From 24961812899d088e94d5cabd46e1af98db9253b1 Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Sat, 11 Jul 2015 14:54:07 +0300 Subject: [PATCH 001/228] 8081297: SSL Problem with Tomcat Reviewed-by: xuelei, jnimeh, ahgross --- .../TlsRsaPremasterSecretGenerator.java | 11 +-- .../TlsRsaPremasterSecretParameterSpec.java | 38 +++++++++++ .../security/ssl/RSAClientKeyExchange.java | 68 +++++++++++++++++-- .../classes/sun/security/util/KeyUtil.java | 9 +-- 4 files changed, 112 insertions(+), 14 deletions(-) diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java index ef2d6351dde..8aa652255de 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java @@ -76,11 +76,14 @@ public final class TlsRsaPremasterSecretGenerator extends KeyGeneratorSpi { "TlsRsaPremasterSecretGenerator must be initialized"); } - if (random == null) { - random = new SecureRandom(); + byte[] b = spec.getEncodedSecret(); + if (b == null) { + if (random == null) { + random = new SecureRandom(); + } + b = new byte[48]; + random.nextBytes(b); } - byte[] b = new byte[48]; - random.nextBytes(b); b[0] = (byte)spec.getMajorVersion(); b[1] = (byte)spec.getMinorVersion(); diff --git a/jdk/src/java.base/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java b/jdk/src/java.base/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java index ad44d4a5452..6a0fe12ed1c 100644 --- a/jdk/src/java.base/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java +++ b/jdk/src/java.base/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java @@ -43,6 +43,8 @@ import java.security.PrivilegedAction; public class TlsRsaPremasterSecretParameterSpec implements AlgorithmParameterSpec { + private final byte[] encodedSecret; + /* * The TLS spec says that the version in the RSA premaster secret must * be the maximum version supported by the client (i.e. the version it @@ -89,6 +91,33 @@ public class TlsRsaPremasterSecretParameterSpec this.clientVersion = checkVersion(clientVersion); this.serverVersion = checkVersion(serverVersion); + this.encodedSecret = null; + } + + /** + * Constructs a new TlsRsaPremasterSecretParameterSpec. + * + * @param clientVersion the version of the TLS protocol by which the + * client wishes to communicate during this session + * @param serverVersion the negotiated version of the TLS protocol which + * contains the lower of that suggested by the client in the client + * hello and the highest supported by the server. + * @param encodedSecret the encoded secret key + * + * @throws IllegalArgumentException if clientVersion or serverVersion are + * negative or larger than (2^16 - 1) or if encodedSecret is not + * exactly 48 bytes + */ + public TlsRsaPremasterSecretParameterSpec( + int clientVersion, int serverVersion, byte[] encodedSecret) { + + this.clientVersion = checkVersion(clientVersion); + this.serverVersion = checkVersion(serverVersion); + if (encodedSecret == null || encodedSecret.length != 48) { + throw new IllegalArgumentException( + "Encoded secret is not exactly 48 bytes"); + } + this.encodedSecret = encodedSecret.clone(); } /** @@ -147,4 +176,13 @@ public class TlsRsaPremasterSecretParameterSpec } return version; } + + /** + * Returns the encoded secret. + * + * @return the encoded secret, may be null if no encoded secret. + */ + public byte[] getEncodedSecret() { + return encodedSecret == null ? null : encodedSecret.clone(); + } } diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java b/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java index f56401e1dbf..9d403db3dae 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java @@ -113,14 +113,41 @@ final class RSAClientKeyExchange extends HandshakeMessage { } } + boolean needFailover = false; + byte[] encoded = null; try { Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1); - cipher.init(Cipher.UNWRAP_MODE, privateKey, - new TlsRsaPremasterSecretParameterSpec( - maxVersion.v, currentVersion.v), - generator); - preMaster = (SecretKey)cipher.unwrap(encrypted, - "TlsRsaPremasterSecret", Cipher.SECRET_KEY); + needFailover = !KeyUtil.isOracleJCEProvider( + cipher.getProvider().getName()); + if (needFailover) { + cipher.init(Cipher.DECRYPT_MODE, privateKey); + encoded = cipher.doFinal(encrypted); + encoded = KeyUtil.checkTlsPreMasterSecretKey( + maxVersion.v, currentVersion.v, + generator, encoded, false); + preMaster = generatePreMasterSecret( + maxVersion.v, currentVersion.v, + encoded, generator); + } else { + cipher.init(Cipher.UNWRAP_MODE, privateKey, + new TlsRsaPremasterSecretParameterSpec( + maxVersion.v, currentVersion.v), + generator); + preMaster = (SecretKey)cipher.unwrap(encrypted, + "TlsRsaPremasterSecret", Cipher.SECRET_KEY); + } + } catch (BadPaddingException bpe) { + if (needFailover) { + encoded = KeyUtil.checkTlsPreMasterSecretKey( + maxVersion.v, currentVersion.v, + generator, null, false); + preMaster = generatePreMasterSecret( + maxVersion.v, currentVersion.v, + encoded, generator); + } else { + // Otherwise, unlikely to happen + throw new RuntimeException("Unexpected exception", bpe); + } } catch (InvalidKeyException ibk) { // the message is too big to process with RSA throw new SSLProtocolException( @@ -135,6 +162,35 @@ final class RSAClientKeyExchange extends HandshakeMessage { } } + // generate a premaster secret with the specified version number + @SuppressWarnings("deprecation") + private static SecretKey generatePreMasterSecret( + int clientVersion, int serverVersion, + byte[] encodedSecret, SecureRandom generator) { + + if (debug != null && Debug.isOn("handshake")) { + System.out.println("Generating a premaster secret"); + } + + try { + String s = ((clientVersion >= ProtocolVersion.TLS12.v) ? + "SunTls12RsaPremasterSecret" : "SunTlsRsaPremasterSecret"); + KeyGenerator kg = JsseJce.getKeyGenerator(s); + kg.init(new TlsRsaPremasterSecretParameterSpec( + clientVersion, serverVersion, encodedSecret), + generator); + return kg.generateKey(); + } catch (InvalidAlgorithmParameterException | + NoSuchAlgorithmException iae) { + // unlikely to happen, otherwise, must be a provider exception + if (debug != null && Debug.isOn("handshake")) { + System.out.println("RSA premaster secret generation error:"); + iae.printStackTrace(System.out); + } + throw new RuntimeException("Could not generate premaster secret", iae); + } + } + @Override int messageType() { return ht_client_key_exchange; diff --git a/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java b/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java index 5e0f58ca2be..1397f3b05e9 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java +++ b/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java @@ -143,8 +143,6 @@ public final class KeyUtil { /** * Returns whether the specified provider is Oracle provider or not. - *

- * Note that this method is only apply to SunJCE and SunPKCS11 at present. * * @param providerName * the provider name @@ -152,8 +150,11 @@ public final class KeyUtil { * {@code providerName} is Oracle provider */ public static final boolean isOracleJCEProvider(String providerName) { - return providerName != null && (providerName.equals("SunJCE") || - providerName.startsWith("SunPKCS11")); + return providerName != null && + (providerName.equals("SunJCE") || + providerName.equals("SunMSCAPI") || + providerName.equals("OracleUcrypto") || + providerName.startsWith("SunPKCS11")); } /** From 72e0832da6dc5aa297503c869e986a74f0a6589d Mon Sep 17 00:00:00 2001 From: Mark Sheppard Date: Wed, 29 Jul 2015 13:42:56 +0100 Subject: [PATCH 002/228] 8059054: Better URL processing Reviewed-by: chegar, rriggs, ahgross, coffeys, igerasim --- .../java.base/share/classes/java/net/URL.java | 241 +++++++++++++++++- 1 file changed, 232 insertions(+), 9 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/net/URL.java b/jdk/src/java.base/share/classes/java/net/URL.java index e8a694116fd..2235a4edd2a 100644 --- a/jdk/src/java.base/share/classes/java/net/URL.java +++ b/jdk/src/java.base/share/classes/java/net/URL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 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 @@ -31,6 +31,10 @@ import java.net.spi.URLStreamHandlerProvider; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Hashtable; +import java.io.InvalidObjectException; +import java.io.ObjectStreamException; +import java.io.ObjectStreamField; +import java.io.ObjectInputStream.GetField; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.ServiceConfigurationError; @@ -142,6 +146,7 @@ import sun.security.util.SecurityConstants; */ public final class URL implements java.io.Serializable { + static final String BUILTIN_HANDLERS_PREFIX = "sun.net.www.protocol"; static final long serialVersionUID = -7627629688361524110L; /** @@ -226,6 +231,8 @@ public final class URL implements java.io.Serializable { */ private int hashCode = -1; + private transient UrlDeserializedState tempState; + /** * Creates a {@code URL} object from the specified * {@code protocol}, {@code host}, {@code port} @@ -1353,6 +1360,31 @@ public final class URL implements java.io.Serializable { return handler; } + /** + * @serialField protocol String + * + * @serialField host String + * + * @serialField port int + * + * @serialField authority String + * + * @serialField file String + * + * @serialField ref String + * + * @serialField hashCode int + * + */ + private static final ObjectStreamField[] serialPersistentFields = { + new ObjectStreamField("protocol", String.class), + new ObjectStreamField("host", String.class), + new ObjectStreamField("port", int.class), + new ObjectStreamField("authority", String.class), + new ObjectStreamField("file", String.class), + new ObjectStreamField("ref", String.class), + new ObjectStreamField("hashCode", int.class), }; + /** * WriteObject is called to save the state of the URL to an * ObjectOutputStream. The handler is not saved since it is @@ -1375,16 +1407,67 @@ public final class URL implements java.io.Serializable { * stream handler. */ private synchronized void readObject(java.io.ObjectInputStream s) - throws IOException, ClassNotFoundException - { - s.defaultReadObject(); // read the fields - if ((handler = getURLStreamHandler(protocol)) == null) { + throws IOException, ClassNotFoundException { + GetField gf = s.readFields(); + String protocol = (String)gf.get("protocol", null); + if (getURLStreamHandler(protocol) == null) { throw new IOException("unknown protocol: " + protocol); } + String host = (String)gf.get("host", null); + int port = gf.get("port", -1); + String authority = (String)gf.get("authority", null); + String file = (String)gf.get("file", null); + String ref = (String)gf.get("ref", null); + int hashCode = gf.get("hashCode", -1); + if (authority == null + && ((host != null && host.length() > 0) || port != -1)) { + if (host == null) + host = ""; + authority = (port == -1) ? host : host + ":" + port; + } + tempState = new UrlDeserializedState(protocol, host, port, authority, + file, ref, hashCode); + } + + /** + * Replaces the de-serialized object with an URL object. + * + * @return a newly created object from deserialized data + * + * @throws ObjectStreamException if a new object replacing this + * object could not be created + */ + + private Object readResolve() throws ObjectStreamException { + + URLStreamHandler handler = null; + // already been checked in readObject + handler = getURLStreamHandler(tempState.getProtocol()); + + URL replacementURL = null; + if (isBuiltinStreamHandler(handler.getClass().getName())) { + replacementURL = fabricateNewURL(); + } else { + replacementURL = setDeserializedFields(handler); + } + return replacementURL; + } + + private URL setDeserializedFields(URLStreamHandler handler) { + URL replacementURL; + String userInfo = null; + String protocol = tempState.getProtocol(); + String host = tempState.getHost(); + int port = tempState.getPort(); + String authority = tempState.getAuthority(); + String file = tempState.getFile(); + String ref = tempState.getRef(); + int hashCode = tempState.getHashCode(); + // Construct authority part - if (authority == null && - ((host != null && host.length() > 0) || port != -1)) { + if (authority == null + && ((host != null && host.length() > 0) || port != -1)) { if (host == null) host = ""; authority = (port == -1) ? host : host + ":" + port; @@ -1403,8 +1486,8 @@ public final class URL implements java.io.Serializable { } // Construct path and query part - path = null; - query = null; + String path = null; + String query = null; if (file != null) { // Fix: only do this if hierarchical? int q = file.lastIndexOf('?'); @@ -1414,6 +1497,67 @@ public final class URL implements java.io.Serializable { } else path = file; } + + if (port == -1) { + port = 0; + } + // Set the object fields. + this.protocol = protocol; + this.host = host; + this.port = port; + this.file = file; + this.authority = authority; + this.ref = ref; + this.hashCode = hashCode; + this.handler = handler; + this.query = query; + this.path = path; + this.userInfo = userInfo; + replacementURL = this; + return replacementURL; + } + + private URL fabricateNewURL() + throws InvalidObjectException { + // create URL string from deserialized object + URL replacementURL = null; + String urlString = tempState.reconstituteUrlString(); + + try { + replacementURL = new URL(urlString); + } catch (MalformedURLException mEx) { + resetState(); + InvalidObjectException invoEx = new InvalidObjectException( + "Malformed URL: " + urlString); + invoEx.initCause(mEx); + throw invoEx; + } + replacementURL.setSerializedHashCode(tempState.getHashCode()); + resetState(); + return replacementURL; + } + + private boolean isBuiltinStreamHandler(String handlerClassName) { + return (handlerClassName.startsWith(BUILTIN_HANDLERS_PREFIX)); + } + + private void resetState() { + this.protocol = null; + this.host = null; + this.port = -1; + this.file = null; + this.authority = null; + this.ref = null; + this.hashCode = -1; + this.handler = null; + this.query = null; + this.path = null; + this.userInfo = null; + this.tempState = null; + } + + private void setSerializedHashCode(int hc) { + this.hashCode = hc; } } @@ -1445,3 +1589,82 @@ class Parts { return ref; } } + +final class UrlDeserializedState { + private final String protocol; + private final String host; + private final int port; + private final String authority; + private final String file; + private final String ref; + private final int hashCode; + + public UrlDeserializedState(String protocol, + String host, int port, + String authority, String file, + String ref, int hashCode) { + this.protocol = protocol; + this.host = host; + this.port = port; + this.authority = authority; + this.file = file; + this.ref = ref; + this.hashCode = hashCode; + } + + String getProtocol() { + return protocol; + } + + String getHost() { + return host; + } + + String getAuthority () { + return authority; + } + + int getPort() { + return port; + } + + String getFile () { + return file; + } + + String getRef () { + return ref; + } + + int getHashCode () { + return hashCode; + } + + String reconstituteUrlString() { + + // pre-compute length of StringBuffer + int len = protocol.length() + 1; + if (authority != null && authority.length() > 0) + len += 2 + authority.length(); + if (file != null) { + len += file.length(); + } + if (ref != null) + len += 1 + ref.length(); + StringBuilder result = new StringBuilder(len); + result.append(protocol); + result.append(":"); + if (authority != null && authority.length() > 0) { + result.append("//"); + result.append(authority); + } + if (file != null) { + result.append(file); + } + if (ref != null) { + result.append("#"); + result.append(ref); + } + return result.toString(); + } +} From 3b45c076803b4a718dae6fe9b58c5dc18682677e Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Mon, 3 Aug 2015 12:18:10 +0300 Subject: [PATCH 003/228] 8132209: DiagnosticCommandImpl.getNotificationInfo() may expose internal representation DiagnosticCommandImpl.getNotificationInfo() may expose internal representation Reviewed-by: skoivu, fparain, jbachorik --- .../com/sun/management/internal/DiagnosticCommandImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/internal/DiagnosticCommandImpl.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/DiagnosticCommandImpl.java index a0718a3c2f3..5e149633dcd 100644 --- a/jdk/src/jdk.management/share/classes/com/sun/management/internal/DiagnosticCommandImpl.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/DiagnosticCommandImpl.java @@ -343,7 +343,7 @@ public class DiagnosticCommandImpl extends NotificationEmitterSupport "Diagnostic Framework Notification"); } } - return notifInfo; + return notifInfo.clone(); } private static long seqNumber = 0; From be335f3af5dabdc0d7d01b551f8704e1f975442b Mon Sep 17 00:00:00 2001 From: Shanliang Jiang Date: Thu, 3 Sep 2015 09:33:04 +0200 Subject: [PATCH 004/228] 8130710: Better attributes processing Reviewed-by: jbachorik, dfuchs, ahgross --- .../remote/rmi/RMIConnectionImpl.java | 7 ++--- .../management/remote/rmi/RMIConnector.java | 29 ++++++++++++------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java index dd050e4ef9c..c37e3e9af12 100644 --- a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java +++ b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java @@ -359,7 +359,6 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced { "connectionId=" + connectionId +", className=" + className +", name=" + name - +", params=" + objects(values) +", signature=" + strings(signature)); return (ObjectInstance) @@ -425,7 +424,6 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced { +", className=" + className +", name=" + name +", loaderName=" + loaderName - +", params=" + objects(values) +", signature=" + strings(signature)); return (ObjectInstance) @@ -717,7 +715,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced { if (debug) logger.debug("setAttribute", "connectionId=" + connectionId +", name="+name - +", attribute="+attr); + +", attribute name="+attr.getName()); doPrivilegedOperation( SET_ATTRIBUTE, @@ -768,7 +766,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced { if (debug) logger.debug("setAttributes", "connectionId=" + connectionId +", name="+name - +", attributes="+attrlist); + +", attribute names="+RMIConnector.getAttributesNames(attrlist)); return (AttributeList) doPrivilegedOperation( @@ -823,7 +821,6 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced { "connectionId=" + connectionId +", name="+name +", operationName="+operationName - +", params="+objects(values) +", signature="+strings(signature)); return diff --git a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java index 4bd796e3e7a..bb4057db54a 100644 --- a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java +++ b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java @@ -65,6 +65,7 @@ import java.util.Hashtable; import java.util.Map; import java.util.Set; import java.util.WeakHashMap; +import java.util.stream.Collectors; import javax.management.Attribute; import javax.management.AttributeList; import javax.management.AttributeNotFoundException; @@ -689,9 +690,7 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable if (logger.debugOn()) logger.debug("createMBean(String,ObjectName,Object[],String[])", "className=" + className + ", name=" - + name + ", params=" - + objects(params) + ", signature=" - + strings(signature)); + + name + ", signature=" + strings(signature)); final MarshalledObject sParams = new MarshalledObject(params); @@ -730,8 +729,7 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable if (logger.debugOn()) logger.debug( "createMBean(String,ObjectName,ObjectName,Object[],String[])", "className=" + className + ", name=" + name + ", loaderName=" - + loaderName + ", params=" + objects(params) - + ", signature=" + strings(signature)); + + loaderName + ", signature=" + strings(signature)); final MarshalledObject sParams = new MarshalledObject(params); @@ -931,8 +929,8 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable IOException { if (logger.debugOn()) logger.debug("setAttribute", - "name=" + name + ", attribute=" - + attribute); + "name=" + name + ", attribute name=" + + attribute.getName()); final MarshalledObject sAttribute = new MarshalledObject(attribute); @@ -954,9 +952,11 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable ReflectionException, IOException { - if (logger.debugOn()) logger.debug("setAttributes", - "name=" + name + ", attributes=" - + attributes); + if (logger.debugOn()) { + logger.debug("setAttributes", + "name=" + name + ", attribute names=" + + getAttributesNames(attributes)); + } final MarshalledObject sAttributes = new MarshalledObject(attributes); @@ -989,7 +989,6 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable if (logger.debugOn()) logger.debug("invoke", "name=" + name + ", operationName=" + operationName - + ", params=" + objects(params) + ", signature=" + strings(signature)); final MarshalledObject sParams = @@ -2246,4 +2245,12 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable private static String strings(final String[] strs) { return objects(strs); } + + static String getAttributesNames(AttributeList attributes) { + return attributes != null ? + attributes.asList().stream() + .map(Attribute::getName) + .collect(Collectors.joining("[", ", ", "]")) + : "[]"; + } } From 3febcc8b758771cd37151fa4b7137d70c731536b Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Mon, 7 Sep 2015 18:58:41 +0300 Subject: [PATCH 005/228] 8074068: Cleanup in java.base/share/classes/sun/security/x509/ Reviewed-by: mullan, ahgross, coffeys --- .../sun/security/x509/AlgorithmId.java | 2 +- .../x509/CRLDistributionPointsExtension.java | 8 +++-- .../sun/security/x509/CRLNumberExtension.java | 7 ++-- .../classes/sun/security/x509/DNSName.java | 12 +++---- .../sun/security/x509/EDIPartyName.java | 2 +- .../sun/security/x509/GeneralSubtrees.java | 2 +- .../sun/security/x509/IPAddressName.java | 20 ++++++----- .../IssuingDistributionPointExtension.java | 2 +- .../sun/security/x509/KeyIdentifier.java | 4 +-- .../x509/PolicyMappingsExtension.java | 2 +- .../x509/PrivateKeyUsageExtension.java | 6 ++-- .../share/classes/sun/security/x509/RDN.java | 34 +++++++------------ .../x509/SubjectInfoAccessExtension.java | 4 ++- .../classes/sun/security/x509/URIName.java | 2 +- .../classes/sun/security/x509/X500Name.java | 13 +++---- .../sun/security/x509/X509AttributeName.java | 2 +- .../sun/security/x509/X509CRLImpl.java | 8 ++--- .../sun/security/x509/X509CertImpl.java | 4 +-- 18 files changed, 60 insertions(+), 74 deletions(-) diff --git a/jdk/src/java.base/share/classes/sun/security/x509/AlgorithmId.java b/jdk/src/java.base/share/classes/sun/security/x509/AlgorithmId.java index f84371da80e..60b0b922190 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/AlgorithmId.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/AlgorithmId.java @@ -588,7 +588,7 @@ public class AlgorithmId implements Serializable, DerEncoder { } if (oidTable == null) { - oidTable = new HashMap<>(1); + oidTable = Collections.emptyMap(); } initOidTable = true; } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java index d60f7f13079..cb7f106e685 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.io.OutputStream; import java.util.*; +import java.util.Collections; import sun.security.util.DerOutputStream; import sun.security.util.DerValue; @@ -255,11 +256,12 @@ public class CRLDistributionPointsExtension extends Extension */ public void delete(String name) throws IOException { if (name.equalsIgnoreCase(POINTS)) { - distributionPoints = new ArrayList(); + distributionPoints = + Collections.emptyList(); } else { throw new IOException("Attribute name [" + name + - "] not recognized by " + - "CertAttrSet:" + extensionName + "."); + "] not recognized by " + + "CertAttrSet:" + extensionName + '.'); } encodeThis(); } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java index 7a66f0b935f..9434e613441 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java @@ -157,11 +157,10 @@ implements CertAttrSet { */ public BigInteger get(String name) throws IOException { if (name.equalsIgnoreCase(NUMBER)) { - if (crlNumber == null) return null; - else return crlNumber; + return crlNumber; } else { - throw new IOException("Attribute name not recognized by" - + " CertAttrSet:" + extensionName + "."); + throw new IOException("Attribute name not recognized by" + + " CertAttrSet:" + extensionName + '.'); } } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/DNSName.java b/jdk/src/java.base/share/classes/sun/security/x509/DNSName.java index 449d7550043..c9aa54aa73e 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/DNSName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/DNSName.java @@ -232,15 +232,15 @@ public class DNSName implements GeneralNameInterface { * @throws UnsupportedOperationException if not supported for this name type */ public int subtreeDepth() throws UnsupportedOperationException { - String subtree=name; - int i=1; + // subtree depth is always at least 1 + int sum = 1; - /* count dots */ - for (; subtree.lastIndexOf('.') >= 0; i++) { - subtree=subtree.substring(0,subtree.lastIndexOf('.')); + // count dots + for (int i = name.indexOf('.'); i >= 0; i = name.indexOf('.', i + 1)) { + ++sum; } - return i; + return sum; } } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java b/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java index 74c0e4df7d4..2ba0b56ad6f 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java @@ -197,7 +197,7 @@ public class EDIPartyName implements GeneralNameInterface { */ public int hashCode() { if (myhash == -1) { - myhash = 37 + party.hashCode(); + myhash = 37 + (party == null ? 1 : party.hashCode()); if (assigner != null) { myhash = 37 * myhash + assigner.hashCode(); } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java b/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java index 5a1f8c7de65..847f56aba86 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java @@ -189,7 +189,7 @@ public class GeneralSubtrees implements Cloneable { // the list: if any subsequent entry matches or widens entry n, // remove entry n. If any subsequent entries narrow entry n, remove // the subsequent entries. - for (int i = 0; i < size(); i++) { + for (int i = 0; i < (size() - 1); i++) { GeneralNameInterface current = getGeneralNameInterface(i); boolean remove1 = false; diff --git a/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java b/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java index c94df301bcb..50f045758be 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java @@ -197,8 +197,10 @@ public class IPAddressName implements GeneralNameInterface { // append a mask corresponding to the num of prefix bits specified int prefixLen = Integer.parseInt(name.substring(slashNdx+1)); - if (prefixLen > 128) - throw new IOException("IPv6Address prefix is longer than 128"); + if (prefixLen < 0 || prefixLen > 128) { + throw new IOException("IPv6Address prefix length (" + + prefixLen + ") in out of valid range [0,128]"); + } // create new bit array initialized to zeros BitArray bitArray = new BitArray(MASKSIZE * 8); @@ -317,7 +319,8 @@ public class IPAddressName implements GeneralNameInterface { if (!(obj instanceof IPAddressName)) return false; - byte[] other = ((IPAddressName)obj).getBytes(); + IPAddressName otherName = (IPAddressName)obj; + byte[] other = otherName.address; if (other.length != address.length) return false; @@ -326,12 +329,10 @@ public class IPAddressName implements GeneralNameInterface { // Two subnet addresses // Mask each and compare masked values int maskLen = address.length/2; - byte[] maskedThis = new byte[maskLen]; - byte[] maskedOther = new byte[maskLen]; for (int i=0; i < maskLen; i++) { - maskedThis[i] = (byte)(address[i] & address[i+maskLen]); - maskedOther[i] = (byte)(other[i] & other[i+maskLen]); - if (maskedThis[i] != maskedOther[i]) { + byte maskedThis = (byte)(address[i] & address[i+maskLen]); + byte maskedOther = (byte)(other[i] & other[i+maskLen]); + if (maskedThis != maskedOther) { return false; } } @@ -400,7 +401,8 @@ public class IPAddressName implements GeneralNameInterface { else if (((IPAddressName)inputName).equals(this)) constraintType = NAME_MATCH; else { - byte[] otherAddress = ((IPAddressName)inputName).getBytes(); + IPAddressName otherName = (IPAddressName)inputName; + byte[] otherAddress = otherName.address; if (otherAddress.length == 4 && address.length == 4) // Two host addresses constraintType = NAME_SAME_TYPE; diff --git a/jdk/src/java.base/share/classes/sun/security/x509/IssuingDistributionPointExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/IssuingDistributionPointExtension.java index 26dd18a352b..580225859b9 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/IssuingDistributionPointExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/IssuingDistributionPointExtension.java @@ -261,6 +261,7 @@ public class IssuingDistributionPointExtension extends Extension throw new IOException( "Attribute value should be of type ReasonFlags."); } + revocationReasons = (ReasonFlags)obj; } else if (name.equalsIgnoreCase(INDIRECT_CRL)) { if (!(obj instanceof Boolean)) { @@ -290,7 +291,6 @@ public class IssuingDistributionPointExtension extends Extension } hasOnlyAttributeCerts = ((Boolean)obj).booleanValue(); - } else { throw new IOException("Attribute name [" + name + "] not recognized by " + diff --git a/jdk/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java b/jdk/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java index 74139a4f6b5..97036e2ea88 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java @@ -148,7 +148,7 @@ public class KeyIdentifier { return true; if (!(other instanceof KeyIdentifier)) return false; - return java.util.Arrays.equals(octetString, - ((KeyIdentifier)other).getIdentifier()); + byte[] otherString = ((KeyIdentifier)other).octetString; + return java.util.Arrays.equals(octetString, otherString); } } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/PolicyMappingsExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/PolicyMappingsExtension.java index 175201c732b..ed931a2119b 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/PolicyMappingsExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/PolicyMappingsExtension.java @@ -102,7 +102,7 @@ implements CertAttrSet { public PolicyMappingsExtension() { extensionId = PKIXExtensions.PolicyMappings_Id; critical = true; - maps = new ArrayList(); + maps = Collections.emptyList(); } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java index 0cb40155025..afb08b1a68e 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java @@ -33,6 +33,7 @@ import java.security.cert.CertificateExpiredException; import java.security.cert.CertificateNotYetValidException; import java.util.Date; import java.util.Enumeration; +import java.util.Objects; import sun.security.util.*; @@ -217,16 +218,17 @@ implements CertAttrSet { */ public void valid(Date now) throws CertificateNotYetValidException, CertificateExpiredException { + Objects.requireNonNull(now); /* * we use the internal Dates rather than the passed in Date * because someone could override the Date methods after() * and before() to do something entirely different. */ - if (notBefore.after(now)) { + if (notBefore != null && notBefore.after(now)) { throw new CertificateNotYetValidException("NotBefore: " + notBefore.toString()); } - if (notAfter.before(now)) { + if (notAfter != null && notAfter.before(now)) { throw new CertificateExpiredException("NotAfter: " + notAfter.toString()); } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/RDN.java b/jdk/src/java.base/share/classes/sun/security/x509/RDN.java index 6e927c4a340..2ee060930db 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/RDN.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/RDN.java @@ -27,6 +27,8 @@ package sun.security.x509; import java.io.IOException; import java.io.StringReader; +import java.util.Arrays; +import java.util.StringJoiner; import java.util.*; import sun.security.util.*; @@ -436,31 +438,19 @@ public class RDN { assertion[0].toRFC2253String(oidMap); } - StringBuilder relname = new StringBuilder(); - if (!canonical) { - for (int i = 0; i < assertion.length; i++) { - if (i > 0) { - relname.append('+'); - } - relname.append(assertion[i].toRFC2253String(oidMap)); - } - } else { + AVA[] toOutput = assertion; + if (canonical) { // order the string type AVA's alphabetically, // followed by the oid type AVA's numerically - List avaList = new ArrayList<>(assertion.length); - for (int i = 0; i < assertion.length; i++) { - avaList.add(assertion[i]); - } - java.util.Collections.sort(avaList, AVAComparator.getInstance()); - - for (int i = 0; i < avaList.size(); i++) { - if (i > 0) { - relname.append('+'); - } - relname.append(avaList.get(i).toRFC2253CanonicalString()); - } + toOutput = assertion.clone(); + Arrays.sort(toOutput, AVAComparator.getInstance()); } - return relname.toString(); + StringJoiner sj = new StringJoiner("+"); + for (AVA ava : toOutput) { + sj.add(canonical ? ava.toRFC2253CanonicalString() + : ava.toRFC2253String(oidMap)); + } + return sj.toString(); } } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java index 8daa0b319b4..0acdf96057f 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java @@ -28,6 +28,7 @@ package sun.security.x509; import java.io.IOException; import java.io.OutputStream; +import java.util.Collections; import java.util.*; import sun.security.util.DerOutputStream; @@ -200,7 +201,8 @@ public class SubjectInfoAccessExtension extends Extension */ public void delete(String name) throws IOException { if (name.equalsIgnoreCase(DESCRIPTIONS)) { - accessDescriptions = new ArrayList(); + accessDescriptions = + Collections.emptyList(); } else { throw new IOException("Attribute name [" + name + "] not recognized by " + diff --git a/jdk/src/java.base/share/classes/sun/security/x509/URIName.java b/jdk/src/java.base/share/classes/sun/security/x509/URIName.java index 2f3e107ef0b..878d745a881 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/URIName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/URIName.java @@ -165,7 +165,7 @@ public class URIName implements GeneralNameInterface { String host = uri.getSchemeSpecificPart(); try { DNSName hostDNS; - if (host.charAt(0) == '.') { + if (host.startsWith(".")) { hostDNS = new DNSName(host.substring(1)); } else { hostDNS = new DNSName(host); diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java b/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java index 740b7fed538..07f0aedf8e8 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java @@ -347,6 +347,8 @@ public class X500Name implements GeneralNameInterface, Principal { for (int i = 0; i < names.length; i++) { list.addAll(names[i].avas()); } + list = Collections.unmodifiableList(list); + allAvaList = list; } return list; } @@ -365,9 +367,6 @@ public class X500Name implements GeneralNameInterface, Principal { */ public boolean isEmpty() { int n = names.length; - if (n == 0) { - return true; - } for (int i = 0; i < n; i++) { if (names[i].assertion.length != 0) { return false; @@ -1103,12 +1102,8 @@ public class X500Name implements GeneralNameInterface, Principal { * and speed recognition of common X.500 attributes. */ static ObjectIdentifier intern(ObjectIdentifier oid) { - ObjectIdentifier interned = internedOIDs.get(oid); - if (interned != null) { - return interned; - } - internedOIDs.put(oid, oid); - return oid; + ObjectIdentifier interned = internedOIDs.putIfAbsent(oid, oid); + return (interned == null) ? oid : interned; } private static final Map internedOIDs diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X509AttributeName.java b/jdk/src/java.base/share/classes/sun/security/x509/X509AttributeName.java index 090792aa2e9..c60b6f46010 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X509AttributeName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X509AttributeName.java @@ -47,7 +47,7 @@ public class X509AttributeName { */ public X509AttributeName(String name) { int i = name.indexOf(SEPARATOR); - if (i == (-1)) { + if (i < 0) { prefix = name; } else { prefix = name.substring(0, i); diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java index 812778c02c0..1fc5bed4c83 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java @@ -762,9 +762,7 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { public byte[] getTBSCertList() throws CRLException { if (tbsCertList == null) throw new CRLException("Uninitialized CRL"); - byte[] dup = new byte[tbsCertList.length]; - System.arraycopy(tbsCertList, 0, dup, 0, dup.length); - return dup; + return tbsCertList.clone(); } /** @@ -775,9 +773,7 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { public byte[] getSignature() { if (signature == null) return null; - byte[] dup = new byte[signature.length]; - System.arraycopy(signature, 0, dup, 0, dup.length); - return dup; + return signature.clone(); } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java b/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java index cc15fb23414..0e4da831a83 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java @@ -1001,9 +1001,7 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { public byte[] getSignature() { if (signature == null) return null; - byte[] dup = new byte[signature.length]; - System.arraycopy(signature, 0, dup, 0, dup.length); - return dup; + return signature.clone(); } /** From c05fa375933253976ca5586022250f01019034ee Mon Sep 17 00:00:00 2001 From: Shanliang Jiang Date: Tue, 8 Sep 2015 08:34:35 +0200 Subject: [PATCH 006/228] 8132210: Reinforce JMX collector internals Reviewed-by: jbachorik, ahgross --- .../internal/GarbageCollectorExtImpl.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectorExtImpl.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectorExtImpl.java index 8e0512dde5f..fde7a0070df 100644 --- a/jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectorExtImpl.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectorExtImpl.java @@ -81,17 +81,12 @@ public class GarbageCollectorExtImpl extends GarbageCollectorImpl GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION }; - private MBeanNotificationInfo[] notifInfo = null; public MBeanNotificationInfo[] getNotificationInfo() { - synchronized (this) { - if (notifInfo == null) { - notifInfo = new MBeanNotificationInfo[1]; - notifInfo[0] = new MBeanNotificationInfo(gcNotifTypes, - notifName, - "GC Notification"); - } - } - return notifInfo; + return new MBeanNotificationInfo[]{ + new MBeanNotificationInfo(gcNotifTypes, + notifName, + "GC Notification") + }; } private static long seqNumber = 0; From a59ce6689f8b782d2f13f6b0f2d29effff6f715b Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Tue, 24 Nov 2015 21:32:46 +0300 Subject: [PATCH 007/228] 8132961: JEP 279: Improve Test-Failure Troubleshooting Co-authored-by: Kirill Shirokov Co-authored-by: Dmitry Fazunenko Co-authored-by: Kirill Zhaldybin Reviewed-by: lmesnik, sla --- test/failure_handler/Makefile | 114 ++++++ test/failure_handler/README | 107 ++++++ .../failurehandler/ElapsedTimePrinter.java | 48 +++ .../EnvironmentInfoGatherer.java | 28 ++ .../test/failurehandler/GathererFactory.java | 63 +++ .../jdk/test/failurehandler/HtmlPage.java | 47 +++ .../jdk/test/failurehandler/HtmlSection.java | 237 ++++++++++++ .../failurehandler/ProcessInfoGatherer.java | 28 ++ .../jdk/test/failurehandler/Stopwatch.java | 73 ++++ .../jdk/test/failurehandler/ToolKit.java | 72 ++++ .../jdk/test/failurehandler/Utils.java | 88 +++++ .../test/failurehandler/action/Action.java | 33 ++ .../failurehandler/action/ActionHelper.java | 360 ++++++++++++++++++ .../action/ActionParameters.java | 47 +++ .../test/failurehandler/action/ActionSet.java | 126 ++++++ .../failurehandler/action/PatternAction.java | 79 ++++ .../failurehandler/action/SimpleAction.java | 86 +++++ .../jtreg/GatherDiagnosticInfoObserver.java | 153 ++++++++ .../GatherProcessInfoTimeoutHandler.java | 144 +++++++ .../failurehandler/value/ArrayParser.java | 53 +++ .../failurehandler/value/DefaultParser.java | 120 ++++++ .../failurehandler/value/DefaultValue.java | 35 ++ .../value/InvalidValueException.java | 40 ++ .../failurehandler/value/PathValueParser.java | 36 ++ .../test/failurehandler/value/SubValues.java | 35 ++ .../jdk/test/failurehandler/value/Value.java | 36 ++ .../failurehandler/value/ValueHandler.java | 122 ++++++ .../failurehandler/value/ValueParser.java | 28 ++ .../src/share/conf/common.properties | 74 ++++ .../src/share/conf/linux.properties | 110 ++++++ .../src/share/conf/mac.properties | 98 +++++ .../src/share/conf/solaris.properties | 111 ++++++ .../src/share/conf/windows.properties | 115 ++++++ .../jtreg/GatherProcessInfoTimeoutHandler.c | 37 ++ test/failure_handler/test/TEST.ROOT | 0 test/failure_handler/test/sanity/Crash.java | 39 ++ .../failure_handler/test/sanity/Deadlock.java | 63 +++ .../failure_handler/test/sanity/Livelock.java | 55 +++ test/failure_handler/test/sanity/OOME.java | 49 +++ test/failure_handler/test/sanity/Suicide.java | 55 +++ .../test/sanity/SystemExit.java | 32 ++ .../test/sanity/ThrowError.java | 31 ++ .../test/sanity/WaitForDeadlock.java | 44 +++ .../value/DefaultParserTest.java | 118 ++++++ .../value/ValueHandlerTest.java | 110 ++++++ 45 files changed, 3579 insertions(+) create mode 100644 test/failure_handler/Makefile create mode 100644 test/failure_handler/README create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/ElapsedTimePrinter.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/EnvironmentInfoGatherer.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/GathererFactory.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlPage.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlSection.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/ProcessInfoGatherer.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/Stopwatch.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/ToolKit.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/Utils.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/action/Action.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionHelper.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionParameters.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionSet.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/action/PatternAction.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/action/SimpleAction.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ArrayParser.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultParser.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultValue.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/InvalidValueException.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/PathValueParser.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/SubValues.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/Value.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueHandler.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueParser.java create mode 100644 test/failure_handler/src/share/conf/common.properties create mode 100644 test/failure_handler/src/share/conf/linux.properties create mode 100644 test/failure_handler/src/share/conf/mac.properties create mode 100644 test/failure_handler/src/share/conf/solaris.properties create mode 100644 test/failure_handler/src/share/conf/windows.properties create mode 100644 test/failure_handler/src/windows/native/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.c create mode 100644 test/failure_handler/test/TEST.ROOT create mode 100644 test/failure_handler/test/sanity/Crash.java create mode 100644 test/failure_handler/test/sanity/Deadlock.java create mode 100644 test/failure_handler/test/sanity/Livelock.java create mode 100644 test/failure_handler/test/sanity/OOME.java create mode 100644 test/failure_handler/test/sanity/Suicide.java create mode 100644 test/failure_handler/test/sanity/SystemExit.java create mode 100644 test/failure_handler/test/sanity/ThrowError.java create mode 100644 test/failure_handler/test/sanity/WaitForDeadlock.java create mode 100644 test/failure_handler/test/unit/jdk/test/failurehandler/value/DefaultParserTest.java create mode 100644 test/failure_handler/test/unit/jdk/test/failurehandler/value/ValueHandlerTest.java diff --git a/test/failure_handler/Makefile b/test/failure_handler/Makefile new file mode 100644 index 00000000000..00f34c26511 --- /dev/null +++ b/test/failure_handler/Makefile @@ -0,0 +1,114 @@ +# +# 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. +# + +# +# This is a temporary standalone makefile +# + +BUILD_DIR := $(shell pwd)/build +CLASSES_DIR := ${BUILD_DIR}/classes +IMAGE_DIR := ${BUILD_DIR}/image +RUN_DIR := $(shell pwd)/run + +SRC_DIR := src/share/classes/ +SOURCES := ${SRC_DIR}/jdk/test/failurehandler/*.java \ + ${SRC_DIR}/jdk/test/failurehandler/action/*.java \ + ${SRC_DIR}/jdk/test/failurehandler/jtreg/*.java \ + ${SRC_DIR}/jdk/test/failurehandler/value/*.java + +CONF_DIR = src/share/conf + +JAVA_RELEASE = 7 + +TARGET_JAR = ${IMAGE_DIR}/lib/jtregFailureHandler.jar + +OS_NAME := $(shell uname -o 2>&1) + +ifeq ("${OS_NAME}", "Cygwin") +BUILD_DIR := $(shell cygpath -m "${BUILD_DIR}") +CLASSES_DIR := $(shell cygpath -m "${CLASSES_DIR}") +IMAGE_DIR := $(shell cygpath -m "${IMAGE_DIR}") RUN_DIR := $(shell cygpath -m "${RUN_DIR}") +SRC_DIR := $(shell cygpath -m "${SRC_DIR}") +JTREG_HOME := $(shell cygpath -m "${JTREG_HOME}") +CC := "cl.exe" +endif + +all: clean test + +native: require_env +ifeq ("${OS_NAME}", "Cygwin") + "${CC}" src/windows/native/jdk/test/failurehandler/jtreg/*.c \ + -I"$(shell cygpath -w ${JAVA_HOME}/include)" \ + -I"$(shell cygpath -w ${JAVA_HOME}/include/win32)" \ + /link /MACHINE:X64 /DLL /OUT:timeoutHandler.dll +endif + +check_defined = $(foreach 1,$1,$(__check_defined)) +__check_defined = $(if $(value $1),, $(error $1 is not set)) + +classes: require_env + mkdir -p ${IMAGE_DIR}/bin ${IMAGE_DIR}/lib ${CLASSES_DIR} + "${JAVA_HOME}"/bin/javac -target ${JAVA_RELEASE} -source ${JAVA_RELEASE} \ + -sourcepath $(shell pwd) \ + -classpath ${JTREG_HOME}/lib/jtreg.jar:${JAVA_HOME}/lib/tools.jar \ + -d ${CLASSES_DIR} \ + ${SOURCES} + "${JAVA_HOME}"/bin/jar cf ${TARGET_JAR} -C ${CLASSES_DIR} . + "${JAVA_HOME}"/bin/jar uf ${TARGET_JAR} -C ${CONF_DIR} . + +# +# Use JTREG_TEST_OPTS for test VM options +# Use JTREG_TESTS for jtreg tests parameter +# +test: require_env build + rm -rf ${RUN_DIR} + mkdir -p ${RUN_DIR} + "${JTREG_HOME}"/bin/jtreg \ + -jdk:"${JAVA_HOME}" \ + ${JTREG_TEST_OPTS} \ + -timeout:0.1 -va -retain:all \ + -noreport \ + -agentvm \ + -thd:"${TARGET_JAR}" \ + -th:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \ + -od:"${TARGET_JAR}" \ + -o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \ + -w:${RUN_DIR}/JTwork -r:${RUN_DIR}/JTreport \ + $(if ${JTREG_TESTS}, ${JTREG_TESTS}, test) \ + && false || true + +debug: JTREG_TEST_OPTS += "-J-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005'" +debug: test + +require_env: + $(call check_defined, JAVA_HOME) + $(call check_defined, JTREG_HOME) + +clean: + rm -rf "${BUILD_DIR}" "${RUN_DIR}" + +build: classes native + +.PHONY: all build classes native test require_env clean +.DEFAULT: all + diff --git a/test/failure_handler/README b/test/failure_handler/README new file mode 100644 index 00000000000..ca3e72705d2 --- /dev/null +++ b/test/failure_handler/README @@ -0,0 +1,107 @@ +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. + + + +DESCRIPTION + +The purpose of this library is gathering diagnostic information on test +failures and timeouts. The library runs platform specific tools, which are +configured in the way described below. The collected data will be available +in HTML format next to JTR files. + +The library uses JTHarness Observer and jtreg TimeoutHandler extensions points. + +DEPENDENCES + +The library requires jtreg 4b13+ and JDK 7+. + +BUILDING + +To build a library, one should simply run make with 'JTREG_HOME' and +'JAVA_HOME' environment variables set. 'JAVA_HOME' should contain path to JDK, +'JTREG_HOME' -- path to jtreg. + +'image/lib/jtregFailureHandler.jar' is created on successful build. + +CONFIGURATION + +Properties files are used to configure the library. They define which actions +to be performed in case of individual test failure or timeout. Each platform +family uses its own property file (named '.properties'). For platform +independent actions, 'common.properties' is used. + +Actions to be performed on each failure are listed in 'environment' property. +Extra actions for timeouts are listed in 'onTimeout'. + +Each action is defined via the following parameters: + - 'javaOnly' -- run the action only for java applications, false by default + - 'app' -- an application to run, mandatory parameter + - 'args' -- application command line arguments, none by default + - 'params' -- a structure which defines how an application should be run, + described below + +Actions listed in 'onTimeout' are "patterned" actions. Besides the parameters +listed above, they also have 'pattern' parameter -- a string which will be +replaced by PID in 'args' parameter before action execution. + +'params' structure has the following parameters: + - repeat -- how many times an action will be run, 1 by default + - pause -- delay in ms between iterations, 500 by default + - timeout -- time limitation for iteration in ms, 20 000 by default + - stopOnError -- if true, an action will be interrupted after the first error, + false by default + +From '.properties', the library reads the following parameters + - 'config.execSuffix' -- a suffix for all binary application file names + - 'config.getChildren' -- a "patterned" action used to get the list of all + children + +For simplicity we use parameter values inheritance. This means that we are +looking for the most specified parameter value. If we do not find it, we are +trying to find less specific value by reducing prefix. +For example, if properties contains 'p1=A', 'a.p1=B', 'a.b.p1=C', then +parameter 'p1' will be: + - 'C' for 'a.b.c' + - 'B' for 'a.c' + - 'A' for 'b.c' + +RUNNING + +To enable the library in jtreg, the following options should be set: + - '-timeoutHandlerDir' points to the built jar ('jtregFailureHandler.jar') + - '-observerDir' points to the built jar + - '-timeoutHandler' equals to jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler + - '-observer' equals to jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver + +In case of environment issues during an action execution, such as missing +application, hung application, lack of disk space, etc, the corresponding +warning appears and the library proceeds to next action. + +EXAMPLES + +$ ${JTREG_HOME}/bin/jtreg -jdk:${JAVA_HOME} \ + -timeoutHandlerDir:./image/lib/jtregFailureHandler.jar \ + -observerDir:./image/lib/jtregFailureHandler.jar \ + -timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler\ + -observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \ + ${WS}/hotspot/test/ + diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/ElapsedTimePrinter.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ElapsedTimePrinter.java new file mode 100644 index 00000000000..f1ab374d22c --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ElapsedTimePrinter.java @@ -0,0 +1,48 @@ +/* + * 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. + */ + +package jdk.test.failurehandler; + +import java.io.PrintWriter; +import java.util.concurrent.TimeUnit; + +public class ElapsedTimePrinter implements AutoCloseable { + private final String name; + private final PrintWriter out; + private final Stopwatch stopwatch; + + public ElapsedTimePrinter(Stopwatch stopwatch, String name, + PrintWriter out) { + this.stopwatch = stopwatch; + this.name = name; + this.out = out; + stopwatch.start(); + } + + @Override + public void close() { + stopwatch.stop(); + out.printf("%s took %d s%n", name, + TimeUnit.NANOSECONDS.toSeconds(stopwatch.getElapsedTimeNs())); + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/EnvironmentInfoGatherer.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/EnvironmentInfoGatherer.java new file mode 100644 index 00000000000..e2b9510ed76 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/EnvironmentInfoGatherer.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package jdk.test.failurehandler; + +public interface EnvironmentInfoGatherer { + void gatherEnvironmentInfo(HtmlSection section); +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/GathererFactory.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/GathererFactory.java new file mode 100644 index 00000000000..4799bb81da6 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/GathererFactory.java @@ -0,0 +1,63 @@ +/* + * 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. + */ + +package jdk.test.failurehandler; + +import jdk.test.failurehandler.action.ActionHelper; +import jdk.test.failurehandler.value.InvalidValueException; + +import java.io.PrintWriter; +import java.nio.file.Path; +import java.util.Properties; + +public final class GathererFactory { + private final Path workdir; + private final Path[] jdks; + private final PrintWriter log; + private final String osName; + + public GathererFactory(String osName, Path workdir, PrintWriter log, Path... jdks) { + this.osName = osName; + this.workdir = workdir; + this.log = log; + this.jdks = jdks; + } + + public EnvironmentInfoGatherer getEnvironmentInfoGatherer() { + return create(); + } + + public ProcessInfoGatherer getProcessInfoGatherer() { + return create(); + } + + private ToolKit create() { + Properties osProperty = Utils.getProperties(osName); + try { + ActionHelper helper = new ActionHelper(workdir, "config", osProperty, jdks); + return new ToolKit(helper, log, osName, "common"); + } catch (InvalidValueException e) { + throw new IllegalStateException("can't create tool kit", e); + } + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlPage.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlPage.java new file mode 100644 index 00000000000..d8fd13fdd7c --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlPage.java @@ -0,0 +1,47 @@ +/* + * 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. + */ + +package jdk.test.failurehandler; + +import java.io.PrintWriter; +import java.util.Objects; + +public class HtmlPage implements AutoCloseable { + private final PrintWriter writer; + private final HtmlSection rootSection; + + public HtmlPage(PrintWriter writer) { + Objects.requireNonNull(writer, "writer cannot be null"); + this.writer = writer; + rootSection = new HtmlSection(writer); + } + + @Override + public void close() { + writer.close(); + } + + public HtmlSection getRootSection() { + return rootSection; + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlSection.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlSection.java new file mode 100644 index 00000000000..0597fe7b206 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlSection.java @@ -0,0 +1,237 @@ +/* + * 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. + */ + +package jdk.test.failurehandler; + +import java.io.FilterWriter; +import java.io.IOException; +import java.io.PrintWriter; + +public class HtmlSection { + protected final HtmlSection rootSection; + protected final String id; + protected final String name; + + public PrintWriter getWriter() { + return textWriter; + } + + protected final PrintWriter pw; + protected final PrintWriter textWriter; + protected boolean closed; + + private HtmlSection child; + + + public HtmlSection(PrintWriter pw) { + this(pw, "", null, null); + } + + private HtmlSection(PrintWriter pw, String id, String name, HtmlSection rootSection) { + this.pw = pw; + textWriter = new PrintWriter(new HtmlFilterWriter(pw)); + this.id = id; + this.name = name; + child = null; + // main + if (rootSection == null) { + this.rootSection = this; + this.pw.println(""); + this.pw.println("\n" + + "\n" + + "\n" + + ""); + + this.pw.println(""); + } else { + this.rootSection = rootSection; + this.pw.print("

"); + } + + } + + protected final void closeChild() { + if (child != null) { + child.close(); + child = null; + } + } + + public void link(HtmlSection section, String child, String name) { + String path = section.id; + if (path.isEmpty()) { + path = child; + } else if (child != null) { + path = String.format("%s.%s", path, child); + } + pw.printf("%2$s%n", + path, name); + } + + public HtmlSection createChildren(String[] sections) { + int i = 0; + int n = sections.length; + HtmlSection current = rootSection; + if (current != null) { + for (; i < n && current.child != null; + ++i, current = current.child) { + if (!sections[i].equals(current.child.name)) { + break; + } + } + } + for (; i < n; ++i) { + current = current.createChildren(sections[i]); + } + return current; + } + + private static class SubSection extends HtmlSection { + private final HtmlSection parent; + + public SubSection(HtmlSection parent, String name, + HtmlSection rootSection) { + super(parent.pw, + parent.id.isEmpty() + ? name + : String.format("%s.%s", parent.id, name), + name, rootSection); + this.parent = parent; + pw.printf("
  • %2$s
    ",
    +                    id, name);
    +        }
    +
    +        @Override
    +        public void close() {
    +            closeChild();
    +            if (closed) {
    +                return;
    +            }
    +            pw.print("
  • "); + parent.removeChild(this); + super.close(); + } + } + + private static class HtmlFilterWriter extends FilterWriter { + public HtmlFilterWriter(PrintWriter pw) { + super(pw); + } + + @Override + public void write(int c) throws IOException { + switch (c) { + case '<': + super.write("<", 0, 4); + break; + case '>': + super.write(">", 0, 4); + break; + case '"': + super.write(""", 0, 5); + break; + case '&': + super.write("&", 0, 4); + break; + default: + super.write(c); + } + } + + @Override + public void write(char[] cbuf, int off, int len) throws IOException { + for (int i = off; i < len; ++i){ + write(cbuf[i]); + } + } + + @Override + public void write(String str, int off, int len) throws IOException { + for (int i = off; i < len; ++i){ + write(str.charAt(i)); + } + } + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/ProcessInfoGatherer.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ProcessInfoGatherer.java new file mode 100644 index 00000000000..3fb407cb578 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ProcessInfoGatherer.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package jdk.test.failurehandler; + +public interface ProcessInfoGatherer { + void gatherProcessInfo(HtmlSection section, long pid); +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/Stopwatch.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/Stopwatch.java new file mode 100644 index 00000000000..2ac98959821 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/Stopwatch.java @@ -0,0 +1,73 @@ +/* + * 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. + */ + +package jdk.test.failurehandler; + +public final class Stopwatch { + protected boolean isResultAvailable; + protected boolean isRunning; + + private long startTimeNs; + private long stopTimeNs; + + public Stopwatch() { + isResultAvailable = false; + } + + /** + * Starts measuring time. + */ + public void start() { + startTimeNs = System.nanoTime(); + isRunning = true; + } + + /** + * Stops measuring time. + */ + public void stop() { + if (!isRunning) { + throw new IllegalStateException(" hasn't been started"); + } + stopTimeNs = System.nanoTime(); + isRunning = false; + isResultAvailable = true; + } + + /** + * @return time in nanoseconds measured between + * calls of {@link #start()} and {@link #stop()} methods. + * + * @throws IllegalStateException if called without preceding + * {@link #start()} {@link #stop()} method + */ + public long getElapsedTimeNs() { + if (isRunning) { + throw new IllegalStateException("hasn't been stopped"); + } + if (!isResultAvailable) { + throw new IllegalStateException("was not run"); + } + return stopTimeNs - startTimeNs; + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/ToolKit.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ToolKit.java new file mode 100644 index 00000000000..408bc1f450a --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ToolKit.java @@ -0,0 +1,72 @@ +/* + * 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. + */ + +package jdk.test.failurehandler; + +import jdk.test.failurehandler.action.ActionSet; +import jdk.test.failurehandler.action.ActionHelper; + +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +public class ToolKit implements EnvironmentInfoGatherer, ProcessInfoGatherer { + private final List actions = new ArrayList<>(); + private final ActionHelper helper; + + public ToolKit(ActionHelper helper, PrintWriter log, String... names) { + this.helper = helper; + for (String name : names) { + actions.add(new ActionSet(helper, log, name)); + } + } + + @Override + public void gatherEnvironmentInfo(HtmlSection section) { + for (ActionSet set : actions) { + set.gatherEnvironmentInfo(section); + } + } + + @Override + public void gatherProcessInfo(HtmlSection section, long pid) { + Queue pids = new LinkedList<>(); + pids.add(pid); + for (Long p = pids.poll(); p != null; p = pids.poll()) { + HtmlSection pidSection = section.createChildren("" + p); + for (ActionSet set : actions) { + set.gatherProcessInfo(pidSection, p); + } + List children = helper.getChildren(pidSection, p); + if (!children.isEmpty()) { + HtmlSection s = pidSection.createChildren("children"); + for (Long c : children) { + s.link(section, c.toString(), c.toString()); + } + pids.addAll(children); + } + } + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/Utils.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/Utils.java new file mode 100644 index 00000000000..ea82360293b --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/Utils.java @@ -0,0 +1,88 @@ +/* + * 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. + */ + +package jdk.test.failurehandler; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; +import java.util.Properties; + +public final class Utils { + private static final int BUFFER_LENGTH = 1024; + + public static String prependPrefix(String prefix, String name) { + return (prefix == null || prefix.isEmpty()) + ? name + : (name == null || name.isEmpty()) + ? prefix + : String.format("%s.%s", prefix, name); + } + + public static void copyStream(InputStream in, OutputStream out) + throws IOException { + int n; + byte[] buffer = new byte[BUFFER_LENGTH]; + while ((n = in.read(buffer)) != -1) { + out.write(buffer, 0, n); + } + out.flush(); + } + + public static void copyStream(Reader in, Writer out) + throws IOException { + int n; + char[] buffer = new char[BUFFER_LENGTH]; + while ((n = in.read(buffer)) != -1) { + out.write(buffer, 0, n); + } + out.flush(); + } + + public static Properties getProperties(String name) { + Properties properties = new Properties(); + String resourceName = String.format( + "/%s.%s", name.toLowerCase(), "properties"); + InputStream stream = Utils.class.getResourceAsStream(resourceName); + if (stream == null) { + throw new IllegalStateException(String.format( + "resource '%s' doesn't exist%n", resourceName)); + } + try { + try { + properties.load(stream); + } finally { + stream.close(); + } + } catch (IOException e) { + throw new IllegalStateException(String.format( + "can't read resource '%s' : %s%n", + resourceName, e.getMessage()), e); + } + return properties; + } + + private Utils() { } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/Action.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/Action.java new file mode 100644 index 00000000000..65b2a229e45 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/Action.java @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.action; + +import jdk.test.failurehandler.HtmlSection; + +public interface Action { + boolean isJavaOnly(); + HtmlSection getSection(HtmlSection section); + + ActionParameters getParameters(); +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionHelper.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionHelper.java new file mode 100644 index 00000000000..6a8ae037ea4 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionHelper.java @@ -0,0 +1,360 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.action; + +import com.sun.tools.attach.VirtualMachine; +import com.sun.tools.attach.VirtualMachineDescriptor; +import jdk.test.failurehandler.value.InvalidValueException; +import jdk.test.failurehandler.value.Value; +import jdk.test.failurehandler.value.ValueHandler; +import jdk.test.failurehandler.HtmlSection; +import jdk.test.failurehandler.Stopwatch; +import jdk.test.failurehandler.Utils; + +import java.io.BufferedReader; +import java.io.CharArrayReader; +import java.io.CharArrayWriter; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.Writer; +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Properties; +import java.util.Timer; +import java.util.TimerTask; +import java.util.concurrent.TimeUnit; + +public class ActionHelper { + private final Path workDir; + @Value(name = "execSuffix") + private String executableSuffix = ""; + private Path[] paths; + + private final PatternAction getChildren; + + public ActionHelper(Path workDir, String prefix, Properties properties, + Path... jdks) throws InvalidValueException { + this.workDir = workDir.toAbsolutePath(); + getChildren = new PatternAction("children", + Utils.prependPrefix(prefix, "getChildren"), properties); + ValueHandler.apply(this, properties, prefix); + String[] pathStrings = System.getenv("PATH").split(File.pathSeparator); + paths = new Path[pathStrings.length]; + for (int i = 0; i < paths.length; ++i) { + paths[i] = Paths.get(pathStrings[i]); + } + addJdks(jdks); + } + + public List getChildren(HtmlSection section, long pid) { + String pidStr = "" + pid; + ProcessBuilder pb = getChildren.prepareProcess(section, this, pidStr); + PrintWriter log = getChildren.getSection(section).getWriter(); + CharArrayWriter writer = new CharArrayWriter(); + ExitCode code = run(log, writer, pb, getChildren.getParameters()); + Reader output = new CharArrayReader(writer.toCharArray()); + + if (!ExitCode.OK.equals(code)) { + log.println("WARNING: get children pids action failed"); + try { + Utils.copyStream(output, log); + } catch (IOException e) { + e.printStackTrace(log); + } + return Collections.emptyList(); + } + + List result = new ArrayList<>(); + try { + try (BufferedReader reader = new BufferedReader(output)) { + String line; + while ((line = reader.readLine()) != null) { + String value = line.trim(); + if (value.isEmpty()) { + // ignore empty lines + continue; + } + try { + result.add(Long.valueOf(value)); + } catch (NumberFormatException e) { + log.printf("WARNING: can't parse child pid %s : %s%n", + line, e.getMessage()); + e.printStackTrace(log); + } + } + } + } catch (IOException e) { + e.printStackTrace(log); + } + return result; + } + + public ProcessBuilder prepareProcess(PrintWriter log, String app, + String... args) { + File appBin = findApp(app); + if (appBin == null) { + log.printf("ERROR: can't find %s in %s.%n", + app, Arrays.toString(paths)); + return null; + } + List command = new ArrayList<>(args.length + 1); + command.add(appBin.toString()); + Collections.addAll(command, args); + return new ProcessBuilder() + .command(command) + .directory(workDir.toFile()); + } + + private File findApp(String app) { + String name = app + executableSuffix; + for (Path pathElem : paths) { + File result = pathElem.resolve(name).toFile(); + if (result.exists()) { + return result; + } + } + return null; + } + + private void addJdks(Path[] jdkPaths) { + if (jdkPaths != null && jdkPaths.length != 0) { + Path[] result = new Path[jdkPaths.length + paths.length]; + for (int i = 0; i < jdkPaths.length; ++i) { + result[i] = jdkPaths[i].resolve("bin"); + } + System.arraycopy(paths, 0, result, jdkPaths.length, paths.length); + paths = result; + } + } + + private ExitCode run(PrintWriter log, Writer out, ProcessBuilder pb, + ActionParameters params) { + char[] lineChars = new char[40]; + Arrays.fill(lineChars, '-'); + String line = new String(lineChars); + Stopwatch stopwatch = new Stopwatch(); + stopwatch.start(); + + log.printf("%s%n[%tF % 0) { + WATCHDOG.schedule(this, timeout); + } + } + } + + private void exec(HtmlSection section, ProcessBuilder process, + ActionParameters params) { + if (process == null) { + return; + } + PrintWriter sectionWriter = section.getWriter(); + if (params.repeat > 1) { + for (int i = 0, n = params.repeat; i < n; ++i) { + HtmlSection iteration = section.createChildren( + String.format("iteration_%d", i)); + PrintWriter writer = iteration.getWriter(); + ExitCode exitCode = run(writer, writer, process, params); + if (params.stopOnError && !ExitCode.OK.equals(exitCode)) { + sectionWriter.printf( + "ERROR: non zero exit code[%d] -- break.", + exitCode.value); + break; + } + try { + Thread.sleep(params.pause); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + e.printStackTrace(sectionWriter); + } + } + } else { + run(section.getWriter(), section.getWriter(), process, params); + } + } + + /** + * Special values for prepareProcess exit code. + * + *

    Can we clash with normal codes? + * On Solaris and Linux, only [0..255] are returned. + * On Windows, prepareProcess exit codes are stored in unsigned int. + * On MacOSX no limits (except it should fit C int type) + * are defined in the exit() man pages. + */ + private static class ExitCode { + /** Process exits gracefully */ + public static final ExitCode OK = new ExitCode(0); + /** Error launching prepareProcess */ + public static final ExitCode LAUNCH_ERROR = new ExitCode(-1); + /** Application prepareProcess has been killed by watchdog due to timeout */ + public static final ExitCode TIMED_OUT = new ExitCode(-2); + /** Application prepareProcess has never been started due to program logic */ + public static final ExitCode NEVER_STARTED = new ExitCode(-3); + + public final int value; + + private ExitCode(int value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + ExitCode exitCode = (ExitCode) o; + return value == exitCode.value; + } + + @Override + public int hashCode() { + return value; + } + } + +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionParameters.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionParameters.java new file mode 100644 index 00000000000..4bd919e1549 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionParameters.java @@ -0,0 +1,47 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.action; + +import jdk.test.failurehandler.value.DefaultValue; +import jdk.test.failurehandler.value.Value; + +public class ActionParameters { + @Value (name = "repeat") + @DefaultValue (value = "1") + public int repeat = 1; + + @Value (name = "pause") + @DefaultValue (value = "500") + public long pause = 500; + + @Value (name = "stopOnError") + @DefaultValue (value = "false") + public boolean stopOnError = false; + + @Value (name = "timeout") + @DefaultValue (value = "" + 20_000L) + public long timeout = -1L; + + public ActionParameters() { } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionSet.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionSet.java new file mode 100644 index 00000000000..3ed5b31403d --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionSet.java @@ -0,0 +1,126 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.action; + +import jdk.test.failurehandler.ProcessInfoGatherer; +import jdk.test.failurehandler.EnvironmentInfoGatherer; +import jdk.test.failurehandler.HtmlSection; +import jdk.test.failurehandler.Utils; + +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +public class ActionSet implements ProcessInfoGatherer, EnvironmentInfoGatherer { + private static final String ENVIRONMENT_PROPERTY = "environment"; + private static final String ON_PID_PROPERTY = "onTimeout"; + + private final ActionHelper helper; + + public String getName() { + return name; + } + + private final String name; + private final List environmentActions; + private final List processActions; + + + public ActionSet(ActionHelper helper, PrintWriter log, String name) { + this.helper = helper; + this.name = name; + + Properties p = Utils.getProperties(name); + environmentActions = getSimpleActions(log, p, ENVIRONMENT_PROPERTY); + processActions = getPatternActions(log, p, ON_PID_PROPERTY); + } + + private List getSimpleActions(PrintWriter log, Properties p, + String key) { + String[] tools = getTools(log, p, key); + List result = new ArrayList<>(tools.length); + for (String tool : tools) { + try { + SimpleAction action = new SimpleAction( + Utils.prependPrefix(name, tool), tool, p); + result.add(action); + } catch (Exception e) { + log.printf("ERROR: %s cannot be created : %s %n", + tool, e.getMessage()); + e.printStackTrace(log); + } + } + return result; + } + + private List getPatternActions(PrintWriter log, + Properties p, String key) { + String[] tools = getTools(log, p, key); + List result = new ArrayList<>(tools.length); + for (String tool : tools) { + try { + PatternAction action = new PatternAction( + Utils.prependPrefix(name, tool), tool, p); + result.add(action); + } catch (Exception e) { + log.printf("ERROR: %s cannot be created : %s %n", + tool, e.getMessage()); + e.printStackTrace(log); + } + } + return result; + } + + private String[] getTools(PrintWriter writer, Properties p, String key) { + String value = p.getProperty(key); + if (value == null || value.isEmpty()) { + writer.printf("ERROR: '%s' property is empty%n", key); + return new String[]{}; + } + return value.split(" "); + } + + + @Override + public void gatherProcessInfo(HtmlSection section, long pid) { + String pidStr = "" + pid; + for (PatternAction action : processActions) { + if (action.isJavaOnly()) { + if (helper.isJava(pid, section.getWriter())) { + helper.runPatternAction(action, section, pidStr); + } + } else { + helper.runPatternAction(action, section, pidStr); + } + } + } + + @Override + public void gatherEnvironmentInfo(HtmlSection section) { + for (SimpleAction action : environmentActions) { + helper.runPatternAction(action, section); + } + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/PatternAction.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/PatternAction.java new file mode 100644 index 00000000000..fbcaaa7f47d --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/PatternAction.java @@ -0,0 +1,79 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.action; + +import jdk.test.failurehandler.value.InvalidValueException; +import jdk.test.failurehandler.HtmlSection; +import jdk.test.failurehandler.value.Value; +import jdk.test.failurehandler.value.ValueHandler; + +import java.util.Properties; + +public class PatternAction implements Action { + @Value(name = "pattern") + private String pattern = null; + + private final SimpleAction action; + private final String[] originalArgs; + + public PatternAction(String id, Properties properties) + throws InvalidValueException { + this(id, id, properties); + } + + public PatternAction(String name, String id, Properties properties) + throws InvalidValueException { + action = new SimpleAction(("pattern." + name), id, properties); + ValueHandler.apply(this, properties, id); + originalArgs = action.args.clone(); + } + + public ProcessBuilder prepareProcess(HtmlSection section, + ActionHelper helper, String value) { + action.sections[0] = value; + section = getSection(section); + String[] args = action.args; + System.arraycopy(originalArgs, 0, args, 0, originalArgs.length); + + for (int i = 0, n = args.length; i < n; ++i) { + args[i] = args[i].replace(pattern, value) ; + } + return action.prepareProcess(section.getWriter(), helper); + } + + @Override + public HtmlSection getSection(HtmlSection section) { + return action.getSection(section); + } + + @Override + public ActionParameters getParameters() { + return action.getParameters(); + } + + @Override + public boolean isJavaOnly() { + return action.isJavaOnly(); + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/SimpleAction.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/SimpleAction.java new file mode 100644 index 00000000000..e6a0e9ad102 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/SimpleAction.java @@ -0,0 +1,86 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.action; + +import jdk.test.failurehandler.HtmlSection; +import jdk.test.failurehandler.value.InvalidValueException; +import jdk.test.failurehandler.value.SubValues; +import jdk.test.failurehandler.value.Value; +import jdk.test.failurehandler.value.ValueHandler; +import jdk.test.failurehandler.value.DefaultValue; + +import java.io.PrintWriter; +import java.util.Properties; + +public class SimpleAction implements Action { + /* package-private */ final String[] sections; + @Value(name = "javaOnly") + @DefaultValue(value = "false") + private boolean javaOnly = false; + + @Value (name = "app") + private String app = null; + + @Value (name = "args") + @DefaultValue (value = "") + /* package-private */ String[] args = new String[]{}; + + @SubValues(prefix = "params") + private final ActionParameters params; + + public SimpleAction(String id, Properties properties) + throws InvalidValueException { + this(id, id, properties); + } + public SimpleAction(String name, String id, Properties properties) + throws InvalidValueException { + sections = name.split("\\."); + this.params = new ActionParameters(); + ValueHandler.apply(this, properties, id); + } + + public ProcessBuilder prepareProcess(PrintWriter log, ActionHelper helper) { + ProcessBuilder process = helper.prepareProcess(log, app, args); + if (process != null) { + process.redirectErrorStream(true); + } + + return process; + } + + @Override + public boolean isJavaOnly() { + return javaOnly; + } + + @Override + public HtmlSection getSection(HtmlSection section) { + return section.createChildren(sections); + } + + @Override + public ActionParameters getParameters() { + return params; + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java new file mode 100644 index 00000000000..bab0b598059 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java @@ -0,0 +1,153 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.jtreg; + +import com.sun.javatest.Harness; +import com.sun.javatest.Parameters; +import com.sun.javatest.TestResult; +import com.sun.javatest.regtest.RegressionParameters; +import com.sun.javatest.regtest.OS; +import jdk.test.failurehandler.*; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; + +/** + * The jtreg test execution observer, which gathers info about + * system and dumps it to a file. + */ +public class GatherDiagnosticInfoObserver implements Harness.Observer { + public static final String LOG_FILENAME = "environment.log"; + public static final String ENVIRONMENT_OUTPUT = "environment.html"; + + private String compileJdk; + private String testJdk; + + /* + * The harness calls this method after each test. + */ + @Override + public void finishedTest(TestResult tr) { + if (!tr.getStatus().isError() && !tr.getStatus().isFailed()) { + return; + } + + String jtrFile = tr.getFile().toString(); + final Path workDir = Paths.get( + jtrFile.substring(0, jtrFile.lastIndexOf('.'))); + workDir.toFile().mkdir(); + + String name = getClass().getName(); + PrintWriter log; + boolean needClose = false; + try { + log = new PrintWriter(new FileWriter( + workDir.resolve(LOG_FILENAME).toFile(), true)); + needClose = true; + } catch (IOException e) { + log = new PrintWriter(System.out); + log.printf("ERROR: %s cannot open log file %s", name, + LOG_FILENAME); + e.printStackTrace(log); + } + try { + log.printf("%s ---%n", name); + GathererFactory gathererFactory = new GathererFactory( + OS.current().family, workDir, log, + Paths.get(testJdk), Paths.get(compileJdk)); + gatherEnvInfo(workDir, name, log, + gathererFactory.getEnvironmentInfoGatherer()); + } catch (Throwable e) { + log.printf("ERROR: exception in observer %s:", name); + e.printStackTrace(log); + } finally { + log.printf("--- %s%n", name); + if (needClose) { + log.close(); + } else { + log.flush(); + } + } + } + + private void gatherEnvInfo(Path workDir, String name, PrintWriter log, + EnvironmentInfoGatherer gatherer) { + File output = workDir.resolve(ENVIRONMENT_OUTPUT).toFile(); + try (HtmlPage html = new HtmlPage(new PrintWriter( + new FileWriter(output, true)))) { + try (ElapsedTimePrinter timePrinter + = new ElapsedTimePrinter(new Stopwatch(), name, log)) { + gatherer.gatherEnvironmentInfo(html.getRootSection()); + } + } catch (Throwable e) { + log.printf("ERROR: exception in observer on getting environment " + + "information %s:", name); + e.printStackTrace(log); + } + } + + /* + * The harness calls this method one time per run, not per test. + */ + @Override + public void startingTestRun(Parameters params) { + // TODO find a better way to get JDKs + RegressionParameters rp = (RegressionParameters) params; + Map map = new HashMap<>(); + rp.save(map); + compileJdk = (String) map.get("regtest.compilejdk"); + testJdk = (String) map.get("regtest.testjdk"); + } + + @Override + public void startingTest(TestResult tr) { + // no-op + } + + @Override + public void stoppingTestRun() { + // no-op + } + + @Override + public void finishedTesting() { + // no-op + } + + @Override + public void finishedTestRun(boolean allOK) { + // no-op + } + + @Override + public void error(String msg) { + // no-op + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java new file mode 100644 index 00000000000..a16b4e734d7 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java @@ -0,0 +1,144 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.jtreg; + +import com.sun.javatest.regtest.OS; +import com.sun.javatest.regtest.TimeoutHandler; +import jdk.test.failurehandler.*; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.lang.reflect.Field; +import java.nio.file.Path; + +/** + * A timeout handler for jtreg, which gathers information about the timed out + * process and its children. + */ +public class GatherProcessInfoTimeoutHandler extends TimeoutHandler { + static { + try { + System.loadLibrary("timeoutHandler"); + } catch (UnsatisfiedLinkError ignore) { + // not all os need timeoutHandler native-library + } + } + private static final String LOG_FILENAME = "processes.log"; + private static final String OUTPUT_FILENAME = "processes.html"; + + public GatherProcessInfoTimeoutHandler(PrintWriter jtregLog, File outputDir, + File testJdk) { + super(jtregLog, outputDir, testJdk); + } + + /** + * Runs various actions for jtreg timeout handler. + * + *

    Please see method code for the actions. + */ + @Override + protected void runActions(Process process, long pid) + throws InterruptedException { + Path workDir = outputDir.toPath(); + + String name = getClass().getName(); + PrintWriter actionsLog; + try { + // try to open a separate file for aciton log + actionsLog = new PrintWriter(new FileWriter( + workDir.resolve(LOG_FILENAME).toFile(), true)); + } catch (IOException e) { + // use jtreg log as a fallback + actionsLog = log; + actionsLog.printf("ERROR: %s cannot open log file %s : %s", name, + LOG_FILENAME, e.getMessage()); + } + try { + actionsLog.printf("%s ---%n", name); + + File output = workDir.resolve(OUTPUT_FILENAME).toFile(); + try { + PrintWriter pw = new PrintWriter(new FileWriter(output, true)); + runGatherer(name, workDir, actionsLog, pw, pid); + } catch (IOException e) { + actionsLog.printf("IOException: cannot open output file[%s] : %s", + output, e.getMessage()); + e.printStackTrace(actionsLog); + } + } finally { + actionsLog.printf("--- %s%n", name); + // don't close jtreg log + if (actionsLog != log) { + actionsLog.close(); + } else { + log.flush(); + } + } + } + + @Override + protected long getProcessId(Process process) { + long result = super.getProcessId(process); + if (result == 0L) { + /* jtreg didn't find pid, most probably we are on JDK < 9 + there is no Process::getPid */ + if ("windows".equals(OS.current().family)) { + try { + Field field = process.getClass().getDeclaredField("handle"); + boolean old = field.isAccessible(); + try { + field.setAccessible(true); + long handle = field.getLong(process); + result = getWin32Pid(handle); + } finally { + field.setAccessible(old); + } + } catch (ReflectiveOperationException e) { + e.printStackTrace(log); + } + } + } + return result; + } + + private native long getWin32Pid(long handle); + + private void runGatherer(String name, Path workDir, PrintWriter log, + PrintWriter out, long pid) { + try (HtmlPage html = new HtmlPage(out)) { + ProcessInfoGatherer gatherer = new GathererFactory( + OS.current().family, + workDir, log, testJdk.toPath()).getProcessInfoGatherer(); + try (ElapsedTimePrinter timePrinter + = new ElapsedTimePrinter(new Stopwatch(), name, log)) { + gatherer.gatherProcessInfo(html.getRootSection(), pid); + } + } catch (Throwable e) { + log.printf("ERROR: exception in timeout handler %s:", name); + e.printStackTrace(log); + } + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ArrayParser.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ArrayParser.java new file mode 100644 index 00000000000..fd2e4e6e01a --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ArrayParser.java @@ -0,0 +1,53 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.value; + +import java.lang.reflect.Array; +import java.util.Objects; + +public class ArrayParser implements ValueParser { + private final ValueParser parser; + + public ArrayParser(ValueParser parser) { + Objects.requireNonNull(parser); + this.parser = parser; + } + + @Override + public Object parse(Class type, String value, String delimiter) { + Class component = type.getComponentType(); + if (component.isArray()) { + throw new IllegalArgumentException( + "multidimensional array fields aren't supported"); + } + String[] values = (value == null || value.isEmpty()) + ? new String[]{} + : value.split(delimiter); + Object result = Array.newInstance(component, values.length); + for (int i = 0, n = values.length; i < n; ++i) { + Array.set(result, i, parser.parse(component, values[i], delimiter)); + } + return result; + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultParser.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultParser.java new file mode 100644 index 00000000000..7de7442efaf --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultParser.java @@ -0,0 +1,120 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.value; + +import java.util.HashMap; +import java.util.Map; + +public class DefaultParser implements ValueParser { + private static final Map, BasicParser> PARSERS = new HashMap<>(); + + static { + BasicParser.init(); + } + + @Override + public Object parse(Class type, String value, String s) { + if (type.isArray()) { + return new ArrayParser(this).parse(type, value, s); + } + ValueParser parser = PARSERS.get(type); + if (parser == null) { + throw new IllegalArgumentException("can't find parser for " + + type.getName()); + } + + return parser.parse(type, value, s); + } + + private static enum BasicParser implements ValueParser { + BOOL(boolean.class, Boolean.class) { + @Override + public Object parse(Class type, String value, String s) { + return Boolean.valueOf(value); + } + }, + BYTE(byte.class, Byte.class) { + @Override + public Object parse(Class type, String value, String s) { + return Byte.decode(value); + } + }, + CHAR(char.class, Character.class) { + @Override + public Object parse(Class type, String value, String s) { + if (value.length() != 1) { + throw new IllegalArgumentException( + String.format("can't cast %s to char", value)); + } + return value.charAt(0); + } + }, + SHORT(short.class, Short.class) { + @Override + public Object parse(Class type, String value, String s) { + return Short.decode(value); + } + }, + INT(int.class, Integer.class) { + @Override + public Object parse(Class type, String value, String s) { + return Integer.decode(value); + } + }, + LONG(long.class, Long.class) { + @Override + public Object parse(Class type, String value, String s) { + return Long.decode(value); + } + }, + FLOAT(float.class, Float.class) { + @Override + public Object parse(Class type, String value, String s) { + return Float.parseFloat(value); + } + }, + DOUBLE(double.class, Double.class) { + @Override + public Object parse(Class type, String value, String s) { + return Double.parseDouble(value); + } + }, + STRING(String.class, Object.class) { + @Override + public Object parse(Class type, String value, String s) { + return value; + } + }; + + private BasicParser(Class... classes) { + for (Class aClass : classes) { + DefaultParser.PARSERS.put(aClass, this); + } + } + + private static void init() { + // no-op used to provoke + } + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultValue.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultValue.java new file mode 100644 index 00000000000..081a9fd92de --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultValue.java @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.value; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(value = RetentionPolicy.RUNTIME) +@Target(value = ElementType.FIELD) +public @interface DefaultValue { + String value(); +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/InvalidValueException.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/InvalidValueException.java new file mode 100644 index 00000000000..6d544c27cb3 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/InvalidValueException.java @@ -0,0 +1,40 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.value; + +public class InvalidValueException extends Exception { + public InvalidValueException() { } + + public InvalidValueException(String message) { + super(message); + } + + public InvalidValueException(String s, Throwable e) { + super(s, e); + } + + public InvalidValueException(Throwable cause) { + super(cause); + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/PathValueParser.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/PathValueParser.java new file mode 100644 index 00000000000..89ed3a713b0 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/PathValueParser.java @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.value; + +import java.io.File; + +public class PathValueParser implements ValueParser { + @Override + public Object parse(Class type, String value, String delimiter) { + if (type.isArray()) { + return new ArrayParser(this).parse(type, value, delimiter); + } + return new File(value).toPath(); + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/SubValues.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/SubValues.java new file mode 100644 index 00000000000..cc09a0d4b50 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/SubValues.java @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.value; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(value = RetentionPolicy.RUNTIME) +@Target(value = ElementType.FIELD) +public @interface SubValues { + String prefix(); +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/Value.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/Value.java new file mode 100644 index 00000000000..9f4c3cdac22 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/Value.java @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.value; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(value = RetentionPolicy.RUNTIME) +@Target(value = ElementType.FIELD) +public @interface Value { + String name(); + Class parser() default DefaultParser.class; +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueHandler.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueHandler.java new file mode 100644 index 00000000000..971f11ef243 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueHandler.java @@ -0,0 +1,122 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.value; + +import jdk.test.failurehandler.Utils; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.Objects; +import java.util.Properties; + +public final class ValueHandler { + public static void apply(T object, Properties properties, + String prefix) throws InvalidValueException { + Objects.requireNonNull(object, "object cannot be null"); + Objects.requireNonNull(properties, "properties cannot be null"); + Class aClass = object.getClass(); + while (aClass != null) { + for (Field field : aClass.getDeclaredFields()) { + Value p = field.getAnnotation(Value.class); + if (p != null) { + applyToField(p, object, field, properties, prefix); + } else { + SubValues sub + = field.getAnnotation(SubValues.class); + if (sub != null) { + getAccess(field); + try { + apply(field.get(object), properties, + Utils.prependPrefix(prefix, sub.prefix())); + } catch (IllegalAccessException e) { + throw new InvalidValueException(String.format( + "can't apply sub properties to %s.", + field.getName())); + } + } + } + } + aClass = aClass.getSuperclass(); + } + } + + private static void applyToField(Value property, Object object, + Field field, Properties properties, String prefix) + throws InvalidValueException { + getAccess(field); + if (Modifier.isFinal(field.getModifiers())) { + throw new InvalidValueException( + String.format("field '%s' is final", field)); + } + String name = Utils.prependPrefix(prefix, property.name()); + String value = getProperty(properties, prefix, property.name()); + if (value == null) { + DefaultValue defaultValue + = field.getAnnotation(DefaultValue.class); + value = defaultValue == null ? null : defaultValue.value(); + } + if (value == null) { + throw new InvalidValueException(String.format( + "can't set '%s', because properties don't have '%s'.", + field.getName(), name)); + } + String delimiter = getProperty(properties, + Utils.prependPrefix(prefix, property.name()), "delimiter"); + delimiter = delimiter == null ? " " : delimiter; + Class parserClass = property.parser(); + try { + field.set(object, parserClass.newInstance().parse( + field.getType(), value, delimiter)); + } catch (ReflectiveOperationException | IllegalArgumentException e) { + throw new InvalidValueException( + String.format("can't set field '%s' : %s", + field.getName(), e.getMessage()), e); + } + } + + private static String getProperty(Properties properties, + String prefix, String name) { + if (prefix == null || prefix.isEmpty()) { + return properties.getProperty(name); + } + int index = prefix.length(); + do { + String value = properties.getProperty( + Utils.prependPrefix(prefix.substring(0, index), name)); + if (value != null) { + return value; + } + index = prefix.lastIndexOf('.', index - 1); + } while (index > 0); + return properties.getProperty(name); + } + + private static void getAccess(Field field) { + int modifiers = field.getModifiers(); + if (!Modifier.isPublic(modifiers)) { + field.setAccessible(true); + } + } + +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueParser.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueParser.java new file mode 100644 index 00000000000..fe7c00a41d2 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueParser.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.value; + +public interface ValueParser { + Object parse(Class type, String value, String delimiter); +} diff --git a/test/failure_handler/src/share/conf/common.properties b/test/failure_handler/src/share/conf/common.properties new file mode 100644 index 00000000000..6e8e6ef24c4 --- /dev/null +++ b/test/failure_handler/src/share/conf/common.properties @@ -0,0 +1,74 @@ +# +# 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. +# + +pattern=%p +javaOnly=true +args=%p +################################################################################ +# process info to gather +################################################################################ +onTimeout=\ + jinfo \ + jcmd.compiler.codecache jcmd.compiler.codelist \ + jcmd.compiler.queue \ + jcmd.vm.classloader_stats jcmd.vm.stringtable \ + jcmd.vm.symboltable jcmd.vm.uptime jcmd.vm.dynlibs \ + jcmd.vm.system_properties \ + jcmd.gc.class_stats jcmd.gc.class_histogram \ + jstack \ + jmap.heap jmap.histo jmap.clstats jmap.finalizerinfo + +jinfo.app=jinfo + +jcmd.app=jcmd + +jcmd.compiler.codecache.args=%p Compiler.codecache +jcmd.compiler.codelist.args=%p Compiler.codelist +jcmd.compiler.queue.args=%p Compiler.queue + +jcmd.vm.classloader_stats.args=%p VM.classloader_stats +jcmd.vm.stringtable.args=%p VM.stringtable +jcmd.vm.symboltable.args=%p VM.symboltable +jcmd.vm.uptime.args=%p VM.uptime +jcmd.vm.dynlibs.args=%p VM.dynlibs +jcmd.vm.system_properties.args=%p VM.system_properties + +jcmd.gc.class_stats.args=%p GC.class_stats +jcmd.gc.class_histogram.args=%p GC.class_histogram + +jstack.app=jstack +jstack.params.repeat=6 + +jmap.app=jmap +jmap.heap.args=-heap %p +jmap.histo.args=-histo %p +jmap.clstats.args=-clstats %p +jmap.finalizerinfo.args=-finalizerinfo %p + +################################################################################ +# environment info to gather +################################################################################ +environment=jps +jps.app=jps +jps.args=-mlv +################################################################################ diff --git a/test/failure_handler/src/share/conf/linux.properties b/test/failure_handler/src/share/conf/linux.properties new file mode 100644 index 00000000000..a9cb01f4b84 --- /dev/null +++ b/test/failure_handler/src/share/conf/linux.properties @@ -0,0 +1,110 @@ +# +# 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. +# + +config.execSuffix= +config.getChildren.pattern=%p +config.getChildren.app=ps +config.getChildren.args=--no-headers -o pid --ppid %p +################################################################################ +# process info to gather +################################################################################ +onTimeout=\ + native.pmap.normal native.pmap.everything \ + native.files native.locks \ + native.stack native.core +################################################################################ +native.pattern=%p +native.javaOnly=false +native.args=%p + +native.pmap.app=pmap +native.pmap.normal.args=-p %p +native.pmap.everything.args=-XXp %p + +native.files.app=lsof +native.files.args=-p %p + +native.locks.app=lslocks +native.locks.args=-u --pid %p + +native.stack.app=gdb +native.stack.args=--pid=%p\0-batch\0-ex\0thread apply all backtrace +native.stack.args.delimiter=\0 +native.stack.params.repeat=6 + +native.core.app=gcore +native.core.args=-o ./core.%p %p +native.core.params.timeout=3600000 +################################################################################ +# environment info to gather +################################################################################ +environment=\ + users.current users.logged users.last \ + disk \ + env \ + system.dmesg system.sysctl \ + process.top process.ps \ + memory.free memory.vmstat.default memory.vmstat.statistics \ + memory.vmstat.slabinfo memory.vmstat.disk \ + files \ + locks \ + net.sockets net.statistics +################################################################################ +users.current.app=id +users.current.args=-a +users.logged.app=who +users.logged.args=-a +users.last.app=last +users.last.args=-10 + +disk.app=df +disk.args=-h + +env.app=env + +system.dmesg.app=dmesg +system.sysctl.app=sysctl +system.sysctl.args=-a + +process.top.app=top +process.top.args=-b -n 1 +process.ps.app=ps +process.ps.args=-Leo pid,pcpu,cputime,start,pmem,vsz,rssize,stackp,stat,sgi_p,wchan,user,args + +memory.free.app=free +memory.free.args=-h +memory.vmstat.app=vmstat +memory.vmstat.default.args=3 3 +memory.vmstat.statistics.args=-s +memory.vmstat.slabinfo.args=-m +memory.vmstat.disk.args=-d + +files.app=lsof +locks.app=lslocks +locks.args=-u + +net.app=netstat +net.sockets.args=-aeeopv +net.statistics.args=-sv +################################################################################ + diff --git a/test/failure_handler/src/share/conf/mac.properties b/test/failure_handler/src/share/conf/mac.properties new file mode 100644 index 00000000000..e2b1ac21b25 --- /dev/null +++ b/test/failure_handler/src/share/conf/mac.properties @@ -0,0 +1,98 @@ +# +# 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. +# + +config.execSuffix= +config.getChildren.pattern=%p +config.getChildren.app=pgrep +config.getChildren.args=-P %p +################################################################################ +# process info to gather +################################################################################ +onTimeout=\ + native.vmmap native.heap native.leaks native.spindump \ + native.stack native.core +################################################################################ +native.pattern=%p +native.javaOnly=false +native.args=%p + +# Some of them require root privileges +native.vmmap.app=vmmap +native.heap.app=heap +native.leaks.app=leaks +native.spindump.app=spindump +native.spindump.args=%p -stdout + +native.stack.app=lldb +native.stack.delimiter=\0 +native.stack.params.repeat=6 +native.stack.args=-o\0attach %p\0-o\0thread backtrace all\0-o\0detach\0-o\0quit + +native.core.app=bash +native.core.delimiter=\0 +native.core.args=-c\0gcore -o ./core.%p %p || \ + lldb -o 'attach %p' -o 'process save-core core.%p' -o 'detach' -o 'quit' +native.core.params.timeout=3600000 +################################################################################ +# environment info to gather +################################################################################ +environment=\ + users.current users.logged users.last \ + disk \ + env \ + system.dmesg system.sysctl \ + process.ps process.top \ + memory.vmstat \ + netstat.av netstat.aL netstat.m netstat.s +################################################################################ +users.current.app=id +users.current.args=-a +users.logged.app=who +users.logged.args=-a +users.last.app=last +users.last.args=-10 + +disk.app=df +disk.args=-h + +env.app=env + +system.dmesg.app=dmesg +system.sysctl.app=sysctl +system.sysctl.args=-a + +process.ps.app=ps +process.ps.args=-Meo pid,pcpu,cputime,start,pmem,vsz,rss,state,wchan,user,args +process.top.app=top +process.top.args=-l 1 + +memory.vmstat.app=vm_stat +memory.vmstat.args=-c 3 3 + + +netstat.app=netstat +netstat.av.args=-av +netstat.aL.args=-aL +netstat.m.args=-m +netstat.s.args=-s +################################################################################ diff --git a/test/failure_handler/src/share/conf/solaris.properties b/test/failure_handler/src/share/conf/solaris.properties new file mode 100644 index 00000000000..4c0b673014e --- /dev/null +++ b/test/failure_handler/src/share/conf/solaris.properties @@ -0,0 +1,111 @@ +# +# 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. +# + +config.execSuffix= +# pattern will be replaced with the PID +config.getChildren.pattern=%p +config.getChildren.app=pgrep +config.getChildren.args=-P %p +################################################################################ +# prepareProcess info to gather +################################################################################ +onTimeout=\ + native.pmap \ + native.pfiles \ + native.stack native.core +################################################################################ +# solaris specific +################################################################################ +native.pattern=%p +native.javaOnly=false + +native.pmap.app=pmap +native.pmap.args=-F %p + +native.pfiles.app=pfiles +native.pfiles.args=-F %p + +# native.locks TODO find 'analog for solaris' for Linux lslocks + +native.stack.app=pstack +native.stack.args=-F %p +native.stack.params.repeat=6 + +native.core.app=gcore +native.core.args=-F -o ./core %p +native.core.params.timeout=3600000 +################################################################################ +# environment info to gather +################################################################################ +environment=\ + users.current users.logged users.last \ + disk \ + env \ + system.dmesg system.prtconf system.sysdef \ + process.ps process.top \ + memory.swap memory.vmstat.default memory.vmstat.statistics memory.pagesize \ + netstat.av netstat.m netstat.s netstat.i +################################################################################ +# common unix +################################################################################ +users.current.app=id +users.current.args=-a +users.logged.app=who +users.logged.args=-a +users.last.app=last +users.last.args=-10 + +disk.app=df +disk.args=-h + +env.app=env + +system.dmesg.app=dmesg +system.prtconf.app=prtconf +system.sysdef.app=sysdef + +memory.swap.app=swap +memory.swap.args=-l + +process.ps.app=ps +process.ps.args=-Leo pid,lwp,ppid,tty,s,wchan,pcpu,time,stime,pmem,vsz,osz,rss,args + +process.top.app=top +process.top.args=-b -n + +memory.vmstat.app=vmstat +memory.vmstat.default.args=3 3 +memory.vmstat.statistics.args=-s + +memory.pagesize.app=pagesize + +# TODO: how to start prstat to show statistics and exit? +# prstat.app=prstat +# prstat.args=-a + +netstat.app=netstat +netstat.av.args=-av +netstat.m.args=-m +netstat.s.args=-s +netstat.i.args=-i 1 5 +################################################################################ diff --git a/test/failure_handler/src/share/conf/windows.properties b/test/failure_handler/src/share/conf/windows.properties new file mode 100644 index 00000000000..ed5385cba83 --- /dev/null +++ b/test/failure_handler/src/share/conf/windows.properties @@ -0,0 +1,115 @@ +# +# 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. +# + +config.execSuffix=.exe +config.getChildren.app=bash +config.getChildren.pattern=%p +config.getChildren.args=-c\0wmic process where ParentProcessId=%p get ProcessId | tail -n+2 +config.getChildren.args.delimiter=\0 +################################################################################ +# process info to gather +################################################################################ +onTimeout=\ + native.info \ + native.pmap.normal native.pmap.everything \ + native.files native.locks \ + native.stack native.core +################################################################################ +native.pattern=%p +native.javaOnly=false +native.args=%p + +native.info.app=wmic +native.info.args=process where processId=%p list full + +native.pmap.app=pmap +native.pmap.normal.args=%p +native.pmap.everything.args=-x %p + +native.files.app=handle +native.files.args=-p %p +# TODO +native.locks.app=lslocks +native.locks.args=-u --pid %p + +native.stack.app=cdb +native.stack.args=-c "~*kP n;qd" -p %p +native.stack.params.repeat=6 + +native.core.app=cdb +native.core.args=-c ".dump /f core.%p;qd" -p %p +native.core.params.timeout=3600000 +################################################################################ +# environment info to gather +################################################################################ +environment=\ + users.current users.logged \ + disk \ + env \ + system.events.system system.events.application system.os \ + process.top process.ps process.tasklist \ + memory.free memory.vmstat.default memory.vmstat.statistics \ + memory.vmstat.slabinfo memory.vmstat.disk \ + files \ + net.sockets net.statistics +################################################################################ +users.current.app=id +users.current.args=-a +users.logged.app=query +users.logged.args=user + +disk.app=df +disk.args=-h + +env.app=env + +system.events.app=powershell +system.events.delimiter=\0 +system.events.system.args=-NoLogo\0-Command\0Get-EventLog System -After (Get-Date).AddDays(-1) | Format-List +system.events.application.args=-NoLogo\0-Command\0Get-EventLog Application -After (Get-Date).AddDays(-1) | Format-List + +system.os.app=wmic +system.os.args=os get /format:list + +process.top.app=top +process.top.args=-b -n 1 +process.ps.app=ps +process.ps.args=-efW +process.tasklist.app=tasklist +process.tasklist.args=/V + +memory.free.app=free +memory.vmstat.app=vmstat +memory.vmstat.statistics.args=-s +memory.vmstat.slabinfo.args=-m +memory.vmstat.disk.args=-d + +files.app=openfiles +files.args=/query + +net.sockets.app=bash +net.sockets.args=-c\0netstat -b -a -t -o || netstat -a -t -o +net.sockets.args.delimiter=\0 +net.statistics.app=netstat +net.statistics.args=-s -e +################################################################################ diff --git a/test/failure_handler/src/windows/native/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.c b/test/failure_handler/src/windows/native/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.c new file mode 100644 index 00000000000..f2155129316 --- /dev/null +++ b/test/failure_handler/src/windows/native/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.c @@ -0,0 +1,37 @@ +/* + * 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. + */ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +JNIEXPORT jlong JNICALL Java_jdk_test_failurehandler_jtreg_GatherProcessInfoTimeoutHandler_getWin32Pid + (JNIEnv* env, jobject o, jlong handle) { + return GetProcessId(handle); +} +#ifdef __cplusplus +} +#endif diff --git a/test/failure_handler/test/TEST.ROOT b/test/failure_handler/test/TEST.ROOT new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/failure_handler/test/sanity/Crash.java b/test/failure_handler/test/sanity/Crash.java new file mode 100644 index 00000000000..8ada290fd78 --- /dev/null +++ b/test/failure_handler/test/sanity/Crash.java @@ -0,0 +1,39 @@ +/* + * 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. + */ + +import sun.misc.Unsafe; + +import java.lang.reflect.Field; + +/* + * @test + * @run main/othervm Crash + */ +public class Crash { + public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException { + Field f = Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + Unsafe u = (Unsafe) f.get(null); + u.setMemory(0, 42, (byte) 0xFF); + } +} diff --git a/test/failure_handler/test/sanity/Deadlock.java b/test/failure_handler/test/sanity/Deadlock.java new file mode 100644 index 00000000000..d74c7a5de66 --- /dev/null +++ b/test/failure_handler/test/sanity/Deadlock.java @@ -0,0 +1,63 @@ +/* + * 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 + * @summary Deadlocked client + */ +public class Deadlock { + public double e; + private volatile int i; + + public static void main(String[] args) { + new Deadlock().test(); + } + private void test() { + final Object a = new Object(); + final Object b = new Object(); + + new Thread(new Runnable() { + @Override + public void run() { + synchronized (a) { + do { + i |= 1; + } while (i != 3); + + synchronized (b) { + e = 1; + } + } + }}).start(); + + synchronized (b) { + do { + i |= 2; + } while (i != 3); + synchronized (a) { + e = 2; + } + } + } +} diff --git a/test/failure_handler/test/sanity/Livelock.java b/test/failure_handler/test/sanity/Livelock.java new file mode 100644 index 00000000000..6ab96fdbb91 --- /dev/null +++ b/test/failure_handler/test/sanity/Livelock.java @@ -0,0 +1,55 @@ +/* + * 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 + * @summary Busy infinite loop client, calculating E number + */ +public class Livelock { + + public static double elim; + + public static void main(String[] args) { + System.out.printf( + "%24s %24s %24s %24s %24s %24s%n", + "n", "n!", "e = lim(...)", "e = taylor series", + "err e-lim", "err e-taylor"); + + while (true) { + double esum = 2; + double nfac = 1; + double iter = 1; + for (double n = 1; !Double.isInfinite(n) && !Double.isNaN(n) ; n = n * 2) { + elim = Math.pow(1 + 1 / n, n); + + iter += 1; + nfac *= iter; + esum += 1 / nfac; + + System.out.printf("% 24.16e % 24.16e % 24.16e % 24.16e" + + "%- 24.16e %- 24.16e%n", + n, nfac, elim, esum, (Math.E - elim), (Math.E - esum)); + } + } + } +} diff --git a/test/failure_handler/test/sanity/OOME.java b/test/failure_handler/test/sanity/OOME.java new file mode 100644 index 00000000000..6cec15b3e8d --- /dev/null +++ b/test/failure_handler/test/sanity/OOME.java @@ -0,0 +1,49 @@ +/* + * 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. + */ + + +import java.util.LinkedList; + +/* + * @test + * @summary Slowly eat all memory in an infinite loop + * @run main/othervm Crash + */ +public class OOME { + @SuppressWarnings ("UnusedDeclaration") + private static Object garbage; + public static void main(String args[]) { + + int chunkSize = 0x8000; + LinkedList list = new LinkedList<>(); + garbage = list; + + while (true) { + try { + list.add(new int[chunkSize]); + } catch (OutOfMemoryError e) { + chunkSize >>= 1; + } + } + } +} diff --git a/test/failure_handler/test/sanity/Suicide.java b/test/failure_handler/test/sanity/Suicide.java new file mode 100644 index 00000000000..0cc1c4a3fe0 --- /dev/null +++ b/test/failure_handler/test/sanity/Suicide.java @@ -0,0 +1,55 @@ +/* + * 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. + */ + + + +import java.lang.management.ManagementFactory; + +/* + * @test + * @summary Suicide test + * @run main/othervm Crash + */ +public class Suicide { + public static void main(String[] args) { + String cmd = null; + try { + String pidStr = ManagementFactory.getRuntimeMXBean().getName() + .split("@")[0]; + String osName = System.getProperty("os.name"); + if (osName.contains("Windows")) { + cmd = "taskkill.exe /F /PID " + pidStr; + } else { + cmd = "kill -9 " + pidStr; + } + + System.out.printf("executing `%s'%n", cmd); + Runtime.getRuntime().exec(cmd); + Thread.sleep(2000); + } catch (Exception e) { + e.printStackTrace(); + } + System.err.printf("TEST/ENV BUG: %s didn't kill JVM%n", cmd); + System.exit(1); + } +} diff --git a/test/failure_handler/test/sanity/SystemExit.java b/test/failure_handler/test/sanity/SystemExit.java new file mode 100644 index 00000000000..e0eabb77f57 --- /dev/null +++ b/test/failure_handler/test/sanity/SystemExit.java @@ -0,0 +1,32 @@ +/* + * 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 + * @run main/othervm SystemExit + */ +public class SystemExit { + public static void main(String[] args) { + System.exit(1); + } +} diff --git a/test/failure_handler/test/sanity/ThrowError.java b/test/failure_handler/test/sanity/ThrowError.java new file mode 100644 index 00000000000..45100d6862b --- /dev/null +++ b/test/failure_handler/test/sanity/ThrowError.java @@ -0,0 +1,31 @@ +/* + * 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 + */ +public class ThrowError { + public static void main(String[] args) { + throw new Error("TEST FAIL"); + } +} diff --git a/test/failure_handler/test/sanity/WaitForDeadlock.java b/test/failure_handler/test/sanity/WaitForDeadlock.java new file mode 100644 index 00000000000..98f14bc31f3 --- /dev/null +++ b/test/failure_handler/test/sanity/WaitForDeadlock.java @@ -0,0 +1,44 @@ +/* + * 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. + */ + +import java.io.IOException; +import java.nio.file.Paths; + +/* + * @test + * @build Deadlock + * @run driver WaitForDeadlock + */ +public class WaitForDeadlock { + public static void main(String[] args) throws Exception { + System.out.println("START"); + ProcessBuilder pb = new ProcessBuilder(Paths.get( + System.getProperty("test.jdk"), "bin", "java").toString(), + "-cp", System.getProperty("java.class.path"), + Deadlock.class.getName()); + pb.redirectError(ProcessBuilder.Redirect.to(Paths.get("out").toFile())); + pb.redirectOutput(ProcessBuilder.Redirect.to(Paths.get("err").toFile())); + int r = pb.start().waitFor(); + System.out.println("END. " + r); + } +} diff --git a/test/failure_handler/test/unit/jdk/test/failurehandler/value/DefaultParserTest.java b/test/failure_handler/test/unit/jdk/test/failurehandler/value/DefaultParserTest.java new file mode 100644 index 00000000000..55297e09168 --- /dev/null +++ b/test/failure_handler/test/unit/jdk/test/failurehandler/value/DefaultParserTest.java @@ -0,0 +1,118 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.value; + +import org.junit.Assert; +import org.junit.Test; + +public class DefaultParserTest { + @Test + public void testParseStringArray() throws Exception { + DefaultParser parser = new DefaultParser(); + String line = "a aa aaa"; + String[] result = {"a", "aa", "", "", "aaa"}; + Assert.assertArrayEquals(result, + (Object[]) parser.parse(result.getClass(), line, " ")); + + line = null; + result = new String[]{}; + Assert.assertArrayEquals(result, + (Object[]) parser.parse(result.getClass(), line, " ")); + } + + @Test + public void testParseObjectArray() throws Exception { + DefaultParser parser = new DefaultParser(); + String line = "a aa aaa"; + String[] result = {"a", "aa", "", "", "aaa"}; + Assert.assertArrayEquals(result, + (String[]) parser.parse(result.getClass(), line, " ")); + Object[] result2 = {"a", "aa", "", "", "aaa"}; + Assert.assertArrayEquals(result2, + (Object[]) parser.parse(result.getClass(), line, " ")); + } + + @Test + public void testParseCharArray() throws Exception { + DefaultParser parser = new DefaultParser(); + String line = "a b c a"; + char[] result = {'a', 'b', 'c', 'a'}; + Assert.assertArrayEquals(result, + (char[]) parser.parse(result.getClass(), line, " ")); + + Character[] result2 = {'a', 'b', 'c', 'a'}; + Assert.assertArrayEquals(result2, + (Character[]) parser.parse(result2.getClass(), line, " ")); + } + + @Test + public void testParseBoolean() throws Exception { + DefaultParser parser = new DefaultParser(); + String line = "a b c a"; + Assert.assertEquals(false, + (boolean) parser.parse(boolean.class, line, " ")); + Assert.assertEquals(Boolean.FALSE, + parser.parse(Boolean.class, line, " ")); + line = "trUe"; + Assert.assertEquals(true, + (boolean) parser.parse(boolean.class, line, " ")); + Assert.assertEquals(Boolean.TRUE, + parser.parse(Boolean.class, line, " ")); + } + + @Test + public void testParseShort() throws Exception { + DefaultParser parser = new DefaultParser(); + Assert.assertSame("10", (short) 10, + parser.parse(short.class, "10", " ")); + Assert.assertSame("010", (short) 8, + parser.parse(short.class, "010", " ")); + Assert.assertSame("0x10", (short) 16, + parser.parse(short.class, "0x10", " ")); + } + + @Test + public void testParseByte() throws Exception { + DefaultParser parser = new DefaultParser(); + Assert.assertSame("11", (byte) 11, + parser.parse(byte.class, "11", " ")); + Assert.assertSame("011", (byte) 9, + parser.parse(byte.class, "011", " ")); + Assert.assertSame("0x11", (byte) 17, + parser.parse(byte.class, "0x11", " ")); + } + + @Test + public void testParseInt() throws Exception { + DefaultParser parser = new DefaultParser(); + Assert.assertEquals("20", (int) 20, + parser.parse(int.class, "20", " ")); + Assert.assertEquals("020", (int) 16, + parser.parse(int.class, "020", " ")); + Assert.assertEquals("0x20", (int) 32, + parser.parse(int.class, "0x20", " ")); + } + + +} diff --git a/test/failure_handler/test/unit/jdk/test/failurehandler/value/ValueHandlerTest.java b/test/failure_handler/test/unit/jdk/test/failurehandler/value/ValueHandlerTest.java new file mode 100644 index 00000000000..51e8205ffcf --- /dev/null +++ b/test/failure_handler/test/unit/jdk/test/failurehandler/value/ValueHandlerTest.java @@ -0,0 +1,110 @@ +/* + * 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. + */ + +package jdk.test.failurehandler.value; + +import org.junit.Assert; +import org.junit.Test; + +import java.lang.reflect.Field; +import java.util.Properties; + +public class ValueHandlerTest { + @Test + public void testApplyAnonymousPrivateFinalInt() throws Exception { + Properties p = new Properties(); + p.put("int", "010"); + Object o = new Object() { + @Value (name = "int") + private final int i1 = -1; + }; + Field f = o.getClass().getDeclaredField("i1"); + f.setAccessible(true); + int value = f.getInt(o); + Assert.assertEquals(value, -1); + f.setAccessible(false); + ValueHandler.apply(o, p, null); + f.setAccessible(true); + value = f.getInt(o); + Assert.assertEquals(value, 8); + f.setAccessible(false); + } + + @Test + public void testApplyPublicStaticWithDefault() throws Exception { + Assert.assertEquals(StaticDefaultCase.s, null); + Properties p = new Properties(); + StaticDefaultCase o = new StaticDefaultCase(); + ValueHandler.apply(o, p, "prefix"); + Assert.assertEquals(StaticDefaultCase.s, "default"); + p.put("s", "new2"); + ValueHandler.apply(o, p, "prefix"); + Assert.assertEquals(StaticDefaultCase.s, "new2"); + p.put("prefix.s", "new"); + ValueHandler.apply(o, p, "prefix"); + Assert.assertEquals(StaticDefaultCase.s, "new"); + ValueHandler.apply(o, p, null); + Assert.assertEquals(StaticDefaultCase.s, "new2"); + } + + protected class InnerClass1 { + @Value (name = "innerClass") + String[] arr = null; + } + + public class InnerClass2 extends InnerClass1 { + @Value (name = "float") + float f = 0.0f; + + @SubValues (prefix = "inner") + InnerClass1 inner1 = new InnerClass1(); + + @SubValues (prefix = "") + InnerClass1 inner2 = new InnerClass1(); + } + + @Test + public void testApplySub() throws Exception { + InnerClass2 o = new InnerClass2(); + Assert.assertArrayEquals(o.arr, null); + Assert.assertArrayEquals(o.inner1.arr, null); + Assert.assertArrayEquals(o.inner2.arr, null); + Assert.assertEquals(o.f, 0.0f, Float.MIN_VALUE); + + Properties p = new Properties(); + p.put("float", "1.f"); + p.put("innerClass", "a b"); + p.put("inner.innerClass", "a b c"); + ValueHandler.apply(o, p, ""); + Assert.assertArrayEquals(o.arr, new String[]{"a", "b"}); + Assert.assertArrayEquals(o.inner1.arr, new String[]{"a", "b", "c"}); + Assert.assertArrayEquals(o.inner2.arr, new String[]{"a", "b"}); + Assert.assertEquals(o.f, 1.0f, Float.MIN_VALUE); + } +} + +class StaticDefaultCase { + @Value (name = "s") + @DefaultValue (value = "default") + public static String s; +} From 67e52adf51c8334abe83acf1e21da5b979abd0ce Mon Sep 17 00:00:00 2001 From: Alexander Smundak Date: Fri, 11 Dec 2015 10:45:46 -0800 Subject: [PATCH 008/228] 8073139: PPC64: User-visible arch directory and os.arch value on ppc64le cause issues with Java tooling Set VAR_CPU value to ppc64le on the little-endian PowerPC64. Co-authored-by: Andrew Hughes Reviewed-by: dholmes, ihse --- common/autoconf/generated-configure.sh | 24 ++++++++++++------------ common/autoconf/platform.m4 | 2 +- common/bin/unshuffle_list.txt | 1 + 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 9318de77b41..139e0e0631d 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -4052,6 +4052,15 @@ pkgadd_help() { # +################################################################################ +# +# Static build support. When enabled will generate static +# libraries instead of shared libraries for all JDK libs. +# + + + + # # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4091,15 +4100,6 @@ pkgadd_help() { -################################################################################ -# -# Static build support. When enabled will generate static -# libraries instead of shared libraries for all JDK libs. -# - - - - # # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4709,7 +4709,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1449049746 +DATE_WHEN_GENERATED=1449859210 ############################################################################### # @@ -14688,7 +14688,7 @@ test -n "$target_alias" && VAR_CPU_ENDIAN=big ;; powerpc64le) - VAR_CPU=ppc64 + VAR_CPU=ppc64le VAR_CPU_ARCH=ppc VAR_CPU_BITS=64 VAR_CPU_ENDIAN=little @@ -14827,7 +14827,7 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; } VAR_CPU_ENDIAN=big ;; powerpc64le) - VAR_CPU=ppc64 + VAR_CPU=ppc64le VAR_CPU_ARCH=ppc VAR_CPU_BITS=64 VAR_CPU_ENDIAN=little diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 index 203b6285a06..3b7e3e33e5d 100644 --- a/common/autoconf/platform.m4 +++ b/common/autoconf/platform.m4 @@ -67,7 +67,7 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU], VAR_CPU_ENDIAN=big ;; powerpc64le) - VAR_CPU=ppc64 + VAR_CPU=ppc64le VAR_CPU_ARCH=ppc VAR_CPU_BITS=64 VAR_CPU_ENDIAN=little diff --git a/common/bin/unshuffle_list.txt b/common/bin/unshuffle_list.txt index 68acb88fde4..1c704041649 100644 --- a/common/bin/unshuffle_list.txt +++ b/common/bin/unshuffle_list.txt @@ -378,6 +378,7 @@ jdk/src/java.base/unix/conf/arm/jvm.cfg : jdk/src/solaris/bin/arm/jvm.cfg jdk/src/java.base/unix/conf/i586/jvm.cfg : jdk/src/solaris/bin/i586/jvm.cfg jdk/src/java.base/unix/conf/ia64/jvm.cfg : jdk/src/solaris/bin/ia64/jvm.cfg jdk/src/java.base/unix/conf/ppc64/jvm.cfg : jdk/src/solaris/bin/ppc64/jvm.cfg +jdk/src/java.base/unix/conf/ppc64le/jvm.cfg : jdk/src/solaris/bin/ppc64le/jvm.cfg jdk/src/java.base/unix/conf/ppc/jvm.cfg : jdk/src/solaris/bin/ppc/jvm.cfg jdk/src/java.base/unix/conf/sdp/sdp.conf.template : jdk/src/solaris/lib/sdp/sdp.conf.template jdk/src/java.base/unix/conf/sparc/jvm.cfg : jdk/src/solaris/bin/sparc/jvm.cfg From 85c44d96823cd695d4b238b0d2a01874329ac9dc Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Wed, 16 Dec 2015 01:16:49 -0500 Subject: [PATCH 009/228] 8145427: [aix] xlc: wrong flag used to switch off optimization Just a small typo in flags.m4 Reviewed-by: dholmes --- common/autoconf/flags.m4 | 2 +- common/autoconf/generated-configure.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index 88f2e89dd6f..e35d25111cc 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -475,7 +475,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], C_O_FLAG_HI="-O3 -qstrict" C_O_FLAG_NORM="-O2" C_O_FLAG_DEBUG="-qnoopt" - C_O_FLAG_NONE="-qnoop" + C_O_FLAG_NONE="-qnoopt" elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then C_O_FLAG_HIGHEST="-O2" C_O_FLAG_HI="-O1" diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 2b7000bd591..3980351d761 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -4728,7 +4728,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1449859210 +DATE_WHEN_GENERATED=1450246539 ############################################################################### # @@ -46926,7 +46926,7 @@ $as_echo "$supports" >&6; } C_O_FLAG_HI="-O3 -qstrict" C_O_FLAG_NORM="-O2" C_O_FLAG_DEBUG="-qnoopt" - C_O_FLAG_NONE="-qnoop" + C_O_FLAG_NONE="-qnoopt" elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then C_O_FLAG_HIGHEST="-O2" C_O_FLAG_HI="-O1" From 83e2c4bdf7b3003dc19ee2769c92b04e026cb689 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Thu, 17 Dec 2015 10:16:27 +0100 Subject: [PATCH 010/228] 8145564: 8036003: startup regression on linux fastdebug builds Reviewed-by: ihse --- common/autoconf/generated-configure.sh | 14 +++++++++++--- common/autoconf/jdk-options.m4 | 12 ++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index a322c533c01..b80d7355aac 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -4728,7 +4728,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1449850507 +DATE_WHEN_GENERATED=1450343758 ############################################################################### # @@ -47677,7 +47677,10 @@ $as_echo "$NATIVE_DEBUG_SYMBOLS" >&6; } ENABLE_DEBUG_SYMBOLS=true ZIP_DEBUGINFO_FILES=true - DEBUG_BINARIES=true + # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles + # will basically do slowdebug builds when DEBUG_BINARIES is set for + # fastdebug builds + DEBUG_BINARIES=false STRIP_POLICY=min_strip elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then ENABLE_DEBUG_SYMBOLS=false @@ -47687,6 +47690,8 @@ $as_echo "$NATIVE_DEBUG_SYMBOLS" >&6; } elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then ENABLE_DEBUG_SYMBOLS=false # -g option only ZIP_DEBUGINFO_FILES=false + # Fastdebug builds with this setting will essentially be slowdebug + # in hotspot. DEBUG_BINARIES=true STRIP_POLICY=no_strip STRIP="" @@ -47702,7 +47707,10 @@ $as_echo "$NATIVE_DEBUG_SYMBOLS" >&6; } ENABLE_DEBUG_SYMBOLS=true ZIP_DEBUGINFO_FILES=false - DEBUG_BINARIES=true + # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles + # will basically do slowdebug builds when DEBUG_BINARIES is set for + # fastdebug builds + DEBUG_BINARIES=false STRIP_POLICY=min_strip else as_fn_error $? "Allowed native debug symbols are: none, internal, external, zipped" "$LINENO" 5 diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 index 3f7a29e0abb..8236c201308 100644 --- a/common/autoconf/jdk-options.m4 +++ b/common/autoconf/jdk-options.m4 @@ -515,7 +515,10 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], ENABLE_DEBUG_SYMBOLS=true ZIP_DEBUGINFO_FILES=true - DEBUG_BINARIES=true + # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles + # will basically do slowdebug builds when DEBUG_BINARIES is set for + # fastdebug builds + DEBUG_BINARIES=false STRIP_POLICY=min_strip elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then ENABLE_DEBUG_SYMBOLS=false @@ -525,6 +528,8 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then ENABLE_DEBUG_SYMBOLS=false # -g option only ZIP_DEBUGINFO_FILES=false + # Fastdebug builds with this setting will essentially be slowdebug + # in hotspot. DEBUG_BINARIES=true STRIP_POLICY=no_strip STRIP="" @@ -540,7 +545,10 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], ENABLE_DEBUG_SYMBOLS=true ZIP_DEBUGINFO_FILES=false - DEBUG_BINARIES=true + # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles + # will basically do slowdebug builds when DEBUG_BINARIES is set for + # fastdebug builds + DEBUG_BINARIES=false STRIP_POLICY=min_strip else AC_MSG_ERROR([Allowed native debug symbols are: none, internal, external, zipped]) From 280ec689c6a24a9b39080fa24ef2b2d3c0a61e22 Mon Sep 17 00:00:00 2001 From: Kirill Zhaldybin Date: Thu, 17 Dec 2015 16:20:09 +0300 Subject: [PATCH 011/228] 8132723: Add tests which check that soft references to humongous objects should work correctly 8132724: Add tests which check that weak references to humongous objects should work correctly Reviewed-by: jmasa, dfazunen --- test/lib/sun/hotspot/WhiteBox.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java index 02a4c562993..6b7863ad938 100644 --- a/test/lib/sun/hotspot/WhiteBox.java +++ b/test/lib/sun/hotspot/WhiteBox.java @@ -140,6 +140,23 @@ public class WhiteBox { return g1IsHumongous0(o); } + private native boolean g1BelongsToHumongousRegion0(long adr); + public boolean g1BelongsToHumongousRegion(long adr) { + if (adr == 0) { + throw new IllegalArgumentException("adr argument should not be null"); + } + return g1BelongsToHumongousRegion0(adr); + } + + + private native boolean g1BelongsToFreeRegion0(long adr); + public boolean g1BelongsToFreeRegion(long adr) { + if (adr == 0) { + throw new IllegalArgumentException("adr argument should not be null"); + } + return g1BelongsToFreeRegion0(adr); + } + public native long g1NumMaxRegions(); public native long g1NumFreeRegions(); public native int g1RegionSize(); From 19cddada2c3960681befcbce2e8d54201676a41f Mon Sep 17 00:00:00 2001 From: Mikael Vidstedt Date: Tue, 22 Dec 2015 20:47:40 -0800 Subject: [PATCH 012/228] 8145828: JPRT hotspot push jobs should allow merge on push Reviewed-by: dholmes, iklam --- make/jprt.properties | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/make/jprt.properties b/make/jprt.properties index 30d974af888..1d66e76b1ca 100644 --- a/make/jprt.properties +++ b/make/jprt.properties @@ -34,13 +34,8 @@ jprt.selective.test.bundle.installation=true # The current release name jprt.tools.default.release=jdk9 -# Check if this is the equivalent of a hotspot push job -# Interpret -testset hotspot to mean exactly that -my.is.hotspot.job.hotspot=true -my.is.hotspot.job=${my.is.hotspot.job.${jprt.test.set}} - -# Disable syncing the source after builds and tests are done -jprt.sync.push=${my.is.hotspot.job ? false : true} +# Allow concurrent changes to be merged in prior to pushing +jprt.sync.push=true # Directories to be excluded from the source bundles jprt.bundle.exclude.src.dirs=build dist webrev From c28f46f6373f992ac29284bbade8154e4ffa7367 Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Wed, 23 Dec 2015 13:12:12 +0300 Subject: [PATCH 013/228] 8067194: Restructure hotspot/agent/src to conform the modular source layout Move sources under jdk.hotspot.agent Reviewed-by: ihse, erikj, jbachorik --- make/CompileJavaModules.gmk | 8 ++------ make/common/Modules.gmk | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index 83eb00338a9..06241b35ba9 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -367,10 +367,6 @@ jdk.compiler_CLEAN_FILES := $(wildcard \ ################################################################################ -jdk.hotspot.agent_SRC += \ - $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent \ - $(HOTSPOT_TOPDIR)/agent/src/share/classes \ - # jdk.hotspot.agent_ADD_JAVAC_FLAGS := $(DISABLE_WARNINGS),-overrides jdk.hotspot.agent_COPY := .png sa.js .properties @@ -381,9 +377,9 @@ ifeq ($(MODULE), jdk.hotspot.agent) # These can't be handled by COPY to SetupJavaCompilation since they chop off # one directory level. $(eval $(call SetupCopyFiles, COPY_SA_IMAGES, \ - SRC := $(HOTSPOT_TOPDIR)/agent/src/share/classes/images, \ + SRC := $(HOTSPOT_TOPDIR)/src/jdk.hotspot.agent/share/classes/images, \ DEST := $(JDK_OUTPUTDIR)/modules/$(MODULE), \ - FILES := $(wildcard $(HOTSPOT_TOPDIR)/agent/src/share/classes/images/*/*/*.gif), \ + FILES := $(wildcard $(HOTSPOT_TOPDIR)/src/jdk.hotspot.agent/share/classes/images/*/*/*.gif), \ )) jdk.hotspot.agent: $(COPY_SA_IMAGES) endif diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index c90e505b040..500f3a62350 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -49,25 +49,21 @@ ALL_TOP_SRC_DIRS := \ # # Find all modules with java sources by looking in the source dirs -# jdk.hotspot.agent currently doesn't comply with source dir policy. define FindJavaModules $(filter-out $(MODULES_FILTER), $(sort $(notdir \ $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir \ $(wildcard $(patsubst %,%/*/share/classes/*, $(ALL_TOP_SRC_DIRS)) \ $(patsubst %,%/*/$(OPENJDK_TARGET_OS)/classes/*, $(ALL_TOP_SRC_DIRS)) \ - $(patsubst %,%/*/$(OPENJDK_TARGET_OS_TYPE)/classes/*, $(ALL_TOP_SRC_DIRS))))))))))) \ - jdk.hotspot.agent) + $(patsubst %,%/*/$(OPENJDK_TARGET_OS_TYPE)/classes/*, $(ALL_TOP_SRC_DIRS)))))))))))) endef # Find all modules with source for the target platform. -# jdk.hotspot.agent currently doesn't comply with source dir policy. define FindAllModules $(sort $(filter-out $(MODULES_FILTER) closed demo sample, \ $(notdir $(patsubst %/,%, $(dir \ $(wildcard $(patsubst %, %/*/share, $(ALL_TOP_SRC_DIRS)) \ $(patsubst %, %/*/$(OPENJDK_TARGET_OS), $(ALL_TOP_SRC_DIRS)) \ - $(patsubst %, %/*/$(OPENJDK_TARGET_OS_TYPE), $(ALL_TOP_SRC_DIRS)))))) \ - jdk.hotspot.agent)) + $(patsubst %, %/*/$(OPENJDK_TARGET_OS_TYPE), $(ALL_TOP_SRC_DIRS)))))))) endef ################################################################################ From d9ae786b3b54036a8b2417321e5fffe5bc343094 Mon Sep 17 00:00:00 2001 From: Alejandro Murillo Date: Wed, 13 Jan 2016 12:45:33 -0800 Subject: [PATCH 014/228] 8146660: Resolve merge issue in resulting from sun.misc.VM move to jdk.internal.misc Reviewed-by: twisti, erikj, chegar --- make/Main.gmk | 4 ++++ modules.xml | 1 + 2 files changed, 5 insertions(+) diff --git a/make/Main.gmk b/make/Main.gmk index 3b60038e42d..ce315103b88 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -427,6 +427,10 @@ else # in javadoc. java.desktop-gensrc-jdk: java.base-gensrc + # The annotation processing for jdk.vm.ci needs java.base classes from the + # current JDK. + jdk.vm.ci-gensrc-hotspot: java.base-java + # Explicitly add dependencies for special targets java.base-java: unpack-sec diff --git a/modules.xml b/modules.xml index d7db4ed42d8..c5f8419faf3 100644 --- a/modules.xml +++ b/modules.xml @@ -237,6 +237,7 @@ jdk.charsets jdk.management.resource jdk.scripting.nashorn + jdk.vm.ci jdk.internal.org.objectweb.asm From 8c55662304867b4e18a38abaf614f168f0dd6d83 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Sat, 16 Jan 2016 13:01:43 +0100 Subject: [PATCH 015/228] 8146403: Windows build can be faster Reviewed-by: ihse --- common/autoconf/generated-configure.sh | 2 +- make/BuildStatic.gmk | 2 +- make/GenerateModuleDeps.gmk | 64 ++++++++++++++++++++++++++ make/HotspotWrapper.gmk | 10 ++-- make/Images.gmk | 50 +++++++++----------- make/Init.gmk | 19 ++++---- make/InitSupport.gmk | 33 +++++++------ make/MacBundles.gmk | 8 ++-- make/Main.gmk | 8 ++-- make/MainSupport.gmk | 1 - make/StripBinaries.gmk | 4 +- make/common/IdlCompilation.gmk | 5 +- make/common/MakeBase.gmk | 27 ++++++----- make/common/Modules.gmk | 26 +---------- make/common/NativeCompilation.gmk | 33 +++++++------ make/common/RMICompilation.gmk | 6 +-- make/common/TextFileProcessing.gmk | 12 ++--- 17 files changed, 178 insertions(+), 132 deletions(-) create mode 100644 make/GenerateModuleDeps.gmk diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 5ecfef8e2af..cf9f6832baf 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -4839,7 +4839,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1452780299 +DATE_WHEN_GENERATED=1452935762 ############################################################################### # diff --git a/make/BuildStatic.gmk b/make/BuildStatic.gmk index 0fc166a10f3..b8dceebafc7 100644 --- a/make/BuildStatic.gmk +++ b/make/BuildStatic.gmk @@ -41,7 +41,7 @@ MODULES_SYMBOLS_FILES := $(foreach module, $(EXPORTED_SYMBOLS_MODULES), \ $(SUPPORT_OUTPUTDIR)/modules_libs/$(module)/$(module).symbols) $(GLOBAL_SYMBOLS_FILE): $(MODULES_SYMBOLS_FILES) - $(ECHO) $(LOG_INFO) "Generating global exported.symbols file" + $(call LogInfo, Generating global exported.symbols file) $(MKDIR) -p $(@D) $(CAT) $^ > $@ diff --git a/make/GenerateModuleDeps.gmk b/make/GenerateModuleDeps.gmk new file mode 100644 index 00000000000..b5427dd89a5 --- /dev/null +++ b/make/GenerateModuleDeps.gmk @@ -0,0 +1,64 @@ +# +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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. +# + +# This file is included from Main.gmk only. + +include $(SRC_ROOT)/make/common/JavaCompilation.gmk +include $(SRC_ROOT)/make/common/SetupJavaCompilers.gmk + +################################################################################ + +$(eval $(call SetupJavaCompilation, BUILD_GENMODULESLIST, \ + SETUP := BOOT_JAVAC, \ + SRC := $(JDK_TOPDIR)/make/src/classes, \ + INCLUDES := build/tools/module, \ + EXCLUDE_FILES := ImageBuilder.java ModuleArchive.java, \ + BIN := $(MAKESUPPORT_OUTPUTDIR)/bt_classes_moduleslist, \ + DISABLE_SJAVAC := true, \ +)) + +TOOL_GENMODULESLIST = $(JAVA_SMALL) \ + -cp "$(MAKESUPPORT_OUTPUTDIR)/bt_classes_moduleslist" \ + build.tools.module.GenModulesList + +MODULES_LIST_FILE := $(MAKESUPPORT_OUTPUTDIR)/modules.list +# The module deps makefile is used from make/common/Modules.gmk +MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk + +$(MODULES_LIST_FILE): $(SRC_ROOT)/modules.xml $(BUILD_GENMODULESLIST) + $(TOOL_GENMODULESLIST) -o $@ $(filter %.xml, $^) + +$(MODULE_DEPS_MAKEFILE): $(MODULES_LIST_FILE) + $(CAT) $^ | $(SED) -e 's/^\([^:]*\):/DEPS_\1 :=/g' > $@ + +TARGETS += $(MODULE_DEPS_MAKEFILE) + +################################################################################ + +# Hook to include the corresponding custom file, if present. +$(eval $(call IncludeCustomExtension, , GenerateModuleDeps.gmk)) + +# Trigger generation of this file and restart make if it changed. +-include $(MODULE_DEPS_MAKEFILE) diff --git a/make/HotspotWrapper.gmk b/make/HotspotWrapper.gmk index e5ec544abcb..d356232195a 100644 --- a/make/HotspotWrapper.gmk +++ b/make/HotspotWrapper.gmk @@ -35,14 +35,18 @@ include MakeBase.gmk default: all -# Get all files except .hg in the hotspot directory. -HOTSPOT_FILES := $(shell $(FIND) -L $(HOTSPOT_TOPDIR) -name ".hg" -prune -o -print) +# Get all files in src, make or agent subdirs in hotspot directory and +# filter out .hg. This skips the test directory. +HOTSPOT_FILES := $(shell $(FIND) -L \ + $(HOTSPOT_TOPDIR)/src $(HOTSPOT_TOPDIR)/make $(HOTSPOT_TOPDIR)/agent \ + -name ".hg" -prune -o -print) # The old build creates hotspot output dir before calling hotspot and # not doing it breaks builds on msys. $(HOTSPOT_OUTPUTDIR)/_hotspot.timestamp: $(HOTSPOT_FILES) @$(MKDIR) -p $(HOTSPOT_OUTPUTDIR) - @($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) $(HOTSPOT_MAKE_ARGS) LOG_LEVEL=$(LOG_LEVEL) SPEC=$(HOTSPOT_SPEC) BASE_SPEC=$(BASE_SPEC)) + @($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) $(HOTSPOT_MAKE_ARGS) \ + LOG_LEVEL=$(LOG_LEVEL) SPEC=$(HOTSPOT_SPEC) BASE_SPEC=$(BASE_SPEC)) $(TOUCH) $@ hotspot: $(HOTSPOT_OUTPUTDIR)/_hotspot.timestamp diff --git a/make/Images.gmk b/make/Images.gmk index cfc934d4c07..ca6a4e2d8bf 100644 --- a/make/Images.gmk +++ b/make/Images.gmk @@ -248,38 +248,38 @@ ifneq ($(OPENJDK_TARGET_OS), windows) endif $(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/% - $(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(install-file) $(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/% - $(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(install-file) $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% - $(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(install-file) $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% - $(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(install-file) ifeq ($(OPENJDK_TARGET_OS), solaris) $(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% - $(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(call LogInfo, Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(install-file) $(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% - $(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(call LogInfo, Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(install-file) endif ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), ) $(JRE_IMAGE_DIR)/man/ja: - $(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(call LogInfo, Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja $(JDK_IMAGE_DIR)/man/ja: - $(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(call LogInfo, Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja endif @@ -333,7 +333,7 @@ JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/, $(JDK_DOC_FILES)) # Processing license files from source area to image area # These are modified to have the platform specific EOL chars. define process-doc-file - $(ECHO) $(LOG_INFO) Processing $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(call LogInfo, Processing $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(MKDIR) -p $(@D) $(RM) $@ LC_ALL=C $(SED) 's/$$//g' $< > $@ @@ -378,7 +378,7 @@ endef # Param 1 - The file containing the MODULES list define prepare-info-file - $(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(MKDIR) -p $(@D) $(RM) $@ endef @@ -426,38 +426,30 @@ JRE_COMPACT3_TARGETS += $(JRE_COMPACT3_INFO_FILE) # src.zip $(JDK_IMAGE_DIR)/src.zip: $(SUPPORT_OUTPUTDIR)/src.zip - $(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(install-file) JDK_TARGETS += $(JDK_IMAGE_DIR)/src.zip ################################################################################ # /demo dir - -# The db demo contains an empty dir that needs to be copied. The other -# directories will always trigger the rule for recompile since -# _the.list_of_packages files are touched. ifneq ($(findstring images, $(MAKECMDGOALS)), ) - $(JDK_IMAGE_DIR)/demo/%: $(SUPPORT_OUTPUTDIR)/demos/image/% - if [ ! -d "$@" ]; then \ - $(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'; \ - $(MKDIR) -p $(@D); \ - if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) '$<' '$@'; fi \ - fi + $(eval $(call SetupCopyFiles, JDK_COPY_DEMOS, \ + SRC := $(SUPPORT_OUTPUTDIR)/demos/image, \ + DEST := $(JDK_IMAGE_DIR)/demo, \ + FILES := $(if $(wildcard $(SUPPORT_OUTPUTDIR)/demos/image), \ + $(call DoubleDollar, $(call DoubleDollar, \ + $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/demos/image \ + -type f -a ! \( -name "_the*" -o -name "javac_state" \) )))), \ + )) - # Find all files including directories - JDK_DEMO_TARGETS := $(if $(wildcard $(SUPPORT_OUTPUTDIR)/demos/image), \ - $(patsubst $(SUPPORT_OUTPUTDIR)/demos/image/%, $(JDK_IMAGE_DIR)/demo/%, \ - $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/demos/image \ - ! \( -name "_the*" -o -name "javac_state" \) ))) - - JDK_TARGETS += $(JDK_DEMO_TARGETS) + JDK_TARGETS += $(JDK_COPY_DEMOS) endif ################################################################################ # /sample dir -$(eval $(call SetupCopyFiles,COPY_SAMPLES, \ +$(eval $(call SetupCopyFiles, COPY_SAMPLES, \ SRC := $(SUPPORT_OUTPUTDIR)/sample/image, \ DEST := $(JDK_IMAGE_DIR)/sample, \ FILES := $(if $(wildcard $(SUPPORT_OUTPUTDIR)/sample/image), \ diff --git a/make/Init.gmk b/make/Init.gmk index 3627d12579c..a231526db05 100644 --- a/make/Init.gmk +++ b/make/Init.gmk @@ -226,8 +226,8 @@ else # HAS_SPEC=true $(eval $(call ParseCompareBuild)) ifeq ($(LOG_NOFILE), true) - # Disable log wrapper if LOG=[level,]nofile was given - override BUILD_LOG_WRAPPER := + # Disable build log if LOG=[level,]nofile was given + override BUILD_LOG_PIPE := endif ifeq ($(OUTPUT_SYNC_SUPPORTED), true) @@ -277,10 +277,10 @@ else # HAS_SPEC=true ifneq ($(SEQUENTIAL_TARGETS)$(PARALLEL_TARGETS), ) $(call RotateLogFiles) $(call PrepareFailureLogs) - $(BUILD_LOG_WRAPPER) $(PRINTF) "Building $(TARGET_DESCRIPTION)\n" + $(PRINTF) "Building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE) ifneq ($(SEQUENTIAL_TARGETS), ) # Don't touch build output dir since we might be cleaning. That - # means no log wrapper. + # means no log pipe. ( cd $(TOPDIR) && \ $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \ $(SEQUENTIAL_TARGETS) ) @@ -289,11 +289,12 @@ else # HAS_SPEC=true $(call StartGlobalTimer) $(call PrepareSmartJavac) ( cd $(TOPDIR) && \ - $(BUILD_LOG_WRAPPER) $(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \ + $(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \ -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \ - $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) || \ - ( exitcode=$$? && $(BUILD_LOG_WRAPPER) \ - $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" && \ + $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \ + ( exitcode=$$? && \ + $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \ + $(BUILD_LOG_PIPE) && \ cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk \ HAS_SPEC=true on-failure ; \ exit $$exitcode ) ) @@ -301,7 +302,7 @@ else # HAS_SPEC=true $(call StopGlobalTimer) $(call ReportBuildTimes) endif - $(BUILD_LOG_WRAPPER) $(PRINTF) "Finished building $(TARGET_DESCRIPTION)\n" + $(PRINTF) "Finished building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE) endif on-failure: diff --git a/make/InitSupport.gmk b/make/InitSupport.gmk index 4211ce6228f..6e10c7b59e3 100644 --- a/make/InitSupport.gmk +++ b/make/InitSupport.gmk @@ -155,7 +155,7 @@ ifeq ($(HAS_SPEC),) else ifeq ($$(LOG_LEVEL), debug) MAKE_LOG_FLAGS := else ifeq ($$(LOG_LEVEL), trace) - MAKE_LOG_FLAGS := -d + MAKE_LOG_FLAGS := else $$(info Error: LOG must be one of: warn, info, debug or trace.) $$(error Cannot continue) @@ -235,11 +235,15 @@ ifeq ($(HAS_SPEC),) $$(foreach var, $$(all_confs), $$(info * $$(var))) $$(error Cannot continue) else - ifeq ($$(words $$(matching_confs)), 1) - $$(info Building configuration '$$(matching_confs)' (matching CONF=$$(CONF))) - else - $$(info Building these configurations (matching CONF=$$(CONF)):) - $$(foreach var, $$(matching_confs), $$(info * $$(var))) + # Don't repeat this output on make restarts caused by including + # generated files. + ifeq ($$(MAKE_RESTARTS),) + ifeq ($$(words $$(matching_confs)), 1) + $$(info Building configuration '$$(matching_confs)' (matching CONF=$$(CONF))) + else + $$(info Building these configurations (matching CONF=$$(CONF)):) + $$(foreach var, $$(matching_confs), $$(info * $$(var))) + endif endif endif @@ -284,7 +288,7 @@ ifeq ($(HAS_SPEC),) $$(main_targets_file): @( cd $$(topdir) && \ - $$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(topdir)/make/Main.gmk \ + $$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(topdir)/make/Main.gmk \ -I $$(topdir)/make/common SPEC=$(strip $2) NO_RECIPES=true \ LOG_LEVEL=$$(LOG_LEVEL) \ create-main-targets-include ) @@ -313,7 +317,7 @@ else # $(HAS_SPEC)=true BUILD_LOG := $(OUTPUT_ROOT)/build.log BUILD_TRACE_LOG := $(OUTPUT_ROOT)/build-trace-time.log - BUILD_LOG_WRAPPER := $(BASH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG) + BUILD_LOG_PIPE := > >($(TEE) -a $(BUILD_LOG)) 2> >($(TEE) -a $(BUILD_LOG) >&2) # Sanity check the spec file, so it matches this source code define CheckSpecSanity @@ -455,7 +459,7 @@ else # $(HAS_SPEC)=true endef define RotateLogFiles - $(RM) $(BUILD_LOG).old 2> /dev/null + $(RM) $(BUILD_LOG).old 2> /dev/null && \ $(MV) $(BUILD_LOG) $(BUILD_LOG).old 2> /dev/null || true $(if $(findstring trace, $(LOG_LEVEL)), \ $(RM) $(BUILD_TRACE_LOG).old 2> /dev/null && \ @@ -464,7 +468,7 @@ else # $(HAS_SPEC)=true endef define PrepareFailureLogs - $(RM) -r $(MAKESUPPORT_OUTPUTDIR)/failure-logs 2> /dev/null + $(RM) -r $(MAKESUPPORT_OUTPUTDIR)/failure-logs 2> /dev/null && \ $(MKDIR) -p $(MAKESUPPORT_OUTPUTDIR)/failure-logs endef @@ -483,8 +487,8 @@ else # $(HAS_SPEC)=true endef define StartGlobalTimer - $(RM) -r $(BUILDTIMESDIR) 2> /dev/null - $(MKDIR) -p $(BUILDTIMESDIR) + $(RM) -r $(BUILDTIMESDIR) 2> /dev/null && \ + $(MKDIR) -p $(BUILDTIMESDIR) && \ $(call RecordStartTime,TOTAL) endef @@ -495,13 +499,14 @@ else # $(HAS_SPEC)=true # Find all build_time_* files and print their contents in a list sorted # on the name of the sub repository. define ReportBuildTimes - $(BUILD_LOG_WRAPPER) $(PRINTF) $(LOG_INFO) -- \ + $(PRINTF) $(LOG_INFO) -- \ "----- Build times -------\nStart %s\nEnd %s\n%s\n%s\n-------------------------\n" \ "`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \ "`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \ "`$(LS) $(BUILDTIMESDIR)/build_time_diff_* | $(GREP) -v _TOTAL | \ $(XARGS) $(CAT) | $(SORT) -k 2`" \ - "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`" + "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`" \ + $(BUILD_LOG_PIPE) endef endif # HAS_SPEC diff --git a/make/MacBundles.gmk b/make/MacBundles.gmk index d49921dff8a..ea8913eded5 100644 --- a/make/MacBundles.gmk +++ b/make/MacBundles.gmk @@ -57,23 +57,23 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) # Copy empty directories (jre/lib/applet). $(JDK_MACOSX_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/% - $(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(LOG_INFO) + $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(MKDIR) -p $(@D) if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi $(JRE_MACOSX_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/% - $(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(LOG_INFO) + $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(MKDIR) -p $(@D) if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi $(JDK_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib: - $(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(LOG_INFO) + $(call LogInfo, Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(MKDIR) -p $(@D) $(RM) $@ $(LN) -s ../Home/lib/jli/libjli.dylib $@ $(JRE_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib: - $(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(LOG_INFO) + $(call LogInfo, Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(MKDIR) -p $(@D) $(RM) $@ $(LN) -s ../Home/lib/jli/libjli.dylib $@ diff --git a/make/Main.gmk b/make/Main.gmk index 3b60038e42d..ae0ea431e0b 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -42,6 +42,8 @@ include $(SRC_ROOT)/make/MainSupport.gmk # Load the vital tools for all the makefiles. include $(SRC_ROOT)/make/common/MakeBase.gmk +# Explicitly generate module deps makefile data +include $(SRC_ROOT)/make/GenerateModuleDeps.gmk include $(SRC_ROOT)/make/common/Modules.gmk # Declare ALL_TARGETS as an immediate variable. This variable is a list of all @@ -78,7 +80,7 @@ interim-cldrconverter: +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimCLDRConverter.gmk) buildtools-jdk: - +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools) + +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileTools.gmk) ALL_TARGETS += buildtools-langtools interim-langtools \ interim-rmic interim-cldrconverter buildtools-jdk @@ -218,7 +220,7 @@ ALL_TARGETS += demos-jdk samples-jdk # used to track the exact sources used to build that image. source-tips: $(SUPPORT_OUTPUTDIR)/source_tips $(SUPPORT_OUTPUTDIR)/source_tips: FRC - @$(MKDIR) -p $(@D) + $(call MakeDir, $(@D)) @$(RM) $@ @$(call GetSourceTips) @@ -656,7 +658,7 @@ print-modules: @$(ECHO) $(sort $(ALL_MODULES)) create-main-targets-include: - @$(ECHO) $(LOG_INFO) Generating main target list + $(call LogInfo, Generating main target list) @$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \ $(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk diff --git a/make/MainSupport.gmk b/make/MainSupport.gmk index 8131da75c91..be697f663cf 100644 --- a/make/MainSupport.gmk +++ b/make/MainSupport.gmk @@ -141,7 +141,6 @@ define DeclareRecipeForModuleMakefile else $2-$$($1_TARGET_SUFFIX): endif - $(ECHO) $(LOG_INFO) "Building $$@" ifeq ($$($1_USE_WRAPPER), true) +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) \ -f ModuleWrapper.gmk \ diff --git a/make/StripBinaries.gmk b/make/StripBinaries.gmk index 62f3b137763..63d3ca65a0c 100644 --- a/make/StripBinaries.gmk +++ b/make/StripBinaries.gmk @@ -40,8 +40,8 @@ MODULES_LIBS_STRIPPED := $(SUPPORT_OUTPUTDIR)/modules_libs-stripped ifneq ($(STRIP), ) define StripRecipe - $(ECHO) Stripping $(LOG_INFO) $(patsubst $(OUTPUT_ROOT)/%,%,$<) - $(MKDIR) -p $(@D) + $(call LogInfo, Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<)) + $(call MakeDir, $(@D)) $(CP) $< $@.tmp $(CHMOD) u+w $@.tmp $(STRIP) $(STRIPFLAGS) $@.tmp diff --git a/make/common/IdlCompilation.gmk b/make/common/IdlCompilation.gmk index 38c2704b93b..ab08004a0d0 100644 --- a/make/common/IdlCompilation.gmk +++ b/make/common/IdlCompilation.gmk @@ -56,10 +56,9 @@ define add_idl_package $4_OLDIMPLBASE_MSG:=with -oldImplBase endif $5 : $4 - $(MKDIR) -p $3/$$($4_TMPDIR) + $$(call LogInfo, Compiling IDL $(patsubst $2/%,%,$4)) + $$(call MakeDir, $$(@D)) $(RM) -rf $3/$$($4_TMPDIR) - $(MKDIR) -p $(dir $5) - $(ECHO) $(LOG_INFO) Compiling IDL $(patsubst $2/%,%,$4) $8 -td $3/$$($4_TMPDIR) \ -i $2/org/omg/CORBA \ -i $2/org/omg/PortableInterceptor \ diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk index ad4e3548605..1f3bdb76650 100644 --- a/make/common/MakeBase.gmk +++ b/make/common/MakeBase.gmk @@ -86,8 +86,7 @@ BUILDTIMESDIR=$(OUTPUT_ROOT)/make-support/build-times # Record starting time for build of a sub repository. define RecordStartTime - $(MKDIR) -p $(BUILDTIMESDIR) - $(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) + $(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) && \ $(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)_human_readable endef @@ -233,6 +232,7 @@ else # HAS_FILE_FUNCTION endef endif # HAS_FILE_FUNCTION +################################################################################ # The source tips can come from the Mercurial repository, or in the files # $(HGTIP_FILENAME) which contains the tip but is also positioned in the same # directory as the original $(HGDIR) directory. @@ -264,12 +264,14 @@ define GetSourceTips $(PRINTF) "\n" >> $@ endef -# Create the HGTIP_FILENAME file. Called from jdk/make/closed/bundles.gmk +# Create the HGTIP_FILENAME file. Called from closed/make/SourceBundles.gmk define CreateHgTip $(HG) tip --repository $1 --template '{node|short}\n' > $1/$(HGTIP_FILENAME); \ $(ECHO) $1/$(HGTIP_FILENAME) endef +################################################################################ + define SetupLogging ifeq ($$(LOG_LEVEL), trace) # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make @@ -368,9 +370,9 @@ endef ################################################################################ # Make directory without forking mkdir if not needed +# 1: List of directories to create MakeDir = \ - $(strip $(if $(subst $(wildcard $1 $2 $3 $4 $5 $6 $7 $8 $9),,$(strip $1 $2 $3 $4 $5 $6 $7 $8 $9)),\ - $(shell $(MKDIR) -p $1 $2 $3 $4 $5 $6 $7 $8 $9))) + $(strip $(if $(wildcard $1), , $(shell $(MKDIR) -p $1))) ################################################################################ # Assign a variable only if it is empty @@ -418,7 +420,8 @@ else # Running mkdir and cp in the same shell speeds up copy intensive tasks in Cygwin # significantly. define install-file - $(MKDIR) -p '$(@D)' && $(CP) -fP '$<' '$@' + $(call MakeDir, $(@D)) + $(CP) -fP '$<' '$@' endef endif @@ -518,9 +521,9 @@ ifneq ($(DISABLE_CACHE_FIND), true) # Param 1 - Dirs to find in # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression. define CacheFind - $(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \ + $(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \ $(shell $(FIND) $1 \( -type f -o -type l \) $2), \ - $(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(FIND_CACHE))) + $(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(FIND_CACHE))) endef else @@ -541,7 +544,7 @@ define AddFileToCopy # 3 : Variable to add targets to # 4 : Macro to call for copy operation $2: $1 - $(ECHO) $(LOG_INFO) Copying $$(patsubst $(OUTPUT_ROOT)/%,%,$$@) + $$(call LogInfo, Copying $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)) $$($$(strip $4)) $3 += $2 @@ -686,8 +689,10 @@ DependOnVariable = \ # Param 2 - A compact but representative name to describe this command # Param 3 - Command to run LogFailures = \ - ( ($(BASH) $(SRC_ROOT)/common/bin/logger.sh $1 $3 && $(RM) $1) || \ - (exitcode=$(DOLLAR)$(DOLLAR)? && $(MV) $1 $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(strip $2).log && exit $(DOLLAR)$(DOLLAR)exitcode) ) + ( $3 > >($(TEE) $1) 2> >($(TEE) $1 >&2) || \ + (exitcode=$(DOLLAR)$(DOLLAR)? && \ + $(CP) $1 $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(strip $2).log && \ + exit $(DOLLAR)$(DOLLAR)exitcode) ) ################################################################################ # Find lib dir for module diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index c90e505b040..8426145e1a8 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -26,9 +26,6 @@ ifndef _MODULES_GMK _MODULES_GMK := 1 -include JavaCompilation.gmk -include SetupJavaCompilers.gmk - ################################################################################ # Some platforms don't have the serviceability agent ifeq ($(INCLUDE_SA), false) @@ -71,29 +68,8 @@ define FindAllModules endef ################################################################################ - -$(eval $(call SetupJavaCompilation,BUILD_GENMODULESLIST, \ - SETUP := BOOT_JAVAC, \ - SRC := $(JDK_TOPDIR)/make/src/classes, \ - INCLUDES := build/tools/module, \ - EXCLUDE_FILES := ImageBuilder.java ModuleArchive.java, \ - BIN := $(MAKESUPPORT_OUTPUTDIR)/bt_classes_moduleslist, \ - DISABLE_SJAVAC := true)) - -TOOL_GENMODULESLIST = $(JAVA_SMALL) \ - -cp "$(MAKESUPPORT_OUTPUTDIR)/bt_classes_moduleslist" \ - build.tools.module.GenModulesList - -MODULES_LIST_FILE := $(MAKESUPPORT_OUTPUTDIR)/modules.list +# The module deps makefile is generated in make/GenerateModuleDeps.gmk MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk - -$(MODULES_LIST_FILE): $(SRC_ROOT)/modules.xml \ - $(BUILD_GENMODULESLIST) - $(TOOL_GENMODULESLIST) -o $@ $(filter %.xml, $^) - -$(MODULE_DEPS_MAKEFILE): $(MODULES_LIST_FILE) - $(CAT) $^ | $(SED) -e 's/^\([^:]*\):/DEPS_\1 :=/g' > $@ - -include $(MODULE_DEPS_MAKEFILE) # Param 1: Module to find deps for diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index 89a2d079a03..1711c9fe0c4 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -261,18 +261,17 @@ define add_native_source # The Visual Studio compiler lacks a feature for generating make dependencies, but by # setting -showIncludes, all included files are printed. These are filtered out and # parsed into make dependences. - # Keep as much as possible on one execution line for best performance on Windows - $(RM) $$($1_$2_DEP).exitvalue ; \ - ($(call LogFailures, $$($1_$2_OBJ).log, $$($1_SAFE_NAME)_$$(notdir $2), \ + # Keep as much as possible on one execution line for best performance on Windows. + # No need to save exit code from compilation since pipefail is always active on + # Windows. + $(call LogFailures, $$($1_$2_OBJ).log, $$($1_SAFE_NAME)_$$(notdir $2), \ $$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \ - $(CC_OUT_OPTION)$$($1_$2_OBJ) $2) || echo $$$$? > $$($1_$2_DEP).exitvalue ) \ - | $(TEE) $$($1_$2_DEP).raw | $(GREP) -v -e "^Note: including file:" \ + $(CC_OUT_OPTION)$$($1_$2_OBJ) $2) \ + | $(GREP) -v -e "^Note: including file:" \ -e "^$(notdir $2)$$$$" || test "$$$$?" = "1" ; \ - ( test -s $$($1_$2_DEP).exitvalue \ - && exit `$(CAT) $$($1_$2_DEP).exitvalue` || true ) ; \ - ($(ECHO) $$@: \\ ; \ - $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_DEP).raw) \ - | $(SORT) -u > $$($1_$2_DEP) ; \ + $(ECHO) $$@: \\ > $$($1_$2_DEP) ; \ + $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_OBJ).log \ + | $(SORT) -u >> $$($1_$2_DEP) ; \ $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_$2_DEP) > $$($1_$2_DEP_TARGETS) endif endif @@ -658,14 +657,14 @@ define SetupNativeCompilationBody $$($1_RES).vardeps) $$($1_RES): $$($1_VERSIONINFO_RESOURCE) $$($1_RES_VARDEPS_FILE) - $(ECHO) $(LOG_INFO) "Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$(notdir $$($1_TARGET)))" + $$(call LogInfo, Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$(notdir $$($1_TARGET)))) $$($1_RC) $$($1_RC_FLAGS) $$($1_SYSROOT_CFLAGS) $(CC_OUT_OPTION)$$@ \ $$($1_VERSIONINFO_RESOURCE) # Windows RC compiler does not support -showIncludes, so we mis-use CL for this. $$($1_CC) $$($1_RC_FLAGS) $$($1_SYSROOT_CFLAGS) -showIncludes -nologo -TC \ - $(CC_OUT_OPTION)$$($1_RES_DEP).obj $$($1_VERSIONINFO_RESOURCE) > $$($1_RES_DEP).raw 2>&1 || exit 0 - ($(ECHO) $$($1_RES): \\ \ - && $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEP).raw) > $$($1_RES_DEP) + $(CC_OUT_OPTION)$$($1_RES_DEP).obj $$($1_VERSIONINFO_RESOURCE) > $$($1_RES_DEP).raw 2>&1 || true ; \ + $(ECHO) $$($1_RES): \\ > $$($1_RES_DEP) ; \ + $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEP).raw >> $$($1_RES_DEP) ; \ $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEP) > $$($1_RES_DEP_TARGETS) endif endif @@ -801,7 +800,7 @@ define SetupNativeCompilationBody endif # Keep as much as possible on one execution line for best performance # on Windows - $(ECHO) $(LOG_INFO) "Linking $$($1_BASENAME)" ; \ + $$(call LogInfo, Linking $$($1_BASENAME)) $(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \ $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \ $(LD_OUT_OPTION)$$@ \ @@ -820,7 +819,7 @@ define SetupNativeCompilationBody # Generating a static library, ie object file archive. $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE) - $(ECHO) $(LOG_INFO) "Archiving $$($1_STATIC_LIBRARY)" + $$(call LogInfo, Archiving $$($1_STATIC_LIBRARY)) $(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \ $$($1_AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_ALL_OBJS) \ $$($1_RES)) @@ -842,7 +841,7 @@ define SetupNativeCompilationBody $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \ $$($1_VARDEPS_FILE) - $(ECHO) $(LOG_INFO) "Linking executable $$($1_BASENAME)" ; \ + $$(call LogInfo, Linking executable $$($1_BASENAME)) $(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \ $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \ $(EXE_OUT_OPTION)$$($1_TARGET) \ diff --git a/make/common/RMICompilation.gmk b/make/common/RMICompilation.gmk index 1ae79734854..6668f680ab2 100644 --- a/make/common/RMICompilation.gmk +++ b/make/common/RMICompilation.gmk @@ -68,15 +68,15 @@ define SetupRMICompilationBody $$($1_TARGETS): $$($1_DEP_FILE) $$($1_CLASS_FILES) $$($1_DEP_FILE): $$($1_CLASS_FILES) - $(MKDIR) -p $$($1_STUB_CLASSES_DIR) - $(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES) && \ + $$(call LogInfo, Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES)) + $$(call MakeDir, $$($1_STUB_CLASSES_DIR)) $(RMIC) $$($1_ARGS) -classpath "$$($1_CLASSES_DIR)" \ -d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES); \ if [ "x$$($1_ARGS2)" != "x" ]; then \ $(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS2) for $$($1_DOLLAR_SAFE_CLASSES) && \ $(RMIC) $$($1_ARGS2) -classpath "$$($1_CLASSES_DIR)" \ -d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES); \ - fi; + fi; \ $(TOUCH) $$@ diff --git a/make/common/TextFileProcessing.gmk b/make/common/TextFileProcessing.gmk index 9c2e4b5a413..1d4d4cfe596 100644 --- a/make/common/TextFileProcessing.gmk +++ b/make/common/TextFileProcessing.gmk @@ -35,12 +35,12 @@ endif # param 4 = the target file name (possibly with a partial path) define SetupSingleTextFileForProcessing $(strip $3)/$(strip $4): $2 $$($1_VARDEPS_FILE) - $(ECHO) $(LOG_INFO) "Processing $(strip $4)" - $(MKDIR) -p '$$(@D)' - $(RM) '$$@' '$$@.includes.tmp' '$$@.replacements.tmp' - $$($1_INCLUDES_COMMAND_LINE) < '$$<' > '$$@.includes.tmp' - $$($1_REPLACEMENTS_COMMAND_LINE) < '$$@.includes.tmp' > '$$@.replacements.tmp' - $(RM) '$$@.includes.tmp' + $$(call LogInfo, Processing $(strip $4)) + $$(call MakeDir, $$(@D)) + $(RM) '$$@' '$$@.includes.tmp' '$$@.replacements.tmp' ; \ + $$($1_INCLUDES_COMMAND_LINE) < '$$<' > '$$@.includes.tmp' ; \ + $$($1_REPLACEMENTS_COMMAND_LINE) < '$$@.includes.tmp' > '$$@.replacements.tmp' ; \ + $(RM) '$$@.includes.tmp' ; \ $(MV) '$$@.replacements.tmp' '$$@' $1 += $(strip $3)/$(strip $4) From 7275190792d5bcac43bb4e4e5a2d8b43875b6793 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Tue, 19 Jan 2016 16:28:18 +0100 Subject: [PATCH 016/228] 8147449: sjavac builds of jdk9/dev with closed sources broken Reviewed-by: ihse --- make/common/JavaCompilation.gmk | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk index c569557ec34..b1c6d37c1a8 100644 --- a/make/common/JavaCompilation.gmk +++ b/make/common/JavaCompilation.gmk @@ -246,13 +246,6 @@ define SetupJavaCompilationBody $1_SAFE_NAME := $$(strip $$(subst /,_, $1)) - # Create the corresponding smart javac wrapper command line. - $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix /**,$$($1_EXCLUDES))) \ - $$(addprefix -i ,$$(addsuffix /**,$$($1_INCLUDES))) \ - $$(addprefix -x **,$$(strip $$($1_EXCLUDE_FILES) $$($1_SJAVAC_EXCLUDE_FILES))) \ - $$(addprefix -i **,$$(strip $$($1_INCLUDE_FILES))) \ - -src $$(call PathList, $$($1_SRC)) - # All files below META-INF are always copied. $1_ALL_COPIES := $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS)) # Find all files to be copied from source to bin. @@ -315,11 +308,32 @@ define SetupJavaCompilationBody ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes) # Using sjavac to compile. + # Create the sjavac wrapper command line. Sjavac doesn't handle patterns that + # match the absolute path, only the part inside each src dir. Instead -i and + # -x flags apply only to the next -src arg on the command line. + $1_EXCLUDE_FILES_ABS := $$(filter /%, $$($1_EXCLUDE_FILES)) $$($1_SJAVAC_EXCLUDE_FILES) + $1_EXCLUDE_FILES_REL := $$(filter-out /%, $$($1_EXCLUDE_FILES)) + $1_SJAVAC_ARGS_STRING := $$(foreach s, $$(patsubst %/, %, $$($1_SRC)), \ + $$(addprefix -x ,$$(addsuffix /**,$$($1_EXCLUDES))) \ + $$(addprefix -i ,$$(addsuffix /**,$$($1_INCLUDES))) \ + $$(addprefix -x **,$$(strip $$($1_EXCLUDE_FILES_REL))) \ + $$(addprefix -i **,$$(strip $$($1_INCLUDE_FILES))) \ + $$(addprefix -x , $$(strip $$(patsubst $$(s)/%, %, $$(filter $$(s)/%, $$($1_EXCLUDE_FILES_ABS))))) \ + -src $$(s)) + + ifneq ($$(word 20, $$($1_SJAVAC_ARGS_STRING)), ) + $1_SJAVAC_ARGS_FILE := $$($1_BIN)/_the.$1_args + $1_SJAVAC_ARGS := @$$($1_SJAVAC_ARGS_FILE) + else + $1_SJAVAC_ARGS := $$($1_SJAVAC_ARGS_STRING) + endif + + ifneq (,$$($1_HEADERS)) $1_HEADERS_ARG := -h $$($1_HEADERS) endif - $1_VARDEPS := $$($1_JVM) $$($1_SJAVAC) $$($1_SJAVAC_ARGS) $$($1_FLAGS) \ + $1_VARDEPS := $$($1_JVM) $$($1_SJAVAC) $$($1_SJAVAC_ARGS_STRING) $$($1_FLAGS) \ $$($1_HEADERS_ARG) $$($1_BIN) $$($1_EXCLUDES) $$($1_INCLUDES) \ $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES) $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps) @@ -327,6 +341,9 @@ define SetupJavaCompilationBody $$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE) $(MKDIR) -p $$(@D) $$(dir $$($1_SJAVAC_PORTFILE)) $$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp)) + ifneq ($$($1_SJAVAC_ARGS_FILE), ) + $$(eval $$(call ListPathsSafely,$1_SJAVAC_ARGS_STRING, $$($1_SJAVAC_ARGS_FILE))) + endif $(ECHO) Compiling $1 $(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \ $$($1_JVM) $$($1_SJAVAC) \ From f206abd057d37d2510088e3f1cd98d901edcf4c9 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Wed, 20 Jan 2016 09:53:52 +0100 Subject: [PATCH 017/228] 8145596: Enable debug symbols for all libraries Reviewed-by: erikj --- common/autoconf/flags.m4 | 2 +- common/autoconf/generated-configure.sh | 59 ++++++++---- common/autoconf/hotspot-spec.gmk.in | 7 +- common/autoconf/jdk-options.m4 | 45 +++++---- common/autoconf/spec.gmk.in | 9 +- make/common/NativeCompilation.gmk | 127 +++++++++++-------------- make/common/TestFilesCompilation.gmk | 2 +- 7 files changed, 130 insertions(+), 121 deletions(-) diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index d8f0c85020f..e6b8417241f 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -403,7 +403,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], CXXFLAGS_DEBUG_SYMBOLS="-g" elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then CFLAGS_DEBUG_SYMBOLS="-g -xs" - # FIXME: likely a bug, this disables debug symbols rather than enables them + # -g0 enables debug symbols without disabling inlining. CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" elif test "x$TOOLCHAIN_TYPE" = xxlc; then CFLAGS_DEBUG_SYMBOLS="-g" diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index c8243b7c5f6..15203c2855e 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -688,11 +688,11 @@ STATIC_CXX_SETTING FIXPATH_DETACH_FLAG FIXPATH GCOV_ENABLED -ZIP_DEBUGINFO_FILES -ENABLE_DEBUG_SYMBOLS STRIP_POLICY DEBUG_BINARIES -NATIVE_DEBUG_SYMBOLS +ZIP_EXTERNAL_DEBUG_SYMBOLS +COPY_DEBUG_SYMBOLS +COMPILE_WITH_DEBUG_SYMBOLS CFLAGS_WARNINGS_ARE_ERRORS DISABLE_WARNING_PREFIX HOTSPOT_SET_WARNINGS_AS_ERRORS @@ -4119,6 +4119,16 @@ pkgadd_help() { + # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles + # will basically do slowdebug builds when DEBUG_BINARIES is set for + # fastdebug builds + DEBUG_BINARIES=false + # Fastdebug builds with this setting will essentially be slowdebug + # in hotspot. + # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles + # will basically do slowdebug builds when DEBUG_BINARIES is set for + # fastdebug builds + DEBUG_BINARIES=false # # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4839,7 +4849,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1452935762 +DATE_WHEN_GENERATED=1453279620 ############################################################################### # @@ -47031,7 +47041,7 @@ $as_echo "$ac_cv_c_bigendian" >&6; } CXXFLAGS_DEBUG_SYMBOLS="-g" elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then CFLAGS_DEBUG_SYMBOLS="-g -xs" - # FIXME: likely a bug, this disables debug symbols rather than enables them + # -g0 enables debug symbols without disabling inlining. CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" elif test "x$TOOLCHAIN_TYPE" = xxlc; then CFLAGS_DEBUG_SYMBOLS="-g" @@ -48271,26 +48281,31 @@ $as_echo "$NATIVE_DEBUG_SYMBOLS" >&6; } fi fi - ENABLE_DEBUG_SYMBOLS=true - ZIP_DEBUGINFO_FILES=true - # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles - # will basically do slowdebug builds when DEBUG_BINARIES is set for - # fastdebug builds + COMPILE_WITH_DEBUG_SYMBOLS=true + COPY_DEBUG_SYMBOLS=true + ZIP_EXTERNAL_DEBUG_SYMBOLS=true + + # Hotspot legacy support, not relevant with COPY_DEBUG_SYMBOLS=true DEBUG_BINARIES=false STRIP_POLICY=min_strip + elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then - ENABLE_DEBUG_SYMBOLS=false - ZIP_DEBUGINFO_FILES=false + COMPILE_WITH_DEBUG_SYMBOLS=false + COPY_DEBUG_SYMBOLS=false + ZIP_EXTERNAL_DEBUG_SYMBOLS=false + DEBUG_BINARIES=false STRIP_POLICY=no_strip elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then - ENABLE_DEBUG_SYMBOLS=false # -g option only - ZIP_DEBUGINFO_FILES=false - # Fastdebug builds with this setting will essentially be slowdebug - # in hotspot. + COMPILE_WITH_DEBUG_SYMBOLS=true + COPY_DEBUG_SYMBOLS=false + ZIP_EXTERNAL_DEBUG_SYMBOLS=false + + # Hotspot legacy support, will turn on -g when COPY_DEBUG_SYMBOLS=false DEBUG_BINARIES=true STRIP_POLICY=no_strip STRIP="" + elif test "x$NATIVE_DEBUG_SYMBOLS" = xexternal; then if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then @@ -48301,11 +48316,11 @@ $as_echo "$NATIVE_DEBUG_SYMBOLS" >&6; } fi fi - ENABLE_DEBUG_SYMBOLS=true - ZIP_DEBUGINFO_FILES=false - # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles - # will basically do slowdebug builds when DEBUG_BINARIES is set for - # fastdebug builds + COMPILE_WITH_DEBUG_SYMBOLS=true + COPY_DEBUG_SYMBOLS=true + ZIP_EXTERNAL_DEBUG_SYMBOLS=false + + # Hotspot legacy support, not relevant with COPY_DEBUG_SYMBOLS=true DEBUG_BINARIES=false STRIP_POLICY=min_strip else @@ -48356,6 +48371,8 @@ $as_echo "$as_me: WARNING: Please use --with-native-debug-symbols=zipped ." >&2; + # Legacy values + diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in index 86557031e0f..a5dc40b3d7f 100644 --- a/common/autoconf/hotspot-spec.gmk.in +++ b/common/autoconf/hotspot-spec.gmk.in @@ -118,7 +118,7 @@ USE_PRECOMPILED_HEADER=@USE_PRECOMPILED_HEADER@ # Hotspot expects the variable FULL_DEBUG_SYMBOLS=1/0 to control debug symbols # creation. -ifeq ($(ENABLE_DEBUG_SYMBOLS), true) +ifeq ($(COPY_DEBUG_SYMBOLS), true) FULL_DEBUG_SYMBOLS=1 # Ensure hotspot uses the objcopy that configure located ALT_OBJCOPY:=$(OBJCOPY) @@ -127,12 +127,15 @@ else endif # Hotspot expects the variable ZIP_DEBUGINFO_FILES=1/0 and not true/false. -ifeq ($(ZIP_DEBUGINFO_FILES)$(ENABLE_DEBUG_SYMBOLS), truetrue) +ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true) ZIP_DEBUGINFO_FILES:=1 else ZIP_DEBUGINFO_FILES:=0 endif +DEBUG_BINARIES := @DEBUG_BINARIES@ +STRIP_POLICY := @STRIP_POLICY@ + ifeq ($(OPENJDK_TARGET_OS), windows) # On Windows, the Visual Studio toolchain needs the LIB and INCLUDE # environment variables (in Windows path style). diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 index 8e25ce0e99c..e0a8c2762b7 100644 --- a/common/autoconf/jdk-options.m4 +++ b/common/autoconf/jdk-options.m4 @@ -251,26 +251,31 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], fi fi - ENABLE_DEBUG_SYMBOLS=true - ZIP_DEBUGINFO_FILES=true - # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles - # will basically do slowdebug builds when DEBUG_BINARIES is set for - # fastdebug builds + COMPILE_WITH_DEBUG_SYMBOLS=true + COPY_DEBUG_SYMBOLS=true + ZIP_EXTERNAL_DEBUG_SYMBOLS=true + + # Hotspot legacy support, not relevant with COPY_DEBUG_SYMBOLS=true DEBUG_BINARIES=false STRIP_POLICY=min_strip + elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then - ENABLE_DEBUG_SYMBOLS=false - ZIP_DEBUGINFO_FILES=false + COMPILE_WITH_DEBUG_SYMBOLS=false + COPY_DEBUG_SYMBOLS=false + ZIP_EXTERNAL_DEBUG_SYMBOLS=false + DEBUG_BINARIES=false STRIP_POLICY=no_strip elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then - ENABLE_DEBUG_SYMBOLS=false # -g option only - ZIP_DEBUGINFO_FILES=false - # Fastdebug builds with this setting will essentially be slowdebug - # in hotspot. + COMPILE_WITH_DEBUG_SYMBOLS=true + COPY_DEBUG_SYMBOLS=false + ZIP_EXTERNAL_DEBUG_SYMBOLS=false + + # Hotspot legacy support, will turn on -g when COPY_DEBUG_SYMBOLS=false DEBUG_BINARIES=true STRIP_POLICY=no_strip STRIP="" + elif test "x$NATIVE_DEBUG_SYMBOLS" = xexternal; then if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then @@ -281,11 +286,11 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], fi fi - ENABLE_DEBUG_SYMBOLS=true - ZIP_DEBUGINFO_FILES=false - # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles - # will basically do slowdebug builds when DEBUG_BINARIES is set for - # fastdebug builds + COMPILE_WITH_DEBUG_SYMBOLS=true + COPY_DEBUG_SYMBOLS=true + ZIP_EXTERNAL_DEBUG_SYMBOLS=false + + # Hotspot legacy support, not relevant with COPY_DEBUG_SYMBOLS=true DEBUG_BINARIES=false STRIP_POLICY=min_strip else @@ -302,11 +307,13 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], BASIC_DEPRECATED_ARG_ENABLE(zip-debug-info, zip_debug_info, [Please use --with-native-debug-symbols=zipped .]) - AC_SUBST(NATIVE_DEBUG_SYMBOLS) + AC_SUBST(COMPILE_WITH_DEBUG_SYMBOLS) + AC_SUBST(COPY_DEBUG_SYMBOLS) + AC_SUBST(ZIP_EXTERNAL_DEBUG_SYMBOLS) + + # Legacy values AC_SUBST(DEBUG_BINARIES) AC_SUBST(STRIP_POLICY) - AC_SUBST(ENABLE_DEBUG_SYMBOLS) - AC_SUBST(ZIP_DEBUGINFO_FILES) ]) ################################################################################ diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index 86b4761709a..e2a73d20ccf 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -424,13 +424,12 @@ CXX_FLAG_REORDER:=@CXX_FLAG_REORDER@ # # Options for generating debug symbols -ENABLE_DEBUG_SYMBOLS:=@ENABLE_DEBUG_SYMBOLS@ +COMPILE_WITH_DEBUG_SYMBOLS := @COMPILE_WITH_DEBUG_SYMBOLS@ +COPY_DEBUG_SYMBOLS := @COPY_DEBUG_SYMBOLS@ +ZIP_EXTERNAL_DEBUG_SYMBOLS := @ZIP_EXTERNAL_DEBUG_SYMBOLS@ + CFLAGS_DEBUG_SYMBOLS:=@CFLAGS_DEBUG_SYMBOLS@ CXXFLAGS_DEBUG_SYMBOLS:=@CXXFLAGS_DEBUG_SYMBOLS@ -ZIP_DEBUGINFO_FILES:=@ZIP_DEBUGINFO_FILES@ -NATIVE_DEBUG_SYMBOLS:=@NATIVE_DEBUG_SYMBOLS@ -DEBUG_BINARIES:=@DEBUG_BINARIES@ -STRIP_POLICY:=@STRIP_POLICY@ # # Compress (or not) jars diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index 1711c9fe0c4..b080beac1dc 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -305,7 +305,6 @@ endef # RC_FLAGS flags for RC. # MAPFILE mapfile # REORDER reorder file -# DEBUG_SYMBOLS add debug symbols (if configured on) # CC the compiler to use, default is $(CC) # LD the linker to use, default is $(LD) # OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST @@ -538,25 +537,9 @@ define SetupNativeCompilationBody $1_EXTRA_CXXFLAGS:=$$($1_EXTRA_CFLAGS) endif - ifeq ($(DEBUG_BINARIES), true) - $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS) - $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS) - endif - ifeq ($$($1_DEBUG_SYMBOLS), true) - ifeq ($(ENABLE_DEBUG_SYMBOLS), true) - ifdef OPENJDK - # Always add debug symbols - $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS) - $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS) - else - # Programs don't get the debug symbols added in the old build. It's not clear if - # this is intentional. - ifeq ($$($1_PROGRAM),) - $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS) - $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS) - endif - endif - endif + ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true) + $1_EXTRA_CFLAGS += $(CFLAGS_DEBUG_SYMBOLS) + $1_EXTRA_CXXFLAGS += $(CXXFLAGS_DEBUG_SYMBOLS) endif ifneq (,$$($1_REORDER)) @@ -695,67 +678,67 @@ define SetupNativeCompilationBody # Need to make sure TARGET is first on list $1 := $$($1_TARGET) - ifeq ($$($1_STATIC_LIBRARY),) - ifeq ($$($1_DEBUG_SYMBOLS), true) - ifeq ($(ENABLE_DEBUG_SYMBOLS), true) - ifneq ($$($1_OUTPUT_DIR), $$($1_OBJECT_DIR)) - # The dependency on TARGET is needed on windows for debuginfo files - # to be rebuilt properly. - $$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% $$($1_TARGET) + + ifeq ($(COPY_DEBUG_SYMBOLS), true) + # Only copy debug symbols for dynamic libraries and programs. + ifeq ($$($1_STATIC_LIBRARY), ) + ifneq ($$($1_OUTPUT_DIR), $$($1_OBJECT_DIR)) + # The dependency on TARGET is needed on windows for debuginfo files + # to be rebuilt properly. + $$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% $$($1_TARGET) $(CP) $$< $$@ - endif + endif - # Generate debuginfo files. - ifeq ($(OPENJDK_TARGET_OS), windows) - $1_EXTRA_LDFLAGS += "-pdb:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb" \ - "-map:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map" - $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb \ - $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map - # No separate command is needed for debuginfo on windows, instead - # touch target to make sure it has a later time stamp than the debug - # symbol files to avoid unnecessary relinking on rebuild. - $1_CREATE_DEBUGINFO_CMDS := $(TOUCH) $$($1_TARGET) + # Generate debuginfo files. + ifeq ($(OPENJDK_TARGET_OS), windows) + $1_EXTRA_LDFLAGS += "-pdb:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb" \ + "-map:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map" + $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb \ + $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map + # No separate command is needed for debuginfo on windows, instead + # touch target to make sure it has a later time stamp than the debug + # symbol files to avoid unnecessary relinking on rebuild. + $1_CREATE_DEBUGINFO_CMDS := $(TOUCH) $$($1_TARGET) - else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), ) - $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo - # Setup the command line creating debuginfo files, to be run after linking. - # It cannot be run separately since it updates the original target file - $1_CREATE_DEBUGINFO_CMDS := \ - $(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \ - $(CD) $$($1_OUTPUT_DIR) && \ - $(OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET) + else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), ) + $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo + # Setup the command line creating debuginfo files, to be run after linking. + # It cannot be run separately since it updates the original target file + $1_CREATE_DEBUGINFO_CMDS := \ + $(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \ + $(CD) $$($1_OUTPUT_DIR) && \ + $(OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET) - else ifeq ($(OPENJDK_TARGET_OS), macosx) - $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_BASENAME).dSYM - # On Macosx, the debuginfo generation doesn't touch the linked binary, but - # to avoid always relinking, touch it anyway to force a later timestamp than - # the dSYM files. - $1_CREATE_DEBUGINFO_CMDS := \ - $(DSYMUTIL) --out $$($1_DEBUGINFO_FILES) $$($1_TARGET) $$(NEWLINE) \ - $(TOUCH) $$($1_TARGET) - endif # OPENJDK_TARGET_OS + else ifeq ($(OPENJDK_TARGET_OS), macosx) + $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_BASENAME).dSYM + # On Macosx, the debuginfo generation doesn't touch the linked binary, but + # to avoid always relinking, touch it anyway to force a later timestamp than + # the dSYM files. + $1_CREATE_DEBUGINFO_CMDS := \ + $(DSYMUTIL) --out $$($1_DEBUGINFO_FILES) $$($1_TARGET) $$(NEWLINE) \ + $(TOUCH) $$($1_TARGET) + endif # OPENJDK_TARGET_OS - # This dependency dance ensures that debug info files get rebuilt - # properly if deleted. - $$($1_TARGET): $$($1_DEBUGINFO_FILES) - $$($1_DEBUGINFO_FILES): $$($1_ALL_OBJS) + # This dependency dance ensures that debug info files get rebuilt + # properly if deleted. + $$($1_TARGET): $$($1_DEBUGINFO_FILES) + $$($1_DEBUGINFO_FILES): $$($1_ALL_OBJS) - ifeq ($(ZIP_DEBUGINFO_FILES), true) - $1_DEBUGINFO_ZIP := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).diz - $1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_ZIP)) + ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true) + $1_DEBUGINFO_ZIP := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).diz + $1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_ZIP)) - # The dependency on TARGET is needed for debuginfo files - # to be rebuilt properly. - $$($1_DEBUGINFO_ZIP): $$($1_DEBUGINFO_FILES) $$($1_TARGET) + # The dependency on TARGET is needed for debuginfo files + # to be rebuilt properly. + $$($1_DEBUGINFO_ZIP): $$($1_DEBUGINFO_FILES) $$($1_TARGET) $(CD) $$($1_OBJECT_DIR) \ - && $(ZIP) -q $$@ $$(notdir $$($1_DEBUGINFO_FILES)) + && $(ZIP) -q -r $$@ $$(notdir $$($1_DEBUGINFO_FILES)) - else - $1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_FILES)) - endif - endif # $(ENABLE_DEBUG_SYMBOLS) - endif # $1_DEBUG_SYMBOLS - endif # !STATIC_LIBRARY + else + $1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_FILES)) + endif + endif # !STATIC_LIBRARY + endif # COPY_DEBUG_SYMBOLS ifeq ($$($1_STRIP_SYMBOLS), true) ifneq ($$($1_STRIP), ) diff --git a/make/common/TestFilesCompilation.gmk b/make/common/TestFilesCompilation.gmk index a44a794c9c1..1dd40a0a877 100644 --- a/make/common/TestFilesCompilation.gmk +++ b/make/common/TestFilesCompilation.gmk @@ -87,7 +87,7 @@ define SetupTestFilesCompilationBody CFLAGS := $$($1_CFLAGS) $$($1_CFLAGS_$$($1_PREFIX)$$(name)), \ LDFLAGS := $$($1_LDFLAGS) $$($1_LDFLAGS_$$($1_PREFIX)$$(name)), \ OPTIMIZATION := LOW, \ - DEBUG_SYMBOLS := true)) \ + )) \ $$(eval $1 += $$(BUILD_TEST_$$(name)) ) \ ) From b5206561e2899de092b18029493478ff8ca7a536 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Wed, 20 Jan 2016 13:57:03 +0100 Subject: [PATCH 018/228] 8147786: Building hotspot gives error message from find Reviewed-by: ihse --- make/HotspotWrapper.gmk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/HotspotWrapper.gmk b/make/HotspotWrapper.gmk index d356232195a..eec08d6e129 100644 --- a/make/HotspotWrapper.gmk +++ b/make/HotspotWrapper.gmk @@ -38,7 +38,7 @@ default: all # Get all files in src, make or agent subdirs in hotspot directory and # filter out .hg. This skips the test directory. HOTSPOT_FILES := $(shell $(FIND) -L \ - $(HOTSPOT_TOPDIR)/src $(HOTSPOT_TOPDIR)/make $(HOTSPOT_TOPDIR)/agent \ + $(HOTSPOT_TOPDIR)/src $(HOTSPOT_TOPDIR)/make \ -name ".hg" -prune -o -print) # The old build creates hotspot output dir before calling hotspot and From c0c76dcc3d9823d48cb9cd065b440a9efc5e9c8a Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Fri, 2 Oct 2015 11:48:50 +0300 Subject: [PATCH 019/228] 8134605: Partial rework of the fix for 8081297 Reviewed-by: xuelei, coffeys, valeriep --- modules.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/modules.xml b/modules.xml index a0dd91d284e..c6370d55e1a 100644 --- a/modules.xml +++ b/modules.xml @@ -399,6 +399,7 @@ java.xml.crypto jdk.crypto.ec jdk.crypto.pkcs11 + jdk.crypto.ucrypto jdk.naming.dns From 0ab643787434613472d1290c09aa57c154af3e2c Mon Sep 17 00:00:00 2001 From: Vinnie Ryan Date: Wed, 7 Oct 2015 18:04:06 +0100 Subject: [PATCH 020/228] 8138589: Correct limits on unlimited cryptography Reviewed-by: mullan --- .../share/classes/com/sun/crypto/provider/PBES2Core.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBES2Core.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBES2Core.java index 51c49b500ab..37873666eba 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBES2Core.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBES2Core.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, 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 @@ -263,7 +263,7 @@ abstract class PBES2Core extends CipherSpi { passwdChars[i] = (char) (passwdBytes[i] & 0x7f); PBEKeySpec pbeSpec = - new PBEKeySpec(passwdChars, salt, iCount, blkSize * 8); + new PBEKeySpec(passwdChars, salt, iCount, keyLength); // password char[] was cloned in PBEKeySpec constructor, // so we can zero it out here java.util.Arrays.fill(passwdChars, ' '); From 31abfb24a90dcb2112245b328682185da9a339d5 Mon Sep 17 00:00:00 2001 From: Vadim Pakhnushev Date: Tue, 13 Oct 2015 20:59:19 +0300 Subject: [PATCH 021/228] 8132988: Better printing dialogues Reviewed-by: prr, serb, mschoene --- .../macosx/classes/sun/lwawt/macosx/CPrinterJob.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java index a7b200981ed..c28e83bfbf2 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java @@ -235,6 +235,11 @@ public final class CPrinterJob extends RasterPrinterJob { // this will not work if the user clicks on the "Preview" button // However if the printer is a StreamPrintService, its the right path. PrintService psvc = getPrintService(); + + if (psvc == null) { + throw new PrinterException("No print service found."); + } + if (psvc instanceof StreamPrintService) { spoolToService(psvc, attributes); return; From 57e9de313667e5e4e5e116b379c2fb847b32e420 Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Fri, 2 Oct 2015 11:50:20 +0300 Subject: [PATCH 022/228] 8134605: Partial rework of the fix for 8081297 Reviewed-by: xuelei, coffeys, valeriep --- .../classes/sun/security/jca/JCAUtil.java | 29 ++--- .../security/ssl/RSAClientKeyExchange.java | 29 ++--- .../classes/sun/security/util/KeyUtil.java | 6 +- .../sun/security/pkcs11/P11Cipher.java | 5 +- .../sun/security/pkcs11/P11RSACipher.java | 115 ++++++++---------- .../oracle/security/ucrypto/NativeCipher.java | 7 +- .../security/ucrypto/NativeGCMCipher.java | 7 +- .../security/ucrypto/NativeRSACipher.java | 4 + 8 files changed, 95 insertions(+), 107 deletions(-) diff --git a/jdk/src/java.base/share/classes/sun/security/jca/JCAUtil.java b/jdk/src/java.base/share/classes/sun/security/jca/JCAUtil.java index 7515a22b40e..59375cc220b 100644 --- a/jdk/src/java.base/share/classes/sun/security/jca/JCAUtil.java +++ b/jdk/src/java.base/share/classes/sun/security/jca/JCAUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -41,12 +41,6 @@ public final class JCAUtil { // no instantiation } - // lock to use for synchronization - private static final Object LOCK = JCAUtil.class; - - // cached SecureRandom instance - private static volatile SecureRandom secureRandom; - // size of the temporary arrays we use. Should fit into the CPU's 1st // level cache and could be adjusted based on the platform private static final int ARRAY_SIZE = 4096; @@ -60,26 +54,19 @@ public final class JCAUtil { return Math.min(ARRAY_SIZE, totalSize); } + // cached SecureRandom instance + private static class CachedSecureRandomHolder { + public static SecureRandom instance = new SecureRandom(); + } + /** - * Get a SecureRandom instance. This method should me used by JDK + * Get a SecureRandom instance. This method should be used by JDK * internal code in favor of calling "new SecureRandom()". That needs to * iterate through the provider table to find the default SecureRandom * implementation, which is fairly inefficient. */ public static SecureRandom getSecureRandom() { - // we use double checked locking to minimize synchronization - // works because we use a volatile reference - SecureRandom r = secureRandom; - if (r == null) { - synchronized (LOCK) { - r = secureRandom; - if (r == null) { - r = new SecureRandom(); - secureRandom = r; - } - } - } - return r; + return CachedSecureRandomHolder.instance; } } diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java b/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java index 9d403db3dae..b374b8c42d7 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -113,18 +113,23 @@ final class RSAClientKeyExchange extends HandshakeMessage { } } - boolean needFailover = false; byte[] encoded = null; try { Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1); - needFailover = !KeyUtil.isOracleJCEProvider( - cipher.getProvider().getName()); + boolean needFailover = !KeyUtil.isOracleJCEProvider( + cipher.getProvider().getName()); if (needFailover) { cipher.init(Cipher.DECRYPT_MODE, privateKey); - encoded = cipher.doFinal(encrypted); + boolean failed = false; + try { + encoded = cipher.doFinal(encrypted); + } catch (BadPaddingException bpe) { + // Note: encoded == null + failed = true; + } encoded = KeyUtil.checkTlsPreMasterSecretKey( maxVersion.v, currentVersion.v, - generator, encoded, false); + generator, encoded, failed); preMaster = generatePreMasterSecret( maxVersion.v, currentVersion.v, encoded, generator); @@ -136,18 +141,6 @@ final class RSAClientKeyExchange extends HandshakeMessage { preMaster = (SecretKey)cipher.unwrap(encrypted, "TlsRsaPremasterSecret", Cipher.SECRET_KEY); } - } catch (BadPaddingException bpe) { - if (needFailover) { - encoded = KeyUtil.checkTlsPreMasterSecretKey( - maxVersion.v, currentVersion.v, - generator, null, false); - preMaster = generatePreMasterSecret( - maxVersion.v, currentVersion.v, - encoded, generator); - } else { - // Otherwise, unlikely to happen - throw new RuntimeException("Unexpected exception", bpe); - } } catch (InvalidKeyException ibk) { // the message is too big to process with RSA throw new SSLProtocolException( diff --git a/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java b/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java index 1397f3b05e9..70f5952b077 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java +++ b/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, 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 @@ -41,6 +41,8 @@ import javax.crypto.spec.DHParameterSpec; import javax.crypto.spec.DHPublicKeySpec; import java.math.BigInteger; +import sun.security.jca.JCAUtil; + /** * A utility class to get key length, valiate keys, etc. */ @@ -201,7 +203,7 @@ public final class KeyUtil { byte[] encoded, boolean isFailOver) { if (random == null) { - random = new SecureRandom(); + random = JCAUtil.getSecureRandom(); } byte[] replacer = new byte[48]; random.nextBytes(replacer); diff --git a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Cipher.java b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Cipher.java index 690d865167e..022dc3be72a 100644 --- a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Cipher.java +++ b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Cipher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -35,6 +35,7 @@ import javax.crypto.*; import javax.crypto.spec.*; import sun.nio.ch.DirectBuffer; +import sun.security.jca.JCAUtil; import sun.security.pkcs11.wrapper.*; import static sun.security.pkcs11.wrapper.PKCS11Constants.*; @@ -379,7 +380,7 @@ final class P11Cipher extends CipherSpi { } // generate random IV if (random == null) { - random = new SecureRandom(); + random = JCAUtil.getSecureRandom(); } iv = new byte[blockSize]; random.nextBytes(iv); diff --git a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11RSACipher.java b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11RSACipher.java index bc65e2f2424..58a4e2f545d 100644 --- a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11RSACipher.java +++ b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11RSACipher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -470,49 +470,49 @@ final class P11RSACipher extends CipherSpi { algorithm.equals("TlsRsaPremasterSecret"); Exception failover = null; - SecureRandom secureRandom = random; - if (secureRandom == null && isTlsRsaPremasterSecret) { - secureRandom = new SecureRandom(); - } - // Should C_Unwrap be preferred for non-TLS RSA premaster secret? if (token.supportsRawSecretKeyImport()) { // XXX implement unwrap using C_Unwrap() for all keys implInit(Cipher.DECRYPT_MODE, p11Key); - if (wrappedKey.length > maxInputSize) { - throw new InvalidKeyException("Key is too long for unwrapping"); - } - - byte[] encoded = null; - implUpdate(wrappedKey, 0, wrappedKey.length); try { - encoded = doFinal(); - } catch (BadPaddingException e) { - if (isTlsRsaPremasterSecret) { - failover = e; - } else { + if (wrappedKey.length > maxInputSize) { + throw new InvalidKeyException("Key is too long for unwrapping"); + } + + byte[] encoded = null; + implUpdate(wrappedKey, 0, wrappedKey.length); + try { + encoded = doFinal(); + } catch (BadPaddingException e) { + if (isTlsRsaPremasterSecret) { + failover = e; + } else { + throw new InvalidKeyException("Unwrapping failed", e); + } + } catch (IllegalBlockSizeException e) { + // should not occur, handled with length check above throw new InvalidKeyException("Unwrapping failed", e); } - } catch (IllegalBlockSizeException e) { - // should not occur, handled with length check above - throw new InvalidKeyException("Unwrapping failed", e); - } - if (isTlsRsaPremasterSecret) { - if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) { - throw new IllegalStateException( - "No TlsRsaPremasterSecretParameterSpec specified"); + if (isTlsRsaPremasterSecret) { + if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) { + throw new IllegalStateException( + "No TlsRsaPremasterSecretParameterSpec specified"); + } + + // polish the TLS premaster secret + TlsRsaPremasterSecretParameterSpec psps = + (TlsRsaPremasterSecretParameterSpec)spec; + encoded = KeyUtil.checkTlsPreMasterSecretKey( + psps.getClientVersion(), psps.getServerVersion(), + random, encoded, (failover != null)); } - // polish the TLS premaster secret - TlsRsaPremasterSecretParameterSpec psps = - (TlsRsaPremasterSecretParameterSpec)spec; - encoded = KeyUtil.checkTlsPreMasterSecretKey( - psps.getClientVersion(), psps.getServerVersion(), - secureRandom, encoded, (failover != null)); + return ConstructKeys.constructKey(encoded, algorithm, type); + } finally { + // Restore original mode + implInit(Cipher.UNWRAP_MODE, p11Key); } - - return ConstructKeys.constructKey(encoded, algorithm, type); } else { Session s = null; SecretKey secretKey = null; @@ -540,20 +540,13 @@ final class P11RSACipher extends CipherSpi { } if (isTlsRsaPremasterSecret) { - byte[] replacer = new byte[48]; - if (failover == null) { - // Does smart compiler dispose this operation? - secureRandom.nextBytes(replacer); - } - TlsRsaPremasterSecretParameterSpec psps = (TlsRsaPremasterSecretParameterSpec)spec; - // Please use the tricky failover and replacer byte array - // as the parameters so that smart compiler won't dispose - // the unused variable . + // Please use the tricky failover as the parameter so that + // smart compiler won't dispose the unused variable. secretKey = polishPreMasterSecretKey(token, s, - failover, replacer, secretKey, + failover, secretKey, psps.getClientVersion(), psps.getServerVersion()); } @@ -572,29 +565,27 @@ final class P11RSACipher extends CipherSpi { private static SecretKey polishPreMasterSecretKey( Token token, Session session, - Exception failover, byte[] replacer, SecretKey secretKey, + Exception failover, SecretKey unwrappedKey, int clientVersion, int serverVersion) { - if (failover != null) { - CK_VERSION version = new CK_VERSION( - (clientVersion >>> 8) & 0xFF, clientVersion & 0xFF); - try { - CK_ATTRIBUTE[] attributes = token.getAttributes( - O_GENERATE, CKO_SECRET_KEY, - CKK_GENERIC_SECRET, new CK_ATTRIBUTE[0]); - long keyID = token.p11.C_GenerateKey(session.id(), - // new CK_MECHANISM(CKM_TLS_PRE_MASTER_KEY_GEN, version), - new CK_MECHANISM(CKM_SSL3_PRE_MASTER_KEY_GEN, version), - attributes); - return P11Key.secretKey(session, - keyID, "TlsRsaPremasterSecret", 48 << 3, attributes); - } catch (PKCS11Exception e) { - throw new ProviderException( - "Could not generate premaster secret", e); - } + SecretKey newKey; + CK_VERSION version = new CK_VERSION( + (clientVersion >>> 8) & 0xFF, clientVersion & 0xFF); + try { + CK_ATTRIBUTE[] attributes = token.getAttributes( + O_GENERATE, CKO_SECRET_KEY, + CKK_GENERIC_SECRET, new CK_ATTRIBUTE[0]); + long keyID = token.p11.C_GenerateKey(session.id(), + new CK_MECHANISM(CKM_SSL3_PRE_MASTER_KEY_GEN, version), + attributes); + newKey = P11Key.secretKey(session, + keyID, "TlsRsaPremasterSecret", 48 << 3, attributes); + } catch (PKCS11Exception e) { + throw new ProviderException( + "Could not generate premaster secret", e); } - return secretKey; + return (failover == null) ? unwrappedKey : newKey; } } diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipher.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipher.java index 392ade324d3..af7767924a3 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipher.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipher.java @@ -38,6 +38,8 @@ import javax.crypto.*; import javax.crypto.spec.SecretKeySpec; import javax.crypto.spec.IvParameterSpec; +import sun.security.jca.JCAUtil; + /** * Cipher wrapper class utilizing ucrypto APIs. This class currently supports * - AES/ECB/NOPADDING @@ -288,7 +290,10 @@ class NativeCipher extends CipherSpi { if (encrypt) { // generate IV if none supplied for encryption ivBytes = new byte[blockSize]; - new SecureRandom().nextBytes(ivBytes); + if (random == null) { + random = JCAUtil.getSecureRandom(); + } + random.nextBytes(ivBytes); } else { throw new InvalidAlgorithmParameterException ("Parameters required for decryption"); diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeGCMCipher.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeGCMCipher.java index 2f9880cd792..10913cb3c06 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeGCMCipher.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeGCMCipher.java @@ -36,6 +36,8 @@ import javax.crypto.*; import javax.crypto.spec.SecretKeySpec; import javax.crypto.spec.GCMParameterSpec; +import sun.security.jca.JCAUtil; + /** * Cipher wrapper class utilizing ucrypto APIs. This class currently supports * - AES/GCM/NoPADDING @@ -200,7 +202,10 @@ class NativeGCMCipher extends NativeCipher { // generate IV if none supplied for encryption ivBytes = new byte[blockSize]; - new SecureRandom().nextBytes(ivBytes); + if (random == null) { + random = JCAUtil.getSecureRandom(); + } + random.nextBytes(ivBytes); } else { throw new InvalidAlgorithmParameterException("Parameters required for decryption"); } diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java index 183c4d0a17a..4b4e408e42d 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java @@ -63,6 +63,7 @@ import javax.crypto.ShortBufferException; import javax.crypto.spec.SecretKeySpec; import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec; +import sun.security.jca.JCAUtil; import sun.security.util.KeyUtil; /** @@ -201,6 +202,9 @@ public class NativeRSACipher extends CipherSpi { "No Parameters can be specified"); } spec = params; + if (random == null) { + random = JCAUtil.getSecureRandom(); + } this.random = random; // for TLS RSA premaster secret } boolean doEncrypt = (opmode == Cipher.ENCRYPT_MODE || opmode == Cipher.WRAP_MODE); From 683bd2b8b384f40885194557b5f743204b59de42 Mon Sep 17 00:00:00 2001 From: Shanliang Jiang Date: Tue, 6 Oct 2015 09:20:12 +0200 Subject: [PATCH 023/228] 8137060: JMX memory management improvements Reviewed-by: dfuchs, ahgross --- .../share/classes/sun/management/MemoryImpl.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java b/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java index 00d68d4a022..c707c4fba73 100644 --- a/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java +++ b/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java @@ -115,17 +115,10 @@ class MemoryImpl extends NotificationEmitterSupport "Memory usage exceeds collection usage threshold" }; - private MBeanNotificationInfo[] notifInfo = null; public MBeanNotificationInfo[] getNotificationInfo() { - synchronized (this) { - if (notifInfo == null) { - notifInfo = new MBeanNotificationInfo[1]; - notifInfo[0] = new MBeanNotificationInfo(notifTypes, - notifName, - "Memory Notification"); - } - } - return notifInfo; + return new MBeanNotificationInfo[] { + new MBeanNotificationInfo(notifTypes, notifName, "Memory Notification") + }; } private static String getNotifMsg(String notifType) { From c464a9de39631ca47524b78fe9274cc0892d21ef Mon Sep 17 00:00:00 2001 From: Paul Sandoz Date: Thu, 3 Dec 2015 11:17:31 +0100 Subject: [PATCH 024/228] 8144223: Move j.l.invoke.{ForceInline, DontInline, Stable} to jdk.internal.vm.annotation package Reviewed-by: jrose, vlivanov, mchung, roland --- .../java/lang/invoke/BoundMethodHandle.java | 26 +++++++------- .../java/lang/invoke/DirectMethodHandle.java | 24 +++++++------ .../lang/invoke/InvokerBytecodeGenerator.java | 8 ++--- .../classes/java/lang/invoke/Invokers.java | 4 +++ .../classes/java/lang/invoke/LambdaForm.java | 20 +++++++---- .../java/lang/invoke/MethodHandleImpl.java | 4 +-- .../classes/java/lang/invoke/MethodType.java | 1 + .../java/lang/invoke/MethodTypeForm.java | 1 + .../internal/vm/annotation}/DontInline.java | 21 ++++++++--- .../internal/vm/annotation}/ForceInline.java | 22 +++++++++--- .../internal/vm/annotation}/Stable.java | 35 ++++++++++++++----- 11 files changed, 113 insertions(+), 53 deletions(-) rename jdk/src/java.base/share/classes/{java/lang/invoke => jdk/internal/vm/annotation}/DontInline.java (59%) rename jdk/src/java.base/share/classes/{java/lang/invoke => jdk/internal/vm/annotation}/ForceInline.java (58%) rename jdk/src/java.base/share/classes/{java/lang/invoke => jdk/internal/vm/annotation}/Stable.java (65%) diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java index f385d95c4c9..90d0d590697 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java @@ -25,25 +25,25 @@ package java.lang.invoke; -import static jdk.internal.org.objectweb.asm.Opcodes.*; -import static java.lang.invoke.LambdaForm.*; -import static java.lang.invoke.LambdaForm.BasicType.*; -import static java.lang.invoke.MethodHandleStatics.*; +import jdk.internal.vm.annotation.Stable; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.FieldVisitor; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import sun.invoke.util.ValueConversions; +import sun.invoke.util.Wrapper; import java.lang.invoke.LambdaForm.NamedFunction; import java.lang.invoke.MethodHandles.Lookup; import java.lang.reflect.Field; import java.util.Arrays; -import java.util.function.Function; -import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.function.Function; -import jdk.internal.org.objectweb.asm.FieldVisitor; -import sun.invoke.util.ValueConversions; -import sun.invoke.util.Wrapper; - -import jdk.internal.org.objectweb.asm.ClassWriter; -import jdk.internal.org.objectweb.asm.MethodVisitor; +import static java.lang.invoke.LambdaForm.BasicType; +import static java.lang.invoke.LambdaForm.BasicType.*; +import static java.lang.invoke.MethodHandleStatics.*; +import static jdk.internal.org.objectweb.asm.Opcodes.*; /** * The flavor of method handle which emulates an invoke instruction @@ -459,7 +459,7 @@ import jdk.internal.org.objectweb.asm.MethodVisitor; static final String BMH_SIG = "L"+BMH+";"; static final String SPECIES_DATA = "java/lang/invoke/BoundMethodHandle$SpeciesData"; static final String SPECIES_DATA_SIG = "L"+SPECIES_DATA+";"; - static final String STABLE_SIG = "Ljava/lang/invoke/Stable;"; + static final String STABLE_SIG = "Ljdk/internal/vm/annotation/Stable;"; static final String SPECIES_PREFIX_NAME = "Species_"; static final String SPECIES_PREFIX_PATH = BMH + "$" + SPECIES_PREFIX_NAME; diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java index 54cbb4b3038..21e45d85663 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java @@ -26,20 +26,24 @@ package java.lang.invoke; import jdk.internal.misc.Unsafe; -import java.lang.reflect.Method; -import java.util.Arrays; -import sun.invoke.util.VerifyAccess; -import static java.lang.invoke.MethodHandleNatives.Constants.*; -import static java.lang.invoke.LambdaForm.*; -import static java.lang.invoke.MethodTypeForm.*; -import static java.lang.invoke.MethodHandleStatics.*; -import java.lang.ref.WeakReference; -import java.lang.reflect.Field; -import java.util.Objects; +import jdk.internal.vm.annotation.ForceInline; import sun.invoke.util.ValueConversions; +import sun.invoke.util.VerifyAccess; import sun.invoke.util.VerifyType; import sun.invoke.util.Wrapper; +import java.lang.ref.WeakReference; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.Objects; + +import static java.lang.invoke.LambdaForm.*; +import static java.lang.invoke.MethodHandleNatives.Constants.*; +import static java.lang.invoke.MethodHandleStatics.UNSAFE; +import static java.lang.invoke.MethodHandleStatics.newInternalError; +import static java.lang.invoke.MethodTypeForm.*; + /** * The flavor of method handle which implements a constant reference * to a class member. diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java index 83d66d52299..802589d727f 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java @@ -608,9 +608,9 @@ class InvokerBytecodeGenerator { if (lambdaForm.forceInline) { // Force inlining of this invoker method. - mv.visitAnnotation("Ljava/lang/invoke/ForceInline;", true); + mv.visitAnnotation("Ljdk/internal/vm/annotation/ForceInline;", true); } else { - mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true); + mv.visitAnnotation("Ljdk/internal/vm/annotation/DontInline;", true); } if (lambdaForm.customized != null) { @@ -1292,7 +1292,7 @@ class InvokerBytecodeGenerator { mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true); // Don't inline the interpreter entry. - mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true); + mv.visitAnnotation("Ljdk/internal/vm/annotation/DontInline;", true); // create parameter array emitIconstInsn(invokerType.parameterCount()); @@ -1351,7 +1351,7 @@ class InvokerBytecodeGenerator { mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true); // Force inlining of this invoker method. - mv.visitAnnotation("Ljava/lang/invoke/ForceInline;", true); + mv.visitAnnotation("Ljdk/internal/vm/annotation/ForceInline;", true); // Load receiver emitAloadInsn(0); diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java index add42889bac..32a96ebea7e 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java @@ -25,6 +25,10 @@ package java.lang.invoke; +import jdk.internal.vm.annotation.DontInline; +import jdk.internal.vm.annotation.ForceInline; +import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.Array; import java.util.Arrays; diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java index 438b4256c09..45818bbf24a 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java @@ -25,18 +25,24 @@ package java.lang.invoke; -import java.lang.annotation.*; +import jdk.internal.vm.annotation.DontInline; +import jdk.internal.vm.annotation.Stable; +import sun.invoke.util.Wrapper; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.reflect.Field; import java.lang.reflect.Method; -import java.util.List; import java.util.Arrays; import java.util.HashMap; - -import sun.invoke.util.Wrapper; -import java.lang.reflect.Field; +import java.util.List; import static java.lang.invoke.LambdaForm.BasicType.*; -import static java.lang.invoke.MethodHandleStatics.*; -import static java.lang.invoke.MethodHandleNatives.Constants.*; +import static java.lang.invoke.MethodHandleNatives.Constants.REF_invokeStatic; +import static java.lang.invoke.MethodHandleStatics.debugEnabled; +import static java.lang.invoke.MethodHandleStatics.newInternalError; /** * The symbolic, non-executable form of a method handle's invocation semantics. diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java index 7ad49cd38aa..c522b03486d 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java @@ -32,8 +32,8 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.function.Function; -import java.util.stream.Collectors; +import jdk.internal.vm.annotation.Stable; import sun.invoke.empty.Empty; import sun.invoke.util.ValueConversions; import sun.invoke.util.VerifyType; @@ -1483,7 +1483,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP; } private static final int LEFT_ARGS = FILL_ARRAYS_COUNT - 1; - private static final @Stable MethodHandle[] FILL_ARRAY_TO_RIGHT = new MethodHandle[MAX_ARITY+1]; + private static final @Stable MethodHandle[] FILL_ARRAY_TO_RIGHT = new MethodHandle[MAX_ARITY + 1]; /** fill_array_to_right(N).invoke(a, argL..arg[N-1]) * fills a[L]..a[N-1] with corresponding arguments, * and then returns a. The value L is a global constant (LEFT_ARGS). diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java index d75bad58a36..71690e5c439 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java @@ -25,6 +25,7 @@ package java.lang.invoke; +import jdk.internal.vm.annotation.Stable; import sun.invoke.util.Wrapper; import java.lang.ref.WeakReference; import java.lang.ref.Reference; diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodTypeForm.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodTypeForm.java index 0c4cf9bd4e1..e988252c8bc 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodTypeForm.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodTypeForm.java @@ -25,6 +25,7 @@ package java.lang.invoke; +import jdk.internal.vm.annotation.Stable; import sun.invoke.util.Wrapper; import java.lang.ref.SoftReference; import static java.lang.invoke.MethodHandleStatics.*; diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/DontInline.java b/jdk/src/java.base/share/classes/jdk/internal/vm/annotation/DontInline.java similarity index 59% rename from jdk/src/java.base/share/classes/java/lang/invoke/DontInline.java rename to jdk/src/java.base/share/classes/jdk/internal/vm/annotation/DontInline.java index 1bd969efb8a..d39dccffbad 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/DontInline.java +++ b/jdk/src/java.base/share/classes/jdk/internal/vm/annotation/DontInline.java @@ -23,15 +23,28 @@ * questions. */ -package java.lang.invoke; +package jdk.internal.vm.annotation; import java.lang.annotation.*; /** - * Internal marker for some methods in the JSR 292 implementation. + * A method or constructor may be annotated as "don't inline" if the inlining of + * this method should not be performed by the HotSpot VM. + *

    + * This annotation must be used sparingly. It is useful when the only + * reasonable alternative is to bind the name of a specific method or + * constructor into the HotSpot VM for special handling by the inlining policy. + * This annotation must not be relied on as an alternative to avoid tuning the + * VM's inlining policy. In a few cases, it may act as a temporary workaround + * until the profiling and inlining performed by the HotSpot VM is sufficiently + * improved. + * + * @implNote + * This annotation only takes effect for methods or constructors of classes + * loaded by the boot loader. Annotations on methods or constructors of classes + * loaded outside of the boot loader are ignored. */ -/*non-public*/ @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) @Retention(RetentionPolicy.RUNTIME) -@interface DontInline { +public @interface DontInline { } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/ForceInline.java b/jdk/src/java.base/share/classes/jdk/internal/vm/annotation/ForceInline.java similarity index 58% rename from jdk/src/java.base/share/classes/java/lang/invoke/ForceInline.java rename to jdk/src/java.base/share/classes/jdk/internal/vm/annotation/ForceInline.java index bbac427efb7..e8253db04a1 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/ForceInline.java +++ b/jdk/src/java.base/share/classes/jdk/internal/vm/annotation/ForceInline.java @@ -23,15 +23,29 @@ * questions. */ -package java.lang.invoke; +package jdk.internal.vm.annotation; import java.lang.annotation.*; /** - * Internal marker for some methods in the JSR 292 implementation. + * A method or constructor may be annotated as "force inline" if the standard + * inlining metrics are to be ignored when the HotSpot VM inlines the method + * or constructor. + *

    + * This annotation must be used sparingly. It is useful when the only + * reasonable alternative is to bind the name of a specific method or + * constructor into the HotSpot VM for special handling by the inlining policy. + * This annotation must not be relied on as an alternative to avoid tuning the + * VM's inlining policy. In a few cases, it may act as a temporary workaround + * until the profiling and inlining performed by the HotSpot VM is sufficiently + * improved. + * + * @implNote + * This annotation only takes effect for methods or constructors of classes + * loaded by the boot loader. Annotations on methods or constructors of classes + * loaded outside of the boot loader are ignored. */ -/*non-public*/ @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) @Retention(RetentionPolicy.RUNTIME) -@interface ForceInline { +public @interface ForceInline { } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/Stable.java b/jdk/src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java similarity index 65% rename from jdk/src/java.base/share/classes/java/lang/invoke/Stable.java rename to jdk/src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java index a0a413e2a79..2ba6e992adf 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/Stable.java +++ b/jdk/src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java @@ -23,7 +23,7 @@ * questions. */ -package java.lang.invoke; +package jdk.internal.vm.annotation; import java.lang.annotation.*; @@ -57,17 +57,34 @@ import java.lang.annotation.*; *

    * Fields which are declared {@code final} may also be annotated as stable. * Since final fields already behave as stable values, such an annotation - * indicates no additional information, unless the type of the field is - * an array type. + * conveys no additional information regarding change of the field's value, but + * still conveys information regarding change of additional components values if + * the type of the field is an array type (as described above). + *

    + * The HotSpot VM relies on this annotation to promote a non-null (resp., + * non-zero) component value to a constant, thereby enabling superior + * optimizations of code depending on such a value (such as constant folding). + * More specifically, the HotSpot VM will process non-null stable fields (final + * or otherwise) in a similar manner to static final fields with respect to + * promoting the field's value to a constant. Thus, placing aside the + * differences for null/non-null values and arrays, a final stable field is + * treated as if it is really final from both the Java language and the HotSpot + * VM. *

    * It is (currently) undefined what happens if a field annotated as stable - * is given a third value. In practice, if the JVM relies on this annotation - * to promote a field reference to a constant, it may be that the Java memory - * model would appear to be broken, if such a constant (the second value of the field) - * is used as the value of the field even after the field value has changed. + * is given a third value (by explicitly updating a stable field, a component of + * a stable array, or a final stable field via reflection or other means). + * Since the HotSpot VM promotes a non-null component value to constant, it may + * be that the Java memory model would appear to be broken, if such a constant + * (the second value of the field) is used as the value of the field even after + * the field value has changed (to a third value). + * + * @implNote + * This annotation only takes effect for fields of classes loaded by the boot + * loader. Annoations on fields of classes loaded outside of the boot loader + * are ignored. */ -/* package-private */ @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) -@interface Stable { +public @interface Stable { } From be2ad289543a3f1ce74ab6fa1734ae70064c04a1 Mon Sep 17 00:00:00 2001 From: Paul Sandoz Date: Wed, 9 Dec 2015 15:26:52 +0100 Subject: [PATCH 025/228] 8143628: Fork sun.misc.Unsafe and jdk.internal.misc.Unsafe native method tables Reviewed-by: shade, dholmes, alanb, chegar, mchung --- jdk/make/src/classes/build/tools/spp/Spp.java | 45 ++++++++++--------- .../share/classes/sun/misc/Unsafe.java | 12 ++--- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/jdk/make/src/classes/build/tools/spp/Spp.java b/jdk/make/src/classes/build/tools/spp/Spp.java index 0e3ca8da0b9..9bbebe6f34e 100644 --- a/jdk/make/src/classes/build/tools/spp/Spp.java +++ b/jdk/make/src/classes/build/tools/spp/Spp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -32,9 +32,10 @@ import java.util.regex.*; * Spp: A simple regex-based stream preprocessor based on Mark Reinhold's * sed-based spp.sh * - * Usage: java build.tools.spp.Spp [-be] [-Kkey] -Dvar=value ... out + * Usage: java build.tools.spp.Spp [-be] [-nel] [-Kkey] -Dvar=value ... out * - * Source-file constructs + * If -nel is declared then empty lines will not be substituted for lines of + * text in the template that do not appear in the output. * * Meaningful only at beginning of line, works with any number of keys: * @@ -64,9 +65,10 @@ import java.util.regex.*; public class Spp { public static void main(String args[]) throws Exception { - Map vars = new HashMap(); - Set keys = new HashSet(); + Map vars = new HashMap<>(); + Set keys = new HashSet<>(); boolean be = false; + boolean el = true; for (String arg:args) { if (arg.startsWith("-D")) { @@ -76,8 +78,10 @@ public class Spp { keys.add(arg.substring(2)); } else if ("-be".equals(arg)) { be = true; + } else if ("-nel".equals(arg)) { + el = false; } else { - System.err.println("Usage: java build.tools.spp.Spp [-be] [-Kkey] -Dvar=value ... out"); + System.err.println("Usage: java build.tools.spp.Spp [-be] [-nel] [-Kkey] -Dvar=value ... out"); System.exit(-1); } } @@ -85,7 +89,7 @@ public class Spp { StringBuffer out = new StringBuffer(); new Spp().spp(new Scanner(System.in), out, "", - keys, vars, be, + keys, vars, be, el, false); System.out.print(out.toString()); } @@ -93,7 +97,7 @@ public class Spp { static final String LNSEP = System.getProperty("line.separator"); static final String KEY = "([a-zA-Z0-9]+)"; static final String VAR = "([a-zA-Z0-9_\\-]+)"; - static final String TEXT = "([a-zA-Z0-9&;,.<>/#() \\$]+)"; // $ -- hack embedded $var$ + static final String TEXT = "([a-zA-Z0-9&;,.<>/#() \\?\\[\\]\\$]+)"; // $ -- hack embedded $var$ static final int GN_NOT = 1; static final int GN_KEY = 2; @@ -101,11 +105,11 @@ public class Spp { static final int GN_NO = 5; static final int GN_VAR = 6; - Matcher ifkey = Pattern.compile("^#if\\[(!)?" + KEY + "\\]").matcher(""); - Matcher elsekey = Pattern.compile("^#else\\[(!)?" + KEY + "\\]").matcher(""); - Matcher endkey = Pattern.compile("^#end\\[(!)?" + KEY + "\\]").matcher(""); - Matcher vardef = Pattern.compile("\\{#if\\[(!)?" + KEY + "\\]\\?" + TEXT + "(:"+ TEXT + ")?\\}|\\$" + VAR + "\\$").matcher(""); - Matcher vardef2 = Pattern.compile("\\$" + VAR + "\\$").matcher(""); + final Matcher ifkey = Pattern.compile("^#if\\[(!)?" + KEY + "\\]").matcher(""); + final Matcher elsekey = Pattern.compile("^#else\\[(!)?" + KEY + "\\]").matcher(""); + final Matcher endkey = Pattern.compile("^#end\\[(!)?" + KEY + "\\]").matcher(""); + final Matcher vardef = Pattern.compile("\\{#if\\[(!)?" + KEY + "\\]\\?" + TEXT + "(:"+ TEXT + ")?\\}|\\$" + VAR + "\\$").matcher(""); + final Matcher vardef2 = Pattern.compile("\\$" + VAR + "\\$").matcher(""); void append(StringBuffer buf, String ln, Set keys, Map vars) { @@ -135,7 +139,7 @@ public class Spp { // return true if #end[key], #end or EOF reached boolean spp(Scanner in, StringBuffer buf, String key, Set keys, Map vars, - boolean be, boolean skip) { + boolean be, boolean el, boolean skip) { while (in.hasNextLine()) { String ln = in.nextLine(); if (be) { @@ -154,9 +158,9 @@ public class Spp { boolean test = keys.contains(k); if (ifkey.group(GN_NOT) != null) test = !test; - buf.append(LNSEP); - if (!spp(in, buf, k, keys, vars, be, skip || !test)) { - spp(in, buf, k, keys, vars, be, skip || test); + if (el) buf.append(LNSEP); + if (!spp(in, buf, k, keys, vars, be, el, skip || !test)) { + spp(in, buf, k, keys, vars, be, el, skip || test); } continue; } @@ -164,14 +168,14 @@ public class Spp { if (!key.equals(elsekey.group(GN_KEY))) { throw new Error("Mis-matched #if-else-end at line <" + ln + ">"); } - buf.append(LNSEP); + if (el) buf.append(LNSEP); return false; } if (endkey.reset(ln).find()) { if (!key.equals(endkey.group(GN_KEY))) { throw new Error("Mis-matched #if-else-end at line <" + ln + ">"); } - buf.append(LNSEP); + if (el) buf.append(LNSEP); return true; } if (ln.startsWith("#warn")) { @@ -181,8 +185,9 @@ public class Spp { } if (!skip) { append(buf, ln, keys, vars); + if (!el) buf.append(LNSEP); } - buf.append(LNSEP); + if (el) buf.append(LNSEP); } return true; } diff --git a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java index 6a4775a4c3a..f100c8649e3 100644 --- a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java +++ b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java @@ -25,13 +25,12 @@ package sun.misc; -import java.lang.reflect.Field; -import java.security.ProtectionDomain; - +import jdk.internal.HotSpotIntrinsicCandidate; import sun.reflect.CallerSensitive; import sun.reflect.Reflection; -import jdk.internal.HotSpotIntrinsicCandidate; +import java.lang.reflect.Field; +import java.security.ProtectionDomain; /** @@ -1035,9 +1034,4 @@ public final class Unsafe { private static void throwIllegalAccessError() { throw new IllegalAccessError(); } - - // JVM interface methods - private native boolean unalignedAccess0(); - private native boolean isBigEndian0(); - } From 5ba6e8e4394d04fce3c0b41efacce6f52c4c98a7 Mon Sep 17 00:00:00 2001 From: Paul Sandoz Date: Tue, 6 Oct 2015 18:42:06 +0200 Subject: [PATCH 026/228] 8133348: Reference.reachabilityFence Co-authored-by: Doug Lea Co-authored-by: Aleksey Shipilev Reviewed-by: plevart, mr, chegar, mchung --- .../classes/java/lang/ref/Reference.java | 117 ++++++++++++++ .../java/lang/ref/ReachabilityFenceTest.java | 143 ++++++++++++++++++ 2 files changed, 260 insertions(+) create mode 100644 jdk/test/java/lang/ref/ReachabilityFenceTest.java diff --git a/jdk/src/java.base/share/classes/java/lang/ref/Reference.java b/jdk/src/java.base/share/classes/java/lang/ref/Reference.java index d18f059308f..eeb771903af 100644 --- a/jdk/src/java.base/share/classes/java/lang/ref/Reference.java +++ b/jdk/src/java.base/share/classes/java/lang/ref/Reference.java @@ -25,6 +25,7 @@ package java.lang.ref; +import jdk.internal.vm.annotation.DontInline; import sun.misc.Cleaner; import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.misc.JavaLangRefAccess; @@ -311,4 +312,120 @@ public abstract class Reference { this.queue = (queue == null) ? ReferenceQueue.NULL : queue; } + /** + * Ensures that the object referenced by the given reference remains + * strongly reachable, + * regardless of any prior actions of the program that might otherwise cause + * the object to become unreachable; thus, the referenced object is not + * reclaimable by garbage collection at least until after the invocation of + * this method. Invocation of this method does not itself initiate garbage + * collection or finalization. + * + *

    This method establishes an ordering for + * strong reachability + * with respect to garbage collection. It controls relations that are + * otherwise only implicit in a program -- the reachability conditions + * triggering garbage collection. This method is designed for use in + * uncommon situations of premature finalization where using + * {@code synchronized} blocks or methods, or using other synchronization + * facilities are not possible or do not provide the desired control. This + * method is applicable only when reclamation may have visible effects, + * which is possible for objects with finalizers (See + * + * Section 12.6 17 of The Java™ Language Specification) + * that are implemented in ways that rely on ordering control for correctness. + * + * @apiNote + * Finalization may occur whenever the virtual machine detects that no + * reference to an object will ever be stored in the heap: The garbage + * collector may reclaim an object even if the fields of that object are + * still in use, so long as the object has otherwise become unreachable. + * This may have surprising and undesirable effects in cases such as the + * following example in which the bookkeeping associated with a class is + * managed through array indices. Here, method {@code action} uses a + * {@code reachabilityFence} to ensure that the {@code Resource} object is + * not reclaimed before bookkeeping on an associated + * {@code ExternalResource} has been performed; in particular here, to + * ensure that the array slot holding the {@code ExternalResource} is not + * nulled out in method {@link Object#finalize}, which may otherwise run + * concurrently. + * + *

     {@code
    +     * class Resource {
    +     *   private static ExternalResource[] externalResourceArray = ...
    +     *
    +     *   int myIndex;
    +     *   Resource(...) {
    +     *     myIndex = ...
    +     *     externalResourceArray[myIndex] = ...;
    +     *     ...
    +     *   }
    +     *   protected void finalize() {
    +     *     externalResourceArray[myIndex] = null;
    +     *     ...
    +     *   }
    +     *   public void action() {
    +     *     try {
    +     *       // ...
    +     *       int i = myIndex;
    +     *       Resource.update(externalResourceArray[i]);
    +     *     } finally {
    +     *       Reference.reachabilityFence(this);
    +     *     }
    +     *   }
    +     *   private static void update(ExternalResource ext) {
    +     *     ext.status = ...;
    +     *   }
    +     * }}
    + * + * Here, the invocation of {@code reachabilityFence} is nonintuitively + * placed after the call to {@code update}, to ensure that the + * array slot is not nulled out by {@link Object#finalize} before the + * update, even if the call to {@code action} was the last use of this + * object. This might be the case if, for example a usage in a user program + * had the form {@code new Resource().action();} which retains no other + * reference to this {@code Resource}. While probably overkill here, + * {@code reachabilityFence} is placed in a {@code finally} block to ensure + * that it is invoked across all paths in the method. In a method with more + * complex control paths, you might need further precautions to ensure that + * {@code reachabilityFence} is encountered along all of them. + * + *

    It is sometimes possible to better encapsulate use of + * {@code reachabilityFence}. Continuing the above example, if it were + * acceptable for the call to method {@code update} to proceed even if the + * finalizer had already executed (nulling out slot), then you could + * localize use of {@code reachabilityFence}: + * + *

     {@code
    +     * public void action2() {
    +     *   // ...
    +     *   Resource.update(getExternalResource());
    +     * }
    +     * private ExternalResource getExternalResource() {
    +     *   ExternalResource ext = externalResourceArray[myIndex];
    +     *   Reference.reachabilityFence(this);
    +     *   return ext;
    +     * }}
    + * + *

    Method {@code reachabilityFence} is not required in constructions + * that themselves ensure reachability. For example, because objects that + * are locked cannot, in general, be reclaimed, it would suffice if all + * accesses of the object, in all methods of class {@code Resource} + * (including {@code finalize}) were enclosed in {@code synchronized (this)} + * blocks. (Further, such blocks must not include infinite loops, or + * themselves be unreachable, which fall into the corner case exceptions to + * the "in general" disclaimer.) However, method {@code reachabilityFence} + * remains a better option in cases where this approach is not as efficient, + * desirable, or possible; for example because it would encounter deadlock. + * + * @param ref the reference. If {@code null}, this method has no effect. + * @since 9 + */ + @DontInline + public static void reachabilityFence(Object ref) { + // Does nothing, because this method is annotated with @DontInline + // HotSpot needs to retain the ref and not GC it before a call to this + // method + } + } diff --git a/jdk/test/java/lang/ref/ReachabilityFenceTest.java b/jdk/test/java/lang/ref/ReachabilityFenceTest.java new file mode 100644 index 00000000000..461c6b200f1 --- /dev/null +++ b/jdk/test/java/lang/ref/ReachabilityFenceTest.java @@ -0,0 +1,143 @@ +/* + * 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 8133348 + * @summary Tests if reachabilityFence is working + * + * @run main/othervm -Xint -Dpremature=false ReachabilityFenceTest + * @run main/othervm -XX:TieredStopAtLevel=1 -Dpremature=true ReachabilityFenceTest + * @run main/othervm -XX:TieredStopAtLevel=2 -Dpremature=true ReachabilityFenceTest + * @run main/othervm -XX:TieredStopAtLevel=3 -Dpremature=true ReachabilityFenceTest + * @run main/othervm -XX:TieredStopAtLevel=4 -Dpremature=true ReachabilityFenceTest + */ + +import java.lang.ref.Reference; +import java.util.concurrent.atomic.AtomicBoolean; + +public class ReachabilityFenceTest { + + /* + * Implementation notes: + * + * This test has positive and negative parts. + * + * Negative test is "nonFenced", and it tests that absent of reachabilityFence, the object can + * be prematurely finalized -- this validates the test itself. Not every VM mode is expected to + * prematurely finalize the objects, and -Dpremature option communicates that to test. If a VM mode + * passes the negative test, then our understanding of what could happen is correct, and we can + * go forward. + * + * Positive test is "fenced", and it checks that given the reachabilityFence at the end of the block, + * the object cannot be finalized. There is no sense running a positive test when premature finalization + * is not expected. It is a job for negative test to verify that invariant. + * + * The test methods should be appropriately compiled, therefore we do several iterations. + */ + + // Enough to OSR and compile + static final int LOOP_ITERS = Integer.getInteger("LOOP_ITERS", 50000); + + // Enough after which to start triggering GC and finalization + static final int WARMUP_LOOP_ITERS = LOOP_ITERS - Integer.getInteger("GC_ITERS", 100); + + // Enough to switch from an OSR'ed method to compiled method + static final int MAIN_ITERS = 3; + + static final boolean PREMATURE_FINALIZATION = Boolean.getBoolean("premature"); + + public static void main(String... args) { + // Negative test + boolean finalized = false; + for (int c = 0; !finalized && c < MAIN_ITERS; c++) { + finalized |= nonFenced(); + } + + if (PREMATURE_FINALIZATION && !finalized) { + throw new IllegalStateException("The object had never been finalized before timeout reached."); + } + + if (!PREMATURE_FINALIZATION && finalized) { + throw new IllegalStateException("The object had been finalized without a fence, even though we don't expect it."); + } + + if (!PREMATURE_FINALIZATION) + return; + + // Positive test + finalized = false; + for (int c = 0; !finalized && c < MAIN_ITERS; c++) { + finalized |= fenced(); + } + + if (finalized) { + throw new IllegalStateException("The object had been prematurely finalized."); + } + } + + public static boolean nonFenced() { + AtomicBoolean finalized = new AtomicBoolean(); + MyFinalizeable o = new MyFinalizeable(finalized); + + for (int i = 0; i < LOOP_ITERS; i++) { + if (finalized.get()) break; + if (i > WARMUP_LOOP_ITERS) { + System.gc(); + System.runFinalization(); + } + } + + return finalized.get(); + } + + public static boolean fenced() { + AtomicBoolean finalized = new AtomicBoolean(); + MyFinalizeable o = new MyFinalizeable(finalized); + + for (int i = 0; i < LOOP_ITERS; i++) { + if (finalized.get()) break; + if (i > WARMUP_LOOP_ITERS) { + System.gc(); + System.runFinalization(); + } + } + + Reference.reachabilityFence(o); + + return finalized.get(); + } + + private static class MyFinalizeable { + private final AtomicBoolean finalized; + + public MyFinalizeable(AtomicBoolean b) { + this.finalized = b; + } + + @Override + protected void finalize() throws Throwable { + super.finalize(); + finalized.set(true); + } + } +} \ No newline at end of file From 64190ac6295d2efc1daf5fa173d6ed9487c1ba60 Mon Sep 17 00:00:00 2001 From: Vadim Pakhnushev Date: Fri, 16 Oct 2015 14:12:35 +0300 Subject: [PATCH 027/228] 8139017: More stable image decoding Reviewed-by: prr, serb, mschoene --- .../share/native/libjavajpeg/jpegdecoder.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c b/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c index 65ef089a06a..06d0e2ba539 100644 --- a/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c +++ b/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c @@ -180,6 +180,7 @@ struct sun_jpeg_source_mgr { int *ip; unsigned char *bp; } outbuf; + size_t outbufSize; jobject hOutputBuffer; }; @@ -235,6 +236,7 @@ static int GET_ARRAYS(JNIEnv *env, sun_jpeg_source_ptr src) assert(src->outbuf.ip == 0); src->outbuf.ip = (int *)(*env)->GetPrimitiveArrayCritical (env, src->hOutputBuffer, 0); + src->outbufSize = (*env)->GetArrayLength(env, src->hOutputBuffer); if (src->outbuf.ip == 0) { RELEASE_ARRAYS(env, src); return 0; @@ -677,8 +679,8 @@ Java_sun_awt_image_JPEGImageDecoder_readImage(JNIEnv *env, cinfo.output_scanline - 1); } else { if (hasalpha) { - ip = jsrc.outbuf.ip + cinfo.image_width; - bp = jsrc.outbuf.bp + cinfo.image_width * 4; + ip = jsrc.outbuf.ip + jsrc.outbufSize; + bp = jsrc.outbuf.bp + jsrc.outbufSize * 4; while (ip > jsrc.outbuf.ip) { pixel = (*--bp) << 24; pixel |= (*--bp); @@ -687,8 +689,8 @@ Java_sun_awt_image_JPEGImageDecoder_readImage(JNIEnv *env, *--ip = pixel; } } else { - ip = jsrc.outbuf.ip + cinfo.image_width; - bp = jsrc.outbuf.bp + cinfo.image_width * 3; + ip = jsrc.outbuf.ip + jsrc.outbufSize; + bp = jsrc.outbuf.bp + jsrc.outbufSize * 3; while (ip > jsrc.outbuf.ip) { pixel = (*--bp); pixel |= (*--bp) << 8; From 11af905b181504da95f793d5172af0728d16ba4b Mon Sep 17 00:00:00 2001 From: Vadim Pakhnushev Date: Wed, 21 Oct 2015 14:55:18 +0300 Subject: [PATCH 028/228] 8139012: Better font substitutions Reviewed-by: prr, srl, mschoene --- .../layout/ContextualSubstSubtables.cpp | 38 ++++++++++--------- .../layout/CursiveAttachmentSubtables.cpp | 2 +- .../native/libfontmanager/layout/Features.cpp | 2 +- .../layout/MarkToBasePosnSubtables.cpp | 2 +- .../layout/MarkToLigaturePosnSubtables.cpp | 6 ++- 5 files changed, 29 insertions(+), 21 deletions(-) diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/ContextualSubstSubtables.cpp b/jdk/src/java.desktop/share/native/libfontmanager/layout/ContextualSubstSubtables.cpp index 8b676683fa8..8beae2730aa 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/ContextualSubstSubtables.cpp +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/ContextualSubstSubtables.cpp @@ -243,14 +243,14 @@ le_uint32 ContextualSubstitutionFormat1Subtable::process(const LETableReference le_uint16 srSetCount = SWAPW(subRuleSetCount); if (coverageIndex < srSetCount) { - LEReferenceToArrayOf subRuleSetTableOffsetArrayRef(base, success, - &subRuleSetTableOffsetArray[coverageIndex], 1); + LEReferenceToArrayOf + subRuleSetTableOffsetArrayRef(base, success, subRuleSetTableOffsetArray, srSetCount); if (LE_FAILURE(success)) { return 0; } Offset subRuleSetTableOffset = SWAPW(subRuleSetTableOffsetArray[coverageIndex]); - LEReferenceTo - subRuleSetTable(base, success, (const SubRuleSetTable *) ((char *) this + subRuleSetTableOffset)); + LEReferenceTo subRuleSetTable(base, success, subRuleSetTableOffset); + if (LE_FAILURE(success)) { return 0; } le_uint16 subRuleCount = SWAPW(subRuleSetTable->subRuleCount); le_int32 position = glyphIterator->getCurrStreamPosition(); @@ -264,6 +264,7 @@ le_uint32 ContextualSubstitutionFormat1Subtable::process(const LETableReference SWAPW(subRuleSetTable->subRuleTableOffsetArray[subRule]); LEReferenceTo subRuleTable(subRuleSetTable, success, subRuleTableOffset); + if (LE_FAILURE(success)) { return 0; } le_uint16 matchCount = SWAPW(subRuleTable->glyphCount) - 1; le_uint16 substCount = SWAPW(subRuleTable->substCount); LEReferenceToArrayOf inputGlyphArray(base, success, subRuleTable->inputGlyphArray, matchCount+2); @@ -304,8 +305,8 @@ le_uint32 ContextualSubstitutionFormat2Subtable::process(const LETableReference } if (coverageIndex >= 0) { - LEReferenceTo classDefinitionTable(base, success, - (const ClassDefinitionTable *) ((char *) this + SWAPW(classDefTableOffset))); + LEReferenceTo classDefinitionTable(base, success, SWAPW(classDefTableOffset)); + if (LE_FAILURE(success)) { return 0; } le_uint16 scSetCount = SWAPW(subClassSetCount); le_int32 setClass = classDefinitionTable->getGlyphClass(classDefinitionTable, glyphIterator->getCurrGlyphID(), @@ -313,13 +314,13 @@ le_uint32 ContextualSubstitutionFormat2Subtable::process(const LETableReference if (setClass < scSetCount) { LEReferenceToArrayOf - subClassSetTableOffsetArrayRef(base, success, subClassSetTableOffsetArray, setClass); + subClassSetTableOffsetArrayRef(base, success, subClassSetTableOffsetArray, scSetCount); if (LE_FAILURE(success)) { return 0; } if (subClassSetTableOffsetArray[setClass] != 0) { Offset subClassSetTableOffset = SWAPW(subClassSetTableOffsetArray[setClass]); - LEReferenceTo - subClassSetTable(base, success, (const SubClassSetTable *) ((char *) this + subClassSetTableOffset)); + LEReferenceTo subClassSetTable(base, success, subClassSetTableOffset); + if (LE_FAILURE(success)) { return 0; } le_uint16 subClassRuleCount = SWAPW(subClassSetTable->subClassRuleCount); le_int32 position = glyphIterator->getCurrStreamPosition(); LEReferenceToArrayOf @@ -332,6 +333,7 @@ le_uint32 ContextualSubstitutionFormat2Subtable::process(const LETableReference SWAPW(subClassSetTable->subClassRuleTableOffsetArray[scRule]); LEReferenceTo subClassRuleTable(subClassSetTable, success, subClassRuleTableOffset); + if (LE_FAILURE(success)) { return 0; } le_uint16 matchCount = SWAPW(subClassRuleTable->glyphCount) - 1; le_uint16 substCount = SWAPW(subClassRuleTable->substCount); @@ -463,13 +465,13 @@ le_uint32 ChainingContextualSubstitutionFormat1Subtable::process(const LETableRe if (coverageIndex < srSetCount) { LEReferenceToArrayOf - chainSubRuleSetTableOffsetArrayRef(base, success, chainSubRuleSetTableOffsetArray, coverageIndex); + chainSubRuleSetTableOffsetArrayRef(base, success, chainSubRuleSetTableOffsetArray, srSetCount); if (LE_FAILURE(success)) { return 0; } Offset chainSubRuleSetTableOffset = SWAPW(chainSubRuleSetTableOffsetArray[coverageIndex]); - LEReferenceTo - chainSubRuleSetTable(base, success, (const ChainSubRuleSetTable *) ((char *) this + chainSubRuleSetTableOffset)); + LEReferenceTo chainSubRuleSetTable(base, success, chainSubRuleSetTableOffset); + if (LE_FAILURE(success)) { return 0; } le_uint16 chainSubRuleCount = SWAPW(chainSubRuleSetTable->chainSubRuleCount); le_int32 position = glyphIterator->getCurrStreamPosition(); GlyphIterator tempIterator(*glyphIterator, emptyFeatureList); @@ -550,17 +552,17 @@ le_uint32 ChainingContextualSubstitutionFormat2Subtable::process(const LETableRe if (coverageIndex >= 0) { LEReferenceTo - backtrackClassDefinitionTable(base, success, (const ClassDefinitionTable *) ((char *) this + SWAPW(backtrackClassDefTableOffset))); + backtrackClassDefinitionTable(base, success, SWAPW(backtrackClassDefTableOffset)); LEReferenceTo - inputClassDefinitionTable(base, success, (const ClassDefinitionTable *) ((char *) this + SWAPW(inputClassDefTableOffset))); + inputClassDefinitionTable(base, success, SWAPW(inputClassDefTableOffset)); LEReferenceTo - lookaheadClassDefinitionTable(base, success, (const ClassDefinitionTable *) ((char *) this + SWAPW(lookaheadClassDefTableOffset))); + lookaheadClassDefinitionTable(base, success, SWAPW(lookaheadClassDefTableOffset)); le_uint16 scSetCount = SWAPW(chainSubClassSetCount); le_int32 setClass = inputClassDefinitionTable->getGlyphClass(inputClassDefinitionTable, glyphIterator->getCurrGlyphID(), success); LEReferenceToArrayOf - chainSubClassSetTableOffsetArrayRef(base, success, chainSubClassSetTableOffsetArray, setClass); + chainSubClassSetTableOffsetArrayRef(base, success, chainSubClassSetTableOffsetArray, scSetCount); if (LE_FAILURE(success)) { return 0; } @@ -568,7 +570,8 @@ le_uint32 ChainingContextualSubstitutionFormat2Subtable::process(const LETableRe if (setClass < scSetCount && chainSubClassSetTableOffsetArray[setClass] != 0) { Offset chainSubClassSetTableOffset = SWAPW(chainSubClassSetTableOffsetArray[setClass]); LEReferenceTo - chainSubClassSetTable(base, success, (const ChainSubClassSetTable *) ((char *) this + chainSubClassSetTableOffset)); + chainSubClassSetTable(base, success, chainSubClassSetTableOffset); + if (LE_FAILURE(success)) { return 0; } le_uint16 chainSubClassRuleCount = SWAPW(chainSubClassSetTable->chainSubClassRuleCount); le_int32 position = glyphIterator->getCurrStreamPosition(); GlyphIterator tempIterator(*glyphIterator, emptyFeatureList); @@ -582,6 +585,7 @@ le_uint32 ChainingContextualSubstitutionFormat2Subtable::process(const LETableRe SWAPW(chainSubClassSetTable->chainSubClassRuleTableOffsetArray[scRule]); LEReferenceTo chainSubClassRuleTable(chainSubClassSetTable, success, chainSubClassRuleTableOffset); + if (LE_FAILURE(success)) { return 0; } le_uint16 backtrackGlyphCount = SWAPW(chainSubClassRuleTable->backtrackGlyphCount); LEReferenceToArrayOf backtrackClassArray(base, success, chainSubClassRuleTable->backtrackClassArray, backtrackGlyphCount); if( LE_FAILURE(success) ) { return 0; } diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/CursiveAttachmentSubtables.cpp b/jdk/src/java.desktop/share/native/libfontmanager/layout/CursiveAttachmentSubtables.cpp index f2c9f95ac70..0f230f12e7d 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/CursiveAttachmentSubtables.cpp +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/CursiveAttachmentSubtables.cpp @@ -46,7 +46,7 @@ le_uint32 CursiveAttachmentSubtable::process(const LEReferenceTo - entryExitRecordsArrayRef(base, success, entryExitRecords, coverageIndex); + entryExitRecordsArrayRef(base, success, entryExitRecords, eeCount); if (coverageIndex < 0 || coverageIndex >= eeCount || LE_FAILURE(success)) { glyphIterator->setCursiveGlyph(); diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/Features.cpp b/jdk/src/java.desktop/share/native/libfontmanager/layout/Features.cpp index 02bb838d52f..0621888504d 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/Features.cpp +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/Features.cpp @@ -41,7 +41,7 @@ U_NAMESPACE_BEGIN LEReferenceTo FeatureListTable::getFeatureTable(const LETableReference &base, le_uint16 featureIndex, LETag *featureTag, LEErrorCode &success) const { LEReferenceToArrayOf - featureRecordArrayRef(base, success, featureRecordArray, featureIndex+1); + featureRecordArrayRef(base, success, featureRecordArray, SWAPW(featureCount)); if (featureIndex >= SWAPW(featureCount) || LE_FAILURE(success)) { return LEReferenceTo(); diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/MarkToBasePosnSubtables.cpp b/jdk/src/java.desktop/share/native/libfontmanager/layout/MarkToBasePosnSubtables.cpp index ed1d11d4044..086da91629e 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/MarkToBasePosnSubtables.cpp +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/MarkToBasePosnSubtables.cpp @@ -93,7 +93,7 @@ le_int32 MarkToBasePositioningSubtable::process(const LETableReference &base, Gl } LEReferenceTo baseRecord(base, success, &baseArray->baseRecordArray[baseCoverage * mcCount]); if( LE_FAILURE(success) ) { return 0; } - LEReferenceToArrayOf baseAnchorTableOffsetArray(base, success, &(baseRecord->baseAnchorTableOffsetArray[0]), markClass+1); + LEReferenceToArrayOf baseAnchorTableOffsetArray(base, success, &(baseRecord->baseAnchorTableOffsetArray[0]), mcCount); if( LE_FAILURE(success) ) { return 0; } Offset anchorTableOffset = SWAPW(baseRecord->baseAnchorTableOffsetArray[markClass]); diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/MarkToLigaturePosnSubtables.cpp b/jdk/src/java.desktop/share/native/libfontmanager/layout/MarkToLigaturePosnSubtables.cpp index 55fadf3b5f0..2515b8afb5a 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/MarkToLigaturePosnSubtables.cpp +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/MarkToLigaturePosnSubtables.cpp @@ -83,6 +83,7 @@ le_int32 MarkToLigaturePositioningSubtable::process(const LETableReference &base LEGlyphID ligatureGlyph = findLigatureGlyph(&ligatureIterator); le_int32 ligatureCoverage = getBaseCoverage(base, (LEGlyphID) ligatureGlyph, success); LEReferenceTo ligatureArray(base, success, SWAPW(baseArrayOffset)); + if (LE_FAILURE(success)) { return 0; } le_uint16 ligatureCount = SWAPW(ligatureArray->ligatureCount); if (ligatureCoverage < 0 || ligatureCoverage >= ligatureCount) { @@ -95,6 +96,7 @@ le_int32 MarkToLigaturePositioningSubtable::process(const LETableReference &base le_int32 markPosition = glyphIterator->getCurrStreamPosition(); Offset ligatureAttachOffset = SWAPW(ligatureArray->ligatureAttachTableOffsetArray[ligatureCoverage]); LEReferenceTo ligatureAttachTable(ligatureArray, success, ligatureAttachOffset); + if (LE_FAILURE(success)) { return 0; } le_int32 componentCount = SWAPW(ligatureAttachTable->componentCount); le_int32 component = ligatureIterator.getMarkComponent(markPosition); @@ -104,10 +106,12 @@ le_int32 MarkToLigaturePositioningSubtable::process(const LETableReference &base } LEReferenceTo componentRecord(base, success, &ligatureAttachTable->componentRecordArray[component * mcCount]); - LEReferenceToArrayOf ligatureAnchorTableOffsetArray(base, success, &(componentRecord->ligatureAnchorTableOffsetArray[0]), markClass+1); + if (LE_FAILURE(success)) { return 0; } + LEReferenceToArrayOf ligatureAnchorTableOffsetArray(base, success, &(componentRecord->ligatureAnchorTableOffsetArray[0]), mcCount); if( LE_FAILURE(success) ) { return 0; } Offset anchorTableOffset = SWAPW(componentRecord->ligatureAnchorTableOffsetArray[markClass]); LEReferenceTo anchorTable(ligatureAttachTable, success, anchorTableOffset); + if (LE_FAILURE(success)) { return 0; } LEPoint ligatureAnchor, markAdvance, pixels; anchorTable->getAnchor(anchorTable, ligatureGlyph, fontInstance, ligatureAnchor, success); From f03a55be9ea9565ccf2a64c6b5aea1a1716db629 Mon Sep 17 00:00:00 2001 From: Vadim Pakhnushev Date: Mon, 26 Oct 2015 23:41:41 +0300 Subject: [PATCH 029/228] 8140543: Arrange font actions Reviewed-by: prr, srl, mschoene --- .../libfontmanager/layout/IndicRearrangementProcessor.cpp | 6 +++--- .../libfontmanager/layout/IndicRearrangementProcessor.h | 4 ++-- .../libfontmanager/layout/IndicRearrangementProcessor2.cpp | 6 +++--- .../libfontmanager/layout/IndicRearrangementProcessor2.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor.cpp b/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor.cpp index 15bca3800b2..5598349131a 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor.cpp +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor.cpp @@ -76,11 +76,11 @@ ByteOffset IndicRearrangementProcessor::processStateEntry(LEGlyphStorage &glyphS } if (flags & irfMarkFirst) { - firstGlyph = (le_uint32)currGlyph; + firstGlyph = currGlyph; } if (flags & irfMarkLast) { - lastGlyph = (le_uint32)currGlyph; + lastGlyph = currGlyph; } doRearrangementAction(glyphStorage, (IndicRearrangementVerb) (flags & irfVerbMask), success); @@ -118,7 +118,7 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto if (firstGlyph == lastGlyph) break; if (firstGlyph + 1 < firstGlyph) { success = LE_INDEX_OUT_OF_BOUNDS_ERROR; - break; + break; } a = glyphStorage[firstGlyph]; ia = glyphStorage.getCharIndex(firstGlyph, success); diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor.h b/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor.h index 36af0ff1254..42d7a249aa1 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor.h +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor.h @@ -76,8 +76,8 @@ public: static UClassID getStaticClassID(); protected: - le_uint32 firstGlyph; - le_uint32 lastGlyph; + le_int32 firstGlyph; + le_int32 lastGlyph; LEReferenceTo indicRearrangementSubtableHeader; LEReferenceToArrayOf entryTable; diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor2.cpp b/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor2.cpp index 2a94c101f2a..8692312ecd4 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor2.cpp +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor2.cpp @@ -74,11 +74,11 @@ le_uint16 IndicRearrangementProcessor2::processStateEntry(LEGlyphStorage &glyphS } if (flags & irfMarkFirst) { - firstGlyph = (le_uint32)currGlyph; + firstGlyph = currGlyph; } if (flags & irfMarkLast) { - lastGlyph = (le_uint32)currGlyph; + lastGlyph = currGlyph; } doRearrangementAction(glyphStorage, (IndicRearrangementVerb) (flags & irfVerbMask), success); @@ -115,7 +115,7 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt if (firstGlyph == lastGlyph) break; if (firstGlyph + 1 < firstGlyph) { success = LE_INDEX_OUT_OF_BOUNDS_ERROR; - break; + break; } a = glyphStorage[firstGlyph]; ia = glyphStorage.getCharIndex(firstGlyph, success); diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor2.h b/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor2.h index b68abe1695c..691274c6da0 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor2.h +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/IndicRearrangementProcessor2.h @@ -76,8 +76,8 @@ public: static UClassID getStaticClassID(); protected: - le_uint32 firstGlyph; - le_uint32 lastGlyph; + le_int32 firstGlyph; + le_int32 lastGlyph; LEReferenceToArrayOf entryTable; LEReferenceTo indicRearrangementSubtableHeader; From 69c0fd73d38b4a38ff0c1ffa0abf7315a1de9b6d Mon Sep 17 00:00:00 2001 From: Vadim Pakhnushev Date: Tue, 3 Nov 2015 14:44:10 +0300 Subject: [PATCH 030/228] 8141213: [Parfait]Potentially blocking function GetArrayLength called in JNI critical region at line 239 of jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c in function GET_ARRAYS Reviewed-by: prr, serb --- jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c b/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c index 06d0e2ba539..1cd05ab09c2 100644 --- a/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c +++ b/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c @@ -234,9 +234,9 @@ static int GET_ARRAYS(JNIEnv *env, sun_jpeg_source_ptr src) } if (src->hOutputBuffer) { assert(src->outbuf.ip == 0); + src->outbufSize = (*env)->GetArrayLength(env, src->hOutputBuffer); src->outbuf.ip = (int *)(*env)->GetPrimitiveArrayCritical (env, src->hOutputBuffer, 0); - src->outbufSize = (*env)->GetArrayLength(env, src->hOutputBuffer); if (src->outbuf.ip == 0) { RELEASE_ARRAYS(env, src); return 0; From c6b9bd52d8ed92ad5c3028f8992a827cf79d2109 Mon Sep 17 00:00:00 2001 From: Vadim Pakhnushev Date: Wed, 18 Nov 2015 11:35:23 +0300 Subject: [PATCH 031/228] 8141229: [Parfait] Null pointer dereference in cmsstrcasecmp of cmserr.c Reviewed-by: prr, serb --- jdk/src/java.desktop/share/native/liblcms/cmscgats.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jdk/src/java.desktop/share/native/liblcms/cmscgats.c b/jdk/src/java.desktop/share/native/liblcms/cmscgats.c index 0dedc277718..664a3c9eca7 100644 --- a/jdk/src/java.desktop/share/native/liblcms/cmscgats.c +++ b/jdk/src/java.desktop/share/native/liblcms/cmscgats.c @@ -2545,9 +2545,11 @@ int LocateSample(cmsIT8* it8, const char* cSample) for (i=0; i < t->nSamples; i++) { fld = GetDataFormat(it8, i); + if (fld != NULL) { if (cmsstrcasecmp(fld, cSample) == 0) return i; } + } return -1; From 0410c05b22f05c0e007ca92c2428381ec8846e46 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 18 Nov 2015 11:31:59 +0100 Subject: [PATCH 032/228] 8143215: gcc 4.1.2: fix three issues breaking the build Also fix some more recent introduced missing casts. Reviewed-by: stuefe, simonis, kbarrett, tschatzl --- .../vm/gc/cms/concurrentMarkSweepGeneration.cpp | 2 +- hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp | 14 +++++++++----- hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp | 1 + hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp | 15 ++++++++++----- hotspot/src/share/vm/gc/shared/gcTraceSend.cpp | 4 ++-- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp index 92ede42baef..f112552d0ff 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp @@ -2730,7 +2730,7 @@ class CMSPhaseAccounting: public StackObj { public: // Not MT-safe; so do not pass around these StackObj's // where they may be accessed by other threads. - jlong wallclock_millis() { + double wallclock_millis() { return TimeHelper::counter_to_millis(os::elapsed_counter() - _trace_time.start_time()); } }; diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp index 4e603475391..0f435abe90a 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp @@ -291,6 +291,10 @@ double G1CollectorPolicy::get_new_prediction(TruncatedSeq const* seq) const { return _predictor.get_new_prediction(seq); } +size_t G1CollectorPolicy::get_new_size_prediction(TruncatedSeq const* seq) const { + return (size_t)get_new_prediction(seq); +} + void G1CollectorPolicy::initialize_alignments() { _space_alignment = HeapRegion::GrainBytes; size_t card_table_alignment = CardTableRS::ct_max_alignment_constraint(); @@ -477,7 +481,7 @@ bool G1CollectorPolicy::predict_will_fit(uint young_length, // (100 + TargetPLABWastePct) represents the increase in expected bytes during // copying due to anticipated waste in the PLABs. double safety_factor = (100.0 / G1ConfidencePercent) * (100 + TargetPLABWastePct) / 100.0; - size_t expected_bytes_to_copy = safety_factor * bytes_to_copy; + size_t expected_bytes_to_copy = (size_t)(safety_factor * bytes_to_copy); if (expected_bytes_to_copy > free_bytes) { // end condition 3: out-of-space @@ -524,7 +528,7 @@ uint G1CollectorPolicy::calculate_young_list_desired_max_length() const { } uint G1CollectorPolicy::update_young_list_max_and_target_length() { - return update_young_list_max_and_target_length(get_new_prediction(_rs_lengths_seq)); + return update_young_list_max_and_target_length(get_new_size_prediction(_rs_lengths_seq)); } uint G1CollectorPolicy::update_young_list_max_and_target_length(size_t rs_lengths) { @@ -629,7 +633,7 @@ G1CollectorPolicy::calculate_young_list_target_length(size_t rs_lengths, double target_pause_time_ms = _mmu_tracker->max_gc_time() * 1000.0; double survivor_regions_evac_time = predict_survivor_regions_evac_time(); - size_t pending_cards = (size_t) get_new_prediction(_pending_cards_seq); + size_t pending_cards = get_new_size_prediction(_pending_cards_seq); size_t adj_rs_lengths = rs_lengths + predict_rs_length_diff(); size_t scanned_cards = predict_young_card_num(adj_rs_lengths); double base_time_ms = @@ -732,7 +736,7 @@ void G1CollectorPolicy::revise_young_list_target_length_if_necessary() { } void G1CollectorPolicy::update_rs_lengths_prediction() { - update_rs_lengths_prediction(get_new_prediction(_rs_lengths_seq)); + update_rs_lengths_prediction(get_new_size_prediction(_rs_lengths_seq)); } void G1CollectorPolicy::update_rs_lengths_prediction(size_t prediction) { @@ -1345,7 +1349,7 @@ void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time, } size_t G1CollectorPolicy::predict_rs_length_diff() const { - return (size_t) get_new_prediction(_rs_length_diff_seq); + return get_new_size_prediction(_rs_length_diff_seq); } double G1CollectorPolicy::predict_alloc_rate_ms() const { diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp index d0687a1c1e6..d742f852a49 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp @@ -179,6 +179,7 @@ class G1CollectorPolicy: public CollectorPolicy { G1Predictions _predictor; double get_new_prediction(TruncatedSeq const* seq) const; + size_t get_new_size_prediction(TruncatedSeq const* seq) const; // either equal to the number of parallel threads, if ParallelGCThreads // has been set, or 1 otherwise diff --git a/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp b/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp index 705d3af6fd7..0cf5dab9448 100644 --- a/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp +++ b/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp @@ -138,7 +138,7 @@ size_t G1AdaptiveIHOPControl::actual_target_threshold() const { double safe_total_heap_percentage = MIN2((double)(_heap_reserve_percent + _heap_waste_percent), 100.0); - return MIN2( + return (size_t)MIN2( G1CollectedHeap::heap()->max_capacity() * (100.0 - safe_total_heap_percentage) / 100.0, _target_occupancy * (100.0 - _heap_waste_percent) / 100.0 ); @@ -153,10 +153,13 @@ size_t G1AdaptiveIHOPControl::get_conc_mark_start_threshold() { if (have_enough_data_for_prediction()) { double pred_marking_time = _predictor->get_new_prediction(&_marking_times_s); double pred_promotion_rate = _predictor->get_new_prediction(&_allocation_rate_s); + size_t pred_promotion_size = (size_t)(pred_marking_time * pred_promotion_rate); size_t predicted_needed_bytes_during_marking = - (pred_marking_time * pred_promotion_rate + - _last_unrestrained_young_size); // In reality we would need the maximum size of the young gen during marking. This is a conservative estimate. + pred_promotion_size + + // In reality we would need the maximum size of the young gen during + // marking. This is a conservative estimate. + _last_unrestrained_young_size; size_t internal_threshold = actual_target_threshold(); size_t predicted_initiating_threshold = predicted_needed_bytes_during_marking < internal_threshold ? @@ -165,11 +168,13 @@ size_t G1AdaptiveIHOPControl::get_conc_mark_start_threshold() { return predicted_initiating_threshold; } else { // Use the initial value. - return _initial_ihop_percent * _target_occupancy / 100.0; + return (size_t)(_initial_ihop_percent * _target_occupancy / 100.0); } } -void G1AdaptiveIHOPControl::update_allocation_info(double allocation_time_s, size_t allocated_bytes, size_t additional_buffer_size) { +void G1AdaptiveIHOPControl::update_allocation_info(double allocation_time_s, + size_t allocated_bytes, + size_t additional_buffer_size) { G1IHOPControl::update_allocation_info(allocation_time_s, allocated_bytes, additional_buffer_size); double allocation_rate = (double) allocated_bytes / allocation_time_s; diff --git a/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp b/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp index 5c6b5ad2284..07c8f32e5dd 100644 --- a/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp +++ b/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp @@ -278,7 +278,7 @@ void G1NewTracer::send_basic_ihop_statistics(size_t threshold, evt.set_gcId(GCId::current()); evt.set_threshold(threshold); evt.set_targetOccupancy(target_occupancy); - evt.set_thresholdPercentage(target_occupancy > 0 ? threshold * 100.0 / target_occupancy : 0.0); + evt.set_thresholdPercentage(target_occupancy > 0 ? (threshold * 100 / target_occupancy) : 0); evt.set_currentOccupancy(current_occupancy); evt.set_lastAllocationSize(last_allocation_size); evt.set_lastAllocationDuration(last_allocation_duration); @@ -299,7 +299,7 @@ void G1NewTracer::send_adaptive_ihop_statistics(size_t threshold, if (evt.should_commit()) { evt.set_gcId(GCId::current()); evt.set_threshold(threshold); - evt.set_thresholdPercentage(internal_target_occupancy > 0 ? threshold * 100.0 / internal_target_occupancy : 0.0); + evt.set_thresholdPercentage(internal_target_occupancy > 0 ? (threshold * 100 / internal_target_occupancy) : 0); evt.set_internalTargetOccupancy(internal_target_occupancy); evt.set_currentOccupancy(current_occupancy); evt.set_additionalBufferSize(additional_buffer_size); From 1d4561775d54cded26d08d8ed0444653789a2e23 Mon Sep 17 00:00:00 2001 From: Michael Haupt Date: Wed, 9 Dec 2015 11:02:54 +0000 Subject: [PATCH 033/228] 8081512: Remove sun.invoke.anon classes, or move / co-locate them with tests Reviewed-by: mchung, sundar --- .../sun/invoke/anon/AnonymousClassLoader.java | 234 -------- .../sun/invoke/anon/ConstantPoolParser.java | 368 ------------- .../sun/invoke/anon/ConstantPoolPatch.java | 503 ------------------ .../sun/invoke/anon/ConstantPoolVisitor.java | 192 ------- .../InvalidConstantPoolFormatException.java | 45 -- .../ConstantPoolPatch/OptimalMapSize.java | 41 -- 6 files changed, 1383 deletions(-) delete mode 100644 jdk/src/java.base/share/classes/sun/invoke/anon/AnonymousClassLoader.java delete mode 100644 jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolParser.java delete mode 100644 jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolPatch.java delete mode 100644 jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolVisitor.java delete mode 100644 jdk/src/java.base/share/classes/sun/invoke/anon/InvalidConstantPoolFormatException.java delete mode 100644 jdk/test/sun/invoke/anon/ConstantPoolPatch/OptimalMapSize.java diff --git a/jdk/src/java.base/share/classes/sun/invoke/anon/AnonymousClassLoader.java b/jdk/src/java.base/share/classes/sun/invoke/anon/AnonymousClassLoader.java deleted file mode 100644 index 6c5cb3f5563..00000000000 --- a/jdk/src/java.base/share/classes/sun/invoke/anon/AnonymousClassLoader.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.invoke.anon; - -import java.io.EOFException; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -/** - * Anonymous class loader. Will load any valid classfile, producing - * a {@link Class} metaobject, without installing that class in the - * system dictionary. Therefore, {@link Class#forName(String)} will never - * produce a reference to an anonymous class. - *

    - * The access permissions of the anonymous class are borrowed from - * a host class. The new class behaves as if it were an - * inner class of the host class. It can access the host's private - * members, if the creator of the class loader has permission to - * do so (or to create accessible reflective objects). - *

    - * When the anonymous class is loaded, elements of its constant pool - * can be patched to new values. This provides a hook to pre-resolve - * named classes in the constant pool to other classes, including - * anonymous ones. Also, string constants can be pre-resolved to - * any reference. (The verifier treats non-string, non-class reference - * constants as plain objects.) - *

    - * Why include the patching function? It makes some use cases much easier. - * Second, the constant pool needed some internal patching anyway, - * to anonymize the loaded class itself. Finally, if you are going - * to use this seriously, you'll want to build anonymous classes - * on top of pre-existing anonymous classes, and that requires patching. - * - *

    %%% TO-DO: - *

      - *
    • needs better documentation
    • - *
    • needs more security work (for safe delegation)
    • - *
    • needs a clearer story about error processing
    • - *
    • patch member references also (use ';' as delimiter char)
    • - *
    • patch method references to (conforming) method handles
    • - *
    - * - * @author jrose - * @author Remi Forax - * @see - * http://blogs.sun.com/jrose/entry/anonymous_classes_in_the_vm - */ - -public class AnonymousClassLoader { - final Class hostClass; - - // Privileged constructor. - private AnonymousClassLoader(Class hostClass) { - this.hostClass = hostClass; - } - - public static AnonymousClassLoader make(jdk.internal.misc.Unsafe unsafe, Class hostClass) { - if (unsafe == null) throw new NullPointerException(); - return new AnonymousClassLoader(hostClass); - } - - public Class loadClass(byte[] classFile) { - if (defineAnonymousClass == null) { - // no JVM support; try to fake an approximation - try { - return fakeLoadClass(new ConstantPoolParser(classFile).createPatch()); - } catch (InvalidConstantPoolFormatException ee) { - throw new IllegalArgumentException(ee); - } - } - return loadClass(classFile, null); - } - - public Class loadClass(ConstantPoolPatch classPatch) { - if (defineAnonymousClass == null) { - // no JVM support; try to fake an approximation - return fakeLoadClass(classPatch); - } - Object[] patches = classPatch.patchArray; - // Convert class names (this late in the game) - // to use slash '/' instead of dot '.'. - // Java likes dots, but the JVM likes slashes. - for (int i = 0; i < patches.length; i++) { - Object value = patches[i]; - if (value != null) { - byte tag = classPatch.getTag(i); - switch (tag) { - case ConstantPoolVisitor.CONSTANT_Class: - if (value instanceof String) { - if (patches == classPatch.patchArray) - patches = patches.clone(); - patches[i] = ((String)value).replace('.', '/'); - } - break; - case ConstantPoolVisitor.CONSTANT_Fieldref: - case ConstantPoolVisitor.CONSTANT_Methodref: - case ConstantPoolVisitor.CONSTANT_InterfaceMethodref: - case ConstantPoolVisitor.CONSTANT_NameAndType: - // When/if the JVM supports these patches, - // we'll probably need to reformat them also. - // Meanwhile, let the class loader create the error. - break; - } - } - } - return loadClass(classPatch.outer.classFile, classPatch.patchArray); - } - - private Class loadClass(byte[] classFile, Object[] patchArray) { - try { - return (Class) - defineAnonymousClass.invoke(unsafe, - hostClass, classFile, patchArray); - } catch (Exception ex) { - throwReflectedException(ex); - throw new RuntimeException("error loading into "+hostClass, ex); - } - } - - private static void throwReflectedException(Exception ex) { - if (ex instanceof InvocationTargetException) { - Throwable tex = ((InvocationTargetException)ex).getTargetException(); - if (tex instanceof Error) - throw (Error) tex; - ex = (Exception) tex; - } - if (ex instanceof RuntimeException) { - throw (RuntimeException) ex; - } - } - - private Class fakeLoadClass(ConstantPoolPatch classPatch) { - // Implementation: - // 1. Make up a new name nobody has used yet. - // 2. Inspect the tail-header of the class to find the this_class index. - // 3. Patch the CONSTANT_Class for this_class to the new name. - // 4. Add other CP entries required by (e.g.) string patches. - // 5. Flatten Class constants down to their names, making sure that - // the host class loader can pick them up again accurately. - // 6. Generate the edited class file bytes. - // - // Potential limitations: - // * The class won't be truly anonymous, and may interfere with others. - // * Flattened class constants might not work, because of loader issues. - // * Pseudo-string constants will not flatten down to real strings. - // * Method handles will (of course) fail to flatten to linkage strings. - if (true) throw new UnsupportedOperationException("NYI"); - Object[] cpArray; - try { - cpArray = classPatch.getOriginalCP(); - } catch (InvalidConstantPoolFormatException ex) { - throw new RuntimeException(ex); - } - int thisClassIndex = classPatch.getParser().getThisClassIndex(); - String thisClassName = (String) cpArray[thisClassIndex]; - synchronized (AnonymousClassLoader.class) { - thisClassName = thisClassName+"\\|"+(++fakeNameCounter); - } - classPatch.putUTF8(thisClassIndex, thisClassName); - byte[] classFile = null; - return unsafe.defineClass(null, classFile, 0, classFile.length, - hostClass.getClassLoader(), - hostClass.getProtectionDomain()); - } - private static int fakeNameCounter = 99999; - - // ignore two warnings on this line: - private static jdk.internal.misc.Unsafe unsafe = jdk.internal.misc.Unsafe.getUnsafe(); - // preceding line requires that this class be on the boot class path - - private static final Method defineAnonymousClass; - static { - Method dac = null; - Class unsafeClass = unsafe.getClass(); - try { - dac = unsafeClass.getMethod("defineAnonymousClass", - Class.class, - byte[].class, - Object[].class); - } catch (Exception ee) { - dac = null; - } - defineAnonymousClass = dac; - } - - private static void noJVMSupport() { - throw new UnsupportedOperationException("no JVM support for anonymous classes"); - } - - - private static native Class loadClassInternal(Class hostClass, - byte[] classFile, - Object[] patchArray); - - public static byte[] readClassFile(Class templateClass) throws IOException { - String templateName = templateClass.getName(); - int lastDot = templateName.lastIndexOf('.'); - java.net.URL url = templateClass.getResource(templateName.substring(lastDot+1)+".class"); - java.net.URLConnection connection = url.openConnection(); - int contentLength = connection.getContentLength(); - if (contentLength < 0) - throw new IOException("invalid content length "+contentLength); - - byte[] b = connection.getInputStream().readAllBytes(); - if (b.length != contentLength) - throw new EOFException("Expected:" + contentLength + ", read:" + b.length); - - return b; - } -} diff --git a/jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolParser.java b/jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolParser.java deleted file mode 100644 index 441ba957336..00000000000 --- a/jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolParser.java +++ /dev/null @@ -1,368 +0,0 @@ -/* - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.invoke.anon; - -import java.io.IOException; -import java.io.OutputStream; -import java.nio.BufferUnderflowException; -import java.nio.ByteBuffer; - -import static sun.invoke.anon.ConstantPoolVisitor.*; - -/** A constant pool parser. - */ -public class ConstantPoolParser { - final byte[] classFile; - final byte[] tags; - final char[] firstHeader; // maghi, maglo, minor, major, cplen - - // these are filled in on first parse: - int endOffset; - char[] secondHeader; // flags, this_class, super_class, intlen - - // used to decode UTF8 array - private char[] charArray = new char[80]; - - /** Creates a constant pool parser. - * @param classFile an array of bytes containing a class. - * @throws InvalidConstantPoolFormatException if the header of the class has errors. - */ - public ConstantPoolParser(byte[] classFile) throws InvalidConstantPoolFormatException { - this.classFile = classFile; - this.firstHeader = parseHeader(classFile); - this.tags = new byte[firstHeader[4]]; - } - - /** Create a constant pool parser by loading the bytecodes of the - * class taken as argument. - * - * @param templateClass the class to parse. - * - * @throws IOException raised if an I/O occurs when loading - * the bytecode of the template class. - * @throws InvalidConstantPoolFormatException if the header of the class has errors. - * - * @see #ConstantPoolParser(byte[]) - * @see AnonymousClassLoader#readClassFile(Class) - */ - public ConstantPoolParser(Class templateClass) throws IOException, InvalidConstantPoolFormatException { - this(AnonymousClassLoader.readClassFile(templateClass)); - } - - /** Creates an empty patch to patch the class file - * used by the current parser. - * @return a new class patch. - */ - public ConstantPoolPatch createPatch() { - return new ConstantPoolPatch(this); - } - - /** Report the tag of the indicated CP entry. - * @param index - * @return one of {@link ConstantPoolVisitor#CONSTANT_Utf8}, etc. - */ - public byte getTag(int index) { - getEndOffset(); // trigger an exception if we haven't parsed yet - return tags[index]; - } - - /** Report the length of the constant pool. */ - public int getLength() { - return firstHeader[4]; - } - - /** Report the offset, within the class file, of the start of the constant pool. */ - public int getStartOffset() { - return firstHeader.length * 2; - } - - /** Report the offset, within the class file, of the end of the constant pool. */ - public int getEndOffset() { - if (endOffset == 0) - throw new IllegalStateException("class file has not yet been parsed"); - return endOffset; - } - - /** Report the CP index of this class's own name. */ - public int getThisClassIndex() { - getEndOffset(); // provoke exception if not yet parsed - return secondHeader[1]; - } - - /** Report the total size of the class file. */ - public int getTailLength() { - return classFile.length - getEndOffset(); - } - - /** Write the head (header plus constant pool) - * of the class file to the indicated stream. - */ - public void writeHead(OutputStream out) throws IOException { - out.write(classFile, 0, getEndOffset()); - } - - /** Write the head (header plus constant pool) - * of the class file to the indicated stream, - * incorporating the non-null entries of the given array - * as patches. - */ - void writePatchedHead(OutputStream out, Object[] patchArray) { - // this will be useful to partially emulate the class loader on old JVMs - throw new UnsupportedOperationException("Not yet implemented"); - } - - /** Write the tail (everything after the constant pool) - * of the class file to the indicated stream. - */ - public void writeTail(OutputStream out) throws IOException { - out.write(classFile, getEndOffset(), getTailLength()); - } - - private static char[] parseHeader(byte[] classFile) throws InvalidConstantPoolFormatException { - char[] result = new char[5]; - ByteBuffer buffer = ByteBuffer.wrap(classFile); - for (int i = 0; i < result.length; i++) - result[i] = (char) getUnsignedShort(buffer); - int magic = result[0] << 16 | result[1] << 0; - if (magic != 0xCAFEBABE) - throw new InvalidConstantPoolFormatException("invalid magic number "+magic); - // skip major, minor version - int len = result[4]; - if (len < 1) - throw new InvalidConstantPoolFormatException("constant pool length < 1"); - return result; - } - - /** Parse the constant pool of the class - * calling a method visit* each time a constant pool entry is parsed. - * - * The order of the calls to visit* is not guaranteed to be the same - * than the order of the constant pool entry in the bytecode array. - * - * @param visitor - * @throws InvalidConstantPoolFormatException - */ - public void parse(ConstantPoolVisitor visitor) throws InvalidConstantPoolFormatException { - ByteBuffer buffer = ByteBuffer.wrap(classFile); - buffer.position(getStartOffset()); //skip header - - Object[] values = new Object[getLength()]; - try { - parseConstantPool(buffer, values, visitor); - } catch(BufferUnderflowException e) { - throw new InvalidConstantPoolFormatException(e); - } - if (endOffset == 0) { - endOffset = buffer.position(); - secondHeader = new char[4]; - for (int i = 0; i < secondHeader.length; i++) { - secondHeader[i] = (char) getUnsignedShort(buffer); - } - } - resolveConstantPool(values, visitor); - } - - private char[] getCharArray(int utfLength) { - if (utfLength <= charArray.length) - return charArray; - return charArray = new char[utfLength]; - } - - private void parseConstantPool(ByteBuffer buffer, Object[] values, ConstantPoolVisitor visitor) throws InvalidConstantPoolFormatException { - for (int i = 1; i < tags.length; ) { - byte tag = (byte) getUnsignedByte(buffer); - assert(tags[i] == 0 || tags[i] == tag); - tags[i] = tag; - switch (tag) { - case CONSTANT_Utf8: - int utfLen = getUnsignedShort(buffer); - String value = getUTF8(buffer, utfLen, getCharArray(utfLen)); - visitor.visitUTF8(i, CONSTANT_Utf8, value); - tags[i] = tag; - values[i++] = value; - break; - case CONSTANT_Integer: - visitor.visitConstantValue(i, tag, buffer.getInt()); - i++; - break; - case CONSTANT_Float: - visitor.visitConstantValue(i, tag, buffer.getFloat()); - i++; - break; - case CONSTANT_Long: - visitor.visitConstantValue(i, tag, buffer.getLong()); - i+=2; - break; - case CONSTANT_Double: - visitor.visitConstantValue(i, tag, buffer.getDouble()); - i+=2; - break; - - case CONSTANT_Class: // fall through: - case CONSTANT_String: - tags[i] = tag; - values[i++] = new int[] { getUnsignedShort(buffer) }; - break; - - case CONSTANT_Fieldref: // fall through: - case CONSTANT_Methodref: // fall through: - case CONSTANT_InterfaceMethodref: // fall through: - case CONSTANT_NameAndType: - tags[i] = tag; - values[i++] = new int[] { getUnsignedShort(buffer), getUnsignedShort(buffer) }; - break; - default: - throw new AssertionError("invalid constant "+tag); - } - } - } - - private void resolveConstantPool(Object[] values, ConstantPoolVisitor visitor) { - // clean out the int[] values, which are temporary - for (int beg = 1, end = values.length-1, beg2, end2; - beg <= end; - beg = beg2, end = end2) { - beg2 = end; end2 = beg-1; - //System.out.println("CP resolve pass: "+beg+".."+end); - for (int i = beg; i <= end; i++) { - Object value = values[i]; - if (!(value instanceof int[])) - continue; - int[] array = (int[]) value; - byte tag = tags[i]; - switch (tag) { - case CONSTANT_String: - String stringBody = (String) values[array[0]]; - visitor.visitConstantString(i, tag, stringBody, array[0]); - values[i] = null; - break; - case CONSTANT_Class: { - String className = (String) values[array[0]]; - // use the external form favored by Class.forName: - className = className.replace('/', '.'); - visitor.visitConstantString(i, tag, className, array[0]); - values[i] = className; - break; - } - case CONSTANT_NameAndType: { - String memberName = (String) values[array[0]]; - String signature = (String) values[array[1]]; - visitor.visitDescriptor(i, tag, memberName, signature, - array[0], array[1]); - values[i] = new String[] {memberName, signature}; - break; - } - case CONSTANT_Fieldref: // fall through: - case CONSTANT_Methodref: // fall through: - case CONSTANT_InterfaceMethodref: { - Object className = values[array[0]]; - Object nameAndType = values[array[1]]; - if (!(className instanceof String) || - !(nameAndType instanceof String[])) { - // one more pass is needed - if (beg2 > i) beg2 = i; - if (end2 < i) end2 = i; - continue; - } - String[] nameAndTypeArray = (String[]) nameAndType; - visitor.visitMemberRef(i, tag, - (String)className, - nameAndTypeArray[0], - nameAndTypeArray[1], - array[0], array[1]); - values[i] = null; - } - break; - default: - continue; - } - } - } - } - - private static int getUnsignedByte(ByteBuffer buffer) { - return buffer.get() & 0xFF; - } - - private static int getUnsignedShort(ByteBuffer buffer) { - int b1 = getUnsignedByte(buffer); - int b2 = getUnsignedByte(buffer); - return (b1 << 8) + (b2 << 0); - } - - private static String getUTF8(ByteBuffer buffer, int utfLen, char[] charArray) throws InvalidConstantPoolFormatException { - int utfLimit = buffer.position() + utfLen; - int index = 0; - while (buffer.position() < utfLimit) { - int c = buffer.get() & 0xff; - if (c > 127) { - buffer.position(buffer.position() - 1); - return getUTF8Extended(buffer, utfLimit, charArray, index); - } - charArray[index++] = (char)c; - } - return new String(charArray, 0, index); - } - - private static String getUTF8Extended(ByteBuffer buffer, int utfLimit, char[] charArray, int index) throws InvalidConstantPoolFormatException { - int c, c2, c3; - while (buffer.position() < utfLimit) { - c = buffer.get() & 0xff; - switch (c >> 4) { - case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: - /* 0xxxxxxx*/ - charArray[index++] = (char)c; - break; - case 12: case 13: - /* 110x xxxx 10xx xxxx*/ - c2 = buffer.get(); - if ((c2 & 0xC0) != 0x80) - throw new InvalidConstantPoolFormatException( - "malformed input around byte " + buffer.position()); - charArray[index++] = (char)(((c & 0x1F) << 6) | - (c2 & 0x3F)); - break; - case 14: - /* 1110 xxxx 10xx xxxx 10xx xxxx */ - c2 = buffer.get(); - c3 = buffer.get(); - if (((c2 & 0xC0) != 0x80) || ((c3 & 0xC0) != 0x80)) - throw new InvalidConstantPoolFormatException( - "malformed input around byte " + (buffer.position())); - charArray[index++] = (char)(((c & 0x0F) << 12) | - ((c2 & 0x3F) << 6) | - ((c3 & 0x3F) << 0)); - break; - default: - /* 10xx xxxx, 1111 xxxx */ - throw new InvalidConstantPoolFormatException( - "malformed input around byte " + buffer.position()); - } - } - // The number of chars produced may be less than utflen - return new String(charArray, 0, index); - } -} diff --git a/jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolPatch.java b/jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolPatch.java deleted file mode 100644 index 416a918ba8d..00000000000 --- a/jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolPatch.java +++ /dev/null @@ -1,503 +0,0 @@ -/* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.invoke.anon; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.Arrays; -import java.util.HashSet; -import java.util.IdentityHashMap; -import java.util.Map; - -import static sun.invoke.anon.ConstantPoolVisitor.*; - -/** A class and its patched constant pool. - * - * This class allow to modify (patch) a constant pool - * by changing the value of its entry. - * Entry are referenced using index that can be get - * by parsing the constant pool using - * {@link ConstantPoolParser#parse(ConstantPoolVisitor)}. - * - * @see ConstantPoolVisitor - * @see ConstantPoolParser#createPatch() - */ -public class ConstantPoolPatch { - final ConstantPoolParser outer; - final Object[] patchArray; - - ConstantPoolPatch(ConstantPoolParser outer) { - this.outer = outer; - this.patchArray = new Object[outer.getLength()]; - } - - /** Create a {@link ConstantPoolParser} and - * a {@link ConstantPoolPatch} in one step. - * Equivalent to {@code new ConstantPoolParser(classFile).createPatch()}. - * - * @param classFile an array of bytes containing a class. - * @see #ConstantPoolParser(Class) - */ - public ConstantPoolPatch(byte[] classFile) throws InvalidConstantPoolFormatException { - this(new ConstantPoolParser(classFile)); - } - - /** Create a {@link ConstantPoolParser} and - * a {@link ConstantPoolPatch} in one step. - * Equivalent to {@code new ConstantPoolParser(templateClass).createPatch()}. - * - * @param templateClass the class to parse. - * @see #ConstantPoolParser(Class) - */ - public ConstantPoolPatch(Class templateClass) throws IOException, InvalidConstantPoolFormatException { - this(new ConstantPoolParser(templateClass)); - } - - - /** Creates a patch from an existing patch. - * All changes are copied from that patch. - * @param patch a patch - * - * @see ConstantPoolParser#createPatch() - */ - public ConstantPoolPatch(ConstantPoolPatch patch) { - outer = patch.outer; - patchArray = patch.patchArray.clone(); - } - - /** Which parser built this patch? */ - public ConstantPoolParser getParser() { - return outer; - } - - /** Report the tag at the given index in the constant pool. */ - public byte getTag(int index) { - return outer.getTag(index); - } - - /** Report the current patch at the given index of the constant pool. - * Null means no patch will be made. - * To observe the unpatched entry at the given index, use - * {@link #getParser()}{@code .}@link ConstantPoolParser#parse(ConstantPoolVisitor)} - */ - public Object getPatch(int index) { - Object value = patchArray[index]; - if (value == null) return null; - switch (getTag(index)) { - case CONSTANT_Fieldref: - case CONSTANT_Methodref: - case CONSTANT_InterfaceMethodref: - if (value instanceof String) - value = stripSemis(2, (String) value); - break; - case CONSTANT_NameAndType: - if (value instanceof String) - value = stripSemis(1, (String) value); - break; - } - return value; - } - - /** Clear all patches. */ - public void clear() { - Arrays.fill(patchArray, null); - } - - /** Clear one patch. */ - public void clear(int index) { - patchArray[index] = null; - } - - /** Produce the patches as an array. */ - public Object[] getPatches() { - return patchArray.clone(); - } - - /** Produce the original constant pool as an array. */ - public Object[] getOriginalCP() throws InvalidConstantPoolFormatException { - return getOriginalCP(0, patchArray.length, -1); - } - - /** Walk the constant pool, applying patches using the given map. - * - * @param utf8Map Utf8 strings to modify, if encountered - * @param classMap Classes (or their names) to modify, if encountered - * @param valueMap Constant values to modify, if encountered - * @param deleteUsedEntries if true, delete map entries that are used - */ - public void putPatches(final Map utf8Map, - final Map classMap, - final Map valueMap, - boolean deleteUsedEntries) throws InvalidConstantPoolFormatException { - final HashSet usedUtf8Keys; - final HashSet usedClassKeys; - final HashSet usedValueKeys; - if (deleteUsedEntries) { - usedUtf8Keys = (utf8Map == null) ? null : new HashSet(); - usedClassKeys = (classMap == null) ? null : new HashSet(); - usedValueKeys = (valueMap == null) ? null : new HashSet(); - } else { - usedUtf8Keys = null; - usedClassKeys = null; - usedValueKeys = null; - } - - outer.parse(new ConstantPoolVisitor() { - - @Override - public void visitUTF8(int index, byte tag, String utf8) { - putUTF8(index, utf8Map.get(utf8)); - if (usedUtf8Keys != null) usedUtf8Keys.add(utf8); - } - - @Override - public void visitConstantValue(int index, byte tag, Object value) { - putConstantValue(index, tag, valueMap.get(value)); - if (usedValueKeys != null) usedValueKeys.add(value); - } - - @Override - public void visitConstantString(int index, byte tag, String name, int nameIndex) { - if (tag == CONSTANT_Class) { - putConstantValue(index, tag, classMap.get(name)); - if (usedClassKeys != null) usedClassKeys.add(name); - } else { - assert(tag == CONSTANT_String); - visitConstantValue(index, tag, name); - } - } - }); - if (usedUtf8Keys != null) utf8Map.keySet().removeAll(usedUtf8Keys); - if (usedClassKeys != null) classMap.keySet().removeAll(usedClassKeys); - if (usedValueKeys != null) valueMap.keySet().removeAll(usedValueKeys); - } - - Object[] getOriginalCP(final int startIndex, - final int endIndex, - final int tagMask) throws InvalidConstantPoolFormatException { - final Object[] cpArray = new Object[endIndex - startIndex]; - outer.parse(new ConstantPoolVisitor() { - - void show(int index, byte tag, Object value) { - if (index < startIndex || index >= endIndex) return; - if (((1 << tag) & tagMask) == 0) return; - cpArray[index - startIndex] = value; - } - - @Override - public void visitUTF8(int index, byte tag, String utf8) { - show(index, tag, utf8); - } - - @Override - public void visitConstantValue(int index, byte tag, Object value) { - assert(tag != CONSTANT_String); - show(index, tag, value); - } - - @Override - public void visitConstantString(int index, byte tag, - String value, int j) { - show(index, tag, value); - } - - @Override - public void visitMemberRef(int index, byte tag, - String className, String memberName, - String signature, - int j, int k) { - show(index, tag, new String[]{ className, memberName, signature }); - } - - @Override - public void visitDescriptor(int index, byte tag, - String memberName, String signature, - int j, int k) { - show(index, tag, new String[]{ memberName, signature }); - } - }); - return cpArray; - } - - /** Write the head (header plus constant pool) - * of the patched class file to the indicated stream. - */ - void writeHead(OutputStream out) throws IOException { - outer.writePatchedHead(out, patchArray); - } - - /** Write the tail (everything after the constant pool) - * of the patched class file to the indicated stream. - */ - void writeTail(OutputStream out) throws IOException { - outer.writeTail(out); - } - - private void checkConstantTag(byte tag, Object value) { - if (value == null) - throw new IllegalArgumentException( - "invalid null constant value"); - if (classForTag(tag) != value.getClass()) - throw new IllegalArgumentException( - "invalid constant value" - + (tag == CONSTANT_None ? "" - : " for tag "+tagName(tag)) - + " of class "+value.getClass()); - } - - private void checkTag(int index, byte putTag) { - byte tag = outer.tags[index]; - if (tag != putTag) - throw new IllegalArgumentException( - "invalid put operation" - + " for " + tagName(putTag) - + " at index " + index + " found " + tagName(tag)); - } - - private void checkTagMask(int index, int tagBitMask) { - byte tag = outer.tags[index]; - int tagBit = ((tag & 0x1F) == tag) ? (1 << tag) : 0; - if ((tagBit & tagBitMask) == 0) - throw new IllegalArgumentException( - "invalid put operation" - + " at index " + index + " found " + tagName(tag)); - } - - private static void checkMemberName(String memberName) { - if (memberName.indexOf(';') >= 0) - throw new IllegalArgumentException("memberName " + memberName + " contains a ';'"); - } - - /** Set the entry of the constant pool indexed by index to - * a new string. - * - * @param index an index to a constant pool entry containing a - * {@link ConstantPoolVisitor#CONSTANT_Utf8} value. - * @param utf8 a string - * - * @see ConstantPoolVisitor#visitUTF8(int, byte, String) - */ - public void putUTF8(int index, String utf8) { - if (utf8 == null) { clear(index); return; } - checkTag(index, CONSTANT_Utf8); - patchArray[index] = utf8; - } - - /** Set the entry of the constant pool indexed by index to - * a new value, depending on its dynamic type. - * - * @param index an index to a constant pool entry containing a - * one of the following structures: - * {@link ConstantPoolVisitor#CONSTANT_Integer}, - * {@link ConstantPoolVisitor#CONSTANT_Float}, - * {@link ConstantPoolVisitor#CONSTANT_Long}, - * {@link ConstantPoolVisitor#CONSTANT_Double}, - * {@link ConstantPoolVisitor#CONSTANT_String}, or - * {@link ConstantPoolVisitor#CONSTANT_Class} - * @param value a boxed int, float, long or double; or a string or class object - * @throws IllegalArgumentException if the type of the constant does not - * match the constant pool entry type, - * as reported by {@link #getTag(int)} - * - * @see #putConstantValue(int, byte, Object) - * @see ConstantPoolVisitor#visitConstantValue(int, byte, Object) - * @see ConstantPoolVisitor#visitConstantString(int, byte, String, int) - */ - public void putConstantValue(int index, Object value) { - if (value == null) { clear(index); return; } - byte tag = tagForConstant(value.getClass()); - checkConstantTag(tag, value); - checkTag(index, tag); - patchArray[index] = value; - } - - /** Set the entry of the constant pool indexed by index to - * a new value. - * - * @param index an index to a constant pool entry matching the given tag - * @param tag one of the following values: - * {@link ConstantPoolVisitor#CONSTANT_Integer}, - * {@link ConstantPoolVisitor#CONSTANT_Float}, - * {@link ConstantPoolVisitor#CONSTANT_Long}, - * {@link ConstantPoolVisitor#CONSTANT_Double}, - * {@link ConstantPoolVisitor#CONSTANT_String}, or - * {@link ConstantPoolVisitor#CONSTANT_Class} - * @param value a boxed number, string, or class object - * @throws IllegalArgumentException if the type of the constant does not - * match the constant pool entry type, or if a class name contains - * '/' or ';' - * - * @see #putConstantValue(int, Object) - * @see ConstantPoolVisitor#visitConstantValue(int, byte, Object) - * @see ConstantPoolVisitor#visitConstantString(int, byte, String, int) - */ - public void putConstantValue(int index, byte tag, Object value) { - if (value == null) { clear(index); return; } - checkTag(index, tag); - if (tag == CONSTANT_Class && value instanceof String) { - checkClassName((String) value); - } else if (tag == CONSTANT_String) { - // the JVM accepts any object as a patch for a string - } else { - // make sure the incoming value is the right type - checkConstantTag(tag, value); - } - checkTag(index, tag); - patchArray[index] = value; - } - - /** Set the entry of the constant pool indexed by index to - * a new {@link ConstantPoolVisitor#CONSTANT_NameAndType} value. - * - * @param index an index to a constant pool entry containing a - * {@link ConstantPoolVisitor#CONSTANT_NameAndType} value. - * @param memberName a memberName - * @param signature a signature - * @throws IllegalArgumentException if memberName contains the character ';' - * - * @see ConstantPoolVisitor#visitDescriptor(int, byte, String, String, int, int) - */ - public void putDescriptor(int index, String memberName, String signature) { - checkTag(index, CONSTANT_NameAndType); - checkMemberName(memberName); - patchArray[index] = addSemis(memberName, signature); - } - - /** Set the entry of the constant pool indexed by index to - * a new {@link ConstantPoolVisitor#CONSTANT_Fieldref}, - * {@link ConstantPoolVisitor#CONSTANT_Methodref}, or - * {@link ConstantPoolVisitor#CONSTANT_InterfaceMethodref} value. - * - * @param index an index to a constant pool entry containing a member reference - * @param className a class name - * @param memberName a field or method name - * @param signature a field or method signature - * @throws IllegalArgumentException if memberName contains the character ';' - * or signature is not a correct signature - * - * @see ConstantPoolVisitor#visitMemberRef(int, byte, String, String, String, int, int) - */ - public void putMemberRef(int index, byte tag, - String className, String memberName, String signature) { - checkTagMask(tag, CONSTANT_MemberRef_MASK); - checkTag(index, tag); - checkClassName(className); - checkMemberName(memberName); - if (signature.startsWith("(") == (tag == CONSTANT_Fieldref)) - throw new IllegalArgumentException("bad signature: "+signature); - patchArray[index] = addSemis(className, memberName, signature); - } - - private static final int CONSTANT_MemberRef_MASK = - CONSTANT_Fieldref - | CONSTANT_Methodref - | CONSTANT_InterfaceMethodref; - - private static final Map, Byte> CONSTANT_VALUE_CLASS_TAG - = new IdentityHashMap, Byte>(6); - private static final Class[] CONSTANT_VALUE_CLASS = new Class[16]; - static { - Object[][] values = { - {Integer.class, CONSTANT_Integer}, - {Long.class, CONSTANT_Long}, - {Float.class, CONSTANT_Float}, - {Double.class, CONSTANT_Double}, - {String.class, CONSTANT_String}, - {Class.class, CONSTANT_Class} - }; - for (Object[] value : values) { - Class cls = (Class)value[0]; - Byte tag = (Byte) value[1]; - CONSTANT_VALUE_CLASS_TAG.put(cls, tag); - CONSTANT_VALUE_CLASS[(byte)tag] = cls; - } - } - - static Class classForTag(byte tag) { - if ((tag & 0xFF) >= CONSTANT_VALUE_CLASS.length) - return null; - return CONSTANT_VALUE_CLASS[tag]; - } - - static byte tagForConstant(Class cls) { - Byte tag = CONSTANT_VALUE_CLASS_TAG.get(cls); - return (tag == null) ? CONSTANT_None : (byte)tag; - } - - private static void checkClassName(String className) { - if (className.indexOf('/') >= 0 || className.indexOf(';') >= 0) - throw new IllegalArgumentException("invalid class name " + className); - } - - static String addSemis(String name, String... names) { - StringBuilder buf = new StringBuilder(name.length() * 5); - buf.append(name); - for (String name2 : names) { - buf.append(';').append(name2); - } - String res = buf.toString(); - assert(stripSemis(names.length, res)[0].equals(name)); - assert(stripSemis(names.length, res)[1].equals(names[0])); - assert(names.length == 1 || - stripSemis(names.length, res)[2].equals(names[1])); - return res; - } - - static String[] stripSemis(int count, String string) { - String[] res = new String[count+1]; - int pos = 0; - for (int i = 0; i < count; i++) { - int pos2 = string.indexOf(';', pos); - if (pos2 < 0) pos2 = string.length(); // yuck - res[i] = string.substring(pos, pos2); - pos = pos2; - } - res[count] = string.substring(pos); - return res; - } - - public String toString() { - StringBuilder buf = new StringBuilder(this.getClass().getName()); - buf.append("{"); - Object[] origCP = null; - for (int i = 0; i < patchArray.length; i++) { - if (patchArray[i] == null) continue; - if (origCP != null) { - buf.append(", "); - } else { - try { - origCP = getOriginalCP(); - } catch (InvalidConstantPoolFormatException ee) { - origCP = new Object[0]; - } - } - Object orig = (i < origCP.length) ? origCP[i] : "?"; - buf.append(orig).append("=").append(patchArray[i]); - } - buf.append("}"); - return buf.toString(); - } -} diff --git a/jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolVisitor.java b/jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolVisitor.java deleted file mode 100644 index dfec8b41151..00000000000 --- a/jdk/src/java.base/share/classes/sun/invoke/anon/ConstantPoolVisitor.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.invoke.anon; - -/** - * A visitor called by {@link ConstantPoolParser#parse(ConstantPoolVisitor)} - * when a constant pool entry is parsed. - *

    - * A visit* method is called when a constant pool entry is parsed. - * The first argument is always the constant pool index. - * The second argument is always the constant pool tag, - * even for methods like {@link #visitUTF8(int, byte, String)} which only apply to one tag. - * String arguments refer to Utf8 or NameAndType entries declared elsewhere, - * and are always accompanied by the indexes of those entries. - *

    - * The order of the calls to the visit* methods is not necessarily related - * to the order of the entries in the constant pool. - * If one entry has a reference to another entry, the latter (lower-level) - * entry will be visited first. - *

    - * The following table shows the relation between constant pool entry - * types and the corresponding visit* methods: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    Tag(s)Method
    {@link #CONSTANT_Utf8}{@link #visitUTF8(int, byte, String)}
    {@link #CONSTANT_Integer}, {@link #CONSTANT_Float}, - * {@link #CONSTANT_Long}, {@link #CONSTANT_Double}{@link #visitConstantValue(int, byte, Object)}
    {@link #CONSTANT_String}, {@link #CONSTANT_Class}{@link #visitConstantString(int, byte, String, int)}
    {@link #CONSTANT_NameAndType}{@link #visitDescriptor(int, byte, String, String, int, int)}
    {@link #CONSTANT_Fieldref}, - * {@link #CONSTANT_Methodref}, - * {@link #CONSTANT_InterfaceMethodref}{@link #visitMemberRef(int, byte, String, String, String, int, int)}
    - * - * @see ConstantPoolPatch - * @author Remi Forax - * @author jrose - */ -public class ConstantPoolVisitor { - /** Called each time an UTF8 constant pool entry is found. - * @param index the constant pool index - * @param tag always {@link #CONSTANT_Utf8} - * @param utf8 string encoded in modified UTF-8 format passed as a {@code String} - * - * @see ConstantPoolPatch#putUTF8(int, String) - */ - public void visitUTF8(int index, byte tag, String utf8) { - // do nothing - } - - /** Called for each constant pool entry that encodes an integer, - * a float, a long, or a double. - * Constant strings and classes are not managed by this method but - * by {@link #visitConstantString(int, byte, String, int)}. - * - * @param index the constant pool index - * @param tag one of {@link #CONSTANT_Integer}, - * {@link #CONSTANT_Float}, - * {@link #CONSTANT_Long}, - * or {@link #CONSTANT_Double} - * @param value encoded value - * - * @see ConstantPoolPatch#putConstantValue(int, Object) - */ - public void visitConstantValue(int index, byte tag, Object value) { - // do nothing - } - - /** Called for each constant pool entry that encodes a string or a class. - * @param index the constant pool index - * @param tag one of {@link #CONSTANT_String}, - * {@link #CONSTANT_Class}, - * @param name string body or class name (using dot separator) - * @param nameIndex the index of the Utf8 string for the name - * - * @see ConstantPoolPatch#putConstantValue(int, byte, Object) - */ - public void visitConstantString(int index, byte tag, - String name, int nameIndex) { - // do nothing - } - - /** Called for each constant pool entry that encodes a name and type. - * @param index the constant pool index - * @param tag always {@link #CONSTANT_NameAndType} - * @param memberName a field or method name - * @param signature the member signature - * @param memberNameIndex index of the Utf8 string for the member name - * @param signatureIndex index of the Utf8 string for the signature - * - * @see ConstantPoolPatch#putDescriptor(int, String, String) - */ - public void visitDescriptor(int index, byte tag, - String memberName, String signature, - int memberNameIndex, int signatureIndex) { - // do nothing - } - - /** Called for each constant pool entry that encodes a field or method. - * @param index the constant pool index - * @param tag one of {@link #CONSTANT_Fieldref}, - * or {@link #CONSTANT_Methodref}, - * or {@link #CONSTANT_InterfaceMethodref} - * @param className the class name (using dot separator) - * @param memberName name of the field or method - * @param signature the field or method signature - * @param classNameIndex index of the Utf8 string for the class name - * @param descriptorIndex index of the NameAndType descriptor constant - * - * @see ConstantPoolPatch#putMemberRef(int, byte, String, String, String) - */ - public void visitMemberRef(int index, byte tag, - String className, String memberName, String signature, - int classNameIndex, int descriptorIndex) { - // do nothing - } - - public static final byte - CONSTANT_None = 0, - CONSTANT_Utf8 = 1, - //CONSTANT_Unicode = 2, /* unused */ - CONSTANT_Integer = 3, - CONSTANT_Float = 4, - CONSTANT_Long = 5, - CONSTANT_Double = 6, - CONSTANT_Class = 7, - CONSTANT_String = 8, - CONSTANT_Fieldref = 9, - CONSTANT_Methodref = 10, - CONSTANT_InterfaceMethodref = 11, - CONSTANT_NameAndType = 12; - - private static String[] TAG_NAMES = { - "Empty", - "Utf8", - null, //"Unicode", - "Integer", - "Float", - "Long", - "Double", - "Class", - "String", - "Fieldref", - "Methodref", - "InterfaceMethodref", - "NameAndType" - }; - - public static String tagName(byte tag) { - String name = null; - if ((tag & 0xFF) < TAG_NAMES.length) - name = TAG_NAMES[tag]; - if (name == null) - name = "Unknown#"+(tag&0xFF); - return name; - } -} diff --git a/jdk/src/java.base/share/classes/sun/invoke/anon/InvalidConstantPoolFormatException.java b/jdk/src/java.base/share/classes/sun/invoke/anon/InvalidConstantPoolFormatException.java deleted file mode 100644 index d420d34b0d6..00000000000 --- a/jdk/src/java.base/share/classes/sun/invoke/anon/InvalidConstantPoolFormatException.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.invoke.anon; - -/** Exception used when there is an error in the constant pool - * format. - */ -public class InvalidConstantPoolFormatException extends Exception { - private static final long serialVersionUID=-6103888330523770949L; - - public InvalidConstantPoolFormatException(String message,Throwable cause) { - super(message,cause); - } - - public InvalidConstantPoolFormatException(String message) { - super(message); - } - - public InvalidConstantPoolFormatException(Throwable cause) { - super(cause); - } -} diff --git a/jdk/test/sun/invoke/anon/ConstantPoolPatch/OptimalMapSize.java b/jdk/test/sun/invoke/anon/ConstantPoolPatch/OptimalMapSize.java deleted file mode 100644 index d3895dd9255..00000000000 --- a/jdk/test/sun/invoke/anon/ConstantPoolPatch/OptimalMapSize.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 8080535 - * @summary Static storages should be initialized with optimal capacity - * @library /lib/testlibrary - * @build jdk.testlibrary.OptimalCapacity - * @run main OptimalMapSize - */ - -import jdk.testlibrary.OptimalCapacity; - -public class OptimalMapSize { - public static void main(String[] args) throws Throwable { - OptimalCapacity.ofIdentityHashMap( - Class.forName("sun.invoke.anon.ConstantPoolPatch"), - "CONSTANT_VALUE_CLASS_TAG", 6); - } -} From ac45dea45ef65d7b0d950242d2afdc82cab9c87f Mon Sep 17 00:00:00 2001 From: David Lindholm Date: Wed, 18 Nov 2015 14:51:10 +0100 Subject: [PATCH 034/228] 8145092: Use Unified Logging for the GC logging JEP-271 Reviewed-by: sjohanss, brutisso --- .../HotSpotDiagnosticMXBean/CheckOrigin.java | 4 ++-- .../HotSpotDiagnosticMXBean/GetVMOption.java | 6 ++--- .../HotSpotDiagnosticMXBean/SetVMOption.java | 20 ++++++++-------- .../MemoryMXBean/LowMemoryTest.java | 2 +- .../lang/management/MemoryMXBean/RunUtil.java | 2 +- .../RuntimeMXBean/TestInputArgument.sh | 4 ++-- .../DecimalFormat/FormatMicroBenchmark.java | 8 +++---- .../jdk/testlibrary/JDKToolLauncher.java | 3 +-- .../jinfo/JInfoRunningProcessFlagTest.java | 24 +++++++++---------- jdk/test/sun/tools/jps/JpsHelper.java | 2 +- 10 files changed, 37 insertions(+), 38 deletions(-) diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java index 6f3ac9feec5..9b8afea79e9 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java @@ -62,7 +62,7 @@ public class CheckOrigin { ProcessBuilder pb = ProcessTools. createJavaProcessBuilder( "-XX:+UseConcMarkSweepGC", // this will cause UseParNewGC to be FLAG_SET_ERGO - "-XX:+PrintGCDetails", + "-XX:+UseCodeAging", "-XX:+UseCerealGC", // Should be ignored. "-XX:Flags=" + flagsFile.getAbsolutePath(), "-cp", System.getProperty("test.class.path"), @@ -97,7 +97,7 @@ public class CheckOrigin { // Not set, so should be default checkOrigin("ManagementServer", Origin.DEFAULT); // Set on the command line - checkOrigin("PrintGCDetails", Origin.VM_CREATION); + checkOrigin("UseCodeAging", Origin.VM_CREATION); // Set in _JAVA_OPTIONS checkOrigin("TraceExceptions", Origin.ENVIRON_VAR); // Set in JAVA_TOOL_OPTIONS diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java index 16589749648..49edcc14415 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java @@ -28,7 +28,7 @@ * @author Mandy Chung * * @modules jdk.management - * @run main/othervm -XX:+PrintGCDetails GetVMOption + * @run main/othervm -XX:+HeapDumpOnOutOfMemoryError GetVMOption */ import com.sun.management.HotSpotDiagnosticMXBean; @@ -38,7 +38,7 @@ import java.util.List; import javax.management.MBeanServer; public class GetVMOption { - private static final String PRINT_GC_DETAILS = "PrintGCDetails"; + private static final String HEAP_DUMP_ON_OOM = "HeapDumpOnOutOfMemoryError"; private static final String EXPECTED_VALUE = "true"; private static final String BAD_OPTION = "BadOption"; private static final String HOTSPOT_DIAGNOSTIC_MXBEAN_NAME = @@ -58,7 +58,7 @@ public class GetVMOption { } private static void checkVMOption(HotSpotDiagnosticMXBean mbean) { - VMOption option = mbean.getVMOption(PRINT_GC_DETAILS); + VMOption option = mbean.getVMOption(HEAP_DUMP_ON_OOM); if (!option.getValue().equalsIgnoreCase(EXPECTED_VALUE)) { throw new RuntimeException("Unexpected value: " + option.getValue() + " expected: " + EXPECTED_VALUE); diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java index 1c7117d91d0..d11ec33fa7c 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java @@ -30,7 +30,7 @@ * @author Jaroslav Bachorik * * @modules jdk.management - * @run main/othervm -XX:+PrintGCDetails SetVMOption + * @run main/othervm -XX:+HeapDumpOnOutOfMemoryError SetVMOption */ import java.lang.management.ManagementFactory; @@ -40,7 +40,7 @@ import com.sun.management.VMOption; import com.sun.management.VMOption.Origin; public class SetVMOption { - private static final String PRINT_GC_DETAILS = "PrintGCDetails"; + private static final String HEAP_DUMP_ON_OOM = "HeapDumpOnOutOfMemoryError"; private static final String EXPECTED_VALUE = "true"; private static final String BAD_VALUE = "yes"; private static final String NEW_VALUE = "false"; @@ -51,7 +51,7 @@ public class SetVMOption { mbean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class); - VMOption option = findPrintGCDetailsOption(); + VMOption option = findHeapDumpOnOomOption(); if (!option.getValue().equalsIgnoreCase(EXPECTED_VALUE)) { throw new RuntimeException("Unexpected value: " + option.getValue() + " expected: " + EXPECTED_VALUE); @@ -61,14 +61,14 @@ public class SetVMOption { option.getOrigin() + " expected: VM_CREATION"); } if (!option.isWriteable()) { - throw new RuntimeException("Expected " + PRINT_GC_DETAILS + + throw new RuntimeException("Expected " + HEAP_DUMP_ON_OOM + " to be writeable"); } // set VM option to a new value - mbean.setVMOption(PRINT_GC_DETAILS, NEW_VALUE); + mbean.setVMOption(HEAP_DUMP_ON_OOM, NEW_VALUE); - option = findPrintGCDetailsOption(); + option = findHeapDumpOnOomOption(); if (!option.getValue().equalsIgnoreCase(NEW_VALUE)) { throw new RuntimeException("Unexpected value: " + option.getValue() + " expected: " + NEW_VALUE); @@ -77,7 +77,7 @@ public class SetVMOption { throw new RuntimeException("Unexpected origin: " + option.getOrigin() + " expected: MANAGEMENT"); } - VMOption o = mbean.getVMOption(PRINT_GC_DETAILS); + VMOption o = mbean.getVMOption(HEAP_DUMP_ON_OOM); if (!option.getValue().equals(o.getValue())) { throw new RuntimeException("Unmatched value: " + option.getValue() + " expected: " + o.getValue()); @@ -123,17 +123,17 @@ public class SetVMOption { } } - public static VMOption findPrintGCDetailsOption() { + public static VMOption findHeapDumpOnOomOption() { List options = mbean.getDiagnosticOptions(); VMOption gcDetails = null; for (VMOption o : options) { - if (o.getName().equals(PRINT_GC_DETAILS)) { + if (o.getName().equals(HEAP_DUMP_ON_OOM)) { gcDetails = o; break; } } if (gcDetails == null) { - throw new RuntimeException("VM option " + PRINT_GC_DETAILS + + throw new RuntimeException("VM option " + HEAP_DUMP_ON_OOM + " not found"); } return gcDetails; diff --git a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java index 5e8bda4cd86..8e3c2e55a3f 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java +++ b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java @@ -100,7 +100,7 @@ public class LowMemoryTest { opts.addAll(Arrays.asList(Utils.getTestJavaOpts())); opts.add("-cp"); opts.add(System.getProperty("test.class.path", "test.class.path")); - opts.add("-XX:+PrintGCDetails"); + opts.add("-Xlog:gc*=debug"); opts.addAll(Arrays.asList(testOpts)); opts.add(classMain); diff --git a/jdk/test/java/lang/management/MemoryMXBean/RunUtil.java b/jdk/test/java/lang/management/MemoryMXBean/RunUtil.java index 5f9d07c1a00..24761131484 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/RunUtil.java +++ b/jdk/test/java/lang/management/MemoryMXBean/RunUtil.java @@ -66,7 +66,7 @@ public class RunUtil { opts.addAll(Arrays.asList(Utils.getTestJavaOpts())); opts.add("-cp"); opts.add(System.getProperty("test.class.path", "test.class.path")); - opts.add("-XX:+PrintGCDetails"); + opts.add("-Xlog:gc*=debug"); if (clearGcOpts) { opts = Utils.removeGcOpts(opts); diff --git a/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh b/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh index f92fac42db0..d76b2bd2c34 100644 --- a/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh +++ b/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh @@ -48,8 +48,8 @@ runOne() runOne InputArgument -runOne -XX:+UseFastJNIAccessors -XX:+PrintGCDetails InputArgument -XX:+PrintGCDetails -runOne -XX:+UseFastJNIAccessors -XX:+PrintGCDetails InputArgument -XX:+UseFastJNIAccessors +runOne -XX:+UseFastJNIAccessors -Xlog:gc*=debug InputArgument +runOne -XX:+UseFastJNIAccessors -Xlog:gc*=debug InputArgument -XX:+UseFastJNIAccessors runOne "-Dprops=one two three" InputArgument "-Dprops=one two three" exit 0 diff --git a/jdk/test/java/text/Format/DecimalFormat/FormatMicroBenchmark.java b/jdk/test/java/text/Format/DecimalFormat/FormatMicroBenchmark.java index cd8648a70ce..372d3e0ce98 100644 --- a/jdk/test/java/text/Format/DecimalFormat/FormatMicroBenchmark.java +++ b/jdk/test/java/text/Format/DecimalFormat/FormatMicroBenchmark.java @@ -51,7 +51,7 @@ * getting reliable numbers. Otherwise GC activity may corrupt results. * As of jdk80b48 using "-Xms500m -Xmx500m -XX:NewSize=400m" covers * all cases. - * - Optionally using "-XX:+printGC" option provides information that + * - Optionally using "-Xlog:gc" option provides information that * helps checking any GC activity while benches are run. * * Vm Options: @@ -60,7 +60,7 @@ * non fast-path case: -Xms500m -Xmx500m -XX:NewSize=400m * or use worst case (non fast-path above) with both types of algorithm. * - * - use -XX:+PrintGC to verify memory consumption of the benchmarks. + * - use -Xlog:gc to verify memory consumption of the benchmarks. * (See "Checking Memory Consumption" below). * * Description: @@ -166,7 +166,7 @@ * but is not enough, since any unexpected incremental GC may lower * artificially the estimation of the memory consumption. * - * Options to set are -Xms, -Xmx, -XX:NewSize, plus -XX:+PrintGC to evaluate + * Options to set are -Xms, -Xmx, -XX:NewSize, plus -Xlog:gc to evaluate * correctly the values of these options. When running "-verbose", varying * numbers reported for memory consumption may indicate bad choices for these * options. @@ -217,7 +217,7 @@ public class FormatMicroBenchmark { " getting reliable numbers. Otherwise GC activity may corrupt results.\n" + " As of jdk80b48 using \"-Xms500m -Xmx500m -XX:NewSize=400m\" covers \n" + " all cases.\n" + - " - Optionally using \"-XX:+printGC\" option provides information that \n" + + " - Optionally using \"-Xlog:gc\" option provides information that \n" + " helps checking any GC activity while benches are run.\n\n" + "Look at the heading comments and description in source code for " + "detailed information.\n"); diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/JDKToolLauncher.java b/jdk/test/lib/testlibrary/jdk/testlibrary/JDKToolLauncher.java index 43f1ddb97d6..777e8cf5336 100644 --- a/jdk/test/lib/testlibrary/jdk/testlibrary/JDKToolLauncher.java +++ b/jdk/test/lib/testlibrary/jdk/testlibrary/JDKToolLauncher.java @@ -38,8 +38,7 @@ import java.util.List; *

      * {@code
      * JDKToolLauncher jmap = JDKToolLauncher.create("jmap")
    - *                                       .addVMArg("-XX:+PrintGC");
    - *                                       .addVMArg("-XX:+PrintGCDetails")
    + *                                       .addVMArg("-Xlog:gc*=debug")
      *                                       .addToolArg("-heap")
      *                                       .addToolArg(pid);
      * ProcessBuilder pb = new ProcessBuilder(jmap.getCommand());
    diff --git a/jdk/test/sun/tools/jinfo/JInfoRunningProcessFlagTest.java b/jdk/test/sun/tools/jinfo/JInfoRunningProcessFlagTest.java
    index 35dd7526e20..cb28cc7a49f 100644
    --- a/jdk/test/sun/tools/jinfo/JInfoRunningProcessFlagTest.java
    +++ b/jdk/test/sun/tools/jinfo/JInfoRunningProcessFlagTest.java
    @@ -60,30 +60,30 @@ public class JInfoRunningProcessFlagTest {
         }
     
         private static void testFlagPlus() throws Exception {
    -        OutputAnalyzer output = JInfoHelper.jinfo("-flag", "+PrintGC");
    +        OutputAnalyzer output = JInfoHelper.jinfo("-flag", "+HeapDumpOnOutOfMemoryError");
             output.shouldHaveExitValue(0);
    -        output = JInfoHelper.jinfo("-flag", "PrintGC");
    +        output = JInfoHelper.jinfo("-flag", "HeapDumpOnOutOfMemoryError");
             output.shouldHaveExitValue(0);
    -        output.shouldContain("+PrintGC");
    -        verifyIsEnabled("PrintGC");
    +        output.shouldContain("+HeapDumpOnOutOfMemoryError");
    +        verifyIsEnabled("HeapDumpOnOutOfMemoryError");
         }
     
         private static void testFlagMinus() throws Exception {
    -        OutputAnalyzer output = JInfoHelper.jinfo("-flag", "-PrintGC");
    +        OutputAnalyzer output = JInfoHelper.jinfo("-flag", "-HeapDumpOnOutOfMemoryError");
             output.shouldHaveExitValue(0);
    -        output = JInfoHelper.jinfo("-flag", "PrintGC");
    +        output = JInfoHelper.jinfo("-flag", "HeapDumpOnOutOfMemoryError");
             output.shouldHaveExitValue(0);
    -        output.shouldContain("-PrintGC");
    -        verifyIsDisabled("PrintGC");
    +        output.shouldContain("-HeapDumpOnOutOfMemoryError");
    +        verifyIsDisabled("HeapDumpOnOutOfMemoryError");
         }
     
         private static void testFlagEqual() throws Exception {
    -        OutputAnalyzer output = JInfoHelper.jinfo("-flag", "PrintGC=1");
    +        OutputAnalyzer output = JInfoHelper.jinfo("-flag", "HeapDumpOnOutOfMemoryError=1");
             output.shouldHaveExitValue(0);
    -        output = JInfoHelper.jinfo("-flag", "PrintGC");
    +        output = JInfoHelper.jinfo("-flag", "HeapDumpOnOutOfMemoryError");
             output.shouldHaveExitValue(0);
    -        output.shouldContain("+PrintGC");
    -        verifyIsEnabled("PrintGC");
    +        output.shouldContain("+HeapDumpOnOutOfMemoryError");
    +        verifyIsEnabled("HeapDumpOnOutOfMemoryError");
         }
     
         private static void testInvalidFlag() throws Exception {
    diff --git a/jdk/test/sun/tools/jps/JpsHelper.java b/jdk/test/sun/tools/jps/JpsHelper.java
    index 6f32ff4f67a..3078ea5a336 100644
    --- a/jdk/test/sun/tools/jps/JpsHelper.java
    +++ b/jdk/test/sun/tools/jps/JpsHelper.java
    @@ -98,7 +98,7 @@ public final class JpsHelper {
          * -XX:+UsePerfData is required for running the tests on embedded platforms.
          */
         public static final String[] VM_ARGS = {
    -        "-XX:+UsePerfData", "-Xmx512m", "-XX:+PrintGCDetails",
    +        "-XX:+UsePerfData", "-Xmx512m", "-Xlog:gc",
             "-Dmultiline.prop=value1\nvalue2\r\nvalue3"
         };
         /**
    
    From 2c277c0986ac6e5ef52ebb57fe73880eb0801c7c Mon Sep 17 00:00:00 2001
    From: Jaroslav Bachorik 
    Date: Tue, 24 Nov 2015 16:07:40 +0100
    Subject: [PATCH 035/228] 8138677: IllegalAccessException Class
     sun.usagetracker.UsageTrackerClient$4 (module java.base) can not access a
     member of class java.lang.management.ManagementFactory (module
     java.management)
    
    Reviewed-by: alanb, mchung, dholmes, erikj, ihse
    ---
     hotspot/make/share/makefiles/mapfile-vers    |  1 +
     hotspot/src/share/vm/prims/jvm.cpp           | 29 +++++++
     hotspot/src/share/vm/prims/jvm.h             |  7 ++
     hotspot/src/share/vm/services/jmm.h          |  6 --
     hotspot/src/share/vm/services/management.cpp | 86 --------------------
     5 files changed, 37 insertions(+), 92 deletions(-)
    
    diff --git a/hotspot/make/share/makefiles/mapfile-vers b/hotspot/make/share/makefiles/mapfile-vers
    index 9672bfe3fc9..2085a98b459 100644
    --- a/hotspot/make/share/makefiles/mapfile-vers
    +++ b/hotspot/make/share/makefiles/mapfile-vers
    @@ -111,6 +111,7 @@
                     JVM_GetSystemPackages;
                     JVM_GetTemporaryDirectory;
                     JVM_GetVersionInfo;
    +                JVM_GetVmArguments;
                     JVM_Halt;
                     JVM_HoldsLock;
                     JVM_IHashCode;
    diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp
    index 463b42180d2..c867df135c1 100644
    --- a/hotspot/src/share/vm/prims/jvm.cpp
    +++ b/hotspot/src/share/vm/prims/jvm.cpp
    @@ -3723,6 +3723,35 @@ JVM_ENTRY(void, JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t i
     }
     JVM_END
     
    +// Returns an array of java.lang.String objects containing the input arguments to the VM.
    +JVM_ENTRY(jobjectArray, JVM_GetVmArguments(JNIEnv *env))
    +  ResourceMark rm(THREAD);
    +
    +  if (Arguments::num_jvm_args() == 0 && Arguments::num_jvm_flags() == 0) {
    +    return NULL;
    +  }
    +
    +  char** vm_flags = Arguments::jvm_flags_array();
    +  char** vm_args = Arguments::jvm_args_array();
    +  int num_flags = Arguments::num_jvm_flags();
    +  int num_args = Arguments::num_jvm_args();
    +
    +  instanceKlassHandle ik (THREAD, SystemDictionary::String_klass());
    +  objArrayOop r = oopFactory::new_objArray(ik(), num_args + num_flags, CHECK_NULL);
    +  objArrayHandle result_h(THREAD, r);
    +
    +  int index = 0;
    +  for (int j = 0; j < num_flags; j++, index++) {
    +    Handle h = java_lang_String::create_from_platform_dependent_str(vm_flags[j], CHECK_NULL);
    +    result_h->obj_at_put(index, h());
    +  }
    +  for (int i = 0; i < num_args; i++, index++) {
    +    Handle h = java_lang_String::create_from_platform_dependent_str(vm_args[i], CHECK_NULL);
    +    result_h->obj_at_put(index, h());
    +  }
    +  return (jobjectArray) JNIHandles::make_local(env, result_h());
    +JVM_END
    +
     JVM_ENTRY_NO_ENV(jint, JVM_FindSignal(const char *name))
       return os::get_signal_number(name);
     JVM_END
    diff --git a/hotspot/src/share/vm/prims/jvm.h b/hotspot/src/share/vm/prims/jvm.h
    index 5a14f7cfcf7..2e995cabf4d 100644
    --- a/hotspot/src/share/vm/prims/jvm.h
    +++ b/hotspot/src/share/vm/prims/jvm.h
    @@ -141,6 +141,10 @@ JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos,
     JNIEXPORT jobject JNICALL
     JVM_InitProperties(JNIEnv *env, jobject p);
     
    +/*
    + * java.lang.Runtime
    + */
    +
     JNIEXPORT void JNICALL
     JVM_Halt(jint code);
     
    @@ -188,6 +192,9 @@ JVM_FindLibraryEntry(void *handle, const char *name);
     JNIEXPORT jboolean JNICALL
     JVM_IsSupportedJNIVersion(jint version);
     
    +JNIEXPORT jobjectArray JNICALL
    +JVM_GetVmArguments(JNIEnv *env);
    +
     /*
      * java.lang.Throwable
      */
    diff --git a/hotspot/src/share/vm/services/jmm.h b/hotspot/src/share/vm/services/jmm.h
    index 40dfb4e7325..0362e794d10 100644
    --- a/hotspot/src/share/vm/services/jmm.h
    +++ b/hotspot/src/share/vm/services/jmm.h
    @@ -227,16 +227,10 @@ typedef struct jmmInterface_1_ {
       jint         (JNICALL *GetOptionalSupport)     (JNIEnv *env,
                                                       jmmOptionalSupport* support_ptr);
     
    -  /* This is used by JDK 6 and earlier.
    -   * For JDK 7 and after, use GetInputArgumentArray.
    -   */
    -  jobject      (JNICALL *GetInputArguments)      (JNIEnv *env);
    -
       jint         (JNICALL *GetThreadInfo)          (JNIEnv *env,
                                                       jlongArray ids,
                                                       jint maxDepth,
                                                       jobjectArray infoArray);
    -  jobjectArray (JNICALL *GetInputArgumentArray)  (JNIEnv *env);
     
       jobjectArray (JNICALL *GetMemoryPools)         (JNIEnv* env, jobject mgr);
     
    diff --git a/hotspot/src/share/vm/services/management.cpp b/hotspot/src/share/vm/services/management.cpp
    index cbd759df389..892ce92fe7e 100644
    --- a/hotspot/src/share/vm/services/management.cpp
    +++ b/hotspot/src/share/vm/services/management.cpp
    @@ -473,90 +473,6 @@ JVM_LEAF(jint, jmm_GetOptionalSupport(JNIEnv *env, jmmOptionalSupport* support))
       return 0;
     JVM_END
     
    -// Returns a java.lang.String object containing the input arguments to the VM.
    -JVM_ENTRY(jobject, jmm_GetInputArguments(JNIEnv *env))
    -  ResourceMark rm(THREAD);
    -
    -  if (Arguments::num_jvm_args() == 0 && Arguments::num_jvm_flags() == 0) {
    -    return NULL;
    -  }
    -
    -  char** vm_flags = Arguments::jvm_flags_array();
    -  char** vm_args  = Arguments::jvm_args_array();
    -  int num_flags   = Arguments::num_jvm_flags();
    -  int num_args    = Arguments::num_jvm_args();
    -
    -  size_t length = 1; // null terminator
    -  int i;
    -  for (i = 0; i < num_flags; i++) {
    -    length += strlen(vm_flags[i]);
    -  }
    -  for (i = 0; i < num_args; i++) {
    -    length += strlen(vm_args[i]);
    -  }
    -  // add a space between each argument
    -  length += num_flags + num_args - 1;
    -
    -  // Return the list of input arguments passed to the VM
    -  // and preserve the order that the VM processes.
    -  char* args = NEW_RESOURCE_ARRAY(char, length);
    -  args[0] = '\0';
    -  // concatenate all jvm_flags
    -  if (num_flags > 0) {
    -    strcat(args, vm_flags[0]);
    -    for (i = 1; i < num_flags; i++) {
    -      strcat(args, " ");
    -      strcat(args, vm_flags[i]);
    -    }
    -  }
    -
    -  if (num_args > 0 && num_flags > 0) {
    -    // append a space if args already contains one or more jvm_flags
    -    strcat(args, " ");
    -  }
    -
    -  // concatenate all jvm_args
    -  if (num_args > 0) {
    -    strcat(args, vm_args[0]);
    -    for (i = 1; i < num_args; i++) {
    -      strcat(args, " ");
    -      strcat(args, vm_args[i]);
    -    }
    -  }
    -
    -  Handle hargs = java_lang_String::create_from_platform_dependent_str(args, CHECK_NULL);
    -  return JNIHandles::make_local(env, hargs());
    -JVM_END
    -
    -// Returns an array of java.lang.String object containing the input arguments to the VM.
    -JVM_ENTRY(jobjectArray, jmm_GetInputArgumentArray(JNIEnv *env))
    -  ResourceMark rm(THREAD);
    -
    -  if (Arguments::num_jvm_args() == 0 && Arguments::num_jvm_flags() == 0) {
    -    return NULL;
    -  }
    -
    -  char** vm_flags = Arguments::jvm_flags_array();
    -  char** vm_args = Arguments::jvm_args_array();
    -  int num_flags = Arguments::num_jvm_flags();
    -  int num_args = Arguments::num_jvm_args();
    -
    -  instanceKlassHandle ik (THREAD, SystemDictionary::String_klass());
    -  objArrayOop r = oopFactory::new_objArray(ik(), num_args + num_flags, CHECK_NULL);
    -  objArrayHandle result_h(THREAD, r);
    -
    -  int index = 0;
    -  for (int j = 0; j < num_flags; j++, index++) {
    -    Handle h = java_lang_String::create_from_platform_dependent_str(vm_flags[j], CHECK_NULL);
    -    result_h->obj_at_put(index, h());
    -  }
    -  for (int i = 0; i < num_args; i++, index++) {
    -    Handle h = java_lang_String::create_from_platform_dependent_str(vm_args[i], CHECK_NULL);
    -    result_h->obj_at_put(index, h());
    -  }
    -  return (jobjectArray) JNIHandles::make_local(env, result_h());
    -JVM_END
    -
     // Returns an array of java/lang/management/MemoryPoolMXBean object
     // one for each memory pool if obj == null; otherwise returns
     // an array of memory pools for a given memory manager if
    @@ -2291,9 +2207,7 @@ const struct jmmInterface_1_ jmm_interface = {
       NULL,
       jmm_GetVersion,
       jmm_GetOptionalSupport,
    -  jmm_GetInputArguments,
       jmm_GetThreadInfo,
    -  jmm_GetInputArgumentArray,
       jmm_GetMemoryPools,
       jmm_GetMemoryManagers,
       jmm_GetMemoryPoolUsage,
    
    From f648ec7dccd990038c84107f0959cc03b23e46bd Mon Sep 17 00:00:00 2001
    From: Alexander Harlap 
    Date: Thu, 3 Dec 2015 15:37:52 -0500
    Subject: [PATCH 036/228] 8141123: Cleanup in FreeIdSet
    
    Some members of FreeIdSet should be size_t instead of ints. Also remove unused code
    
    Reviewed-by: tschatzl, kbarrett, tbenson
    ---
     hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp |   2 +-
     hotspot/src/share/vm/gc/shared/workgroup.cpp  | 116 +++---------------
     hotspot/src/share/vm/gc/shared/workgroup.hpp  |  37 ++----
     3 files changed, 31 insertions(+), 124 deletions(-)
    
    diff --git a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp
    index 7eb460394a3..3869a648af9 100644
    --- a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp
    +++ b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp
    @@ -112,7 +112,7 @@ void DirtyCardQueueSet::initialize(CardTableEntryClosure* cl,
                               fl_owner);
       set_buffer_size(G1UpdateBufferSize);
       _shared_dirty_card_queue.set_lock(lock);
    -  _free_ids = new FreeIdSet((int) num_par_ids(), _cbl_mon);
    +  _free_ids = new FreeIdSet(num_par_ids(), _cbl_mon);
     }
     
     void DirtyCardQueueSet::handle_zero_index_for_thread(JavaThread* t) {
    diff --git a/hotspot/src/share/vm/gc/shared/workgroup.cpp b/hotspot/src/share/vm/gc/shared/workgroup.cpp
    index 22e231ffc0c..0fea9e88eb3 100644
    --- a/hotspot/src/share/vm/gc/shared/workgroup.cpp
    +++ b/hotspot/src/share/vm/gc/shared/workgroup.cpp
    @@ -500,122 +500,42 @@ bool SequentialSubTasksDone::all_tasks_completed() {
       return false;
     }
     
    -bool FreeIdSet::_stat_init = false;
    -FreeIdSet* FreeIdSet::_sets[NSets];
    -bool FreeIdSet::_safepoint;
    -
    -FreeIdSet::FreeIdSet(int sz, Monitor* mon) :
    -  _sz(sz), _mon(mon), _hd(0), _waiters(0), _index(-1), _claimed(0)
    +FreeIdSet::FreeIdSet(uint size, Monitor* mon) :
    +  _size(size), _mon(mon), _hd(0), _waiters(0), _claimed(0)
     {
    -  _ids = NEW_C_HEAP_ARRAY(int, sz, mtInternal);
    -  for (int i = 0; i < sz; i++) _ids[i] = i+1;
    -  _ids[sz-1] = end_of_list; // end of list.
    -  if (_stat_init) {
    -    for (int j = 0; j < NSets; j++) _sets[j] = NULL;
    -    _stat_init = true;
    +  guarantee(size != 0, "must be");
    +  _ids = NEW_C_HEAP_ARRAY(uint, size, mtGC);
    +  for (uint i = 0; i < size - 1; i++) {
    +    _ids[i] = i+1;
       }
    -  // Add to sets.  (This should happen while the system is still single-threaded.)
    -  for (int j = 0; j < NSets; j++) {
    -    if (_sets[j] == NULL) {
    -      _sets[j] = this;
    -      _index = j;
    -      break;
    -    }
    -  }
    -  guarantee(_index != -1, "Too many FreeIdSets in use!");
    +  _ids[size-1] = end_of_list; // end of list.
     }
     
     FreeIdSet::~FreeIdSet() {
    -  _sets[_index] = NULL;
    -  FREE_C_HEAP_ARRAY(int, _ids);
    +  FREE_C_HEAP_ARRAY(uint, _ids);
     }
     
    -void FreeIdSet::set_safepoint(bool b) {
    -  _safepoint = b;
    -  if (b) {
    -    for (int j = 0; j < NSets; j++) {
    -      if (_sets[j] != NULL && _sets[j]->_waiters > 0) {
    -        Monitor* mon = _sets[j]->_mon;
    -        mon->lock_without_safepoint_check();
    -        mon->notify_all();
    -        mon->unlock();
    -      }
    -    }
    -  }
    -}
    -
    -#define FID_STATS 0
    -
    -int FreeIdSet::claim_par_id() {
    -#if FID_STATS
    -  thread_t tslf = thr_self();
    -  tty->print("claim_par_id[%d]: sz = %d, claimed = %d\n", tslf, _sz, _claimed);
    -#endif
    +uint FreeIdSet::claim_par_id() {
       MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag);
    -  while (!_safepoint && _hd == end_of_list) {
    +  while (_hd == end_of_list) {
         _waiters++;
    -#if FID_STATS
    -    if (_waiters > 5) {
    -      tty->print("claim_par_id waiting[%d]: %d waiters, %d claimed.\n",
    -                 tslf, _waiters, _claimed);
    -    }
    -#endif
         _mon->wait(Mutex::_no_safepoint_check_flag);
         _waiters--;
       }
    -  if (_hd == end_of_list) {
    -#if FID_STATS
    -    tty->print("claim_par_id[%d]: returning EOL.\n", tslf);
    -#endif
    -    return -1;
    -  } else {
    -    int res = _hd;
    -    _hd = _ids[res];
    -    _ids[res] = claimed;  // For debugging.
    -    _claimed++;
    -#if FID_STATS
    -    tty->print("claim_par_id[%d]: returning %d, claimed = %d.\n",
    -               tslf, res, _claimed);
    -#endif
    -    return res;
    -  }
    +  uint res = _hd;
    +  _hd = _ids[res];
    +  _ids[res] = claimed;  // For debugging.
    +  _claimed++;
    +  return res;
     }
     
    -bool FreeIdSet::claim_perm_id(int i) {
    -  assert(0 <= i && i < _sz, "Out of range.");
    -  MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag);
    -  int prev = end_of_list;
    -  int cur = _hd;
    -  while (cur != end_of_list) {
    -    if (cur == i) {
    -      if (prev == end_of_list) {
    -        _hd = _ids[cur];
    -      } else {
    -        _ids[prev] = _ids[cur];
    -      }
    -      _ids[cur] = claimed;
    -      _claimed++;
    -      return true;
    -    } else {
    -      prev = cur;
    -      cur = _ids[cur];
    -    }
    -  }
    -  return false;
    -
    -}
    -
    -void FreeIdSet::release_par_id(int id) {
    +void FreeIdSet::release_par_id(uint id) {
       MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag);
       assert(_ids[id] == claimed, "Precondition.");
       _ids[id] = _hd;
       _hd = id;
       _claimed--;
    -#if FID_STATS
    -  tty->print("[%d] release_par_id(%d), waiters =%d,  claimed = %d.\n",
    -             thr_self(), id, _waiters, _claimed);
    -#endif
    -  if (_waiters > 0)
    -    // Notify all would be safer, but this is OK, right?
    +  if (_waiters > 0) {
         _mon->notify_all();
    +  }
     }
    diff --git a/hotspot/src/share/vm/gc/shared/workgroup.hpp b/hotspot/src/share/vm/gc/shared/workgroup.hpp
    index fa72ad440ed..8c0dde8b396 100644
    --- a/hotspot/src/share/vm/gc/shared/workgroup.hpp
    +++ b/hotspot/src/share/vm/gc/shared/workgroup.hpp
    @@ -379,42 +379,29 @@ public:
     };
     
     // Represents a set of free small integer ids.
    -class FreeIdSet : public CHeapObj {
    +class FreeIdSet : public CHeapObj {
       enum {
    -    end_of_list = -1,
    -    claimed = -2
    +    end_of_list = UINT_MAX,
    +    claimed = UINT_MAX - 1
       };
     
    -  int _sz;
    +  uint _size;
       Monitor* _mon;
     
    -  int* _ids;
    -  int _hd;
    -  int _waiters;
    -  int _claimed;
    -
    -  static bool _safepoint;
    -  typedef FreeIdSet* FreeIdSetPtr;
    -  static const int NSets = 10;
    -  static FreeIdSetPtr _sets[NSets];
    -  static bool _stat_init;
    -  int _index;
    +  uint* _ids;
    +  uint _hd;
    +  uint _waiters;
    +  uint _claimed;
     
     public:
    -  FreeIdSet(int sz, Monitor* mon);
    +  FreeIdSet(uint size, Monitor* mon);
       ~FreeIdSet();
     
    -  static void set_safepoint(bool b);
    -
    -  // Attempt to claim the given id permanently.  Returns "true" iff
    -  // successful.
    -  bool claim_perm_id(int i);
    -
       // Returns an unclaimed parallel id (waiting for one to be released if
    -  // necessary).  Returns "-1" if a GC wakes up a wait for an id.
    -  int claim_par_id();
    +  // necessary).
    +  uint claim_par_id();
     
    -  void release_par_id(int id);
    +  void release_par_id(uint id);
     };
     
     #endif // SHARE_VM_GC_SHARED_WORKGROUP_HPP
    
    From e62c706965e086ff6f73e5dd13b21c59dc93fc65 Mon Sep 17 00:00:00 2001
    From: Jon Masamitsu 
    Date: Tue, 24 Nov 2015 15:56:40 -0800
    Subject: [PATCH 037/228] 8133023: ParallelGCThreads is not calculated
     correctly
    
    Reviewed-by: kbarrett, tschatzl, sangheki, dholmes
    ---
     hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp |  7 ++++---
     hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp |  2 ++
     hotspot/src/share/vm/runtime/os.cpp           |  4 ++++
     hotspot/src/share/vm/runtime/vm_version.hpp   | 11 +++++++++++
     4 files changed, 21 insertions(+), 3 deletions(-)
    
    diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
    index e6a79435447..6891ca56998 100644
    --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
    +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
    @@ -35,7 +35,10 @@ const char* VM_Version::_features_str = "";
     unsigned int VM_Version::_L2_data_cache_line_size = 0;
     
     void VM_Version::initialize() {
    -  _features = determine_features();
    +
    +  assert(_features != VM_Version::unknown_m, "System pre-initialization is not complete.");
    +  guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
    +
       PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes();
       PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes();
       PrefetchFieldsAhead         = prefetch_fields_ahead();
    @@ -60,8 +63,6 @@ void VM_Version::initialize() {
         FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1);
       }
     
    -  guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
    -
       UseSSE = 0; // Only on x86 and x64
     
       _supports_cx8 = has_v9();
    diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
    index c21a6ee13d5..db2d77e1bc1 100644
    --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
    +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
    @@ -127,6 +127,8 @@ public:
       // Initialization
       static void initialize();
     
    +  static void init_before_ergo()        { _features = determine_features(); }
    +
       // Instruction support
       static bool has_v8()                  { return (_features & v8_instructions_m) != 0; }
       static bool has_v9()                  { return (_features & v9_instructions_m) != 0; }
    diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp
    index 1eb8323c464..5c0ebf54c79 100644
    --- a/hotspot/src/share/vm/runtime/os.cpp
    +++ b/hotspot/src/share/vm/runtime/os.cpp
    @@ -315,6 +315,10 @@ void os::init_before_ergo() {
       // We need to initialize large page support here because ergonomics takes some
       // decisions depending on large page support and the calculated large page size.
       large_page_init();
    +
    +  // VM version initialization identifies some characteristics of the
    +  // the platform that are used during ergonomic decisions.
    +  VM_Version::init_before_ergo();
     }
     
     void os::signal_init() {
    diff --git a/hotspot/src/share/vm/runtime/vm_version.hpp b/hotspot/src/share/vm/runtime/vm_version.hpp
    index 7977a2cbcb5..4e12c00bba5 100644
    --- a/hotspot/src/share/vm/runtime/vm_version.hpp
    +++ b/hotspot/src/share/vm/runtime/vm_version.hpp
    @@ -56,6 +56,12 @@ class Abstract_VM_Version: AllStatic {
                                                       unsigned int dem,
                                                       unsigned int switch_pt);
      public:
    +  // Called as part of the runtime services initialization which is
    +  // called from the management module initialization (via init_globals())
    +  // after argument parsing and attaching of the main thread has
    +  // occurred.  Examines a variety of the hardware capabilities of
    +  // the platform to determine which features can be used to execute the
    +  // program.
       static void initialize();
     
       // This allows for early initialization of VM_Version information
    @@ -65,6 +71,11 @@ class Abstract_VM_Version: AllStatic {
       // need to specialize this define VM_Version::early_initialize().
       static void early_initialize() { }
     
    +  // Called to initialize VM variables needing initialization
    +  // after command line parsing. Platforms that need to specialize
    +  // this should define VM_Version::init_before_ergo().
    +  static void init_before_ergo() {}
    +
       // Name
       static const char* vm_name();
       // Vendor
    
    From 343b6c32534ff4b150268c436b16c775895a85f3 Mon Sep 17 00:00:00 2001
    From: Weijun Wang 
    Date: Thu, 26 Nov 2015 16:25:48 -0800
    Subject: [PATCH 038/228] 8143959: Certificates requiring blacklisting
    
    Reviewed-by: mullan
    ---
     .../blacklisted.certs.pem                     | 23 +++++++++++++++++++
     1 file changed, 23 insertions(+)
    
    diff --git a/jdk/make/data/blacklistedcertsconverter/blacklisted.certs.pem b/jdk/make/data/blacklistedcertsconverter/blacklisted.certs.pem
    index db1c077ccb0..191e94e12a5 100644
    --- a/jdk/make/data/blacklistedcertsconverter/blacklisted.certs.pem
    +++ b/jdk/make/data/blacklistedcertsconverter/blacklisted.certs.pem
    @@ -725,3 +725,26 @@ v9qpeC45ZA/jelxV11HKbQnVF194gDb7D2H9OsAsRUy8HVKbXEcc/8dKvwOqb+BC
     DBabJH1vJ9Gd+KwxMCmBZ6pQPl28JDimhJhI2LNqU349uADQVV0HJosddN/ARyyI
     LSIQO7BnNVKVG9Iujf33bvPNeg0qNz5qw+rKKq97Pqeum+L5oKU=
     -----END CERTIFICATE-----
    +
    +// Subject: CN=eDellRoot
    +// Issuer: CN=eDellRoot
    +// Serial Number:
    +//     6b:c5:7b:95:18:93:aa:97:4b:62:4a:c0:88:fc:3b:b6
    +-----BEGIN CERTIFICATE-----
    +MIIC8zCCAd+gAwIBAgIQa8V7lRiTqpdLYkrAiPw7tjAJBgUrDgMCHQUAMBQxEjAQ
    +BgNVBAMTCWVEZWxsUm9vdDAeFw0xNTA0MDcxMDIzMjdaFw0zOTEyMzEyMzU5NTla
    +MBQxEjAQBgNVBAMTCWVEZWxsUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
    +AQoCggEBAL3RJg1uzVuEX0Hw4XWGzs6oI9W+o7HZdVdBMMVb4Gzb4uZjCTNjbPx4
    +b8LNFL1uArUt+5VVMQDsOTY3Lg/Xe/UNukY2b+0llUOzzBYYpbsFcco4n6SsTvDh
    +Ni5t+kPo7c23ZrYBPmOu82eEJ6cavs/t39u+wFOkXXwvRCiHA/lWyNWNEPh17+bC
    +EP3q5N+JrV+6Ho3zQPEv5QUJYdmXsMmD2CMQojeQUj68J91P5w5BKjurG0xjivzh
    +Soie9ym7VRwLFjWScRuw/9XV6CLqTyL5xrqiiDp1uTOuqNj3uxyts9ocbsoJXuxj
    +5iEYkSM1nvLupEv+lgy9WqzIEFMm1l8CAwEAAaNJMEcwRQYDVR0BBD4wPIAQYA/f
    +EzPwmaRcZuSaa/VZ1KEWMBQxEjAQBgNVBAMTCWVEZWxsUm9vdIIQa8V7lRiTqpdL
    +YkrAiPw7tjAJBgUrDgMCHQUAA4IBAQArfdcScsezj8ooJ92UwwnPgg36noOgiUs5
    +XzPLP4h0JpUYQVKB9hY1WTDwRUfTKGh7oNOowd027a/rVSb/TNeoiJIvMKn4gbvV
    +CWAiHhO8u2u0RkHCDVsa7e0i4ncpueWsihjn6jBrY8T+7eDYwiFT/F03A8NJ7mK5
    +lZA8SFd5CTDy3EBUU5UwzXUc5HoIRUxXSPycu3aIBWawg3sCdKiAoikScPAWj0bM
    +0vmsP/8QSlTOBqO+QFQ6R82BtTvBNU3qbVICV4QObsxib++FAFL56NApPqskg7Vz
    +LfNIAjKabHUcjbuZkmg6jr4BfYW7+oQDHCsYgADjjKGdKz/8U/fP
    +-----END CERTIFICATE-----
    
    From b97ff269d0cc7c79a82f6b319f0fe6f020fbe4e2 Mon Sep 17 00:00:00 2001
    From: Roland Westrelin 
    Date: Tue, 1 Dec 2015 12:17:18 +0100
    Subject: [PATCH 039/228] 8143930: C1 LinearScan asserts when compiling two
     back-to-back CompareAndSwapLongs
    
    Refactor CAS code to decrease register pressure in c1
    
    Reviewed-by: kvn, shade
    ---
     .../src/cpu/x86/vm/c1_LIRGenerator_x86.cpp    | 26 +++----
     .../intrinsics/unsafe/UnsafeTwoCASLong.java   | 77 +++++++++++++++++++
     2 files changed, 90 insertions(+), 13 deletions(-)
     create mode 100644 hotspot/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java
    
    diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
    index 8303fe989c8..e7ba64b69e6 100644
    --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
    +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
    @@ -736,19 +736,6 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) {
       obj.load_item();
       offset.load_nonconstant();
     
    -  if (type == objectType) {
    -    cmp.load_item_force(FrameMap::rax_oop_opr);
    -    val.load_item();
    -  } else if (type == intType) {
    -    cmp.load_item_force(FrameMap::rax_opr);
    -    val.load_item();
    -  } else if (type == longType) {
    -    cmp.load_item_force(FrameMap::long0_opr);
    -    val.load_item_force(FrameMap::long1_opr);
    -  } else {
    -    ShouldNotReachHere();
    -  }
    -
       LIR_Opr addr = new_pointer_register();
       LIR_Address* a;
       if(offset.result()->is_constant()) {
    @@ -785,6 +772,19 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) {
                     true /* do_load */, false /* patch */, NULL);
       }
     
    +  if (type == objectType) {
    +    cmp.load_item_force(FrameMap::rax_oop_opr);
    +    val.load_item();
    +  } else if (type == intType) {
    +    cmp.load_item_force(FrameMap::rax_opr);
    +    val.load_item();
    +  } else if (type == longType) {
    +    cmp.load_item_force(FrameMap::long0_opr);
    +    val.load_item_force(FrameMap::long1_opr);
    +  } else {
    +    ShouldNotReachHere();
    +  }
    +
       LIR_Opr ill = LIR_OprFact::illegalOpr;  // for convenience
       if (type == objectType)
         __ cas_obj(addr, cmp.result(), val.result(), ill, ill);
    diff --git a/hotspot/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java b/hotspot/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java
    new file mode 100644
    index 00000000000..224d22ca42c
    --- /dev/null
    +++ b/hotspot/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java
    @@ -0,0 +1,77 @@
    +/*
    + * 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 8143930
    + * @summary C1 LinearScan asserts when compiling two back-to-back CompareAndSwapLongs
    + * @modules java.base/jdk.internal.misc
    + * @run testng/othervm -Diters=200000 -XX:TieredStopAtLevel=1 UnsafeTwoCASLong
    + */
    +
    +import org.testng.annotations.Test;
    +
    +import java.lang.reflect.Field;
    +
    +import static org.testng.Assert.*;
    +
    +public class UnsafeTwoCASLong {
    +    static final int ITERS = Integer.getInteger("iters", 1);
    +    static final jdk.internal.misc.Unsafe UNSAFE;
    +    static final long V_OFFSET;
    +
    +    static {
    +        try {
    +            Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe");
    +            f.setAccessible(true);
    +            UNSAFE = (jdk.internal.misc.Unsafe) f.get(null);
    +        } catch (Exception e) {
    +            throw new RuntimeException("Unable to get Unsafe instance.", e);
    +        }
    +
    +        try {
    +            Field vField = UnsafeTwoCASLong.class.getDeclaredField("v");
    +            V_OFFSET = UNSAFE.objectFieldOffset(vField);
    +        } catch (Exception e) {
    +            throw new RuntimeException(e);
    +        }
    +    }
    +
    +    long v;
    +
    +    @Test
    +    public void testFieldInstance() {
    +        UnsafeTwoCASLong t = new UnsafeTwoCASLong();
    +        for (int c = 0; c < ITERS; c++) {
    +            testAccess(t, V_OFFSET);
    +        }
    +    }
    +
    +    static void testAccess(Object base, long offset) {
    +        UNSAFE.compareAndSwapLong(base, offset, 1L, 2L);
    +        UNSAFE.compareAndSwapLong(base, offset, 2L, 1L);
    +    }
    +
    +}
    +
    
    From 78853b0d4679356e3060b3caba60828451be6379 Mon Sep 17 00:00:00 2001
    From: Chris Hegarty 
    Date: Tue, 1 Dec 2015 12:38:28 +0000
    Subject: [PATCH 040/228] 8143185: Cleanup for handling proxies
    
    Reviewed-by: alanb, darcy, robm, rriggs, skoivu, rriggs
    ---
     .../AnnotationInvocationHandler.java          | 52 ++++++++++++++++---
     1 file changed, 45 insertions(+), 7 deletions(-)
    
    diff --git a/jdk/src/java.base/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java b/jdk/src/java.base/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java
    index 2f6bdee2f93..a69b32f2be4 100644
    --- a/jdk/src/java.base/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java
    +++ b/jdk/src/java.base/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java
    @@ -25,6 +25,7 @@
     
     package sun.reflect.annotation;
     
    +import java.io.ObjectInputStream;
     import java.lang.annotation.*;
     import java.lang.reflect.*;
     import java.io.Serializable;
    @@ -431,35 +432,72 @@ class AnnotationInvocationHandler implements InvocationHandler, Serializable {
     
         private void readObject(java.io.ObjectInputStream s)
             throws java.io.IOException, ClassNotFoundException {
    -        s.defaultReadObject();
    +        ObjectInputStream.GetField fields = s.readFields();
    +
    +        @SuppressWarnings("unchecked")
    +        Class t = (Class)fields.get("type", null);
    +        @SuppressWarnings("unchecked")
    +        Map streamVals = (Map)fields.get("memberValues", null);
     
             // Check to make sure that types have not evolved incompatibly
     
             AnnotationType annotationType = null;
             try {
    -            annotationType = AnnotationType.getInstance(type);
    +            annotationType = AnnotationType.getInstance(t);
             } catch(IllegalArgumentException e) {
                 // Class is no longer an annotation type; time to punch out
                 throw new java.io.InvalidObjectException("Non-annotation type in annotation serial stream");
             }
     
             Map> memberTypes = annotationType.memberTypes();
    +        // consistent with runtime Map type
    +        Map mv = new LinkedHashMap<>();
     
             // If there are annotation members without values, that
             // situation is handled by the invoke method.
    -        for (Map.Entry memberValue : memberValues.entrySet()) {
    +        for (Map.Entry memberValue : streamVals.entrySet()) {
                 String name = memberValue.getKey();
    +            Object value = null;
                 Class memberType = memberTypes.get(name);
                 if (memberType != null) {  // i.e. member still exists
    -                Object value = memberValue.getValue();
    +                value = memberValue.getValue();
                     if (!(memberType.isInstance(value) ||
                           value instanceof ExceptionProxy)) {
    -                    memberValue.setValue(
    -                        new AnnotationTypeMismatchExceptionProxy(
    +                    value = new AnnotationTypeMismatchExceptionProxy(
                                 value.getClass() + "[" + value + "]").setMember(
    -                                annotationType.members().get(name)));
    +                                annotationType.members().get(name));
                     }
                 }
    +            mv.put(name, value);
    +        }
    +
    +        UnsafeAccessor.setType(this, t);
    +        UnsafeAccessor.setMemberValues(this, mv);
    +    }
    +
    +    private static class UnsafeAccessor {
    +        private static final jdk.internal.misc.Unsafe unsafe;
    +        private static final long typeOffset;
    +        private static final long memberValuesOffset;
    +        static {
    +            try {
    +                unsafe = jdk.internal.misc.Unsafe.getUnsafe();
    +                typeOffset = unsafe.objectFieldOffset
    +                        (AnnotationInvocationHandler.class.getDeclaredField("type"));
    +                memberValuesOffset = unsafe.objectFieldOffset
    +                        (AnnotationInvocationHandler.class.getDeclaredField("memberValues"));
    +            } catch (Exception ex) {
    +                throw new ExceptionInInitializerError(ex);
    +            }
    +        }
    +        static void setType(AnnotationInvocationHandler o,
    +                            Class type) {
    +            unsafe.putObject(o, typeOffset, type);
    +        }
    +
    +        static void setMemberValues(AnnotationInvocationHandler o,
    +                                    Map memberValues) {
    +            unsafe.putObject(o, memberValuesOffset, memberValues);
             }
         }
     }
    
    From 7925eb298bb356873c48c820f9741aa391979bad Mon Sep 17 00:00:00 2001
    From: Roland Westrelin 
    Date: Wed, 2 Dec 2015 15:13:42 +0100
    Subject: [PATCH 041/228] 8134883: C1 hard crash in range check elimination in
     Nashorn test262parallel
    
    C1's range check elimination breaks with a non-natural loop that has an exception handler as one entry
    
    Reviewed-by: iveresov
    ---
     hotspot/src/share/vm/c1/c1_IR.cpp             |  7 +-
     .../TestRangeCheckExceptionHandlerLoop.jasm   | 89 +++++++++++++++++++
     ...estRangeCheckExceptionHandlerLoopMain.java | 41 +++++++++
     3 files changed, 134 insertions(+), 3 deletions(-)
     create mode 100644 hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm
     create mode 100644 hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java
    
    diff --git a/hotspot/src/share/vm/c1/c1_IR.cpp b/hotspot/src/share/vm/c1/c1_IR.cpp
    index 6b015b44d85..105d27fcc0c 100644
    --- a/hotspot/src/share/vm/c1/c1_IR.cpp
    +++ b/hotspot/src/share/vm/c1/c1_IR.cpp
    @@ -579,11 +579,8 @@ void ComputeLinearScanOrder::count_edges(BlockBegin* cur, BlockBegin* parent) {
         assert(is_visited(cur), "block must be visisted when block is active");
         assert(parent != NULL, "must have parent");
     
    -    cur->set(BlockBegin::linear_scan_loop_header_flag);
         cur->set(BlockBegin::backward_branch_target_flag);
     
    -    parent->set(BlockBegin::linear_scan_loop_end_flag);
    -
         // When a loop header is also the start of an exception handler, then the backward branch is
         // an exception edge. Because such edges are usually critical edges which cannot be split, the
         // loop must be excluded here from processing.
    @@ -592,6 +589,10 @@ void ComputeLinearScanOrder::count_edges(BlockBegin* cur, BlockBegin* parent) {
           _iterative_dominators = true;
           return;
         }
    +
    +    cur->set(BlockBegin::linear_scan_loop_header_flag);
    +    parent->set(BlockBegin::linear_scan_loop_end_flag);
    +
         assert(parent->number_of_sux() == 1 && parent->sux_at(0) == cur,
                "loop end blocks must have one successor (critical edges are split)");
     
    diff --git a/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm b/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm
    new file mode 100644
    index 00000000000..2befe6db091
    --- /dev/null
    +++ b/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm
    @@ -0,0 +1,89 @@
    +/*
    + * 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.
    + *
    + */
    +
    +super public class TestRangeCheckExceptionHandlerLoop
    +	version 51:0
    +{
    +
    +
    +public Method "":"()V"
    +	stack 1 locals 1
    +{
    +		aload_0;
    +		invokespecial	Method java/lang/Object."":"()V";
    +		return;
    +}
    +
    +/* This method has an irreducible loop, with 2 entries, one is the exception handler
    +
    +    static void test(boolean flag, int[] array, Exception exception) throws Exception {
    +        int i = 0;
    +        if (flag) {
    +            try {
    +                throw exception;
    +            } catch(Exception e) {
    +                array[i] = 0;
    +                i++;
    +            }
    +        }
    +        if (i < 10) {
    +            throw exception; // caught by exception handler above as well
    +        }
    +    }
    +*/
    +public static Method test:"(Z[ILjava/lang/Exception;)V"
    +	throws java/lang/Exception
    +	stack 3 locals 5
    +{
    +		iconst_0;
    +		istore_3;
    +		iload_0;
    +		ifeq	L17;
    +		try t0;
    +		aload_2;
    +		athrow;
    +		endtry t0;
    +		catch t0 java/lang/Exception;
    +		catch t1 java/lang/Exception;
    +		stack_frame_type full;
    +		locals_map int, class "[I", class java/lang/Exception, int;
    +		stack_map class java/lang/Exception;
    +		astore	4;
    +		aload_1;
    +		iload_3;
    +		iconst_0;
    +		iastore;
    +		iinc	3, 1;
    +	L17:	stack_frame_type same;
    +		iload_3;
    +		bipush	10;
    +		if_icmpge	L25;
    +		try t1;
    +		aload_2;
    +		athrow;
    +		endtry t1;
    +	L25:	stack_frame_type same;
    +		return;
    +}
    +} // end Class TestRangeCheckExceptionHandlerLoop
    diff --git a/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java b/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java
    new file mode 100644
    index 00000000000..3eac3231571
    --- /dev/null
    +++ b/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java
    @@ -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 8134883
    + * @summary C1's range check elimination breaks with a non-natural loop that an exception handler as one entry
    + * @compile TestRangeCheckExceptionHandlerLoop.jasm
    + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestRangeCheckExceptionHandlerLoopMain
    + */
    +
    +public class TestRangeCheckExceptionHandlerLoopMain {
    +    public static void main(String[] args) throws Exception {
    +        Exception exception = new Exception();
    +        int[] array = new int[10];
    +        for (int i = 0; i < 20000; i++) {
    +            TestRangeCheckExceptionHandlerLoop.test(false, array, exception);
    +        }
    +    }
    +}
    
    From 67caeeaa08ca5174d6ca672c3a9004ecc43e0b69 Mon Sep 17 00:00:00 2001
    From: Fei Yang 
    Date: Mon, 7 Dec 2015 21:23:02 +0800
    Subject: [PATCH 042/228] 8144587: aarch64: generate vectorized MLA/MLS
     instructions
    
    Add support for MLA/MLS (vector) instructions
    
    Reviewed-by: roland
    ---
     hotspot/src/cpu/aarch64/vm/aarch64.ad         | 118 ++++++++++++++++++
     .../src/cpu/aarch64/vm/assembler_aarch64.hpp  |   2 +
     2 files changed, 120 insertions(+)
    
    diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad
    index 75b598e902c..b6a1a242038 100644
    --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad
    +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad
    @@ -15318,6 +15318,124 @@ instruct vmul2D(vecX dst, vecX src1, vecX src2)
       ins_pipe(pipe_class_default);
     %}
     
    +// --------------------------------- MLA --------------------------------------
    +
    +instruct vmla4S(vecD dst, vecD src1, vecD src2)
    +%{
    +  predicate(n->as_Vector()->length() == 2 ||
    +            n->as_Vector()->length() == 4);
    +  match(Set dst (AddVS dst (MulVS src1 src2)));
    +  ins_cost(INSN_COST);
    +  format %{ "mlav  $dst,$src1,$src2\t# vector (4H)" %}
    +  ins_encode %{
    +    __ mlav(as_FloatRegister($dst$$reg), __ T4H,
    +            as_FloatRegister($src1$$reg),
    +            as_FloatRegister($src2$$reg));
    +  %}
    +  ins_pipe(pipe_class_default);
    +%}
    +
    +instruct vmla8S(vecX dst, vecX src1, vecX src2)
    +%{
    +  predicate(n->as_Vector()->length() == 8);
    +  match(Set dst (AddVS dst (MulVS src1 src2)));
    +  ins_cost(INSN_COST);
    +  format %{ "mlav  $dst,$src1,$src2\t# vector (8H)" %}
    +  ins_encode %{
    +    __ mlav(as_FloatRegister($dst$$reg), __ T8H,
    +            as_FloatRegister($src1$$reg),
    +            as_FloatRegister($src2$$reg));
    +  %}
    +  ins_pipe(pipe_class_default);
    +%}
    +
    +instruct vmla2I(vecD dst, vecD src1, vecD src2)
    +%{
    +  predicate(n->as_Vector()->length() == 2);
    +  match(Set dst (AddVI dst (MulVI src1 src2)));
    +  ins_cost(INSN_COST);
    +  format %{ "mlav  $dst,$src1,$src2\t# vector (2S)" %}
    +  ins_encode %{
    +    __ mlav(as_FloatRegister($dst$$reg), __ T2S,
    +            as_FloatRegister($src1$$reg),
    +            as_FloatRegister($src2$$reg));
    +  %}
    +  ins_pipe(pipe_class_default);
    +%}
    +
    +instruct vmla4I(vecX dst, vecX src1, vecX src2)
    +%{
    +  predicate(n->as_Vector()->length() == 4);
    +  match(Set dst (AddVI dst (MulVI src1 src2)));
    +  ins_cost(INSN_COST);
    +  format %{ "mlav  $dst,$src1,$src2\t# vector (4S)" %}
    +  ins_encode %{
    +    __ mlav(as_FloatRegister($dst$$reg), __ T4S,
    +            as_FloatRegister($src1$$reg),
    +            as_FloatRegister($src2$$reg));
    +  %}
    +  ins_pipe(pipe_class_default);
    +%}
    +
    +// --------------------------------- MLS --------------------------------------
    +
    +instruct vmls4S(vecD dst, vecD src1, vecD src2)
    +%{
    +  predicate(n->as_Vector()->length() == 2 ||
    +            n->as_Vector()->length() == 4);
    +  match(Set dst (SubVS dst (MulVS src1 src2)));
    +  ins_cost(INSN_COST);
    +  format %{ "mlsv  $dst,$src1,$src2\t# vector (4H)" %}
    +  ins_encode %{
    +    __ mlsv(as_FloatRegister($dst$$reg), __ T4H,
    +            as_FloatRegister($src1$$reg),
    +            as_FloatRegister($src2$$reg));
    +  %}
    +  ins_pipe(pipe_class_default);
    +%}
    +
    +instruct vmls8S(vecX dst, vecX src1, vecX src2)
    +%{
    +  predicate(n->as_Vector()->length() == 8);
    +  match(Set dst (SubVS dst (MulVS src1 src2)));
    +  ins_cost(INSN_COST);
    +  format %{ "mlsv  $dst,$src1,$src2\t# vector (8H)" %}
    +  ins_encode %{
    +    __ mlsv(as_FloatRegister($dst$$reg), __ T8H,
    +            as_FloatRegister($src1$$reg),
    +            as_FloatRegister($src2$$reg));
    +  %}
    +  ins_pipe(pipe_class_default);
    +%}
    +
    +instruct vmls2I(vecD dst, vecD src1, vecD src2)
    +%{
    +  predicate(n->as_Vector()->length() == 2);
    +  match(Set dst (SubVI dst (MulVI src1 src2)));
    +  ins_cost(INSN_COST);
    +  format %{ "mlsv  $dst,$src1,$src2\t# vector (2S)" %}
    +  ins_encode %{
    +    __ mlsv(as_FloatRegister($dst$$reg), __ T2S,
    +            as_FloatRegister($src1$$reg),
    +            as_FloatRegister($src2$$reg));
    +  %}
    +  ins_pipe(pipe_class_default);
    +%}
    +
    +instruct vmls4I(vecX dst, vecX src1, vecX src2)
    +%{
    +  predicate(n->as_Vector()->length() == 4);
    +  match(Set dst (SubVI dst (MulVI src1 src2)));
    +  ins_cost(INSN_COST);
    +  format %{ "mlsv  $dst,$src1,$src2\t# vector (4S)" %}
    +  ins_encode %{
    +    __ mlsv(as_FloatRegister($dst$$reg), __ T4S,
    +            as_FloatRegister($src1$$reg),
    +            as_FloatRegister($src2$$reg));
    +  %}
    +  ins_pipe(pipe_class_default);
    +%}
    +
     // --------------------------------- DIV --------------------------------------
     
     instruct vdiv2F(vecD dst, vecD src1, vecD src2)
    diff --git a/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp
    index dcd99c341ce..76fdf876f90 100644
    --- a/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp
    +++ b/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp
    @@ -2041,6 +2041,8 @@ public:
       INSN(addv, 0, 0b100001);
       INSN(subv, 1, 0b100001);
       INSN(mulv, 0, 0b100111);
    +  INSN(mlav, 0, 0b100101);
    +  INSN(mlsv, 1, 0b100101);
       INSN(sshl, 0, 0b010001);
       INSN(ushl, 1, 0b010001);
     
    
    From 73acd1827545f9011b44b86ab69c56b7302b4d46 Mon Sep 17 00:00:00 2001
    From: Paul Sandoz 
    Date: Thu, 3 Dec 2015 11:18:34 +0100
    Subject: [PATCH 043/228] 8144223: Move j.l.invoke.{ForceInline, DontInline,
     Stable} to jdk.internal.vm.annotation package
    
    Reviewed-by: jrose, vlivanov, mchung, roland
    ---
     .../src/jdk/vm/ci/hotspot/Stable.java                |  2 +-
     hotspot/src/share/vm/classfile/classFileParser.cpp   |  6 +++---
     hotspot/src/share/vm/classfile/vmSymbols.hpp         |  6 +++---
     .../test/compiler/jsr292/NonInlinedCall/GCTest.java  |  3 +++
     .../compiler/jsr292/NonInlinedCall/InvokeTest.java   |  3 +++
     .../compiler/jsr292/NonInlinedCall/RedefineTest.java |  3 ++-
     hotspot/test/compiler/stable/TestStableBoolean.java  |  2 ++
     hotspot/test/compiler/stable/TestStableByte.java     |  2 ++
     hotspot/test/compiler/stable/TestStableChar.java     |  2 ++
     hotspot/test/compiler/stable/TestStableDouble.java   |  2 ++
     hotspot/test/compiler/stable/TestStableFloat.java    |  2 ++
     hotspot/test/compiler/stable/TestStableInt.java      |  2 ++
     hotspot/test/compiler/stable/TestStableLong.java     |  2 ++
     .../compiler/stable/TestStableMemoryBarrier.java     |  2 ++
     hotspot/test/compiler/stable/TestStableObject.java   |  2 ++
     hotspot/test/compiler/stable/TestStableShort.java    |  2 ++
     .../test/compiler/unsafe/UnsafeGetConstantField.java | 12 +++++++++---
     17 files changed, 44 insertions(+), 11 deletions(-)
    
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/Stable.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/Stable.java
    index e386dc0ca77..f313238bf41 100644
    --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/Stable.java
    +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/Stable.java
    @@ -29,7 +29,7 @@ import java.lang.annotation.RetentionPolicy;
     import java.lang.annotation.Target;
     
     /**
    - * This annotation functions as an alias for the java.lang.invoke.Stable annotation within JVMCI
    + * This annotation functions as an alias for the jdk.internal.vm.annotation.Stable annotation within JVMCI
      * code. It is specially recognized during class file parsing in the same way as that annotation.
      */
     @Target(ElementType.FIELD)
    diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp
    index aa788362bc7..184744e5481 100644
    --- a/hotspot/src/share/vm/classfile/classFileParser.cpp
    +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp
    @@ -1733,11 +1733,11 @@ ClassFileParser::AnnotationCollector::annotation_index(ClassLoaderData* loader_d
         if (_location != _in_method)  break;  // only allow for methods
         if (!privileged)              break;  // only allow in privileged code
         return _method_CallerSensitive;
    -  case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_ForceInline_signature):
    +  case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_ForceInline_signature):
         if (_location != _in_method)  break;  // only allow for methods
         if (!privileged)              break;  // only allow in privileged code
         return _method_ForceInline;
    -  case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_DontInline_signature):
    +  case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_DontInline_signature):
         if (_location != _in_method)  break;  // only allow for methods
         if (!privileged)              break;  // only allow in privileged code
         return _method_DontInline;
    @@ -1763,7 +1763,7 @@ ClassFileParser::AnnotationCollector::annotation_index(ClassLoaderData* loader_d
         if (!privileged)              break;  // only allow in privileged code
         return _field_Stable;
     #endif
    -  case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_Stable_signature):
    +  case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_Stable_signature):
         if (_location != _in_field)   break;  // only allow for fields
         if (!privileged)              break;  // only allow in privileged code
         return _field_Stable;
    diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp
    index e651ad00ed9..2c1f2572e85 100644
    --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp
    +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp
    @@ -268,6 +268,9 @@
                                                                                                       \
       /* Intrinsic Annotation (JDK 9 and above) */                                                    \
       template(jdk_internal_HotSpotIntrinsicCandidate_signature, "Ljdk/internal/HotSpotIntrinsicCandidate;") \
    +  template(jdk_internal_vm_annotation_ForceInline_signature, "Ljdk/internal/vm/annotation/ForceInline;") \
    +  template(jdk_internal_vm_annotation_DontInline_signature,  "Ljdk/internal/vm/annotation/DontInline;")  \
    +  template(jdk_internal_vm_annotation_Stable_signature,      "Ljdk/internal/vm/annotation/Stable;")      \
                                                                                                       \
       /* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */                                   \
       template(java_lang_invoke_CallSite,                 "java/lang/invoke/CallSite")                \
    @@ -286,10 +289,7 @@
       template(java_lang_invoke_MethodHandleNatives,      "java/lang/invoke/MethodHandleNatives")     \
       template(java_lang_invoke_MethodHandleNatives_CallSiteContext, "java/lang/invoke/MethodHandleNatives$CallSiteContext") \
       template(java_lang_invoke_LambdaForm,               "java/lang/invoke/LambdaForm")              \
    -  template(java_lang_invoke_ForceInline_signature,    "Ljava/lang/invoke/ForceInline;")           \
    -  template(java_lang_invoke_DontInline_signature,     "Ljava/lang/invoke/DontInline;")            \
       template(java_lang_invoke_InjectedProfile_signature, "Ljava/lang/invoke/InjectedProfile;")      \
    -  template(java_lang_invoke_Stable_signature,         "Ljava/lang/invoke/Stable;")                \
       template(java_lang_invoke_LambdaForm_Compiled_signature, "Ljava/lang/invoke/LambdaForm$Compiled;") \
       template(java_lang_invoke_LambdaForm_Hidden_signature, "Ljava/lang/invoke/LambdaForm$Hidden;")  \
       template(java_lang_invoke_MethodHandleNatives_CallSiteContext_signature, "Ljava/lang/invoke/MethodHandleNatives$CallSiteContext;") \
    diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java
    index 0a325734db4..8be925b00d6 100644
    --- a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java
    +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java
    @@ -41,6 +41,9 @@ package java.lang.invoke;
     
     import sun.hotspot.WhiteBox;
     
    +import jdk.internal.vm.annotation.DontInline;
    +import jdk.internal.vm.annotation.Stable;
    +
     import java.lang.ref.*;
     import static jdk.test.lib.Asserts.*;
     
    diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java
    index 687ef7242a7..8ab6031b575 100644
    --- a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java
    +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java
    @@ -43,6 +43,9 @@
     package java.lang.invoke;
     
     import sun.hotspot.WhiteBox;
    +
    +import jdk.internal.vm.annotation.DontInline;
    +
     import static jdk.test.lib.Asserts.*;
     
     public class InvokeTest {
    diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java
    index 54ce2221390..2da0f4bd70b 100644
    --- a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java
    +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java
    @@ -44,6 +44,7 @@ import sun.hotspot.WhiteBox;
     import sun.misc.Unsafe;
     
     import jdk.internal.org.objectweb.asm.*;
    +import jdk.internal.vm.annotation.DontInline;
     
     import java.lang.instrument.ClassDefinition;
     import java.lang.instrument.Instrumentation;
    @@ -73,7 +74,7 @@ public class RedefineTest {
             cw.visit(52, ACC_PUBLIC | ACC_SUPER, NAME, null, "java/lang/Object", null);
             {
                 mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "f", "()I", null, null);
    -            mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true);
    +            mv.visitAnnotation("Ljdk/internal/vm/annotation/DontInline;", true);
                 mv.visitCode();
                 mv.visitLdcInsn(r);
                 mv.visitInsn(IRETURN);
    diff --git a/hotspot/test/compiler/stable/TestStableBoolean.java b/hotspot/test/compiler/stable/TestStableBoolean.java
    index 767055752b1..168ddf48da7 100644
    --- a/hotspot/test/compiler/stable/TestStableBoolean.java
    +++ b/hotspot/test/compiler/stable/TestStableBoolean.java
    @@ -82,6 +82,8 @@
      */
     package java.lang.invoke;
     
    +import jdk.internal.vm.annotation.Stable;
    +
     import java.lang.reflect.InvocationTargetException;
     
     public class TestStableBoolean {
    diff --git a/hotspot/test/compiler/stable/TestStableByte.java b/hotspot/test/compiler/stable/TestStableByte.java
    index 9201cd09794..694205e8e55 100644
    --- a/hotspot/test/compiler/stable/TestStableByte.java
    +++ b/hotspot/test/compiler/stable/TestStableByte.java
    @@ -82,6 +82,8 @@
      */
     package java.lang.invoke;
     
    +import jdk.internal.vm.annotation.Stable;
    +
     import java.lang.reflect.InvocationTargetException;
     
     public class TestStableByte {
    diff --git a/hotspot/test/compiler/stable/TestStableChar.java b/hotspot/test/compiler/stable/TestStableChar.java
    index f1a2e9f5842..d92dfb67c73 100644
    --- a/hotspot/test/compiler/stable/TestStableChar.java
    +++ b/hotspot/test/compiler/stable/TestStableChar.java
    @@ -82,6 +82,8 @@
      */
     package java.lang.invoke;
     
    +import jdk.internal.vm.annotation.Stable;
    +
     import java.lang.reflect.InvocationTargetException;
     
     public class TestStableChar {
    diff --git a/hotspot/test/compiler/stable/TestStableDouble.java b/hotspot/test/compiler/stable/TestStableDouble.java
    index 54ff453cd66..5e55a0f8597 100644
    --- a/hotspot/test/compiler/stable/TestStableDouble.java
    +++ b/hotspot/test/compiler/stable/TestStableDouble.java
    @@ -82,6 +82,8 @@
      */
     package java.lang.invoke;
     
    +import jdk.internal.vm.annotation.Stable;
    +
     import java.lang.reflect.InvocationTargetException;
     
     public class TestStableDouble {
    diff --git a/hotspot/test/compiler/stable/TestStableFloat.java b/hotspot/test/compiler/stable/TestStableFloat.java
    index 00a90591092..04acead22ef 100644
    --- a/hotspot/test/compiler/stable/TestStableFloat.java
    +++ b/hotspot/test/compiler/stable/TestStableFloat.java
    @@ -82,6 +82,8 @@
      */
     package java.lang.invoke;
     
    +import jdk.internal.vm.annotation.Stable;
    +
     import java.lang.reflect.InvocationTargetException;
     
     public class TestStableFloat {
    diff --git a/hotspot/test/compiler/stable/TestStableInt.java b/hotspot/test/compiler/stable/TestStableInt.java
    index 5a052a15dec..2837bd3d1a5 100644
    --- a/hotspot/test/compiler/stable/TestStableInt.java
    +++ b/hotspot/test/compiler/stable/TestStableInt.java
    @@ -82,6 +82,8 @@
      */
     package java.lang.invoke;
     
    +import jdk.internal.vm.annotation.Stable;
    +
     import java.lang.reflect.InvocationTargetException;
     
     public class TestStableInt {
    diff --git a/hotspot/test/compiler/stable/TestStableLong.java b/hotspot/test/compiler/stable/TestStableLong.java
    index a859a6b20d7..b6c2fbb0be6 100644
    --- a/hotspot/test/compiler/stable/TestStableLong.java
    +++ b/hotspot/test/compiler/stable/TestStableLong.java
    @@ -82,6 +82,8 @@
      */
     package java.lang.invoke;
     
    +import jdk.internal.vm.annotation.Stable;
    +
     import java.lang.reflect.InvocationTargetException;
     
     public class TestStableLong {
    diff --git a/hotspot/test/compiler/stable/TestStableMemoryBarrier.java b/hotspot/test/compiler/stable/TestStableMemoryBarrier.java
    index 6a1e1f6d149..4d3a223463c 100644
    --- a/hotspot/test/compiler/stable/TestStableMemoryBarrier.java
    +++ b/hotspot/test/compiler/stable/TestStableMemoryBarrier.java
    @@ -36,6 +36,8 @@
      */
     package java.lang.invoke;
     
    +import jdk.internal.vm.annotation.Stable;
    +
     import java.lang.reflect.InvocationTargetException;
     
     public class TestStableMemoryBarrier {
    diff --git a/hotspot/test/compiler/stable/TestStableObject.java b/hotspot/test/compiler/stable/TestStableObject.java
    index 38b8c1ce9df..b61736b6e32 100644
    --- a/hotspot/test/compiler/stable/TestStableObject.java
    +++ b/hotspot/test/compiler/stable/TestStableObject.java
    @@ -83,6 +83,8 @@
      */
     package java.lang.invoke;
     
    +import jdk.internal.vm.annotation.Stable;
    +
     import java.lang.reflect.InvocationTargetException;
     
     public class TestStableObject {
    diff --git a/hotspot/test/compiler/stable/TestStableShort.java b/hotspot/test/compiler/stable/TestStableShort.java
    index 57e52cfa0d4..1b0f127785c 100644
    --- a/hotspot/test/compiler/stable/TestStableShort.java
    +++ b/hotspot/test/compiler/stable/TestStableShort.java
    @@ -82,6 +82,8 @@
      */
     package java.lang.invoke;
     
    +import jdk.internal.vm.annotation.Stable;
    +
     import java.lang.reflect.InvocationTargetException;
     
     public class TestStableShort {
    diff --git a/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java b/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java
    index bd2b28db674..8c144143d62 100644
    --- a/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java
    +++ b/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java
    @@ -40,10 +40,16 @@
      */
     package java.lang.invoke;
     
    -import jdk.internal.org.objectweb.asm.*;
    -import jdk.test.lib.Asserts;
    -import jdk.test.lib.Utils;
    +import jdk.internal.vm.annotation.DontInline;
    +import jdk.internal.vm.annotation.Stable;
     import jdk.internal.misc.Unsafe;
    +import jdk.internal.org.objectweb.asm.ClassWriter;
    +import jdk.internal.org.objectweb.asm.FieldVisitor;
    +import jdk.internal.org.objectweb.asm.MethodVisitor;
    +import jdk.internal.org.objectweb.asm.Opcodes;
    +import jdk.internal.org.objectweb.asm.Type;
    +import jdk.test.lib.Asserts;
    +
     import static jdk.internal.org.objectweb.asm.Opcodes.*;
     
     public class UnsafeGetConstantField {
    
    From c64b2175e7f4aac94f48bc8e26e9d8db73b9fc9b Mon Sep 17 00:00:00 2001
    From: Andreas Eriksson 
    Date: Fri, 4 Dec 2015 14:06:38 +0100
    Subject: [PATCH 044/228] 6869327: Add new C2 flag to keep safepoints in
     counted loops
    
    Reviewed-by: kvn, shade
    ---
     hotspot/src/share/vm/opto/c2_globals.hpp      |  3 +
     hotspot/src/share/vm/opto/loopnode.cpp        | 96 +++++++++++--------
     hotspot/src/share/vm/opto/loopnode.hpp        |  5 +-
     .../loopopts/UseCountedLoopSafepoints.java    | 68 +++++++++++++
     4 files changed, 129 insertions(+), 43 deletions(-)
     create mode 100644 hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java
    
    diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp
    index 0001104c001..6a08d42f052 100644
    --- a/hotspot/src/share/vm/opto/c2_globals.hpp
    +++ b/hotspot/src/share/vm/opto/c2_globals.hpp
    @@ -213,6 +213,9 @@
       notproduct(bool, TraceProfileTripCount, false,                            \
               "Trace profile loop trip count information")                      \
                                                                                 \
    +  product(bool, UseCountedLoopSafepoints, false,                            \
    +          "Force counted loops to keep a safepoint")                        \
    +                                                                            \
       product(bool, UseLoopPredicate, true,                                     \
               "Generate a predicate to select fast/slow loop versions")         \
                                                                                 \
    diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp
    index 953364397ab..db0b3c83c84 100644
    --- a/hotspot/src/share/vm/opto/loopnode.cpp
    +++ b/hotspot/src/share/vm/opto/loopnode.cpp
    @@ -690,14 +690,16 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) {
     
       } // LoopLimitCheck
     
    -  // Check for SafePoint on backedge and remove
    -  Node *sfpt = x->in(LoopNode::LoopBackControl);
    -  if (sfpt->Opcode() == Op_SafePoint && is_deleteable_safept(sfpt)) {
    -    lazy_replace( sfpt, iftrue );
    -    if (loop->_safepts != NULL) {
    -      loop->_safepts->yank(sfpt);
    +  if (!UseCountedLoopSafepoints) {
    +    // Check for SafePoint on backedge and remove
    +    Node *sfpt = x->in(LoopNode::LoopBackControl);
    +    if (sfpt->Opcode() == Op_SafePoint && is_deleteable_safept(sfpt)) {
    +      lazy_replace( sfpt, iftrue );
    +      if (loop->_safepts != NULL) {
    +        loop->_safepts->yank(sfpt);
    +      }
    +      loop->_tail = iftrue;
         }
    -    loop->_tail = iftrue;
       }
     
       // Build a canonical trip test.
    @@ -786,12 +788,14 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) {
       lazy_replace( x, l );
       set_idom(l, init_control, dom_depth(x));
     
    -  // Check for immediately preceding SafePoint and remove
    -  Node *sfpt2 = le->in(0);
    -  if (sfpt2->Opcode() == Op_SafePoint && is_deleteable_safept(sfpt2)) {
    -    lazy_replace( sfpt2, sfpt2->in(TypeFunc::Control));
    -    if (loop->_safepts != NULL) {
    -      loop->_safepts->yank(sfpt2);
    +  if (!UseCountedLoopSafepoints) {
    +    // Check for immediately preceding SafePoint and remove
    +    Node *sfpt2 = le->in(0);
    +    if (sfpt2->Opcode() == Op_SafePoint && is_deleteable_safept(sfpt2)) {
    +      lazy_replace( sfpt2, sfpt2->in(TypeFunc::Control));
    +      if (loop->_safepts != NULL) {
    +        loop->_safepts->yank(sfpt2);
    +      }
         }
       }
     
    @@ -1813,6 +1817,33 @@ void PhaseIdealLoop::replace_parallel_iv(IdealLoopTree *loop) {
       }
     }
     
    +void IdealLoopTree::remove_safepoints(PhaseIdealLoop* phase, bool keep_one) {
    +  // Look for a safepoint on the idom-path.
    +  Node* keep = NULL;
    +  if (keep_one) {
    +    // Keep one if possible
    +    for (Node* i = tail(); i != _head; i = phase->idom(i)) {
    +      if (i->Opcode() == Op_SafePoint && phase->get_loop(i) == this) {
    +        keep = i;
    +        break; // Found one
    +      }
    +    }
    +  }
    +
    +  // Delete other safepoints in this loop.
    +  Node_List* sfpts = _safepts;
    +  if (sfpts != NULL) {
    +    assert(keep == NULL || keep->Opcode() == Op_SafePoint, "not safepoint");
    +    for (uint i = 0; i < sfpts->size(); i++) {
    +      Node* n = sfpts->at(i);
    +      assert(phase->get_loop(n) == this, "");
    +      if (n != keep && phase->is_deleteable_safept(n)) {
    +        phase->lazy_replace(n, n->in(TypeFunc::Control));
    +      }
    +    }
    +  }
    +}
    +
     //------------------------------counted_loop-----------------------------------
     // Convert to counted loops where possible
     void IdealLoopTree::counted_loop( PhaseIdealLoop *phase ) {
    @@ -1824,42 +1855,23 @@ void IdealLoopTree::counted_loop( PhaseIdealLoop *phase ) {
     
       if (_head->is_CountedLoop() ||
           phase->is_counted_loop(_head, this)) {
    -    _has_sfpt = 1;              // Indicate we do not need a safepoint here
     
    -    // Look for safepoints to remove.
    -    Node_List* sfpts = _safepts;
    -    if (sfpts != NULL) {
    -      for (uint i = 0; i < sfpts->size(); i++) {
    -        Node* n = sfpts->at(i);
    -        assert(phase->get_loop(n) == this, "");
    -        if (phase->is_deleteable_safept(n)) {
    -          phase->lazy_replace(n, n->in(TypeFunc::Control));
    -        }
    -      }
    +    if (!UseCountedLoopSafepoints) {
    +      // Indicate we do not need a safepoint here
    +      _has_sfpt = 1;
         }
     
    +    // Remove safepoints
    +    bool keep_one_sfpt = !(_has_call || _has_sfpt);
    +    remove_safepoints(phase, keep_one_sfpt);
    +
         // Look for induction variables
         phase->replace_parallel_iv(this);
     
       } else if (_parent != NULL && !_irreducible) {
    -    // Not a counted loop.
    -    // Look for a safepoint on the idom-path.
    -    Node* sfpt = tail();
    -    for (; sfpt != _head; sfpt = phase->idom(sfpt)) {
    -      if (sfpt->Opcode() == Op_SafePoint && phase->get_loop(sfpt) == this)
    -        break; // Found one
    -    }
    -    // Delete other safepoints in this loop.
    -    Node_List* sfpts = _safepts;
    -    if (sfpts != NULL && sfpt != _head && sfpt->Opcode() == Op_SafePoint) {
    -      for (uint i = 0; i < sfpts->size(); i++) {
    -        Node* n = sfpts->at(i);
    -        assert(phase->get_loop(n) == this, "");
    -        if (n != sfpt && phase->is_deleteable_safept(n)) {
    -          phase->lazy_replace(n, n->in(TypeFunc::Control));
    -        }
    -      }
    -    }
    +    // Not a counted loop. Keep one safepoint.
    +    bool keep_one_sfpt = true;
    +    remove_safepoints(phase, keep_one_sfpt);
       }
     
       // Recursively
    diff --git a/hotspot/src/share/vm/opto/loopnode.hpp b/hotspot/src/share/vm/opto/loopnode.hpp
    index fd736bbf426..59cfc690c7e 100644
    --- a/hotspot/src/share/vm/opto/loopnode.hpp
    +++ b/hotspot/src/share/vm/opto/loopnode.hpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1998, 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
    @@ -429,6 +429,9 @@ public:
       // encountered.
       void allpaths_check_safepts(VectorSet &visited, Node_List &stack);
     
    +  // Remove safepoints from loop. Optionally keeping one.
    +  void remove_safepoints(PhaseIdealLoop* phase, bool keep_one);
    +
       // Convert to counted loops where possible
       void counted_loop( PhaseIdealLoop *phase );
     
    diff --git a/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java b/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java
    new file mode 100644
    index 00000000000..c769b5b5aba
    --- /dev/null
    +++ b/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java
    @@ -0,0 +1,68 @@
    +/*
    + * 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 6869327
    + * @summary Test that C2 flag UseCountedLoopSafepoints ensures a safepoint is kept in a CountedLoop
    + * @library /testlibrary
    + * @modules java.base
    + * @run main UseCountedLoopSafepoints
    + */
    +
    +import java.util.concurrent.atomic.AtomicLong;
    +import jdk.test.lib.ProcessTools;
    +import jdk.test.lib.OutputAnalyzer;
    +
    +public class UseCountedLoopSafepoints {
    +    private static final AtomicLong _num = new AtomicLong(0);
    +
    +    // Uses the fact that an EnableBiasedLocking vmop will be started
    +    // after 500ms, while we are still in the loop. If there is a
    +    // safepoint in the counted loop, then we will reach safepoint
    +    // very quickly. Otherwise SafepointTimeout will be hit.
    +    public static void main (String args[]) throws Exception {
    +        if (args.length == 1) {
    +            final int loops = Integer.parseInt(args[0]);
    +            for (int i = 0; i < loops; i++) {
    +                _num.addAndGet(1);
    +            }
    +        } else {
    +            ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
    +                    "-XX:+IgnoreUnrecognizedVMOptions",
    +                    "-XX:-TieredCompilation",
    +                    "-XX:+UseBiasedLocking",
    +                    "-XX:BiasedLockingStartupDelay=500",
    +                    "-XX:+SafepointTimeout",
    +                    "-XX:SafepointTimeoutDelay=2000",
    +                    "-XX:+UseCountedLoopSafepoints",
    +                    "UseCountedLoopSafepoints",
    +                    "2000000000"
    +                    );
    +            OutputAnalyzer output = new OutputAnalyzer(pb.start());
    +            output.shouldNotContain("Timeout detected");
    +            output.shouldHaveExitValue(0);
    +        }
    +    }
    +}
    
    From 0fba365de2b950d02c586068f86d12509cede415 Mon Sep 17 00:00:00 2001
    From: Martin Doerr 
    Date: Fri, 4 Dec 2015 16:23:39 +0100
    Subject: [PATCH 045/228] 8136445: Performance issue with Nashorn and C2's
     global code motion
    
    Reviewed-by: kvn
    ---
     hotspot/src/share/vm/opto/block.hpp |  6 +--
     hotspot/src/share/vm/opto/gcm.cpp   | 63 +++++++++++++++++------------
     2 files changed, 41 insertions(+), 28 deletions(-)
    
    diff --git a/hotspot/src/share/vm/opto/block.hpp b/hotspot/src/share/vm/opto/block.hpp
    index ad30a167130..d84529deb88 100644
    --- a/hotspot/src/share/vm/opto/block.hpp
    +++ b/hotspot/src/share/vm/opto/block.hpp
    @@ -419,12 +419,12 @@ class PhaseCFG : public Phase {
       void global_code_motion();
     
       // Schedule Nodes early in their basic blocks.
    -  bool schedule_early(VectorSet &visited, Node_List &roots);
    +  bool schedule_early(VectorSet &visited, Node_Stack &roots);
     
       // For each node, find the latest block it can be scheduled into
       // and then select the cheapest block between the latest and earliest
       // block to place the node.
    -  void schedule_late(VectorSet &visited, Node_List &stack);
    +  void schedule_late(VectorSet &visited, Node_Stack &stack);
     
       // Compute the (backwards) latency of a node from a single use
       int latency_from_use(Node *n, const Node *def, Node *use);
    @@ -433,7 +433,7 @@ class PhaseCFG : public Phase {
       void partial_latency_of_defs(Node *n);
     
       // Compute the instruction global latency with a backwards walk
    -  void compute_latencies_backwards(VectorSet &visited, Node_List &stack);
    +  void compute_latencies_backwards(VectorSet &visited, Node_Stack &stack);
     
       // Pick a block between early and late that is a cheaper alternative
       // to late. Helper for schedule_late.
    diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp
    index 70c17ad8b1c..833be199daa 100644
    --- a/hotspot/src/share/vm/opto/gcm.cpp
    +++ b/hotspot/src/share/vm/opto/gcm.cpp
    @@ -228,18 +228,19 @@ static Block* find_deepest_input(Node* n, const PhaseCFG* cfg) {
     // Find the earliest Block any instruction can be placed in.  Some instructions
     // are pinned into Blocks.  Unpinned instructions can appear in last block in
     // which all their inputs occur.
    -bool PhaseCFG::schedule_early(VectorSet &visited, Node_List &roots) {
    +bool PhaseCFG::schedule_early(VectorSet &visited, Node_Stack &roots) {
       // Allocate stack with enough space to avoid frequent realloc
    -  Node_Stack nstack(roots.Size() + 8);
    +  Node_Stack nstack(roots.size() + 8);
       // _root will be processed among C->top() inputs
    -  roots.push(C->top());
    +  roots.push(C->top(), 0);
       visited.set(C->top()->_idx);
     
       while (roots.size() != 0) {
         // Use local variables nstack_top_n & nstack_top_i to cache values
         // on stack's top.
    -    Node* parent_node = roots.pop();
    +    Node* parent_node = roots.node();
         uint  input_index = 0;
    +    roots.pop();
     
         while (true) {
           if (input_index == 0) {
    @@ -286,7 +287,7 @@ bool PhaseCFG::schedule_early(VectorSet &visited, Node_List &roots) {
               break;
             } else if (!is_visited) {
               // Visit this guy later, using worklist
    -          roots.push(in);
    +          roots.push(in, 0);
             }
           }
     
    @@ -791,23 +792,23 @@ private:
     
     public:
       // Constructor for the iterator
    -  Node_Backward_Iterator(Node *root, VectorSet &visited, Node_List &stack, PhaseCFG &cfg);
    +  Node_Backward_Iterator(Node *root, VectorSet &visited, Node_Stack &stack, PhaseCFG &cfg);
     
       // Postincrement operator to iterate over the nodes
       Node *next();
     
     private:
       VectorSet   &_visited;
    -  Node_List   &_stack;
    +  Node_Stack  &_stack;
       PhaseCFG &_cfg;
     };
     
     // Constructor for the Node_Backward_Iterator
    -Node_Backward_Iterator::Node_Backward_Iterator( Node *root, VectorSet &visited, Node_List &stack, PhaseCFG &cfg)
    +Node_Backward_Iterator::Node_Backward_Iterator( Node *root, VectorSet &visited, Node_Stack &stack, PhaseCFG &cfg)
       : _visited(visited), _stack(stack), _cfg(cfg) {
       // The stack should contain exactly the root
       stack.clear();
    -  stack.push(root);
    +  stack.push(root, root->outcnt());
     
       // Clear the visited bits
       visited.Clear();
    @@ -820,12 +821,14 @@ Node *Node_Backward_Iterator::next() {
       if ( !_stack.size() )
         return NULL;
     
    -  // '_stack' is emulating a real _stack.  The 'visit-all-users' loop has been
    -  // made stateless, so I do not need to record the index 'i' on my _stack.
    -  // Instead I visit all users each time, scanning for unvisited users.
       // I visit unvisited not-anti-dependence users first, then anti-dependent
    -  // children next.
    -  Node *self = _stack.pop();
    +  // children next. I iterate backwards to support removal of nodes.
    +  // The stack holds states consisting of 3 values:
    +  // current Def node, flag which indicates 1st/2nd pass, index of current out edge
    +  Node *self = (Node*)(((uintptr_t)_stack.node()) & ~1);
    +  bool iterate_anti_dep = (((uintptr_t)_stack.node()) & 1);
    +  uint idx = MIN2(_stack.index(), self->outcnt()); // Support removal of nodes.
    +  _stack.pop();
     
       // I cycle here when I am entering a deeper level of recursion.
       // The key variable 'self' was set prior to jumping here.
    @@ -841,9 +844,9 @@ Node *Node_Backward_Iterator::next() {
         Node *unvisited = NULL;  // Unvisited anti-dependent Node, if any
     
         // Scan for unvisited nodes
    -    for (DUIterator_Fast imax, i = self->fast_outs(imax); i < imax; i++) {
    +    while (idx > 0) {
           // For all uses, schedule late
    -      Node* n = self->fast_out(i); // Use
    +      Node* n = self->raw_out(--idx); // Use
     
           // Skip already visited children
           if ( _visited.test(n->_idx) )
    @@ -863,19 +866,31 @@ Node *Node_Backward_Iterator::next() {
           unvisited = n;      // Found unvisited
     
           // Check for possible-anti-dependent
    -      if( !n->needs_anti_dependence_check() )
    -        break;            // Not visited, not anti-dep; schedule it NOW
    +      // 1st pass: No such nodes, 2nd pass: Only such nodes.
    +      if (n->needs_anti_dependence_check() == iterate_anti_dep) {
    +        unvisited = n;      // Found unvisited
    +        break;
    +      }
         }
     
         // Did I find an unvisited not-anti-dependent Node?
    -    if ( !unvisited )
    +    if (!unvisited) {
    +      if (!iterate_anti_dep) {
    +        // 2nd pass: Iterate over nodes which needs_anti_dependence_check.
    +        iterate_anti_dep = true;
    +        idx = self->outcnt();
    +        continue;
    +      }
           break;                  // All done with children; post-visit 'self'
    +    }
     
         // Visit the unvisited Node.  Contains the obvious push to
         // indicate I'm entering a deeper level of recursion.  I push the
         // old state onto the _stack and set a new state and loop (recurse).
    -    _stack.push(self);
    +    _stack.push((Node*)((uintptr_t)self | (uintptr_t)iterate_anti_dep), idx);
         self = unvisited;
    +    iterate_anti_dep = false;
    +    idx = self->outcnt();
       } // End recursion loop
     
       return self;
    @@ -883,7 +898,7 @@ Node *Node_Backward_Iterator::next() {
     
     //------------------------------ComputeLatenciesBackwards----------------------
     // Compute the latency of all the instructions.
    -void PhaseCFG::compute_latencies_backwards(VectorSet &visited, Node_List &stack) {
    +void PhaseCFG::compute_latencies_backwards(VectorSet &visited, Node_Stack &stack) {
     #ifndef PRODUCT
       if (trace_opto_pipelining())
         tty->print("\n#---- ComputeLatenciesBackwards ----\n");
    @@ -1157,7 +1172,7 @@ Block* PhaseCFG::hoist_to_cheaper_block(Block* LCA, Block* early, Node* self) {
     // dominator tree of all USES of a value.  Pick the block with the least
     // loop nesting depth that is lowest in the dominator tree.
     extern const char must_clone[];
    -void PhaseCFG::schedule_late(VectorSet &visited, Node_List &stack) {
    +void PhaseCFG::schedule_late(VectorSet &visited, Node_Stack &stack) {
     #ifndef PRODUCT
       if (trace_opto_pipelining())
         tty->print("\n#---- schedule_late ----\n");
    @@ -1313,9 +1328,7 @@ void PhaseCFG::global_code_motion() {
       // instructions are pinned into Blocks.  Unpinned instructions can
       // appear in last block in which all their inputs occur.
       visited.Clear();
    -  Node_List stack(arena);
    -  // Pre-grow the list
    -  stack.map((C->live_nodes() >> 1) + 16, NULL);
    +  Node_Stack stack(arena, (C->live_nodes() >> 2) + 16); // pre-grow
       if (!schedule_early(visited, stack)) {
         // Bailout without retry
         C->record_method_not_compilable("early schedule failed");
    
    From 8c5da27f19d26be9b4f727c7ff4a17f99a25a520 Mon Sep 17 00:00:00 2001
    From: Martin Doerr 
    Date: Fri, 4 Dec 2015 16:38:04 +0100
    Subject: [PATCH 046/228] 8144019: PPC64 C1: Introduce Client Compiler
    
    Reviewed-by: goetz
    ---
     hotspot/make/aix/Makefile                     |    6 +-
     hotspot/make/aix/makefiles/fastdebug.make     |    2 +-
     hotspot/make/aix/makefiles/tiered.make        |   32 +
     hotspot/make/linux/Makefile                   |    8 -
     hotspot/src/cpu/ppc/vm/assembler_ppc.cpp      |    5 +-
     hotspot/src/cpu/ppc/vm/assembler_ppc.hpp      |   68 +-
     .../src/cpu/ppc/vm/assembler_ppc.inline.hpp   |   10 +-
     hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp   |  527 +++
     hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp        |   76 +
     hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp |   32 +
     hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp    |  394 +++
     hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp    |  202 ++
     .../src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp    | 3133 +++++++++++++++++
     .../src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp    |   69 +
     .../src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp    | 1429 ++++++++
     hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp  |   34 +
     hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp  |   73 +
     .../src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp  |  486 +++
     .../src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp  |   93 +
     hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp    | 1020 ++++++
     hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp     |   68 +
     hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp     |    2 +-
     hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp        |    8 +-
     hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp     |   15 +-
     hotspot/src/cpu/ppc/vm/frame_ppc.cpp          |   37 +-
     hotspot/src/cpu/ppc/vm/frame_ppc.hpp          |    5 +-
     hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp   |    3 -
     .../src/cpu/ppc/vm/globalDefinitions_ppc.hpp  |    3 +
     hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp |   59 +-
     hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp |    4 +-
     hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp |  393 ++-
     hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp |   47 +-
     .../cpu/ppc/vm/macroAssembler_ppc.inline.hpp  |   48 +-
     hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp  |    7 +-
     hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp     |   55 +-
     hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp     |  123 +-
     hotspot/src/cpu/ppc/vm/ppc.ad                 |  194 +-
     hotspot/src/cpu/ppc/vm/register_ppc.hpp       |    6 +
     hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp      |    4 +-
     hotspot/src/cpu/ppc/vm/runtime_ppc.cpp        |   40 +-
     hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp  |   72 +-
     hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp  |  624 +++-
     .../src/cpu/ppc/vm/stubRoutines_ppc_64.cpp    |    2 +-
     .../cpu/ppc/vm/templateInterpreter_ppc.cpp    |   26 +-
     .../cpu/ppc/vm/templateInterpreter_ppc.hpp    |    2 -
     .../src/cpu/ppc/vm/templateTable_ppc_64.cpp   |   32 +-
     hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp     |   40 +-
     hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp     |    3 -
     hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp |   20 +-
     hotspot/src/os/aix/vm/c1_globals_aix.hpp      |   37 +
     50 files changed, 9055 insertions(+), 623 deletions(-)
     create mode 100644 hotspot/make/aix/makefiles/tiered.make
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp
     create mode 100644 hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp
     create mode 100644 hotspot/src/os/aix/vm/c1_globals_aix.hpp
    
    diff --git a/hotspot/make/aix/Makefile b/hotspot/make/aix/Makefile
    index 4e0db05251c..77e54d08dc0 100644
    --- a/hotspot/make/aix/Makefile
    +++ b/hotspot/make/aix/Makefile
    @@ -1,6 +1,6 @@
     #
     # Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
    -# Copyright 2012, 2013 SAP AG. All rights reserved.
    +# Copyright 2012, 2015 SAP AG. 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
    @@ -61,10 +61,6 @@ ifndef CC_INTERP
         FORCE_TIERED=1
       endif
     endif
    -# C1 is not ported on ppc64(le), so we cannot build a tiered VM:
    -ifneq (,$(filter $(ARCH),ppc64 pp64le))
    -  FORCE_TIERED=0
    -endif
     
     ifdef LP64
       ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
    diff --git a/hotspot/make/aix/makefiles/fastdebug.make b/hotspot/make/aix/makefiles/fastdebug.make
    index 33bf50940b9..d7feb025617 100644
    --- a/hotspot/make/aix/makefiles/fastdebug.make
    +++ b/hotspot/make/aix/makefiles/fastdebug.make
    @@ -68,5 +68,5 @@ MAPFILE = $(GAMMADIR)/make/aix/makefiles/mapfile-vers-debug
     LFLAGS_QIPA=
     
     VERSION = optimized
    -SYSDEFS += -DASSERT -DFASTDEBUG
    +SYSDEFS += -DASSERT
     PICFLAGS = DEFAULT
    diff --git a/hotspot/make/aix/makefiles/tiered.make b/hotspot/make/aix/makefiles/tiered.make
    new file mode 100644
    index 00000000000..992d59d5241
    --- /dev/null
    +++ b/hotspot/make/aix/makefiles/tiered.make
    @@ -0,0 +1,32 @@
    +#
    +# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
    +# Copyright 2012, 2015 SAP AG. 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.
    +#
    +#
    +
    +# Sets make macros for making tiered version of VM
    +
    +TYPE=TIERED
    +
    +VM_SUBDIR = server
    +
    +CFLAGS += -DCOMPILER2 -DCOMPILER1
    diff --git a/hotspot/make/linux/Makefile b/hotspot/make/linux/Makefile
    index 52aa0305f7a..dba28625eec 100644
    --- a/hotspot/make/linux/Makefile
    +++ b/hotspot/make/linux/Makefile
    @@ -57,14 +57,6 @@ ifndef CC_INTERP
         FORCE_TIERED=1
       endif
     endif
    -# C1 is not ported on ppc64, so we cannot build a tiered VM:
    -# Notice: after 8046471 ARCH will be 'ppc' for top-level ppc64 builds but
    -# 'ppc64' for HotSpot-only ppc64 builds. Need to detect both variants here!
    -ifneq (,$(findstring $(ARCH), ppc ppc64))
    -  ifeq ($(ARCH_DATA_MODEL), 64)
    -    FORCE_TIERED=0
    -  endif
    -endif
     
     ifdef LP64
       ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
    diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp
    index 56564ac7ea7..66e4f08c3d4 100644
    --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp
    @@ -53,9 +53,6 @@ int AbstractAssembler::code_fill_byte() {
       return 0x00;                  // illegal instruction 0x00000000
     }
     
    -void Assembler::print_instruction(int inst) {
    -  Unimplemented();
    -}
     
     // Patch instruction `inst' at offset `inst_pos' to refer to
     // `dest_pos' and return the resulting instruction.  We should have
    @@ -484,7 +481,7 @@ int Assembler::add_const_optimized(Register d, Register s, long x, Register tmp,
           if (d != s) { mr(d, s); }
           return 0;
         }
    -    if (return_simm16_rest) {
    +    if (return_simm16_rest && (d == s)) {
           return xd;
         }
         addi(d, s, xd);
    diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp
    index 6c7103aefa4..41cb7a16316 100644
    --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp
    @@ -31,10 +31,37 @@
     // Address is an abstraction used to represent a memory location
     // as used in assembler instructions.
     // PPC instructions grok either baseReg + indexReg or baseReg + disp.
    -// So far we do not use this as simplification by this class is low
    -// on PPC with its simple addressing mode. Use RegisterOrConstant to
    -// represent an offset.
     class Address VALUE_OBJ_CLASS_SPEC {
    + private:
    +  Register _base;         // Base register.
    +  Register _index;        // Index register.
    +  intptr_t _disp;         // Displacement.
    +
    + public:
    +  Address(Register b, Register i, address d = 0)
    +    : _base(b), _index(i), _disp((intptr_t)d) {
    +    assert(i == noreg || d == 0, "can't have both");
    +  }
    +
    +  Address(Register b, address d = 0)
    +    : _base(b), _index(noreg), _disp((intptr_t)d) {}
    +
    +  Address(Register b, intptr_t d)
    +    : _base(b), _index(noreg), _disp(d) {}
    +
    +  Address(Register b, RegisterOrConstant roc)
    +    : _base(b), _index(noreg), _disp(0) {
    +    if (roc.is_constant()) _disp = roc.as_constant(); else _index = roc.as_register();
    +  }
    +
    +  Address()
    +    : _base(noreg), _index(noreg), _disp(0) {}
    +
    +  // accessors
    +  Register base()  const { return _base; }
    +  Register index() const { return _index; }
    +  int      disp()  const { return (int)_disp; }
    +  bool     is_const() const { return _base == noreg && _index == noreg; }
     };
     
     class AddressLiteral VALUE_OBJ_CLASS_SPEC {
    @@ -164,10 +191,14 @@ struct FunctionDescriptor VALUE_OBJ_CLASS_SPEC {
     };
     #endif
     
    +
    +// The PPC Assembler: Pure assembler doing NO optimizations on the
    +// instruction level; i.e., what you write is what you get. The
    +// Assembler is generating code into a CodeBuffer.
    +
     class Assembler : public AbstractAssembler {
      protected:
       // Displacement routines
    -  static void print_instruction(int inst);
       static int  patched_branch(int dest_pos, int inst, int inst_pos);
       static int  branch_destination(int inst, int pos);
     
    @@ -839,41 +870,38 @@ class Assembler : public AbstractAssembler {
     
       enum Predict { pt = 1, pn = 0 }; // pt = predict taken
     
    -  // instruction must start at passed address
    +  // Instruction must start at passed address.
       static int instr_len(unsigned char *instr) { return BytesPerInstWord; }
     
    -  // instruction must be left-justified in argument
    -  static int instr_len(unsigned long instr)  { return BytesPerInstWord; }
    -
       // longest instructions
       static int instr_maxlen() { return BytesPerInstWord; }
     
       // Test if x is within signed immediate range for nbits.
       static bool is_simm(int x, unsigned int nbits) {
         assert(0 < nbits && nbits < 32, "out of bounds");
    -    const int   min      = -( ((int)1) << nbits-1 );
    -    const int   maxplus1 =  ( ((int)1) << nbits-1 );
    +    const int   min      = -(((int)1) << nbits-1);
    +    const int   maxplus1 =  (((int)1) << nbits-1);
         return min <= x && x < maxplus1;
       }
     
       static bool is_simm(jlong x, unsigned int nbits) {
         assert(0 < nbits && nbits < 64, "out of bounds");
    -    const jlong min      = -( ((jlong)1) << nbits-1 );
    -    const jlong maxplus1 =  ( ((jlong)1) << nbits-1 );
    +    const jlong min      = -(((jlong)1) << nbits-1);
    +    const jlong maxplus1 =  (((jlong)1) << nbits-1);
         return min <= x && x < maxplus1;
       }
     
    -  // Test if x is within unsigned immediate range for nbits
    +  // Test if x is within unsigned immediate range for nbits.
       static bool is_uimm(int x, unsigned int nbits) {
         assert(0 < nbits && nbits < 32, "out of bounds");
    -    const int   maxplus1 = ( ((int)1) << nbits );
    -    return 0 <= x && x < maxplus1;
    +    const unsigned int maxplus1 = (((unsigned int)1) << nbits);
    +    return (unsigned int)x < maxplus1;
       }
     
       static bool is_uimm(jlong x, unsigned int nbits) {
         assert(0 < nbits && nbits < 64, "out of bounds");
    -    const jlong maxplus1 =  ( ((jlong)1) << nbits );
    -    return 0 <= x && x < maxplus1;
    +    const julong maxplus1 = (((julong)1) << nbits);
    +    return (julong)x < maxplus1;
       }
     
      protected:
    @@ -1376,8 +1404,11 @@ class Assembler : public AbstractAssembler {
       inline void orc(    Register a, Register s, Register b);
       inline void orc_(   Register a, Register s, Register b);
       inline void extsb(  Register a, Register s);
    +  inline void extsb_( Register a, Register s);
       inline void extsh(  Register a, Register s);
    +  inline void extsh_( Register a, Register s);
       inline void extsw(  Register a, Register s);
    +  inline void extsw_( Register a, Register s);
     
       // extended mnemonics
       inline void nop();
    @@ -1767,6 +1798,8 @@ class Assembler : public AbstractAssembler {
       inline void smt_yield();
       inline void smt_mdoio();
       inline void smt_mdoom();
    +  // >= Power8
    +  inline void smt_miso();
     
       // trap instructions
       inline void twi_0(Register a); // for load with acquire semantics use load+twi_0+isync (trap can't occur)
    @@ -2168,6 +2201,7 @@ class Assembler : public AbstractAssembler {
       inline void load_const(Register d, void* a,           Register tmp = noreg);
       inline void load_const(Register d, Label& L,          Register tmp = noreg);
       inline void load_const(Register d, AddressLiteral& a, Register tmp = noreg);
    +  inline void load_const32(Register d, int i); // load signed int (patchable)
     
       // Load a 64 bit constant, optimized, not identifyable.
       // Tmp can be used to increase ILP. Set return_simm16_rest = true to get a
    diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp
    index e860dac7d43..2a4b03f760b 100644
    --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp
    +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp
    @@ -206,8 +206,11 @@ inline void Assembler::andc_(   Register a, Register s, Register b)    { emit_in
     inline void Assembler::orc(     Register a, Register s, Register b)    { emit_int32(ORC_OPCODE     | rta(a) | rs(s) | rb(b) | rc(0)); }
     inline void Assembler::orc_(    Register a, Register s, Register b)    { emit_int32(ORC_OPCODE     | rta(a) | rs(s) | rb(b) | rc(1)); }
     inline void Assembler::extsb(   Register a, Register s)                { emit_int32(EXTSB_OPCODE   | rta(a) | rs(s) | rc(0)); }
    +inline void Assembler::extsb_(  Register a, Register s)                { emit_int32(EXTSB_OPCODE   | rta(a) | rs(s) | rc(1)); }
     inline void Assembler::extsh(   Register a, Register s)                { emit_int32(EXTSH_OPCODE   | rta(a) | rs(s) | rc(0)); }
    +inline void Assembler::extsh_(  Register a, Register s)                { emit_int32(EXTSH_OPCODE   | rta(a) | rs(s) | rc(1)); }
     inline void Assembler::extsw(   Register a, Register s)                { emit_int32(EXTSW_OPCODE   | rta(a) | rs(s) | rc(0)); }
    +inline void Assembler::extsw_(  Register a, Register s)                { emit_int32(EXTSW_OPCODE   | rta(a) | rs(s) | rc(1)); }
     
     // extended mnemonics
     inline void Assembler::nop()                              { Assembler::ori(R0, R0, 0); }
    @@ -609,6 +612,8 @@ inline void Assembler::smt_prio_high()        { Assembler::or_unchecked(R3,  R3,
     inline void Assembler::smt_yield()            { Assembler::or_unchecked(R27, R27, R27); }
     inline void Assembler::smt_mdoio()            { Assembler::or_unchecked(R29, R29, R29); }
     inline void Assembler::smt_mdoom()            { Assembler::or_unchecked(R30, R30, R30); }
    +// >= Power8
    +inline void Assembler::smt_miso()             { Assembler::or_unchecked(R26, R26, R26); }
     
     inline void Assembler::twi_0(Register a)      { twi_unchecked(0, a, 0);}
     
    @@ -967,12 +972,15 @@ inline void Assembler::load_const(Register d, Label& L, Register tmp) {
     
     // Load a 64 bit constant encoded by an AddressLiteral. patchable.
     inline void Assembler::load_const(Register d, AddressLiteral& a, Register tmp) {
    -  assert(d != R0, "R0 not allowed");
       // First relocate (we don't change the offset in the RelocationHolder,
       // just pass a.rspec()), then delegate to load_const(Register, long).
       relocate(a.rspec());
       load_const(d, (long)a.value(), tmp);
     }
     
    +inline void Assembler::load_const32(Register d, int i) {
    +  lis(d, i >> 16);
    +  ori(d, d, i & 0xFFFF);
    +}
     
     #endif // CPU_PPC_VM_ASSEMBLER_PPC_INLINE_HPP
    diff --git a/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp
    new file mode 100644
    index 00000000000..a19c7b7de11
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp
    @@ -0,0 +1,527 @@
    +/*
    + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#include "precompiled.hpp"
    +#include "c1/c1_CodeStubs.hpp"
    +#include "c1/c1_FrameMap.hpp"
    +#include "c1/c1_LIRAssembler.hpp"
    +#include "c1/c1_MacroAssembler.hpp"
    +#include "c1/c1_Runtime1.hpp"
    +#include "nativeInst_ppc.hpp"
    +#include "runtime/sharedRuntime.hpp"
    +#include "utilities/macros.hpp"
    +#include "vmreg_ppc.inline.hpp"
    +#if INCLUDE_ALL_GCS
    +#include "gc/g1/g1SATBCardTableModRefBS.hpp"
    +#endif // INCLUDE_ALL_GCS
    +
    +#define __ ce->masm()->
    +
    +
    +RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
    +                               bool throw_index_out_of_bounds_exception)
    +  : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception)
    +  , _index(index) {
    +  assert(info != NULL, "must have info");
    +  _info = new CodeEmitInfo(info);
    +}
    +
    +void RangeCheckStub::emit_code(LIR_Assembler* ce) {
    +  __ bind(_entry);
    +
    +  if (_info->deoptimize_on_exception()) {
    +    address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
    +    // May be used by optimizations like LoopInvariantCodeMotion or RangeCheckEliminator.
    +    DEBUG_ONLY( __ untested("RangeCheckStub: predicate_failed_trap_id"); )
    +    //__ load_const_optimized(R0, a);
    +    __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a));
    +    __ mtctr(R0);
    +    __ bctrl();
    +    ce->add_call_info_here(_info);
    +    ce->verify_oop_map(_info);
    +    debug_only(__ illtrap());
    +    return;
    +  }
    +
    +  address stub = _throw_index_out_of_bounds_exception ? Runtime1::entry_for(Runtime1::throw_index_exception_id)
    +                                                      : Runtime1::entry_for(Runtime1::throw_range_check_failed_id);
    +  //__ load_const_optimized(R0, stub);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
    +  __ mtctr(R0);
    +
    +  Register index = R0; // pass in R0
    +  if (_index->is_register()) {
    +    __ extsw(index, _index->as_register());
    +  } else {
    +    __ load_const_optimized(index, _index->as_jint());
    +  }
    +
    +  __ bctrl();
    +  ce->add_call_info_here(_info);
    +  ce->verify_oop_map(_info);
    +  debug_only(__ illtrap());
    +}
    +
    +
    +PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
    +  _info = new CodeEmitInfo(info);
    +}
    +
    +void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
    +  __ bind(_entry);
    +  address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
    +  //__ load_const_optimized(R0, a);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a));
    +  __ mtctr(R0);
    +  __ bctrl();
    +  ce->add_call_info_here(_info);
    +  ce->verify_oop_map(_info);
    +  debug_only(__ illtrap());
    +}
    +
    +
    +void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
    +  __ bind(_entry);
    +
    +  // Parameter 1: bci
    +  __ load_const_optimized(R0, _bci);
    +  __ std(R0, -16, R1_SP);
    +
    +  // Parameter 2: Method*
    +  Metadata *m = _method->as_constant_ptr()->as_metadata();
    +  AddressLiteral md = __ constant_metadata_address(m); // Notify OOP recorder (don't need the relocation).
    +  __ load_const_optimized(R0, md.value());
    +  __ std(R0, -8, R1_SP);
    +
    +  address a = Runtime1::entry_for(Runtime1::counter_overflow_id);
    +  //__ load_const_optimized(R0, a);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a));
    +  __ mtctr(R0);
    +  __ bctrl();
    +  ce->add_call_info_here(_info);
    +  ce->verify_oop_map(_info);
    +
    +  __ b(_continuation);
    +}
    +
    +
    +void DivByZeroStub::emit_code(LIR_Assembler* ce) {
    +  if (_offset != -1) {
    +    ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
    +  }
    +  __ bind(_entry);
    +  address stub = Runtime1::entry_for(Runtime1::throw_div0_exception_id);
    +  //__ load_const_optimized(R0, stub);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
    +  __ mtctr(R0);
    +  __ bctrl();
    +  ce->add_call_info_here(_info);
    +  ce->verify_oop_map(_info);
    +  debug_only(__ illtrap());
    +}
    +
    +
    +void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) {
    +  address a;
    +  if (_info->deoptimize_on_exception()) {
    +    // Deoptimize, do not throw the exception, because it is probably wrong to do it here.
    +    a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
    +  } else {
    +    a = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id);
    +  }
    +
    +  if (ImplicitNullChecks || TrapBasedNullChecks) {
    +    ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
    +  }
    +  __ bind(_entry);
    +  //__ load_const_optimized(R0, a);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a));
    +  __ mtctr(R0);
    +  __ bctrl();
    +  ce->add_call_info_here(_info);
    +  ce->verify_oop_map(_info);
    +  debug_only(__ illtrap());
    +}
    +
    +
    +// Implementation of SimpleExceptionStub
    +void SimpleExceptionStub::emit_code(LIR_Assembler* ce) {
    +  __ bind(_entry);
    +  address stub = Runtime1::entry_for(_stub);
    +  //__ load_const_optimized(R0, stub);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
    +  if (_obj->is_valid()) { __ mr_if_needed(/*tmp1 in do_CheckCast*/ R4_ARG2, _obj->as_register()); }
    +  __ mtctr(R0);
    +  __ bctrl();
    +  ce->add_call_info_here(_info);
    +  debug_only( __ illtrap(); )
    +}
    +
    +
    +// Implementation of NewInstanceStub
    +NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) {
    +  _result = result;
    +  _klass = klass;
    +  _klass_reg = klass_reg;
    +  _info = new CodeEmitInfo(info);
    +  assert(stub_id == Runtime1::new_instance_id                 ||
    +         stub_id == Runtime1::fast_new_instance_id            ||
    +         stub_id == Runtime1::fast_new_instance_init_check_id,
    +         "need new_instance id");
    +  _stub_id = stub_id;
    +}
    +
    +void NewInstanceStub::emit_code(LIR_Assembler* ce) {
    +  __ bind(_entry);
    +
    +  address entry = Runtime1::entry_for(_stub_id);
    +  //__ load_const_optimized(R0, entry);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry));
    +  __ mtctr(R0);
    +  __ bctrl();
    +  ce->add_call_info_here(_info);
    +  ce->verify_oop_map(_info);
    +  __ b(_continuation);
    +}
    +
    +
    +// Implementation of NewTypeArrayStub
    +NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
    +  _klass_reg = klass_reg;
    +  _length = length;
    +  _result = result;
    +  _info = new CodeEmitInfo(info);
    +}
    +
    +void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
    +  __ bind(_entry);
    +
    +  address entry = Runtime1::entry_for(Runtime1::new_type_array_id);
    +  //__ load_const_optimized(R0, entry);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry));
    +  __ mr_if_needed(/*op->tmp1()->as_register()*/ R5_ARG3, _length->as_register()); // already sign-extended
    +  __ mtctr(R0);
    +  __ bctrl();
    +  ce->add_call_info_here(_info);
    +  ce->verify_oop_map(_info);
    +  __ b(_continuation);
    +}
    +
    +
    +// Implementation of NewObjectArrayStub
    +NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
    +  _klass_reg = klass_reg;
    +  _length = length;
    +  _result = result;
    +  _info = new CodeEmitInfo(info);
    +}
    +
    +void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
    +  __ bind(_entry);
    +
    +  address entry = Runtime1::entry_for(Runtime1::new_object_array_id);
    +  //__ load_const_optimized(R0, entry);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry));
    +  __ mr_if_needed(/*op->tmp1()->as_register()*/ R5_ARG3, _length->as_register()); // already sign-extended
    +  __ mtctr(R0);
    +  __ bctrl();
    +  ce->add_call_info_here(_info);
    +  ce->verify_oop_map(_info);
    +  __ b(_continuation);
    +}
    +
    +
    +// Implementation of MonitorAccessStubs
    +MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
    +  : MonitorAccessStub(obj_reg, lock_reg) {
    +  _info = new CodeEmitInfo(info);
    +}
    +
    +void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
    +  __ bind(_entry);
    +  address stub = Runtime1::entry_for(ce->compilation()->has_fpu_code() ? Runtime1::monitorenter_id : Runtime1::monitorenter_nofpu_id);
    +  //__ load_const_optimized(R0, stub);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
    +  __ mr_if_needed(/*scratch_opr()->as_register()*/ R4_ARG2, _obj_reg->as_register());
    +  assert(_lock_reg->as_register() == R5_ARG3, "");
    +  __ mtctr(R0);
    +  __ bctrl();
    +  ce->add_call_info_here(_info);
    +  ce->verify_oop_map(_info);
    +  __ b(_continuation);
    +}
    +
    +void MonitorExitStub::emit_code(LIR_Assembler* ce) {
    +  __ bind(_entry);
    +  if (_compute_lock) {
    +    ce->monitor_address(_monitor_ix, _lock_reg);
    +  }
    +  address stub = Runtime1::entry_for(ce->compilation()->has_fpu_code() ? Runtime1::monitorexit_id : Runtime1::monitorexit_nofpu_id);
    +  //__ load_const_optimized(R0, stub);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
    +  assert(_lock_reg->as_register() == R4_ARG2, "");
    +  __ mtctr(R0);
    +  __ bctrl();
    +  __ b(_continuation);
    +}
    +
    +
    +// Implementation of patching:
    +// - Copy the code at given offset to an inlined buffer (first the bytes, then the number of bytes).
    +// - Replace original code with a call to the stub.
    +// At Runtime:
    +// - call to stub, jump to runtime
    +// - in runtime: preserve all registers (especially objects, i.e., source and destination object)
    +// - in runtime: after initializing class, restore original code, reexecute instruction
    +
    +int PatchingStub::_patch_info_offset = -(5 * BytesPerInstWord);
    +
    +void PatchingStub::align_patch_site(MacroAssembler* ) {
    +  // Patch sites on ppc are always properly aligned.
    +}
    +
    +#ifdef ASSERT
    +inline void compare_with_patch_site(address template_start, address pc_start, int bytes_to_copy) {
    +  address start = template_start;
    +  for (int i = 0; i < bytes_to_copy; i++) {
    +    address ptr = (address)(pc_start + i);
    +    int a_byte = (*ptr) & 0xFF;
    +    assert(a_byte == *start++, "should be the same code");
    +  }
    +}
    +#endif
    +
    +void PatchingStub::emit_code(LIR_Assembler* ce) {
    +  // copy original code here
    +  assert(NativeGeneralJump::instruction_size <= _bytes_to_copy && _bytes_to_copy <= 0xFF,
    +         "not enough room for call");
    +  assert((_bytes_to_copy & 0x3) == 0, "must copy a multiple of four bytes");
    +
    +  Label call_patch;
    +
    +  int being_initialized_entry = __ offset();
    +
    +  if (_id == load_klass_id) {
    +    // Produce a copy of the load klass instruction for use by the being initialized case.
    +    AddressLiteral addrlit((address)NULL, metadata_Relocation::spec(_index));
    +    __ load_const(_obj, addrlit, R0);
    +    DEBUG_ONLY( compare_with_patch_site(__ code_section()->start() + being_initialized_entry, _pc_start, _bytes_to_copy); )
    +  } else if (_id == load_mirror_id || _id == load_appendix_id) {
    +    // Produce a copy of the load mirror instruction for use by the being initialized case.
    +    AddressLiteral addrlit((address)NULL, oop_Relocation::spec(_index));
    +    __ load_const(_obj, addrlit, R0);
    +    DEBUG_ONLY( compare_with_patch_site(__ code_section()->start() + being_initialized_entry, _pc_start, _bytes_to_copy); )
    +  } else {
    +    // Make a copy the code which is going to be patched.
    +    for (int i = 0; i < _bytes_to_copy; i++) {
    +      address ptr = (address)(_pc_start + i);
    +      int a_byte = (*ptr) & 0xFF;
    +      __ emit_int8 (a_byte);
    +    }
    +  }
    +
    +  address end_of_patch = __ pc();
    +  int bytes_to_skip = 0;
    +  if (_id == load_mirror_id) {
    +    int offset = __ offset();
    +    __ block_comment(" being_initialized check");
    +
    +    // Static field accesses have special semantics while the class
    +    // initializer is being run so we emit a test which can be used to
    +    // check that this code is being executed by the initializing
    +    // thread.
    +    assert(_obj != noreg, "must be a valid register");
    +    assert(_index >= 0, "must have oop index");
    +    __ mr(R0, _obj); // spill
    +    __ ld(_obj, java_lang_Class::klass_offset_in_bytes(), _obj);
    +    __ ld(_obj, in_bytes(InstanceKlass::init_thread_offset()), _obj);
    +    __ cmpd(CCR0, _obj, R16_thread);
    +    __ mr(_obj, R0); // restore
    +    __ bne(CCR0, call_patch);
    +
    +    // Load_klass patches may execute the patched code before it's
    +    // copied back into place so we need to jump back into the main
    +    // code of the nmethod to continue execution.
    +    __ b(_patch_site_continuation);
    +
    +    // Make sure this extra code gets skipped.
    +    bytes_to_skip += __ offset() - offset;
    +  }
    +
    +  // Now emit the patch record telling the runtime how to find the
    +  // pieces of the patch.  We only need 3 bytes but it has to be
    +  // aligned as an instruction so emit 4 bytes.
    +  int sizeof_patch_record = 4;
    +  bytes_to_skip += sizeof_patch_record;
    +
    +  // Emit the offsets needed to find the code to patch.
    +  int being_initialized_entry_offset = __ offset() - being_initialized_entry + sizeof_patch_record;
    +
    +  // Emit the patch record.  We need to emit a full word, so emit an extra empty byte.
    +  __ emit_int8(0);
    +  __ emit_int8(being_initialized_entry_offset);
    +  __ emit_int8(bytes_to_skip);
    +  __ emit_int8(_bytes_to_copy);
    +  address patch_info_pc = __ pc();
    +  assert(patch_info_pc - end_of_patch == bytes_to_skip, "incorrect patch info");
    +
    +  address entry = __ pc();
    +  NativeGeneralJump::insert_unconditional((address)_pc_start, entry);
    +  address target = NULL;
    +  relocInfo::relocType reloc_type = relocInfo::none;
    +  switch (_id) {
    +    case access_field_id:  target = Runtime1::entry_for(Runtime1::access_field_patching_id); break;
    +    case load_klass_id:    target = Runtime1::entry_for(Runtime1::load_klass_patching_id);
    +                           reloc_type = relocInfo::metadata_type; break;
    +    case load_mirror_id:   target = Runtime1::entry_for(Runtime1::load_mirror_patching_id);
    +                           reloc_type = relocInfo::oop_type; break;
    +    case load_appendix_id: target = Runtime1::entry_for(Runtime1::load_appendix_patching_id);
    +                           reloc_type = relocInfo::oop_type; break;
    +    default: ShouldNotReachHere();
    +  }
    +  __ bind(call_patch);
    +
    +  __ block_comment("patch entry point");
    +  //__ load_const(R0, target); + mtctr + bctrl must have size -_patch_info_offset
    +  __ load_const32(R0, MacroAssembler::offset_to_global_toc(target));
    +  __ add(R0, R29_TOC, R0);
    +  __ mtctr(R0);
    +  __ bctrl();
    +  assert(_patch_info_offset == (patch_info_pc - __ pc()), "must not change");
    +  ce->add_call_info_here(_info);
    +  __ b(_patch_site_entry);
    +  if (_id == load_klass_id || _id == load_mirror_id || _id == load_appendix_id) {
    +    CodeSection* cs = __ code_section();
    +    address pc = (address)_pc_start;
    +    RelocIterator iter(cs, pc, pc + 1);
    +    relocInfo::change_reloc_info_for_address(&iter, (address) pc, reloc_type, relocInfo::none);
    +  }
    +}
    +
    +
    +void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
    +  __ bind(_entry);
    +  address stub = Runtime1::entry_for(Runtime1::deoptimize_id);
    +  //__ load_const_optimized(R0, stub);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
    +  __ mtctr(R0);
    +
    +  __ load_const_optimized(R0, _trap_request); // Pass trap request in R0.
    +  __ bctrl();
    +  ce->add_call_info_here(_info);
    +  debug_only(__ illtrap());
    +}
    +
    +
    +void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
    +  //---------------slow case: call to native-----------------
    +  __ bind(_entry);
    +  __ mr(R3_ARG1, src()->as_register());
    +  __ extsw(R4_ARG2, src_pos()->as_register());
    +  __ mr(R5_ARG3, dst()->as_register());
    +  __ extsw(R6_ARG4, dst_pos()->as_register());
    +  __ extsw(R7_ARG5, length()->as_register());
    +
    +  ce->emit_static_call_stub();
    +
    +  bool success = ce->emit_trampoline_stub_for_call(SharedRuntime::get_resolve_static_call_stub());
    +  if (!success) { return; }
    +
    +  __ relocate(relocInfo::static_call_type);
    +  // Note: At this point we do not have the address of the trampoline
    +  // stub, and the entry point might be too far away for bl, so __ pc()
    +  // serves as dummy and the bl will be patched later.
    +  __ code()->set_insts_mark();
    +  __ bl(__ pc());
    +  ce->add_call_info_here(info());
    +  ce->verify_oop_map(info());
    +
    +#ifndef PRODUCT
    +  const address counter = (address)&Runtime1::_arraycopy_slowcase_cnt;
    +  const Register tmp = R3, tmp2 = R4;
    +  int simm16_offs = __ load_const_optimized(tmp, counter, tmp2, true);
    +  __ lwz(tmp2, simm16_offs, tmp);
    +  __ addi(tmp2, tmp2, 1);
    +  __ stw(tmp2, simm16_offs, tmp);
    +#endif
    +
    +  __ b(_continuation);
    +}
    +
    +
    +///////////////////////////////////////////////////////////////////////////////////
    +#if INCLUDE_ALL_GCS
    +
    +void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {
    +  // At this point we know that marking is in progress.
    +  // If do_load() is true then we have to emit the
    +  // load of the previous value; otherwise it has already
    +  // been loaded into _pre_val.
    +
    +  __ bind(_entry);
    +
    +  assert(pre_val()->is_register(), "Precondition.");
    +  Register pre_val_reg = pre_val()->as_register();
    +
    +  if (do_load()) {
    +    ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);
    +  }
    +
    +  __ cmpdi(CCR0, pre_val_reg, 0);
    +  __ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::equal), _continuation);
    +
    +  address stub = Runtime1::entry_for(Runtime1::Runtime1::g1_pre_barrier_slow_id);
    +  //__ load_const_optimized(R0, stub);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
    +  __ std(pre_val_reg, -8, R1_SP); // Pass pre_val on stack.
    +  __ mtctr(R0);
    +  __ bctrl();
    +  __ b(_continuation);
    +}
    +
    +void G1PostBarrierStub::emit_code(LIR_Assembler* ce) {
    +  __ bind(_entry);
    +
    +  assert(addr()->is_register(), "Precondition.");
    +  assert(new_val()->is_register(), "Precondition.");
    +  Register addr_reg = addr()->as_pointer_register();
    +  Register new_val_reg = new_val()->as_register();
    +
    +  __ cmpdi(CCR0, new_val_reg, 0);
    +  __ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::equal), _continuation);
    +
    +  address stub = Runtime1::entry_for(Runtime1::Runtime1::g1_post_barrier_slow_id);
    +  //__ load_const_optimized(R0, stub);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
    +  __ mtctr(R0);
    +  __ mr(R0, addr_reg); // Pass addr in R0.
    +  __ bctrl();
    +  __ b(_continuation);
    +}
    +
    +#endif // INCLUDE_ALL_GCS
    +///////////////////////////////////////////////////////////////////////////////////
    +
    +#undef __
    diff --git a/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp
    new file mode 100644
    index 00000000000..73edcaba207
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp
    @@ -0,0 +1,76 @@
    +/*
    + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#ifndef CPU_PPC_VM_C1_DEFS_PPC_HPP
    +#define CPU_PPC_VM_C1_DEFS_PPC_HPP
    +
    +// Native word offsets from memory address.
    +enum {
    +#if defined(VM_LITTLE_ENDIAN)
    +  pd_lo_word_offset_in_bytes = 0,
    +  pd_hi_word_offset_in_bytes = BytesPerInt
    +#else
    +  pd_lo_word_offset_in_bytes = BytesPerInt,
    +  pd_hi_word_offset_in_bytes = 0
    +#endif
    +};
    +
    +
    +// Explicit rounding operations are not required to implement the strictFP mode.
    +enum {
    +  pd_strict_fp_requires_explicit_rounding = false
    +};
    +
    +
    +// registers
    +enum {
    +  pd_nof_cpu_regs_frame_map = 32,              // Number of registers used during code emission.
    +  pd_nof_caller_save_cpu_regs_frame_map = 27,  // Number of cpu registers killed by calls. (At least R3_ARG1 ... R10_ARG8, but using all like C2.)
    +  pd_nof_cpu_regs_reg_alloc = 27,              // Number of registers that are visible to register allocator.
    +  pd_nof_cpu_regs_linearscan = 32,             // Number of registers visible linear scan.
    +  pd_first_callee_saved_reg = pd_nof_caller_save_cpu_regs_frame_map,
    +  pd_last_callee_saved_reg = pd_nof_cpu_regs_reg_alloc - 1,
    +  pd_first_cpu_reg = 0,
    +  pd_last_cpu_reg = pd_nof_cpu_regs_reg_alloc - 1,
    +
    +  pd_nof_fpu_regs_frame_map = 32,              // Number of registers used during code emission.
    +  pd_nof_caller_save_fpu_regs_frame_map = 32,  // Number of fpu registers killed by calls.
    +  pd_nof_fpu_regs_reg_alloc = 32,              // Number of registers that are visible to register allocator.
    +  pd_nof_fpu_regs_linearscan = 32,             // Number of registers visible to linear scan.
    +  pd_first_fpu_reg = pd_nof_cpu_regs_frame_map,
    +  pd_last_fpu_reg =  pd_nof_cpu_regs_frame_map + pd_nof_fpu_regs_reg_alloc - 1,
    +
    +  pd_nof_xmm_regs_linearscan = 0,
    +  pd_nof_caller_save_xmm_regs = 0,
    +  pd_first_xmm_reg = -1,
    +  pd_last_xmm_reg = -1
    +};
    +
    +// For debug info: a float value in a register is saved in single precision by runtime stubs.
    +enum {
    +  pd_float_saved_as_double = true
    +};
    +
    +#endif // CPU_PPC_VM_C1_DEFS_PPC_HPP
    diff --git a/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp
    new file mode 100644
    index 00000000000..19f85034ba9
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp
    @@ -0,0 +1,32 @@
    +/*
    + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#ifndef CPU_PPC_VM_C1_FPUSTACKSIM_PPC_HPP
    +#define CPU_PPC_VM_C1_FPUSTACKSIM_PPC_HPP
    +
    +// No FPU stack on PPC.
    +class FpuStackSim;
    +
    +#endif // CPU_PPC_VM_C1_FPUSTACKSIM_PPC_HPP
    diff --git a/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp
    new file mode 100644
    index 00000000000..90afc7873ce
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp
    @@ -0,0 +1,394 @@
    +/*
    + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#include "precompiled.hpp"
    +#include "c1/c1_FrameMap.hpp"
    +#include "c1/c1_LIR.hpp"
    +#include "runtime/sharedRuntime.hpp"
    +#include "vmreg_ppc.inline.hpp"
    +
    +
    +const int FrameMap::pd_c_runtime_reserved_arg_size = 7;
    +
    +
    +LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool outgoing) {
    +  LIR_Opr opr = LIR_OprFact::illegalOpr;
    +  VMReg r_1 = reg->first();
    +  VMReg r_2 = reg->second();
    +  if (r_1->is_stack()) {
    +    // Convert stack slot to an SP offset.
    +    // The calling convention does not count the SharedRuntime::out_preserve_stack_slots() value
    +    // so we must add it in here.
    +    int st_off = (r_1->reg2stack() + SharedRuntime::out_preserve_stack_slots()) * VMRegImpl::stack_slot_size;
    +    opr = LIR_OprFact::address(new LIR_Address(SP_opr, st_off + STACK_BIAS, type));
    +  } else if (r_1->is_Register()) {
    +    Register reg = r_1->as_Register();
    +    //if (outgoing) {
    +    //  assert(!reg->is_in(), "should be using I regs");
    +    //} else {
    +    //  assert(!reg->is_out(), "should be using O regs");
    +    //}
    +    if (r_2->is_Register() && (type == T_LONG || type == T_DOUBLE)) {
    +      opr = as_long_opr(reg);
    +    } else if (type == T_OBJECT || type == T_ARRAY) {
    +      opr = as_oop_opr(reg);
    +    } else {
    +      opr = as_opr(reg);
    +    }
    +  } else if (r_1->is_FloatRegister()) {
    +    assert(type == T_DOUBLE || type == T_FLOAT, "wrong type");
    +    FloatRegister f = r_1->as_FloatRegister();
    +    if (type == T_DOUBLE) {
    +      opr = as_double_opr(f);
    +    } else {
    +      opr = as_float_opr(f);
    +    }
    +  }
    +  return opr;
    +}
    +
    +//               FrameMap
    +//--------------------------------------------------------
    +
    +FloatRegister FrameMap::_fpu_regs [FrameMap::nof_fpu_regs];
    +
    +LIR_Opr  FrameMap::R0_opr;
    +LIR_Opr  FrameMap::R1_opr;
    +LIR_Opr  FrameMap::R2_opr;
    +LIR_Opr  FrameMap::R3_opr;
    +LIR_Opr  FrameMap::R4_opr;
    +LIR_Opr  FrameMap::R5_opr;
    +LIR_Opr  FrameMap::R6_opr;
    +LIR_Opr  FrameMap::R7_opr;
    +LIR_Opr  FrameMap::R8_opr;
    +LIR_Opr  FrameMap::R9_opr;
    +LIR_Opr FrameMap::R10_opr;
    +LIR_Opr FrameMap::R11_opr;
    +LIR_Opr FrameMap::R12_opr;
    +LIR_Opr FrameMap::R13_opr;
    +LIR_Opr FrameMap::R14_opr;
    +LIR_Opr FrameMap::R15_opr;
    +LIR_Opr FrameMap::R16_opr;
    +LIR_Opr FrameMap::R17_opr;
    +LIR_Opr FrameMap::R18_opr;
    +LIR_Opr FrameMap::R19_opr;
    +LIR_Opr FrameMap::R20_opr;
    +LIR_Opr FrameMap::R21_opr;
    +LIR_Opr FrameMap::R22_opr;
    +LIR_Opr FrameMap::R23_opr;
    +LIR_Opr FrameMap::R24_opr;
    +LIR_Opr FrameMap::R25_opr;
    +LIR_Opr FrameMap::R26_opr;
    +LIR_Opr FrameMap::R27_opr;
    +LIR_Opr FrameMap::R28_opr;
    +LIR_Opr FrameMap::R29_opr;
    +LIR_Opr FrameMap::R30_opr;
    +LIR_Opr FrameMap::R31_opr;
    +
    +LIR_Opr  FrameMap::R0_oop_opr;
    +//LIR_Opr  FrameMap::R1_oop_opr;
    +LIR_Opr  FrameMap::R2_oop_opr;
    +LIR_Opr  FrameMap::R3_oop_opr;
    +LIR_Opr  FrameMap::R4_oop_opr;
    +LIR_Opr  FrameMap::R5_oop_opr;
    +LIR_Opr  FrameMap::R6_oop_opr;
    +LIR_Opr  FrameMap::R7_oop_opr;
    +LIR_Opr  FrameMap::R8_oop_opr;
    +LIR_Opr  FrameMap::R9_oop_opr;
    +LIR_Opr FrameMap::R10_oop_opr;
    +LIR_Opr FrameMap::R11_oop_opr;
    +LIR_Opr FrameMap::R12_oop_opr;
    +//LIR_Opr FrameMap::R13_oop_opr;
    +LIR_Opr FrameMap::R14_oop_opr;
    +LIR_Opr FrameMap::R15_oop_opr;
    +//LIR_Opr FrameMap::R16_oop_opr;
    +LIR_Opr FrameMap::R17_oop_opr;
    +LIR_Opr FrameMap::R18_oop_opr;
    +LIR_Opr FrameMap::R19_oop_opr;
    +LIR_Opr FrameMap::R20_oop_opr;
    +LIR_Opr FrameMap::R21_oop_opr;
    +LIR_Opr FrameMap::R22_oop_opr;
    +LIR_Opr FrameMap::R23_oop_opr;
    +LIR_Opr FrameMap::R24_oop_opr;
    +LIR_Opr FrameMap::R25_oop_opr;
    +LIR_Opr FrameMap::R26_oop_opr;
    +LIR_Opr FrameMap::R27_oop_opr;
    +LIR_Opr FrameMap::R28_oop_opr;
    +//LIR_Opr FrameMap::R29_oop_opr;
    +LIR_Opr FrameMap::R30_oop_opr;
    +LIR_Opr FrameMap::R31_oop_opr;
    +
    +LIR_Opr  FrameMap::R0_metadata_opr;
    +//LIR_Opr  FrameMap::R1_metadata_opr;
    +LIR_Opr  FrameMap::R2_metadata_opr;
    +LIR_Opr  FrameMap::R3_metadata_opr;
    +LIR_Opr  FrameMap::R4_metadata_opr;
    +LIR_Opr  FrameMap::R5_metadata_opr;
    +LIR_Opr  FrameMap::R6_metadata_opr;
    +LIR_Opr  FrameMap::R7_metadata_opr;
    +LIR_Opr  FrameMap::R8_metadata_opr;
    +LIR_Opr  FrameMap::R9_metadata_opr;
    +LIR_Opr FrameMap::R10_metadata_opr;
    +LIR_Opr FrameMap::R11_metadata_opr;
    +LIR_Opr FrameMap::R12_metadata_opr;
    +//LIR_Opr FrameMap::R13_metadata_opr;
    +LIR_Opr FrameMap::R14_metadata_opr;
    +LIR_Opr FrameMap::R15_metadata_opr;
    +//LIR_Opr FrameMap::R16_metadata_opr;
    +LIR_Opr FrameMap::R17_metadata_opr;
    +LIR_Opr FrameMap::R18_metadata_opr;
    +LIR_Opr FrameMap::R19_metadata_opr;
    +LIR_Opr FrameMap::R20_metadata_opr;
    +LIR_Opr FrameMap::R21_metadata_opr;
    +LIR_Opr FrameMap::R22_metadata_opr;
    +LIR_Opr FrameMap::R23_metadata_opr;
    +LIR_Opr FrameMap::R24_metadata_opr;
    +LIR_Opr FrameMap::R25_metadata_opr;
    +LIR_Opr FrameMap::R26_metadata_opr;
    +LIR_Opr FrameMap::R27_metadata_opr;
    +LIR_Opr FrameMap::R28_metadata_opr;
    +//LIR_Opr FrameMap::R29_metadata_opr;
    +LIR_Opr FrameMap::R30_metadata_opr;
    +LIR_Opr FrameMap::R31_metadata_opr;
    +
    +LIR_Opr FrameMap::SP_opr;
    +
    +LIR_Opr FrameMap::R0_long_opr;
    +LIR_Opr FrameMap::R3_long_opr;
    +
    +LIR_Opr FrameMap::F1_opr;
    +LIR_Opr FrameMap::F1_double_opr;
    +
    +LIR_Opr FrameMap::_caller_save_cpu_regs[] = { 0, };
    +LIR_Opr FrameMap::_caller_save_fpu_regs[] = { 0, };
    +
    +FloatRegister FrameMap::nr2floatreg (int rnr) {
    +  assert(_init_done, "tables not initialized");
    +  debug_only(fpu_range_check(rnr);)
    +  return _fpu_regs[rnr];
    +}
    +
    +
    +// Returns true if reg could be smashed by a callee.
    +bool FrameMap::is_caller_save_register (LIR_Opr reg) {
    +  if (reg->is_single_fpu() || reg->is_double_fpu()) { return true; }
    +  if (reg->is_double_cpu()) {
    +    return is_caller_save_register(reg->as_register_lo()) ||
    +           is_caller_save_register(reg->as_register_hi());
    +  }
    +  return is_caller_save_register(reg->as_register());
    +}
    +
    +
    +bool FrameMap::is_caller_save_register (Register r) {
    +  // not visible to allocator: R0: scratch, R1: SP
    +  // r->encoding() < 2 + nof_caller_save_cpu_regs();
    +  return true; // Currently all regs are caller save.
    +}
    +
    +
    +void FrameMap::initialize() {
    +  assert(!_init_done, "once");
    +
    +  int i = 0;
    +
    +  // Put generally available registers at the beginning (allocated, saved for GC).
    +  for (int j = 0; j < nof_cpu_regs; ++j) {
    +    Register rj = as_Register(j);
    +    if (reg_needs_save(rj)) {
    +      map_register(i++, rj);
    +    }
    +  }
    +  assert(i == nof_cpu_regs_reg_alloc, "number of allocated registers");
    +
    +  // The following registers are not normally available.
    +  for (int j = 0; j < nof_cpu_regs; ++j) {
    +    Register rj = as_Register(j);
    +    if (!reg_needs_save(rj)) {
    +      map_register(i++, rj);
    +    }
    +  }
    +  assert(i == nof_cpu_regs, "number of CPU registers");
    +
    +  for (i = 0; i < nof_fpu_regs; i++) {
    +    _fpu_regs[i] = as_FloatRegister(i);
    +  }
    +
    +  _init_done = true;
    +
    +  R0_opr  = as_opr(R0);
    +  R1_opr  = as_opr(R1);
    +  R2_opr  = as_opr(R2);
    +  R3_opr  = as_opr(R3);
    +  R4_opr  = as_opr(R4);
    +  R5_opr  = as_opr(R5);
    +  R6_opr  = as_opr(R6);
    +  R7_opr  = as_opr(R7);
    +  R8_opr  = as_opr(R8);
    +  R9_opr  = as_opr(R9);
    +  R10_opr = as_opr(R10);
    +  R11_opr = as_opr(R11);
    +  R12_opr = as_opr(R12);
    +  R13_opr = as_opr(R13);
    +  R14_opr = as_opr(R14);
    +  R15_opr = as_opr(R15);
    +  R16_opr = as_opr(R16);
    +  R17_opr = as_opr(R17);
    +  R18_opr = as_opr(R18);
    +  R19_opr = as_opr(R19);
    +  R20_opr = as_opr(R20);
    +  R21_opr = as_opr(R21);
    +  R22_opr = as_opr(R22);
    +  R23_opr = as_opr(R23);
    +  R24_opr = as_opr(R24);
    +  R25_opr = as_opr(R25);
    +  R26_opr = as_opr(R26);
    +  R27_opr = as_opr(R27);
    +  R28_opr = as_opr(R28);
    +  R29_opr = as_opr(R29);
    +  R30_opr = as_opr(R30);
    +  R31_opr = as_opr(R31);
    +
    +  R0_oop_opr  = as_oop_opr(R0);
    +  //R1_oop_opr  = as_oop_opr(R1);
    +  R2_oop_opr  = as_oop_opr(R2);
    +  R3_oop_opr  = as_oop_opr(R3);
    +  R4_oop_opr  = as_oop_opr(R4);
    +  R5_oop_opr  = as_oop_opr(R5);
    +  R6_oop_opr  = as_oop_opr(R6);
    +  R7_oop_opr  = as_oop_opr(R7);
    +  R8_oop_opr  = as_oop_opr(R8);
    +  R9_oop_opr  = as_oop_opr(R9);
    +  R10_oop_opr = as_oop_opr(R10);
    +  R11_oop_opr = as_oop_opr(R11);
    +  R12_oop_opr = as_oop_opr(R12);
    +  //R13_oop_opr = as_oop_opr(R13);
    +  R14_oop_opr = as_oop_opr(R14);
    +  R15_oop_opr = as_oop_opr(R15);
    +  //R16_oop_opr = as_oop_opr(R16);
    +  R17_oop_opr = as_oop_opr(R17);
    +  R18_oop_opr = as_oop_opr(R18);
    +  R19_oop_opr = as_oop_opr(R19);
    +  R20_oop_opr = as_oop_opr(R20);
    +  R21_oop_opr = as_oop_opr(R21);
    +  R22_oop_opr = as_oop_opr(R22);
    +  R23_oop_opr = as_oop_opr(R23);
    +  R24_oop_opr = as_oop_opr(R24);
    +  R25_oop_opr = as_oop_opr(R25);
    +  R26_oop_opr = as_oop_opr(R26);
    +  R27_oop_opr = as_oop_opr(R27);
    +  R28_oop_opr = as_oop_opr(R28);
    +  //R29_oop_opr = as_oop_opr(R29);
    +  R30_oop_opr = as_oop_opr(R30);
    +  R31_oop_opr = as_oop_opr(R31);
    +
    +  R0_metadata_opr  = as_metadata_opr(R0);
    +  //R1_metadata_opr  = as_metadata_opr(R1);
    +  R2_metadata_opr  = as_metadata_opr(R2);
    +  R3_metadata_opr  = as_metadata_opr(R3);
    +  R4_metadata_opr  = as_metadata_opr(R4);
    +  R5_metadata_opr  = as_metadata_opr(R5);
    +  R6_metadata_opr  = as_metadata_opr(R6);
    +  R7_metadata_opr  = as_metadata_opr(R7);
    +  R8_metadata_opr  = as_metadata_opr(R8);
    +  R9_metadata_opr  = as_metadata_opr(R9);
    +  R10_metadata_opr = as_metadata_opr(R10);
    +  R11_metadata_opr = as_metadata_opr(R11);
    +  R12_metadata_opr = as_metadata_opr(R12);
    +  //R13_metadata_opr = as_metadata_opr(R13);
    +  R14_metadata_opr = as_metadata_opr(R14);
    +  R15_metadata_opr = as_metadata_opr(R15);
    +  //R16_metadata_opr = as_metadata_opr(R16);
    +  R17_metadata_opr = as_metadata_opr(R17);
    +  R18_metadata_opr = as_metadata_opr(R18);
    +  R19_metadata_opr = as_metadata_opr(R19);
    +  R20_metadata_opr = as_metadata_opr(R20);
    +  R21_metadata_opr = as_metadata_opr(R21);
    +  R22_metadata_opr = as_metadata_opr(R22);
    +  R23_metadata_opr = as_metadata_opr(R23);
    +  R24_metadata_opr = as_metadata_opr(R24);
    +  R25_metadata_opr = as_metadata_opr(R25);
    +  R26_metadata_opr = as_metadata_opr(R26);
    +  R27_metadata_opr = as_metadata_opr(R27);
    +  R28_metadata_opr = as_metadata_opr(R28);
    +  //R29_metadata_opr = as_metadata_opr(R29);
    +  R30_metadata_opr = as_metadata_opr(R30);
    +  R31_metadata_opr = as_metadata_opr(R31);
    +
    +  SP_opr = as_pointer_opr(R1_SP);
    +
    +  R0_long_opr = LIR_OprFact::double_cpu(cpu_reg2rnr(R0), cpu_reg2rnr(R0));
    +  R3_long_opr = LIR_OprFact::double_cpu(cpu_reg2rnr(R3), cpu_reg2rnr(R3));
    +
    +  F1_opr = as_float_opr(F1);
    +  F1_double_opr = as_double_opr(F1);
    +
    +  // All the allocated cpu regs are caller saved.
    +  for (int i = 0; i < max_nof_caller_save_cpu_regs; i++) {
    +    _caller_save_cpu_regs[i] = LIR_OprFact::single_cpu(i);
    +  }
    +
    +  // All the fpu regs are caller saved.
    +  for (int i = 0; i < nof_caller_save_fpu_regs; i++) {
    +    _caller_save_fpu_regs[i] = LIR_OprFact::single_fpu(i);
    +  }
    +}
    +
    +
    +Address FrameMap::make_new_address(ByteSize sp_offset) const {
    +  return Address(R1_SP, STACK_BIAS + in_bytes(sp_offset));
    +}
    +
    +
    +VMReg FrameMap::fpu_regname (int n) {
    +  return as_FloatRegister(n)->as_VMReg();
    +}
    +
    +
    +LIR_Opr FrameMap::stack_pointer() {
    +  return SP_opr;
    +}
    +
    +
    +// JSR 292
    +// On PPC64, there is no need to save the SP, because neither
    +// method handle intrinsics, nor compiled lambda forms modify it.
    +LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() {
    +  return LIR_OprFact::illegalOpr;
    +}
    +
    +
    +bool FrameMap::validate_frame() {
    +  int max_offset = in_bytes(framesize_in_bytes());
    +  int java_index = 0;
    +  for (int i = 0; i < _incoming_arguments->length(); i++) {
    +    LIR_Opr opr = _incoming_arguments->at(i);
    +    if (opr->is_stack()) {
    +      max_offset = MAX2(_argument_locations->at(java_index), max_offset);
    +    }
    +    java_index += type2size[opr->type()];
    +  }
    +  return Assembler::is_simm16(max_offset + STACK_BIAS);
    +}
    diff --git a/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp
    new file mode 100644
    index 00000000000..5eee5ffca1f
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp
    @@ -0,0 +1,202 @@
    +/*
    + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#ifndef CPU_PPC_VM_C1_FRAMEMAP_PPC_HPP
    +#define CPU_PPC_VM_C1_FRAMEMAP_PPC_HPP
    +
    + public:
    +
    +  enum {
    +    nof_reg_args = 8,   // Registers R3-R10 are available for parameter passing.
    +    first_available_sp_in_frame = frame::jit_out_preserve_size,
    +    frame_pad_in_bytes = 0
    +  };
    +
    +  static const int pd_c_runtime_reserved_arg_size;
    +
    +  static LIR_Opr  R0_opr;
    +  static LIR_Opr  R1_opr;
    +  static LIR_Opr  R2_opr;
    +  static LIR_Opr  R3_opr;
    +  static LIR_Opr  R4_opr;
    +  static LIR_Opr  R5_opr;
    +  static LIR_Opr  R6_opr;
    +  static LIR_Opr  R7_opr;
    +  static LIR_Opr  R8_opr;
    +  static LIR_Opr  R9_opr;
    +  static LIR_Opr R10_opr;
    +  static LIR_Opr R11_opr;
    +  static LIR_Opr R12_opr;
    +  static LIR_Opr R13_opr;
    +  static LIR_Opr R14_opr;
    +  static LIR_Opr R15_opr;
    +  static LIR_Opr R16_opr;
    +  static LIR_Opr R17_opr;
    +  static LIR_Opr R18_opr;
    +  static LIR_Opr R19_opr;
    +  static LIR_Opr R20_opr;
    +  static LIR_Opr R21_opr;
    +  static LIR_Opr R22_opr;
    +  static LIR_Opr R23_opr;
    +  static LIR_Opr R24_opr;
    +  static LIR_Opr R25_opr;
    +  static LIR_Opr R26_opr;
    +  static LIR_Opr R27_opr;
    +  static LIR_Opr R28_opr;
    +  static LIR_Opr R29_opr;
    +  static LIR_Opr R30_opr;
    +  static LIR_Opr R31_opr;
    +
    +  static LIR_Opr  R0_oop_opr;
    +  //R1: Stack pointer. Not an oop.
    +  static LIR_Opr  R2_oop_opr;
    +  static LIR_Opr  R3_oop_opr;
    +  static LIR_Opr  R4_oop_opr;
    +  static LIR_Opr  R5_oop_opr;
    +  static LIR_Opr  R6_oop_opr;
    +  static LIR_Opr  R7_oop_opr;
    +  static LIR_Opr  R8_oop_opr;
    +  static LIR_Opr  R9_oop_opr;
    +  static LIR_Opr R10_oop_opr;
    +  static LIR_Opr R11_oop_opr;
    +  static LIR_Opr R12_oop_opr;
    +  //R13: System thread register. Not usable.
    +  static LIR_Opr R14_oop_opr;
    +  static LIR_Opr R15_oop_opr;
    +  //R16: Java thread register. Not an oop.
    +  static LIR_Opr R17_oop_opr;
    +  static LIR_Opr R18_oop_opr;
    +  static LIR_Opr R19_oop_opr;
    +  static LIR_Opr R20_oop_opr;
    +  static LIR_Opr R21_oop_opr;
    +  static LIR_Opr R22_oop_opr;
    +  static LIR_Opr R23_oop_opr;
    +  static LIR_Opr R24_oop_opr;
    +  static LIR_Opr R25_oop_opr;
    +  static LIR_Opr R26_oop_opr;
    +  static LIR_Opr R27_oop_opr;
    +  static LIR_Opr R28_oop_opr;
    +  static LIR_Opr R29_oop_opr;
    +  //R29: TOC register. Not an oop.
    +  static LIR_Opr R30_oop_opr;
    +  static LIR_Opr R31_oop_opr;
    +
    +  static LIR_Opr  R0_metadata_opr;
    +  //R1: Stack pointer. Not metadata.
    +  static LIR_Opr  R2_metadata_opr;
    +  static LIR_Opr  R3_metadata_opr;
    +  static LIR_Opr  R4_metadata_opr;
    +  static LIR_Opr  R5_metadata_opr;
    +  static LIR_Opr  R6_metadata_opr;
    +  static LIR_Opr  R7_metadata_opr;
    +  static LIR_Opr  R8_metadata_opr;
    +  static LIR_Opr  R9_metadata_opr;
    +  static LIR_Opr R10_metadata_opr;
    +  static LIR_Opr R11_metadata_opr;
    +  static LIR_Opr R12_metadata_opr;
    +  //R13: System thread register. Not usable.
    +  static LIR_Opr R14_metadata_opr;
    +  static LIR_Opr R15_metadata_opr;
    +  //R16: Java thread register. Not metadata.
    +  static LIR_Opr R17_metadata_opr;
    +  static LIR_Opr R18_metadata_opr;
    +  static LIR_Opr R19_metadata_opr;
    +  static LIR_Opr R20_metadata_opr;
    +  static LIR_Opr R21_metadata_opr;
    +  static LIR_Opr R22_metadata_opr;
    +  static LIR_Opr R23_metadata_opr;
    +  static LIR_Opr R24_metadata_opr;
    +  static LIR_Opr R25_metadata_opr;
    +  static LIR_Opr R26_metadata_opr;
    +  static LIR_Opr R27_metadata_opr;
    +  static LIR_Opr R28_metadata_opr;
    +  //R29: TOC register. Not metadata.
    +  static LIR_Opr R30_metadata_opr;
    +  static LIR_Opr R31_metadata_opr;
    +
    +  static LIR_Opr SP_opr;
    +
    +  static LIR_Opr R0_long_opr;
    +  static LIR_Opr R3_long_opr;
    +
    +  static LIR_Opr F1_opr;
    +  static LIR_Opr F1_double_opr;
    +
    + private:
    +  static FloatRegister  _fpu_regs [nof_fpu_regs];
    +
    +  static LIR_Opr as_long_single_opr(Register r) {
    +    return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r));
    +  }
    +  static LIR_Opr as_long_pair_opr(Register r) {
    +    return LIR_OprFact::double_cpu(cpu_reg2rnr(r->successor()), cpu_reg2rnr(r));
    +  }
    +
    + public:
    +
    +#ifdef _LP64
    +  static LIR_Opr as_long_opr(Register r) {
    +    return as_long_single_opr(r);
    +  }
    +  static LIR_Opr as_pointer_opr(Register r) {
    +    return as_long_single_opr(r);
    +  }
    +#else
    +  static LIR_Opr as_long_opr(Register r) {
    +    Unimplemented(); return 0;
    +//    return as_long_pair_opr(r);
    +  }
    +  static LIR_Opr as_pointer_opr(Register r) {
    +    Unimplemented(); return 0;
    +//    return as_opr(r);
    +  }
    +#endif
    +  static LIR_Opr as_float_opr(FloatRegister r) {
    +    return LIR_OprFact::single_fpu(r->encoding());
    +  }
    +  static LIR_Opr as_double_opr(FloatRegister r) {
    +    return LIR_OprFact::double_fpu(r->encoding());
    +  }
    +
    +  static FloatRegister nr2floatreg (int rnr);
    +
    +  static VMReg fpu_regname (int n);
    +
    +  static bool is_caller_save_register(LIR_Opr  reg);
    +  static bool is_caller_save_register(Register r);
    +
    +  static int nof_caller_save_cpu_regs() { return pd_nof_caller_save_cpu_regs_frame_map; }
    +  static int last_cpu_reg()             { return pd_last_cpu_reg; }
    +
    +  // Registers which need to be saved in the frames (e.g. for GC).
    +  // Register usage:
    +  //  R0: scratch
    +  //  R1: sp
    +  // R13: system thread id
    +  // R16: java thread
    +  // R29: global TOC
    +  static bool reg_needs_save(Register r) { return r != R0 && r != R1 && r != R13 && r != R16 && r != R29; }
    +
    +#endif // CPU_PPC_VM_C1_FRAMEMAP_PPC_HPP
    diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp
    new file mode 100644
    index 00000000000..8a64bab4be4
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp
    @@ -0,0 +1,3133 @@
    +/*
    + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#include "precompiled.hpp"
    +#include "c1/c1_Compilation.hpp"
    +#include "c1/c1_LIRAssembler.hpp"
    +#include "c1/c1_MacroAssembler.hpp"
    +#include "c1/c1_Runtime1.hpp"
    +#include "c1/c1_ValueStack.hpp"
    +#include "ci/ciArrayKlass.hpp"
    +#include "ci/ciInstance.hpp"
    +#include "gc/shared/collectedHeap.hpp"
    +#include "gc/shared/barrierSet.hpp"
    +#include "gc/shared/cardTableModRefBS.hpp"
    +#include "nativeInst_ppc.hpp"
    +#include "oops/objArrayKlass.hpp"
    +#include "runtime/sharedRuntime.hpp"
    +
    +#define __ _masm->
    +
    +
    +const ConditionRegister LIR_Assembler::BOOL_RESULT = CCR5;
    +
    +
    +bool LIR_Assembler::is_small_constant(LIR_Opr opr) {
    +  Unimplemented(); return false; // Currently not used on this platform.
    +}
    +
    +
    +LIR_Opr LIR_Assembler::receiverOpr() {
    +  return FrameMap::R3_oop_opr;
    +}
    +
    +
    +LIR_Opr LIR_Assembler::osrBufferPointer() {
    +  return FrameMap::R3_opr;
    +}
    +
    +
    +// This specifies the stack pointer decrement needed to build the frame.
    +int LIR_Assembler::initial_frame_size_in_bytes() const {
    +  return in_bytes(frame_map()->framesize_in_bytes());
    +}
    +
    +
    +// Inline cache check: the inline cached class is in inline_cache_reg;
    +// we fetch the class of the receiver and compare it with the cached class.
    +// If they do not match we jump to slow case.
    +int LIR_Assembler::check_icache() {
    +  int offset = __ offset();
    +  __ inline_cache_check(R3_ARG1, R19_inline_cache_reg);
    +  return offset;
    +}
    +
    +
    +void LIR_Assembler::osr_entry() {
    +  // On-stack-replacement entry sequence:
    +  //
    +  //   1. Create a new compiled activation.
    +  //   2. Initialize local variables in the compiled activation. The expression
    +  //      stack must be empty at the osr_bci; it is not initialized.
    +  //   3. Jump to the continuation address in compiled code to resume execution.
    +
    +  // OSR entry point
    +  offsets()->set_value(CodeOffsets::OSR_Entry, code_offset());
    +  BlockBegin* osr_entry = compilation()->hir()->osr_entry();
    +  ValueStack* entry_state = osr_entry->end()->state();
    +  int number_of_locks = entry_state->locks_size();
    +
    +  // Create a frame for the compiled activation.
    +  __ build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes());
    +
    +  // OSR buffer is
    +  //
    +  // locals[nlocals-1..0]
    +  // monitors[number_of_locks-1..0]
    +  //
    +  // Locals is a direct copy of the interpreter frame so in the osr buffer
    +  // the first slot in the local array is the last local from the interpreter
    +  // and the last slot is local[0] (receiver) from the interpreter.
    +  //
    +  // Similarly with locks. The first lock slot in the osr buffer is the nth lock
    +  // from the interpreter frame, the nth lock slot in the osr buffer is 0th lock
    +  // in the interpreter frame (the method lock if a sync method).
    +
    +  // Initialize monitors in the compiled activation.
    +  //   R3: pointer to osr buffer
    +  //
    +  // All other registers are dead at this point and the locals will be
    +  // copied into place by code emitted in the IR.
    +
    +  Register OSR_buf = osrBufferPointer()->as_register();
    +  { assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below");
    +    int monitor_offset = BytesPerWord * method()->max_locals() +
    +      (2 * BytesPerWord) * (number_of_locks - 1);
    +    // SharedRuntime::OSR_migration_begin() packs BasicObjectLocks in
    +    // the OSR buffer using 2 word entries: first the lock and then
    +    // the oop.
    +    for (int i = 0; i < number_of_locks; i++) {
    +      int slot_offset = monitor_offset - ((i * 2) * BytesPerWord);
    +#ifdef ASSERT
    +      // Verify the interpreter's monitor has a non-null object.
    +      {
    +        Label L;
    +        __ ld(R0, slot_offset + 1*BytesPerWord, OSR_buf);
    +        __ cmpdi(CCR0, R0, 0);
    +        __ bne(CCR0, L);
    +        __ stop("locked object is NULL");
    +        __ bind(L);
    +      }
    +#endif // ASSERT
    +      // Copy the lock field into the compiled activation.
    +      Address ml = frame_map()->address_for_monitor_lock(i),
    +              mo = frame_map()->address_for_monitor_object(i);
    +      assert(ml.index() == noreg && mo.index() == noreg, "sanity");
    +      __ ld(R0, slot_offset + 0, OSR_buf);
    +      __ std(R0, ml.disp(), ml.base());
    +      __ ld(R0, slot_offset + 1*BytesPerWord, OSR_buf);
    +      __ std(R0, mo.disp(), mo.base());
    +    }
    +  }
    +}
    +
    +
    +int LIR_Assembler::emit_exception_handler() {
    +  // If the last instruction is a call (typically to do a throw which
    +  // is coming at the end after block reordering) the return address
    +  // must still point into the code area in order to avoid assertion
    +  // failures when searching for the corresponding bci => add a nop
    +  // (was bug 5/14/1999 - gri).
    +  __ nop();
    +
    +  // Generate code for the exception handler.
    +  address handler_base = __ start_a_stub(exception_handler_size);
    +
    +  if (handler_base == NULL) {
    +    // Not enough space left for the handler.
    +    bailout("exception handler overflow");
    +    return -1;
    +  }
    +
    +  int offset = code_offset();
    +  address entry_point = CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::handle_exception_from_callee_id));
    +  //__ load_const_optimized(R0, entry_point);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry_point));
    +  __ mtctr(R0);
    +  __ bctr();
    +
    +  guarantee(code_offset() - offset <= exception_handler_size, "overflow");
    +  __ end_a_stub();
    +
    +  return offset;
    +}
    +
    +
    +// Emit the code to remove the frame from the stack in the exception
    +// unwind path.
    +int LIR_Assembler::emit_unwind_handler() {
    +  _masm->block_comment("Unwind handler");
    +
    +  int offset = code_offset();
    +  bool preserve_exception = method()->is_synchronized() || compilation()->env()->dtrace_method_probes();
    +  const Register Rexception = R3 /*LIRGenerator::exceptionOopOpr()*/, Rexception_save = R31;
    +
    +  // Fetch the exception from TLS and clear out exception related thread state.
    +  __ ld(Rexception, in_bytes(JavaThread::exception_oop_offset()), R16_thread);
    +  __ li(R0, 0);
    +  __ std(R0, in_bytes(JavaThread::exception_oop_offset()), R16_thread);
    +  __ std(R0, in_bytes(JavaThread::exception_pc_offset()), R16_thread);
    +
    +  __ bind(_unwind_handler_entry);
    +  __ verify_not_null_oop(Rexception);
    +  if (preserve_exception) { __ mr(Rexception_save, Rexception); }
    +
    +  // Perform needed unlocking
    +  MonitorExitStub* stub = NULL;
    +  if (method()->is_synchronized()) {
    +    monitor_address(0, FrameMap::R4_opr);
    +    stub = new MonitorExitStub(FrameMap::R4_opr, true, 0);
    +    __ unlock_object(R5, R6, R4, *stub->entry());
    +    __ bind(*stub->continuation());
    +  }
    +
    +  if (compilation()->env()->dtrace_method_probes()) {
    +    Unimplemented();
    +  }
    +
    +  // Dispatch to the unwind logic.
    +  address unwind_stub = Runtime1::entry_for(Runtime1::unwind_exception_id);
    +  //__ load_const_optimized(R0, unwind_stub);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(unwind_stub));
    +  if (preserve_exception) { __ mr(Rexception, Rexception_save); }
    +  __ mtctr(R0);
    +  __ bctr();
    +
    +  // Emit the slow path assembly.
    +  if (stub != NULL) {
    +    stub->emit_code(this);
    +  }
    +
    +  return offset;
    +}
    +
    +
    +int LIR_Assembler::emit_deopt_handler() {
    +  // If the last instruction is a call (typically to do a throw which
    +  // is coming at the end after block reordering) the return address
    +  // must still point into the code area in order to avoid assertion
    +  // failures when searching for the corresponding bci => add a nop
    +  // (was bug 5/14/1999 - gri).
    +  __ nop();
    +
    +  // Generate code for deopt handler.
    +  address handler_base = __ start_a_stub(deopt_handler_size);
    +
    +  if (handler_base == NULL) {
    +    // Not enough space left for the handler.
    +    bailout("deopt handler overflow");
    +    return -1;
    +  }
    +
    +  int offset = code_offset();
    +  __ bl64_patchable(SharedRuntime::deopt_blob()->unpack(), relocInfo::runtime_call_type);
    +
    +  guarantee(code_offset() - offset <= deopt_handler_size, "overflow");
    +  __ end_a_stub();
    +
    +  return offset;
    +}
    +
    +
    +void LIR_Assembler::jobject2reg(jobject o, Register reg) {
    +  if (o == NULL) {
    +    __ li(reg, 0);
    +  } else {
    +    AddressLiteral addrlit = __ constant_oop_address(o);
    +    __ load_const(reg, addrlit, (reg != R0) ? R0 : noreg);
    +  }
    +}
    +
    +
    +void LIR_Assembler::jobject2reg_with_patching(Register reg, CodeEmitInfo *info) {
    +  // Allocate a new index in table to hold the object once it's been patched.
    +  int oop_index = __ oop_recorder()->allocate_oop_index(NULL);
    +  PatchingStub* patch = new PatchingStub(_masm, patching_id(info), oop_index);
    +
    +  AddressLiteral addrlit((address)NULL, oop_Relocation::spec(oop_index));
    +  __ load_const(reg, addrlit, R0);
    +
    +  patching_epilog(patch, lir_patch_normal, reg, info);
    +}
    +
    +
    +void LIR_Assembler::metadata2reg(Metadata* o, Register reg) {
    +  AddressLiteral md = __ constant_metadata_address(o); // Notify OOP recorder (don't need the relocation)
    +  __ load_const_optimized(reg, md.value(), (reg != R0) ? R0 : noreg);
    +}
    +
    +
    +void LIR_Assembler::klass2reg_with_patching(Register reg, CodeEmitInfo *info) {
    +  // Allocate a new index in table to hold the klass once it's been patched.
    +  int index = __ oop_recorder()->allocate_metadata_index(NULL);
    +  PatchingStub* patch = new PatchingStub(_masm, PatchingStub::load_klass_id, index);
    +
    +  AddressLiteral addrlit((address)NULL, metadata_Relocation::spec(index));
    +  assert(addrlit.rspec().type() == relocInfo::metadata_type, "must be an metadata reloc");
    +  __ load_const(reg, addrlit, R0);
    +
    +  patching_epilog(patch, lir_patch_normal, reg, info);
    +}
    +
    +
    +void LIR_Assembler::emit_op3(LIR_Op3* op) {
    +  const bool is_int = op->result_opr()->is_single_cpu();
    +  Register Rdividend = is_int ? op->in_opr1()->as_register() : op->in_opr1()->as_register_lo();
    +  Register Rdivisor  = noreg;
    +  Register Rscratch  = op->in_opr3()->as_register();
    +  Register Rresult   = is_int ? op->result_opr()->as_register() : op->result_opr()->as_register_lo();
    +  long divisor = -1;
    +
    +  if (op->in_opr2()->is_register()) {
    +    Rdivisor = is_int ? op->in_opr2()->as_register() : op->in_opr2()->as_register_lo();
    +  } else {
    +    divisor = is_int ? op->in_opr2()->as_constant_ptr()->as_jint()
    +                     : op->in_opr2()->as_constant_ptr()->as_jlong();
    +  }
    +
    +  assert(Rdividend != Rscratch, "");
    +  assert(Rdivisor  != Rscratch, "");
    +  assert(op->code() == lir_idiv || op->code() == lir_irem, "Must be irem or idiv");
    +
    +  if (Rdivisor == noreg) {
    +    if (divisor == 1) { // stupid, but can happen
    +      if (op->code() == lir_idiv) {
    +        __ mr_if_needed(Rresult, Rdividend);
    +      } else {
    +        __ li(Rresult, 0);
    +      }
    +
    +    } else if (is_power_of_2(divisor)) {
    +      // Convert division by a power of two into some shifts and logical operations.
    +      int log2 = log2_intptr(divisor);
    +
    +      // Round towards 0.
    +      if (divisor == 2) {
    +        if (is_int) {
    +          __ srwi(Rscratch, Rdividend, 31);
    +        } else {
    +          __ srdi(Rscratch, Rdividend, 63);
    +        }
    +      } else {
    +        if (is_int) {
    +          __ srawi(Rscratch, Rdividend, 31);
    +        } else {
    +          __ sradi(Rscratch, Rdividend, 63);
    +        }
    +        __ clrldi(Rscratch, Rscratch, 64-log2);
    +      }
    +      __ add(Rscratch, Rdividend, Rscratch);
    +
    +      if (op->code() == lir_idiv) {
    +        if (is_int) {
    +          __ srawi(Rresult, Rscratch, log2);
    +        } else {
    +          __ sradi(Rresult, Rscratch, log2);
    +        }
    +      } else { // lir_irem
    +        __ clrrdi(Rscratch, Rscratch, log2);
    +        __ sub(Rresult, Rdividend, Rscratch);
    +      }
    +
    +    } else if (divisor == -1) {
    +      if (op->code() == lir_idiv) {
    +        __ neg(Rresult, Rdividend);
    +      } else {
    +        __ li(Rresult, 0);
    +      }
    +
    +    } else {
    +      __ load_const_optimized(Rscratch, divisor);
    +      if (op->code() == lir_idiv) {
    +        if (is_int) {
    +          __ divw(Rresult, Rdividend, Rscratch); // Can't divide minint/-1.
    +        } else {
    +          __ divd(Rresult, Rdividend, Rscratch); // Can't divide minint/-1.
    +        }
    +      } else {
    +        assert(Rscratch != R0, "need both");
    +        if (is_int) {
    +          __ divw(R0, Rdividend, Rscratch); // Can't divide minint/-1.
    +          __ mullw(Rscratch, R0, Rscratch);
    +        } else {
    +          __ divd(R0, Rdividend, Rscratch); // Can't divide minint/-1.
    +          __ mulld(Rscratch, R0, Rscratch);
    +        }
    +        __ sub(Rresult, Rdividend, Rscratch);
    +      }
    +
    +    }
    +    return;
    +  }
    +
    +  Label regular, done;
    +  if (is_int) {
    +    __ cmpwi(CCR0, Rdivisor, -1);
    +  } else {
    +    __ cmpdi(CCR0, Rdivisor, -1);
    +  }
    +  __ bne(CCR0, regular);
    +  if (op->code() == lir_idiv) {
    +    __ neg(Rresult, Rdividend);
    +    __ b(done);
    +    __ bind(regular);
    +    if (is_int) {
    +      __ divw(Rresult, Rdividend, Rdivisor); // Can't divide minint/-1.
    +    } else {
    +      __ divd(Rresult, Rdividend, Rdivisor); // Can't divide minint/-1.
    +    }
    +  } else { // lir_irem
    +    __ li(Rresult, 0);
    +    __ b(done);
    +    __ bind(regular);
    +    if (is_int) {
    +      __ divw(Rscratch, Rdividend, Rdivisor); // Can't divide minint/-1.
    +      __ mullw(Rscratch, Rscratch, Rdivisor);
    +    } else {
    +      __ divd(Rscratch, Rdividend, Rdivisor); // Can't divide minint/-1.
    +      __ mulld(Rscratch, Rscratch, Rdivisor);
    +    }
    +    __ sub(Rresult, Rdividend, Rscratch);
    +  }
    +  __ bind(done);
    +}
    +
    +
    +void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) {
    +#ifdef ASSERT
    +  assert(op->block() == NULL || op->block()->label() == op->label(), "wrong label");
    +  if (op->block() != NULL)  _branch_target_blocks.append(op->block());
    +  if (op->ublock() != NULL) _branch_target_blocks.append(op->ublock());
    +  assert(op->info() == NULL, "shouldn't have CodeEmitInfo");
    +#endif
    +
    +  Label *L = op->label();
    +  if (op->cond() == lir_cond_always) {
    +    __ b(*L);
    +  } else {
    +    Label done;
    +    bool is_unordered = false;
    +    if (op->code() == lir_cond_float_branch) {
    +      assert(op->ublock() != NULL, "must have unordered successor");
    +      is_unordered = true;
    +    } else {
    +      assert(op->code() == lir_branch, "just checking");
    +    }
    +
    +    bool positive = false;
    +    Assembler::Condition cond = Assembler::equal;
    +    switch (op->cond()) {
    +      case lir_cond_equal:        positive = true ; cond = Assembler::equal  ; is_unordered = false; break;
    +      case lir_cond_notEqual:     positive = false; cond = Assembler::equal  ; is_unordered = false; break;
    +      case lir_cond_less:         positive = true ; cond = Assembler::less   ; break;
    +      case lir_cond_belowEqual:   assert(op->code() != lir_cond_float_branch, ""); // fallthru
    +      case lir_cond_lessEqual:    positive = false; cond = Assembler::greater; break;
    +      case lir_cond_greater:      positive = true ; cond = Assembler::greater; break;
    +      case lir_cond_aboveEqual:   assert(op->code() != lir_cond_float_branch, ""); // fallthru
    +      case lir_cond_greaterEqual: positive = false; cond = Assembler::less   ; break;
    +      default:                    ShouldNotReachHere();
    +    }
    +    int bo = positive ? Assembler::bcondCRbiIs1 : Assembler::bcondCRbiIs0;
    +    int bi = Assembler::bi0(BOOL_RESULT, cond);
    +    if (is_unordered) {
    +      if (positive) {
    +        if (op->ublock() == op->block()) {
    +          __ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(BOOL_RESULT, Assembler::summary_overflow), *L);
    +        }
    +      } else {
    +        if (op->ublock() != op->block()) { __ bso(BOOL_RESULT, done); }
    +      }
    +    }
    +    __ bc_far_optimized(bo, bi, *L);
    +    __ bind(done);
    +  }
    +}
    +
    +
    +void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) {
    +  Bytecodes::Code code = op->bytecode();
    +  LIR_Opr src = op->in_opr(),
    +          dst = op->result_opr();
    +
    +  switch(code) {
    +    case Bytecodes::_i2l: {
    +      __ extsw(dst->as_register_lo(), src->as_register());
    +      break;
    +    }
    +    case Bytecodes::_l2i: {
    +      __ mr_if_needed(dst->as_register(), src->as_register_lo()); // high bits are garbage
    +      break;
    +    }
    +    case Bytecodes::_i2b: {
    +      __ extsb(dst->as_register(), src->as_register());
    +      break;
    +    }
    +    case Bytecodes::_i2c: {
    +      __ clrldi(dst->as_register(), src->as_register(), 64-16);
    +      break;
    +    }
    +    case Bytecodes::_i2s: {
    +      __ extsh(dst->as_register(), src->as_register());
    +      break;
    +    }
    +    case Bytecodes::_i2d:
    +    case Bytecodes::_l2d: {
    +      __ fcfid(dst->as_double_reg(), src->as_double_reg()); // via mem
    +      break;
    +    }
    +    case Bytecodes::_i2f: {
    +      FloatRegister rdst = dst->as_float_reg();
    +      FloatRegister rsrc = src->as_double_reg(); // via mem
    +      if (VM_Version::has_fcfids()) {
    +        __ fcfids(rdst, rsrc);
    +      } else {
    +        __ fcfid(rdst, rsrc);
    +        __ frsp(rdst, rdst);
    +      }
    +      break;
    +    }
    +    case Bytecodes::_l2f: { // >= Power7
    +      assert(VM_Version::has_fcfids(), "fcfid+frsp needs fixup code to avoid rounding incompatibility");
    +      __ fcfids(dst->as_float_reg(), src->as_double_reg()); // via mem
    +      break;
    +    }
    +    case Bytecodes::_f2d: {
    +      __ fmr_if_needed(dst->as_double_reg(), src->as_float_reg());
    +      break;
    +    }
    +    case Bytecodes::_d2f: {
    +      __ frsp(dst->as_float_reg(), src->as_double_reg());
    +      break;
    +    }
    +    case Bytecodes::_d2i:
    +    case Bytecodes::_f2i: {
    +      FloatRegister rsrc = (code == Bytecodes::_d2i) ? src->as_double_reg() : src->as_float_reg();
    +      Address       addr = frame_map()->address_for_slot(dst->double_stack_ix());
    +      Label L;
    +      // Result must be 0 if value is NaN; test by comparing value to itself.
    +      __ fcmpu(CCR0, rsrc, rsrc);
    +      __ li(R0, 0); // 0 in case of NAN
    +      __ std(R0, addr.disp(), addr.base());
    +      __ bso(CCR0, L);
    +      __ fctiwz(rsrc, rsrc); // USE_KILL
    +      __ stfd(rsrc, addr.disp(), addr.base());
    +      __ bind(L);
    +      break;
    +    }
    +    case Bytecodes::_d2l:
    +    case Bytecodes::_f2l: {
    +      FloatRegister rsrc = (code == Bytecodes::_d2l) ? src->as_double_reg() : src->as_float_reg();
    +      Address       addr = frame_map()->address_for_slot(dst->double_stack_ix());
    +      Label L;
    +      // Result must be 0 if value is NaN; test by comparing value to itself.
    +      __ fcmpu(CCR0, rsrc, rsrc);
    +      __ li(R0, 0); // 0 in case of NAN
    +      __ std(R0, addr.disp(), addr.base());
    +      __ bso(CCR0, L);
    +      __ fctidz(rsrc, rsrc); // USE_KILL
    +      __ stfd(rsrc, addr.disp(), addr.base());
    +      __ bind(L);
    +      break;
    +    }
    +
    +    default: ShouldNotReachHere();
    +  }
    +}
    +
    +
    +void LIR_Assembler::align_call(LIR_Code) {
    +  // do nothing since all instructions are word aligned on ppc
    +}
    +
    +
    +bool LIR_Assembler::emit_trampoline_stub_for_call(address target, Register Rtoc) {
    +  int start_offset = __ offset();
    +  // Put the entry point as a constant into the constant pool.
    +  const address entry_point_toc_addr   = __ address_constant(target, RelocationHolder::none);
    +  if (entry_point_toc_addr == NULL) {
    +    bailout("const section overflow");
    +    return false;
    +  }
    +  const int     entry_point_toc_offset = __ offset_to_method_toc(entry_point_toc_addr);
    +
    +  // Emit the trampoline stub which will be related to the branch-and-link below.
    +  address stub = __ emit_trampoline_stub(entry_point_toc_offset, start_offset, Rtoc);
    +  if (!stub) {
    +    bailout("no space for trampoline stub");
    +    return false;
    +  }
    +  return true;
    +}
    +
    +
    +void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) {
    +  assert(rtype==relocInfo::opt_virtual_call_type || rtype==relocInfo::static_call_type, "unexpected rtype");
    +
    +  bool success = emit_trampoline_stub_for_call(op->addr());
    +  if (!success) { return; }
    +
    +  __ relocate(rtype);
    +  // Note: At this point we do not have the address of the trampoline
    +  // stub, and the entry point might be too far away for bl, so __ pc()
    +  // serves as dummy and the bl will be patched later.
    +  __ code()->set_insts_mark();
    +  __ bl(__ pc());
    +  add_call_info(code_offset(), op->info());
    +}
    +
    +
    +void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
    +  __ calculate_address_from_global_toc(R2_TOC, __ method_toc());
    +
    +  // Virtual call relocation will point to ic load.
    +  address virtual_call_meta_addr = __ pc();
    +  // Load a clear inline cache.
    +  AddressLiteral empty_ic((address) Universe::non_oop_word());
    +  bool success = __ load_const_from_method_toc(R19_inline_cache_reg, empty_ic, R2_TOC);
    +  if (!success) {
    +    bailout("const section overflow");
    +    return;
    +  }
    +  // Call to fixup routine. Fixup routine uses ScopeDesc info
    +  // to determine who we intended to call.
    +  __ relocate(virtual_call_Relocation::spec(virtual_call_meta_addr));
    +
    +  success = emit_trampoline_stub_for_call(op->addr(), R2_TOC);
    +  if (!success) { return; }
    +
    +  // Note: At this point we do not have the address of the trampoline
    +  // stub, and the entry point might be too far away for bl, so __ pc()
    +  // serves as dummy and the bl will be patched later.
    +  __ bl(__ pc());
    +  add_call_info(code_offset(), op->info());
    +}
    +
    +
    +void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
    +  ShouldNotReachHere(); // ic_call is used instead.
    +}
    +
    +
    +void LIR_Assembler::explicit_null_check(Register addr, CodeEmitInfo* info) {
    +  ImplicitNullCheckStub* stub = new ImplicitNullCheckStub(code_offset(), info);
    +  __ null_check(addr, stub->entry());
    +  append_code_stub(stub);
    +}
    +
    +
    +// Attention: caller must encode oop if needed
    +int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool wide, bool unaligned) {
    +  int store_offset;
    +  if (!Assembler::is_simm16(offset)) {
    +    // For offsets larger than a simm16 we setup the offset.
    +    assert(wide && !from_reg->is_same_register(FrameMap::R0_opr), "large offset only supported in special case");
    +    __ load_const_optimized(R0, offset);
    +    store_offset = store(from_reg, base, R0, type, wide);
    +  } else {
    +    store_offset = code_offset();
    +    switch (type) {
    +      case T_BOOLEAN: // fall through
    +      case T_BYTE  : __ stb(from_reg->as_register(), offset, base); break;
    +      case T_CHAR  :
    +      case T_SHORT : __ sth(from_reg->as_register(), offset, base); break;
    +      case T_INT   : __ stw(from_reg->as_register(), offset, base); break;
    +      case T_LONG  : __ std(from_reg->as_register_lo(), offset, base); break;
    +      case T_ADDRESS:
    +      case T_METADATA: __ std(from_reg->as_register(), offset, base); break;
    +      case T_ARRAY : // fall through
    +      case T_OBJECT:
    +        {
    +          if (UseCompressedOops && !wide) {
    +            // Encoding done in caller
    +            __ stw(from_reg->as_register(), offset, base);
    +          } else {
    +            __ std(from_reg->as_register(), offset, base);
    +          }
    +          __ verify_oop(from_reg->as_register());
    +          break;
    +        }
    +      case T_FLOAT : __ stfs(from_reg->as_float_reg(), offset, base); break;
    +      case T_DOUBLE: __ stfd(from_reg->as_double_reg(), offset, base); break;
    +      default      : ShouldNotReachHere();
    +    }
    +  }
    +  return store_offset;
    +}
    +
    +
    +// Attention: caller must encode oop if needed
    +int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicType type, bool wide) {
    +  int store_offset = code_offset();
    +  switch (type) {
    +    case T_BOOLEAN: // fall through
    +    case T_BYTE  : __ stbx(from_reg->as_register(), base, disp); break;
    +    case T_CHAR  :
    +    case T_SHORT : __ sthx(from_reg->as_register(), base, disp); break;
    +    case T_INT   : __ stwx(from_reg->as_register(), base, disp); break;
    +    case T_LONG  :
    +#ifdef _LP64
    +      __ stdx(from_reg->as_register_lo(), base, disp);
    +#else
    +      Unimplemented();
    +#endif
    +      break;
    +    case T_ADDRESS:
    +      __ stdx(from_reg->as_register(), base, disp);
    +      break;
    +    case T_ARRAY : // fall through
    +    case T_OBJECT:
    +      {
    +        if (UseCompressedOops && !wide) {
    +          // Encoding done in caller.
    +          __ stwx(from_reg->as_register(), base, disp);
    +        } else {
    +          __ stdx(from_reg->as_register(), base, disp);
    +        }
    +        __ verify_oop(from_reg->as_register()); // kills R0
    +        break;
    +      }
    +    case T_FLOAT : __ stfsx(from_reg->as_float_reg(), base, disp); break;
    +    case T_DOUBLE: __ stfdx(from_reg->as_double_reg(), base, disp); break;
    +    default      : ShouldNotReachHere();
    +  }
    +  return store_offset;
    +}
    +
    +
    +int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool wide, bool unaligned) {
    +  int load_offset;
    +  if (!Assembler::is_simm16(offset)) {
    +    // For offsets larger than a simm16 we setup the offset.
    +    __ load_const_optimized(R0, offset);
    +    load_offset = load(base, R0, to_reg, type, wide);
    +  } else {
    +    load_offset = code_offset();
    +    switch(type) {
    +      case T_BOOLEAN: // fall through
    +      case T_BYTE  :   __ lbz(to_reg->as_register(), offset, base);
    +                       __ extsb(to_reg->as_register(), to_reg->as_register()); break;
    +      case T_CHAR  :   __ lhz(to_reg->as_register(), offset, base); break;
    +      case T_SHORT :   __ lha(to_reg->as_register(), offset, base); break;
    +      case T_INT   :   __ lwa(to_reg->as_register(), offset, base); break;
    +      case T_LONG  :   __ ld(to_reg->as_register_lo(), offset, base); break;
    +      case T_METADATA: __ ld(to_reg->as_register(), offset, base); break;
    +      case T_ADDRESS:
    +        if (offset == oopDesc::klass_offset_in_bytes() && UseCompressedClassPointers) {
    +          __ lwz(to_reg->as_register(), offset, base);
    +          __ decode_klass_not_null(to_reg->as_register());
    +        } else {
    +          __ ld(to_reg->as_register(), offset, base);
    +        }
    +        break;
    +      case T_ARRAY : // fall through
    +      case T_OBJECT:
    +        {
    +          if (UseCompressedOops && !wide) {
    +            __ lwz(to_reg->as_register(), offset, base);
    +            __ decode_heap_oop(to_reg->as_register());
    +          } else {
    +            __ ld(to_reg->as_register(), offset, base);
    +          }
    +          __ verify_oop(to_reg->as_register());
    +          break;
    +        }
    +      case T_FLOAT:  __ lfs(to_reg->as_float_reg(), offset, base); break;
    +      case T_DOUBLE: __ lfd(to_reg->as_double_reg(), offset, base); break;
    +      default      : ShouldNotReachHere();
    +    }
    +  }
    +  return load_offset;
    +}
    +
    +
    +int LIR_Assembler::load(Register base, Register disp, LIR_Opr to_reg, BasicType type, bool wide) {
    +  int load_offset = code_offset();
    +  switch(type) {
    +    case T_BOOLEAN: // fall through
    +    case T_BYTE  :  __ lbzx(to_reg->as_register(), base, disp);
    +                    __ extsb(to_reg->as_register(), to_reg->as_register()); break;
    +    case T_CHAR  :  __ lhzx(to_reg->as_register(), base, disp); break;
    +    case T_SHORT :  __ lhax(to_reg->as_register(), base, disp); break;
    +    case T_INT   :  __ lwax(to_reg->as_register(), base, disp); break;
    +    case T_ADDRESS: __ ldx(to_reg->as_register(), base, disp); break;
    +    case T_ARRAY : // fall through
    +    case T_OBJECT:
    +      {
    +        if (UseCompressedOops && !wide) {
    +          __ lwzx(to_reg->as_register(), base, disp);
    +          __ decode_heap_oop(to_reg->as_register());
    +        } else {
    +          __ ldx(to_reg->as_register(), base, disp);
    +        }
    +        __ verify_oop(to_reg->as_register());
    +        break;
    +      }
    +    case T_FLOAT:  __ lfsx(to_reg->as_float_reg() , base, disp); break;
    +    case T_DOUBLE: __ lfdx(to_reg->as_double_reg(), base, disp); break;
    +    case T_LONG  :
    +#ifdef _LP64
    +      __ ldx(to_reg->as_register_lo(), base, disp);
    +#else
    +      Unimplemented();
    +#endif
    +      break;
    +    default      : ShouldNotReachHere();
    +  }
    +  return load_offset;
    +}
    +
    +
    +void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) {
    +  LIR_Const* c = src->as_constant_ptr();
    +  Register src_reg = R0;
    +  switch (c->type()) {
    +    case T_INT:
    +    case T_FLOAT: {
    +      int value = c->as_jint_bits();
    +      __ load_const_optimized(src_reg, value);
    +      Address addr = frame_map()->address_for_slot(dest->single_stack_ix());
    +      __ stw(src_reg, addr.disp(), addr.base());
    +      break;
    +    }
    +    case T_ADDRESS: {
    +      int value = c->as_jint_bits();
    +      __ load_const_optimized(src_reg, value);
    +      Address addr = frame_map()->address_for_slot(dest->single_stack_ix());
    +      __ std(src_reg, addr.disp(), addr.base());
    +      break;
    +    }
    +    case T_OBJECT: {
    +      jobject2reg(c->as_jobject(), src_reg);
    +      Address addr = frame_map()->address_for_slot(dest->single_stack_ix());
    +      __ std(src_reg, addr.disp(), addr.base());
    +      break;
    +    }
    +    case T_LONG:
    +    case T_DOUBLE: {
    +      int value = c->as_jlong_bits();
    +      __ load_const_optimized(src_reg, value);
    +      Address addr = frame_map()->address_for_double_slot(dest->double_stack_ix());
    +      __ std(src_reg, addr.disp(), addr.base());
    +      break;
    +    }
    +    default:
    +      Unimplemented();
    +  }
    +}
    +
    +
    +void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info, bool wide) {
    +  LIR_Const* c = src->as_constant_ptr();
    +  LIR_Address* addr = dest->as_address_ptr();
    +  Register base = addr->base()->as_pointer_register();
    +  LIR_Opr tmp = LIR_OprFact::illegalOpr;
    +  int offset = -1;
    +  // Null check for large offsets in LIRGenerator::do_StoreField.
    +  bool needs_explicit_null_check = !ImplicitNullChecks;
    +
    +  if (info != NULL && needs_explicit_null_check) {
    +    explicit_null_check(base, info);
    +  }
    +
    +  switch (c->type()) {
    +    case T_FLOAT: type = T_INT;
    +    case T_INT:
    +    case T_ADDRESS: {
    +      tmp = FrameMap::R0_opr;
    +      __ load_const_optimized(tmp->as_register(), c->as_jint_bits());
    +      break;
    +    }
    +    case T_DOUBLE: type = T_LONG;
    +    case T_LONG: {
    +      tmp = FrameMap::R0_long_opr;
    +      __ load_const_optimized(tmp->as_register_lo(), c->as_jlong_bits());
    +      break;
    +    }
    +    case T_OBJECT: {
    +      tmp = FrameMap::R0_opr;
    +      if (UseCompressedOops && !wide && c->as_jobject() != NULL) {
    +        AddressLiteral oop_addr = __ constant_oop_address(c->as_jobject());
    +        __ lis(R0, oop_addr.value() >> 16); // Don't care about sign extend (will use stw).
    +        __ relocate(oop_addr.rspec(), /*compressed format*/ 1);
    +        __ ori(R0, R0, oop_addr.value() & 0xffff);
    +      } else {
    +        jobject2reg(c->as_jobject(), R0);
    +      }
    +      break;
    +    }
    +    default:
    +      Unimplemented();
    +  }
    +
    +  // Handle either reg+reg or reg+disp address.
    +  if (addr->index()->is_valid()) {
    +    assert(addr->disp() == 0, "must be zero");
    +    offset = store(tmp, base, addr->index()->as_pointer_register(), type, wide);
    +  } else {
    +    assert(Assembler::is_simm16(addr->disp()), "can't handle larger addresses");
    +    offset = store(tmp, base, addr->disp(), type, wide, false);
    +  }
    +
    +  if (info != NULL) {
    +    assert(offset != -1, "offset should've been set");
    +    if (!needs_explicit_null_check) {
    +      add_debug_info_for_null_check(offset, info);
    +    }
    +  }
    +}
    +
    +
    +void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_code, CodeEmitInfo* info) {
    +  LIR_Const* c = src->as_constant_ptr();
    +  LIR_Opr to_reg = dest;
    +
    +  switch (c->type()) {
    +    case T_INT: {
    +      assert(patch_code == lir_patch_none, "no patching handled here");
    +      __ load_const_optimized(dest->as_register(), c->as_jint(), R0);
    +      break;
    +    }
    +    case T_ADDRESS: {
    +      assert(patch_code == lir_patch_none, "no patching handled here");
    +      __ load_const_optimized(dest->as_register(), c->as_jint(), R0);  // Yes, as_jint ...
    +      break;
    +    }
    +    case T_LONG: {
    +      assert(patch_code == lir_patch_none, "no patching handled here");
    +      __ load_const_optimized(dest->as_register_lo(), c->as_jlong(), R0);
    +      break;
    +    }
    +
    +    case T_OBJECT: {
    +      if (patch_code == lir_patch_none) {
    +        jobject2reg(c->as_jobject(), to_reg->as_register());
    +      } else {
    +        jobject2reg_with_patching(to_reg->as_register(), info);
    +      }
    +      break;
    +    }
    +
    +    case T_METADATA:
    +      {
    +        if (patch_code == lir_patch_none) {
    +          metadata2reg(c->as_metadata(), to_reg->as_register());
    +        } else {
    +          klass2reg_with_patching(to_reg->as_register(), info);
    +        }
    +      }
    +      break;
    +
    +    case T_FLOAT:
    +      {
    +        if (to_reg->is_single_fpu()) {
    +          address const_addr = __ float_constant(c->as_jfloat());
    +          if (const_addr == NULL) {
    +            bailout("const section overflow");
    +            break;
    +          }
    +          RelocationHolder rspec = internal_word_Relocation::spec(const_addr);
    +          __ relocate(rspec);
    +          __ load_const(R0, const_addr);
    +          __ lfsx(to_reg->as_float_reg(), R0);
    +        } else {
    +          assert(to_reg->is_single_cpu(), "Must be a cpu register.");
    +          __ load_const_optimized(to_reg->as_register(), jint_cast(c->as_jfloat()), R0);
    +        }
    +      }
    +      break;
    +
    +    case T_DOUBLE:
    +      {
    +        if (to_reg->is_double_fpu()) {
    +          address const_addr = __ double_constant(c->as_jdouble());
    +          if (const_addr == NULL) {
    +            bailout("const section overflow");
    +            break;
    +          }
    +          RelocationHolder rspec = internal_word_Relocation::spec(const_addr);
    +          __ relocate(rspec);
    +          __ load_const(R0, const_addr);
    +          __ lfdx(to_reg->as_double_reg(), R0);
    +        } else {
    +          assert(to_reg->is_double_cpu(), "Must be a long register.");
    +          __ load_const_optimized(to_reg->as_register_lo(), jlong_cast(c->as_jdouble()), R0);
    +        }
    +      }
    +      break;
    +
    +    default:
    +      ShouldNotReachHere();
    +  }
    +}
    +
    +
    +Address LIR_Assembler::as_Address(LIR_Address* addr) {
    +  Unimplemented(); return Address();
    +}
    +
    +
    +inline RegisterOrConstant index_or_disp(LIR_Address* addr) {
    +  if (addr->index()->is_illegal()) {
    +    return (RegisterOrConstant)(addr->disp());
    +  } else {
    +    return (RegisterOrConstant)(addr->index()->as_pointer_register());
    +  }
    +}
    +
    +
    +void LIR_Assembler::stack2stack(LIR_Opr src, LIR_Opr dest, BasicType type) {
    +  const Register tmp = R0;
    +  switch (type) {
    +    case T_INT:
    +    case T_FLOAT: {
    +      Address from = frame_map()->address_for_slot(src->single_stack_ix());
    +      Address to   = frame_map()->address_for_slot(dest->single_stack_ix());
    +      __ lwz(tmp, from.disp(), from.base());
    +      __ stw(tmp, to.disp(), to.base());
    +      break;
    +    }
    +    case T_ADDRESS:
    +    case T_OBJECT: {
    +      Address from = frame_map()->address_for_slot(src->single_stack_ix());
    +      Address to   = frame_map()->address_for_slot(dest->single_stack_ix());
    +      __ ld(tmp, from.disp(), from.base());
    +      __ std(tmp, to.disp(), to.base());
    +      break;
    +    }
    +    case T_LONG:
    +    case T_DOUBLE: {
    +      Address from = frame_map()->address_for_double_slot(src->double_stack_ix());
    +      Address to   = frame_map()->address_for_double_slot(dest->double_stack_ix());
    +      __ ld(tmp, from.disp(), from.base());
    +      __ std(tmp, to.disp(), to.base());
    +      break;
    +    }
    +
    +    default:
    +      ShouldNotReachHere();
    +  }
    +}
    +
    +
    +Address LIR_Assembler::as_Address_hi(LIR_Address* addr) {
    +  Unimplemented(); return Address();
    +}
    +
    +
    +Address LIR_Assembler::as_Address_lo(LIR_Address* addr) {
    +  Unimplemented(); return Address();
    +}
    +
    +
    +void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type,
    +                            LIR_PatchCode patch_code, CodeEmitInfo* info, bool wide, bool unaligned) {
    +
    +  assert(type != T_METADATA, "load of metadata ptr not supported");
    +  LIR_Address* addr = src_opr->as_address_ptr();
    +  LIR_Opr to_reg = dest;
    +
    +  Register src = addr->base()->as_pointer_register();
    +  Register disp_reg = noreg;
    +  int disp_value = addr->disp();
    +  bool needs_patching = (patch_code != lir_patch_none);
    +  // null check for large offsets in LIRGenerator::do_LoadField
    +  bool needs_explicit_null_check = !os::zero_page_read_protected() || !ImplicitNullChecks;
    +
    +  if (info != NULL && needs_explicit_null_check) {
    +    explicit_null_check(src, info);
    +  }
    +
    +  if (addr->base()->type() == T_OBJECT) {
    +    __ verify_oop(src);
    +  }
    +
    +  PatchingStub* patch = NULL;
    +  if (needs_patching) {
    +    patch = new PatchingStub(_masm, PatchingStub::access_field_id);
    +    assert(!to_reg->is_double_cpu() ||
    +           patch_code == lir_patch_none ||
    +           patch_code == lir_patch_normal, "patching doesn't match register");
    +  }
    +
    +  if (addr->index()->is_illegal()) {
    +    if (!Assembler::is_simm16(disp_value)) {
    +      if (needs_patching) {
    +        __ load_const32(R0, 0); // patchable int
    +      } else {
    +        __ load_const_optimized(R0, disp_value);
    +      }
    +      disp_reg = R0;
    +    }
    +  } else {
    +    disp_reg = addr->index()->as_pointer_register();
    +    assert(disp_value == 0, "can't handle 3 operand addresses");
    +  }
    +
    +  // Remember the offset of the load. The patching_epilog must be done
    +  // before the call to add_debug_info, otherwise the PcDescs don't get
    +  // entered in increasing order.
    +  int offset;
    +
    +  if (disp_reg == noreg) {
    +    assert(Assembler::is_simm16(disp_value), "should have set this up");
    +    offset = load(src, disp_value, to_reg, type, wide, unaligned);
    +  } else {
    +    assert(!unaligned, "unexpected");
    +    offset = load(src, disp_reg, to_reg, type, wide);
    +  }
    +
    +  if (patch != NULL) {
    +    patching_epilog(patch, patch_code, src, info);
    +  }
    +  if (info != NULL && !needs_explicit_null_check) {
    +    add_debug_info_for_null_check(offset, info);
    +  }
    +}
    +
    +
    +void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) {
    +  Address addr;
    +  if (src->is_single_word()) {
    +    addr = frame_map()->address_for_slot(src->single_stack_ix());
    +  } else if (src->is_double_word())  {
    +    addr = frame_map()->address_for_double_slot(src->double_stack_ix());
    +  }
    +
    +  bool unaligned = (addr.disp() - STACK_BIAS) % 8 != 0;
    +  load(addr.base(), addr.disp(), dest, dest->type(), true /*wide*/, unaligned);
    +}
    +
    +
    +void LIR_Assembler::reg2stack(LIR_Opr from_reg, LIR_Opr dest, BasicType type, bool pop_fpu_stack) {
    +  Address addr;
    +  if (dest->is_single_word()) {
    +    addr = frame_map()->address_for_slot(dest->single_stack_ix());
    +  } else if (dest->is_double_word())  {
    +    addr = frame_map()->address_for_slot(dest->double_stack_ix());
    +  }
    +  bool unaligned = (addr.disp() - STACK_BIAS) % 8 != 0;
    +  store(from_reg, addr.base(), addr.disp(), from_reg->type(), true /*wide*/, unaligned);
    +}
    +
    +
    +void LIR_Assembler::reg2reg(LIR_Opr from_reg, LIR_Opr to_reg) {
    +  if (from_reg->is_float_kind() && to_reg->is_float_kind()) {
    +    if (from_reg->is_double_fpu()) {
    +      // double to double moves
    +      assert(to_reg->is_double_fpu(), "should match");
    +      __ fmr_if_needed(to_reg->as_double_reg(), from_reg->as_double_reg());
    +    } else {
    +      // float to float moves
    +      assert(to_reg->is_single_fpu(), "should match");
    +      __ fmr_if_needed(to_reg->as_float_reg(), from_reg->as_float_reg());
    +    }
    +  } else if (!from_reg->is_float_kind() && !to_reg->is_float_kind()) {
    +    if (from_reg->is_double_cpu()) {
    +      __ mr_if_needed(to_reg->as_pointer_register(), from_reg->as_pointer_register());
    +    } else if (to_reg->is_double_cpu()) {
    +      // int to int moves
    +      __ mr_if_needed(to_reg->as_register_lo(), from_reg->as_register());
    +    } else {
    +      // int to int moves
    +      __ mr_if_needed(to_reg->as_register(), from_reg->as_register());
    +    }
    +  } else {
    +    ShouldNotReachHere();
    +  }
    +  if (to_reg->type() == T_OBJECT || to_reg->type() == T_ARRAY) {
    +    __ verify_oop(to_reg->as_register());
    +  }
    +}
    +
    +
    +void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type,
    +                            LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack,
    +                            bool wide, bool unaligned) {
    +  assert(type != T_METADATA, "store of metadata ptr not supported");
    +  LIR_Address* addr = dest->as_address_ptr();
    +
    +  Register src = addr->base()->as_pointer_register();
    +  Register disp_reg = noreg;
    +  int disp_value = addr->disp();
    +  bool needs_patching = (patch_code != lir_patch_none);
    +  bool compress_oop = (type == T_ARRAY || type == T_OBJECT) && UseCompressedOops && !wide &&
    +                      Universe::narrow_oop_mode() != Universe::UnscaledNarrowOop;
    +  bool load_disp = addr->index()->is_illegal() && !Assembler::is_simm16(disp_value);
    +  bool use_R29 = compress_oop && load_disp; // Avoid register conflict, also do null check before killing R29.
    +  // Null check for large offsets in LIRGenerator::do_StoreField.
    +  bool needs_explicit_null_check = !ImplicitNullChecks || use_R29;
    +
    +  if (info != NULL && needs_explicit_null_check) {
    +    explicit_null_check(src, info);
    +  }
    +
    +  if (addr->base()->is_oop_register()) {
    +    __ verify_oop(src);
    +  }
    +
    +  PatchingStub* patch = NULL;
    +  if (needs_patching) {
    +    patch = new PatchingStub(_masm, PatchingStub::access_field_id);
    +    assert(!from_reg->is_double_cpu() ||
    +           patch_code == lir_patch_none ||
    +           patch_code == lir_patch_normal, "patching doesn't match register");
    +  }
    +
    +  if (addr->index()->is_illegal()) {
    +    if (load_disp) {
    +      disp_reg = use_R29 ? R29_TOC : R0;
    +      if (needs_patching) {
    +        __ load_const32(disp_reg, 0); // patchable int
    +      } else {
    +        __ load_const_optimized(disp_reg, disp_value);
    +      }
    +    }
    +  } else {
    +    disp_reg = addr->index()->as_pointer_register();
    +    assert(disp_value == 0, "can't handle 3 operand addresses");
    +  }
    +
    +  // remember the offset of the store. The patching_epilog must be done
    +  // before the call to add_debug_info_for_null_check, otherwise the PcDescs don't get
    +  // entered in increasing order.
    +  int offset;
    +
    +  if (compress_oop) {
    +    Register co = __ encode_heap_oop(R0, from_reg->as_register());
    +    from_reg = FrameMap::as_opr(co);
    +  }
    +
    +  if (disp_reg == noreg) {
    +    assert(Assembler::is_simm16(disp_value), "should have set this up");
    +    offset = store(from_reg, src, disp_value, type, wide, unaligned);
    +  } else {
    +    assert(!unaligned, "unexpected");
    +    offset = store(from_reg, src, disp_reg, type, wide);
    +  }
    +
    +  if (use_R29) {
    +    __ load_const_optimized(R29_TOC, MacroAssembler::global_toc(), R0); // reinit
    +  }
    +
    +  if (patch != NULL) {
    +    patching_epilog(patch, patch_code, src, info);
    +  }
    +
    +  if (info != NULL && !needs_explicit_null_check) {
    +    add_debug_info_for_null_check(offset, info);
    +  }
    +}
    +
    +
    +void LIR_Assembler::return_op(LIR_Opr result) {
    +  const Register return_pc        = R11;
    +  const Register polling_page     = R12;
    +
    +  // Pop the stack before the safepoint code.
    +  int frame_size = initial_frame_size_in_bytes();
    +  if (Assembler::is_simm(frame_size, 16)) {
    +    __ addi(R1_SP, R1_SP, frame_size);
    +  } else {
    +    __ pop_frame();
    +  }
    +
    +  if (LoadPollAddressFromThread) {
    +    // TODO: PPC port __ ld(polling_page, in_bytes(JavaThread::poll_address_offset()), R16_thread);
    +    Unimplemented();
    +  } else {
    +    __ load_const_optimized(polling_page, (long)(address) os::get_polling_page(), R0); // TODO: PPC port: get_standard_polling_page()
    +  }
    +
    +  // Restore return pc relative to callers' sp.
    +  __ ld(return_pc, _abi(lr), R1_SP);
    +  // Move return pc to LR.
    +  __ mtlr(return_pc);
    +
    +  // We need to mark the code position where the load from the safepoint
    +  // polling page was emitted as relocInfo::poll_return_type here.
    +  __ relocate(relocInfo::poll_return_type);
    +  __ load_from_polling_page(polling_page);
    +
    +  // Return.
    +  __ blr();
    +}
    +
    +
    +int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
    +
    +  if (LoadPollAddressFromThread) {
    +    const Register poll_addr = tmp->as_register();
    +    // TODO: PPC port __ ld(poll_addr, in_bytes(JavaThread::poll_address_offset()), R16_thread);
    +    Unimplemented();
    +    __ relocate(relocInfo::poll_type); // XXX
    +    guarantee(info != NULL, "Shouldn't be NULL");
    +    int offset = __ offset();
    +    add_debug_info_for_branch(info);
    +    __ load_from_polling_page(poll_addr);
    +    return offset;
    +  }
    +
    +  __ load_const_optimized(tmp->as_register(), (intptr_t)os::get_polling_page(), R0); // TODO: PPC port: get_standard_polling_page()
    +  if (info != NULL) {
    +    add_debug_info_for_branch(info);
    +  }
    +  int offset = __ offset();
    +  __ relocate(relocInfo::poll_type);
    +  __ load_from_polling_page(tmp->as_register());
    +
    +  return offset;
    +}
    +
    +
    +void LIR_Assembler::emit_static_call_stub() {
    +  address call_pc = __ pc();
    +  address stub = __ start_a_stub(max_static_call_stub_size);
    +  if (stub == NULL) {
    +    bailout("static call stub overflow");
    +    return;
    +  }
    +
    +  // For java_to_interp stubs we use R11_scratch1 as scratch register
    +  // and in call trampoline stubs we use R12_scratch2. This way we
    +  // can distinguish them (see is_NativeCallTrampolineStub_at()).
    +  const Register reg_scratch = R11_scratch1;
    +
    +  // Create a static stub relocation which relates this stub
    +  // with the call instruction at insts_call_instruction_offset in the
    +  // instructions code-section.
    +  int start = __ offset();
    +  __ relocate(static_stub_Relocation::spec(call_pc));
    +
    +  // Now, create the stub's code:
    +  // - load the TOC
    +  // - load the inline cache oop from the constant pool
    +  // - load the call target from the constant pool
    +  // - call
    +  __ calculate_address_from_global_toc(reg_scratch, __ method_toc());
    +  AddressLiteral ic = __ allocate_metadata_address((Metadata *)NULL);
    +  bool success = __ load_const_from_method_toc(R19_inline_cache_reg, ic, reg_scratch, /*fixed_size*/ true);
    +
    +  if (ReoptimizeCallSequences) {
    +    __ b64_patchable((address)-1, relocInfo::none);
    +  } else {
    +    AddressLiteral a((address)-1);
    +    success = success && __ load_const_from_method_toc(reg_scratch, a, reg_scratch, /*fixed_size*/ true);
    +    __ mtctr(reg_scratch);
    +    __ bctr();
    +  }
    +  if (!success) {
    +    bailout("const section overflow");
    +    return;
    +  }
    +
    +  assert(__ offset() - start <= max_static_call_stub_size, "stub too big");
    +  __ end_a_stub();
    +}
    +
    +
    +void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Op2* op) {
    +  bool unsigned_comp = (condition == lir_cond_belowEqual || condition == lir_cond_aboveEqual);
    +  if (opr1->is_single_fpu()) {
    +    __ fcmpu(BOOL_RESULT, opr1->as_float_reg(), opr2->as_float_reg());
    +  } else if (opr1->is_double_fpu()) {
    +    __ fcmpu(BOOL_RESULT, opr1->as_double_reg(), opr2->as_double_reg());
    +  } else if (opr1->is_single_cpu()) {
    +    if (opr2->is_constant()) {
    +      switch (opr2->as_constant_ptr()->type()) {
    +        case T_INT:
    +          {
    +            jint con = opr2->as_constant_ptr()->as_jint();
    +            if (unsigned_comp) {
    +              if (Assembler::is_uimm(con, 16)) {
    +                __ cmplwi(BOOL_RESULT, opr1->as_register(), con);
    +              } else {
    +                __ load_const_optimized(R0, con);
    +                __ cmplw(BOOL_RESULT, opr1->as_register(), R0);
    +              }
    +            } else {
    +              if (Assembler::is_simm(con, 16)) {
    +                __ cmpwi(BOOL_RESULT, opr1->as_register(), con);
    +              } else {
    +                __ load_const_optimized(R0, con);
    +                __ cmpw(BOOL_RESULT, opr1->as_register(), R0);
    +              }
    +            }
    +          }
    +          break;
    +
    +        case T_OBJECT:
    +          // There are only equal/notequal comparisons on objects.
    +          {
    +            assert(condition == lir_cond_equal || condition == lir_cond_notEqual, "oops");
    +            jobject con = opr2->as_constant_ptr()->as_jobject();
    +            if (con == NULL) {
    +              __ cmpdi(BOOL_RESULT, opr1->as_register(), 0);
    +            } else {
    +              jobject2reg(con, R0);
    +              __ cmpd(BOOL_RESULT, opr1->as_register(), R0);
    +            }
    +          }
    +          break;
    +
    +        default:
    +          ShouldNotReachHere();
    +          break;
    +      }
    +    } else {
    +      if (opr2->is_address()) {
    +        DEBUG_ONLY( Unimplemented(); ) // Seems to be unused at the moment.
    +        LIR_Address *addr = opr2->as_address_ptr();
    +        BasicType type = addr->type();
    +        if (type == T_OBJECT) { __ ld(R0, index_or_disp(addr), addr->base()->as_register()); }
    +        else                  { __ lwa(R0, index_or_disp(addr), addr->base()->as_register()); }
    +        __ cmpd(BOOL_RESULT, opr1->as_register(), R0);
    +      } else {
    +        if (unsigned_comp) {
    +          __ cmplw(BOOL_RESULT, opr1->as_register(), opr2->as_register());
    +        } else {
    +          __ cmpw(BOOL_RESULT, opr1->as_register(), opr2->as_register());
    +        }
    +      }
    +    }
    +  } else if (opr1->is_double_cpu()) {
    +    if (opr2->is_constant()) {
    +      jlong con = opr2->as_constant_ptr()->as_jlong();
    +      if (unsigned_comp) {
    +        if (Assembler::is_uimm(con, 16)) {
    +          __ cmpldi(BOOL_RESULT, opr1->as_register_lo(), con);
    +        } else {
    +          __ load_const_optimized(R0, con);
    +          __ cmpld(BOOL_RESULT, opr1->as_register_lo(), R0);
    +        }
    +      } else {
    +        if (Assembler::is_simm(con, 16)) {
    +          __ cmpdi(BOOL_RESULT, opr1->as_register_lo(), con);
    +        } else {
    +          __ load_const_optimized(R0, con);
    +          __ cmpd(BOOL_RESULT, opr1->as_register_lo(), R0);
    +        }
    +      }
    +    } else if (opr2->is_register()) {
    +      if (unsigned_comp) {
    +        __ cmpld(BOOL_RESULT, opr1->as_register_lo(), opr2->as_register_lo());
    +      } else {
    +        __ cmpd(BOOL_RESULT, opr1->as_register_lo(), opr2->as_register_lo());
    +      }
    +    } else {
    +      ShouldNotReachHere();
    +    }
    +  } else if (opr1->is_address()) {
    +    DEBUG_ONLY( Unimplemented(); ) // Seems to be unused at the moment.
    +    LIR_Address * addr = opr1->as_address_ptr();
    +    BasicType type = addr->type();
    +    assert (opr2->is_constant(), "Checking");
    +    if (type == T_OBJECT) { __ ld(R0, index_or_disp(addr), addr->base()->as_register()); }
    +    else                  { __ lwa(R0, index_or_disp(addr), addr->base()->as_register()); }
    +    __ cmpdi(BOOL_RESULT, R0, opr2->as_constant_ptr()->as_jint());
    +  } else {
    +    ShouldNotReachHere();
    +  }
    +}
    +
    +
    +void LIR_Assembler::comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dst, LIR_Op2* op){
    +  const Register Rdst = dst->as_register();
    +  Label done;
    +  if (code == lir_cmp_fd2i || code == lir_ucmp_fd2i) {
    +    bool is_unordered_less = (code == lir_ucmp_fd2i);
    +    if (left->is_single_fpu()) {
    +      __ fcmpu(CCR0, left->as_float_reg(), right->as_float_reg());
    +    } else if (left->is_double_fpu()) {
    +      __ fcmpu(CCR0, left->as_double_reg(), right->as_double_reg());
    +    } else {
    +      ShouldNotReachHere();
    +    }
    +    __ li(Rdst, is_unordered_less ? -1 : 1);
    +    __ bso(CCR0, done);
    +  } else if (code == lir_cmp_l2i) {
    +    __ cmpd(CCR0, left->as_register_lo(), right->as_register_lo());
    +  } else {
    +    ShouldNotReachHere();
    +  }
    +  __ mfcr(R0); // set bit 32..33 as follows: <: 0b10, =: 0b00, >: 0b01
    +  __ srwi(Rdst, R0, 30);
    +  __ srawi(R0, R0, 31);
    +  __ orr(Rdst, R0, Rdst); // set result as follows: <: -1, =: 0, >: 1
    +  __ bind(done);
    +}
    +
    +
    +inline void load_to_reg(LIR_Assembler *lasm, LIR_Opr src, LIR_Opr dst) {
    +  if (src->is_constant()) {
    +    lasm->const2reg(src, dst, lir_patch_none, NULL);
    +  } else if (src->is_register()) {
    +    lasm->reg2reg(src, dst);
    +  } else if (src->is_stack()) {
    +    lasm->stack2reg(src, dst, dst->type());
    +  } else {
    +    ShouldNotReachHere();
    +  }
    +}
    +
    +
    +void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) {
    +  if (opr1->is_equal(opr2) || opr1->is_same_register(opr2)) {
    +    load_to_reg(this, opr1, result); // Condition doesn't matter.
    +    return;
    +  }
    +
    +  bool positive = false;
    +  Assembler::Condition cond = Assembler::equal;
    +  switch (condition) {
    +    case lir_cond_equal:        positive = true ; cond = Assembler::equal  ; break;
    +    case lir_cond_notEqual:     positive = false; cond = Assembler::equal  ; break;
    +    case lir_cond_less:         positive = true ; cond = Assembler::less   ; break;
    +    case lir_cond_belowEqual:
    +    case lir_cond_lessEqual:    positive = false; cond = Assembler::greater; break;
    +    case lir_cond_greater:      positive = true ; cond = Assembler::greater; break;
    +    case lir_cond_aboveEqual:
    +    case lir_cond_greaterEqual: positive = false; cond = Assembler::less   ; break;
    +    default:                    ShouldNotReachHere();
    +  }
    +
    +  // Try to use isel on >=Power7.
    +  if (VM_Version::has_isel() && result->is_cpu_register()) {
    +    bool o1_is_reg = opr1->is_cpu_register(), o2_is_reg = opr2->is_cpu_register();
    +    const Register result_reg = result->is_single_cpu() ? result->as_register() : result->as_register_lo();
    +
    +    // We can use result_reg to load one operand if not already in register.
    +    Register first  = o1_is_reg ? (opr1->is_single_cpu() ? opr1->as_register() : opr1->as_register_lo()) : result_reg,
    +             second = o2_is_reg ? (opr2->is_single_cpu() ? opr2->as_register() : opr2->as_register_lo()) : result_reg;
    +
    +    if (first != second) {
    +      if (!o1_is_reg) {
    +        load_to_reg(this, opr1, result);
    +      }
    +
    +      if (!o2_is_reg) {
    +        load_to_reg(this, opr2, result);
    +      }
    +
    +      __ isel(result_reg, BOOL_RESULT, cond, !positive, first, second);
    +      return;
    +    }
    +  } // isel
    +
    +  load_to_reg(this, opr1, result);
    +
    +  Label skip;
    +  int bo = positive ? Assembler::bcondCRbiIs1 : Assembler::bcondCRbiIs0;
    +  int bi = Assembler::bi0(BOOL_RESULT, cond);
    +  __ bc(bo, bi, skip);
    +
    +  load_to_reg(this, opr2, result);
    +  __ bind(skip);
    +}
    +
    +
    +void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest,
    +                             CodeEmitInfo* info, bool pop_fpu_stack) {
    +  assert(info == NULL, "unused on this code path");
    +  assert(left->is_register(), "wrong items state");
    +  assert(dest->is_register(), "wrong items state");
    +
    +  if (right->is_register()) {
    +    if (dest->is_float_kind()) {
    +
    +      FloatRegister lreg, rreg, res;
    +      if (right->is_single_fpu()) {
    +        lreg = left->as_float_reg();
    +        rreg = right->as_float_reg();
    +        res  = dest->as_float_reg();
    +        switch (code) {
    +          case lir_add: __ fadds(res, lreg, rreg); break;
    +          case lir_sub: __ fsubs(res, lreg, rreg); break;
    +          case lir_mul: // fall through
    +          case lir_mul_strictfp: __ fmuls(res, lreg, rreg); break;
    +          case lir_div: // fall through
    +          case lir_div_strictfp: __ fdivs(res, lreg, rreg); break;
    +          default: ShouldNotReachHere();
    +        }
    +      } else {
    +        lreg = left->as_double_reg();
    +        rreg = right->as_double_reg();
    +        res  = dest->as_double_reg();
    +        switch (code) {
    +          case lir_add: __ fadd(res, lreg, rreg); break;
    +          case lir_sub: __ fsub(res, lreg, rreg); break;
    +          case lir_mul: // fall through
    +          case lir_mul_strictfp: __ fmul(res, lreg, rreg); break;
    +          case lir_div: // fall through
    +          case lir_div_strictfp: __ fdiv(res, lreg, rreg); break;
    +          default: ShouldNotReachHere();
    +        }
    +      }
    +
    +    } else if (dest->is_double_cpu()) {
    +
    +      Register dst_lo = dest->as_register_lo();
    +      Register op1_lo = left->as_pointer_register();
    +      Register op2_lo = right->as_pointer_register();
    +
    +      switch (code) {
    +        case lir_add: __ add(dst_lo, op1_lo, op2_lo); break;
    +        case lir_sub: __ sub(dst_lo, op1_lo, op2_lo); break;
    +        case lir_mul: __ mulld(dst_lo, op1_lo, op2_lo); break;
    +        default: ShouldNotReachHere();
    +      }
    +    } else {
    +      assert (right->is_single_cpu(), "Just Checking");
    +
    +      Register lreg = left->as_register();
    +      Register res  = dest->as_register();
    +      Register rreg = right->as_register();
    +      switch (code) {
    +        case lir_add:  __ add  (res, lreg, rreg); break;
    +        case lir_sub:  __ sub  (res, lreg, rreg); break;
    +        case lir_mul:  __ mullw(res, lreg, rreg); break;
    +        default: ShouldNotReachHere();
    +      }
    +    }
    +  } else {
    +    assert (right->is_constant(), "must be constant");
    +
    +    if (dest->is_single_cpu()) {
    +      Register lreg = left->as_register();
    +      Register res  = dest->as_register();
    +      int    simm16 = right->as_constant_ptr()->as_jint();
    +
    +      switch (code) {
    +        case lir_sub:  assert(Assembler::is_simm16(-simm16), "cannot encode"); // see do_ArithmeticOp_Int
    +                       simm16 = -simm16;
    +        case lir_add:  if (res == lreg && simm16 == 0) break;
    +                       __ addi(res, lreg, simm16); break;
    +        case lir_mul:  if (res == lreg && simm16 == 1) break;
    +                       __ mulli(res, lreg, simm16); break;
    +        default: ShouldNotReachHere();
    +      }
    +    } else {
    +      Register lreg = left->as_pointer_register();
    +      Register res  = dest->as_register_lo();
    +      long con = right->as_constant_ptr()->as_jlong();
    +      assert(Assembler::is_simm16(con), "must be simm16");
    +
    +      switch (code) {
    +        case lir_sub:  assert(Assembler::is_simm16(-con), "cannot encode");  // see do_ArithmeticOp_Long
    +                       con = -con;
    +        case lir_add:  if (res == lreg && con == 0) break;
    +                       __ addi(res, lreg, (int)con); break;
    +        case lir_mul:  if (res == lreg && con == 1) break;
    +                       __ mulli(res, lreg, (int)con); break;
    +        default: ShouldNotReachHere();
    +      }
    +    }
    +  }
    +}
    +
    +
    +void LIR_Assembler::fpop() {
    +  Unimplemented();
    +  // do nothing
    +}
    +
    +
    +void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr thread, LIR_Opr dest, LIR_Op* op) {
    +  switch (code) {
    +    case lir_sqrt: {
    +      __ fsqrt(dest->as_double_reg(), value->as_double_reg());
    +      break;
    +    }
    +    case lir_abs: {
    +      __ fabs(dest->as_double_reg(), value->as_double_reg());
    +      break;
    +    }
    +    default: {
    +      ShouldNotReachHere();
    +      break;
    +    }
    +  }
    +}
    +
    +
    +void LIR_Assembler::logic_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest) {
    +  if (right->is_constant()) { // see do_LogicOp
    +    long uimm;
    +    Register d, l;
    +    if (dest->is_single_cpu()) {
    +      uimm = right->as_constant_ptr()->as_jint();
    +      d = dest->as_register();
    +      l = left->as_register();
    +    } else {
    +      uimm = right->as_constant_ptr()->as_jlong();
    +      d = dest->as_register_lo();
    +      l = left->as_register_lo();
    +    }
    +    long uimms  = (unsigned long)uimm >> 16,
    +         uimmss = (unsigned long)uimm >> 32;
    +
    +    switch (code) {
    +      case lir_logic_and:
    +        if (uimmss != 0 || (uimms != 0 && (uimm & 0xFFFF) != 0) || is_power_of_2_long(uimm)) {
    +          __ andi(d, l, uimm); // special cases
    +        } else if (uimms != 0) { __ andis_(d, l, uimms); }
    +        else { __ andi_(d, l, uimm); }
    +        break;
    +
    +      case lir_logic_or:
    +        if (uimms != 0) { assert((uimm & 0xFFFF) == 0, "sanity"); __ oris(d, l, uimms); }
    +        else { __ ori(d, l, uimm); }
    +        break;
    +
    +      case lir_logic_xor:
    +        if (uimm == -1) { __ nand(d, l, l); } // special case
    +        else if (uimms != 0) { assert((uimm & 0xFFFF) == 0, "sanity"); __ xoris(d, l, uimms); }
    +        else { __ xori(d, l, uimm); }
    +        break;
    +
    +      default: ShouldNotReachHere();
    +    }
    +  } else {
    +    assert(right->is_register(), "right should be in register");
    +
    +    if (dest->is_single_cpu()) {
    +      switch (code) {
    +        case lir_logic_and: __ andr(dest->as_register(), left->as_register(), right->as_register()); break;
    +        case lir_logic_or:  __ orr (dest->as_register(), left->as_register(), right->as_register()); break;
    +        case lir_logic_xor: __ xorr(dest->as_register(), left->as_register(), right->as_register()); break;
    +        default: ShouldNotReachHere();
    +      }
    +    } else {
    +      Register l = (left->is_single_cpu() && left->is_oop_register()) ? left->as_register() :
    +                                                                        left->as_register_lo();
    +      Register r = (right->is_single_cpu() && right->is_oop_register()) ? right->as_register() :
    +                                                                          right->as_register_lo();
    +
    +      switch (code) {
    +        case lir_logic_and: __ andr(dest->as_register_lo(), l, r); break;
    +        case lir_logic_or:  __ orr (dest->as_register_lo(), l, r); break;
    +        case lir_logic_xor: __ xorr(dest->as_register_lo(), l, r); break;
    +        default: ShouldNotReachHere();
    +      }
    +    }
    +  }
    +}
    +
    +
    +int LIR_Assembler::shift_amount(BasicType t) {
    +  int elem_size = type2aelembytes(t);
    +  switch (elem_size) {
    +    case 1 : return 0;
    +    case 2 : return 1;
    +    case 4 : return 2;
    +    case 8 : return 3;
    +  }
    +  ShouldNotReachHere();
    +  return -1;
    +}
    +
    +
    +void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmitInfo* info) {
    +  info->add_register_oop(exceptionOop);
    +
    +  // Reuse the debug info from the safepoint poll for the throw op itself.
    +  address pc_for_athrow = __ pc();
    +  int pc_for_athrow_offset = __ offset();
    +  //RelocationHolder rspec = internal_word_Relocation::spec(pc_for_athrow);
    +  //__ relocate(rspec);
    +  //__ load_const(exceptionPC->as_register(), pc_for_athrow, R0);
    +  __ calculate_address_from_global_toc(exceptionPC->as_register(), pc_for_athrow, true, true, /*add_relocation*/ true);
    +  add_call_info(pc_for_athrow_offset, info); // for exception handler
    +
    +  address stub = Runtime1::entry_for(compilation()->has_fpu_code() ? Runtime1::handle_exception_id
    +                                                                   : Runtime1::handle_exception_nofpu_id);
    +  //__ load_const_optimized(R0, stub);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
    +  __ mtctr(R0);
    +  __ bctr();
    +}
    +
    +
    +void LIR_Assembler::unwind_op(LIR_Opr exceptionOop) {
    +  // Note: Not used with EnableDebuggingOnDemand.
    +  assert(exceptionOop->as_register() == R3, "should match");
    +  __ b(_unwind_handler_entry);
    +}
    +
    +
    +void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
    +  Register src = op->src()->as_register();
    +  Register dst = op->dst()->as_register();
    +  Register src_pos = op->src_pos()->as_register();
    +  Register dst_pos = op->dst_pos()->as_register();
    +  Register length  = op->length()->as_register();
    +  Register tmp = op->tmp()->as_register();
    +  Register tmp2 = R0;
    +
    +  int flags = op->flags();
    +  ciArrayKlass* default_type = op->expected_type();
    +  BasicType basic_type = default_type != NULL ? default_type->element_type()->basic_type() : T_ILLEGAL;
    +  if (basic_type == T_ARRAY) basic_type = T_OBJECT;
    +
    +  // Set up the arraycopy stub information.
    +  ArrayCopyStub* stub = op->stub();
    +  const int frame_resize = frame::abi_reg_args_size - sizeof(frame::jit_abi); // C calls need larger frame.
    +
    +  // Always do stub if no type information is available. It's ok if
    +  // the known type isn't loaded since the code sanity checks
    +  // in debug mode and the type isn't required when we know the exact type
    +  // also check that the type is an array type.
    +  if (op->expected_type() == NULL) {
    +    assert(src->is_nonvolatile() && src_pos->is_nonvolatile() && dst->is_nonvolatile() && dst_pos->is_nonvolatile() &&
    +           length->is_nonvolatile(), "must preserve");
    +    // 3 parms are int. Convert to long.
    +    __ mr(R3_ARG1, src);
    +    __ extsw(R4_ARG2, src_pos);
    +    __ mr(R5_ARG3, dst);
    +    __ extsw(R6_ARG4, dst_pos);
    +    __ extsw(R7_ARG5, length);
    +    address copyfunc_addr = StubRoutines::generic_arraycopy();
    +
    +    if (copyfunc_addr == NULL) { // Use C version if stub was not generated.
    +      address entry = CAST_FROM_FN_PTR(address, Runtime1::arraycopy);
    +      __ call_c_with_frame_resize(entry, frame_resize);
    +    } else {
    +#ifndef PRODUCT
    +      if (PrintC1Statistics) {
    +        address counter = (address)&Runtime1::_generic_arraycopystub_cnt;
    +        int simm16_offs = __ load_const_optimized(tmp, counter, tmp2, true);
    +        __ lwz(R11_scratch1, simm16_offs, tmp);
    +        __ addi(R11_scratch1, R11_scratch1, 1);
    +        __ stw(R11_scratch1, simm16_offs, tmp);
    +      }
    +#endif
    +      __ call_c_with_frame_resize(copyfunc_addr, /*stub does not need resized frame*/ 0);
    +
    +      __ nand(tmp, R3_RET, R3_RET);
    +      __ subf(length, tmp, length);
    +      __ add(src_pos, tmp, src_pos);
    +      __ add(dst_pos, tmp, dst_pos);
    +    }
    +
    +    __ cmpwi(CCR0, R3_RET, 0);
    +    __ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::less), *stub->entry());
    +    __ bind(*stub->continuation());
    +    return;
    +  }
    +
    +  assert(default_type != NULL && default_type->is_array_klass(), "must be true at this point");
    +  Label cont, slow, copyfunc;
    +
    +  bool simple_check_flag_set = flags & (LIR_OpArrayCopy::src_null_check |
    +                                        LIR_OpArrayCopy::dst_null_check |
    +                                        LIR_OpArrayCopy::src_pos_positive_check |
    +                                        LIR_OpArrayCopy::dst_pos_positive_check |
    +                                        LIR_OpArrayCopy::length_positive_check);
    +
    +  // Use only one conditional branch for simple checks.
    +  if (simple_check_flag_set) {
    +    ConditionRegister combined_check = CCR1, tmp_check = CCR1;
    +
    +    // Make sure src and dst are non-null.
    +    if (flags & LIR_OpArrayCopy::src_null_check) {
    +      __ cmpdi(combined_check, src, 0);
    +      tmp_check = CCR0;
    +    }
    +
    +    if (flags & LIR_OpArrayCopy::dst_null_check) {
    +      __ cmpdi(tmp_check, dst, 0);
    +      if (tmp_check != combined_check) {
    +        __ cror(combined_check, Assembler::equal, tmp_check, Assembler::equal);
    +      }
    +      tmp_check = CCR0;
    +    }
    +
    +    // Clear combined_check.eq if not already used.
    +    if (tmp_check == combined_check) {
    +      __ crandc(combined_check, Assembler::equal, combined_check, Assembler::equal);
    +      tmp_check = CCR0;
    +    }
    +
    +    if (flags & LIR_OpArrayCopy::src_pos_positive_check) {
    +      // Test src_pos register.
    +      __ cmpwi(tmp_check, src_pos, 0);
    +      __ cror(combined_check, Assembler::equal, tmp_check, Assembler::less);
    +    }
    +
    +    if (flags & LIR_OpArrayCopy::dst_pos_positive_check) {
    +      // Test dst_pos register.
    +      __ cmpwi(tmp_check, dst_pos, 0);
    +      __ cror(combined_check, Assembler::equal, tmp_check, Assembler::less);
    +    }
    +
    +    if (flags & LIR_OpArrayCopy::length_positive_check) {
    +      // Make sure length isn't negative.
    +      __ cmpwi(tmp_check, length, 0);
    +      __ cror(combined_check, Assembler::equal, tmp_check, Assembler::less);
    +    }
    +
    +    __ beq(combined_check, slow);
    +  }
    +
    +  // Higher 32bits must be null.
    +  __ extsw(length, length);
    +
    +  __ extsw(src_pos, src_pos);
    +  if (flags & LIR_OpArrayCopy::src_range_check) {
    +    __ lwz(tmp2, arrayOopDesc::length_offset_in_bytes(), src);
    +    __ add(tmp, length, src_pos);
    +    __ cmpld(CCR0, tmp2, tmp);
    +    __ ble(CCR0, slow);
    +  }
    +
    +  __ extsw(dst_pos, dst_pos);
    +  if (flags & LIR_OpArrayCopy::dst_range_check) {
    +    __ lwz(tmp2, arrayOopDesc::length_offset_in_bytes(), dst);
    +    __ add(tmp, length, dst_pos);
    +    __ cmpld(CCR0, tmp2, tmp);
    +    __ ble(CCR0, slow);
    +  }
    +
    +  int shift = shift_amount(basic_type);
    +
    +  if (!(flags & LIR_OpArrayCopy::type_check)) {
    +    __ b(cont);
    +  } else {
    +    // We don't know the array types are compatible.
    +    if (basic_type != T_OBJECT) {
    +      // Simple test for basic type arrays.
    +      if (UseCompressedClassPointers) {
    +        // We don't need decode because we just need to compare.
    +        __ lwz(tmp, oopDesc::klass_offset_in_bytes(), src);
    +        __ lwz(tmp2, oopDesc::klass_offset_in_bytes(), dst);
    +        __ cmpw(CCR0, tmp, tmp2);
    +      } else {
    +        __ ld(tmp, oopDesc::klass_offset_in_bytes(), src);
    +        __ ld(tmp2, oopDesc::klass_offset_in_bytes(), dst);
    +        __ cmpd(CCR0, tmp, tmp2);
    +      }
    +      __ beq(CCR0, cont);
    +    } else {
    +      // For object arrays, if src is a sub class of dst then we can
    +      // safely do the copy.
    +      address copyfunc_addr = StubRoutines::checkcast_arraycopy();
    +
    +      const Register sub_klass = R5, super_klass = R4; // like CheckCast/InstanceOf
    +      assert_different_registers(tmp, tmp2, sub_klass, super_klass);
    +
    +      __ load_klass(sub_klass, src);
    +      __ load_klass(super_klass, dst);
    +
    +      __ check_klass_subtype_fast_path(sub_klass, super_klass, tmp, tmp2,
    +                                       &cont, copyfunc_addr != NULL ? ©func : &slow, NULL);
    +
    +      address slow_stc = Runtime1::entry_for(Runtime1::slow_subtype_check_id);
    +      //__ load_const_optimized(tmp, slow_stc, tmp2);
    +      __ calculate_address_from_global_toc(tmp, slow_stc, true, true, false);
    +      __ mtctr(tmp);
    +      __ bctrl(); // sets CR0
    +      __ beq(CCR0, cont);
    +
    +      if (copyfunc_addr != NULL) { // Use stub if available.
    +        __ bind(copyfunc);
    +        // Src is not a sub class of dst so we have to do a
    +        // per-element check.
    +        int mask = LIR_OpArrayCopy::src_objarray|LIR_OpArrayCopy::dst_objarray;
    +        if ((flags & mask) != mask) {
    +          assert(flags & mask, "one of the two should be known to be an object array");
    +
    +          if (!(flags & LIR_OpArrayCopy::src_objarray)) {
    +            __ load_klass(tmp, src);
    +          } else if (!(flags & LIR_OpArrayCopy::dst_objarray)) {
    +            __ load_klass(tmp, dst);
    +          }
    +
    +          __ lwz(tmp2, in_bytes(Klass::layout_helper_offset()), tmp);
    +
    +          jint objArray_lh = Klass::array_layout_helper(T_OBJECT);
    +          __ load_const_optimized(tmp, objArray_lh);
    +          __ cmpw(CCR0, tmp, tmp2);
    +          __ bne(CCR0, slow);
    +        }
    +
    +        Register src_ptr = R3_ARG1;
    +        Register dst_ptr = R4_ARG2;
    +        Register len     = R5_ARG3;
    +        Register chk_off = R6_ARG4;
    +        Register super_k = R7_ARG5;
    +
    +        __ addi(src_ptr, src, arrayOopDesc::base_offset_in_bytes(basic_type));
    +        __ addi(dst_ptr, dst, arrayOopDesc::base_offset_in_bytes(basic_type));
    +        if (shift == 0) {
    +          __ add(src_ptr, src_pos, src_ptr);
    +          __ add(dst_ptr, dst_pos, dst_ptr);
    +        } else {
    +          __ sldi(tmp, src_pos, shift);
    +          __ sldi(tmp2, dst_pos, shift);
    +          __ add(src_ptr, tmp, src_ptr);
    +          __ add(dst_ptr, tmp2, dst_ptr);
    +        }
    +
    +        __ load_klass(tmp, dst);
    +        __ mr(len, length);
    +
    +        int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
    +        __ ld(super_k, ek_offset, tmp);
    +
    +        int sco_offset = in_bytes(Klass::super_check_offset_offset());
    +        __ lwz(chk_off, sco_offset, super_k);
    +
    +        __ call_c_with_frame_resize(copyfunc_addr, /*stub does not need resized frame*/ 0);
    +
    +#ifndef PRODUCT
    +        if (PrintC1Statistics) {
    +          Label failed;
    +          __ cmpwi(CCR0, R3_RET, 0);
    +          __ bne(CCR0, failed);
    +          address counter = (address)&Runtime1::_arraycopy_checkcast_cnt;
    +          int simm16_offs = __ load_const_optimized(tmp, counter, tmp2, true);
    +          __ lwz(R11_scratch1, simm16_offs, tmp);
    +          __ addi(R11_scratch1, R11_scratch1, 1);
    +          __ stw(R11_scratch1, simm16_offs, tmp);
    +          __ bind(failed);
    +        }
    +#endif
    +
    +        __ nand(tmp, R3_RET, R3_RET);
    +        __ cmpwi(CCR0, R3_RET, 0);
    +        __ beq(CCR0, *stub->continuation());
    +
    +#ifndef PRODUCT
    +        if (PrintC1Statistics) {
    +          address counter = (address)&Runtime1::_arraycopy_checkcast_attempt_cnt;
    +          int simm16_offs = __ load_const_optimized(tmp, counter, tmp2, true);
    +          __ lwz(R11_scratch1, simm16_offs, tmp);
    +          __ addi(R11_scratch1, R11_scratch1, 1);
    +          __ stw(R11_scratch1, simm16_offs, tmp);
    +        }
    +#endif
    +
    +        __ subf(length, tmp, length);
    +        __ add(src_pos, tmp, src_pos);
    +        __ add(dst_pos, tmp, dst_pos);
    +      }
    +    }
    +  }
    +  __ bind(slow);
    +  __ b(*stub->entry());
    +  __ bind(cont);
    +
    +#ifdef ASSERT
    +  if (basic_type != T_OBJECT || !(flags & LIR_OpArrayCopy::type_check)) {
    +    // Sanity check the known type with the incoming class. For the
    +    // primitive case the types must match exactly with src.klass and
    +    // dst.klass each exactly matching the default type. For the
    +    // object array case, if no type check is needed then either the
    +    // dst type is exactly the expected type and the src type is a
    +    // subtype which we can't check or src is the same array as dst
    +    // but not necessarily exactly of type default_type.
    +    Label known_ok, halt;
    +    metadata2reg(op->expected_type()->constant_encoding(), tmp);
    +    if (UseCompressedClassPointers) {
    +      // Tmp holds the default type. It currently comes uncompressed after the
    +      // load of a constant, so encode it.
    +      __ encode_klass_not_null(tmp);
    +      // Load the raw value of the dst klass, since we will be comparing
    +      // uncompressed values directly.
    +      __ lwz(tmp2, oopDesc::klass_offset_in_bytes(), dst);
    +      __ cmpw(CCR0, tmp, tmp2);
    +      if (basic_type != T_OBJECT) {
    +        __ bne(CCR0, halt);
    +        // Load the raw value of the src klass.
    +        __ lwz(tmp2, oopDesc::klass_offset_in_bytes(), src);
    +        __ cmpw(CCR0, tmp, tmp2);
    +        __ beq(CCR0, known_ok);
    +      } else {
    +        __ beq(CCR0, known_ok);
    +        __ cmpw(CCR0, src, dst);
    +        __ beq(CCR0, known_ok);
    +      }
    +    } else {
    +      __ ld(tmp2, oopDesc::klass_offset_in_bytes(), dst);
    +      __ cmpd(CCR0, tmp, tmp2);
    +      if (basic_type != T_OBJECT) {
    +        __ bne(CCR0, halt);
    +        // Load the raw value of the src klass.
    +        __ ld(tmp2, oopDesc::klass_offset_in_bytes(), src);
    +        __ cmpd(CCR0, tmp, tmp2);
    +        __ beq(CCR0, known_ok);
    +      } else {
    +        __ beq(CCR0, known_ok);
    +        __ cmpd(CCR0, src, dst);
    +        __ beq(CCR0, known_ok);
    +      }
    +    }
    +    __ bind(halt);
    +    __ stop("incorrect type information in arraycopy");
    +    __ bind(known_ok);
    +  }
    +#endif
    +
    +#ifndef PRODUCT
    +  if (PrintC1Statistics) {
    +    address counter = Runtime1::arraycopy_count_address(basic_type);
    +    int simm16_offs = __ load_const_optimized(tmp, counter, tmp2, true);
    +    __ lwz(R11_scratch1, simm16_offs, tmp);
    +    __ addi(R11_scratch1, R11_scratch1, 1);
    +    __ stw(R11_scratch1, simm16_offs, tmp);
    +  }
    +#endif
    +
    +  Register src_ptr = R3_ARG1;
    +  Register dst_ptr = R4_ARG2;
    +  Register len     = R5_ARG3;
    +
    +  __ addi(src_ptr, src, arrayOopDesc::base_offset_in_bytes(basic_type));
    +  __ addi(dst_ptr, dst, arrayOopDesc::base_offset_in_bytes(basic_type));
    +  if (shift == 0) {
    +    __ add(src_ptr, src_pos, src_ptr);
    +    __ add(dst_ptr, dst_pos, dst_ptr);
    +  } else {
    +    __ sldi(tmp, src_pos, shift);
    +    __ sldi(tmp2, dst_pos, shift);
    +    __ add(src_ptr, tmp, src_ptr);
    +    __ add(dst_ptr, tmp2, dst_ptr);
    +  }
    +
    +  bool disjoint = (flags & LIR_OpArrayCopy::overlapping) == 0;
    +  bool aligned = (flags & LIR_OpArrayCopy::unaligned) == 0;
    +  const char *name;
    +  address entry = StubRoutines::select_arraycopy_function(basic_type, aligned, disjoint, name, false);
    +
    +  // Arraycopy stubs takes a length in number of elements, so don't scale it.
    +  __ mr(len, length);
    +  __ call_c_with_frame_resize(entry, /*stub does not need resized frame*/ 0);
    +
    +  __ bind(*stub->continuation());
    +}
    +
    +
    +void LIR_Assembler::shift_op(LIR_Code code, LIR_Opr left, LIR_Opr count, LIR_Opr dest, LIR_Opr tmp) {
    +  if (dest->is_single_cpu()) {
    +    __ rldicl(tmp->as_register(), count->as_register(), 0, 64-5);
    +#ifdef _LP64
    +    if (left->type() == T_OBJECT) {
    +      switch (code) {
    +        case lir_shl:  __ sld(dest->as_register(), left->as_register(), tmp->as_register()); break;
    +        case lir_shr:  __ srad(dest->as_register(), left->as_register(), tmp->as_register()); break;
    +        case lir_ushr: __ srd(dest->as_register(), left->as_register(), tmp->as_register()); break;
    +        default: ShouldNotReachHere();
    +      }
    +    } else
    +#endif
    +      switch (code) {
    +        case lir_shl:  __ slw(dest->as_register(), left->as_register(), tmp->as_register()); break;
    +        case lir_shr:  __ sraw(dest->as_register(), left->as_register(), tmp->as_register()); break;
    +        case lir_ushr: __ srw(dest->as_register(), left->as_register(), tmp->as_register()); break;
    +        default: ShouldNotReachHere();
    +      }
    +  } else {
    +    __ rldicl(tmp->as_register(), count->as_register(), 0, 64-6);
    +    switch (code) {
    +      case lir_shl:  __ sld(dest->as_register_lo(), left->as_register_lo(), tmp->as_register()); break;
    +      case lir_shr:  __ srad(dest->as_register_lo(), left->as_register_lo(), tmp->as_register()); break;
    +      case lir_ushr: __ srd(dest->as_register_lo(), left->as_register_lo(), tmp->as_register()); break;
    +      default: ShouldNotReachHere();
    +    }
    +  }
    +}
    +
    +
    +void LIR_Assembler::shift_op(LIR_Code code, LIR_Opr left, jint count, LIR_Opr dest) {
    +#ifdef _LP64
    +  if (left->type() == T_OBJECT) {
    +    count = count & 63;  // Shouldn't shift by more than sizeof(intptr_t).
    +    if (count == 0) { __ mr_if_needed(dest->as_register_lo(), left->as_register()); }
    +    else {
    +      switch (code) {
    +        case lir_shl:  __ sldi(dest->as_register_lo(), left->as_register(), count); break;
    +        case lir_shr:  __ sradi(dest->as_register_lo(), left->as_register(), count); break;
    +        case lir_ushr: __ srdi(dest->as_register_lo(), left->as_register(), count); break;
    +        default: ShouldNotReachHere();
    +      }
    +    }
    +    return;
    +  }
    +#endif
    +
    +  if (dest->is_single_cpu()) {
    +    count = count & 0x1F; // Java spec
    +    if (count == 0) { __ mr_if_needed(dest->as_register(), left->as_register()); }
    +    else {
    +      switch (code) {
    +        case lir_shl: __ slwi(dest->as_register(), left->as_register(), count); break;
    +        case lir_shr:  __ srawi(dest->as_register(), left->as_register(), count); break;
    +        case lir_ushr: __ srwi(dest->as_register(), left->as_register(), count); break;
    +        default: ShouldNotReachHere();
    +      }
    +    }
    +  } else if (dest->is_double_cpu()) {
    +    count = count & 63; // Java spec
    +    if (count == 0) { __ mr_if_needed(dest->as_pointer_register(), left->as_pointer_register()); }
    +    else {
    +      switch (code) {
    +        case lir_shl:  __ sldi(dest->as_pointer_register(), left->as_pointer_register(), count); break;
    +        case lir_shr:  __ sradi(dest->as_pointer_register(), left->as_pointer_register(), count); break;
    +        case lir_ushr: __ srdi(dest->as_pointer_register(), left->as_pointer_register(), count); break;
    +        default: ShouldNotReachHere();
    +      }
    +    }
    +  } else {
    +    ShouldNotReachHere();
    +  }
    +}
    +
    +
    +void LIR_Assembler::emit_alloc_obj(LIR_OpAllocObj* op) {
    +  if (op->init_check()) {
    +    if (!os::zero_page_read_protected() || !ImplicitNullChecks) {
    +      explicit_null_check(op->klass()->as_register(), op->stub()->info());
    +    } else {
    +      add_debug_info_for_null_check_here(op->stub()->info());
    +    }
    +    __ lbz(op->tmp1()->as_register(),
    +           in_bytes(InstanceKlass::init_state_offset()), op->klass()->as_register());
    +    __ cmpwi(CCR0, op->tmp1()->as_register(), InstanceKlass::fully_initialized);
    +    __ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CCR0, Assembler::equal), *op->stub()->entry());
    +  }
    +  __ allocate_object(op->obj()->as_register(),
    +                     op->tmp1()->as_register(),
    +                     op->tmp2()->as_register(),
    +                     op->tmp3()->as_register(),
    +                     op->header_size(),
    +                     op->object_size(),
    +                     op->klass()->as_register(),
    +                     *op->stub()->entry());
    +
    +  __ bind(*op->stub()->continuation());
    +  __ verify_oop(op->obj()->as_register());
    +}
    +
    +
    +void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
    +  LP64_ONLY( __ extsw(op->len()->as_register(), op->len()->as_register()); )
    +  if (UseSlowPath ||
    +      (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
    +      (!UseFastNewTypeArray   && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
    +    __ b(*op->stub()->entry());
    +  } else {
    +    __ allocate_array(op->obj()->as_register(),
    +                      op->len()->as_register(),
    +                      op->tmp1()->as_register(),
    +                      op->tmp2()->as_register(),
    +                      op->tmp3()->as_register(),
    +                      arrayOopDesc::header_size(op->type()),
    +                      type2aelembytes(op->type()),
    +                      op->klass()->as_register(),
    +                      *op->stub()->entry());
    +  }
    +  __ bind(*op->stub()->continuation());
    +}
    +
    +
    +void LIR_Assembler::type_profile_helper(Register mdo, int mdo_offset_bias,
    +                                        ciMethodData *md, ciProfileData *data,
    +                                        Register recv, Register tmp1, Label* update_done) {
    +  uint i;
    +  for (i = 0; i < VirtualCallData::row_limit(); i++) {
    +    Label next_test;
    +    // See if the receiver is receiver[n].
    +    __ ld(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) - mdo_offset_bias, mdo);
    +    __ verify_klass_ptr(tmp1);
    +    __ cmpd(CCR0, recv, tmp1);
    +    __ bne(CCR0, next_test);
    +
    +    __ ld(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)) - mdo_offset_bias, mdo);
    +    __ addi(tmp1, tmp1, DataLayout::counter_increment);
    +    __ std(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)) - mdo_offset_bias, mdo);
    +    __ b(*update_done);
    +
    +    __ bind(next_test);
    +  }
    +
    +  // Didn't find receiver; find next empty slot and fill it in.
    +  for (i = 0; i < VirtualCallData::row_limit(); i++) {
    +    Label next_test;
    +    __ ld(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) - mdo_offset_bias, mdo);
    +    __ cmpdi(CCR0, tmp1, 0);
    +    __ bne(CCR0, next_test);
    +    __ li(tmp1, DataLayout::counter_increment);
    +    __ std(recv, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) - mdo_offset_bias, mdo);
    +    __ std(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)) - mdo_offset_bias, mdo);
    +    __ b(*update_done);
    +
    +    __ bind(next_test);
    +  }
    +}
    +
    +
    +void LIR_Assembler::setup_md_access(ciMethod* method, int bci,
    +                                    ciMethodData*& md, ciProfileData*& data, int& mdo_offset_bias) {
    +  md = method->method_data_or_null();
    +  assert(md != NULL, "Sanity");
    +  data = md->bci_to_data(bci);
    +  assert(data != NULL,       "need data for checkcast");
    +  assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check");
    +  if (!Assembler::is_simm16(md->byte_offset_of_slot(data, DataLayout::header_offset()) + data->size_in_bytes())) {
    +    // The offset is large so bias the mdo by the base of the slot so
    +    // that the ld can use simm16s to reference the slots of the data.
    +    mdo_offset_bias = md->byte_offset_of_slot(data, DataLayout::header_offset());
    +  }
    +}
    +
    +
    +void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, Label* failure, Label* obj_is_null) {
    +  Register obj = op->object()->as_register();
    +  Register k_RInfo = op->tmp1()->as_register();
    +  Register klass_RInfo = op->tmp2()->as_register();
    +  Register Rtmp1 = op->tmp3()->as_register();
    +  Register dst = op->result_opr()->as_register();
    +  ciKlass* k = op->klass();
    +  bool should_profile = op->should_profile();
    +  bool move_obj_to_dst = (op->code() == lir_checkcast);
    +  // Attention: do_temp(opTypeCheck->_object) is not used, i.e. obj may be same as one of the temps.
    +  bool reg_conflict = (obj == k_RInfo || obj == klass_RInfo || obj == Rtmp1);
    +  bool restore_obj = move_obj_to_dst && reg_conflict;
    +
    +  __ cmpdi(CCR0, obj, 0);
    +  if (move_obj_to_dst || reg_conflict) {
    +    __ mr_if_needed(dst, obj);
    +    if (reg_conflict) { obj = dst; }
    +  }
    +
    +  ciMethodData* md;
    +  ciProfileData* data;
    +  int mdo_offset_bias = 0;
    +  if (should_profile) {
    +    ciMethod* method = op->profiled_method();
    +    assert(method != NULL, "Should have method");
    +    setup_md_access(method, op->profiled_bci(), md, data, mdo_offset_bias);
    +
    +    Register mdo      = k_RInfo;
    +    Register data_val = Rtmp1;
    +    Label not_null;
    +    __ bne(CCR0, not_null);
    +    metadata2reg(md->constant_encoding(), mdo);
    +    __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0);
    +    __ lbz(data_val, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias, mdo);
    +    __ ori(data_val, data_val, BitData::null_seen_byte_constant());
    +    __ stb(data_val, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias, mdo);
    +    __ b(*obj_is_null);
    +    __ bind(not_null);
    +  } else {
    +    __ beq(CCR0, *obj_is_null);
    +  }
    +
    +  // get object class
    +  __ load_klass(klass_RInfo, obj);
    +
    +  if (k->is_loaded()) {
    +    metadata2reg(k->constant_encoding(), k_RInfo);
    +  } else {
    +    klass2reg_with_patching(k_RInfo, op->info_for_patch());
    +  }
    +
    +  Label profile_cast_failure, failure_restore_obj, profile_cast_success;
    +  Label *failure_target = should_profile ? &profile_cast_failure : failure;
    +  Label *success_target = should_profile ? &profile_cast_success : success;
    +
    +  if (op->fast_check()) {
    +    assert_different_registers(klass_RInfo, k_RInfo);
    +    __ cmpd(CCR0, k_RInfo, klass_RInfo);
    +    if (should_profile) {
    +      __ bne(CCR0, *failure_target);
    +      // Fall through to success case.
    +    } else {
    +      __ beq(CCR0, *success);
    +      // Fall through to failure case.
    +    }
    +  } else {
    +    bool need_slow_path = true;
    +    if (k->is_loaded()) {
    +      if ((int) k->super_check_offset() != in_bytes(Klass::secondary_super_cache_offset())) {
    +        need_slow_path = false;
    +      }
    +      // Perform the fast part of the checking logic.
    +      __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, R0, (need_slow_path ? success_target : NULL),
    +                                       failure_target, NULL, RegisterOrConstant(k->super_check_offset()));
    +    } else {
    +      // Perform the fast part of the checking logic.
    +      __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, R0, success_target, failure_target);
    +    }
    +    if (!need_slow_path) {
    +      if (!should_profile) { __ b(*success); }
    +    } else {
    +      // Call out-of-line instance of __ check_klass_subtype_slow_path(...):
    +      address entry = Runtime1::entry_for(Runtime1::slow_subtype_check_id);
    +      //__ load_const_optimized(Rtmp1, entry, R0);
    +      __ calculate_address_from_global_toc(Rtmp1, entry, true, true, false);
    +      __ mtctr(Rtmp1);
    +      __ bctrl(); // sets CR0
    +      if (should_profile) {
    +        __ bne(CCR0, *failure_target);
    +        // Fall through to success case.
    +      } else {
    +        __ beq(CCR0, *success);
    +        // Fall through to failure case.
    +      }
    +    }
    +  }
    +
    +  if (should_profile) {
    +    Register mdo = k_RInfo, recv = klass_RInfo;
    +    assert_different_registers(mdo, recv, Rtmp1);
    +    __ bind(profile_cast_success);
    +    metadata2reg(md->constant_encoding(), mdo);
    +    __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0);
    +    type_profile_helper(mdo, mdo_offset_bias, md, data, recv, Rtmp1, success);
    +    __ b(*success);
    +
    +    // Cast failure case.
    +    __ bind(profile_cast_failure);
    +    metadata2reg(md->constant_encoding(), mdo);
    +    __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0);
    +    __ ld(Rtmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo);
    +    __ addi(Rtmp1, Rtmp1, -DataLayout::counter_increment);
    +    __ std(Rtmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo);
    +  }
    +
    +  __ bind(*failure);
    +
    +  if (restore_obj) {
    +    __ mr(op->object()->as_register(), dst);
    +    // Fall through to failure case.
    +  }
    +}
    +
    +
    +void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
    +  LIR_Code code = op->code();
    +  if (code == lir_store_check) {
    +    Register value = op->object()->as_register();
    +    Register array = op->array()->as_register();
    +    Register k_RInfo = op->tmp1()->as_register();
    +    Register klass_RInfo = op->tmp2()->as_register();
    +    Register Rtmp1 = op->tmp3()->as_register();
    +    bool should_profile = op->should_profile();
    +
    +    __ verify_oop(value);
    +    CodeStub* stub = op->stub();
    +    // Check if it needs to be profiled.
    +    ciMethodData* md;
    +    ciProfileData* data;
    +    int mdo_offset_bias = 0;
    +    if (should_profile) {
    +      ciMethod* method = op->profiled_method();
    +      assert(method != NULL, "Should have method");
    +      setup_md_access(method, op->profiled_bci(), md, data, mdo_offset_bias);
    +    }
    +    Label profile_cast_success, failure, done;
    +    Label *success_target = should_profile ? &profile_cast_success : &done;
    +
    +    __ cmpdi(CCR0, value, 0);
    +    if (should_profile) {
    +      Label not_null;
    +      __ bne(CCR0, not_null);
    +      Register mdo      = k_RInfo;
    +      Register data_val = Rtmp1;
    +      metadata2reg(md->constant_encoding(), mdo);
    +      __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0);
    +      __ lbz(data_val, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias, mdo);
    +      __ ori(data_val, data_val, BitData::null_seen_byte_constant());
    +      __ stb(data_val, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias, mdo);
    +      __ b(done);
    +      __ bind(not_null);
    +    } else {
    +      __ beq(CCR0, done);
    +    }
    +    if (!os::zero_page_read_protected() || !ImplicitNullChecks) {
    +      explicit_null_check(array, op->info_for_exception());
    +    } else {
    +      add_debug_info_for_null_check_here(op->info_for_exception());
    +    }
    +    __ load_klass(k_RInfo, array);
    +    __ load_klass(klass_RInfo, value);
    +
    +    // Get instance klass.
    +    __ ld(k_RInfo, in_bytes(ObjArrayKlass::element_klass_offset()), k_RInfo);
    +    // Perform the fast part of the checking logic.
    +    __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, R0, success_target, &failure, NULL);
    +
    +    // Call out-of-line instance of __ check_klass_subtype_slow_path(...):
    +    const address slow_path = Runtime1::entry_for(Runtime1::slow_subtype_check_id);
    +    //__ load_const_optimized(R0, slow_path);
    +    __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(slow_path));
    +    __ mtctr(R0);
    +    __ bctrl(); // sets CR0
    +    if (!should_profile) {
    +      __ beq(CCR0, done);
    +      __ bind(failure);
    +    } else {
    +      __ bne(CCR0, failure);
    +      // Fall through to the success case.
    +
    +      Register mdo  = klass_RInfo, recv = k_RInfo, tmp1 = Rtmp1;
    +      assert_different_registers(value, mdo, recv, tmp1);
    +      __ bind(profile_cast_success);
    +      metadata2reg(md->constant_encoding(), mdo);
    +      __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0);
    +      __ load_klass(recv, value);
    +      type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, &done);
    +      __ b(done);
    +
    +      // Cast failure case.
    +      __ bind(failure);
    +      metadata2reg(md->constant_encoding(), mdo);
    +      __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0);
    +      Address data_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias);
    +      __ ld(tmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo);
    +      __ addi(tmp1, tmp1, -DataLayout::counter_increment);
    +      __ std(tmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo);
    +    }
    +    __ b(*stub->entry());
    +    __ bind(done);
    +
    +  } else if (code == lir_checkcast) {
    +    Label success, failure;
    +    emit_typecheck_helper(op, &success, /*fallthru*/&failure, &success); // Moves obj to dst.
    +    __ b(*op->stub()->entry());
    +    __ align(32, 12);
    +    __ bind(success);
    +  } else if (code == lir_instanceof) {
    +    Register dst = op->result_opr()->as_register();
    +    Label success, failure, done;
    +    emit_typecheck_helper(op, &success, /*fallthru*/&failure, &failure);
    +    __ li(dst, 0);
    +    __ b(done);
    +    __ align(32, 12);
    +    __ bind(success);
    +    __ li(dst, 1);
    +    __ bind(done);
    +  } else {
    +    ShouldNotReachHere();
    +  }
    +}
    +
    +
    +void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
    +  Register addr = op->addr()->as_pointer_register();
    +  Register cmp_value = noreg, new_value = noreg;
    +  bool is_64bit = false;
    +
    +  if (op->code() == lir_cas_long) {
    +    cmp_value = op->cmp_value()->as_register_lo();
    +    new_value = op->new_value()->as_register_lo();
    +    is_64bit = true;
    +  } else if (op->code() == lir_cas_int || op->code() == lir_cas_obj) {
    +    cmp_value = op->cmp_value()->as_register();
    +    new_value = op->new_value()->as_register();
    +    if (op->code() == lir_cas_obj) {
    +      if (UseCompressedOops) {
    +        Register t1 = op->tmp1()->as_register();
    +        Register t2 = op->tmp2()->as_register();
    +        cmp_value = __ encode_heap_oop(t1, cmp_value);
    +        new_value = __ encode_heap_oop(t2, new_value);
    +      } else {
    +        is_64bit = true;
    +      }
    +    }
    +  } else {
    +    Unimplemented();
    +  }
    +
    +  if (is_64bit) {
    +    __ cmpxchgd(BOOL_RESULT, /*current_value=*/R0, cmp_value, new_value, addr,
    +                MacroAssembler::MemBarFenceAfter,
    +                MacroAssembler::cmpxchgx_hint_atomic_update(),
    +                noreg, NULL, /*check without ldarx first*/true);
    +  } else {
    +    __ cmpxchgw(BOOL_RESULT, /*current_value=*/R0, cmp_value, new_value, addr,
    +                MacroAssembler::MemBarFenceAfter,
    +                MacroAssembler::cmpxchgx_hint_atomic_update(),
    +                noreg, /*check without ldarx first*/true);
    +  }
    +}
    +
    +
    +void LIR_Assembler::set_24bit_FPU() {
    +  Unimplemented();
    +}
    +
    +void LIR_Assembler::reset_FPU() {
    +  Unimplemented();
    +}
    +
    +
    +void LIR_Assembler::breakpoint() {
    +  __ illtrap();
    +}
    +
    +
    +void LIR_Assembler::push(LIR_Opr opr) {
    +  Unimplemented();
    +}
    +
    +void LIR_Assembler::pop(LIR_Opr opr) {
    +  Unimplemented();
    +}
    +
    +
    +void LIR_Assembler::monitor_address(int monitor_no, LIR_Opr dst_opr) {
    +  Address mon_addr = frame_map()->address_for_monitor_lock(monitor_no);
    +  Register dst = dst_opr->as_register();
    +  Register reg = mon_addr.base();
    +  int offset = mon_addr.disp();
    +  // Compute pointer to BasicLock.
    +  __ add_const_optimized(dst, reg, offset);
    +}
    +
    +
    +void LIR_Assembler::emit_lock(LIR_OpLock* op) {
    +  Register obj = op->obj_opr()->as_register();
    +  Register hdr = op->hdr_opr()->as_register();
    +  Register lock = op->lock_opr()->as_register();
    +
    +  // Obj may not be an oop.
    +  if (op->code() == lir_lock) {
    +    MonitorEnterStub* stub = (MonitorEnterStub*)op->stub();
    +    if (UseFastLocking) {
    +      assert(BasicLock::displaced_header_offset_in_bytes() == 0, "lock_reg must point to the displaced header");
    +      // Add debug info for NullPointerException only if one is possible.
    +      if (op->info() != NULL) {
    +        if (!os::zero_page_read_protected() || !ImplicitNullChecks) {
    +          explicit_null_check(obj, op->info());
    +        } else {
    +          add_debug_info_for_null_check_here(op->info());
    +        }
    +      }
    +      __ lock_object(hdr, obj, lock, op->scratch_opr()->as_register(), *op->stub()->entry());
    +    } else {
    +      // always do slow locking
    +      // note: The slow locking code could be inlined here, however if we use
    +      //       slow locking, speed doesn't matter anyway and this solution is
    +      //       simpler and requires less duplicated code - additionally, the
    +      //       slow locking code is the same in either case which simplifies
    +      //       debugging.
    +      __ b(*op->stub()->entry());
    +    }
    +  } else {
    +    assert (op->code() == lir_unlock, "Invalid code, expected lir_unlock");
    +    if (UseFastLocking) {
    +      assert(BasicLock::displaced_header_offset_in_bytes() == 0, "lock_reg must point to the displaced header");
    +      __ unlock_object(hdr, obj, lock, *op->stub()->entry());
    +    } else {
    +      // always do slow unlocking
    +      // note: The slow unlocking code could be inlined here, however if we use
    +      //       slow unlocking, speed doesn't matter anyway and this solution is
    +      //       simpler and requires less duplicated code - additionally, the
    +      //       slow unlocking code is the same in either case which simplifies
    +      //       debugging.
    +      __ b(*op->stub()->entry());
    +    }
    +  }
    +  __ bind(*op->stub()->continuation());
    +}
    +
    +
    +void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
    +  ciMethod* method = op->profiled_method();
    +  int bci          = op->profiled_bci();
    +  ciMethod* callee = op->profiled_callee();
    +
    +  // Update counter for all call types.
    +  ciMethodData* md = method->method_data_or_null();
    +  assert(md != NULL, "Sanity");
    +  ciProfileData* data = md->bci_to_data(bci);
    +  assert(data->is_CounterData(), "need CounterData for calls");
    +  assert(op->mdo()->is_single_cpu(),  "mdo must be allocated");
    +  Register mdo = op->mdo()->as_register();
    +#ifdef _LP64
    +  assert(op->tmp1()->is_double_cpu(), "tmp1 must be allocated");
    +  Register tmp1 = op->tmp1()->as_register_lo();
    +#else
    +  assert(op->tmp1()->is_single_cpu(), "tmp1 must be allocated");
    +  Register tmp1 = op->tmp1()->as_register();
    +#endif
    +  metadata2reg(md->constant_encoding(), mdo);
    +  int mdo_offset_bias = 0;
    +  if (!Assembler::is_simm16(md->byte_offset_of_slot(data, CounterData::count_offset()) +
    +                            data->size_in_bytes())) {
    +    // The offset is large so bias the mdo by the base of the slot so
    +    // that the ld can use simm16s to reference the slots of the data.
    +    mdo_offset_bias = md->byte_offset_of_slot(data, CounterData::count_offset());
    +    __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0);
    +  }
    +
    +  Bytecodes::Code bc = method->java_code_at_bci(bci);
    +  const bool callee_is_static = callee->is_loaded() && callee->is_static();
    +  // Perform additional virtual call profiling for invokevirtual and
    +  // invokeinterface bytecodes.
    +  if ((bc == Bytecodes::_invokevirtual || bc == Bytecodes::_invokeinterface) &&
    +      !callee_is_static &&  // Required for optimized MH invokes.
    +      C1ProfileVirtualCalls) {
    +    assert(op->recv()->is_single_cpu(), "recv must be allocated");
    +    Register recv = op->recv()->as_register();
    +    assert_different_registers(mdo, tmp1, recv);
    +    assert(data->is_VirtualCallData(), "need VirtualCallData for virtual calls");
    +    ciKlass* known_klass = op->known_holder();
    +    if (C1OptimizeVirtualCallProfiling && known_klass != NULL) {
    +      // We know the type that will be seen at this call site; we can
    +      // statically update the MethodData* rather than needing to do
    +      // dynamic tests on the receiver type.
    +
    +      // NOTE: we should probably put a lock around this search to
    +      // avoid collisions by concurrent compilations.
    +      ciVirtualCallData* vc_data = (ciVirtualCallData*) data;
    +      uint i;
    +      for (i = 0; i < VirtualCallData::row_limit(); i++) {
    +        ciKlass* receiver = vc_data->receiver(i);
    +        if (known_klass->equals(receiver)) {
    +          __ ld(tmp1, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - mdo_offset_bias, mdo);
    +          __ addi(tmp1, tmp1, DataLayout::counter_increment);
    +          __ std(tmp1, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - mdo_offset_bias, mdo);
    +          return;
    +        }
    +      }
    +
    +      // Receiver type not found in profile data; select an empty slot.
    +
    +      // Note that this is less efficient than it should be because it
    +      // always does a write to the receiver part of the
    +      // VirtualCallData rather than just the first time.
    +      for (i = 0; i < VirtualCallData::row_limit(); i++) {
    +        ciKlass* receiver = vc_data->receiver(i);
    +        if (receiver == NULL) {
    +          metadata2reg(known_klass->constant_encoding(), tmp1);
    +          __ std(tmp1, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) - mdo_offset_bias, mdo);
    +
    +          __ ld(tmp1, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - mdo_offset_bias, mdo);
    +          __ addi(tmp1, tmp1, DataLayout::counter_increment);
    +          __ std(tmp1, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - mdo_offset_bias, mdo);
    +          return;
    +        }
    +      }
    +    } else {
    +      __ load_klass(recv, recv);
    +      Label update_done;
    +      type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, &update_done);
    +      // Receiver did not match any saved receiver and there is no empty row for it.
    +      // Increment total counter to indicate polymorphic case.
    +      __ ld(tmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo);
    +      __ addi(tmp1, tmp1, DataLayout::counter_increment);
    +      __ std(tmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo);
    +
    +      __ bind(update_done);
    +    }
    +  } else {
    +    // Static call
    +    __ ld(tmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo);
    +    __ addi(tmp1, tmp1, DataLayout::counter_increment);
    +    __ std(tmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo);
    +  }
    +}
    +
    +
    +void LIR_Assembler::align_backward_branch_target() {
    +  __ align(32, 12); // Insert up to 3 nops to align with 32 byte boundary.
    +}
    +
    +
    +void LIR_Assembler::emit_delay(LIR_OpDelay* op) {
    +  Unimplemented();
    +}
    +
    +
    +void LIR_Assembler::negate(LIR_Opr left, LIR_Opr dest) {
    +  assert(left->is_register(), "can only handle registers");
    +
    +  if (left->is_single_cpu()) {
    +    __ neg(dest->as_register(), left->as_register());
    +  } else if (left->is_single_fpu()) {
    +    __ fneg(dest->as_float_reg(), left->as_float_reg());
    +  } else if (left->is_double_fpu()) {
    +    __ fneg(dest->as_double_reg(), left->as_double_reg());
    +  } else {
    +    assert (left->is_double_cpu(), "Must be a long");
    +    __ neg(dest->as_register_lo(), left->as_register_lo());
    +  }
    +}
    +
    +
    +void LIR_Assembler::fxch(int i) {
    +  Unimplemented();
    +}
    +
    +void LIR_Assembler::fld(int i) {
    +  Unimplemented();
    +}
    +
    +void LIR_Assembler::ffree(int i) {
    +  Unimplemented();
    +}
    +
    +
    +void LIR_Assembler::rt_call(LIR_Opr result, address dest,
    +                            const LIR_OprList* args, LIR_Opr tmp, CodeEmitInfo* info) {
    +  // Stubs: Called via rt_call, but dest is a stub address (no function descriptor).
    +  if (dest == Runtime1::entry_for(Runtime1::register_finalizer_id) ||
    +      dest == Runtime1::entry_for(Runtime1::new_multi_array_id   )) {
    +    //__ load_const_optimized(R0, dest);
    +    __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(dest));
    +    __ mtctr(R0);
    +    __ bctrl();
    +    assert(info != NULL, "sanity");
    +    add_call_info_here(info);
    +    return;
    +  }
    +
    +  __ call_c_with_frame_resize(dest, /*no resizing*/ 0);
    +  if (info != NULL) {
    +    add_call_info_here(info);
    +  }
    +}
    +
    +
    +void LIR_Assembler::volatile_move_op(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info) {
    +  ShouldNotReachHere(); // Not needed on _LP64.
    +}
    +
    +void LIR_Assembler::membar() {
    +  __ fence();
    +}
    +
    +void LIR_Assembler::membar_acquire() {
    +  __ acquire();
    +}
    +
    +void LIR_Assembler::membar_release() {
    +  __ release();
    +}
    +
    +void LIR_Assembler::membar_loadload() {
    +  __ membar(Assembler::LoadLoad);
    +}
    +
    +void LIR_Assembler::membar_storestore() {
    +  __ membar(Assembler::StoreStore);
    +}
    +
    +void LIR_Assembler::membar_loadstore() {
    +  __ membar(Assembler::LoadStore);
    +}
    +
    +void LIR_Assembler::membar_storeload() {
    +  __ membar(Assembler::StoreLoad);
    +}
    +
    +
    +void LIR_Assembler::leal(LIR_Opr addr_opr, LIR_Opr dest) {
    +  LIR_Address* addr = addr_opr->as_address_ptr();
    +  assert(addr->scale() == LIR_Address::times_1, "no scaling on this platform");
    +  if (addr->index()->is_illegal()) {
    +    __ add_const_optimized(dest->as_pointer_register(), addr->base()->as_pointer_register(), addr->disp());
    +  } else {
    +    assert(addr->disp() == 0, "can't have both: index and disp");
    +    __ add(dest->as_pointer_register(), addr->index()->as_pointer_register(), addr->base()->as_pointer_register());
    +  }
    +}
    +
    +
    +void LIR_Assembler::get_thread(LIR_Opr result_reg) {
    +  ShouldNotReachHere();
    +}
    +
    +
    +#ifdef ASSERT
    +// Emit run-time assertion.
    +void LIR_Assembler::emit_assert(LIR_OpAssert* op) {
    +  Unimplemented();
    +}
    +#endif
    +
    +
    +void LIR_Assembler::peephole(LIR_List* lir) {
    +  // Optimize instruction pairs before emitting.
    +  LIR_OpList* inst = lir->instructions_list();
    +  for (int i = 1; i < inst->length(); i++) {
    +    LIR_Op* op = inst->at(i);
    +
    +    // 2 register-register-moves
    +    if (op->code() == lir_move) {
    +      LIR_Opr in2  = ((LIR_Op1*)op)->in_opr(),
    +              res2 = ((LIR_Op1*)op)->result_opr();
    +      if (in2->is_register() && res2->is_register()) {
    +        LIR_Op* prev = inst->at(i - 1);
    +        if (prev && prev->code() == lir_move) {
    +          LIR_Opr in1  = ((LIR_Op1*)prev)->in_opr(),
    +                  res1 = ((LIR_Op1*)prev)->result_opr();
    +          if (in1->is_same_register(res2) && in2->is_same_register(res1)) {
    +            inst->remove_at(i);
    +          }
    +        }
    +      }
    +    }
    +
    +  }
    +  return;
    +}
    +
    +
    +void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr dest, LIR_Opr tmp) {
    +  const Register Rptr = src->as_pointer_register(),
    +                 Rtmp = tmp->as_register();
    +  Register Rco = noreg;
    +  if (UseCompressedOops && data->is_oop()) {
    +    Rco = __ encode_heap_oop(Rtmp, data->as_register());
    +  }
    +
    +  Label Lretry;
    +  __ bind(Lretry);
    +
    +  if (data->type() == T_INT) {
    +    const Register Rold = dest->as_register(),
    +                   Rsrc = data->as_register();
    +    assert_different_registers(Rptr, Rtmp, Rold, Rsrc);
    +    __ lwarx(Rold, Rptr, MacroAssembler::cmpxchgx_hint_atomic_update());
    +    if (code == lir_xadd) {
    +      __ add(Rtmp, Rsrc, Rold);
    +      __ stwcx_(Rtmp, Rptr);
    +    } else {
    +      __ stwcx_(Rsrc, Rptr);
    +    }
    +  } else if (data->is_oop()) {
    +    assert(code == lir_xchg, "xadd for oops");
    +    const Register Rold = dest->as_register();
    +    if (UseCompressedOops) {
    +      assert_different_registers(Rptr, Rold, Rco);
    +      __ lwarx(Rold, Rptr, MacroAssembler::cmpxchgx_hint_atomic_update());
    +      __ stwcx_(Rco, Rptr);
    +    } else {
    +      const Register Robj = data->as_register();
    +      assert_different_registers(Rptr, Rold, Robj);
    +      __ ldarx(Rold, Rptr, MacroAssembler::cmpxchgx_hint_atomic_update());
    +      __ stdcx_(Robj, Rptr);
    +    }
    +  } else if (data->type() == T_LONG) {
    +    const Register Rold = dest->as_register_lo(),
    +                   Rsrc = data->as_register_lo();
    +    assert_different_registers(Rptr, Rtmp, Rold, Rsrc);
    +    __ ldarx(Rold, Rptr, MacroAssembler::cmpxchgx_hint_atomic_update());
    +    if (code == lir_xadd) {
    +      __ add(Rtmp, Rsrc, Rold);
    +      __ stdcx_(Rtmp, Rptr);
    +    } else {
    +      __ stdcx_(Rsrc, Rptr);
    +    }
    +  } else {
    +    ShouldNotReachHere();
    +  }
    +
    +  if (UseStaticBranchPredictionInCompareAndSwapPPC64) {
    +    __ bne_predict_not_taken(CCR0, Lretry);
    +  } else {
    +    __ bne(                  CCR0, Lretry);
    +  }
    +
    +  if (UseCompressedOops && data->is_oop()) {
    +    __ decode_heap_oop(dest->as_register());
    +  }
    +}
    +
    +
    +void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
    +  Register obj = op->obj()->as_register();
    +  Register tmp = op->tmp()->as_pointer_register();
    +  LIR_Address* mdo_addr = op->mdp()->as_address_ptr();
    +  ciKlass* exact_klass = op->exact_klass();
    +  intptr_t current_klass = op->current_klass();
    +  bool not_null = op->not_null();
    +  bool no_conflict = op->no_conflict();
    +
    +  Label Lupdate, Ldo_update, Ldone;
    +
    +  bool do_null = !not_null;
    +  bool exact_klass_set = exact_klass != NULL && ciTypeEntries::valid_ciklass(current_klass) == exact_klass;
    +  bool do_update = !TypeEntries::is_type_unknown(current_klass) && !exact_klass_set;
    +
    +  assert(do_null || do_update, "why are we here?");
    +  assert(!TypeEntries::was_null_seen(current_klass) || do_update, "why are we here?");
    +
    +  __ verify_oop(obj);
    +
    +  if (do_null) {
    +    if (!TypeEntries::was_null_seen(current_klass)) {
    +      __ cmpdi(CCR0, obj, 0);
    +      __ bne(CCR0, Lupdate);
    +      __ ld(R0, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register());
    +      __ ori(R0, R0, TypeEntries::null_seen);
    +      if (do_update) {
    +        __ b(Ldo_update);
    +      } else {
    +        __ std(R0, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register());
    +      }
    +    } else {
    +      if (do_update) {
    +        __ cmpdi(CCR0, obj, 0);
    +        __ beq(CCR0, Ldone);
    +      }
    +    }
    +#ifdef ASSERT
    +  } else {
    +    __ cmpdi(CCR0, obj, 0);
    +    __ bne(CCR0, Lupdate);
    +    __ stop("unexpect null obj", 0x9652);
    +#endif
    +  }
    +
    +  __ bind(Lupdate);
    +  if (do_update) {
    +    Label Lnext;
    +    const Register klass = R29_TOC; // kill and reload
    +    bool klass_reg_used = false;
    +#ifdef ASSERT
    +    if (exact_klass != NULL) {
    +      Label ok;
    +      klass_reg_used = true;
    +      __ load_klass(klass, obj);
    +      metadata2reg(exact_klass->constant_encoding(), R0);
    +      __ cmpd(CCR0, klass, R0);
    +      __ beq(CCR0, ok);
    +      __ stop("exact klass and actual klass differ", 0x8564);
    +      __ bind(ok);
    +    }
    +#endif
    +
    +    if (!no_conflict) {
    +      if (exact_klass == NULL || TypeEntries::is_type_none(current_klass)) {
    +        klass_reg_used = true;
    +        if (exact_klass != NULL) {
    +          __ ld(tmp, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register());
    +          metadata2reg(exact_klass->constant_encoding(), klass);
    +        } else {
    +          __ load_klass(klass, obj);
    +          __ ld(tmp, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register()); // may kill obj
    +        }
    +
    +        // Like InterpreterMacroAssembler::profile_obj_type
    +        __ clrrdi(R0, tmp, exact_log2(-TypeEntries::type_klass_mask));
    +        // Basically same as andi(R0, tmp, TypeEntries::type_klass_mask);
    +        __ cmpd(CCR1, R0, klass);
    +        // Klass seen before, nothing to do (regardless of unknown bit).
    +        //beq(CCR1, do_nothing);
    +
    +        __ andi_(R0, klass, TypeEntries::type_unknown);
    +        // Already unknown. Nothing to do anymore.
    +        //bne(CCR0, do_nothing);
    +        __ crorc(CCR0, Assembler::equal, CCR1, Assembler::equal); // cr0 eq = cr1 eq or cr0 ne
    +        __ beq(CCR0, Lnext);
    +
    +        if (TypeEntries::is_type_none(current_klass)) {
    +          __ clrrdi_(R0, tmp, exact_log2(-TypeEntries::type_mask));
    +          __ orr(R0, klass, tmp); // Combine klass and null_seen bit (only used if (tmp & type_mask)==0).
    +          __ beq(CCR0, Ldo_update); // First time here. Set profile type.
    +        }
    +
    +      } else {
    +        assert(ciTypeEntries::valid_ciklass(current_klass) != NULL &&
    +               ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "conflict only");
    +
    +        __ ld(tmp, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register());
    +        __ andi_(R0, tmp, TypeEntries::type_unknown);
    +        // Already unknown. Nothing to do anymore.
    +        __ bne(CCR0, Lnext);
    +      }
    +
    +      // Different than before. Cannot keep accurate profile.
    +      __ ori(R0, tmp, TypeEntries::type_unknown);
    +    } else {
    +      // There's a single possible klass at this profile point
    +      assert(exact_klass != NULL, "should be");
    +      __ ld(tmp, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register());
    +
    +      if (TypeEntries::is_type_none(current_klass)) {
    +        klass_reg_used = true;
    +        metadata2reg(exact_klass->constant_encoding(), klass);
    +
    +        __ clrrdi(R0, tmp, exact_log2(-TypeEntries::type_klass_mask));
    +        // Basically same as andi(R0, tmp, TypeEntries::type_klass_mask);
    +        __ cmpd(CCR1, R0, klass);
    +        // Klass seen before, nothing to do (regardless of unknown bit).
    +        __ beq(CCR1, Lnext);
    +#ifdef ASSERT
    +        {
    +          Label ok;
    +          __ clrrdi_(R0, tmp, exact_log2(-TypeEntries::type_mask));
    +          __ beq(CCR0, ok); // First time here.
    +
    +          __ stop("unexpected profiling mismatch", 0x7865);
    +          __ bind(ok);
    +        }
    +#endif
    +        // First time here. Set profile type.
    +        __ orr(R0, klass, tmp); // Combine klass and null_seen bit (only used if (tmp & type_mask)==0).
    +      } else {
    +        assert(ciTypeEntries::valid_ciklass(current_klass) != NULL &&
    +               ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "inconsistent");
    +
    +        // Already unknown. Nothing to do anymore.
    +        __ andi_(R0, tmp, TypeEntries::type_unknown);
    +        __ bne(CCR0, Lnext);
    +
    +        // Different than before. Cannot keep accurate profile.
    +        __ ori(R0, tmp, TypeEntries::type_unknown);
    +      }
    +    }
    +
    +    __ bind(Ldo_update);
    +    __ std(R0, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register());
    +
    +    __ bind(Lnext);
    +    if (klass_reg_used) { __ load_const_optimized(R29_TOC, MacroAssembler::global_toc(), R0); } // reinit
    +  }
    +  __ bind(Ldone);
    +}
    +
    +
    +void LIR_Assembler::emit_updatecrc32(LIR_OpUpdateCRC32* op) {
    +  assert(op->crc()->is_single_cpu(), "crc must be register");
    +  assert(op->val()->is_single_cpu(), "byte value must be register");
    +  assert(op->result_opr()->is_single_cpu(), "result must be register");
    +  Register crc = op->crc()->as_register();
    +  Register val = op->val()->as_register();
    +  Register res = op->result_opr()->as_register();
    +
    +  assert_different_registers(val, crc, res);
    +
    +  __ load_const_optimized(res, StubRoutines::crc_table_addr(), R0);
    +  __ nand(crc, crc, crc); // ~crc
    +  __ update_byte_crc32(crc, val, res);
    +  __ nand(res, crc, crc); // ~crc
    +}
    +
    +#undef __
    diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp
    new file mode 100644
    index 00000000000..03d1faedbf9
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp
    @@ -0,0 +1,69 @@
    +/*
    + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#ifndef CPU_PPC_VM_C1_LIRASSEMBLER_PPC_HPP
    +#define CPU_PPC_VM_C1_LIRASSEMBLER_PPC_HPP
    +
    + private:
    +
    +  //////////////////////////////////////////////////////////////////////////////
    +  // PPC64 load/store emission
    +  //
    +  // The PPC ld/st instructions cannot accomodate displacements > 16 bits long.
    +  // The following "pseudo" instructions (load/store) make it easier to
    +  // use the indexed addressing mode by allowing 32 bit displacements:
    +  //
    +
    +  void explicit_null_check(Register addr, CodeEmitInfo* info);
    +
    +  int store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool wide, bool unaligned);
    +  int store(LIR_Opr from_reg, Register base, Register disp, BasicType type, bool wide);
    +
    +  int load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool wide, bool unaligned);
    +  int load(Register base, Register disp, LIR_Opr to_reg, BasicType type, bool wide);
    +
    +  int shift_amount(BasicType t);
    +
    +  // Record the type of the receiver in ReceiverTypeData.
    +  void type_profile_helper(Register mdo, int mdo_offset_bias,
    +                           ciMethodData *md, ciProfileData *data,
    +                           Register recv, Register tmp1, Label* update_done);
    +  // Setup pointers to MDO, MDO slot, also compute offset bias to access the slot.
    +  void setup_md_access(ciMethod* method, int bci,
    +                       ciMethodData*& md, ciProfileData*& data, int& mdo_offset_bias);
    + public:
    +  static const ConditionRegister BOOL_RESULT;
    +
    +  // Emit trampoline stub for call. Call bailout() if failed. Return true on success.
    +  bool emit_trampoline_stub_for_call(address target, Register Rtoc = noreg);
    +
    +enum {
    +  max_static_call_stub_size = 4 * BytesPerInstWord + MacroAssembler::b64_patchable_size,
    +  call_stub_size = max_static_call_stub_size + MacroAssembler::trampoline_stub_size, // or smaller
    +  exception_handler_size = MacroAssembler::b64_patchable_size, // or smaller
    +  deopt_handler_size = MacroAssembler::bl64_patchable_size
    +};
    +
    +#endif // CPU_PPC_VM_C1_LIRASSEMBLER_PPC_HPP
    diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp
    new file mode 100644
    index 00000000000..909d0136011
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp
    @@ -0,0 +1,1429 @@
    +/*
    + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#include "precompiled.hpp"
    +#include "c1/c1_Compilation.hpp"
    +#include "c1/c1_FrameMap.hpp"
    +#include "c1/c1_Instruction.hpp"
    +#include "c1/c1_LIRAssembler.hpp"
    +#include "c1/c1_LIRGenerator.hpp"
    +#include "c1/c1_Runtime1.hpp"
    +#include "c1/c1_ValueStack.hpp"
    +#include "ci/ciArray.hpp"
    +#include "ci/ciObjArrayKlass.hpp"
    +#include "ci/ciTypeArrayKlass.hpp"
    +#include "runtime/sharedRuntime.hpp"
    +#include "runtime/stubRoutines.hpp"
    +#include "vmreg_ppc.inline.hpp"
    +
    +#ifdef ASSERT
    +#define __ gen()->lir(__FILE__, __LINE__)->
    +#else
    +#define __ gen()->lir()->
    +#endif
    +
    +void LIRItem::load_byte_item() {
    +  // Byte loads use same registers as other loads.
    +  load_item();
    +}
    +
    +
    +void LIRItem::load_nonconstant() {
    +  LIR_Opr r = value()->operand();
    +  if (_gen->can_inline_as_constant(value())) {
    +    if (!r->is_constant()) {
    +      r = LIR_OprFact::value_type(value()->type());
    +    }
    +    _result = r;
    +  } else {
    +    load_item();
    +  }
    +}
    +
    +
    +inline void load_int_as_long(LIR_List *ll, LIRItem &li, LIR_Opr dst) {
    +  LIR_Opr r = li.value()->operand();
    +  if (r->is_register()) {
    +    LIR_Opr dst_l = FrameMap::as_long_opr(dst->as_register());
    +    ll->convert(Bytecodes::_i2l, li.result(), dst_l); // Convert.
    +  } else {
    +    // Constants or memory get loaded with sign extend on this platform.
    +    ll->move(li.result(), dst);
    +  }
    +}
    +
    +
    +//--------------------------------------------------------------
    +//               LIRGenerator
    +//--------------------------------------------------------------
    +
    +LIR_Opr LIRGenerator::exceptionOopOpr()              { return FrameMap::R3_oop_opr; }
    +LIR_Opr LIRGenerator::exceptionPcOpr()               { return FrameMap::R4_opr; }
    +LIR_Opr LIRGenerator::syncLockOpr()                  { return FrameMap::R5_opr; }     // Need temp effect for MonitorEnterStub.
    +LIR_Opr LIRGenerator::syncTempOpr()                  { return FrameMap::R4_oop_opr; } // Need temp effect for MonitorEnterStub.
    +LIR_Opr LIRGenerator::getThreadTemp()                { return LIR_OprFact::illegalOpr; } // not needed
    +
    +LIR_Opr LIRGenerator::result_register_for(ValueType* type, bool callee) {
    +  LIR_Opr opr;
    +  switch (type->tag()) {
    +  case intTag:     opr = FrameMap::R3_opr;         break;
    +  case objectTag:  opr = FrameMap::R3_oop_opr;     break;
    +  case longTag:    opr = FrameMap::R3_long_opr;    break;
    +  case floatTag:   opr = FrameMap::F1_opr;         break;
    +  case doubleTag:  opr = FrameMap::F1_double_opr;  break;
    +
    +  case addressTag:
    +  default: ShouldNotReachHere(); return LIR_OprFact::illegalOpr;
    +  }
    +
    +  assert(opr->type_field() == as_OprType(as_BasicType(type)), "type mismatch");
    +  return opr;
    +}
    +
    +LIR_Opr LIRGenerator::rlock_callee_saved(BasicType type) {
    +  ShouldNotReachHere();
    +  return LIR_OprFact::illegalOpr;
    +}
    +
    +
    +LIR_Opr LIRGenerator::rlock_byte(BasicType type) {
    +  return new_register(T_INT);
    +}
    +
    +
    +//--------- loading items into registers --------------------------------
    +
    +// PPC cannot inline all constants.
    +bool LIRGenerator::can_store_as_constant(Value v, BasicType type) const {
    +  if (v->type()->as_IntConstant() != NULL) {
    +    return Assembler::is_simm16(v->type()->as_IntConstant()->value());
    +  } else if (v->type()->as_LongConstant() != NULL) {
    +    return Assembler::is_simm16(v->type()->as_LongConstant()->value());
    +  } else if (v->type()->as_ObjectConstant() != NULL) {
    +    return v->type()->as_ObjectConstant()->value()->is_null_object();
    +  } else {
    +    return false;
    +  }
    +}
    +
    +
    +// Only simm16 constants can be inlined.
    +bool LIRGenerator::can_inline_as_constant(Value i) const {
    +  return can_store_as_constant(i, as_BasicType(i->type()));
    +}
    +
    +
    +bool LIRGenerator::can_inline_as_constant(LIR_Const* c) const {
    +  if (c->type() == T_INT) {
    +    return Assembler::is_simm16(c->as_jint());
    +  }
    +  if (c->type() == T_LONG) {
    +    return Assembler::is_simm16(c->as_jlong());
    +  }
    +  if (c->type() == T_OBJECT) {
    +    return c->as_jobject() == NULL;
    +  }
    +  return false;
    +}
    +
    +
    +LIR_Opr LIRGenerator::safepoint_poll_register() {
    +  return new_register(T_INT);
    +}
    +
    +
    +LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
    +                                            int shift, int disp, BasicType type) {
    +  assert(base->is_register(), "must be");
    +
    +  // Accumulate fixed displacements.
    +  if (index->is_constant()) {
    +    disp += index->as_constant_ptr()->as_jint() << shift;
    +    index = LIR_OprFact::illegalOpr;
    +  }
    +
    +  if (index->is_register()) {
    +    // Apply the shift and accumulate the displacement.
    +    if (shift > 0) {
    +      LIR_Opr tmp = new_pointer_register();
    +      __ shift_left(index, shift, tmp);
    +      index = tmp;
    +    }
    +    if (disp != 0) {
    +      LIR_Opr tmp = new_pointer_register();
    +      if (Assembler::is_simm16(disp)) {
    +        __ add(index, LIR_OprFact::intptrConst(disp), tmp);
    +        index = tmp;
    +      } else {
    +        __ move(LIR_OprFact::intptrConst(disp), tmp);
    +        __ add(tmp, index, tmp);
    +        index = tmp;
    +      }
    +      disp = 0;
    +    }
    +  } else if (!Assembler::is_simm16(disp)) {
    +    // Index is illegal so replace it with the displacement loaded into a register.
    +    index = new_pointer_register();
    +    __ move(LIR_OprFact::intptrConst(disp), index);
    +    disp = 0;
    +  }
    +
    +  // At this point we either have base + index or base + displacement.
    +  if (disp == 0) {
    +    return new LIR_Address(base, index, type);
    +  } else {
    +    assert(Assembler::is_simm16(disp), "must be");
    +    return new LIR_Address(base, disp, type);
    +  }
    +}
    +
    +
    +LIR_Address* LIRGenerator::emit_array_address(LIR_Opr array_opr, LIR_Opr index_opr,
    +                                              BasicType type, bool needs_card_mark) {
    +  int elem_size = type2aelembytes(type);
    +  int shift = exact_log2(elem_size);
    +
    +  LIR_Opr base_opr;
    +  int offset = arrayOopDesc::base_offset_in_bytes(type);
    +
    +  if (index_opr->is_constant()) {
    +    int i = index_opr->as_constant_ptr()->as_jint();
    +    int array_offset = i * elem_size;
    +    if (Assembler::is_simm16(array_offset + offset)) {
    +      base_opr = array_opr;
    +      offset = array_offset + offset;
    +    } else {
    +      base_opr = new_pointer_register();
    +      if (Assembler::is_simm16(array_offset)) {
    +        __ add(array_opr, LIR_OprFact::intptrConst(array_offset), base_opr);
    +      } else {
    +        __ move(LIR_OprFact::intptrConst(array_offset), base_opr);
    +        __ add(base_opr, array_opr, base_opr);
    +      }
    +    }
    +  } else {
    +#ifdef _LP64
    +    if (index_opr->type() == T_INT) {
    +      LIR_Opr tmp = new_register(T_LONG);
    +      __ convert(Bytecodes::_i2l, index_opr, tmp);
    +      index_opr = tmp;
    +    }
    +#endif
    +
    +    base_opr = new_pointer_register();
    +    assert (index_opr->is_register(), "Must be register");
    +    if (shift > 0) {
    +      __ shift_left(index_opr, shift, base_opr);
    +      __ add(base_opr, array_opr, base_opr);
    +    } else {
    +      __ add(index_opr, array_opr, base_opr);
    +    }
    +  }
    +  if (needs_card_mark) {
    +    LIR_Opr ptr = new_pointer_register();
    +    __ add(base_opr, LIR_OprFact::intptrConst(offset), ptr);
    +    return new LIR_Address(ptr, type);
    +  } else {
    +    return new LIR_Address(base_opr, offset, type);
    +  }
    +}
    +
    +
    +LIR_Opr LIRGenerator::load_immediate(int x, BasicType type) {
    +  LIR_Opr r = NULL;
    +  if (type == T_LONG) {
    +    r = LIR_OprFact::longConst(x);
    +  } else if (type == T_INT) {
    +    r = LIR_OprFact::intConst(x);
    +  } else {
    +    ShouldNotReachHere();
    +  }
    +  if (!Assembler::is_simm16(x)) {
    +    LIR_Opr tmp = new_register(type);
    +    __ move(r, tmp);
    +    return tmp;
    +  }
    +  return r;
    +}
    +
    +
    +void LIRGenerator::increment_counter(address counter, BasicType type, int step) {
    +  LIR_Opr pointer = new_pointer_register();
    +  __ move(LIR_OprFact::intptrConst(counter), pointer);
    +  LIR_Address* addr = new LIR_Address(pointer, type);
    +  increment_counter(addr, step);
    +}
    +
    +
    +void LIRGenerator::increment_counter(LIR_Address* addr, int step) {
    +  LIR_Opr temp = new_register(addr->type());
    +  __ move(addr, temp);
    +  __ add(temp, load_immediate(step, addr->type()), temp);
    +  __ move(temp, addr);
    +}
    +
    +
    +void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) {
    +  LIR_Opr tmp = FrameMap::R0_opr;
    +  __ load(new LIR_Address(base, disp, T_INT), tmp, info);
    +  __ cmp(condition, tmp, c);
    +}
    +
    +
    +void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base,
    +                               int disp, BasicType type, CodeEmitInfo* info) {
    +  LIR_Opr tmp = FrameMap::R0_opr;
    +  __ load(new LIR_Address(base, disp, type), tmp, info);
    +  __ cmp(condition, reg, tmp);
    +}
    +
    +
    +void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base,
    +                               LIR_Opr disp, BasicType type, CodeEmitInfo* info) {
    +  LIR_Opr tmp = FrameMap::R0_opr;
    +  __ load(new LIR_Address(base, disp, type), tmp, info);
    +  __ cmp(condition, reg, tmp);
    +}
    +
    +
    +bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) {
    +  assert(left != result, "should be different registers");
    +  if (is_power_of_2(c + 1)) {
    +    __ shift_left(left, log2_intptr(c + 1), result);
    +    __ sub(result, left, result);
    +    return true;
    +  } else if (is_power_of_2(c - 1)) {
    +    __ shift_left(left, log2_intptr(c - 1), result);
    +    __ add(result, left, result);
    +    return true;
    +  }
    +  return false;
    +}
    +
    +
    +void LIRGenerator::store_stack_parameter(LIR_Opr item, ByteSize offset_from_sp) {
    +  BasicType t = item->type();
    +  LIR_Opr sp_opr = FrameMap::SP_opr;
    +  if ((t == T_LONG || t == T_DOUBLE) &&
    +      ((in_bytes(offset_from_sp) - STACK_BIAS) % 8 != 0)) {
    +    __ unaligned_move(item, new LIR_Address(sp_opr, in_bytes(offset_from_sp), t));
    +  } else {
    +    __ move(item, new LIR_Address(sp_opr, in_bytes(offset_from_sp), t));
    +  }
    +}
    +
    +
    +//----------------------------------------------------------------------
    +//             visitor functions
    +//----------------------------------------------------------------------
    +
    +void LIRGenerator::do_StoreIndexed(StoreIndexed* x) {
    +  assert(x->is_pinned(),"");
    +  bool needs_range_check = x->compute_needs_range_check();
    +  bool use_length = x->length() != NULL;
    +  bool obj_store = x->elt_type() == T_ARRAY || x->elt_type() == T_OBJECT;
    +  bool needs_store_check = obj_store && (x->value()->as_Constant() == NULL ||
    +                                         !get_jobject_constant(x->value())->is_null_object() ||
    +                                         x->should_profile());
    +
    +  LIRItem array(x->array(), this);
    +  LIRItem index(x->index(), this);
    +  LIRItem value(x->value(), this);
    +  LIRItem length(this);
    +
    +  array.load_item();
    +  index.load_nonconstant();
    +
    +  if (use_length && needs_range_check) {
    +    length.set_instruction(x->length());
    +    length.load_item();
    +  }
    +  if (needs_store_check) {
    +    value.load_item();
    +  } else {
    +    value.load_for_store(x->elt_type());
    +  }
    +
    +  set_no_result(x);
    +
    +  // The CodeEmitInfo must be duplicated for each different
    +  // LIR-instruction because spilling can occur anywhere between two
    +  // instructions and so the debug information must be different.
    +  CodeEmitInfo* range_check_info = state_for(x);
    +  CodeEmitInfo* null_check_info = NULL;
    +  if (x->needs_null_check()) {
    +    null_check_info = new CodeEmitInfo(range_check_info);
    +  }
    +
    +  // Emit array address setup early so it schedules better.
    +  LIR_Address* array_addr = emit_array_address(array.result(), index.result(), x->elt_type(), obj_store);
    +
    +  if (GenerateRangeChecks && needs_range_check) {
    +    if (use_length) {
    +      __ cmp(lir_cond_belowEqual, length.result(), index.result());
    +      __ branch(lir_cond_belowEqual, T_INT, new RangeCheckStub(range_check_info, index.result()));
    +    } else {
    +      array_range_check(array.result(), index.result(), null_check_info, range_check_info);
    +      // Range_check also does the null check.
    +      null_check_info = NULL;
    +    }
    +  }
    +
    +  if (GenerateArrayStoreCheck && needs_store_check) {
    +    // Following registers are used by slow_subtype_check:
    +    LIR_Opr tmp1 = FrameMap::R4_opr; // super_klass
    +    LIR_Opr tmp2 = FrameMap::R5_opr; // sub_klass
    +    LIR_Opr tmp3 = FrameMap::R6_opr; // temp
    +
    +    CodeEmitInfo* store_check_info = new CodeEmitInfo(range_check_info);
    +    __ store_check(value.result(), array.result(), tmp1, tmp2, tmp3,
    +                   store_check_info, x->profiled_method(), x->profiled_bci());
    +  }
    +
    +  if (obj_store) {
    +    // Needs GC write barriers.
    +    pre_barrier(LIR_OprFact::address(array_addr), LIR_OprFact::illegalOpr /* pre_val */,
    +                true /* do_load */, false /* patch */, NULL);
    +  }
    +  __ move(value.result(), array_addr, null_check_info);
    +  if (obj_store) {
    +    // Precise card mark.
    +    post_barrier(LIR_OprFact::address(array_addr), value.result());
    +  }
    +}
    +
    +
    +void LIRGenerator::do_MonitorEnter(MonitorEnter* x) {
    +  assert(x->is_pinned(),"");
    +  LIRItem obj(x->obj(), this);
    +  obj.load_item();
    +
    +  set_no_result(x);
    +
    +  // We use R4+R5 in order to get a temp effect. These regs are used in slow path (MonitorEnterStub).
    +  LIR_Opr lock    = FrameMap::R5_opr;
    +  LIR_Opr scratch = FrameMap::R4_opr;
    +  LIR_Opr hdr     = FrameMap::R6_opr;
    +
    +  CodeEmitInfo* info_for_exception = NULL;
    +  if (x->needs_null_check()) {
    +    info_for_exception = state_for(x);
    +  }
    +
    +  // This CodeEmitInfo must not have the xhandlers because here the
    +  // object is already locked (xhandlers expects object to be unlocked).
    +  CodeEmitInfo* info = state_for(x, x->state(), true);
    +  monitor_enter(obj.result(), lock, hdr, scratch, x->monitor_no(), info_for_exception, info);
    +}
    +
    +
    +void LIRGenerator::do_MonitorExit(MonitorExit* x) {
    +  assert(x->is_pinned(),"");
    +  LIRItem obj(x->obj(), this);
    +  obj.dont_load_item();
    +
    +  set_no_result(x);
    +  LIR_Opr lock     = FrameMap::R5_opr;
    +  LIR_Opr hdr      = FrameMap::R4_opr; // Used for slow path (MonitorExitStub).
    +  LIR_Opr obj_temp = FrameMap::R6_opr;
    +  monitor_exit(obj_temp, lock, hdr, LIR_OprFact::illegalOpr, x->monitor_no());
    +}
    +
    +
    +// _ineg, _lneg, _fneg, _dneg
    +void LIRGenerator::do_NegateOp(NegateOp* x) {
    +  LIRItem value(x->x(), this);
    +  value.load_item();
    +  LIR_Opr reg = rlock_result(x);
    +  __ negate(value.result(), reg);
    +}
    +
    +
    +// for  _fadd, _fmul, _fsub, _fdiv, _frem
    +//      _dadd, _dmul, _dsub, _ddiv, _drem
    +void LIRGenerator::do_ArithmeticOp_FPU(ArithmeticOp* x) {
    +  switch (x->op()) {
    +  case Bytecodes::_fadd:
    +  case Bytecodes::_fmul:
    +  case Bytecodes::_fsub:
    +  case Bytecodes::_fdiv:
    +  case Bytecodes::_dadd:
    +  case Bytecodes::_dmul:
    +  case Bytecodes::_dsub:
    +  case Bytecodes::_ddiv: {
    +    LIRItem left(x->x(), this);
    +    LIRItem right(x->y(), this);
    +    left.load_item();
    +    right.load_item();
    +    rlock_result(x);
    +    arithmetic_op_fpu(x->op(), x->operand(), left.result(), right.result(), x->is_strictfp());
    +  }
    +  break;
    +
    +  case Bytecodes::_frem:
    +  case Bytecodes::_drem: {
    +    address entry = NULL;
    +    switch (x->op()) {
    +    case Bytecodes::_frem:
    +      entry = CAST_FROM_FN_PTR(address, SharedRuntime::frem);
    +      break;
    +    case Bytecodes::_drem:
    +      entry = CAST_FROM_FN_PTR(address, SharedRuntime::drem);
    +      break;
    +    default:
    +      ShouldNotReachHere();
    +    }
    +    LIR_Opr result = call_runtime(x->x(), x->y(), entry, x->type(), NULL);
    +    set_result(x, result);
    +  }
    +  break;
    +
    +  default: ShouldNotReachHere();
    +  }
    +}
    +
    +
    +// for  _ladd, _lmul, _lsub, _ldiv, _lrem
    +void LIRGenerator::do_ArithmeticOp_Long(ArithmeticOp* x) {
    +  bool is_div_rem = x->op() == Bytecodes::_ldiv || x->op() == Bytecodes::_lrem;
    +
    +  LIRItem right(x->y(), this);
    +  // Missing test if instr is commutative and if we should swap.
    +  if (right.value()->type()->as_LongConstant() &&
    +      (x->op() == Bytecodes::_lsub && right.value()->type()->as_LongConstant()->value() == ((-1)<<15)) ) {
    +    // Sub is implemented by addi and can't support min_simm16 as constant..
    +    right.load_item();
    +  } else {
    +    right.load_nonconstant();
    +  }
    +  assert(right.is_constant() || right.is_register(), "wrong state of right");
    +
    +  if (is_div_rem) {
    +    LIR_Opr divisor = right.result();
    +    if (divisor->is_register()) {
    +      CodeEmitInfo* null_check_info = state_for(x);
    +      __ cmp(lir_cond_equal, divisor, LIR_OprFact::longConst(0));
    +      __ branch(lir_cond_equal, T_LONG, new DivByZeroStub(null_check_info));
    +    } else {
    +      jlong const_divisor = divisor->as_constant_ptr()->as_jlong();
    +      if (const_divisor == 0) {
    +        CodeEmitInfo* null_check_info = state_for(x);
    +        __ jump(new DivByZeroStub(null_check_info));
    +        rlock_result(x);
    +        __ move(LIR_OprFact::longConst(0), x->operand()); // dummy
    +        return;
    +      }
    +      if (x->op() == Bytecodes::_lrem && !is_power_of_2(const_divisor) && const_divisor != -1) {
    +        // Remainder computation would need additional tmp != R0.
    +        right.load_item();
    +      }
    +    }
    +  }
    +
    +  LIRItem left(x->x(), this);
    +  left.load_item();
    +  rlock_result(x);
    +  if (is_div_rem) {
    +    CodeEmitInfo* info = NULL; // Null check already done above.
    +    LIR_Opr tmp = FrameMap::R0_opr;
    +    if (x->op() == Bytecodes::_lrem) {
    +      __ irem(left.result(), right.result(), x->operand(), tmp, info);
    +    } else if (x->op() == Bytecodes::_ldiv) {
    +      __ idiv(left.result(), right.result(), x->operand(), tmp, info);
    +    }
    +  } else {
    +    arithmetic_op_long(x->op(), x->operand(), left.result(), right.result(), NULL);
    +  }
    +}
    +
    +
    +// for: _iadd, _imul, _isub, _idiv, _irem
    +void LIRGenerator::do_ArithmeticOp_Int(ArithmeticOp* x) {
    +  bool is_div_rem = x->op() == Bytecodes::_idiv || x->op() == Bytecodes::_irem;
    +
    +  LIRItem right(x->y(), this);
    +  // Missing test if instr is commutative and if we should swap.
    +  if (right.value()->type()->as_IntConstant() &&
    +      (x->op() == Bytecodes::_isub && right.value()->type()->as_IntConstant()->value() == ((-1)<<15)) ) {
    +    // Sub is implemented by addi and can't support min_simm16 as constant.
    +    right.load_item();
    +  } else {
    +    right.load_nonconstant();
    +  }
    +  assert(right.is_constant() || right.is_register(), "wrong state of right");
    +
    +  if (is_div_rem) {
    +    LIR_Opr divisor = right.result();
    +    if (divisor->is_register()) {
    +      CodeEmitInfo* null_check_info = state_for(x);
    +      __ cmp(lir_cond_equal, divisor, LIR_OprFact::intConst(0));
    +      __ branch(lir_cond_equal, T_INT, new DivByZeroStub(null_check_info));
    +    } else {
    +      jint const_divisor = divisor->as_constant_ptr()->as_jint();
    +      if (const_divisor == 0) {
    +        CodeEmitInfo* null_check_info = state_for(x);
    +        __ jump(new DivByZeroStub(null_check_info));
    +        rlock_result(x);
    +        __ move(LIR_OprFact::intConst(0), x->operand()); // dummy
    +        return;
    +      }
    +      if (x->op() == Bytecodes::_irem && !is_power_of_2(const_divisor) && const_divisor != -1) {
    +        // Remainder computation would need additional tmp != R0.
    +        right.load_item();
    +      }
    +    }
    +  }
    +
    +  LIRItem left(x->x(), this);
    +  left.load_item();
    +  rlock_result(x);
    +  if (is_div_rem) {
    +    CodeEmitInfo* info = NULL; // Null check already done above.
    +    LIR_Opr tmp = FrameMap::R0_opr;
    +    if (x->op() == Bytecodes::_irem) {
    +      __ irem(left.result(), right.result(), x->operand(), tmp, info);
    +    } else if (x->op() == Bytecodes::_idiv) {
    +      __ idiv(left.result(), right.result(), x->operand(), tmp, info);
    +    }
    +  } else {
    +    arithmetic_op_int(x->op(), x->operand(), left.result(), right.result(), FrameMap::R0_opr);
    +  }
    +}
    +
    +
    +void LIRGenerator::do_ArithmeticOp(ArithmeticOp* x) {
    +  ValueTag tag = x->type()->tag();
    +  assert(x->x()->type()->tag() == tag && x->y()->type()->tag() == tag, "wrong parameters");
    +  switch (tag) {
    +    case floatTag:
    +    case doubleTag: do_ArithmeticOp_FPU(x);  return;
    +    case longTag:   do_ArithmeticOp_Long(x); return;
    +    case intTag:    do_ArithmeticOp_Int(x);  return;
    +  }
    +  ShouldNotReachHere();
    +}
    +
    +
    +// _ishl, _lshl, _ishr, _lshr, _iushr, _lushr
    +void LIRGenerator::do_ShiftOp(ShiftOp* x) {
    +  LIRItem value(x->x(), this);
    +  LIRItem count(x->y(), this);
    +  value.load_item();
    +  LIR_Opr reg = rlock_result(x);
    +  LIR_Opr mcount;
    +  if (count.result()->is_register()) {
    +    mcount = FrameMap::R0_opr;
    +  } else {
    +    mcount = LIR_OprFact::illegalOpr;
    +  }
    +  shift_op(x->op(), reg, value.result(), count.result(), mcount);
    +}
    +
    +
    +inline bool can_handle_logic_op_as_uimm(ValueType *type, Bytecodes::Code bc) {
    +  jlong int_or_long_const;
    +  if (type->as_IntConstant()) {
    +    int_or_long_const = type->as_IntConstant()->value();
    +  } else if (type->as_LongConstant()) {
    +    int_or_long_const = type->as_LongConstant()->value();
    +  } else if (type->as_ObjectConstant()) {
    +    return type->as_ObjectConstant()->value()->is_null_object();
    +  } else {
    +    return false;
    +  }
    +
    +  if (Assembler::is_uimm(int_or_long_const, 16)) return true;
    +  if ((int_or_long_const & 0xFFFF) == 0 &&
    +      Assembler::is_uimm((jlong)((julong)int_or_long_const >> 16), 16)) return true;
    +
    +  // see Assembler::andi
    +  if (bc == Bytecodes::_iand &&
    +      (is_power_of_2_long(int_or_long_const+1) ||
    +       is_power_of_2_long(int_or_long_const) ||
    +       is_power_of_2_long(-int_or_long_const))) return true;
    +  if (bc == Bytecodes::_land &&
    +      (is_power_of_2_long(int_or_long_const+1) ||
    +       (Assembler::is_uimm(int_or_long_const, 32) && is_power_of_2_long(int_or_long_const)) ||
    +       (int_or_long_const != min_jlong && is_power_of_2_long(-int_or_long_const)))) return true;
    +
    +  // special case: xor -1
    +  if ((bc == Bytecodes::_ixor || bc == Bytecodes::_lxor) &&
    +      int_or_long_const == -1) return true;
    +  return false;
    +}
    +
    +
    +// _iand, _land, _ior, _lor, _ixor, _lxor
    +void LIRGenerator::do_LogicOp(LogicOp* x) {
    +  LIRItem left(x->x(), this);
    +  LIRItem right(x->y(), this);
    +
    +  left.load_item();
    +
    +  Value rval = right.value();
    +  LIR_Opr r = rval->operand();
    +  ValueType *type = rval->type();
    +  // Logic instructions use unsigned immediate values.
    +  if (can_handle_logic_op_as_uimm(type, x->op())) {
    +    if (!r->is_constant()) {
    +      r = LIR_OprFact::value_type(type);
    +      rval->set_operand(r);
    +    }
    +    right.set_result(r);
    +  } else {
    +    right.load_item();
    +  }
    +
    +  LIR_Opr reg = rlock_result(x);
    +
    +  logic_op(x->op(), reg, left.result(), right.result());
    +}
    +
    +
    +// _lcmp, _fcmpl, _fcmpg, _dcmpl, _dcmpg
    +void LIRGenerator::do_CompareOp(CompareOp* x) {
    +  LIRItem left(x->x(), this);
    +  LIRItem right(x->y(), this);
    +  left.load_item();
    +  right.load_item();
    +  LIR_Opr reg = rlock_result(x);
    +  if (x->x()->type()->is_float_kind()) {
    +    Bytecodes::Code code = x->op();
    +    __ fcmp2int(left.result(), right.result(), reg, (code == Bytecodes::_fcmpl || code == Bytecodes::_dcmpl));
    +  } else if (x->x()->type()->tag() == longTag) {
    +    __ lcmp2int(left.result(), right.result(), reg);
    +  } else {
    +    Unimplemented();
    +  }
    +}
    +
    +
    +void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) {
    +  assert(x->number_of_arguments() == 4, "wrong type");
    +  LIRItem obj   (x->argument_at(0), this);  // object
    +  LIRItem offset(x->argument_at(1), this);  // offset of field
    +  LIRItem cmp   (x->argument_at(2), this);  // Value to compare with field.
    +  LIRItem val   (x->argument_at(3), this);  // Replace field with val if matches cmp.
    +
    +  LIR_Opr t1 = LIR_OprFact::illegalOpr;
    +  LIR_Opr t2 = LIR_OprFact::illegalOpr;
    +  LIR_Opr addr = new_pointer_register();
    +
    +  // Get address of field.
    +  obj.load_item();
    +  offset.load_item();
    +  cmp.load_item();
    +  val.load_item();
    +
    +  __ add(obj.result(), offset.result(), addr);
    +
    +  // Volatile load may be followed by Unsafe CAS.
    +  if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
    +    __ membar(); // To be safe. Unsafe semantics are unclear.
    +  } else {
    +    __ membar_release();
    +  }
    +
    +  if (type == objectType) {  // Write-barrier needed for Object fields.
    +    // Only cmp value can get overwritten, no do_load required.
    +    pre_barrier(LIR_OprFact::illegalOpr /* addr */, cmp.result() /* pre_val */,
    +                false /* do_load */, false /* patch */, NULL);
    +  }
    +
    +  if (type == objectType) {
    +    if (UseCompressedOops) {
    +      t1 = new_register(T_OBJECT);
    +      t2 = new_register(T_OBJECT);
    +    }
    +    __ cas_obj(addr, cmp.result(), val.result(), t1, t2);
    +  } else if (type == intType) {
    +    __ cas_int(addr, cmp.result(), val.result(), t1, t2);
    +  } else if (type == longType) {
    +    __ cas_long(addr, cmp.result(), val.result(), t1, t2);
    +  } else {
    +    ShouldNotReachHere();
    +  }
    +  // Benerate conditional move of boolean result.
    +  LIR_Opr result = rlock_result(x);
    +  __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0),
    +           result, as_BasicType(type));
    +  if (type == objectType) {  // Write-barrier needed for Object fields.
    +    // Precise card mark since could either be object or array.
    +    post_barrier(addr, val.result());
    +  }
    +}
    +
    +
    +void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
    +  switch (x->id()) {
    +    case vmIntrinsics::_dabs: {
    +      assert(x->number_of_arguments() == 1, "wrong type");
    +      LIRItem value(x->argument_at(0), this);
    +      value.load_item();
    +      LIR_Opr dst = rlock_result(x);
    +      __ abs(value.result(), dst, LIR_OprFact::illegalOpr);
    +      break;
    +    }
    +    case vmIntrinsics::_dsqrt: {
    +      if (VM_Version::has_fsqrt()) {
    +        assert(x->number_of_arguments() == 1, "wrong type");
    +        LIRItem value(x->argument_at(0), this);
    +        value.load_item();
    +        LIR_Opr dst = rlock_result(x);
    +        __ sqrt(value.result(), dst, LIR_OprFact::illegalOpr);
    +        break;
    +      } // else fallthru
    +    }
    +    case vmIntrinsics::_dlog10: // fall through
    +    case vmIntrinsics::_dlog: // fall through
    +    case vmIntrinsics::_dsin: // fall through
    +    case vmIntrinsics::_dtan: // fall through
    +    case vmIntrinsics::_dcos: // fall through
    +    case vmIntrinsics::_dexp: {
    +      assert(x->number_of_arguments() == 1, "wrong type");
    +
    +      address runtime_entry = NULL;
    +      switch (x->id()) {
    +      case vmIntrinsics::_dsqrt:
    +        runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dsqrt);
    +        break;
    +      case vmIntrinsics::_dsin:
    +        runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dsin);
    +        break;
    +      case vmIntrinsics::_dcos:
    +        runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dcos);
    +        break;
    +      case vmIntrinsics::_dtan:
    +        runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dtan);
    +        break;
    +      case vmIntrinsics::_dlog:
    +        runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dlog);
    +        break;
    +      case vmIntrinsics::_dlog10:
    +        runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dlog10);
    +        break;
    +      case vmIntrinsics::_dexp:
    +        runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dexp);
    +        break;
    +      default:
    +        ShouldNotReachHere();
    +      }
    +
    +      LIR_Opr result = call_runtime(x->argument_at(0), runtime_entry, x->type(), NULL);
    +      set_result(x, result);
    +      break;
    +    }
    +    case vmIntrinsics::_dpow: {
    +      assert(x->number_of_arguments() == 2, "wrong type");
    +      address runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dpow);
    +      LIR_Opr result = call_runtime(x->argument_at(0), x->argument_at(1), runtime_entry, x->type(), NULL);
    +      set_result(x, result);
    +      break;
    +    }
    +  }
    +}
    +
    +
    +void LIRGenerator::do_ArrayCopy(Intrinsic* x) {
    +  assert(x->number_of_arguments() == 5, "wrong type");
    +
    +  // Make all state_for calls early since they can emit code.
    +  CodeEmitInfo* info = state_for(x, x->state());
    +
    +  LIRItem src     (x->argument_at(0), this);
    +  LIRItem src_pos (x->argument_at(1), this);
    +  LIRItem dst     (x->argument_at(2), this);
    +  LIRItem dst_pos (x->argument_at(3), this);
    +  LIRItem length  (x->argument_at(4), this);
    +
    +  // Load all values in callee_save_registers (C calling convention),
    +  // as this makes the parameter passing to the fast case simpler.
    +  src.load_item_force     (FrameMap::R14_oop_opr);
    +  src_pos.load_item_force (FrameMap::R15_opr);
    +  dst.load_item_force     (FrameMap::R17_oop_opr);
    +  dst_pos.load_item_force (FrameMap::R18_opr);
    +  length.load_item_force  (FrameMap::R19_opr);
    +  LIR_Opr tmp =            FrameMap::R20_opr;
    +
    +  int flags;
    +  ciArrayKlass* expected_type;
    +  arraycopy_helper(x, &flags, &expected_type);
    +
    +  __ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(),
    +               length.result(), tmp,
    +               expected_type, flags, info);
    +  set_no_result(x);
    +}
    +
    +
    +// _i2l, _i2f, _i2d, _l2i, _l2f, _l2d, _f2i, _f2l, _f2d, _d2i, _d2l, _d2f
    +// _i2b, _i2c, _i2s
    +void LIRGenerator::do_Convert(Convert* x) {
    +  switch (x->op()) {
    +
    +    // int -> float: force spill
    +    case Bytecodes::_l2f: {
    +      if (!VM_Version::has_fcfids()) { // fcfids is >= Power7 only
    +        // fcfid+frsp needs fixup code to avoid rounding incompatibility.
    +        address entry = CAST_FROM_FN_PTR(address, SharedRuntime::l2f);
    +        LIR_Opr result = call_runtime(x->value(), entry, x->type(), NULL);
    +        set_result(x, result);
    +        break;
    +      } // else fallthru
    +    }
    +    case Bytecodes::_l2d: {
    +      LIRItem value(x->value(), this);
    +      LIR_Opr reg = rlock_result(x);
    +      value.load_item();
    +      LIR_Opr tmp = force_to_spill(value.result(), T_DOUBLE);
    +      __ convert(x->op(), tmp, reg);
    +      break;
    +    }
    +    case Bytecodes::_i2f:
    +    case Bytecodes::_i2d: {
    +      LIRItem value(x->value(), this);
    +      LIR_Opr reg = rlock_result(x);
    +      value.load_item();
    +      // Convert i2l first.
    +      LIR_Opr tmp1 = new_register(T_LONG);
    +      __ convert(Bytecodes::_i2l, value.result(), tmp1);
    +      LIR_Opr tmp2 = force_to_spill(tmp1, T_DOUBLE);
    +      __ convert(x->op(), tmp2, reg);
    +      break;
    +    }
    +
    +    // float -> int: result will be stored
    +    case Bytecodes::_f2l:
    +    case Bytecodes::_d2l: {
    +      LIRItem value(x->value(), this);
    +      LIR_Opr reg = rlock_result(x);
    +      value.set_destroys_register(); // USE_KILL
    +      value.load_item();
    +      set_vreg_flag(reg, must_start_in_memory);
    +      __ convert(x->op(), value.result(), reg);
    +      break;
    +    }
    +    case Bytecodes::_f2i:
    +    case Bytecodes::_d2i: {
    +      LIRItem value(x->value(), this);
    +      LIR_Opr reg = rlock_result(x);
    +      value.set_destroys_register(); // USE_KILL
    +      value.load_item();
    +      // Convert l2i afterwards.
    +      LIR_Opr tmp1 = new_register(T_LONG);
    +      set_vreg_flag(tmp1, must_start_in_memory);
    +      __ convert(x->op(), value.result(), tmp1);
    +      __ convert(Bytecodes::_l2i, tmp1, reg);
    +      break;
    +    }
    +
    +    // Within same category: just register conversions.
    +    case Bytecodes::_i2b:
    +    case Bytecodes::_i2c:
    +    case Bytecodes::_i2s:
    +    case Bytecodes::_i2l:
    +    case Bytecodes::_l2i:
    +    case Bytecodes::_f2d:
    +    case Bytecodes::_d2f: {
    +      LIRItem value(x->value(), this);
    +      LIR_Opr reg = rlock_result(x);
    +      value.load_item();
    +      __ convert(x->op(), value.result(), reg);
    +      break;
    +    }
    +
    +    default: ShouldNotReachHere();
    +  }
    +}
    +
    +
    +void LIRGenerator::do_NewInstance(NewInstance* x) {
    +  // This instruction can be deoptimized in the slow path.
    +  const LIR_Opr reg = result_register_for(x->type());
    +#ifndef PRODUCT
    +  if (PrintNotLoaded && !x->klass()->is_loaded()) {
    +    tty->print_cr("   ###class not loaded at new bci %d", x->printable_bci());
    +  }
    +#endif
    +  CodeEmitInfo* info = state_for(x, x->state());
    +  LIR_Opr klass_reg = FrameMap::R4_metadata_opr; // Used by slow path (NewInstanceStub).
    +  LIR_Opr tmp1 = FrameMap::R5_oop_opr;
    +  LIR_Opr tmp2 = FrameMap::R6_oop_opr;
    +  LIR_Opr tmp3 = FrameMap::R7_oop_opr;
    +  LIR_Opr tmp4 = FrameMap::R8_oop_opr;
    +  new_instance(reg, x->klass(), x->is_unresolved(), tmp1, tmp2, tmp3, tmp4, klass_reg, info);
    +
    +  // Must prevent reordering of stores for object initialization
    +  // with stores that publish the new object.
    +  __ membar_storestore();
    +  LIR_Opr result = rlock_result(x);
    +  __ move(reg, result);
    +}
    +
    +
    +void LIRGenerator::do_NewTypeArray(NewTypeArray* x) {
    +  // Evaluate state_for early since it may emit code.
    +  CodeEmitInfo* info = state_for(x, x->state());
    +
    +  LIRItem length(x->length(), this);
    +  length.load_item();
    +
    +  LIR_Opr reg = result_register_for(x->type());
    +  LIR_Opr klass_reg = FrameMap::R4_metadata_opr; // Used by slow path (NewTypeArrayStub).
    +  // We use R5 in order to get a temp effect. This reg is used in slow path (NewTypeArrayStub).
    +  LIR_Opr tmp1 = FrameMap::R5_oop_opr;
    +  LIR_Opr tmp2 = FrameMap::R6_oop_opr;
    +  LIR_Opr tmp3 = FrameMap::R7_oop_opr;
    +  LIR_Opr tmp4 = FrameMap::R8_oop_opr;
    +  LIR_Opr len = length.result();
    +  BasicType elem_type = x->elt_type();
    +
    +  __ metadata2reg(ciTypeArrayKlass::make(elem_type)->constant_encoding(), klass_reg);
    +
    +  CodeStub* slow_path = new NewTypeArrayStub(klass_reg, len, reg, info);
    +  __ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, elem_type, klass_reg, slow_path);
    +
    +  // Must prevent reordering of stores for object initialization
    +  // with stores that publish the new object.
    +  __ membar_storestore();
    +  LIR_Opr result = rlock_result(x);
    +  __ move(reg, result);
    +}
    +
    +
    +void LIRGenerator::do_NewObjectArray(NewObjectArray* x) {
    +  // Evaluate state_for early since it may emit code.
    +  CodeEmitInfo* info = state_for(x, x->state());
    +  // In case of patching (i.e., object class is not yet loaded),
    +  // we need to reexecute the instruction and therefore provide
    +  // the state before the parameters have been consumed.
    +  CodeEmitInfo* patching_info = NULL;
    +  if (!x->klass()->is_loaded() || PatchALot) {
    +    patching_info = state_for(x, x->state_before());
    +  }
    +
    +  LIRItem length(x->length(), this);
    +  length.load_item();
    +
    +  const LIR_Opr reg = result_register_for(x->type());
    +  LIR_Opr klass_reg = FrameMap::R4_metadata_opr; // Used by slow path (NewObjectArrayStub).
    +  // We use R5 in order to get a temp effect. This reg is used in slow path (NewObjectArrayStub).
    +  LIR_Opr tmp1 = FrameMap::R5_oop_opr;
    +  LIR_Opr tmp2 = FrameMap::R6_oop_opr;
    +  LIR_Opr tmp3 = FrameMap::R7_oop_opr;
    +  LIR_Opr tmp4 = FrameMap::R8_oop_opr;
    +  LIR_Opr len = length.result();
    +
    +  CodeStub* slow_path = new NewObjectArrayStub(klass_reg, len, reg, info);
    +  ciMetadata* obj = ciObjArrayKlass::make(x->klass());
    +  if (obj == ciEnv::unloaded_ciobjarrayklass()) {
    +    BAILOUT("encountered unloaded_ciobjarrayklass due to out of memory error");
    +  }
    +  klass2reg_with_patching(klass_reg, obj, patching_info);
    +  __ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, T_OBJECT, klass_reg, slow_path);
    +
    +  // Must prevent reordering of stores for object initialization
    +  // with stores that publish the new object.
    +  __ membar_storestore();
    +  LIR_Opr result = rlock_result(x);
    +  __ move(reg, result);
    +}
    +
    +
    +void LIRGenerator::do_NewMultiArray(NewMultiArray* x) {
    +  Values* dims = x->dims();
    +  int i = dims->length();
    +  LIRItemList* items = new LIRItemList(dims->length(), NULL);
    +  while (i-- > 0) {
    +    LIRItem* size = new LIRItem(dims->at(i), this);
    +    items->at_put(i, size);
    +  }
    +
    +  // Evaluate state_for early since it may emit code.
    +  CodeEmitInfo* patching_info = NULL;
    +  if (!x->klass()->is_loaded() || PatchALot) {
    +    patching_info = state_for(x, x->state_before());
    +
    +    // Cannot re-use same xhandlers for multiple CodeEmitInfos, so
    +    // clone all handlers (NOTE: Usually this is handled transparently
    +    // by the CodeEmitInfo cloning logic in CodeStub constructors but
    +    // is done explicitly here because a stub isn't being used).
    +    x->set_exception_handlers(new XHandlers(x->exception_handlers()));
    +  }
    +  CodeEmitInfo* info = state_for(x, x->state());
    +
    +  i = dims->length();
    +  while (i-- > 0) {
    +    LIRItem* size = items->at(i);
    +    size->load_nonconstant();
    +    // FrameMap::_reserved_argument_area_size includes the dimensions
    +    // varargs, because it's initialized to hir()->max_stack() when the
    +    // FrameMap is created.
    +    store_stack_parameter(size->result(), in_ByteSize(i*sizeof(jint) + FrameMap::first_available_sp_in_frame));
    +  }
    +
    +  const LIR_Opr klass_reg = FrameMap::R4_metadata_opr; // Used by slow path.
    +  klass2reg_with_patching(klass_reg, x->klass(), patching_info);
    +
    +  LIR_Opr rank = FrameMap::R5_opr; // Used by slow path.
    +  __ move(LIR_OprFact::intConst(x->rank()), rank);
    +
    +  LIR_Opr varargs = FrameMap::as_pointer_opr(R6); // Used by slow path.
    +  __ leal(LIR_OprFact::address(new LIR_Address(FrameMap::SP_opr, FrameMap::first_available_sp_in_frame, T_INT)),
    +          varargs);
    +
    +  // Note: This instruction can be deoptimized in the slow path.
    +  LIR_OprList* args = new LIR_OprList(3);
    +  args->append(klass_reg);
    +  args->append(rank);
    +  args->append(varargs);
    +  const LIR_Opr reg = result_register_for(x->type());
    +  __ call_runtime(Runtime1::entry_for(Runtime1::new_multi_array_id),
    +                  LIR_OprFact::illegalOpr,
    +                  reg, args, info);
    +
    +  // Must prevent reordering of stores for object initialization
    +  // with stores that publish the new object.
    +  __ membar_storestore();
    +  LIR_Opr result = rlock_result(x);
    +  __ move(reg, result);
    +}
    +
    +
    +void LIRGenerator::do_BlockBegin(BlockBegin* x) {
    +  // nothing to do for now
    +}
    +
    +
    +void LIRGenerator::do_CheckCast(CheckCast* x) {
    +  LIRItem obj(x->obj(), this);
    +  CodeEmitInfo* patching_info = NULL;
    +  if (!x->klass()->is_loaded() || (PatchALot && !x->is_incompatible_class_change_check())) {
    +    // Must do this before locking the destination register as
    +    // an oop register, and before the obj is loaded (so x->obj()->item()
    +    // is valid for creating a debug info location).
    +    patching_info = state_for(x, x->state_before());
    +  }
    +  obj.load_item();
    +  LIR_Opr out_reg = rlock_result(x);
    +  CodeStub* stub;
    +  CodeEmitInfo* info_for_exception = state_for(x);
    +
    +  if (x->is_incompatible_class_change_check()) {
    +    assert(patching_info == NULL, "can't patch this");
    +    stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id,
    +                                   LIR_OprFact::illegalOpr, info_for_exception);
    +  } else {
    +    stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception);
    +  }
    +  // Following registers are used by slow_subtype_check:
    +  LIR_Opr tmp1 = FrameMap::R4_oop_opr; // super_klass
    +  LIR_Opr tmp2 = FrameMap::R5_oop_opr; // sub_klass
    +  LIR_Opr tmp3 = FrameMap::R6_oop_opr; // temp
    +  __ checkcast(out_reg, obj.result(), x->klass(), tmp1, tmp2, tmp3,
    +               x->direct_compare(), info_for_exception, patching_info, stub,
    +               x->profiled_method(), x->profiled_bci());
    +}
    +
    +
    +void LIRGenerator::do_InstanceOf(InstanceOf* x) {
    +  LIRItem obj(x->obj(), this);
    +  CodeEmitInfo* patching_info = NULL;
    +  if (!x->klass()->is_loaded() || PatchALot) {
    +    patching_info = state_for(x, x->state_before());
    +  }
    +  // Ensure the result register is not the input register because the
    +  // result is initialized before the patching safepoint.
    +  obj.load_item();
    +  LIR_Opr out_reg = rlock_result(x);
    +  // Following registers are used by slow_subtype_check:
    +  LIR_Opr tmp1 = FrameMap::R4_oop_opr; // super_klass
    +  LIR_Opr tmp2 = FrameMap::R5_oop_opr; // sub_klass
    +  LIR_Opr tmp3 = FrameMap::R6_oop_opr; // temp
    +  __ instanceof(out_reg, obj.result(), x->klass(), tmp1, tmp2, tmp3,
    +                x->direct_compare(), patching_info,
    +                x->profiled_method(), x->profiled_bci());
    +}
    +
    +
    +void LIRGenerator::do_If(If* x) {
    +  assert(x->number_of_sux() == 2, "inconsistency");
    +  ValueTag tag = x->x()->type()->tag();
    +  LIRItem xitem(x->x(), this);
    +  LIRItem yitem(x->y(), this);
    +  LIRItem* xin = &xitem;
    +  LIRItem* yin = &yitem;
    +  If::Condition cond = x->cond();
    +
    +  LIR_Opr left = LIR_OprFact::illegalOpr;
    +  LIR_Opr right = LIR_OprFact::illegalOpr;
    +
    +  xin->load_item();
    +  left = xin->result();
    +
    +  if (yin->result()->is_constant() && yin->result()->type() == T_INT &&
    +      Assembler::is_simm16(yin->result()->as_constant_ptr()->as_jint())) {
    +    // Inline int constants which are small enough to be immediate operands.
    +    right = LIR_OprFact::value_type(yin->value()->type());
    +  } else if (tag == longTag && yin->is_constant() && yin->get_jlong_constant() == 0 &&
    +             (cond == If::eql || cond == If::neq)) {
    +    // Inline long zero.
    +    right = LIR_OprFact::value_type(yin->value()->type());
    +  } else if (tag == objectTag && yin->is_constant() && (yin->get_jobject_constant()->is_null_object())) {
    +    right = LIR_OprFact::value_type(yin->value()->type());
    +  } else {
    +    yin->load_item();
    +    right = yin->result();
    +  }
    +  set_no_result(x);
    +
    +  // Add safepoint before generating condition code so it can be recomputed.
    +  if (x->is_safepoint()) {
    +    // Increment backedge counter if needed.
    +    increment_backedge_counter(state_for(x, x->state_before()), x->profiled_bci());
    +    __ safepoint(safepoint_poll_register(), state_for(x, x->state_before()));
    +  }
    +
    +  __ cmp(lir_cond(cond), left, right);
    +  // Generate branch profiling. Profiling code doesn't kill flags.
    +  profile_branch(x, cond);
    +  move_to_phi(x->state());
    +  if (x->x()->type()->is_float_kind()) {
    +    __ branch(lir_cond(cond), right->type(), x->tsux(), x->usux());
    +  } else {
    +    __ branch(lir_cond(cond), right->type(), x->tsux());
    +  }
    +  assert(x->default_sux() == x->fsux(), "wrong destination above");
    +  __ jump(x->default_sux());
    +}
    +
    +
    +LIR_Opr LIRGenerator::getThreadPointer() {
    +  return FrameMap::as_pointer_opr(R16_thread);
    +}
    +
    +
    +void LIRGenerator::trace_block_entry(BlockBegin* block) {
    +  LIR_Opr arg1 = FrameMap::R3_opr; // ARG1
    +  __ move(LIR_OprFact::intConst(block->block_id()), arg1);
    +  LIR_OprList* args = new LIR_OprList(1);
    +  args->append(arg1);
    +  address func = CAST_FROM_FN_PTR(address, Runtime1::trace_block_entry);
    +  __ call_runtime_leaf(func, LIR_OprFact::illegalOpr, LIR_OprFact::illegalOpr, args);
    +}
    +
    +
    +void LIRGenerator::volatile_field_store(LIR_Opr value, LIR_Address* address,
    +                                        CodeEmitInfo* info) {
    +#ifdef _LP64
    +  __ store(value, address, info);
    +#else
    +  Unimplemented();
    +//  __ volatile_store_mem_reg(value, address, info);
    +#endif
    +}
    +
    +void LIRGenerator::volatile_field_load(LIR_Address* address, LIR_Opr result,
    +                                       CodeEmitInfo* info) {
    +#ifdef _LP64
    +  __ load(address, result, info);
    +#else
    +  Unimplemented();
    +//  __ volatile_load_mem_reg(address, result, info);
    +#endif
    +}
    +
    +
    +void LIRGenerator::put_Object_unsafe(LIR_Opr src, LIR_Opr offset, LIR_Opr data,
    +                                     BasicType type, bool is_volatile) {
    +  LIR_Opr base_op = src;
    +  LIR_Opr index_op = offset;
    +
    +  bool is_obj = (type == T_ARRAY || type == T_OBJECT);
    +#ifndef _LP64
    +  if (is_volatile && type == T_LONG) {
    +    __ volatile_store_unsafe_reg(data, src, offset, type, NULL, lir_patch_none);
    +  } else
    +#endif
    +  {
    +    if (type == T_BOOLEAN) {
    +      type = T_BYTE;
    +    }
    +    LIR_Address* addr;
    +    if (type == T_ARRAY || type == T_OBJECT) {
    +      LIR_Opr tmp = new_pointer_register();
    +      __ add(base_op, index_op, tmp);
    +      addr = new LIR_Address(tmp, type);
    +    } else {
    +      addr = new LIR_Address(base_op, index_op, type);
    +    }
    +
    +    if (is_obj) {
    +      pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */,
    +          true /* do_load */, false /* patch */, NULL);
    +      // _bs->c1_write_barrier_pre(this, LIR_OprFact::address(addr));
    +    }
    +    __ move(data, addr);
    +    if (is_obj) {
    +      // This address is precise.
    +      post_barrier(LIR_OprFact::address(addr), data);
    +    }
    +  }
    +}
    +
    +
    +void LIRGenerator::get_Object_unsafe(LIR_Opr dst, LIR_Opr src, LIR_Opr offset,
    +                                     BasicType type, bool is_volatile) {
    +#ifndef _LP64
    +  if (is_volatile && type == T_LONG) {
    +    __ volatile_load_unsafe_reg(src, offset, dst, type, NULL, lir_patch_none);
    +  } else
    +#endif
    +    {
    +    LIR_Address* addr = new LIR_Address(src, offset, type);
    +    __ load(addr, dst);
    +  }
    +}
    +
    +
    +void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {
    +  BasicType type = x->basic_type();
    +  LIRItem src(x->object(), this);
    +  LIRItem off(x->offset(), this);
    +  LIRItem value(x->value(), this);
    +
    +  src.load_item();
    +  value.load_item();
    +  off.load_nonconstant();
    +
    +  LIR_Opr dst = rlock_result(x, type);
    +  LIR_Opr data = value.result();
    +  bool is_obj = (type == T_ARRAY || type == T_OBJECT);
    +
    +  LIR_Opr tmp = FrameMap::R0_opr;
    +  LIR_Opr ptr = new_pointer_register();
    +  __ add(src.result(), off.result(), ptr);
    +
    +  if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
    +    __ membar();
    +  } else {
    +    __ membar_release();
    +  }
    +
    +  if (x->is_add()) {
    +    __ xadd(ptr, data, dst, tmp);
    +  } else {
    +    const bool can_move_barrier = true; // TODO: port GraphKit::can_move_pre_barrier() from C2
    +    if (!can_move_barrier && is_obj) {
    +      // Do the pre-write barrier, if any.
    +      pre_barrier(ptr, LIR_OprFact::illegalOpr /* pre_val */,
    +                  true /* do_load */, false /* patch */, NULL);
    +    }
    +    __ xchg(ptr, data, dst, tmp);
    +    if (is_obj) {
    +      // Seems to be a precise address.
    +      post_barrier(ptr, data);
    +      if (can_move_barrier) {
    +        pre_barrier(LIR_OprFact::illegalOpr, dst /* pre_val */,
    +                    false /* do_load */, false /* patch */, NULL);
    +      }
    +    }
    +  }
    +
    +  __ membar();
    +}
    +
    +
    +void LIRGenerator::do_update_CRC32(Intrinsic* x) {
    +  assert(UseCRC32Intrinsics, "or should not be here");
    +  LIR_Opr result = rlock_result(x);
    +
    +  switch (x->id()) {
    +    case vmIntrinsics::_updateCRC32: {
    +      LIRItem crc(x->argument_at(0), this);
    +      LIRItem val(x->argument_at(1), this);
    +      // Registers destroyed by update_crc32.
    +      crc.set_destroys_register();
    +      val.set_destroys_register();
    +      crc.load_item();
    +      val.load_item();
    +      __ update_crc32(crc.result(), val.result(), result);
    +      break;
    +    }
    +    case vmIntrinsics::_updateBytesCRC32:
    +    case vmIntrinsics::_updateByteBufferCRC32: {
    +      bool is_updateBytes = (x->id() == vmIntrinsics::_updateBytesCRC32);
    +
    +      LIRItem crc(x->argument_at(0), this);
    +      LIRItem buf(x->argument_at(1), this);
    +      LIRItem off(x->argument_at(2), this);
    +      LIRItem len(x->argument_at(3), this);
    +      buf.load_item();
    +      off.load_nonconstant();
    +
    +      LIR_Opr index = off.result();
    +      int offset = is_updateBytes ? arrayOopDesc::base_offset_in_bytes(T_BYTE) : 0;
    +      if (off.result()->is_constant()) {
    +        index = LIR_OprFact::illegalOpr;
    +        offset += off.result()->as_jint();
    +      }
    +      LIR_Opr base_op = buf.result();
    +      LIR_Address* a = NULL;
    +
    +      if (index->is_valid()) {
    +        LIR_Opr tmp = new_register(T_LONG);
    +        __ convert(Bytecodes::_i2l, index, tmp);
    +        index = tmp;
    +        __ add(index, LIR_OprFact::intptrConst(offset), index);
    +        a = new LIR_Address(base_op, index, T_BYTE);
    +      } else {
    +        a = new LIR_Address(base_op, offset, T_BYTE);
    +      }
    +
    +      BasicTypeList signature(3);
    +      signature.append(T_INT);
    +      signature.append(T_ADDRESS);
    +      signature.append(T_INT);
    +      CallingConvention* cc = frame_map()->c_calling_convention(&signature);
    +      const LIR_Opr result_reg = result_register_for(x->type());
    +
    +      LIR_Opr arg1 = cc->at(0),
    +              arg2 = cc->at(1),
    +              arg3 = cc->at(2);
    +
    +      // CCallingConventionRequiresIntsAsLongs
    +      crc.load_item_force(arg1); // We skip int->long conversion here, because CRC32 stub doesn't care about high bits.
    +      __ leal(LIR_OprFact::address(a), arg2);
    +      load_int_as_long(gen()->lir(), len, arg3);
    +
    +      __ call_runtime_leaf(StubRoutines::updateBytesCRC32(), LIR_OprFact::illegalOpr, result_reg, cc->args());
    +      __ move(result_reg, result);
    +      break;
    +    }
    +    default: {
    +      ShouldNotReachHere();
    +    }
    +  }
    +}
    diff --git a/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp
    new file mode 100644
    index 00000000000..7c73b1c70a8
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp
    @@ -0,0 +1,34 @@
    +/*
    + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#include "precompiled.hpp"
    +#include "c1/c1_Instruction.hpp"
    +#include "c1/c1_LinearScan.hpp"
    +#include "utilities/bitMap.inline.hpp"
    +
    +void LinearScan::allocate_fpu_stack() {
    +  Unimplemented();
    +  // No FPU stack on PPC
    +}
    diff --git a/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp
    new file mode 100644
    index 00000000000..d0f6002929e
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp
    @@ -0,0 +1,73 @@
    +/*
    + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#ifndef CPU_PPC_VM_C1_LINEARSCAN_PPC_HPP
    +#define CPU_PPC_VM_C1_LINEARSCAN_PPC_HPP
    +
    +inline bool LinearScan::is_processed_reg_num(int reg_num) {
    +  assert(FrameMap::R0_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 1, "wrong assumption below");
    +  assert(FrameMap::R1_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 2, "wrong assumption below");
    +  assert(FrameMap::R13_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 3, "wrong assumption below");
    +  assert(FrameMap::R16_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 4, "wrong assumption below");
    +  assert(FrameMap::R29_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 5, "wrong assumption below");
    +  return reg_num <= FrameMap::last_cpu_reg() || reg_num >= pd_nof_cpu_regs_frame_map;
    +}
    +
    +inline int LinearScan::num_physical_regs(BasicType type) {
    +  return 1;
    +}
    +
    +
    +inline bool LinearScan::requires_adjacent_regs(BasicType type) {
    +  return false;
    +}
    +
    +inline bool LinearScan::is_caller_save(int assigned_reg) {
    +  return true; // assigned_reg < pd_first_callee_saved_reg;
    +}
    +
    +
    +inline void LinearScan::pd_add_temps(LIR_Op* op) {
    +  // No special case behaviours yet
    +}
    +
    +
    +inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) {
    +  if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::callee_saved)) {
    +    assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only");
    +    _first_reg = pd_first_callee_saved_reg;
    +    _last_reg = pd_last_callee_saved_reg;
    +    ShouldNotReachHere(); // Currently no callee saved regs.
    +    return true;
    +  } else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT ||
    +             cur->type() == T_ADDRESS || cur->type() == T_METADATA) {
    +    _first_reg = pd_first_cpu_reg;
    +    _last_reg = pd_last_cpu_reg;
    +    return true;
    +  }
    +  return false;
    +}
    +
    +#endif // CPU_PPC_VM_C1_LINEARSCAN_PPC_HPP
    diff --git a/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp
    new file mode 100644
    index 00000000000..f41a83b1c71
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp
    @@ -0,0 +1,486 @@
    +/*
    + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#include "precompiled.hpp"
    +#include "c1/c1_MacroAssembler.hpp"
    +#include "c1/c1_Runtime1.hpp"
    +#include "classfile/systemDictionary.hpp"
    +#include "gc/shared/collectedHeap.hpp"
    +#include "interpreter/interpreter.hpp"
    +#include "oops/arrayOop.hpp"
    +#include "oops/markOop.hpp"
    +#include "runtime/basicLock.hpp"
    +#include "runtime/biasedLocking.hpp"
    +#include "runtime/os.hpp"
    +#include "runtime/stubRoutines.hpp"
    +#include "runtime/sharedRuntime.hpp"
    +
    +
    +void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
    +  const Register temp_reg = R12_scratch2;
    +  verify_oop(receiver);
    +  load_klass(temp_reg, receiver);
    +  if (TrapBasedICMissChecks) {
    +    trap_ic_miss_check(temp_reg, iCache);
    +  } else {
    +    Label L;
    +    cmpd(CCR0, temp_reg, iCache);
    +    beq(CCR0, L);
    +    //load_const_optimized(temp_reg, SharedRuntime::get_ic_miss_stub(), R0);
    +    calculate_address_from_global_toc(temp_reg, SharedRuntime::get_ic_miss_stub(), true, true, false);
    +    mtctr(temp_reg);
    +    bctr();
    +    align(32, 12);
    +    bind(L);
    +  }
    +}
    +
    +
    +void C1_MacroAssembler::explicit_null_check(Register base) {
    +  Unimplemented();
    +}
    +
    +
    +void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) {
    +  assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect");
    +  // Make sure there is enough stack space for this method's activation.
    +  generate_stack_overflow_check(bang_size_in_bytes);
    +
    +  // Create the frame.
    +  const Register return_pc  = R0;
    +
    +  mflr(return_pc);
    +  // Get callers sp.
    +  std(return_pc, _abi(lr), R1_SP);           // SP->lr = return_pc
    +  push_frame(frame_size_in_bytes, R0);       // SP -= frame_size_in_bytes
    +}
    +
    +
    +void C1_MacroAssembler::unverified_entry(Register receiver, Register ic_klass) {
    +  Unimplemented(); // Currently unused.
    +  //if (C1Breakpoint) illtrap();
    +  //inline_cache_check(receiver, ic_klass);
    +}
    +
    +
    +void C1_MacroAssembler::verified_entry() {
    +  if (C1Breakpoint) illtrap();
    +  // build frame
    +}
    +
    +
    +void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox, Register Rscratch, Label& slow_case) {
    +  assert_different_registers(Rmark, Roop, Rbox, Rscratch);
    +
    +  Label done, cas_failed, slow_int;
    +
    +  // The following move must be the first instruction of emitted since debug
    +  // information may be generated for it.
    +  // Load object header.
    +  ld(Rmark, oopDesc::mark_offset_in_bytes(), Roop);
    +
    +  verify_oop(Roop);
    +
    +  // Save object being locked into the BasicObjectLock...
    +  std(Roop, BasicObjectLock::obj_offset_in_bytes(), Rbox);
    +
    +  if (UseBiasedLocking) {
    +    biased_locking_enter(CCR0, Roop, Rmark, Rscratch, R0, done, &slow_int);
    +  }
    +
    +  // ... and mark it unlocked.
    +  ori(Rmark, Rmark, markOopDesc::unlocked_value);
    +
    +  // Save unlocked object header into the displaced header location on the stack.
    +  std(Rmark, BasicLock::displaced_header_offset_in_bytes(), Rbox);
    +
    +  // Compare object markOop with Rmark and if equal exchange Rscratch with object markOop.
    +  assert(oopDesc::mark_offset_in_bytes() == 0, "cas must take a zero displacement");
    +  cmpxchgd(/*flag=*/CCR0,
    +           /*current_value=*/Rscratch,
    +           /*compare_value=*/Rmark,
    +           /*exchange_value=*/Rbox,
    +           /*where=*/Roop/*+0==mark_offset_in_bytes*/,
    +           MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq,
    +           MacroAssembler::cmpxchgx_hint_acquire_lock(),
    +           noreg,
    +           &cas_failed,
    +           /*check without membar and ldarx first*/true);
    +  // If compare/exchange succeeded we found an unlocked object and we now have locked it
    +  // hence we are done.
    +  b(done);
    +
    +  bind(slow_int);
    +  b(slow_case); // far
    +
    +  bind(cas_failed);
    +  // We did not find an unlocked object so see if this is a recursive case.
    +  sub(Rscratch, Rscratch, R1_SP);
    +  load_const_optimized(R0, (~(os::vm_page_size()-1) | markOopDesc::lock_mask_in_place));
    +  and_(R0/*==0?*/, Rscratch, R0);
    +  std(R0/*==0, perhaps*/, BasicLock::displaced_header_offset_in_bytes(), Rbox);
    +  bne(CCR0, slow_int);
    +
    +  bind(done);
    +}
    +
    +
    +void C1_MacroAssembler::unlock_object(Register Rmark, Register Roop, Register Rbox, Label& slow_case) {
    +  assert_different_registers(Rmark, Roop, Rbox);
    +
    +  Label slow_int, done;
    +
    +  Address mark_addr(Roop, oopDesc::mark_offset_in_bytes());
    +  assert(mark_addr.disp() == 0, "cas must take a zero displacement");
    +
    +  if (UseBiasedLocking) {
    +    // Load the object out of the BasicObjectLock.
    +    ld(Roop, BasicObjectLock::obj_offset_in_bytes(), Rbox);
    +    verify_oop(Roop);
    +    biased_locking_exit(CCR0, Roop, R0, done);
    +  }
    +  // Test first it it is a fast recursive unlock.
    +  ld(Rmark, BasicLock::displaced_header_offset_in_bytes(), Rbox);
    +  cmpdi(CCR0, Rmark, 0);
    +  beq(CCR0, done);
    +  if (!UseBiasedLocking) {
    +    // Load object.
    +    ld(Roop, BasicObjectLock::obj_offset_in_bytes(), Rbox);
    +    verify_oop(Roop);
    +  }
    +
    +  // Check if it is still a light weight lock, this is is true if we see
    +  // the stack address of the basicLock in the markOop of the object.
    +  cmpxchgd(/*flag=*/CCR0,
    +           /*current_value=*/R0,
    +           /*compare_value=*/Rbox,
    +           /*exchange_value=*/Rmark,
    +           /*where=*/Roop,
    +           MacroAssembler::MemBarRel,
    +           MacroAssembler::cmpxchgx_hint_release_lock(),
    +           noreg,
    +           &slow_int);
    +  b(done);
    +  bind(slow_int);
    +  b(slow_case); // far
    +
    +  // Done
    +  bind(done);
    +}
    +
    +
    +void C1_MacroAssembler::try_allocate(
    +  Register obj,                        // result: pointer to object after successful allocation
    +  Register var_size_in_bytes,          // object size in bytes if unknown at compile time; invalid otherwise
    +  int      con_size_in_bytes,          // object size in bytes if   known at compile time
    +  Register t1,                         // temp register, must be global register for incr_allocated_bytes
    +  Register t2,                         // temp register
    +  Label&   slow_case                   // continuation point if fast allocation fails
    +) {
    +  if (UseTLAB) {
    +    tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case);
    +  } else {
    +    eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case);
    +    RegisterOrConstant size_in_bytes = var_size_in_bytes->is_valid()
    +                                       ? RegisterOrConstant(var_size_in_bytes)
    +                                       : RegisterOrConstant(con_size_in_bytes);
    +    incr_allocated_bytes(size_in_bytes, t1, t2);
    +  }
    +}
    +
    +
    +void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register len, Register t1, Register t2) {
    +  assert_different_registers(obj, klass, len, t1, t2);
    +  if (UseBiasedLocking && !len->is_valid()) {
    +    ld(t1, in_bytes(Klass::prototype_header_offset()), klass);
    +  } else {
    +    load_const_optimized(t1, (intx)markOopDesc::prototype());
    +  }
    +  std(t1, oopDesc::mark_offset_in_bytes(), obj);
    +  store_klass(obj, klass);
    +  if (len->is_valid()) {
    +    stw(len, arrayOopDesc::length_offset_in_bytes(), obj);
    +  } else if (UseCompressedClassPointers) {
    +    // Otherwise length is in the class gap.
    +    store_klass_gap(obj);
    +  }
    +}
    +
    +
    +void C1_MacroAssembler::initialize_body(Register base, Register index) {
    +  assert_different_registers(base, index);
    +  srdi(index, index, LogBytesPerWord);
    +  clear_memory_doubleword(base, index);
    +}
    +
    +void C1_MacroAssembler::initialize_body(Register obj, Register tmp1, Register tmp2,
    +                                        int obj_size_in_bytes, int hdr_size_in_bytes) {
    +  const int index = (obj_size_in_bytes - hdr_size_in_bytes) / HeapWordSize;
    +
    +  const int cl_size         = VM_Version::L1_data_cache_line_size(),
    +            cl_dwords       = cl_size>>3,
    +            cl_dw_addr_bits = exact_log2(cl_dwords);
    +
    +  const Register tmp = R0,
    +                 base_ptr = tmp1,
    +                 cnt_dwords = tmp2;
    +
    +  if (index <= 6) {
    +    // Use explicit NULL stores.
    +    if (index > 0) { li(tmp, 0); }
    +    for (int i = 0; i < index; ++i) { std(tmp, hdr_size_in_bytes + i * HeapWordSize, obj); }
    +
    +  } else if (index < (2<0).
    +    andi(cnt_dwords, cnt_dwords, cl_dwords-1); // Rest in dwords.
    +    mtctr(tmp);                                // Load counter.
    +
    +  bind(fastloop);
    +    dcbz(base_ptr);                    // Clear 128byte aligned block.
    +    addi(base_ptr, base_ptr, cl_size);
    +    bdnz(fastloop);
    +
    +    cmpdi(CCR0, cnt_dwords, 0);        // size 0?
    +    beq(CCR0, done);                   // rest == 0
    +    li(tmp, 0);
    +    mtctr(cnt_dwords);                 // Load counter.
    +
    +  bind(restloop);                      // Clear rest.
    +    std(tmp, 0, base_ptr);             // Clear 8byte aligned block.
    +    addi(base_ptr, base_ptr, 8);
    +    bdnz(restloop);
    +
    +  bind(done);
    +  }
    +}
    +
    +void C1_MacroAssembler::allocate_object(
    +  Register obj,                        // result: pointer to object after successful allocation
    +  Register t1,                         // temp register
    +  Register t2,                         // temp register
    +  Register t3,                         // temp register
    +  int      hdr_size,                   // object header size in words
    +  int      obj_size,                   // object size in words
    +  Register klass,                      // object klass
    +  Label&   slow_case                   // continuation point if fast allocation fails
    +) {
    +  assert_different_registers(obj, t1, t2, t3, klass);
    +
    +  // allocate space & initialize header
    +  if (!is_simm16(obj_size * wordSize)) {
    +    // Would need to use extra register to load
    +    // object size => go the slow case for now.
    +    b(slow_case);
    +    return;
    +  }
    +  try_allocate(obj, noreg, obj_size * wordSize, t2, t3, slow_case);
    +
    +  initialize_object(obj, klass, noreg, obj_size * HeapWordSize, t1, t2);
    +}
    +
    +void C1_MacroAssembler::initialize_object(
    +  Register obj,                        // result: pointer to object after successful allocation
    +  Register klass,                      // object klass
    +  Register var_size_in_bytes,          // object size in bytes if unknown at compile time; invalid otherwise
    +  int      con_size_in_bytes,          // object size in bytes if   known at compile time
    +  Register t1,                         // temp register
    +  Register t2                          // temp register
    +  ) {
    +  const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize;
    +
    +  initialize_header(obj, klass, noreg, t1, t2);
    +
    +#ifdef ASSERT
    +  {
    +    lwz(t1, in_bytes(Klass::layout_helper_offset()), klass);
    +    if (var_size_in_bytes != noreg) {
    +      cmpw(CCR0, t1, var_size_in_bytes);
    +    } else {
    +      cmpwi(CCR0, t1, con_size_in_bytes);
    +    }
    +    asm_assert_eq("bad size in initialize_object", 0x753);
    +  }
    +#endif
    +
    +  // Initialize body.
    +  if (var_size_in_bytes != noreg) {
    +    // Use a loop.
    +    addi(t1, obj, hdr_size_in_bytes);                // Compute address of first element.
    +    addi(t2, var_size_in_bytes, -hdr_size_in_bytes); // Compute size of body.
    +    initialize_body(t1, t2);
    +  } else if (con_size_in_bytes > hdr_size_in_bytes) {
    +    // Use a loop.
    +    initialize_body(obj, t1, t2, con_size_in_bytes, hdr_size_in_bytes);
    +  }
    +
    +  if (CURRENT_ENV->dtrace_alloc_probes()) {
    +    Unimplemented();
    +//    assert(obj == O0, "must be");
    +//    call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::dtrace_object_alloc_id)),
    +//         relocInfo::runtime_call_type);
    +  }
    +
    +  verify_oop(obj);
    +}
    +
    +
    +void C1_MacroAssembler::allocate_array(
    +  Register obj,                        // result: pointer to array after successful allocation
    +  Register len,                        // array length
    +  Register t1,                         // temp register
    +  Register t2,                         // temp register
    +  Register t3,                         // temp register
    +  int      hdr_size,                   // object header size in words
    +  int      elt_size,                   // element size in bytes
    +  Register klass,                      // object klass
    +  Label&   slow_case                   // continuation point if fast allocation fails
    +) {
    +  assert_different_registers(obj, len, t1, t2, t3, klass);
    +
    +  // Determine alignment mask.
    +  assert(!(BytesPerWord & 1), "must be a multiple of 2 for masking code to work");
    +  int log2_elt_size = exact_log2(elt_size);
    +
    +  // Check for negative or excessive length.
    +  size_t max_length = max_array_allocation_length >> log2_elt_size;
    +  if (UseTLAB) {
    +    size_t max_tlab = align_size_up(ThreadLocalAllocBuffer::max_size() >> log2_elt_size, 64*K);
    +    if (max_tlab < max_length) { max_length = max_tlab; }
    +  }
    +  load_const_optimized(t1, max_length);
    +  cmpld(CCR0, len, t1);
    +  bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CCR0, Assembler::greater), slow_case);
    +
    +  // compute array size
    +  // note: If 0 <= len <= max_length, len*elt_size + header + alignment is
    +  //       smaller or equal to the largest integer; also, since top is always
    +  //       aligned, we can do the alignment here instead of at the end address
    +  //       computation.
    +  const Register arr_size = t1;
    +  Register arr_len_in_bytes = len;
    +  if (elt_size != 1) {
    +    sldi(t1, len, log2_elt_size);
    +    arr_len_in_bytes = t1;
    +  }
    +  addi(arr_size, arr_len_in_bytes, hdr_size * wordSize + MinObjAlignmentInBytesMask); // Add space for header & alignment.
    +  clrrdi(arr_size, arr_size, LogMinObjAlignmentInBytes);                              // Align array size.
    +
    +  // Allocate space & initialize header.
    +  if (UseTLAB) {
    +    tlab_allocate(obj, arr_size, 0, t2, slow_case);
    +  } else {
    +    eden_allocate(obj, arr_size, 0, t2, t3, slow_case);
    +  }
    +  initialize_header(obj, klass, len, t2, t3);
    +
    +  // Initialize body.
    +  const Register base  = t2;
    +  const Register index = t3;
    +  addi(base, obj, hdr_size * wordSize);               // compute address of first element
    +  addi(index, arr_size, -(hdr_size * wordSize));      // compute index = number of bytes to clear
    +  initialize_body(base, index);
    +
    +  if (CURRENT_ENV->dtrace_alloc_probes()) {
    +    Unimplemented();
    +    //assert(obj == O0, "must be");
    +    //call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::dtrace_object_alloc_id)),
    +    //     relocInfo::runtime_call_type);
    +  }
    +
    +  verify_oop(obj);
    +}
    +
    +
    +#ifndef PRODUCT
    +
    +void C1_MacroAssembler::verify_stack_oop(int stack_offset) {
    +  verify_oop_addr((RegisterOrConstant)(stack_offset + STACK_BIAS), R1_SP, "broken oop in stack slot");
    +}
    +
    +void C1_MacroAssembler::verify_not_null_oop(Register r) {
    +  Label not_null;
    +  cmpdi(CCR0, r, 0);
    +  bne(CCR0, not_null);
    +  stop("non-null oop required");
    +  bind(not_null);
    +  if (!VerifyOops) return;
    +  verify_oop(r);
    +}
    +
    +#endif // PRODUCT
    +
    +void C1_MacroAssembler::null_check(Register r, Label* Lnull) {
    +  if (TrapBasedNullChecks) { // SIGTRAP based
    +    trap_null_check(r);
    +  } else { // explicit
    +    //const address exception_entry = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id);
    +    assert(Lnull != NULL, "must have Label for explicit check");
    +    cmpdi(CCR0, r, 0);
    +    bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CCR0, Assembler::equal), *Lnull);
    +  }
    +}
    +
    +address C1_MacroAssembler::call_c_with_frame_resize(address dest, int frame_resize) {
    +  if (frame_resize) { resize_frame(-frame_resize, R0); }
    +#if defined(ABI_ELFv2)
    +  address return_pc = call_c(dest, relocInfo::runtime_call_type);
    +#else
    +  address return_pc = call_c(CAST_FROM_FN_PTR(FunctionDescriptor*, dest), relocInfo::runtime_call_type);
    +#endif
    +  if (frame_resize) { resize_frame(frame_resize, R0); }
    +  return return_pc;
    +}
    diff --git a/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp
    new file mode 100644
    index 00000000000..9989baa8700
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp
    @@ -0,0 +1,93 @@
    +/*
    + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#ifndef CPU_PPC_VM_C1_MACROASSEMBLER_PPC_HPP
    +#define CPU_PPC_VM_C1_MACROASSEMBLER_PPC_HPP
    +
    +  void pd_init() { /* nothing to do */ }
    +
    + public:
    +   void try_allocate(
    +    Register obj,                      // result: pointer to object after successful allocation
    +    Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
    +    int      con_size_in_bytes,        // object size in bytes if   known at compile time
    +    Register t1,                       // temp register
    +    Register t2,                       // temp register
    +    Label&   slow_case                 // continuation point if fast allocation fails
    +  );
    +
    +  void initialize_header(Register obj, Register klass, Register len, Register t1, Register t2);
    +  void initialize_body(Register base, Register index);
    +  void initialize_body(Register obj, Register tmp1, Register tmp2, int obj_size_in_bytes, int hdr_size_in_bytes);
    +
    +  // locking/unlocking
    +  void lock_object  (Register Rmark, Register Roop, Register Rbox, Register Rscratch, Label& slow_case);
    +  void unlock_object(Register Rmark, Register Roop, Register Rbox,                    Label& slow_case);
    +
    +  void initialize_object(
    +    Register obj,                      // result: pointer to object after successful allocation
    +    Register klass,                    // object klass
    +    Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
    +    int      con_size_in_bytes,        // object size in bytes if   known at compile time
    +    Register t1,                       // temp register
    +    Register t2                        // temp register
    +  );
    +
    +  // Allocation of fixed-size objects
    +  // (Can also be used to allocate fixed-size arrays, by setting
    +  // hdr_size correctly and storing the array length afterwards.)
    +  void allocate_object(
    +    Register obj,                      // result: pointer to object after successful allocation
    +    Register t1,                       // temp register
    +    Register t2,                       // temp register
    +    Register t3,                       // temp register
    +    int      hdr_size,                 // object header size in words
    +    int      obj_size,                 // object size in words
    +    Register klass,                    // object klass
    +    Label&   slow_case                 // continuation point if fast allocation fails
    +  );
    +
    +  enum {
    +    max_array_allocation_length = 0x40000000 // ppc friendly value, requires lis only
    +  };
    +
    +  // Allocation of arrays
    +  void allocate_array(
    +    Register obj,                      // result: pointer to array after successful allocation
    +    Register len,                      // array length
    +    Register t1,                       // temp register
    +    Register t2,                       // temp register
    +    Register t3,                       // temp register
    +    int      hdr_size,                 // object header size in words
    +    int      elt_size,                 // element size in bytes
    +    Register klass,                    // object klass
    +    Label&   slow_case                 // continuation point if fast allocation fails
    +  );
    +
    +  void null_check(Register r, Label *Lnull = NULL);
    +
    +  address call_c_with_frame_resize(address dest, int frame_resize);
    +
    +#endif // CPU_PPC_VM_C1_MACROASSEMBLER_PPC_HPP
    diff --git a/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp
    new file mode 100644
    index 00000000000..5fbaa4beb4e
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp
    @@ -0,0 +1,1020 @@
    +/*
    + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#include "precompiled.hpp"
    +#include "c1/c1_Defs.hpp"
    +#include "c1/c1_MacroAssembler.hpp"
    +#include "c1/c1_Runtime1.hpp"
    +#include "interpreter/interpreter.hpp"
    +#include "nativeInst_ppc.hpp"
    +#include "oops/compiledICHolder.hpp"
    +#include "oops/oop.inline.hpp"
    +#include "prims/jvmtiExport.hpp"
    +#include "register_ppc.hpp"
    +#include "runtime/sharedRuntime.hpp"
    +#include "runtime/signature.hpp"
    +#include "runtime/vframeArray.hpp"
    +#include "utilities/macros.hpp"
    +#include "vmreg_ppc.inline.hpp"
    +#if INCLUDE_ALL_GCS
    +#include "gc/g1/g1SATBCardTableModRefBS.hpp"
    +#endif
    +
    +// Implementation of StubAssembler
    +
    +int StubAssembler::call_RT(Register oop_result1, Register metadata_result,
    +                           address entry_point, int number_of_arguments) {
    +  set_num_rt_args(0); // Nothing on stack
    +  assert(!(oop_result1->is_valid() || metadata_result->is_valid()) ||
    +         oop_result1 != metadata_result, "registers must be different");
    +
    +  // Currently no stack banging. We assume that there are enough
    +  // StackShadowPages (which have been banged in generate_stack_overflow_check)
    +  // for the stub frame and the runtime frames.
    +
    +  set_last_Java_frame(R1_SP, noreg);
    +
    +  // ARG1 must hold thread address.
    +  mr(R3_ARG1, R16_thread);
    +
    +  address return_pc = call_c_with_frame_resize(entry_point, /*No resize, we have a C compatible frame.*/0);
    +
    +  reset_last_Java_frame();
    +
    +  // Check for pending exceptions.
    +  {
    +    ld(R0, in_bytes(Thread::pending_exception_offset()), R16_thread);
    +    cmpdi(CCR0, R0, 0);
    +
    +    // This used to conditionally jump to forward_exception however it is
    +    // possible if we relocate that the branch will not reach. So we must jump
    +    // around so we can always reach.
    +
    +    Label ok;
    +    beq(CCR0, ok);
    +
    +    // Make sure that the vm_results are cleared.
    +    if (oop_result1->is_valid() || metadata_result->is_valid()) {
    +      li(R0, 0);
    +      if (oop_result1->is_valid()) {
    +        std(R0, in_bytes(JavaThread::vm_result_offset()), R16_thread);
    +      }
    +      if (metadata_result->is_valid()) {
    +        std(R0, in_bytes(JavaThread::vm_result_2_offset()), R16_thread);
    +      }
    +    }
    +
    +    if (frame_size() == no_frame_size) {
    +      ShouldNotReachHere(); // We always have a frame size.
    +      //pop_frame(); // pop the stub frame
    +      //ld(R0, _abi(lr), R1_SP);
    +      //mtlr(R0);
    +      //load_const_optimized(R0, StubRoutines::forward_exception_entry());
    +      //mtctr(R0);
    +      //bctr();
    +    } else if (_stub_id == Runtime1::forward_exception_id) {
    +      should_not_reach_here();
    +    } else {
    +      // keep stub frame for next call_RT
    +      //load_const_optimized(R0, Runtime1::entry_for(Runtime1::forward_exception_id));
    +      add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(Runtime1::entry_for(Runtime1::forward_exception_id)));
    +      mtctr(R0);
    +      bctr();
    +    }
    +
    +    bind(ok);
    +  }
    +
    +  // Get oop results if there are any and reset the values in the thread.
    +  if (oop_result1->is_valid()) {
    +    get_vm_result(oop_result1);
    +  }
    +  if (metadata_result->is_valid()) {
    +    get_vm_result_2(metadata_result);
    +  }
    +
    +  return (int)(return_pc - code_section()->start());
    +}
    +
    +
    +int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1) {
    +  mr_if_needed(R4_ARG2, arg1);
    +  return call_RT(oop_result1, metadata_result, entry, 1);
    +}
    +
    +
    +int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2) {
    +  mr_if_needed(R4_ARG2, arg1);
    +  mr_if_needed(R5_ARG3, arg2); assert(arg2 != R4_ARG2, "smashed argument");
    +  return call_RT(oop_result1, metadata_result, entry, 2);
    +}
    +
    +
    +int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2, Register arg3) {
    +  mr_if_needed(R4_ARG2, arg1);
    +  mr_if_needed(R5_ARG3, arg2); assert(arg2 != R4_ARG2, "smashed argument");
    +  mr_if_needed(R6_ARG4, arg3); assert(arg3 != R4_ARG2 && arg3 != R5_ARG3, "smashed argument");
    +  return call_RT(oop_result1, metadata_result, entry, 3);
    +}
    +
    +
    +// Implementation of Runtime1
    +
    +#define __ sasm->
    +
    +static int cpu_reg_save_offsets[FrameMap::nof_cpu_regs];
    +static int fpu_reg_save_offsets[FrameMap::nof_fpu_regs];
    +static int frame_size_in_bytes = -1;
    +
    +static OopMap* generate_oop_map(StubAssembler* sasm, bool save_fpu_registers) {
    +  assert(frame_size_in_bytes > frame::abi_reg_args_size, "init");
    +  sasm->set_frame_size(frame_size_in_bytes / BytesPerWord);
    +  int frame_size_in_slots = frame_size_in_bytes / sizeof(jint);
    +  OopMap* oop_map = new OopMap(frame_size_in_slots, 0);
    +
    +  int i;
    +  for (i = 0; i < FrameMap::nof_cpu_regs; i++) {
    +    Register r = as_Register(i);
    +    if (FrameMap::reg_needs_save(r)) {
    +      int sp_offset = cpu_reg_save_offsets[i];
    +      oop_map->set_callee_saved(VMRegImpl::stack2reg(sp_offset>>2), r->as_VMReg());
    +      oop_map->set_callee_saved(VMRegImpl::stack2reg((sp_offset>>2) + 1), r->as_VMReg()->next());
    +    }
    +  }
    +
    +  if (save_fpu_registers) {
    +    for (i = 0; i < FrameMap::nof_fpu_regs; i++) {
    +      FloatRegister r = as_FloatRegister(i);
    +      int sp_offset = fpu_reg_save_offsets[i];
    +      oop_map->set_callee_saved(VMRegImpl::stack2reg(sp_offset>>2), r->as_VMReg());
    +      oop_map->set_callee_saved(VMRegImpl::stack2reg((sp_offset>>2) + 1), r->as_VMReg()->next());
    +    }
    +  }
    +
    +  return oop_map;
    +}
    +
    +static OopMap* save_live_registers(StubAssembler* sasm, bool save_fpu_registers = true,
    +                                   Register ret_pc = noreg, int stack_preserve = 0) {
    +  if (ret_pc == noreg) {
    +    ret_pc = R0;
    +    __ mflr(ret_pc);
    +  }
    +  __ std(ret_pc, _abi(lr), R1_SP); // C code needs pc in C1 method.
    +  __ push_frame(frame_size_in_bytes + stack_preserve, R0);
    +
    +  // Record volatile registers as callee-save values in an OopMap so
    +  // their save locations will be propagated to the caller frame's
    +  // RegisterMap during StackFrameStream construction (needed for
    +  // deoptimization; see compiledVFrame::create_stack_value).
    +  // OopMap frame sizes are in c2 stack slot sizes (sizeof(jint)).
    +
    +  int i;
    +  for (i = 0; i < FrameMap::nof_cpu_regs; i++) {
    +    Register r = as_Register(i);
    +    if (FrameMap::reg_needs_save(r)) {
    +      int sp_offset = cpu_reg_save_offsets[i];
    +      __ std(r, sp_offset + STACK_BIAS, R1_SP);
    +    }
    +  }
    +
    +  if (save_fpu_registers) {
    +    for (i = 0; i < FrameMap::nof_fpu_regs; i++) {
    +      FloatRegister r = as_FloatRegister(i);
    +      int sp_offset = fpu_reg_save_offsets[i];
    +      __ stfd(r, sp_offset + STACK_BIAS, R1_SP);
    +    }
    +  }
    +
    +  return generate_oop_map(sasm, save_fpu_registers);
    +}
    +
    +static void restore_live_registers(StubAssembler* sasm, Register result1, Register result2,
    +                                   bool restore_fpu_registers = true) {
    +  for (int i = 0; i < FrameMap::nof_cpu_regs; i++) {
    +    Register r = as_Register(i);
    +    if (FrameMap::reg_needs_save(r) && r != result1 && r != result2) {
    +      int sp_offset = cpu_reg_save_offsets[i];
    +      __ ld(r, sp_offset + STACK_BIAS, R1_SP);
    +    }
    +  }
    +
    +  if (restore_fpu_registers) {
    +    for (int i = 0; i < FrameMap::nof_fpu_regs; i++) {
    +      FloatRegister r = as_FloatRegister(i);
    +      int sp_offset = fpu_reg_save_offsets[i];
    +      __ lfd(r, sp_offset + STACK_BIAS, R1_SP);
    +    }
    +  }
    +
    +  __ pop_frame();
    +  __ ld(R0, _abi(lr), R1_SP);
    +  __ mtlr(R0);
    +}
    +
    +
    +void Runtime1::initialize_pd() {
    +  int i;
    +  int sp_offset = frame::abi_reg_args_size;
    +
    +  for (i = 0; i < FrameMap::nof_cpu_regs; i++) {
    +    Register r = as_Register(i);
    +    if (FrameMap::reg_needs_save(r)) {
    +      cpu_reg_save_offsets[i] = sp_offset;
    +      sp_offset += BytesPerWord;
    +    }
    +  }
    +
    +  for (i = 0; i < FrameMap::nof_fpu_regs; i++) {
    +    fpu_reg_save_offsets[i] = sp_offset;
    +    sp_offset += BytesPerWord;
    +  }
    +  frame_size_in_bytes = align_size_up(sp_offset, frame::alignment_in_bytes);
    +}
    +
    +
    +OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) {
    +  // Make a frame and preserve the caller's caller-save registers.
    +  OopMap* oop_map = save_live_registers(sasm);
    +
    +  int call_offset;
    +  if (!has_argument) {
    +    call_offset = __ call_RT(noreg, noreg, target);
    +  } else {
    +    call_offset = __ call_RT(noreg, noreg, target, R4_ARG2);
    +  }
    +  OopMapSet* oop_maps = new OopMapSet();
    +  oop_maps->add_gc_map(call_offset, oop_map);
    +
    +  __ should_not_reach_here();
    +  return oop_maps;
    +}
    +
    +static OopMapSet* generate_exception_throw_with_stack_parms(StubAssembler* sasm, address target,
    +                                                            int stack_parms) {
    +  // Make a frame and preserve the caller's caller-save registers.
    +  const int parm_size_in_bytes = align_size_up(stack_parms << LogBytesPerWord, frame::alignment_in_bytes);
    +  const int padding = parm_size_in_bytes - (stack_parms << LogBytesPerWord);
    +  OopMap* oop_map = save_live_registers(sasm, true, noreg, parm_size_in_bytes);
    +
    +  int call_offset = 0;
    +  switch (stack_parms) {
    +    case 3:
    +    __ ld(R6_ARG4, frame_size_in_bytes + padding + 16, R1_SP);
    +    case 2:
    +    __ ld(R5_ARG3, frame_size_in_bytes + padding + 8, R1_SP);
    +    case 1:
    +    __ ld(R4_ARG2, frame_size_in_bytes + padding + 0, R1_SP);
    +    call_offset = __ call_RT(noreg, noreg, target);
    +    break;
    +    default: Unimplemented(); break;
    +  }
    +  OopMapSet* oop_maps = new OopMapSet();
    +  oop_maps->add_gc_map(call_offset, oop_map);
    +
    +  __ should_not_reach_here();
    +  return oop_maps;
    +}
    +
    +
    +OopMapSet* Runtime1::generate_stub_call(StubAssembler* sasm, Register result, address target,
    +                                        Register arg1, Register arg2, Register arg3) {
    +  // Make a frame and preserve the caller's caller-save registers.
    +  OopMap* oop_map = save_live_registers(sasm);
    +
    +  int call_offset;
    +  if (arg1 == noreg) {
    +    call_offset = __ call_RT(result, noreg, target);
    +  } else if (arg2 == noreg) {
    +    call_offset = __ call_RT(result, noreg, target, arg1);
    +  } else if (arg3 == noreg) {
    +    call_offset = __ call_RT(result, noreg, target, arg1, arg2);
    +  } else {
    +    call_offset = __ call_RT(result, noreg, target, arg1, arg2, arg3);
    +  }
    +  OopMapSet* oop_maps = new OopMapSet();
    +  oop_maps->add_gc_map(call_offset, oop_map);
    +
    +  restore_live_registers(sasm, result, noreg);
    +  __ blr();
    +  return oop_maps;
    +}
    +
    +static OopMapSet* stub_call_with_stack_parms(StubAssembler* sasm, Register result, address target,
    +                                             int stack_parms, bool do_return = true) {
    +  // Make a frame and preserve the caller's caller-save registers.
    +  const int parm_size_in_bytes = align_size_up(stack_parms << LogBytesPerWord, frame::alignment_in_bytes);
    +  const int padding = parm_size_in_bytes - (stack_parms << LogBytesPerWord);
    +  OopMap* oop_map = save_live_registers(sasm, true, noreg, parm_size_in_bytes);
    +
    +  int call_offset = 0;
    +  switch (stack_parms) {
    +    case 3:
    +    __ ld(R6_ARG4, frame_size_in_bytes + padding + 16, R1_SP);
    +    case 2:
    +    __ ld(R5_ARG3, frame_size_in_bytes + padding + 8, R1_SP);
    +    case 1:
    +    __ ld(R4_ARG2, frame_size_in_bytes + padding + 0, R1_SP);
    +    call_offset = __ call_RT(result, noreg, target);
    +    break;
    +    default: Unimplemented(); break;
    +  }
    +  OopMapSet* oop_maps = new OopMapSet();
    +  oop_maps->add_gc_map(call_offset, oop_map);
    +
    +  restore_live_registers(sasm, result, noreg);
    +  if (do_return) __ blr();
    +  return oop_maps;
    +}
    +
    +
    +OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {
    +  // Make a frame and preserve the caller's caller-save registers.
    +  OopMap* oop_map = save_live_registers(sasm);
    +
    +  // Call the runtime patching routine, returns non-zero if nmethod got deopted.
    +  int call_offset = __ call_RT(noreg, noreg, target);
    +  OopMapSet* oop_maps = new OopMapSet();
    +  oop_maps->add_gc_map(call_offset, oop_map);
    +  __ cmpdi(CCR0, R3_RET, 0);
    +
    +  // Re-execute the patched instruction or, if the nmethod was deoptmized,
    +  // return to the deoptimization handler entry that will cause re-execution
    +  // of the current bytecode.
    +  DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob();
    +  assert(deopt_blob != NULL, "deoptimization blob must have been created");
    +
    +  // Return to the deoptimization handler entry for unpacking and rexecute.
    +  // If we simply returned the we'd deopt as if any call we patched had just
    +  // returned.
    +
    +  restore_live_registers(sasm, noreg, noreg);
    +  // Return if patching routine returned 0.
    +  __ bclr(Assembler::bcondCRbiIs1, Assembler::bi0(CCR0, Assembler::equal), Assembler::bhintbhBCLRisReturn);
    +
    +  address stub = deopt_blob->unpack_with_reexecution();
    +  //__ load_const_optimized(R0, stub);
    +  __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
    +  __ mtctr(R0);
    +  __ bctr();
    +
    +  return oop_maps;
    +}
    +
    +OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
    +  OopMapSet* oop_maps = NULL;
    +
    +  // For better readability.
    +  const bool must_gc_arguments = true;
    +  const bool dont_gc_arguments = false;
    +
    +  // Stub code & info for the different stubs.
    +  switch (id) {
    +    case forward_exception_id:
    +      {
    +        oop_maps = generate_handle_exception(id, sasm);
    +      }
    +      break;
    +
    +    case new_instance_id:
    +    case fast_new_instance_id:
    +    case fast_new_instance_init_check_id:
    +      {
    +        if (id == new_instance_id) {
    +          __ set_info("new_instance", dont_gc_arguments);
    +        } else if (id == fast_new_instance_id) {
    +          __ set_info("fast new_instance", dont_gc_arguments);
    +        } else {
    +          assert(id == fast_new_instance_init_check_id, "bad StubID");
    +          __ set_info("fast new_instance init check", dont_gc_arguments);
    +        }
    +        // We don't support eden allocation.
    +//        if ((id == fast_new_instance_id || id == fast_new_instance_init_check_id) &&
    +//            UseTLAB && FastTLABRefill) {
    +//          if (id == fast_new_instance_init_check_id) {
    +//            // make sure the klass is initialized
    +//            __ lbz(R0, in_bytes(InstanceKlass::init_state_offset()), R3_ARG1);
    +//            __ cmpwi(CCR0, R0, InstanceKlass::fully_initialized);
    +//            __ bne(CCR0, slow_path);
    +//          }
    +//#ifdef ASSERT
    +//          // assert object can be fast path allocated
    +//          {
    +//            Label ok, not_ok;
    +//          __ lwz(R0, in_bytes(Klass::layout_helper_offset()), R3_ARG1);
    +//          // make sure it's an instance (LH > 0)
    +//          __ cmpwi(CCR0, R0, 0);
    +//          __ ble(CCR0, not_ok);
    +//          __ testbitdi(CCR0, R0, R0, Klass::_lh_instance_slow_path_bit);
    +//          __ beq(CCR0, ok);
    +//
    +//          __ bind(not_ok);
    +//          __ stop("assert(can be fast path allocated)");
    +//          __ bind(ok);
    +//          }
    +//#endif // ASSERT
    +//          // We don't support eden allocation.
    +//          __ bind(slow_path);
    +//        }
    +        oop_maps = generate_stub_call(sasm, R3_RET, CAST_FROM_FN_PTR(address, new_instance), R4_ARG2);
    +      }
    +      break;
    +
    +    case counter_overflow_id:
    +        // Bci and method are on stack.
    +        oop_maps = stub_call_with_stack_parms(sasm, noreg, CAST_FROM_FN_PTR(address, counter_overflow), 2);
    +      break;
    +
    +    case new_type_array_id:
    +    case new_object_array_id:
    +      {
    +        if (id == new_type_array_id) {
    +          __ set_info("new_type_array", dont_gc_arguments);
    +        } else {
    +          __ set_info("new_object_array", dont_gc_arguments);
    +        }
    +
    +#ifdef ASSERT
    +        // Assert object type is really an array of the proper kind.
    +        {
    +          int tag = (id == new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value;
    +          Label ok;
    +          __ lwz(R0, in_bytes(Klass::layout_helper_offset()), R4_ARG2);
    +          __ srawi(R0, R0, Klass::_lh_array_tag_shift);
    +          __ cmpwi(CCR0, R0, tag);
    +          __ beq(CCR0, ok);
    +          __ stop("assert(is an array klass)");
    +          __ should_not_reach_here();
    +          __ bind(ok);
    +        }
    +#endif // ASSERT
    +
    +        // We don't support eden allocation.
    +
    +        if (id == new_type_array_id) {
    +          oop_maps = generate_stub_call(sasm, R3_RET, CAST_FROM_FN_PTR(address, new_type_array), R4_ARG2, R5_ARG3);
    +        } else {
    +          oop_maps = generate_stub_call(sasm, R3_RET, CAST_FROM_FN_PTR(address, new_object_array), R4_ARG2, R5_ARG3);
    +        }
    +      }
    +      break;
    +
    +    case new_multi_array_id:
    +      {
    +        // R4: klass
    +        // R5: rank
    +        // R6: address of 1st dimension
    +        __ set_info("new_multi_array", dont_gc_arguments);
    +        oop_maps = generate_stub_call(sasm, R3_RET, CAST_FROM_FN_PTR(address, new_multi_array), R4_ARG2, R5_ARG3, R6_ARG4);
    +      }
    +      break;
    +
    +    case register_finalizer_id:
    +      {
    +        __ set_info("register_finalizer", dont_gc_arguments);
    +        // This code is called via rt_call. Hence, caller-save registers have been saved.
    +        Register t = R11_scratch1;
    +
    +        // Load the klass and check the has finalizer flag.
    +        __ load_klass(t, R3_ARG1);
    +        __ lwz(t, in_bytes(Klass::access_flags_offset()), t);
    +        __ testbitdi(CCR0, R0, t, exact_log2(JVM_ACC_HAS_FINALIZER));
    +        // Return if has_finalizer bit == 0 (CR0.eq).
    +        __ bclr(Assembler::bcondCRbiIs1, Assembler::bi0(CCR0, Assembler::equal), Assembler::bhintbhBCLRisReturn);
    +
    +        __ mflr(R0);
    +        __ std(R0, _abi(lr), R1_SP);
    +        __ push_frame(frame::abi_reg_args_size, R0); // Empty dummy frame (no callee-save regs).
    +        sasm->set_frame_size(frame::abi_reg_args_size / BytesPerWord);
    +        OopMap* oop_map = new OopMap(frame::abi_reg_args_size / sizeof(jint), 0);
    +        int call_offset = __ call_RT(noreg, noreg,
    +                                     CAST_FROM_FN_PTR(address, SharedRuntime::register_finalizer), R3_ARG1);
    +        oop_maps = new OopMapSet();
    +        oop_maps->add_gc_map(call_offset, oop_map);
    +
    +        __ pop_frame();
    +        __ ld(R0, _abi(lr), R1_SP);
    +        __ mtlr(R0);
    +        __ blr();
    +      }
    +      break;
    +
    +    case throw_range_check_failed_id:
    +      {
    +        __ set_info("range_check_failed", dont_gc_arguments); // Arguments will be discarded.
    +        __ std(R0, -8, R1_SP); // Pass index on stack.
    +        oop_maps = generate_exception_throw_with_stack_parms(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), 1);
    +      }
    +      break;
    +
    +    case throw_index_exception_id:
    +      {
    +        __ set_info("index_range_check_failed", dont_gc_arguments); // Arguments will be discarded.
    +        oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true);
    +      }
    +      break;
    +
    +    case throw_div0_exception_id:
    +      {
    +        __ set_info("throw_div0_exception", dont_gc_arguments);
    +        oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false);
    +      }
    +      break;
    +
    +    case throw_null_pointer_exception_id:
    +      {
    +        __ set_info("throw_null_pointer_exception", dont_gc_arguments);
    +        oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false);
    +      }
    +      break;
    +
    +    case handle_exception_nofpu_id:
    +    case handle_exception_id:
    +      {
    +        __ set_info("handle_exception", dont_gc_arguments);
    +        oop_maps = generate_handle_exception(id, sasm);
    +      }
    +      break;
    +
    +    case handle_exception_from_callee_id:
    +      {
    +        __ set_info("handle_exception_from_callee", dont_gc_arguments);
    +        oop_maps = generate_handle_exception(id, sasm);
    +      }
    +      break;
    +
    +    case unwind_exception_id:
    +      {
    +        const Register Rexception    = R3 /*LIRGenerator::exceptionOopOpr()*/,
    +                       Rexception_pc = R4 /*LIRGenerator::exceptionPcOpr()*/,
    +                       Rexception_save = R31, Rcaller_sp = R30;
    +        __ set_info("unwind_exception", dont_gc_arguments);
    +
    +        __ ld(Rcaller_sp, 0, R1_SP);
    +        __ push_frame_reg_args(0, R0); // dummy frame for C call
    +        __ mr(Rexception_save, Rexception); // save over C call
    +        __ ld(Rexception_pc, _abi(lr), Rcaller_sp); // return pc
    +        __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address), R16_thread, Rexception_pc);
    +        __ verify_not_null_oop(Rexception_save);
    +        __ mtctr(R3_RET);
    +        __ ld(Rexception_pc, _abi(lr), Rcaller_sp); // return pc
    +        __ mr(R1_SP, Rcaller_sp); // Pop both frames at once.
    +        __ mr(Rexception, Rexception_save); // restore
    +        __ mtlr(Rexception_pc);
    +        __ bctr();
    +      }
    +      break;
    +
    +    case throw_array_store_exception_id:
    +      {
    +        __ set_info("throw_array_store_exception", dont_gc_arguments);
    +        oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_array_store_exception), true);
    +      }
    +      break;
    +
    +    case throw_class_cast_exception_id:
    +      {
    +        __ set_info("throw_class_cast_exception", dont_gc_arguments);
    +        oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true);
    +      }
    +      break;
    +
    +    case throw_incompatible_class_change_error_id:
    +      {
    +        __ set_info("throw_incompatible_class_cast_exception", dont_gc_arguments);
    +        oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false);
    +      }
    +      break;
    +
    +    case slow_subtype_check_id:
    +      { // Support for uint StubRoutine::partial_subtype_check( Klass sub, Klass super );
    +        const Register sub_klass = R5,
    +                       super_klass = R4,
    +                       temp1_reg = R6,
    +                       temp2_reg = R0;
    +        __ check_klass_subtype_slow_path(sub_klass, super_klass, temp1_reg, temp2_reg); // returns with CR0.eq if successful
    +        __ crandc(CCR0, Assembler::equal, CCR0, Assembler::equal); // failed: CR0.ne
    +        __ blr();
    +      }
    +      break;
    +
    +    case monitorenter_nofpu_id:
    +    case monitorenter_id:
    +      {
    +        __ set_info("monitorenter", dont_gc_arguments);
    +
    +        int save_fpu_registers = (id == monitorenter_id);
    +        // Make a frame and preserve the caller's caller-save registers.
    +        OopMap* oop_map = save_live_registers(sasm, save_fpu_registers);
    +
    +        int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, monitorenter), R4_ARG2, R5_ARG3);
    +
    +        oop_maps = new OopMapSet();
    +        oop_maps->add_gc_map(call_offset, oop_map);
    +
    +        restore_live_registers(sasm, noreg, noreg, save_fpu_registers);
    +        __ blr();
    +      }
    +      break;
    +
    +    case monitorexit_nofpu_id:
    +    case monitorexit_id:
    +      {
    +        // note: Really a leaf routine but must setup last java sp
    +        //       => use call_RT for now (speed can be improved by
    +        //       doing last java sp setup manually).
    +        __ set_info("monitorexit", dont_gc_arguments);
    +
    +        int save_fpu_registers = (id == monitorexit_id);
    +        // Make a frame and preserve the caller's caller-save registers.
    +        OopMap* oop_map = save_live_registers(sasm, save_fpu_registers);
    +
    +        int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, monitorexit), R4_ARG2);
    +
    +        oop_maps = new OopMapSet();
    +        oop_maps->add_gc_map(call_offset, oop_map);
    +
    +        restore_live_registers(sasm, noreg, noreg, save_fpu_registers);
    +        __ blr();
    +      }
    +      break;
    +
    +    case deoptimize_id:
    +      {
    +        __ set_info("deoptimize", dont_gc_arguments);
    +        __ std(R0, -8, R1_SP); // Pass trap_request on stack.
    +        oop_maps = stub_call_with_stack_parms(sasm, noreg, CAST_FROM_FN_PTR(address, deoptimize), 1, /*do_return*/ false);
    +
    +        DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob();
    +        assert(deopt_blob != NULL, "deoptimization blob must have been created");
    +        address stub = deopt_blob->unpack_with_reexecution();
    +        //__ load_const_optimized(R0, stub);
    +        __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
    +        __ mtctr(R0);
    +        __ bctr();
    +      }
    +      break;
    +
    +    case access_field_patching_id:
    +      {
    +        __ set_info("access_field_patching", dont_gc_arguments);
    +        oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, access_field_patching));
    +      }
    +      break;
    +
    +    case load_klass_patching_id:
    +      {
    +        __ set_info("load_klass_patching", dont_gc_arguments);
    +        oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching));
    +      }
    +      break;
    +
    +    case load_mirror_patching_id:
    +      {
    +        __ set_info("load_mirror_patching", dont_gc_arguments);
    +        oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching));
    +      }
    +      break;
    +
    +    case load_appendix_patching_id:
    +      {
    +        __ set_info("load_appendix_patching", dont_gc_arguments);
    +        oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_appendix_patching));
    +      }
    +      break;
    +
    +    case dtrace_object_alloc_id:
    +      { // O0: object
    +        __ unimplemented("stub dtrace_object_alloc_id");
    +        __ set_info("dtrace_object_alloc", dont_gc_arguments);
    +//        // We can't gc here so skip the oopmap but make sure that all
    +//        // the live registers get saved.
    +//        save_live_registers(sasm);
    +//
    +//        __ save_thread(L7_thread_cache);
    +//        __ call(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc),
    +//                relocInfo::runtime_call_type);
    +//        __ delayed()->mov(I0, O0);
    +//        __ restore_thread(L7_thread_cache);
    +//
    +//        restore_live_registers(sasm);
    +//        __ ret();
    +//        __ delayed()->restore();
    +      }
    +      break;
    +
    +#if INCLUDE_ALL_GCS
    +    case g1_pre_barrier_slow_id:
    +      {
    +        BarrierSet* bs = Universe::heap()->barrier_set();
    +        if (bs->kind() != BarrierSet::G1SATBCTLogging) {
    +          goto unimplemented_entry;
    +        }
    +
    +        __ set_info("g1_pre_barrier_slow_id", dont_gc_arguments);
    +
    +        // Using stack slots: pre_val (pre-pushed), spill tmp, spill tmp2.
    +        const int stack_slots = 3;
    +        Register pre_val = R0; // previous value of memory
    +        Register tmp  = R14;
    +        Register tmp2 = R15;
    +
    +        Label refill, restart;
    +        int satb_q_index_byte_offset =
    +          in_bytes(JavaThread::satb_mark_queue_offset() +
    +                   SATBMarkQueue::byte_offset_of_index());
    +        int satb_q_buf_byte_offset =
    +          in_bytes(JavaThread::satb_mark_queue_offset() +
    +                   SATBMarkQueue::byte_offset_of_buf());
    +
    +        // Spill
    +        __ std(tmp, -16, R1_SP);
    +        __ std(tmp2, -24, R1_SP);
    +
    +        __ bind(restart);
    +        // Load the index into the SATB buffer. SATBMarkQueue::_index is a
    +        // size_t so ld_ptr is appropriate.
    +        __ ld(tmp, satb_q_index_byte_offset, R16_thread);
    +
    +        // index == 0?
    +        __ cmpdi(CCR0, tmp, 0);
    +        __ beq(CCR0, refill);
    +
    +        __ ld(tmp2, satb_q_buf_byte_offset, R16_thread);
    +        __ ld(pre_val, -8, R1_SP); // Load from stack.
    +        __ addi(tmp, tmp, -oopSize);
    +
    +        __ std(tmp, satb_q_index_byte_offset, R16_thread);
    +        __ stdx(pre_val, tmp2, tmp); // [_buf + index] := 
    +
    +        // Restore temp registers and return-from-leaf.
    +        __ ld(tmp2, -24, R1_SP);
    +        __ ld(tmp, -16, R1_SP);
    +        __ blr();
    +
    +        __ bind(refill);
    +        const int nbytes_save = (MacroAssembler::num_volatile_regs + stack_slots) * BytesPerWord;
    +        __ save_volatile_gprs(R1_SP, -nbytes_save); // except R0
    +        __ mflr(R0);
    +        __ std(R0, _abi(lr), R1_SP);
    +        __ push_frame_reg_args(nbytes_save, R0); // dummy frame for C call
    +        __ call_VM_leaf(CAST_FROM_FN_PTR(address, SATBMarkQueueSet::handle_zero_index_for_thread), R16_thread);
    +        __ pop_frame();
    +        __ ld(R0, _abi(lr), R1_SP);
    +        __ mtlr(R0);
    +        __ restore_volatile_gprs(R1_SP, -nbytes_save); // except R0
    +        __ b(restart);
    +      }
    +      break;
    +
    +  case g1_post_barrier_slow_id:
    +    {
    +        BarrierSet* bs = Universe::heap()->barrier_set();
    +        if (bs->kind() != BarrierSet::G1SATBCTLogging) {
    +          goto unimplemented_entry;
    +        }
    +
    +        __ set_info("g1_post_barrier_slow_id", dont_gc_arguments);
    +
    +        // Using stack slots: spill addr, spill tmp2
    +        const int stack_slots = 2;
    +        Register tmp = R0;
    +        Register addr = R14;
    +        Register tmp2 = R15;
    +        jbyte* byte_map_base = ((CardTableModRefBS*)bs)->byte_map_base;
    +
    +        Label restart, refill, ret;
    +
    +        // Spill
    +        __ std(addr, -8, R1_SP);
    +        __ std(tmp2, -16, R1_SP);
    +
    +        __ srdi(addr, R0, CardTableModRefBS::card_shift); // Addr is passed in R0.
    +        __ load_const_optimized(/*cardtable*/ tmp2, byte_map_base, tmp);
    +        __ add(addr, tmp2, addr);
    +        __ lbz(tmp, 0, addr); // tmp := [addr + cardtable]
    +
    +        // Return if young card.
    +        __ cmpwi(CCR0, tmp, G1SATBCardTableModRefBS::g1_young_card_val());
    +        __ beq(CCR0, ret);
    +
    +        // Return if sequential consistent value is already dirty.
    +        __ membar(Assembler::StoreLoad);
    +        __ lbz(tmp, 0, addr); // tmp := [addr + cardtable]
    +
    +        __ cmpwi(CCR0, tmp, G1SATBCardTableModRefBS::dirty_card_val());
    +        __ beq(CCR0, ret);
    +
    +        // Not dirty.
    +
    +        // First, dirty it.
    +        __ li(tmp, G1SATBCardTableModRefBS::dirty_card_val());
    +        __ stb(tmp, 0, addr);
    +
    +        int dirty_card_q_index_byte_offset =
    +          in_bytes(JavaThread::dirty_card_queue_offset() +
    +                   DirtyCardQueue::byte_offset_of_index());
    +        int dirty_card_q_buf_byte_offset =
    +          in_bytes(JavaThread::dirty_card_queue_offset() +
    +                   DirtyCardQueue::byte_offset_of_buf());
    +
    +        __ bind(restart);
    +
    +        // Get the index into the update buffer. DirtyCardQueue::_index is
    +        // a size_t so ld_ptr is appropriate here.
    +        __ ld(tmp2, dirty_card_q_index_byte_offset, R16_thread);
    +
    +        // index == 0?
    +        __ cmpdi(CCR0, tmp2, 0);
    +        __ beq(CCR0, refill);
    +
    +        __ ld(tmp, dirty_card_q_buf_byte_offset, R16_thread);
    +        __ addi(tmp2, tmp2, -oopSize);
    +
    +        __ std(tmp2, dirty_card_q_index_byte_offset, R16_thread);
    +        __ add(tmp2, tmp, tmp2);
    +        __ std(addr, 0, tmp2); // [_buf + index] := 
    +
    +        // Restore temp registers and return-from-leaf.
    +        __ bind(ret);
    +        __ ld(tmp2, -16, R1_SP);
    +        __ ld(addr, -8, R1_SP);
    +        __ blr();
    +
    +        __ bind(refill);
    +        const int nbytes_save = (MacroAssembler::num_volatile_regs + stack_slots) * BytesPerWord;
    +        __ save_volatile_gprs(R1_SP, -nbytes_save); // except R0
    +        __ mflr(R0);
    +        __ std(R0, _abi(lr), R1_SP);
    +        __ push_frame_reg_args(nbytes_save, R0); // dummy frame for C call
    +        __ call_VM_leaf(CAST_FROM_FN_PTR(address, DirtyCardQueueSet::handle_zero_index_for_thread), R16_thread);
    +        __ pop_frame();
    +        __ ld(R0, _abi(lr), R1_SP);
    +        __ mtlr(R0);
    +        __ restore_volatile_gprs(R1_SP, -nbytes_save); // except R0
    +        __ b(restart);
    +      }
    +      break;
    +#endif // INCLUDE_ALL_GCS
    +
    +    case predicate_failed_trap_id:
    +      {
    +        __ set_info("predicate_failed_trap", dont_gc_arguments);
    +        OopMap* oop_map = save_live_registers(sasm);
    +
    +        int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, predicate_failed_trap));
    +
    +        oop_maps = new OopMapSet();
    +        oop_maps->add_gc_map(call_offset, oop_map);
    +
    +        DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob();
    +        assert(deopt_blob != NULL, "deoptimization blob must have been created");
    +        restore_live_registers(sasm, noreg, noreg);
    +
    +        address stub = deopt_blob->unpack_with_reexecution();
    +        //__ load_const_optimized(R0, stub);
    +        __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));
    +        __ mtctr(R0);
    +        __ bctr();
    +      }
    +      break;
    +
    +  default:
    +  unimplemented_entry:
    +      {
    +        __ set_info("unimplemented entry", dont_gc_arguments);
    +        __ mflr(R0);
    +        __ std(R0, _abi(lr), R1_SP);
    +        __ push_frame(frame::abi_reg_args_size, R0); // empty dummy frame
    +        sasm->set_frame_size(frame::abi_reg_args_size / BytesPerWord);
    +        OopMap* oop_map = new OopMap(frame::abi_reg_args_size / sizeof(jint), 0);
    +
    +        __ load_const_optimized(R4_ARG2, (int)id);
    +        int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), R4_ARG2);
    +
    +        oop_maps = new OopMapSet();
    +        oop_maps->add_gc_map(call_offset, oop_map);
    +        __ should_not_reach_here();
    +      }
    +      break;
    +  }
    +  return oop_maps;
    +}
    +
    +
    +OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) {
    +  __ block_comment("generate_handle_exception");
    +
    +  // Save registers, if required.
    +  OopMapSet* oop_maps = new OopMapSet();
    +  OopMap* oop_map = NULL;
    +  const Register Rexception    = R3 /*LIRGenerator::exceptionOopOpr()*/,
    +                 Rexception_pc = R4 /*LIRGenerator::exceptionPcOpr()*/;
    +
    +  switch (id) {
    +  case forward_exception_id:
    +    // We're handling an exception in the context of a compiled frame.
    +    // The registers have been saved in the standard places. Perform
    +    // an exception lookup in the caller and dispatch to the handler
    +    // if found. Otherwise unwind and dispatch to the callers
    +    // exception handler.
    +    oop_map = generate_oop_map(sasm, true);
    +    // Transfer the pending exception to the exception_oop.
    +    // Also load the PC which is typically at SP + frame_size_in_bytes + _abi(lr),
    +    // but we support additional slots in the frame for parameter passing.
    +    __ ld(Rexception_pc, 0, R1_SP);
    +    __ ld(Rexception, in_bytes(JavaThread::pending_exception_offset()), R16_thread);
    +    __ li(R0, 0);
    +    __ ld(Rexception_pc, _abi(lr), Rexception_pc);
    +    __ std(R0, in_bytes(JavaThread::pending_exception_offset()), R16_thread);
    +    break;
    +  case handle_exception_nofpu_id:
    +  case handle_exception_id:
    +    // At this point all registers MAY be live.
    +    oop_map = save_live_registers(sasm, id != handle_exception_nofpu_id, Rexception_pc);
    +    break;
    +  case handle_exception_from_callee_id:
    +    // At this point all registers except exception oop and exception pc are dead.
    +    oop_map = new OopMap(frame_size_in_bytes / sizeof(jint), 0);
    +    sasm->set_frame_size(frame_size_in_bytes / BytesPerWord);
    +    __ std(Rexception_pc, _abi(lr), R1_SP);
    +    __ push_frame(frame_size_in_bytes, R0);
    +    break;
    +  default:  ShouldNotReachHere();
    +  }
    +
    +  __ verify_not_null_oop(Rexception);
    +
    +#ifdef ASSERT
    +  // Check that fields in JavaThread for exception oop and issuing pc are
    +  // empty before writing to them.
    +  __ ld(R0, in_bytes(JavaThread::exception_oop_offset()), R16_thread);
    +  __ cmpdi(CCR0, R0, 0);
    +  __ asm_assert_eq("exception oop already set", 0x963);
    +  __ ld(R0, in_bytes(JavaThread::exception_pc_offset() ), R16_thread);
    +  __ cmpdi(CCR0, R0, 0);
    +  __ asm_assert_eq("exception pc already set", 0x962);
    +#endif
    +
    +  // Save the exception and issuing pc in the thread.
    +  __ std(Rexception,    in_bytes(JavaThread::exception_oop_offset()), R16_thread);
    +  __ std(Rexception_pc, in_bytes(JavaThread::exception_pc_offset() ), R16_thread);
    +
    +  int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, exception_handler_for_pc));
    +  oop_maps->add_gc_map(call_offset, oop_map);
    +
    +  __ mtctr(R3_RET);
    +
    +  // Note: if nmethod has been deoptimized then regardless of
    +  // whether it had a handler or not we will deoptimize
    +  // by entering the deopt blob with a pending exception.
    +
    +  // Restore the registers that were saved at the beginning, remove
    +  // the frame and jump to the exception handler.
    +  switch (id) {
    +  case forward_exception_id:
    +  case handle_exception_nofpu_id:
    +  case handle_exception_id:
    +    restore_live_registers(sasm, noreg, noreg, id != handle_exception_nofpu_id);
    +    __ bctr();
    +    break;
    +  case handle_exception_from_callee_id: {
    +    __ pop_frame();
    +    __ ld(Rexception_pc, _abi(lr), R1_SP);
    +    __ mtlr(Rexception_pc);
    +    __ bctr();
    +    break;
    +  }
    +  default:  ShouldNotReachHere();
    +  }
    +
    +  return oop_maps;
    +}
    +
    +const char *Runtime1::pd_name_for_address(address entry) {
    +  return "";
    +}
    +
    +#undef __
    diff --git a/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp
    new file mode 100644
    index 00000000000..234248e387e
    --- /dev/null
    +++ b/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp
    @@ -0,0 +1,68 @@
    +/*
    + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#ifndef CPU_PPC_VM_C1_GLOBALS_PPC_HPP
    +#define CPU_PPC_VM_C1_GLOBALS_PPC_HPP
    +
    +#include "utilities/globalDefinitions.hpp"
    +#include "utilities/macros.hpp"
    +
    +// Sets the default values for platform dependent flags used by the client compiler.
    +// (see c1_globals.hpp)
    +
    +#ifndef TIERED
    +define_pd_global(bool, BackgroundCompilation,        true );
    +define_pd_global(bool, CICompileOSR,                 true );
    +define_pd_global(bool, InlineIntrinsics,             true );
    +define_pd_global(bool, PreferInterpreterNativeStubs, false);
    +define_pd_global(bool, ProfileTraps,                 false);
    +define_pd_global(bool, UseOnStackReplacement,        true );
    +define_pd_global(bool, TieredCompilation,            false);
    +define_pd_global(intx, CompileThreshold,             1000 );
    +
    +define_pd_global(intx, OnStackReplacePercentage,     1400 );
    +define_pd_global(bool, UseTLAB,                      true );
    +define_pd_global(bool, ProfileInterpreter,           false);
    +define_pd_global(intx, FreqInlineSize,               325  );
    +define_pd_global(bool, ResizeTLAB,                   true );
    +define_pd_global(intx, ReservedCodeCacheSize,        32*M );
    +define_pd_global(intx, CodeCacheExpansionSize,       32*K );
    +define_pd_global(uintx,CodeCacheMinBlockLength,      1);
    +define_pd_global(uintx,MetaspaceSize,                12*M );
    +define_pd_global(bool, NeverActAsServerClassMachine, true );
    +define_pd_global(intx, NewSizeThreadIncrease,        16*K );
    +define_pd_global(uint64_t,MaxRAM,                    1ULL*G);
    +define_pd_global(intx, InitialCodeCacheSize,         160*K);
    +#endif // !TIERED
    +
    +define_pd_global(bool, UseTypeProfile,               false);
    +define_pd_global(bool, RoundFPResults,               false);
    +
    +define_pd_global(bool, LIRFillDelaySlots,            false);
    +define_pd_global(bool, OptimizeSinglePrecision,      false);
    +define_pd_global(bool, CSEArrayLength,               true );
    +define_pd_global(bool, TwoOperandLIRForm,            false);
    +
    +#endif // CPU_PPC_VM_C1_GLOBALS_PPC_HPP
    diff --git a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp
    index 20174522381..9934d1f0143 100644
    --- a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp
    @@ -39,7 +39,7 @@ define_pd_global(bool, PreferInterpreterNativeStubs, false);
     define_pd_global(bool, ProfileTraps,                 true);
     define_pd_global(bool, UseOnStackReplacement,        true);
     define_pd_global(bool, ProfileInterpreter,           true);
    -define_pd_global(bool, TieredCompilation,            false);
    +define_pd_global(bool, TieredCompilation,            true);
     define_pd_global(intx, CompileThreshold,             10000);
     
     define_pd_global(intx, OnStackReplacePercentage,     140);
    diff --git a/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp b/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp
    index 94b59db4d7e..9bfe48dd887 100644
    --- a/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp
    @@ -1,6 +1,6 @@
     /*
    - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    - * Copyright 2012, 2013 SAP AG. All rights reserved.
    + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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
    @@ -45,4 +45,8 @@ void Compile::pd_compiler2_init() {
           FLAG_SET_ERGO(bool, InsertEndGroupPPC64, true);
         }
       }
    +
    +  if (!VM_Version::has_isel() && FLAG_IS_DEFAULT(ConditionalMoveLimit)) {
    +    FLAG_SET_ERGO(intx, ConditionalMoveLimit, 0);
    +  }
     }
    diff --git a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp
    index 41b5125f06e..197d3069817 100644
    --- a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp
    @@ -1,5 +1,6 @@
     /*
    - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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
    @@ -129,13 +130,20 @@ address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark/*
       // - call
       __ calculate_address_from_global_toc(reg_scratch, __ method_toc());
       AddressLiteral ic = __ allocate_metadata_address((Metadata *)NULL);
    -  __ load_const_from_method_toc(as_Register(Matcher::inline_cache_reg_encode()), ic, reg_scratch);
    +  bool success = __ load_const_from_method_toc(as_Register(Matcher::inline_cache_reg_encode()),
    +                                               ic, reg_scratch, /*fixed_size*/ true);
    +  if (!success) {
    +    return NULL; // CodeCache is full
    +  }
     
       if (ReoptimizeCallSequences) {
         __ b64_patchable((address)-1, relocInfo::none);
       } else {
         AddressLiteral a((address)-1);
    -    __ load_const_from_method_toc(reg_scratch, a, reg_scratch);
    +    success = __ load_const_from_method_toc(reg_scratch, a, reg_scratch, /*fixed_size*/ true);
    +    if (!success) {
    +      return NULL; // CodeCache is full
    +    }
         __ mtctr(reg_scratch);
         __ bctr();
       }
    @@ -153,6 +161,7 @@ address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark/*
       return stub;
     #else
       ShouldNotReachHere();
    +  return NULL;
     #endif
     }
     #undef __
    diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp
    index 2e051d99918..304cddca9e6 100644
    --- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp
    @@ -1,6 +1,6 @@
     /*
    - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
    - * Copyright 2012, 2014 SAP AG. All rights reserved.
    + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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
    @@ -271,39 +271,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) {
     }
     #endif
     
    -void frame::adjust_unextended_sp() {
    -  // If we are returning to a compiled MethodHandle call site, the
    -  // saved_fp will in fact be a saved value of the unextended SP. The
    -  // simplest way to tell whether we are returning to such a call site
    -  // is as follows:
    -
    -  if (is_compiled_frame() && false /*is_at_mh_callsite()*/) {  // TODO PPC port
    -    // If the sender PC is a deoptimization point, get the original
    -    // PC. For MethodHandle call site the unextended_sp is stored in
    -    // saved_fp.
    -    _unextended_sp = _fp - _cb->frame_size();
    -
    -#ifdef ASSERT
    -    nmethod *sender_nm = _cb->as_nmethod_or_null();
    -    assert(sender_nm && *_sp == *_unextended_sp, "backlink changed");
    -
    -    intptr_t* sp = _unextended_sp;  // check if stack can be walked from here
    -    for (int x = 0; x < 5; ++x) {   // check up to a couple of backlinks
    -      intptr_t* prev_sp = *(intptr_t**)sp;
    -      if (prev_sp == 0) break;      // end of stack
    -      assert(prev_sp>sp, "broken stack");
    -      sp = prev_sp;
    -    }
    -
    -    if (sender_nm->is_deopt_mh_entry(_pc)) { // checks for deoptimization
    -      address original_pc = sender_nm->get_original_pc(this);
    -      assert(sender_nm->insts_contains(original_pc), "original PC must be in nmethod");
    -      assert(sender_nm->is_method_handle_return(original_pc), "must be");
    -    }
    -#endif
    -  }
    -}
    -
     intptr_t *frame::initial_deoptimization_info() {
       // unused... but returns fp() to minimize changes introduced by 7087445
       return fp();
    diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.hpp
    index f327d2ce424..c645307a945 100644
    --- a/hotspot/src/cpu/ppc/vm/frame_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.hpp
    @@ -1,6 +1,6 @@
     /*
    - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    - * Copyright 2012, 2014 SAP AG. All rights reserved.
    + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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
    @@ -465,7 +465,6 @@
       // The frame's stack pointer before it has been extended by a c2i adapter;
       // needed by deoptimization
       intptr_t* _unextended_sp;
    -  void adjust_unextended_sp();
     
      public:
     
    diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp
    index 4945d7f827b..fbd696cd47c 100644
    --- a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp
    +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp
    @@ -39,9 +39,6 @@ inline void frame::find_codeblob_and_set_pc_and_deopt_state(address pc) {
       _pc = pc;   // Must be set for get_deopt_original_pc()
     
       _fp = (intptr_t*)own_abi()->callers_sp;
    -  // Use _fp - frame_size, needs to be done between _cb and _pc initialization
    -  // and get_deopt_original_pc.
    -  adjust_unextended_sp();
     
       address original_pc = nmethod::get_deopt_original_pc(this);
       if (original_pc != NULL) {
    diff --git a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
    index da5c8b008c5..542abd1bdb6 100644
    --- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
    @@ -36,4 +36,7 @@ const int StackAlignmentInBytes = 16;
     // The PPC CPUs are NOT multiple-copy-atomic.
     #define CPU_NOT_MULTIPLE_COPY_ATOMIC
     
    +// The expected size in bytes of a cache line, used to pad data structures.
    +#define DEFAULT_CACHE_LINE_SIZE 128
    +
     #endif // CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
    diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
    index be9c8da7124..a839ba4cb49 100644
    --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
    +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
    @@ -93,9 +93,9 @@ void InterpreterMacroAssembler::dispatch_prolog(TosState state, int bcp_incr) {
     // own dispatch. The dispatch address in R24_dispatch_addr is used for the
     // dispatch.
     void InterpreterMacroAssembler::dispatch_epilog(TosState state, int bcp_incr) {
    +  if (bcp_incr) { addi(R14_bcp, R14_bcp, bcp_incr); }
       mtctr(R24_dispatch_addr);
    -  addi(R14_bcp, R14_bcp, bcp_incr);
    -  bctr();
    +  bcctr(bcondAlways, 0, bhintbhBCCTRisNotPredictable);
     }
     
     void InterpreterMacroAssembler::check_and_handle_popframe(Register scratch_reg) {
    @@ -212,9 +212,6 @@ void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, Register byt
         unimplemented("dispatch_Lbyte_code: verify"); // See Sparc Implementation to implement this
       }
     
    -#ifdef FAST_DISPATCH
    -  unimplemented("dispatch_Lbyte_code FAST_DISPATCH");
    -#else
       assert_different_registers(bytecode, R11_scratch1);
     
       // Calc dispatch table address.
    @@ -225,8 +222,7 @@ void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, Register byt
     
       // Jump off!
       mtctr(R11_scratch1);
    -  bctr();
    -#endif
    +  bcctr(bcondAlways, 0, bhintbhBCCTRisNotPredictable);
     }
     
     void InterpreterMacroAssembler::load_receiver(Register Rparam_count, Register Rrecv_dst) {
    @@ -546,8 +542,8 @@ void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Registe
       sldi(RsxtIndex, RsxtIndex, index_shift);
       blt(CCR0, LnotOOR);
       // Index should be in R17_tos, array should be in R4_ARG2.
    -  mr(R17_tos, Rindex);
    -  mr(R4_ARG2, Rarray);
    +  mr_if_needed(R17_tos, Rindex);
    +  mr_if_needed(R4_ARG2, Rarray);
       load_dispatch_table(Rtmp, (address*)Interpreter::_throw_ArrayIndexOutOfBoundsException_entry);
       mtctr(Rtmp);
       bctr();
    @@ -842,7 +838,6 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
     
         // Must fence, otherwise, preceding store(s) may float below cmpxchg.
         // CmpxchgX sets CCR0 to cmpX(current, displaced).
    -    fence(); // TODO: replace by MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq ?
         cmpxchgd(/*flag=*/CCR0,
                  /*current_value=*/current_header,
                  /*compare_value=*/displaced_header, /*exchange_value=*/monitor,
    @@ -850,7 +845,8 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
                  MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq,
                  MacroAssembler::cmpxchgx_hint_acquire_lock(),
                  noreg,
    -             &cas_failed);
    +             &cas_failed,
    +             /*check without membar and ldarx first*/true);
     
         // If the compare-and-exchange succeeded, then we found an unlocked
         // object and we have now locked it.
    @@ -868,9 +864,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
         sub(current_header, current_header, R1_SP);
     
         assert(os::vm_page_size() > 0xfff, "page size too small - change the constant");
    -    load_const_optimized(tmp,
    -                         (address) (~(os::vm_page_size()-1) |
    -                                    markOopDesc::lock_mask_in_place));
    +    load_const_optimized(tmp, ~(os::vm_page_size()-1) | markOopDesc::lock_mask_in_place);
     
         and_(R0/*==0?*/, current_header, tmp);
         // If condition is true we are done and hence we can store 0 in the displaced
    @@ -1107,6 +1101,7 @@ void InterpreterMacroAssembler::verify_method_data_pointer() {
     }
     
     void InterpreterMacroAssembler::test_invocation_counter_for_mdp(Register invocation_count,
    +                                                                Register method_counters,
                                                                     Register Rscratch,
                                                                     Label &profile_continue) {
       assert(ProfileInterpreter, "must be profiling interpreter");
    @@ -1115,12 +1110,11 @@ void InterpreterMacroAssembler::test_invocation_counter_for_mdp(Register invocat
       Label done;
     
       // If no method data exists, and the counter is high enough, make one.
    -  int ipl_offs = load_const_optimized(Rscratch, &InvocationCounter::InterpreterProfileLimit, R0, true);
    -  lwz(Rscratch, ipl_offs, Rscratch);
    +  lwz(Rscratch, in_bytes(MethodCounters::interpreter_profile_limit_offset()), method_counters);
     
       cmpdi(CCR0, R28_mdx, 0);
       // Test to see if we should create a method data oop.
    -  cmpd(CCR1, Rscratch /* InterpreterProfileLimit */, invocation_count);
    +  cmpd(CCR1, Rscratch, invocation_count);
       bne(CCR0, done);
       bge(CCR1, profile_continue);
     
    @@ -1133,15 +1127,15 @@ void InterpreterMacroAssembler::test_invocation_counter_for_mdp(Register invocat
       bind(done);
     }
     
    -void InterpreterMacroAssembler::test_backedge_count_for_osr(Register backedge_count, Register branch_bcp, Register Rtmp) {
    -  assert_different_registers(backedge_count, Rtmp, branch_bcp);
    +void InterpreterMacroAssembler::test_backedge_count_for_osr(Register backedge_count, Register method_counters,
    +                                                            Register target_bcp, Register disp, Register Rtmp) {
    +  assert_different_registers(backedge_count, target_bcp, disp, Rtmp, R4_ARG2);
       assert(UseOnStackReplacement,"Must UseOnStackReplacement to test_backedge_count_for_osr");
     
       Label did_not_overflow;
       Label overflow_with_error;
     
    -  int ibbl_offs = load_const_optimized(Rtmp, &InvocationCounter::InterpreterBackwardBranchLimit, R0, true);
    -  lwz(Rtmp, ibbl_offs, Rtmp);
    +  lwz(Rtmp, in_bytes(MethodCounters::interpreter_backward_branch_limit_offset()), method_counters);
       cmpw(CCR0, backedge_count, Rtmp);
     
       blt(CCR0, did_not_overflow);
    @@ -1153,17 +1147,15 @@ void InterpreterMacroAssembler::test_backedge_count_for_osr(Register backedge_co
       // the overflow function is called only once every overflow_frequency.
       if (ProfileInterpreter) {
         const int overflow_frequency = 1024;
    -    li(Rtmp, overflow_frequency-1);
    -    andr(Rtmp, Rtmp, backedge_count);
    -    cmpwi(CCR0, Rtmp, 0);
    +    andi_(Rtmp, backedge_count, overflow_frequency-1);
         bne(CCR0, did_not_overflow);
       }
     
       // Overflow in loop, pass branch bytecode.
    -  call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), branch_bcp, true);
    +  subf(R4_ARG2, disp, target_bcp); // Compute branch bytecode (previous bcp).
    +  call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), R4_ARG2, true);
     
       // Was an OSR adapter generated?
    -  // O0 = osr nmethod
       cmpdi(CCR0, R3_RET, 0);
       beq(CCR0, overflow_with_error);
     
    @@ -1324,7 +1316,7 @@ void InterpreterMacroAssembler::increment_backedge_counter(const Register Rcount
       assert_different_registers(Rdst, Rtmp1);
       const Register invocation_counter = Rtmp1;
       const Register counter = Rdst;
    -  // TODO ppc port assert(4 == InvocationCounter::sz_counter(), "unexpected field size.");
    +  // TODO: PPC port: assert(4 == InvocationCounter::sz_counter(), "unexpected field size.");
     
       // Load backedge counter.
       lwz(counter, in_bytes(MethodCounters::backedge_counter_offset()) +
    @@ -1337,8 +1329,7 @@ void InterpreterMacroAssembler::increment_backedge_counter(const Register Rcount
       addi(counter, counter, InvocationCounter::count_increment);
     
       // Mask the invocation counter.
    -  li(Rscratch, InvocationCounter::count_mask_value);
    -  andr(invocation_counter, invocation_counter, Rscratch);
    +  andi(invocation_counter, invocation_counter, InvocationCounter::count_mask_value);
     
       // Store new counter value.
       stw(counter, in_bytes(MethodCounters::backedge_counter_offset()) +
    @@ -1817,15 +1808,13 @@ void InterpreterMacroAssembler::profile_return_type(Register ret, Register tmp1,
         test_method_data_pointer(profile_continue);
     
         if (MethodData::profile_return_jsr292_only()) {
    -      assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2");
    -
           // If we don't profile all invoke bytecodes we must make sure
           // it's a bytecode we indeed profile. We can't go back to the
           // begining of the ProfileData we intend to update to check its
           // type because we're right after it and we don't known its
           // length.
           lbz(tmp1, 0, R14_bcp);
    -      lhz(tmp2, Method::intrinsic_id_offset_in_bytes(), R19_method);
    +      lbz(tmp2, Method::intrinsic_id_offset_in_bytes(), R19_method);
           cmpwi(CCR0, tmp1, Bytecodes::_invokedynamic);
           cmpwi(CCR1, tmp1, Bytecodes::_invokehandle);
           cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
    @@ -2207,9 +2196,7 @@ void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters,
       // Load the backedge counter.
       lwz(backedge_count, be_counter_offset, Rcounters); // is unsigned int
       // Mask the backedge counter.
    -  Register tmp = invocation_count;
    -  li(tmp, InvocationCounter::count_mask_value);
    -  andr(backedge_count, tmp, backedge_count); // Cannot use andi, need sign extension of count_mask_value.
    +  andi(backedge_count, backedge_count, InvocationCounter::count_mask_value);
     
       // Load the invocation counter.
       lwz(invocation_count, inv_counter_offset, Rcounters); // is unsigned int
    @@ -2266,7 +2253,7 @@ void InterpreterMacroAssembler::verify_oop_or_return_address(Register reg, Regis
       bne(CCR0, test);
     
       address fd = CAST_FROM_FN_PTR(address, verify_return_address);
    -  const int nbytes_save = 11*8; // volatile gprs except R0
    +  const int nbytes_save = MacroAssembler::num_volatile_regs * 8;
       save_volatile_gprs(R1_SP, -nbytes_save); // except R0
       save_LR_CR(Rtmp); // Save in old frame.
       push_frame_reg_args(nbytes_save, Rtmp);
    diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp
    index 9692e65225c..5baf225c199 100644
    --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp
    +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp
    @@ -203,7 +203,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
       void restore_interpreter_state(Register scratch, bool bcp_and_mdx_only = false);
     
       void increment_backedge_counter(const Register Rcounters, Register Rtmp, Register Rtmp2, Register Rscratch);
    -  void test_backedge_count_for_osr(Register backedge_count, Register branch_bcp, Register Rtmp);
    +  void test_backedge_count_for_osr(Register backedge_count, Register method_counters, Register target_bcp, Register disp, Register Rtmp);
     
       void record_static_call_in_profile(Register Rentry, Register Rtmp);
       void record_receiver_call_in_profile(Register Rklass, Register Rentry, Register Rtmp);
    @@ -222,7 +222,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
       void set_method_data_pointer_for_bcp();
       void test_method_data_pointer(Label& zero_continue);
       void verify_method_data_pointer();
    -  void test_invocation_counter_for_mdp(Register invocation_count, Register Rscratch, Label &profile_continue);
    +  void test_invocation_counter_for_mdp(Register invocation_count, Register method_counters, Register Rscratch, Label &profile_continue);
     
       void set_mdp_data_at(int constant, Register value);
     
    diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
    index 38cf28d094a..1ba560b3160 100644
    --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
    @@ -30,6 +30,7 @@
     #include "gc/shared/collectedHeap.inline.hpp"
     #include "interpreter/interpreter.hpp"
     #include "memory/resourceArea.hpp"
    +#include "nativeInst_ppc.hpp"
     #include "prims/methodHandles.hpp"
     #include "runtime/biasedLocking.hpp"
     #include "runtime/icache.hpp"
    @@ -114,7 +115,7 @@ void MacroAssembler::calculate_address_from_global_toc(Register dst, address add
       }
     
       if (hi16) {
    -    addis(dst, R29, MacroAssembler::largeoffset_si16_si16_hi(offset));
    +    addis(dst, R29_TOC, MacroAssembler::largeoffset_si16_si16_hi(offset));
       }
       if (lo16) {
         if (add_relocation) {
    @@ -256,7 +257,9 @@ narrowOop MacroAssembler::get_narrow_oop(address a, address bound) {
     }
     #endif // _LP64
     
    -void MacroAssembler::load_const_from_method_toc(Register dst, AddressLiteral& a, Register toc) {
    +// Returns true if successful.
    +bool MacroAssembler::load_const_from_method_toc(Register dst, AddressLiteral& a,
    +                                                Register toc, bool fixed_size) {
       int toc_offset = 0;
       // Use RelocationHolder::none for the constant pool entry, otherwise
       // we will end up with a failing NativeCall::verify(x) where x is
    @@ -264,11 +267,13 @@ void MacroAssembler::load_const_from_method_toc(Register dst, AddressLiteral& a,
       // FIXME: We should insert relocation information for oops at the constant
       // pool entries instead of inserting it at the loads; patching of a constant
       // pool entry should be less expensive.
    -  address oop_address = address_constant((address)a.value(), RelocationHolder::none);
    +  address const_address = address_constant((address)a.value(), RelocationHolder::none);
    +  if (const_address == NULL) { return false; } // allocation failure
       // Relocate at the pc of the load.
       relocate(a.rspec());
    -  toc_offset = (int)(oop_address - code()->consts()->start());
    -  ld_largeoffset_unchecked(dst, toc_offset, toc, true);
    +  toc_offset = (int)(const_address - code()->consts()->start());
    +  ld_largeoffset_unchecked(dst, toc_offset, toc, fixed_size);
    +  return true;
     }
     
     bool MacroAssembler::is_load_const_from_method_toc_at(address a) {
    @@ -446,6 +451,15 @@ void MacroAssembler::bc_far(int boint, int biint, Label& dest, int optimize) {
       assert(dest.is_bound() || target_pc == b_pc, "postcondition");
     }
     
    +// 1 or 2 instructions
    +void MacroAssembler::bc_far_optimized(int boint, int biint, Label& dest) {
    +  if (dest.is_bound() && is_within_range_of_bcxx(target(dest), pc())) {
    +    bc(boint, biint, dest);
    +  } else {
    +    bc_far(boint, biint, dest, MacroAssembler::bc_far_optimize_on_relocate);
    +  }
    +}
    +
     bool MacroAssembler::is_bc_far_at(address instruction_addr) {
       return is_bc_far_variant1_at(instruction_addr) ||
              is_bc_far_variant2_at(instruction_addr) ||
    @@ -496,7 +510,7 @@ void MacroAssembler::set_dest_of_bc_far_at(address instruction_addr, address des
           // variant 1, the 1st instruction contains the destination address:
           //
           //    bcxx  DEST
    -      //    endgroup
    +      //    nop
           //
           const int instruction_1 = *(int*)(instruction_addr);
           boint = inv_bo_field(instruction_1);
    @@ -523,10 +537,10 @@ void MacroAssembler::set_dest_of_bc_far_at(address instruction_addr, address des
           // variant 1:
           //
           //    bcxx  DEST
    -      //    endgroup
    +      //    nop
           //
           masm.bc(boint, biint, dest);
    -      masm.endgroup();
    +      masm.nop();
         } else {
           // variant 2:
           //
    @@ -810,7 +824,22 @@ void MacroAssembler::save_volatile_gprs(Register dst, int offset) {
       std(R9,  offset, dst);   offset += 8;
       std(R10, offset, dst);   offset += 8;
       std(R11, offset, dst);   offset += 8;
    -  std(R12, offset, dst);
    +  std(R12, offset, dst);   offset += 8;
    +
    +  stfd(F0, offset, dst);   offset += 8;
    +  stfd(F1, offset, dst);   offset += 8;
    +  stfd(F2, offset, dst);   offset += 8;
    +  stfd(F3, offset, dst);   offset += 8;
    +  stfd(F4, offset, dst);   offset += 8;
    +  stfd(F5, offset, dst);   offset += 8;
    +  stfd(F6, offset, dst);   offset += 8;
    +  stfd(F7, offset, dst);   offset += 8;
    +  stfd(F8, offset, dst);   offset += 8;
    +  stfd(F9, offset, dst);   offset += 8;
    +  stfd(F10, offset, dst);  offset += 8;
    +  stfd(F11, offset, dst);  offset += 8;
    +  stfd(F12, offset, dst);  offset += 8;
    +  stfd(F13, offset, dst);
     }
     
     // For verify_oops.
    @@ -825,7 +854,22 @@ void MacroAssembler::restore_volatile_gprs(Register src, int offset) {
       ld(R9,  offset, src);   offset += 8;
       ld(R10, offset, src);   offset += 8;
       ld(R11, offset, src);   offset += 8;
    -  ld(R12, offset, src);
    +  ld(R12, offset, src);   offset += 8;
    +
    +  lfd(F0, offset, src);   offset += 8;
    +  lfd(F1, offset, src);   offset += 8;
    +  lfd(F2, offset, src);   offset += 8;
    +  lfd(F3, offset, src);   offset += 8;
    +  lfd(F4, offset, src);   offset += 8;
    +  lfd(F5, offset, src);   offset += 8;
    +  lfd(F6, offset, src);   offset += 8;
    +  lfd(F7, offset, src);   offset += 8;
    +  lfd(F8, offset, src);   offset += 8;
    +  lfd(F9, offset, src);   offset += 8;
    +  lfd(F10, offset, src);  offset += 8;
    +  lfd(F11, offset, src);  offset += 8;
    +  lfd(F12, offset, src);  offset += 8;
    +  lfd(F13, offset, src);
     }
     
     void MacroAssembler::save_LR_CR(Register tmp) {
    @@ -908,7 +952,7 @@ void MacroAssembler::push_frame(unsigned int bytes, Register tmp) {
       if (is_simm(-offset, 16)) {
         stdu(R1_SP, -offset, R1_SP);
       } else {
    -    load_const(tmp, -offset);
    +    load_const_optimized(tmp, -offset);
         stdux(R1_SP, R1_SP, tmp);
       }
     }
    @@ -1090,20 +1134,21 @@ address MacroAssembler::call_c_using_toc(const FunctionDescriptor* fd,
         assert(fd->entry() != NULL, "function must be linked");
     
         AddressLiteral fd_entry(fd->entry());
    -    load_const_from_method_toc(R11, fd_entry, toc);
    +    bool success = load_const_from_method_toc(R11, fd_entry, toc, /*fixed_size*/ true);
         mtctr(R11);
         if (fd->env() == NULL) {
           li(R11, 0);
           nop();
         } else {
           AddressLiteral fd_env(fd->env());
    -      load_const_from_method_toc(R11, fd_env, toc);
    +      success = success && load_const_from_method_toc(R11, fd_env, toc, /*fixed_size*/ true);
         }
         AddressLiteral fd_toc(fd->toc());
    -    load_toc_from_toc(R2_TOC, fd_toc, toc);
    -    // R2_TOC is killed.
    +    // Set R2_TOC (load from toc)
    +    success = success && load_const_from_method_toc(R2_TOC, fd_toc, toc, /*fixed_size*/ true);
         bctrl();
         _last_calls_return_pc = pc();
    +    if (!success) { return NULL; }
       } else {
         // It's a friend function, load the entry point and don't care about
         // toc and env. Use an optimizable call instruction, but ensure the
    @@ -1367,11 +1412,6 @@ void MacroAssembler::cmpxchgw(ConditionRegister flag, Register dest_current_valu
       bool preset_result_reg = (int_flag_success != dest_current_value && int_flag_success != compare_value &&
                                 int_flag_success != exchange_value && int_flag_success != addr_base);
     
    -  // release/fence semantics
    -  if (semantics & MemBarRel) {
    -    release();
    -  }
    -
       if (use_result_reg && preset_result_reg) {
         li(int_flag_success, 0); // preset (assume cas failed)
       }
    @@ -1383,6 +1423,11 @@ void MacroAssembler::cmpxchgw(ConditionRegister flag, Register dest_current_valu
         bne(flag, failed);
       }
     
    +  // release/fence semantics
    +  if (semantics & MemBarRel) {
    +    release();
    +  }
    +
       // atomic emulation loop
       bind(retry);
     
    @@ -1462,11 +1507,6 @@ void MacroAssembler::cmpxchgd(ConditionRegister flag,
                                 int_flag_success!=exchange_value && int_flag_success!=addr_base);
       assert(int_flag_success == noreg || failed_ext == NULL, "cannot have both");
     
    -  // release/fence semantics
    -  if (semantics & MemBarRel) {
    -    release();
    -  }
    -
       if (use_result_reg && preset_result_reg) {
         li(int_flag_success, 0); // preset (assume cas failed)
       }
    @@ -1478,6 +1518,11 @@ void MacroAssembler::cmpxchgd(ConditionRegister flag,
         bne(flag, failed);
       }
     
    +  // release/fence semantics
    +  if (semantics & MemBarRel) {
    +    release();
    +  }
    +
       // atomic emulation loop
       bind(retry);
     
    @@ -1501,8 +1546,6 @@ void MacroAssembler::cmpxchgd(ConditionRegister flag,
         li(int_flag_success, 1);
       }
     
    -  // POWER6 doesn't need isync in CAS.
    -  // Always emit isync to be on the safe side.
       if (semantics & MemBarFenceAfter) {
         fence();
       } else if (semantics & MemBarAcq) {
    @@ -1627,13 +1670,14 @@ void MacroAssembler::lookup_virtual_method(Register recv_klass,
     }
     
     /////////////////////////////////////////// subtype checking ////////////////////////////////////////////
    -
     void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass,
                                                        Register super_klass,
                                                        Register temp1_reg,
                                                        Register temp2_reg,
    -                                                   Label& L_success,
    -                                                   Label& L_failure) {
    +                                                   Label* L_success,
    +                                                   Label* L_failure,
    +                                                   Label* L_slow_path,
    +                                                   RegisterOrConstant super_check_offset) {
     
       const Register check_cache_offset = temp1_reg;
       const Register cached_super       = temp2_reg;
    @@ -1643,6 +1687,18 @@ void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass,
       int sco_offset = in_bytes(Klass::super_check_offset_offset());
       int sc_offset  = in_bytes(Klass::secondary_super_cache_offset());
     
    +  bool must_load_sco = (super_check_offset.constant_or_zero() == -1);
    +  bool need_slow_path = (must_load_sco || super_check_offset.constant_or_zero() == sco_offset);
    +
    +  Label L_fallthrough;
    +  int label_nulls = 0;
    +  if (L_success == NULL)   { L_success   = &L_fallthrough; label_nulls++; }
    +  if (L_failure == NULL)   { L_failure   = &L_fallthrough; label_nulls++; }
    +  if (L_slow_path == NULL) { L_slow_path = &L_fallthrough; label_nulls++; }
    +  assert(label_nulls <= 1 ||
    +         (L_slow_path == &L_fallthrough && label_nulls <= 2 && !need_slow_path),
    +         "at most one NULL in the batch, usually");
    +
       // If the pointers are equal, we are done (e.g., String[] elements).
       // This self-check enables sharing of secondary supertype arrays among
       // non-primary types such as array-of-interface. Otherwise, each such
    @@ -1651,15 +1707,20 @@ void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass,
       // type checks are in fact trivially successful in this manner,
       // so we get a nicely predicted branch right at the start of the check.
       cmpd(CCR0, sub_klass, super_klass);
    -  beq(CCR0, L_success);
    +  beq(CCR0, *L_success);
     
       // Check the supertype display:
    +  if (must_load_sco) {
    +    // The super check offset is always positive...
       lwz(check_cache_offset, sco_offset, super_klass);
    +    super_check_offset = RegisterOrConstant(check_cache_offset);
    +    // super_check_offset is register.
    +    assert_different_registers(sub_klass, super_klass, cached_super, super_check_offset.as_register());
    +  }
       // The loaded value is the offset from KlassOopDesc.
     
    -  ldx(cached_super, check_cache_offset, sub_klass);
    +  ld(cached_super, super_check_offset, sub_klass);
       cmpd(CCR0, cached_super, super_klass);
    -  beq(CCR0, L_success);
     
       // This check has worked decisively for primary supers.
       // Secondary supers are sought in the super_cache ('super_cache_addr').
    @@ -1672,9 +1733,39 @@ void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass,
       // So if it was a primary super, we can just fail immediately.
       // Otherwise, it's the slow path for us (no success at this point).
     
    -  cmpwi(CCR0, check_cache_offset, sc_offset);
    -  bne(CCR0, L_failure);
    -  // bind(slow_path); // fallthru
    +#define FINAL_JUMP(label) if (&(label) != &L_fallthrough) { b(label); }
    +
    +  if (super_check_offset.is_register()) {
    +    beq(CCR0, *L_success);
    +    cmpwi(CCR0, super_check_offset.as_register(), sc_offset);
    +    if (L_failure == &L_fallthrough) {
    +      beq(CCR0, *L_slow_path);
    +    } else {
    +      bne(CCR0, *L_failure);
    +      FINAL_JUMP(*L_slow_path);
    +    }
    +  } else {
    +    if (super_check_offset.as_constant() == sc_offset) {
    +      // Need a slow path; fast failure is impossible.
    +      if (L_slow_path == &L_fallthrough) {
    +        beq(CCR0, *L_success);
    +      } else {
    +        bne(CCR0, *L_slow_path);
    +        FINAL_JUMP(*L_success);
    +      }
    +    } else {
    +      // No slow path; it's a fast decision.
    +      if (L_failure == &L_fallthrough) {
    +        beq(CCR0, *L_success);
    +      } else {
    +        bne(CCR0, *L_failure);
    +        FINAL_JUMP(*L_success);
    +      }
    +    }
    +  }
    +
    +  bind(L_fallthrough);
    +#undef FINAL_JUMP
     }
     
     void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass,
    @@ -1698,7 +1789,7 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass,
     
       ld(array_ptr, source_offset, sub_klass);
     
    -  //assert(4 == arrayOopDesc::length_length_in_bytes(), "precondition violated.");
    +  // TODO: PPC port: assert(4 == arrayOopDesc::length_length_in_bytes(), "precondition violated.");
       lwz(temp, length_offset, array_ptr);
       cmpwi(CCR0, temp, 0);
       beq(CCR0, result_reg!=noreg ? failure : fallthru); // length 0
    @@ -1719,8 +1810,9 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass,
     
       bind(hit);
       std(super_klass, target_offset, sub_klass); // save result to cache
    -  if (result_reg != noreg) li(result_reg, 0); // load zero result (indicates a hit)
    -  if (L_success != NULL) b(*L_success);
    +  if (result_reg != noreg) { li(result_reg, 0); } // load zero result (indicates a hit)
    +  if (L_success != NULL) { b(*L_success); }
    +  else if (result_reg == noreg) { blr(); } // return with CR0.eq if neither label nor result reg provided
     
       bind(fallthru);
     }
    @@ -1732,7 +1824,7 @@ void MacroAssembler::check_klass_subtype(Register sub_klass,
                              Register temp2_reg,
                              Label& L_success) {
       Label L_failure;
    -  check_klass_subtype_fast_path(sub_klass, super_klass, temp1_reg, temp2_reg, L_success, L_failure);
    +  check_klass_subtype_fast_path(sub_klass, super_klass, temp1_reg, temp2_reg, &L_success, &L_failure);
       check_klass_subtype_slow_path(sub_klass, super_klass, temp1_reg, temp2_reg, &L_success);
       bind(L_failure); // Fallthru if not successful.
     }
    @@ -1765,6 +1857,7 @@ RegisterOrConstant MacroAssembler::argument_offset(RegisterOrConstant arg_slot,
       }
     }
     
    +// Supports temp2_reg = R0.
     void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj_reg,
                                               Register mark_reg, Register temp_reg,
                                               Register temp2_reg, Label& done, Label* slow_case) {
    @@ -1788,10 +1881,10 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj
              "biased locking makes assumptions about bit layout");
     
       if (PrintBiasedLockingStatistics) {
    -    load_const(temp_reg, (address) BiasedLocking::total_entry_count_addr(), temp2_reg);
    -    lwz(temp2_reg, 0, temp_reg);
    -    addi(temp2_reg, temp2_reg, 1);
    -    stw(temp2_reg, 0, temp_reg);
    +    load_const(temp2_reg, (address) BiasedLocking::total_entry_count_addr(), temp_reg);
    +    lwzx(temp_reg, temp2_reg);
    +    addi(temp_reg, temp_reg, 1);
    +    stwx(temp_reg, temp2_reg);
       }
     
       andi(temp_reg, mark_reg, markOopDesc::biased_lock_mask_in_place);
    @@ -1809,10 +1902,10 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj
       if (PrintBiasedLockingStatistics) {
         Label l;
         bne(cr_reg, l);
    -    load_const(mark_reg, (address) BiasedLocking::biased_lock_entry_count_addr());
    -    lwz(temp2_reg, 0, mark_reg);
    -    addi(temp2_reg, temp2_reg, 1);
    -    stw(temp2_reg, 0, mark_reg);
    +    load_const(temp2_reg, (address) BiasedLocking::biased_lock_entry_count_addr());
    +    lwzx(mark_reg, temp2_reg);
    +    addi(mark_reg, mark_reg, 1);
    +    stwx(mark_reg, temp2_reg);
         // restore mark_reg
         ld(mark_reg, oopDesc::mark_offset_in_bytes(), obj_reg);
         bind(l);
    @@ -1878,10 +1971,10 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj
       // need to revoke that bias. The revocation will occur in the
       // interpreter runtime in the slow case.
       if (PrintBiasedLockingStatistics) {
    -    load_const(temp_reg, (address) BiasedLocking::anonymously_biased_lock_entry_count_addr(), temp2_reg);
    -    lwz(temp2_reg, 0, temp_reg);
    -    addi(temp2_reg, temp2_reg, 1);
    -    stw(temp2_reg, 0, temp_reg);
    +    load_const(temp2_reg, (address) BiasedLocking::anonymously_biased_lock_entry_count_addr(), temp_reg);
    +    lwzx(temp_reg, temp2_reg);
    +    addi(temp_reg, temp_reg, 1);
    +    stwx(temp_reg, temp2_reg);
       }
       b(done);
     
    @@ -1892,15 +1985,14 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj
       // value as the comparison value when doing the cas to acquire the
       // bias in the current epoch. In other words, we allow transfer of
       // the bias from one thread to another directly in this situation.
    -  andi(temp_reg, mark_reg, markOopDesc::age_mask_in_place);
    -  orr(temp_reg, R16_thread, temp_reg);
    -  load_klass(temp2_reg, obj_reg);
    -  ld(temp2_reg, in_bytes(Klass::prototype_header_offset()), temp2_reg);
    -  orr(temp_reg, temp_reg, temp2_reg);
    +  load_klass(temp_reg, obj_reg);
    +  andi(temp2_reg, mark_reg, markOopDesc::age_mask_in_place);
    +  orr(temp2_reg, R16_thread, temp2_reg);
    +  ld(temp_reg, in_bytes(Klass::prototype_header_offset()), temp_reg);
    +  orr(temp_reg, temp2_reg, temp_reg);
     
       assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0");
     
    -  // CmpxchgX sets cr_reg to cmpX(temp2_reg, mark_reg).
       cmpxchgd(/*flag=*/cr_reg, /*current_value=*/temp2_reg,
                      /*compare_value=*/mark_reg, /*exchange_value=*/temp_reg,
                      /*where=*/obj_reg,
    @@ -1913,10 +2005,10 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj
       // need to revoke that bias. The revocation will occur in the
       // interpreter runtime in the slow case.
       if (PrintBiasedLockingStatistics) {
    -    load_const(temp_reg, (address) BiasedLocking::rebiased_lock_entry_count_addr(), temp2_reg);
    -    lwz(temp2_reg, 0, temp_reg);
    -    addi(temp2_reg, temp2_reg, 1);
    -    stw(temp2_reg, 0, temp_reg);
    +    load_const(temp2_reg, (address) BiasedLocking::rebiased_lock_entry_count_addr(), temp_reg);
    +    lwzx(temp_reg, temp2_reg);
    +    addi(temp_reg, temp_reg, 1);
    +    stwx(temp_reg, temp2_reg);
       }
       b(done);
     
    @@ -1952,10 +2044,10 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj
       if (PrintBiasedLockingStatistics) {
         Label l;
         bne(cr_reg, l);
    -    load_const(temp_reg, (address) BiasedLocking::revoked_lock_entry_count_addr(), temp2_reg);
    -    lwz(temp2_reg, 0, temp_reg);
    -    addi(temp2_reg, temp2_reg, 1);
    -    stw(temp2_reg, 0, temp_reg);
    +    load_const(temp2_reg, (address) BiasedLocking::revoked_lock_entry_count_addr(), temp_reg);
    +    lwzx(temp_reg, temp2_reg);
    +    addi(temp_reg, temp_reg, 1);
    +    stwx(temp_reg, temp2_reg);
         bind(l);
       }
     
    @@ -1977,6 +2069,109 @@ void MacroAssembler::biased_locking_exit (ConditionRegister cr_reg, Register mar
       beq(cr_reg, done);
     }
     
    +// allocation (for C1)
    +void MacroAssembler::eden_allocate(
    +  Register obj,                      // result: pointer to object after successful allocation
    +  Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
    +  int      con_size_in_bytes,        // object size in bytes if   known at compile time
    +  Register t1,                       // temp register
    +  Register t2,                       // temp register
    +  Label&   slow_case                 // continuation point if fast allocation fails
    +) {
    +  b(slow_case);
    +}
    +
    +void MacroAssembler::tlab_allocate(
    +  Register obj,                      // result: pointer to object after successful allocation
    +  Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
    +  int      con_size_in_bytes,        // object size in bytes if   known at compile time
    +  Register t1,                       // temp register
    +  Label&   slow_case                 // continuation point if fast allocation fails
    +) {
    +  // make sure arguments make sense
    +  assert_different_registers(obj, var_size_in_bytes, t1);
    +  assert(0 <= con_size_in_bytes && is_simm13(con_size_in_bytes), "illegal object size");
    +  assert((con_size_in_bytes & MinObjAlignmentInBytesMask) == 0, "object size is not multiple of alignment");
    +
    +  const Register new_top = t1;
    +  //verify_tlab(); not implemented
    +
    +  ld(obj, in_bytes(JavaThread::tlab_top_offset()), R16_thread);
    +  ld(R0, in_bytes(JavaThread::tlab_end_offset()), R16_thread);
    +  if (var_size_in_bytes == noreg) {
    +    addi(new_top, obj, con_size_in_bytes);
    +  } else {
    +    add(new_top, obj, var_size_in_bytes);
    +  }
    +  cmpld(CCR0, new_top, R0);
    +  bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CCR0, Assembler::greater), slow_case);
    +
    +#ifdef ASSERT
    +  // make sure new free pointer is properly aligned
    +  {
    +    Label L;
    +    andi_(R0, new_top, MinObjAlignmentInBytesMask);
    +    beq(CCR0, L);
    +    stop("updated TLAB free is not properly aligned", 0x934);
    +    bind(L);
    +  }
    +#endif // ASSERT
    +
    +  // update the tlab top pointer
    +  std(new_top, in_bytes(JavaThread::tlab_top_offset()), R16_thread);
    +  //verify_tlab(); not implemented
    +}
    +void MacroAssembler::tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case) {
    +  unimplemented("tlab_refill");
    +}
    +void MacroAssembler::incr_allocated_bytes(RegisterOrConstant size_in_bytes, Register t1, Register t2) {
    +  unimplemented("incr_allocated_bytes");
    +}
    +
    +address MacroAssembler::emit_trampoline_stub(int destination_toc_offset,
    +                                             int insts_call_instruction_offset, Register Rtoc) {
    +  // Start the stub.
    +  address stub = start_a_stub(64);
    +  if (stub == NULL) { return NULL; } // CodeCache full: bail out
    +
    +  // Create a trampoline stub relocation which relates this trampoline stub
    +  // with the call instruction at insts_call_instruction_offset in the
    +  // instructions code-section.
    +  relocate(trampoline_stub_Relocation::spec(code()->insts()->start() + insts_call_instruction_offset));
    +  const int stub_start_offset = offset();
    +
    +  // For java_to_interp stubs we use R11_scratch1 as scratch register
    +  // and in call trampoline stubs we use R12_scratch2. This way we
    +  // can distinguish them (see is_NativeCallTrampolineStub_at()).
    +  Register reg_scratch = R12_scratch2;
    +
    +  // Now, create the trampoline stub's code:
    +  // - load the TOC
    +  // - load the call target from the constant pool
    +  // - call
    +  if (Rtoc == noreg) {
    +    calculate_address_from_global_toc(reg_scratch, method_toc());
    +    Rtoc = reg_scratch;
    +  }
    +
    +  ld_largeoffset_unchecked(reg_scratch, destination_toc_offset, Rtoc, false);
    +  mtctr(reg_scratch);
    +  bctr();
    +
    +  const address stub_start_addr = addr_at(stub_start_offset);
    +
    +  // Assert that the encoded destination_toc_offset can be identified and that it is correct.
    +  assert(destination_toc_offset == NativeCallTrampolineStub_at(stub_start_addr)->destination_toc_offset(),
    +         "encoded offset into the constant pool must match");
    +  // Trampoline_stub_size should be good.
    +  assert((uint)(offset() - stub_start_offset) <= trampoline_stub_size, "should be good size");
    +  assert(is_NativeCallTrampolineStub_at(stub_start_addr), "doesn't look like a trampoline");
    +
    +  // End the stub.
    +  end_a_stub();
    +  return stub;
    +}
    +
     // TM on PPC64.
     void MacroAssembler::atomic_inc_ptr(Register addr, Register result, int simm16) {
       Label retry;
    @@ -2387,17 +2582,16 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register
     
       // Must fence, otherwise, preceding store(s) may float below cmpxchg.
       // Compare object markOop with mark and if equal exchange scratch1 with object markOop.
    -  // CmpxchgX sets cr_reg to cmpX(current, displaced).
    -  membar(Assembler::StoreStore);
       cmpxchgd(/*flag=*/flag,
                /*current_value=*/current_header,
                /*compare_value=*/displaced_header,
                /*exchange_value=*/box,
                /*where=*/oop,
    -           MacroAssembler::MemBarAcq,
    +           MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq,
                MacroAssembler::cmpxchgx_hint_acquire_lock(),
                noreg,
    -           &cas_failed);
    +           &cas_failed,
    +           /*check without membar and ldarx first*/true);
       assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0");
     
       // If the compare-and-exchange succeeded, then we found an unlocked
    @@ -2410,8 +2604,7 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register
       // Check if the owner is self by comparing the value in the markOop of object
       // (current_header) with the stack pointer.
       sub(current_header, current_header, R1_SP);
    -  load_const_optimized(temp, (address) (~(os::vm_page_size()-1) |
    -                                        markOopDesc::lock_mask_in_place));
    +  load_const_optimized(temp, ~(os::vm_page_size()-1) | markOopDesc::lock_mask_in_place);
     
       and_(R0/*==0?*/, current_header, temp);
       // If condition is true we are cont and hence we can store 0 as the
    @@ -2437,8 +2630,6 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register
     
         // Try to CAS m->owner from NULL to current thread.
         addi(temp, displaced_header, ObjectMonitor::owner_offset_in_bytes()-markOopDesc::monitor_value);
    -    li(displaced_header, 0);
    -    // CmpxchgX sets flag to cmpX(current, displaced).
         cmpxchgd(/*flag=*/flag,
                  /*current_value=*/current_header,
                  /*compare_value=*/(intptr_t)0,
    @@ -2928,31 +3119,12 @@ void MacroAssembler::load_klass(Register dst, Register src) {
       }
     }
     
    -void MacroAssembler::load_klass_with_trap_null_check(Register dst, Register src) {
    -  if (!os::zero_page_read_protected()) {
    -    if (TrapBasedNullChecks) {
    -      trap_null_check(src);
    -    }
    -  }
    -  load_klass(dst, src);
    -}
    -
    -void MacroAssembler::reinit_heapbase(Register d, Register tmp) {
    -  if (Universe::heap() != NULL) {
    -    load_const_optimized(R30, Universe::narrow_ptrs_base(), tmp);
    -  } else {
    -    // Heap not yet allocated. Load indirectly.
    -    int simm16_offset = load_const_optimized(R30, Universe::narrow_ptrs_base_addr(), tmp, true);
    -    ld(R30, simm16_offset, R30);
    -  }
    -}
    -
     // Clear Array
     // Kills both input registers. tmp == R0 is allowed.
     void MacroAssembler::clear_memory_doubleword(Register base_ptr, Register cnt_dwords, Register tmp) {
       // Procedure for large arrays (uses data cache block zero instruction).
         Label startloop, fast, fastloop, small_rest, restloop, done;
    -    const int cl_size         = VM_Version::get_cache_line_size(),
    +    const int cl_size         = VM_Version::L1_data_cache_line_size(),
                   cl_dwords       = cl_size>>3,
                   cl_dw_addr_bits = exact_log2(cl_dwords),
                   dcbz_min        = 1;                     // Min count of dcbz executions, needs to be >0.
    @@ -4025,7 +4197,7 @@ void MacroAssembler::multiply_128_x_128_loop(Register x_xstart,
       bind(L_check_1);
     
       addi(idx, idx, 0x2);
    -  andi_(idx, idx, 0x1) ;
    +  andi_(idx, idx, 0x1);
       addic_(idx, idx, -1);
       blt(CCR0, L_post_third_loop_done);
     
    @@ -4255,17 +4427,42 @@ void MacroAssembler::verify_oop(Register oop, const char* msg) {
     
       address/* FunctionDescriptor** */fd = StubRoutines::verify_oop_subroutine_entry_address();
       const Register tmp = R11; // Will be preserved.
    -  const int nbytes_save = 11*8; // Volatile gprs except R0.
    +  const int nbytes_save = MacroAssembler::num_volatile_regs * 8;
       save_volatile_gprs(R1_SP, -nbytes_save); // except R0
     
    -  if (oop == tmp) mr(R4_ARG2, oop);
    +  mr_if_needed(R4_ARG2, oop);
    +  save_LR_CR(tmp); // save in old frame
    +  push_frame_reg_args(nbytes_save, tmp);
    +  // load FunctionDescriptor** / entry_address *
    +  load_const_optimized(tmp, fd, R0);
    +  // load FunctionDescriptor* / entry_address
    +  ld(tmp, 0, tmp);
    +  load_const_optimized(R3_ARG1, (address)msg, R0);
    +  // Call destination for its side effect.
    +  call_c(tmp);
    +
    +  pop_frame();
    +  restore_LR_CR(tmp);
    +  restore_volatile_gprs(R1_SP, -nbytes_save); // except R0
    +}
    +
    +void MacroAssembler::verify_oop_addr(RegisterOrConstant offs, Register base, const char* msg) {
    +  if (!VerifyOops) {
    +    return;
    +  }
    +
    +  address/* FunctionDescriptor** */fd = StubRoutines::verify_oop_subroutine_entry_address();
    +  const Register tmp = R11; // Will be preserved.
    +  const int nbytes_save = MacroAssembler::num_volatile_regs * 8;
    +  save_volatile_gprs(R1_SP, -nbytes_save); // except R0
    +
    +  ld(R4_ARG2, offs, base);
       save_LR_CR(tmp); // save in old frame
       push_frame_reg_args(nbytes_save, tmp);
       // load FunctionDescriptor** / entry_address *
       load_const_optimized(tmp, fd, R0);
       // load FunctionDescriptor* / entry_address
       ld(tmp, 0, tmp);
    -  if (oop != tmp) mr_if_needed(R4_ARG2, oop);
       load_const_optimized(R3_ARG1, (address)msg, R0);
       // Call destination for its side effect.
       call_c(tmp);
    diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp
    index 37930a4bfc2..df58832b160 100644
    --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp
    @@ -119,11 +119,8 @@ class MacroAssembler: public Assembler {
     
       // Emits an oop const to the constant pool, loads the constant, and
       // sets a relocation info with address current_pc.
    -  void load_const_from_method_toc(Register dst, AddressLiteral& a, Register toc);
    -  void load_toc_from_toc(Register dst, AddressLiteral& a, Register toc) {
    -    assert(dst == R2_TOC, "base register must be TOC");
    -    load_const_from_method_toc(dst, a, toc);
    -  }
    +  // Returns true if successful.
    +  bool load_const_from_method_toc(Register dst, AddressLiteral& a, Register toc, bool fixed_size = false);
     
       static bool is_load_const_from_method_toc_at(address a);
       static int get_offset_of_load_const_from_method_toc_at(address a);
    @@ -174,6 +171,7 @@ class MacroAssembler: public Assembler {
       // optimize: flag for telling the conditional far branch to optimize
       //           itself when relocated.
       void bc_far(int boint, int biint, Label& dest, int optimize);
    +  void bc_far_optimized(int boint, int biint, Label& dest); // 1 or 2 instructions
       // Relocation of conditional far branches.
       static bool    is_bc_far_at(address instruction_addr);
       static address get_dest_of_bc_far_at(address instruction_addr);
    @@ -262,6 +260,7 @@ class MacroAssembler: public Assembler {
       // some ABI-related functions
       void save_nonvolatile_gprs(   Register dst_base, int offset);
       void restore_nonvolatile_gprs(Register src_base, int offset);
    +  enum { num_volatile_regs = 11 + 14 }; // GPR + FPR
       void save_volatile_gprs(   Register dst_base, int offset);
       void restore_volatile_gprs(Register src_base, int offset);
       void save_LR_CR(   Register tmp);     // tmp contains LR on return.
    @@ -461,8 +460,10 @@ class MacroAssembler: public Assembler {
                                          Register super_klass,
                                          Register temp1_reg,
                                          Register temp2_reg,
    -                                     Label& L_success,
    -                                     Label& L_failure);
    +                                     Label* L_success,
    +                                     Label* L_failure,
    +                                     Label* L_slow_path = NULL, // default fall through
    +                                     RegisterOrConstant super_check_offset = RegisterOrConstant(-1));
     
       // The rest of the type check; must be wired to a corresponding fast path.
       // It does not repeat the fast path logic, so don't use it standalone.
    @@ -507,6 +508,28 @@ class MacroAssembler: public Assembler {
       // biased locking exit case failed.
       void biased_locking_exit(ConditionRegister cr_reg, Register mark_addr, Register temp_reg, Label& done);
     
    +  // allocation (for C1)
    +  void eden_allocate(
    +    Register obj,                      // result: pointer to object after successful allocation
    +    Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
    +    int      con_size_in_bytes,        // object size in bytes if   known at compile time
    +    Register t1,                       // temp register
    +    Register t2,                       // temp register
    +    Label&   slow_case                 // continuation point if fast allocation fails
    +  );
    +  void tlab_allocate(
    +    Register obj,                      // result: pointer to object after successful allocation
    +    Register var_size_in_bytes,        // object size in bytes if unknown at compile time; invalid otherwise
    +    int      con_size_in_bytes,        // object size in bytes if   known at compile time
    +    Register t1,                       // temp register
    +    Label&   slow_case                 // continuation point if fast allocation fails
    +  );
    +  void tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case);
    +  void incr_allocated_bytes(RegisterOrConstant size_in_bytes, Register t1, Register t2);
    +
    +  enum { trampoline_stub_size = 6 * 4 };
    +  address emit_trampoline_stub(int destination_toc_offset, int insts_call_instruction_offset, Register Rtoc = noreg);
    +
       void atomic_inc_ptr(Register addr, Register result, int simm16 = 1);
       void atomic_ori_int(Register addr, Register result, int uimm16);
     
    @@ -597,9 +620,7 @@ class MacroAssembler: public Assembler {
     
       // Implicit or explicit null check, jumps to static address exception_entry.
       inline void null_check_throw(Register a, int offset, Register temp_reg, address exception_entry);
    -
    -  // Check accessed object for null. Use SIGTRAP-based null checks on AIX.
    -  inline void load_with_trap_null_check(Register d, int si16, Register s1);
    +  inline void null_check(Register a, int offset, Label *Lis_null); // implicit only if Lis_null not provided
     
       // Load heap oop and decompress. Loaded oop may not be null.
       // Specify tmp to save one cycle.
    @@ -619,20 +640,17 @@ class MacroAssembler: public Assembler {
       inline Register decode_heap_oop_not_null(Register d, Register src = noreg);
     
       // Null allowed.
    +  inline Register encode_heap_oop(Register d, Register src); // Prefer null check in GC barrier!
       inline void decode_heap_oop(Register d);
     
       // Load/Store klass oop from klass field. Compress.
       void load_klass(Register dst, Register src);
    -  void load_klass_with_trap_null_check(Register dst, Register src);
       void store_klass(Register dst_oop, Register klass, Register tmp = R0);
       void store_klass_gap(Register dst_oop, Register val = noreg); // Will store 0 if val not specified.
       static int instr_size_for_decode_klass_not_null();
       void decode_klass_not_null(Register dst, Register src = noreg);
       Register encode_klass_not_null(Register dst, Register src = noreg);
     
    -  // Load common heap base into register.
    -  void reinit_heapbase(Register d, Register tmp = noreg);
    -
       // SIGTRAP-based range checks for arrays.
       inline void trap_range_check_l(Register a, Register b);
       inline void trap_range_check_l(Register a, int si16);
    @@ -750,6 +768,7 @@ class MacroAssembler: public Assembler {
     
       // Emit code to verify that reg contains a valid oop if +VerifyOops is set.
       void verify_oop(Register reg, const char* s = "broken oop");
    +  void verify_oop_addr(RegisterOrConstant offs, Register base, const char* s = "contains broken oop");
     
       // TODO: verify method and klass metadata (compare against vptr?)
       void _verify_method_ptr(Register reg, const char * msg, const char * file, int line) {}
    diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp
    index 9d062d799c7..62843482074 100644
    --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp
    +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp
    @@ -70,9 +70,11 @@ inline void MacroAssembler::endgroup_if_needed(bool needed) {
     }
     
     inline void MacroAssembler::membar(int bits) {
    -  // TODO: use elemental_membar(bits) for Power 8 and disable optimization of acquire-release
    -  // (Matcher::post_membar_release where we use PPC64_ONLY(xop == Op_MemBarRelease ||))
    -  if (bits & StoreLoad) sync(); else lwsync();
    +  // Comment: Usage of elemental_membar(bits) is not recommended for Power 8.
    +  // If elemental_membar(bits) is used, disable optimization of acquire-release
    +  // (Matcher::post_membar_release where we use PPC64_ONLY(xop == Op_MemBarRelease ||))!
    +  if (bits & StoreLoad) { sync(); }
    +  else if (bits) { lwsync(); }
     }
     inline void MacroAssembler::release() { membar(LoadStore | StoreStore); }
     inline void MacroAssembler::acquire() { membar(LoadLoad | LoadStore); }
    @@ -86,7 +88,7 @@ inline address MacroAssembler::global_toc() {
     // Offset of given address to the global TOC.
     inline int MacroAssembler::offset_to_global_toc(const address addr) {
       intptr_t offset = (intptr_t)addr - (intptr_t)MacroAssembler::global_toc();
    -  assert(Assembler::is_simm((long)offset, 31) && offset >= 0, "must be in range");
    +  assert(Assembler::is_uimm((long)offset, 31), "must be in range");
       return (int)offset;
     }
     
    @@ -98,7 +100,7 @@ inline address MacroAssembler::method_toc() {
     // Offset of given address to current method's TOC.
     inline int MacroAssembler::offset_to_method_toc(address addr) {
       intptr_t offset = (intptr_t)addr - (intptr_t)method_toc();
    -  assert(is_simm((long)offset, 31) && offset >= 0, "must be in range");
    +  assert(Assembler::is_uimm((long)offset, 31), "must be in range");
       return (int)offset;
     }
     
    @@ -190,13 +192,13 @@ inline bool MacroAssembler::is_bc_far_variant1_at(address instruction_addr) {
       // Variant 1, the 1st instruction contains the destination address:
       //
       //    bcxx  DEST
    -  //    endgroup
    +  //    nop
       //
       const int instruction_1 = *(int*)(instruction_addr);
       const int instruction_2 = *(int*)(instruction_addr + 4);
       return is_bcxx(instruction_1) &&
              (inv_bd_field(instruction_1, (intptr_t)instruction_addr) != (intptr_t)(instruction_addr + 2*4)) &&
    -         is_endgroup(instruction_2);
    +         is_nop(instruction_2);
     }
     
     // Relocation of conditional far branches.
    @@ -302,13 +304,17 @@ inline void MacroAssembler::null_check_throw(Register a, int offset, Register te
       }
     }
     
    -inline void MacroAssembler::load_with_trap_null_check(Register d, int si16, Register s1) {
    -  if (!os::zero_page_read_protected()) {
    +inline void MacroAssembler::null_check(Register a, int offset, Label *Lis_null) {
    +  if (!ImplicitNullChecks || needs_explicit_null_check(offset) || !os::zero_page_read_protected()) {
         if (TrapBasedNullChecks) {
    -      trap_null_check(s1);
    +      assert(UseSIGTRAP, "sanity");
    +      trap_null_check(a);
    +    } else if (Lis_null){
    +      Label ok;
    +      cmpdi(CCR0, a, 0);
    +      beq(CCR0, *Lis_null);
         }
       }
    -  ld(d, si16, s1);
     }
     
     inline void MacroAssembler::load_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1, Register tmp) {
    @@ -365,6 +371,26 @@ inline Register MacroAssembler::encode_heap_oop_not_null(Register d, Register sr
       return current; // Encoded oop is in this register.
     }
     
    +inline Register MacroAssembler::encode_heap_oop(Register d, Register src) {
    +  if (Universe::narrow_oop_base() != NULL) {
    +    if (VM_Version::has_isel()) {
    +      cmpdi(CCR0, src, 0);
    +      Register co = encode_heap_oop_not_null(d, src);
    +      assert(co == d, "sanity");
    +      isel_0(d, CCR0, Assembler::equal);
    +    } else {
    +      Label isNull;
    +      or_(d, src, src); // move and compare 0
    +      beq(CCR0, isNull);
    +      encode_heap_oop_not_null(d, src);
    +      bind(isNull);
    +    }
    +    return d;
    +  } else {
    +    return encode_heap_oop_not_null(d, src);
    +  }
    +}
    +
     inline Register MacroAssembler::decode_heap_oop_not_null(Register d, Register src) {
       if (Universe::narrow_oop_base_disjoint() && src != noreg && src != d &&
           Universe::narrow_oop_shift() != 0) {
    diff --git a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp
    index fed5e53c206..4a743eed8be 100644
    --- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp
    @@ -1,6 +1,6 @@
     /*
      * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
    - * Copyright 2012, 2014 SAP AG. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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
    @@ -504,8 +504,7 @@ void trace_method_handle_stub(const char* adaptername,
           frame cur_frame = os::current_frame();
     
           // Robust search of trace_calling_frame (independant of inlining).
    -      // Assumes saved_regs comes from a pusha in the trace_calling_frame.
    -      assert(cur_frame.sp() < saved_regs, "registers not saved on stack ?");
    +      assert(cur_frame.sp() <= saved_regs, "registers not saved on stack ?");
           frame trace_calling_frame = os::get_sender_for_C_frame(&cur_frame);
           while (trace_calling_frame.fp() < saved_regs) {
             trace_calling_frame = os::get_sender_for_C_frame(&trace_calling_frame);
    @@ -539,7 +538,7 @@ void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adapt
       BLOCK_COMMENT("trace_method_handle {");
     
       const Register tmp = R11; // Will be preserved.
    -  const int nbytes_save = 11*8; // volatile gprs except R0
    +  const int nbytes_save = MacroAssembler::num_volatile_regs * 8;
       __ save_volatile_gprs(R1_SP, -nbytes_save); // except R0
       __ save_LR_CR(tmp); // save in old frame
     
    diff --git a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp
    index ecca49af2ef..37956925d0d 100644
    --- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp
    @@ -1,6 +1,6 @@
     /*
    - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
    - * Copyright 2012, 2014 SAP AG. All rights reserved.
    + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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
    @@ -65,13 +65,17 @@ address NativeCall::destination() const {
       address destination = Assembler::bxx_destination(addr);
     
       // Do we use a trampoline stub for this call?
    -  CodeBlob* cb = CodeCache::find_blob_unsafe(addr);   // Else we get assertion if nmethod is zombie.
    -  assert(cb && cb->is_nmethod(), "sanity");
    -  nmethod *nm = (nmethod *)cb;
    -  if (nm->stub_contains(destination) && is_NativeCallTrampolineStub_at(destination)) {
    -    // Yes we do, so get the destination from the trampoline stub.
    -    const address trampoline_stub_addr = destination;
    -    destination = NativeCallTrampolineStub_at(trampoline_stub_addr)->destination(nm);
    +  // Trampoline stubs are located behind the main code.
    +  if (destination > addr) {
    +    // Filter out recursive method invocation (call to verified/unverified entry point).
    +    CodeBlob* cb = CodeCache::find_blob_unsafe(addr);   // Else we get assertion if nmethod is zombie.
    +    assert(cb && cb->is_nmethod(), "sanity");
    +    nmethod *nm = (nmethod *)cb;
    +    if (nm->stub_contains(destination) && is_NativeCallTrampolineStub_at(destination)) {
    +      // Yes we do, so get the destination from the trampoline stub.
    +      const address trampoline_stub_addr = destination;
    +      destination = NativeCallTrampolineStub_at(trampoline_stub_addr)->destination(nm);
    +    }
       }
     
       return destination;
    @@ -267,7 +271,7 @@ void NativeMovConstReg::set_data(intptr_t data) {
               oop_addr = r->oop_addr();
               *oop_addr = cast_to_oop(data);
             } else {
    -          assert(oop_addr == r->oop_addr(), "must be only one set-oop here") ;
    +          assert(oop_addr == r->oop_addr(), "must be only one set-oop here");
             }
           }
           if (iter.type() == relocInfo::metadata_type) {
    @@ -351,6 +355,27 @@ void NativeJump::verify() {
     }
     #endif // ASSERT
     
    +
    +void NativeGeneralJump::insert_unconditional(address code_pos, address entry) {
    +  CodeBuffer cb(code_pos, BytesPerInstWord + 1);
    +  MacroAssembler* a = new MacroAssembler(&cb);
    +  a->b(entry);
    +  ICache::ppc64_flush_icache_bytes(code_pos, NativeGeneralJump::instruction_size);
    +}
    +
    +// MT-safe patching of a jmp instruction.
    +void NativeGeneralJump::replace_mt_safe(address instr_addr, address code_buffer) {
    +  // Bytes beyond offset NativeGeneralJump::instruction_size are copied by caller.
    +
    +  // Finally patch out the jump.
    +  volatile juint *jump_addr = (volatile juint*)instr_addr;
    +  // Release not needed because caller uses invalidate_range after copying the remaining bytes.
    +  //OrderAccess::release_store(jump_addr, *((juint*)code_buffer));
    +  *jump_addr = *((juint*)code_buffer); // atomically store code over branch instruction
    +  ICache::ppc64_flush_icache_bytes(instr_addr, NativeGeneralJump::instruction_size);
    +}
    +
    +
     //-------------------------------------------------------------------
     
     // Call trampoline stubs.
    @@ -364,10 +389,12 @@ void NativeJump::verify() {
     //
     
     address NativeCallTrampolineStub::encoded_destination_addr() const {
    -  address instruction_addr = addr_at(2 * BytesPerInstWord);
    -  assert(MacroAssembler::is_ld_largeoffset(instruction_addr),
    -         "must be a ld with large offset (from the constant pool)");
    -
    +  address instruction_addr = addr_at(0 * BytesPerInstWord);
    +  if (!MacroAssembler::is_ld_largeoffset(instruction_addr)) {
    +    instruction_addr = addr_at(2 * BytesPerInstWord);
    +    assert(MacroAssembler::is_ld_largeoffset(instruction_addr),
    +           "must be a ld with large offset (from the constant pool)");
    +  }
       return instruction_addr;
     }
     
    diff --git a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp
    index 0ef57be0556..f0f6b6a87d9 100644
    --- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp
    @@ -1,6 +1,6 @@
     /*
    - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
    - * Copyright 2012, 2013 SAP AG. All rights reserved.
    + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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
    @@ -50,6 +50,8 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC {
       friend class Relocation;
     
      public:
    +  bool is_jump() { return Assembler::is_b(long_at(0)); } // See NativeGeneralJump.
    +
       bool is_sigtrap_ic_miss_check() {
         assert(UseSIGTRAP, "precondition");
         return MacroAssembler::is_trap_ic_miss_check(long_at(0));
    @@ -235,8 +237,8 @@ inline NativeFarCall* nativeFarCall_at(address instr) {
       return call;
     }
     
    -// An interface for accessing/manipulating native set_oop imm, reg instructions.
    -// (used to manipulate inlined data references, etc.)
    +// An interface for accessing/manipulating native set_oop imm, reg instructions
    +// (used to manipulate inlined data references, etc.).
     class NativeMovConstReg: public NativeInstruction {
      public:
     
    @@ -384,10 +386,21 @@ class NativeCallTrampolineStub : public NativeInstruction {
       void set_destination(address new_destination);
     };
     
    +// Note: Other stubs must not begin with this pattern.
     inline bool is_NativeCallTrampolineStub_at(address address) {
       int first_instr = *(int*)address;
    -  return Assembler::is_addis(first_instr) &&
    -    (Register)(intptr_t)Assembler::inv_rt_field(first_instr) == R12_scratch2;
    +  // calculate_address_from_global_toc and long form of ld_largeoffset_unchecked begin with addis with target R12
    +  if (Assembler::is_addis(first_instr) &&
    +      (Register)(intptr_t)Assembler::inv_rt_field(first_instr) == R12_scratch2) return true;
    +
    +  // short form of ld_largeoffset_unchecked is ld which is followed by mtctr
    +  int second_instr = *((int*)address + 1);
    +  if (Assembler::is_ld(first_instr) &&
    +      (Register)(intptr_t)Assembler::inv_rt_field(first_instr) == R12_scratch2 &&
    +      Assembler::is_mtctr(second_instr) &&
    +      (Register)(intptr_t)Assembler::inv_rs_field(second_instr) == R12_scratch2) return true;
    +
    +  return false;
     }
     
     inline NativeCallTrampolineStub* NativeCallTrampolineStub_at(address address) {
    @@ -395,4 +408,102 @@ inline NativeCallTrampolineStub* NativeCallTrampolineStub_at(address address) {
       return (NativeCallTrampolineStub*)address;
     }
     
    +///////////////////////////////////////////////////////////////////////////////////////////////////
    +
    +//-------------------------------------
    +//  N a t i v e G e n e r a l J u m p
    +//-------------------------------------
    +
    +// Despite the name, handles only simple branches.
    +class NativeGeneralJump;
    +inline NativeGeneralJump* nativeGeneralJump_at(address address);
    +
    +// Currently only implemented as single unconditional branch.
    +class NativeGeneralJump: public NativeInstruction {
    + public:
    +
    +  enum PPC64_specific_constants {
    +    instruction_size = 4
    +  };
    +
    +  address instruction_address() const { return addr_at(0); }
    +
    +  // Creation.
    +  friend inline NativeGeneralJump* nativeGeneralJump_at(address addr) {
    +    NativeGeneralJump* jump = (NativeGeneralJump*)(addr);
    +    DEBUG_ONLY( jump->verify(); )
    +    return jump;
    +  }
    +
    +  // Insertion of native general jump instruction.
    +  static void insert_unconditional(address code_pos, address entry);
    +
    +  address jump_destination() const {
    +    DEBUG_ONLY( verify(); )
    +    return addr_at(0) + Assembler::inv_li_field(long_at(0));
    +  }
    +
    +  void set_jump_destination(address dest) {
    +    DEBUG_ONLY( verify(); )
    +    insert_unconditional(addr_at(0), dest);
    +  }
    +
    +  static void replace_mt_safe(address instr_addr, address code_buffer);
    +
    +  void verify() const { guarantee(Assembler::is_b(long_at(0)), "invalid NativeGeneralJump"); }
    +};
    +
    +// An interface for accessing/manipulating native load int (load_const32).
    +class NativeMovRegMem;
    +inline NativeMovRegMem* nativeMovRegMem_at(address address);
    +class NativeMovRegMem: public NativeInstruction {
    + public:
    +
    +  enum PPC64_specific_constants {
    +    instruction_size = 8
    +  };
    +
    +  address instruction_address() const { return addr_at(0); }
    +
    +  intptr_t offset() const {
    +#ifdef VM_LITTLE_ENDIAN
    +    short *hi_ptr = (short*)(addr_at(0));
    +    short *lo_ptr = (short*)(addr_at(4));
    +#else
    +    short *hi_ptr = (short*)(addr_at(0) + 2);
    +    short *lo_ptr = (short*)(addr_at(4) + 2);
    +#endif
    +    return ((*hi_ptr) << 16) | ((*lo_ptr) & 0xFFFF);
    +  }
    +
    +  void set_offset(intptr_t x) {
    +#ifdef VM_LITTLE_ENDIAN
    +    short *hi_ptr = (short*)(addr_at(0));
    +    short *lo_ptr = (short*)(addr_at(4));
    +#else
    +    short *hi_ptr = (short*)(addr_at(0) + 2);
    +    short *lo_ptr = (short*)(addr_at(4) + 2);
    +#endif
    +    *hi_ptr = x >> 16;
    +    *lo_ptr = x & 0xFFFF;
    +    ICache::ppc64_flush_icache_bytes(addr_at(0), NativeMovRegMem::instruction_size);
    +  }
    +
    +  void add_offset_in_bytes(intptr_t radd_offset) {
    +    set_offset(offset() + radd_offset);
    +  }
    +
    +  void verify() const {
    +    guarantee(Assembler::is_lis(long_at(0)), "load_const32 1st instr");
    +    guarantee(Assembler::is_ori(long_at(4)), "load_const32 2nd instr");
    +  }
    +
    + private:
    +  friend inline NativeMovRegMem* nativeMovRegMem_at(address address) {
    +    NativeMovRegMem* test = (NativeMovRegMem*)address;
    +    DEBUG_ONLY( test->verify(); )
    +    return test;
    +  }
    +};
    +
     #endif // CPU_PPC_VM_NATIVEINST_PPC_HPP
    diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad
    index daa35899360..aefdf28133f 100644
    --- a/hotspot/src/cpu/ppc/vm/ppc.ad
    +++ b/hotspot/src/cpu/ppc/vm/ppc.ad
    @@ -698,7 +698,7 @@ reg_class ctr_reg(SR_CTR);
     // ----------------------------
     
     reg_class flt_reg(
    -/*F0*/              // scratch
    +  F0,
       F1,
       F2,
       F3,
    @@ -735,7 +735,7 @@ reg_class flt_reg(
     // Double precision float registers have virtual `high halves' that
     // are needed by the allocator.
     reg_class dbl_reg(
    -/*F0,  F0_H*/     // scratch
    +  F0,  F0_H,
       F1,  F1_H,
       F2,  F2_H,
       F3,  F3_H,
    @@ -1040,8 +1040,6 @@ source_hpp %{ // Header information of the source block.
     //---<  Used for optimization in Compile::Shorten_branches  >---
     //--------------------------------------------------------------
     
    -const uint trampoline_stub_size     =  6 * BytesPerInstWord;
    -
     class CallStubImpl {
     
      public:
    @@ -1053,7 +1051,7 @@ class CallStubImpl {
       // This doesn't need to be accurate to the byte, but it
       // must be larger than or equal to the real size of the stub.
       static uint size_call_trampoline() {
    -    return trampoline_stub_size;
    +    return MacroAssembler::trampoline_stub_size;
       }
     
       // number of relocations needed by a call trampoline stub
    @@ -1079,46 +1077,10 @@ source %{
     //   branch via CTR (LR/link still points to the call-site above)
     
     void CallStubImpl::emit_trampoline_stub(MacroAssembler &_masm, int destination_toc_offset, int insts_call_instruction_offset) {
    -  // Start the stub.
    -  address stub = __ start_a_stub(Compile::MAX_stubs_size/2);
    +  address stub = __ emit_trampoline_stub(destination_toc_offset, insts_call_instruction_offset);
       if (stub == NULL) {
    -    ciEnv::current()->record_failure("CodeCache is full");
    -    return;
    +    ciEnv::current()->record_out_of_memory_failure();
       }
    -
    -  // For java_to_interp stubs we use R11_scratch1 as scratch register
    -  // and in call trampoline stubs we use R12_scratch2. This way we
    -  // can distinguish them (see is_NativeCallTrampolineStub_at()).
    -  Register reg_scratch = R12_scratch2;
    -
    -  // Create a trampoline stub relocation which relates this trampoline stub
    -  // with the call instruction at insts_call_instruction_offset in the
    -  // instructions code-section.
    -  __ relocate(trampoline_stub_Relocation::spec(__ code()->insts()->start() + insts_call_instruction_offset));
    -  const int stub_start_offset = __ offset();
    -
    -  // Now, create the trampoline stub's code:
    -  // - load the TOC
    -  // - load the call target from the constant pool
    -  // - call
    -  __ calculate_address_from_global_toc(reg_scratch, __ method_toc());
    -  __ ld_largeoffset_unchecked(reg_scratch, destination_toc_offset, reg_scratch, false);
    -  __ mtctr(reg_scratch);
    -  __ bctr();
    -
    -  const address stub_start_addr = __ addr_at(stub_start_offset);
    -
    -  // FIXME: Assert that the trampoline stub can be identified and patched.
    -
    -  // Assert that the encoded destination_toc_offset can be identified and that it is correct.
    -  assert(destination_toc_offset == NativeCallTrampolineStub_at(stub_start_addr)->destination_toc_offset(),
    -         "encoded offset into the constant pool must match");
    -  // Trampoline_stub_size should be good.
    -  assert((uint)(__ offset() - stub_start_offset) <= trampoline_stub_size, "should be good size");
    -  assert(is_NativeCallTrampolineStub_at(stub_start_addr), "doesn't look like a trampoline");
    -
    -  // End the stub.
    -  __ end_a_stub();
     }
     
     //=============================================================================
    @@ -1156,6 +1118,10 @@ EmitCallOffsets emit_call_with_trampoline_stub(MacroAssembler &_masm, address en
       if (!Compile::current()->in_scratch_emit_size()) {
         // Put the entry point as a constant into the constant pool.
         const address entry_point_toc_addr   = __ address_constant(entry_point, RelocationHolder::none);
    +    if (entry_point_toc_addr == NULL) {
    +      ciEnv::current()->record_out_of_memory_failure();
    +      return offsets;
    +    }
         const int     entry_point_toc_offset = __ offset_to_method_toc(entry_point_toc_addr);
     
         // Emit the trampoline stub which will be related to the branch-and-link below.
    @@ -2474,6 +2440,10 @@ encode %{
           // Create a non-oop constant, no relocation needed.
           // If it is an IC, it has a virtual_call_Relocation.
           const_toc_addr = __ long_constant((jlong)$src$$constant);
    +      if (const_toc_addr == NULL) {
    +        ciEnv::current()->record_out_of_memory_failure();
    +        return;
    +      }
     
           // Get the constant's TOC offset.
           toc_offset = __ offset_to_method_toc(const_toc_addr);
    @@ -2495,6 +2465,10 @@ encode %{
           // Create a non-oop constant, no relocation needed.
           // If it is an IC, it has a virtual_call_Relocation.
           const_toc_addr = __ long_constant((jlong)$src$$constant);
    +      if (const_toc_addr == NULL) {
    +        ciEnv::current()->record_out_of_memory_failure();
    +        return;
    +      }
     
           // Get the constant's TOC offset.
           const int toc_offset = __ offset_to_method_toc(const_toc_addr);
    @@ -2631,6 +2605,10 @@ encode %{
             const_toc_addr = __ long_constant((jlong)$src$$constant);
           }
     
    +      if (const_toc_addr == NULL) {
    +        ciEnv::current()->record_out_of_memory_failure();
    +        return;
    +      }
           // Get the constant's TOC offset.
           toc_offset = __ offset_to_method_toc(const_toc_addr);
         }
    @@ -2660,6 +2638,10 @@ encode %{
             const_toc_addr = __ long_constant((jlong)$src$$constant);
           }
     
    +      if (const_toc_addr == NULL) {
    +        ciEnv::current()->record_out_of_memory_failure();
    +        return;
    +      }
           // Get the constant's TOC offset.
           const int toc_offset = __ offset_to_method_toc(const_toc_addr);
           // Store the toc offset of the constant.
    @@ -3408,6 +3390,10 @@ encode %{
     
             // Put the entry point as a constant into the constant pool.
             const address entry_point_toc_addr   = __ address_constant(entry_point, RelocationHolder::none);
    +        if (entry_point_toc_addr == NULL) {
    +          ciEnv::current()->record_out_of_memory_failure();
    +          return;
    +        }
             const int     entry_point_toc_offset = __ offset_to_method_toc(entry_point_toc_addr);
     
             // Emit the trampoline stub which will be related to the branch-and-link below.
    @@ -3433,76 +3419,6 @@ encode %{
         }
       %}
     
    -  // Emit a method handle call.
    -  //
    -  // Method handle calls from compiled to compiled are going thru a
    -  // c2i -> i2c adapter, extending the frame for their arguments. The
    -  // caller however, returns directly to the compiled callee, that has
    -  // to cope with the extended frame. We restore the original frame by
    -  // loading the callers sp and adding the calculated framesize.
    -  enc_class enc_java_handle_call(method meth) %{
    -    // TODO: PPC port $archOpcode(ppc64Opcode_compound);
    -
    -    MacroAssembler _masm(&cbuf);
    -    address entry_point = (address)$meth$$method;
    -
    -    // Remember the offset not the address.
    -    const int start_offset = __ offset();
    -    // The trampoline stub.
    -    if (!ra_->C->in_scratch_emit_size()) {
    -      // No entry point given, use the current pc.
    -      // Make sure branch fits into
    -      if (entry_point == 0) entry_point = __ pc();
    -
    -      // Put the entry point as a constant into the constant pool.
    -      const address entry_point_toc_addr   = __ address_constant(entry_point, RelocationHolder::none);
    -      const int     entry_point_toc_offset = __ offset_to_method_toc(entry_point_toc_addr);
    -
    -      // Emit the trampoline stub which will be related to the branch-and-link below.
    -      CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, start_offset);
    -      if (ra_->C->env()->failing()) { return; } // Code cache may be full.
    -      assert(_optimized_virtual, "methodHandle call should be a virtual call");
    -      __ relocate(relocInfo::opt_virtual_call_type);
    -    }
    -
    -    // The real call.
    -    // Note: At this point we do not have the address of the trampoline
    -    // stub, and the entry point might be too far away for bl, so __ pc()
    -    // serves as dummy and the bl will be patched later.
    -    cbuf.set_insts_mark();
    -    __ bl(__ pc());  // Emits a relocation.
    -
    -    assert(_method, "execute next statement conditionally");
    -    // The stub for call to interpreter.
    -    address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
    -    if (stub == NULL) {
    -      ciEnv::current()->record_failure("CodeCache is full");
    -      return;
    -    }
    -
    -    // Restore original sp.
    -    __ ld(R11_scratch1, 0, R1_SP); // Load caller sp.
    -    const long framesize = ra_->C->frame_slots() << LogBytesPerInt;
    -    unsigned int bytes = (unsigned int)framesize;
    -    long offset = Assembler::align_addr(bytes, frame::alignment_in_bytes);
    -    if (Assembler::is_simm(-offset, 16)) {
    -      __ addi(R1_SP, R11_scratch1, -offset);
    -    } else {
    -      __ load_const_optimized(R12_scratch2, -offset);
    -      __ add(R1_SP, R11_scratch1, R12_scratch2);
    -    }
    -#ifdef ASSERT
    -  __ ld(R12_scratch2, 0, R1_SP); // Load from unextended_sp.
    -  __ cmpd(CCR0, R11_scratch1, R12_scratch2);
    -  __ asm_assert_eq("backlink changed", 0x8000);
    -#endif
    -    // If fails should store backlink before unextending.
    -
    -    if (ra_->C->env()->failing()) {
    -      return;
    -    }
    -  %}
    -
       // Second node of expanded dynamic call - the call.
       enc_class enc_java_dynamic_call_sched(method meth) %{
         // TODO: PPC port $archOpcode(ppc64Opcode_bl);
    @@ -3513,6 +3429,10 @@ encode %{
           // Create a call trampoline stub for the given method.
           const address entry_point = !($meth$$method) ? 0 : (address)$meth$$method;
           const address entry_point_const = __ address_constant(entry_point, RelocationHolder::none);
    +      if (entry_point_const == NULL) {
    +        ciEnv::current()->record_out_of_memory_failure();
    +        return;
    +      }
           const int entry_point_const_toc_offset = __ offset_to_method_toc(entry_point_const);
           CallStubImpl::emit_trampoline_stub(_masm, entry_point_const_toc_offset, __ offset());
           if (ra_->C->env()->failing()) { return; } // Code cache may be full.
    @@ -3620,7 +3540,11 @@ encode %{
           address virtual_call_meta_addr = __ pc();
           // Load a clear inline cache.
           AddressLiteral empty_ic((address) Universe::non_oop_word());
    -      __ load_const_from_method_toc(ic_reg, empty_ic, Rtoc);
    +      bool success = __ load_const_from_method_toc(ic_reg, empty_ic, Rtoc, /*fixed_size*/ true);
    +      if (!success) {
    +        ciEnv::current()->record_out_of_memory_failure();
    +        return;
    +      }
           // CALL to fixup routine.  Fixup routine uses ScopeDesc info
           // to determine who we intended to call.
           __ relocate(virtual_call_Relocation::spec(virtual_call_meta_addr));
    @@ -3676,7 +3600,11 @@ encode %{
         __ calculate_address_from_global_toc(Rtoc, __ method_toc());
         // Put entry, env, toc into the constant pool, this needs up to 3 constant
         // pool entries; call_c_using_toc will optimize the call.
    -    __ call_c_using_toc(fd, relocInfo::runtime_call_type, Rtoc);
    +    bool success = __ call_c_using_toc(fd, relocInfo::runtime_call_type, Rtoc);
    +    if (!success) {
    +      ciEnv::current()->record_out_of_memory_failure();
    +      return;
    +    }
     #endif
     
         // Check the ret_addr_offset.
    @@ -6263,6 +6191,10 @@ instruct loadConF(regF dst, immF src, iRegLdst toc) %{
       ins_encode %{
         // TODO: PPC port $archOpcode(ppc64Opcode_lfs);
         address float_address = __ float_constant($src$$constant);
    +    if (float_address == NULL) {
    +      ciEnv::current()->record_out_of_memory_failure();
    +      return;
    +    }
         __ lfs($dst$$FloatRegister, __ offset_to_method_toc(float_address), $toc$$Register);
       %}
       ins_pipe(pipe_class_memory);
    @@ -6284,6 +6216,10 @@ instruct loadConFComp(regF dst, immF src, iRegLdst toc) %{
         FloatRegister Rdst    = $dst$$FloatRegister;
         Register Rtoc         = $toc$$Register;
         address float_address = __ float_constant($src$$constant);
    +    if (float_address == NULL) {
    +      ciEnv::current()->record_out_of_memory_failure();
    +      return;
    +    }
         int offset            = __ offset_to_method_toc(float_address);
         int hi = (offset + (1<<15))>>16;
         int lo = offset - hi * (1<<16);
    @@ -6318,7 +6254,12 @@ instruct loadConD(regD dst, immD src, iRegLdst toc) %{
       size(4);
       ins_encode %{
         // TODO: PPC port $archOpcode(ppc64Opcode_lfd);
    -    int offset =  __ offset_to_method_toc(__ double_constant($src$$constant));
    +    address float_address = __ double_constant($src$$constant);
    +    if (float_address == NULL) {
    +      ciEnv::current()->record_out_of_memory_failure();
    +      return;
    +    }
    +    int offset =  __ offset_to_method_toc(float_address);
         __ lfd($dst$$FloatRegister, offset, $toc$$Register);
       %}
       ins_pipe(pipe_class_memory);
    @@ -6340,7 +6281,11 @@ instruct loadConDComp(regD dst, immD src, iRegLdst toc) %{
         FloatRegister Rdst    = $dst$$FloatRegister;
         Register      Rtoc    = $toc$$Register;
         address float_address = __ double_constant($src$$constant);
    -    int offset            = __ offset_to_method_toc(float_address);
    +    if (float_address == NULL) {
    +      ciEnv::current()->record_out_of_memory_failure();
    +      return;
    +    }
    +    int offset = __ offset_to_method_toc(float_address);
         int hi = (offset + (1<<15))>>16;
         int lo = offset - hi * (1<<16);
     
    @@ -11790,7 +11735,6 @@ instruct safePoint_poll_conPollAddr(rscratch2RegP poll) %{
     instruct CallStaticJavaDirect(method meth) %{
       match(CallStaticJava);
       effect(USE meth);
    -  predicate(!((CallStaticJavaNode*)n)->is_method_handle_invoke());
       ins_cost(CALL_COST);
     
       ins_num_consts(3 /* up to 3 patchable constants: inline cache, 2 call targets. */);
    @@ -11801,20 +11745,6 @@ instruct CallStaticJavaDirect(method meth) %{
       ins_pipe(pipe_class_call);
     %}
     
    -// Schedulable version of call static node.
    -instruct CallStaticJavaDirectHandle(method meth) %{
    -  match(CallStaticJava);
    -  effect(USE meth);
    -  predicate(((CallStaticJavaNode*)n)->is_method_handle_invoke());
    -  ins_cost(CALL_COST);
    -
    -  ins_num_consts(3 /* up to 3 patchable constants: inline cache, 2 call targets. */);
    -
    -  format %{ "CALL,static $meth \t// ==> " %}
    -  ins_encode( enc_java_handle_call(meth) );
    -  ins_pipe(pipe_class_call);
    -%}
    -
     // Call Java Dynamic Instruction
     
     // Used by postalloc expand of CallDynamicJavaDirectSchedEx (actual call).
    diff --git a/hotspot/src/cpu/ppc/vm/register_ppc.hpp b/hotspot/src/cpu/ppc/vm/register_ppc.hpp
    index 9dc765ab4a2..1d0eeac61a2 100644
    --- a/hotspot/src/cpu/ppc/vm/register_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/register_ppc.hpp
    @@ -627,6 +627,9 @@ REGISTER_DECLARATION(Register, R27_constPoolCache,    R27);
     REGISTER_DECLARATION(Register, R28_mdx,               R28);
     #endif // CC_INTERP
     
    +REGISTER_DECLARATION(Register, R19_inline_cache_reg, R19);
    +REGISTER_DECLARATION(Register, R29_TOC, R29);
    +
     #ifndef DONT_USE_REGISTER_DEFINES
     #define R21_tmp1         AS_REGISTER(Register, R21)
     #define R22_tmp2         AS_REGISTER(Register, R22)
    @@ -648,6 +651,9 @@ REGISTER_DECLARATION(Register, R28_mdx,               R28);
     #define R28_mdx               AS_REGISTER(Register, R28)
     #endif
     
    +#define R19_inline_cache_reg AS_REGISTER(Register, R19)
    +#define R29_TOC AS_REGISTER(Register, R29)
    +
     #define CCR4_is_synced AS_REGISTER(ConditionRegister, CCR4)
     #endif
     
    diff --git a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp
    index 74e72ba62b6..9c5065d0dd4 100644
    --- a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp
    @@ -84,13 +84,11 @@ address Relocation::pd_call_destination(address orig_addr) {
         NativeConditionalFarBranch* branch = NativeConditionalFarBranch_at(inst_loc);
         return branch->branch_destination();
       } else {
    -    // There are two instructions at the beginning of a stub, therefore we
    -    // load at orig_addr + 8.
         orig_addr = nativeCall_at(inst_loc)->get_trampoline();
         if (orig_addr == NULL) {
           return (address) -1;
         } else {
    -      return (address) nativeMovConstReg_at(orig_addr + 8)->data();
    +      return ((NativeCallTrampolineStub*)orig_addr)->destination();
         }
       }
     }
    diff --git a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp
    index 404df938777..e887877d14e 100644
    --- a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp
    @@ -1,6 +1,6 @@
     /*
    - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
    - * Copyright 2012, 2014 SAP AG. All rights reserved.
    + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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
    @@ -45,16 +45,6 @@
     
     #ifdef COMPILER2
     
    -// SP adjustment (must use unextended SP) for method handle call sites
    -// during exception handling.
    -static intptr_t adjust_SP_for_methodhandle_callsite(JavaThread *thread) {
    -  RegisterMap map(thread, false);
    -  // The frame constructor will do the correction for us (see frame::adjust_unextended_SP).
    -  frame mh_caller_frame = thread->last_frame().sender(&map);
    -  assert(mh_caller_frame.is_compiled_frame(), "Only may reach here for compiled MH call sites");
    -  return (intptr_t) mh_caller_frame.unextended_sp();
    -}
    -
     //------------------------------generate_exception_blob---------------------------
     // Creates exception blob at the end.
     // Using exception blob, this code is jumped from a compiled method.
    @@ -129,17 +119,10 @@ void OptoRuntime::generate_exception_blob() {
       OopMapSet* oop_maps = new OopMapSet();
       oop_maps->add_gc_map(calls_return_pc - start, map);
     
    -  // Get unextended_sp for method handle call sites.
    -  Label mh_callsite, mh_done; // Use a 2nd c call if it's a method handle call site.
    -  __ lwa(R4_ARG2, in_bytes(JavaThread::is_method_handle_return_offset()), R16_thread);
    -  __ cmpwi(CCR0, R4_ARG2, 0);
    -  __ bne(CCR0, mh_callsite);
    -
       __ mtctr(R3_RET); // Move address of exception handler to SR_CTR.
       __ reset_last_Java_frame();
       __ pop_frame();
     
    -  __ bind(mh_done);
       // We have a handler in register SR_CTR (could be deopt blob).
     
       // Get the exception oop.
    @@ -161,25 +144,6 @@ void OptoRuntime::generate_exception_blob() {
       __ mtlr(R4_ARG2);
       __ bctr();
     
    -
    -  // Same as above, but also set sp to unextended_sp.
    -  __ bind(mh_callsite);
    -  __ mr(R31, R3_RET); // Save branch address.
    -  __ mr(R3_ARG1, R16_thread);
    -#if defined(ABI_ELFv2)
    -  __ call_c((address) adjust_SP_for_methodhandle_callsite, relocInfo::none);
    -#else
    -  __ call_c(CAST_FROM_FN_PTR(FunctionDescriptor*, adjust_SP_for_methodhandle_callsite), relocInfo::none);
    -#endif
    -  // Returns unextended_sp in R3_RET.
    -
    -  __ mtctr(R31); // Move address of exception handler to SR_CTR.
    -  __ reset_last_Java_frame();
    -
    -  __ mr(R1_SP, R3_RET); // Set sp to unextended_sp.
    -  __ b(mh_done);
    -
    -
       // Make sure all code is generated.
       masm->flush();
     
    diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
    index 141891d0a16..ec9f568516e 100644
    --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
    @@ -62,7 +62,7 @@ class RegisterSaver {
       // Support different return pc locations.
       enum ReturnPCLocation {
         return_pc_is_lr,
    -    return_pc_is_r4,
    +    return_pc_is_pre_saved,
         return_pc_is_thread_saved_exception_pc
       };
     
    @@ -241,16 +241,17 @@ OopMap* RegisterSaver::push_frame_reg_args_and_save_live_registers(MacroAssemble
       __ mfcr(R31);
       __ std(R31, _abi(cr), R1_SP);
       switch (return_pc_location) {
    -    case return_pc_is_lr:    __ mflr(R31);           break;
    -    case return_pc_is_r4:    __ mr(R31, R4);     break;
    -    case return_pc_is_thread_saved_exception_pc:
    -                             __ ld(R31, thread_(saved_exception_pc)); break;
    +    case return_pc_is_lr: __ mflr(R31); break;
    +    case return_pc_is_pre_saved: assert(return_pc_adjustment == 0, "unsupported"); break;
    +    case return_pc_is_thread_saved_exception_pc: __ ld(R31, thread_(saved_exception_pc)); break;
         default: ShouldNotReachHere();
       }
    -  if (return_pc_adjustment != 0) {
    -    __ addi(R31, R31, return_pc_adjustment);
    +  if (return_pc_location != return_pc_is_pre_saved) {
    +    if (return_pc_adjustment != 0) {
    +      __ addi(R31, R31, return_pc_adjustment);
    +    }
    +    __ std(R31, _abi(lr), R1_SP);
       }
    -  __ std(R31, _abi(lr), R1_SP);
     
       // push a new frame
       __ push_frame(frame_size_in_bytes, R31);
    @@ -646,7 +647,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
       return round_to(stk, 2);
     }
     
    -#ifdef COMPILER2
    +#if defined(COMPILER1) || defined(COMPILER2)
     // Calling convention for calling C code.
     int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
                                             VMRegPair *regs,
    @@ -2576,7 +2577,7 @@ uint SharedRuntime::out_preserve_stack_slots() {
     #endif
     }
     
    -#ifdef COMPILER2
    +#if defined(COMPILER1) || defined(COMPILER2)
     // Frame generation for deopt and uncommon trap blobs.
     static void push_skeleton_frame(MacroAssembler* masm, bool deopt,
                                     /* Read */
    @@ -2734,7 +2735,7 @@ void SharedRuntime::generate_deopt_blob() {
     
       const address start = __ pc();
     
    -#ifdef COMPILER2
    +#if defined(COMPILER1) || defined(COMPILER2)
       // --------------------------------------------------------------------------
       // Prolog for non exception case!
     
    @@ -2783,28 +2784,43 @@ void SharedRuntime::generate_deopt_blob() {
     
       BLOCK_COMMENT("Prolog for exception case");
     
    -  // The RegisterSaves doesn't need to adjust the return pc for this situation.
    -  const int return_pc_adjustment_exception = 0;
    -
    -  // Push the "unpack frame".
    -  // Save everything in sight.
    -  assert(R4 == R4_ARG2, "exception pc must be in r4");
    -  RegisterSaver::push_frame_reg_args_and_save_live_registers(masm,
    -                                                             &first_frame_size_in_bytes,
    -                                                             /*generate_oop_map=*/ false,
    -                                                             return_pc_adjustment_exception,
    -                                                             RegisterSaver::return_pc_is_r4);
    -
    -  // Deopt during an exception. Save exec mode for unpack_frames.
    -  __ li(exec_mode_reg, Deoptimization::Unpack_exception);
    -
       // Store exception oop and pc in thread (location known to GC).
       // This is needed since the call to "fetch_unroll_info()" may safepoint.
       __ std(R3_ARG1, in_bytes(JavaThread::exception_oop_offset()), R16_thread);
       __ std(R4_ARG2, in_bytes(JavaThread::exception_pc_offset()),  R16_thread);
    +  __ std(R4_ARG2, _abi(lr), R1_SP);
    +
    +  // Vanilla deoptimization with an exception pending in exception_oop.
    +  int exception_in_tls_offset = __ pc() - start;
    +
    +  // Push the "unpack frame".
    +  // Save everything in sight.
    +  RegisterSaver::push_frame_reg_args_and_save_live_registers(masm,
    +                                                             &first_frame_size_in_bytes,
    +                                                             /*generate_oop_map=*/ false,
    +                                                             /*return_pc_adjustment_exception=*/ 0,
    +                                                             RegisterSaver::return_pc_is_pre_saved);
    +
    +  // Deopt during an exception. Save exec mode for unpack_frames.
    +  __ li(exec_mode_reg, Deoptimization::Unpack_exception);
     
       // fall through
     
    +  int reexecute_offset = 0;
    +#ifdef COMPILER1
    +  __ b(exec_mode_initialized);
    +
    +  // Reexecute entry, similar to c2 uncommon trap
    +  reexecute_offset = __ pc() - start;
    +
    +  RegisterSaver::push_frame_reg_args_and_save_live_registers(masm,
    +                                                             &first_frame_size_in_bytes,
    +                                                             /*generate_oop_map=*/ false,
    +                                                             /*return_pc_adjustment_reexecute=*/ 0,
    +                                                             RegisterSaver::return_pc_is_pre_saved);
    +  __ li(exec_mode_reg, Deoptimization::Unpack_reexecute);
    +#endif
    +
       // --------------------------------------------------------------------------
       __ BIND(exec_mode_initialized);
     
    @@ -2918,7 +2934,9 @@ void SharedRuntime::generate_deopt_blob() {
       int exception_offset = __ pc() - start;
     #endif // COMPILER2
     
    -  _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, 0, first_frame_size_in_bytes / wordSize);
    +  _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset,
    +                                           reexecute_offset, first_frame_size_in_bytes / wordSize);
    +  _deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset);
     }
     
     #ifdef COMPILER2
    diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
    index 1dbb5c04f29..28f2ca60425 100644
    --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
    @@ -48,6 +48,12 @@
     #define BLOCK_COMMENT(str) __ block_comment(str)
     #endif
     
    +#if defined(ABI_ELFv2)
    +#define STUB_ENTRY(name) StubRoutines::name()
    +#else
    +#define STUB_ENTRY(name) ((FunctionDescriptor*)StubRoutines::name())->entry()
    +#endif
    +
     class StubGenerator: public StubCodeGenerator {
      private:
     
    @@ -259,8 +265,7 @@ class StubGenerator: public StubCodeGenerator {
           //
     
           // global toc register
    -      __ load_const(R29, MacroAssembler::global_toc(), R11_scratch1);
    -
    +      __ load_const_optimized(R29_TOC, MacroAssembler::global_toc(), R11_scratch1);
           // Remember the senderSP so we interpreter can pop c2i arguments off of the stack
           // when called via a c2i.
     
    @@ -619,14 +624,17 @@ class StubGenerator: public StubCodeGenerator {
       //  Kills:
       //     nothing
       //
    -  void gen_write_ref_array_pre_barrier(Register from, Register to, Register count, bool dest_uninitialized, Register Rtmp1) {
    +  void gen_write_ref_array_pre_barrier(Register from, Register to, Register count, bool dest_uninitialized, Register Rtmp1,
    +                                       Register preserve1 = noreg, Register preserve2 = noreg) {
         BarrierSet* const bs = Universe::heap()->barrier_set();
         switch (bs->kind()) {
           case BarrierSet::G1SATBCTLogging:
             // With G1, don't generate the call if we statically know that the target in uninitialized
             if (!dest_uninitialized) {
    -          const int spill_slots = 4 * wordSize;
    -          const int frame_size  = frame::abi_reg_args_size + spill_slots;
    +          int spill_slots = 3;
    +          if (preserve1 != noreg) { spill_slots++; }
    +          if (preserve2 != noreg) { spill_slots++; }
    +          const int frame_size = align_size_up(frame::abi_reg_args_size + spill_slots * BytesPerWord, frame::alignment_in_bytes);
               Label filtered;
     
               // Is marking active?
    @@ -640,17 +648,23 @@ class StubGenerator: public StubCodeGenerator {
               __ beq(CCR0, filtered);
     
               __ save_LR_CR(R0);
    -          __ push_frame_reg_args(spill_slots, R0);
    -          __ std(from,  frame_size - 1 * wordSize, R1_SP);
    -          __ std(to,    frame_size - 2 * wordSize, R1_SP);
    -          __ std(count, frame_size - 3 * wordSize, R1_SP);
    +          __ push_frame(frame_size, R0);
    +          int slot_nr = 0;
    +          __ std(from,  frame_size - (++slot_nr) * wordSize, R1_SP);
    +          __ std(to,    frame_size - (++slot_nr) * wordSize, R1_SP);
    +          __ std(count, frame_size - (++slot_nr) * wordSize, R1_SP);
    +          if (preserve1 != noreg) { __ std(preserve1, frame_size - (++slot_nr) * wordSize, R1_SP); }
    +          if (preserve2 != noreg) { __ std(preserve2, frame_size - (++slot_nr) * wordSize, R1_SP); }
     
               __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre), to, count);
     
    -          __ ld(from,  frame_size - 1 * wordSize, R1_SP);
    -          __ ld(to,    frame_size - 2 * wordSize, R1_SP);
    -          __ ld(count, frame_size - 3 * wordSize, R1_SP);
    -          __ pop_frame();
    +          slot_nr = 0;
    +          __ ld(from,  frame_size - (++slot_nr) * wordSize, R1_SP);
    +          __ ld(to,    frame_size - (++slot_nr) * wordSize, R1_SP);
    +          __ ld(count, frame_size - (++slot_nr) * wordSize, R1_SP);
    +          if (preserve1 != noreg) { __ ld(preserve1, frame_size - (++slot_nr) * wordSize, R1_SP); }
    +          if (preserve2 != noreg) { __ ld(preserve2, frame_size - (++slot_nr) * wordSize, R1_SP); }
    +          __ addi(R1_SP, R1_SP, frame_size); // pop_frame()
               __ restore_LR_CR(R0);
     
               __ bind(filtered);
    @@ -674,27 +688,22 @@ class StubGenerator: public StubCodeGenerator {
       //
       //  The input registers and R0 are overwritten.
       //
    -  void gen_write_ref_array_post_barrier(Register addr, Register count, Register tmp, bool branchToEnd) {
    +  void gen_write_ref_array_post_barrier(Register addr, Register count, Register tmp, Register preserve = noreg) {
         BarrierSet* const bs = Universe::heap()->barrier_set();
     
         switch (bs->kind()) {
           case BarrierSet::G1SATBCTLogging:
             {
    -          if (branchToEnd) {
    -            __ save_LR_CR(R0);
    -            // We need this frame only to spill LR.
    -            __ push_frame_reg_args(0, R0);
    -            __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), addr, count);
    -            __ pop_frame();
    -            __ restore_LR_CR(R0);
    -          } else {
    -            // Tail call: fake call from stub caller by branching without linking.
    -            address entry_point = (address)CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post);
    -            __ mr_if_needed(R3_ARG1, addr);
    -            __ mr_if_needed(R4_ARG2, count);
    -            __ load_const(R11, entry_point, R0);
    -            __ call_c_and_return_to_caller(R11);
    -          }
    +          int spill_slots = (preserve != noreg) ? 1 : 0;
    +          const int frame_size = align_size_up(frame::abi_reg_args_size + spill_slots * BytesPerWord, frame::alignment_in_bytes);
    +
    +          __ save_LR_CR(R0);
    +          __ push_frame(frame_size, R0);
    +          if (preserve != noreg) { __ std(preserve, frame_size - 1 * wordSize, R1_SP); }
    +          __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), addr, count);
    +          if (preserve != noreg) { __ ld(preserve, frame_size - 1 * wordSize, R1_SP); }
    +          __ addi(R1_SP, R1_SP, frame_size); // pop_frame();
    +          __ restore_LR_CR(R0);
             }
             break;
           case BarrierSet::CardTableForRS:
    @@ -729,12 +738,9 @@ class StubGenerator: public StubCodeGenerator {
               __ addi(addr, addr, 1);
               __ bdnz(Lstore_loop);
               __ bind(Lskip_loop);
    -
    -          if (!branchToEnd) __ blr();
             }
           break;
           case BarrierSet::ModRef:
    -        if (!branchToEnd) __ blr();
             break;
           default:
             ShouldNotReachHere();
    @@ -763,8 +769,10 @@ class StubGenerator: public StubCodeGenerator {
     
         // Procedure for large arrays (uses data cache block zero instruction).
         Label dwloop, fast, fastloop, restloop, lastdword, done;
    -    int cl_size=VM_Version::get_cache_line_size(), cl_dwords=cl_size>>3, cl_dwordaddr_bits=exact_log2(cl_dwords);
    -    int min_dcbz=2; // Needs to be positive, apply dcbz only to at least min_dcbz cache lines.
    +    int cl_size = VM_Version::L1_data_cache_line_size();
    +    int cl_dwords = cl_size >> 3;
    +    int cl_dwordaddr_bits = exact_log2(cl_dwords);
    +    int min_dcbz = 2; // Needs to be positive, apply dcbz only to at least min_dcbz cache lines.
     
         // Clear up to 128byte boundary if long enough, dword_cnt=(16-(base>>3))%16.
         __ dcbtst(base_ptr_reg);                    // Indicate write access to first cache line ...
    @@ -1081,7 +1089,6 @@ class StubGenerator: public StubCodeGenerator {
         Register tmp1 = R6_ARG4;
         Register tmp2 = R7_ARG5;
     
    -    Label l_overlap;
     #ifdef ASSERT
         __ srdi_(tmp2, R5_ARG3, 31);
         __ asm_assert_eq("missing zero extend", 0xAFFE);
    @@ -1091,19 +1098,11 @@ class StubGenerator: public StubCodeGenerator {
         __ sldi(tmp2, R5_ARG3, log2_elem_size); // size in bytes
         __ cmpld(CCR0, R3_ARG1, R4_ARG2); // Use unsigned comparison!
         __ cmpld(CCR1, tmp1, tmp2);
    -    __ crand(CCR0, Assembler::less, CCR1, Assembler::less);
    -    __ blt(CCR0, l_overlap); // Src before dst and distance smaller than size.
    +    __ crnand(CCR0, Assembler::less, CCR1, Assembler::less);
    +    // Overlaps if Src before dst and distance smaller than size.
    +    // Branch to forward copy routine otherwise (within range of 32kB).
    +    __ bc(Assembler::bcondCRbiIs1, Assembler::bi0(CCR0, Assembler::less), no_overlap_target);
     
    -    // need to copy forwards
    -    if (__ is_within_range_of_b(no_overlap_target, __ pc())) {
    -      __ b(no_overlap_target);
    -    } else {
    -      __ load_const(tmp1, no_overlap_target, tmp2);
    -      __ mtctr(tmp1);
    -      __ bctr();
    -    }
    -
    -    __ bind(l_overlap);
         // need to copy backwards
       }
     
    @@ -1248,6 +1247,7 @@ class StubGenerator: public StubCodeGenerator {
         }
     
         __ bind(l_4);
    +    __ li(R3_RET, 0); // return 0
         __ blr();
     
         return start;
    @@ -1269,15 +1269,9 @@ class StubGenerator: public StubCodeGenerator {
         Register tmp2 = R7_ARG5;
         Register tmp3 = R8_ARG6;
     
    -#if defined(ABI_ELFv2)
         address nooverlap_target = aligned ?
    -      StubRoutines::arrayof_jbyte_disjoint_arraycopy() :
    -      StubRoutines::jbyte_disjoint_arraycopy();
    -#else
    -    address nooverlap_target = aligned ?
    -      ((FunctionDescriptor*)StubRoutines::arrayof_jbyte_disjoint_arraycopy())->entry() :
    -      ((FunctionDescriptor*)StubRoutines::jbyte_disjoint_arraycopy())->entry();
    -#endif
    +      STUB_ENTRY(arrayof_jbyte_disjoint_arraycopy) :
    +      STUB_ENTRY(jbyte_disjoint_arraycopy);
     
         array_overlap_test(nooverlap_target, 0);
         // Do reverse copy. We assume the case of actual overlap is rare enough
    @@ -1292,6 +1286,7 @@ class StubGenerator: public StubCodeGenerator {
         __ lbzx(tmp1, R3_ARG1, R5_ARG3);
         __ bge(CCR0, l_1);
     
    +    __ li(R3_RET, 0); // return 0
         __ blr();
     
         return start;
    @@ -1474,6 +1469,7 @@ class StubGenerator: public StubCodeGenerator {
           __ bdnz(l_5);
         }
         __ bind(l_4);
    +    __ li(R3_RET, 0); // return 0
         __ blr();
     
         return start;
    @@ -1495,15 +1491,9 @@ class StubGenerator: public StubCodeGenerator {
         Register tmp2 = R7_ARG5;
         Register tmp3 = R8_ARG6;
     
    -#if defined(ABI_ELFv2)
         address nooverlap_target = aligned ?
    -        StubRoutines::arrayof_jshort_disjoint_arraycopy() :
    -        StubRoutines::jshort_disjoint_arraycopy();
    -#else
    -    address nooverlap_target = aligned ?
    -        ((FunctionDescriptor*)StubRoutines::arrayof_jshort_disjoint_arraycopy())->entry() :
    -        ((FunctionDescriptor*)StubRoutines::jshort_disjoint_arraycopy())->entry();
    -#endif
    +      STUB_ENTRY(arrayof_jshort_disjoint_arraycopy) :
    +      STUB_ENTRY(jshort_disjoint_arraycopy);
     
         array_overlap_test(nooverlap_target, 1);
     
    @@ -1517,6 +1507,7 @@ class StubGenerator: public StubCodeGenerator {
         __ lhzx(tmp2, R3_ARG1, tmp1);
         __ bge(CCR0, l_1);
     
    +    __ li(R3_RET, 0); // return 0
         __ blr();
     
         return start;
    @@ -1620,6 +1611,7 @@ class StubGenerator: public StubCodeGenerator {
         StubCodeMark mark(this, "StubRoutines", name);
         address start = __ function_entry();
         generate_disjoint_int_copy_core(aligned);
    +    __ li(R3_RET, 0); // return 0
         __ blr();
         return start;
       }
    @@ -1704,20 +1696,15 @@ class StubGenerator: public StubCodeGenerator {
         StubCodeMark mark(this, "StubRoutines", name);
         address start = __ function_entry();
     
    -#if defined(ABI_ELFv2)
         address nooverlap_target = aligned ?
    -      StubRoutines::arrayof_jint_disjoint_arraycopy() :
    -      StubRoutines::jint_disjoint_arraycopy();
    -#else
    -    address nooverlap_target = aligned ?
    -      ((FunctionDescriptor*)StubRoutines::arrayof_jint_disjoint_arraycopy())->entry() :
    -      ((FunctionDescriptor*)StubRoutines::jint_disjoint_arraycopy())->entry();
    -#endif
    +      STUB_ENTRY(arrayof_jint_disjoint_arraycopy) :
    +      STUB_ENTRY(jint_disjoint_arraycopy);
     
         array_overlap_test(nooverlap_target, 2);
     
         generate_conjoint_int_copy_core(aligned);
     
    +    __ li(R3_RET, 0); // return 0
         __ blr();
     
         return start;
    @@ -1796,6 +1783,7 @@ class StubGenerator: public StubCodeGenerator {
         StubCodeMark mark(this, "StubRoutines", name);
         address start = __ function_entry();
         generate_disjoint_long_copy_core(aligned);
    +    __ li(R3_RET, 0); // return 0
         __ blr();
     
         return start;
    @@ -1878,19 +1866,14 @@ class StubGenerator: public StubCodeGenerator {
         StubCodeMark mark(this, "StubRoutines", name);
         address start = __ function_entry();
     
    -#if defined(ABI_ELFv2)
         address nooverlap_target = aligned ?
    -      StubRoutines::arrayof_jlong_disjoint_arraycopy() :
    -      StubRoutines::jlong_disjoint_arraycopy();
    -#else
    -    address nooverlap_target = aligned ?
    -      ((FunctionDescriptor*)StubRoutines::arrayof_jlong_disjoint_arraycopy())->entry() :
    -      ((FunctionDescriptor*)StubRoutines::jlong_disjoint_arraycopy())->entry();
    -#endif
    +      STUB_ENTRY(arrayof_jlong_disjoint_arraycopy) :
    +      STUB_ENTRY(jlong_disjoint_arraycopy);
     
         array_overlap_test(nooverlap_target, 3);
         generate_conjoint_long_copy_core(aligned);
     
    +    __ li(R3_RET, 0); // return 0
         __ blr();
     
         return start;
    @@ -1910,15 +1893,9 @@ class StubGenerator: public StubCodeGenerator {
     
         address start = __ function_entry();
     
    -#if defined(ABI_ELFv2)
         address nooverlap_target = aligned ?
    -      StubRoutines::arrayof_oop_disjoint_arraycopy() :
    -      StubRoutines::oop_disjoint_arraycopy();
    -#else
    -    address nooverlap_target = aligned ?
    -      ((FunctionDescriptor*)StubRoutines::arrayof_oop_disjoint_arraycopy())->entry() :
    -      ((FunctionDescriptor*)StubRoutines::oop_disjoint_arraycopy())->entry();
    -#endif
    +      STUB_ENTRY(arrayof_oop_disjoint_arraycopy) :
    +      STUB_ENTRY(oop_disjoint_arraycopy);
     
         gen_write_ref_array_pre_barrier(R3_ARG1, R4_ARG2, R5_ARG3, dest_uninitialized, R9_ARG7);
     
    @@ -1934,7 +1911,9 @@ class StubGenerator: public StubCodeGenerator {
           generate_conjoint_long_copy_core(aligned);
         }
     
    -    gen_write_ref_array_post_barrier(R9_ARG7, R10_ARG8, R11_scratch1, /*branchToEnd*/ false);
    +    gen_write_ref_array_post_barrier(R9_ARG7, R10_ARG8, R11_scratch1);
    +    __ li(R3_RET, 0); // return 0
    +    __ blr();
         return start;
       }
     
    @@ -1964,11 +1943,460 @@ class StubGenerator: public StubCodeGenerator {
           generate_disjoint_long_copy_core(aligned);
         }
     
    -    gen_write_ref_array_post_barrier(R9_ARG7, R10_ARG8, R11_scratch1, /*branchToEnd*/ false);
    +    gen_write_ref_array_post_barrier(R9_ARG7, R10_ARG8, R11_scratch1);
    +    __ li(R3_RET, 0); // return 0
    +    __ blr();
     
         return start;
       }
     
    +
    +  // Helper for generating a dynamic type check.
    +  // Smashes only the given temp registers.
    +  void generate_type_check(Register sub_klass,
    +                           Register super_check_offset,
    +                           Register super_klass,
    +                           Register temp,
    +                           Label& L_success) {
    +    assert_different_registers(sub_klass, super_check_offset, super_klass);
    +
    +    BLOCK_COMMENT("type_check:");
    +
    +    Label L_miss;
    +
    +    __ check_klass_subtype_fast_path(sub_klass, super_klass, temp, R0, &L_success, &L_miss, NULL,
    +                                     super_check_offset);
    +    __ check_klass_subtype_slow_path(sub_klass, super_klass, temp, R0, &L_success, NULL);
    +
    +    // Fall through on failure!
    +    __ bind(L_miss);
    +  }
    +
    +
    +  //  Generate stub for checked oop copy.
    +  //
    +  // Arguments for generated stub:
    +  //      from:  R3
    +  //      to:    R4
    +  //      count: R5 treated as signed
    +  //      ckoff: R6 (super_check_offset)
    +  //      ckval: R7 (super_klass)
    +  //      ret:   R3 zero for success; (-1^K) where K is partial transfer count
    +  //
    +  address generate_checkcast_copy(const char *name, bool dest_uninitialized) {
    +
    +    const Register R3_from   = R3_ARG1;      // source array address
    +    const Register R4_to     = R4_ARG2;      // destination array address
    +    const Register R5_count  = R5_ARG3;      // elements count
    +    const Register R6_ckoff  = R6_ARG4;      // super_check_offset
    +    const Register R7_ckval  = R7_ARG5;      // super_klass
    +
    +    const Register R8_offset = R8_ARG6;      // loop var, with stride wordSize
    +    const Register R9_remain = R9_ARG7;      // loop var, with stride -1
    +    const Register R10_oop   = R10_ARG8;     // actual oop copied
    +    const Register R11_klass = R11_scratch1; // oop._klass
    +    const Register R12_tmp   = R12_scratch2;
    +
    +    const Register R2_minus1 = R2;
    +
    +    //__ align(CodeEntryAlignment);
    +    StubCodeMark mark(this, "StubRoutines", name);
    +    address start = __ function_entry();
    +
    +    // TODO: Assert that int is 64 bit sign extended and arrays are not conjoint.
    +
    +    gen_write_ref_array_pre_barrier(R3_from, R4_to, R5_count, dest_uninitialized, R12_tmp, /* preserve: */ R6_ckoff, R7_ckval);
    +
    +    //inc_counter_np(SharedRuntime::_checkcast_array_copy_ctr, R12_tmp, R3_RET);
    +
    +    Label load_element, store_element, store_null, success, do_card_marks;
    +    __ or_(R9_remain, R5_count, R5_count); // Initialize loop index, and test it.
    +    __ li(R8_offset, 0);                   // Offset from start of arrays.
    +    __ li(R2_minus1, -1);
    +    __ bne(CCR0, load_element);
    +
    +    // Empty array: Nothing to do.
    +    __ li(R3_RET, 0);           // Return 0 on (trivial) success.
    +    __ blr();
    +
    +    // ======== begin loop ========
    +    // (Entry is load_element.)
    +    __ align(OptoLoopAlignment);
    +    __ bind(store_element);
    +    if (UseCompressedOops) {
    +      __ encode_heap_oop_not_null(R10_oop);
    +      __ bind(store_null);
    +      __ stw(R10_oop, R8_offset, R4_to);
    +    } else {
    +      __ bind(store_null);
    +      __ std(R10_oop, R8_offset, R4_to);
    +    }
    +
    +    __ addi(R8_offset, R8_offset, heapOopSize);   // Step to next offset.
    +    __ add_(R9_remain, R2_minus1, R9_remain);     // Decrement the count.
    +    __ beq(CCR0, success);
    +
    +    // ======== loop entry is here ========
    +    __ bind(load_element);
    +    __ load_heap_oop(R10_oop, R8_offset, R3_from, &store_null);  // Load the oop.
    +
    +    __ load_klass(R11_klass, R10_oop); // Query the object klass.
    +
    +    generate_type_check(R11_klass, R6_ckoff, R7_ckval, R12_tmp,
    +                        // Branch to this on success:
    +                        store_element);
    +    // ======== end loop ========
    +
    +    // It was a real error; we must depend on the caller to finish the job.
    +    // Register R9_remain has number of *remaining* oops, R5_count number of *total* oops.
    +    // Emit GC store barriers for the oops we have copied (R5_count minus R9_remain),
    +    // and report their number to the caller.
    +    __ subf_(R5_count, R9_remain, R5_count);
    +    __ nand(R3_RET, R5_count, R5_count);   // report (-1^K) to caller
    +    __ bne(CCR0, do_card_marks);
    +    __ blr();
    +
    +    __ bind(success);
    +    __ li(R3_RET, 0);
    +
    +    __ bind(do_card_marks);
    +    // Store check on R4_to[0..R5_count-1].
    +    gen_write_ref_array_post_barrier(R4_to, R5_count, R12_tmp, /* preserve: */ R3_RET);
    +    __ blr();
    +    return start;
    +  }
    +
    +
    +  //  Generate 'unsafe' array copy stub.
    +  //  Though just as safe as the other stubs, it takes an unscaled
    +  //  size_t argument instead of an element count.
    +  //
    +  // Arguments for generated stub:
    +  //      from:  R3
    +  //      to:    R4
    +  //      count: R5 byte count, treated as ssize_t, can be zero
    +  //
    +  // Examines the alignment of the operands and dispatches
    +  // to a long, int, short, or byte copy loop.
    +  //
    +  address generate_unsafe_copy(const char* name,
    +                               address byte_copy_entry,
    +                               address short_copy_entry,
    +                               address int_copy_entry,
    +                               address long_copy_entry) {
    +
    +    const Register R3_from   = R3_ARG1;      // source array address
    +    const Register R4_to     = R4_ARG2;      // destination array address
    +    const Register R5_count  = R5_ARG3;      // elements count (as long on PPC64)
    +
    +    const Register R6_bits   = R6_ARG4;      // test copy of low bits
    +    const Register R7_tmp    = R7_ARG5;
    +
    +    //__ align(CodeEntryAlignment);
    +    StubCodeMark mark(this, "StubRoutines", name);
    +    address start = __ function_entry();
    +
    +    // Bump this on entry, not on exit:
    +    //inc_counter_np(SharedRuntime::_unsafe_array_copy_ctr, R6_bits, R7_tmp);
    +
    +    Label short_copy, int_copy, long_copy;
    +
    +    __ orr(R6_bits, R3_from, R4_to);
    +    __ orr(R6_bits, R6_bits, R5_count);
    +    __ andi_(R0, R6_bits, (BytesPerLong-1));
    +    __ beq(CCR0, long_copy);
    +
    +    __ andi_(R0, R6_bits, (BytesPerInt-1));
    +    __ beq(CCR0, int_copy);
    +
    +    __ andi_(R0, R6_bits, (BytesPerShort-1));
    +    __ beq(CCR0, short_copy);
    +
    +    // byte_copy:
    +    __ b(byte_copy_entry);
    +
    +    __ bind(short_copy);
    +    __ srwi(R5_count, R5_count, LogBytesPerShort);
    +    __ b(short_copy_entry);
    +
    +    __ bind(int_copy);
    +    __ srwi(R5_count, R5_count, LogBytesPerInt);
    +    __ b(int_copy_entry);
    +
    +    __ bind(long_copy);
    +    __ srwi(R5_count, R5_count, LogBytesPerLong);
    +    __ b(long_copy_entry);
    +
    +    return start;
    +  }
    +
    +
    +  // Perform range checks on the proposed arraycopy.
    +  // Kills the two temps, but nothing else.
    +  // Also, clean the sign bits of src_pos and dst_pos.
    +  void arraycopy_range_checks(Register src,     // source array oop
    +                              Register src_pos, // source position
    +                              Register dst,     // destination array oop
    +                              Register dst_pos, // destination position
    +                              Register length,  // length of copy
    +                              Register temp1, Register temp2,
    +                              Label& L_failed) {
    +    BLOCK_COMMENT("arraycopy_range_checks:");
    +
    +    const Register array_length = temp1;  // scratch
    +    const Register end_pos      = temp2;  // scratch
    +
    +    //  if (src_pos + length > arrayOop(src)->length() ) FAIL;
    +    __ lwa(array_length, arrayOopDesc::length_offset_in_bytes(), src);
    +    __ add(end_pos, src_pos, length);  // src_pos + length
    +    __ cmpd(CCR0, end_pos, array_length);
    +    __ bgt(CCR0, L_failed);
    +
    +    //  if (dst_pos + length > arrayOop(dst)->length() ) FAIL;
    +    __ lwa(array_length, arrayOopDesc::length_offset_in_bytes(), dst);
    +    __ add(end_pos, dst_pos, length);  // src_pos + length
    +    __ cmpd(CCR0, end_pos, array_length);
    +    __ bgt(CCR0, L_failed);
    +
    +    BLOCK_COMMENT("arraycopy_range_checks done");
    +  }
    +
    +
    +  //
    +  //  Generate generic array copy stubs
    +  //
    +  //  Input:
    +  //    R3    -  src oop
    +  //    R4    -  src_pos
    +  //    R5    -  dst oop
    +  //    R6    -  dst_pos
    +  //    R7    -  element count
    +  //
    +  //  Output:
    +  //    R3 ==  0  -  success
    +  //    R3 == -1  -  need to call System.arraycopy
    +  //
    +  address generate_generic_copy(const char *name,
    +                                address entry_jbyte_arraycopy,
    +                                address entry_jshort_arraycopy,
    +                                address entry_jint_arraycopy,
    +                                address entry_oop_arraycopy,
    +                                address entry_disjoint_oop_arraycopy,
    +                                address entry_jlong_arraycopy,
    +                                address entry_checkcast_arraycopy) {
    +    Label L_failed, L_objArray;
    +
    +    // Input registers
    +    const Register src       = R3_ARG1;  // source array oop
    +    const Register src_pos   = R4_ARG2;  // source position
    +    const Register dst       = R5_ARG3;  // destination array oop
    +    const Register dst_pos   = R6_ARG4;  // destination position
    +    const Register length    = R7_ARG5;  // elements count
    +
    +    // registers used as temp
    +    const Register src_klass = R8_ARG6;  // source array klass
    +    const Register dst_klass = R9_ARG7;  // destination array klass
    +    const Register lh        = R10_ARG8; // layout handler
    +    const Register temp      = R2;
    +
    +    //__ align(CodeEntryAlignment);
    +    StubCodeMark mark(this, "StubRoutines", name);
    +    address start = __ function_entry();
    +
    +    // Bump this on entry, not on exit:
    +    //inc_counter_np(SharedRuntime::_generic_array_copy_ctr, lh, temp);
    +
    +    // In principle, the int arguments could be dirty.
    +
    +    //-----------------------------------------------------------------------
    +    // Assembler stubs will be used for this call to arraycopy
    +    // if the following conditions are met:
    +    //
    +    // (1) src and dst must not be null.
    +    // (2) src_pos must not be negative.
    +    // (3) dst_pos must not be negative.
    +    // (4) length  must not be negative.
    +    // (5) src klass and dst klass should be the same and not NULL.
    +    // (6) src and dst should be arrays.
    +    // (7) src_pos + length must not exceed length of src.
    +    // (8) dst_pos + length must not exceed length of dst.
    +    BLOCK_COMMENT("arraycopy initial argument checks");
    +
    +    __ cmpdi(CCR1, src, 0);      // if (src == NULL) return -1;
    +    __ extsw_(src_pos, src_pos); // if (src_pos < 0) return -1;
    +    __ cmpdi(CCR5, dst, 0);      // if (dst == NULL) return -1;
    +    __ cror(CCR1, Assembler::equal, CCR0, Assembler::less);
    +    __ extsw_(dst_pos, dst_pos); // if (src_pos < 0) return -1;
    +    __ cror(CCR5, Assembler::equal, CCR0, Assembler::less);
    +    __ extsw_(length, length);   // if (length < 0) return -1;
    +    __ cror(CCR1, Assembler::equal, CCR5, Assembler::equal);
    +    __ cror(CCR1, Assembler::equal, CCR0, Assembler::less);
    +    __ beq(CCR1, L_failed);
    +
    +    BLOCK_COMMENT("arraycopy argument klass checks");
    +    __ load_klass(src_klass, src);
    +    __ load_klass(dst_klass, dst);
    +
    +    // Load layout helper
    +    //
    +    //  |array_tag|     | header_size | element_type |     |log2_element_size|
    +    // 32        30    24            16              8     2                 0
    +    //
    +    //   array_tag: typeArray = 0x3, objArray = 0x2, non-array = 0x0
    +    //
    +
    +    int lh_offset = in_bytes(Klass::layout_helper_offset());
    +
    +    // Load 32-bits signed value. Use br() instruction with it to check icc.
    +    __ lwz(lh, lh_offset, src_klass);
    +
    +    // Handle objArrays completely differently...
    +    jint objArray_lh = Klass::array_layout_helper(T_OBJECT);
    +    __ load_const_optimized(temp, objArray_lh, R0);
    +    __ cmpw(CCR0, lh, temp);
    +    __ beq(CCR0, L_objArray);
    +
    +    __ cmpd(CCR5, src_klass, dst_klass);          // if (src->klass() != dst->klass()) return -1;
    +    __ cmpwi(CCR6, lh, Klass::_lh_neutral_value); // if (!src->is_Array()) return -1;
    +
    +    __ crnand(CCR5, Assembler::equal, CCR6, Assembler::less);
    +    __ beq(CCR5, L_failed);
    +
    +    // At this point, it is known to be a typeArray (array_tag 0x3).
    +#ifdef ASSERT
    +    { Label L;
    +      jint lh_prim_tag_in_place = (Klass::_lh_array_tag_type_value << Klass::_lh_array_tag_shift);
    +      __ load_const_optimized(temp, lh_prim_tag_in_place, R0);
    +      __ cmpw(CCR0, lh, temp);
    +      __ bge(CCR0, L);
    +      __ stop("must be a primitive array");
    +      __ bind(L);
    +    }
    +#endif
    +
    +    arraycopy_range_checks(src, src_pos, dst, dst_pos, length,
    +                           temp, dst_klass, L_failed);
    +
    +    // TypeArrayKlass
    +    //
    +    // src_addr = (src + array_header_in_bytes()) + (src_pos << log2elemsize);
    +    // dst_addr = (dst + array_header_in_bytes()) + (dst_pos << log2elemsize);
    +    //
    +
    +    const Register offset = dst_klass;    // array offset
    +    const Register elsize = src_klass;    // log2 element size
    +
    +    __ rldicl(offset, lh, 64 - Klass::_lh_header_size_shift, 64 - exact_log2(Klass::_lh_header_size_mask + 1));
    +    __ andi(elsize, lh, Klass::_lh_log2_element_size_mask);
    +    __ add(src, offset, src);       // src array offset
    +    __ add(dst, offset, dst);       // dst array offset
    +
    +    // Next registers should be set before the jump to corresponding stub.
    +    const Register from     = R3_ARG1;  // source array address
    +    const Register to       = R4_ARG2;  // destination array address
    +    const Register count    = R5_ARG3;  // elements count
    +
    +    // 'from', 'to', 'count' registers should be set in this order
    +    // since they are the same as 'src', 'src_pos', 'dst'.
    +
    +    BLOCK_COMMENT("scale indexes to element size");
    +    __ sld(src_pos, src_pos, elsize);
    +    __ sld(dst_pos, dst_pos, elsize);
    +    __ add(from, src_pos, src);  // src_addr
    +    __ add(to, dst_pos, dst);    // dst_addr
    +    __ mr(count, length);        // length
    +
    +    BLOCK_COMMENT("choose copy loop based on element size");
    +    // Using conditional branches with range 32kB.
    +    const int bo = Assembler::bcondCRbiIs1, bi = Assembler::bi0(CCR0, Assembler::equal);
    +    __ cmpwi(CCR0, elsize, 0);
    +    __ bc(bo, bi, entry_jbyte_arraycopy);
    +    __ cmpwi(CCR0, elsize, LogBytesPerShort);
    +    __ bc(bo, bi, entry_jshort_arraycopy);
    +    __ cmpwi(CCR0, elsize, LogBytesPerInt);
    +    __ bc(bo, bi, entry_jint_arraycopy);
    +#ifdef ASSERT
    +    { Label L;
    +      __ cmpwi(CCR0, elsize, LogBytesPerLong);
    +      __ beq(CCR0, L);
    +      __ stop("must be long copy, but elsize is wrong");
    +      __ bind(L);
    +    }
    +#endif
    +    __ b(entry_jlong_arraycopy);
    +
    +    // ObjArrayKlass
    +  __ bind(L_objArray);
    +    // live at this point:  src_klass, dst_klass, src[_pos], dst[_pos], length
    +
    +    Label L_disjoint_plain_copy, L_checkcast_copy;
    +    //  test array classes for subtyping
    +    __ cmpd(CCR0, src_klass, dst_klass);         // usual case is exact equality
    +    __ bne(CCR0, L_checkcast_copy);
    +
    +    // Identically typed arrays can be copied without element-wise checks.
    +    arraycopy_range_checks(src, src_pos, dst, dst_pos, length,
    +                           temp, lh, L_failed);
    +
    +    __ addi(src, src, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); //src offset
    +    __ addi(dst, dst, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); //dst offset
    +    __ sldi(src_pos, src_pos, LogBytesPerHeapOop);
    +    __ sldi(dst_pos, dst_pos, LogBytesPerHeapOop);
    +    __ add(from, src_pos, src);  // src_addr
    +    __ add(to, dst_pos, dst);    // dst_addr
    +    __ mr(count, length);        // length
    +    __ b(entry_oop_arraycopy);
    +
    +  __ bind(L_checkcast_copy);
    +    // live at this point:  src_klass, dst_klass
    +    {
    +      // Before looking at dst.length, make sure dst is also an objArray.
    +      __ lwz(temp, lh_offset, dst_klass);
    +      __ cmpw(CCR0, lh, temp);
    +      __ bne(CCR0, L_failed);
    +
    +      // It is safe to examine both src.length and dst.length.
    +      arraycopy_range_checks(src, src_pos, dst, dst_pos, length,
    +                             temp, lh, L_failed);
    +
    +      // Marshal the base address arguments now, freeing registers.
    +      __ addi(src, src, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); //src offset
    +      __ addi(dst, dst, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); //dst offset
    +      __ sldi(src_pos, src_pos, LogBytesPerHeapOop);
    +      __ sldi(dst_pos, dst_pos, LogBytesPerHeapOop);
    +      __ add(from, src_pos, src);  // src_addr
    +      __ add(to, dst_pos, dst);    // dst_addr
    +      __ mr(count, length);        // length
    +
    +      Register sco_temp = R6_ARG4;             // This register is free now.
    +      assert_different_registers(from, to, count, sco_temp,
    +                                 dst_klass, src_klass);
    +
    +      // Generate the type check.
    +      int sco_offset = in_bytes(Klass::super_check_offset_offset());
    +      __ lwz(sco_temp, sco_offset, dst_klass);
    +      generate_type_check(src_klass, sco_temp, dst_klass,
    +                          temp, L_disjoint_plain_copy);
    +
    +      // Fetch destination element klass from the ObjArrayKlass header.
    +      int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
    +
    +      // The checkcast_copy loop needs two extra arguments:
    +      __ ld(R7_ARG5, ek_offset, dst_klass);   // dest elem klass
    +      __ lwz(R6_ARG4, sco_offset, R7_ARG5);   // sco of elem klass
    +      __ b(entry_checkcast_arraycopy);
    +    }
    +
    +    __ bind(L_disjoint_plain_copy);
    +    __ b(entry_disjoint_oop_arraycopy);
    +
    +  __ bind(L_failed);
    +    __ li(R3_RET, -1); // return -1
    +    __ blr();
    +    return start;
    +  }
    +
    +
       void generate_arraycopy_stubs() {
         // Note: the disjoint stubs must be generated first, some of
         // the conjoint stubs use them.
    @@ -2005,6 +2433,24 @@ class StubGenerator: public StubCodeGenerator {
         StubRoutines::_arrayof_oop_arraycopy        = generate_conjoint_oop_copy(true, "arrayof_oop_arraycopy", false);
         StubRoutines::_arrayof_oop_arraycopy_uninit = generate_conjoint_oop_copy(true, "arrayof_oop_arraycopy", true);
     
    +    // special/generic versions
    +    StubRoutines::_checkcast_arraycopy        = generate_checkcast_copy("checkcast_arraycopy", false);
    +    StubRoutines::_checkcast_arraycopy_uninit = generate_checkcast_copy("checkcast_arraycopy_uninit", true);
    +
    +    StubRoutines::_unsafe_arraycopy  = generate_unsafe_copy("unsafe_arraycopy",
    +                                                            STUB_ENTRY(jbyte_arraycopy),
    +                                                            STUB_ENTRY(jshort_arraycopy),
    +                                                            STUB_ENTRY(jint_arraycopy),
    +                                                            STUB_ENTRY(jlong_arraycopy));
    +    StubRoutines::_generic_arraycopy = generate_generic_copy("generic_arraycopy",
    +                                                             STUB_ENTRY(jbyte_arraycopy),
    +                                                             STUB_ENTRY(jshort_arraycopy),
    +                                                             STUB_ENTRY(jint_arraycopy),
    +                                                             STUB_ENTRY(oop_arraycopy),
    +                                                             STUB_ENTRY(oop_disjoint_arraycopy),
    +                                                             STUB_ENTRY(jlong_arraycopy),
    +                                                             STUB_ENTRY(checkcast_arraycopy));
    +
         // fill routines
         StubRoutines::_jbyte_fill          = generate_fill(T_BYTE,  false, "jbyte_fill");
         StubRoutines::_jshort_fill         = generate_fill(T_SHORT, false, "jshort_fill");
    diff --git a/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp
    index 65239dd317d..1f49fe1de26 100644
    --- a/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp
    +++ b/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp
    @@ -34,7 +34,7 @@
     
     // CRC32 Intrinsics.
     void StubRoutines::ppc64::generate_load_crc_table_addr(MacroAssembler* masm, Register table) {
    -  __ load_const(table, StubRoutines::_crc_table_adr);
    +  __ load_const_optimized(table, StubRoutines::_crc_table_adr, R0);
     }
     
     // CRC32 Intrinsics.
    diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp
    index 361e637d253..4691f70f8eb 100644
    --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp
    @@ -255,34 +255,33 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label*
     
       if (TieredCompilation) {
         const int increment = InvocationCounter::count_increment;
    -    const int mask = ((1 << Tier0InvokeNotifyFreqLog) - 1) << InvocationCounter::count_shift;
         Label no_mdo;
         if (ProfileInterpreter) {
    -      const Register Rmdo = Rscratch1;
    +      const Register Rmdo = R3_counters;
           // If no method data exists, go to profile_continue.
           __ ld(Rmdo, in_bytes(Method::method_data_offset()), R19_method);
           __ 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);
    +      const int mdo_ic_offs = in_bytes(MethodData::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset());
    +      __ lwz(Rscratch2, mdo_ic_offs, Rmdo);
    +      __ lwz(Rscratch1, in_bytes(MethodData::invoke_mask_offset()), Rmdo);
           __ addi(Rscratch2, Rscratch2, increment);
    -      __ stw(Rscratch2, mdo_bc_offs, Rmdo);
    -      __ load_const_optimized(Rscratch1, mask, R0);
    +      __ stw(Rscratch2, mdo_ic_offs, Rmdo);
           __ and_(Rscratch1, Rscratch2, Rscratch1);
           __ bne(CCR0, done);
           __ b(*overflow);
         }
     
         // Increment counter in MethodCounters*.
    -    const int mo_bc_offs = in_bytes(MethodCounters::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset());
    +    const int mo_bc_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(Rscratch1, in_bytes(MethodCounters::invoke_mask_offset()), R3_counters);
         __ addi(Rscratch2, Rscratch2, increment);
         __ stw(Rscratch2, mo_bc_offs, R3_counters);
    -    __ load_const_optimized(Rscratch1, mask, R0);
         __ and_(Rscratch1, Rscratch2, Rscratch1);
         __ beq(CCR0, *overflow);
     
    @@ -303,8 +302,7 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label*
         // Check if we must create a method data obj.
         if (ProfileInterpreter && profile_method != NULL) {
           const Register profile_limit = Rscratch1;
    -      int pl_offs = __ load_const_optimized(profile_limit, &InvocationCounter::InterpreterProfileLimit, R0, true);
    -      __ lwz(profile_limit, pl_offs, profile_limit);
    +      __ lwz(profile_limit, in_bytes(MethodCounters::interpreter_profile_limit_offset()), R3_counters);
           // Test to see if we should create a method data oop.
           __ cmpw(CCR0, Rsum_ivc_bec, profile_limit);
           __ blt(CCR0, *profile_method_continue);
    @@ -314,9 +312,7 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label*
         // Finally check for counter overflow.
         if (overflow) {
           const Register invocation_limit = Rscratch1;
    -      int il_offs = __ load_const_optimized(invocation_limit, &InvocationCounter::InterpreterInvocationLimit, R0, true);
    -      __ lwz(invocation_limit, il_offs, invocation_limit);
    -      assert(4 == sizeof(InvocationCounter::InterpreterInvocationLimit), "unexpected field size");
    +      __ lwz(invocation_limit, in_bytes(MethodCounters::interpreter_invocation_limit_offset()), R3_counters);
           __ cmpw(CCR0, Rsum_ivc_bec, invocation_limit);
           __ bge(CCR0, *overflow);
         }
    @@ -1484,9 +1480,9 @@ void AbstractInterpreter::layout_activation(Method* method,
     
       intptr_t* locals_base  = (caller->is_interpreted_frame()) ?
         caller->interpreter_frame_esp() + caller_actual_parameters :
    -    caller->sp() + method->max_locals() - 1 + (frame::abi_minframe_size / Interpreter::stackElementSize) ;
    +    caller->sp() + method->max_locals() - 1 + (frame::abi_minframe_size / Interpreter::stackElementSize);
     
    -  intptr_t* monitor_base = caller->sp() - frame::ijava_state_size / Interpreter::stackElementSize ;
    +  intptr_t* monitor_base = caller->sp() - frame::ijava_state_size / Interpreter::stackElementSize;
       intptr_t* monitor      = monitor_base - (moncount * frame::interpreter_frame_monitor_size());
       intptr_t* esp_base     = monitor - 1;
       intptr_t* esp          = esp_base - tempcount - popframe_extra_args;
    diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp
    index 4450dd71897..c08e6d44cf7 100644
    --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp
    @@ -37,5 +37,3 @@
       const static int InterpreterCodeSize = 230*K;
     
     #endif // CPU_PPC_VM_TEMPLATEINTERPRETER_PPC_HPP
    -
    -
    diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
    index 0660726181c..4a1c44a4ce3 100644
    --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
    +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
    @@ -1626,12 +1626,13 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
       // --------------------------------------------------------------------------
       // Normal (non-jsr) branch handling
     
    +  // Bump bytecode pointer by displacement (take the branch).
    +  __ add(R14_bcp, Rdisp, R14_bcp); // Add to bc addr.
    +
       const bool increment_invocation_counter_for_backward_branches = UseCompiler && UseLoopCounter;
       if (increment_invocation_counter_for_backward_branches) {
    -    //__ unimplemented("branch invocation counter");
    -
         Label Lforward;
    -    __ add(R14_bcp, Rdisp, R14_bcp); // Add to bc addr.
    +    __ dispatch_prolog(vtos);
     
         // Check branch direction.
         __ cmpdi(CCR0, Rdisp, 0);
    @@ -1642,7 +1643,6 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
         if (TieredCompilation) {
           Label Lno_mdo, Loverflow;
           const int increment = InvocationCounter::count_increment;
    -      const int mask = ((1 << Tier0BackedgeNotifyFreqLog) - 1) << InvocationCounter::count_shift;
           if (ProfileInterpreter) {
             Register Rmdo = Rscratch1;
     
    @@ -1654,7 +1654,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
             // 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);
    -        __ load_const_optimized(Rscratch3, mask, R0);
    +        __ lwz(Rscratch3, in_bytes(MethodData::backedge_mask_offset()), Rmdo);
             __ addi(Rscratch2, Rscratch2, increment);
             __ stw(Rscratch2, mdo_bc_offs, Rmdo);
             __ and_(Rscratch3, Rscratch2, Rscratch3);
    @@ -1666,19 +1666,19 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
           const int mo_bc_offs = in_bytes(MethodCounters::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset());
           __ bind(Lno_mdo);
           __ lwz(Rscratch2, mo_bc_offs, R4_counters);
    -      __ load_const_optimized(Rscratch3, mask, R0);
    +      __ lwz(Rscratch3, in_bytes(MethodCounters::backedge_mask_offset()), R4_counters);
           __ addi(Rscratch2, Rscratch2, increment);
    -      __ stw(Rscratch2, mo_bc_offs, R19_method);
    +      __ stw(Rscratch2, mo_bc_offs, R4_counters);
           __ and_(Rscratch3, Rscratch2, Rscratch3);
           __ bne(CCR0, Lforward);
     
           __ bind(Loverflow);
     
           // Notify point for loop, pass branch bytecode.
    -      __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), R14_bcp, true);
    +      __ subf(R4_ARG2, Rdisp, R14_bcp); // Compute branch bytecode (previous bcp).
    +      __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), R4_ARG2, true);
     
           // Was an OSR adapter generated?
    -      // O0 = osr nmethod
           __ cmpdi(CCR0, R3_RET, 0);
           __ beq(CCR0, Lforward);
     
    @@ -1714,27 +1714,23 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
           __ increment_backedge_counter(R4_counters, invoke_ctr, Rscratch2, Rscratch3);
     
           if (ProfileInterpreter) {
    -        __ test_invocation_counter_for_mdp(invoke_ctr, Rscratch2, Lforward);
    +        __ test_invocation_counter_for_mdp(invoke_ctr, R4_counters, Rscratch2, Lforward);
             if (UseOnStackReplacement) {
    -          __ test_backedge_count_for_osr(bumped_count, R14_bcp, Rscratch2);
    +          __ test_backedge_count_for_osr(bumped_count, R4_counters, R14_bcp, Rdisp, Rscratch2);
             }
           } else {
             if (UseOnStackReplacement) {
    -          __ test_backedge_count_for_osr(invoke_ctr, R14_bcp, Rscratch2);
    +          __ test_backedge_count_for_osr(invoke_ctr, R4_counters, R14_bcp, Rdisp, Rscratch2);
             }
           }
         }
     
         __ bind(Lforward);
    +    __ dispatch_epilog(vtos);
     
       } else {
    -    // Bump bytecode pointer by displacement (take the branch).
    -    __ add(R14_bcp, Rdisp, R14_bcp); // Add to bc addr.
    +    __ dispatch_next(vtos);
       }
    -  // Continue with bytecode @ target.
    -  // %%%%% Like Intel, could speed things up by moving bytecode fetch to code above,
    -  // %%%%% and changing dispatch_next to dispatch_only.
    -  __ dispatch_next(vtos);
     }
     
     // Helper function for if_cmp* methods below.
    diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
    index 90bd9c2ad7a..774d90b5cf1 100644
    --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
    @@ -38,7 +38,6 @@
     # include 
     
     int VM_Version::_features = VM_Version::unknown_m;
    -int VM_Version::_measured_cache_line_size = 32; // pessimistic init value
     const char* VM_Version::_features_str = "";
     bool VM_Version::_is_determine_features_test_running = false;
     
    @@ -56,7 +55,7 @@ void VM_Version::initialize() {
     
       // If PowerArchitecturePPC64 hasn't been specified explicitly determine from features.
       if (FLAG_IS_DEFAULT(PowerArchitecturePPC64)) {
    -    if (VM_Version::has_lqarx()) {
    +    if (VM_Version::has_tcheck() && VM_Version::has_lqarx()) {
           FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 8);
         } else if (VM_Version::has_popcntw()) {
           FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 7);
    @@ -68,10 +67,19 @@ void VM_Version::initialize() {
           FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 0);
         }
       }
    -  guarantee(PowerArchitecturePPC64 == 0 || PowerArchitecturePPC64 == 5 ||
    -            PowerArchitecturePPC64 == 6 || PowerArchitecturePPC64 == 7 ||
    -            PowerArchitecturePPC64 == 8,
    -            "PowerArchitecturePPC64 should be 0, 5, 6, 7, or 8");
    +
    +  bool PowerArchitecturePPC64_ok = false;
    +  switch (PowerArchitecturePPC64) {
    +    case 8: if (!VM_Version::has_tcheck() ) break;
    +            if (!VM_Version::has_lqarx()  ) break;
    +    case 7: if (!VM_Version::has_popcntw()) break;
    +    case 6: if (!VM_Version::has_cmpb()   ) break;
    +    case 5: if (!VM_Version::has_popcntb()) break;
    +    case 0: PowerArchitecturePPC64_ok = true; break;
    +    default: break;
    +  }
    +  guarantee(PowerArchitecturePPC64_ok, "PowerArchitecturePPC64 cannot be set to "
    +            UINTX_FORMAT " on this machine", PowerArchitecturePPC64);
     
       // Power 8: Configure Data Stream Control Register.
       if (PowerArchitecturePPC64 >= 8) {
    @@ -132,9 +140,15 @@ void VM_Version::initialize() {
       // and 'atomic long memory ops' (see Unsafe_GetLongVolatile).
       _supports_cx8 = true;
     
    +  // Used by C1.
    +  _supports_atomic_getset4 = true;
    +  _supports_atomic_getadd4 = true;
    +  _supports_atomic_getset8 = true;
    +  _supports_atomic_getadd8 = true;
    +
       UseSSE = 0; // Only on x86 and x64
     
    -  intx cache_line_size = _measured_cache_line_size;
    +  intx cache_line_size = L1_data_cache_line_size();
     
       if (FLAG_IS_DEFAULT(AllocatePrefetchStyle)) AllocatePrefetchStyle = 1;
     
    @@ -261,11 +275,9 @@ void VM_Version::initialize() {
         }
       }
     
    -  // This machine does not allow unaligned memory accesses
    -  if (UseUnalignedAccesses) {
    -    if (!FLAG_IS_DEFAULT(UseUnalignedAccesses))
    -      warning("Unaligned memory access is not available on this CPU");
    -    FLAG_SET_DEFAULT(UseUnalignedAccesses, false);
    +  // This machine allows unaligned memory accesses
    +  if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
    +    FLAG_SET_DEFAULT(UseUnalignedAccesses, true);
       }
     }
     
    @@ -291,7 +303,7 @@ bool VM_Version::use_biased_locking() {
     }
     
     void VM_Version::print_features() {
    -  tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), (int) get_cache_line_size());
    +  tty->print_cr("Version: %s L1_data_cache_line_size=%d", cpu_features(), L1_data_cache_line_size());
     }
     
     #ifdef COMPILER2
    @@ -592,7 +604,7 @@ void VM_Version::determine_features() {
       int count = 0; // count zeroed bytes
       for (int i = 0; i < BUFFER_SIZE; i++) if (test_area[i] == 0) count++;
       guarantee(is_power_of_2(count), "cache line size needs to be a power of 2");
    -  _measured_cache_line_size = count;
    +  _L1_data_cache_line_size = count;
     
       // Execute code. Illegal instructions will be replaced by 0 in the signal handler.
       VM_Version::_is_determine_features_test_running = true;
    diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp
    index 6fc76e4cd41..d5f6dc6cc81 100644
    --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp
    @@ -65,7 +65,6 @@ protected:
         all_features_m        = -1
       };
       static int  _features;
    -  static int  _measured_cache_line_size;
       static const char* _features_str;
       static bool _is_determine_features_test_running;
     
    @@ -99,8 +98,6 @@ public:
     
       static const char* cpu_features() { return _features_str; }
     
    -  static int get_cache_line_size()  { return _measured_cache_line_size; }
    -
       // Assembler testing
       static void allow_all();
       static void revert();
    diff --git a/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp
    index 0165fb22e34..d19c211300f 100644
    --- a/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp
    +++ b/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp
    @@ -76,7 +76,8 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
     
       // We might implicit NULL fault here.
       address npe_addr = __ pc(); // npe = null pointer exception
    -  __ load_klass_with_trap_null_check(rcvr_klass, R3);
    +  __ null_check(R3, oopDesc::klass_offset_in_bytes(), /*implicit only*/NULL);
    +  __ load_klass(rcvr_klass, R3);
     
      // Set method (in case of interpreted method), and destination address.
       int entry_offset = InstanceKlass::vtable_start_offset() + vtable_index*vtableEntry::size();
    @@ -111,8 +112,8 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
     
       // If the vtable entry is null, the method is abstract.
       address ame_addr = __ pc(); // ame = abstract method error
    -
    -  __ load_with_trap_null_check(R12_scratch2, in_bytes(Method::from_compiled_offset()), R19_method);
    +  __ null_check(R19_method, in_bytes(Method::from_compiled_offset()), /*implicit only*/NULL);
    +  __ ld(R12_scratch2, in_bytes(Method::from_compiled_offset()), R19_method);
       __ mtctr(R12_scratch2);
       __ bctr();
       masm->flush();
    @@ -158,7 +159,8 @@ VtableStub* VtableStubs::create_itable_stub(int vtable_index) {
     
       // We might implicit NULL fault here.
       address npe_addr = __ pc(); // npe = null pointer exception
    -  __ load_klass_with_trap_null_check(rcvr_klass, R3_ARG1);
    +  __ null_check(R3_ARG1, oopDesc::klass_offset_in_bytes(), /*implicit only*/NULL);
    +  __ load_klass(rcvr_klass, R3_ARG1);
     
       BLOCK_COMMENT("Load start of itable entries into itable_entry.");
       __ lwz(vtable_len, InstanceKlass::vtable_length_offset() * wordSize, rcvr_klass);
    @@ -217,15 +219,7 @@ VtableStub* VtableStubs::create_itable_stub(int vtable_index) {
       address ame_addr = __ pc(); // ame = abstract method error
     
       // Must do an explicit check if implicit checks are disabled.
    -  assert(!MacroAssembler::needs_explicit_null_check(in_bytes(Method::from_compiled_offset())), "sanity");
    -  if (!ImplicitNullChecks || !os::zero_page_read_protected()) {
    -    if (TrapBasedNullChecks) {
    -      __ trap_null_check(R19_method);
    -    } else {
    -      __ cmpdi(CCR0, R19_method, 0);
    -      __ beq(CCR0, throw_icce);
    -    }
    -  }
    +  __ null_check(R19_method, in_bytes(Method::from_compiled_offset()), &throw_icce);
       __ ld(R12_scratch2, in_bytes(Method::from_compiled_offset()), R19_method);
       __ mtctr(R12_scratch2);
       __ bctr();
    diff --git a/hotspot/src/os/aix/vm/c1_globals_aix.hpp b/hotspot/src/os/aix/vm/c1_globals_aix.hpp
    new file mode 100644
    index 00000000000..45b57f71954
    --- /dev/null
    +++ b/hotspot/src/os/aix/vm/c1_globals_aix.hpp
    @@ -0,0 +1,37 @@
    +/*
    + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright 2012, 2015 SAP AG. 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.
    + *
    + */
    +
    +#ifndef OS_AIX_VM_C1_GLOBALS_AIX_HPP
    +#define OS_AIX_VM_C1_GLOBALS_AIX_HPP
    +
    +#include "utilities/globalDefinitions.hpp"
    +#include "utilities/macros.hpp"
    +
    +//
    +// Sets the default values for operating system dependent flags used by the
    +// client compiler. (see c1_globals.hpp)
    +//
    +
    +#endif // OS_AIX_VM_C1_GLOBALS_AIX_HPP
    
    From d60a09e9c5c58cb7c32e362b778008c625b16ab1 Mon Sep 17 00:00:00 2001
    From: Vladimir Ivanov 
    Date: Fri, 4 Dec 2015 23:46:19 +0300
    Subject: [PATCH 047/228] 8072008: Emit direct call instead of linkTo* for
     recursive indy/MH.invoke* calls
    
    Reviewed-by: jrose, dlong, aph, forax
    ---
     hotspot/src/cpu/aarch64/vm/aarch64.ad         |  20 +-
     .../cpu/aarch64/vm/macroAssembler_aarch64.cpp |   4 +-
     .../cpu/aarch64/vm/macroAssembler_aarch64.hpp |   2 +-
     hotspot/src/cpu/ppc/vm/ppc.ad                 |  10 +-
     hotspot/src/cpu/sparc/vm/assembler_sparc.hpp  |   2 +
     .../cpu/sparc/vm/assembler_sparc.inline.hpp   |   2 +
     .../src/cpu/sparc/vm/macroAssembler_sparc.cpp |   5 +-
     .../src/cpu/sparc/vm/macroAssembler_sparc.hpp |   6 +-
     .../sparc/vm/macroAssembler_sparc.inline.hpp  |  10 +-
     hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp |   5 +-
     hotspot/src/cpu/sparc/vm/sparc.ad             |  34 +--
     hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp |   4 +-
     hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp |   2 +-
     hotspot/src/cpu/x86/vm/x86_32.ad              |  19 +-
     hotspot/src/cpu/x86/vm/x86_64.ad              |  21 +-
     hotspot/src/share/vm/asm/codeBuffer.cpp       |  25 ++
     hotspot/src/share/vm/asm/codeBuffer.hpp       |   5 +-
     hotspot/src/share/vm/ci/ciMethod.hpp          |   6 +
     hotspot/src/share/vm/classfile/vmSymbols.hpp  |   5 +
     hotspot/src/share/vm/code/compiledIC.cpp      |   2 +-
     hotspot/src/share/vm/code/nmethod.cpp         |  84 ++++++-
     hotspot/src/share/vm/code/nmethod.hpp         |  11 +-
     hotspot/src/share/vm/code/relocInfo.cpp       |  61 ++++-
     hotspot/src/share/vm/code/relocInfo.hpp       |  54 +++--
     .../src/share/vm/interpreter/linkResolver.cpp |  27 +++
     .../src/share/vm/interpreter/linkResolver.hpp |   6 +
     hotspot/src/share/vm/opto/callGenerator.cpp   |  38 ++-
     hotspot/src/share/vm/opto/callGenerator.hpp   |   5 +-
     hotspot/src/share/vm/opto/callnode.cpp        |   3 +-
     hotspot/src/share/vm/opto/callnode.hpp        |  20 +-
     hotspot/src/share/vm/opto/doCall.cpp          |  96 ++++++++
     hotspot/src/share/vm/opto/library_call.cpp    |  14 ++
     hotspot/src/share/vm/opto/machnode.cpp        |   3 +-
     hotspot/src/share/vm/opto/machnode.hpp        |  22 +-
     hotspot/src/share/vm/opto/matcher.cpp         |   1 +
     hotspot/src/share/vm/prims/methodHandles.cpp  |  13 ++
     hotspot/src/share/vm/prims/methodHandles.hpp  |   6 +
     hotspot/src/share/vm/prims/whitebox.cpp       |   6 +
     .../src/share/vm/runtime/sharedRuntime.cpp    |  90 ++++++--
     .../src/share/vm/runtime/sharedRuntime.hpp    |   2 +
     .../src/share/vm/runtime/vm_operations.hpp    |   9 +
     .../compiler/jsr292/NonInlinedCall/Agent.java |  48 ++++
     .../jsr292/NonInlinedCall/GCTest.java         | 105 +++++++++
     .../jsr292/NonInlinedCall/InvokeTest.java     | 218 ++++++++++++++++++
     .../NonInlinedCall/NonInlinedReinvoker.java   |  48 ++++
     .../jsr292/NonInlinedCall/RedefineTest.java   | 157 +++++++++++++
     .../sanity/MismatchedWhiteBox/WhiteBox.java   |   2 +-
     47 files changed, 1190 insertions(+), 148 deletions(-)
     create mode 100644 hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java
     create mode 100644 hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java
     create mode 100644 hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java
     create mode 100644 hotspot/test/compiler/jsr292/NonInlinedCall/NonInlinedReinvoker.java
     create mode 100644 hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java
    
    diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad
    index afa30b74491..75b598e902c 100644
    --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad
    +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad
    @@ -4667,17 +4667,12 @@ encode %{
         if (!_method) {
           // A call to a runtime wrapper, e.g. new, new_typeArray_Java, uncommon_trap.
           call = __ trampoline_call(Address(addr, relocInfo::runtime_call_type), &cbuf);
    -    } else if (_optimized_virtual) {
    -      call = __ trampoline_call(Address(addr, relocInfo::opt_virtual_call_type), &cbuf);
         } else {
    -      call = __ trampoline_call(Address(addr, relocInfo::static_call_type), &cbuf);
    -    }
    -    if (call == NULL) {
    -      ciEnv::current()->record_failure("CodeCache is full");
    -      return;
    -    }
    +      int method_index = resolved_method_index(cbuf);
    +      RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index)
    +                                                  : static_call_Relocation::spec(method_index);
    +      call = __ trampoline_call(Address(addr, rspec), &cbuf);
     
    -    if (_method) {
           // Emit stub for static call
           address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
           if (stub == NULL) {
    @@ -4685,11 +4680,16 @@ encode %{
             return;
           }
         }
    +    if (call == NULL) {
    +      ciEnv::current()->record_failure("CodeCache is full");
    +      return;
    +    }
       %}
     
       enc_class aarch64_enc_java_dynamic_call(method meth) %{
         MacroAssembler _masm(&cbuf);
    -    address call = __ ic_call((address)$meth$$method);
    +    int method_index = resolved_method_index(cbuf);
    +    address call = __ ic_call((address)$meth$$method, method_index);
         if (call == NULL) {
           ciEnv::current()->record_failure("CodeCache is full");
           return;
    diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
    index c9608bc7492..8fed72e1313 100644
    --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
    +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
    @@ -732,8 +732,8 @@ address MacroAssembler::emit_trampoline_stub(int insts_call_instruction_offset,
       return stub;
     }
     
    -address MacroAssembler::ic_call(address entry) {
    -  RelocationHolder rh = virtual_call_Relocation::spec(pc());
    +address MacroAssembler::ic_call(address entry, jint method_index) {
    +  RelocationHolder rh = virtual_call_Relocation::spec(pc(), method_index);
       // address const_ptr = long_constant((jlong)Universe::non_oop_word());
       // unsigned long offset;
       // ldr_constant(rscratch2, const_ptr);
    diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
    index 4c4e79b8629..54c608fada0 100644
    --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
    +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
    @@ -983,7 +983,7 @@ public:
       }
     
       // Emit the CompiledIC call idiom
    -  address ic_call(address entry);
    +  address ic_call(address entry, jint method_index = 0);
     
     public:
     
    diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad
    index aefdf28133f..615f74eecf9 100644
    --- a/hotspot/src/cpu/ppc/vm/ppc.ad
    +++ b/hotspot/src/cpu/ppc/vm/ppc.ad
    @@ -3396,11 +3396,13 @@ encode %{
             }
             const int     entry_point_toc_offset = __ offset_to_method_toc(entry_point_toc_addr);
     
    +
             // Emit the trampoline stub which will be related to the branch-and-link below.
             CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, start_offset);
             if (ciEnv::current()->failing()) { return; } // Code cache may be full.
    -        __ relocate(_optimized_virtual ?
    -                    relocInfo::opt_virtual_call_type : relocInfo::static_call_type);
    +        int method_index = resolved_method_index(cbuf);
    +        __ relocate(_optimized_virtual ? opt_virtual_call_Relocate::spec(method_index)
    +                                       : static_call_Relocate::spec(method_index));
           }
     
           // The real call.
    @@ -3450,8 +3452,8 @@ encode %{
           const address virtual_call_oop_addr = __ addr_at(virtual_call_oop_addr_offset);
           assert(MacroAssembler::is_load_const_from_method_toc_at(virtual_call_oop_addr),
                  "should be load from TOC");
    -
    -      __ relocate(virtual_call_Relocation::spec(virtual_call_oop_addr));
    +      int method_index = resolved_method_index(cbuf);
    +      __ relocate(virtual_call_Relocation::spec(virtual_call_oop_addr, method_index));
         }
     
         // At this point I do not have the address of the trampoline stub,
    diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
    index e2ef96c727c..7c9c86a1466 100644
    --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
    +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
    @@ -816,6 +816,8 @@ public:
       inline void call( address d,  relocInfo::relocType rt = relocInfo::runtime_call_type );
       inline void call( Label& L,   relocInfo::relocType rt = relocInfo::runtime_call_type );
     
    +  inline void call( address d,  RelocationHolder const& rspec );
    +
      public:
     
       // pp 150
    diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
    index 2bbf95e3b61..197e26fa6f8 100644
    --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
    +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
    @@ -76,6 +76,8 @@ inline void Assembler::cbcond(Condition c, CC cc, Register s1, int simm5, Label&
     inline void Assembler::call( address d,  relocInfo::relocType rt ) { insert_nop_after_cbcond(); cti();  emit_data( op(call_op) | wdisp(intptr_t(d), intptr_t(pc()), 30), rt);  has_delay_slot(); assert(rt != relocInfo::virtual_call_type, "must use virtual_call_Relocation::spec"); }
     inline void Assembler::call( Label& L,   relocInfo::relocType rt ) { insert_nop_after_cbcond(); call( target(L), rt); }
     
    +inline void Assembler::call( address d,  RelocationHolder const& rspec ) { insert_nop_after_cbcond(); cti();  emit_data( op(call_op) | wdisp(intptr_t(d), intptr_t(pc()), 30), rspec);  has_delay_slot(); assert(rspec.type() != relocInfo::virtual_call_type, "must use virtual_call_Relocation::spec"); }
    +
     inline void Assembler::flush( Register s1, Register s2) { emit_int32( op(arith_op) | op3(flush_op3) | rs1(s1) | rs2(s2)); }
     inline void Assembler::flush( Register s1, int simm13a) { emit_data( op(arith_op) | op3(flush_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
     
    diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp
    index 59b5b41a0d8..0c4fc97cc6b 100644
    --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp
    +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp
    @@ -770,8 +770,8 @@ void MacroAssembler::set_vm_result(Register oop_result) {
     }
     
     
    -void MacroAssembler::ic_call(address entry, bool emit_delay) {
    -  RelocationHolder rspec = virtual_call_Relocation::spec(pc());
    +void MacroAssembler::ic_call(address entry, bool emit_delay, jint method_index) {
    +  RelocationHolder rspec = virtual_call_Relocation::spec(pc(), method_index);
       patchable_set((intptr_t)Universe::non_oop_word(), G5_inline_cache_reg);
       relocate(rspec);
       call(entry, relocInfo::none);
    @@ -780,7 +780,6 @@ void MacroAssembler::ic_call(address entry, bool emit_delay) {
       }
     }
     
    -
     void MacroAssembler::card_table_write(jbyte* byte_map_base,
                                           Register tmp, Register obj) {
     #ifdef _LP64
    diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp
    index d58fc54f1c9..b9e34133328 100644
    --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp
    +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp
    @@ -729,7 +729,11 @@ class MacroAssembler : public Assembler {
       // Check if the call target is out of wdisp30 range (relative to the code cache)
       static inline bool is_far_target(address d);
       inline void call( address d,  relocInfo::relocType rt = relocInfo::runtime_call_type );
    +  inline void call( address d,  RelocationHolder const& rspec);
    +
       inline void call( Label& L,   relocInfo::relocType rt = relocInfo::runtime_call_type );
    +  inline void call( Label& L,  RelocationHolder const& rspec);
    +
       inline void callr( Register s1, Register s2 );
       inline void callr( Register s1, int simm13a, RelocationHolder const& rspec = RelocationHolder() );
     
    @@ -1146,7 +1150,7 @@ public:
       void set_vm_result(Register oop_result);
     
       // Emit the CompiledIC call idiom
    -  void ic_call(address entry, bool emit_delay = true);
    +  void ic_call(address entry, bool emit_delay = true, jint method_index = 0);
     
       // if call_VM_base was called with check_exceptions=false, then call
       // check_and_forward_exception to handle exceptions when it is safe
    diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp
    index 3518d0b6336..4dd8772e010 100644
    --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp
    +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp
    @@ -298,6 +298,10 @@ inline bool MacroAssembler::is_far_target(address d) {
     // expense of relocation and if we overflow the displacement
     // of the quick call instruction.
     inline void MacroAssembler::call( address d, relocInfo::relocType rt ) {
    +  MacroAssembler::call(d, Relocation::spec_simple(rt));
    +}
    +
    +inline void MacroAssembler::call( address d, RelocationHolder const& rspec ) {
     #ifdef _LP64
       intptr_t disp;
       // NULL is ok because it will be relocated later.
    @@ -309,14 +313,14 @@ inline void MacroAssembler::call( address d, relocInfo::relocType rt ) {
       // Is this address within range of the call instruction?
       // If not, use the expensive instruction sequence
       if (is_far_target(d)) {
    -    relocate(rt);
    +    relocate(rspec);
         AddressLiteral dest(d);
         jumpl_to(dest, O7, O7);
       } else {
    -    Assembler::call(d, rt);
    +    Assembler::call(d, rspec);
       }
     #else
    -  Assembler::call( d, rt );
    +  Assembler::call( d, rspec );
     #endif
     }
     
    diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp
    index 3342f51388e..f08eb5be2f2 100644
    --- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp
    +++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp
    @@ -131,8 +131,9 @@ bool NativeInstruction::is_load_store_with_small_offset(Register reg) {
     void NativeCall::verify() {
       NativeInstruction::verify();
       // make sure code pattern is actually a call instruction
    -  if (!is_op(long_at(0), Assembler::call_op)) {
    -    fatal("not a call");
    +  int x = long_at(0);
    +  if (!is_op(x, Assembler::call_op)) {
    +    fatal("not a call: 0x%x @ " INTPTR_FORMAT, x, p2i(instruction_address()));
       }
     }
     
    diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad
    index 15526706f78..510a6a5b156 100644
    --- a/hotspot/src/cpu/sparc/vm/sparc.ad
    +++ b/hotspot/src/cpu/sparc/vm/sparc.ad
    @@ -1001,7 +1001,7 @@ void emit_form3_mem_reg(CodeBuffer &cbuf, PhaseRegAlloc* ra, const MachNode* n,
     #endif
     }
     
    -void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocType rtype, bool preserve_g2 = false) {
    +void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, RelocationHolder const& rspec, bool preserve_g2 = false) {
       // The method which records debug information at every safepoint
       // expects the call to be the first instruction in the snippet as
       // it creates a PcDesc structure which tracks the offset of a call
    @@ -1023,7 +1023,7 @@ void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocTyp
       int startpos = __ offset();
     #endif /* ASSERT */
     
    -  __ call((address)entry_point, rtype);
    +  __ call((address)entry_point, rspec);
     
       if (preserve_g2)   __ delayed()->mov(G2, L7);
       else __ delayed()->nop();
    @@ -2593,8 +2593,7 @@ encode %{
       enc_class Java_To_Runtime (method meth) %{    // CALL Java_To_Runtime
         // CALL directly to the runtime
         // The user of this is responsible for ensuring that R_L7 is empty (killed).
    -    emit_call_reloc(cbuf, $meth$$method, relocInfo::runtime_call_type,
    -                    /*preserve_g2=*/true);
    +    emit_call_reloc(cbuf, $meth$$method, runtime_call_Relocation::spec(), /*preserve_g2=*/true);
       %}
     
       enc_class preserve_SP %{
    @@ -2611,13 +2610,14 @@ encode %{
         // CALL to fixup routine.  Fixup routine uses ScopeDesc info to determine
         // who we intended to call.
         if (!_method) {
    -      emit_call_reloc(cbuf, $meth$$method, relocInfo::runtime_call_type);
    -    } else if (_optimized_virtual) {
    -      emit_call_reloc(cbuf, $meth$$method, relocInfo::opt_virtual_call_type);
    +      emit_call_reloc(cbuf, $meth$$method, runtime_call_Relocation::spec());
         } else {
    -      emit_call_reloc(cbuf, $meth$$method, relocInfo::static_call_type);
    -    }
    -    if (_method) {  // Emit stub for static call.
    +      int method_index = resolved_method_index(cbuf);
    +      RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index)
    +                                                  : static_call_Relocation::spec(method_index);
    +      emit_call_reloc(cbuf, $meth$$method, rspec);
    +
    +      // Emit stub for static call.
           address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
           // Stub does not fit into scratch buffer if TraceJumps is enabled
           if (stub == NULL && !(TraceJumps && Compile::current()->in_scratch_emit_size())) {
    @@ -2638,7 +2638,7 @@ encode %{
           Register G5_ic_reg = reg_to_register_object(Matcher::inline_cache_reg_encode());
           assert(G5_ic_reg == G5_inline_cache_reg, "G5_inline_cache_reg used in assemble_ic_buffer_code()");
           assert(G5_ic_reg == G5_megamorphic_method, "G5_megamorphic_method used in megamorphic call stub");
    -      __ ic_call((address)$meth$$method);
    +      __ ic_call((address)$meth$$method, /*emit_delay=*/true, resolved_method_index(cbuf));
         } else {
           assert(!UseInlineCaches, "expect vtable calls only if not using ICs");
           // Just go thru the vtable
    @@ -10069,10 +10069,10 @@ instruct string_compareL(o0RegP str1, o1RegP str2, g3RegI cnt1, g4RegI cnt2, not
       format %{ "String Compare byte[] $str1,$cnt1,$str2,$cnt2 -> $result   // KILL $tmp" %}
       ins_encode %{
         __ string_compare($str1$$Register, $str2$$Register,
    -                      $cnt1$$Register, $cnt2$$Register, 
    +                      $cnt1$$Register, $cnt2$$Register,
                           $tmp$$Register, $tmp$$Register,
                           $result$$Register, StrIntrinsicNode::LL);
    -  %}                    
    +  %}
       ins_pipe(long_memory_op);
     %}
     
    @@ -10088,7 +10088,7 @@ instruct string_compareU(o0RegP str1, o1RegP str2, g3RegI cnt1, g4RegI cnt2, not
                           $cnt1$$Register, $cnt2$$Register,
                           $tmp$$Register, $tmp$$Register,
                           $result$$Register, StrIntrinsicNode::UU);
    -  %}                    
    +  %}
       ins_pipe(long_memory_op);
     %}
     
    @@ -10104,7 +10104,7 @@ instruct string_compareLU(o0RegP str1, o1RegP str2, g3RegI cnt1, g4RegI cnt2, no
                           $cnt1$$Register, $cnt2$$Register,
                           $tmp1$$Register, $tmp2$$Register,
                           $result$$Register, StrIntrinsicNode::LU);
    -  %}                    
    +  %}
       ins_pipe(long_memory_op);
     %}
     
    @@ -10117,10 +10117,10 @@ instruct string_compareUL(o0RegP str1, o1RegP str2, g3RegI cnt1, g4RegI cnt2, no
       format %{ "String Compare byte[] $str1,$cnt1,$str2,$cnt2 -> $result   // KILL $tmp1,$tmp2" %}
       ins_encode %{
         __ string_compare($str2$$Register, $str1$$Register,
    -                      $cnt2$$Register, $cnt1$$Register, 
    +                      $cnt2$$Register, $cnt1$$Register,
                           $tmp1$$Register, $tmp2$$Register,
                           $result$$Register, StrIntrinsicNode::UL);
    -  %}                    
    +  %}
       ins_pipe(long_memory_op);
     %}
     
    diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
    index 21646e1bc0d..69a0d562df1 100644
    --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
    +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
    @@ -2260,8 +2260,8 @@ void MacroAssembler::call(AddressLiteral entry) {
       }
     }
     
    -void MacroAssembler::ic_call(address entry) {
    -  RelocationHolder rh = virtual_call_Relocation::spec(pc());
    +void MacroAssembler::ic_call(address entry, jint method_index) {
    +  RelocationHolder rh = virtual_call_Relocation::spec(pc(), method_index);
       movptr(rax, (intptr_t)Universe::non_oop_word());
       call(AddressLiteral(entry, rh));
     }
    diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp
    index b4e440f4383..e29d80b12bb 100644
    --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp
    +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp
    @@ -850,7 +850,7 @@ class MacroAssembler: public Assembler {
       void call(AddressLiteral entry);
     
       // Emit the CompiledIC call idiom
    -  void ic_call(address entry);
    +  void ic_call(address entry, jint method_index = 0);
     
       // Jumps
     
    diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad
    index 1f38927626c..0383a0aa56d 100644
    --- a/hotspot/src/cpu/x86/vm/x86_32.ad
    +++ b/hotspot/src/cpu/x86/vm/x86_32.ad
    @@ -1898,17 +1898,18 @@ encode %{
         // who we intended to call.
         cbuf.set_insts_mark();
         $$$emit8$primary;
    +
         if (!_method) {
           emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4),
    -                     runtime_call_Relocation::spec(), RELOC_IMM32 );
    -    } else if (_optimized_virtual) {
    -      emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4),
    -                     opt_virtual_call_Relocation::spec(), RELOC_IMM32 );
    +                     runtime_call_Relocation::spec(),
    +                     RELOC_IMM32);
         } else {
    +      int method_index = resolved_method_index(cbuf);
    +      RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index)
    +                                                  : static_call_Relocation::spec(method_index);
           emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4),
    -                     static_call_Relocation::spec(), RELOC_IMM32 );
    -    }
    -    if (_method) {  // Emit stub for static call.
    +                     rspec, RELOC_DISP32);
    +      // Emit stubs for static call.
           address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
           if (stub == NULL) {
             ciEnv::current()->record_failure("CodeCache is full");
    @@ -1919,7 +1920,7 @@ encode %{
     
       enc_class Java_Dynamic_Call (method meth) %{    // JAVA DYNAMIC CALL
         MacroAssembler _masm(&cbuf);
    -    __ ic_call((address)$meth$$method);
    +    __ ic_call((address)$meth$$method, resolved_method_index(cbuf));
       %}
     
       enc_class Java_Compiled_Call (method meth) %{    // JAVA COMPILED CALL
    @@ -11504,7 +11505,7 @@ instruct string_equals(eDIRegP str1, eSIRegP str2, eCXRegI cnt, eAXRegI result,
         __ arrays_equals(false, $str1$$Register, $str2$$Register,
                          $cnt$$Register, $result$$Register, $tmp3$$Register,
                          $tmp1$$XMMRegister, $tmp2$$XMMRegister, false /* char */);
    -  %} 
    +  %}
     
       ins_pipe( pipe_slow );
     %}
    diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad
    index 9b4f9f9ebce..9fac082c788 100644
    --- a/hotspot/src/cpu/x86/vm/x86_64.ad
    +++ b/hotspot/src/cpu/x86/vm/x86_64.ad
    @@ -2120,22 +2120,15 @@ encode %{
         $$$emit8$primary;
     
         if (!_method) {
    -      emit_d32_reloc(cbuf,
    -                     (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4),
    +      emit_d32_reloc(cbuf, (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4),
                          runtime_call_Relocation::spec(),
                          RELOC_DISP32);
    -    } else if (_optimized_virtual) {
    -      emit_d32_reloc(cbuf,
    -                     (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4),
    -                     opt_virtual_call_Relocation::spec(),
    -                     RELOC_DISP32);
         } else {
    -      emit_d32_reloc(cbuf,
    -                     (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4),
    -                     static_call_Relocation::spec(),
    -                     RELOC_DISP32);
    -    }
    -    if (_method) {
    +      int method_index = resolved_method_index(cbuf);
    +      RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index)
    +                                                  : static_call_Relocation::spec(method_index);
    +      emit_d32_reloc(cbuf, (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4),
    +                     rspec, RELOC_DISP32);
           // Emit stubs for static call.
           address mark = cbuf.insts_mark();
           address stub = CompiledStaticCall::emit_to_interp_stub(cbuf, mark);
    @@ -2148,7 +2141,7 @@ encode %{
     
       enc_class Java_Dynamic_Call(method meth) %{
         MacroAssembler _masm(&cbuf);
    -    __ ic_call((address)$meth$$method);
    +    __ ic_call((address)$meth$$method, resolved_method_index(cbuf));
       %}
     
       enc_class Java_Compiled_Call(method meth)
    diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp
    index 4ffcf0c81a2..30828b69751 100644
    --- a/hotspot/src/share/vm/asm/codeBuffer.cpp
    +++ b/hotspot/src/share/vm/asm/codeBuffer.cpp
    @@ -305,6 +305,31 @@ address CodeSection::target(Label& L, address branch_pc) {
       }
     }
     
    +void CodeSection::relocate(address at, relocInfo::relocType rtype, int format, jint method_index) {
    +  RelocationHolder rh;
    +  switch (rtype) {
    +    case relocInfo::none: return;
    +    case relocInfo::opt_virtual_call_type: {
    +      rh = opt_virtual_call_Relocation::spec(method_index);
    +      break;
    +    }
    +    case relocInfo::static_call_type: {
    +      rh = static_call_Relocation::spec(method_index);
    +      break;
    +    }
    +    case relocInfo::virtual_call_type: {
    +      assert(method_index == 0, "resolved method overriding is not supported");
    +      rh = Relocation::spec_simple(rtype);
    +      break;
    +    }
    +    default: {
    +      rh = Relocation::spec_simple(rtype);
    +      break;
    +    }
    +  }
    +  relocate(at, rh, format);
    +}
    +
     void CodeSection::relocate(address at, RelocationHolder const& spec, int format) {
       Relocation* reloc = spec.reloc();
       relocInfo::relocType rtype = (relocInfo::relocType) reloc->type();
    diff --git a/hotspot/src/share/vm/asm/codeBuffer.hpp b/hotspot/src/share/vm/asm/codeBuffer.hpp
    index 387a5b7cced..534a81f0631 100644
    --- a/hotspot/src/share/vm/asm/codeBuffer.hpp
    +++ b/hotspot/src/share/vm/asm/codeBuffer.hpp
    @@ -209,10 +209,7 @@ class CodeSection VALUE_OBJ_CLASS_SPEC {
     
       // Emit a relocation.
       void relocate(address at, RelocationHolder const& rspec, int format = 0);
    -  void relocate(address at,    relocInfo::relocType rtype, int format = 0) {
    -    if (rtype != relocInfo::none)
    -      relocate(at, Relocation::spec_simple(rtype), format);
    -  }
    +  void relocate(address at,    relocInfo::relocType rtype, int format = 0, jint method_index = 0);
     
       // alignment requirement for starting offset
       // Requirements are that the instruction area and the
    diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp
    index 5b19e95d39f..65edcc30ab5 100644
    --- a/hotspot/src/share/vm/ci/ciMethod.hpp
    +++ b/hotspot/src/share/vm/ci/ciMethod.hpp
    @@ -250,6 +250,12 @@ class ciMethod : public ciMetadata {
     
       ciField*      get_field_at_bci( int bci, bool &will_link);
       ciMethod*     get_method_at_bci(int bci, bool &will_link, ciSignature* *declared_signature);
    +  ciMethod*     get_method_at_bci(int bci) {
    +    bool ignored_will_link;
    +    ciSignature* ignored_declared_signature;
    +    return get_method_at_bci(bci, ignored_will_link, &ignored_declared_signature);
    +  }
    +
       // Given a certain calling environment, find the monomorphic target
       // for the call.  Return NULL if the call is not monomorphic in
       // its calling environment.
    diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp
    index df477a8462f..e651ad00ed9 100644
    --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp
    +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp
    @@ -1054,6 +1054,11 @@
        do_name(     isCompileConstant_name,                          "isCompileConstant")                                   \
        do_alias(    isCompileConstant_signature,                      object_boolean_signature)                             \
                                                                                                                             \
    +  do_class(sun_hotspot_WhiteBox,                                 "sun/hotspot/WhiteBox")                                \
    +  do_intrinsic(_deoptimize,          sun_hotspot_WhiteBox,        deoptimize_name, deoptimize_signature, F_R)           \
    +   do_name(     deoptimize_name,                                 "deoptimize")                                          \
    +   do_alias(    deoptimize_signature,                             void_method_signature)                                \
    +                                                                                                                        \
       /* unsafe memory references (there are a lot of them...) */                                                           \
       do_signature(getObject_signature,       "(Ljava/lang/Object;J)Ljava/lang/Object;")                                    \
       do_signature(putObject_signature,       "(Ljava/lang/Object;JLjava/lang/Object;)V")                                   \
    diff --git a/hotspot/src/share/vm/code/compiledIC.cpp b/hotspot/src/share/vm/code/compiledIC.cpp
    index ec3e3a8e072..b2dde314f54 100644
    --- a/hotspot/src/share/vm/code/compiledIC.cpp
    +++ b/hotspot/src/share/vm/code/compiledIC.cpp
    @@ -434,7 +434,7 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
           InlineCacheBuffer::create_transition_stub(this, info.cached_metadata(), info.entry());
         } else {
           if (is_optimized()) {
    -      set_ic_destination(info.entry());
    +        set_ic_destination(info.entry());
           } else {
             set_ic_destination_and_value(info.entry(), info.cached_metadata());
           }
    diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp
    index 307f0f71b98..d8af2c0624b 100644
    --- a/hotspot/src/share/vm/code/nmethod.cpp
    +++ b/hotspot/src/share/vm/code/nmethod.cpp
    @@ -978,19 +978,23 @@ void nmethod::print_nmethod(bool printmethod) {
           oop_maps()->print();
         }
       }
    -  if (PrintDebugInfo || CompilerOracle::has_option_string(_method, "PrintDebugInfo")) {
    +  if (printmethod || PrintDebugInfo || CompilerOracle::has_option_string(_method, "PrintDebugInfo")) {
         print_scopes();
       }
    -  if (PrintRelocations || CompilerOracle::has_option_string(_method, "PrintRelocations")) {
    +  if (printmethod || PrintRelocations || CompilerOracle::has_option_string(_method, "PrintRelocations")) {
         print_relocations();
       }
    -  if (PrintDependencies || CompilerOracle::has_option_string(_method, "PrintDependencies")) {
    +  if (printmethod || PrintDependencies || CompilerOracle::has_option_string(_method, "PrintDependencies")) {
         print_dependencies();
       }
    -  if (PrintExceptionHandlers) {
    +  if (printmethod || PrintExceptionHandlers) {
         print_handler_table();
         print_nul_chk_table();
       }
    +  if (printmethod) {
    +    print_recorded_oops();
    +    print_recorded_metadata();
    +  }
       if (xtty != NULL) {
         xtty->tail("print_nmethod");
       }
    @@ -3013,6 +3017,26 @@ void nmethod::print_pcs() {
       }
     }
     
    +void nmethod::print_recorded_oops() {
    +  tty->print_cr("Recorded oops:");
    +  for (int i = 0; i < oops_count(); i++) {
    +    oop o = oop_at(i);
    +    tty->print("#%3d: " INTPTR_FORMAT " ", i, p2i(o));
    +    o->print_value();
    +    tty->cr();
    +  }
    +}
    +
    +void nmethod::print_recorded_metadata() {
    +  tty->print_cr("Recorded metadata:");
    +  for (int i = 0; i < metadata_count(); i++) {
    +    Metadata* m = metadata_at(i);
    +    tty->print("#%3d: " INTPTR_FORMAT " ", i, p2i(m));
    +    m->print_value_on_maybe_null(tty);
    +    tty->cr();
    +  }
    +}
    +
     #endif // PRODUCT
     
     const char* nmethod::reloc_string_for(u_char* begin, u_char* end) {
    @@ -3053,9 +3077,39 @@ const char* nmethod::reloc_string_for(u_char* begin, u_char* end) {
               }
               return st.as_string();
             }
    -        case relocInfo::virtual_call_type:     return "virtual_call";
    -        case relocInfo::opt_virtual_call_type: return "optimized virtual_call";
    -        case relocInfo::static_call_type:      return "static_call";
    +        case relocInfo::virtual_call_type: {
    +          stringStream st;
    +          st.print_raw("virtual_call");
    +          virtual_call_Relocation* r = iter.virtual_call_reloc();
    +          Method* m = r->method_value();
    +          if (m != NULL) {
    +            assert(m->is_method(), "");
    +            m->print_short_name(&st);
    +          }
    +          return st.as_string();
    +        }
    +        case relocInfo::opt_virtual_call_type: {
    +          stringStream st;
    +          st.print_raw("optimized virtual_call");
    +          opt_virtual_call_Relocation* r = iter.opt_virtual_call_reloc();
    +          Method* m = r->method_value();
    +          if (m != NULL) {
    +            assert(m->is_method(), "");
    +            m->print_short_name(&st);
    +          }
    +          return st.as_string();
    +        }
    +        case relocInfo::static_call_type: {
    +          stringStream st;
    +          st.print_raw("static_call");
    +          static_call_Relocation* r = iter.static_call_reloc();
    +          Method* m = r->method_value();
    +          if (m != NULL) {
    +            assert(m->is_method(), "");
    +            m->print_short_name(&st);
    +          }
    +          return st.as_string();
    +        }
             case relocInfo::static_stub_type:      return "static_stub";
             case relocInfo::external_word_type:    return "external_word";
             case relocInfo::internal_word_type:    return "internal_word";
    @@ -3393,3 +3447,19 @@ char* nmethod::jvmci_installed_code_name(char* buf, size_t buflen) {
       return buf;
     }
     #endif
    +
    +Method* nmethod::attached_method(address call_instr) {
    +  assert(code_contains(call_instr), "not part of the nmethod");
    +  RelocIterator iter(this, call_instr, call_instr + 1);
    +  while (iter.next()) {
    +    if (iter.addr() == call_instr) {
    +      switch(iter.type()) {
    +        case relocInfo::static_call_type:      return iter.static_call_reloc()->method_value();
    +        case relocInfo::opt_virtual_call_type: return iter.opt_virtual_call_reloc()->method_value();
    +        case relocInfo::virtual_call_type:     return iter.virtual_call_reloc()->method_value();
    +      }
    +    }
    +  }
    +  return NULL; // not found
    +}
    +
    diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp
    index 6134378aac0..3f72547d518 100644
    --- a/hotspot/src/share/vm/code/nmethod.hpp
    +++ b/hotspot/src/share/vm/code/nmethod.hpp
    @@ -392,6 +392,9 @@ class nmethod : public CodeBlob {
       int handler_table_size() const                  { return            handler_table_end() -            handler_table_begin(); }
       int nul_chk_table_size() const                  { return            nul_chk_table_end() -            nul_chk_table_begin(); }
     
    +  int     oops_count() const { assert(oops_size() % oopSize == 0, "");  return (oops_size() / oopSize) + 1; }
    +  int metadata_count() const { assert(metadata_size() % wordSize == 0, ""); return (metadata_size() / wordSize) + 1; }
    +
       int total_size        () const;
     
       void dec_hotness_counter()        { _hotness_counter--; }
    @@ -491,7 +494,7 @@ class nmethod : public CodeBlob {
       oop   oop_at(int index) const                   { return index == 0 ? (oop) NULL: *oop_addr_at(index); }
       oop*  oop_addr_at(int index) const {  // for GC
         // relocation indexes are biased by 1 (because 0 is reserved)
    -    assert(index > 0 && index <= oops_size(), "must be a valid non-zero index");
    +    assert(index > 0 && index <= oops_count(), "must be a valid non-zero index");
         assert(!_oops_are_stale, "oops are stale");
         return &oops_begin()[index - 1];
       }
    @@ -501,13 +504,15 @@ class nmethod : public CodeBlob {
       Metadata*     metadata_at(int index) const      { return index == 0 ? NULL: *metadata_addr_at(index); }
       Metadata**  metadata_addr_at(int index) const {  // for GC
         // relocation indexes are biased by 1 (because 0 is reserved)
    -    assert(index > 0 && index <= metadata_size(), "must be a valid non-zero index");
    +    assert(index > 0 && index <= metadata_count(), "must be a valid non-zero index");
         return &metadata_begin()[index - 1];
       }
     
       void copy_values(GrowableArray* oops);
       void copy_values(GrowableArray* metadata);
     
    +  Method* attached_method(address call_pc);
    +
       // Relocation support
     private:
       void fix_oop_relocations(address begin, address end, bool initialize_immediates);
    @@ -696,6 +701,8 @@ public:
       void print_calls(outputStream* st)              PRODUCT_RETURN;
       void print_handler_table()                      PRODUCT_RETURN;
       void print_nul_chk_table()                      PRODUCT_RETURN;
    +  void print_recorded_oops()                      PRODUCT_RETURN;
    +  void print_recorded_metadata()                  PRODUCT_RETURN;
       void print_nmethod(bool print_code);
     
       // need to re-define this from CodeBlob else the overload hides it
    diff --git a/hotspot/src/share/vm/code/relocInfo.cpp b/hotspot/src/share/vm/code/relocInfo.cpp
    index 50b0517457d..ec83dad64a8 100644
    --- a/hotspot/src/share/vm/code/relocInfo.cpp
    +++ b/hotspot/src/share/vm/code/relocInfo.cpp
    @@ -581,13 +581,14 @@ void virtual_call_Relocation::pack_data_to(CodeSection* dest) {
     
       normalize_address(_cached_value, dest);
       jint x0 = scaled_offset_null_special(_cached_value, point);
    -  p = pack_1_int_to(p, x0);
    +  p = pack_2_ints_to(p, x0, _method_index);
       dest->set_locs_end((relocInfo*) p);
     }
     
     
     void virtual_call_Relocation::unpack_data() {
    -  jint x0 = unpack_1_int();
    +  jint x0 = 0;
    +  unpack_2_ints(x0, _method_index);
       address point = addr();
       _cached_value = x0==0? NULL: address_from_scaled_offset(x0, point);
     }
    @@ -793,6 +794,12 @@ address virtual_call_Relocation::cached_value() {
       return _cached_value;
     }
     
    +Method* virtual_call_Relocation::method_value() {
    +  Metadata* m = code()->metadata_at(_method_index);
    +  assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");
    +  assert(m == NULL || m->is_method(), "not a method");
    +  return (Method*)m;
    +}
     
     void virtual_call_Relocation::clear_inline_cache() {
       // No stubs for ICs
    @@ -803,6 +810,23 @@ void virtual_call_Relocation::clear_inline_cache() {
     }
     
     
    +void opt_virtual_call_Relocation::pack_data_to(CodeSection* dest) {
    +  short* p = (short*) dest->locs_end();
    +  p = pack_1_int_to(p, _method_index);
    +  dest->set_locs_end((relocInfo*) p);
    +}
    +
    +void opt_virtual_call_Relocation::unpack_data() {
    +  _method_index = unpack_1_int();
    +}
    +
    +Method* opt_virtual_call_Relocation::method_value() {
    +  Metadata* m = code()->metadata_at(_method_index);
    +  assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");
    +  assert(m == NULL || m->is_method(), "not a method");
    +  return (Method*)m;
    +}
    +
     void opt_virtual_call_Relocation::clear_inline_cache() {
       // No stubs for ICs
       // Clean IC
    @@ -827,6 +851,22 @@ address opt_virtual_call_Relocation::static_stub() {
       return NULL;
     }
     
    +Method* static_call_Relocation::method_value() {
    +  Metadata* m = code()->metadata_at(_method_index);
    +  assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");
    +  assert(m == NULL || m->is_method(), "not a method");
    +  return (Method*)m;
    +}
    +
    +void static_call_Relocation::pack_data_to(CodeSection* dest) {
    +  short* p = (short*) dest->locs_end();
    +  p = pack_1_int_to(p, _method_index);
    +  dest->set_locs_end((relocInfo*) p);
    +}
    +
    +void static_call_Relocation::unpack_data() {
    +  _method_index = unpack_1_int();
    +}
     
     void static_call_Relocation::clear_inline_cache() {
       // Safe call site info
    @@ -1014,6 +1054,12 @@ void RelocIterator::print_current() {
           break;
         }
       case relocInfo::static_call_type:
    +    {
    +      static_call_Relocation* r = (static_call_Relocation*) reloc();
    +      tty->print(" | [destination=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]",
    +                 p2i(r->destination()), p2i(r->method_value()));
    +      break;
    +    }
       case relocInfo::runtime_call_type:
         {
           CallRelocation* r = (CallRelocation*) reloc();
    @@ -1023,8 +1069,8 @@ void RelocIterator::print_current() {
       case relocInfo::virtual_call_type:
         {
           virtual_call_Relocation* r = (virtual_call_Relocation*) reloc();
    -      tty->print(" | [destination=" INTPTR_FORMAT " cached_value=" INTPTR_FORMAT "]",
    -                 p2i(r->destination()), p2i(r->cached_value()));
    +      tty->print(" | [destination=" INTPTR_FORMAT " cached_value=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]",
    +                 p2i(r->destination()), p2i(r->cached_value()), p2i(r->method_value()));
           break;
         }
       case relocInfo::static_stub_type:
    @@ -1039,6 +1085,13 @@ void RelocIterator::print_current() {
           tty->print(" | [trampoline owner=" INTPTR_FORMAT "]", p2i(r->owner()));
           break;
         }
    +  case relocInfo::opt_virtual_call_type:
    +    {
    +      opt_virtual_call_Relocation* r = (opt_virtual_call_Relocation*) reloc();
    +      tty->print(" | [destination=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]",
    +                 p2i(r->destination()), p2i(r->method_value()));
    +      break;
    +    }
       }
       tty->cr();
     }
    diff --git a/hotspot/src/share/vm/code/relocInfo.hpp b/hotspot/src/share/vm/code/relocInfo.hpp
    index dc9b11bbcfe..a243bfdbee7 100644
    --- a/hotspot/src/share/vm/code/relocInfo.hpp
    +++ b/hotspot/src/share/vm/code/relocInfo.hpp
    @@ -1044,27 +1044,31 @@ class virtual_call_Relocation : public CallRelocation {
       // "cached_value" points to the first associated set-oop.
       // The oop_limit helps find the last associated set-oop.
       // (See comments at the top of this file.)
    -  static RelocationHolder spec(address cached_value) {
    +  static RelocationHolder spec(address cached_value, jint method_index = 0) {
         RelocationHolder rh = newHolder();
    -    new(rh) virtual_call_Relocation(cached_value);
    +    new(rh) virtual_call_Relocation(cached_value, method_index);
         return rh;
       }
     
    -  virtual_call_Relocation(address cached_value) {
    + private:
    +  address _cached_value; // location of set-value instruction
    +  jint    _method_index; // resolved method for a Java call
    +
    +  virtual_call_Relocation(address cached_value, int method_index) {
         _cached_value = cached_value;
    +    _method_index = method_index;
         assert(cached_value != NULL, "first oop address must be specified");
       }
     
    - private:
    -  address _cached_value;               // location of set-value instruction
    -
       friend class RelocIterator;
       virtual_call_Relocation() { }
     
    -
      public:
       address cached_value();
     
    +  int     method_index() { return _method_index; }
    +  Method* method_value();
    +
       // data is packed as scaled offsets in "2_ints" format:  [f l] or [Ff Ll]
       // oop_limit is set to 0 if the limit falls somewhere within the call.
       // When unpacking, a zero oop_limit is taken to refer to the end of the call.
    @@ -1080,17 +1084,29 @@ class opt_virtual_call_Relocation : public CallRelocation {
       relocInfo::relocType type() { return relocInfo::opt_virtual_call_type; }
     
      public:
    -  static RelocationHolder spec() {
    +  static RelocationHolder spec(int method_index = 0) {
         RelocationHolder rh = newHolder();
    -    new(rh) opt_virtual_call_Relocation();
    +    new(rh) opt_virtual_call_Relocation(method_index);
         return rh;
       }
     
      private:
    +  jint _method_index; // resolved method for a Java call
    +
    +  opt_virtual_call_Relocation(int method_index) {
    +    _method_index = method_index;
    +  }
    +
       friend class RelocIterator;
    -  opt_virtual_call_Relocation() { }
    +  opt_virtual_call_Relocation() {}
     
      public:
    +  int     method_index() { return _method_index; }
    +  Method* method_value();
    +
    +  void pack_data_to(CodeSection* dest);
    +  void unpack_data();
    +
       void clear_inline_cache();
     
       // find the matching static_stub
    @@ -1102,17 +1118,29 @@ class static_call_Relocation : public CallRelocation {
       relocInfo::relocType type() { return relocInfo::static_call_type; }
     
      public:
    -  static RelocationHolder spec() {
    +  static RelocationHolder spec(int method_index = 0) {
         RelocationHolder rh = newHolder();
    -    new(rh) static_call_Relocation();
    +    new(rh) static_call_Relocation(method_index);
         return rh;
       }
     
      private:
    +  jint _method_index; // resolved method for a Java call
    +
    +  static_call_Relocation(int method_index) {
    +    _method_index = method_index;
    +  }
    +
       friend class RelocIterator;
    -  static_call_Relocation() { }
    +  static_call_Relocation() {}
     
      public:
    +  int     method_index() { return _method_index; }
    +  Method* method_value();
    +
    +  void pack_data_to(CodeSection* dest);
    +  void unpack_data();
    +
       void clear_inline_cache();
     
       // find the matching static_stub
    diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp
    index 173ec0ec667..4c7e891d74a 100644
    --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp
    +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp
    @@ -1456,6 +1456,33 @@ void LinkResolver::resolve_invoke(CallInfo& result, Handle recv, const constantP
       return;
     }
     
    +void LinkResolver::resolve_invoke(CallInfo& result, Handle& recv,
    +                             const methodHandle& attached_method,
    +                             Bytecodes::Code byte, TRAPS) {
    +  KlassHandle defc = attached_method->method_holder();
    +  Symbol* name = attached_method->name();
    +  Symbol* type = attached_method->signature();
    +  LinkInfo link_info(defc, name, type, KlassHandle(), /*check_access=*/false);
    +  switch(byte) {
    +    case Bytecodes::_invokevirtual:
    +      resolve_virtual_call(result, recv, recv->klass(), link_info,
    +                           /*check_null_and_abstract=*/true, CHECK);
    +      break;
    +    case Bytecodes::_invokeinterface:
    +      resolve_interface_call(result, recv, recv->klass(), link_info,
    +                             /*check_null_and_abstract=*/true, CHECK);
    +      break;
    +    case Bytecodes::_invokestatic:
    +      resolve_static_call(result, link_info, /*initialize_class=*/false, CHECK);
    +      break;
    +    case Bytecodes::_invokespecial:
    +      resolve_special_call(result, link_info, CHECK);
    +      break;
    +    default:
    +      fatal("bad call: %s", Bytecodes::name(byte));
    +  }
    +}
    +
     void LinkResolver::resolve_invokestatic(CallInfo& result, const constantPoolHandle& pool, int index, TRAPS) {
       LinkInfo link_info(pool, index, CHECK);
       resolve_static_call(result, link_info, /*initialize_class*/true, CHECK);
    diff --git a/hotspot/src/share/vm/interpreter/linkResolver.hpp b/hotspot/src/share/vm/interpreter/linkResolver.hpp
    index 198eefbe2c0..7d7a27944c8 100644
    --- a/hotspot/src/share/vm/interpreter/linkResolver.hpp
    +++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp
    @@ -295,6 +295,12 @@ class LinkResolver: AllStatic {
       static void resolve_invoke(CallInfo& result, Handle recv,
                                  const constantPoolHandle& pool, int index,
                                  Bytecodes::Code byte, TRAPS);
    +
    +  // runtime resolving from attached method
    +  static void resolve_invoke(CallInfo& result, Handle& recv,
    +                             const methodHandle& attached_method,
    +                             Bytecodes::Code byte, TRAPS);
    +
      private:
       static void trace_method_resolution(const char* prefix, KlassHandle klass,
                                           KlassHandle resolved_klass,
    diff --git a/hotspot/src/share/vm/opto/callGenerator.cpp b/hotspot/src/share/vm/opto/callGenerator.cpp
    index ff86ad4750d..68a193e246c 100644
    --- a/hotspot/src/share/vm/opto/callGenerator.cpp
    +++ b/hotspot/src/share/vm/opto/callGenerator.cpp
    @@ -46,6 +46,11 @@ const TypeFunc* CallGenerator::tf() const {
       return TypeFunc::make(method());
     }
     
    +bool CallGenerator::is_inlined_mh_linker(JVMState* jvms, ciMethod* callee) {
    +  ciMethod* symbolic_info = jvms->method()->get_method_at_bci(jvms->bci());
    +  return symbolic_info->is_method_handle_intrinsic() && !callee->is_method_handle_intrinsic();
    +}
    +
     //-----------------------------ParseGenerator---------------------------------
     // Internal class which handles all direct bytecode traversal.
     class ParseGenerator : public InlineCallGenerator {
    @@ -137,6 +142,13 @@ JVMState* DirectCallGenerator::generate(JVMState* jvms) {
       }
     
       CallStaticJavaNode *call = new CallStaticJavaNode(kit.C, tf(), target, method(), kit.bci());
    +  if (is_inlined_mh_linker(jvms, method())) {
    +    // To be able to issue a direct call and skip a call to MH.linkTo*/invokeBasic adapter,
    +    // additional information about the method being invoked should be attached
    +    // to the call site to make resolution logic work
    +    // (see SharedRuntime::resolve_static_call_C).
    +    call->set_override_symbolic_info(true);
    +  }
       _call_node = call;  // Save the call node in case we need it later
       if (!is_static) {
         // Make an explicit receiver null_check as part of this call.
    @@ -192,7 +204,10 @@ JVMState* VirtualCallGenerator::generate(JVMState* jvms) {
       // the call instruction will have a seemingly deficient out-count.
       // (The bailout says something misleading about an "infinite loop".)
       if (kit.gvn().type(receiver)->higher_equal(TypePtr::NULL_PTR)) {
    -    kit.inc_sp(method()->arg_size());  // restore arguments
    +    assert(Bytecodes::is_invoke(kit.java_bc()), "%d: %s", kit.java_bc(), Bytecodes::name(kit.java_bc()));
    +    ciMethod* declared_method = kit.method()->get_method_at_bci(kit.bci());
    +    int arg_size = declared_method->signature()->arg_size_for_bc(kit.java_bc());
    +    kit.inc_sp(arg_size);  // restore arguments
         kit.uncommon_trap(Deoptimization::Reason_null_check,
                           Deoptimization::Action_none,
                           NULL, "null receiver");
    @@ -226,6 +241,13 @@ JVMState* VirtualCallGenerator::generate(JVMState* jvms) {
       address target = SharedRuntime::get_resolve_virtual_call_stub();
       // Normal inline cache used for call
       CallDynamicJavaNode *call = new CallDynamicJavaNode(tf(), target, method(), _vtable_index, kit.bci());
    +  if (is_inlined_mh_linker(jvms, method())) {
    +    // To be able to issue a direct call (optimized virtual or virtual)
    +    // and skip a call to MH.linkTo*/invokeBasic adapter, additional information
    +    // about the method being invoked should be attached to the call site to
    +    // make resolution logic work (see SharedRuntime::resolve_{virtual,opt_virtual}_call_C).
    +    call->set_override_symbolic_info(true);
    +  }
       kit.set_arguments_for_java_call(call);
       kit.set_edges_for_java_call(call);
       Node* ret = kit.set_results_for_java_call(call);
    @@ -463,8 +485,8 @@ bool LateInlineMHCallGenerator::do_late_inline_check(JVMState* jvms) {
         _attempt++;
       }
     
    -  if (cg != NULL) {
    -    assert(!cg->is_late_inline() && cg->is_inline(), "we're doing late inlining");
    +  if (cg != NULL && cg->is_inline()) {
    +    assert(!cg->is_late_inline(), "we're doing late inlining");
         _inline_cg = cg;
         Compile::current()->dec_number_of_mh_late_inlines();
         return true;
    @@ -807,8 +829,7 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod*
             const int vtable_index = Method::invalid_vtable_index;
             CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS, NULL, true, true);
             assert(cg == NULL || !cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here");
    -        if (cg != NULL && cg->is_inline())
    -          return cg;
    +        return cg;
           } else {
             const char* msg = "receiver not constant";
             if (PrintInlining)  C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), msg);
    @@ -829,7 +850,7 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod*
             const TypeOopPtr* oop_ptr = member_name->bottom_type()->is_oopptr();
             ciMethod* target = oop_ptr->const_oop()->as_member_name()->get_vmtarget();
     
    -        // In lamda forms we erase signature types to avoid resolving issues
    +        // In lambda forms we erase signature types to avoid resolving issues
             // involving class loaders.  When we optimize a method handle invoke
             // to a direct call we must cast the receiver and arguments to its
             // actual types.
    @@ -882,10 +903,9 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod*
               // provide us with a type
               speculative_receiver_type = (receiver_type != NULL) ? receiver_type->speculative_type() : NULL;
             }
    -        CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, true, PROB_ALWAYS, speculative_receiver_type, true, true);
    +        CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, /*allow_inline=*/true, PROB_ALWAYS, speculative_receiver_type, true, true);
             assert(cg == NULL || !cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here");
    -        if (cg != NULL && cg->is_inline())
    -          return cg;
    +        return cg;
           } else {
             const char* msg = "member_name not constant";
             if (PrintInlining)  C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), msg);
    diff --git a/hotspot/src/share/vm/opto/callGenerator.hpp b/hotspot/src/share/vm/opto/callGenerator.hpp
    index 238fba2ce4a..58e8fe9c614 100644
    --- a/hotspot/src/share/vm/opto/callGenerator.hpp
    +++ b/hotspot/src/share/vm/opto/callGenerator.hpp
    @@ -49,7 +49,7 @@ class CallGenerator : public ResourceObj {
     
      public:
       // Accessors
    -  ciMethod*         method() const              { return _method; }
    +  ciMethod*          method() const             { return _method; }
     
       // is_inline: At least some code implementing the method is copied here.
       virtual bool      is_inline() const           { return false; }
    @@ -123,7 +123,6 @@ class CallGenerator : public ResourceObj {
       // How to generate vanilla out-of-line call sites:
       static CallGenerator* for_direct_call(ciMethod* m, bool separate_io_projs = false);   // static, special
       static CallGenerator* for_virtual_call(ciMethod* m, int vtable_index);  // virtual, interface
    -  static CallGenerator* for_dynamic_call(ciMethod* m);   // invokedynamic
     
       static CallGenerator* for_method_handle_call(  JVMState* jvms, ciMethod* caller, ciMethod* callee, bool delayed_forbidden);
       static CallGenerator* for_method_handle_inline(JVMState* jvms, ciMethod* caller, ciMethod* callee, bool& input_not_const);
    @@ -170,6 +169,8 @@ class CallGenerator : public ResourceObj {
           C->print_inlining(callee, inline_level, bci, msg);
         }
       }
    +
    +  static bool is_inlined_mh_linker(JVMState* jvms, ciMethod* m);
     };
     
     
    diff --git a/hotspot/src/share/vm/opto/callnode.cpp b/hotspot/src/share/vm/opto/callnode.cpp
    index c82a149d444..581b6d3bd67 100644
    --- a/hotspot/src/share/vm/opto/callnode.cpp
    +++ b/hotspot/src/share/vm/opto/callnode.cpp
    @@ -959,7 +959,8 @@ bool CallNode::is_call_to_arraycopystub() const {
     uint CallJavaNode::size_of() const { return sizeof(*this); }
     uint CallJavaNode::cmp( const Node &n ) const {
       CallJavaNode &call = (CallJavaNode&)n;
    -  return CallNode::cmp(call) && _method == call._method;
    +  return CallNode::cmp(call) && _method == call._method &&
    +         _override_symbolic_info == call._override_symbolic_info;
     }
     #ifndef PRODUCT
     void CallJavaNode::dump_spec(outputStream *st) const {
    diff --git a/hotspot/src/share/vm/opto/callnode.hpp b/hotspot/src/share/vm/opto/callnode.hpp
    index 389f09cab07..40f939a1160 100644
    --- a/hotspot/src/share/vm/opto/callnode.hpp
    +++ b/hotspot/src/share/vm/opto/callnode.hpp
    @@ -657,25 +657,29 @@ protected:
     
       bool    _optimized_virtual;
       bool    _method_handle_invoke;
    -  ciMethod* _method;            // Method being direct called
    +  bool    _override_symbolic_info; // Override symbolic call site info from bytecode
    +  ciMethod* _method;               // Method being direct called
     public:
       const int       _bci;         // Byte Code Index of call byte code
       CallJavaNode(const TypeFunc* tf , address addr, ciMethod* method, int bci)
         : CallNode(tf, addr, TypePtr::BOTTOM),
           _method(method), _bci(bci),
           _optimized_virtual(false),
    -      _method_handle_invoke(false)
    +      _method_handle_invoke(false),
    +      _override_symbolic_info(false)
       {
         init_class_id(Class_CallJava);
       }
     
       virtual int   Opcode() const;
    -  ciMethod* method() const                { return _method; }
    -  void  set_method(ciMethod *m)           { _method = m; }
    -  void  set_optimized_virtual(bool f)     { _optimized_virtual = f; }
    -  bool  is_optimized_virtual() const      { return _optimized_virtual; }
    -  void  set_method_handle_invoke(bool f)  { _method_handle_invoke = f; }
    -  bool  is_method_handle_invoke() const   { return _method_handle_invoke; }
    +  ciMethod* method() const                 { return _method; }
    +  void  set_method(ciMethod *m)            { _method = m; }
    +  void  set_optimized_virtual(bool f)      { _optimized_virtual = f; }
    +  bool  is_optimized_virtual() const       { return _optimized_virtual; }
    +  void  set_method_handle_invoke(bool f)   { _method_handle_invoke = f; }
    +  bool  is_method_handle_invoke() const    { return _method_handle_invoke; }
    +  void  set_override_symbolic_info(bool f) { _override_symbolic_info = f; }
    +  bool  override_symbolic_info() const     { return _override_symbolic_info; }
     
     #ifndef PRODUCT
       virtual void  dump_spec(outputStream *st) const;
    diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp
    index b8737560b07..1e8c1a465dc 100644
    --- a/hotspot/src/share/vm/opto/doCall.cpp
    +++ b/hotspot/src/share/vm/opto/doCall.cpp
    @@ -393,6 +393,100 @@ bool Parse::can_not_compile_call_site(ciMethod *dest_method, ciInstanceKlass* kl
       return false;
     }
     
    +#ifdef ASSERT
    +static bool check_type(ciType* t1, ciType* t2) {
    +  // Either oop-oop or prim-prim pair.
    +  if (t1->is_primitive_type() && t2->is_primitive_type()) {
    +    return t1->size() == t2->size(); // argument sizes should match
    +  } else {
    +    return !t1->is_primitive_type() && !t2->is_primitive_type(); // oop-oop
    +  }
    +}
    +
    +static bool check_inlined_mh_linker_info(ciMethod* symbolic_info, ciMethod* resolved_method) {
    +  assert(symbolic_info->is_method_handle_intrinsic(), "sanity");
    +  assert(!resolved_method->is_method_handle_intrinsic(), "sanity");
    +
    +  if (!symbolic_info->is_loaded() || !resolved_method->is_loaded()) {
    +    return true; // Don't compare unloaded methods.
    +  }
    +  // Linkers have appendix argument which is not passed to callee.
    +  int has_appendix = MethodHandles::has_member_arg(symbolic_info->intrinsic_id()) ? 1 : 0;
    +  if (symbolic_info->arg_size() != (resolved_method->arg_size() + has_appendix)) {
    +    return false; // Total size of arguments on stack mismatch.
    +  }
    +  if (!check_type(symbolic_info->return_type(), resolved_method->return_type())) {
    +    return false; // Return value size or type mismatch encountered.
    +  }
    +
    +  switch (symbolic_info->intrinsic_id()) {
    +    case vmIntrinsics::_linkToVirtual:
    +    case vmIntrinsics::_linkToInterface:
    +    case vmIntrinsics::_linkToSpecial: {
    +      if (resolved_method->is_static())  return false;
    +      break;
    +    }
    +    case vmIntrinsics::_linkToStatic: {
    +      if (!resolved_method->is_static())  return false;
    +      break;
    +    }
    +  }
    +
    +  ciSignature* symbolic_sig = symbolic_info->signature();
    +  ciSignature* resolved_sig = resolved_method->signature();
    +
    +  if (symbolic_sig->count() + (symbolic_info->is_static() ? 0 : 1) !=
    +      resolved_sig->count() + (resolved_method->is_static() ? 0 : 1) + has_appendix) {
    +    return false; // Argument count mismatch
    +  }
    +
    +  int sbase = 0, rbase = 0;
    +  int arg_count = MIN2(symbolic_sig->count() - has_appendix, resolved_sig->count());
    +  ciType* recv_type = NULL;
    +  if (symbolic_info->is_static() && !resolved_method->is_static()) {
    +    recv_type = symbolic_sig->type_at(0);
    +    sbase = 1;
    +  } else if (!symbolic_info->is_static() && resolved_method->is_static()) {
    +    recv_type = resolved_sig->type_at(0);
    +    rbase = 1;
    +  }
    +  if (recv_type != NULL && recv_type->is_primitive_type()) {
    +    return false; // Receiver should be an oop.
    +  }
    +  for (int i = 0; i < arg_count; i++) {
    +    if (!check_type(symbolic_sig->type_at(sbase + i), resolved_sig->type_at(rbase + i))) {
    +      return false; // Argument size or type mismatch encountered.
    +    }
    +  }
    +  return true;
    +}
    +
    +static bool is_call_consistent_with_jvms(JVMState* jvms, CallGenerator* cg) {
    +  ciMethod* symbolic_info = jvms->method()->get_method_at_bci(jvms->bci());
    +  ciMethod* resolved_method = cg->method();
    +
    +  if (CallGenerator::is_inlined_mh_linker(jvms, resolved_method)) {
    +    return check_inlined_mh_linker_info(symbolic_info, resolved_method);
    +  } else {
    +    // Method name & descriptor should stay the same.
    +    return (symbolic_info->get_Method()->name() == resolved_method->get_Method()->name()) &&
    +           (symbolic_info->get_Method()->signature() == resolved_method->get_Method()->signature());
    +  }
    +}
    +
    +static bool check_call_consistency(JVMState* jvms, CallGenerator* cg) {
    +  if (!is_call_consistent_with_jvms(jvms, cg)) {
    +    tty->print_cr("JVMS:");
    +    jvms->dump();
    +    tty->print_cr("Bytecode info:");
    +    jvms->method()->get_method_at_bci(jvms->bci())->print(); tty->cr();
    +    tty->print_cr("Resolved method:");
    +    cg->method()->print(); tty->cr();
    +    return false;
    +  }
    +  return true;
    +}
    +#endif // ASSERT
     
     //------------------------------do_call----------------------------------------
     // Handle your basic call.  Inline if we can & want to, else just setup call.
    @@ -571,6 +665,8 @@ void Parse::do_call() {
         set_jvms(new_jvms);
       }
     
    +  assert(check_call_consistency(jvms, cg), "inconsistent info");
    +
       if (!stopped()) {
         // This was some sort of virtual call, which did a null check for us.
         // Now we can assert receiver-not-null, on the normal return path.
    diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp
    index ff068a7fd55..694fb6f6834 100644
    --- a/hotspot/src/share/vm/opto/library_call.cpp
    +++ b/hotspot/src/share/vm/opto/library_call.cpp
    @@ -315,6 +315,8 @@ class LibraryCallKit : public GraphKit {
     
       bool inline_profileBoolean();
       bool inline_isCompileConstant();
    +
    +  bool inline_deoptimize();
     };
     
     //---------------------------make_vm_intrinsic----------------------------
    @@ -750,6 +752,9 @@ bool LibraryCallKit::try_to_inline(int predicate) {
       case vmIntrinsics::_hasNegatives:
         return inline_hasNegatives();
     
    +  case vmIntrinsics::_deoptimize:
    +    return inline_deoptimize();
    +
       default:
         // If you get here, it may be that someone has added a new intrinsic
         // to the list in vmSymbols.hpp without implementing it here.
    @@ -6574,3 +6579,12 @@ bool LibraryCallKit::inline_isCompileConstant() {
       set_result(n->is_Con() ? intcon(1) : intcon(0));
       return true;
     }
    +
    +bool LibraryCallKit::inline_deoptimize() {
    +  assert(WhiteBoxAPI, "");
    +  PreserveReexecuteState preexecs(this);
    +  jvms()->set_should_reexecute(false);
    +  uncommon_trap(Deoptimization::Reason_intrinsic,
    +                Deoptimization::Action_none);
    +  return true;
    +}
    diff --git a/hotspot/src/share/vm/opto/machnode.cpp b/hotspot/src/share/vm/opto/machnode.cpp
    index c780d3f5340..c4e6953ab9f 100644
    --- a/hotspot/src/share/vm/opto/machnode.cpp
    +++ b/hotspot/src/share/vm/opto/machnode.cpp
    @@ -707,7 +707,8 @@ const RegMask &MachCallNode::in_RegMask(uint idx) const {
     uint MachCallJavaNode::size_of() const { return sizeof(*this); }
     uint MachCallJavaNode::cmp( const Node &n ) const {
       MachCallJavaNode &call = (MachCallJavaNode&)n;
    -  return MachCallNode::cmp(call) && _method->equals(call._method);
    +  return MachCallNode::cmp(call) && _method->equals(call._method) &&
    +         _override_symbolic_info == call._override_symbolic_info;
     }
     #ifndef PRODUCT
     void MachCallJavaNode::dump_spec(outputStream *st) const {
    diff --git a/hotspot/src/share/vm/opto/machnode.hpp b/hotspot/src/share/vm/opto/machnode.hpp
    index ca2ad70c264..25cbdc648e7 100644
    --- a/hotspot/src/share/vm/opto/machnode.hpp
    +++ b/hotspot/src/share/vm/opto/machnode.hpp
    @@ -885,16 +885,28 @@ protected:
       virtual uint cmp( const Node &n ) const;
       virtual uint size_of() const; // Size is bigger
     public:
    -  ciMethod* _method;             // Method being direct called
    -  int        _bci;               // Byte Code index of call byte code
    -  bool       _optimized_virtual; // Tells if node is a static call or an optimized virtual
    -  bool       _method_handle_invoke;   // Tells if the call has to preserve SP
    -  MachCallJavaNode() : MachCallNode() {
    +  ciMethod* _method;                 // Method being direct called
    +  bool      _override_symbolic_info; // Override symbolic call site info from bytecode
    +  int       _bci;                    // Byte Code index of call byte code
    +  bool      _optimized_virtual;      // Tells if node is a static call or an optimized virtual
    +  bool      _method_handle_invoke;   // Tells if the call has to preserve SP
    +  MachCallJavaNode() : MachCallNode(), _override_symbolic_info(false) {
         init_class_id(Class_MachCallJava);
       }
     
       virtual const RegMask &in_RegMask(uint) const;
     
    +  int resolved_method_index(CodeBuffer &cbuf) const {
    +    if (_override_symbolic_info) {
    +      // Attach corresponding Method* to the call site, so VM can use it during resolution
    +      // instead of querying symbolic info from bytecode.
    +      assert(_method != NULL, "method should be set");
    +      assert(_method->constant_encoding()->is_method(), "should point to a Method");
    +      return cbuf.oop_recorder()->find_index(_method->constant_encoding());
    +    }
    +    return 0; // Use symbolic info from bytecode (resolved_method == NULL).
    +  }
    +
     #ifndef PRODUCT
       virtual void dump_spec(outputStream *st) const;
     #endif
    diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp
    index acf3f32ece0..bb18a3da6d8 100644
    --- a/hotspot/src/share/vm/opto/matcher.cpp
    +++ b/hotspot/src/share/vm/opto/matcher.cpp
    @@ -1201,6 +1201,7 @@ MachNode *Matcher::match_sfpt( SafePointNode *sfpt ) {
           mcall_java->_optimized_virtual = call_java->is_optimized_virtual();
           is_method_handle_invoke = call_java->is_method_handle_invoke();
           mcall_java->_method_handle_invoke = is_method_handle_invoke;
    +      mcall_java->_override_symbolic_info = call_java->override_symbolic_info();
           if (is_method_handle_invoke) {
             C->set_has_method_handle_invokes(true);
           }
    diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp
    index 99e8a785f10..4f21e410c24 100644
    --- a/hotspot/src/share/vm/prims/methodHandles.cpp
    +++ b/hotspot/src/share/vm/prims/methodHandles.cpp
    @@ -358,6 +358,19 @@ Symbol* MethodHandles::signature_polymorphic_intrinsic_name(vmIntrinsics::ID iid
       return 0;
     }
     
    +Bytecodes::Code MethodHandles::signature_polymorphic_intrinsic_bytecode(vmIntrinsics::ID id) {
    +  switch(id) {
    +    case vmIntrinsics::_linkToVirtual:   return Bytecodes::_invokevirtual;
    +    case vmIntrinsics::_linkToInterface: return Bytecodes::_invokeinterface;
    +    case vmIntrinsics::_linkToStatic:    return Bytecodes::_invokestatic;
    +    case vmIntrinsics::_linkToSpecial:   return Bytecodes::_invokespecial;
    +    case vmIntrinsics::_invokeBasic:     return Bytecodes::_invokehandle;
    +    default:
    +      fatal("unexpected id: (%d) %s", (uint)id, vmIntrinsics::name_at(id));
    +      return Bytecodes::_illegal;
    +  }
    +}
    +
     int MethodHandles::signature_polymorphic_intrinsic_ref_kind(vmIntrinsics::ID iid) {
       switch (iid) {
       case vmIntrinsics::_invokeBasic:      return 0;
    diff --git a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp
    index ab41c31b4a3..22205f2e9da 100644
    --- a/hotspot/src/share/vm/prims/methodHandles.hpp
    +++ b/hotspot/src/share/vm/prims/methodHandles.hpp
    @@ -91,6 +91,10 @@ class MethodHandles: AllStatic {
                 iid <= vmIntrinsics::LAST_MH_SIG_POLY);
       }
     
    +  static bool is_signature_polymorphic_method(Method* m) {
    +    return is_signature_polymorphic(m->intrinsic_id());
    +  }
    +
       static bool is_signature_polymorphic_intrinsic(vmIntrinsics::ID iid) {
         assert(is_signature_polymorphic(iid), "");
         // Most sig-poly methods are intrinsics which do not require an
    @@ -131,6 +135,8 @@ class MethodHandles: AllStatic {
         return signature_polymorphic_name_id(klass, name) != vmIntrinsics::_none;
       }
     
    +  static Bytecodes::Code signature_polymorphic_intrinsic_bytecode(vmIntrinsics::ID id);
    +
       static int get_named_constant(int which, Handle name_box, TRAPS);
     
     public:
    diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp
    index 6c68a00d29c..c627ee3ca60 100644
    --- a/hotspot/src/share/vm/prims/whitebox.cpp
    +++ b/hotspot/src/share/vm/prims/whitebox.cpp
    @@ -1290,6 +1290,11 @@ WB_ENTRY(jlong, WB_GetConstantPool(JNIEnv* env, jobject wb, jclass klass))
       return (jlong) ikh->constants();
     WB_END
     
    +WB_ENTRY(void, WB_ClearInlineCaches(JNIEnv* env, jobject wb))
    +  VM_ClearICs clear_ics;
    +  VMThread::execute(&clear_ics);
    +WB_END
    +
     template 
     static bool GetMethodOption(JavaThread* thread, JNIEnv* env, jobject method, jstring name, T* value) {
       assert(value != NULL, "sanity");
    @@ -1615,6 +1620,7 @@ static JNINativeMethod methods[] = {
                                                           (void*)&WB_GetMethodStringOption},
       {CC"isShared",           CC"(Ljava/lang/Object;)Z", (void*)&WB_IsShared },
       {CC"areSharedStringsIgnored",           CC"()Z",    (void*)&WB_AreSharedStringsIgnored },
    +  {CC"clearInlineCaches",  CC"()V",                   (void*)&WB_ClearInlineCaches },
     };
     
     #undef CC
    diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
    index 68440ee89cf..a79ae71fbc6 100644
    --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp
    +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
    @@ -1070,6 +1070,21 @@ Handle SharedRuntime::find_callee_info(JavaThread* thread, Bytecodes::Code& bc,
       return find_callee_info_helper(thread, vfst, bc, callinfo, THREAD);
     }
     
    +methodHandle SharedRuntime::extract_attached_method(vframeStream& vfst) {
    +  nmethod* caller_nm = vfst.nm();
    +
    +  nmethodLocker caller_lock(caller_nm);
    +
    +  address pc = vfst.frame_pc();
    +  { // Get call instruction under lock because another thread may be busy patching it.
    +    MutexLockerEx ml_patch(Patching_lock, Mutex::_no_safepoint_check_flag);
    +    if (NativeCall::is_call_before(pc)) {
    +      NativeCall* ncall = nativeCall_before(pc);
    +      return caller_nm->attached_method(ncall->instruction_address());
    +    }
    +  }
    +  return NULL;
    +}
     
     // Finds receiver, CallInfo (i.e. receiver method), and calling bytecode
     // for a call current in progress, i.e., arguments has been pushed on stack
    @@ -1087,15 +1102,37 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread,
       methodHandle caller(THREAD, vfst.method());
       int          bci   = vfst.bci();
     
    -  // Find bytecode
       Bytecode_invoke bytecode(caller, bci);
    -  bc = bytecode.invoke_code();
       int bytecode_index = bytecode.index();
     
    +  methodHandle attached_method = extract_attached_method(vfst);
    +  if (attached_method.not_null()) {
    +    methodHandle callee = bytecode.static_target(CHECK_NH);
    +    vmIntrinsics::ID id = callee->intrinsic_id();
    +    // When VM replaces MH.invokeBasic/linkTo* call with a direct/virtual call,
    +    // it attaches statically resolved method to the call site.
    +    if (MethodHandles::is_signature_polymorphic(id) &&
    +        MethodHandles::is_signature_polymorphic_intrinsic(id)) {
    +      bc = MethodHandles::signature_polymorphic_intrinsic_bytecode(id);
    +
    +      // Need to adjust invokehandle since inlining through signature-polymorphic
    +      // method happened.
    +      if (bc == Bytecodes::_invokehandle &&
    +          !MethodHandles::is_signature_polymorphic_method(attached_method())) {
    +        bc = attached_method->is_static() ? Bytecodes::_invokestatic
    +                                          : Bytecodes::_invokevirtual;
    +      }
    +    }
    +  } else {
    +    bc = bytecode.invoke_code();
    +  }
    +
    +  bool has_receiver = bc != Bytecodes::_invokestatic &&
    +                      bc != Bytecodes::_invokedynamic &&
    +                      bc != Bytecodes::_invokehandle;
    +
       // Find receiver for non-static call
    -  if (bc != Bytecodes::_invokestatic &&
    -      bc != Bytecodes::_invokedynamic &&
    -      bc != Bytecodes::_invokehandle) {
    +  if (has_receiver) {
         // This register map must be update since we need to find the receiver for
         // compiled frames. The receiver might be in a register.
         RegisterMap reg_map2(thread);
    @@ -1103,10 +1140,13 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread,
         // Caller-frame is a compiled frame
         frame callerFrame = stubFrame.sender(®_map2);
     
    -    methodHandle callee = bytecode.static_target(CHECK_(nullHandle));
    -    if (callee.is_null()) {
    -      THROW_(vmSymbols::java_lang_NoSuchMethodException(), nullHandle);
    +    if (attached_method.is_null()) {
    +      methodHandle callee = bytecode.static_target(CHECK_NH);
    +      if (callee.is_null()) {
    +        THROW_(vmSymbols::java_lang_NoSuchMethodException(), nullHandle);
    +      }
         }
    +
         // Retrieve from a compiled argument list
         receiver = Handle(THREAD, callerFrame.retrieve_receiver(®_map2));
     
    @@ -1115,26 +1155,35 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread,
         }
       }
     
    -  // Resolve method. This is parameterized by bytecode.
    -  constantPoolHandle constants(THREAD, caller->constants());
       assert(receiver.is_null() || receiver->is_oop(), "wrong receiver");
    -  LinkResolver::resolve_invoke(callinfo, receiver, constants, bytecode_index, bc, CHECK_(nullHandle));
    +
    +  // Resolve method
    +  if (attached_method.not_null()) {
    +    // Parameterized by attached method.
    +    LinkResolver::resolve_invoke(callinfo, receiver, attached_method, bc, CHECK_NH);
    +  } else {
    +    // Parameterized by bytecode.
    +    constantPoolHandle constants(THREAD, caller->constants());
    +    LinkResolver::resolve_invoke(callinfo, receiver, constants, bytecode_index, bc, CHECK_NH);
    +  }
     
     #ifdef ASSERT
       // Check that the receiver klass is of the right subtype and that it is initialized for virtual calls
    -  if (bc != Bytecodes::_invokestatic && bc != Bytecodes::_invokedynamic && bc != Bytecodes::_invokehandle) {
    +  if (has_receiver) {
         assert(receiver.not_null(), "should have thrown exception");
         KlassHandle receiver_klass(THREAD, receiver->klass());
    -    Klass* rk = constants->klass_ref_at(bytecode_index, CHECK_(nullHandle));
    -                            // klass is already loaded
    +    Klass* rk = NULL;
    +    if (attached_method.not_null()) {
    +      // In case there's resolved method attached, use its holder during the check.
    +      rk = attached_method->method_holder();
    +    } else {
    +      // Klass is already loaded.
    +      constantPoolHandle constants(THREAD, caller->constants());
    +      rk = constants->klass_ref_at(bytecode_index, CHECK_NH);
    +    }
         KlassHandle static_receiver_klass(THREAD, rk);
    -    // Method handle invokes might have been optimized to a direct call
    -    // so don't check for the receiver class.
    -    // FIXME this weakens the assert too much
         methodHandle callee = callinfo.selected_method();
    -    assert(receiver_klass->is_subtype_of(static_receiver_klass()) ||
    -           callee->is_method_handle_intrinsic() ||
    -           callee->is_compiled_lambda_form(),
    +    assert(receiver_klass->is_subtype_of(static_receiver_klass()),
                "actual receiver must be subclass of static receiver klass");
         if (receiver_klass->is_instance_klass()) {
           if (InstanceKlass::cast(receiver_klass())->is_not_initialized()) {
    @@ -1670,7 +1719,6 @@ methodHandle SharedRuntime::reresolve_call_site(JavaThread *thread, TRAPS) {
             inline_cache->set_to_clean();
           }
         }
    -
       }
     
       methodHandle callee_method = find_callee_method(thread, CHECK_(methodHandle()));
    diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.hpp b/hotspot/src/share/vm/runtime/sharedRuntime.hpp
    index acf822f6eb1..39fc4ce818a 100644
    --- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp
    +++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp
    @@ -343,6 +343,8 @@ class SharedRuntime: AllStatic {
                                             Bytecodes::Code& bc,
                                             CallInfo& callinfo, TRAPS);
     
    +  static methodHandle extract_attached_method(vframeStream& vfst);
    +
       static address clean_virtual_call_entry();
       static address clean_opt_virtual_call_entry();
       static address clean_static_call_entry();
    diff --git a/hotspot/src/share/vm/runtime/vm_operations.hpp b/hotspot/src/share/vm/runtime/vm_operations.hpp
    index ac53ea63913..940f801f170 100644
    --- a/hotspot/src/share/vm/runtime/vm_operations.hpp
    +++ b/hotspot/src/share/vm/runtime/vm_operations.hpp
    @@ -30,6 +30,7 @@
     #include "oops/oop.hpp"
     #include "runtime/thread.hpp"
     #include "utilities/top.hpp"
    +#include "code/codeCache.hpp"
     
     // The following classes are used for operations
     // initiated by a Java thread but that must
    @@ -44,6 +45,7 @@
       template(ThreadDump)                            \
       template(PrintThreads)                          \
       template(FindDeadlocks)                         \
    +  template(ClearICs)                              \
       template(ForceSafepoint)                        \
       template(ForceAsyncSafepoint)                   \
       template(Deoptimize)                            \
    @@ -230,6 +232,13 @@ class VM_ThreadStop: public VM_Operation {
       }
     };
     
    +class VM_ClearICs: public VM_Operation {
    + public:
    +  VM_ClearICs() {}
    +  void doit()         { CodeCache::clear_inline_caches(); }
    +  VMOp_Type type() const { return VMOp_ClearICs; }
    +};
    +
     // dummy vm op, evaluated just to force a safepoint
     class VM_ForceSafepoint: public VM_Operation {
      public:
    diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java b/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java
    new file mode 100644
    index 00000000000..415f0b6b903
    --- /dev/null
    +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java
    @@ -0,0 +1,48 @@
    +/*
    + * 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.
    + */
    +import java.io.File;
    +import java.io.PrintStream;
    +import java.lang.instrument.Instrumentation;
    +import java.util.Arrays;
    +
    +public class Agent {
    +    public static void main(String[] args) throws Exception {
    +        String jarName = args[0];
    +        String className = args[1];
    +        String manifestName = "manifest.mf";
    +
    +        System.out.println("Creating "+manifestName);
    +        try (PrintStream out = new PrintStream(new File(manifestName))) {
    +            out.println("Premain-Class: " + className);
    +            out.println("Can-Redefine-Classes: true");
    +        }
    +        System.out.println("Building "+jarName);
    +        String[] jarArgs = new String[] {"-cfm", jarName, manifestName };
    +
    +        System.out.println("Running jar " + Arrays.toString(jarArgs));
    +        sun.tools.jar.Main jarTool = new sun.tools.jar.Main(System.out, System.err, "jar");
    +        if (!jarTool.run(jarArgs)) {
    +            throw new Error("jar failed: args=" + Arrays.toString(args));
    +        }
    +    }
    +}
    diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java
    new file mode 100644
    index 00000000000..0a325734db4
    --- /dev/null
    +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java
    @@ -0,0 +1,105 @@
    +/*
    + * 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 8072008
    + * @library /testlibrary /../../test/lib
    + * @build GCTest NonInlinedReinvoker
    + * @run main ClassFileInstaller sun.hotspot.WhiteBox
    + *                              sun.hotspot.WhiteBox$WhiteBoxPermission
    + *                              java.lang.invoke.GCTest
    + *                              java.lang.invoke.GCTest$T
    + *                              java.lang.invoke.NonInlinedReinvoker
    + *                              jdk.test.lib.Asserts
    + * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
    + *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
    + *                   -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1
    + *                      java.lang.invoke.GCTest
    + */
    +package java.lang.invoke;
    +
    +import sun.hotspot.WhiteBox;
    +
    +import java.lang.ref.*;
    +import static jdk.test.lib.Asserts.*;
    +
    +public class GCTest {
    +    static final MethodHandles.Lookup LOOKUP = MethodHandles.Lookup.IMPL_LOOKUP;
    +
    +    static class T {
    +        static int f1() { return 0; }
    +        static int f2() { return 1; }
    +    }
    +
    +    static @Stable MethodHandle mh;
    +    static PhantomReference lform;
    +
    +    static final ReferenceQueue rq = new ReferenceQueue<>();
    +    static final WhiteBox WB = WhiteBox.getWhiteBox();
    +
    +    @DontInline
    +    static int invokeBasic() {
    +        try {
    +            return (int) mh.invokeBasic();
    +        } catch (Throwable e) {
    +            throw new Error(e);
    +        }
    +    }
    +
    +    static void test(int expected) {
    +        for (int i = 0; i < 20_000; i++) {
    +            invokeBasic();
    +        }
    +        assertEquals(invokeBasic(), expected);
    +    }
    +
    +    public static void main(String[] args) throws Exception {
    +        mh = NonInlinedReinvoker.make(
    +                LOOKUP.findStatic(T.class, "f1", MethodType.methodType(int.class)));
    +
    +        // Monitor LambdaForm GC
    +        lform = new PhantomReference<>(mh.form, rq);
    +
    +        test(0);
    +        WB.clearInlineCaches();
    +        test(0);
    +
    +        mh = NonInlinedReinvoker.make(
    +                LOOKUP.findStatic(T.class, "f2", MethodType.methodType(int.class)));
    +
    +        Reference ref = null;
    +        while (ref == null) {
    +            WB.fullGC();
    +            try {
    +                ref = rq.remove(1000);
    +            } catch (InterruptedException e) { /*ignore*/ }
    +        }
    +
    +        test(1);
    +        WB.clearInlineCaches();
    +        test(1);
    +
    +        System.out.println("TEST PASSED");
    +    }
    +}
    diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java
    new file mode 100644
    index 00000000000..687ef7242a7
    --- /dev/null
    +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java
    @@ -0,0 +1,218 @@
    +/*
    + * 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 8072008
    + * @library /testlibrary /../../test/lib
    + * @build InvokeTest NonInlinedReinvoker
    + * @run main ClassFileInstaller sun.hotspot.WhiteBox
    + *                              sun.hotspot.WhiteBox$WhiteBoxPermission
    + *                              java.lang.invoke.InvokeTest
    + *                              java.lang.invoke.InvokeTest$T
    + *                              java.lang.invoke.InvokeTest$P1
    + *                              java.lang.invoke.InvokeTest$P2
    + *                              java.lang.invoke.InvokeTest$I
    + *                              java.lang.invoke.NonInlinedReinvoker
    + *                              jdk.test.lib.Asserts
    + * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
    + *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
    + *                   -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1
    + *                      java.lang.invoke.InvokeTest
    + */
    +package java.lang.invoke;
    +
    +import sun.hotspot.WhiteBox;
    +import static jdk.test.lib.Asserts.*;
    +
    +public class InvokeTest {
    +    static MethodHandles.Lookup LOOKUP = MethodHandles.Lookup.IMPL_LOOKUP;
    +
    +    static final MethodHandle virtualMH;  // invokevirtual   T.f1
    +    static final MethodHandle staticMH;   // invokestatic    T.f2
    +    static final MethodHandle intfMH;     // invokeinterface I.f1
    +    static final MethodHandle specialMH;  // invokespecial   T.f4 T
    +    static final MethodHandle basicMH;
    +
    +    static final WhiteBox WB = WhiteBox.getWhiteBox();
    +
    +    static volatile boolean doDeopt = false;
    +
    +    static {
    +        try {
    +            MethodType mtype = MethodType.methodType(Class.class);
    +
    +            virtualMH  = LOOKUP.findVirtual(T.class, "f1", mtype);
    +            staticMH   = LOOKUP.findStatic (T.class, "f2", mtype);
    +            intfMH     = LOOKUP.findVirtual(I.class, "f3", mtype);
    +            specialMH  = LOOKUP.findSpecial(T.class, "f4", mtype, T.class);
    +            basicMH    = NonInlinedReinvoker.make(staticMH);
    +        } catch (Exception e) {
    +            throw new Error(e);
    +        }
    +    }
    +
    +    static class T implements I {
    +        @DontInline public        Class f1() { if (doDeopt) WB.deoptimize(); return T.class; }
    +        @DontInline public static Class f2() { if (doDeopt) WB.deoptimize(); return T.class; }
    +        @DontInline private       Class f4() { if (doDeopt) WB.deoptimize(); return T.class; }
    +    }
    +
    +    static class P1 extends T {
    +        @DontInline public Class f1() { if (doDeopt) WB.deoptimize(); return P1.class; }
    +        @DontInline public Class f3() { if (doDeopt) WB.deoptimize(); return P1.class; }
    +    }
    +
    +    static class P2 extends T {
    +        @DontInline public Class f1() { if (doDeopt) WB.deoptimize(); return P2.class; }
    +        @DontInline public Class f3() { if (doDeopt) WB.deoptimize(); return P2.class; }
    +    }
    +
    +    static interface I {
    +        @DontInline default Class f3() { if (doDeopt) WB.deoptimize(); return I.class; }
    +    }
    +
    +    @DontInline
    +    static void linkToVirtual(Object obj, Class extecpted) {
    +        try {
    +            Class cls = (Class)virtualMH.invokeExact((T)obj);
    +            assertEquals(cls, obj.getClass());
    +        } catch (Throwable e) {
    +            throw new Error(e);
    +        }
    +    }
    +
    +    @DontInline
    +    static void linkToInterface(Object obj, Class expected) {
    +        try {
    +            Class cls = (Class)intfMH.invokeExact((I)obj);
    +            assertEquals(cls, expected);
    +        } catch (Throwable e) {
    +            throw new Error(e);
    +        }
    +    }
    +
    +    @DontInline
    +    static void linkToStatic() {
    +        try {
    +            Class cls = (Class)staticMH.invokeExact();
    +            assertEquals(cls, T.class);
    +        } catch (Throwable e) {
    +            throw new Error(e);
    +        }
    +    }
    +
    +    @DontInline
    +    static void linkToSpecial(Object obj, Class expected) {
    +        try {
    +            Class cls = (Class)specialMH.invokeExact((T)obj);
    +            assertEquals(cls, expected);
    +        } catch (Throwable e) {
    +            throw new Error(e);
    +        }
    +    }
    +
    +    @DontInline
    +    static void invokeBasic() {
    +        try {
    +            Class cls = (Class)basicMH.invokeBasic();
    +            assertEquals(cls, T.class);
    +        } catch (Throwable e) {
    +            throw new Error(e);
    +        }
    +    }
    +
    +    static void run(Runnable r) {
    +        for (int i = 0; i < 20_000; i++) {
    +            r.run();
    +        }
    +
    +        doDeopt = true;
    +        r.run();
    +        doDeopt = false;
    +
    +        WB.clearInlineCaches();
    +
    +        for (int i = 0; i < 20_000; i++) {
    +            r.run();
    +        }
    +
    +        doDeopt = true;
    +        r.run();
    +        doDeopt = false;
    +    }
    +
    +    static void testVirtual() {
    +        System.out.println("linkToVirtual");
    +
    +        // Monomorphic case (optimized virtual call)
    +        run(() -> linkToVirtual(new T(), T.class));
    +
    +        // Megamorphic case (virtual call)
    +        Object[] recv = new Object[] { new T(), new P1(), new P2() };
    +        run(() -> {
    +            for (Object r : recv) {
    +                linkToVirtual(r, r.getClass());
    +            }});
    +    }
    +
    +    static void testInterface() {
    +        System.out.println("linkToInterface");
    +
    +        // Monomorphic case (optimized virtual call)
    +        run(() -> linkToInterface(new T(), I.class));
    +
    +        // Megamorphic case (virtual call)
    +        Object[][] recv = new Object[][] {{new T(), I.class}, {new P1(), P1.class}, {new P2(), P2.class}};
    +        run(() -> {
    +            for (Object[] r : recv) {
    +                linkToInterface(r[0], (Class)r[1]);
    +            }});
    +    }
    +
    +    static void testSpecial() {
    +        System.out.println("linkToSpecial");
    +        // Monomorphic case (optimized virtual call)
    +        run(() -> linkToSpecial(new T(), T.class));
    +    }
    +
    +    static void testStatic() {
    +        System.out.println("linkToStatic");
    +        // static call
    +        run(() -> linkToStatic());
    +    }
    +
    +    static void testBasic() {
    +        System.out.println("invokeBasic");
    +        // static call
    +        run(() -> invokeBasic());
    +    }
    +
    +    public static void main(String[] args) {
    +        testVirtual();
    +        testInterface();
    +        testSpecial();
    +        testStatic();
    +        testBasic();
    +    }
    +}
    diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/NonInlinedReinvoker.java b/hotspot/test/compiler/jsr292/NonInlinedCall/NonInlinedReinvoker.java
    new file mode 100644
    index 00000000000..c4c36d3c49d
    --- /dev/null
    +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/NonInlinedReinvoker.java
    @@ -0,0 +1,48 @@
    +/*
    + * 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.
    + */
    +package java.lang.invoke;
    +
    +class NonInlinedReinvoker extends DelegatingMethodHandle {
    +    private final MethodHandle target;
    +
    +    private NonInlinedReinvoker(MethodHandle target, LambdaForm lf) {
    +        super(target.type(), lf);
    +        this.target = target;
    +    }
    +    @Override
    +    protected MethodHandle getTarget() {
    +        return target;
    +    }
    +
    +    @Override
    +    MethodHandle asTypeUncached(MethodType newType) {
    +        return asTypeCache = target.asType(newType);
    +    }
    +
    +    static MethodHandle make(MethodHandle target) {
    +        LambdaForm lform = DelegatingMethodHandle.makeReinvokerForm(
    +                target, -1, DelegatingMethodHandle.class, "reinvoker.dontInline",
    +                /*forceInline=*/false, DelegatingMethodHandle.NF_getTarget, null);
    +        return new NonInlinedReinvoker(target, lform);
    +    }
    +}
    diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java
    new file mode 100644
    index 00000000000..54ce2221390
    --- /dev/null
    +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java
    @@ -0,0 +1,157 @@
    +/*
    + * 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 8072008
    + * @library /testlibrary /../../test/lib
    + * @build RedefineTest Agent
    + * @run main ClassFileInstaller sun.hotspot.WhiteBox
    + *                              sun.hotspot.WhiteBox$WhiteBoxPermission
    + *                              java.lang.invoke.RedefineTest
    + *                              Agent
    + *                              jdk.test.lib.Asserts
    + * @run main Agent agent.jar java.lang.invoke.RedefineTest
    + * @run main/othervm -Xbootclasspath/a:. -javaagent:agent.jar
    + *                   -XX:+IgnoreUnrecognizedVMOptions
    + *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
    + *                   -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1
    + *                      java.lang.invoke.RedefineTest
    + */
    +package java.lang.invoke;
    +
    +import sun.hotspot.WhiteBox;
    +import sun.misc.Unsafe;
    +
    +import jdk.internal.org.objectweb.asm.*;
    +
    +import java.lang.instrument.ClassDefinition;
    +import java.lang.instrument.Instrumentation;
    +
    +import static jdk.internal.org.objectweb.asm.Opcodes.*;
    +
    +public class RedefineTest {
    +    static final MethodHandles.Lookup LOOKUP = MethodHandles.Lookup.IMPL_LOOKUP;
    +    static final Unsafe UNSAFE = Unsafe.getUnsafe();
    +
    +    static final String NAME = "java/lang/invoke/RedefineTest$T";
    +
    +    static Class getClass(int r) {
    +        byte[] classFile = getClassFile(r);
    +        return UNSAFE.defineClass(NAME, classFile, 0, classFile.length, null, null);
    +    }
    +
    +    /**
    +     * Generates a class of the following shape:
    +     *     static class T {
    +     *         @DontInline public static int f() { return $r; }
    +     *     }
    +     */
    +    static byte[] getClassFile(int r) {
    +        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
    +        MethodVisitor mv;
    +        cw.visit(52, ACC_PUBLIC | ACC_SUPER, NAME, null, "java/lang/Object", null);
    +        {
    +            mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "f", "()I", null, null);
    +            mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true);
    +            mv.visitCode();
    +            mv.visitLdcInsn(r);
    +            mv.visitInsn(IRETURN);
    +            mv.visitMaxs(0, 0);
    +            mv.visitEnd();
    +        }
    +        cw.visitEnd();
    +        return cw.toByteArray();
    +    }
    +
    +    static final MethodHandle mh;
    +    static final Class CLS = getClass(0);
    +    static {
    +        try {
    +            mh = LOOKUP.findStatic(CLS, "f", MethodType.methodType(int.class));
    +        } catch (Exception e) {
    +            throw new Error(e);
    +        }
    +    }
    +
    +    static final WhiteBox WB = WhiteBox.getWhiteBox();
    +
    +    @DontInline
    +    static int invokeBasic() {
    +        try {
    +            return (int)mh.invokeExact();
    +        } catch (Throwable e) {
    +            throw new Error(e);
    +        }
    +    }
    +
    +    static Instrumentation instr;
    +    public static void premain(String args, Instrumentation instr) {
    +        RedefineTest.instr = instr;
    +    }
    +
    +
    +    public static void main(String[] args) throws Exception {
    +        for (int i = 0; i < 20_000; i++) {
    +            int r = invokeBasic();
    +            if (r != 0) {
    +                throw new Error(r + " != 0");
    +            }
    +        }
    +        // WB.ensureCompiled();
    +
    +        redefine();
    +
    +        int exp = (instr != null) ? 1 : 0;
    +
    +        for (int i = 0; i < 20_000; i++) {
    +            if (invokeBasic() != exp) {
    +                throw new Error();
    +            }
    +        }
    +
    +        WB.clearInlineCaches();
    +
    +        for (int i = 0; i < 20_000; i++) {
    +            if (invokeBasic() != exp) {
    +                throw new Error();
    +            }
    +        }
    +
    +        // WB.ensureCompiled();
    +    }
    +
    +    static void redefine() {
    +        if (instr == null) {
    +            System.out.println("NOT REDEFINED");
    +            return;
    +        }
    +        ClassDefinition cd = new ClassDefinition(CLS, getClassFile(1));
    +        try {
    +            instr.redefineClasses(cd);
    +        } catch (Exception e) {
    +            throw new Error(e);
    +        }
    +        System.out.println("REDEFINED");
    +    }
    +}
    diff --git a/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java b/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java
    index 8841c1362ab..87d56e442cb 100644
    --- a/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java
    +++ b/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java
    @@ -29,7 +29,7 @@
      * @library /testlibrary
      * @compile WhiteBox.java
      * @run main ClassFileInstaller sun.hotspot.WhiteBox
    - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI sun.hotspot.WhiteBox
    + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-CheckIntrinsics sun.hotspot.WhiteBox
      */
     
     package sun.hotspot;
    
    From 7caf70643cacf9b6683dbb6b521f943434ce3c92 Mon Sep 17 00:00:00 2001
    From: Mikael Vidstedt 
    Date: Fri, 4 Dec 2015 13:36:10 -0800
    Subject: [PATCH 048/228] 8144657: Invalid format specifiers in jvmci trace
     messages
    
    Reviewed-by: kvn
    ---
     hotspot/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/hotspot/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp b/hotspot/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp
    index c50844963d0..50431ccca89 100644
    --- a/hotspot/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp
    +++ b/hotspot/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp
    @@ -73,7 +73,7 @@ void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, Handle constant, T
         NativeMovConstReg32* move = nativeMovConstReg32_at(pc);
         narrowKlass narrowOop = record_narrow_metadata_reference(constant, CHECK);
         move->set_data((intptr_t)narrowOop);
    -    TRACE_jvmci_3("relocating (narrow metaspace constant) at %p/%p", pc, narrowOop);
    +    TRACE_jvmci_3("relocating (narrow metaspace constant) at " PTR_FORMAT "/0x%x", p2i(pc), narrowOop);
     #else
         JVMCI_ERROR("compressed Klass* on 32bit");
     #endif
    @@ -81,7 +81,7 @@ void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, Handle constant, T
         NativeMovConstReg* move = nativeMovConstReg_at(pc);
         Metadata* reference = record_metadata_reference(constant, CHECK);
         move->set_data((intptr_t)reference);
    -    TRACE_jvmci_3("relocating (metaspace constant) at %p/%p", pc, reference);
    +    TRACE_jvmci_3("relocating (metaspace constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(reference));
       }
     }
     
    
    From b5691de477939a174faa904adb7e10867d8d563b Mon Sep 17 00:00:00 2001
    From: Mikael Vidstedt 
    Date: Fri, 4 Dec 2015 15:08:49 -0800
    Subject: [PATCH 049/228] 8144748: Move assembler/macroAssembler inline
     function definitions to corresponding inline.hpp files
    
    Reviewed-by: kvn, coleenp
    ---
     hotspot/src/cpu/sparc/vm/assembler_sparc.hpp  | 421 +++++++++---------
     .../cpu/sparc/vm/assembler_sparc.inline.hpp   | 303 +++++++++++++
     .../src/cpu/sparc/vm/macroAssembler_sparc.cpp |  13 -
     .../src/cpu/sparc/vm/macroAssembler_sparc.hpp | 120 ++---
     .../sparc/vm/macroAssembler_sparc.inline.hpp  | 109 +++++
     5 files changed, 659 insertions(+), 307 deletions(-)
    
    diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
    index 7c9c86a1466..ec1a2423aa0 100644
    --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
    +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
    @@ -677,11 +677,8 @@ class Assembler : public AbstractAssembler  {
     
      protected:
       // Insert a nop if the previous is cbcond
    -  void insert_nop_after_cbcond() {
    -    if (UseCBCond && cbcond_before()) {
    -      nop();
    -    }
    -  }
    +  inline void insert_nop_after_cbcond();
    +
       // Delay slot helpers
       // cti is called when emitting control-transfer instruction,
       // BEFORE doing the emitting.
    @@ -739,7 +736,7 @@ public:
       }
     
       inline void emit_int32(int);  // shadows AbstractAssembler::emit_int32
    -  inline void emit_data(int x) { emit_int32(x); }
    +  inline void emit_data(int x);
       inline void emit_data(int, RelocationHolder const&);
       inline void emit_data(int, relocInfo::relocType rtype);
       // helper for above fcns
    @@ -754,31 +751,31 @@ public:
       inline void add(Register s1, Register s2, Register d );
       inline void add(Register s1, int simm13a, Register d );
     
    -  void addcc(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    -  void addcc(  Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void addc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3             ) | rs1(s1) | rs2(s2) ); }
    -  void addc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void addccc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    -  void addccc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void addcc(  Register s1, Register s2, Register d );
    +  inline void addcc(  Register s1, int simm13a, Register d );
    +  inline void addc(   Register s1, Register s2, Register d );
    +  inline void addc(   Register s1, int simm13a, Register d );
    +  inline void addccc( Register s1, Register s2, Register d );
    +  inline void addccc( Register s1, int simm13a, Register d );
     
     
       // 4-operand AES instructions
     
    -  void aes_eround01(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround01_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    -  void aes_eround23(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround23_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    -  void aes_dround01(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround01_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    -  void aes_dround23(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround23_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    -  void aes_eround01_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround01_l_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    -  void aes_eround23_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround23_l_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    -  void aes_dround01_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround01_l_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    -  void aes_dround23_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround23_l_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    -  void aes_kexpand1(  FloatRegister s1, FloatRegister s2, int imm5a, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | u_field(imm5a, 13, 9) | op5(aes_kexpand1_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    +  inline void aes_eround01(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d );
    +  inline void aes_eround23(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d );
    +  inline void aes_dround01(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d );
    +  inline void aes_dround23(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d );
    +  inline void aes_eround01_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d );
    +  inline void aes_eround23_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d );
    +  inline void aes_dround01_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d );
    +  inline void aes_dround23_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d );
    +  inline void aes_kexpand1(  FloatRegister s1, FloatRegister s2, int imm5a, FloatRegister d );
     
     
       // 3-operand AES instructions
     
    -  void aes_kexpand0(  FloatRegister s1, FloatRegister s2, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes3_op3) | fs1(s1, FloatRegisterImpl::D) | opf(aes_kexpand0_opf) | fs2(s2, FloatRegisterImpl::D) ); }
    -  void aes_kexpand2(  FloatRegister s1, FloatRegister s2, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes3_op3) | fs1(s1, FloatRegisterImpl::D) | opf(aes_kexpand2_opf) | fs2(s2, FloatRegisterImpl::D) ); }
    +  inline void aes_kexpand0(  FloatRegister s1, FloatRegister s2, FloatRegister d );
    +  inline void aes_kexpand2(  FloatRegister s1, FloatRegister s2, FloatRegister d );
     
       // pp 136
     
    @@ -827,70 +824,70 @@ public:
       // at address s1 is swapped with the data in d. If the values are not equal,
       // the the contents of memory at s1 is loaded into d, without the swap.
     
    -  void casa(  Register s1, Register s2, Register d, int ia = -1 ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(casa_op3 ) | rs1(s1) | (ia == -1  ? immed(true) : imm_asi(ia)) | rs2(s2)); }
    -  void casxa( Register s1, Register s2, Register d, int ia = -1 ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(casxa_op3) | rs1(s1) | (ia == -1  ? immed(true) : imm_asi(ia)) | rs2(s2)); }
    +  inline void casa(  Register s1, Register s2, Register d, int ia = -1 );
    +  inline void casxa( Register s1, Register s2, Register d, int ia = -1 );
     
       // pp 152
     
    -  void udiv(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3             ) | rs1(s1) | rs2(s2)); }
    -  void udiv(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void sdiv(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3             ) | rs1(s1) | rs2(s2)); }
    -  void sdiv(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void udivcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); }
    -  void udivcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void sdivcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); }
    -  void sdivcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void udiv(   Register s1, Register s2, Register d );
    +  inline void udiv(   Register s1, int simm13a, Register d );
    +  inline void sdiv(   Register s1, Register s2, Register d );
    +  inline void sdiv(   Register s1, int simm13a, Register d );
    +  inline void udivcc( Register s1, Register s2, Register d );
    +  inline void udivcc( Register s1, int simm13a, Register d );
    +  inline void sdivcc( Register s1, Register s2, Register d );
    +  inline void sdivcc( Register s1, int simm13a, Register d );
     
       // pp 155
     
    -  void done()  { v9_only();  cti();  emit_int32( op(arith_op) | fcn(0) | op3(done_op3) ); }
    -  void retry() { v9_only();  cti();  emit_int32( op(arith_op) | fcn(1) | op3(retry_op3) ); }
    +  inline void done();
    +  inline void retry();
     
       // pp 156
     
    -  void fadd( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x40 + w) | fs2(s2, w)); }
    -  void fsub( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x44 + w) | fs2(s2, w)); }
    +  inline void fadd( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d );
    +  inline void fsub( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d );
     
       // pp 157
     
    -  void fcmp(  FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x50 + w) | fs2(s2, w)); }
    -  void fcmpe( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x54 + w) | fs2(s2, w)); }
    +  inline void fcmp(  FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2);
    +  inline void fcmpe( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2);
     
       // pp 159
     
    -  void ftox( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only();  emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(fpop1_op3) | opf(0x80 + w) | fs2(s, w)); }
    -  void ftoi( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) {             emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(fpop1_op3) | opf(0xd0 + w) | fs2(s, w)); }
    +  inline void ftox( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d );
    +  inline void ftoi( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d );
     
       // pp 160
     
    -  void ftof( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | opf(0xc0 + sw + dw*4) | fs2(s, sw)); }
    +  inline void ftof( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s, FloatRegister d );
     
       // pp 161
     
    -  void fxtof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only();  emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x80 + w*4) | fs2(s, FloatRegisterImpl::D)); }
    -  void fitof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) {             emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0xc0 + w*4) | fs2(s, FloatRegisterImpl::S)); }
    +  inline void fxtof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d );
    +  inline void fitof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d );
     
       // pp 162
     
    -  void fmov( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x00 + w) | fs2(s, w)); }
    +  inline void fmov( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d );
     
    -  void fneg( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x04 + w) | fs2(s, w)); }
    +  inline void fneg( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d );
     
    -  void fabs( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x08 + w) | fs2(s, w)); }
    +  inline void fabs( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d );
     
       // pp 163
     
    -  void fmul( FloatRegisterImpl::Width w,                            FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w)  | op3(fpop1_op3) | fs1(s1, w)  | opf(0x48 + w)         | fs2(s2, w)); }
    -  void fmul( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw,  FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | fs1(s1, sw) | opf(0x60 + sw + dw*4) | fs2(s2, sw)); }
    -  void fdiv( FloatRegisterImpl::Width w,                            FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w)  | op3(fpop1_op3) | fs1(s1, w)  | opf(0x4c + w)         | fs2(s2, w)); }
    +  inline void fmul( FloatRegisterImpl::Width w,                            FloatRegister s1, FloatRegister s2, FloatRegister d );
    +  inline void fmul( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw,  FloatRegister s1, FloatRegister s2, FloatRegister d );
    +  inline void fdiv( FloatRegisterImpl::Width w,                            FloatRegister s1, FloatRegister s2, FloatRegister d );
     
       // FXORs/FXORd instructions
     
    -  void fxor( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(flog3_op3) | fs1(s1, w) | opf(0x6E - w) | fs2(s2, w)); }
    +  inline void fxor( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d );
     
       // pp 164
     
    -  void fsqrt( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x28 + w) | fs2(s, w)); }
    +  inline void fsqrt( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d );
     
       // pp 165
     
    @@ -899,17 +896,17 @@ public:
     
       // pp 167
     
    -  void flushw() { v9_only();  emit_int32( op(arith_op) | op3(flushw_op3) ); }
    +  void flushw();
     
       // pp 168
     
    -  void illtrap( int const22a) { if (const22a != 0) v9_only();  emit_int32( op(branch_op) | u_field(const22a, 21, 0) ); }
    +  void illtrap( int const22a);
       // v8 unimp == illtrap(0)
     
       // pp 169
     
    -  void impdep1( int id1, int const19a ) { v9_only();  emit_int32( op(arith_op) | fcn(id1) | op3(impdep1_op3) | u_field(const19a, 18, 0)); }
    -  void impdep2( int id1, int const19a ) { v9_only();  emit_int32( op(arith_op) | fcn(id1) | op3(impdep2_op3) | u_field(const19a, 18, 0)); }
    +  void impdep1( int id1, int const19a );
    +  void impdep2( int id1, int const19a );
     
       // pp 170
     
    @@ -929,8 +926,8 @@ public:
     
       // 173
     
    -  void ldfa(  FloatRegisterImpl::Width w, Register s1, Register s2, int ia, FloatRegister d ) { v9_only();  emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void ldfa(  FloatRegisterImpl::Width w, Register s1, int simm13a,         FloatRegister d ) { v9_only();  emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void ldfa(  FloatRegisterImpl::Width w, Register s1, Register s2, int ia, FloatRegister d );
    +  inline void ldfa(  FloatRegisterImpl::Width w, Register s1, int simm13a,         FloatRegister d );
     
       // pp 175, lduw is ld on v8
     
    @@ -953,119 +950,119 @@ public:
     
       // pp 177
     
    -  void ldsba(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void ldsba(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void ldsha(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void ldsha(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void ldswa(  Register s1, Register s2, int ia, Register d ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void ldswa(  Register s1, int simm13a,         Register d ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void lduba(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void lduba(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void lduha(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void lduha(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void lduwa(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void lduwa(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void ldxa(   Register s1, Register s2, int ia, Register d ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3  | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void ldxa(   Register s1, int simm13a,         Register d ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3  | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void ldsba(  Register s1, Register s2, int ia, Register d );
    +  inline void ldsba(  Register s1, int simm13a,         Register d );
    +  inline void ldsha(  Register s1, Register s2, int ia, Register d );
    +  inline void ldsha(  Register s1, int simm13a,         Register d );
    +  inline void ldswa(  Register s1, Register s2, int ia, Register d );
    +  inline void ldswa(  Register s1, int simm13a,         Register d );
    +  inline void lduba(  Register s1, Register s2, int ia, Register d );
    +  inline void lduba(  Register s1, int simm13a,         Register d );
    +  inline void lduha(  Register s1, Register s2, int ia, Register d );
    +  inline void lduha(  Register s1, int simm13a,         Register d );
    +  inline void lduwa(  Register s1, Register s2, int ia, Register d );
    +  inline void lduwa(  Register s1, int simm13a,         Register d );
    +  inline void ldxa(   Register s1, Register s2, int ia, Register d );
    +  inline void ldxa(   Register s1, int simm13a,         Register d );
     
       // pp 181
     
    -  void and3(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3              ) | rs1(s1) | rs2(s2) ); }
    -  void and3(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3              ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void andcc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    -  void andcc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void andn(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3             ) | rs1(s1) | rs2(s2) ); }
    -  void andn(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void andncc(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    -  void andncc(  Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void or3(     Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3               ) | rs1(s1) | rs2(s2) ); }
    -  void or3(     Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3               ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void orcc(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3   | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    -  void orcc(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3   | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void orn(     Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | rs2(s2) ); }
    -  void orn(     Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void orncc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    -  void orncc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void xor3(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3              ) | rs1(s1) | rs2(s2) ); }
    -  void xor3(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3              ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void xorcc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    -  void xorcc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void xnor(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3             ) | rs1(s1) | rs2(s2) ); }
    -  void xnor(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void xnorcc(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    -  void xnorcc(  Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void and3(    Register s1, Register s2, Register d );
    +  inline void and3(    Register s1, int simm13a, Register d );
    +  inline void andcc(   Register s1, Register s2, Register d );
    +  inline void andcc(   Register s1, int simm13a, Register d );
    +  inline void andn(    Register s1, Register s2, Register d );
    +  inline void andn(    Register s1, int simm13a, Register d );
    +  inline void andncc(  Register s1, Register s2, Register d );
    +  inline void andncc(  Register s1, int simm13a, Register d );
    +  inline void or3(     Register s1, Register s2, Register d );
    +  inline void or3(     Register s1, int simm13a, Register d );
    +  inline void orcc(    Register s1, Register s2, Register d );
    +  inline void orcc(    Register s1, int simm13a, Register d );
    +  inline void orn(     Register s1, Register s2, Register d );
    +  inline void orn(     Register s1, int simm13a, Register d );
    +  inline void orncc(   Register s1, Register s2, Register d );
    +  inline void orncc(   Register s1, int simm13a, Register d );
    +  inline void xor3(    Register s1, Register s2, Register d );
    +  inline void xor3(    Register s1, int simm13a, Register d );
    +  inline void xorcc(   Register s1, Register s2, Register d );
    +  inline void xorcc(   Register s1, int simm13a, Register d );
    +  inline void xnor(    Register s1, Register s2, Register d );
    +  inline void xnor(    Register s1, int simm13a, Register d );
    +  inline void xnorcc(  Register s1, Register s2, Register d );
    +  inline void xnorcc(  Register s1, int simm13a, Register d );
     
       // pp 183
     
    -  void membar( Membar_mask_bits const7a ) { v9_only(); emit_int32( op(arith_op) | op3(membar_op3) | rs1(O7) | immed(true) | u_field( int(const7a), 6, 0)); }
    +  inline void membar( Membar_mask_bits const7a );
     
       // pp 185
     
    -  void fmov( FloatRegisterImpl::Width w, Condition c,  bool floatCC, CC cca, FloatRegister s2, FloatRegister d ) { v9_only();  emit_int32( op(arith_op) | fd(d, w) | op3(fpop2_op3) | cond_mov(c) | opf_cc(cca, floatCC) | opf_low6(w) | fs2(s2, w)); }
    +  inline void fmov( FloatRegisterImpl::Width w, Condition c,  bool floatCC, CC cca, FloatRegister s2, FloatRegister d );
     
       // pp 189
     
    -  void fmov( FloatRegisterImpl::Width w, RCondition c, Register s1,  FloatRegister s2, FloatRegister d ) { v9_only();  emit_int32( op(arith_op) | fd(d, w) | op3(fpop2_op3) | rs1(s1) | rcond(c) | opf_low5(4 + w) | fs2(s2, w)); }
    +  inline void fmov( FloatRegisterImpl::Width w, RCondition c, Register s1,  FloatRegister s2, FloatRegister d );
     
       // pp 191
     
    -  void movcc( Condition c, bool floatCC, CC cca, Register s2, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | rs2(s2) ); }
    -  void movcc( Condition c, bool floatCC, CC cca, int simm11a, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | immed(true) | simm(simm11a, 11) ); }
    +  inline void movcc( Condition c, bool floatCC, CC cca, Register s2, Register d );
    +  inline void movcc( Condition c, bool floatCC, CC cca, int simm11a, Register d );
     
       // pp 195
     
    -  void movr( RCondition c, Register s1, Register s2,  Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | rs2(s2) ); }
    -  void movr( RCondition c, Register s1, int simm10a,  Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | immed(true) | simm(simm10a, 10) ); }
    +  inline void movr( RCondition c, Register s1, Register s2,  Register d );
    +  inline void movr( RCondition c, Register s1, int simm10a,  Register d );
     
       // pp 196
     
    -  void mulx(  Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | rs2(s2) ); }
    -  void mulx(  Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void sdivx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | rs2(s2) ); }
    -  void sdivx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void udivx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | rs2(s2) ); }
    -  void udivx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void mulx(  Register s1, Register s2, Register d );
    +  inline void mulx(  Register s1, int simm13a, Register d );
    +  inline void sdivx( Register s1, Register s2, Register d );
    +  inline void sdivx( Register s1, int simm13a, Register d );
    +  inline void udivx( Register s1, Register s2, Register d );
    +  inline void udivx( Register s1, int simm13a, Register d );
     
       // pp 197
     
    -  void umul(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3             ) | rs1(s1) | rs2(s2) ); }
    -  void umul(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void smul(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3             ) | rs1(s1) | rs2(s2) ); }
    -  void smul(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void umulcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    -  void umulcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void smulcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    -  void smulcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void umul(   Register s1, Register s2, Register d );
    +  inline void umul(   Register s1, int simm13a, Register d );
    +  inline void smul(   Register s1, Register s2, Register d );
    +  inline void smul(   Register s1, int simm13a, Register d );
    +  inline void umulcc( Register s1, Register s2, Register d );
    +  inline void umulcc( Register s1, int simm13a, Register d );
    +  inline void smulcc( Register s1, Register s2, Register d );
    +  inline void smulcc( Register s1, int simm13a, Register d );
     
       // pp 201
     
    -  void nop() { emit_int32( op(branch_op) | op2(sethi_op2) ); }
    +  inline void nop();
     
    -  void sw_count() { emit_int32( op(branch_op) | op2(sethi_op2) | 0x3f0 ); }
    +  inline void sw_count();
     
       // pp 202
     
    -  void popc( Register s,  Register d) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(popc_op3) | rs2(s)); }
    -  void popc( int simm13a, Register d) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(popc_op3) | immed(true) | simm(simm13a, 13)); }
    +  inline void popc( Register s,  Register d);
    +  inline void popc( int simm13a, Register d);
     
       // pp 203
     
    -  void prefetch(   Register s1, Register s2, PrefetchFcn f) { v9_only();  emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | rs2(s2) ); }
    -  void prefetch(   Register s1, int simm13a, PrefetchFcn f) { v9_only();  emit_data( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
    +  inline void prefetch(   Register s1, Register s2, PrefetchFcn f);
    +  inline void prefetch(   Register s1, int simm13a, PrefetchFcn f);
     
    -  void prefetcha(  Register s1, Register s2, int ia, PrefetchFcn f ) { v9_only();  emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void prefetcha(  Register s1, int simm13a,         PrefetchFcn f ) { v9_only();  emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void prefetcha(  Register s1, Register s2, int ia, PrefetchFcn f );
    +  inline void prefetcha(  Register s1, int simm13a,         PrefetchFcn f );
     
       // pp 208
     
       // not implementing read privileged register
     
    -  inline void rdy(    Register d) { v9_dep();  emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(0, 18, 14)); }
    -  inline void rdccr(  Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(2, 18, 14)); }
    -  inline void rdasi(  Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(3, 18, 14)); }
    -  inline void rdtick( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(4, 18, 14)); } // Spoon!
    -  inline void rdpc(   Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(5, 18, 14)); }
    -  inline void rdfprs( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(6, 18, 14)); }
    +  inline void rdy(    Register d);
    +  inline void rdccr(  Register d);
    +  inline void rdasi(  Register d);
    +  inline void rdtick( Register d);
    +  inline void rdpc(   Register d);
    +  inline void rdfprs( Register d);
     
       // pp 213
     
    @@ -1074,47 +1071,43 @@ public:
     
       // pp 214
     
    -  void save(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | rs2(s2) ); }
    -  void save(    Register s1, int simm13a, Register d ) {
    -    // make sure frame is at least large enough for the register save area
    -    assert(-simm13a >= 16 * wordSize, "frame too small");
    -    emit_int32( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) );
    -  }
    +  inline void save(    Register s1, Register s2, Register d );
    +  inline void save(    Register s1, int simm13a, Register d );
     
    -  void restore( Register s1 = G0,  Register s2 = G0, Register d = G0 ) { emit_int32( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | rs2(s2) ); }
    -  void restore( Register s1,       int simm13a,      Register d      ) { emit_int32( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void restore( Register s1 = G0,  Register s2 = G0, Register d = G0 );
    +  inline void restore( Register s1,       int simm13a,      Register d      );
     
       // pp 216
     
    -  void saved()    { v9_only();  emit_int32( op(arith_op) | fcn(0) | op3(saved_op3)); }
    -  void restored() { v9_only();  emit_int32( op(arith_op) | fcn(1) | op3(saved_op3)); }
    +  inline void saved();
    +  inline void restored();
     
       // pp 217
     
       inline void sethi( int imm22a, Register d, RelocationHolder const& rspec = RelocationHolder() );
       // pp 218
     
    -  void sll(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
    -  void sll(  Register s1, int imm5a,   Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
    -  void srl(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
    -  void srl(  Register s1, int imm5a,   Register d ) { emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
    -  void sra(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
    -  void sra(  Register s1, int imm5a,   Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
    +  inline void sll(  Register s1, Register s2, Register d );
    +  inline void sll(  Register s1, int imm5a,   Register d );
    +  inline void srl(  Register s1, Register s2, Register d );
    +  inline void srl(  Register s1, int imm5a,   Register d );
    +  inline void sra(  Register s1, Register s2, Register d );
    +  inline void sra(  Register s1, int imm5a,   Register d );
     
    -  void sllx( Register s1, Register s2, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
    -  void sllx( Register s1, int imm6a,   Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
    -  void srlx( Register s1, Register s2, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
    -  void srlx( Register s1, int imm6a,   Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
    -  void srax( Register s1, Register s2, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
    -  void srax( Register s1, int imm6a,   Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
    +  inline void sllx( Register s1, Register s2, Register d );
    +  inline void sllx( Register s1, int imm6a,   Register d );
    +  inline void srlx( Register s1, Register s2, Register d );
    +  inline void srlx( Register s1, int imm6a,   Register d );
    +  inline void srax( Register s1, Register s2, Register d );
    +  inline void srax( Register s1, int imm6a,   Register d );
     
       // pp 220
     
    -  void sir( int simm13a ) { emit_int32( op(arith_op) | fcn(15) | op3(sir_op3) | immed(true) | simm(simm13a, 13)); }
    +  inline void sir( int simm13a );
     
       // pp 221
     
    -  void stbar() { emit_int32( op(arith_op) | op3(membar_op3) | u_field(15, 18, 14)); }
    +  inline void stbar();
     
       // pp 222
     
    @@ -1128,8 +1121,8 @@ public:
     
       //  pp 224
     
    -  void stfa(  FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2, int ia ) { v9_only();  emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void stfa(  FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a         ) { v9_only();  emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void stfa(  FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2, int ia );
    +  inline void stfa(  FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a         );
     
       // p 226
     
    @@ -1146,28 +1139,28 @@ public:
     
       // pp 177
     
    -  void stba(  Register d, Register s1, Register s2, int ia ) {             emit_int32( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void stba(  Register d, Register s1, int simm13a         ) {             emit_int32( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void stha(  Register d, Register s1, Register s2, int ia ) {             emit_int32( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void stha(  Register d, Register s1, int simm13a         ) {             emit_int32( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void stwa(  Register d, Register s1, Register s2, int ia ) {             emit_int32( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void stwa(  Register d, Register s1, int simm13a         ) {             emit_int32( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void stxa(  Register d, Register s1, Register s2, int ia ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void stxa(  Register d, Register s1, int simm13a         ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void stda(  Register d, Register s1, Register s2, int ia ) {             emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void stda(  Register d, Register s1, int simm13a         ) {             emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void stba(  Register d, Register s1, Register s2, int ia );
    +  inline void stba(  Register d, Register s1, int simm13a         );
    +  inline void stha(  Register d, Register s1, Register s2, int ia );
    +  inline void stha(  Register d, Register s1, int simm13a         );
    +  inline void stwa(  Register d, Register s1, Register s2, int ia );
    +  inline void stwa(  Register d, Register s1, int simm13a         );
    +  inline void stxa(  Register d, Register s1, Register s2, int ia );
    +  inline void stxa(  Register d, Register s1, int simm13a         );
    +  inline void stda(  Register d, Register s1, Register s2, int ia );
    +  inline void stda(  Register d, Register s1, int simm13a         );
     
       // pp 230
     
    -  void sub(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3              ) | rs1(s1) | rs2(s2) ); }
    -  void sub(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3              ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void sub(    Register s1, Register s2, Register d );
    +  inline void sub(    Register s1, int simm13a, Register d );
     
    -  void subcc(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | rs2(s2) ); }
    -  void subcc(  Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void subc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3             ) | rs1(s1) | rs2(s2) ); }
    -  void subc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    -  void subccc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    -  void subccc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void subcc(  Register s1, Register s2, Register d );
    +  inline void subcc(  Register s1, int simm13a, Register d );
    +  inline void subc(   Register s1, Register s2, Register d );
    +  inline void subc(   Register s1, int simm13a, Register d );
    +  inline void subccc( Register s1, Register s2, Register d );
    +  inline void subccc( Register s1, int simm13a, Register d );
     
       // pp 231
     
    @@ -1176,86 +1169,80 @@ public:
     
       // pp 232
     
    -  void swapa(   Register s1, Register s2, int ia, Register d ) { v9_dep();  emit_int32( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    -  void swapa(   Register s1, int simm13a,         Register d ) { v9_dep();  emit_int32( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void swapa(   Register s1, Register s2, int ia, Register d );
    +  inline void swapa(   Register s1, int simm13a,         Register d );
     
       // pp 234, note op in book is wrong, see pp 268
     
    -  void taddcc(    Register s1, Register s2, Register d ) {            emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3  ) | rs1(s1) | rs2(s2) ); }
    -  void taddcc(    Register s1, int simm13a, Register d ) {            emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3  ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void taddcc(    Register s1, Register s2, Register d );
    +  inline void taddcc(    Register s1, int simm13a, Register d );
     
       // pp 235
     
    -  void tsubcc(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3  ) | rs1(s1) | rs2(s2) ); }
    -  void tsubcc(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3  ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +  inline void tsubcc(    Register s1, Register s2, Register d );
    +  inline void tsubcc(    Register s1, int simm13a, Register d );
     
       // pp 237
     
    -  void trap( Condition c, CC cc, Register s1, Register s2 ) { emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | rs2(s2)); }
    -  void trap( Condition c, CC cc, Register s1, int trapa   ) { emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | immed(true) | u_field(trapa, 6, 0)); }
    +  inline void trap( Condition c, CC cc, Register s1, Register s2 );
    +  inline void trap( Condition c, CC cc, Register s1, int trapa   );
       // simple uncond. trap
    -  void trap( int trapa ) { trap( always, icc, G0, trapa ); }
    +  inline void trap( int trapa );
     
       // pp 239 omit write priv register for now
     
    -  inline void wry(    Register d) { v9_dep();  emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(0, 29, 25)); }
    -  inline void wrccr(Register s) { v9_only(); emit_int32( op(arith_op) | rs1(s) | op3(wrreg_op3) | u_field(2, 29, 25)); }
    -  inline void wrccr(Register s, int simm13a) { v9_only(); emit_int32( op(arith_op) |
    -                                                                           rs1(s) |
    -                                                                           op3(wrreg_op3) |
    -                                                                           u_field(2, 29, 25) |
    -                                                                           immed(true) |
    -                                                                           simm(simm13a, 13)); }
    -  inline void wrasi(Register d) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(3, 29, 25)); }
    +  inline void wry(    Register d);
    +  inline void wrccr(Register s);
    +  inline void wrccr(Register s, int simm13a);
    +  inline void wrasi(Register d);
       // wrasi(d, imm) stores (d xor imm) to asi
    -  inline void wrasi(Register d, int simm13a) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) |
    -                                               u_field(3, 29, 25) | immed(true) | simm(simm13a, 13)); }
    -  inline void wrfprs( Register d) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(6, 29, 25)); }
    +  inline void wrasi(Register d, int simm13a);
    +  inline void wrfprs( Register d);
     
       //  VIS1 instructions
     
    -  void alignaddr( Register s1, Register s2, Register d ) { vis1_only(); emit_int32( op(arith_op) | rd(d) | op3(alignaddr_op3) | rs1(s1) | opf(alignaddr_opf) | rs2(s2)); }
    +  inline void alignaddr( Register s1, Register s2, Register d );
     
    -  void faligndata( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(faligndata_op3) | fs1(s1, FloatRegisterImpl::D) | opf(faligndata_opf) | fs2(s2, FloatRegisterImpl::D)); }
    +  inline void faligndata( FloatRegister s1, FloatRegister s2, FloatRegister d );
     
    -  void fzero( FloatRegisterImpl::Width w, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fzero_op3) | opf(0x62 - w)); }
    +  inline void fzero( FloatRegisterImpl::Width w, FloatRegister d );
     
    -  void fsrc2( FloatRegisterImpl::Width w, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fsrc_op3) | opf(0x7A - w) | fs2(s2, w)); }
    +  inline void fsrc2( FloatRegisterImpl::Width w, FloatRegister s2, FloatRegister d );
     
    -  void fnot1( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fnot_op3) | fs1(s1, w) | opf(0x6C - w)); }
    +  inline void fnot1( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister d );
     
    -  void fpmerge( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(0x36) | fs1(s1, FloatRegisterImpl::S) | opf(0x4b) | fs2(s2, FloatRegisterImpl::S)); }
    +  inline void fpmerge( FloatRegister s1, FloatRegister s2, FloatRegister d );
     
    -  void stpartialf( Register s1, Register s2, FloatRegister d, int ia = -1 ) { vis1_only(); emit_int32( op(ldst_op) | fd(d, FloatRegisterImpl::D) | op3(stpartialf_op3) | rs1(s1) | imm_asi(ia) | rs2(s2)); }
    +  inline void stpartialf( Register s1, Register s2, FloatRegister d, int ia = -1 );
     
       //  VIS2 instructions
     
    -  void edge8n( Register s1, Register s2, Register d ) { vis2_only(); emit_int32( op(arith_op) | rd(d) | op3(edge_op3) | rs1(s1) | opf(edge8n_opf) | rs2(s2)); }
    +  inline void edge8n( Register s1, Register s2, Register d );
     
    -  void bmask( Register s1, Register s2, Register d ) { vis2_only(); emit_int32( op(arith_op) | rd(d) | op3(bmask_op3) | rs1(s1) | opf(bmask_opf) | rs2(s2)); }
    -  void bshuffle( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis2_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(bshuffle_op3) | fs1(s1, FloatRegisterImpl::D) | opf(bshuffle_opf) | fs2(s2, FloatRegisterImpl::D)); }
    +  inline void bmask( Register s1, Register s2, Register d );
    +  inline void bshuffle( FloatRegister s1, FloatRegister s2, FloatRegister d );
     
       // VIS3 instructions
     
    -  void movstosw( FloatRegister s, Register d ) { vis3_only();  emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstosw_opf) | fs2(s, FloatRegisterImpl::S)); }
    -  void movstouw( FloatRegister s, Register d ) { vis3_only();  emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstouw_opf) | fs2(s, FloatRegisterImpl::S)); }
    -  void movdtox(  FloatRegister s, Register d ) { vis3_only();  emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mdtox_opf) | fs2(s, FloatRegisterImpl::D)); }
    +  inline void movstosw( FloatRegister s, Register d );
    +  inline void movstouw( FloatRegister s, Register d );
    +  inline void movdtox(  FloatRegister s, Register d );
     
    -  void movwtos( Register s, FloatRegister d ) { vis3_only();  emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(mftoi_op3) | opf(mwtos_opf) | rs2(s)); }
    -  void movxtod( Register s, FloatRegister d ) { vis3_only();  emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(mftoi_op3) | opf(mxtod_opf) | rs2(s)); }
    +  inline void movwtos( Register s, FloatRegister d );
    +  inline void movxtod( Register s, FloatRegister d );
     
    -  void xmulx(Register s1, Register s2, Register d) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(xmulx_op3) | rs1(s1) | opf(xmulx_opf) | rs2(s2)); }
    -  void xmulxhi(Register s1, Register s2, Register d) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(xmulx_op3) | rs1(s1) | opf(xmulxhi_opf) | rs2(s2)); }
    +  inline void xmulx(Register s1, Register s2, Register d);
    +  inline void xmulxhi(Register s1, Register s2, Register d);
     
       // Crypto SHA instructions
     
    -  void sha1()   { sha1_only();    emit_int32( op(arith_op) | op3(sha_op3) | opf(sha1_opf)); }
    -  void sha256() { sha256_only();  emit_int32( op(arith_op) | op3(sha_op3) | opf(sha256_opf)); }
    -  void sha512() { sha512_only();  emit_int32( op(arith_op) | op3(sha_op3) | opf(sha512_opf)); }
    +  inline void sha1();
    +  inline void sha256();
    +  inline void sha512();
     
       // CRC32C instruction
     
    -  void crc32c( FloatRegister s1, FloatRegister s2, FloatRegister d ) { crc32c_only();  emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(crc32c_op3) | fs1(s1, FloatRegisterImpl::D) | opf(crc32c_opf) | fs2(s2, FloatRegisterImpl::D)); }
    +  inline void crc32c( FloatRegister s1, FloatRegister s2, FloatRegister d );
     
       // Creation
       Assembler(CodeBuffer* code) : AbstractAssembler(code) {
    diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
    index 197e26fa6f8..c18b07ec019 100644
    --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
    +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
    @@ -28,6 +28,12 @@
     #include "asm/assembler.hpp"
     
     
    +inline void Assembler::insert_nop_after_cbcond() {
    +  if (UseCBCond && cbcond_before()) {
    +    nop();
    +  }
    +}
    +
     inline void Assembler::check_delay() {
     # ifdef CHECK_DELAY
       guarantee( delay_state != at_delay_slot, "must say delayed() when filling delay slot");
    @@ -40,6 +46,10 @@ inline void Assembler::emit_int32(int x) {
       AbstractAssembler::emit_int32(x);
     }
     
    +inline void Assembler::emit_data(int x) {
    +  emit_int32(x);
    +}
    +
     inline void Assembler::emit_data(int x, relocInfo::relocType rtype) {
       relocate(rtype);
       emit_int32(x);
    @@ -54,6 +64,29 @@ inline void Assembler::emit_data(int x, RelocationHolder const& rspec) {
     inline void Assembler::add(Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | rs2(s2) ); }
     inline void Assembler::add(Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
     
    +inline void Assembler::addcc(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::addcc(  Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::addc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3             ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::addc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::addccc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::addccc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
    +inline void Assembler::aes_eround01(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround01_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    +inline void Assembler::aes_eround23(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround23_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    +inline void Assembler::aes_dround01(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround01_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    +inline void Assembler::aes_dround23(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround23_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    +inline void Assembler::aes_eround01_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround01_l_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    +inline void Assembler::aes_eround23_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround23_l_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    +inline void Assembler::aes_dround01_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround01_l_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    +inline void Assembler::aes_dround23_l(  FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround23_l_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    +inline void Assembler::aes_kexpand1(  FloatRegister s1, FloatRegister s2, int imm5a, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | u_field(imm5a, 13, 9) | op5(aes_kexpand1_op5) | fs2(s2, FloatRegisterImpl::D) ); }
    +
    +
    +// 3-operand AES instructions
    +
    +inline void Assembler::aes_kexpand0(  FloatRegister s1, FloatRegister s2, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes3_op3) | fs1(s1, FloatRegisterImpl::D) | opf(aes_kexpand0_opf) | fs2(s2, FloatRegisterImpl::D) ); }
    +inline void Assembler::aes_kexpand2(  FloatRegister s1, FloatRegister s2, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes3_op3) | fs1(s1, FloatRegisterImpl::D) | opf(aes_kexpand2_opf) | fs2(s2, FloatRegisterImpl::D) ); }
    +
     inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, address d, relocInfo::relocType rt ) { v9_only(); insert_nop_after_cbcond(); cti();  emit_data( op(branch_op) | annul(a) | cond(c) | op2(bpr_op2) | wdisp16(intptr_t(d), intptr_t(pc())) | predict(p) | rs1(s1), rt);  has_delay_slot(); }
     inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, Label& L) { insert_nop_after_cbcond(); bpr( c, a, p, s1, target(L)); }
     
    @@ -78,9 +111,56 @@ inline void Assembler::call( Label& L,   relocInfo::relocType rt ) { insert_nop_
     
     inline void Assembler::call( address d,  RelocationHolder const& rspec ) { insert_nop_after_cbcond(); cti();  emit_data( op(call_op) | wdisp(intptr_t(d), intptr_t(pc()), 30), rspec);  has_delay_slot(); assert(rspec.type() != relocInfo::virtual_call_type, "must use virtual_call_Relocation::spec"); }
     
    +inline void Assembler::casa(  Register s1, Register s2, Register d, int ia ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(casa_op3 ) | rs1(s1) | (ia == -1  ? immed(true) : imm_asi(ia)) | rs2(s2)); }
    +inline void Assembler::casxa( Register s1, Register s2, Register d, int ia ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(casxa_op3) | rs1(s1) | (ia == -1  ? immed(true) : imm_asi(ia)) | rs2(s2)); }
    +
    +inline void Assembler::udiv(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3             ) | rs1(s1) | rs2(s2)); }
    +inline void Assembler::udiv(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::sdiv(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3             ) | rs1(s1) | rs2(s2)); }
    +inline void Assembler::sdiv(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::udivcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); }
    +inline void Assembler::udivcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::sdivcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); }
    +inline void Assembler::sdivcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
    +inline void Assembler::done()  { v9_only();  cti();  emit_int32( op(arith_op) | fcn(0) | op3(done_op3) ); }
    +inline void Assembler::retry() { v9_only();  cti();  emit_int32( op(arith_op) | fcn(1) | op3(retry_op3) ); }
    +
    +inline void Assembler::fadd( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x40 + w) | fs2(s2, w)); }
    +inline void Assembler::fsub( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x44 + w) | fs2(s2, w)); }
    +
    +inline void Assembler::fcmp(  FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x50 + w) | fs2(s2, w)); }
    +inline void Assembler::fcmpe( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x54 + w) | fs2(s2, w)); }
    +
    +inline void Assembler::ftox( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only();  emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(fpop1_op3) | opf(0x80 + w) | fs2(s, w)); }
    +inline void Assembler::ftoi( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) {             emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(fpop1_op3) | opf(0xd0 + w) | fs2(s, w)); }
    +
    +inline void Assembler::ftof( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | opf(0xc0 + sw + dw*4) | fs2(s, sw)); }
    +
    +inline void Assembler::fxtof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only();  emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x80 + w*4) | fs2(s, FloatRegisterImpl::D)); }
    +inline void Assembler::fitof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) {             emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0xc0 + w*4) | fs2(s, FloatRegisterImpl::S)); }
    +
    +inline void Assembler::fmov( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x00 + w) | fs2(s, w)); }
    +inline void Assembler::fneg( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x04 + w) | fs2(s, w)); }
    +inline void Assembler::fabs( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x08 + w) | fs2(s, w)); }
    +inline void Assembler::fmul( FloatRegisterImpl::Width w,                            FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w)  | op3(fpop1_op3) | fs1(s1, w)  | opf(0x48 + w)         | fs2(s2, w)); }
    +inline void Assembler::fmul( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw,  FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | fs1(s1, sw) | opf(0x60 + sw + dw*4) | fs2(s2, sw)); }
    +inline void Assembler::fdiv( FloatRegisterImpl::Width w,                            FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w)  | op3(fpop1_op3) | fs1(s1, w)  | opf(0x4c + w)         | fs2(s2, w)); }
    +
    +inline void Assembler::fxor( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(flog3_op3) | fs1(s1, w) | opf(0x6E - w) | fs2(s2, w)); }
    +
    +inline void Assembler::fsqrt( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x28 + w) | fs2(s, w)); }
    +
     inline void Assembler::flush( Register s1, Register s2) { emit_int32( op(arith_op) | op3(flush_op3) | rs1(s1) | rs2(s2)); }
     inline void Assembler::flush( Register s1, int simm13a) { emit_data( op(arith_op) | op3(flush_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
     
    +inline void Assembler::flushw() { v9_only();  emit_int32( op(arith_op) | op3(flushw_op3) ); }
    +
    +inline void Assembler::illtrap( int const22a) { if (const22a != 0) v9_only();  emit_int32( op(branch_op) | u_field(const22a, 21, 0) ); }
    +
    +inline void Assembler::impdep1( int id1, int const19a ) { v9_only();  emit_int32( op(arith_op) | fcn(id1) | op3(impdep1_op3) | u_field(const19a, 18, 0)); }
    +inline void Assembler::impdep2( int id1, int const19a ) { v9_only();  emit_int32( op(arith_op) | fcn(id1) | op3(impdep2_op3) | u_field(const19a, 18, 0)); }
    +
     inline void Assembler::jmpl( Register s1, Register s2, Register d ) { insert_nop_after_cbcond(); cti();  emit_int32( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | rs2(s2));  has_delay_slot(); }
     inline void Assembler::jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { insert_nop_after_cbcond(); cti();  emit_data( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec);  has_delay_slot(); }
     
    @@ -90,6 +170,9 @@ inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, int simm13a,
     inline void Assembler::ldxfsr( Register s1, Register s2) { v9_only();  emit_int32( op(ldst_op) | rd(G1)    | op3(ldfsr_op3) | rs1(s1) | rs2(s2) ); }
     inline void Assembler::ldxfsr( Register s1, int simm13a) { v9_only();  emit_data( op(ldst_op) | rd(G1)    | op3(ldfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
     
    +inline void Assembler::ldfa(  FloatRegisterImpl::Width w, Register s1, Register s2, int ia, FloatRegister d ) { v9_only();  emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::ldfa(  FloatRegisterImpl::Width w, Register s1, int simm13a,         FloatRegister d ) { v9_only();  emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
     inline void Assembler::ldsb(  Register s1, Register s2, Register d) { emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3) | rs1(s1) | rs2(s2) ); }
     inline void Assembler::ldsb(  Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldsb_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
     
    @@ -109,11 +192,134 @@ inline void Assembler::ldx(   Register s1, int simm13a, Register d) { v9_only();
     inline void Assembler::ldd(   Register s1, Register s2, Register d) { v9_dep(); assert(d->is_even(), "not even"); emit_int32( op(ldst_op) | rd(d) | op3(ldd_op3) | rs1(s1) | rs2(s2) ); }
     inline void Assembler::ldd(   Register s1, int simm13a, Register d) { v9_dep(); assert(d->is_even(), "not even"); emit_data( op(ldst_op) | rd(d) | op3(ldd_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
     
    +inline void Assembler::ldsba(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::ldsba(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::ldsha(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::ldsha(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::ldswa(  Register s1, Register s2, int ia, Register d ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::ldswa(  Register s1, int simm13a,         Register d ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::lduba(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::lduba(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::lduha(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::lduha(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::lduwa(  Register s1, Register s2, int ia, Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::lduwa(  Register s1, int simm13a,         Register d ) {             emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::ldxa(   Register s1, Register s2, int ia, Register d ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3  | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::ldxa(   Register s1, int simm13a,         Register d ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3  | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
    +inline void Assembler::and3(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3              ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::and3(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3              ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::andcc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::andcc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::andn(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3             ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::andn(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::andncc(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::andncc(  Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::or3(     Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3               ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::or3(     Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3               ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::orcc(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3   | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::orcc(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3   | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::orn(     Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::orn(     Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::orncc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::orncc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::xor3(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3              ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::xor3(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3              ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::xorcc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::xorcc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::xnor(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3             ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::xnor(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::xnorcc(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::xnorcc(  Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
    +inline void Assembler::membar( Membar_mask_bits const7a ) { v9_only(); emit_int32( op(arith_op) | op3(membar_op3) | rs1(O7) | immed(true) | u_field( int(const7a), 6, 0)); }
    +
    +inline void Assembler::fmov( FloatRegisterImpl::Width w, Condition c,  bool floatCC, CC cca, FloatRegister s2, FloatRegister d ) { v9_only();  emit_int32( op(arith_op) | fd(d, w) | op3(fpop2_op3) | cond_mov(c) | opf_cc(cca, floatCC) | opf_low6(w) | fs2(s2, w)); }
    +
    +inline void Assembler::fmov( FloatRegisterImpl::Width w, RCondition c, Register s1,  FloatRegister s2, FloatRegister d ) { v9_only();  emit_int32( op(arith_op) | fd(d, w) | op3(fpop2_op3) | rs1(s1) | rcond(c) | opf_low5(4 + w) | fs2(s2, w)); }
    +
    +inline void Assembler::movcc( Condition c, bool floatCC, CC cca, Register s2, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | rs2(s2) ); }
    +inline void Assembler::movcc( Condition c, bool floatCC, CC cca, int simm11a, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | immed(true) | simm(simm11a, 11) ); }
    +
    +inline void Assembler::movr( RCondition c, Register s1, Register s2,  Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | rs2(s2) ); }
    +inline void Assembler::movr( RCondition c, Register s1, int simm10a,  Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | immed(true) | simm(simm10a, 10) ); }
    +
    +inline void Assembler::mulx(  Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::mulx(  Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::sdivx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::sdivx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::udivx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::udivx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
    +inline void Assembler::umul(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3             ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::umul(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::smul(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3             ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::smul(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::umulcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::umulcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::smulcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::smulcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
    +inline void Assembler::nop() { emit_int32( op(branch_op) | op2(sethi_op2) ); }
    +
    +inline void Assembler::sw_count() { emit_int32( op(branch_op) | op2(sethi_op2) | 0x3f0 ); }
    +
    +inline void Assembler::popc( Register s,  Register d) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(popc_op3) | rs2(s)); }
    +inline void Assembler::popc( int simm13a, Register d) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(popc_op3) | immed(true) | simm(simm13a, 13)); }
    +
    +inline void Assembler::prefetch(   Register s1, Register s2, PrefetchFcn f) { v9_only();  emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::prefetch(   Register s1, int simm13a, PrefetchFcn f) { v9_only();  emit_data( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
    +
    +inline void Assembler::prefetcha(  Register s1, Register s2, int ia, PrefetchFcn f ) { v9_only();  emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::prefetcha(  Register s1, int simm13a,         PrefetchFcn f ) { v9_only();  emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
    +inline void Assembler::rdy(    Register d) { v9_dep();  emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(0, 18, 14)); }
    +inline void Assembler::rdccr(  Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(2, 18, 14)); }
    +inline void Assembler::rdasi(  Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(3, 18, 14)); }
    +inline void Assembler::rdtick( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(4, 18, 14)); } // Spoon!
    +inline void Assembler::rdpc(   Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(5, 18, 14)); }
    +inline void Assembler::rdfprs( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(6, 18, 14)); }
    +
     inline void Assembler::rett( Register s1, Register s2                         ) { cti();  emit_int32( op(arith_op) | op3(rett_op3) | rs1(s1) | rs2(s2));  has_delay_slot(); }
     inline void Assembler::rett( Register s1, int simm13a, relocInfo::relocType rt) { cti();  emit_data( op(arith_op) | op3(rett_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rt);  has_delay_slot(); }
     
    +inline void Assembler::save(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::save(    Register s1, int simm13a, Register d ) {
    +  // make sure frame is at least large enough for the register save area
    +  assert(-simm13a >= 16 * wordSize, "frame too small");
    +  emit_int32( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) );
    +}
    +
    +inline void Assembler::restore( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::restore( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
    +// pp 216
    +
    +inline void Assembler::saved()    { v9_only();  emit_int32( op(arith_op) | fcn(0) | op3(saved_op3)); }
    +inline void Assembler::restored() { v9_only();  emit_int32( op(arith_op) | fcn(1) | op3(saved_op3)); }
    +
     inline void Assembler::sethi( int imm22a, Register d, RelocationHolder const& rspec ) { emit_data( op(branch_op) | rd(d) | op2(sethi_op2) | hi22(imm22a), rspec); }
     
    +inline void Assembler::sll(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
    +inline void Assembler::sll(  Register s1, int imm5a,   Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
    +inline void Assembler::srl(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
    +inline void Assembler::srl(  Register s1, int imm5a,   Register d ) { emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
    +inline void Assembler::sra(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | rs2(s2) ); }
    +inline void Assembler::sra(  Register s1, int imm5a,   Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); }
    +
    +inline void Assembler::sllx( Register s1, Register s2, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
    +inline void Assembler::sllx( Register s1, int imm6a,   Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
    +inline void Assembler::srlx( Register s1, Register s2, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
    +inline void Assembler::srlx( Register s1, int imm6a,   Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
    +inline void Assembler::srax( Register s1, Register s2, Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | rs2(s2) ); }
    +inline void Assembler::srax( Register s1, int imm6a,   Register d ) { v9_only();  emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); }
    +
    +inline void Assembler::sir( int simm13a ) { emit_int32( op(arith_op) | fcn(15) | op3(sir_op3) | immed(true) | simm(simm13a, 13)); }
    +
    +  // pp 221
    +
    +inline void Assembler::stbar() { emit_int32( op(arith_op) | op3(membar_op3) | u_field(15, 18, 14)); }
    +
       // pp 222
     
     inline void Assembler::stf(    FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2) { emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | rs2(s2) ); }
    @@ -122,6 +328,9 @@ inline void Assembler::stf(    FloatRegisterImpl::Width w, FloatRegister d, Regi
     inline void Assembler::stxfsr( Register s1, Register s2) { v9_only();  emit_int32( op(ldst_op) | rd(G1)    | op3(stfsr_op3) | rs1(s1) | rs2(s2) ); }
     inline void Assembler::stxfsr( Register s1, int simm13a) { v9_only();  emit_data( op(ldst_op) | rd(G1)    | op3(stfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
     
    +inline void Assembler::stfa(  FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2, int ia ) { v9_only();  emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::stfa(  FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a         ) { v9_only();  emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
       // p 226
     
     inline void Assembler::stb(  Register d, Register s1, Register s2) { emit_int32( op(ldst_op) | rd(d) | op3(stb_op3) | rs1(s1) | rs2(s2) ); }
    @@ -137,9 +346,103 @@ inline void Assembler::stx(  Register d, Register s1, int simm13a) { v9_only();
     inline void Assembler::std(  Register d, Register s1, Register s2) { v9_dep(); assert(d->is_even(), "not even"); emit_int32( op(ldst_op) | rd(d) | op3(std_op3) | rs1(s1) | rs2(s2) ); }
     inline void Assembler::std(  Register d, Register s1, int simm13a) { v9_dep(); assert(d->is_even(), "not even"); emit_data( op(ldst_op) | rd(d) | op3(std_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
     
    +inline void Assembler::stba(  Register d, Register s1, Register s2, int ia ) {             emit_int32( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::stba(  Register d, Register s1, int simm13a         ) {             emit_int32( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::stha(  Register d, Register s1, Register s2, int ia ) {             emit_int32( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::stha(  Register d, Register s1, int simm13a         ) {             emit_int32( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::stwa(  Register d, Register s1, Register s2, int ia ) {             emit_int32( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::stwa(  Register d, Register s1, int simm13a         ) {             emit_int32( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::stxa(  Register d, Register s1, Register s2, int ia ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::stxa(  Register d, Register s1, int simm13a         ) { v9_only();  emit_int32( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::stda(  Register d, Register s1, Register s2, int ia ) {             emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::stda(  Register d, Register s1, int simm13a         ) {             emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
    +// pp 230
    +
    +inline void Assembler::sub(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3              ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::sub(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3              ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
    +inline void Assembler::subcc(  Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::subcc(  Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::subc(   Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3             ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::subc(   Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +inline void Assembler::subccc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::subccc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
     // pp 231
     
     inline void Assembler::swap(    Register s1, Register s2, Register d) { v9_dep();  emit_int32( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | rs2(s2) ); }
     inline void Assembler::swap(    Register s1, int simm13a, Register d) { v9_dep();  emit_data( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
     
    +inline void Assembler::swapa(   Register s1, Register s2, int ia, Register d ) { v9_dep();  emit_int32( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
    +inline void Assembler::swapa(   Register s1, int simm13a,         Register d ) { v9_dep();  emit_int32( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
    +// pp 234, note op in book is wrong, see pp 268
    +
    +inline void Assembler::taddcc(    Register s1, Register s2, Register d ) {            emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3  ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::taddcc(    Register s1, int simm13a, Register d ) {            emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3  ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
    +// pp 235
    +
    +inline void Assembler::tsubcc(    Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3  ) | rs1(s1) | rs2(s2) ); }
    +inline void Assembler::tsubcc(    Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3  ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    +
    +// pp 237
    +
    +inline void Assembler::trap( Condition c, CC cc, Register s1, Register s2 ) { emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | rs2(s2)); }
    +inline void Assembler::trap( Condition c, CC cc, Register s1, int trapa   ) { emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | immed(true) | u_field(trapa, 6, 0)); }
    +// simple uncond. trap
    +inline void Assembler::trap( int trapa ) { trap( always, icc, G0, trapa ); }
    +
    +inline void Assembler::wry(Register d) { v9_dep(); emit_int32(op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(0, 29, 25)); }
    +inline void Assembler::wrccr(Register s) { v9_only(); emit_int32(op(arith_op) | rs1(s) | op3(wrreg_op3) | u_field(2, 29, 25)); }
    +inline void Assembler::wrccr(Register s, int simm13a) { v9_only(); emit_int32(op(arith_op) | rs1(s) | op3(wrreg_op3) | u_field(2, 29, 25) | immed(true) | simm(simm13a, 13)); }
    +inline void Assembler::wrasi(Register d) { v9_only(); emit_int32(op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(3, 29, 25)); }
    +// wrasi(d, imm) stores (d xor imm) to asi
    +inline void Assembler::wrasi(Register d, int simm13a) { v9_only(); emit_int32(op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(3, 29, 25) | immed(true) | simm(simm13a, 13)); }
    +inline void Assembler::wrfprs(Register d) { v9_only(); emit_int32(op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(6, 29, 25)); }
    +
    +inline void Assembler::alignaddr( Register s1, Register s2, Register d ) { vis1_only(); emit_int32( op(arith_op) | rd(d) | op3(alignaddr_op3) | rs1(s1) | opf(alignaddr_opf) | rs2(s2)); }
    +
    +inline void Assembler::faligndata( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(faligndata_op3) | fs1(s1, FloatRegisterImpl::D) | opf(faligndata_opf) | fs2(s2, FloatRegisterImpl::D)); }
    +
    +inline void Assembler::fzero( FloatRegisterImpl::Width w, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fzero_op3) | opf(0x62 - w)); }
    +
    +inline void Assembler::fsrc2( FloatRegisterImpl::Width w, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fsrc_op3) | opf(0x7A - w) | fs2(s2, w)); }
    +
    +inline void Assembler::fnot1( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fnot_op3) | fs1(s1, w) | opf(0x6C - w)); }
    +
    +inline void Assembler::fpmerge( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(0x36) | fs1(s1, FloatRegisterImpl::S) | opf(0x4b) | fs2(s2, FloatRegisterImpl::S)); }
    +
    +inline void Assembler::stpartialf( Register s1, Register s2, FloatRegister d, int ia ) { vis1_only(); emit_int32( op(ldst_op) | fd(d, FloatRegisterImpl::D) | op3(stpartialf_op3) | rs1(s1) | imm_asi(ia) | rs2(s2)); }
    +
    +//  VIS2 instructions
    +
    +inline void Assembler::edge8n( Register s1, Register s2, Register d ) { vis2_only(); emit_int32( op(arith_op) | rd(d) | op3(edge_op3) | rs1(s1) | opf(edge8n_opf) | rs2(s2)); }
    +
    +inline void Assembler::bmask( Register s1, Register s2, Register d ) { vis2_only(); emit_int32( op(arith_op) | rd(d) | op3(bmask_op3) | rs1(s1) | opf(bmask_opf) | rs2(s2)); }
    +inline void Assembler::bshuffle( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis2_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(bshuffle_op3) | fs1(s1, FloatRegisterImpl::D) | opf(bshuffle_opf) | fs2(s2, FloatRegisterImpl::D)); }
    +
    +// VIS3 instructions
    +
    +inline void Assembler::movstosw( FloatRegister s, Register d ) { vis3_only();  emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstosw_opf) | fs2(s, FloatRegisterImpl::S)); }
    +inline void Assembler::movstouw( FloatRegister s, Register d ) { vis3_only();  emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstouw_opf) | fs2(s, FloatRegisterImpl::S)); }
    +inline void Assembler::movdtox(  FloatRegister s, Register d ) { vis3_only();  emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mdtox_opf) | fs2(s, FloatRegisterImpl::D)); }
    +
    +inline void Assembler::movwtos( Register s, FloatRegister d ) { vis3_only();  emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(mftoi_op3) | opf(mwtos_opf) | rs2(s)); }
    +inline void Assembler::movxtod( Register s, FloatRegister d ) { vis3_only();  emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(mftoi_op3) | opf(mxtod_opf) | rs2(s)); }
    +
    +inline void Assembler::xmulx(Register s1, Register s2, Register d) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(xmulx_op3) | rs1(s1) | opf(xmulx_opf) | rs2(s2)); }
    +inline void Assembler::xmulxhi(Register s1, Register s2, Register d) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(xmulx_op3) | rs1(s1) | opf(xmulxhi_opf) | rs2(s2)); }
    +
    +// Crypto SHA instructions
    +
    +inline void Assembler::sha1()   { sha1_only();    emit_int32( op(arith_op) | op3(sha_op3) | opf(sha1_opf)); }
    +inline void Assembler::sha256() { sha256_only();  emit_int32( op(arith_op) | op3(sha_op3) | opf(sha256_opf)); }
    +inline void Assembler::sha512() { sha512_only();  emit_int32( op(arith_op) | op3(sha_op3) | opf(sha512_opf)); }
    +
    +// CRC32C instruction
    +
    +inline void Assembler::crc32c( FloatRegister s1, FloatRegister s2, FloatRegister d ) { crc32c_only();  emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(crc32c_op3) | fs1(s1, FloatRegisterImpl::D) | opf(crc32c_opf) | fs2(s2, FloatRegisterImpl::D)); }
    +
     #endif // CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP
    diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp
    index 0c4fc97cc6b..baee6280a47 100644
    --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp
    +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp
    @@ -181,19 +181,6 @@ void MacroAssembler::null_check(Register reg, int offset) {
     
     // Ring buffer jumps
     
    -#ifndef PRODUCT
    -void MacroAssembler::ret(  bool trace )   { if (trace) {
    -                                                    mov(I7, O7); // traceable register
    -                                                    JMP(O7, 2 * BytesPerInstWord);
    -                                                  } else {
    -                                                    jmpl( I7, 2 * BytesPerInstWord, G0 );
    -                                                  }
    -                                                }
    -
    -void MacroAssembler::retl( bool trace )  { if (trace) JMP(O7, 2 * BytesPerInstWord);
    -                                                 else jmpl( O7, 2 * BytesPerInstWord, G0 ); }
    -#endif /* PRODUCT */
    -
     
     void MacroAssembler::jmp2(Register r1, Register r2, const char* file, int line ) {
       assert_not_delayed();
    diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp
    index b9e34133328..3443c3f3a87 100644
    --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp
    +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp
    @@ -720,8 +720,8 @@ class MacroAssembler : public Assembler {
       inline int get_pc( Register d );
     
       // Sparc shorthands(pp 85, V8 manual, pp 289 V9 manual)
    -  inline void cmp(  Register s1, Register s2 ) { subcc( s1, s2, G0 ); }
    -  inline void cmp(  Register s1, int simm13a ) { subcc( s1, simm13a, G0 ); }
    +  inline void cmp(  Register s1, Register s2 );
    +  inline void cmp(  Register s1, int simm13a );
     
       inline void jmp( Register s1, Register s2 );
       inline void jmp( Register s1, int simm13a, RelocationHolder const& rspec = RelocationHolder() );
    @@ -741,23 +741,10 @@ class MacroAssembler : public Assembler {
       inline void iprefetch( address d, relocInfo::relocType rt = relocInfo::none );
       inline void iprefetch( Label& L);
     
    -  inline void tst( Register s ) { orcc( G0, s, G0 ); }
    +  inline void tst( Register s );
     
    -#ifdef PRODUCT
    -  inline void ret(  bool trace = TraceJumps )   { if (trace) {
    -                                                    mov(I7, O7); // traceable register
    -                                                    JMP(O7, 2 * BytesPerInstWord);
    -                                                  } else {
    -                                                    jmpl( I7, 2 * BytesPerInstWord, G0 );
    -                                                  }
    -                                                }
    -
    -  inline void retl( bool trace = TraceJumps )  { if (trace) JMP(O7, 2 * BytesPerInstWord);
    -                                                 else jmpl( O7, 2 * BytesPerInstWord, G0 ); }
    -#else
    -  void ret(  bool trace = TraceJumps );
    -  void retl( bool trace = TraceJumps );
    -#endif /* PRODUCT */
    +  inline void ret(  bool trace = TraceJumps );
    +  inline void retl( bool trace = TraceJumps );
     
       // Required platform-specific helpers for Label::patch_instructions.
       // They _shadow_ the declarations in AbstractAssembler, which are undefined.
    @@ -790,26 +777,20 @@ public:
       static int insts_for_set64(jlong value);
     
       // sign-extend 32 to 64
    -  inline void signx( Register s, Register d ) { sra( s, G0, d); }
    -  inline void signx( Register d )             { sra( d, G0, d); }
    +  inline void signx( Register s, Register d );
    +  inline void signx( Register d );
     
    -  inline void not1( Register s, Register d ) { xnor( s, G0, d ); }
    -  inline void not1( Register d )             { xnor( d, G0, d ); }
    +  inline void not1( Register s, Register d );
    +  inline void not1( Register d );
     
    -  inline void neg( Register s, Register d ) { sub( G0, s, d ); }
    -  inline void neg( Register d )             { sub( G0, d, d ); }
    +  inline void neg( Register s, Register d );
    +  inline void neg( Register d );
     
    -  inline void cas(  Register s1, Register s2, Register d) { casa( s1, s2, d, ASI_PRIMARY); }
    -  inline void casx( Register s1, Register s2, Register d) { casxa(s1, s2, d, ASI_PRIMARY); }
    +  inline void cas(  Register s1, Register s2, Register d);
    +  inline void casx( Register s1, Register s2, Register d);
       // Functions for isolating 64 bit atomic swaps for LP64
       // cas_ptr will perform cas for 32 bit VM's and casx for 64 bit VM's
    -  inline void cas_ptr(  Register s1, Register s2, Register d) {
    -#ifdef _LP64
    -    casx( s1, s2, d );
    -#else
    -    cas( s1, s2, d );
    -#endif
    -  }
    +  inline void cas_ptr(  Register s1, Register s2, Register d);
     
       // Functions for isolating 64 bit shifts for LP64
       inline void sll_ptr( Register s1, Register s2, Register d );
    @@ -819,14 +800,14 @@ public:
       inline void srl_ptr( Register s1, int imm6a,   Register d );
     
       // little-endian
    -  inline void casl(  Register s1, Register s2, Register d) { casa( s1, s2, d, ASI_PRIMARY_LITTLE); }
    -  inline void casxl( Register s1, Register s2, Register d) { casxa(s1, s2, d, ASI_PRIMARY_LITTLE); }
    +  inline void casl(  Register s1, Register s2, Register d);
    +  inline void casxl( Register s1, Register s2, Register d);
     
    -  inline void inc(   Register d,  int const13 = 1 ) { add(   d, const13, d); }
    -  inline void inccc( Register d,  int const13 = 1 ) { addcc( d, const13, d); }
    +  inline void inc(   Register d,  int const13 = 1 );
    +  inline void inccc( Register d,  int const13 = 1 );
     
    -  inline void dec(   Register d,  int const13 = 1 ) { sub(   d, const13, d); }
    -  inline void deccc( Register d,  int const13 = 1 ) { subcc( d, const13, d); }
    +  inline void dec(   Register d,  int const13 = 1 );
    +  inline void deccc( Register d,  int const13 = 1 );
     
       using Assembler::add;
       inline void add(Register s1, int simm13a, Register d, relocInfo::relocType rtype);
    @@ -837,19 +818,19 @@ public:
       using Assembler::andn;
       inline void andn(  Register s1, RegisterOrConstant s2, Register d);
     
    -  inline void btst( Register s1,  Register s2 ) { andcc( s1, s2, G0 ); }
    -  inline void btst( int simm13a,  Register s )  { andcc( s,  simm13a, G0 ); }
    +  inline void btst( Register s1,  Register s2 );
    +  inline void btst( int simm13a,  Register s );
     
    -  inline void bset( Register s1,  Register s2 ) { or3( s1, s2, s2 ); }
    -  inline void bset( int simm13a,  Register s )  { or3( s,  simm13a, s ); }
    +  inline void bset( Register s1,  Register s2 );
    +  inline void bset( int simm13a,  Register s );
     
    -  inline void bclr( Register s1,  Register s2 ) { andn( s1, s2, s2 ); }
    -  inline void bclr( int simm13a,  Register s )  { andn( s,  simm13a, s ); }
    +  inline void bclr( Register s1,  Register s2 );
    +  inline void bclr( int simm13a,  Register s );
     
    -  inline void btog( Register s1,  Register s2 ) { xor3( s1, s2, s2 ); }
    -  inline void btog( int simm13a,  Register s )  { xor3( s,  simm13a, s ); }
    +  inline void btog( Register s1,  Register s2 );
    +  inline void btog( int simm13a,  Register s );
     
    -  inline void clr( Register d ) { or3( G0, G0, d ); }
    +  inline void clr( Register d );
     
       inline void clrb( Register s1, Register s2);
       inline void clrh( Register s1, Register s2);
    @@ -862,9 +843,9 @@ public:
       inline void clrx( Register s1, int simm13a);
     
       // copy & clear upper word
    -  inline void clruw( Register s, Register d ) { srl( s, G0, d); }
    +  inline void clruw( Register s, Register d );
       // clear upper word
    -  inline void clruwu( Register d ) { srl( d, G0, d); }
    +  inline void clruwu( Register d );
     
       using Assembler::ldsb;
       using Assembler::ldsh;
    @@ -908,10 +889,10 @@ public:
       inline void ldf(FloatRegisterImpl::Width w, const Address& a, FloatRegister d, int offset = 0);
     
       // little-endian
    -  inline void lduwl(Register s1, Register s2, Register d) { lduwa(s1, s2, ASI_PRIMARY_LITTLE, d); }
    -  inline void ldswl(Register s1, Register s2, Register d) { ldswa(s1, s2, ASI_PRIMARY_LITTLE, d);}
    -  inline void ldxl( Register s1, Register s2, Register d) { ldxa(s1, s2, ASI_PRIMARY_LITTLE, d); }
    -  inline void ldfl(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { ldfa(w, s1, s2, ASI_PRIMARY_LITTLE, d); }
    +  inline void lduwl(Register s1, Register s2, Register d);
    +  inline void ldswl(Register s1, Register s2, Register d);
    +  inline void ldxl( Register s1, Register s2, Register d);
    +  inline void ldfl(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d);
     
       // membar psuedo instruction.  takes into account target memory model.
       inline void membar( Assembler::Membar_mask_bits const7a );
    @@ -920,17 +901,11 @@ public:
       inline bool membar_has_effect( Assembler::Membar_mask_bits const7a );
     
       // mov pseudo instructions
    -  inline void mov( Register s,  Register d) {
    -    if ( s != d )    or3( G0, s, d);
    -    else             assert_not_delayed();  // Put something useful in the delay slot!
    -  }
    +  inline void mov( Register s,  Register d);
     
    -  inline void mov_or_nop( Register s,  Register d) {
    -    if ( s != d )    or3( G0, s, d);
    -    else             nop();
    -  }
    +  inline void mov_or_nop( Register s,  Register d);
     
    -  inline void mov( int simm13a, Register d) { or3( G0, simm13a, d); }
    +  inline void mov( int simm13a, Register d);
     
       using Assembler::prefetch;
       inline void prefetch(const Address& a, PrefetchFcn F, int offset = 0);
    @@ -1005,11 +980,7 @@ public:
     
       // handy macros:
     
    -  inline void round_to( Register r, int modulus ) {
    -    assert_not_delayed();
    -    inc( r, modulus - 1 );
    -    and3( r, -modulus, r );
    -  }
    +  inline void round_to( Register r, int modulus );
     
       // --------------------------------------------------
     
    @@ -1077,9 +1048,9 @@ public:
       // These are idioms to flag the need for care with accessing bools but on
       // this platform we assume byte size
     
    -  inline void stbool(Register d, const Address& a) { stb(d, a); }
    -  inline void ldbool(const Address& a, Register d) { ldub(a, d); }
    -  inline void movbool( bool boolconst, Register d) { mov( (int) boolconst, d); }
    +  inline void stbool(Register d, const Address& a);
    +  inline void ldbool(const Address& a, Register d);
    +  inline void movbool( bool boolconst, Register d);
     
       // klass oop manipulations if compressed
       void load_klass(Register src_oop, Register klass);
    @@ -1415,12 +1386,7 @@ public:
       // Stack overflow checking
     
       // Note: this clobbers G3_scratch
    -  void bang_stack_with_offset(int offset) {
    -    // stack grows down, caller passes positive offset
    -    assert(offset > 0, "must bang with negative offset");
    -    set((-offset)+STACK_BIAS, G3_scratch);
    -    st(G0, SP, G3_scratch);
    -  }
    +  inline void bang_stack_with_offset(int offset);
     
       // Writes to stack successive pages until offset reached to check for
       // stack overflow + shadow pages.  Clobbers tsp and scratch registers.
    diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp
    index 4dd8772e010..2f1c949bb7f 100644
    --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp
    +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp
    @@ -187,6 +187,33 @@ inline void MacroAssembler::st_long( Register d, const Address& a, int offset )
     #endif
     }
     
    +inline void MacroAssembler::stbool(Register d, const Address& a) { stb(d, a); }
    +inline void MacroAssembler::ldbool(const Address& a, Register d) { ldub(a, d); }
    +inline void MacroAssembler::movbool( bool boolconst, Register d) { mov( (int) boolconst, d); }
    +
    +
    +inline void MacroAssembler::signx( Register s, Register d ) { sra( s, G0, d); }
    +inline void MacroAssembler::signx( Register d )             { sra( d, G0, d); }
    +
    +inline void MacroAssembler::not1( Register s, Register d ) { xnor( s, G0, d ); }
    +inline void MacroAssembler::not1( Register d )             { xnor( d, G0, d ); }
    +
    +inline void MacroAssembler::neg( Register s, Register d ) { sub( G0, s, d ); }
    +inline void MacroAssembler::neg( Register d )             { sub( G0, d, d ); }
    +
    +inline void MacroAssembler::cas(  Register s1, Register s2, Register d) { casa( s1, s2, d, ASI_PRIMARY); }
    +inline void MacroAssembler::casx( Register s1, Register s2, Register d) { casxa(s1, s2, d, ASI_PRIMARY); }
    +
    +// Functions for isolating 64 bit atomic swaps for LP64
    +// cas_ptr will perform cas for 32 bit VM's and casx for 64 bit VM's
    +inline void MacroAssembler::cas_ptr(  Register s1, Register s2, Register d) {
    +#ifdef _LP64
    +  casx( s1, s2, d );
    +#else
    +  cas( s1, s2, d );
    +#endif
    +}
    +
     // Functions for isolating 64 bit shifts for LP64
     
     inline void MacroAssembler::sll_ptr( Register s1, Register s2, Register d ) {
    @@ -226,6 +253,15 @@ inline void MacroAssembler::sll_ptr( Register s1, RegisterOrConstant s2, Registe
       else                   sll_ptr(s1, s2.as_constant(), d);
     }
     
    +inline void MacroAssembler::casl(  Register s1, Register s2, Register d) { casa( s1, s2, d, ASI_PRIMARY_LITTLE); }
    +inline void MacroAssembler::casxl( Register s1, Register s2, Register d) { casxa(s1, s2, d, ASI_PRIMARY_LITTLE); }
    +
    +inline void MacroAssembler::inc(   Register d,  int const13 ) { add(   d, const13, d); }
    +inline void MacroAssembler::inccc( Register d,  int const13 ) { addcc( d, const13, d); }
    +
    +inline void MacroAssembler::dec(   Register d,  int const13 ) { sub(   d, const13, d); }
    +inline void MacroAssembler::deccc( Register d,  int const13 ) { subcc( d, const13, d); }
    +
     // Use the right branch for the platform
     
     inline void MacroAssembler::br( Condition c, bool a, Predict p, address d, relocInfo::relocType rt ) {
    @@ -341,6 +377,24 @@ inline void MacroAssembler::iprefetch( address d, relocInfo::relocType rt ) {
     }
     inline void MacroAssembler::iprefetch( Label& L) { iprefetch( target(L) ); }
     
    +inline void MacroAssembler::tst( Register s ) { orcc( G0, s, G0 ); }
    +
    +inline void MacroAssembler::ret( bool trace ) {
    +  if (trace) {
    +    mov(I7, O7); // traceable register
    +    JMP(O7, 2 * BytesPerInstWord);
    +  } else {
    +    jmpl( I7, 2 * BytesPerInstWord, G0 );
    +  }
    +}
    +
    +inline void MacroAssembler::retl( bool trace ) {
    +  if (trace) {
    +    JMP(O7, 2 * BytesPerInstWord);
    +  } else {
    +    jmpl( O7, 2 * BytesPerInstWord, G0 );
    +  }
    +}
     
     // clobbers o7 on V8!!
     // returns delta from gotten pc to addr after
    @@ -350,6 +404,8 @@ inline int MacroAssembler::get_pc( Register d ) {
       return offset() - x;
     }
     
    +inline void MacroAssembler::cmp(  Register s1, Register s2 ) { subcc( s1, s2, G0 ); }
    +inline void MacroAssembler::cmp(  Register s1, int simm13a ) { subcc( s1, simm13a, G0 ); }
     
     // Note:  All MacroAssembler::set_foo functions are defined out-of-line.
     
    @@ -525,6 +581,12 @@ inline void MacroAssembler::store_long_argument( Register s, Argument& a ) {
     }
     #endif
     
    +inline void MacroAssembler::round_to( Register r, int modulus ) {
    +  assert_not_delayed();
    +  inc( r, modulus - 1 );
    +  and3( r, -modulus, r );
    +}
    +
     inline void MacroAssembler::add(Register s1, int simm13a, Register d, relocInfo::relocType rtype) {
       relocate(rtype);
       add(s1, simm13a, d);
    @@ -551,6 +613,20 @@ inline void MacroAssembler::andn(Register s1, RegisterOrConstant s2, Register d)
       else                   andn(s1, s2.as_constant(), d);
     }
     
    +inline void MacroAssembler::btst( Register s1,  Register s2 ) { andcc( s1, s2, G0 ); }
    +inline void MacroAssembler::btst( int simm13a,  Register s )  { andcc( s,  simm13a, G0 ); }
    +
    +inline void MacroAssembler::bset( Register s1,  Register s2 ) { or3( s1, s2, s2 ); }
    +inline void MacroAssembler::bset( int simm13a,  Register s )  { or3( s,  simm13a, s ); }
    +
    +inline void MacroAssembler::bclr( Register s1,  Register s2 ) { andn( s1, s2, s2 ); }
    +inline void MacroAssembler::bclr( int simm13a,  Register s )  { andn( s,  simm13a, s ); }
    +
    +inline void MacroAssembler::btog( Register s1,  Register s2 ) { xor3( s1, s2, s2 ); }
    +inline void MacroAssembler::btog( int simm13a,  Register s )  { xor3( s,  simm13a, s ); }
    +
    +inline void MacroAssembler::clr( Register d ) { or3( G0, G0, d ); }
    +
     inline void MacroAssembler::clrb( Register s1, Register s2) { stb( G0, s1, s2 ); }
     inline void MacroAssembler::clrh( Register s1, Register s2) { sth( G0, s1, s2 ); }
     inline void MacroAssembler::clr(  Register s1, Register s2) { stw( G0, s1, s2 ); }
    @@ -561,6 +637,9 @@ inline void MacroAssembler::clrh( Register s1, int simm13a) { sth( G0, s1, simm1
     inline void MacroAssembler::clr(  Register s1, int simm13a) { stw( G0, s1, simm13a); }
     inline void MacroAssembler::clrx( Register s1, int simm13a) { stx( G0, s1, simm13a); }
     
    +inline void MacroAssembler::clruw( Register s, Register d ) { srl( s, G0, d); }
    +inline void MacroAssembler::clruwu( Register d ) { srl( d, G0, d); }
    +
     #ifdef _LP64
     // Make all 32 bit loads signed so 64 bit registers maintain proper sign
     inline void MacroAssembler::ld(  Register s1, Register s2, Register d)      { ldsw( s1, s2, d); }
    @@ -642,6 +721,11 @@ inline void MacroAssembler::ldf(FloatRegisterImpl::Width w, const Address& a, Fl
       }
     }
     
    +inline void MacroAssembler::lduwl(Register s1, Register s2, Register d) { lduwa(s1, s2, ASI_PRIMARY_LITTLE, d); }
    +inline void MacroAssembler::ldswl(Register s1, Register s2, Register d) { ldswa(s1, s2, ASI_PRIMARY_LITTLE, d);}
    +inline void MacroAssembler::ldxl( Register s1, Register s2, Register d) { ldxa(s1, s2, ASI_PRIMARY_LITTLE, d); }
    +inline void MacroAssembler::ldfl(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { ldfa(w, s1, s2, ASI_PRIMARY_LITTLE, d); }
    +
     // returns if membar generates anything, obviously this code should mirror
     // membar below.
     inline bool MacroAssembler::membar_has_effect( Membar_mask_bits const7a ) {
    @@ -668,6 +752,24 @@ inline void MacroAssembler::membar( Membar_mask_bits const7a ) {
       }
     }
     
    +inline void MacroAssembler::mov(Register s, Register d) {
    +  if (s != d) {
    +    or3(G0, s, d);
    +  } else {
    +    assert_not_delayed();  // Put something useful in the delay slot!
    +  }
    +}
    +
    +inline void MacroAssembler::mov_or_nop(Register s, Register d) {
    +  if (s != d) {
    +    or3(G0, s, d);
    +  } else {
    +    nop();
    +  }
    +}
    +
    +inline void MacroAssembler::mov( int simm13a, Register d) { or3( G0, simm13a, d); }
    +
     inline void MacroAssembler::prefetch(const Address& a, PrefetchFcn f, int offset) {
       relocate(a.rspec(offset));
       assert(!a.has_index(), "");
    @@ -738,4 +840,11 @@ inline void MacroAssembler::swap(const Address& a, Register d, int offset) {
       else               {                          swap(a.base(), a.disp() + offset, d); }
     }
     
    +inline void MacroAssembler::bang_stack_with_offset(int offset) {
    +  // stack grows down, caller passes positive offset
    +  assert(offset > 0, "must bang with negative offset");
    +  set((-offset)+STACK_BIAS, G3_scratch);
    +  st(G0, SP, G3_scratch);
    +}
    +
     #endif // CPU_SPARC_VM_MACROASSEMBLER_SPARC_INLINE_HPP
    
    From 449bf68d35017f83481edd12ace5b349ccbf8aae Mon Sep 17 00:00:00 2001
    From: Tom Rodriguez 
    Date: Fri, 4 Dec 2015 15:18:46 -1000
    Subject: [PATCH 050/228] 8143571: [JVMCI] Double unregistering of nmethod
     during unloading
    
    Reviewed-by: iveresov, twisti
    ---
     hotspot/src/share/vm/code/nmethod.cpp         | 107 ++++++++++++++----
     hotspot/src/share/vm/code/nmethod.hpp         |  14 ++-
     .../src/share/vm/jvmci/jvmciCompilerToVM.cpp  |  48 +++-----
     .../src/share/vm/jvmci/jvmciCompilerToVM.hpp  |   2 -
     4 files changed, 114 insertions(+), 57 deletions(-)
    
    diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp
    index d8af2c0624b..18625bcbbe3 100644
    --- a/hotspot/src/share/vm/code/nmethod.cpp
    +++ b/hotspot/src/share/vm/code/nmethod.cpp
    @@ -1348,6 +1348,9 @@ void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) {
     
       _state = unloaded;
     
    +  // Log the unloading.
    +  log_state_change();
    +
     #if INCLUDE_JVMCI
       // The method can only be unloaded after the pointer to the installed code
       // Java wrapper is no longer alive. Here we need to clear out this weak
    @@ -1355,11 +1358,12 @@ void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) {
       // after the method is unregistered since the original value may be still
       // tracked by the rset.
       maybe_invalidate_installed_code();
    +  // Clear these out after the nmethod has been unregistered and any
    +  // updates to the InstalledCode instance have been performed.
    +  _jvmci_installed_code = NULL;
    +  _speculation_log = NULL;
     #endif
     
    -  // Log the unloading.
    -  log_state_change();
    -
       // The Method* is gone at this point
       assert(_method == NULL, "Tautology");
     
    @@ -1470,6 +1474,9 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) {
         // Log the transition once
         log_state_change();
     
    +    // Invalidate while holding the patching lock
    +    JVMCI_ONLY(maybe_invalidate_installed_code());
    +
         // Remove nmethod from method.
         // We need to check if both the _code and _from_compiled_code_entry_point
         // refer to this nmethod because there is a race in setting these two fields
    @@ -1496,6 +1503,10 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) {
           MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
           if (nmethod_needs_unregister) {
             Universe::heap()->unregister_nmethod(this);
    +#ifdef JVMCI
    +        _jvmci_installed_code = NULL;
    +        _speculation_log = NULL;
    +#endif
           }
           flush_dependencies(NULL);
         }
    @@ -1519,8 +1530,6 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) {
         assert(state == not_entrant, "other cases may need to be handled differently");
       }
     
    -  JVMCI_ONLY(maybe_invalidate_installed_code());
    -
       if (TraceCreateZombies) {
         ResourceMark m;
         tty->print_cr("nmethod <" INTPTR_FORMAT "> %s code made %s", p2i(this), this->method() ? this->method()->name_and_sig_as_C_string() : "null", (state == not_entrant) ? "not entrant" : "zombie");
    @@ -3403,26 +3412,80 @@ void nmethod::print_statistics() {
     
     #if INCLUDE_JVMCI
     void nmethod::clear_jvmci_installed_code() {
    -  // This must be done carefully to maintain nmethod remembered sets properly
    -  BarrierSet* bs = Universe::heap()->barrier_set();
    -  bs->write_ref_nmethod_pre(&_jvmci_installed_code, this);
    -  _jvmci_installed_code = NULL;
    -  bs->write_ref_nmethod_post(&_jvmci_installed_code, this);
    +  // write_ref_method_pre/post can only be safely called at a
    +  // safepoint or while holding the CodeCache_lock
    +  assert(CodeCache_lock->is_locked() ||
    +         SafepointSynchronize::is_at_safepoint(), "should be performed under a lock for consistency");
    +  if (_jvmci_installed_code != NULL) {
    +    // This must be done carefully to maintain nmethod remembered sets properly
    +    BarrierSet* bs = Universe::heap()->barrier_set();
    +    bs->write_ref_nmethod_pre(&_jvmci_installed_code, this);
    +    _jvmci_installed_code = NULL;
    +    bs->write_ref_nmethod_post(&_jvmci_installed_code, this);
    +  }
     }
     
     void nmethod::maybe_invalidate_installed_code() {
    -  if (_jvmci_installed_code != NULL) {
    -     if (!is_alive()) {
    -       // Break the link between nmethod and InstalledCode such that the nmethod
    -       // can subsequently be flushed safely.  The link must be maintained while
    -       // the method could have live activations since invalidateInstalledCode
    -       // might want to invalidate all existing activations.
    -       InstalledCode::set_address(_jvmci_installed_code, 0);
    -       InstalledCode::set_entryPoint(_jvmci_installed_code, 0);
    -       clear_jvmci_installed_code();
    -     } else if (is_not_entrant()) {
    -       InstalledCode::set_entryPoint(_jvmci_installed_code, 0);
    -     }
    +  assert(Patching_lock->is_locked() ||
    +         SafepointSynchronize::is_at_safepoint(), "should be performed under a lock for consistency");
    +  oop installed_code = jvmci_installed_code();
    +  if (installed_code != NULL) {
    +    nmethod* nm = (nmethod*)InstalledCode::address(installed_code);
    +    if (nm == NULL || nm != this) {
    +      // The link has been broken or the InstalledCode instance is
    +      // associated with another nmethod so do nothing.
    +      return;
    +    }
    +    if (!is_alive()) {
    +      // Break the link between nmethod and InstalledCode such that the nmethod
    +      // can subsequently be flushed safely.  The link must be maintained while
    +      // the method could have live activations since invalidateInstalledCode
    +      // might want to invalidate all existing activations.
    +      InstalledCode::set_address(installed_code, 0);
    +      InstalledCode::set_entryPoint(installed_code, 0);
    +    } else if (is_not_entrant()) {
    +      // Remove the entry point so any invocation will fail but keep
    +      // the address link around that so that existing activations can
    +      // be invalidated.
    +      InstalledCode::set_entryPoint(installed_code, 0);
    +    }
    +  }
    +}
    +
    +void nmethod::invalidate_installed_code(Handle installedCode, TRAPS) {
    +  if (installedCode() == NULL) {
    +    THROW(vmSymbols::java_lang_NullPointerException());
    +  }
    +  jlong nativeMethod = InstalledCode::address(installedCode);
    +  nmethod* nm = (nmethod*)nativeMethod;
    +  if (nm == NULL) {
    +    // Nothing to do
    +    return;
    +  }
    +
    +  nmethodLocker nml(nm);
    +#ifdef ASSERT
    +  {
    +    MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
    +    // This relationship can only be checked safely under a lock
    +    assert(nm == NULL || !nm->is_alive() || nm->jvmci_installed_code() == installedCode(), "sanity check");
    +  }
    +#endif
    +
    +  if (nm->is_alive()) {
    +    // The nmethod state machinery maintains the link between the
    +    // HotSpotInstalledCode and nmethod* so as long as the nmethod appears to be
    +    // alive assume there is work to do and deoptimize the nmethod.
    +    nm->mark_for_deoptimization();
    +    VM_Deoptimize op;
    +    VMThread::execute(&op);
    +  }
    +
    +  MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
    +  // Check that it's still associated with the same nmethod and break
    +  // the link if it is.
    +  if (InstalledCode::address(installedCode) == nativeMethod) {
    +    InstalledCode::set_address(installedCode, 0);
       }
     }
     
    diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp
    index 3f72547d518..5f9b1aa320f 100644
    --- a/hotspot/src/share/vm/code/nmethod.hpp
    +++ b/hotspot/src/share/vm/code/nmethod.hpp
    @@ -607,10 +607,20 @@ public:
     #if INCLUDE_JVMCI
       oop jvmci_installed_code() { return _jvmci_installed_code ; }
       char* jvmci_installed_code_name(char* buf, size_t buflen);
    -  void clear_jvmci_installed_code();
    +
    +  // Update the state of any InstalledCode instance associated with
    +  // this nmethod based on the current value of _state.
       void maybe_invalidate_installed_code();
    +
    +  // Helper function to invalidate InstalledCode instances
    +  static void invalidate_installed_code(Handle installed_code, TRAPS);
    +
       oop speculation_log() { return _speculation_log ; }
    -  void set_speculation_log(oop speculation_log) { _speculation_log = speculation_log;  }
    +
    + private:
    +  void clear_jvmci_installed_code();
    +
    + public:
     #endif
     
       // GC support
    diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
    index 558331e64a7..694513cc4a7 100644
    --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
    +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
    @@ -84,24 +84,6 @@ oop CompilerToVM::get_jvmci_type(KlassHandle klass, TRAPS) {
       return NULL;
     }
     
    -void CompilerToVM::invalidate_installed_code(Handle installedCode, TRAPS) {
    -  if (installedCode() == NULL) {
    -    THROW(vmSymbols::java_lang_NullPointerException());
    -  }
    -  jlong nativeMethod = InstalledCode::address(installedCode);
    -  nmethod* nm = (nmethod*)nativeMethod;
    -  assert(nm == NULL || nm->jvmci_installed_code() == installedCode(), "sanity check");
    -  if (nm != NULL && nm->is_alive()) {
    -    // The nmethod state machinery maintains the link between the
    -    // HotSpotInstalledCode and nmethod* so as long as the nmethod appears to be
    -    // alive assume there is work to do and deoptimize the nmethod.
    -    nm->mark_for_deoptimization();
    -    VM_Deoptimize op;
    -    VMThread::execute(&op);
    -  }
    -  InstalledCode::set_address(installedCode, 0);
    -}
    -
     extern "C" {
     extern VMStructEntry* gHotSpotVMStructs;
     extern uint64_t gHotSpotVMStructEntryTypeNameOffset;
    @@ -688,18 +670,22 @@ C2V_VMENTRY(jint, installCode, (JNIEnv *jniEnv, jobject, jobject target, jobject
       } else {
         if (!installed_code_handle.is_null()) {
           assert(installed_code_handle->is_a(InstalledCode::klass()), "wrong type");
    -      CompilerToVM::invalidate_installed_code(installed_code_handle, CHECK_0);
    -      InstalledCode::set_address(installed_code_handle, (jlong) cb);
    -      InstalledCode::set_version(installed_code_handle, InstalledCode::version(installed_code_handle) + 1);
    -      if (cb->is_nmethod()) {
    -        InstalledCode::set_entryPoint(installed_code_handle, (jlong) cb->as_nmethod_or_null()->verified_entry_point());
    -      } else {
    -        InstalledCode::set_entryPoint(installed_code_handle, (jlong) cb->code_begin());
    -      }
    -      if (installed_code_handle->is_a(HotSpotInstalledCode::klass())) {
    -        HotSpotInstalledCode::set_size(installed_code_handle, cb->size());
    -        HotSpotInstalledCode::set_codeStart(installed_code_handle, (jlong) cb->code_begin());
    -        HotSpotInstalledCode::set_codeSize(installed_code_handle, cb->code_size());
    +      nmethod::invalidate_installed_code(installed_code_handle, CHECK_0);
    +      {
    +        // Ensure that all updates to the InstalledCode fields are consistent.
    +        MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
    +        InstalledCode::set_address(installed_code_handle, (jlong) cb);
    +        InstalledCode::set_version(installed_code_handle, InstalledCode::version(installed_code_handle) + 1);
    +        if (cb->is_nmethod()) {
    +          InstalledCode::set_entryPoint(installed_code_handle, (jlong) cb->as_nmethod_or_null()->verified_entry_point());
    +        } else {
    +          InstalledCode::set_entryPoint(installed_code_handle, (jlong) cb->code_begin());
    +        }
    +        if (installed_code_handle->is_a(HotSpotInstalledCode::klass())) {
    +          HotSpotInstalledCode::set_size(installed_code_handle, cb->size());
    +          HotSpotInstalledCode::set_codeStart(installed_code_handle, (jlong) cb->code_begin());
    +          HotSpotInstalledCode::set_codeSize(installed_code_handle, cb->code_size());
    +        }
           }
           nmethod* nm = cb->as_nmethod_or_null();
           if (nm != NULL && installed_code_handle->is_scavengable()) {
    @@ -971,7 +957,7 @@ C2V_END
     
     C2V_VMENTRY(void, invalidateInstalledCode, (JNIEnv*, jobject, jobject installed_code))
       Handle installed_code_handle = JNIHandles::resolve(installed_code);
    -  CompilerToVM::invalidate_installed_code(installed_code_handle, CHECK);
    +  nmethod::invalidate_installed_code(installed_code_handle, CHECK);
     C2V_END
     
     C2V_VMENTRY(jobject, readUncompressedOop, (JNIEnv*, jobject, jlong addr))
    diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp
    index 4acce0bcb93..35f17689f1e 100644
    --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp
    +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp
    @@ -97,8 +97,6 @@ public:
       static oop get_jvmci_method(const methodHandle& method, TRAPS);
     
       static oop get_jvmci_type(KlassHandle klass, TRAPS);
    -
    -  static void invalidate_installed_code(Handle installedCode, TRAPS);
     };
     
     class JavaArgumentUnboxer : public SignatureIterator {
    
    From b7ad80c79fde16d00a6e9a3f5d920b3ef8fd6cf3 Mon Sep 17 00:00:00 2001
    From: Martin Doerr 
    Date: Mon, 7 Dec 2015 15:01:24 +0100
    Subject: [PATCH 051/228] 8144822: PPC64: Fix build after 8072008
    
    Reviewed-by: goetz
    ---
     hotspot/src/cpu/ppc/vm/ppc.ad | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad
    index 615f74eecf9..781b4038229 100644
    --- a/hotspot/src/cpu/ppc/vm/ppc.ad
    +++ b/hotspot/src/cpu/ppc/vm/ppc.ad
    @@ -3401,8 +3401,8 @@ encode %{
             CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, start_offset);
             if (ciEnv::current()->failing()) { return; } // Code cache may be full.
             int method_index = resolved_method_index(cbuf);
    -        __ relocate(_optimized_virtual ? opt_virtual_call_Relocate::spec(method_index)
    -                                       : static_call_Relocate::spec(method_index));
    +        __ relocate(_optimized_virtual ? opt_virtual_call_Relocation::spec(method_index)
    +                                       : static_call_Relocation::spec(method_index));
           }
     
           // The real call.
    
    From 2d9a6cfd3f4ebe81428fb759be0498e7e2bff129 Mon Sep 17 00:00:00 2001
    From: Vivek R Deshpande 
    Date: Mon, 7 Dec 2015 16:35:07 -0800
    Subject: [PATCH 052/228] 8143355: Update for addition of vectorizedMismatch
     intrinsic for x86
    
    Co-authored-by: Liqi Yi 
    Reviewed-by: kvn
    ---
     .../src/cpu/aarch64/vm/vm_version_aarch64.cpp |   5 +
     hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp     |   5 +
     hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp |   5 +
     hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 173 +++++++++++++++++-
     hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp |   4 +-
     .../src/cpu/x86/vm/stubGenerator_x86_64.cpp   |  52 +++++-
     hotspot/src/cpu/x86/vm/vm_version_x86.cpp     |  19 ++
     hotspot/src/share/vm/classfile/vmSymbols.cpp  |   3 +
     hotspot/src/share/vm/classfile/vmSymbols.hpp  |   5 +
     hotspot/src/share/vm/opto/c2compiler.cpp      |   1 +
     hotspot/src/share/vm/opto/escape.cpp          |   3 +-
     hotspot/src/share/vm/opto/library_call.cpp    |  48 +++++
     hotspot/src/share/vm/opto/runtime.cpp         |  20 ++
     hotspot/src/share/vm/opto/runtime.hpp         |   2 +
     hotspot/src/share/vm/runtime/globals.hpp      |   3 +
     hotspot/src/share/vm/runtime/stubRoutines.cpp |   2 +
     hotspot/src/share/vm/runtime/stubRoutines.hpp |   4 +
     hotspot/src/share/vm/runtime/vmStructs.cpp    |   1 +
     18 files changed, 351 insertions(+), 4 deletions(-)
    
    diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
    index 37c0e5bbb63..72cd0375f52 100644
    --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
    +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
    @@ -182,6 +182,11 @@ void VM_Version::get_processor_features() {
         FLAG_SET_DEFAULT(UseAdler32Intrinsics, true);
       }
     
    +  if (UseVectorizedMismatchIntrinsic) {
    +    warning("UseVectorizedMismatchIntrinsic specified, but not available on this CPU.");
    +    FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false);
    +  }
    +
       if (auxv & HWCAP_AES) {
         UseAES = UseAES || FLAG_IS_DEFAULT(UseAES);
         UseAESIntrinsics =
    diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
    index 774d90b5cf1..5228c2749e3 100644
    --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
    @@ -223,6 +223,11 @@ void VM_Version::initialize() {
         UseMultiplyToLenIntrinsic = true;
       }
     
    +  if (UseVectorizedMismatchIntrinsic) {
    +    warning("UseVectorizedMismatchIntrinsic specified, but not available on this CPU.");
    +    FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false);
    +  }
    +
       // Adjust RTM (Restricted Transactional Memory) flags.
       if (!has_tcheck() && UseRTMLocking) {
         // Can't continue because UseRTMLocking affects UseBiasedLocking flag
    diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
    index e6a79435447..a8b7964e3f7 100644
    --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
    +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
    @@ -356,6 +356,11 @@ void VM_Version::initialize() {
         FLAG_SET_DEFAULT(UseCRC32Intrinsics, false);
       }
     
    +  if (UseVectorizedMismatchIntrinsic) {
    +    warning("UseVectorizedMismatchIntrinsic specified, but not available on this CPU.");
    +    FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false);
    +  }
    +
       if (FLAG_IS_DEFAULT(ContendedPaddingWidth) &&
         (cache_line_size > ContendedPaddingWidth))
         ContendedPaddingWidth = cache_line_size;
    diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
    index 69a0d562df1..2ccee91a6cd 100644
    --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
    +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
    @@ -9439,13 +9439,184 @@ void MacroAssembler::multiply_to_len(Register x, Register xlen, Register y, Regi
       pop(tmp1);
     }
     
    +void MacroAssembler::vectorized_mismatch(Register obja, Register objb, Register length, Register log2_array_indxscale,
    +  Register result, Register tmp1, Register tmp2, XMMRegister rymm0, XMMRegister rymm1, XMMRegister rymm2){
    +  assert(UseSSE42Intrinsics, "SSE4.2 must be enabled.");
    +  Label VECTOR32_LOOP, VECTOR16_LOOP, VECTOR8_LOOP, VECTOR4_LOOP;
    +  Label VECTOR16_TAIL, VECTOR8_TAIL, VECTOR4_TAIL;
    +  Label VECTOR32_NOT_EQUAL, VECTOR16_NOT_EQUAL, VECTOR8_NOT_EQUAL, VECTOR4_NOT_EQUAL;
    +  Label SAME_TILL_END, DONE;
    +  Label BYTES_LOOP, BYTES_TAIL, BYTES_NOT_EQUAL;
    +
    +  //scale is in rcx in both Win64 and Unix
    +  ShortBranchVerifier sbv(this);
    +
    +  shlq(length);
    +  xorq(result, result);
    +
    +  cmpq(length, 8);
    +  jcc(Assembler::equal, VECTOR8_LOOP);
    +  jcc(Assembler::less, VECTOR4_TAIL);
    +
    +  if (UseAVX >= 2){
    +
    +    cmpq(length, 16);
    +    jcc(Assembler::equal, VECTOR16_LOOP);
    +    jcc(Assembler::less, VECTOR8_LOOP);
    +
    +    cmpq(length, 32);
    +    jccb(Assembler::less, VECTOR16_TAIL);
    +
    +    subq(length, 32);
    +    bind(VECTOR32_LOOP);
    +    vmovdqu(rymm0, Address(obja, result));
    +    vmovdqu(rymm1, Address(objb, result));
    +    vpxor(rymm2, rymm0, rymm1, Assembler::AVX_256bit);
    +    vptest(rymm2, rymm2);
    +    jcc(Assembler::notZero, VECTOR32_NOT_EQUAL);//mismatch found
    +    addq(result, 32);
    +    subq(length, 32);
    +    jccb(Assembler::greaterEqual, VECTOR32_LOOP);
    +    addq(length, 32);
    +    jcc(Assembler::equal, SAME_TILL_END);
    +    //falling through if less than 32 bytes left //close the branch here.
    +
    +    bind(VECTOR16_TAIL);
    +    cmpq(length, 16);
    +    jccb(Assembler::less, VECTOR8_TAIL);
    +    bind(VECTOR16_LOOP);
    +    movdqu(rymm0, Address(obja, result));
    +    movdqu(rymm1, Address(objb, result));
    +    vpxor(rymm2, rymm0, rymm1, Assembler::AVX_128bit);
    +    ptest(rymm2, rymm2);
    +    jcc(Assembler::notZero, VECTOR16_NOT_EQUAL);//mismatch found
    +    addq(result, 16);
    +    subq(length, 16);
    +    jcc(Assembler::equal, SAME_TILL_END);
    +    //falling through if less than 16 bytes left
    +  } else {//regular intrinsics
    +
    +    cmpq(length, 16);
    +    jccb(Assembler::less, VECTOR8_TAIL);
    +
    +    subq(length, 16);
    +    bind(VECTOR16_LOOP);
    +    movdqu(rymm0, Address(obja, result));
    +    movdqu(rymm1, Address(objb, result));
    +    pxor(rymm0, rymm1);
    +    ptest(rymm0, rymm0);
    +    jcc(Assembler::notZero, VECTOR16_NOT_EQUAL);//mismatch found
    +    addq(result, 16);
    +    subq(length, 16);
    +    jccb(Assembler::greaterEqual, VECTOR16_LOOP);
    +    addq(length, 16);
    +    jcc(Assembler::equal, SAME_TILL_END);
    +    //falling through if less than 16 bytes left
    +  }
    +
    +  bind(VECTOR8_TAIL);
    +  cmpq(length, 8);
    +  jccb(Assembler::less, VECTOR4_TAIL);
    +  bind(VECTOR8_LOOP);
    +  movq(tmp1, Address(obja, result));
    +  movq(tmp2, Address(objb, result));
    +  xorq(tmp1, tmp2);
    +  testq(tmp1, tmp1);
    +  jcc(Assembler::notZero, VECTOR8_NOT_EQUAL);//mismatch found
    +  addq(result, 8);
    +  subq(length, 8);
    +  jcc(Assembler::equal, SAME_TILL_END);
    +  //falling through if less than 8 bytes left
    +
    +  bind(VECTOR4_TAIL);
    +  cmpq(length, 4);
    +  jccb(Assembler::less, BYTES_TAIL);
    +  bind(VECTOR4_LOOP);
    +  movl(tmp1, Address(obja, result));
    +  xorl(tmp1, Address(objb, result));
    +  testl(tmp1, tmp1);
    +  jcc(Assembler::notZero, VECTOR4_NOT_EQUAL);//mismatch found
    +  addq(result, 4);
    +  subq(length, 4);
    +  jcc(Assembler::equal, SAME_TILL_END);
    +  //falling through if less than 4 bytes left
    +
    +  bind(BYTES_TAIL);
    +  bind(BYTES_LOOP);
    +  load_unsigned_byte(tmp1, Address(obja, result));
    +  load_unsigned_byte(tmp2, Address(objb, result));
    +  xorl(tmp1, tmp2);
    +  testl(tmp1, tmp1);
    +  jccb(Assembler::notZero, BYTES_NOT_EQUAL);//mismatch found
    +  decq(length);
    +  jccb(Assembler::zero, SAME_TILL_END);
    +  incq(result);
    +  load_unsigned_byte(tmp1, Address(obja, result));
    +  load_unsigned_byte(tmp2, Address(objb, result));
    +  xorl(tmp1, tmp2);
    +  testl(tmp1, tmp1);
    +  jccb(Assembler::notZero, BYTES_NOT_EQUAL);//mismatch found
    +  decq(length);
    +  jccb(Assembler::zero, SAME_TILL_END);
    +  incq(result);
    +  load_unsigned_byte(tmp1, Address(obja, result));
    +  load_unsigned_byte(tmp2, Address(objb, result));
    +  xorl(tmp1, tmp2);
    +  testl(tmp1, tmp1);
    +  jccb(Assembler::notZero, BYTES_NOT_EQUAL);//mismatch found
    +  jmpb(SAME_TILL_END);
    +
    +  if (UseAVX >= 2){
    +    bind(VECTOR32_NOT_EQUAL);
    +    vpcmpeqb(rymm2, rymm2, rymm2, Assembler::AVX_256bit);
    +    vpcmpeqb(rymm0, rymm0, rymm1, Assembler::AVX_256bit);
    +    vpxor(rymm0, rymm0, rymm2, Assembler::AVX_256bit);
    +    vpmovmskb(tmp1, rymm0);
    +    bsfq(tmp1, tmp1);
    +    addq(result, tmp1);
    +    shrq(result);
    +    jmpb(DONE);
    +  }
    +
    +  bind(VECTOR16_NOT_EQUAL);
    +  if (UseAVX >= 2){
    +    vpcmpeqb(rymm2, rymm2, rymm2, Assembler::AVX_128bit);
    +    vpcmpeqb(rymm0, rymm0, rymm1, Assembler::AVX_128bit);
    +    pxor(rymm0, rymm2);
    +  } else {
    +    pcmpeqb(rymm2, rymm2);
    +    pxor(rymm0, rymm1);
    +    pcmpeqb(rymm0, rymm1);
    +    pxor(rymm0, rymm2);
    +  }
    +  pmovmskb(tmp1, rymm0);
    +  bsfq(tmp1, tmp1);
    +  addq(result, tmp1);
    +  shrq(result);
    +  jmpb(DONE);
    +
    +  bind(VECTOR8_NOT_EQUAL);
    +  bind(VECTOR4_NOT_EQUAL);
    +  bsfq(tmp1, tmp1);
    +  shrq(tmp1, 3);
    +  addq(result, tmp1);
    +  bind(BYTES_NOT_EQUAL);
    +  shrq(result);
    +  jmpb(DONE);
    +
    +  bind(SAME_TILL_END);
    +  mov64(result, -1);
    +
    +  bind(DONE);
    +}
    +
    +
     //Helper functions for square_to_len()
     
     /**
      * Store the squares of x[], right shifted one bit (divided by 2) into z[]
      * Preserves x and z and modifies rest of the registers.
      */
    -
     void MacroAssembler::square_rshift(Register x, Register xlen, Register z, Register tmp1, Register tmp3, Register tmp4, Register tmp5, Register rdxReg, Register raxReg) {
       // Perform square and right shift by 1
       // Handle odd xlen case first, then for even xlen do the following
    diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp
    index e29d80b12bb..719d745b3ed 100644
    --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp
    +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp
    @@ -1346,7 +1346,6 @@ public:
                                    Register carry2);
       void multiply_to_len(Register x, Register xlen, Register y, Register ylen, Register z, Register zlen,
                            Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5);
    -
       void square_rshift(Register x, Register len, Register z, Register tmp1, Register tmp3,
                          Register tmp4, Register tmp5, Register rdxReg, Register raxReg);
       void multiply_add_64_bmi2(Register sum, Register op1, Register op2, Register carry,
    @@ -1365,6 +1364,9 @@ public:
       void mul_add(Register out, Register in, Register offset, Register len, Register k, Register tmp1,
                    Register tmp2, Register tmp3, Register tmp4, Register tmp5, Register rdxReg,
                    Register raxReg);
    +  void vectorized_mismatch(Register obja, Register objb, Register length, Register log2_array_indxscale,
    +                           Register result, Register tmp1, Register tmp2,
    +                           XMMRegister vec1, XMMRegister vec2, XMMRegister vec3);
     #endif
     
       // CRC32 code for java.util.zip.CRC32::updateBytes() intrinsic.
    diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
    index b68bedf1ad6..c704975870f 100644
    --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
    +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
    @@ -4054,6 +4054,54 @@ class StubGenerator: public StubCodeGenerator {
         return start;
       }
     
    +  /**
    +  *  Arguments:
    +  *
    +  *  Input:
    +  *    c_rarg0   - obja     address
    +  *    c_rarg1   - objb     address
    +  *    c_rarg3   - length   length
    +  *    c_rarg4   - scale    log2_array_indxscale
    +  */
    +  address generate_vectorizedMismatch() {
    +    __ align(CodeEntryAlignment);
    +    StubCodeMark mark(this, "StubRoutines", "vectorizedMismatch");
    +    address start = __ pc();
    +
    +    BLOCK_COMMENT("Entry:");
    +    __ enter();
    +
    +#ifdef _WIN64  // Win64: rcx, rdx, r8, r9 (c_rarg0, c_rarg1, ...)
    +    const Register scale = c_rarg0;  //rcx, will exchange with r9
    +    const Register objb = c_rarg1;   //rdx
    +    const Register length = c_rarg2; //r8
    +    const Register obja = c_rarg3;   //r9
    +    __ xchgq(obja, scale);  //now obja and scale contains the correct contents
    +
    +    const Register tmp1 = r10;
    +    const Register tmp2 = r11;
    +#endif
    +#ifndef _WIN64 // Unix:  rdi, rsi, rdx, rcx, r8, r9 (c_rarg0, c_rarg1, ...)
    +    const Register obja = c_rarg0;   //U:rdi
    +    const Register objb = c_rarg1;   //U:rsi
    +    const Register length = c_rarg2; //U:rdx
    +    const Register scale = c_rarg3;  //U:rcx
    +    const Register tmp1 = r8;
    +    const Register tmp2 = r9;
    +#endif
    +    const Register result = rax; //return value
    +    const XMMRegister vec0 = xmm0;
    +    const XMMRegister vec1 = xmm1;
    +    const XMMRegister vec2 = xmm2;
    +
    +    __ vectorized_mismatch(obja, objb, length, scale, result, tmp1, tmp2, vec0, vec1, vec2);
    +
    +    __ leave();
    +    __ ret(0);
    +
    +    return start;
    +  }
    +
     /**
        *  Arguments:
        *
    @@ -4505,7 +4553,9 @@ class StubGenerator: public StubCodeGenerator {
         if (UseMulAddIntrinsic) {
           StubRoutines::_mulAdd = generate_mulAdd();
         }
    -
    +    if (UseVectorizedMismatchIntrinsic) {
    +      StubRoutines::_vectorizedMismatch = generate_vectorizedMismatch();
    +    }
     #ifndef _WINDOWS
         if (UseMontgomeryMultiplyIntrinsic) {
           StubRoutines::_montgomeryMultiply
    diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
    index eed88e81342..b458f99fac0 100644
    --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
    +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
    @@ -1041,6 +1041,25 @@ void VM_Version::get_processor_features() {
         }
       }
     
    +#ifdef _LP64
    +  if (UseSSE42Intrinsics) {
    +    if (FLAG_IS_DEFAULT(UseVectorizedMismatchIntrinsic)) {
    +      UseVectorizedMismatchIntrinsic = true;
    +    }
    +  } else if (UseVectorizedMismatchIntrinsic) {
    +    if (!FLAG_IS_DEFAULT(UseVectorizedMismatchIntrinsic))
    +      warning("vectorizedMismatch intrinsics are not available on this CPU");
    +    FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false);
    +  }
    +#else
    +  if (UseVectorizedMismatchIntrinsic) {
    +    if (!FLAG_IS_DEFAULT(UseVectorizedMismatchIntrinsic)) {
    +      warning("vectorizedMismatch intrinsic is not available in 32-bit VM");
    +    }
    +    FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false);
    +  }
    +#endif // _LP64
    +
       // Use count leading zeros count instruction if available.
       if (supports_lzcnt()) {
         if (FLAG_IS_DEFAULT(UseCountLeadingZerosInstruction)) {
    diff --git a/hotspot/src/share/vm/classfile/vmSymbols.cpp b/hotspot/src/share/vm/classfile/vmSymbols.cpp
    index bfb99c67630..6f0089a77f5 100644
    --- a/hotspot/src/share/vm/classfile/vmSymbols.cpp
    +++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp
    @@ -681,6 +681,9 @@ bool vmIntrinsics::is_disabled_by_flags(const methodHandle& method) {
       case vmIntrinsics::_montgomerySquare:
         if (!UseMontgomerySquareIntrinsic) return true;
         break;
    +  case vmIntrinsics::_vectorizedMismatch:
    +    if (!UseVectorizedMismatchIntrinsic) return true;
    +    break;
       case vmIntrinsics::_addExactI:
       case vmIntrinsics::_addExactL:
       case vmIntrinsics::_decrementExactI:
    diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp
    index e651ad00ed9..0146b37a4ec 100644
    --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp
    +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp
    @@ -957,6 +957,11 @@
        do_name(     montgomerySquare_name,                             "implMontgomerySquare")                              \
        do_signature(montgomerySquare_signature,                        "([I[IIJ[I)[I")                                      \
                                                                                                                             \
    +  do_class(java_util_ArraysSupport, "java/util/ArraysSupport")                                                          \
    +  do_intrinsic(_vectorizedMismatch, java_util_ArraysSupport, vectorizedMismatch_name, vectorizedMismatch_signature, F_S)\
    +   do_name(vectorizedMismatch_name, "vectorizedMismatch")                                                               \
    +   do_signature(vectorizedMismatch_signature, "(Ljava/lang/Object;JLjava/lang/Object;JII)I")                            \
    +                                                                                                                        \
       /* java/lang/ref/Reference */                                                                                         \
       do_intrinsic(_Reference_get,            java_lang_ref_Reference, get_name,    void_object_signature, F_R)             \
                                                                                                                             \
    diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp
    index c8ff9804039..689147d9f97 100644
    --- a/hotspot/src/share/vm/opto/c2compiler.cpp
    +++ b/hotspot/src/share/vm/opto/c2compiler.cpp
    @@ -441,6 +441,7 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt
       case vmIntrinsics::_mulAdd:
       case vmIntrinsics::_montgomeryMultiply:
       case vmIntrinsics::_montgomerySquare:
    +  case vmIntrinsics::_vectorizedMismatch:
       case vmIntrinsics::_ghash_processBlocks:
       case vmIntrinsics::_updateCRC32:
       case vmIntrinsics::_updateBytesCRC32:
    diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp
    index 92ed15ca3da..169cfc0113f 100644
    --- a/hotspot/src/share/vm/opto/escape.cpp
    +++ b/hotspot/src/share/vm/opto/escape.cpp
    @@ -987,7 +987,8 @@ void ConnectionGraph::process_call_arguments(CallNode *call) {
                       strcmp(call->as_CallLeaf()->_name, "squareToLen") == 0 ||
                       strcmp(call->as_CallLeaf()->_name, "mulAdd") == 0 ||
                       strcmp(call->as_CallLeaf()->_name, "montgomery_multiply") == 0 ||
    -                  strcmp(call->as_CallLeaf()->_name, "montgomery_square") == 0)
    +                  strcmp(call->as_CallLeaf()->_name, "montgomery_square") == 0 ||
    +                  strcmp(call->as_CallLeaf()->_name, "vectorizedMismatch") == 0)
                      ))) {
                 call->dump();
                 fatal("EA unexpected CallLeaf %s", call->as_CallLeaf()->_name);
    diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp
    index 694fb6f6834..6620e57be72 100644
    --- a/hotspot/src/share/vm/opto/library_call.cpp
    +++ b/hotspot/src/share/vm/opto/library_call.cpp
    @@ -312,6 +312,7 @@ class LibraryCallKit : public GraphKit {
       bool inline_mulAdd();
       bool inline_montgomeryMultiply();
       bool inline_montgomerySquare();
    +  bool inline_vectorizedMismatch();
     
       bool inline_profileBoolean();
       bool inline_isCompileConstant();
    @@ -720,6 +721,9 @@ bool LibraryCallKit::try_to_inline(int predicate) {
       case vmIntrinsics::_montgomerySquare:
         return inline_montgomerySquare();
     
    +  case vmIntrinsics::_vectorizedMismatch:
    +    return inline_vectorizedMismatch();
    +
       case vmIntrinsics::_ghash_processBlocks:
         return inline_ghash_processBlocks();
     
    @@ -5581,6 +5585,50 @@ bool LibraryCallKit::inline_montgomerySquare() {
       return true;
     }
     
    +//-------------inline_vectorizedMismatch------------------------------
    +bool LibraryCallKit::inline_vectorizedMismatch() {
    +  assert(UseVectorizedMismatchIntrinsic, "not implementated on this platform");
    +
    +  address stubAddr = StubRoutines::vectorizedMismatch();
    +  if (stubAddr == NULL) {
    +    return false; // Intrinsic's stub is not implemented on this platform
    +  }
    +  const char* stubName = "vectorizedMismatch";
    +  int size_l = callee()->signature()->size();
    +  assert(callee()->signature()->size() == 8, "vectorizedMismatch has 6 parameters");
    +
    +  Node* obja = argument(0);
    +  Node* aoffset = argument(1);
    +  Node* objb = argument(3);
    +  Node* boffset = argument(4);
    +  Node* length = argument(6);
    +  Node* scale = argument(7);
    +
    +  const Type* a_type = obja->Value(&_gvn);
    +  const Type* b_type = objb->Value(&_gvn);
    +  const TypeAryPtr* top_a = a_type->isa_aryptr();
    +  const TypeAryPtr* top_b = b_type->isa_aryptr();
    +  if (top_a == NULL || top_a->klass() == NULL ||
    +    top_b == NULL || top_b->klass() == NULL) {
    +    // failed array check
    +    return false;
    +  }
    +
    +  Node* call;
    +  jvms()->set_should_reexecute(true);
    +
    +  Node* obja_adr = make_unsafe_address(obja, aoffset);
    +  Node* objb_adr = make_unsafe_address(objb, boffset);
    +
    +  call = make_runtime_call(RC_LEAF,
    +    OptoRuntime::vectorizedMismatch_Type(),
    +    stubAddr, stubName, TypePtr::BOTTOM,
    +    obja_adr, objb_adr, length, scale);
    +
    +  Node* result = _gvn.transform(new ProjNode(call, TypeFunc::Parms));
    +  set_result(result);
    +  return true;
    +}
     
     /**
      * Calculate CRC32 for byte.
    diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp
    index 1ae727c105a..a42c750d465 100644
    --- a/hotspot/src/share/vm/opto/runtime.cpp
    +++ b/hotspot/src/share/vm/opto/runtime.cpp
    @@ -1103,6 +1103,26 @@ const TypeFunc* OptoRuntime::montgomerySquare_Type() {
       return TypeFunc::make(domain, range);
     }
     
    +const TypeFunc* OptoRuntime::vectorizedMismatch_Type() {
    +  // create input type (domain)
    +  int num_args = 4;
    +  int argcnt = num_args;
    +  const Type** fields = TypeTuple::fields(argcnt);
    +  int argp = TypeFunc::Parms;
    +  fields[argp++] = TypePtr::NOTNULL;    // obja
    +  fields[argp++] = TypePtr::NOTNULL;    // objb
    +  fields[argp++] = TypeInt::INT;        // length, number of elements
    +  fields[argp++] = TypeInt::INT;        // log2scale, element size
    +  assert(argp == TypeFunc::Parms + argcnt, "correct decoding");
    +  const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms + argcnt, fields);
    +
    +  //return mismatch index (int)
    +  fields = TypeTuple::fields(1);
    +  fields[TypeFunc::Parms + 0] = TypeInt::INT;
    +  const TypeTuple* range = TypeTuple::make(TypeFunc::Parms + 1, fields);
    +  return TypeFunc::make(domain, range);
    +}
    +
     // GHASH block processing
     const TypeFunc* OptoRuntime::ghash_processBlocks_Type() {
         int argcnt = 4;
    diff --git a/hotspot/src/share/vm/opto/runtime.hpp b/hotspot/src/share/vm/opto/runtime.hpp
    index 8e38f3f3a15..69e78aa8ff7 100644
    --- a/hotspot/src/share/vm/opto/runtime.hpp
    +++ b/hotspot/src/share/vm/opto/runtime.hpp
    @@ -299,6 +299,8 @@ private:
     
       static const TypeFunc* mulAdd_Type();
     
    +  static const TypeFunc* vectorizedMismatch_Type();
    +
       static const TypeFunc* ghash_processBlocks_Type();
     
       static const TypeFunc* updateBytesCRC32_Type();
    diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp
    index 9b8b1311a76..acfcd6735f4 100644
    --- a/hotspot/src/share/vm/runtime/globals.hpp
    +++ b/hotspot/src/share/vm/runtime/globals.hpp
    @@ -855,6 +855,9 @@ public:
       product(bool, UseAdler32Intrinsics, false,                                \
               "use intrinsics for java.util.zip.Adler32")                       \
                                                                                 \
    +  product(bool, UseVectorizedMismatchIntrinsic, false,                      \
    +          "Enables intrinsification of ArraysSupport.vectorizedMismatch()") \
    +                                                                            \
       diagnostic(ccstrlist, DisableIntrinsic, "",                               \
              "do not expand intrinsics whose (internal) names appear here")     \
                                                                                 \
    diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp
    index fef7c0b3b03..330ca9d0a55 100644
    --- a/hotspot/src/share/vm/runtime/stubRoutines.cpp
    +++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp
    @@ -148,6 +148,8 @@ address StubRoutines::_mulAdd = NULL;
     address StubRoutines::_montgomeryMultiply = NULL;
     address StubRoutines::_montgomerySquare = NULL;
     
    +address StubRoutines::_vectorizedMismatch = NULL;
    +
     address StubRoutines::_dexp = NULL;
     address StubRoutines::_dlog = NULL;
     
    diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp
    index ac198d0746c..2a9c7084786 100644
    --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp
    +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp
    @@ -207,6 +207,8 @@ class StubRoutines: AllStatic {
       static address _montgomeryMultiply;
       static address _montgomerySquare;
     
    +  static address _vectorizedMismatch;
    +
       static address _dexp;
       static address _dlog;
     
    @@ -376,6 +378,8 @@ class StubRoutines: AllStatic {
       static address montgomeryMultiply()  { return _montgomeryMultiply; }
       static address montgomerySquare()    { return _montgomerySquare; }
     
    +  static address vectorizedMismatch()  { return _vectorizedMismatch; }
    +
       static address dexp()                { return _dexp; }
       static address dlog()                { return _dlog; }
     
    diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp
    index bda425a96df..d3e1b44de02 100644
    --- a/hotspot/src/share/vm/runtime/vmStructs.cpp
    +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp
    @@ -860,6 +860,7 @@ typedef CompactHashtable       SymbolCompactHashTable;
          static_field(StubRoutines,                _mulAdd,                                       address)                               \
          static_field(StubRoutines,                _dexp,                                         address)                               \
          static_field(StubRoutines,                _dlog,                                         address)                               \
    +     static_field(StubRoutines,                _vectorizedMismatch,                           address)                               \
          static_field(StubRoutines,                _jbyte_arraycopy,                              address)                               \
          static_field(StubRoutines,                _jshort_arraycopy,                             address)                               \
          static_field(StubRoutines,                _jint_arraycopy,                               address)                               \
    
    From 682da7441854744f3be7ec3c64b3108d69ad8d49 Mon Sep 17 00:00:00 2001
    From: Martin Doerr 
    Date: Tue, 8 Dec 2015 14:44:00 +0100
    Subject: [PATCH 053/228] 8143817: C1: Platform dependent stack space not
     preserved for all runtime calls
    
    Reviewed-by: roland
    ---
     hotspot/src/share/vm/c1/c1_LIRGenerator.cpp | 23 ++++++++++++---------
     hotspot/src/share/vm/c1/c1_LIRGenerator.hpp |  2 +-
     2 files changed, 14 insertions(+), 11 deletions(-)
    
    diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
    index 98b519b58eb..8fa61f1e975 100644
    --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
    +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
    @@ -3055,13 +3055,16 @@ void LIRGenerator::do_IfOp(IfOp* x) {
       __ cmove(lir_cond(x->cond()), t_val.result(), f_val.result(), reg, as_BasicType(x->x()->type()));
     }
     
    -void LIRGenerator::do_RuntimeCall(address routine, int expected_arguments, Intrinsic* x) {
    -    assert(x->number_of_arguments() == expected_arguments, "wrong type");
    -    LIR_Opr reg = result_register_for(x->type());
    -    __ call_runtime_leaf(routine, getThreadTemp(),
    -                         reg, new LIR_OprList());
    -    LIR_Opr result = rlock_result(x);
    -    __ move(reg, result);
    +void LIRGenerator::do_RuntimeCall(address routine, Intrinsic* x) {
    +  assert(x->number_of_arguments() == 0, "wrong type");
    +  // Enforce computation of _reserved_argument_area_size which is required on some platforms.
    +  BasicTypeList signature;
    +  CallingConvention* cc = frame_map()->c_calling_convention(&signature);
    +  LIR_Opr reg = result_register_for(x->type());
    +  __ call_runtime_leaf(routine, getThreadTemp(),
    +                       reg, new LIR_OprList());
    +  LIR_Opr result = rlock_result(x);
    +  __ move(reg, result);
     }
     
     #ifdef TRACE_HAVE_INTRINSICS
    @@ -3115,16 +3118,16 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) {
       case vmIntrinsics::_threadID: do_ThreadIDIntrinsic(x); break;
       case vmIntrinsics::_classID: do_ClassIDIntrinsic(x); break;
       case vmIntrinsics::_counterTime:
    -    do_RuntimeCall(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), 0, x);
    +    do_RuntimeCall(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), x);
         break;
     #endif
     
       case vmIntrinsics::_currentTimeMillis:
    -    do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeMillis), 0, x);
    +    do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeMillis), x);
         break;
     
       case vmIntrinsics::_nanoTime:
    -    do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeNanos), 0, x);
    +    do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeNanos), x);
         break;
     
       case vmIntrinsics::_Object_init:    do_RegisterFinalizer(x); break;
    diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp
    index 89f5960182a..47dd33df54e 100644
    --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp
    +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp
    @@ -439,7 +439,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
       SwitchRangeArray* create_lookup_ranges(LookupSwitch* x);
       void do_SwitchRanges(SwitchRangeArray* x, LIR_Opr value, BlockBegin* default_sux);
     
    -  void do_RuntimeCall(address routine, int expected_arguments, Intrinsic* x);
    +  void do_RuntimeCall(address routine, Intrinsic* x);
     #ifdef TRACE_HAVE_INTRINSICS
       void do_ThreadIDIntrinsic(Intrinsic* x);
       void do_ClassIDIntrinsic(Intrinsic* x);
    
    From 6f27a97d77d7eab89bbb79a447168056a882c1f7 Mon Sep 17 00:00:00 2001
    From: Goetz Lindenmaier 
    Date: Mon, 7 Dec 2015 15:42:47 +0100
    Subject: [PATCH 054/228] 8144466: ppc64: fix argument passing through opto
     stubs
    
    Reviewed-by: kvn
    ---
     hotspot/make/test/JtregNative.gmk             |  1 +
     .../aarch64/vm/globalDefinitions_aarch64.hpp  |  4 ++
     .../src/cpu/ppc/vm/globalDefinitions_ppc.hpp  |  4 ++
     .../cpu/sparc/vm/globalDefinitions_sparc.hpp  |  4 ++
     .../src/cpu/x86/vm/globalDefinitions_x86.hpp  |  4 ++
     .../cpu/zero/vm/globalDefinitions_zero.hpp    |  4 ++
     .../src/share/vm/opto/generateOptoStub.cpp    | 59 ++++++++++------
     .../TestArrayCopyOverflowArguments.java       | 69 +++++++++++++++++++
     .../floatingpoint/Test15FloatJNIArgs.java     | 61 ++++++++++++++++
     .../floatingpoint/libTest15FloatJNIArgs.c     | 41 +++++++++++
     10 files changed, 229 insertions(+), 22 deletions(-)
     create mode 100644 hotspot/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java
     create mode 100644 hotspot/test/compiler/floatingpoint/Test15FloatJNIArgs.java
     create mode 100644 hotspot/test/compiler/floatingpoint/libTest15FloatJNIArgs.c
    
    diff --git a/hotspot/make/test/JtregNative.gmk b/hotspot/make/test/JtregNative.gmk
    index 09c48d77aba..d49a03757e7 100644
    --- a/hotspot/make/test/JtregNative.gmk
    +++ b/hotspot/make/test/JtregNative.gmk
    @@ -46,6 +46,7 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC := \
         $(HOTSPOT_TOPDIR)/test/runtime/jni/8033445 \
         $(HOTSPOT_TOPDIR)/test/runtime/jni/ToStringInInterfaceTest \
         $(HOTSPOT_TOPDIR)/test/runtime/SameObject \
    +    $(HOTSPOT_TOPDIR)/test/compiler/floatingpoint/ \
         #
     
     # Add conditional directories here when needed.
    diff --git a/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp
    index d392ccf5e48..4c9d377ff09 100644
    --- a/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp
    +++ b/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp
    @@ -28,6 +28,10 @@
     
     const int StackAlignmentInBytes  = 16;
     
    +// Indicates whether the C calling conventions require that
    +// 32-bit integer argument values are extended to 64 bits.
    +const bool CCallingConventionRequiresIntsAsLongs = false;
    +
     #define SUPPORTS_NATIVE_CX8
     
     // The maximum B/BL offset range on AArch64 is 128MB.
    diff --git a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
    index 542abd1bdb6..86fddbc1751 100644
    --- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
    @@ -31,6 +31,10 @@ const int BytesPerInstWord = 4;
     
     const int StackAlignmentInBytes = 16;
     
    +// Indicates whether the C calling conventions require that
    +// 32-bit integer argument values are extended to 64 bits.
    +const bool CCallingConventionRequiresIntsAsLongs = true;
    +
     #define SUPPORTS_NATIVE_CX8
     
     // The PPC CPUs are NOT multiple-copy-atomic.
    diff --git a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp
    index 93432223e8d..427b7ab5f14 100644
    --- a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp
    +++ b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp
    @@ -30,6 +30,10 @@ const int BytesPerInstWord = 4;
     
     const int StackAlignmentInBytes = (2*wordSize);
     
    +// Indicates whether the C calling conventions require that
    +// 32-bit integer argument values are extended to 64 bits.
    +const bool CCallingConventionRequiresIntsAsLongs = false;
    +
     #define SUPPORTS_NATIVE_CX8
     
     // The expected size in bytes of a cache line, used to pad data structures.
    diff --git a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp
    index 8ddbdf82ca4..b7abbacd052 100644
    --- a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp
    +++ b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp
    @@ -27,6 +27,10 @@
     
     const int StackAlignmentInBytes  = 16;
     
    +// Indicates whether the C calling conventions require that
    +// 32-bit integer argument values are extended to 64 bits.
    +const bool CCallingConventionRequiresIntsAsLongs = false;
    +
     #define SUPPORTS_NATIVE_CX8
     
     // The expected size in bytes of a cache line, used to pad data structures.
    diff --git a/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp b/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp
    index 5956fe1cfcc..144c47e3cb9 100644
    --- a/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp
    +++ b/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp
    @@ -28,4 +28,8 @@
     
     #include 
     
    +// Indicates whether the C calling conventions require that
    +// 32-bit integer argument values are extended to 64 bits.
    +const bool CCallingConventionRequiresIntsAsLongs = false;
    +
     #endif // CPU_ZERO_VM_GLOBALDEFINITIONS_ZERO_HPP
    diff --git a/hotspot/src/share/vm/opto/generateOptoStub.cpp b/hotspot/src/share/vm/opto/generateOptoStub.cpp
    index b3bc8999daa..48166b491fc 100644
    --- a/hotspot/src/share/vm/opto/generateOptoStub.cpp
    +++ b/hotspot/src/share/vm/opto/generateOptoStub.cpp
    @@ -72,16 +72,18 @@ void GraphKit::gen_stub(address C_function,
     
       // Make up the parameters
       uint i;
    -  for( i = 0; i < parm_cnt; i++ )
    +  for (i = 0; i < parm_cnt; i++) {
         map()->init_req(i, _gvn.transform(new ParmNode(start, i)));
    -  for( ; ireq(); i++ )
    +  }
    +  for ( ; ireq(); i++) {
         map()->init_req(i, top());      // For nicer debugging
    +  }
     
       // GraphKit requires memory to be a MergeMemNode:
       set_all_memory(map()->memory());
     
       // Get base of thread-local storage area
    -  Node* thread = _gvn.transform( new ThreadLocalNode() );
    +  Node* thread = _gvn.transform(new ThreadLocalNode());
     
       const int NoAlias = Compile::AliasIdxBot;
     
    @@ -113,21 +115,27 @@ void GraphKit::gen_stub(address C_function,
     
       //-----------------------------
       // Compute signature for C call.  Varies from the Java signature!
    +
       const Type **fields = TypeTuple::fields(2*parm_cnt+2);
       uint cnt = TypeFunc::Parms;
       // The C routines gets the base of thread-local storage passed in as an
    -  // extra argument.  Not all calls need it, but its cheap to add here.
    +  // extra argument. Not all calls need it, but it is cheap to add here.
       for (uint pcnt = cnt; pcnt < parm_cnt; pcnt++, cnt++) {
    -    fields[cnt] = jdomain->field_at(pcnt);
    +    const Type *f = jdomain->field_at(pcnt);
    +    if (CCallingConventionRequiresIntsAsLongs && f->isa_int()) {
    +      fields[cnt++] = TypeLong::LONG;
    +      fields[cnt] = Type::HALF; // Must add an additional half for a long.
    +    } else {
    +      fields[cnt] = f;
    +    }
       }
    -
       fields[cnt++] = TypeRawPtr::BOTTOM; // Thread-local storage
       // Also pass in the caller's PC, if asked for.
       if (return_pc) {
         fields[cnt++] = TypeRawPtr::BOTTOM; // Return PC
       }
    +  const TypeTuple* domain = TypeTuple::make(cnt, fields);
     
    -  const TypeTuple* domain = TypeTuple::make(cnt,fields);
       // The C routine we are about to call cannot return an oop; it can block on
       // exit and a GC will trash the oop while it sits in C-land.  Instead, we
       // return the oop through TLS for runtime calls.
    @@ -155,37 +163,44 @@ void GraphKit::gen_stub(address C_function,
           rfields[TypeFunc::Parms+1] = jrange->field_at(TypeFunc::Parms+1);
         }
       }
    -  const TypeTuple* range = TypeTuple::make(jrange->cnt(),rfields);
    +  const TypeTuple* range = TypeTuple::make(jrange->cnt(), rfields);
     
       // Final C signature
    -  const TypeFunc *c_sig = TypeFunc::make(domain,range);
    +  const TypeFunc *c_sig = TypeFunc::make(domain, range);
     
       //-----------------------------
    -  // Make the call node
    +  // Make the call node.
       CallRuntimeNode *call = new CallRuntimeNode(c_sig, C_function, name, TypePtr::BOTTOM);
       //-----------------------------
     
    -  // Fix-up the debug info for the call
    -  call->set_jvms( new (C) JVMState(0) );
    +  // Fix-up the debug info for the call.
    +  call->set_jvms(new (C) JVMState(0));
       call->jvms()->set_bci(0);
       call->jvms()->set_offsets(cnt);
     
    -  // Set fixed predefined input arguments
    +  // Set fixed predefined input arguments.
       cnt = 0;
    -  for (i = 0; i < TypeFunc::Parms; i++)
    -    call->init_req(cnt++, map()->in(i));
    -  // A little too aggressive on the parm copy; return address is not an input
    -  call->set_req(TypeFunc::ReturnAdr, top());
    -  for (; i < parm_cnt; i++) { // Regular input arguments
    +  for (i = 0; i < TypeFunc::Parms; i++) {
         call->init_req(cnt++, map()->in(i));
       }
    +  // A little too aggressive on the parm copy; return address is not an input.
    +  call->set_req(TypeFunc::ReturnAdr, top());
    +  for (; i < parm_cnt; i++) { // Regular input arguments.
    +    const Type *f = jdomain->field_at(i);
    +    if (CCallingConventionRequiresIntsAsLongs && f->isa_int()) {
    +      call->init_req(cnt++, _gvn.transform(new ConvI2LNode(map()->in(i))));
    +      call->init_req(cnt++, top());
    +    } else {
    +      call->init_req(cnt++, map()->in(i));
    +    }
    +  }
    +  call->init_req(cnt++, thread);
    +  if (return_pc) {             // Return PC, if asked for.
    +    call->init_req(cnt++, returnadr());
    +  }
     
    -  call->init_req( cnt++, thread );
    -  if( return_pc )             // Return PC, if asked for
    -    call->init_req( cnt++, returnadr() );
       _gvn.transform_no_reclaim(call);
     
    -
       //-----------------------------
       // Now set up the return results
       set_control( _gvn.transform( new ProjNode(call,TypeFunc::Control)) );
    diff --git a/hotspot/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java b/hotspot/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java
    new file mode 100644
    index 00000000000..1bfaa35e578
    --- /dev/null
    +++ b/hotspot/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java
    @@ -0,0 +1,69 @@
    +/*
    + * Copyright (c) 2015 SAP SE. 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
    + * @summary Test that overflowed integers passed to arraycopy don't do any harm. This might
    + *          be the case on platforms where C-code expects that ints passed to a call
    + *          are properly sign extended to 64 bit (e.g., PPC64, s390x). This can fail
    + *          if slow_arraycopy_C() is commpiled by the C compiler without any imlicit
    + *          casts (as spill stores to the stack that are done with 4-byte instruction).
    + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyOverflowArguments
    + *
    + */
    +
    +public class TestArrayCopyOverflowArguments {
    +
    +    // Without volatile the overflowing computation was moved up and then
    +    // spilled to the stack. The 32-bit spill store caused proper rounding.
    +    static volatile int mod = Integer.MAX_VALUE;
    +
    +    public static int[] m1(Object src) {
    +        if (src == null) return null;
    +        int[] dest = new int[10];
    +        try {
    +            // PPC C calling conventions require that ints are properly expanded
    +            // to longs when passed to a function.
    +            int pos   =  8 + mod + mod; // = 0x1_0000_0006.
    +            int start =  2 + mod + mod; // = 0x1_0000_0000.
    +            int len   = 12 + mod + mod; // = 0x1_0000_0010.
    +            // This is supposed to call SharedRuntime::slow_arraycopy_C().
    +            System.arraycopy(src, pos, dest, 0, 10);
    +        } catch (ArrayStoreException npe) {
    +        }
    +        return dest;
    +    }
    +
    +    static public void main(String[] args) throws Exception {
    +        int[] src = new int[20];
    +
    +        for (int i  = 0; i < 20; ++i) {
    +            src[i] = i * (i-1);
    +        }
    +
    +        for (int i = 0; i < 20000; i++) {
    +            m1(src);
    +        }
    +    }
    +}
    +
    diff --git a/hotspot/test/compiler/floatingpoint/Test15FloatJNIArgs.java b/hotspot/test/compiler/floatingpoint/Test15FloatJNIArgs.java
    new file mode 100644
    index 00000000000..1425d3da016
    --- /dev/null
    +++ b/hotspot/test/compiler/floatingpoint/Test15FloatJNIArgs.java
    @@ -0,0 +1,61 @@
    +/*
    + * Copyright (c) 2015 SAP SE. 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 8139258
    + * @summary Regression test for 8139258 which failed to properly pass float args
    + *          to a jni function on ppc64le.
    + * @run main/othervm -Xint Test15FloatJNIArgs
    + * @run main/othervm -XX:+TieredCompilation -Xcomp Test15FloatJNIArgs
    + * @run main/othervm -XX:-TieredCompilation -Xcomp Test15FloatJNIArgs
    + */
    +
    +public class Test15FloatJNIArgs {
    +    static {
    +        try {
    +            System.loadLibrary("Test15FloatJNIArgs");
    +        } catch (UnsatisfiedLinkError e) {
    +            System.out.println("could not load native lib: " + e);
    +        }
    +    }
    +
    +    public static native float add15floats(
    +        float f1, float f2, float f3, float f4,
    +        float f5, float f6, float f7, float f8,
    +        float f9, float f10, float f11, float f12,
    +        float f13, float f14, float f15);
    +
    +    static void test() throws Exception {
    +        float sum = Test15FloatJNIArgs.add15floats(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
    +                                                   1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
    +        if (sum != 15.0f) {
    +            throw new Error("Passed 15 times 1.0f to jni function which didn't add them properly: " + sum);
    +        }
    +    }
    +
    +    public static void main(String[] args) throws Exception {
    +        for (int i = 0; i < 200; ++i) {
    +            test();
    +        }
    +    }
    +}
    diff --git a/hotspot/test/compiler/floatingpoint/libTest15FloatJNIArgs.c b/hotspot/test/compiler/floatingpoint/libTest15FloatJNIArgs.c
    new file mode 100644
    index 00000000000..e31627955ca
    --- /dev/null
    +++ b/hotspot/test/compiler/floatingpoint/libTest15FloatJNIArgs.c
    @@ -0,0 +1,41 @@
    +/*
    + * Copyright (c) 2015. 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.
    + */
    +
    +#include 
    +
    +#ifdef __cplusplus
    +extern "C" {
    +#endif
    +
    +JNIEXPORT jfloat JNICALL Java_Test15FloatJNIArgs_add15floats
    +  (JNIEnv *env, jclass cls,
    +   jfloat  f1, jfloat  f2, jfloat  f3, jfloat  f4,
    +   jfloat  f5, jfloat  f6, jfloat  f7, jfloat  f8,
    +   jfloat  f9, jfloat f10, jfloat f11, jfloat f12,
    +   jfloat f13, jfloat f14, jfloat f15) {
    +  return f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + f13 + f14 + f15;
    +}
    +
    +#ifdef __cplusplus
    +}
    +#endif
    
    From 9fc9cf684a7097829591a7e36dcb3e9146562f64 Mon Sep 17 00:00:00 2001
    From: Volker Simonis 
    Date: Tue, 15 Dec 2015 00:16:09 -0500
    Subject: [PATCH 055/228] 8145015: jni_GetStringCritical asserts for empty
     strings
    
    Reviewed-by: thartmann, dholmes
    ---
     hotspot/src/share/vm/prims/jni.cpp | 15 +++++++++------
     1 file changed, 9 insertions(+), 6 deletions(-)
    
    diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp
    index 724d75b8495..a0f5665d276 100644
    --- a/hotspot/src/share/vm/prims/jni.cpp
    +++ b/hotspot/src/share/vm/prims/jni.cpp
    @@ -3194,17 +3194,20 @@ JNI_ENTRY(const jchar*, jni_GetStringCritical(JNIEnv *env, jstring string, jbool
       if (isCopy != NULL) {
         *isCopy = is_latin1 ? JNI_TRUE : JNI_FALSE;
       }
    -  const jchar* ret;
    +  jchar* ret;
       if (!is_latin1) {
    -    ret = s_value->char_at_addr(0);
    +    ret = (jchar*) s_value->base(T_CHAR);
       } else {
         // Inflate latin1 encoded string to UTF16
         int s_len = java_lang_String::length(s);
    -    jchar* buf = NEW_C_HEAP_ARRAY(jchar, s_len, mtInternal);
    -    for (int i = 0; i < s_len; i++) {
    -      buf[i] = ((jchar) s_value->byte_at(i)) & 0xff;
    +    ret = NEW_C_HEAP_ARRAY_RETURN_NULL(jchar, s_len + 1, mtInternal);  // add one for zero termination
    +    /* JNI Specification states return NULL on OOM */
    +    if (ret != NULL) {
    +      for (int i = 0; i < s_len; i++) {
    +        ret[i] = ((jchar) s_value->byte_at(i)) & 0xff;
    +      }
    +      ret[s_len] = 0;
         }
    -    ret = &buf[0];
       }
      HOTSPOT_JNI_GETSTRINGCRITICAL_RETURN((uint16_t *) ret);
       return ret;
    
    From 9ecd60a8dc199a58128580dc581b3402255ca1f3 Mon Sep 17 00:00:00 2001
    From: Bengt Rutisson 
    Date: Tue, 15 Dec 2015 09:58:29 +0100
    Subject: [PATCH 056/228] 8145303: Clean up the units for log_gc_footer
    
    Reviewed-by: david, tschatzl, goetz
    ---
     hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp   | 9 ++++-----
     hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp   | 2 +-
     hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp | 4 ++--
     hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp | 2 +-
     hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp    | 4 ++--
     hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp    | 2 +-
     6 files changed, 11 insertions(+), 12 deletions(-)
    
    diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp
    index 2b6106391bc..3fba02e69a7 100644
    --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp
    +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp
    @@ -3600,13 +3600,13 @@ void G1CollectedHeap::reset_taskqueue_stats() {
     }
     #endif // TASKQUEUE_STATS
     
    -void G1CollectedHeap::log_gc_footer(double pause_time_counter) {
    +void G1CollectedHeap::log_gc_footer(jlong pause_time_counter) {
       if (evacuation_failed()) {
         log_info(gc)("To-space exhausted");
       }
     
    -  double pause_time_sec = TimeHelper::counter_to_seconds(pause_time_counter);
    -  g1_policy()->print_phases(pause_time_sec);
    +  double pause_time_ms = TimeHelper::counter_to_millis(pause_time_counter);
    +  g1_policy()->print_phases(pause_time_ms);
     
       g1_policy()->print_detailed_heap_transition();
     }
    @@ -3698,8 +3698,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
         }
         GCTraceTime(Info, gc) tm(gc_string, NULL, gc_cause(), true);
     
    -    double pause_start_sec = os::elapsedTime();
    -    double pause_start_counter = os::elapsed_counter();
    +    jlong pause_start_counter = os::elapsed_counter();
         g1_policy()->note_gc_start(active_workers);
     
         TraceCollectorStats tcs(g1mm()->incremental_collection_counters());
    diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp
    index dafd2cd102b..b6d0dd3e762 100644
    --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp
    +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp
    @@ -290,7 +290,7 @@ private:
       void verify_before_gc();
       void verify_after_gc();
     
    -  void log_gc_footer(double pause_time_counter);
    +  void log_gc_footer(jlong pause_time_counter);
     
       void trace_heap(GCWhen::Type when, const GCTracer* tracer);
     
    diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp
    index d19bf2faab8..4e603475391 100644
    --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp
    +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp
    @@ -1299,8 +1299,8 @@ void G1CollectorPolicy::print_detailed_heap_transition() const {
       MetaspaceAux::print_metaspace_change(_metaspace_used_bytes_before_gc);
     }
     
    -void G1CollectorPolicy::print_phases(double pause_time_sec) {
    -  phase_times()->print(pause_time_sec);
    +void G1CollectorPolicy::print_phases(double pause_time_ms) {
    +  phase_times()->print(pause_time_ms);
     }
     
     void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time,
    diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp
    index 7c7cf4d0a5e..d0687a1c1e6 100644
    --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp
    +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp
    @@ -661,7 +661,7 @@ public:
     
       void print_detailed_heap_transition() const;
     
    -  virtual void print_phases(double pause_time_sec);
    +  virtual void print_phases(double pause_time_ms);
     
       void record_stop_world_start();
       void record_concurrent_pause();
    diff --git a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp
    index 84e749c2ab9..c6b7fed4fdf 100644
    --- a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp
    +++ b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp
    @@ -349,7 +349,7 @@ class G1GCParPhasePrinter : public StackObj {
       }
     };
     
    -void G1GCPhaseTimes::print(double pause_time_sec) {
    +void G1GCPhaseTimes::print(double pause_time_ms) {
       note_gc_end();
     
       G1GCParPhasePrinter par_phase_printer(this);
    @@ -373,7 +373,7 @@ void G1GCPhaseTimes::print(double pause_time_sec) {
       }
       print_stats(Indents[1], "Clear CT", _cur_clear_ct_time_ms);
       print_stats(Indents[1], "Expand Heap After Collection", _cur_expand_heap_time_ms);
    -  double misc_time_ms = pause_time_sec * MILLIUNITS - accounted_time_ms();
    +  double misc_time_ms = pause_time_ms - accounted_time_ms();
       print_stats(Indents[1], "Other", misc_time_ms);
       if (_cur_verify_before_time_ms > 0.0) {
         print_stats(Indents[2], "Verify Before", _cur_verify_before_time_ms);
    diff --git a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp
    index 9803fef0c5b..1e4b166459a 100644
    --- a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp
    +++ b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp
    @@ -126,7 +126,7 @@ class G1GCPhaseTimes : public CHeapObj {
      public:
       G1GCPhaseTimes(uint max_gc_threads);
       void note_gc_start(uint active_gc_threads);
    -  void print(double pause_time_sec);
    +  void print(double pause_time_ms);
     
       // record the time a phase took in seconds
       void record_time_secs(GCParPhases phase, uint worker_i, double secs);
    
    From 6e05599081640f65af8f3dc5696a7ba69ffa571f Mon Sep 17 00:00:00 2001
    From: Magnus Ihse Bursie 
    Date: Tue, 15 Dec 2015 10:55:07 +0100
    Subject: [PATCH 057/228] 8142909: Integration of minor fixes from the
     build-infra project
    
    Reviewed-by: dholmes, erikj
    ---
     hotspot/make/bsd/makefiles/saproc.make   | 175 -----------------------
     hotspot/make/windows/create_obj_files.sh |   1 +
     hotspot/src/share/vm/adlc/adlparse.cpp   |   8 +-
     3 files changed, 6 insertions(+), 178 deletions(-)
     delete mode 100644 hotspot/make/bsd/makefiles/saproc.make
    
    diff --git a/hotspot/make/bsd/makefiles/saproc.make b/hotspot/make/bsd/makefiles/saproc.make
    deleted file mode 100644
    index c1783c470a7..00000000000
    --- a/hotspot/make/bsd/makefiles/saproc.make
    +++ /dev/null
    @@ -1,175 +0,0 @@
    -#
    -# Copyright (c) 2005, 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.
    -#
    -#
    -
    -# Rules to build serviceability agent library, used by vm.make
    -
    -# libsaproc.so(dylib): serviceability agent
    -SAPROC   = saproc
    -
    -ifeq ($(OS_VENDOR), Darwin)
    -  LIBSAPROC           = lib$(SAPROC).$(LIBRARY_SUFFIX)
    -
    -  LIBSAPROC_DEBUGINFO = lib$(SAPROC).$(LIBRARY_SUFFIX).dSYM
    -  LIBSAPROC_DIZ       = lib$(SAPROC).diz
    -else
    -  LIBSAPROC           = lib$(SAPROC).so
    -
    -  LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo
    -  LIBSAPROC_DIZ       = lib$(SAPROC).diz
    -endif
    -
    -AGENT_DIR = $(GAMMADIR)/agent
    -
    -SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)
    -
    -BSD_NON_STUB_SASRCFILES = $(SASRCDIR)/salibelf.c             \
    -                      $(SASRCDIR)/symtab.c                   \
    -                      $(SASRCDIR)/libproc_impl.c             \
    -                      $(SASRCDIR)/ps_proc.c                  \
    -                      $(SASRCDIR)/ps_core.c                  \
    -                      $(SASRCDIR)/BsdDebuggerLocal.c         \
    -                      $(AGENT_DIR)/src/share/native/sadis.c
    -
    -DARWIN_NON_STUB_SASRCFILES = $(SASRCDIR)/symtab.c            \
    -                      $(SASRCDIR)/libproc_impl.c             \
    -                      $(SASRCDIR)/ps_core.c                  \
    -                      $(SASRCDIR)/MacosxDebuggerLocal.m      \
    -                      $(AGENT_DIR)/src/share/native/sadis.c
    -
    -ifeq ($(OS_VENDOR), FreeBSD)
    -  SASRCFILES = $(BSD_NON_STUB_SASRCFILES)
    -  SALIBS = -lutil -lthread_db
    -  SAARCH = $(ARCHFLAG)
    -else
    -  ifeq ($(OS_VENDOR), Darwin)
    -    SASRCFILES = $(DARWIN_NON_STUB_SASRCFILES)
    -    SALIBS = -g \
    -             -framework Foundation \
    -             -framework JavaNativeFoundation \
    -             -framework Security \
    -             -framework CoreFoundation
    -    #objc compiler blows up on -march=i586, perhaps it should not be included in the macosx intel 32-bit C++ compiles?
    -    SAARCH = $(subst -march=i586,,$(ARCHFLAG))
    -
    -    # This is needed to locate JavaNativeFoundation.framework
    -    ifeq ($(SYSROOT_CFLAGS),)
    -      # this will happen when building without spec.gmk, set SDKROOT to a valid SDK
    -      # path if your system does not have headers installed in the system frameworks
    -      SA_SYSROOT_FLAGS = -F"$(SDKROOT)/System/Library/Frameworks/JavaVM.framework/Frameworks"
    -    else
    -      # Just use SYSROOT_CFLAGS
    -      SA_SYSROOT_FLAGS=$(SYSROOT_CFLAGS)
    -    endif
    -  else
    -    SASRCFILES = $(SASRCDIR)/StubDebuggerLocal.c
    -    SALIBS =
    -    SAARCH = $(ARCHFLAG)
    -  endif
    -endif
    -
    -SAMAPFILE = $(SASRCDIR)/mapfile
    -
    -DEST_SAPROC           = $(JDK_LIBDIR)/$(LIBSAPROC)
    -DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO)
    -DEST_SAPROC_DIZ       = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ)
    -
    -# DEBUG_BINARIES overrides everything, use full -g debug information
    -ifeq ($(DEBUG_BINARIES), true)
    -  SA_DEBUG_CFLAGS = -g
    -endif
    -
    -# if $(AGENT_DIR) does not exist, we don't build SA
    -# also, we don't build SA on Itanium, PPC, ARM or zero.
    -
    -ifneq ($(wildcard $(AGENT_DIR)),)
    -ifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),)
    -  BUILDLIBSAPROC = $(LIBSAPROC)
    -endif
    -endif
    -
    -
    -ifneq ($(OS_VENDOR), Darwin)
    -SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
    -endif
    -SA_LFLAGS += $(LDFLAGS_HASH_STYLE)
    -
    -BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
    -  -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]")
    -
    -$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
    -	$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
    -	  echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
    -	  exit 1; \
    -	fi
    -	@echo $(LOG_INFO) Making SA debugger back-end...
    -	$(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE                   \
    -	           $(SA_SYSROOT_FLAGS)                                  \
    -	           $(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG)       \
    -	           -I$(SASRCDIR)                                        \
    -	           -I$(GENERATED)                                       \
    -	           $(BOOT_JAVA_INCLUDES)                                \
    -	           $(SASRCFILES)                                        \
    -	           $(SA_LFLAGS)                                         \
    -	           $(SA_DEBUG_CFLAGS)                                   \
    -	           -o $@                                                \
    -	           $(SALIBS)
    -ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    -  ifeq ($(OS_VENDOR), Darwin)
    -	$(DSYMUTIL) $@
    -    ifeq ($(ZIP_DEBUGINFO_FILES),1)
    -	$(ZIPEXE) -q -r -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
    -	$(RM) -r $(LIBSAPROC_DEBUGINFO)
    -    endif
    -  else
    -	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
    -	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
    -    ifeq ($(STRIP_POLICY),all_strip)
    -	$(QUIETLY) $(STRIP) $@
    -    else
    -      ifeq ($(STRIP_POLICY),min_strip)
    -	$(QUIETLY) $(STRIP) -g $@
    -      # implied else here is no stripping at all
    -      endif
    -    endif
    -    ifeq ($(ZIP_DEBUGINFO_FILES),1)
    -	$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
    -	$(RM) $(LIBSAPROC_DEBUGINFO)
    -    endif
    -  endif
    -endif
    -
    -install_saproc: $(BUILDLIBSAPROC)
    -	@echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"
    -ifeq ($(OS_VENDOR), Darwin)
    -	$(QUIETLY) test ! -d $(LIBSAPROC_DEBUGINFO) || \
    -	    $(CP) -f -r $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO)
    -else
    -	$(QUIETLY) test ! -f $(LIBSAPROC_DEBUGINFO) || \
    -	    $(CP) -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO)
    -endif
    -	$(QUIETLY) test ! -f $(LIBSAPROC_DIZ) || \
    -	    $(CP) -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ)
    -	$(QUIETLY) $(CP) -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"
    -
    -.PHONY: install_saproc
    diff --git a/hotspot/make/windows/create_obj_files.sh b/hotspot/make/windows/create_obj_files.sh
    index a6481549bd6..cc3d276ff24 100644
    --- a/hotspot/make/windows/create_obj_files.sh
    +++ b/hotspot/make/windows/create_obj_files.sh
    @@ -158,5 +158,6 @@ for e in ${Src_Files}; do
             fi
     	Obj_Files="${Obj_Files}$o "
     done
    +Obj_Files=`echo ${Obj_Files} | tr ' ' '\n' | sort`
     
     echo Obj_Files=${Obj_Files}
    diff --git a/hotspot/src/share/vm/adlc/adlparse.cpp b/hotspot/src/share/vm/adlc/adlparse.cpp
    index 54bff63ad6d..e385bf93d1a 100644
    --- a/hotspot/src/share/vm/adlc/adlparse.cpp
    +++ b/hotspot/src/share/vm/adlc/adlparse.cpp
    @@ -48,9 +48,11 @@ ADLParser::~ADLParser() {
       if (!_AD._quiet_mode)
         fprintf(stderr,"---------------------------- Errors and Warnings ----------------------------\n");
     #ifndef ASSERT
    -  fprintf(stderr, "**************************************************************\n");
    -  fprintf(stderr, "***** WARNING: ASSERT is undefined, assertions disabled. *****\n");
    -  fprintf(stderr, "**************************************************************\n");
    +  if (!_AD._quiet_mode) {
    +    fprintf(stderr, "**************************************************************\n");
    +    fprintf(stderr, "***** WARNING: ASSERT is undefined, assertions disabled. *****\n");
    +    fprintf(stderr, "**************************************************************\n");
    +  }
     #endif
       if( _AD._syntax_errs + _AD._semantic_errs + _AD._warnings == 0 ) {
         if (!_AD._quiet_mode)
    
    From 39e280e4e36ca4225f57e20fc82785722d0b4c19 Mon Sep 17 00:00:00 2001
    From: Goetz Lindenmaier 
    Date: Thu, 10 Dec 2015 16:18:25 +0100
    Subject: [PATCH 058/228] 8145117: PPC64: Remove cpp interpreter implementation
    
    Reviewed-by: coleenp, mdoerr
    ---
     hotspot/src/cpu/ppc/vm/frame_ppc.cpp          |  37 +--
     hotspot/src/cpu/ppc/vm/frame_ppc.hpp          | 147 ++----------
     hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp   |  80 -------
     .../src/cpu/ppc/vm/globalDefinitions_ppc.hpp  |   4 +
     hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp | 225 +++++-------------
     hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp |  42 ----
     hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp    |   7 +-
     hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp    |   2 -
     hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp |   4 -
     hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp  |  28 +--
     hotspot/src/cpu/ppc/vm/register_ppc.hpp       |  14 --
     hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp  |  41 +---
     hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp  |   9 +-
     .../vm/templateInterpreterGenerator_ppc.cpp   |   2 -
     .../src/cpu/ppc/vm/templateTable_ppc_64.cpp   |   3 -
     15 files changed, 106 insertions(+), 539 deletions(-)
    
    diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp
    index 2e051d99918..69646f74c77 100644
    --- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp
    @@ -84,10 +84,7 @@ frame frame::sender_for_entry_frame(RegisterMap *map) const {
     
     frame frame::sender_for_interpreter_frame(RegisterMap *map) const {
       // Pass callers initial_caller_sp as unextended_sp.
    -  return frame(sender_sp(), sender_pc(),
    -               CC_INTERP_ONLY((intptr_t*)((parent_ijava_frame_abi *)callers_abi())->initial_caller_sp)
    -               NOT_CC_INTERP((intptr_t*)get_ijava_state()->sender_sp)
    -               );
    +  return frame(sender_sp(), sender_pc(), (intptr_t*)get_ijava_state()->sender_sp);
     }
     
     frame frame::sender_for_compiled_frame(RegisterMap *map) const {
    @@ -168,14 +165,8 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result)
       if (method->is_native()) {
         // Prior to calling into the runtime to notify the method exit the possible
         // result value is saved into the interpreter frame.
    -#ifdef CC_INTERP
    -    interpreterState istate = get_interpreterState();
    -    address lresult = (address)istate + in_bytes(BytecodeInterpreter::native_lresult_offset());
    -    address fresult = (address)istate + in_bytes(BytecodeInterpreter::native_fresult_offset());
    -#else
         address lresult = (address)&(get_ijava_state()->lresult);
         address fresult = (address)&(get_ijava_state()->fresult);
    -#endif
     
         switch (method->result_type()) {
           case T_OBJECT:
    @@ -226,31 +217,6 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result)
     
     void frame::describe_pd(FrameValues& values, int frame_no) {
       if (is_interpreted_frame()) {
    -#ifdef CC_INTERP
    -    interpreterState istate = get_interpreterState();
    -    values.describe(frame_no, (intptr_t*)istate, "istate");
    -    values.describe(frame_no, (intptr_t*)&(istate->_thread), " thread");
    -    values.describe(frame_no, (intptr_t*)&(istate->_bcp), " bcp");
    -    values.describe(frame_no, (intptr_t*)&(istate->_locals), " locals");
    -    values.describe(frame_no, (intptr_t*)&(istate->_constants), " constants");
    -    values.describe(frame_no, (intptr_t*)&(istate->_method), err_msg(" method = %s", istate->_method->name_and_sig_as_C_string()));
    -    values.describe(frame_no, (intptr_t*)&(istate->_mdx), " mdx");
    -    values.describe(frame_no, (intptr_t*)&(istate->_stack), " stack");
    -    values.describe(frame_no, (intptr_t*)&(istate->_msg), err_msg(" msg = %s", BytecodeInterpreter::C_msg(istate->_msg)));
    -    values.describe(frame_no, (intptr_t*)&(istate->_result), " result");
    -    values.describe(frame_no, (intptr_t*)&(istate->_prev_link), " prev_link");
    -    values.describe(frame_no, (intptr_t*)&(istate->_oop_temp), " oop_temp");
    -    values.describe(frame_no, (intptr_t*)&(istate->_stack_base), " stack_base");
    -    values.describe(frame_no, (intptr_t*)&(istate->_stack_limit), " stack_limit");
    -    values.describe(frame_no, (intptr_t*)&(istate->_monitor_base), " monitor_base");
    -    values.describe(frame_no, (intptr_t*)&(istate->_frame_bottom), " frame_bottom");
    -    values.describe(frame_no, (intptr_t*)&(istate->_last_Java_pc), " last_Java_pc");
    -    values.describe(frame_no, (intptr_t*)&(istate->_last_Java_fp), " last_Java_fp");
    -    values.describe(frame_no, (intptr_t*)&(istate->_last_Java_sp), " last_Java_sp");
    -    values.describe(frame_no, (intptr_t*)&(istate->_self_link), " self_link");
    -    values.describe(frame_no, (intptr_t*)&(istate->_native_fresult), " native_fresult");
    -    values.describe(frame_no, (intptr_t*)&(istate->_native_lresult), " native_lresult");
    -#else
     #define DESCRIBE_ADDRESS(name) \
       values.describe(frame_no, (intptr_t*)&(get_ijava_state()->name), #name);
     
    @@ -266,7 +232,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) {
           DESCRIBE_ADDRESS(oop_tmp);
           DESCRIBE_ADDRESS(lresult);
           DESCRIBE_ADDRESS(fresult);
    -#endif
       }
     }
     #endif
    diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.hpp
    index f327d2ce424..8a1ff5c63b3 100644
    --- a/hotspot/src/cpu/ppc/vm/frame_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.hpp
    @@ -193,33 +193,48 @@
       #define _spill_nonvolatiles_neg(_component) \
          (int)(-frame::spill_nonvolatiles_size + offset_of(frame::spill_nonvolatiles, _component))
     
    -
    -
    -#ifndef CC_INTERP
    -  //  Frame layout for the Java template interpreter on PPC64.
    +  // Frame layout for the Java template interpreter on PPC64.
       //
    -  //  Diffs to the CC_INTERP are marked with 'X'.
    +  // In these figures the stack grows upwards, while memory grows
    +  // downwards. Square brackets denote regions possibly larger than
    +  // single 64 bit slots.
       //
    +  //  STACK (interpreter is active):
    +  //    0       [TOP_IJAVA_FRAME]
    +  //            [PARENT_IJAVA_FRAME]
    +  //            ...
    +  //            [PARENT_IJAVA_FRAME]
    +  //            [ENTRY_FRAME]
    +  //            [C_FRAME]
    +  //            ...
    +  //            [C_FRAME]
    +  //
    +  //  With the following frame layouts:
       //  TOP_IJAVA_FRAME:
    -  //
       //    0       [TOP_IJAVA_FRAME_ABI]
       //            alignment (optional)
       //            [operand stack]
       //            [monitors] (optional)
    -  //           X[IJAVA_STATE]
    +  //            [IJAVA_STATE]
       //            note: own locals are located in the caller frame.
       //
       //  PARENT_IJAVA_FRAME:
    -  //
       //    0       [PARENT_IJAVA_FRAME_ABI]
       //            alignment (optional)
       //            [callee's Java result]
       //            [callee's locals w/o arguments]
       //            [outgoing arguments]
       //            [used part of operand stack w/o arguments]
    -  //            [monitors]      (optional)
    -  //           X[IJAVA_STATE]
    +  //            [monitors] (optional)
    +  //            [IJAVA_STATE]
       //
    +  //  ENTRY_FRAME:
    +  //    0       [PARENT_IJAVA_FRAME_ABI]
    +  //            alignment (optional)
    +  //            [callee's Java result]
    +  //            [callee's locals w/o arguments]
    +  //            [outgoing arguments]
    +  //            [ENTRY_FRAME_LOCALS]
     
       struct parent_ijava_frame_abi : abi_minframe {
       };
    @@ -269,113 +284,6 @@
     #define _ijava_state_neg(_component) \
             (int) (-frame::ijava_state_size + offset_of(frame::ijava_state, _component))
     
    -#else // CC_INTERP:
    -
    -  //  Frame layout for the Java C++ interpreter on PPC64.
    -  //
    -  //  This frame layout provides a C-like frame for every Java frame.
    -  //
    -  //  In these figures the stack grows upwards, while memory grows
    -  //  downwards. Square brackets denote regions possibly larger than
    -  //  single 64 bit slots.
    -  //
    -  //  STACK (no JNI, no compiled code, no library calls,
    -  //         interpreter-loop is active):
    -  //    0       [InterpretMethod]
    -  //            [TOP_IJAVA_FRAME]
    -  //            [PARENT_IJAVA_FRAME]
    -  //            ...
    -  //            [PARENT_IJAVA_FRAME]
    -  //            [ENTRY_FRAME]
    -  //            [C_FRAME]
    -  //            ...
    -  //            [C_FRAME]
    -  //
    -  //  TOP_IJAVA_FRAME:
    -  //    0       [TOP_IJAVA_FRAME_ABI]
    -  //            alignment (optional)
    -  //            [operand stack]
    -  //            [monitors] (optional)
    -  //            [cInterpreter object]
    -  //            result, locals, and arguments are in parent frame!
    -  //
    -  //  PARENT_IJAVA_FRAME:
    -  //    0       [PARENT_IJAVA_FRAME_ABI]
    -  //            alignment (optional)
    -  //            [callee's Java result]
    -  //            [callee's locals w/o arguments]
    -  //            [outgoing arguments]
    -  //            [used part of operand stack w/o arguments]
    -  //            [monitors] (optional)
    -  //            [cInterpreter object]
    -  //
    -  //  ENTRY_FRAME:
    -  //    0       [PARENT_IJAVA_FRAME_ABI]
    -  //            alignment (optional)
    -  //            [callee's Java result]
    -  //            [callee's locals w/o arguments]
    -  //            [outgoing arguments]
    -  //            [ENTRY_FRAME_LOCALS]
    -  //
    -  //  PARENT_IJAVA_FRAME_ABI:
    -  //    0       [ABI_MINFRAME]
    -  //            top_frame_sp
    -  //            initial_caller_sp
    -  //
    -  //  TOP_IJAVA_FRAME_ABI:
    -  //    0       [PARENT_IJAVA_FRAME_ABI]
    -  //            carg_3_unused
    -  //            carg_4_unused
    -  //            carg_5_unused
    -  //            carg_6_unused
    -  //            carg_7_unused
    -  //            frame_manager_lr
    -  //
    -
    -  // PARENT_IJAVA_FRAME_ABI
    -
    -  struct parent_ijava_frame_abi : abi_minframe {
    -    // SOE registers.
    -    // C2i adapters spill their top-frame stack-pointer here.
    -    uint64_t top_frame_sp;                        //      carg_1
    -    // Sp of calling compiled frame before it was resized by the c2i
    -    // adapter or sp of call stub. Does not contain a valid value for
    -    // non-initial frames.
    -    uint64_t initial_caller_sp;                   //      carg_2
    -    // aligned to frame::alignment_in_bytes (16)
    -  };
    -
    -  enum {
    -    parent_ijava_frame_abi_size = sizeof(parent_ijava_frame_abi)
    -  };
    -
    -  #define _parent_ijava_frame_abi(_component) \
    -          (offset_of(frame::parent_ijava_frame_abi, _component))
    -
    -  // TOP_IJAVA_FRAME_ABI
    -
    -  struct top_ijava_frame_abi : parent_ijava_frame_abi {
    -    uint64_t carg_3_unused;                       //      carg_3
    -    uint64_t card_4_unused;                       //_16   carg_4
    -    uint64_t carg_5_unused;                       //      carg_5
    -    uint64_t carg_6_unused;                       //_16   carg_6
    -    uint64_t carg_7_unused;                       //      carg_7
    -    // Use arg8 for storing frame_manager_lr. The size of
    -    // top_ijava_frame_abi must match abi_reg_args.
    -    uint64_t frame_manager_lr;                    //_16   carg_8
    -    // nothing to add here!
    -    // aligned to frame::alignment_in_bytes (16)
    -  };
    -
    -  enum {
    -    top_ijava_frame_abi_size = sizeof(top_ijava_frame_abi)
    -  };
    -
    -  #define _top_ijava_frame_abi(_component) \
    -          (offset_of(frame::top_ijava_frame_abi, _component))
    -
    -#endif // CC_INTERP
    -
       // ENTRY_FRAME
     
       struct entry_frame_locals {
    @@ -496,10 +404,6 @@
     
      public:
     
    -#ifdef CC_INTERP
    -  // Additional interface for interpreter frames:
    -  inline interpreterState get_interpreterState() const;
    -#else
       inline ijava_state* get_ijava_state() const;
       // Some convenient register frame setters/getters for deoptimization.
       inline intptr_t* interpreter_frame_esp() const;
    @@ -507,7 +411,6 @@
       inline void interpreter_frame_set_esp(intptr_t* esp);
       inline void interpreter_frame_set_top_frame_sp(intptr_t* top_frame_sp);
       inline void interpreter_frame_set_sender_sp(intptr_t* sender_sp);
    -#endif // CC_INTERP
     
       // Size of a monitor in bytes.
       static int interpreter_frame_monitor_size_in_bytes();
    diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp
    index 4945d7f827b..097ac0da6a1 100644
    --- a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp
    +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp
    @@ -123,84 +123,6 @@ inline intptr_t* frame::real_fp() const {
       return fp();
     }
     
    -#ifdef CC_INTERP
    -
    -inline interpreterState frame::get_interpreterState() const {
    -  return (interpreterState)(((address)callers_abi())
    -                            - frame::interpreter_frame_cinterpreterstate_size_in_bytes());
    -}
    -
    -inline intptr_t** frame::interpreter_frame_locals_addr() const {
    -  interpreterState istate = get_interpreterState();
    -  return (intptr_t**)&istate->_locals;
    -}
    -
    -inline intptr_t* frame::interpreter_frame_bcp_addr() const {
    -  interpreterState istate = get_interpreterState();
    -  return (intptr_t*)&istate->_bcp;
    -}
    -
    -inline intptr_t* frame::interpreter_frame_mdp_addr() const {
    -  interpreterState istate = get_interpreterState();
    -  return (intptr_t*)&istate->_mdx;
    -}
    -
    -inline intptr_t* frame::interpreter_frame_expression_stack() const {
    -  return (intptr_t*)interpreter_frame_monitor_end() - 1;
    -}
    -
    -inline jint frame::interpreter_frame_expression_stack_direction() {
    -  return -1;
    -}
    -
    -// top of expression stack
    -inline intptr_t* frame::interpreter_frame_tos_address() const {
    -  interpreterState istate = get_interpreterState();
    -  return istate->_stack + 1;
    -}
    -
    -inline intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
    -  return &interpreter_frame_tos_address()[offset];
    -}
    -
    -// monitor elements
    -
    -// in keeping with Intel side: end is lower in memory than begin;
    -// and beginning element is oldest element
    -// Also begin is one past last monitor.
    -
    -inline BasicObjectLock* frame::interpreter_frame_monitor_begin() const {
    -  return get_interpreterState()->monitor_base();
    -}
    -
    -inline BasicObjectLock* frame::interpreter_frame_monitor_end() const {
    -  return (BasicObjectLock*)get_interpreterState()->stack_base();
    -}
    -
    -inline int frame::interpreter_frame_cinterpreterstate_size_in_bytes() {
    -  // Size of an interpreter object. Not aligned with frame size.
    -  return round_to(sizeof(BytecodeInterpreter), 8);
    -}
    -
    -inline Method** frame::interpreter_frame_method_addr() const {
    -  interpreterState istate = get_interpreterState();
    -  return &istate->_method;
    -}
    -
    -// Constant pool cache
    -
    -inline ConstantPoolCache** frame::interpreter_frame_cpoolcache_addr() const {
    -  interpreterState istate = get_interpreterState();
    -  return &istate->_constants; // should really use accessor
    -}
    -
    -inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const {
    -  interpreterState istate = get_interpreterState();
    -  return &istate->_constants;
    -}
    -
    -#else // !CC_INTERP
    -
     // Template Interpreter frame value accessors.
     
     inline frame::ijava_state* frame::get_ijava_state() const {
    @@ -267,8 +189,6 @@ inline intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
       return &interpreter_frame_tos_address()[offset];
     }
     
    -#endif // CC_INTERP
    -
     inline int frame::interpreter_frame_monitor_size() {
       // Number of stack slots for a monitor.
       return round_to(BasicObjectLock::size(),  // number of stack slots
    diff --git a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
    index 43fe93146a9..c7d33304bd1 100644
    --- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
    @@ -26,6 +26,10 @@
     #ifndef CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
     #define CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
     
    +#ifdef CC_INTERP
    +#error "CC_INTERP no more supported. Removed in change 8145117."
    +#endif
    +
     // Size of PPC Instructions
     const int BytesPerInstWord = 4;
     
    diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
    index be9c8da7124..80350fe4c5d 100644
    --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
    +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
    @@ -1,6 +1,6 @@
     /*
      * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
    - * Copyright 2012, 2015 SAP AG. All rights reserved.
    + * Copyright (c) 2012, 2015 SAP SE. 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
    @@ -38,11 +38,7 @@
     #endif
     
     void InterpreterMacroAssembler::null_check_throw(Register a, int offset, Register temp_reg) {
    -#ifdef CC_INTERP
    -  address exception_entry = StubRoutines::throw_NullPointerException_at_call_entry();
    -#else
       address exception_entry = Interpreter::throw_NullPointerException_entry();
    -#endif
       MacroAssembler::null_check_throw(a, offset, temp_reg, exception_entry);
     }
     
    @@ -57,8 +53,6 @@ void InterpreterMacroAssembler::jump_to_entry(address entry, Register Rscratch)
       }
     }
     
    -#ifndef CC_INTERP
    -
     void InterpreterMacroAssembler::dispatch_next(TosState state, int bcp_incr) {
       Register bytecode = R12_scratch2;
       if (bcp_incr != 0) {
    @@ -207,7 +201,8 @@ void InterpreterMacroAssembler::load_dispatch_table(Register dst, address* table
       }
     }
     
    -void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, Register bytecode, address* table, bool verify) {
    +void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, Register bytecode,
    +                                                    address* table, bool verify) {
       if (verify) {
         unimplemented("dispatch_Lbyte_code: verify"); // See Sparc Implementation to implement this
       }
    @@ -394,7 +389,8 @@ void InterpreterMacroAssembler::get_4_byte_integer_at_bcp(int         bcp_offset
     //
     // Kills / writes:
     //   - Rdst, Rscratch
    -void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_offset, size_t index_size) {
    +void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_offset,
    +                                                       size_t index_size) {
       assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
       // Cache index is always in the native format, courtesy of Rewriter.
       if (index_size == sizeof(u2)) {
    @@ -416,7 +412,8 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_of
       // Rdst now contains cp cache index.
     }
     
    -void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, int bcp_offset, size_t index_size) {
    +void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, int bcp_offset,
    +                                                           size_t index_size) {
       get_cache_index_at_bcp(cache, bcp_offset, index_size);
       sldi(cache, cache, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord));
       add(cache, R27_constPoolCache, cache);
    @@ -514,7 +511,8 @@ void InterpreterMacroAssembler::generate_stack_overflow_check_with_compare_and_t
     // and put arrayOop + shifted_index into res.
     // Note: res is still shy of address by array offset into object.
     
    -void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Register Rindex, int index_shift, Register Rtmp, Register Rres) {
    +void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Register Rindex,
    +                                                        int index_shift, Register Rtmp, Register Rres) {
       // Check that index is in range for array, then shift index by index_shift,
       // and put arrayOop + shifted_index into res.
       // Note: res is still shy of address by array offset into object.
    @@ -566,7 +564,8 @@ void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Registe
       add(Rres, RsxtIndex, Rarray);
     }
     
    -void InterpreterMacroAssembler::index_check(Register array, Register index, int index_shift, Register tmp, Register res) {
    +void InterpreterMacroAssembler::index_check(Register array, Register index,
    +                                            int index_shift, Register tmp, Register res) {
       // pop array
       pop_ptr(array);
     
    @@ -637,7 +636,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
         Label Lunlock;
         // If it's still locked, everything is ok, unlock it.
         ld(Rmonitor_base, 0, R1_SP);
    -    addi(Rmonitor_base, Rmonitor_base, - (frame::ijava_state_size + frame::interpreter_frame_monitor_size_in_bytes())); // Monitor base
    +    addi(Rmonitor_base, Rmonitor_base,
    +         -(frame::ijava_state_size + frame::interpreter_frame_monitor_size_in_bytes())); // Monitor base
     
         ld(R0, BasicObjectLock::obj_offset_in_bytes(), Rmonitor_base);
         cmpdi(CCR0, R0, 0);
    @@ -677,7 +677,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
           subf_(Riterations, R26_monitor, Rmonitor_base);
           ble(CCR0, Lno_unlock);
     
    -      addi(Rcurrent_obj_addr, Rmonitor_base, BasicObjectLock::obj_offset_in_bytes() - frame::interpreter_frame_monitor_size_in_bytes());
    +      addi(Rcurrent_obj_addr, Rmonitor_base,
    +           BasicObjectLock::obj_offset_in_bytes() - frame::interpreter_frame_monitor_size_in_bytes());
           // Check if any monitor is on stack, bail out if not
           srdi(Riterations, Riterations, exact_log2(delta));
           mtctr(Riterations);
    @@ -727,7 +728,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
     }
     
     // Support function for remove_activation & Co.
    -void InterpreterMacroAssembler::merge_frames(Register Rsender_sp, Register return_pc, Register Rscratch1, Register Rscratch2) {
    +void InterpreterMacroAssembler::merge_frames(Register Rsender_sp, Register return_pc,
    +                                             Register Rscratch1, Register Rscratch2) {
       // Pop interpreter frame.
       ld(Rscratch1, 0, R1_SP); // *SP
       ld(Rsender_sp, _ijava_state_neg(sender_sp), Rscratch1); // top_frame_sp
    @@ -779,8 +781,6 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
       mtlr(R0);
     }
     
    -#endif // !CC_INTERP
    -
     // Lock object
     //
     // Registers alive
    @@ -791,7 +791,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
     void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
       if (UseHeavyMonitors) {
         call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
    -            monitor, /*check_for_exceptions=*/true CC_INTERP_ONLY(&& false));
    +            monitor, /*check_for_exceptions=*/true);
       } else {
         // template code:
         //
    @@ -888,7 +888,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
         // slow case of monitor enter.
         bind(slow_case);
         call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
    -            monitor, /*check_for_exceptions=*/true CC_INTERP_ONLY(&& false));
    +            monitor, /*check_for_exceptions=*/true);
         // }
         align(32, 12);
         bind(done);
    @@ -905,7 +905,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
     void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_exceptions) {
       if (UseHeavyMonitors) {
         call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit),
    -            monitor, check_for_exceptions CC_INTERP_ONLY(&& false));
    +            monitor, check_for_exceptions);
       } else {
     
         // template code:
    @@ -978,7 +978,7 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_e
         // we need to get into the slow case.
         bind(slow_case);
         call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit),
    -            monitor, check_for_exceptions CC_INTERP_ONLY(&& false));
    +            monitor, check_for_exceptions);
         // }
     
         Label done;
    @@ -993,8 +993,6 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_e
       }
     }
     
    -#ifndef CC_INTERP
    -
     // Load compiled (i2c) or interpreter entry when calling from interpreted and
     // do the call. Centralized so that all interpreter calls will do the same actions.
     // If jvmti single stepping is on for a thread we must not call compiled code.
    @@ -1004,7 +1002,8 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_e
     //   - Rret_addr:      return address
     //   - 2 scratch regs
     //
    -void InterpreterMacroAssembler::call_from_interpreter(Register Rtarget_method, Register Rret_addr, Register Rscratch1, Register Rscratch2) {
    +void InterpreterMacroAssembler::call_from_interpreter(Register Rtarget_method, Register Rret_addr,
    +                                                      Register Rscratch1, Register Rscratch2) {
       assert_different_registers(Rscratch1, Rscratch2, Rtarget_method, Rret_addr);
       // Assume we want to go compiled if available.
       const Register Rtarget_addr = Rscratch1;
    @@ -1488,7 +1487,8 @@ void InterpreterMacroAssembler::profile_typecheck_failed(Register Rscratch1, Reg
     }
     
     // Count a ret in the bytecodes.
    -void InterpreterMacroAssembler::profile_ret(TosState state, Register return_bci, Register scratch1, Register scratch2) {
    +void InterpreterMacroAssembler::profile_ret(TosState state, Register return_bci,
    +                                            Register scratch1, Register scratch2) {
       if (ProfileInterpreter) {
         Label profile_continue;
         uint row;
    @@ -1684,7 +1684,8 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper(
     // Argument and return type profilig.
     // kills: tmp, tmp2, R0, CR0, CR1
     void InterpreterMacroAssembler::profile_obj_type(Register obj, Register mdo_addr_base,
    -                                                 RegisterOrConstant mdo_addr_offs, Register tmp, Register tmp2) {
    +                                                 RegisterOrConstant mdo_addr_offs,
    +                                                 Register tmp, Register tmp2) {
       Label do_nothing, do_update;
     
       // tmp2 = obj is allowed
    @@ -1730,7 +1731,9 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, Register mdo_addr
       bind(do_nothing);
     }
     
    -void InterpreterMacroAssembler::profile_arguments_type(Register callee, Register tmp1, Register tmp2, bool is_virtual) {
    +void InterpreterMacroAssembler::profile_arguments_type(Register callee,
    +                                                       Register tmp1, Register tmp2,
    +                                                       bool is_virtual) {
       if (!ProfileInterpreter) {
         return;
       }
    @@ -1742,7 +1745,8 @@ void InterpreterMacroAssembler::profile_arguments_type(Register callee, Register
     
         test_method_data_pointer(profile_continue);
     
    -    int off_to_start = is_virtual ? in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size());
    +    int off_to_start = is_virtual ?
    +      in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size());
     
         lbz(tmp1, in_bytes(DataLayout::tag_offset()) - off_to_start, R28_mdx);
         cmpwi(CCR0, tmp1, is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag);
    @@ -1792,7 +1796,8 @@ void InterpreterMacroAssembler::profile_arguments_type(Register callee, Register
             // argument. tmp1 is the number of cells left in the
             // CallTypeData/VirtualCallTypeData to reach its end. Non null
             // if there's a return to profile.
    -        assert(ReturnTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(), "can't move past ret type");
    +        assert(ReturnTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(),
    +               "can't move past ret type");
             sldi(tmp1, tmp1, exact_log2(DataLayout::cell_size));
             add(R28_mdx, tmp1, R28_mdx);
           }
    @@ -1841,7 +1846,8 @@ void InterpreterMacroAssembler::profile_return_type(Register ret, Register tmp1,
       }
     }
     
    -void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4) {
    +void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register tmp2,
    +                                                        Register tmp3, Register tmp4) {
       if (ProfileInterpreter && MethodData::profile_parameters()) {
         Label profile_continue, done;
     
    @@ -1984,7 +1990,9 @@ void InterpreterMacroAssembler::load_local_long(Register Rdst_value, Register Rd
     // Kills:
     //   - Rdst_value
     //   - Rdst_address
    -void InterpreterMacroAssembler::load_local_ptr(Register Rdst_value, Register Rdst_address, Register Rindex) {
    +void InterpreterMacroAssembler::load_local_ptr(Register Rdst_value,
    +                                               Register Rdst_address,
    +                                               Register Rindex) {
       sldi(Rdst_address, Rindex, Interpreter::logStackElementSize);
       subf(Rdst_address, Rdst_address, R18_locals);
       ld(Rdst_value, 0, Rdst_address);
    @@ -1995,7 +2003,9 @@ void InterpreterMacroAssembler::load_local_ptr(Register Rdst_value, Register Rds
     // Kills:
     //   - Rdst_value
     //   - Rdst_address
    -void InterpreterMacroAssembler::load_local_float(FloatRegister Rdst_value, Register Rdst_address, Register Rindex) {
    +void InterpreterMacroAssembler::load_local_float(FloatRegister Rdst_value,
    +                                                 Register Rdst_address,
    +                                                 Register Rindex) {
       sldi(Rdst_address, Rindex, Interpreter::logStackElementSize);
       subf(Rdst_address, Rdst_address, R18_locals);
       lfs(Rdst_value, 0, Rdst_address);
    @@ -2006,7 +2016,9 @@ void InterpreterMacroAssembler::load_local_float(FloatRegister Rdst_value, Regis
     // Kills:
     //   - Rdst_value
     //   - Rdst_address
    -void InterpreterMacroAssembler::load_local_double(FloatRegister Rdst_value, Register Rdst_address, Register Rindex) {
    +void InterpreterMacroAssembler::load_local_double(FloatRegister Rdst_value,
    +                                                  Register Rdst_address,
    +                                                  Register Rindex) {
       sldi(Rdst_address, Rindex, Interpreter::logStackElementSize);
       subf(Rdst_address, Rdst_address, R18_locals);
       lfd(Rdst_value, -8, Rdst_address);
    @@ -2102,13 +2114,16 @@ void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point
       }
     }
     
    -void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, bool check_exceptions) {
    +void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point,
    +                                        Register arg_1, bool check_exceptions) {
       // ARG1 is reserved for the thread.
       mr_if_needed(R4_ARG2, arg_1);
       call_VM(oop_result, entry_point, check_exceptions);
     }
     
    -void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, bool check_exceptions) {
    +void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point,
    +                                        Register arg_1, Register arg_2,
    +                                        bool check_exceptions) {
       // ARG1 is reserved for the thread.
       mr_if_needed(R4_ARG2, arg_1);
       assert(arg_2 != R4_ARG2, "smashed argument");
    @@ -2116,7 +2131,9 @@ void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point
       call_VM(oop_result, entry_point, check_exceptions);
     }
     
    -void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, Register arg_3, bool check_exceptions) {
    +void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point,
    +                                        Register arg_1, Register arg_2, Register arg_3,
    +                                        bool check_exceptions) {
       // ARG1 is reserved for the thread.
       mr_if_needed(R4_ARG2, arg_1);
       assert(arg_2 != R4_ARG2, "smashed argument");
    @@ -2168,8 +2185,6 @@ void InterpreterMacroAssembler::restore_interpreter_state(Register scratch, bool
     #endif
     }
     
    -#endif // !CC_INTERP
    -
     void InterpreterMacroAssembler::get_method_counters(Register method,
                                                         Register Rcounters,
                                                         Label& skip) {
    @@ -2188,7 +2203,9 @@ void InterpreterMacroAssembler::get_method_counters(Register method,
       bind(has_counters);
     }
     
    -void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters, Register iv_be_count, Register Rtmp_r0) {
    +void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters,
    +                                                             Register iv_be_count,
    +                                                             Register Rtmp_r0) {
       assert(UseCompiler || LogTouchedMethods, "incrementing must be useful");
       Register invocation_count = iv_be_count;
       Register backedge_count   = Rtmp_r0;
    @@ -2230,7 +2247,6 @@ void InterpreterMacroAssembler::verify_oop(Register reg, TosState state) {
       if (state == atos) { MacroAssembler::verify_oop(reg); }
     }
     
    -#ifndef CC_INTERP
     // Local helper function for the verify_oop_or_return_address macro.
     static bool verify_return_address(Method* m, int bci) {
     #ifndef PRODUCT
    @@ -2287,7 +2303,6 @@ void InterpreterMacroAssembler::verify_oop_or_return_address(Register reg, Regis
       verify_oop(reg);
       bind(skip);
     }
    -#endif // !CC_INTERP
     
     // Inline assembly for:
     //
    @@ -2311,7 +2326,7 @@ void InterpreterMacroAssembler::notify_method_entry() {
         cmpwi(CCR0, R0, 0);
         beq(CCR0, jvmti_post_done);
         call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_entry),
    -            /*check_exceptions=*/true CC_INTERP_ONLY(&& false));
    +            /*check_exceptions=*/true);
     
         bind(jvmti_post_done);
       }
    @@ -2345,11 +2360,10 @@ void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, TosSta
         lwz(R0, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread);
         cmpwi(CCR0, R0, 0);
         beq(CCR0, jvmti_post_done);
    -    CC_INTERP_ONLY(assert(is_native_method && !check_exceptions, "must not push state"));
    -    if (!is_native_method) push(state); // Expose tos to GC.
    +    if (!is_native_method) { push(state); } // Expose tos to GC.
         call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit),
                 /*check_exceptions=*/check_exceptions);
    -    if (!is_native_method) pop(state);
    +    if (!is_native_method) { pop(state); }
     
         align(32, 12);
         bind(jvmti_post_done);
    @@ -2358,124 +2372,3 @@ void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, TosSta
       // Dtrace support not implemented.
     }
     
    -#ifdef CC_INTERP
    -// Convert the current TOP_IJAVA_FRAME into a PARENT_IJAVA_FRAME
    -// (using parent_frame_resize) and push a new interpreter
    -// TOP_IJAVA_FRAME (using frame_size).
    -void InterpreterMacroAssembler::push_interpreter_frame(Register top_frame_size, Register parent_frame_resize,
    -                                                       Register tmp1, Register tmp2, Register tmp3,
    -                                                       Register tmp4, Register pc) {
    -  assert_different_registers(top_frame_size, parent_frame_resize, tmp1, tmp2, tmp3, tmp4);
    -  ld(tmp1, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
    -  mr(tmp2/*top_frame_sp*/, R1_SP);
    -  // Move initial_caller_sp.
    -  ld(tmp4, _top_ijava_frame_abi(initial_caller_sp), R1_SP);
    -  neg(parent_frame_resize, parent_frame_resize);
    -  resize_frame(parent_frame_resize/*-parent_frame_resize*/, tmp3);
    -
    -  // Set LR in new parent frame.
    -  std(tmp1, _abi(lr), R1_SP);
    -  // Set top_frame_sp info for new parent frame.
    -  std(tmp2, _parent_ijava_frame_abi(top_frame_sp), R1_SP);
    -  std(tmp4, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
    -
    -  // Push new TOP_IJAVA_FRAME.
    -  push_frame(top_frame_size, tmp2);
    -
    -  get_PC_trash_LR(tmp3);
    -  std(tmp3, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
    -  // Used for non-initial callers by unextended_sp().
    -  std(R1_SP, _top_ijava_frame_abi(initial_caller_sp), R1_SP);
    -}
    -
    -// Pop the topmost TOP_IJAVA_FRAME and convert the previous
    -// PARENT_IJAVA_FRAME back into a TOP_IJAVA_FRAME.
    -void InterpreterMacroAssembler::pop_interpreter_frame(Register tmp1, Register tmp2, Register tmp3, Register tmp4) {
    -  assert_different_registers(tmp1, tmp2, tmp3, tmp4);
    -
    -  ld(tmp1/*caller's sp*/, _abi(callers_sp), R1_SP);
    -  ld(tmp3, _abi(lr), tmp1);
    -
    -  ld(tmp4, _parent_ijava_frame_abi(initial_caller_sp), tmp1);
    -
    -  ld(tmp2/*caller's caller's sp*/, _abi(callers_sp), tmp1);
    -  // Merge top frame.
    -  std(tmp2, _abi(callers_sp), R1_SP);
    -
    -  ld(tmp2, _parent_ijava_frame_abi(top_frame_sp), tmp1);
    -
    -  // Update C stack pointer to caller's top_abi.
    -  resize_frame_absolute(tmp2/*addr*/, tmp1/*tmp*/, tmp2/*tmp*/);
    -
    -  // Update LR in top_frame.
    -  std(tmp3, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
    -
    -  std(tmp4, _top_ijava_frame_abi(initial_caller_sp), R1_SP);
    -
    -  // Store the top-frame stack-pointer for c2i adapters.
    -  std(R1_SP, _top_ijava_frame_abi(top_frame_sp), R1_SP);
    -}
    -
    -// Turn state's interpreter frame into the current TOP_IJAVA_FRAME.
    -void InterpreterMacroAssembler::pop_interpreter_frame_to_state(Register state, Register tmp1, Register tmp2, Register tmp3) {
    -  assert_different_registers(R14_state, R15_prev_state, tmp1, tmp2, tmp3);
    -
    -  if (state == R14_state) {
    -    ld(tmp1/*state's fp*/, state_(_last_Java_fp));
    -    ld(tmp2/*state's sp*/, state_(_last_Java_sp));
    -  } else if (state == R15_prev_state) {
    -    ld(tmp1/*state's fp*/, prev_state_(_last_Java_fp));
    -    ld(tmp2/*state's sp*/, prev_state_(_last_Java_sp));
    -  } else {
    -    ShouldNotReachHere();
    -  }
    -
    -  // Merge top frames.
    -  std(tmp1, _abi(callers_sp), R1_SP);
    -
    -  // Tmp2 is new SP.
    -  // Tmp1 is parent's SP.
    -  resize_frame_absolute(tmp2/*addr*/, tmp1/*tmp*/, tmp2/*tmp*/);
    -
    -  // Update LR in top_frame.
    -  // Must be interpreter frame.
    -  get_PC_trash_LR(tmp3);
    -  std(tmp3, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
    -  // Used for non-initial callers by unextended_sp().
    -  std(R1_SP, _top_ijava_frame_abi(initial_caller_sp), R1_SP);
    -}
    -
    -// Set SP to initial caller's sp, but before fix the back chain.
    -void InterpreterMacroAssembler::resize_frame_to_initial_caller(Register tmp1, Register tmp2) {
    -  ld(tmp1, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
    -  ld(tmp2, _parent_ijava_frame_abi(callers_sp), R1_SP);
    -  std(tmp2, _parent_ijava_frame_abi(callers_sp), tmp1); // Fix back chain ...
    -  mr(R1_SP, tmp1); // ... and resize to initial caller.
    -}
    -
    -// Pop the current interpreter state (without popping the correspoding
    -// frame) and restore R14_state and R15_prev_state accordingly.
    -// Use prev_state_may_be_0 to indicate whether prev_state may be 0
    -// in order to generate an extra check before retrieving prev_state_(_prev_link).
    -void InterpreterMacroAssembler::pop_interpreter_state(bool prev_state_may_be_0)
    -{
    -  // Move prev_state to state and restore prev_state from state_(_prev_link).
    -  Label prev_state_is_0;
    -  mr(R14_state, R15_prev_state);
    -
    -  // Don't retrieve /*state==*/prev_state_(_prev_link)
    -  // if /*state==*/prev_state is 0.
    -  if (prev_state_may_be_0) {
    -    cmpdi(CCR0, R15_prev_state, 0);
    -    beq(CCR0, prev_state_is_0);
    -  }
    -
    -  ld(R15_prev_state, /*state==*/prev_state_(_prev_link));
    -  bind(prev_state_is_0);
    -}
    -
    -void InterpreterMacroAssembler::restore_prev_state() {
    -  // _prev_link is private, but cInterpreter is a friend.
    -  ld(R15_prev_state, state_(_prev_link));
    -}
    -#endif // CC_INTERP
    diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp
    index 9692e65225c..7fd60ead67d 100644
    --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp
    +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp
    @@ -45,14 +45,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
     #define thread_(field_name) in_bytes(JavaThread::field_name ## _offset()), R16_thread
     #define method_(field_name) in_bytes(Method::field_name ## _offset()), R19_method
     
    -#ifdef CC_INTERP
    -#define state_(field_name)  in_bytes(byte_offset_of(BytecodeInterpreter, field_name)), R14_state
    -#define prev_state_(field_name)  in_bytes(byte_offset_of(BytecodeInterpreter, field_name)), R15_prev_state
    -  void pop (TosState state) {};           // Not needed.
    -  void push(TosState state) {};           // Not needed.
    -#endif
    -
    -#ifndef CC_INTERP
       virtual void check_and_handle_popframe(Register java_thread);
       virtual void check_and_handle_earlyret(Register java_thread);
     
    @@ -207,7 +199,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
     
       void record_static_call_in_profile(Register Rentry, Register Rtmp);
       void record_receiver_call_in_profile(Register Rklass, Register Rentry, Register Rtmp);
    -#endif // !CC_INTERP
     
       void get_method_counters(Register method, Register Rcounters, Label& skip);
       void increment_invocation_counter(Register iv_be_count, Register Rtmp1, Register Rtmp2_r0);
    @@ -216,8 +207,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
       void lock_object  (Register lock_reg, Register obj_reg);
       void unlock_object(Register lock_reg, bool check_for_exceptions = true);
     
    -#ifndef CC_INTERP
    -
       // Interpreter profiling operations
       void set_method_data_pointer_for_bcp();
       void test_method_data_pointer(Label& zero_continue);
    @@ -260,14 +249,10 @@ class InterpreterMacroAssembler: public MacroAssembler {
       void profile_return_type(Register ret, Register tmp1, Register tmp2);
       void profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4);
     
    -#endif // !CC_INTERP
    -
       // Debugging
       void verify_oop(Register reg, TosState state = atos);    // only if +VerifyOops && state == atos
    -#ifndef CC_INTERP
       void verify_oop_or_return_address(Register reg, Register rtmp); // for astore
       void verify_FPU(int stack_depth, TosState state = ftos);
    -#endif // !CC_INTERP
     
       typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
     
    @@ -275,33 +260,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
       void notify_method_entry();
       void notify_method_exit(bool is_native_method, TosState state,
                               NotifyMethodExitMode mode, bool check_exceptions);
    -
    -#ifdef CC_INTERP
    -  // Convert the current TOP_IJAVA_FRAME into a PARENT_IJAVA_FRAME
    -  // (using parent_frame_resize) and push a new interpreter
    -  // TOP_IJAVA_FRAME (using frame_size).
    -  void push_interpreter_frame(Register top_frame_size, Register parent_frame_resize,
    -                              Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register pc=noreg);
    -
    -  // Pop the topmost TOP_IJAVA_FRAME and convert the previous
    -  // PARENT_IJAVA_FRAME back into a TOP_IJAVA_FRAME.
    -  void pop_interpreter_frame(Register tmp1, Register tmp2, Register tmp3, Register tmp4);
    -
    -  // Turn state's interpreter frame into the current TOP_IJAVA_FRAME.
    -  void pop_interpreter_frame_to_state(Register state, Register tmp1, Register tmp2, Register tmp3);
    -
    -  // Set SP to initial caller's sp, but before fix the back chain.
    -  void resize_frame_to_initial_caller(Register tmp1, Register tmp2);
    -
    -  // Pop the current interpreter state (without popping the
    -  // correspoding frame) and restore R14_state and R15_prev_state
    -  // accordingly. Use prev_state_may_be_0 to indicate whether
    -  // prev_state may be 0 in order to generate an extra check before
    -  // retrieving prev_state_(_prev_link).
    -  void pop_interpreter_state(bool prev_state_may_be_0);
    -
    -  void restore_prev_state();
    -#endif
     };
     
     #endif // CPU_PPC_VM_INTERP_MASM_PPC_64_HPP
    diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp
    index 280ebd5148b..b887d17828d 100644
    --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp
    @@ -457,17 +457,12 @@ address InterpreterGenerator::generate_abstract_entry(void) {
       // Reset JavaFrameAnchor from call_VM_leaf above.
       __ reset_last_Java_frame();
     
    -#ifdef CC_INTERP
    -  // Return to frame manager, it will handle the pending exception.
    -  __ blr();
    -#else
       // We don't know our caller, so jump to the general forward exception stub,
       // which will also pop our full frame off. Satisfy the interface of
       // SharedRuntime::generate_forward_exception()
       __ load_const_optimized(R11_scratch1, StubRoutines::forward_exception_entry(), R0);
       __ mtctr(R11_scratch1);
       __ bctr();
    -#endif
     
       return entry;
     }
    @@ -518,7 +513,7 @@ address InterpreterGenerator::generate_Reference_get_entry(void) {
         // continue and the thread will safepoint at the next bytecode dispatch.
     
         // If the receiver is null then it is OK to jump to the slow path.
    -    __ ld(R3_RET, Interpreter::stackElementSize, CC_INTERP_ONLY(R17_tos) NOT_CC_INTERP(R15_esp)); // get receiver
    +    __ ld(R3_RET, Interpreter::stackElementSize, R15_esp); // get receiver
     
         // Check if receiver == NULL and go the slow path.
         __ cmpdi(CCR0, R3_RET, 0);
    diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp
    index e42e66c6914..50dc2a2c567 100644
    --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp
    @@ -39,12 +39,10 @@
         return stackElementWords * i;
       }
     
    -#ifndef CC_INTERP
       // The offset in bytes to access a expression stack slot
       // relative to the esp pointer.
       static int expr_offset_in_bytes(int slot) {
         return stackElementSize * slot + wordSize;
       }
    -#endif
     
     #endif // CPU_PPC_VM_INTERPRETER_PPC_HPP
    diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
    index 38cf28d094a..87b16e0e572 100644
    --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
    @@ -2822,12 +2822,8 @@ void MacroAssembler::set_top_ijava_frame_at_SP_as_last_Java_frame(Register sp, R
       // sp points to a TOP_IJAVA_FRAME, retrieve frame's PC via
       // TOP_IJAVA_FRAME_ABI.
       // FIXME: assert that we really have a TOP_IJAVA_FRAME here!
    -#ifdef CC_INTERP
    -  ld(tmp1/*pc*/, _top_ijava_frame_abi(frame_manager_lr), sp);
    -#else
       address entry = pc();
       load_const_optimized(tmp1, entry);
    -#endif
     
       set_last_Java_frame(/*sp=*/sp, /*pc=*/tmp1);
     }
    diff --git a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp
    index fed5e53c206..168aacb6326 100644
    --- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp
    @@ -1,6 +1,6 @@
     /*
      * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
    - * Copyright 2012, 2014 SAP AG. All rights reserved.
    + * Copyright (c) 2012, 2015 SAP SE. 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
    @@ -32,12 +32,6 @@
     
     #define __ _masm->
     
    -#ifdef CC_INTERP
    -#define EXCEPTION_ENTRY StubRoutines::throw_NullPointerException_at_call_entry()
    -#else
    -#define EXCEPTION_ENTRY Interpreter::throw_NullPointerException_entry()
    -#endif
    -
     #ifdef PRODUCT
     #define BLOCK_COMMENT(str) // nothing
     #else
    @@ -51,10 +45,12 @@ inline static RegisterOrConstant constant(int value) {
       return RegisterOrConstant(value);
     }
     
    -void MethodHandles::load_klass_from_Class(MacroAssembler* _masm, Register klass_reg, Register temp_reg, Register temp2_reg) {
    -  if (VerifyMethodHandles)
    -    verify_klass(_masm, klass_reg, SystemDictionary::WK_KLASS_ENUM_NAME(java_lang_Class), temp_reg, temp2_reg,
    -                 "MH argument is a Class");
    +void MethodHandles::load_klass_from_Class(MacroAssembler* _masm, Register klass_reg,
    +                                          Register temp_reg, Register temp2_reg) {
    +  if (VerifyMethodHandles) {
    +    verify_klass(_masm, klass_reg, SystemDictionary::WK_KLASS_ENUM_NAME(java_lang_Class),
    +                 temp_reg, temp2_reg, "MH argument is a Class");
    +  }
       __ ld(klass_reg, java_lang_Class::klass_offset_in_bytes(), klass_reg);
     }
     
    @@ -187,7 +183,7 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
                             sizeof(u2), /*is_signed*/ false);
         // assert(sizeof(u2) == sizeof(ConstMethod::_size_of_parameters), "");
         Label L;
    -    __ ld(temp2, __ argument_offset(temp2, temp2, 0), CC_INTERP_ONLY(R17_tos) NOT_CC_INTERP(R15_esp));
    +    __ ld(temp2, __ argument_offset(temp2, temp2, 0), R15_esp);
         __ cmpd(CCR1, temp2, recv);
         __ beq(CCR1, L);
         __ stop("receiver not on stack");
    @@ -214,7 +210,7 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
         return NULL;
       }
     
    -  Register argbase    = CC_INTERP_ONLY(R17_tos) NOT_CC_INTERP(R15_esp); // parameter (preserved)
    +  Register argbase    = R15_esp; // parameter (preserved)
       Register argslot    = R3;
       Register temp1      = R6;
       Register param_size = R7;
    @@ -317,10 +313,12 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
           __ verify_oop(receiver_reg);
           if (iid == vmIntrinsics::_linkToSpecial) {
             // Don't actually load the klass; just null-check the receiver.
    -        __ null_check_throw(receiver_reg, -1, temp1, EXCEPTION_ENTRY);
    +        __ null_check_throw(receiver_reg, -1, temp1,
    +                            Interpreter::throw_NullPointerException_entry());
           } else {
             // load receiver klass itself
    -        __ null_check_throw(receiver_reg, oopDesc::klass_offset_in_bytes(), temp1, EXCEPTION_ENTRY);
    +        __ null_check_throw(receiver_reg, oopDesc::klass_offset_in_bytes(), temp1,
    +                            Interpreter::throw_NullPointerException_entry());
             __ load_klass(temp1_recv_klass, receiver_reg);
             __ verify_klass_ptr(temp1_recv_klass);
           }
    diff --git a/hotspot/src/cpu/ppc/vm/register_ppc.hpp b/hotspot/src/cpu/ppc/vm/register_ppc.hpp
    index 9dc765ab4a2..d97d3aea93b 100644
    --- a/hotspot/src/cpu/ppc/vm/register_ppc.hpp
    +++ b/hotspot/src/cpu/ppc/vm/register_ppc.hpp
    @@ -578,27 +578,17 @@ REGISTER_DECLARATION(FloatRegister, F13_ARG13,  F13); // volatile
     
     // Register declarations to be used in frame manager assembly code.
     // Use only non-volatile registers in order to keep values across C-calls.
    -#ifdef CC_INTERP
    -REGISTER_DECLARATION(Register, R14_state,      R14);      // address of new cInterpreter.
    -REGISTER_DECLARATION(Register, R15_prev_state, R15);      // address of old cInterpreter
    -#else // CC_INTERP
     REGISTER_DECLARATION(Register, R14_bcp,        R14);
     REGISTER_DECLARATION(Register, R15_esp,        R15);
     REGISTER_DECLARATION(FloatRegister, F15_ftos,  F15);
    -#endif // CC_INTERP
     REGISTER_DECLARATION(Register, R16_thread,     R16);      // address of current thread
     REGISTER_DECLARATION(Register, R17_tos,        R17);      // address of Java tos (prepushed).
     REGISTER_DECLARATION(Register, R18_locals,     R18);      // address of first param slot (receiver).
     REGISTER_DECLARATION(Register, R19_method,     R19);      // address of current method
     #ifndef DONT_USE_REGISTER_DEFINES
    -#ifdef CC_INTERP
    -#define R14_state         AS_REGISTER(Register, R14)
    -#define R15_prev_state    AS_REGISTER(Register, R15)
    -#else // CC_INTERP
     #define R14_bcp           AS_REGISTER(Register, R14)
     #define R15_esp           AS_REGISTER(Register, R15)
     #define F15_ftos          AS_REGISTER(FloatRegister, F15)
    -#endif // CC_INTERP
     #define R16_thread        AS_REGISTER(Register, R16)
     #define R17_tos           AS_REGISTER(Register, R17)
     #define R18_locals        AS_REGISTER(Register, R18)
    @@ -619,13 +609,11 @@ REGISTER_DECLARATION(Register, R26_tmp6, R26);
     REGISTER_DECLARATION(Register, R27_tmp7, R27);
     REGISTER_DECLARATION(Register, R28_tmp8, R28);
     REGISTER_DECLARATION(Register, R29_tmp9, R29);
    -#ifndef CC_INTERP
     REGISTER_DECLARATION(Register, R24_dispatch_addr,     R24);
     REGISTER_DECLARATION(Register, R25_templateTableBase, R25);
     REGISTER_DECLARATION(Register, R26_monitor,           R26);
     REGISTER_DECLARATION(Register, R27_constPoolCache,    R27);
     REGISTER_DECLARATION(Register, R28_mdx,               R28);
    -#endif // CC_INTERP
     
     #ifndef DONT_USE_REGISTER_DEFINES
     #define R21_tmp1         AS_REGISTER(Register, R21)
    @@ -637,7 +625,6 @@ REGISTER_DECLARATION(Register, R28_mdx,               R28);
     #define R27_tmp7         AS_REGISTER(Register, R27)
     #define R28_tmp8         AS_REGISTER(Register, R28)
     #define R29_tmp9         AS_REGISTER(Register, R29)
    -#ifndef CC_INTERP
     //    Lmonitors  : monitor pointer
     //    LcpoolCache: constant pool cache
     //    mdx: method data index
    @@ -649,7 +636,6 @@ REGISTER_DECLARATION(Register, R28_mdx,               R28);
     #endif
     
     #define CCR4_is_synced AS_REGISTER(ConditionRegister, CCR4)
    -#endif
     
     // Scratch registers are volatile.
     REGISTER_DECLARATION(Register, R11_scratch1, R11);
    diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
    index 141891d0a16..098e1ba4da0 100644
    --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
    @@ -1,6 +1,6 @@
     /*
      * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
    - * Copyright 2012, 2015 SAP AG. All rights reserved.
    + * Copyright (c) 2012, 2015 SAP SE. 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
    @@ -954,15 +954,10 @@ static address gen_c2i_adapter(MacroAssembler *masm,
     
       // Jump to the interpreter just as if interpreter was doing it.
     
    -#ifdef CC_INTERP
    -  const Register tos = R17_tos;
    -#else
    -  const Register tos = R15_esp;
       __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
    -#endif
     
       // load TOS
    -  __ addi(tos, R1_SP, st_off);
    +  __ addi(R15_esp, R1_SP, st_off);
     
       // Frame_manager expects initial_caller_sp (= SP without resize by c2i) in R21_tmp1.
       assert(sender_SP == R21_sender_SP, "passing initial caller's SP in wrong register");
    @@ -996,12 +991,7 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
       // save code can segv when fxsave instructions find improperly
       // aligned stack pointer.
     
    -#ifdef CC_INTERP
    -  const Register ld_ptr = R17_tos;
    -#else
       const Register ld_ptr = R15_esp;
    -#endif
    -
       const Register value_regs[] = { R22_tmp2, R23_tmp3, R24_tmp4, R25_tmp5, R26_tmp6 };
       const int num_value_regs = sizeof(value_regs) / sizeof(Register);
       int value_regs_index = 0;
    @@ -2593,15 +2583,11 @@ static void push_skeleton_frame(MacroAssembler* masm, bool deopt,
       __ ld(frame_size_reg, 0, frame_sizes_reg);
       __ std(pc_reg, _abi(lr), R1_SP);
       __ push_frame(frame_size_reg, R0/*tmp*/);
    -#ifdef CC_INTERP
    -  __ std(R1_SP, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
    -#else
     #ifdef ASSERT
       __ load_const_optimized(pc_reg, 0x5afe);
       __ std(pc_reg, _ijava_state_neg(ijava_reserved), R1_SP);
     #endif
       __ std(R1_SP, _ijava_state_neg(sender_sp), R1_SP);
    -#endif // CC_INTERP
       __ addi(number_of_frames_reg, number_of_frames_reg, -1);
       __ addi(frame_sizes_reg, frame_sizes_reg, wordSize);
       __ addi(pcs_reg, pcs_reg, wordSize);
    @@ -2673,15 +2659,11 @@ static void push_skeleton_frames(MacroAssembler* masm, bool deopt,
       __ std(R12_scratch2, _abi(lr), R1_SP);
     
       // Initialize initial_caller_sp.
    -#ifdef CC_INTERP
    -  __ std(frame_size_reg/*old_sp*/, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
    -#else
     #ifdef ASSERT
      __ load_const_optimized(pc_reg, 0x5afe);
      __ std(pc_reg, _ijava_state_neg(ijava_reserved), R1_SP);
     #endif
      __ std(frame_size_reg, _ijava_state_neg(sender_sp), R1_SP);
    -#endif // CC_INTERP
     
     #ifdef ASSERT
       // Make sure that there is at least one entry in the array.
    @@ -2708,9 +2690,6 @@ static void push_skeleton_frames(MacroAssembler* masm, bool deopt,
       // Store it in the top interpreter frame.
       __ std(R0, _abi(lr), R1_SP);
       // Initialize frame_manager_lr of interpreter top frame.
    -#ifdef CC_INTERP
    -  __ std(R0, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
    -#endif
     }
     #endif
     
    @@ -2899,16 +2878,8 @@ void SharedRuntime::generate_deopt_blob() {
       // optional c2i, caller of deoptee, ...).
     
       // Initialize R14_state.
    -#ifdef CC_INTERP
    -  __ ld(R14_state, 0, R1_SP);
    -  __ addi(R14_state, R14_state, -frame::interpreter_frame_cinterpreterstate_size_in_bytes());
    -  // Also inititialize R15_prev_state.
    -  __ restore_prev_state();
    -#else
       __ restore_interpreter_state(R11_scratch1);
       __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
    -#endif // CC_INTERP
    -
     
       // Return to the interpreter entry point.
       __ blr();
    @@ -3034,16 +3005,8 @@ void SharedRuntime::generate_uncommon_trap_blob() {
       // stack: (top interpreter frame, ..., optional interpreter frame,
       // optional c2i, caller of deoptee, ...).
     
    -#ifdef CC_INTERP
    -  // Initialize R14_state, ...
    -  __ ld(R11_scratch1, 0, R1_SP);
    -  __ addi(R14_state, R11_scratch1, -frame::interpreter_frame_cinterpreterstate_size_in_bytes());
    -  // also initialize R15_prev_state.
    -  __ restore_prev_state();
    -#else
       __ restore_interpreter_state(R11_scratch1);
       __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
    -#endif // CC_INTERP
     
       // Return to the interpreter entry point.
       __ blr();
    diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
    index 1dbb5c04f29..1a4493d96a0 100644
    --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
    @@ -225,11 +225,8 @@ class StubGenerator: public StubCodeGenerator {
           //   R16_thread  -  JavaThread*
     
           // Tos must point to last argument - element_size.
    -#ifdef CC_INTERP
    -      const Register tos = R17_tos;
    -#else
           const Register tos = R15_esp;
    -#endif
    +
           __ addi(tos, r_top_of_arguments_addr, -Interpreter::stackElementSize);
     
           // initialize call_stub locals (step 2)
    @@ -243,11 +240,7 @@ class StubGenerator: public StubCodeGenerator {
           assert(tos != r_arg_thread && R19_method != r_arg_thread, "trashed r_arg_thread");
     
           // Set R15_prev_state to 0 for simplifying checks in callee.
    -#ifdef CC_INTERP
    -      __ li(R15_prev_state, 0);
    -#else
           __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
    -#endif
           // Stack on entry to frame manager / native entry:
           //
           //      F0      [TOP_IJAVA_FRAME_ABI]
    diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
    index 1d99393562f..321a9c0e86d 100644
    --- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
    +++ b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
    @@ -24,7 +24,6 @@
      */
     
     #include "precompiled.hpp"
    -#ifndef CC_INTERP
     #include "asm/macroAssembler.inline.hpp"
     #include "interpreter/bytecodeHistogram.hpp"
     #include "interpreter/interpreter.hpp"
    @@ -1799,4 +1798,3 @@ void TemplateInterpreterGenerator::stop_interpreter_at() {
     }
     
     #endif // !PRODUCT
    -#endif // !CC_INTERP
    diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
    index 0660726181c..0bb08012e21 100644
    --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
    +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
    @@ -39,8 +39,6 @@
     #include "runtime/synchronizer.hpp"
     #include "utilities/macros.hpp"
     
    -#ifndef CC_INTERP
    -
     #undef __
     #define __ _masm->
     
    @@ -4145,4 +4143,3 @@ void TemplateTable::wide() {
       __ bctr();
       // Note: the bcp increment step is part of the individual wide bytecode implementations.
     }
    -#endif // !CC_INTERP
    
    From f238510a5ab86aca761cc4d2f0e039d6271f5f45 Mon Sep 17 00:00:00 2001
    From: Kirill Zhaldybin 
    Date: Thu, 10 Dec 2015 20:14:00 +0300
    Subject: [PATCH 059/228] 8143933: Create testlibrary for auxiliary methods
     used in g1/humongousObjects testing
    
    Reviewed-by: iignatyev, dfazunen
    ---
     .../test/gc/g1/humongousObjects/Helpers.java  |  58 ----
     .../TestHumongousThreshold.java               |   5 +-
     hotspot/test/gc/testlibrary/Helpers.java      | 251 ++++++++++++++++++
     3 files changed, 254 insertions(+), 60 deletions(-)
     delete mode 100644 hotspot/test/gc/g1/humongousObjects/Helpers.java
     create mode 100644 hotspot/test/gc/testlibrary/Helpers.java
    
    diff --git a/hotspot/test/gc/g1/humongousObjects/Helpers.java b/hotspot/test/gc/g1/humongousObjects/Helpers.java
    deleted file mode 100644
    index 9028fb6bdee..00000000000
    --- a/hotspot/test/gc/g1/humongousObjects/Helpers.java
    +++ /dev/null
    @@ -1,58 +0,0 @@
    -/*
    - * 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.
    - *
    - */
    -
    -package gc.g1.humongousObjects;
    -
    -import sun.hotspot.WhiteBox;
    -
    -public class Helpers {
    -
    -    // In case of 128 byte padding
    -    private static final int MAX_PADDING_SIZE = 128;
    -
    -    /**
    -     * Detects amount of extra bytes required to allocate a byte array.
    -     * Allocating a byte[n] array takes more then just n bytes in the heap.
    -     * Extra bytes are required to store object reference and the length.
    -     * This amount depends on bitness and other factors.
    -     *
    -     * @return byte[] memory overhead
    -     */
    -    public static int detectByteArrayAllocationOverhead() {
    -
    -        WhiteBox whiteBox = WhiteBox.getWhiteBox();
    -
    -        int zeroLengthByteArraySize = (int) whiteBox.getObjectSize(new byte[0]);
    -
    -        // Since we do not know is there any padding in zeroLengthByteArraySize we cannot just take byte[0] size as overhead
    -        for (int i = 1; i < MAX_PADDING_SIZE + 1; ++i) {
    -            int realAllocationSize = (int) whiteBox.getObjectSize(new byte[i]);
    -            if (realAllocationSize != zeroLengthByteArraySize) {
    -                // It means we did not have any padding on previous step
    -                return zeroLengthByteArraySize - (i - 1);
    -            }
    -        }
    -        throw new Error("We cannot find byte[] memory overhead - should not reach here");
    -    }
    -}
    diff --git a/hotspot/test/gc/g1/humongousObjects/TestHumongousThreshold.java b/hotspot/test/gc/g1/humongousObjects/TestHumongousThreshold.java
    index f372459987c..a9a83728195 100644
    --- a/hotspot/test/gc/g1/humongousObjects/TestHumongousThreshold.java
    +++ b/hotspot/test/gc/g1/humongousObjects/TestHumongousThreshold.java
    @@ -24,6 +24,7 @@
     
     package gc.g1.humongousObjects;
     
    +import gc.testlibrary.Helpers;
     import jdk.test.lib.Asserts;
     import sun.hotspot.WhiteBox;
     
    @@ -31,10 +32,10 @@ import sun.hotspot.WhiteBox;
      * @test TestHumongousThreshold
      * @summary Checks that objects larger than half a region are allocated as humongous
      * @requires vm.gc=="G1" | vm.gc=="null"
    - * @library /testlibrary /test/lib
    + * @library /testlibrary /test/lib /
      * @modules java.management
      * @build sun.hotspot.WhiteBox
    - *        gc.g1.humongousObjects.Helpers
    + *        gc.testlibrary.Helpers
      *        gc.g1.humongousObjects.TestHumongousThreshold
      * @run driver ClassFileInstaller sun.hotspot.WhiteBox
      *                                sun.hotspot.WhiteBox$WhiteBoxPermission
    diff --git a/hotspot/test/gc/testlibrary/Helpers.java b/hotspot/test/gc/testlibrary/Helpers.java
    new file mode 100644
    index 00000000000..aa20031cd10
    --- /dev/null
    +++ b/hotspot/test/gc/testlibrary/Helpers.java
    @@ -0,0 +1,251 @@
    +/*
    + * 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.
    + *
    + */
    +
    +package gc.testlibrary;
    +
    +import jdk.test.lib.JDKToolLauncher;
    +import jdk.test.lib.OutputAnalyzer;
    +import sun.hotspot.WhiteBox;
    +
    +import java.io.File;
    +import java.io.IOException;
    +import java.nio.file.Files;
    +import java.nio.file.Path;
    +
    +public class Helpers {
    +
    +    /**
    +     * Size of a long field in bytes
    +     */
    +    public static final int SIZE_OF_LONG = 8;
    +
    +    // In case of 128 byte padding
    +    private static final int MAX_PADDING_SIZE = 128;
    +
    +    /**
    +     * According class file format theoretical amount of fields in class is u2 which is (256 * 256 - 1).
    +     * Some service info takes place in constant pool and we really could make a class with only (256 * 256 - 29)
    +     * fields.
    +     * Since the exact value is not so important and I would like to avoid issues that may be caused by future changes/
    +     * different archs etc I selected (256 * 256 - 32) for this constant.
    +     * The test works with other values too but the smaller the number the more classes we need to generate and it takes
    +     * more time
    +     */
    +    private static final int MAXIMUM_AMOUNT_OF_FIELDS_IN_CLASS = 256 * 256 - 32;
    +
    +    /**
    +     * Detects amount of extra bytes required to allocate a byte array.
    +     * Allocating a byte[n] array takes more then just n bytes in the heap.
    +     * Extra bytes are required to store object reference and the length.
    +     * This amount depends on bitness and other factors.
    +     *
    +     * @return byte[] memory overhead
    +     */
    +    public static int detectByteArrayAllocationOverhead() {
    +
    +        WhiteBox whiteBox = WhiteBox.getWhiteBox();
    +
    +        int zeroLengthByteArraySize = (int) whiteBox.getObjectSize(new byte[0]);
    +
    +        // Since we do not know is there any padding in zeroLengthByteArraySize we cannot just take byte[0] size as overhead
    +        for (int i = 1; i < MAX_PADDING_SIZE + 1; ++i) {
    +            int realAllocationSize = (int) whiteBox.getObjectSize(new byte[i]);
    +            if (realAllocationSize != zeroLengthByteArraySize) {
    +                // It means we did not have any padding on previous step
    +                return zeroLengthByteArraySize - (i - 1);
    +            }
    +        }
    +        throw new Error("We cannot find byte[] memory overhead - should not reach here");
    +    }
    +
    +    /**
    +     * Compiles a java class
    +     *
    +     * @param className class name
    +     * @param root      root directory - where .java and .class files will be put
    +     * @param source    class source
    +     * @throws IOException if cannot write file to specified directory
    +     */
    +    public static void compileClass(String className, Path root, String source) throws IOException {
    +        Path sourceFile = root.resolve(className + ".java");
    +        Files.write(sourceFile, source.getBytes());
    +
    +        JDKToolLauncher jar = JDKToolLauncher.create("javac")
    +                .addToolArg("-d")
    +                .addToolArg(root.toAbsolutePath().toString())
    +                .addToolArg("-cp")
    +                .addToolArg(System.getProperty("java.class.path") + File.pathSeparator + root.toAbsolutePath())
    +                .addToolArg(sourceFile.toAbsolutePath().toString());
    +
    +        ProcessBuilder pb = new ProcessBuilder(jar.getCommand());
    +        OutputAnalyzer output = new OutputAnalyzer(pb.start());
    +        output.shouldHaveExitValue(0);
    +    }
    +
    +    /**
    +     * Generates class with specified name, which extends specified class, with specified constructor and specified
    +     * count of long fields
    +     * Generated class will looks like this:
    +     * public class ClassName extends SuperClass {
    +     * ClassName() {super();}
    +     * long f0;
    +     * ...
    +     * long fNNN;
    +     * 

    + * } + * + * @param className class name + * @param superClass super class. if null - no extends clause + * @param constructor constructor. if null - no constructor + * @param fieldCount count of long fields + * @return class text + */ + public static String generate(String className, String superClass, String constructor, long fieldCount) { + + StringBuilder builder = new StringBuilder(); + builder.append(String.format("public class %s%s {\n", className, superClass == null ? "" + : " extends " + superClass)); + + if (constructor != null) { + builder.append(constructor); + } + + for (int i = 0; i < fieldCount; ++i) { + builder.append(String.format("long f%d;\n", i)); + } + + builder.append("}\n"); + return builder.toString(); + } + + /** + * Changes string from enum notation to class notation - i.e. "VERY_SMALL_CAT" to "VerySmallCat" + * + * @param enumName string in enum notation + * @return string in class notation + */ + public static String enumNameToClassName(String enumName) { + if (enumName == null) { + return null; + } + + StringBuilder builder = new StringBuilder(); + boolean toLowerCase = false; + for (int i = 0; i < enumName.length(); ++i) { + if (enumName.charAt(i) == '_') { + toLowerCase = false; + } else { + builder.append(toLowerCase ? String.valueOf(enumName.charAt(i)).toLowerCase() : + String.valueOf(enumName.charAt(i))); + toLowerCase = true; + } + + } + return builder.toString(); + } + + /** + * Generates and compiles class with instance of specified size and load it in specified class loader + * Generated class will looks like this: + * public class ClassName extends SuperClass { + * long f0; + * ... + * long fNNN; + *

    + * } + * + * @param classLoader class loader + * @param className generated class name + * @param instanceSize size of generated class' instance. Size should be aligned by 8 bytes + * @param workDir working dir where generated classes are put and compiled + * @param prefix prefix for service classes (ones we use to create chain of inheritance). + * The names will be prefix_1, prefix_2,.., prefix_n + * @return Class object of generated and compiled class loaded in specified class loader + * @throws IOException + * @throws ClassNotFoundException + */ + public static Class generateCompileAndLoad(ClassLoader classLoader, String className, long instanceSize, + Path workDir, String prefix) + throws IOException, ClassNotFoundException { + + if (instanceSize % SIZE_OF_LONG != 0L) { + throw new Error(String.format("Test bug: only sizes aligned by 8 bytes are supported and %d was specified", + instanceSize)); + } + + long instanceSizeWithoutObjectHeader = instanceSize - WhiteBox.getWhiteBox().getObjectSize(new Object()); + + int generatedClassesCount; + int fieldsInLastClassCount; + + int sizeOfLastFile = (int) (instanceSizeWithoutObjectHeader + % (MAXIMUM_AMOUNT_OF_FIELDS_IN_CLASS * SIZE_OF_LONG)); + + if (sizeOfLastFile != 0) { + generatedClassesCount = (int) instanceSizeWithoutObjectHeader + / (MAXIMUM_AMOUNT_OF_FIELDS_IN_CLASS * SIZE_OF_LONG) + 1; + fieldsInLastClassCount = sizeOfLastFile / SIZE_OF_LONG; + } else { + generatedClassesCount = (int) instanceSizeWithoutObjectHeader + / (MAXIMUM_AMOUNT_OF_FIELDS_IN_CLASS * SIZE_OF_LONG); + fieldsInLastClassCount = MAXIMUM_AMOUNT_OF_FIELDS_IN_CLASS; + } + + for (int i = 0; i < generatedClassesCount; i++) { + // for the last generated class we use specified class name + String clsName = (i == generatedClassesCount - 1) ? className : prefix + i; + + Helpers.compileClass(clsName, workDir, + Helpers.generate( + clsName, + // for first generated class we don't have 'extends' + (i == 0 ? null : prefix + (i - 1)), + null, + // for the last generated class we use different field count + (i == generatedClassesCount - 1) ? fieldsInLastClassCount + : MAXIMUM_AMOUNT_OF_FIELDS_IN_CLASS)); + } + return classLoader.loadClass(className); + } + + /** + * Waits until Concurent Mark Cycle finishes + * @param wb Whitebox instance + * @param sleepTime sleep time + */ + public static void waitTillCMCFinished(WhiteBox wb, int sleepTime) { + while (wb.g1InConcurrentMark()) { + if (sleepTime > -1) { + try { + Thread.sleep(sleepTime); + } catch (InterruptedException e) { + System.out.println("Got InterruptedException while waiting for ConcMarkCycle to finish"); + Thread.currentThread().interrupt(); + break; + } + } + } + } + +} From a74243c3020290837578ee9ff94cbc615c50fc17 Mon Sep 17 00:00:00 2001 From: Rachel Protacio Date: Fri, 11 Dec 2015 14:58:20 -0500 Subject: [PATCH 060/228] 8145153: Convert TraceMonitorInflation to Unified Logging Updated -XX:+TraceMonitorInflation flag to -Xlog:monitorinflation=debug, with an alias (and related alias table) to support the old option. Reviewed-by: dholmes, mockner, coleenp --- hotspot/src/share/vm/logging/logTag.hpp | 1 + hotspot/src/share/vm/runtime/arguments.cpp | 32 ++++++++- hotspot/src/share/vm/runtime/arguments.hpp | 1 + hotspot/src/share/vm/runtime/globals.hpp | 3 - hotspot/src/share/vm/runtime/synchronizer.cpp | 25 ++++--- .../runtime/logging/MonitorInflationTest.java | 68 +++++++++++++++++++ 6 files changed, 115 insertions(+), 15 deletions(-) create mode 100644 hotspot/test/runtime/logging/MonitorInflationTest.java diff --git a/hotspot/src/share/vm/logging/logTag.hpp b/hotspot/src/share/vm/logging/logTag.hpp index de21a9e6f11..7927c7f2a6c 100644 --- a/hotspot/src/share/vm/logging/logTag.hpp +++ b/hotspot/src/share/vm/logging/logTag.hpp @@ -55,6 +55,7 @@ LOG_TAG(logging) \ LOG_TAG(marking) \ LOG_TAG(metaspace) \ + LOG_TAG(monitorinflation) \ LOG_TAG(phases) \ LOG_TAG(plab) \ LOG_TAG(promotion) \ diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 285e9e228e7..fe8dbf1b183 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -399,6 +399,12 @@ static AliasedFlag const aliased_jvm_flags[] = { { NULL, NULL} }; +static AliasedFlag const aliased_jvm_logging_flags[] = { + { "-XX:+TraceMonitorInflation", "-Xlog:monitorinflation=debug" }, + { "-XX:-TraceMonitorInflation", "-Xlog:monitorinflation=off" }, + { NULL, NULL } +}; + // Return true if "v" is less than "other", where "other" may be "undefined". static bool version_less_than(JDK_Version v, JDK_Version other) { assert(!v.is_undefined(), "must be defined"); @@ -929,6 +935,20 @@ const char* Arguments::handle_aliases_and_deprecation(const char* arg, bool warn return NULL; } +// lookup_logging_aliases +// Called from parse_each_vm_init_arg(). Should be called on -XX options before specific cases are checked. +// If arg matches any aliased_jvm_logging_flags entry, look up the real name and copy it into buffer. +bool Arguments::lookup_logging_aliases(const char* arg, char* buffer) { + for (size_t i = 0; aliased_jvm_logging_flags[i].alias_name != NULL; i++) { + const AliasedFlag& flag_status = aliased_jvm_logging_flags[i]; + if (strcmp(flag_status.alias_name, arg) == 0) { + strcpy(buffer, flag_status.real_name); + return true; + } + } + return false; +} + bool Arguments::parse_argument(const char* arg, Flag::Flags origin) { // range of acceptable characters spelled out for portability reasons @@ -2605,7 +2625,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, for (int index = 0; index < args->nOptions; index++) { bool is_absolute_path = false; // for -agentpath vs -agentlib - const JavaVMOption* option = args->options + index; + JavaVMOption* option = args->options + index; if (!match_option(option, "-Djava.class.path", &tail) && !match_option(option, "-Dsun.java.command", &tail) && @@ -2619,6 +2639,16 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, build_jvm_args(option->optionString); } + // char buffer to store looked up logging option. + char aliased_logging_option[256]; + + // Catch -XX options which are aliased to Unified logging commands. + if (match_option(option, "-XX:", &tail)) { + if (lookup_logging_aliases(option->optionString, aliased_logging_option)) { + option->optionString = aliased_logging_option; + } + } + // -verbose:[class/gc/jni] if (match_option(option, "-verbose", &tail)) { if (!strcmp(tail, ":class") || !strcmp(tail, "")) { diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index fc07f0f9c0e..8ad75aa506a 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -445,6 +445,7 @@ class Arguments : AllStatic { // Return the "real" name for option arg if arg is an alias, and print a warning if arg is deprecated. // Return NULL if the arg has expired. static const char* handle_aliases_and_deprecation(const char* arg, bool warn); + static bool lookup_logging_aliases(const char* arg, char* buffer); static short CompileOnlyClassesNum; static short CompileOnlyClassesMax; diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 18625166245..6292486d48e 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1506,9 +1506,6 @@ public: product(bool, TraceBiasedLocking, false, \ "Trace biased locking in JVM") \ \ - product(bool, TraceMonitorInflation, false, \ - "Trace monitor inflation in JVM") \ - \ /* gc */ \ \ product(bool, UseSerialGC, false, \ diff --git a/hotspot/src/share/vm/runtime/synchronizer.cpp b/hotspot/src/share/vm/runtime/synchronizer.cpp index 7046016299f..f74f78a98ef 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.cpp +++ b/hotspot/src/share/vm/runtime/synchronizer.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/vmSymbols.hpp" +#include "logging/log.hpp" #include "memory/metaspaceShared.hpp" #include "memory/padded.hpp" #include "memory/resourceArea.hpp" @@ -1414,12 +1415,12 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::inflate(Thread * Self, // to avoid false sharing on MP systems ... OM_PERFDATA_OP(Inflations, inc()); TEVENT(Inflate: overwrite stacklock); - if (TraceMonitorInflation) { + if (log_is_enabled(Debug, monitorinflation)) { if (object->is_instance()) { ResourceMark rm; - tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", - p2i(object), p2i(object->mark()), - object->klass()->external_name()); + log_debug(monitorinflation)("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", + p2i(object), p2i(object->mark()), + object->klass()->external_name()); } } return m; @@ -1462,12 +1463,12 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::inflate(Thread * Self, // cache lines to avoid false sharing on MP systems ... OM_PERFDATA_OP(Inflations, inc()); TEVENT(Inflate: overwrite neutral); - if (TraceMonitorInflation) { + if (log_is_enabled(Debug, monitorinflation)) { if (object->is_instance()) { ResourceMark rm; - tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", - p2i(object), p2i(object->mark()), - object->klass()->external_name()); + log_debug(monitorinflation)("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", + p2i(object), p2i(object->mark()), + object->klass()->external_name()); } } return m; @@ -1526,11 +1527,13 @@ bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj, // It's idle - scavenge and return to the global free list // plain old deflation ... TEVENT(deflate_idle_monitors - scavenge1); - if (TraceMonitorInflation) { + if (log_is_enabled(Debug, monitorinflation)) { if (obj->is_instance()) { ResourceMark rm; - tty->print_cr("Deflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", - p2i(obj), p2i(obj->mark()), obj->klass()->external_name()); + log_debug(monitorinflation)("Deflating object " INTPTR_FORMAT " , " + "mark " INTPTR_FORMAT " , type %s", + p2i(obj), p2i(obj->mark()), + obj->klass()->external_name()); } } diff --git a/hotspot/test/runtime/logging/MonitorInflationTest.java b/hotspot/test/runtime/logging/MonitorInflationTest.java new file mode 100644 index 00000000000..3799a016664 --- /dev/null +++ b/hotspot/test/runtime/logging/MonitorInflationTest.java @@ -0,0 +1,68 @@ +/* + * 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 8133885 + * @summary monitorinflation=debug should have logging from each of the statements in the code + * @library /testlibrary + * @modules java.base/sun.misc + * java.management + * @build MonitorInflationTest + * @run driver MonitorInflationTest + */ + +import jdk.test.lib.*; + +public class MonitorInflationTest { + static void analyzeOutputOn(ProcessBuilder pb) throws Exception { + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Inflating object"); + output.shouldContain("Deflating object "); + output.shouldHaveExitValue(0); + } + + static void analyzeOutputOff(ProcessBuilder pb) throws Exception { + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldNotContain("[monitorinflation]"); + output.shouldHaveExitValue(0); + } + + public static void main(String[] args) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:monitorinflation=debug", "-version"); + analyzeOutputOn(pb); + + pb = ProcessTools.createJavaProcessBuilder( + "-XX:+TraceMonitorInflation", "-version"); + analyzeOutputOn(pb); + + pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:monitorinflation=off", "-version"); + analyzeOutputOff(pb); + + pb = ProcessTools.createJavaProcessBuilder( + "-XX:-TraceMonitorInflation", "-version"); + analyzeOutputOff(pb); + } +} From 26af4d84c3ac794ef243633992405206b2eda495 Mon Sep 17 00:00:00 2001 From: Joseph Provino Date: Mon, 14 Dec 2015 17:06:06 -0500 Subject: [PATCH 061/228] 8139768: Running with -XX:CMSOldPLABNumRefills=2147483648 causes EXCEPTION_INT_DIVIDE_BY_ZERO on Windows i586 Use double arithmetic to avoid integer overflow Reviewed-by: jwilhelm, tbenson --- hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp index 933186d34fe..192fdab8e53 100644 --- a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp +++ b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp @@ -2517,7 +2517,11 @@ void CFLS_LAB::get_from_global_pool(size_t word_sz, AdaptiveFreeList* // Lacking sufficient experience, CMSOldPLABResizeQuicker is disabled by // default. if (ResizeOldPLAB && CMSOldPLABResizeQuicker) { - size_t multiple = _num_blocks[word_sz]/(CMSOldPLABToleranceFactor*CMSOldPLABNumRefills*n_blks); + // + // On a 32-bit VM, the denominator can become zero because of integer overflow, + // which is why there is a cast to double. + // + size_t multiple = (size_t) (_num_blocks[word_sz]/(((double)CMSOldPLABToleranceFactor)*CMSOldPLABNumRefills*n_blks)); n_blks += CMSOldPLABReactivityFactor*multiple*n_blks; n_blks = MIN2(n_blks, CMSOldPLABMax); } From 9c775566e5dbc1248fb02cd4b3cdf1b45baf9b93 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Mon, 7 Dec 2015 09:19:26 -0800 Subject: [PATCH 062/228] 8144853: Print the names of callees in PrintAssembly/PrintInterpreter Reviewed-by: dholmes, vlivanov --- hotspot/src/share/vm/code/nmethod.cpp | 12 ++++++++++++ hotspot/src/share/vm/compiler/disassembler.cpp | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 60a864b38e0..5ff6520581b 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -41,6 +41,7 @@ #include "prims/jvmtiImpl.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.inline.hpp" +#include "runtime/os.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/sweeper.hpp" #include "utilities/resourceHash.hpp" @@ -3050,6 +3051,17 @@ const char* nmethod::reloc_string_for(u_char* begin, u_char* end) { CodeBlob* cb = CodeCache::find_blob(dest); if (cb != NULL) { st.print(" %s", cb->name()); + } else { + ResourceMark rm; + const int buflen = 1024; + char* buf = NEW_RESOURCE_ARRAY(char, buflen); + int offset; + if (os::dll_address_to_function_name(dest, buf, buflen, &offset)) { + st.print(" %s", buf); + if (offset != 0) { + st.print("+%d", offset); + } + } } return st.as_string(); } diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp index 1ac15590cd0..4b15e7c6301 100644 --- a/hotspot/src/share/vm/compiler/disassembler.cpp +++ b/hotspot/src/share/vm/compiler/disassembler.cpp @@ -360,6 +360,22 @@ void decode_env::print_address(address adr) { } } + if (_nm == NULL) { + // Don't do this for native methods, as the function name will be printed in + // nmethod::reloc_string_for(). + ResourceMark rm; + const int buflen = 1024; + char* buf = NEW_RESOURCE_ARRAY(char, buflen); + int offset; + if (os::dll_address_to_function_name(adr, buf, buflen, &offset)) { + st->print(PTR_FORMAT " = %s", p2i(adr), buf); + if (offset != 0) { + st->print("+%d", offset); + } + return; + } + } + // Fall through to a simple (hexadecimal) numeral. st->print(PTR_FORMAT, p2i(adr)); } From 08a2e337c77be8952093613528751a9b905a898a Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Sun, 13 Dec 2015 22:51:13 +0100 Subject: [PATCH 063/228] 8145270: Need to eagerly initialize JVMCI compiler under -Xcomp Reviewed-by: twisti --- hotspot/src/share/vm/compiler/compileBroker.cpp | 14 +++++++++++++- hotspot/src/share/vm/compiler/compileBroker.hpp | 2 +- hotspot/src/share/vm/runtime/thread.cpp | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index e5eac46910c..9881a31435e 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -56,6 +56,7 @@ #if INCLUDE_JVMCI #include "jvmci/jvmciCompiler.hpp" #include "jvmci/jvmciRuntime.hpp" +#include "jvmci/jvmciJavaClasses.hpp" #include "runtime/vframe.hpp" #endif #ifdef COMPILER2 @@ -498,7 +499,7 @@ CompilerCounters::CompilerCounters() { // CompileBroker::compilation_init // // Initialize the Compilation object -void CompileBroker::compilation_init() { +void CompileBroker::compilation_init(TRAPS) { _last_method_compiled[0] = '\0'; // No need to initialize compilation system if we do not use it. @@ -529,6 +530,17 @@ void CompileBroker::compilation_init() { } else { c1_count = JVMCIHostThreads; } + + if (!UseInterpreter) { + // Force initialization of JVMCI compiler otherwise JVMCI + // compilations will not block until JVMCI is initialized + ResourceMark rm; + TempNewSymbol getCompiler = SymbolTable::new_symbol("getCompiler", CHECK); + TempNewSymbol sig = SymbolTable::new_symbol("()Ljdk/vm/ci/runtime/JVMCICompiler;", CHECK); + Handle jvmciRuntime = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK); + JavaValue result(T_OBJECT); + JavaCalls::call_virtual(&result, jvmciRuntime, HotSpotJVMCIRuntime::klass(), getCompiler, sig, CHECK); + } } } #endif // INCLUDE_JVMCI diff --git a/hotspot/src/share/vm/compiler/compileBroker.hpp b/hotspot/src/share/vm/compiler/compileBroker.hpp index 9c0709aa28f..448f1f8897d 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.hpp +++ b/hotspot/src/share/vm/compiler/compileBroker.hpp @@ -276,7 +276,7 @@ public: CompileQueue *q = compile_queue(comp_level); return q != NULL ? q->size() : 0; } - static void compilation_init(); + static void compilation_init(TRAPS); static void init_compiler_thread_log(); static nmethod* compile_method(const methodHandle& method, int osr_bci, diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index db0f5d9812c..f6f00384245 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -3628,7 +3628,7 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { // initialize compiler(s) #if defined(COMPILER1) || defined(COMPILER2) || defined(SHARK) || INCLUDE_JVMCI - CompileBroker::compilation_init(); + CompileBroker::compilation_init(CHECK_JNI_ERR); #endif // Pre-initialize some JSR292 core classes to avoid deadlock during class loading. From e4d937a557cfc0d7395be218994751d28bcd64ff Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Mon, 14 Dec 2015 13:06:39 -0800 Subject: [PATCH 064/228] 8145338: compiler/jsr292/CallSiteDepContextTest.java fails: assert(dep_implicit_context_arg(dept) == 0) failed: sanity Reviewed-by: twisti --- hotspot/src/share/vm/code/dependencies.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/hotspot/src/share/vm/code/dependencies.cpp b/hotspot/src/share/vm/code/dependencies.cpp index c941f404276..bdb1292a4aa 100644 --- a/hotspot/src/share/vm/code/dependencies.cpp +++ b/hotspot/src/share/vm/code/dependencies.cpp @@ -346,7 +346,6 @@ void Dependencies::assert_common_2(DepType dept, } } } else { - assert(dep_implicit_context_arg(dept) == 0, "sanity"); if (note_dep_seen(dept, x0) && note_dep_seen(dept, x1)) { // look in this bucket for redundant assertions const int stride = 2; From a08d3805f07742bcf22b20bab32134b45cf01b9d Mon Sep 17 00:00:00 2001 From: Jan Civlin Date: Mon, 14 Dec 2015 14:48:30 -0800 Subject: [PATCH 065/228] 8144771: Use AVX3 instructions for string compare Co-authored-by: Michael C Berg Reviewed-by: kvn, thartmann --- hotspot/src/cpu/x86/vm/assembler_x86.cpp | 226 +++++++++++------- hotspot/src/cpu/x86/vm/assembler_x86.hpp | 16 +- hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 79 +++++- .../src/cpu/x86/vm/sharedRuntime_x86_64.cpp | 6 +- .../src/cpu/x86/vm/stubGenerator_x86_32.cpp | 4 +- .../src/cpu/x86/vm/stubGenerator_x86_64.cpp | 6 +- 6 files changed, 234 insertions(+), 103 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index 015a66b7900..e55fd56e78d 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -2152,33 +2152,64 @@ void Assembler::movddup(XMMRegister dst, XMMRegister src) { emit_int8(0xC0 | encode); } -void Assembler::kmovwl(KRegister dst, Register src) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); +void Assembler::kmovbl(KRegister dst, Register src) { + assert(VM_Version::supports_avx512dq(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(dst, knoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x92); emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::kmovbl(Register dst, KRegister src) { + assert(VM_Version::supports_avx512dq(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0x93); + emit_int8((unsigned char)(0xC0 | encode)); +} + +void Assembler::kmovwl(KRegister dst, Register src) { + assert(VM_Version::supports_evex(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0x92); + emit_int8((unsigned char)(0xC0 | encode)); +} + +void Assembler::kmovwl(Register dst, KRegister src) { + assert(VM_Version::supports_evex(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0x93); + emit_int8((unsigned char)(0xC0 | encode)); +} + void Assembler::kmovdl(KRegister dst, Register src) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); - VexSimdPrefix pre = !_legacy_mode_bw ? VEX_SIMD_F2 : VEX_SIMD_NONE; + assert(VM_Version::supports_avx512bw(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(dst, knoreg, src, pre, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x92); emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::kmovdl(Register dst, KRegister src) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0x93); + emit_int8((unsigned char)(0xC0 | encode)); +} + void Assembler::kmovql(KRegister dst, KRegister src) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); + assert(VM_Version::supports_avx512bw(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(dst, knoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x90); emit_int8((unsigned char)(0xC0 | encode)); } void Assembler::kmovql(KRegister dst, Address src) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); + assert(VM_Version::supports_avx512bw(), ""); InstructionMark im(this); InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); vex_prefix(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); @@ -2187,7 +2218,7 @@ void Assembler::kmovql(KRegister dst, Address src) { } void Assembler::kmovql(Address dst, KRegister src) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); + assert(VM_Version::supports_avx512bw(), ""); InstructionMark im(this); InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); vex_prefix(dst, 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); @@ -2196,46 +2227,53 @@ void Assembler::kmovql(Address dst, KRegister src) { } void Assembler::kmovql(KRegister dst, Register src) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); - VexSimdPrefix pre = !_legacy_mode_bw ? VEX_SIMD_F2 : VEX_SIMD_NONE; - InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_bw, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(dst, knoreg, src, pre, VEX_OPCODE_0F, &attributes); + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x92); emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::kmovql(Register dst, KRegister src) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0x93); + emit_int8((unsigned char)(0xC0 | encode)); +} + // This instruction produces ZF or CF flags void Assembler::kortestbl(KRegister src1, KRegister src2) { - NOT_LP64(assert(VM_Version::supports_avx512dq(), "")); + assert(VM_Version::supports_avx512dq(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(src1, knoreg, src2, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x98); emit_int8((unsigned char)(0xC0 | encode)); } // This instruction produces ZF or CF flags void Assembler::kortestwl(KRegister src1, KRegister src2) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); + assert(VM_Version::supports_evex(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(src1, knoreg, src2, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x98); emit_int8((unsigned char)(0xC0 | encode)); } // This instruction produces ZF or CF flags void Assembler::kortestdl(KRegister src1, KRegister src2) { - NOT_LP64(assert(VM_Version::supports_avx512bw(), "")); + assert(VM_Version::supports_avx512bw(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(src1, knoreg, src2, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x98); emit_int8((unsigned char)(0xC0 | encode)); } // This instruction produces ZF or CF flags void Assembler::kortestql(KRegister src1, KRegister src2) { - NOT_LP64(assert(VM_Version::supports_avx512bw(), "")); + assert(VM_Version::supports_avx512bw(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(src1, knoreg, src2, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x98); emit_int8((unsigned char)(0xC0 | encode)); } @@ -2375,7 +2413,7 @@ void Assembler::vmovdqu(Address dst, XMMRegister src) { // Move Unaligned EVEX enabled Vector (programmable : 8,16,32,64) void Assembler::evmovdqub(XMMRegister dst, XMMRegister src, int vector_len) { assert(VM_Version::supports_evex(), ""); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8(0x6F); emit_int8((unsigned char)(0xC0 | encode)); @@ -2395,7 +2433,7 @@ void Assembler::evmovdqub(Address dst, XMMRegister src, int vector_len) { assert(VM_Version::supports_evex(), ""); assert(src != xnoreg, "sanity"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8(0x7F); @@ -2404,7 +2442,7 @@ void Assembler::evmovdqub(Address dst, XMMRegister src, int vector_len) { void Assembler::evmovdquw(XMMRegister dst, XMMRegister src, int vector_len) { assert(VM_Version::supports_evex(), ""); - InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8(0x6F); emit_int8((unsigned char)(0xC0 | encode)); @@ -2424,7 +2462,7 @@ void Assembler::evmovdquw(Address dst, XMMRegister src, int vector_len) { assert(VM_Version::supports_evex(), ""); assert(src != xnoreg, "sanity"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8(0x7F); @@ -3069,7 +3107,7 @@ void Assembler::packuswb(XMMRegister dst, Address src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); InstructionMark im(this); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x67); @@ -3078,7 +3116,7 @@ void Assembler::packuswb(XMMRegister dst, Address src) { void Assembler::packuswb(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x67); emit_int8((unsigned char)(0xC0 | encode)); @@ -3086,7 +3124,7 @@ void Assembler::packuswb(XMMRegister dst, XMMRegister src) { void Assembler::vpackuswb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { assert(UseAVX > 0, "some form of AVX must be enabled"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x67); @@ -3128,7 +3166,7 @@ void Assembler::pcmpestri(XMMRegister dst, XMMRegister src, int imm8) { // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst void Assembler::pcmpeqb(XMMRegister dst, XMMRegister src) { - NOT_LP64(assert(VM_Version::supports_sse2(), "")); + assert(VM_Version::supports_sse2(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x74); @@ -3148,16 +3186,28 @@ void Assembler::vpcmpeqb(XMMRegister dst, XMMRegister nds, XMMRegister src, int // In this context, kdst is written the mask used to process the equal components void Assembler::evpcmpeqb(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) { assert(VM_Version::supports_avx512bw(), ""); - InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(kdst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x74); emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::evpcmpeqb(KRegister kdst, XMMRegister nds, Address src, int vector_len) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); + int nds_enc = nds->is_valid() ? nds->encoding() : 0; + int dst_enc = kdst->encoding(); + vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8(0x74); + emit_operand(as_Register(dst_enc), src); +} + // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst void Assembler::pcmpeqw(XMMRegister dst, XMMRegister src) { - NOT_LP64(assert(VM_Version::supports_sse2(), "")); + assert(VM_Version::supports_sse2(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x75); @@ -3177,16 +3227,28 @@ void Assembler::vpcmpeqw(XMMRegister dst, XMMRegister nds, XMMRegister src, int // In this context, kdst is written the mask used to process the equal components void Assembler::evpcmpeqw(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) { assert(VM_Version::supports_avx512bw(), ""); - InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(kdst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x75); emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::evpcmpeqw(KRegister kdst, XMMRegister nds, Address src, int vector_len) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); + int nds_enc = nds->is_valid() ? nds->encoding() : 0; + int dst_enc = kdst->encoding(); + vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8(0x75); + emit_operand(as_Register(dst_enc), src); +} + // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst void Assembler::pcmpeqd(XMMRegister dst, XMMRegister src) { - NOT_LP64(assert(VM_Version::supports_sse2(), "")); + assert(VM_Version::supports_sse2(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x76); @@ -3213,9 +3275,21 @@ void Assembler::evpcmpeqd(KRegister kdst, XMMRegister nds, XMMRegister src, int emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::evpcmpeqd(KRegister kdst, XMMRegister nds, Address src, int vector_len) { + assert(VM_Version::supports_evex(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); + int nds_enc = nds->is_valid() ? nds->encoding() : 0; + int dst_enc = kdst->encoding(); + vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8(0x76); + emit_operand(as_Register(dst_enc), src); +} + // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst void Assembler::pcmpeqq(XMMRegister dst, XMMRegister src) { - NOT_LP64(assert(VM_Version::supports_sse4_1(), "")); + assert(VM_Version::supports_sse4_1(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x29); @@ -3328,7 +3402,7 @@ void Assembler::pinsrw(XMMRegister dst, Register src, int imm8) { void Assembler::pmovzxbw(XMMRegister dst, Address src) { assert(VM_Version::supports_sse4_1(), ""); InstructionMark im(this); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); attributes.set_address_attributes(/* tuple_type */ EVEX_HVM, /* input_size_in_bits */ EVEX_NObit); simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x30); @@ -3337,7 +3411,7 @@ void Assembler::pmovzxbw(XMMRegister dst, Address src) { void Assembler::pmovzxbw(XMMRegister dst, XMMRegister src) { assert(VM_Version::supports_sse4_1(), ""); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x30); emit_int8((unsigned char)(0xC0 | encode)); @@ -3347,7 +3421,7 @@ void Assembler::vpmovzxbw(XMMRegister dst, Address src, int vector_len) { assert(VM_Version::supports_avx(), ""); InstructionMark im(this); assert(dst != xnoreg, "sanity"); - InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); attributes.set_address_attributes(/* tuple_type */ EVEX_HVM, /* input_size_in_bits */ EVEX_NObit); vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x30); @@ -3452,7 +3526,7 @@ void Assembler::prefix(Prefix p) { void Assembler::pshufb(XMMRegister dst, XMMRegister src) { assert(VM_Version::supports_ssse3(), ""); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x00); emit_int8((unsigned char)(0xC0 | encode)); @@ -3461,7 +3535,7 @@ void Assembler::pshufb(XMMRegister dst, XMMRegister src) { void Assembler::pshufb(XMMRegister dst, Address src) { assert(VM_Version::supports_ssse3(), ""); InstructionMark im(this); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x00); @@ -3495,7 +3569,7 @@ void Assembler::pshufd(XMMRegister dst, Address src, int mode) { void Assembler::pshuflw(XMMRegister dst, XMMRegister src, int mode) { assert(isByte(mode), "invalid value"); NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8(0x70); emit_int8((unsigned char)(0xC0 | encode)); @@ -3507,7 +3581,7 @@ void Assembler::pshuflw(XMMRegister dst, Address src, int mode) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); InstructionMark im(this); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); simd_prefix(dst, xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8(0x70); @@ -4723,7 +4797,7 @@ void Assembler::vphaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, int v void Assembler::paddb(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xFC); emit_int8((unsigned char)(0xC0 | encode)); @@ -4731,7 +4805,7 @@ void Assembler::paddb(XMMRegister dst, XMMRegister src) { void Assembler::paddw(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xFD); emit_int8((unsigned char)(0xC0 | encode)); @@ -4771,7 +4845,7 @@ void Assembler::phaddd(XMMRegister dst, XMMRegister src) { void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xFC); @@ -4780,7 +4854,7 @@ void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, XMMRegister src, int ve void Assembler::vpaddw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xFD); @@ -4808,7 +4882,7 @@ void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, XMMRegister src, int ve void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); int nds_enc = nds->is_valid() ? nds->encoding() : 0; vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); @@ -4819,7 +4893,7 @@ void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, Address src, int vector void Assembler::vpaddw(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); int nds_enc = nds->is_valid() ? nds->encoding() : 0; vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); @@ -4851,7 +4925,7 @@ void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, Address src, int vector void Assembler::psubb(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xF8); emit_int8((unsigned char)(0xC0 | encode)); @@ -4859,7 +4933,7 @@ void Assembler::psubb(XMMRegister dst, XMMRegister src) { void Assembler::psubw(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xF9); emit_int8((unsigned char)(0xC0 | encode)); @@ -4882,7 +4956,7 @@ void Assembler::psubq(XMMRegister dst, XMMRegister src) { void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xF8); @@ -4891,7 +4965,7 @@ void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, XMMRegister src, int ve void Assembler::vpsubw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xF9); @@ -4919,7 +4993,7 @@ void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, XMMRegister src, int ve void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); int nds_enc = nds->is_valid() ? nds->encoding() : 0; vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); @@ -4930,7 +5004,7 @@ void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, Address src, int vector void Assembler::vpsubw(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); int nds_enc = nds->is_valid() ? nds->encoding() : 0; vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); @@ -4962,7 +5036,7 @@ void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, Address src, int vector void Assembler::pmullw(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xD5); emit_int8((unsigned char)(0xC0 | encode)); @@ -4978,7 +5052,7 @@ void Assembler::pmulld(XMMRegister dst, XMMRegister src) { void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xD5); @@ -5006,7 +5080,7 @@ void Assembler::vpmullq(XMMRegister dst, XMMRegister nds, XMMRegister src, int v void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); int nds_enc = nds->is_valid() ? nds->encoding() : 0; vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); @@ -5039,7 +5113,7 @@ void Assembler::vpmullq(XMMRegister dst, XMMRegister nds, Address src, int vecto // Shift packed integers left by specified number of bits. void Assembler::psllw(XMMRegister dst, int shift) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); // XMM6 is for /6 encoding: 66 0F 71 /6 ib int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x71); @@ -5069,7 +5143,7 @@ void Assembler::psllq(XMMRegister dst, int shift) { void Assembler::psllw(XMMRegister dst, XMMRegister shift) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xF1); emit_int8((unsigned char)(0xC0 | encode)); @@ -5093,7 +5167,7 @@ void Assembler::psllq(XMMRegister dst, XMMRegister shift) { void Assembler::vpsllw(XMMRegister dst, XMMRegister src, int shift, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); // XMM6 is for /6 encoding: 66 0F 71 /6 ib int encode = vex_prefix_and_encode(xmm6->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x71); @@ -5124,7 +5198,7 @@ void Assembler::vpsllq(XMMRegister dst, XMMRegister src, int shift, int vector_l void Assembler::vpsllw(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xF1); emit_int8((unsigned char)(0xC0 | encode)); @@ -5149,7 +5223,7 @@ void Assembler::vpsllq(XMMRegister dst, XMMRegister src, XMMRegister shift, int // Shift packed integers logically right by specified number of bits. void Assembler::psrlw(XMMRegister dst, int shift) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); // XMM2 is for /2 encoding: 66 0F 71 /2 ib int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x71); @@ -5181,7 +5255,7 @@ void Assembler::psrlq(XMMRegister dst, int shift) { void Assembler::psrlw(XMMRegister dst, XMMRegister shift) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xD1); emit_int8((unsigned char)(0xC0 | encode)); @@ -5205,7 +5279,7 @@ void Assembler::psrlq(XMMRegister dst, XMMRegister shift) { void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, int shift, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); // XMM2 is for /2 encoding: 66 0F 71 /2 ib int encode = vex_prefix_and_encode(xmm2->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x71); @@ -5235,7 +5309,7 @@ void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, int shift, int vector_l void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xD1); emit_int8((unsigned char)(0xC0 | encode)); @@ -5260,7 +5334,7 @@ void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, XMMRegister shift, int // Shift packed integers arithmetically right by specified number of bits. void Assembler::psraw(XMMRegister dst, int shift) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); // XMM4 is for /4 encoding: 66 0F 71 /4 ib int encode = simd_prefix_and_encode(xmm4, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x71); @@ -5280,7 +5354,7 @@ void Assembler::psrad(XMMRegister dst, int shift) { void Assembler::psraw(XMMRegister dst, XMMRegister shift) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xE1); emit_int8((unsigned char)(0xC0 | encode)); @@ -5296,7 +5370,7 @@ void Assembler::psrad(XMMRegister dst, XMMRegister shift) { void Assembler::vpsraw(XMMRegister dst, XMMRegister src, int shift, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); // XMM4 is for /4 encoding: 66 0F 71 /4 ib int encode = vex_prefix_and_encode(xmm4->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x71); @@ -5316,7 +5390,7 @@ void Assembler::vpsrad(XMMRegister dst, XMMRegister src, int shift, int vector_l void Assembler::vpsraw(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xE1); emit_int8((unsigned char)(0xC0 | encode)); @@ -5706,7 +5780,7 @@ void Assembler::vpbroadcastd(XMMRegister dst, XMMRegister src) { // duplicate 2-bytes integer data from src into 16 locations in dest void Assembler::vpbroadcastw(XMMRegister dst, XMMRegister src) { assert(VM_Version::supports_avx2(), ""); - InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x79); emit_int8((unsigned char)(0xC0 | encode)); @@ -6573,18 +6647,6 @@ int Assembler::simd_prefix_and_encode(XMMRegister dst, XMMRegister nds, XMMRegis } } -int Assembler::kreg_prefix_and_encode(KRegister dst, KRegister nds, KRegister src, VexSimdPrefix pre, - VexOpcode opc, InstructionAttr *attributes) { - int nds_enc = nds->is_valid() ? nds->encoding() : 0; - return vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), pre, opc, attributes); -} - -int Assembler::kreg_prefix_and_encode(KRegister dst, KRegister nds, Register src, VexSimdPrefix pre, - VexOpcode opc, InstructionAttr *attributes) { - int nds_enc = nds->is_valid() ? nds->encoding() : 0; - return vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), pre, opc, attributes); -} - void Assembler::cmppd(XMMRegister dst, XMMRegister nds, XMMRegister src, int cop, int vector_len) { assert(VM_Version::supports_avx(), ""); assert(!VM_Version::supports_evex(), ""); diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp index a5f493905fc..4b6dcf4a028 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp @@ -655,12 +655,6 @@ private: int simd_prefix_and_encode(XMMRegister dst, XMMRegister nds, XMMRegister src, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes); - int kreg_prefix_and_encode(KRegister dst, KRegister nds, KRegister src, VexSimdPrefix pre, - VexOpcode opc, InstructionAttr *attributes); - - int kreg_prefix_and_encode(KRegister dst, KRegister nds, Register src, VexSimdPrefix pre, - VexOpcode opc, InstructionAttr *attributes); - // Helper functions for groups of instructions void emit_arith_b(int op1, int op2, Register dst, int imm8); @@ -1331,12 +1325,17 @@ private: void movddup(XMMRegister dst, XMMRegister src); + void kmovbl(KRegister dst, Register src); + void kmovbl(Register dst, KRegister src); void kmovwl(KRegister dst, Register src); + void kmovwl(Register dst, KRegister src); void kmovdl(KRegister dst, Register src); + void kmovdl(Register dst, KRegister src); void kmovql(KRegister dst, KRegister src); - void kmovql(KRegister dst, Register src); void kmovql(Address dst, KRegister src); void kmovql(KRegister dst, Address src); + void kmovql(KRegister dst, Register src); + void kmovql(Register dst, KRegister src); void kortestbl(KRegister dst, KRegister src); void kortestwl(KRegister dst, KRegister src); @@ -1521,14 +1520,17 @@ private: void pcmpeqb(XMMRegister dst, XMMRegister src); void vpcmpeqb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void evpcmpeqb(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len); + void evpcmpeqb(KRegister kdst, XMMRegister nds, Address src, int vector_len); void pcmpeqw(XMMRegister dst, XMMRegister src); void vpcmpeqw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void evpcmpeqw(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len); + void evpcmpeqw(KRegister kdst, XMMRegister nds, Address src, int vector_len); void pcmpeqd(XMMRegister dst, XMMRegister src); void vpcmpeqd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void evpcmpeqd(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len); + void evpcmpeqd(KRegister kdst, XMMRegister nds, Address src, int vector_len); void pcmpeqq(XMMRegister dst, XMMRegister src); void vpcmpeqq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 2ccee91a6cd..a916379ea36 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -7999,9 +7999,15 @@ void MacroAssembler::string_compare(Register str1, Register str2, XMMRegister vec1, int ae) { ShortBranchVerifier sbv(this); Label LENGTH_DIFF_LABEL, POP_LABEL, DONE_LABEL, WHILE_HEAD_LABEL; + Label COMPARE_WIDE_VECTORS_LOOP_FAILED; // used only _LP64 && AVX3 int stride, stride2, adr_stride, adr_stride1, adr_stride2; + int stride2x2 = 0x40; Address::ScaleFactor scale, scale1, scale2; + if (ae != StrIntrinsicNode::LL) { + stride2x2 = 0x20; + } + if (ae == StrIntrinsicNode::LU || ae == StrIntrinsicNode::UL) { shrl(cnt2, 1); } @@ -8011,15 +8017,15 @@ void MacroAssembler::string_compare(Register str1, Register str2, movl(result, cnt1); subl(cnt1, cnt2); push(cnt1); - cmov32(Assembler::lessEqual, cnt2, result); + cmov32(Assembler::lessEqual, cnt2, result); // cnt2 = min(cnt1, cnt2) // Is the minimum length zero? testl(cnt2, cnt2); jcc(Assembler::zero, LENGTH_DIFF_LABEL); if (ae == StrIntrinsicNode::LL) { // Load first bytes - load_unsigned_byte(result, Address(str1, 0)); - load_unsigned_byte(cnt1, Address(str2, 0)); + load_unsigned_byte(result, Address(str1, 0)); // result = str1[0] + load_unsigned_byte(cnt1, Address(str2, 0)); // cnt1 = str2[0] } else if (ae == StrIntrinsicNode::UU) { // Load first characters load_unsigned_short(result, Address(str1, 0)); @@ -8060,7 +8066,10 @@ void MacroAssembler::string_compare(Register str1, Register str2, assert(UseSSE >= 4, "SSE4 must be enabled for SSE4.2 intrinsics to be available"); Label COMPARE_WIDE_VECTORS, VECTOR_NOT_EQUAL, COMPARE_WIDE_TAIL, COMPARE_SMALL_STR; Label COMPARE_WIDE_VECTORS_LOOP, COMPARE_16_CHARS, COMPARE_INDEX_CHAR; + Label COMPARE_WIDE_VECTORS_LOOP_AVX2; Label COMPARE_TAIL_LONG; + Label COMPARE_WIDE_VECTORS_LOOP_AVX3; // used only _LP64 && AVX3 + int pcmpmask = 0x19; if (ae == StrIntrinsicNode::LL) { pcmpmask &= ~0x01; @@ -8123,11 +8132,40 @@ void MacroAssembler::string_compare(Register str1, Register str2, } subl(result, stride2); subl(cnt2, stride2); - jccb(Assembler::zero, COMPARE_WIDE_TAIL); + jcc(Assembler::zero, COMPARE_WIDE_TAIL); negptr(result); // In a loop, compare 16-chars (32-bytes) at once using (vpxor+vptest) bind(COMPARE_WIDE_VECTORS_LOOP); + +#ifdef _LP64 + if (VM_Version::supports_avx512vlbw()) { // trying 64 bytes fast loop + cmpl(cnt2, stride2x2); + jccb(Assembler::below, COMPARE_WIDE_VECTORS_LOOP_AVX2); + testl(cnt2, stride2x2-1); // cnt2 holds the vector count + jccb(Assembler::notZero, COMPARE_WIDE_VECTORS_LOOP_AVX2); // means we cannot subtract by 0x40 + + bind(COMPARE_WIDE_VECTORS_LOOP_AVX3); // the hottest loop + if (ae == StrIntrinsicNode::LL || ae == StrIntrinsicNode::UU) { + evmovdquq(vec1, Address(str1, result, scale), Assembler::AVX_512bit); + evpcmpeqb(k7, vec1, Address(str2, result, scale), Assembler::AVX_512bit); // k7 == 11..11, if operands equal, otherwise k7 has some 0 + } else { + vpmovzxbw(vec1, Address(str1, result, scale1), Assembler::AVX_512bit); + evpcmpeqb(k7, vec1, Address(str2, result, scale2), Assembler::AVX_512bit); // k7 == 11..11, if operands equal, otherwise k7 has some 0 + } + kortestql(k7, k7); + jcc(Assembler::aboveEqual, COMPARE_WIDE_VECTORS_LOOP_FAILED); // miscompare + addptr(result, stride2x2); // update since we already compared at this addr + subl(cnt2, stride2x2); // and sub the size too + jccb(Assembler::notZero, COMPARE_WIDE_VECTORS_LOOP_AVX3); + + vpxor(vec1, vec1); + jmpb(COMPARE_WIDE_TAIL); + }//if (VM_Version::supports_avx512vlbw()) +#endif // _LP64 + + + bind(COMPARE_WIDE_VECTORS_LOOP_AVX2); if (ae == StrIntrinsicNode::LL || ae == StrIntrinsicNode::UU) { vmovdqu(vec1, Address(str1, result, scale)); vpxor(vec1, Address(str2, result, scale)); @@ -8136,7 +8174,7 @@ void MacroAssembler::string_compare(Register str1, Register str2, vpxor(vec1, Address(str2, result, scale2)); } vptest(vec1, vec1); - jccb(Assembler::notZero, VECTOR_NOT_EQUAL); + jcc(Assembler::notZero, VECTOR_NOT_EQUAL); addptr(result, stride2); subl(cnt2, stride2); jccb(Assembler::notZero, COMPARE_WIDE_VECTORS_LOOP); @@ -8151,7 +8189,7 @@ void MacroAssembler::string_compare(Register str1, Register str2, movl(result, stride2); movl(cnt2, result); negptr(result); - jmpb(COMPARE_WIDE_VECTORS_LOOP); + jmp(COMPARE_WIDE_VECTORS_LOOP_AVX2); // Identifies the mismatching (higher or lower)16-bytes in the 32-byte vectors. bind(VECTOR_NOT_EQUAL); @@ -8295,6 +8333,34 @@ void MacroAssembler::string_compare(Register str1, Register str2, } jmpb(DONE_LABEL); +#ifdef _LP64 + if (VM_Version::supports_avx512vlbw()) { + + bind(COMPARE_WIDE_VECTORS_LOOP_FAILED); + + kmovql(cnt1, k7); + notq(cnt1); + bsfq(cnt2, cnt1); + if (ae != StrIntrinsicNode::LL) { + // Divide diff by 2 to get number of chars + sarl(cnt2, 1); + } + addq(result, cnt2); + if (ae == StrIntrinsicNode::LL) { + load_unsigned_byte(cnt1, Address(str2, result)); + load_unsigned_byte(result, Address(str1, result)); + } else if (ae == StrIntrinsicNode::UU) { + load_unsigned_short(cnt1, Address(str2, result, scale)); + load_unsigned_short(result, Address(str1, result, scale)); + } else { + load_unsigned_short(cnt1, Address(str2, result, scale2)); + load_unsigned_byte(result, Address(str1, result, scale1)); + } + subl(result, cnt1); + jmpb(POP_LABEL); + }//if (VM_Version::supports_avx512vlbw()) +#endif // _LP64 + // Discard the stored length difference bind(POP_LABEL); pop(cnt1); @@ -8304,6 +8370,7 @@ void MacroAssembler::string_compare(Register str1, Register str2, if(ae == StrIntrinsicNode::UL) { negl(result); } + } // Search for Non-ASCII character (Negative byte value) in a byte array, diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index 79b2a0f1db6..2ea8f1a49f0 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -189,7 +189,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_ } // Save full ZMM registes(16..num_xmm_regs) base_addr = XSAVE_AREA_UPPERBANK; - int off = 0; + off = 0; int vector_len = Assembler::AVX_512bit; for (int n = 16; n < num_xmm_regs; n++) { __ evmovdqul(Address(rsp, base_addr+(off++*64)), as_XMMRegister(n), vector_len); @@ -199,7 +199,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_ if (VM_Version::supports_evex()) { // Save upper bank of ZMM registers(16..31) for double/float usage int base_addr = XSAVE_AREA_UPPERBANK; - int off = 0; + off = 0; for (int n = 16; n < num_xmm_regs; n++) { __ movsd(Address(rsp, base_addr+(off++*64)), as_XMMRegister(n)); } @@ -325,7 +325,7 @@ void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_ve assert(MaxVectorSize == 64, "only 512bit vectors are supported now"); } #else - assert(!save_vectors, "vectors are generated only by C2"); + assert(!restore_vectors, "vectors are generated only by C2"); #endif // On EVEX enabled targets everything is handled in pop fpu state diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 6298be79e33..b55d1bd2e9d 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -170,7 +170,7 @@ class StubGenerator: public StubCodeGenerator { // provide initial value for required masks if (UseAVX > 2) { __ movl(rbx, 0xffff); - __ kmovdl(k1, rbx); + __ kmovwl(k1, rbx); } // save and initialize %mxcsr @@ -798,7 +798,7 @@ class StubGenerator: public StubCodeGenerator { if (UseAVX > 2) { __ push(rbx); __ movl(rbx, 0xffff); - __ kmovdl(k1, rbx); + __ kmovwl(k1, rbx); __ pop(rbx); } // Copy 64-byte chunks diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index c704975870f..f86c6b88786 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -266,7 +266,7 @@ class StubGenerator: public StubCodeGenerator { __ movptr(r15_save, r15); if (UseAVX > 2) { __ movl(rbx, 0xffff); - __ kmovql(k1, rbx); + __ kmovwl(k1, rbx); } #ifdef _WIN64 int last_reg = 15; @@ -1350,7 +1350,7 @@ class StubGenerator: public StubCodeGenerator { Label L_end; if (UseAVX > 2) { __ movl(to, 0xffff); - __ kmovql(k1, to); + __ kmovwl(k1, to); } // Copy 64-bytes per iteration __ BIND(L_loop); @@ -1434,7 +1434,7 @@ class StubGenerator: public StubCodeGenerator { Label L_end; if (UseAVX > 2) { __ movl(to, 0xffff); - __ kmovql(k1, to); + __ kmovwl(k1, to); } // Copy 64-bytes per iteration __ BIND(L_loop); From ef1c3dc4ed614bcf7c8e9d6bb1d57015fc392ff7 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Mon, 7 Dec 2015 18:24:24 +0100 Subject: [PATCH 066/228] 8144850: C1: operator delete needs an implementation Reviewed-by: kvn --- hotspot/src/share/vm/c1/c1_LIRGenerator.hpp | 4 ++-- hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp index 47dd33df54e..9438d77288c 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp @@ -157,8 +157,8 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { private: void* operator new(size_t size) throw(); void* operator new[](size_t size) throw(); - void operator delete(void* p); - void operator delete[](void* p); + void operator delete(void* p) { ShouldNotReachHere(); } + void operator delete[](void* p) { ShouldNotReachHere(); } Compilation* _compilation; ciMethod* _method; // method that we are compiling diff --git a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp index 608f39a9196..0552125b8dc 100644 --- a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp +++ b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp @@ -50,8 +50,8 @@ private: private: void* operator new(size_t size) throw(); void* operator new[](size_t size) throw(); - void operator delete(void* p); - void operator delete[](void* p); + void operator delete(void* p) { ShouldNotReachHere(); } + void operator delete[](void* p) { ShouldNotReachHere(); } IR *_ir; boolArray _used; From 555dd24642f5c4069d8782bcd95fd434b135cc18 Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Wed, 9 Dec 2015 00:33:30 +0300 Subject: [PATCH 067/228] 8140667: CompilerControl: tests incorrectly set states for excluded methods Fix exclude command generation Reviewed-by: kvn --- .../mixed/RandomValidCommandsTest.java | 1 - .../scenario/AbstractCommandBuilder.java | 128 ++++++++++++++---- .../compilercontrol/share/scenario/State.java | 4 + 3 files changed, 103 insertions(+), 30 deletions(-) diff --git a/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java b/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java index 508963836e3..951789991f7 100644 --- a/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java +++ b/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java @@ -24,7 +24,6 @@ /* * @test * @bug 8137167 - * @ignore 8140667 * @summary Randomly generates valid commands with random types * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / * @build RandomValidCommandsTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java b/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java index 6a5b6342f47..0d78cadd8e0 100644 --- a/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java +++ b/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java @@ -33,6 +33,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.concurrent.Callable; /** @@ -48,38 +49,12 @@ public abstract class AbstractCommandBuilder @Override public void add(CompileCommand command) { compileCommands.add(command); + CommandStateBuilder.getInstance().add(command); } @Override public Map getStates() { - Map states = new HashMap<>(); - for (CompileCommand compileCommand : compileCommands) { - if (compileCommand.isValid()) { - CompileCommand cc = new CompileCommand(compileCommand.command, - compileCommand.methodDescriptor, - /* CompileCommand option and file doesn't support - compiler setting */ - null, - compileCommand.type); - MethodDescriptor md = cc.methodDescriptor; - for (Pair> pair: METHODS) { - Executable exec = pair.first; - State state = states.getOrDefault(exec, new State()); - MethodDescriptor execDesc = new MethodDescriptor(exec); - // if executable matches regex then apply the state - if (execDesc.getCanonicalString().matches(md.getRegexp())) { - state.apply(cc); - } else { - if (cc.command == Command.COMPILEONLY) { - state.setC1Compilable(false); - state.setC2Compilable(false); - } - } - states.put(exec, state); - } - } - } - return states; + return CommandStateBuilder.getInstance().getStates(); } @Override @@ -89,7 +64,102 @@ public abstract class AbstractCommandBuilder @Override public boolean isValid() { - // CompileCommand ignores invalid items + // -XX:CompileCommand(File) ignores invalid items return true; } + + /* + * This is an internal class used to build states for commands given from + * options and a file. As all commands are added into a single set in + * CompilerOracle, we need a class that builds states in the same manner + */ + private static class CommandStateBuilder { + private static final CommandStateBuilder INSTANCE + = new CommandStateBuilder(); + private final List optionCommands = new ArrayList<>(); + private final List fileCommands = new ArrayList<>(); + + private CommandStateBuilder() { } + + public static CommandStateBuilder getInstance() { + return INSTANCE; + } + + public void add(CompileCommand command) { + switch (command.type) { + case OPTION: + optionCommands.add(command); + break; + case FILE: + fileCommands.add(command); + break; + default: + throw new Error("TESTBUG: wrong type: " + command.type); + } + } + + public Map getStates() { + List commandList = new ArrayList<>(); + commandList.addAll(optionCommands); + commandList.addAll(fileCommands); + Map states = new HashMap<>(); + for (Pair> pair : METHODS) { + Executable exec = pair.first; + State state = getState(commandList, states, exec); + states.put(exec, state); + } + return states; + } + + private State getState(List commandList, + Map states, Executable exec) { + State state = states.getOrDefault(exec, new State()); + MethodDescriptor execDesc = new MethodDescriptor(exec); + for (CompileCommand compileCommand : commandList) { + if (compileCommand.isValid()) { + // Create a copy without compiler set + CompileCommand cc = new CompileCommand( + compileCommand.command, + compileCommand.methodDescriptor, + /* CompileCommand option and file doesn't support + compiler setting */ + null, + compileCommand.type); + MethodDescriptor md = cc.methodDescriptor; + // if executable matches regex then apply the state + if (execDesc.getCanonicalString().matches(md.getRegexp())) { + if (cc.command == Command.COMPILEONLY + && !state.isCompilable()) { + /* if the method was already excluded it will not + be compilable again */ + } else { + state.apply(cc); + } + } + } + } + + /* + * Set compilation states for methods that don't match + * any compileonly command. Such methods should be excluded + * from compilation + */ + for (CompileCommand compileCommand : commandList) { + if (compileCommand.isValid() + && (compileCommand.command == Command.COMPILEONLY)) { + MethodDescriptor md = compileCommand.methodDescriptor; + if (!execDesc.getCanonicalString().matches(md.getRegexp()) + && (state.getCompilableOptional( + // no matter C1, C2 or both + Scenario.Compiler.C2).isPresent())) { + /* compileonly excludes only methods that haven't been + already set to be compilable or excluded */ + state.setC1Compilable(false); + state.setC2Compilable(false); + } + } + } + return state; + } + } } diff --git a/hotspot/test/compiler/compilercontrol/share/scenario/State.java b/hotspot/test/compiler/compilercontrol/share/scenario/State.java index b9a81984b69..82a46e7dc69 100644 --- a/hotspot/test/compiler/compilercontrol/share/scenario/State.java +++ b/hotspot/test/compiler/compilercontrol/share/scenario/State.java @@ -135,6 +135,10 @@ public class State { + "\nprint_inline " + printInline; } + public Optional getCompilableOptional(Scenario.Compiler compiler) { + return compile[compiler.ordinal()]; + } + public boolean isC1Compilable() { return compile[Scenario.Compiler.C1.ordinal()].orElse(true); } From a1bb5b8456cbfedbf39e56382005c120912fd36a Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Wed, 9 Dec 2015 00:30:32 +0300 Subject: [PATCH 068/228] 8144933: CompilerControl: commandfile/ExcludeTest has incorrect jtreg run innotation Fix incorrect full test name Reviewed-by: kvn --- .../test/compiler/compilercontrol/commandfile/ExcludeTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java index b4843a7d930..0e5dc7948e0 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java @@ -30,7 +30,7 @@ * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm compiler.compilercontrol.commands.ExcludeTest + * @run main/othervm compiler.compilercontrol.commandfile.ExcludeTest */ package compiler.compilercontrol.commandfile; From 1f2a9c1407f43ad254bc467d24c17fbd7985d88c Mon Sep 17 00:00:00 2001 From: Jamsheed Mohammed Date: Wed, 9 Dec 2015 11:06:39 +0100 Subject: [PATCH 069/228] 6808665: Use486InstrsOnly aborts 32-bit VM The code supporting -XX:+/-Use486InstrsOnly was removed. Reviewed-by: dholmes, thartmann, vlivanov --- hotspot/src/cpu/x86/vm/globals_x86.hpp | 3 --- hotspot/src/cpu/x86/vm/vm_version_x86.cpp | 26 +++++++++++------------ 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index 43c4cca5b2a..4c57e1b9a9f 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -175,9 +175,6 @@ define_pd_global(bool, PreserveFramePointer, false); "Use RTM Xend instead of Xabort when lock busy") \ \ /* assembler */ \ - product(bool, Use486InstrsOnly, false, \ - "Use 80486 Compliant instruction subset") \ - \ product(bool, UseCountLeadingZerosInstruction, false, \ "Use count leading zeros instruction") \ \ diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index eed88e81342..b13974f1e37 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -473,23 +473,21 @@ void VM_Version::get_processor_features() { // i486 internal cache is both I&D and has a 16-byte line size _L1_data_cache_line_size = 16; - if (!Use486InstrsOnly) { - // Get raw processor info + // Get raw processor info - get_cpu_info_stub(&_cpuid_info); + get_cpu_info_stub(&_cpuid_info); - assert_is_initialized(); - _cpu = extended_cpu_family(); - _model = extended_cpu_model(); - _stepping = cpu_stepping(); + assert_is_initialized(); + _cpu = extended_cpu_family(); + _model = extended_cpu_model(); + _stepping = cpu_stepping(); - if (cpu_family() > 4) { // it supports CPUID - _cpuFeatures = feature_flags(); - // Logical processors are only available on P4s and above, - // and only if hyperthreading is available. - _logical_processors_per_package = logical_processor_count(); - _L1_data_cache_line_size = L1_line_size(); - } + if (cpu_family() > 4) { // it supports CPUID + _cpuFeatures = feature_flags(); + // Logical processors are only available on P4s and above, + // and only if hyperthreading is available. + _logical_processors_per_package = logical_processor_count(); + _L1_data_cache_line_size = L1_line_size(); } _supports_cx8 = supports_cmpxchg8(); From 4d4c7ad974ca451cedf0b3c3f31efcacc98234b6 Mon Sep 17 00:00:00 2001 From: Paul Sandoz Date: Wed, 9 Dec 2015 14:54:40 +0100 Subject: [PATCH 070/228] 8143628: Fork sun.misc.Unsafe and jdk.internal.misc.Unsafe native method tables Reviewed-by: shade, dholmes, alanb, chegar, mchung, roland --- hotspot/src/share/vm/prims/nativeLookup.cpp | 7 +- hotspot/src/share/vm/prims/unsafe.cpp | 90 ++++++- ...dkInternalMiscUnsafeAccessTestBoolean.java | 135 ++++++++++ .../JdkInternalMiscUnsafeAccessTestByte.java | 172 ++++++++++++ .../JdkInternalMiscUnsafeAccessTestChar.java | 190 ++++++++++++++ ...JdkInternalMiscUnsafeAccessTestDouble.java | 172 ++++++++++++ .../JdkInternalMiscUnsafeAccessTestFloat.java | 172 ++++++++++++ .../JdkInternalMiscUnsafeAccessTestInt.java | 229 ++++++++++++++++ .../JdkInternalMiscUnsafeAccessTestLong.java | 229 ++++++++++++++++ ...JdkInternalMiscUnsafeAccessTestObject.java | 165 ++++++++++++ .../JdkInternalMiscUnsafeAccessTestShort.java | 190 ++++++++++++++ .../SunMiscUnsafeAccessTestBoolean.java | 135 ++++++++++ .../unsafe/SunMiscUnsafeAccessTestByte.java | 172 ++++++++++++ .../unsafe/SunMiscUnsafeAccessTestChar.java | 172 ++++++++++++ .../unsafe/SunMiscUnsafeAccessTestDouble.java | 172 ++++++++++++ .../unsafe/SunMiscUnsafeAccessTestFloat.java | 172 ++++++++++++ .../unsafe/SunMiscUnsafeAccessTestInt.java | 211 +++++++++++++++ .../unsafe/SunMiscUnsafeAccessTestLong.java | 211 +++++++++++++++ .../unsafe/SunMiscUnsafeAccessTestObject.java | 165 ++++++++++++ .../unsafe/SunMiscUnsafeAccessTestShort.java | 172 ++++++++++++ .../unsafe/X-UnsafeAccessTest.java.template | 247 ++++++++++++++++++ .../unsafe/generate-unsafe-access-tests.sh | 119 +++++++++ 22 files changed, 3690 insertions(+), 9 deletions(-) create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java create mode 100644 hotspot/test/compiler/unsafe/X-UnsafeAccessTest.java.template create mode 100644 hotspot/test/compiler/unsafe/generate-unsafe-access-tests.sh diff --git a/hotspot/src/share/vm/prims/nativeLookup.cpp b/hotspot/src/share/vm/prims/nativeLookup.cpp index fecef0a5055..5f693b46684 100644 --- a/hotspot/src/share/vm/prims/nativeLookup.cpp +++ b/hotspot/src/share/vm/prims/nativeLookup.cpp @@ -107,7 +107,8 @@ char* NativeLookup::long_jni_name(const methodHandle& method) { } extern "C" { - void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls); + void JNICALL JVM_RegisterJDKInternalMiscUnsafeMethods(JNIEnv *env, jclass unsafecls); + void JNICALL JVM_RegisterSunMiscUnsafeMethods(JNIEnv *env, jclass unsafecls); void JNICALL JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass unsafecls); void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass); void JNICALL JVM_RegisterWhiteBoxMethods(JNIEnv *env, jclass wbclass); @@ -121,8 +122,8 @@ extern "C" { #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f) static JNINativeMethod lookup_special_native_methods[] = { - { CC"Java_jdk_internal_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, - { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, + { CC"Java_jdk_internal_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterJDKInternalMiscUnsafeMethods) }, + { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterSunMiscUnsafeMethods) }, { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) }, { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) }, { CC"Java_sun_hotspot_WhiteBox_registerNatives", NULL, FN_PTR(JVM_RegisterWhiteBoxMethods) }, diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp index d2d1f0bb866..9d74cf1cf45 100644 --- a/hotspot/src/share/vm/prims/unsafe.cpp +++ b/hotspot/src/share/vm/prims/unsafe.cpp @@ -1227,8 +1227,76 @@ UNSAFE_END {CC "put" #Byte, CC "(" ADR#B ")V", FN_PTR(Unsafe_SetNative##Byte)} +static JNINativeMethod sun_misc_Unsafe_methods[] = { + {CC "getObject", CC "(" OBJ "J)" OBJ "", FN_PTR(Unsafe_GetObject)}, + {CC "putObject", CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetObject)}, + {CC "getObjectVolatile",CC "(" OBJ "J)" OBJ "", FN_PTR(Unsafe_GetObjectVolatile)}, + {CC "putObjectVolatile",CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetObjectVolatile)}, -static JNINativeMethod methods[] = { + {CC "getUncompressedObject", CC "(" ADR ")" OBJ, FN_PTR(Unsafe_GetUncompressedObject)}, + {CC "getJavaMirror", CC "(" ADR ")" CLS, FN_PTR(Unsafe_GetJavaMirror)}, + {CC "getKlassPointer", CC "(" OBJ ")" ADR, FN_PTR(Unsafe_GetKlassPointer)}, + + DECLARE_GETPUTOOP(Boolean, Z), + DECLARE_GETPUTOOP(Byte, B), + DECLARE_GETPUTOOP(Short, S), + DECLARE_GETPUTOOP(Char, C), + DECLARE_GETPUTOOP(Int, I), + DECLARE_GETPUTOOP(Long, J), + DECLARE_GETPUTOOP(Float, F), + DECLARE_GETPUTOOP(Double, D), + + DECLARE_GETPUTNATIVE(Byte, B), + DECLARE_GETPUTNATIVE(Short, S), + DECLARE_GETPUTNATIVE(Char, C), + DECLARE_GETPUTNATIVE(Int, I), + DECLARE_GETPUTNATIVE(Long, J), + DECLARE_GETPUTNATIVE(Float, F), + DECLARE_GETPUTNATIVE(Double, D), + + {CC "getAddress", CC "(" ADR ")" ADR, FN_PTR(Unsafe_GetNativeAddress)}, + {CC "putAddress", CC "(" ADR "" ADR ")V", FN_PTR(Unsafe_SetNativeAddress)}, + + {CC "allocateMemory", CC "(J)" ADR, FN_PTR(Unsafe_AllocateMemory)}, + {CC "reallocateMemory", CC "(" ADR "J)" ADR, FN_PTR(Unsafe_ReallocateMemory)}, + {CC "freeMemory", CC "(" ADR ")V", FN_PTR(Unsafe_FreeMemory)}, + + {CC "objectFieldOffset", CC "(" FLD ")J", FN_PTR(Unsafe_ObjectFieldOffset)}, + {CC "staticFieldOffset", CC "(" FLD ")J", FN_PTR(Unsafe_StaticFieldOffset)}, + {CC "staticFieldBase", CC "(" FLD ")" OBJ, FN_PTR(Unsafe_StaticFieldBaseFromField)}, + {CC "ensureClassInitialized",CC "(" CLS ")V", FN_PTR(Unsafe_EnsureClassInitialized)}, + {CC "arrayBaseOffset", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayBaseOffset)}, + {CC "arrayIndexScale", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayIndexScale)}, + {CC "addressSize", CC "()I", FN_PTR(Unsafe_AddressSize)}, + {CC "pageSize", CC "()I", FN_PTR(Unsafe_PageSize)}, + + {CC "defineClass", CC "(" DC_Args ")" CLS, FN_PTR(Unsafe_DefineClass)}, + {CC "allocateInstance", CC "(" CLS ")" OBJ, FN_PTR(Unsafe_AllocateInstance)}, + {CC "throwException", CC "(" THR ")V", FN_PTR(Unsafe_ThrowException)}, + {CC "compareAndSwapObject", CC "(" OBJ "J" OBJ "" OBJ ")Z", FN_PTR(Unsafe_CompareAndSwapObject)}, + {CC "compareAndSwapInt", CC "(" OBJ "J""I""I"")Z", FN_PTR(Unsafe_CompareAndSwapInt)}, + {CC "compareAndSwapLong", CC "(" OBJ "J""J""J"")Z", FN_PTR(Unsafe_CompareAndSwapLong)}, + {CC "putOrderedObject", CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetOrderedObject)}, + {CC "putOrderedInt", CC "(" OBJ "JI)V", FN_PTR(Unsafe_SetOrderedInt)}, + {CC "putOrderedLong", CC "(" OBJ "JJ)V", FN_PTR(Unsafe_SetOrderedLong)}, + {CC "park", CC "(ZJ)V", FN_PTR(Unsafe_Park)}, + {CC "unpark", CC "(" OBJ ")V", FN_PTR(Unsafe_Unpark)}, + + {CC "getLoadAverage", CC "([DI)I", FN_PTR(Unsafe_Loadavg)}, + + {CC "copyMemory", CC "(" OBJ "J" OBJ "JJ)V", FN_PTR(Unsafe_CopyMemory)}, + {CC "setMemory", CC "(" OBJ "JJB)V", FN_PTR(Unsafe_SetMemory)}, + + {CC "defineAnonymousClass", CC "(" DAC_Args ")" CLS, FN_PTR(Unsafe_DefineAnonymousClass)}, + + {CC "shouldBeInitialized",CC "(" CLS ")Z", FN_PTR(Unsafe_ShouldBeInitialized)}, + + {CC "loadFence", CC "()V", FN_PTR(Unsafe_LoadFence)}, + {CC "storeFence", CC "()V", FN_PTR(Unsafe_StoreFence)}, + {CC "fullFence", CC "()V", FN_PTR(Unsafe_FullFence)}, +}; + +static JNINativeMethod jdk_internal_misc_Unsafe_methods[] = { {CC "getObject", CC "(" OBJ "J)" OBJ "", FN_PTR(Unsafe_GetObject)}, {CC "putObject", CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetObject)}, {CC "getObjectVolatile",CC "(" OBJ "J)" OBJ "", FN_PTR(Unsafe_GetObjectVolatile)}, @@ -1316,17 +1384,27 @@ static JNINativeMethod methods[] = { #undef DECLARE_GETPUTNATIVE -// This one function is exported, used by NativeLookup. +// These two functions are exported, used by NativeLookup. // The Unsafe_xxx functions above are called only from the interpreter. // The optimizer looks at names and signatures to recognize // individual functions. -JVM_ENTRY(void, JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafeclass)) - UnsafeWrapper("JVM_RegisterUnsafeMethods"); +JVM_ENTRY(void, JVM_RegisterSunMiscUnsafeMethods(JNIEnv *env, jclass unsafeclass)) + UnsafeWrapper("JVM_RegisterSunMiscUnsafeMethods"); { ThreadToNativeFromVM ttnfv(thread); - int ok = env->RegisterNatives(unsafeclass, methods, sizeof(methods)/sizeof(JNINativeMethod)); - guarantee(ok == 0, "register unsafe natives"); + int ok = env->RegisterNatives(unsafeclass, sun_misc_Unsafe_methods, sizeof(sun_misc_Unsafe_methods)/sizeof(JNINativeMethod)); + guarantee(ok == 0, "register sun.misc.Unsafe natives"); + } +JVM_END + +JVM_ENTRY(void, JVM_RegisterJDKInternalMiscUnsafeMethods(JNIEnv *env, jclass unsafeclass)) + UnsafeWrapper("JVM_RegisterJDKInternalMiscUnsafeMethods"); + { + ThreadToNativeFromVM ttnfv(thread); + + int ok = env->RegisterNatives(unsafeclass, jdk_internal_misc_Unsafe_methods, sizeof(jdk_internal_misc_Unsafe_methods)/sizeof(JNINativeMethod)); + guarantee(ok == 0, "register jdk.internal.misc.Unsafe natives"); } JVM_END diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java new file mode 100644 index 00000000000..1f19d4c14da --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java @@ -0,0 +1,135 @@ +/* + * 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 8143628 + * @summary Test unsafe access for boolean + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestBoolean + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestBoolean { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestBoolean.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestBoolean.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(boolean[].class); + int ascale = UNSAFE.arrayIndexScale(boolean[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static boolean static_v; + + boolean v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestBoolean t = new JdkInternalMiscUnsafeAccessTestBoolean(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + boolean[] array = new boolean[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putBoolean(base, offset, true); + boolean x = UNSAFE.getBoolean(base, offset); + assertEquals(x, true, "set boolean value"); + } + + // Volatile + { + UNSAFE.putBooleanVolatile(base, offset, false); + boolean x = UNSAFE.getBooleanVolatile(base, offset); + assertEquals(x, false, "putVolatile boolean value"); + } + + + + + } + +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java new file mode 100644 index 00000000000..a3ffa6fb8ab --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java @@ -0,0 +1,172 @@ +/* + * 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 8143628 + * @summary Test unsafe access for byte + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestByte + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestByte { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestByte.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestByte.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(byte[].class); + int ascale = UNSAFE.arrayIndexScale(byte[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static byte static_v; + + byte v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestByte t = new JdkInternalMiscUnsafeAccessTestByte(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + byte[] array = new byte[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putByte(base, offset, (byte)1); + byte x = UNSAFE.getByte(base, offset); + assertEquals(x, (byte)1, "set byte value"); + } + + // Volatile + { + UNSAFE.putByteVolatile(base, offset, (byte)2); + byte x = UNSAFE.getByteVolatile(base, offset); + assertEquals(x, (byte)2, "putVolatile byte value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putByte(address, (byte)1); + byte x = UNSAFE.getByte(address); + assertEquals(x, (byte)1, "set byte value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java new file mode 100644 index 00000000000..b148aee5c8a --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java @@ -0,0 +1,190 @@ +/* + * 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 8143628 + * @summary Test unsafe access for char + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestChar + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestChar { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestChar.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestChar.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(char[].class); + int ascale = UNSAFE.arrayIndexScale(char[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static char static_v; + + char v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestChar t = new JdkInternalMiscUnsafeAccessTestChar(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + char[] array = new char[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putChar(base, offset, 'a'); + char x = UNSAFE.getChar(base, offset); + assertEquals(x, 'a', "set char value"); + } + + // Volatile + { + UNSAFE.putCharVolatile(base, offset, 'b'); + char x = UNSAFE.getCharVolatile(base, offset); + assertEquals(x, 'b', "putVolatile char value"); + } + + + // Unaligned + { + UNSAFE.putCharUnaligned(base, offset, 'b'); + char x = UNSAFE.getCharUnaligned(base, offset); + assertEquals(x, 'b', "putUnaligned char value"); + } + + { + UNSAFE.putCharUnaligned(base, offset, 'a', true); + char x = UNSAFE.getCharUnaligned(base, offset, true); + assertEquals(x, 'a', "putUnaligned big endian char value"); + } + + { + UNSAFE.putCharUnaligned(base, offset, 'b', false); + char x = UNSAFE.getCharUnaligned(base, offset, false); + assertEquals(x, 'b', "putUnaligned little endian char value"); + } + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putChar(address, 'a'); + char x = UNSAFE.getChar(address); + assertEquals(x, 'a', "set char value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java new file mode 100644 index 00000000000..3ea637178ac --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java @@ -0,0 +1,172 @@ +/* + * 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 8143628 + * @summary Test unsafe access for double + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestDouble + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestDouble { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestDouble.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestDouble.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(double[].class); + int ascale = UNSAFE.arrayIndexScale(double[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static double static_v; + + double v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestDouble t = new JdkInternalMiscUnsafeAccessTestDouble(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + double[] array = new double[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putDouble(base, offset, 1.0d); + double x = UNSAFE.getDouble(base, offset); + assertEquals(x, 1.0d, "set double value"); + } + + // Volatile + { + UNSAFE.putDoubleVolatile(base, offset, 2.0d); + double x = UNSAFE.getDoubleVolatile(base, offset); + assertEquals(x, 2.0d, "putVolatile double value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putDouble(address, 1.0d); + double x = UNSAFE.getDouble(address); + assertEquals(x, 1.0d, "set double value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java new file mode 100644 index 00000000000..a2e313620fb --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java @@ -0,0 +1,172 @@ +/* + * 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 8143628 + * @summary Test unsafe access for float + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestFloat + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestFloat { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestFloat.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestFloat.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(float[].class); + int ascale = UNSAFE.arrayIndexScale(float[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static float static_v; + + float v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestFloat t = new JdkInternalMiscUnsafeAccessTestFloat(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + float[] array = new float[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putFloat(base, offset, 1.0f); + float x = UNSAFE.getFloat(base, offset); + assertEquals(x, 1.0f, "set float value"); + } + + // Volatile + { + UNSAFE.putFloatVolatile(base, offset, 2.0f); + float x = UNSAFE.getFloatVolatile(base, offset); + assertEquals(x, 2.0f, "putVolatile float value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putFloat(address, 1.0f); + float x = UNSAFE.getFloat(address); + assertEquals(x, 1.0f, "set float value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java new file mode 100644 index 00000000000..1ea024f1320 --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java @@ -0,0 +1,229 @@ +/* + * 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 8143628 + * @summary Test unsafe access for int + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestInt + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestInt { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestInt.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestInt.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(int[].class); + int ascale = UNSAFE.arrayIndexScale(int[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static int static_v; + + int v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestInt t = new JdkInternalMiscUnsafeAccessTestInt(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + int[] array = new int[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putInt(base, offset, 1); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 1, "set int value"); + } + + // Volatile + { + UNSAFE.putIntVolatile(base, offset, 2); + int x = UNSAFE.getIntVolatile(base, offset); + assertEquals(x, 2, "putVolatile int value"); + } + + // Lazy + { + UNSAFE.putOrderedInt(base, offset, 1); + int x = UNSAFE.getIntVolatile(base, offset); + assertEquals(x, 1, "putRelease int value"); + } + + // Unaligned + { + UNSAFE.putIntUnaligned(base, offset, 2); + int x = UNSAFE.getIntUnaligned(base, offset); + assertEquals(x, 2, "putUnaligned int value"); + } + + { + UNSAFE.putIntUnaligned(base, offset, 1, true); + int x = UNSAFE.getIntUnaligned(base, offset, true); + assertEquals(x, 1, "putUnaligned big endian int value"); + } + + { + UNSAFE.putIntUnaligned(base, offset, 2, false); + int x = UNSAFE.getIntUnaligned(base, offset, false); + assertEquals(x, 2, "putUnaligned little endian int value"); + } + + UNSAFE.putInt(base, offset, 1); + + // Compare + { + boolean r = UNSAFE.compareAndSwapInt(base, offset, 1, 2); + assertEquals(r, true, "success compareAndSwap int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 2, "success compareAndSwap int value"); + } + + { + boolean r = UNSAFE.compareAndSwapInt(base, offset, 1, 3); + assertEquals(r, false, "failing compareAndSwap int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 2, "failing compareAndSwap int value"); + } + + // Compare set and get + { + int o = UNSAFE.getAndSetInt(base, offset, 1); + assertEquals(o, 2, "getAndSet int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 1, "getAndSet int value"); + } + + UNSAFE.putInt(base, offset, 1); + + // get and add, add and get + { + int o = UNSAFE.getAndAddInt(base, offset, 2); + assertEquals(o, 1, "getAndAdd int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 1 + 2, "weakCompareAndSwapRelease int"); + } + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putInt(address, 1); + int x = UNSAFE.getInt(address); + assertEquals(x, 1, "set int value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java new file mode 100644 index 00000000000..0c5262019b1 --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java @@ -0,0 +1,229 @@ +/* + * 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 8143628 + * @summary Test unsafe access for long + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestLong + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestLong { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestLong.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestLong.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(long[].class); + int ascale = UNSAFE.arrayIndexScale(long[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static long static_v; + + long v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestLong t = new JdkInternalMiscUnsafeAccessTestLong(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + long[] array = new long[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putLong(base, offset, 1L); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 1L, "set long value"); + } + + // Volatile + { + UNSAFE.putLongVolatile(base, offset, 2L); + long x = UNSAFE.getLongVolatile(base, offset); + assertEquals(x, 2L, "putVolatile long value"); + } + + // Lazy + { + UNSAFE.putOrderedLong(base, offset, 1L); + long x = UNSAFE.getLongVolatile(base, offset); + assertEquals(x, 1L, "putRelease long value"); + } + + // Unaligned + { + UNSAFE.putLongUnaligned(base, offset, 2L); + long x = UNSAFE.getLongUnaligned(base, offset); + assertEquals(x, 2L, "putUnaligned long value"); + } + + { + UNSAFE.putLongUnaligned(base, offset, 1L, true); + long x = UNSAFE.getLongUnaligned(base, offset, true); + assertEquals(x, 1L, "putUnaligned big endian long value"); + } + + { + UNSAFE.putLongUnaligned(base, offset, 2L, false); + long x = UNSAFE.getLongUnaligned(base, offset, false); + assertEquals(x, 2L, "putUnaligned little endian long value"); + } + + UNSAFE.putLong(base, offset, 1L); + + // Compare + { + boolean r = UNSAFE.compareAndSwapLong(base, offset, 1L, 2L); + assertEquals(r, true, "success compareAndSwap long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 2L, "success compareAndSwap long value"); + } + + { + boolean r = UNSAFE.compareAndSwapLong(base, offset, 1L, 3L); + assertEquals(r, false, "failing compareAndSwap long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 2L, "failing compareAndSwap long value"); + } + + // Compare set and get + { + long o = UNSAFE.getAndSetLong(base, offset, 1L); + assertEquals(o, 2L, "getAndSet long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 1L, "getAndSet long value"); + } + + UNSAFE.putLong(base, offset, 1L); + + // get and add, add and get + { + long o = UNSAFE.getAndAddLong(base, offset, 2L); + assertEquals(o, 1L, "getAndAdd long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 1L + 2L, "weakCompareAndSwapRelease long"); + } + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putLong(address, 1L); + long x = UNSAFE.getLong(address); + assertEquals(x, 1L, "set long value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java new file mode 100644 index 00000000000..c23cffd02ad --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java @@ -0,0 +1,165 @@ +/* + * 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 8143628 + * @summary Test unsafe access for Object + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestObject + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestObject { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestObject.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestObject.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(Object[].class); + int ascale = UNSAFE.arrayIndexScale(Object[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static Object static_v; + + Object v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestObject t = new JdkInternalMiscUnsafeAccessTestObject(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + Object[] array = new Object[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putObject(base, offset, "foo"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "foo", "set Object value"); + } + + // Volatile + { + UNSAFE.putObjectVolatile(base, offset, "bar"); + Object x = UNSAFE.getObjectVolatile(base, offset); + assertEquals(x, "bar", "putVolatile Object value"); + } + + // Lazy + { + UNSAFE.putOrderedObject(base, offset, "foo"); + Object x = UNSAFE.getObjectVolatile(base, offset); + assertEquals(x, "foo", "putRelease Object value"); + } + + + UNSAFE.putObject(base, offset, "foo"); + + // Compare + { + boolean r = UNSAFE.compareAndSwapObject(base, offset, "foo", "bar"); + assertEquals(r, true, "success compareAndSwap Object"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "bar", "success compareAndSwap Object value"); + } + + { + boolean r = UNSAFE.compareAndSwapObject(base, offset, "foo", "baz"); + assertEquals(r, false, "failing compareAndSwap Object"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "bar", "failing compareAndSwap Object value"); + } + + // Compare set and get + { + Object o = UNSAFE.getAndSetObject(base, offset, "foo"); + assertEquals(o, "bar", "getAndSet Object"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "foo", "getAndSet Object value"); + } + + } + +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java new file mode 100644 index 00000000000..40a20789769 --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java @@ -0,0 +1,190 @@ +/* + * 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 8143628 + * @summary Test unsafe access for short + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestShort + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestShort { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestShort.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestShort.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(short[].class); + int ascale = UNSAFE.arrayIndexScale(short[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static short static_v; + + short v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestShort t = new JdkInternalMiscUnsafeAccessTestShort(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + short[] array = new short[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putShort(base, offset, (short)1); + short x = UNSAFE.getShort(base, offset); + assertEquals(x, (short)1, "set short value"); + } + + // Volatile + { + UNSAFE.putShortVolatile(base, offset, (short)2); + short x = UNSAFE.getShortVolatile(base, offset); + assertEquals(x, (short)2, "putVolatile short value"); + } + + + // Unaligned + { + UNSAFE.putShortUnaligned(base, offset, (short)2); + short x = UNSAFE.getShortUnaligned(base, offset); + assertEquals(x, (short)2, "putUnaligned short value"); + } + + { + UNSAFE.putShortUnaligned(base, offset, (short)1, true); + short x = UNSAFE.getShortUnaligned(base, offset, true); + assertEquals(x, (short)1, "putUnaligned big endian short value"); + } + + { + UNSAFE.putShortUnaligned(base, offset, (short)2, false); + short x = UNSAFE.getShortUnaligned(base, offset, false); + assertEquals(x, (short)2, "putUnaligned little endian short value"); + } + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putShort(address, (short)1); + short x = UNSAFE.getShort(address); + assertEquals(x, (short)1, "set short value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java new file mode 100644 index 00000000000..976691c6735 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java @@ -0,0 +1,135 @@ +/* + * 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 8143628 + * @summary Test unsafe access for boolean + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestBoolean + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestBoolean { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestBoolean.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestBoolean.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(boolean[].class); + int ascale = UNSAFE.arrayIndexScale(boolean[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static boolean static_v; + + boolean v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestBoolean t = new SunMiscUnsafeAccessTestBoolean(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + boolean[] array = new boolean[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putBoolean(base, offset, true); + boolean x = UNSAFE.getBoolean(base, offset); + assertEquals(x, true, "set boolean value"); + } + + // Volatile + { + UNSAFE.putBooleanVolatile(base, offset, false); + boolean x = UNSAFE.getBooleanVolatile(base, offset); + assertEquals(x, false, "putVolatile boolean value"); + } + + + + + } + +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java new file mode 100644 index 00000000000..bdcab491316 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java @@ -0,0 +1,172 @@ +/* + * 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 8143628 + * @summary Test unsafe access for byte + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestByte + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestByte { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestByte.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestByte.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(byte[].class); + int ascale = UNSAFE.arrayIndexScale(byte[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static byte static_v; + + byte v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestByte t = new SunMiscUnsafeAccessTestByte(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + byte[] array = new byte[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putByte(base, offset, (byte)1); + byte x = UNSAFE.getByte(base, offset); + assertEquals(x, (byte)1, "set byte value"); + } + + // Volatile + { + UNSAFE.putByteVolatile(base, offset, (byte)2); + byte x = UNSAFE.getByteVolatile(base, offset); + assertEquals(x, (byte)2, "putVolatile byte value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putByte(address, (byte)1); + byte x = UNSAFE.getByte(address); + assertEquals(x, (byte)1, "set byte value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java new file mode 100644 index 00000000000..d7f56e31648 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java @@ -0,0 +1,172 @@ +/* + * 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 8143628 + * @summary Test unsafe access for char + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestChar + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestChar { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestChar.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestChar.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(char[].class); + int ascale = UNSAFE.arrayIndexScale(char[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static char static_v; + + char v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestChar t = new SunMiscUnsafeAccessTestChar(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + char[] array = new char[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putChar(base, offset, 'a'); + char x = UNSAFE.getChar(base, offset); + assertEquals(x, 'a', "set char value"); + } + + // Volatile + { + UNSAFE.putCharVolatile(base, offset, 'b'); + char x = UNSAFE.getCharVolatile(base, offset); + assertEquals(x, 'b', "putVolatile char value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putChar(address, 'a'); + char x = UNSAFE.getChar(address); + assertEquals(x, 'a', "set char value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java new file mode 100644 index 00000000000..e9c5624afe6 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java @@ -0,0 +1,172 @@ +/* + * 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 8143628 + * @summary Test unsafe access for double + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestDouble + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestDouble { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestDouble.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestDouble.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(double[].class); + int ascale = UNSAFE.arrayIndexScale(double[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static double static_v; + + double v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestDouble t = new SunMiscUnsafeAccessTestDouble(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + double[] array = new double[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putDouble(base, offset, 1.0d); + double x = UNSAFE.getDouble(base, offset); + assertEquals(x, 1.0d, "set double value"); + } + + // Volatile + { + UNSAFE.putDoubleVolatile(base, offset, 2.0d); + double x = UNSAFE.getDoubleVolatile(base, offset); + assertEquals(x, 2.0d, "putVolatile double value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putDouble(address, 1.0d); + double x = UNSAFE.getDouble(address); + assertEquals(x, 1.0d, "set double value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java new file mode 100644 index 00000000000..993c63339d8 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java @@ -0,0 +1,172 @@ +/* + * 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 8143628 + * @summary Test unsafe access for float + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestFloat + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestFloat { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestFloat.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestFloat.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(float[].class); + int ascale = UNSAFE.arrayIndexScale(float[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static float static_v; + + float v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestFloat t = new SunMiscUnsafeAccessTestFloat(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + float[] array = new float[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putFloat(base, offset, 1.0f); + float x = UNSAFE.getFloat(base, offset); + assertEquals(x, 1.0f, "set float value"); + } + + // Volatile + { + UNSAFE.putFloatVolatile(base, offset, 2.0f); + float x = UNSAFE.getFloatVolatile(base, offset); + assertEquals(x, 2.0f, "putVolatile float value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putFloat(address, 1.0f); + float x = UNSAFE.getFloat(address); + assertEquals(x, 1.0f, "set float value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java new file mode 100644 index 00000000000..8924cc168cd --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java @@ -0,0 +1,211 @@ +/* + * 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 8143628 + * @summary Test unsafe access for int + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestInt + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestInt { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestInt.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestInt.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(int[].class); + int ascale = UNSAFE.arrayIndexScale(int[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static int static_v; + + int v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestInt t = new SunMiscUnsafeAccessTestInt(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + int[] array = new int[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putInt(base, offset, 1); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 1, "set int value"); + } + + // Volatile + { + UNSAFE.putIntVolatile(base, offset, 2); + int x = UNSAFE.getIntVolatile(base, offset); + assertEquals(x, 2, "putVolatile int value"); + } + + // Lazy + { + UNSAFE.putOrderedInt(base, offset, 1); + int x = UNSAFE.getIntVolatile(base, offset); + assertEquals(x, 1, "putRelease int value"); + } + + + UNSAFE.putInt(base, offset, 1); + + // Compare + { + boolean r = UNSAFE.compareAndSwapInt(base, offset, 1, 2); + assertEquals(r, true, "success compareAndSwap int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 2, "success compareAndSwap int value"); + } + + { + boolean r = UNSAFE.compareAndSwapInt(base, offset, 1, 3); + assertEquals(r, false, "failing compareAndSwap int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 2, "failing compareAndSwap int value"); + } + + // Compare set and get + { + int o = UNSAFE.getAndSetInt(base, offset, 1); + assertEquals(o, 2, "getAndSet int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 1, "getAndSet int value"); + } + + UNSAFE.putInt(base, offset, 1); + + // get and add, add and get + { + int o = UNSAFE.getAndAddInt(base, offset, 2); + assertEquals(o, 1, "getAndAdd int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 1 + 2, "weakCompareAndSwapRelease int"); + } + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putInt(address, 1); + int x = UNSAFE.getInt(address); + assertEquals(x, 1, "set int value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java new file mode 100644 index 00000000000..5999073a425 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java @@ -0,0 +1,211 @@ +/* + * 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 8143628 + * @summary Test unsafe access for long + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestLong + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestLong { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestLong.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestLong.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(long[].class); + int ascale = UNSAFE.arrayIndexScale(long[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static long static_v; + + long v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestLong t = new SunMiscUnsafeAccessTestLong(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + long[] array = new long[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putLong(base, offset, 1L); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 1L, "set long value"); + } + + // Volatile + { + UNSAFE.putLongVolatile(base, offset, 2L); + long x = UNSAFE.getLongVolatile(base, offset); + assertEquals(x, 2L, "putVolatile long value"); + } + + // Lazy + { + UNSAFE.putOrderedLong(base, offset, 1L); + long x = UNSAFE.getLongVolatile(base, offset); + assertEquals(x, 1L, "putRelease long value"); + } + + + UNSAFE.putLong(base, offset, 1L); + + // Compare + { + boolean r = UNSAFE.compareAndSwapLong(base, offset, 1L, 2L); + assertEquals(r, true, "success compareAndSwap long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 2L, "success compareAndSwap long value"); + } + + { + boolean r = UNSAFE.compareAndSwapLong(base, offset, 1L, 3L); + assertEquals(r, false, "failing compareAndSwap long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 2L, "failing compareAndSwap long value"); + } + + // Compare set and get + { + long o = UNSAFE.getAndSetLong(base, offset, 1L); + assertEquals(o, 2L, "getAndSet long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 1L, "getAndSet long value"); + } + + UNSAFE.putLong(base, offset, 1L); + + // get and add, add and get + { + long o = UNSAFE.getAndAddLong(base, offset, 2L); + assertEquals(o, 1L, "getAndAdd long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 1L + 2L, "weakCompareAndSwapRelease long"); + } + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putLong(address, 1L); + long x = UNSAFE.getLong(address); + assertEquals(x, 1L, "set long value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java new file mode 100644 index 00000000000..75fb599340b --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java @@ -0,0 +1,165 @@ +/* + * 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 8143628 + * @summary Test unsafe access for Object + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestObject + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestObject { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestObject.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestObject.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(Object[].class); + int ascale = UNSAFE.arrayIndexScale(Object[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static Object static_v; + + Object v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestObject t = new SunMiscUnsafeAccessTestObject(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + Object[] array = new Object[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putObject(base, offset, "foo"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "foo", "set Object value"); + } + + // Volatile + { + UNSAFE.putObjectVolatile(base, offset, "bar"); + Object x = UNSAFE.getObjectVolatile(base, offset); + assertEquals(x, "bar", "putVolatile Object value"); + } + + // Lazy + { + UNSAFE.putOrderedObject(base, offset, "foo"); + Object x = UNSAFE.getObjectVolatile(base, offset); + assertEquals(x, "foo", "putRelease Object value"); + } + + + UNSAFE.putObject(base, offset, "foo"); + + // Compare + { + boolean r = UNSAFE.compareAndSwapObject(base, offset, "foo", "bar"); + assertEquals(r, true, "success compareAndSwap Object"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "bar", "success compareAndSwap Object value"); + } + + { + boolean r = UNSAFE.compareAndSwapObject(base, offset, "foo", "baz"); + assertEquals(r, false, "failing compareAndSwap Object"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "bar", "failing compareAndSwap Object value"); + } + + // Compare set and get + { + Object o = UNSAFE.getAndSetObject(base, offset, "foo"); + assertEquals(o, "bar", "getAndSet Object"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "foo", "getAndSet Object value"); + } + + } + +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java new file mode 100644 index 00000000000..ef4311483a6 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java @@ -0,0 +1,172 @@ +/* + * 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 8143628 + * @summary Test unsafe access for short + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestShort + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestShort { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestShort.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestShort.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(short[].class); + int ascale = UNSAFE.arrayIndexScale(short[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static short static_v; + + short v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestShort t = new SunMiscUnsafeAccessTestShort(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + short[] array = new short[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putShort(base, offset, (short)1); + short x = UNSAFE.getShort(base, offset); + assertEquals(x, (short)1, "set short value"); + } + + // Volatile + { + UNSAFE.putShortVolatile(base, offset, (short)2); + short x = UNSAFE.getShortVolatile(base, offset); + assertEquals(x, (short)2, "putVolatile short value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putShort(address, (short)1); + short x = UNSAFE.getShort(address); + assertEquals(x, (short)1, "set short value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/X-UnsafeAccessTest.java.template b/hotspot/test/compiler/unsafe/X-UnsafeAccessTest.java.template new file mode 100644 index 00000000000..fcc74e325b0 --- /dev/null +++ b/hotspot/test/compiler/unsafe/X-UnsafeAccessTest.java.template @@ -0,0 +1,247 @@ +/* + * 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 8143628 + * @summary Test unsafe access for $type$ + * @modules java.base/$package$ + * @run testng/othervm -Diters=100 -Xint $Qualifier$UnsafeAccessTest$Type$ + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 $Qualifier$UnsafeAccessTest$Type$ + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation $Qualifier$UnsafeAccessTest$Type$ + * @run testng/othervm -Diters=20000 $Qualifier$UnsafeAccessTest$Type$ + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class $Qualifier$UnsafeAccessTest$Type$ { + static final int ITERS = Integer.getInteger("iters", 1); + + static final $package$.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = $package$.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = ($package$.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = $Qualifier$UnsafeAccessTest$Type$.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = $Qualifier$UnsafeAccessTest$Type$.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset($type$[].class); + int ascale = UNSAFE.arrayIndexScale($type$[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static $type$ static_v; + + $type$ v; + + @Test + public void testFieldInstance() { + $Qualifier$UnsafeAccessTest$Type$ t = new $Qualifier$UnsafeAccessTest$Type$(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + $type$[] array = new $type$[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + +#if[!Object] +#if[!boolean] + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } +#end[!boolean] +#end[!Object] + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.put$Type$(base, offset, $value1$); + $type$ x = UNSAFE.get$Type$(base, offset); + assertEquals(x, $value1$, "set $type$ value"); + } + + // Volatile + { + UNSAFE.put$Type$Volatile(base, offset, $value2$); + $type$ x = UNSAFE.get$Type$Volatile(base, offset); + assertEquals(x, $value2$, "putVolatile $type$ value"); + } + +#if[Ordered] + // Lazy + { + UNSAFE.putOrdered$Type$(base, offset, $value1$); + $type$ x = UNSAFE.get$Type$Volatile(base, offset); + assertEquals(x, $value1$, "putRelease $type$ value"); + } +#end[Ordered] + +#if[JdkInternalMisc] +#if[Unaligned] + // Unaligned + { + UNSAFE.put$Type$Unaligned(base, offset, $value2$); + $type$ x = UNSAFE.get$Type$Unaligned(base, offset); + assertEquals(x, $value2$, "putUnaligned $type$ value"); + } + + { + UNSAFE.put$Type$Unaligned(base, offset, $value1$, true); + $type$ x = UNSAFE.get$Type$Unaligned(base, offset, true); + assertEquals(x, $value1$, "putUnaligned big endian $type$ value"); + } + + { + UNSAFE.put$Type$Unaligned(base, offset, $value2$, false); + $type$ x = UNSAFE.get$Type$Unaligned(base, offset, false); + assertEquals(x, $value2$, "putUnaligned little endian $type$ value"); + } +#end[Unaligned] +#end[JdkInternalMisc] + +#if[CAS] + UNSAFE.put$Type$(base, offset, $value1$); + + // Compare + { + boolean r = UNSAFE.compareAndSwap$Type$(base, offset, $value1$, $value2$); + assertEquals(r, true, "success compareAndSwap $type$"); + $type$ x = UNSAFE.get$Type$(base, offset); + assertEquals(x, $value2$, "success compareAndSwap $type$ value"); + } + + { + boolean r = UNSAFE.compareAndSwap$Type$(base, offset, $value1$, $value3$); + assertEquals(r, false, "failing compareAndSwap $type$"); + $type$ x = UNSAFE.get$Type$(base, offset); + assertEquals(x, $value2$, "failing compareAndSwap $type$ value"); + } + + // Compare set and get + { + $type$ o = UNSAFE.getAndSet$Type$(base, offset, $value1$); + assertEquals(o, $value2$, "getAndSet $type$"); + $type$ x = UNSAFE.get$Type$(base, offset); + assertEquals(x, $value1$, "getAndSet $type$ value"); + } +#end[CAS] + +#if[AtomicAdd] + UNSAFE.put$Type$(base, offset, $value1$); + + // get and add, add and get + { + $type$ o = UNSAFE.getAndAdd$Type$(base, offset, $value2$); + assertEquals(o, $value1$, "getAndAdd $type$"); + $type$ x = UNSAFE.get$Type$(base, offset); + assertEquals(x, $value1$ + $value2$, "weakCompareAndSwapRelease $type$"); + } +#end[AtomicAdd] + } + +#if[!Object] +#if[!boolean] + static void testAccess(long address) { + // Plain + { + UNSAFE.put$Type$(address, $value1$); + $type$ x = UNSAFE.get$Type$(address); + assertEquals(x, $value1$, "set $type$ value"); + } + } +#end[!boolean] +#end[!Object] +} \ No newline at end of file diff --git a/hotspot/test/compiler/unsafe/generate-unsafe-access-tests.sh b/hotspot/test/compiler/unsafe/generate-unsafe-access-tests.sh new file mode 100644 index 00000000000..fc4f7f47ee1 --- /dev/null +++ b/hotspot/test/compiler/unsafe/generate-unsafe-access-tests.sh @@ -0,0 +1,119 @@ +#!/bin/bash + +# +# 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. +# + +javac -d . ../../../../jdk/make/src/classes/build/tools/spp/Spp.java + +SPP=build.tools.spp.Spp + +# Generates unsafe access tests for objects and all primitive types +# $1 = package name to Unsafe, sun.misc | jdk.internal.misc +# $2 = test class qualifier name, SunMisc | JdkInternalMisc +function generate { + package=$1 + Qualifier=$2 + + for type in boolean byte short char int long float double Object + do + Type="$(tr '[:lower:]' '[:upper:]' <<< ${type:0:1})${type:1}" + args="-K$type -Dtype=$type -DType=$Type" + + case $type in + Object|int|long) + args="$args -KCAS -KOrdered" + ;; + esac + + case $type in + int|long) + args="$args -KAtomicAdd" + ;; + esac + + case $type in + short|char|int|long) + args="$args -KUnaligned" + ;; + esac + + case $type in + boolean) + value1=true + value2=false + value3=false + ;; + byte) + value1=(byte)1 + value2=(byte)2 + value3=(byte)3 + ;; + short) + value1=(short)1 + value2=(short)2 + value3=(short)3 + ;; + char) + value1=\'a\' + value2=\'b\' + value3=\'c\' + ;; + int) + value1=1 + value2=2 + value3=3 + ;; + long) + value1=1L + value2=2L + value3=3L + ;; + float) + value1=1.0f + value2=2.0f + value3=3.0f + ;; + double) + value1=1.0d + value2=2.0d + value3=3.0d + ;; + Object) + value1=\"foo\" + value2=\"bar\" + value3=\"baz\" + ;; + esac + + args="$args -Dvalue1=$value1 -Dvalue2=$value2 -Dvalue3=$value3" + + echo $args + java $SPP -nel -K$Qualifier -Dpackage=$package -DQualifier=$Qualifier \ + $args < X-UnsafeAccessTest.java.template > ${Qualifier}UnsafeAccessTest${Type}.java + done +} + +generate sun.misc SunMisc +generate jdk.internal.misc JdkInternalMisc + +rm -fr build \ No newline at end of file From bbc34efe2612f099073d5b0eb119a2f253cc2c47 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Wed, 9 Dec 2015 22:57:52 +0100 Subject: [PATCH 071/228] 8144944: JVMCI compiler initialization can happen on different thread than JVMCI initialization Reviewed-by: twisti --- .../src/jdk/vm/ci/inittimer/InitTimer.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java index 608285e7e92..921b537bfb1 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java @@ -22,6 +22,8 @@ */ package jdk.vm.ci.inittimer; +import java.util.concurrent.atomic.AtomicInteger; + /** * A facility for timing a step in the runtime initialization sequence. This is independent from all * other JVMCI code so as to not perturb the initialization sequence. It is enabled by setting the @@ -32,18 +34,26 @@ public final class InitTimer implements AutoCloseable { final long start; private InitTimer(String name) { + int n = nesting.getAndIncrement(); + if (n == 0) { + initializingThread = Thread.currentThread(); + System.out.println("INITIALIZING THREAD: " + initializingThread); + } else { + assert Thread.currentThread() == initializingThread : Thread.currentThread() + " != " + initializingThread; + } this.name = name; this.start = System.currentTimeMillis(); - System.out.println("START: " + SPACES.substring(0, timerDepth * 2) + name); - assert Thread.currentThread() == initializingThread : Thread.currentThread() + " != " + initializingThread; - timerDepth++; + System.out.println("START: " + SPACES.substring(0, n * 2) + name); } @SuppressFBWarnings(value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD", justification = "only the initializing thread accesses this field") public void close() { final long end = System.currentTimeMillis(); - timerDepth--; - System.out.println(" DONE: " + SPACES.substring(0, timerDepth * 2) + name + " [" + (end - start) + " ms]"); + int n = nesting.decrementAndGet(); + System.out.println(" DONE: " + SPACES.substring(0, n * 2) + name + " [" + (end - start) + " ms]"); + if (n == 0) { + initializingThread = null; + } } public static InitTimer timer(String name) { @@ -59,19 +69,11 @@ public final class InitTimer implements AutoCloseable { */ private static final boolean ENABLED = Boolean.getBoolean("jvmci.inittimer") || Boolean.getBoolean("jvmci.runtime.TimeInit"); - public static int timerDepth = 0; + public static final AtomicInteger nesting = ENABLED ? new AtomicInteger() : null; public static final String SPACES = " "; /** - * Used to assert the invariant that all initialization happens on the same thread. + * Used to assert the invariant that all related initialization happens on the same thread. */ - public static final Thread initializingThread; - static { - if (ENABLED) { - initializingThread = Thread.currentThread(); - System.out.println("INITIALIZING THREAD: " + initializingThread); - } else { - initializingThread = null; - } - } + public static Thread initializingThread; } From 7b54819d3ee2fc6f34b22fcedd7956923685845a Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Wed, 9 Dec 2015 13:41:04 +0100 Subject: [PATCH 072/228] 8144601: Premature assert in directive inline parsing Break after first fail Reviewed-by: roland --- hotspot/src/share/vm/compiler/directivesParser.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hotspot/src/share/vm/compiler/directivesParser.cpp b/hotspot/src/share/vm/compiler/directivesParser.cpp index e916b536dd2..7c2b15404ac 100644 --- a/hotspot/src/share/vm/compiler/directivesParser.cpp +++ b/hotspot/src/share/vm/compiler/directivesParser.cpp @@ -379,11 +379,12 @@ bool DirectivesParser::set_option(JSON_TYPE t, JSON_VAL* v) { const char* error_msg = NULL; if (current_directiveset == NULL) { - if (!current_directive->_c1_store->parse_and_add_inline(s, error_msg)) { - assert (error_msg != NULL, "Must have valid error message"); - error(VALUE_ERROR, "Method pattern error: %s", error_msg); - } - if (!current_directive->_c2_store->parse_and_add_inline(s, error_msg)) { + if (current_directive->_c1_store->parse_and_add_inline(s, error_msg)) { + if (!current_directive->_c2_store->parse_and_add_inline(s, error_msg)) { + assert (error_msg != NULL, "Must have valid error message"); + error(VALUE_ERROR, "Method pattern error: %s", error_msg); + } + } else { assert (error_msg != NULL, "Must have valid error message"); error(VALUE_ERROR, "Method pattern error: %s", error_msg); } From afeb87ddd8adffe47d5ce5b0a18d9122329bfbbc Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Thu, 10 Dec 2015 14:51:53 +0300 Subject: [PATCH 073/228] 8144935: C2: safepoint is pruned from a non-counted loop Reviewed-by: roland --- hotspot/src/share/vm/opto/loopnode.cpp | 19 ++++++++++++++++--- hotspot/src/share/vm/opto/node.cpp | 11 +++++++++++ hotspot/src/share/vm/opto/node.hpp | 1 + 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp index db0b3c83c84..ac82a605303 100644 --- a/hotspot/src/share/vm/opto/loopnode.cpp +++ b/hotspot/src/share/vm/opto/loopnode.cpp @@ -1818,10 +1818,9 @@ void PhaseIdealLoop::replace_parallel_iv(IdealLoopTree *loop) { } void IdealLoopTree::remove_safepoints(PhaseIdealLoop* phase, bool keep_one) { - // Look for a safepoint on the idom-path. Node* keep = NULL; if (keep_one) { - // Keep one if possible + // Look for a safepoint on the idom-path. for (Node* i = tail(); i != _head; i = phase->idom(i)) { if (i->Opcode() == Op_SafePoint && phase->get_loop(i) == this) { keep = i; @@ -1830,9 +1829,14 @@ void IdealLoopTree::remove_safepoints(PhaseIdealLoop* phase, bool keep_one) { } } + // Don't remove any safepoints if it is requested to keep a single safepoint and + // no safepoint was found on idom-path. It is not safe to remove any safepoint + // in this case since there's no safepoint dominating all paths in the loop body. + bool prune = !keep_one || keep != NULL; + // Delete other safepoints in this loop. Node_List* sfpts = _safepts; - if (sfpts != NULL) { + if (prune && sfpts != NULL) { assert(keep == NULL || keep->Opcode() == Op_SafePoint, "not safepoint"); for (uint i = 0; i < sfpts->size(); i++) { Node* n = sfpts->at(i); @@ -1925,6 +1929,15 @@ void IdealLoopTree::dump_head( ) const { if (cl->is_main_loop()) tty->print(" main"); if (cl->is_post_loop()) tty->print(" post"); } + if (_has_call) tty->print(" has_call"); + if (_has_sfpt) tty->print(" has_sfpt"); + if (_rce_candidate) tty->print(" rce"); + if (_safepts != NULL && _safepts->size() > 0) { + tty->print(" sfpts={"); _safepts->dump_simple(); tty->print(" }"); + } + if (_required_safept != NULL && _required_safept->size() > 0) { + tty->print(" req={"); _required_safept->dump_simple(); tty->print(" }"); + } tty->cr(); } diff --git a/hotspot/src/share/vm/opto/node.cpp b/hotspot/src/share/vm/opto/node.cpp index dc91ef3e471..ac093690bc5 100644 --- a/hotspot/src/share/vm/opto/node.cpp +++ b/hotspot/src/share/vm/opto/node.cpp @@ -2365,6 +2365,17 @@ void Node_List::dump() const { #endif } +void Node_List::dump_simple() const { +#ifndef PRODUCT + for( uint i = 0; i < _cnt; i++ ) + if( _nodes[i] ) { + tty->print(" %d", _nodes[i]->_idx); + } else { + tty->print(" NULL"); + } +#endif +} + //============================================================================= //------------------------------remove----------------------------------------- void Unique_Node_List::remove( Node *n ) { diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp index 0d29b85b45a..d737f537868 100644 --- a/hotspot/src/share/vm/opto/node.hpp +++ b/hotspot/src/share/vm/opto/node.hpp @@ -1442,6 +1442,7 @@ public: void clear() { _cnt = 0; Node_Array::clear(); } // retain storage uint size() const { return _cnt; } void dump() const; + void dump_simple() const; }; //------------------------------Unique_Node_List------------------------------- From e56a7de478a319879d8a9cb3dd2a90799580491d Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Thu, 10 Dec 2015 14:51:54 +0300 Subject: [PATCH 074/228] 8145026: compiler/jsr292/NonInlinedCall/RedefineTest.java fails with: java.lang.NullPointerException in ClassFileInstaller.main Reviewed-by: roland --- hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java | 1 - hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java | 6 ++---- hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java | 6 ++---- .../test/compiler/jsr292/NonInlinedCall/RedefineTest.java | 6 ++---- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java b/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java index 415f0b6b903..70665d5f604 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java @@ -22,7 +22,6 @@ */ import java.io.File; import java.io.PrintStream; -import java.lang.instrument.Instrumentation; import java.util.Arrays; public class Agent { diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java index 8be925b00d6..49ce05490fd 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java @@ -24,8 +24,8 @@ /* * @test * @bug 8072008 - * @library /testlibrary /../../test/lib - * @build GCTest NonInlinedReinvoker + * @library /testlibrary /test/lib + * @compile GCTest.java NonInlinedReinvoker.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * java.lang.invoke.GCTest @@ -40,10 +40,8 @@ package java.lang.invoke; import sun.hotspot.WhiteBox; - import jdk.internal.vm.annotation.DontInline; import jdk.internal.vm.annotation.Stable; - import java.lang.ref.*; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java index 8ab6031b575..72a521d480d 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java @@ -24,8 +24,8 @@ /* * @test * @bug 8072008 - * @library /testlibrary /../../test/lib - * @build InvokeTest NonInlinedReinvoker + * @library /testlibrary /test/lib + * @compile InvokeTest.java NonInlinedReinvoker.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * java.lang.invoke.InvokeTest @@ -43,9 +43,7 @@ package java.lang.invoke; import sun.hotspot.WhiteBox; - import jdk.internal.vm.annotation.DontInline; - import static jdk.test.lib.Asserts.*; public class InvokeTest { diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java index 2da0f4bd70b..884295cf77e 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java @@ -24,8 +24,8 @@ /* * @test * @bug 8072008 - * @library /testlibrary /../../test/lib - * @build RedefineTest Agent + * @library /testlibrary /test/lib + * @compile -XDignore.symbol.file RedefineTest.java Agent.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * java.lang.invoke.RedefineTest @@ -42,10 +42,8 @@ package java.lang.invoke; import sun.hotspot.WhiteBox; import sun.misc.Unsafe; - import jdk.internal.org.objectweb.asm.*; import jdk.internal.vm.annotation.DontInline; - import java.lang.instrument.ClassDefinition; import java.lang.instrument.Instrumentation; From 1a4c3a752dfa45eb6f09922077cb99941dced229 Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Fri, 11 Dec 2015 15:03:11 +0300 Subject: [PATCH 075/228] 8145137: Incorrect call signature can be used in nmethod::preserve_callee_argument_oops Reviewed-by: roland, jrose --- hotspot/src/share/vm/code/nmethod.cpp | 21 ++++++++++++++++++- hotspot/src/share/vm/code/nmethod.hpp | 1 + .../src/share/vm/runtime/sharedRuntime.cpp | 5 +---- .../jsr292/NonInlinedCall/InvokeTest.java | 16 +++++++------- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 18625bcbbe3..a2f256a680d 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -2332,11 +2332,22 @@ bool nmethod::detect_scavenge_root_oops() { void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { #ifndef SHARK if (method() != NULL && !method()->is_native()) { - SimpleScopeDesc ssd(this, fr.pc()); + address pc = fr.pc(); + SimpleScopeDesc ssd(this, pc); Bytecode_invoke call(ssd.method(), ssd.bci()); bool has_receiver = call.has_receiver(); bool has_appendix = call.has_appendix(); Symbol* signature = call.signature(); + + // The method attached by JIT-compilers should be used, if present. + // Bytecode can be inaccurate in such case. + Method* callee = attached_method_before_pc(pc); + if (callee != NULL) { + has_receiver = !(callee->access_flags().is_static()); + has_appendix = false; + signature = callee->signature(); + } + fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f); } #endif // !SHARK @@ -3526,3 +3537,11 @@ Method* nmethod::attached_method(address call_instr) { return NULL; // not found } +Method* nmethod::attached_method_before_pc(address pc) { + if (NativeCall::is_call_before(pc)) { + NativeCall* ncall = nativeCall_before(pc); + return attached_method(ncall->instruction_address()); + } + return NULL; // not a call +} + diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 5f9b1aa320f..2305f51bc24 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -512,6 +512,7 @@ class nmethod : public CodeBlob { void copy_values(GrowableArray* metadata); Method* attached_method(address call_pc); + Method* attached_method_before_pc(address pc); // Relocation support private: diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index a79ae71fbc6..02c8dc656d5 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -1078,10 +1078,7 @@ methodHandle SharedRuntime::extract_attached_method(vframeStream& vfst) { address pc = vfst.frame_pc(); { // Get call instruction under lock because another thread may be busy patching it. MutexLockerEx ml_patch(Patching_lock, Mutex::_no_safepoint_check_flag); - if (NativeCall::is_call_before(pc)) { - NativeCall* ncall = nativeCall_before(pc); - return caller_nm->attached_method(ncall->instruction_address()); - } + return caller_nm->attached_method_before_pc(pc); } return NULL; } diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java index 72a521d480d..02bdef91a10 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java @@ -74,23 +74,23 @@ public class InvokeTest { } static class T implements I { - @DontInline public Class f1() { if (doDeopt) WB.deoptimize(); return T.class; } - @DontInline public static Class f2() { if (doDeopt) WB.deoptimize(); return T.class; } - @DontInline private Class f4() { if (doDeopt) WB.deoptimize(); return T.class; } + @DontInline public Class f1() { if (doDeopt) WB.deoptimizeAll(); return T.class; } + @DontInline public static Class f2() { if (doDeopt) WB.deoptimizeAll(); return T.class; } + @DontInline private Class f4() { if (doDeopt) WB.deoptimizeAll(); return T.class; } } static class P1 extends T { - @DontInline public Class f1() { if (doDeopt) WB.deoptimize(); return P1.class; } - @DontInline public Class f3() { if (doDeopt) WB.deoptimize(); return P1.class; } + @DontInline public Class f1() { if (doDeopt) WB.deoptimizeAll(); return P1.class; } + @DontInline public Class f3() { if (doDeopt) WB.deoptimizeAll(); return P1.class; } } static class P2 extends T { - @DontInline public Class f1() { if (doDeopt) WB.deoptimize(); return P2.class; } - @DontInline public Class f3() { if (doDeopt) WB.deoptimize(); return P2.class; } + @DontInline public Class f1() { if (doDeopt) WB.deoptimizeAll(); return P2.class; } + @DontInline public Class f3() { if (doDeopt) WB.deoptimizeAll(); return P2.class; } } static interface I { - @DontInline default Class f3() { if (doDeopt) WB.deoptimize(); return I.class; } + @DontInline default Class f3() { if (doDeopt) WB.deoptimizeAll(); return I.class; } } @DontInline From 2b4403dc8837df2edb09a294c6cd0f902a6dba7c Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 14 Dec 2015 10:22:19 +0100 Subject: [PATCH 076/228] 8145300: ppc64: fix port of "8072008: Emit direct call instead of linkTo* for recursive indy/MH.invoke* calls" Reviewed-by: simonis --- hotspot/src/cpu/ppc/vm/ppc.ad | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 781b4038229..682474c05a3 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -3486,6 +3486,7 @@ encode %{ call->_jvmadj = _jvmadj; call->_in_rms = _in_rms; call->_nesting = _nesting; + call->_override_symbolic_info = _override_symbolic_info; // New call needs all inputs of old call. // Req... From c2221a88e819436b7c973942367eb7eeabc354e7 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Mon, 14 Dec 2015 15:53:48 +0000 Subject: [PATCH 077/228] 8145320: Create unsafe_arraycopy and generic_arraycopy for AArch64 Reviewed-by: kvn --- .../cpu/aarch64/vm/stubGenerator_aarch64.cpp | 364 +++++++++++++++++- 1 file changed, 355 insertions(+), 9 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp index 2eb119125f2..30b42c0634c 100644 --- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp @@ -958,8 +958,8 @@ class StubGenerator: public StubCodeGenerator { const Register t0 = r3, t1 = r4; if (is_backwards) { - __ lea(s, Address(s, count, Address::uxtw(exact_log2(-step)))); - __ lea(d, Address(d, count, Address::uxtw(exact_log2(-step)))); + __ lea(s, Address(s, count, Address::lsl(exact_log2(-step)))); + __ lea(d, Address(d, count, Address::lsl(exact_log2(-step)))); } Label done, tail; @@ -1051,10 +1051,10 @@ class StubGenerator: public StubCodeGenerator { __ cmp(rscratch2, count); __ br(Assembler::HS, end); if (size == (size_t)wordSize) { - __ ldr(temp, Address(a, rscratch2, Address::uxtw(exact_log2(size)))); + __ ldr(temp, Address(a, rscratch2, Address::lsl(exact_log2(size)))); __ verify_oop(temp); } else { - __ ldrw(r16, Address(a, rscratch2, Address::uxtw(exact_log2(size)))); + __ ldrw(r16, Address(a, rscratch2, Address::lsl(exact_log2(size)))); __ decode_heap_oop(temp); // calls verify_oop } __ add(rscratch2, rscratch2, size); @@ -1087,12 +1087,14 @@ class StubGenerator: public StubCodeGenerator { __ align(CodeEntryAlignment); StubCodeMark mark(this, "StubRoutines", name); address start = __ pc(); + __ enter(); + if (entry != NULL) { *entry = __ pc(); // caller can pass a 64-bit byte count here (from Unsafe.copyMemory) BLOCK_COMMENT("Entry:"); } - __ enter(); + if (is_oop) { __ push(RegSet::of(d, count), sp); // no registers are destroyed by this call @@ -1104,10 +1106,11 @@ class StubGenerator: public StubCodeGenerator { if (VerifyOops) verify_oop_array(size, d, count, r16); __ sub(count, count, 1); // make an inclusive end pointer - __ lea(count, Address(d, count, Address::uxtw(exact_log2(size)))); + __ lea(count, Address(d, count, Address::lsl(exact_log2(size)))); gen_write_ref_array_post_barrier(d, count, rscratch1); } __ leave(); + __ mov(r0, zr); // return 0 __ ret(lr); #ifdef BUILTIN_SIM { @@ -1140,11 +1143,16 @@ class StubGenerator: public StubCodeGenerator { StubCodeMark mark(this, "StubRoutines", name); address start = __ pc(); + __ enter(); + if (entry != NULL) { + *entry = __ pc(); + // caller can pass a 64-bit byte count here (from Unsafe.copyMemory) + BLOCK_COMMENT("Entry:"); + } __ cmp(d, s); __ br(Assembler::LS, nooverlap_target); - __ enter(); if (is_oop) { __ push(RegSet::of(d, count), sp); // no registers are destroyed by this call @@ -1160,6 +1168,7 @@ class StubGenerator: public StubCodeGenerator { gen_write_ref_array_post_barrier(d, count, rscratch1); } __ leave(); + __ mov(r0, zr); // return 0 __ ret(lr); #ifdef BUILTIN_SIM { @@ -1559,7 +1568,29 @@ class StubGenerator: public StubCodeGenerator { Register dst_pos, // destination position (c_rarg3) Register length, Register temp, - Label& L_failed) { Unimplemented(); } + Label& L_failed) { + BLOCK_COMMENT("arraycopy_range_checks:"); + + assert_different_registers(rscratch1, temp); + + // if (src_pos + length > arrayOop(src)->length()) FAIL; + __ ldrw(rscratch1, Address(src, arrayOopDesc::length_offset_in_bytes())); + __ addw(temp, length, src_pos); + __ cmpw(temp, rscratch1); + __ br(Assembler::HI, L_failed); + + // if (dst_pos + length > arrayOop(dst)->length()) FAIL; + __ ldrw(rscratch1, Address(dst, arrayOopDesc::length_offset_in_bytes())); + __ addw(temp, length, dst_pos); + __ cmpw(temp, rscratch1); + __ br(Assembler::HI, L_failed); + + // Have to clean up high 32 bits of 'src_pos' and 'dst_pos'. + __ movw(src_pos, src_pos); + __ movw(dst_pos, dst_pos); + + BLOCK_COMMENT("arraycopy_range_checks done"); + } // These stubs get called from some dumb test routine. // I'll write them properly when they're called from @@ -1569,6 +1600,309 @@ class StubGenerator: public StubCodeGenerator { } + // + // Generate 'unsafe' array copy stub + // Though just as safe as the other stubs, it takes an unscaled + // size_t argument instead of an element count. + // + // Input: + // c_rarg0 - source array address + // c_rarg1 - destination array address + // c_rarg2 - byte count, treated as ssize_t, can be zero + // + // Examines the alignment of the operands and dispatches + // to a long, int, short, or byte copy loop. + // + address generate_unsafe_copy(const char *name, + address byte_copy_entry) { +#ifdef PRODUCT + return StubRoutines::_jbyte_arraycopy; +#else + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", name); + address start = __ pc(); + __ enter(); // required for proper stackwalking of RuntimeStub frame + // bump this on entry, not on exit: + __ lea(rscratch2, ExternalAddress((address)&SharedRuntime::_unsafe_array_copy_ctr)); + __ incrementw(Address(rscratch2)); + __ b(RuntimeAddress(byte_copy_entry)); + return start; +#endif + } + + // + // Generate generic array copy stubs + // + // Input: + // c_rarg0 - src oop + // c_rarg1 - src_pos (32-bits) + // c_rarg2 - dst oop + // c_rarg3 - dst_pos (32-bits) + // c_rarg4 - element count (32-bits) + // + // Output: + // r0 == 0 - success + // r0 == -1^K - failure, where K is partial transfer count + // + address generate_generic_copy(const char *name, + address byte_copy_entry, address short_copy_entry, + address int_copy_entry, address oop_copy_entry, + address long_copy_entry, address checkcast_copy_entry) { + + Label L_failed, L_failed_0, L_objArray; + Label L_copy_bytes, L_copy_shorts, L_copy_ints, L_copy_longs; + + // Input registers + const Register src = c_rarg0; // source array oop + const Register src_pos = c_rarg1; // source position + const Register dst = c_rarg2; // destination array oop + const Register dst_pos = c_rarg3; // destination position + const Register length = c_rarg4; + + StubCodeMark mark(this, "StubRoutines", name); + + __ align(CodeEntryAlignment); + address start = __ pc(); + + __ enter(); // required for proper stackwalking of RuntimeStub frame + + // bump this on entry, not on exit: + inc_counter_np(SharedRuntime::_generic_array_copy_ctr); + + //----------------------------------------------------------------------- + // Assembler stub will be used for this call to arraycopy + // if the following conditions are met: + // + // (1) src and dst must not be null. + // (2) src_pos must not be negative. + // (3) dst_pos must not be negative. + // (4) length must not be negative. + // (5) src klass and dst klass should be the same and not NULL. + // (6) src and dst should be arrays. + // (7) src_pos + length must not exceed length of src. + // (8) dst_pos + length must not exceed length of dst. + // + + // if (src == NULL) return -1; + __ cbz(src, L_failed); + + // if (src_pos < 0) return -1; + __ tbnz(src_pos, 31, L_failed); // i.e. sign bit set + + // if (dst == NULL) return -1; + __ cbz(dst, L_failed); + + // if (dst_pos < 0) return -1; + __ tbnz(dst_pos, 31, L_failed); // i.e. sign bit set + + // registers used as temp + const Register scratch_length = r16; // elements count to copy + const Register scratch_src_klass = r17; // array klass + const Register lh = r18; // layout helper + + // if (length < 0) return -1; + __ movw(scratch_length, length); // length (elements count, 32-bits value) + __ tbnz(scratch_length, 31, L_failed); // i.e. sign bit set + + __ load_klass(scratch_src_klass, src); +#ifdef ASSERT + // assert(src->klass() != NULL); + { + BLOCK_COMMENT("assert klasses not null {"); + Label L1, L2; + __ cbnz(scratch_src_klass, L2); // it is broken if klass is NULL + __ bind(L1); + __ stop("broken null klass"); + __ bind(L2); + __ load_klass(rscratch1, dst); + __ cbz(rscratch1, L1); // this would be broken also + BLOCK_COMMENT("} assert klasses not null done"); + } +#endif + + // Load layout helper (32-bits) + // + // |array_tag| | header_size | element_type | |log2_element_size| + // 32 30 24 16 8 2 0 + // + // array_tag: typeArray = 0x3, objArray = 0x2, non-array = 0x0 + // + + const int lh_offset = in_bytes(Klass::layout_helper_offset()); + + // Handle objArrays completely differently... + const jint objArray_lh = Klass::array_layout_helper(T_OBJECT); + __ ldrw(lh, Address(scratch_src_klass, lh_offset)); + __ movw(rscratch1, objArray_lh); + __ eorw(rscratch2, lh, rscratch1); + __ cbzw(rscratch2, L_objArray); + + // if (src->klass() != dst->klass()) return -1; + __ load_klass(rscratch2, dst); + __ eor(rscratch2, rscratch2, scratch_src_klass); + __ cbnz(rscratch2, L_failed); + + // if (!src->is_Array()) return -1; + __ tbz(lh, 31, L_failed); // i.e. (lh >= 0) + + // At this point, it is known to be a typeArray (array_tag 0x3). +#ifdef ASSERT + { + BLOCK_COMMENT("assert primitive array {"); + Label L; + __ movw(rscratch2, Klass::_lh_array_tag_type_value << Klass::_lh_array_tag_shift); + __ cmpw(lh, rscratch2); + __ br(Assembler::GE, L); + __ stop("must be a primitive array"); + __ bind(L); + BLOCK_COMMENT("} assert primitive array done"); + } +#endif + + arraycopy_range_checks(src, src_pos, dst, dst_pos, scratch_length, + rscratch2, L_failed); + + // TypeArrayKlass + // + // src_addr = (src + array_header_in_bytes()) + (src_pos << log2elemsize); + // dst_addr = (dst + array_header_in_bytes()) + (dst_pos << log2elemsize); + // + + const Register rscratch1_offset = rscratch1; // array offset + const Register r18_elsize = lh; // element size + + __ ubfx(rscratch1_offset, lh, Klass::_lh_header_size_shift, + exact_log2(Klass::_lh_header_size_mask+1)); // array_offset + __ add(src, src, rscratch1_offset); // src array offset + __ add(dst, dst, rscratch1_offset); // dst array offset + BLOCK_COMMENT("choose copy loop based on element size"); + + // next registers should be set before the jump to corresponding stub + const Register from = c_rarg0; // source array address + const Register to = c_rarg1; // destination array address + const Register count = c_rarg2; // elements count + + // 'from', 'to', 'count' registers should be set in such order + // since they are the same as 'src', 'src_pos', 'dst'. + + assert(Klass::_lh_log2_element_size_shift == 0, "fix this code"); + + // The possible values of elsize are 0-3, i.e. exact_log2(element + // size in bytes). We do a simple bitwise binary search. + __ BIND(L_copy_bytes); + __ tbnz(r18_elsize, 1, L_copy_ints); + __ tbnz(r18_elsize, 0, L_copy_shorts); + __ lea(from, Address(src, src_pos));// src_addr + __ lea(to, Address(dst, dst_pos));// dst_addr + __ movw(count, scratch_length); // length + __ b(RuntimeAddress(byte_copy_entry)); + + __ BIND(L_copy_shorts); + __ lea(from, Address(src, src_pos, Address::lsl(1)));// src_addr + __ lea(to, Address(dst, dst_pos, Address::lsl(1)));// dst_addr + __ movw(count, scratch_length); // length + __ b(RuntimeAddress(short_copy_entry)); + + __ BIND(L_copy_ints); + __ tbnz(r18_elsize, 0, L_copy_longs); + __ lea(from, Address(src, src_pos, Address::lsl(2)));// src_addr + __ lea(to, Address(dst, dst_pos, Address::lsl(2)));// dst_addr + __ movw(count, scratch_length); // length + __ b(RuntimeAddress(int_copy_entry)); + + __ BIND(L_copy_longs); +#ifdef ASSERT + { + BLOCK_COMMENT("assert long copy {"); + Label L; + __ andw(lh, lh, Klass::_lh_log2_element_size_mask); // lh -> r18_elsize + __ cmpw(r18_elsize, LogBytesPerLong); + __ br(Assembler::EQ, L); + __ stop("must be long copy, but elsize is wrong"); + __ bind(L); + BLOCK_COMMENT("} assert long copy done"); + } +#endif + __ lea(from, Address(src, src_pos, Address::lsl(3)));// src_addr + __ lea(to, Address(dst, dst_pos, Address::lsl(3)));// dst_addr + __ movw(count, scratch_length); // length + __ b(RuntimeAddress(long_copy_entry)); + + // ObjArrayKlass + __ BIND(L_objArray); + // live at this point: scratch_src_klass, scratch_length, src[_pos], dst[_pos] + + Label L_plain_copy, L_checkcast_copy; + // test array classes for subtyping + __ load_klass(r18, dst); + __ cmp(scratch_src_klass, r18); // usual case is exact equality + __ br(Assembler::NE, L_checkcast_copy); + + // Identically typed arrays can be copied without element-wise checks. + arraycopy_range_checks(src, src_pos, dst, dst_pos, scratch_length, + rscratch2, L_failed); + + __ lea(from, Address(src, src_pos, Address::lsl(3))); + __ add(from, from, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); + __ lea(to, Address(dst, dst_pos, Address::lsl(3))); + __ add(to, to, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); + __ movw(count, scratch_length); // length + __ BIND(L_plain_copy); + __ b(RuntimeAddress(oop_copy_entry)); + + __ BIND(L_checkcast_copy); + // live at this point: scratch_src_klass, scratch_length, r18 (dst_klass) + { + // Before looking at dst.length, make sure dst is also an objArray. + __ ldrw(rscratch1, Address(r18, lh_offset)); + __ movw(rscratch2, objArray_lh); + __ eorw(rscratch1, rscratch1, rscratch2); + __ cbnzw(rscratch1, L_failed); + + // It is safe to examine both src.length and dst.length. + arraycopy_range_checks(src, src_pos, dst, dst_pos, scratch_length, + r18, L_failed); + + const Register rscratch2_dst_klass = rscratch2; + __ load_klass(rscratch2_dst_klass, dst); // reload + + // Marshal the base address arguments now, freeing registers. + __ lea(from, Address(src, src_pos, Address::lsl(3))); + __ add(from, from, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); + __ lea(to, Address(dst, dst_pos, Address::lsl(3))); + __ add(to, to, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); + __ movw(count, length); // length (reloaded) + Register sco_temp = c_rarg3; // this register is free now + assert_different_registers(from, to, count, sco_temp, + rscratch2_dst_klass, scratch_src_klass); + // assert_clean_int(count, sco_temp); + + // Generate the type check. + const int sco_offset = in_bytes(Klass::super_check_offset_offset()); + __ ldrw(sco_temp, Address(rscratch2_dst_klass, sco_offset)); + // assert_clean_int(sco_temp, r18); + generate_type_check(scratch_src_klass, sco_temp, rscratch2_dst_klass, L_plain_copy); + + // Fetch destination element klass from the ObjArrayKlass header. + int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset()); + __ ldr(rscratch2_dst_klass, Address(rscratch2_dst_klass, ek_offset)); + __ ldrw(sco_temp, Address(rscratch2_dst_klass, sco_offset)); + + // the checkcast_copy loop needs two extra arguments: + assert(c_rarg3 == sco_temp, "#3 already in place"); + // Set up arguments for checkcast_copy_entry. + __ mov(c_rarg4, rscratch2_dst_klass); // dst.klass.element_klass + __ b(RuntimeAddress(checkcast_copy_entry)); + } + + __ BIND(L_failed); + __ mov(r0, -1); + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(lr); + + return start; + } + void generate_arraycopy_stubs() { address entry; address entry_jbyte_arraycopy; @@ -1655,6 +1989,18 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy", &entry_checkcast_arraycopy); StubRoutines::_checkcast_arraycopy_uninit = generate_checkcast_copy("checkcast_arraycopy_uninit", NULL, /*dest_uninitialized*/true); + + StubRoutines::_unsafe_arraycopy = generate_unsafe_copy("unsafe_arraycopy", + entry_jbyte_arraycopy); + + StubRoutines::_generic_arraycopy = generate_generic_copy("generic_arraycopy", + entry_jbyte_arraycopy, + entry_jshort_arraycopy, + entry_jint_arraycopy, + entry_oop_arraycopy, + entry_jlong_arraycopy, + entry_checkcast_arraycopy); + } void generate_math_stubs() { Unimplemented(); } @@ -1973,7 +2319,7 @@ class StubGenerator: public StubCodeGenerator { // c_rarg4 - input length // // Output: - // rax - input length + // r0 - input length // address generate_cipherBlockChaining_decryptAESCrypt() { assert(UseAES, "need AES instructions and misaligned SSE support"); From c095394bced5c3a8155c651fa28df81709815a28 Mon Sep 17 00:00:00 2001 From: Ed Nevill Date: Tue, 8 Dec 2015 14:26:17 +0000 Subject: [PATCH 078/228] 8144498: aarch64: large code cache generates SEGV Fix pd_call_destination to use is_call_at rather than is_call Reviewed-by: aph, adinn --- hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp index 3ab4f0b7b2c..42d2977b1b5 100644 --- a/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp @@ -59,7 +59,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { address Relocation::pd_call_destination(address orig_addr) { assert(is_call(), "should be a call here"); - if (is_call()) { + if (NativeCall::is_call_at(addr())) { address trampoline = nativeCall_at(addr())->get_trampoline(); if (trampoline) { return nativeCallTrampolineStub_at(trampoline)->destination(); From 24e53a99d3a90413334202d5c0a34cea134302a4 Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Tue, 8 Dec 2015 19:01:33 +0300 Subject: [PATCH 079/228] 8143941: Update splashscreen displays Reviewed-by: ahgross, prr, serb --- .../native/libsplashscreen/libpng/CHANGES | 411 +++++++- .../native/libsplashscreen/libpng/LICENSE | 55 +- .../native/libsplashscreen/libpng/README | 4 +- .../share/native/libsplashscreen/libpng/png.c | 345 +++---- .../share/native/libsplashscreen/libpng/png.h | 602 +++++------- .../native/libsplashscreen/libpng/pngconf.h | 50 +- .../native/libsplashscreen/libpng/pngdebug.h | 3 +- .../native/libsplashscreen/libpng/pngget.c | 36 +- .../native/libsplashscreen/libpng/pnginfo.h | 3 +- .../libsplashscreen/libpng/pnglibconf.h | 12 +- .../native/libsplashscreen/libpng/pngmem.c | 5 +- .../native/libsplashscreen/libpng/pngpread.c | 125 +-- .../native/libsplashscreen/libpng/pngpriv.h | 123 ++- .../native/libsplashscreen/libpng/pngread.c | 59 +- .../native/libsplashscreen/libpng/pngrio.c | 6 +- .../native/libsplashscreen/libpng/pngrtran.c | 85 +- .../native/libsplashscreen/libpng/pngrutil.c | 429 +++++---- .../native/libsplashscreen/libpng/pngset.c | 100 +- .../native/libsplashscreen/libpng/pngstruct.h | 38 +- .../native/libsplashscreen/libpng/pngtest.c | 196 ++-- .../native/libsplashscreen/libpng/pngtrans.c | 10 +- .../native/libsplashscreen/libpng/pngwio.c | 2 +- .../native/libsplashscreen/libpng/pngwrite.c | 637 ++++--------- .../native/libsplashscreen/libpng/pngwtran.c | 16 +- .../native/libsplashscreen/libpng/pngwutil.c | 902 ++++++------------ .../native/libsplashscreen/splashscreen_png.c | 1 + 26 files changed, 1971 insertions(+), 2284 deletions(-) diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/CHANGES b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/CHANGES index 443187481ba..8d9d53ee4e2 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/CHANGES +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/CHANGES @@ -23,13 +23,17 @@ * questions. */ +#if 0 CHANGES - changes for libpng -Version 0.2 +version 0.1 [March 29, 1995] + initial work-in-progress release + +version 0.2 [April 1, 1995] added reader into png.h fixed small problems in stub file -Version 0.3 +version 0.3 [April 8, 1995] added pull reader split up pngwrite.c to several files added pnglib.txt @@ -38,9 +42,9 @@ Version 0.3 fixed some bugs in writer interfaced with zlib 0.5 added K&R support - added check for 64 KB blocks for 16-bit machines + added check for 64 KB blocks for 16 bit machines -Version 0.4 +version 0.4 [April 26, 1995] cleaned up code and commented code simplified time handling into png_time created png_color_16 and png_color_8 to handle color needs @@ -51,28 +55,29 @@ Version 0.4 cleaned up zTXt reader and writer (using zlib's Reset functions) split transformations into pngrtran.c and pngwtran.c -Version 0.5 +version 0.5 [April 30, 1995] interfaced with zlib 0.8 fixed many reading and writing bugs saved using 3 spaces instead of tabs -Version 0.6 +version 0.6 [May 1, 1995] + first beta release added png_large_malloc() and png_large_free() added png_size_t cleaned up some compiler warnings added png_start_read_image() -Version 0.7 +version 0.7 [June 24, 1995] cleaned up lots of bugs finished dithering and other stuff added test program changed name from pnglib to libpng -Version 0.71 [June, 1995] +version 0.71 [June 26, 1995] changed pngtest.png for zlib 0.93 fixed error in libpng.txt and example.c -Version 0.8 +version 0.8 [August 20, 1995] cleaned up some bugs added png_set_filler() split up pngstub.c into pngmem.c, pngio.c, and pngerror.c @@ -115,7 +120,7 @@ Version 0.88 [January, 1996] cleaned up documentation added callbacks for read/write and warning/error functions -Version 0.89 [July, 1996] +Version 0.89 [June 5, 1996] Added new initialization API to make libpng work better with shared libs we now have png_create_read_struct(), png_create_write_struct(), png_create_info_struct(), png_destroy_read_struct(), and @@ -142,6 +147,9 @@ Version 0.89 [July, 1996] New pngtest image also has interlacing and zTXt Updated documentation to reflect new API +Version 0.89c [June 17, 1996] + Bug fixes. + Version 0.90 [January, 1997] Made CRC errors/warnings on critical and ancillary chunks configurable libpng will use the zlib CRC routines by (compile-time) default @@ -182,7 +190,7 @@ Version 0.95 [March, 1997] Added new pCAL chunk read/write support Added experimental filter selection weighting (Greg Roelofs) Removed old png_set_rgbx() and png_set_xrgb() functions that have been - obsolete for about 2 years now (use png_set_filler() instead) + obsolete for about 2 years now (use png_set_filler() instead) Added macros to read 16- and 32-bit ints directly from buffer, to be used only on those systems that support it (namely PowerPC and 680x0) With some testing, this may become the default for MACOS/PPC systems. @@ -464,7 +472,7 @@ Version 1.0.3 [January 14, 1999] Version 1.0.3a [August 12, 1999] Added check for PNG_READ_INTERLACE_SUPPORTED in pngread.c; issue a warning - if an attempt is made to read an interlaced image when it's not supported. + if an attempt is made to read an interlaced image when it's not supported. Added check if png_ptr->trans is defined before freeing it in pngread.c Modified the Y2K statement to include versions back to version 0.71 Fixed a bug in the check for valid IHDR bit_depth/color_types in pngrutil.c @@ -472,7 +480,7 @@ Version 1.0.3a [August 12, 1999] Replaced leading blanks with tab characters in makefile.hux Changed "dworkin.wustl.edu" to "ccrc.wustl.edu" in various documents. Changed (float)red and (float)green to (double)red, (double)green - in png_set_rgb_to_gray() to avoid "promotion" problems in AIX. + in png_set_rgb_to_gray() to avoid "promotion" problems in AIX. Fixed a bug in pngconf.h that omitted when PNG_DEBUG==0 (K Bracey). Reformatted libpng.3 and libpngpf.3 with proper fonts (script by J. vanZandt). Updated documentation to refer to the PNG-1.2 specification. @@ -515,7 +523,7 @@ Version 1.0.3d [September 4, 1999] Added new png_expand functions to scripts/pngdef.pas and pngos2.def Added a demo read_user_transform_fn that examines the row filters in pngtest.c -Version 1.0.4 [September 24, 1999] +Version 1.0.4 [September 24, 1999, not distributed publicly] Define PNG_ALWAYS_EXTERN in pngconf.h if __STDC__ is defined Delete #define PNG_INTERNAL and include "png.h" from pngasmrd.h Made several minor corrections to pngtest.c @@ -542,6 +550,7 @@ Version 1.0.4c [October 1, 1999] Added a "png_check_version" function in png.c and pngtest.c that will generate a helpful compiler error if an old png.h is found in the search path. Changed type of png_user_transform_depth|channels from int to png_byte. + Added "Libpng is OSI Certified Open Source Software" statement to png.h Version 1.0.4d [October 6, 1999] Changed 0.45 to 0.45455 in png_set_sRGB() @@ -928,7 +937,7 @@ Version 1.0.7 [July 1, 2000] Version 1.0.8beta1 [July 8, 2000] Added png_free(png_ptr, key) two places in pngpread.c to stop memory leaks. Changed PNG_NO_STDIO to PNG_NO_CONSOLE_IO, several places in pngrutil.c and - pngwutil.c. + pngwutil.c. Changed PNG_EXPORT_VAR to use PNG_IMPEXP, in pngconf.h. Removed unused "#include " from png.c Added WindowsCE support. @@ -936,12 +945,12 @@ Version 1.0.8beta1 [July 8, 2000] Version 1.0.8beta2 [July 10, 2000] Added project files to the wince directory and made further revisions - of pngtest.c, pngrio.c, and pngwio.c in support of WindowsCE. + of pngtest.c, pngrio.c, and pngwio.c in support of WindowsCE. Version 1.0.8beta3 [July 11, 2000] Only set the PNG_FLAG_FREE_TRNS or PNG_FREE_TRNS flag in png_handle_tRNS() - for indexed-color input files to avoid potential double-freeing trans array - under some unusual conditions; problem was introduced in version 1.0.6f. + for indexed-color input files to avoid potential double-freeing trans array + under some unusual conditions; problem was introduced in version 1.0.6f. Further revisions to pngtest.c and files in the wince subdirectory. Version 1.0.8beta4 [July 14, 2000] @@ -1113,16 +1122,16 @@ Version 1.2.0beta3 [May 17, 2001] Version 1.2.0beta4 [June 23, 2001] Check for missing profile length field in iCCP chunk and free chunk_data - in case of truncated iCCP chunk. + in case of truncated iCCP chunk. Bumped shared-library number to 3 in makefile.sgi and makefile.sggcc Bumped dll-number from 2 to 3 in makefile.cygwin Revised contrib/gregbook/rpng*-x.c to avoid a memory leak and to exit cleanly - if user attempts to run it on an 8-bit display. + if user attempts to run it on an 8-bit display. Updated contrib/gregbook Use png_malloc instead of png_zalloc to allocate palette in pngset.c Updated makefile.ibmc Added some typecasts to eliminate gcc 3.0 warnings. Changed prototypes - of png_write_oFFS width and height from png_uint_32 to png_int_32. + of png_write_oFFS width and height from png_uint_32 to png_int_32. Updated example.c Revised prototypes for png_debug_malloc and png_debug_free in pngtest.c @@ -1130,9 +1139,9 @@ Version 1.2.0beta5 [August 8, 2001] Revised contrib/gregbook Revised makefile.gcmmx Revised pnggccrd.c to conditionally compile some thread-unsafe code only - when PNG_THREAD_UNSAFE_OK is defined. + when PNG_THREAD_UNSAFE_OK is defined. Added tests to prevent pngwutil.c from writing a bKGD or tRNS chunk with - value exceeding 2^bit_depth-1 + value exceeding 2^bit_depth-1 Revised makefile.sgi and makefile.sggcc Replaced calls to fprintf(stderr,...) with png_warning() in pnggccrd.c Removed restriction that do_invert_mono only operate on 1-bit opaque files @@ -1473,8 +1482,9 @@ Version 1.2.6beta4 [July 28, 2004] Use png_malloc instead of png_zalloc to allocate the pallete. Version 1.0.16rc1 and 1.2.6rc1 [August 4, 2004] - Fixed buffer overflow vulnerability in png_handle_tRNS() - Fixed integer arithmetic overflow vulnerability in png_read_png(). + Fixed buffer overflow vulnerability (CVE-2004-0597) in png_handle_tRNS(). + Fixed NULL dereference vulnerability (CVE-2004-0598) in png_handle_iCCP(). + Fixed integer overflow vulnerability (CVE-2004-0599) in png_read_png(). Fixed some harmless bugs in png_handle_sBIT, etc, that would cause duplicate chunk types to go undetected. Fixed some timestamps in the -config version @@ -1517,7 +1527,7 @@ Version 1.0.16rc4 and 1.2.6rc4 [August 10, 2004] Version 1.0.16rc5 and 1.2.6rc5 [August 10, 2004] Moved "PNG_HANDLE_CHUNK_*" macros out of PNG_ASSEMBLER_CODE_SUPPORTED - section of png.h where they were inadvertently placed in version rc3. + section of png.h where they were inadvertently placed in version rc3. Version 1.2.6 and 1.0.16 [August 15, 2004] Revised pngtest so memory allocation testing is only done when PNG_DEBUG==1. @@ -2126,7 +2136,7 @@ Version 1.4.0beta24 [July 25, 2008] png_decompress_chunk(), and remove "chunkdata" from parameter list. Put a call to png_check_chunk_name() in png_read_chunk_header(). Revised png_check_chunk_name() to reject a name with a lowercase 3rd byte. - Removed two calls to png_check_chunk_name() occuring later in the process. + Removed two calls to png_check_chunk_name() occurring later in the process. Define PNG_NO_ERROR_NUMBERS by default in pngconf.h Version 1.4.0beta25 [July 30, 2008] @@ -2349,7 +2359,7 @@ Version 1.4.0beta63 [June 15, 2009] Version 1.4.0beta64 [June 24, 2009] Eliminated PNG_LEGACY_SUPPORTED code. Moved the various unknown chunk macro definitions outside of the - PNG_READ|WRITE_ANCILLARY_CHUNK_SUPPORTED blocks. + PNG_READ|WRITE_ANCILLARY_CHUNK_SUPPORTED blocks. Version 1.4.0beta65 [June 26, 2009] Added a reference to the libpng license in each file. @@ -3771,8 +3781,9 @@ Version 1.5.7beta04 [November 17, 2011] Version 1.5.7beta05 [November 25, 2011] Removed "zTXt" from warning in generic chunk decompression function. - Validate time settings passed to pngset() and png_convert_to_rfc1123() - (Frank Busse). + Validate time settings passed to png_set_tIME() and png_convert_to_rfc1123() + (Frank Busse). Note: This prevented CVE-2015-7981 from affecting + libpng-1.5.7 and later. Added MINGW support to CMakeLists.txt Reject invalid compression flag or method when reading the iTXt chunk. Backed out 'simplified' API changes. The API seems too complex and there @@ -3818,12 +3829,13 @@ Version 1.6.0beta01 [December 15, 2011] (the other two required headers aren't used). Non-ANSI systems that don't have stddef.h or limits.h will have to provide an appropriate fake containing the relevant types and #defines. - The use of FAR/far has been eliminated and the definition of png_alloc_size_t - is now controlled by a flag so that 'small size_t' systems can select it - if necessary. Libpng 1.6 may not currently work on such systems -- it - seems likely that it will ask 'malloc' for more than 65535 bytes with any - image that has a sufficiently large row size (rather than simply failing - to read such images). + Dropped support for 16-bit platforms. The use of FAR/far has been eliminated + and the definition of png_alloc_size_t is now controlled by a flag so + that 'small size_t' systems can select it if necessary. Libpng 1.6 may + not currently work on such systems -- it seems likely that it will + ask 'malloc' for more than 65535 bytes with any image that has a + sufficiently large row size (rather than simply failing to read such + images). New tools directory containing tools used to generate libpng code. Fixed race conditions in parallel make builds. With higher degrees of parallelism during 'make' the use of the same temporary file names such @@ -4435,7 +4447,7 @@ Version 1.6.1beta02 [February 19, 2013] Version 1.6.1beta03 [February 22, 2013] Fixed ALIGNED_MEMORY support. - Allow run-time ARM NEON checking to be disabled. A new configure option: + Added a new configure option: --enable-arm-neon=always will stop the run-time checks. New checks within arm/arm_init.c will cause the code not to be compiled unless __ARM_NEON__ is set. This should make it fail safe (if someone asks @@ -4454,10 +4466,10 @@ Version 1.6.1beta05 [March 1, 2013] Version 1.6.1beta06 [March 4, 2013] Better documentation of unknown handling API interactions. Corrected Android builds and corrected libpng.vers with symbol - prefixing. This adds an API to set optimization options externally, + prefixing. It also makes those tests compile and link on Android. + Added an API png_set_option() to set optimization options externally, providing an alternative and general solution for the non-portable - run-time tests used by the ARM Neon code. It also makes those tests - compile and link on Android. + run-time tests used by the ARM Neon code, using the PNG_ARM_NEON option. The order of settings vs options in pnglibconf.h is reversed to allow settings to depend on options and options can now set (or override) the defaults for settings. @@ -4549,13 +4561,14 @@ Version 1.6.3beta03 [April 30, 2013] Expanded manual paragraph about writing private chunks, particularly the need to call png_set_keep_unknown_chunks() when writing them. Avoid dereferencing NULL pointer possibly returned from - png_create_write_struct() (Andrew Church). + png_create_write_struct() (Andrew Church). Version 1.6.3beta05 [May 9, 2013] Calculate our own zlib windowBits when decoding rather than trusting the CMF bytes in the PNG datastream. Added an option to force maximum window size for inflating, which was - the behavior of libpng15 and earlier. + the behavior of libpng15 and earlier, via a new PNG_MAXIMUM_INFLATE_WINDOW + option for png_set_options(). Added png-fix-itxt and png-fix-too-far-back to the built programs and removed warnings from the source code and timepng that are revealed as a result. @@ -5138,17 +5151,326 @@ Version 1.6.16beta03 [December 21, 2014] Version 1.6.16rc01 [December 21, 2014] Restored a test on width that was removed from png.c at libpng-1.6.9 - (Bug report by Alex Eubanks). + (Bug report by Alex Eubanks, CVE-2015-0973). Version 1.6.16rc02 [December 21, 2014] Undid the update to pngrutil.c in 1.6.16rc01. Version 1.6.16rc03 [December 21, 2014] - Fixed an overflow in png_combine_row with very wide interlaced images. + Fixed an overflow in png_combine_row() with very wide interlaced images + (Bug report and fix by John Bowler, CVE-2014-9495). Version 1.6.16 [December 22, 2014] No changes. +Version 1.6.17beta01 [January 29, 2015] + Removed duplicate PNG_SAFE_LIMITS_SUPPORTED handling from pngconf.h + Corrected the width limit calculation in png_check_IHDR(). + Removed user limits from pngfix. Also pass NULL pointers to + png_read_row to skip the unnecessary row de-interlace stuff. + Added testing of png_set_packing() to pngvalid.c + Regenerated configure scripts in the *.tar distributions with libtool-2.4.4 + Implement previously untested cases of libpng transforms in pngvalid.c + Fixed byte order in png_do_read_filler() with 16-bit input. Previously + the high and low bytes of the filler, from png_set_filler() or from + png_set_add_alpha(), were read in the wrong order. + Made the check for out-of-range values in png_set_tRNS() detect + values that are exactly 2^bit_depth, and work on 16-bit platforms. + Merged some parts of libpng-1.6.17beta01 and libpng-1.7.0beta47. + Added #ifndef __COVERITY__ where needed in png.c, pngrutil.c and + pngset.c to avoid warnings about dead code. + Added "& 0xff" to many instances of expressions that are typecast + to (png_byte), to avoid Coverity warnings. + +Version 1.6.17beta02 [February 7, 2015] + Work around one more Coverity-scan dead-code warning. + Do not build png_product2() when it is unused. + +Version 1.6.17beta03 [February 17, 2015] + Display user limits in the output from pngtest. + Eliminated the PNG_SAFE_LIMITS macro and restored the 1-million-column + and 1-million-row default limits in pnglibconf.dfa, that can be reset + by the user at build time or run time. This provides a more robust + defense against DOS and as-yet undiscovered overflows. + +Version 1.6.17beta04 [February 21, 2015] + Added PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED macro, on by default. + Allow user to call png_get_IHDR() with NULL arguments (Reuben Hawkins). + Rebuilt configure scripts with automake-1.15 and libtool-2.4.6 + +Version 1.6.17beta05 [February 25, 2015] + Restored compiling of png_reciprocal2 with PNG_NO_16BIT. + +Version 1.6.17beta06 [February 27, 2015] + Moved png_set_filter() prototype into a PNG_WRITE_SUPPORTED block + of png.h. + Avoid runtime checks when converting integer to png_byte with + Visual Studio (Sergey Kosarevsky) + +Version 1.6.17rc01 [March 4, 2015] + No changes. + +Version 1.6.17rc02 [March 9, 2015] + Removed some comments that the configure script did not handle + properly from scripts/pnglibconf.dfa and pnglibconf.h.prebuilt. + Free the unknown_chunks structure even when it contains no data. + +Version 1.6.17rc03 [March 12, 2015] + Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF + for consistency, and remove some useless tests (Alexey Petruchik). + +Version 1.6.17rc04 [March 16, 2015] + Remove pnglibconf.h, pnglibconf.c, and pnglibconf.out instead of + pnglibconf.* in "make clean" (Cosmin). + Fix bug in calculation of maxbits, in png_write_sBIT, introduced + in libpng-1.6.17beta01 (John Bowler). + +Version 1.6.17rc05 [March 21, 2015] + Define PNG_FILTER_* and PNG_FILTER_VALUE_* in png.h even when WRITE + is not supported (John Bowler). This fixes an error introduced in + libpng-1.6.17beta06. + Reverted "& 0xff" additions of version 1.6.17beta01. Libpng passes + the Coverity scan without them. + +Version 1.6.17rc06 [March 23, 2015] + Remove pnglibconf.dfn and pnglibconf.pre with "make clean". + Reformatted some "&0xff" instances to "& 0xff". + Fixed simplified 8-bit-linear to sRGB alpha. The calculated alpha + value was wrong. It's not clear if this affected the final stored + value; in the obvious code path the upper and lower 8-bits of the + alpha value were identical and the alpha was truncated to 8-bits + rather than dividing by 257 (John Bowler). + +Version 1.6.17 [March 26, 2015] + No changes. + +Version 1.6.18beta01 [April 1, 2015] + Removed PNG_SET_CHUNK_[CACHE|MALLOC]_LIMIT_SUPPORTED macros. They + have been combined with PNG_SET_USER_LIMITS_SUPPORTED (resolves + bug report by Andrew Church). + Fixed rgb_to_gray checks and added tRNS checks to pngvalid.c. This + fixes some arithmetic errors that caused some tests to fail on + some 32-bit platforms (Bug reports by Peter Breitenlohner [i686] + and Petr Gajdos [i586]). + +Version 1.6.18beta02 [April 26, 2015] + Suppressed some warnings from the Borland C++ 5.5.1/5.82 compiler + (Bug report by Viktor Szakats). + +Version 1.6.18beta03 [May 6, 2015] + Replaced "unexpected" with an integer (0xabadca11) in pngset.c + where a long was expected, to avoid a compiler warning when PNG_DEBUG > 1. + Added contrib/examples/simpleover.c, to demonstrate how to handle + alpha compositing of multiple images, using the "simplified API" + and an example PNG generation tool, contrib/examples/genpng.c + (John Bowler). + +Version 1.6.18beta04 [May 20, 2015] + PNG_RELEASE_BUILD replaces tests where the code depended on the build base + type and can be defined on the command line, allowing testing in beta + builds (John Bowler). + Avoid Coverity issue 80858 (REVERSE NULL) in pngtest.c PNG_DEBUG builds. + Avoid a harmless potential integer overflow in png_XYZ_from_xy() (Bug + report from Christopher Ferris). + +Version 1.6.18beta05 [May 31, 2015] + Backport filter selection code from libpng-1.7.0beta51, to combine + sub_row, up_row, avg_row, and paeth_row into try_row and tst_row. + Changed png_voidcast(), etc., to voidcast(), etc., in contrib/tools/pngfix.c + to avoid confusion with the libpng private macros. + Fixed old cut&paste bug in the weighted filter selection code in + pngwutil.c, introduced in libpng-0.95, March 1997. + +Version 1.6.18beta06 [June 1, 2015] + Removed WRITE_WEIGHTED_FILTERED code, to save a few kbytes of the + compiled library size. It never worked properly and as far as we can + tell, no one uses it. The png_set_filter_heuristics() and + png_set_filter_heuristics_fixed() APIs are retained but deprecated + and do nothing. + +Version 1.6.18beta07 [June 6, 2015] + Removed non-working progressive reader 'skip' function. This + function has apparently never been used. It was implemented + to support back-door modification of png_struct in libpng-1.4.x + but (because it does nothing and cannot do anything) was apparently + never tested (John Bowler). + Fixed cexcept.h in which GCC 5 now reports that one of the auto + variables in the Try macro needs to be volatile to prevent value + being lost over the setjmp (John Bowler). + Fixed NO_WRITE_FILTER and -Wconversion build breaks (John Bowler). + Fix g++ build breaks (John Bowler). + Quieted some Coverity issues in pngfix.c, png-fix-itxt.c, pngvalid.c, + pngstest.c, and pngimage.c. Most seem harmless, but png-fix-itxt + would only work with iTXt chunks with length 255 or less. + Added #ifdef's to contrib/examples programs so people don't try + to compile them without the minimum required support enabled + (suggested by Flavio Medeiros). + +Version 1.6.18beta08 [June 30, 2015] + Eliminated the final two Coverity defects (insecure temporary file + handling in contrib/libtests/pngstest.c; possible overflow of + unsigned char in contrib/tools/png-fix-itxt.c). To use the "secure" + file handling, define PNG_USE_MKSTEMP, otherwise "tmpfile()" will + be used. + Removed some unused WEIGHTED_FILTER macros from png.h and pngstruct.h + +Version 1.6.18beta09 [July 5, 2015] + Removed some useless typecasts from contrib/tools/png-fix-itxt.c + Fixed a new signed-unsigned comparison in pngrtran.c (Max Stepin). + Replaced arbitrary use of 'extern' with #define PNG_LINKAGE_*. To + preserve API compatibility, the new defines all default to "extern" + (requested by Jan Nijtmans). + +Version 1.6.18rc01 [July 9, 2015] + Belatedly added Mans Rullgard and James Yu to the list of Contributing + Authors. + +Version 1.6.18rc02 [July 12, 2015] + Restored unused FILTER_HEURISTIC macros removed at libpng-1.6.18beta08 + to png.h to avoid compatibility warnings. + +Version 1.6.18rc03 [July 15, 2015] + Minor changes to the man page + +Version 1.6.18 [July 23, 2015] + No changes. + +Version 1.6.19beta01 [July 30, 2015] + Updated obsolete information about the simplified API macros in the + manual pages (Bug report by Arc Riley). + Avoid potentially dereferencing NULL info_ptr in png_info_init_3(). + Rearranged png.h to put the major sections in the same order as + in libpng17. + Eliminated unused PNG_COST_SHIFT, PNG_WEIGHT_SHIFT, PNG_COST_FACTOR, and + PNG_WEIGHT_FACTOR macros. + Suppressed some warnings from the Borland C++ 5.5.1/5.82 compiler + (Bug report by Viktor Szakats). Several warnings remain and are + unavoidable, where we test for overflow. + Fixed potential leak of png_pixels in contrib/pngminus/pnm2png.c + Fixed uninitialized variable in contrib/gregbook/rpng2-x.c + +Version 1.6.19beta02 [August 19, 2015] + Moved config.h.in~ from the "libpng_autotools_files" list to the + "libpng_autotools_extra" list in autogen.sh because it was causing a + false positive for missing files (bug report by Robert C. Seacord). + Removed unreachable "break" statements in png.c, pngread.c, and pngrtran.c + to suppress clang warnings (Bug report by Viktor Szakats). + Fixed some bad links in the man page. + Changed "n bit" to "n-bit" in comments. + Added signed/unsigned 16-bit safety net. This removes the dubious + 0x8000 flag definitions on 16-bit systems. They aren't supported + yet the defs *probably* work, however it seems much safer to do this + and be advised if anyone, contrary to advice, is building libpng 1.6 + on a 16-bit system. It also adds back various switch default clauses + for GCC; GCC errors out if they are not present (with an appropriately + high level of warnings). + Safely convert num_bytes to a png_byte in png_set_sig_bytes() (Robert + Seacord). + Fixed the recently reported 1's complement security issue by replacing + the value that is illegal in the PNG spec, in both signed and unsigned + values, with 0. Illegal unsigned values (anything greater than or equal + to 0x80000000) can still pass through, but since these are not illegal + in ANSI-C (unlike 0x80000000 in the signed case) the checking that + occurs later can catch them (John Bowler). + +Version 1.6.19beta03 [September 26, 2015] + Fixed png_save_int_32 when int is not 2's complement (John Bowler). + Updated libpng16 with all the recent test changes from libpng17, + including changes to pngvalid.c to ensure that the original, + distributed, version of contrib/visupng/cexcept.h can be used + (John Bowler). + pngvalid contains the correction to the use of SAVE/STORE_ + UNKNOWN_CHUNKS; a bug revealed by changes in libpng 1.7. More + tests contain the --strict option to detect warnings and the + pngvalid-standard test has been corrected so that it does not + turn on progressive-read. There is a separate test which does + that. (John Bowler) + Also made some signed/unsigned fixes. + Make pngstest error limits version specific. Splitting the machine + generated error structs out to a file allows the values to be updated + without changing pngstest.c itself. Since libpng 1.6 and 1.7 have + slightly different error limits this simplifies maintenance. The + makepngs.sh script has also been updated to more accurately reflect + current problems in libpng 1.7 (John Bowler). + Incorporated new test PNG files into make check. tests/pngstest-* + are changed so that the new test files are divided into 8 groups by + gamma and alpha channel. These tests have considerably better code + and pixel-value coverage than contrib/pngsuite; however,coverage is + still incomplete (John Bowler). + Removed the '--strict' in 1.6 because of the double-gamma-correction + warning, updated pngstest-errors.h for the errors detected with the + new contrib/testspngs PNG test files (John Bowler). + +Version 1.6.19beta04 [October 15, 2015] + Worked around rgb-to-gray issues in libpng 1.6. The previous + attempts to ignore the errors in the code aren't quite enough to + deal with the 'channel selection' encoding added to libpng 1.7; abort. + pngvalid.c is changed to drop this encoding in prior versions. + Fixed 'pow' macros in pngvalid.c. It is legal for 'pow' to be a + macro, therefore the argument list cannot contain preprocessing + directives. Make sure pow is a function where this happens. This is + a minimal safe fix, the issue only arises in non-performance-critical + code (bug report by Curtis Leach, fix by John Bowler). + Added sPLT support to pngtest.c + +Version 1.6.19rc01 [October 23, 2015] + No changes. + +Version 1.6.19rc02 [October 31, 2015] + Prevent setting or writing over-length PLTE chunk (Cosmin Truta). + Silently truncate over-length PLTE chunk while reading. + Libpng incorrectly calculated the output rowbytes when the application + decreased either the number of channels or the bit depth (or both) in + a user transform. This was safe; libpng overallocated buffer space + (potentially by quite a lot; up to 4 times the amount required) but, + from 1.5.4 on, resulted in a png_error (John Bowler). + +Version 1.6.19rc03 [November 3, 2015] + Fixed some inconsequential cut-and-paste typos in png_set_cHRM_XYZ_fixed(). + Clarified COPYRIGHT information to state explicitly that versions + are derived from previous versions. + Removed much of the long list of previous versions from png.h and + libpng.3. + +Version 1.6.19rc04 [November 5, 2015] + Fixed new bug with CRC error after reading an over-length palette + (bug report by Cosmin Truta) (CVE-2015-8126). + +Version 1.6.19 [November 12, 2015] + Cleaned up coding style in png_handle_PLTE(). + +Version 1.6.20beta01 [November 20, 2015] + Avoid potential pointer overflow/underflow in png_handle_sPLT() and + png_handle_pCAL() (Bug report by John Regehr). + +Version 1.6.20beta02 [November 23, 2015] + Fixed incorrect implementation of png_set_PLTE() that uses png_ptr + not info_ptr, that left png_set_PLTE() open to the CVE-2015-8126 + vulnerability. + +Version 1.6.20beta03 [November 24, 2015] + Backported tests from libpng-1.7.0beta69. + +Version 1.6.20rc01 [November 26, 2015] + Fixed an error in handling of bad zlib CMINFO field in pngfix, found by + American Fuzzy Lop, reported by Brian Carpenter. inflate() doesn't + immediately fault a bad CMINFO field; instead a 'too far back' error + happens later (at least some times). pngfix failed to limit CMINFO to + the allowed values but then assumed that window_bits was in range, + triggering an assert. The bug is mostly harmless; the PNG file cannot + be fixed. + +Version 1.6.20rc02 [November 29, 2015] + In libpng 1.6 zlib initialization was changed to use the window size + in the zlib stream, not a fixed value. This causes some invalid images, + where CINFO is too large, to display 'correctly' if the rest of the + data is valid. This provides a workaround for zlib versions where the + error arises (ones that support the API change to use the window size + in the stream). + +Version 1.6.20 [December 3, 2015] + No changes. + Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement @@ -5156,3 +5478,4 @@ to subscribe) or to glennrp at users.sourceforge.net Glenn R-P +#endif diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/LICENSE b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/LICENSE index f912f6a6d9b..82dbe117f6d 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/LICENSE +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/LICENSE @@ -10,21 +10,18 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.6.16, December 22, 2014, are -Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are -distributed according to the same disclaimer and license as libpng-1.2.5 -with the following individual added to the list of Contributing Authors - - Cosmin Truta - -libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are -Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are -distributed according to the same disclaimer and license as libpng-1.0.6 -with the following individuals added to the list of Contributing Authors +libpng versions 1.0.7, July 1, 2000, through 1.6.20, December 3, 2015, are +Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, are +derived from libpng-1.0.6, and are distributed according to the same +disclaimer and license as libpng-1.0.6 with the following individuals +added to the list of Contributing Authors: Simon-Pierre Cadieux Eric S. Raymond + Mans Rullgard + Cosmin Truta Gilles Vollant + James Yu and with the following additions to the disclaimer: @@ -36,18 +33,20 @@ and with the following additions to the disclaimer: the user. libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are -Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are -distributed according to the same disclaimer and license as libpng-0.96, -with the following individuals added to the list of Contributing Authors: +Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from +libpng-0.96, and are distributed according to the same disclaimer and +license as libpng-0.96, with the following individuals added to the list +of Contributing Authors: Tom Lane Glenn Randers-Pehrson Willem van Schaik libpng versions 0.89, June 1996, through 0.96, May 1997, are -Copyright (c) 1996, 1997 Andreas Dilger -Distributed according to the same disclaimer and license as libpng-0.88, -with the following individuals added to the list of Contributing Authors: +Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, +and are distributed according to the same disclaimer and license as +libpng-0.88, with the following individuals added to the list of +Contributing Authors: John Bowler Kevin Bracey @@ -57,7 +56,7 @@ with the following individuals added to the list of Contributing Authors: Tom Tanner libpng versions 0.5, May 1995, through 0.88, January 1996, are -Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. +Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. For the purposes of this copyright and license, "Contributing Authors" is defined as the following set of individuals: @@ -80,13 +79,13 @@ Permission is hereby granted to use, copy, modify, and distribute this source code, or portions hereof, for any purpose, without fee, subject to the following restrictions: -1. The origin of this source code must not be misrepresented. + 1. The origin of this source code must not be misrepresented. -2. Altered versions must be plainly marked as such and must not - be misrepresented as being the original source. + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. -3. This Copyright notice may not be removed or altered from any - source or altered source distribution. + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. The Contributing Authors and Group 42, Inc. specifically permit, without fee, and encourage the use of this source code as a component to @@ -94,18 +93,20 @@ supporting the PNG file format in commercial products. If you use this source code in a product, acknowledgment is not required but would be appreciated. +END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. A "png_get_copyright" function is available, for convenient use in "about" boxes and the like: - printf("%s",png_get_copyright(NULL)); + printf("%s", png_get_copyright(NULL)); Also, the PNG logo (in PNG format, of course) is supplied in the files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). -Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a -certification mark of the Open Source Initiative. +Libpng is OSI Certified Open Source Software. OSI Certified Open Source is +a certification mark of the Open Source Initiative. OSI has not addressed +the additional disclaimers inserted at version 1.0.7. Glenn Randers-Pehrson glennrp at users.sourceforge.net -December 22, 2014 +December 3, 2015 diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/README b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/README index 8c5b0b2f153..59f1f918ae2 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/README +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/README @@ -1,4 +1,4 @@ -README for libpng version 1.6.16 - December 22, 2014 (shared library 16.0) +README for libpng version 1.6.20 - December 3, 2015 (shared library 16.0) See the note about version numbers near the top of png.h See INSTALL for instructions on how to install libpng. @@ -134,7 +134,7 @@ and ...". If in doubt, send questions to me. I'll bounce them to others, if necessary. Please do not send suggestions on how to change PNG. We have -been discussing PNG for nineteen years now, and it is official and +been discussing PNG for twenty years now, and it is official and finished. If you have suggestions for libpng, however, I'll gladly listen. Even if your suggestion is not used immediately, it may be used later. diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/png.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/png.c index d7682a1c4fd..38aa05942c9 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/png.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/png.c @@ -29,8 +29,8 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Last changed in libpng 1.6.16 [December 22, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.19 [November 12, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -42,7 +42,7 @@ #include "pngpriv.h" /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_16 Your_png_h_is_not_version_1_6_16; +typedef png_libpng_version_1_6_20 Your_png_h_is_not_version_1_6_20; /* Tells libpng that we have already handled the first "num_bytes" bytes * of the PNG file signature. If the PNG data is embedded into another @@ -54,15 +54,20 @@ typedef png_libpng_version_1_6_16 Your_png_h_is_not_version_1_6_16; void PNGAPI png_set_sig_bytes(png_structrp png_ptr, int num_bytes) { + unsigned int nb = (unsigned int)num_bytes; + png_debug(1, "in png_set_sig_bytes"); if (png_ptr == NULL) return; - if (num_bytes > 8) + if (num_bytes < 0) + nb = 0; + + if (nb > 8) png_error(png_ptr, "Too many bytes for PNG signature"); - png_ptr->sig_bytes = (png_byte)(num_bytes < 0 ? 0 : num_bytes); + png_ptr->sig_bytes = (png_byte)nb; } /* Checks whether the supplied bytes match the PNG signature. We allow @@ -129,7 +134,7 @@ png_zfree(voidpf png_ptr, voidpf ptr) void /* PRIVATE */ png_reset_crc(png_structrp png_ptr) { - /* The cast is safe because the crc is a 32 bit value. */ + /* The cast is safe because the crc is a 32-bit value. */ png_ptr->crc = (png_uint_32)crc32(0, Z_NULL, 0); } @@ -157,7 +162,7 @@ png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, png_size_t length) } /* 'uLong' is defined in zlib.h as unsigned long; this means that on some - * systems it is a 64 bit value. crc32, however, returns 32 bits so the + * systems it is a 64-bit value. crc32, however, returns 32 bits so the * following cast is safe. 'uInt' may be no more than 16 bits, so it is * necessary to perform a loop here. */ @@ -168,8 +173,10 @@ png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, png_size_t length) do { uInt safe_length = (uInt)length; +#ifndef __COVERITY__ if (safe_length == 0) safe_length = (uInt)-1; /* evil, but safe */ +#endif crc = crc32(crc, ptr, safe_length); @@ -269,15 +276,15 @@ png_create_png_struct,(png_const_charp user_png_ver, png_voidp error_ptr, create_struct.user_height_max = PNG_USER_HEIGHT_MAX; # ifdef PNG_USER_CHUNK_CACHE_MAX - /* Added at libpng-1.2.43 and 1.4.0 */ - create_struct.user_chunk_cache_max = PNG_USER_CHUNK_CACHE_MAX; + /* Added at libpng-1.2.43 and 1.4.0 */ + create_struct.user_chunk_cache_max = PNG_USER_CHUNK_CACHE_MAX; # endif # ifdef PNG_USER_CHUNK_MALLOC_MAX - /* Added at libpng-1.2.43 and 1.4.1, required only for read but exists - * in png_struct regardless. - */ - create_struct.user_chunk_malloc_max = PNG_USER_CHUNK_MALLOC_MAX; + /* Added at libpng-1.2.43 and 1.4.1, required only for read but exists + * in png_struct regardless. + */ + create_struct.user_chunk_malloc_max = PNG_USER_CHUNK_MALLOC_MAX; # endif # endif @@ -301,7 +308,9 @@ png_create_png_struct,(png_const_charp user_png_ver, png_voidp error_ptr, # ifdef PNG_SETJMP_SUPPORTED if (!setjmp(create_jmp_buf)) +# endif { +# ifdef PNG_SETJMP_SUPPORTED /* Temporarily fake out the longjmp information until we have * successfully completed this function. This only works if we have * setjmp() support compiled in, but it is safe - this stuff should @@ -310,8 +319,6 @@ png_create_png_struct,(png_const_charp user_png_ver, png_voidp error_ptr, create_struct.jmp_buf_ptr = &create_jmp_buf; create_struct.jmp_buf_size = 0; /*stack allocation*/ create_struct.longjmp_fn = longjmp; -# else - { # endif /* Call the general version checker (shared with read and write code): */ @@ -330,10 +337,10 @@ png_create_png_struct,(png_const_charp user_png_ver, png_voidp error_ptr, create_struct.zstream.opaque = png_ptr; # ifdef PNG_SETJMP_SUPPORTED - /* Eliminate the local error handling: */ - create_struct.jmp_buf_ptr = NULL; - create_struct.jmp_buf_size = 0; - create_struct.longjmp_fn = 0; + /* Eliminate the local error handling: */ + create_struct.jmp_buf_ptr = NULL; + create_struct.jmp_buf_size = 0; + create_struct.longjmp_fn = 0; # endif *png_ptr = create_struct; @@ -439,6 +446,8 @@ png_info_init_3,(png_infopp ptr_ptr, png_size_t png_info_struct_size), free(info_ptr); info_ptr = png_voidcast(png_inforp, png_malloc_base(NULL, (sizeof *info_ptr))); + if (info_ptr == NULL) + return; *ptr_ptr = info_ptr; } @@ -504,9 +513,10 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, /* Free any tRNS entry */ if (((mask & PNG_FREE_TRNS) & info_ptr->free_me) != 0) { + info_ptr->valid &= ~PNG_INFO_tRNS; png_free(png_ptr, info_ptr->trans_alpha); info_ptr->trans_alpha = NULL; - info_ptr->valid &= ~PNG_INFO_tRNS; + info_ptr->num_trans = 0; } #endif @@ -572,20 +582,17 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, else { - if (info_ptr->splt_palettes_num != 0) + int i; + + for (i = 0; i < info_ptr->splt_palettes_num; i++) { - int i; - - for (i = 0; i < info_ptr->splt_palettes_num; i++) - { - png_free(png_ptr, info_ptr->splt_palettes[i].name); - png_free(png_ptr, info_ptr->splt_palettes[i].entries); - } - - png_free(png_ptr, info_ptr->splt_palettes); - info_ptr->splt_palettes = NULL; - info_ptr->splt_palettes_num = 0; + png_free(png_ptr, info_ptr->splt_palettes[i].name); + png_free(png_ptr, info_ptr->splt_palettes[i].entries); } + + png_free(png_ptr, info_ptr->splt_palettes); + info_ptr->splt_palettes = NULL; + info_ptr->splt_palettes_num = 0; info_ptr->valid &= ~PNG_INFO_sPLT; } } @@ -605,15 +612,12 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, { int i; - if (info_ptr->unknown_chunks_num != 0) - { - for (i = 0; i < info_ptr->unknown_chunks_num; i++) - png_free(png_ptr, info_ptr->unknown_chunks[i].data); + for (i = 0; i < info_ptr->unknown_chunks_num; i++) + png_free(png_ptr, info_ptr->unknown_chunks[i].data); - png_free(png_ptr, info_ptr->unknown_chunks); - info_ptr->unknown_chunks = NULL; - info_ptr->unknown_chunks_num = 0; - } + png_free(png_ptr, info_ptr->unknown_chunks); + info_ptr->unknown_chunks = NULL; + info_ptr->unknown_chunks_num = 0; } } #endif @@ -694,22 +698,23 @@ png_init_io(png_structrp png_ptr, png_FILE_p fp) } # endif -#ifdef PNG_SAVE_INT_32_SUPPORTED -/* The png_save_int_32 function assumes integers are stored in two's - * complement format. If this isn't the case, then this routine needs to - * be modified to write data in two's complement format. Note that, - * the following works correctly even if png_int_32 has more than 32 bits - * (compare the more complex code required on read for sign extension.) +# ifdef PNG_SAVE_INT_32_SUPPORTED +/* PNG signed integers are saved in 32-bit 2's complement format. ANSI C-90 + * defines a cast of a signed integer to an unsigned integer either to preserve + * the value, if it is positive, or to calculate: + * + * (UNSIGNED_MAX+1) + integer + * + * Where UNSIGNED_MAX is the appropriate maximum unsigned value, so when the + * negative integral value is added the result will be an unsigned value + * correspnding to the 2's complement representation. */ void PNGAPI png_save_int_32(png_bytep buf, png_int_32 i) { - buf[0] = (png_byte)((i >> 24) & 0xff); - buf[1] = (png_byte)((i >> 16) & 0xff); - buf[2] = (png_byte)((i >> 8) & 0xff); - buf[3] = (png_byte)(i & 0xff); + png_save_uint_32(buf, i); } -#endif +# endif # ifdef PNG_TIME_RFC1123_SUPPORTED /* Convert the supplied time into an RFC 1123 string suitable for use in @@ -753,6 +758,7 @@ png_convert_to_rfc1123_buffer(char out[29], png_const_timep ptime) APPEND(':'); APPEND_NUMBER(PNG_NUMBER_FORMAT_02u, (unsigned)ptime->second); APPEND_STRING(" +0000"); /* This reliably terminates the buffer */ + PNG_UNUSED (pos) # undef APPEND # undef APPEND_NUMBER @@ -762,7 +768,7 @@ png_convert_to_rfc1123_buffer(char out[29], png_const_timep ptime) return 1; } -# if PNG_LIBPNG_VER < 10700 +# if PNG_LIBPNG_VER < 10700 /* To do: remove the following from libpng-1.7 */ /* Original API that uses a private buffer in png_struct. * Deprecated because it causes png_struct to carry a spurious temporary @@ -783,7 +789,7 @@ png_convert_to_rfc1123(png_structrp png_ptr, png_const_timep ptime) return NULL; } -# endif +# endif /* LIBPNG_VER < 10700 */ # endif /* TIME_RFC1123 */ #endif /* READ || WRITE */ @@ -797,14 +803,14 @@ png_get_copyright(png_const_structrp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.6.16 - December 22, 2014" PNG_STRING_NEWLINE \ - "Copyright (c) 1998-2014 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ - "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ - "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ - PNG_STRING_NEWLINE; + "libpng version 1.6.20 - December 3, 2015" PNG_STRING_NEWLINE \ + "Copyright (c) 1998-2015 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ + "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ + "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ + PNG_STRING_NEWLINE; # else - return "libpng version 1.6.16 - December 22, 2014\ - Copyright (c) 1998-2014 Glenn Randers-Pehrson\ + return "libpng version 1.6.20 - December 3, 2015\ + Copyright (c) 1998-2015 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; # endif @@ -842,9 +848,9 @@ png_get_header_version(png_const_structrp png_ptr) #ifdef __STDC__ return PNG_HEADER_VERSION_STRING # ifndef PNG_READ_SUPPORTED - " (NO READ SUPPORT)" + " (NO READ SUPPORT)" # endif - PNG_STRING_NEWLINE; + PNG_STRING_NEWLINE; #else return PNG_HEADER_VERSION_STRING; #endif @@ -900,9 +906,9 @@ png_build_grayscale_palette(int bit_depth, png_colorp palette) for (i = 0, v = 0; i < num_palette; i++, v += color_inc) { - palette[i].red = (png_byte)v; - palette[i].green = (png_byte)v; - palette[i].blue = (png_byte)v; + palette[i].red = (png_byte)(v & 0xff); + palette[i].green = (png_byte)(v & 0xff); + palette[i].blue = (png_byte)(v & 0xff); } } #endif @@ -975,8 +981,6 @@ png_access_version_number(void) return((png_uint_32)PNG_LIBPNG_VER); } - - #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) /* Ensure that png_ptr->zstream.msg holds some appropriate error message string. * If it doesn't 'ret' is used to set it to something appropriate, even in cases @@ -1119,10 +1123,10 @@ png_colorspace_set_gamma(png_const_structrp png_ptr, errmsg = "gamma value out of range"; # ifdef PNG_READ_gAMA_SUPPORTED - /* Allow the application to set the gamma value more than once */ - else if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 && - (colorspace->flags & PNG_COLORSPACE_FROM_gAMA) != 0) - errmsg = "duplicate"; + /* Allow the application to set the gamma value more than once */ + else if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 && + (colorspace->flags & PNG_COLORSPACE_FROM_gAMA) != 0) + errmsg = "duplicate"; # endif /* Do nothing if the colorspace is already invalid */ @@ -1163,31 +1167,31 @@ png_colorspace_sync_info(png_const_structrp png_ptr, png_inforp info_ptr) PNG_INFO_iCCP); # ifdef PNG_COLORSPACE_SUPPORTED - /* Clean up the iCCP profile now if it won't be used. */ - png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, -1/*not used*/); + /* Clean up the iCCP profile now if it won't be used. */ + png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, -1/*not used*/); # else - PNG_UNUSED(png_ptr) + PNG_UNUSED(png_ptr) # endif } else { # ifdef PNG_COLORSPACE_SUPPORTED - /* Leave the INFO_iCCP flag set if the pngset.c code has already set - * it; this allows a PNG to contain a profile which matches sRGB and - * yet still have that profile retrievable by the application. - */ - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_MATCHES_sRGB) != 0) - info_ptr->valid |= PNG_INFO_sRGB; + /* Leave the INFO_iCCP flag set if the pngset.c code has already set + * it; this allows a PNG to contain a profile which matches sRGB and + * yet still have that profile retrievable by the application. + */ + if ((info_ptr->colorspace.flags & PNG_COLORSPACE_MATCHES_sRGB) != 0) + info_ptr->valid |= PNG_INFO_sRGB; - else - info_ptr->valid &= ~PNG_INFO_sRGB; + else + info_ptr->valid &= ~PNG_INFO_sRGB; - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0) - info_ptr->valid |= PNG_INFO_cHRM; + if ((info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0) + info_ptr->valid |= PNG_INFO_cHRM; - else - info_ptr->valid &= ~PNG_INFO_cHRM; + else + info_ptr->valid &= ~PNG_INFO_cHRM; # endif if ((info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) != 0) @@ -1209,7 +1213,7 @@ png_colorspace_sync(png_const_structrp png_ptr, png_inforp info_ptr) png_colorspace_sync_info(png_ptr, info_ptr); } #endif -#endif +#endif /* GAMMA */ #ifdef PNG_COLORSPACE_SUPPORTED /* Added at libpng-1.5.5 to support read and write of true CIEXYZ values for @@ -1268,16 +1272,17 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy) /* Check xy and, implicitly, z. Note that wide gamut color spaces typically * have end points with 0 tristimulus values (these are impossible end - * points, but they are used to cover the possible colors.) + * points, but they are used to cover the possible colors). We check + * xy->whitey against 5, not 0, to avoid a possible integer overflow. */ - if (xy->redx < 0 || xy->redx > PNG_FP_1) return 1; - if (xy->redy < 0 || xy->redy > PNG_FP_1-xy->redx) return 1; + if (xy->redx < 0 || xy->redx > PNG_FP_1) return 1; + if (xy->redy < 0 || xy->redy > PNG_FP_1-xy->redx) return 1; if (xy->greenx < 0 || xy->greenx > PNG_FP_1) return 1; if (xy->greeny < 0 || xy->greeny > PNG_FP_1-xy->greenx) return 1; - if (xy->bluex < 0 || xy->bluex > PNG_FP_1) return 1; - if (xy->bluey < 0 || xy->bluey > PNG_FP_1-xy->bluex) return 1; + if (xy->bluex < 0 || xy->bluex > PNG_FP_1) return 1; + if (xy->bluey < 0 || xy->bluey > PNG_FP_1-xy->bluex) return 1; if (xy->whitex < 0 || xy->whitex > PNG_FP_1) return 1; - if (xy->whitey < 0 || xy->whitey > PNG_FP_1-xy->whitex) return 1; + if (xy->whitey < 5 || xy->whitey > PNG_FP_1-xy->whitex) return 1; /* The reverse calculation is more difficult because the original tristimulus * value had 9 independent values (red,green,blue)x(X,Y,Z) however only 8 @@ -1735,7 +1740,6 @@ png_colorspace_set_chromaticities(png_const_structrp png_ptr, */ colorspace->flags |= PNG_COLORSPACE_INVALID; png_error(png_ptr, "internal error checking chromaticities"); - break; } return 0; /* failed */ @@ -1763,7 +1767,6 @@ png_colorspace_set_endpoints(png_const_structrp png_ptr, default: colorspace->flags |= PNG_COLORSPACE_INVALID; png_error(png_ptr, "internal error checking chromaticities"); - break; } return 0; /* failed */ @@ -2089,8 +2092,8 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, temp = png_get_uint_32(profile+12); /* profile/device class */ switch (temp) { - case 0x73636E72: /* 'scnr' */ - case 0x6D6E7472: /* 'mntr' */ + case 0x73636e72: /* 'scnr' */ + case 0x6d6e7472: /* 'mntr' */ case 0x70727472: /* 'prtr' */ case 0x73706163: /* 'spac' */ /* All supported */ @@ -2101,7 +2104,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, return png_icc_profile_error(png_ptr, colorspace, name, temp, "invalid embedded Abstract ICC profile"); - case 0x6C696E6B: /* 'link' */ + case 0x6c696e6b: /* 'link' */ /* DeviceLink profiles cannot be interpreted in a non-device specific * fashion, if an app uses the AToB0Tag in the profile the results are * undefined unless the result is sent to the intended device, @@ -2111,7 +2114,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, return png_icc_profile_error(png_ptr, colorspace, name, temp, "unexpected DeviceLink ICC profile class"); - case 0x6E6D636C: /* 'nmcl' */ + case 0x6e6d636c: /* 'nmcl' */ /* A NamedColor profile is also device specific, however it doesn't * contain an AToB0 tag that is open to misinterpretation. Almost * certainly it will fail the tests below. @@ -2137,8 +2140,8 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, temp = png_get_uint_32(profile+20); switch (temp) { - case 0x58595A20: /* 'XYZ ' */ - case 0x4C616220: /* 'Lab ' */ + case 0x58595a20: /* 'XYZ ' */ + case 0x4c616220: /* 'Lab ' */ break; default: @@ -2194,7 +2197,8 @@ png_icc_check_tag_table(png_const_structrp png_ptr, png_colorspacerp colorspace, return 1; /* success, maybe with warnings */ } -#if defined(PNG_sRGB_SUPPORTED) && PNG_sRGB_PROFILE_CHECKS >= 0 +#ifdef PNG_sRGB_SUPPORTED +#if PNG_sRGB_PROFILE_CHECKS >= 0 /* Information about the known ICC sRGB profiles */ static const struct { @@ -2307,8 +2311,8 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr, } /* Length *and* intent must match */ - if (length == png_sRGB_checks[i].length && - intent == png_sRGB_checks[i].intent) + if (length == (png_uint_32) png_sRGB_checks[i].length && + intent == (png_uint_32) png_sRGB_checks[i].intent) { /* Now calculate the adler32 if not done already. */ if (adler == 0) @@ -2352,8 +2356,8 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr, */ else if (png_sRGB_checks[i].have_md5 == 0) { - png_chunk_report(png_ptr, "out-of-date sRGB profile with" - " no signature", + png_chunk_report(png_ptr, + "out-of-date sRGB profile with no signature", PNG_CHUNK_WARNING); } @@ -2366,8 +2370,8 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr, * way. This probably indicates a data error or uninformed hacking. * Fall through to "no match". */ - png_chunk_report(png_ptr, "Not recognizing known sRGB profile that" - " has been edited", + png_chunk_report(png_ptr, + "Not recognizing known sRGB profile that has been edited", PNG_CHUNK_WARNING); break; # endif @@ -2377,9 +2381,8 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr, return 0; /* no match */ } -#endif +#endif /* PNG_sRGB_PROFILE_CHECKS >= 0 */ -#ifdef PNG_sRGB_SUPPORTED void /* PRIVATE */ png_icc_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_bytep profile, uLong adler) @@ -2393,7 +2396,7 @@ png_icc_set_sRGB(png_const_structrp png_ptr, (void)png_colorspace_set_sRGB(png_ptr, colorspace, (int)/*already checked*/png_get_uint_32(profile+64)); } -#endif /* READ_sRGB */ +#endif /* sRGB */ int /* PRIVATE */ png_colorspace_set_ICC(png_const_structrp png_ptr, png_colorspacerp colorspace, @@ -2485,7 +2488,7 @@ png_colorspace_set_rgb_coefficients(png_structrp png_ptr) png_error(png_ptr, "internal error handling cHRM->XYZ"); } } -#endif +#endif /* READ_RGB_TO_GRAY */ #endif /* COLORSPACE */ @@ -2514,18 +2517,19 @@ png_check_IHDR(png_const_structrp png_ptr, png_warning(png_ptr, "Image width is zero in IHDR"); error = 1; } - else if (width > PNG_UINT_31_MAX) + + if (width > PNG_UINT_31_MAX) { png_warning(png_ptr, "Invalid image width in IHDR"); error = 1; } - else if (png_gt(width, - (PNG_SIZE_MAX >> 3) /* 8-byte RGBA pixels */ - - 48 /* big_row_buf hack */ - - 1 /* filter byte */ - - 7*8 /* rounding width to multiple of 8 pix */ - - 8)) /* extra max_pixel_depth pad */ + if (png_gt(((width + 7) & (~7)), + ((PNG_SIZE_MAX + - 48 /* big_row_buf hack */ + - 1) /* filter byte */ + / 8) /* 8-byte RGBA pixels */ + - 1)) /* extra max_pixel_depth pad */ { /* The size of the row must be within the limits of this architecture. * Because the read code can perform arbitrary transformations the @@ -2541,17 +2545,15 @@ png_check_IHDR(png_const_structrp png_ptr, png_warning(png_ptr, "Image width is too large for this architecture"); error = 1; } - else + +#ifdef PNG_SET_USER_LIMITS_SUPPORTED + if (width > png_ptr->user_width_max) +#else + if (width > PNG_USER_WIDTH_MAX) +#endif { -# ifdef PNG_SET_USER_LIMITS_SUPPORTED - if (width > png_ptr->user_width_max) -# else - if (width > PNG_USER_WIDTH_MAX) -# endif - { - png_warning(png_ptr, "Image width exceeds user limit in IHDR"); - error = 1; - } + png_warning(png_ptr, "Image width exceeds user limit in IHDR"); + error = 1; } if (height == 0) @@ -2559,22 +2561,21 @@ png_check_IHDR(png_const_structrp png_ptr, png_warning(png_ptr, "Image height is zero in IHDR"); error = 1; } - else if (height > PNG_UINT_31_MAX) + + if (height > PNG_UINT_31_MAX) { png_warning(png_ptr, "Invalid image height in IHDR"); error = 1; } - else + +#ifdef PNG_SET_USER_LIMITS_SUPPORTED + if (height > png_ptr->user_height_max) +#else + if (height > PNG_USER_HEIGHT_MAX) +#endif { -# ifdef PNG_SET_USER_LIMITS_SUPPORTED - if (height > png_ptr->user_height_max) -# else - if (height > PNG_USER_HEIGHT_MAX) -# endif - { - png_warning(png_ptr, "Image height exceeds user limit in IHDR"); - error = 1; - } + png_warning(png_ptr, "Image height exceeds user limit in IHDR"); + error = 1; } /* Check other values */ @@ -2613,7 +2614,7 @@ png_check_IHDR(png_const_structrp png_ptr, error = 1; } -# ifdef PNG_MNG_FEATURES_SUPPORTED +#ifdef PNG_MNG_FEATURES_SUPPORTED /* Accept filter_method 64 (intrapixel differencing) only if * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and * 2. Libpng did not read a PNG signature (this filter_method is only @@ -2646,13 +2647,13 @@ png_check_IHDR(png_const_structrp png_ptr, } } -# else +#else if (filter_type != PNG_FILTER_TYPE_BASE) { png_warning(png_ptr, "Unknown filter method in IHDR"); error = 1; } -# endif +#endif if (error == 1) png_error(png_ptr, "Invalid IHDR data"); @@ -2878,7 +2879,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, if (fp >= DBL_MIN && fp <= DBL_MAX) { - int exp_b10; /* A base 10 exponent */ + int exp_b10; /* A base 10 exponent */ double base; /* 10^exp_b10 */ /* First extract a base 10 exponent of the number, @@ -2926,7 +2927,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, */ { - int czero, clead, cdigits; + unsigned int czero, clead, cdigits; char exponent[10]; /* Allow up to two leading zeros - this will not lengthen @@ -2956,7 +2957,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, * of the loop don't break the number into parts so * that the final digit is rounded. */ - if (cdigits+czero-clead+1 < (int)precision) + if (cdigits+czero+1 < precision+clead) fp = modf(fp, &d); else @@ -3062,14 +3063,14 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, *ascii++ = (char)(48 + (int)d), ++cdigits; } } - while (cdigits+czero-clead < (int)precision && fp > DBL_MIN); + while (cdigits+czero < precision+clead && fp > DBL_MIN); /* The total output count (max) is now 4+precision */ /* Check for an exponent, if we don't need one we are * done and just need to terminate the string. At * this point exp_b10==(-1) is effectively if flag - it got - * to '-1' because of the decrement after outputing + * to '-1' because of the decrement after outputting * the decimal point above (the exponent required is * *not* -1!) */ @@ -3077,7 +3078,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, { /* The following only happens if we didn't output the * leading zeros above for negative exponent, so this - * doest add to the digit requirement. Note that the + * doesn't add to the digit requirement. Note that the * two zeros here can only be output if the two leading * zeros were *not* output, so this doesn't increase * the output count. @@ -3130,7 +3131,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, /* Need another size check here for the exponent digits, so * this need not be considered above. */ - if ((int)size > cdigits) + if (size > cdigits) { while (cdigits > 0) *ascii++ = exponent[--cdigits]; @@ -3178,7 +3179,7 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii, /* Avoid overflow here on the minimum integer. */ if (fp < 0) - *ascii++ = 45, --size, num = -fp; + *ascii++ = 45, num = -fp; else num = fp; @@ -3234,7 +3235,7 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii, png_error(png_ptr, "ASCII conversion buffer too small"); } # endif /* FIXED_POINT */ -#endif /* READ_SCAL */ +#endif /* SCAL */ #if defined(PNG_FLOATING_POINT_SUPPORTED) && \ !defined(PNG_FIXED_POINT_MACRO_SUPPORTED) && \ @@ -3252,7 +3253,7 @@ png_fixed(png_const_structrp png_ptr, double fp, png_const_charp text) png_fixed_error(png_ptr, text); # ifndef PNG_ERROR_TEXT_SUPPORTED - PNG_UNUSED(text) + PNG_UNUSED(text) # endif return (png_fixed_point)r; @@ -3433,29 +3434,29 @@ png_gamma_significant(png_fixed_point gamma_val) #endif #ifdef PNG_READ_GAMMA_SUPPORTED -#if defined(PNG_16BIT_SUPPORTED) || !defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) +#ifdef PNG_16BIT_SUPPORTED /* A local convenience routine. */ static png_fixed_point png_product2(png_fixed_point a, png_fixed_point b) { /* The required result is 1/a * 1/b; the following preserves accuracy. */ -# ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED +#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED double r = a * 1E-5; r *= b; r = floor(r+.5); if (r <= 2147483647. && r >= -2147483648.) return (png_fixed_point)r; -# else +#else png_fixed_point res; if (png_muldiv(&res, a, b, 100000) != 0) return res; -# endif +#endif return 0; /* overflow */ } -#endif /* 16BIT || !FLOATING_ARITHMETIC */ +#endif /* 16BIT */ /* The inverse of the above. */ png_fixed_point @@ -3463,12 +3464,15 @@ png_reciprocal2(png_fixed_point a, png_fixed_point b) { /* The required result is 1/a * 1/b; the following preserves accuracy. */ #ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED - double r = 1E15/a; - r /= b; - r = floor(r+.5); + if (a != 0 && b != 0) + { + double r = 1E15/a; + r /= b; + r = floor(r+.5); - if (r <= 2147483647. && r >= -2147483648.) - return (png_fixed_point)r; + if (r <= 2147483647. && r >= -2147483648.) + return (png_fixed_point)r; + } #else /* This may overflow because the range of png_fixed_point isn't symmetric, * but this API is only used for the product of file and screen gamma so it @@ -3706,7 +3710,7 @@ png_exp(png_fixed_point x) if (x > 0 && x <= 0xfffff) /* Else overflow or zero (underflow) */ { /* Obtain a 4-bit approximation */ - png_uint_32 e = png_32bit_exp[(x >> 12) & 0xf]; + png_uint_32 e = png_32bit_exp[(x >> 12) & 0x0f]; /* Incorporate the low 12 bits - these decrease the returned value by * multiplying by a number less than 1 if the bit is set. The multiplier @@ -3759,7 +3763,7 @@ png_exp8bit(png_fixed_point lg2) * step. */ x -= x >> 8; - return (png_byte)((x + 0x7fffffU) >> 24); + return (png_byte)(((x + 0x7fffffU) >> 24) & 0xff); } #ifdef PNG_16BIT_SUPPORTED @@ -3820,7 +3824,7 @@ png_gamma_8bit_correct(unsigned int value, png_fixed_point gamma_val) # endif } - return (png_byte)value; + return (png_byte)(value & 0xff); } #ifdef PNG_16BIT_SUPPORTED @@ -4042,7 +4046,7 @@ png_build_8bit_table(png_structrp png_ptr, png_bytepp ptable, else for (i=0; i<256; ++i) - table[i] = (png_byte)i; + table[i] = (png_byte)(i & 0xff); } /* Used from png_read_destroy and below to release the memory used by the gamma @@ -4182,7 +4186,8 @@ png_build_gamma_table(png_structrp png_ptr, int bit_depth) * */ if (sig_bit > 0 && sig_bit < 16U) - shift = (png_byte)(16U - sig_bit); /* shift == insignificant bits */ + /* shift == insignificant bits */ + shift = (png_byte)((16U - sig_bit) & 0xff); else shift = 0; /* keep all 16 bits */ @@ -4251,7 +4256,7 @@ png_set_option(png_structrp png_ptr, int option, int onoff) int setting = (2 + (onoff != 0)) << option; int current = png_ptr->options; - png_ptr->options = (png_byte)((current & ~mask) | setting); + png_ptr->options = (png_byte)(((current & ~mask) | setting) & 0xff); return (current & mask) >> option; } @@ -4267,7 +4272,7 @@ png_set_option(png_structrp png_ptr, int option, int onoff) * contrib/tools/makesRGB.c. The actual sRGB transfer curve defined in the * specification (see the article at http://en.wikipedia.org/wiki/SRGB) * is used, not the gamma=1/2.2 approximation use elsewhere in libpng. - * The sRGB to linear table is exact (to the nearest 16 bit linear fraction). + * The sRGB to linear table is exact (to the nearest 16-bit linear fraction). * The inverse (linear to sRGB) table has accuracies as follows: * * For all possible (255*65535+1) input values: diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/png.h b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/png.h index de99418e773..c90a90f29cb 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/png.h +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/png.h @@ -29,8 +29,9 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * libpng version 1.6.16, December 22, 2014 - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * libpng version 1.6.20, December 3, 2015 + * + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -38,17 +39,137 @@ * * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat - * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.6.16, December 22, 2014: Glenn + * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger + * libpng versions 0.97, January 1998, through 1.6.20, December 3, 2015: + * Glenn Randers-Pehrson. * See also "Contributing Authors", below. + */ + +/* + * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: * - * Note about libpng version numbers: + * If you modify libpng you may insert additional notices immediately following + * this sentence. * - * Due to various miscommunications, unforeseen code incompatibilities - * and occasional factors outside the authors' control, version numbering - * on the library has not always been consistent and straightforward. - * The following table summarizes matters since version 0.89c, which was - * the first widely used release: + * This code is released under the libpng license. + * + * libpng versions 1.0.7, July 1, 2000, through 1.6.20, December 3, 2015, are + * Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, are + * derived from libpng-1.0.6, and are distributed according to the same + * disclaimer and license as libpng-1.0.6 with the following individuals + * added to the list of Contributing Authors: + * + * Simon-Pierre Cadieux + * Eric S. Raymond + * Mans Rullgard + * Cosmin Truta + * Gilles Vollant + * James Yu + * + * and with the following additions to the disclaimer: + * + * There is no warranty against interference with your enjoyment of the + * library or against infringement. There is no warranty that our + * efforts or the library will fulfill any of your particular purposes + * or needs. This library is provided with all faults, and the entire + * risk of satisfactory quality, performance, accuracy, and effort is with + * the user. + * + * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are + * Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from + * libpng-0.96, and are distributed according to the same disclaimer and + * license as libpng-0.96, with the following individuals added to the list + * of Contributing Authors: + * + * Tom Lane + * Glenn Randers-Pehrson + * Willem van Schaik + * + * libpng versions 0.89, June 1996, through 0.96, May 1997, are + * Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, + * and are distributed according to the same disclaimer and license as + * libpng-0.88, with the following individuals added to the list of + * Contributing Authors: + * + * John Bowler + * Kevin Bracey + * Sam Bushell + * Magnus Holmgren + * Greg Roelofs + * Tom Tanner + * + * libpng versions 0.5, May 1995, through 0.88, January 1996, are + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + * + * For the purposes of this copyright and license, "Contributing Authors" + * is defined as the following set of individuals: + * + * Andreas Dilger + * Dave Martindale + * Guy Eric Schalnat + * Paul Schmidt + * Tim Wegner + * + * The PNG Reference Library is supplied "AS IS". The Contributing Authors + * and Group 42, Inc. disclaim all warranties, expressed or implied, + * including, without limitation, the warranties of merchantability and of + * fitness for any purpose. The Contributing Authors and Group 42, Inc. + * assume no liability for direct, indirect, incidental, special, exemplary, + * or consequential damages, which may result from the use of the PNG + * Reference Library, even if advised of the possibility of such damage. + * + * Permission is hereby granted to use, copy, modify, and distribute this + * source code, or portions hereof, for any purpose, without fee, subject + * to the following restrictions: + * + * 1. The origin of this source code must not be misrepresented. + * + * 2. Altered versions must be plainly marked as such and must not + * be misrepresented as being the original source. + * + * 3. This Copyright notice may not be removed or altered from any + * source or altered source distribution. + * + * The Contributing Authors and Group 42, Inc. specifically permit, without + * fee, and encourage the use of this source code as a component to + * supporting the PNG file format in commercial products. If you use this + * source code in a product, acknowledgment is not required but would be + * appreciated. + * + * END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. + */ + +/* + * A "png_get_copyright" function is available, for convenient use in "about" + * boxes and the like: + * + * printf("%s", png_get_copyright(NULL)); + * + * Also, the PNG logo (in PNG format, of course) is supplied in the + * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). + */ + +/* + * Libpng is OSI Certified Open Source Software. OSI Certified Open Source is + * a certification mark of the Open Source Initiative. OSI has not addressed + * the additional disclaimers inserted at version 1.0.7. + */ + +/* + * The contributing authors would like to thank all those who helped + * with testing, bug fixes, and patience. This wouldn't have been + * possible without all of you. + * + * Thanks to Frank J. T. Wojcik for helping with the documentation. + */ + +/* Note about libpng version numbers: + * + * Due to various miscommunications, unforeseen code incompatibilities + * and occasional factors outside the authors' control, version numbering + * on the library has not always been consistent and straightforward. + * The following table summarizes matters since version 0.89c, which was + * the first widely used release: * * source png.h png.h shared-lib * version string int version @@ -86,310 +207,48 @@ * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) * 1.0.7 1 10007 (still compatible) - * 1.0.8beta1-4 1 10008 2.1.0.8beta1-4 - * 1.0.8rc1 1 10008 2.1.0.8rc1 - * 1.0.8 1 10008 2.1.0.8 - * 1.0.9beta1-6 1 10009 2.1.0.9beta1-6 - * 1.0.9rc1 1 10009 2.1.0.9rc1 - * 1.0.9beta7-10 1 10009 2.1.0.9beta7-10 - * 1.0.9rc2 1 10009 2.1.0.9rc2 - * 1.0.9 1 10009 2.1.0.9 - * 1.0.10beta1 1 10010 2.1.0.10beta1 - * 1.0.10rc1 1 10010 2.1.0.10rc1 - * 1.0.10 1 10010 2.1.0.10 - * 1.0.11beta1-3 1 10011 2.1.0.11beta1-3 - * 1.0.11rc1 1 10011 2.1.0.11rc1 - * 1.0.11 1 10011 2.1.0.11 - * 1.0.12beta1-2 2 10012 2.1.0.12beta1-2 - * 1.0.12rc1 2 10012 2.1.0.12rc1 - * 1.0.12 2 10012 2.1.0.12 - * 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned) - * 1.2.0beta1-2 2 10200 2.1.2.0beta1-2 - * 1.2.0beta3-5 3 10200 3.1.2.0beta3-5 - * 1.2.0rc1 3 10200 3.1.2.0rc1 - * 1.2.0 3 10200 3.1.2.0 - * 1.2.1beta1-4 3 10201 3.1.2.1beta1-4 - * 1.2.1rc1-2 3 10201 3.1.2.1rc1-2 - * 1.2.1 3 10201 3.1.2.1 - * 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6 - * 1.0.13beta1 10 10013 10.so.0.1.0.13beta1 - * 1.0.13rc1 10 10013 10.so.0.1.0.13rc1 - * 1.2.2rc1 12 10202 12.so.0.1.2.2rc1 - * 1.0.13 10 10013 10.so.0.1.0.13 - * 1.2.2 12 10202 12.so.0.1.2.2 - * 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6 - * 1.2.3 12 10203 12.so.0.1.2.3 - * 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3 - * 1.0.14rc1 13 10014 10.so.0.1.0.14rc1 - * 1.2.4rc1 13 10204 12.so.0.1.2.4rc1 - * 1.0.14 10 10014 10.so.0.1.0.14 - * 1.2.4 13 10204 12.so.0.1.2.4 - * 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2 - * 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3 - * 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3 - * 1.0.15 10 10015 10.so.0.1.0.15 - * 1.2.5 13 10205 12.so.0.1.2.5 - * 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4 - * 1.0.16 10 10016 10.so.0.1.0.16 - * 1.2.6 13 10206 12.so.0.1.2.6 - * 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2 - * 1.0.17rc1 10 10017 12.so.0.1.0.17rc1 - * 1.2.7rc1 13 10207 12.so.0.1.2.7rc1 - * 1.0.17 10 10017 12.so.0.1.0.17 - * 1.2.7 13 10207 12.so.0.1.2.7 - * 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5 - * 1.0.18rc1-5 10 10018 12.so.0.1.0.18rc1-5 - * 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5 - * 1.0.18 10 10018 12.so.0.1.0.18 - * 1.2.8 13 10208 12.so.0.1.2.8 - * 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3 - * 1.2.9beta4-11 13 10209 12.so.0.9[.0] - * 1.2.9rc1 13 10209 12.so.0.9[.0] - * 1.2.9 13 10209 12.so.0.9[.0] - * 1.2.10beta1-7 13 10210 12.so.0.10[.0] - * 1.2.10rc1-2 13 10210 12.so.0.10[.0] - * 1.2.10 13 10210 12.so.0.10[.0] - * 1.4.0beta1-5 14 10400 14.so.0.0[.0] - * 1.2.11beta1-4 13 10211 12.so.0.11[.0] - * 1.4.0beta7-8 14 10400 14.so.0.0[.0] - * 1.2.11 13 10211 12.so.0.11[.0] - * 1.2.12 13 10212 12.so.0.12[.0] - * 1.4.0beta9-14 14 10400 14.so.0.0[.0] - * 1.2.13 13 10213 12.so.0.13[.0] - * 1.4.0beta15-36 14 10400 14.so.0.0[.0] - * 1.4.0beta37-87 14 10400 14.so.14.0[.0] - * 1.4.0rc01 14 10400 14.so.14.0[.0] - * 1.4.0beta88-109 14 10400 14.so.14.0[.0] - * 1.4.0rc02-08 14 10400 14.so.14.0[.0] - * 1.4.0 14 10400 14.so.14.0[.0] - * 1.4.1beta01-03 14 10401 14.so.14.1[.0] - * 1.4.1rc01 14 10401 14.so.14.1[.0] - * 1.4.1beta04-12 14 10401 14.so.14.1[.0] - * 1.4.1 14 10401 14.so.14.1[.0] - * 1.4.2 14 10402 14.so.14.2[.0] - * 1.4.3 14 10403 14.so.14.3[.0] - * 1.4.4 14 10404 14.so.14.4[.0] - * 1.5.0beta01-58 15 10500 15.so.15.0[.0] - * 1.5.0rc01-07 15 10500 15.so.15.0[.0] - * 1.5.0 15 10500 15.so.15.0[.0] - * 1.5.1beta01-11 15 10501 15.so.15.1[.0] - * 1.5.1rc01-02 15 10501 15.so.15.1[.0] - * 1.5.1 15 10501 15.so.15.1[.0] - * 1.5.2beta01-03 15 10502 15.so.15.2[.0] - * 1.5.2rc01-03 15 10502 15.so.15.2[.0] - * 1.5.2 15 10502 15.so.15.2[.0] - * 1.5.3beta01-10 15 10503 15.so.15.3[.0] - * 1.5.3rc01-02 15 10503 15.so.15.3[.0] - * 1.5.3beta11 15 10503 15.so.15.3[.0] - * 1.5.3 [omitted] - * 1.5.4beta01-08 15 10504 15.so.15.4[.0] - * 1.5.4rc01 15 10504 15.so.15.4[.0] - * 1.5.4 15 10504 15.so.15.4[.0] - * 1.5.5beta01-08 15 10505 15.so.15.5[.0] - * 1.5.5rc01 15 10505 15.so.15.5[.0] - * 1.5.5 15 10505 15.so.15.5[.0] - * 1.5.6beta01-07 15 10506 15.so.15.6[.0] - * 1.5.6rc01-03 15 10506 15.so.15.6[.0] - * 1.5.6 15 10506 15.so.15.6[.0] - * 1.5.7beta01-05 15 10507 15.so.15.7[.0] - * 1.5.7rc01-03 15 10507 15.so.15.7[.0] - * 1.5.7 15 10507 15.so.15.7[.0] - * 1.6.0beta01-40 16 10600 16.so.16.0[.0] - * 1.6.0rc01-08 16 10600 16.so.16.0[.0] - * 1.6.0 16 10600 16.so.16.0[.0] - * 1.6.1beta01-09 16 10601 16.so.16.1[.0] - * 1.6.1rc01 16 10601 16.so.16.1[.0] - * 1.6.1 16 10601 16.so.16.1[.0] - * 1.6.2beta01 16 10602 16.so.16.2[.0] - * 1.6.2rc01-06 16 10602 16.so.16.2[.0] - * 1.6.2 16 10602 16.so.16.2[.0] - * 1.6.3beta01-11 16 10603 16.so.16.3[.0] - * 1.6.3rc01 16 10603 16.so.16.3[.0] - * 1.6.3 16 10603 16.so.16.3[.0] - * 1.6.4beta01-02 16 10604 16.so.16.4[.0] - * 1.6.4rc01 16 10604 16.so.16.4[.0] - * 1.6.4 16 10604 16.so.16.4[.0] - * 1.6.5 16 10605 16.so.16.5[.0] - * 1.6.6 16 10606 16.so.16.6[.0] - * 1.6.7beta01-04 16 10607 16.so.16.7[.0] - * 1.6.7rc01-03 16 10607 16.so.16.7[.0] - * 1.6.7 16 10607 16.so.16.7[.0] - * 1.6.8beta01-02 16 10608 16.so.16.8[.0] - * 1.6.8rc01-02 16 10608 16.so.16.8[.0] - * 1.6.8 16 10608 16.so.16.8[.0] - * 1.6.9beta01-04 16 10609 16.so.16.9[.0] - * 1.6.9rc01-02 16 10609 16.so.16.9[.0] - * 1.6.9 16 10609 16.so.16.9[.0] - * 1.6.10beta01-03 16 10610 16.so.16.10[.0] - * 1.6.10rc01-03 16 10610 16.so.16.10[.0] - * 1.6.10 16 10610 16.so.16.10[.0] - * 1.6.11beta01-06 16 10611 16.so.16.11[.0] - * 1.6.11rc01-02 16 10611 16.so.16.11[.0] - * 1.6.11 16 10611 16.so.16.11[.0] - * 1.6.12rc01-03 16 10612 16.so.16.12[.0] - * 1.6.12 16 10612 16.so.16.12[.0] - * 1.6.13beta01-04 16 10613 16.so.16.13[.0] - * 1.6.13rc01-02 16 10613 16.so.16.13[.0] - * 1.6.13 16 10613 16.so.16.13[.0] - * 1.6.14beta01-07 16 10614 16.so.16.14[.0] - * 1.6.14rc01-02 16 10614 16.so.16.14[.0] - * 1.6.14 16 10614 16.so.16.14[.0] - * 1.6.15beta01-08 16 10615 16.so.16.15[.0] - * 1.6.15rc01-03 16 10615 16.so.16.15[.0] - * 1.6.15 16 10615 16.so.16.15[.0] - * 1.6.16beta01-03 16 10616 16.so.16.16[.0] - * 1.6.16rc01-02 16 10616 16.so.16.16[.0] - * 1.6.16 16 10616 16.so.16.16[.0] + * ... + * 1.0.19 10 10019 10.so.0.19[.0] + * ... + * 1.2.53 13 10253 12.so.0.53[.0] + * ... + * 1.5.23 15 10523 15.so.15.23[.0] + * ... + * 1.6.20 16 10620 16.so.16.20[.0] * - * Henceforth the source version will match the shared-library major - * and minor numbers; the shared-library major version number will be - * used for changes in backward compatibility, as it is intended. The - * PNG_LIBPNG_VER macro, which is not used within libpng but is available - * for applications, is an unsigned integer of the form xyyzz corresponding - * to the source version x.y.z (leading zeros in y and z). Beta versions - * were given the previous public release number plus a letter, until - * version 1.0.6j; from then on they were given the upcoming public - * release number plus "betaNN" or "rcNN". + * Henceforth the source version will match the shared-library major + * and minor numbers; the shared-library major version number will be + * used for changes in backward compatibility, as it is intended. The + * PNG_LIBPNG_VER macro, which is not used within libpng but is available + * for applications, is an unsigned integer of the form xyyzz corresponding + * to the source version x.y.z (leading zeros in y and z). Beta versions + * were given the previous public release number plus a letter, until + * version 1.0.6j; from then on they were given the upcoming public + * release number plus "betaNN" or "rcNN". * - * Binary incompatibility exists only when applications make direct access - * to the info_ptr or png_ptr members through png.h, and the compiled - * application is loaded with a different version of the library. + * Binary incompatibility exists only when applications make direct access + * to the info_ptr or png_ptr members through png.h, and the compiled + * application is loaded with a different version of the library. * - * DLLNUM will change each time there are forward or backward changes - * in binary compatibility (e.g., when a new feature is added). + * DLLNUM will change each time there are forward or backward changes + * in binary compatibility (e.g., when a new feature is added). * - * See libpng-manual.txt or libpng.3 for more information. The PNG - * specification is available as a W3C Recommendation and as an ISO - * Specification, = 0x8000 /* else this might break */ #define PNG_INFO_IDAT 0x8000 /* ESR, 1.0.6 */ +#endif /* This is used for the transformation routines, as some of them * change these values for the row. It also should enable using @@ -1017,7 +883,9 @@ PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef); #define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */ /* Added to libpng-1.5.4 */ #define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */ +#if INT_MAX >= 0x8000 /* else this might break */ #define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */ +#endif /* Flags for MNG supported features */ #define PNG_FLAG_MNG_EMPTY_PLTE 0x01 @@ -1034,7 +902,7 @@ typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp, png_alloc_size_t)); typedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp)); -/* Section 3: exported functions +/* Section 4: exported functions * Here are the function definitions most commonly used. This is not * the place to find out how to use libpng. See libpng-manual.txt for the * full explanation, see example.c for the summary. This just provides @@ -1407,13 +1275,13 @@ PNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) -/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */ +/* Add a filler byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ PNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler, int flags)); /* The values of the PNG_FILLER_ defines should NOT be changed */ # define PNG_FILLER_BEFORE 0 # define PNG_FILLER_AFTER 1 -/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */ +/* Add an alpha byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ PNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr, png_uint_32 filler, int flags)); #endif /* READ_FILLER || WRITE_FILLER */ @@ -1606,6 +1474,7 @@ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action, #define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ #define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ +#ifdef PNG_WRITE_SUPPORTED /* These functions give the user control over the scan-line filtering in * libpng and the compression methods used by zlib. These functions are * mainly useful for testing, as the defaults should work with most users. @@ -1619,6 +1488,7 @@ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action, */ PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method, int filters)); +#endif /* WRITE */ /* Flags for png_set_filter() to say which filters to use. The flags * are chosen so that they don't conflict with real filter types @@ -1644,35 +1514,8 @@ PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method, #define PNG_FILTER_VALUE_PAETH 4 #define PNG_FILTER_VALUE_LAST 5 -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */ -/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_ - * defines, either the default (minimum-sum-of-absolute-differences), or - * the experimental method (weighted-minimum-sum-of-absolute-differences). - * - * Weights are factors >= 1.0, indicating how important it is to keep the - * filter type consistent between rows. Larger numbers mean the current - * filter is that many times as likely to be the same as the "num_weights" - * previous filters. This is cumulative for each previous row with a weight. - * There needs to be "num_weights" values in "filter_weights", or it can be - * NULL if the weights aren't being specified. Weights have no influence on - * the selection of the first row filter. Well chosen weights can (in theory) - * improve the compression for a given image. - * - * Costs are factors >= 1.0 indicating the relative decoding costs of a - * filter type. Higher costs indicate more decoding expense, and are - * therefore less likely to be selected over a filter with lower computational - * costs. There needs to be a value in "filter_costs" for each valid filter - * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't - * setting the costs. Costs try to improve the speed of decompression without - * unduly increasing the compressed image size. - * - * A negative weight or cost indicates the default value is to be used, and - * values in the range [0.0, 1.0) indicate the value is to remain unchanged. - * The default values for both weights and costs are currently 1.0, but may - * change if good general weighting/cost heuristics can be found. If both - * the weights and costs are set to 1.0, this degenerates the WEIGHTED method - * to the UNWEIGHTED method, but with added encoding time/computation. - */ +#ifdef PNG_WRITE_SUPPORTED +#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* DEPRECATED */ PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr, int heuristic_method, int num_weights, png_const_doublep filter_weights, png_const_doublep filter_costs)) @@ -1682,15 +1525,12 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed, png_const_fixed_point_p filter_costs)) #endif /* WRITE_WEIGHTED_FILTER */ -/* Heuristic used for row filter selection. These defines should NOT be - * changed. - */ +/* The following are no longer used and will be removed from libpng-1.7: */ #define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ #define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ #define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ #define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ -#ifdef PNG_WRITE_SUPPORTED /* Set the library compression level. Currently, valid values range from * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 * (0 - no compression, 9 - "maximal" compression). Note that tests have @@ -1698,6 +1538,7 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed, * for PNG images, and do considerably fewer caclulations. In the future, * these values may not correspond directly to the zlib compression levels. */ +#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED PNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr, int level)); @@ -1715,7 +1556,7 @@ PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr, PNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr, int method)); -#endif +#endif /* WRITE_CUSTOMIZE_COMPRESSION */ #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED /* Also set zlib parameters for compressing non-IDAT chunks */ @@ -1737,6 +1578,7 @@ PNG_EXPORT(225, void, png_set_text_compression_window_bits, PNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr, int method)); #endif /* WRITE_CUSTOMIZE_ZTXT_COMPRESSION */ +#endif /* WRITE */ /* These next functions are called for input/output, memory, and error * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, @@ -1847,7 +1689,7 @@ PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp)); * * The integer return from the callback function is interpreted thus: * - * negative: An error occured, png_chunk_error will be called. + * negative: An error occurred; png_chunk_error will be called. * zero: The chunk was not handled, the chunk will be saved. A critical * chunk will cause an error at this point unless it is to be saved. * positive: The chunk was handled, libpng will ignore/discard it. @@ -2692,26 +2534,28 @@ PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, * (png_uint_16)(alpha) \ + (png_uint_16)(bg)*(png_uint_16)(255 \ - (png_uint_16)(alpha)) + 128); \ - (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } + (composite) = (png_byte)(((temp + (temp >> 8)) >> 8) & 0xff); } # define png_composite_16(composite, fg, alpha, bg) \ { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ * (png_uint_32)(alpha) \ + (png_uint_32)(bg)*(65535 \ - (png_uint_32)(alpha)) + 32768); \ - (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } + (composite) = (png_uint_16)(0xffff & ((temp + (temp >> 16)) >> 16)); } #else /* Standard method using integer division */ -# define png_composite(composite, fg, alpha, bg) \ - (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ - (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ - 127) / 255) +# define png_composite(composite, fg, alpha, bg) \ + (composite) = \ + (png_byte)(0xff & (((png_uint_16)(fg) * (png_uint_16)(alpha) + \ + (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ + 127) / 255)) # define png_composite_16(composite, fg, alpha, bg) \ - (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ - (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ - 32767) / 65535) + (composite) = \ + (png_uint_16)(0xffff & (((png_uint_32)(fg) * (png_uint_32)(alpha) + \ + (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ + 32767) / 65535)) #endif /* READ_COMPOSITE_NODIV */ #ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED @@ -2762,7 +2606,7 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); # define PNG_get_int_32(buf) \ ((png_int_32)((*(buf) & 0x80) \ - ? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \ + ? -((png_int_32)(((png_get_uint_32(buf)^0xffffffffU)+1U)&0x7fffffffU)) \ : (png_int_32)png_get_uint_32(buf))) /* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h, @@ -2782,10 +2626,17 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); # endif #endif -#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) || \ - defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) +#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED +PNG_EXPORT(242, void, png_set_check_for_invalid_index, + (png_structrp png_ptr, int allowed)); +# ifdef PNG_GET_PALETTE_MAX_SUPPORTED +PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr, + png_const_infop info_ptr)); +# endif +#endif /* CHECK_FOR_INVALID_INDEX */ + /******************************************************************************* - * SIMPLIFIED API + * Section 5: SIMPLIFIED API ******************************************************************************* * * Please read the documentation in libpng-manual.txt (TODO: write said @@ -2801,8 +2652,9 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); * * To read a PNG file using the simplified API: * - * 1) Declare a 'png_image' structure (see below) on the stack and set the - * version field to PNG_IMAGE_VERSION. + * 1) Declare a 'png_image' structure (see below) on the stack, set the + * version field to PNG_IMAGE_VERSION and the 'opaque' pointer to NULL + * (this is REQUIRED, your program may crash if you don't do it.) * 2) Call the appropriate png_image_begin_read... function. * 3) Set the png_image 'format' member to the required sample format. * 4) Allocate a buffer for the image and, if required, the color-map. @@ -2829,6 +2681,9 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); * when it is being read or defines the in-memory format of an image that you * need to write: */ +#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) || \ + defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) + #define PNG_IMAGE_VERSION 1 typedef struct png_control *png_controlp; @@ -2928,7 +2783,7 @@ typedef struct * called to read or write the color-map and set the format correctly for the * image data. Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly! * - * NOTE: libpng can be built with particular features disabled, if you see + * NOTE: libpng can be built with particular features disabled. If you see * compiler errors because the definition of one of the following flags has been * compiled out it is because libpng does not have the required support. It is * possible, however, for the libpng configuration to enable the format on just @@ -2940,7 +2795,7 @@ typedef struct */ #define PNG_FORMAT_FLAG_ALPHA 0x01U /* format with an alpha channel */ #define PNG_FORMAT_FLAG_COLOR 0x02U /* color format: otherwise grayscale */ -#define PNG_FORMAT_FLAG_LINEAR 0x04U /* 2 byte channels else 1 byte */ +#define PNG_FORMAT_FLAG_LINEAR 0x04U /* 2-byte channels else 1-byte */ #define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */ #ifdef PNG_FORMAT_BGR_SUPPORTED @@ -3227,9 +3082,11 @@ PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file, * * With all APIs row_stride is handled as in the read APIs - it is the spacing * from one row to the next in component sized units (1 or 2 bytes) and if - * negative indicates a bottom-up row layout in the buffer. + * negative indicates a bottom-up row layout in the buffer. If row_stride is zero, + * libpng will calculate it for you from the image width and number of channels. * - * Note that the write API does not support interlacing or sub-8-bit pixels. + * Note that the write API does not support interlacing, sub-8-bit pixels, indexed + * PNG (color_type 3) or most ancillary chunks. */ #endif /* STDIO */ #endif /* SIMPLIFIED_WRITE */ @@ -3238,17 +3095,8 @@ PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file, ******************************************************************************/ #endif /* SIMPLIFIED_{READ|WRITE} */ -#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED -PNG_EXPORT(242, void, png_set_check_for_invalid_index, - (png_structrp png_ptr, int allowed)); -# ifdef PNG_GET_PALETTE_MAX_SUPPORTED -PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr, - png_const_infop info_ptr)); -# endif -#endif /* CHECK_FOR_INVALID_INDEX */ - /******************************************************************************* - * IMPLEMENTATION OPTIONS + * Section 6: IMPLEMENTATION OPTIONS ******************************************************************************* * * Support for arbitrary implementation-specific optimizations. The API allows diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngconf.h b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngconf.h index 2059235d374..482dcf7daef 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngconf.h +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngconf.h @@ -29,9 +29,9 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * libpng version 1.6.16,December 22, 2014 + * libpng version 1.6.20, December 3, 2015 * - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -39,9 +39,7 @@ * For conditions of distribution and use, see the disclaimer * and license in png.h * - */ - -/* Any machine specific code is near the front of this file, so if you + * Any machine specific code is near the front of this file, so if you * are configuring libpng for a machine, you may want to read the section * starting here down to where it starts to typedef png_color, png_text, * and png_info. @@ -50,26 +48,6 @@ #ifndef PNGCONF_H #define PNGCONF_H -/* To do: Do all of this in scripts/pnglibconf.dfa */ -#ifdef PNG_SAFE_LIMITS_SUPPORTED -# ifdef PNG_USER_WIDTH_MAX -# undef PNG_USER_WIDTH_MAX -# define PNG_USER_WIDTH_MAX 1000000L -# endif -# ifdef PNG_USER_HEIGHT_MAX -# undef PNG_USER_HEIGHT_MAX -# define PNG_USER_HEIGHT_MAX 1000000L -# endif -# ifdef PNG_USER_CHUNK_MALLOC_MAX -# undef PNG_USER_CHUNK_MALLOC_MAX -# define PNG_USER_CHUNK_MALLOC_MAX 4000000L -# endif -# ifdef PNG_USER_CHUNK_CACHE_MAX -# undef PNG_USER_CHUNK_CACHE_MAX -# define PNG_USER_CHUNK_CACHE_MAX 128 -# endif -#endif - #ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */ /* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C @@ -113,7 +91,7 @@ */ #define PNG_CONST const /* backward compatibility only */ -/* This controls optimization of the reading of 16 and 32 bit values +/* This controls optimization of the reading of 16-bit and 32-bit values * from PNG files. It can be set on a per-app-file basis - it * just changes whether a macro is used when the function is called. * The library builder sets the default; if read functions are not @@ -345,11 +323,11 @@ * table entries, so we discard it here. See the .dfn files in the * scripts directory. */ -#ifndef PNG_EXPORTA -# define PNG_EXPORTA(ordinal, type, name, args, attributes)\ - PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \ - extern attributes) +#ifndef PNG_EXPORTA +# define PNG_EXPORTA(ordinal, type, name, args, attributes) \ + PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), PNGARG(args), \ + PNG_LINKAGE_API attributes) #endif /* ANSI-C (C90) does not permit a macro to be invoked with an empty argument, @@ -357,7 +335,7 @@ */ #define PNG_EMPTY /*empty list*/ -#define PNG_EXPORT(ordinal, type, name, args)\ +#define PNG_EXPORT(ordinal, type, name, args) \ PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY) /* Use PNG_REMOVED to comment out a removed interface. */ @@ -530,7 +508,7 @@ #if CHAR_BIT == 8 && UCHAR_MAX == 255 typedef unsigned char png_byte; #else -# error "libpng requires 8 bit bytes" +# error "libpng requires 8-bit bytes" #endif #if INT_MIN == -32768 && INT_MAX == 32767 @@ -538,7 +516,7 @@ #elif SHRT_MIN == -32768 && SHRT_MAX == 32767 typedef short png_int_16; #else -# error "libpng requires a signed 16 bit type" +# error "libpng requires a signed 16-bit type" #endif #if UINT_MAX == 65535 @@ -546,7 +524,7 @@ #elif USHRT_MAX == 65535 typedef unsigned short png_uint_16; #else -# error "libpng requires an unsigned 16 bit type" +# error "libpng requires an unsigned 16-bit type" #endif #if INT_MIN < -2147483646 && INT_MAX > 2147483646 @@ -554,7 +532,7 @@ #elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646 typedef long int png_int_32; #else -# error "libpng requires a signed 32 bit (or more) type" +# error "libpng requires a signed 32-bit (or more) type" #endif #if UINT_MAX > 4294967294 @@ -562,7 +540,7 @@ #elif ULONG_MAX > 4294967294 typedef unsigned long int png_uint_32; #else -# error "libpng requires an unsigned 32 bit (or more) type" +# error "libpng requires an unsigned 32-bit (or more) type" #endif /* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however, diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngdebug.h b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngdebug.h index d4af91dcd5c..d30815032c7 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngdebug.h +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngdebug.h @@ -29,12 +29,11 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * + * Last changed in libpng 1.6.8 [December 19, 2013] * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * - * Last changed in libpng 1.6.8 [December 19, 2013] - * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngget.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngget.c index c87fc907797..a2c9d3a8a4c 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngget.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngget.c @@ -29,8 +29,8 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.17 [March 26, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -827,14 +827,20 @@ png_get_IHDR(png_const_structrp png_ptr, png_const_inforp info_ptr, { png_debug1(1, "in %s retrieval function", "IHDR"); - if (png_ptr == NULL || info_ptr == NULL || width == NULL || - height == NULL || bit_depth == NULL || color_type == NULL) + if (png_ptr == NULL || info_ptr == NULL) return (0); - *width = info_ptr->width; - *height = info_ptr->height; - *bit_depth = info_ptr->bit_depth; - *color_type = info_ptr->color_type; + if (width != NULL) + *width = info_ptr->width; + + if (height != NULL) + *height = info_ptr->height; + + if (bit_depth != NULL) + *bit_depth = info_ptr->bit_depth; + + if (color_type != NULL) + *color_type = info_ptr->color_type; if (compression_type != NULL) *compression_type = info_ptr->compression_type; @@ -1163,21 +1169,21 @@ png_get_compression_buffer_size(png_const_structrp png_ptr) if (png_ptr == NULL) return 0; -# ifdef PNG_WRITE_SUPPORTED +#ifdef PNG_WRITE_SUPPORTED if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0) -# endif +#endif { -# ifdef PNG_SEQUENTIAL_READ_SUPPORTED +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED return png_ptr->IDAT_read_size; -# else +#else return PNG_IDAT_READ_SIZE; -# endif +#endif } -# ifdef PNG_WRITE_SUPPORTED +#ifdef PNG_WRITE_SUPPORTED else return png_ptr->zbuffer_size; -# endif +#endif } #ifdef PNG_SET_USER_LIMITS_SUPPORTED diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pnginfo.h b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pnginfo.h index 0b885a5ee7b..ff350824430 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pnginfo.h +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pnginfo.h @@ -29,12 +29,11 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * + * Last changed in libpng 1.6.1 [March 28, 2013] * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * - * Last changed in libpng 1.6.1 [March 28, 2013] - * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pnglibconf.h b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pnglibconf.h index f5fdbae317c..bcb167e7aa7 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pnglibconf.h +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pnglibconf.h @@ -34,7 +34,7 @@ * file and, per its terms, should not be removed: */ -/* libpng version 1.6.16,December 22, 2014 */ +/* libpng version 1.6.20, December 3, 2015 */ /* Copyright (c) 1998-2014 Glenn Randers-Pehrson */ @@ -129,13 +129,10 @@ #define PNG_READ_tIME_SUPPORTED #define PNG_READ_tRNS_SUPPORTED #define PNG_READ_zTXt_SUPPORTED -/*#undef PNG_SAFE_LIMITS_SUPPORTED*/ /*#undef PNG_SAVE_INT_32_SUPPORTED*/ #define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_SEQUENTIAL_READ_SUPPORTED #define PNG_SETJMP_SUPPORTED -#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED -#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED #define PNG_SET_OPTION_SUPPORTED #define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED #define PNG_SET_USER_LIMITS_SUPPORTED @@ -161,6 +158,7 @@ /*#undef PNG_WRITE_BGR_SUPPORTED*/ /*#undef PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED*/ /*#undef PNG_WRITE_COMPRESSED_TEXT_SUPPORTED*/ +/*#undef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED*/ /*#undef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED*/ /*#undef PNG_WRITE_FILLER_SUPPORTED*/ /*#undef PNG_WRITE_FILTER_SUPPORTED*/ @@ -219,11 +217,14 @@ /* end of options */ /* settings */ #define PNG_API_RULE 0 -#define PNG_COST_SHIFT 3 #define PNG_DEFAULT_READ_MACROS 1 #define PNG_GAMMA_THRESHOLD_FIXED 5000 #define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE #define PNG_INFLATE_BUF_SIZE 1024 +#define PNG_LINKAGE_API extern +#define PNG_LINKAGE_CALLBACK extern +#define PNG_LINKAGE_DATA extern +#define PNG_LINKAGE_FUNCTION extern #define PNG_MAX_GAMMA_8 11 #define PNG_QUANTIZE_BLUE_BITS 5 #define PNG_QUANTIZE_GREEN_BITS 5 @@ -234,7 +235,6 @@ #define PNG_USER_CHUNK_MALLOC_MAX 0 #define PNG_USER_HEIGHT_MAX 1000000 #define PNG_USER_WIDTH_MAX 1000000 -#define PNG_WEIGHT_SHIFT 8 #define PNG_ZBUF_SIZE 8192 #define PNG_ZLIB_VERNUM 0 #define PNG_Z_DEFAULT_COMPRESSION (-1) diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngmem.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngmem.c index c24098ffb73..71c6956b79f 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngmem.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngmem.c @@ -69,7 +69,7 @@ png_destroy_png_struct(png_structrp png_ptr) } /* Allocate memory. For reasonable files, size should never exceed - * 64K. However, zlib may allocate more then 64K if you don't tell + * 64K. However, zlib may allocate more than 64K if you don't tell * it not to. See zconf.h and png.h for more information. zlib does * need to allocate exactly 64K, so whatever you call here must * have the ability to do that. @@ -105,6 +105,9 @@ png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size), PNG_UNUSED(png_ptr) #endif + /* Some compilers complain that this is always true. However, it + * can be false when integer overflow happens. + */ if (size > 0 && size <= PNG_SIZE_MAX # ifdef PNG_MAX_MALLOC_64K && size <= 65536U diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngpread.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngpread.c index a0a92bb7faf..e17c993a2ff 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngpread.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngpread.c @@ -29,8 +29,8 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.18 [July 23, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -47,7 +47,6 @@ #define PNG_READ_SIG_MODE 0 #define PNG_READ_CHUNK_MODE 1 #define PNG_READ_IDAT_MODE 2 -#define PNG_SKIP_MODE 3 #define PNG_READ_tEXt_MODE 4 #define PNG_READ_zTXt_MODE 5 #define PNG_READ_DONE_MODE 6 @@ -106,32 +105,14 @@ png_process_data_pause(png_structrp png_ptr, int save) png_uint_32 PNGAPI png_process_data_skip(png_structrp png_ptr) { - png_uint_32 remaining = 0; - - if (png_ptr != NULL && png_ptr->process_mode == PNG_SKIP_MODE && - png_ptr->skip_length > 0) - { - /* At the end of png_process_data the buffer size must be 0 (see the loop - * above) so we can detect a broken call here: - */ - if (png_ptr->buffer_size != 0) - png_error(png_ptr, - "png_process_data_skip called inside png_process_data"); - - /* If is impossible for there to be a saved buffer at this point - - * otherwise we could not be in SKIP mode. This will also happen if - * png_process_skip is called inside png_process_data (but only very - * rarely.) - */ - if (png_ptr->save_buffer_size != 0) - png_error(png_ptr, "png_process_data_skip called with saved data"); - - remaining = png_ptr->skip_length; - png_ptr->skip_length = 0; - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - } - - return remaining; + /* TODO: Deprecate and remove this API. + * Somewhere the implementation of this seems to have been lost, + * or abandoned. It was only to support some internal back-door access + * to png_struct) in libpng-1.4.x. + */ + png_app_warning(png_ptr, +"png_process_data_skip is not implemented in any current version of libpng"); + return 0; } /* What we do with the incoming data depends on what we were previously @@ -163,12 +144,6 @@ png_process_some_data(png_structrp png_ptr, png_inforp info_ptr) break; } - case PNG_SKIP_MODE: - { - png_push_crc_finish(png_ptr); - break; - } - default: { png_ptr->buffer_size = 0; @@ -187,7 +162,7 @@ void /* PRIVATE */ png_push_read_sig(png_structrp png_ptr, png_inforp info_ptr) { png_size_t num_checked = png_ptr->sig_bytes, /* SAFE, does not exceed 8 */ - num_to_check = 8 - num_checked; + num_to_check = 8 - num_checked; if (png_ptr->buffer_size < num_to_check) { @@ -467,69 +442,6 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; } -void /* PRIVATE */ -png_push_crc_skip(png_structrp png_ptr, png_uint_32 skip) -{ - png_ptr->process_mode = PNG_SKIP_MODE; - png_ptr->skip_length = skip; -} - -void /* PRIVATE */ -png_push_crc_finish(png_structrp png_ptr) -{ - if (png_ptr->skip_length != 0 && png_ptr->save_buffer_size != 0) - { - png_size_t save_size = png_ptr->save_buffer_size; - png_uint_32 skip_length = png_ptr->skip_length; - - /* We want the smaller of 'skip_length' and 'save_buffer_size', but - * they are of different types and we don't know which variable has the - * fewest bits. Carefully select the smaller and cast it to the type of - * the larger - this cannot overflow. Do not cast in the following test - * - it will break on either 16 or 64 bit platforms. - */ - if (skip_length < save_size) - save_size = (png_size_t)skip_length; - - else - skip_length = (png_uint_32)save_size; - - png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size); - - png_ptr->skip_length -= skip_length; - png_ptr->buffer_size -= save_size; - png_ptr->save_buffer_size -= save_size; - png_ptr->save_buffer_ptr += save_size; - } - if (png_ptr->skip_length != 0 && png_ptr->current_buffer_size != 0) - { - png_size_t save_size = png_ptr->current_buffer_size; - png_uint_32 skip_length = png_ptr->skip_length; - - /* We want the smaller of 'skip_length' and 'current_buffer_size', here, - * the same problem exists as above and the same solution. - */ - if (skip_length < save_size) - save_size = (png_size_t)skip_length; - - else - skip_length = (png_uint_32)save_size; - - png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size); - - png_ptr->skip_length -= skip_length; - png_ptr->buffer_size -= save_size; - png_ptr->current_buffer_size -= save_size; - png_ptr->current_buffer_ptr += save_size; - } - if (png_ptr->skip_length == 0) - { - PNG_PUSH_SAVE_BUFFER_IF_LT(4) - png_crc_finish(png_ptr, 0); - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - } -} - void PNGCBAPI png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length) { @@ -612,13 +524,11 @@ png_push_save_buffer(png_structrp png_ptr) if (png_ptr->save_buffer == NULL) { png_free(png_ptr, old_buffer); - old_buffer = NULL; png_error(png_ptr, "Insufficient memory for save_buffer"); } memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size); png_free(png_ptr, old_buffer); - old_buffer = NULL; png_ptr->save_buffer_max = new_max; } if (png_ptr->current_buffer_size) @@ -681,7 +591,7 @@ png_push_read_IDAT(png_structrp png_ptr) * are of different types and we don't know which variable has the fewest * bits. Carefully select the smaller and cast it to the type of the * larger - this cannot overflow. Do not cast in the following test - it - * will break on either 16 or 64 bit platforms. + * will break on either 16-bit or 64-bit platforms. */ if (idat_size < save_size) save_size = (png_size_t)idat_size; @@ -724,6 +634,7 @@ png_push_read_IDAT(png_structrp png_ptr) png_ptr->current_buffer_size -= save_size; png_ptr->current_buffer_ptr += save_size; } + if (png_ptr->idat_size == 0) { PNG_PUSH_SAVE_BUFFER_IF_LT(4) @@ -754,7 +665,7 @@ png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer, * or the stream marked as finished. */ while (png_ptr->zstream.avail_in > 0 && - !(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED)) + (png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0) { int ret; @@ -779,7 +690,7 @@ png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer, * change the current behavior (see comments in inflate.c * for why this doesn't happen at present with zlib 1.2.5). */ - ret = inflate(&png_ptr->zstream, Z_SYNC_FLUSH); + ret = PNG_INFLATE(png_ptr, Z_SYNC_FLUSH); /* Check for any failure before proceeding. */ if (ret != Z_OK && ret != Z_STREAM_END) @@ -1064,6 +975,7 @@ png_push_process_row(png_structrp png_ptr) } } else +#endif { png_push_have_row(png_ptr, png_ptr->row_buf + 1); png_read_push_finish_row(png_ptr); @@ -1073,6 +985,7 @@ png_push_process_row(png_structrp png_ptr) void /* PRIVATE */ png_read_push_finish_row(png_structrp png_ptr) { +#ifdef PNG_READ_INTERLACING_SUPPORTED /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ @@ -1097,6 +1010,7 @@ png_read_push_finish_row(png_structrp png_ptr) if (png_ptr->row_number < png_ptr->num_rows) return; +#ifdef PNG_READ_INTERLACING_SUPPORTED if (png_ptr->interlaced != 0) { png_ptr->row_number = 0; @@ -1131,6 +1045,7 @@ png_read_push_finish_row(png_structrp png_ptr) } while (png_ptr->iwidth == 0 || png_ptr->num_rows == 0); } +#endif /* READ_INTERLACING */ } void /* PRIVATE */ @@ -1155,6 +1070,7 @@ png_push_have_row(png_structrp png_ptr, png_bytep row) (int)png_ptr->pass); } +#ifdef PNG_READ_INTERLACING_SUPPORTED void PNGAPI png_progressive_combine_row(png_const_structrp png_ptr, png_bytep old_row, png_const_bytep new_row) @@ -1169,6 +1085,7 @@ png_progressive_combine_row(png_const_structrp png_ptr, png_bytep old_row, if (new_row != NULL) png_combine_row(png_ptr, old_row, 1/*blocky display*/); } +#endif /* READ_INTERLACING */ void PNGAPI png_set_progressive_read_fn(png_structrp png_ptr, png_voidp progressive_ptr, diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngpriv.h b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngpriv.h index 8f79edf59a7..f5c1532af51 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngpriv.h +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngpriv.h @@ -29,13 +29,11 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.18 [July 23, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * - * Last changed in libpng 1.6.10 [March 6, 1014]] - * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h @@ -148,8 +146,12 @@ * to compile with an appropriate #error if ALIGNED_MEMORY has been turned * off. * - * Note that gcc-4.9 defines __ARM_NEON instead of __ARM_NEON__, so we - * check both variants. + * Note that gcc-4.9 defines __ARM_NEON instead of the deprecated + * __ARM_NEON__, so we check both variants. + * + * To disable ARM_NEON optimizations entirely, and skip compiling the + * associated assembler code, pass --enable-arm-neon=no to configure + * or put -DPNG_ARM_NEON_OPT=0 in CPPFLAGS. */ # if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && \ defined(PNG_ALIGNED_MEMORY_SUPPORTED) @@ -278,17 +280,18 @@ * always be used to declare an extern data or function object in this file. */ #ifndef PNG_INTERNAL_DATA -# define PNG_INTERNAL_DATA(type, name, array) extern type name array +# define PNG_INTERNAL_DATA(type, name, array) PNG_LINKAGE_DATA type name array #endif #ifndef PNG_INTERNAL_FUNCTION # define PNG_INTERNAL_FUNCTION(type, name, args, attributes)\ - extern PNG_FUNCTION(type, name, args, PNG_EMPTY attributes) + PNG_LINKAGE_FUNCTION PNG_FUNCTION(type, name, args, PNG_EMPTY attributes) #endif #ifndef PNG_INTERNAL_CALLBACK # define PNG_INTERNAL_CALLBACK(type, name, args, attributes)\ - extern PNG_FUNCTION(type, (PNGCBAPI name), args, PNG_EMPTY attributes) + PNG_LINKAGE_CALLBACK PNG_FUNCTION(type, (PNGCBAPI name), args,\ + PNG_EMPTY attributes) #endif /* If floating or fixed point APIs are disabled they may still be compiled @@ -326,48 +329,27 @@ # define PNG_DLL_EXPORT #endif -/* SECURITY and SAFETY: +/* This is a global switch to set the compilation for an installed system + * (a release build). It can be set for testing debug builds to ensure that + * they will compile when the build type is switched to RC or STABLE, the + * default is just to use PNG_LIBPNG_BUILD_BASE_TYPE. Set this in CPPFLAGS + * with either: * - * By default libpng is built without any internal limits on image size, - * individual heap (png_malloc) allocations or the total amount of memory used. - * If PNG_SAFE_LIMITS_SUPPORTED is defined, however, the limits below are used - * (unless individually overridden). These limits are believed to be fairly - * safe, but builders of secure systems should verify the values against the - * real system capabilities. + * -DPNG_RELEASE_BUILD Turns on the release compile path + * -DPNG_RELEASE_BUILD=0 Turns it off + * or in your pngusr.h with + * #define PNG_RELEASE_BUILD=1 Turns on the release compile path + * #define PNG_RELEASE_BUILD=0 Turns it off */ -#ifdef PNG_SAFE_LIMITS_SUPPORTED - /* 'safe' limits */ -# ifndef PNG_USER_WIDTH_MAX -# define PNG_USER_WIDTH_MAX 1000000 -# endif -# ifndef PNG_USER_HEIGHT_MAX -# define PNG_USER_HEIGHT_MAX 1000000 -# endif -# ifndef PNG_USER_CHUNK_CACHE_MAX -# define PNG_USER_CHUNK_CACHE_MAX 128 -# endif -# ifndef PNG_USER_CHUNK_MALLOC_MAX -# define PNG_USER_CHUNK_MALLOC_MAX 8000000 -# endif -#else - /* values for no limits */ -# ifndef PNG_USER_WIDTH_MAX -# define PNG_USER_WIDTH_MAX 0x7fffffff -# endif -# ifndef PNG_USER_HEIGHT_MAX -# define PNG_USER_HEIGHT_MAX 0x7fffffff -# endif -# ifndef PNG_USER_CHUNK_CACHE_MAX -# define PNG_USER_CHUNK_CACHE_MAX 0 -# endif -# ifndef PNG_USER_CHUNK_MALLOC_MAX -# define PNG_USER_CHUNK_MALLOC_MAX 0 -# endif +#ifndef PNG_RELEASE_BUILD +# define PNG_RELEASE_BUILD (PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC) #endif -/* Moved to pngpriv.h at libpng-1.5.0 */ -/* NOTE: some of these may have been used in external applications as - * these definitions were exposed in pngconf.h prior to 1.5. +/* SECURITY and SAFETY: + * + * libpng is built with support for internal limits on image dimensions and + * memory usage. These are documented in scripts/pnglibconf.dfa of the + * source and recorded in the machine generated header file pnglibconf.h. */ /* If you are running on a machine where you cannot allocate more @@ -610,21 +592,17 @@ #define PNG_RGB_TO_GRAY_WARN 0x400000 #define PNG_RGB_TO_GRAY 0x600000 /* two bits, RGB_TO_GRAY_ERR|WARN */ #define PNG_ENCODE_ALPHA 0x800000 /* Added to libpng-1.5.4 */ -#define PNG_ADD_ALPHA 0x1000000 /* Added to libpng-1.2.7 */ -#define PNG_EXPAND_tRNS 0x2000000 /* Added to libpng-1.2.9 */ -#define PNG_SCALE_16_TO_8 0x4000000 /* Added to libpng-1.5.4 */ - /* 0x8000000 unused */ - /* 0x10000000 unused */ - /* 0x20000000 unused */ - /* 0x40000000 unused */ +#define PNG_ADD_ALPHA 0x1000000 /* Added to libpng-1.2.7 */ +#define PNG_EXPAND_tRNS 0x2000000 /* Added to libpng-1.2.9 */ +#define PNG_SCALE_16_TO_8 0x4000000 /* Added to libpng-1.5.4 */ + /* 0x8000000 unused */ + /* 0x10000000 unused */ + /* 0x20000000 unused */ + /* 0x40000000 unused */ /* Flags for png_create_struct */ #define PNG_STRUCT_PNG 0x0001 #define PNG_STRUCT_INFO 0x0002 -/* Scaling factor for filter heuristic weighting calculations */ -#define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT)) -#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) - /* Flags for the png_ptr->flags rather than declaring a byte for each one */ #define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 #define PNG_FLAG_ZSTREAM_INITIALIZED 0x0002 /* Added to libpng-1.6.0 */ @@ -715,7 +693,7 @@ /* The fixed point conversion performs range checking and evaluates * its argument multiple times, so must be used with care. The * range checking uses the PNG specification values for a signed - * 32 bit fixed point value except that the values are deliberately + * 32-bit fixed point value except that the values are deliberately * rounded-to-zero to an integral value - 21474 (21474.83 is roughly * (2^31-1) * 100000). 's' is a string that describes the value being * converted. @@ -808,15 +786,17 @@ * macro will fail on top-bit-set values because of the sign extension. */ #define PNG_CHUNK_FROM_STRING(s)\ - PNG_U32(0xff&(s)[0], 0xff&(s)[1], 0xff&(s)[2], 0xff&(s)[3]) + PNG_U32(0xff & (s)[0], 0xff & (s)[1], 0xff & (s)[2], 0xff & (s)[3]) /* This uses (char), not (png_byte) to avoid warnings on systems where (char) is * signed and the argument is a (char[]) This macro will fail miserably on * systems where (char) is more than 8 bits. */ #define PNG_STRING_FROM_CHUNK(s,c)\ - (void)(((char*)(s))[0]=(char)((c)>>24), ((char*)(s))[1]=(char)((c)>>16),\ - ((char*)(s))[2]=(char)((c)>>8), ((char*)(s))[3]=(char)((c))) + (void)(((char*)(s))[0]=(char)(((c)>>24) & 0xff), \ + ((char*)(s))[1]=(char)(((c)>>16) & 0xff),\ + ((char*)(s))[2]=(char)(((c)>>8) & 0xff), \ + ((char*)(s))[3]=(char)((c & 0xff))) /* Do the same but terminate with a null character. */ #define PNG_CSTRING_FROM_CHUNK(s,c)\ @@ -860,7 +840,7 @@ */ #endif -/* This is used for 16 bit gamma tables -- only the top level pointers are +/* This is used for 16-bit gamma tables -- only the top level pointers are * const; this could be changed: */ typedef const png_uint_16p * png_const_uint_16pp; @@ -878,8 +858,9 @@ PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_table, [256]); PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_base, [512]); PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]); -#define PNG_sRGB_FROM_LINEAR(linear) ((png_byte)((png_sRGB_base[(linear)>>15] +\ - ((((linear)&0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8)) +#define PNG_sRGB_FROM_LINEAR(linear) \ + ((png_byte)(0xff & ((png_sRGB_base[(linear)>>15] \ + + ((((linear) & 0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8))) /* Given a value 'linear' in the range 0..255*65535 calculate the 8-bit sRGB * encoded value with maximum error 0.646365. Note that the input is not a * 16-bit value; it has been multiplied by 255! */ @@ -1262,6 +1243,14 @@ PNG_INTERNAL_FUNCTION(void,png_read_finish_row,(png_structrp png_ptr), /* Initialize the row buffers, etc. */ PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY); +#if PNG_ZLIB_VERNUM >= 0x1240 +PNG_INTERNAL_FUNCTION(int,png_zlib_inflate,(png_structrp png_ptr, int flush), + PNG_EMPTY); +# define PNG_INFLATE(pp, flush) png_zlib_inflate(pp, flush) +#else /* Zlib < 1.2.4 */ +# define PNG_INFLATE(pp, flush) inflate(&(pp)->zstream, flush) +#endif /* Zlib < 1.2.4 */ + #ifdef PNG_READ_TRANSFORMS_SUPPORTED /* Optional call to update the users info structure */ PNG_INTERNAL_FUNCTION(void,png_read_transform_info,(png_structrp png_ptr, @@ -1436,10 +1425,6 @@ PNG_INTERNAL_FUNCTION(void,png_push_read_chunk,(png_structrp png_ptr, PNG_INTERNAL_FUNCTION(void,png_push_read_sig,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_check_crc,(png_structrp png_ptr),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_crc_skip,(png_structrp png_ptr, - png_uint_32 length),PNG_EMPTY); -PNG_INTERNAL_FUNCTION(void,png_push_crc_finish,(png_structrp png_ptr), - PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_save_buffer,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_restore_buffer,(png_structrp png_ptr, diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngread.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngread.c index 71d5f9269aa..69d5be24367 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngread.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngread.c @@ -29,8 +29,8 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.17 [March 26, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -91,7 +91,7 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr, /* In stable builds only warn if an application error can be completely * handled. */ -# if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC +# if PNG_RELEASE_BUILD png_ptr->flags |= PNG_FLAG_APP_WARNINGS_WARN; # endif # endif @@ -842,8 +842,7 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr) /* Zero length IDATs are legal after the last IDAT has been * read, but not after other chunks have been read. */ - if ((length > 0) || - (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) != 0) + if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) != 0) png_benign_error(png_ptr, "Too many IDATs found"); png_crc_finish(png_ptr, length); @@ -1072,9 +1071,9 @@ png_read_png(png_structrp png_ptr, png_inforp info_ptr, /* Tell libpng to strip 16-bit/color files down to 8 bits per color. */ if ((transforms & PNG_TRANSFORM_SCALE_16) != 0) - /* Added at libpng-1.5.4. "strip_16" produces the same result that it - * did in earlier versions, while "scale_16" is now more accurate. - */ + /* Added at libpng-1.5.4. "strip_16" produces the same result that it + * did in earlier versions, while "scale_16" is now more accurate. + */ #ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED png_set_scale_16(png_ptr); #else @@ -1238,7 +1237,7 @@ png_read_png(png_structrp png_ptr, png_inforp info_ptr, for (iptr = 0; iptr < info_ptr->height; iptr++) info_ptr->row_pointers[iptr] = png_voidcast(png_bytep, - png_malloc(png_ptr, info_ptr->rowbytes)); + png_malloc(png_ptr, info_ptr->rowbytes)); } png_read_image(png_ptr, info_ptr->row_pointers); @@ -1712,10 +1711,11 @@ decode_gamma(png_image_read_control *display, png_uint_32 value, int encoding) value *= 257; break; +#ifdef __GNUC__ default: png_error(display->image->opaque->png_ptr, "unexpected encoding (internal error)"); - break; +#endif } return value; @@ -1852,6 +1852,7 @@ png_create_colormap_entry(png_image_read_control *display, y = (y + 128) >> 8; y *= 255; y = PNG_sRGB_FROM_LINEAR((y + 64) >> 7); + alpha = PNG_DIV257(alpha); encoding = P_sRGB; } @@ -2314,8 +2315,14 @@ png_image_read_colormap(png_voidp argument) output_processing = PNG_CMAP_NONE; break; } - +#ifdef __COVERITY__ + /* Coverity claims that output_encoding cannot be 2 (P_LINEAR) + * here. + */ + back_alpha = 255; +#else back_alpha = output_encoding == P_LINEAR ? 65535 : 255; +#endif } /* output_processing means that the libpng-processed row will be @@ -2440,7 +2447,14 @@ png_image_read_colormap(png_voidp argument) */ background_index = i; png_create_colormap_entry(display, i++, back_r, back_g, back_b, - output_encoding == P_LINEAR ? 65535U : 255U, output_encoding); +#ifdef __COVERITY__ + /* Coverity claims that output_encoding cannot be 2 (P_LINEAR) + * here. + */ 255U, +#else + output_encoding == P_LINEAR ? 65535U : 255U, +#endif + output_encoding); /* For non-opaque input composite on the sRGB background - this * requires inverting the encoding for each component. The input @@ -2852,7 +2866,6 @@ png_image_read_colormap(png_voidp argument) default: png_error(png_ptr, "invalid PNG color type"); /*NOT REACHED*/ - break; } /* Now deal with the output processing */ @@ -2862,10 +2875,6 @@ png_image_read_colormap(png_voidp argument) switch (data_encoding) { - default: - png_error(png_ptr, "bad data option (internal error)"); - break; - case P_sRGB: /* Change to 8-bit sRGB */ png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, PNG_GAMMA_sRGB); @@ -2875,6 +2884,11 @@ png_image_read_colormap(png_voidp argument) if (png_ptr->bit_depth > 8) png_set_scale_16(png_ptr); break; + +#ifdef __GNUC__ + default: + png_error(png_ptr, "bad data option (internal error)"); +#endif } if (cmap_entries > 256 || cmap_entries > image->colormap_entries) @@ -3274,7 +3288,7 @@ png_image_read_composite(png_voidp argument) png_uint_32 width = image->width; ptrdiff_t step_row = display->row_bytes; unsigned int channels = - (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? 3 : 1; + (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? 3 : 1; int pass; for (pass = 0; pass < passes; ++pass) @@ -3425,10 +3439,6 @@ png_image_read_background(png_voidp argument) */ switch (info_ptr->bit_depth) { - default: - png_error(png_ptr, "unexpected bit depth"); - break; - case 8: /* 8-bit sRGB gray values with an alpha channel; the alpha channel is * to be removed by composing on a background: either the row if @@ -3646,6 +3656,11 @@ png_image_read_background(png_voidp argument) } } break; + +#ifdef __GNUC__ + default: + png_error(png_ptr, "unexpected bit depth"); +#endif } return 1; diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngrio.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngrio.c index debf6458ae1..b72cafd328a 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngrio.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngrio.c @@ -29,8 +29,8 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.17 [March 26, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -54,7 +54,7 @@ * reads from a file pointer. Note that this routine sometimes gets called * with very small lengths, so you should implement some kind of simple * buffering if you are using unbuffered reads. This should never be asked - * to read more then 64K on a 16 bit machine. + * to read more than 64K on a 16-bit machine. */ void /* PRIVATE */ png_read_data(png_structrp png_ptr, png_bytep data, png_size_t length) diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngrtran.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngrtran.c index dc38d78d14d..b6b731d0176 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngrtran.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngrtran.c @@ -29,8 +29,8 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.19 [November 12, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -422,7 +422,7 @@ png_set_alpha_mode(png_structrp png_ptr, int mode, double output_gamma) /* Dither file to 8-bit. Supply a palette, the current number * of elements in the palette, the maximum number of elements * allowed, and a histogram if possible. If the current number - * of colors is greater then the maximum number, the palette will be + * of colors is greater than the maximum number, the palette will be * modified to fit in the maximum number. "full_quantize" indicates * whether we need a quantizing cube set up for RGB images, or if we * simply are reducing the number of colors in a paletted image. @@ -1004,7 +1004,6 @@ png_set_rgb_to_gray_fixed(png_structrp png_ptr, int error_action, default: png_error(png_ptr, "invalid error action to rgb_to_gray"); - break; } if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) @@ -2025,7 +2024,7 @@ png_read_transform_info(png_structrp png_ptr, png_inforp info_ptr) # endif # else - /* No 16 bit support: force chopping 16-bit input down to 8, in this case + /* No 16-bit support: force chopping 16-bit input down to 8, in this case * the app program can chose if both APIs are available by setting the * correct scaling to use. */ @@ -2126,10 +2125,10 @@ png_read_transform_info(png_structrp png_ptr, png_inforp info_ptr) defined(PNG_READ_USER_TRANSFORM_SUPPORTED) if ((png_ptr->transformations & PNG_USER_TRANSFORM) != 0) { - if (info_ptr->bit_depth < png_ptr->user_transform_depth) + if (png_ptr->user_transform_depth != 0) info_ptr->bit_depth = png_ptr->user_transform_depth; - if (info_ptr->channels < png_ptr->user_transform_channels) + if (png_ptr->user_transform_channels != 0) info_ptr->channels = png_ptr->user_transform_channels; } #endif @@ -2385,7 +2384,7 @@ png_do_unshift(png_row_infop row_info, png_bytep row, if (++channel >= channels) channel = 0; *bp++ = (png_byte)(value >> 8); - *bp++ = (png_byte)(value & 0xff); + *bp++ = (png_byte)value; } break; } @@ -2410,8 +2409,8 @@ png_do_scale_16_to_8(png_row_infop row_info, png_bytep row) while (sp < ep) { - /* The input is an array of 16 bit components, these must be scaled to - * 8 bits each. For a 16 bit value V the required value (from the PNG + /* The input is an array of 16-bit components, these must be scaled to + * 8 bits each. For a 16-bit value V the required value (from the PNG * specification) is: * * (V * 255) / 65535 @@ -2432,7 +2431,7 @@ png_do_scale_16_to_8(png_row_infop row_info, png_bytep row) * * The approximate differs from the exact answer only when (vlo-vhi) is * 128; it then gives a correction of +1 when the exact correction is - * 0. This gives 128 errors. The exact answer (correct for all 16 bit + * 0. This gives 128 errors. The exact answer (correct for all 16-bit * input values) is: * * error = (vlo-vhi+128)*65535 >> 24; @@ -2690,9 +2689,9 @@ png_do_read_filler(png_row_infop row_info, png_bytep row, png_uint_32 row_width = row_info->width; #ifdef PNG_READ_16BIT_SUPPORTED - png_byte hi_filler = (png_byte)((filler>>8) & 0xff); + png_byte hi_filler = (png_byte)(filler>>8); #endif - png_byte lo_filler = (png_byte)(filler & 0xff); + png_byte lo_filler = (png_byte)filler; png_debug(1, "in png_do_read_filler"); @@ -2743,13 +2742,13 @@ png_do_read_filler(png_row_infop row_info, png_bytep row, png_bytep dp = sp + (png_size_t)row_width * 2; for (i = 1; i < row_width; i++) { - *(--dp) = hi_filler; *(--dp) = lo_filler; + *(--dp) = hi_filler; *(--dp) = *(--sp); *(--dp) = *(--sp); } - *(--dp) = hi_filler; *(--dp) = lo_filler; + *(--dp) = hi_filler; row_info->channels = 2; row_info->pixel_depth = 32; row_info->rowbytes = row_width * 4; @@ -2764,8 +2763,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row, { *(--dp) = *(--sp); *(--dp) = *(--sp); - *(--dp) = hi_filler; *(--dp) = lo_filler; + *(--dp) = hi_filler; } row_info->channels = 2; row_info->pixel_depth = 32; @@ -2824,8 +2823,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row, png_bytep dp = sp + (png_size_t)row_width * 2; for (i = 1; i < row_width; i++) { - *(--dp) = hi_filler; *(--dp) = lo_filler; + *(--dp) = hi_filler; *(--dp) = *(--sp); *(--dp) = *(--sp); *(--dp) = *(--sp); @@ -2833,8 +2832,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row, *(--dp) = *(--sp); *(--dp) = *(--sp); } - *(--dp) = hi_filler; *(--dp) = lo_filler; + *(--dp) = hi_filler; row_info->channels = 4; row_info->pixel_depth = 64; row_info->rowbytes = row_width * 8; @@ -2853,8 +2852,8 @@ png_do_read_filler(png_row_infop row_info, png_bytep row, *(--dp) = *(--sp); *(--dp) = *(--sp); *(--dp) = *(--sp); - *(--dp) = hi_filler; *(--dp) = lo_filler; + *(--dp) = hi_filler; } row_info->channels = 4; @@ -3115,10 +3114,11 @@ png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row) for (i = 0; i < row_width; i++) { png_uint_16 red, green, blue, w; + png_byte hi,lo; - red = (png_uint_16)(((*(sp)) << 8) | *(sp + 1)); sp += 2; - green = (png_uint_16)(((*(sp)) << 8) | *(sp + 1)); sp += 2; - blue = (png_uint_16)(((*(sp)) << 8) | *(sp + 1)); sp += 2; + hi=*(sp)++; lo=*(sp)++; red = (png_uint_16)((hi << 8) | (lo)); + hi=*(sp)++; lo=*(sp)++; green = (png_uint_16)((hi << 8) | (lo)); + hi=*(sp)++; lo=*(sp)++; blue = (png_uint_16)((hi << 8) | (lo)); if (red == green && red == blue) { @@ -3132,16 +3132,16 @@ png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row) else { - png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) + png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red & 0xff) >> png_ptr->gamma_shift][red>>8]; png_uint_16 green_1 = - png_ptr->gamma_16_to_1[(green&0xff) >> + png_ptr->gamma_16_to_1[(green & 0xff) >> png_ptr->gamma_shift][green>>8]; - png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) + png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue & 0xff) >> png_ptr->gamma_shift][blue>>8]; png_uint_16 gray16 = (png_uint_16)((rc*red_1 + gc*green_1 + bc*blue_1 + 16384)>>15); - w = png_ptr->gamma_16_from_1[(gray16&0xff) >> + w = png_ptr->gamma_16_from_1[(gray16 & 0xff) >> png_ptr->gamma_shift][gray16 >> 8]; rgb_error |= 1; } @@ -3166,17 +3166,18 @@ png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row) for (i = 0; i < row_width; i++) { png_uint_16 red, green, blue, gray16; + png_byte hi,lo; - red = (png_uint_16)(((*(sp)) << 8) | *(sp + 1)); sp += 2; - green = (png_uint_16)(((*(sp)) << 8) | *(sp + 1)); sp += 2; - blue = (png_uint_16)(((*(sp)) << 8) | *(sp + 1)); sp += 2; + hi=*(sp)++; lo=*(sp)++; red = (png_uint_16)((hi << 8) | (lo)); + hi=*(sp)++; lo=*(sp)++; green = (png_uint_16)((hi << 8) | (lo)); + hi=*(sp)++; lo=*(sp)++; blue = (png_uint_16)((hi << 8) | (lo)); if (red != green || red != blue) rgb_error |= 1; - /* From 1.5.5 in the 16 bit case do the accurate conversion even + /* From 1.5.5 in the 16-bit case do the accurate conversion even * in the 'fast' case - this is because this is where the code - * ends up when handling linear 16 bit data. + * ends up when handling linear 16-bit data. */ gray16 = (png_uint_16)((rc*red + gc*green + bc*blue + 16384) >> 15); @@ -3341,7 +3342,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr) if ((png_uint_16)((*sp >> shift) & 0x0f) == png_ptr->trans_color.gray) { - unsigned int tmp = *sp & (0xf0f >> (4 - shift)); + unsigned int tmp = *sp & (0x0f0f >> (4 - shift)); tmp |= png_ptr->background.gray << shift; *sp = (png_byte)(tmp & 0xff); } @@ -3351,7 +3352,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr) unsigned int p = (*sp >> shift) & 0x0f; unsigned int g = (gamma_table[p | (p << 4)] >> 4) & 0x0f; - unsigned int tmp = *sp & (0xf0f >> (4 - shift)); + unsigned int tmp = *sp & (0x0f0f >> (4 - shift)); tmp |= g << shift; *sp = (png_byte)(tmp & 0xff); } @@ -3377,7 +3378,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr) if ((png_uint_16)((*sp >> shift) & 0x0f) == png_ptr->trans_color.gray) { - unsigned int tmp = *sp & (0xf0f >> (4 - shift)); + unsigned int tmp = *sp & (0x0f0f >> (4 - shift)); tmp |= png_ptr->background.gray << shift; *sp = (png_byte)(tmp & 0xff); } @@ -3695,7 +3696,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr) if (optimize != 0) w = v; else - w = gamma_16_from_1[(v&0xff) >> gamma_shift][v >> 8]; + w = gamma_16_from_1[(v & 0xff) >> + gamma_shift][v >> 8]; *sp = (png_byte)((w >> 8) & 0xff); *(sp + 1) = (png_byte)(w & 0xff); } @@ -3859,7 +3861,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr) v = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp]; png_composite_16(w, v, a, png_ptr->background_1.red); if (optimize == 0) - w = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> + w = gamma_16_from_1[((w & 0xff) >> gamma_shift)][w >> 8]; *sp = (png_byte)((w >> 8) & 0xff); *(sp + 1) = (png_byte)(w & 0xff); @@ -3867,7 +3869,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr) v = gamma_16_to_1[*(sp + 3) >> gamma_shift][*(sp + 2)]; png_composite_16(w, v, a, png_ptr->background_1.green); if (optimize == 0) - w = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> + w = gamma_16_from_1[((w & 0xff) >> gamma_shift)][w >> 8]; *(sp + 2) = (png_byte)((w >> 8) & 0xff); @@ -3876,7 +3878,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr) v = gamma_16_to_1[*(sp + 5) >> gamma_shift][*(sp + 4)]; png_composite_16(w, v, a, png_ptr->background_1.blue); if (optimize == 0) - w = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> + w = gamma_16_from_1[((w & 0xff) >> gamma_shift)][w >> 8]; *(sp + 4) = (png_byte)((w >> 8) & 0xff); @@ -4485,7 +4487,7 @@ png_do_expand(png_row_infop row_info, png_bytep row, for (i = 0; i < row_width; i++) { - if (*sp == gray) + if ((*sp & 0xffU) == gray) *dp-- = 0; else @@ -4503,7 +4505,8 @@ png_do_expand(png_row_infop row_info, png_bytep row, dp = row + (row_info->rowbytes << 1) - 1; for (i = 0; i < row_width; i++) { - if (*(sp - 1) == gray_high && *(sp) == gray_low) + if ((*(sp - 1) & 0xffU) == gray_high && + (*(sp) & 0xffU) == gray_low) { *dp-- = 0; *dp-- = 0; @@ -4865,7 +4868,7 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info) /* Because PNG_COMPOSE does the gamma transform if there is something to * do (if there is an alpha channel or transparency.) */ - !((png_ptr->transformations & PNG_COMPOSE) && + !((png_ptr->transformations & PNG_COMPOSE) != 0 && ((png_ptr->num_trans != 0) || (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) != 0)) && #endif diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngrutil.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngrutil.c index 68e5caff89c..a2e58468a68 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngrutil.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngrutil.c @@ -29,8 +29,8 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.20 [December 3, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -117,7 +117,13 @@ png_get_int_32)(png_const_bytep buf) return uval; uval = (uval ^ 0xffffffff) + 1; /* 2's complement: -x = ~x+1 */ - return -(png_int_32)uval; + if ((uval & 0x80000000) == 0) /* no overflow */ + return -(png_int_32)uval; + /* The following has to be safe; this function only gets called on PNG data + * and if we get here that data is invalid. 0 is the most safe value and + * if not then an attacker would surely just generate a PNG with 0 instead. + */ + return 0; } /* Grab an unsigned 16-bit integer from a buffer in big-endian format. */ @@ -126,7 +132,7 @@ png_get_uint_16)(png_const_bytep buf) { /* ANSI-C requires an int value to accomodate at least 16 bits so this * works and allows the compiler not to worry about possible narrowing - * on 32 bit systems. (Pre-ANSI systems did not make integers smaller + * on 32-bit systems. (Pre-ANSI systems did not make integers smaller * than 16 bits either.) */ unsigned int val = @@ -369,7 +375,7 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner) * are minimal. */ (void)png_safecat(msg, (sizeof msg), 4, " using zstream"); -#if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC +#if PNG_RELEASE_BUILD png_chunk_warning(png_ptr, msg); png_ptr->zowner = 0; #else @@ -399,10 +405,16 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner) if (((png_ptr->options >> PNG_MAXIMUM_INFLATE_WINDOW) & 3) == PNG_OPTION_ON) + { window_bits = 15; + png_ptr->zstream_start = 0; /* fixed window size */ + } else + { window_bits = 0; + png_ptr->zstream_start = 1; + } # else # define window_bits 0 # endif @@ -451,6 +463,31 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner) #endif } +#if PNG_ZLIB_VERNUM >= 0x1240 +/* Handle the start of the inflate stream if we called inflateInit2(strm,0); + * in this case some zlib versions skip validation of the CINFO field and, in + * certain circumstances, libpng may end up displaying an invalid image, in + * contrast to implementations that call zlib in the normal way (e.g. libpng + * 1.5). + */ +int /* PRIVATE */ +png_zlib_inflate(png_structrp png_ptr, int flush) +{ + if (png_ptr->zstream_start && png_ptr->zstream.avail_in > 0) + { + if ((*png_ptr->zstream.next_in >> 4) > 7) + { + png_ptr->zstream.msg = "invalid window size (libpng)"; + return Z_DATA_ERROR; + } + + png_ptr->zstream_start = 0; + } + + return inflate(&png_ptr->zstream, flush); +} +#endif /* Zlib >= 1.2.4 */ + #ifdef PNG_READ_COMPRESSED_TEXT_SUPPORTED /* png_inflate now returns zlib error codes including Z_OK and Z_STREAM_END to * allow the caller to do multiple calls if required. If the 'finish' flag is @@ -544,7 +581,7 @@ png_inflate(png_structrp png_ptr, png_uint_32 owner, int finish, * the previous chunk of input data. Tell zlib if we have reached the * end of the output buffer. */ - ret = inflate(&png_ptr->zstream, avail_out > 0 ? Z_NO_FLUSH : + ret = PNG_INFLATE(png_ptr, avail_out > 0 ? Z_NO_FLUSH : (finish ? Z_FINISH : Z_SYNC_FLUSH)); } while (ret == Z_OK); @@ -603,7 +640,7 @@ png_decompress_chunk(png_structrp png_ptr, */ png_alloc_size_t limit = PNG_SIZE_MAX; -# ifdef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED +# ifdef PNG_SET_USER_LIMITS_SUPPORTED if (png_ptr->user_chunk_malloc_max > 0 && png_ptr->user_chunk_malloc_max < limit) limit = png_ptr->user_chunk_malloc_max; @@ -698,7 +735,6 @@ png_decompress_chunk(png_structrp png_ptr, * success) */ png_free(png_ptr, text); - text = NULL; /* This really is very benign, but it's still an error because * the extra space may otherwise be used as a Trojan Horse. @@ -794,7 +830,7 @@ png_inflate_read(png_structrp png_ptr, png_bytep read_buffer, uInt read_size, * the available output is produced; this allows reading of truncated * streams. */ - ret = inflate(&png_ptr->zstream, + ret = PNG_INFLATE(png_ptr, *chunk_bytes > 0 ? Z_NO_FLUSH : (finish ? Z_FINISH : Z_SYNC_FLUSH)); } while (ret == Z_OK && (*out_size > 0 || png_ptr->zstream.avail_out > 0)); @@ -895,7 +931,7 @@ void /* PRIVATE */ png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) { png_color palette[PNG_MAX_PALETTE_LENGTH]; - int num, i; + int max_palette_length, num, i; #ifdef PNG_POINTER_INDEXING_SUPPORTED png_colorp pal_ptr; #endif @@ -956,6 +992,19 @@ png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) /* The cast is safe because 'length' is less than 3*PNG_MAX_PALETTE_LENGTH */ num = (int)length / 3; + /* If the palette has 256 or fewer entries but is too large for the bit + * depth, we don't issue an error, to preserve the behavior of previous + * libpng versions. We silently truncate the unused extra palette entries + * here. + */ + if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + max_palette_length = (1 << png_ptr->bit_depth); + else + max_palette_length = PNG_MAX_PALETTE_LENGTH; + + if (num > max_palette_length) + num = max_palette_length; + #ifdef PNG_POINTER_INDEXING_SUPPORTED for (i = 0, pal_ptr = palette; i < num; i++, pal_ptr++) { @@ -988,7 +1037,7 @@ png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) #endif { - png_crc_finish(png_ptr, 0); + png_crc_finish(png_ptr, (int) length - num * 3); } #ifndef PNG_READ_OPT_PLTE_SUPPORTED @@ -1175,11 +1224,13 @@ png_handle_sBIT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) return; for (i=0; i sample_depth) { png_chunk_benign_error(png_ptr, "invalid"); return; } + } if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) != 0) { @@ -1490,10 +1541,10 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) finished = 1; # ifdef PNG_sRGB_SUPPORTED - /* Check for a match against sRGB */ - png_icc_set_sRGB(png_ptr, - &png_ptr->colorspace, profile, - png_ptr->zstream.adler); + /* Check for a match against sRGB */ + png_icc_set_sRGB(png_ptr, + &png_ptr->colorspace, profile, + png_ptr->zstream.adler); # endif /* Steal the profile for info_ptr. */ @@ -1543,8 +1594,10 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) else if (size > 0) errmsg = "truncated"; +#ifndef __COVERITY__ else errmsg = png_ptr->zstream.msg; +#endif } /* else png_icc_check_tag_table output an error */ @@ -1676,7 +1729,7 @@ png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) ++entry_start; /* A sample depth should follow the separator, and we should be on it */ - if (entry_start > buffer + length - 2) + if (length < 2U || entry_start > buffer + (length - 2U)) { png_warning(png_ptr, "malformed sPLT chunk"); return; @@ -1701,8 +1754,8 @@ png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) if (dl > max_dl) { - png_warning(png_ptr, "sPLT chunk too long"); - return; + png_warning(png_ptr, "sPLT chunk too long"); + return; } new_palette.nentries = (png_int_32)(data_length / entry_size); @@ -1712,8 +1765,8 @@ png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) if (new_palette.entries == NULL) { - png_warning(png_ptr, "sPLT chunk requires too much memory"); - return; + png_warning(png_ptr, "sPLT chunk requires too much memory"); + return; } #ifdef PNG_POINTER_INDEXING_SUPPORTED @@ -1843,7 +1896,8 @@ png_handle_tRNS(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) return; } - if (length > png_ptr->num_palette || length > PNG_MAX_PALETTE_LENGTH || + if (length > (unsigned int) png_ptr->num_palette || + length > (unsigned int) PNG_MAX_PALETTE_LENGTH || length == 0) { png_crc_finish(png_ptr, length); @@ -2006,7 +2060,8 @@ png_handle_hIST(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) num = length / 2 ; - if (num != png_ptr->num_palette || num > PNG_MAX_PALETTE_LENGTH) + if (num != (unsigned int) png_ptr->num_palette || + num > (unsigned int) PNG_MAX_PALETTE_LENGTH) { png_crc_finish(png_ptr, length); png_chunk_benign_error(png_ptr, "invalid"); @@ -2178,7 +2233,7 @@ png_handle_pCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) /* We need to have at least 12 bytes after the purpose string * in order to get the parameter information. */ - if (endptr <= buf + 12) + if (endptr - buf <= 12) { png_chunk_benign_error(png_ptr, "invalid"); return; @@ -2741,14 +2796,14 @@ png_cache_unknown_chunk(png_structrp png_ptr, png_uint_32 length) png_ptr->unknown_chunk.data = NULL; } -# ifdef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED - if (png_ptr->user_chunk_malloc_max > 0 && - png_ptr->user_chunk_malloc_max < limit) - limit = png_ptr->user_chunk_malloc_max; +# ifdef PNG_SET_USER_LIMITS_SUPPORTED + if (png_ptr->user_chunk_malloc_max > 0 && + png_ptr->user_chunk_malloc_max < limit) + limit = png_ptr->user_chunk_malloc_max; # elif PNG_USER_CHUNK_MALLOC_MAX > 0 - if (PNG_USER_CHUNK_MALLOC_MAX < limit) - limit = PNG_USER_CHUNK_MALLOC_MAX; + if (PNG_USER_CHUNK_MALLOC_MAX < limit) + limit = PNG_USER_CHUNK_MALLOC_MAX; # endif if (length <= limit) @@ -2811,7 +2866,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr, */ # ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED # ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED - keep = png_chunk_unknown_handling(png_ptr, png_ptr->chunk_name); + keep = png_chunk_unknown_handling(png_ptr, png_ptr->chunk_name); # endif # endif @@ -2820,153 +2875,153 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr, * PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) */ # ifdef PNG_READ_USER_CHUNKS_SUPPORTED - /* The user callback takes precedence over the chunk keep value, but the - * keep value is still required to validate a save of a critical chunk. - */ - if (png_ptr->read_user_chunk_fn != NULL) + /* The user callback takes precedence over the chunk keep value, but the + * keep value is still required to validate a save of a critical chunk. + */ + if (png_ptr->read_user_chunk_fn != NULL) + { + if (png_cache_unknown_chunk(png_ptr, length) != 0) { - if (png_cache_unknown_chunk(png_ptr, length) != 0) + /* Callback to user unknown chunk handler */ + int ret = (*(png_ptr->read_user_chunk_fn))(png_ptr, + &png_ptr->unknown_chunk); + + /* ret is: + * negative: An error occurred; png_chunk_error will be called. + * zero: The chunk was not handled, the chunk will be discarded + * unless png_set_keep_unknown_chunks has been used to set + * a 'keep' behavior for this particular chunk, in which + * case that will be used. A critical chunk will cause an + * error at this point unless it is to be saved. + * positive: The chunk was handled, libpng will ignore/discard it. + */ + if (ret < 0) + png_chunk_error(png_ptr, "error in user chunk"); + + else if (ret == 0) { - /* Callback to user unknown chunk handler */ - int ret = (*(png_ptr->read_user_chunk_fn))(png_ptr, - &png_ptr->unknown_chunk); - - /* ret is: - * negative: An error occured, png_chunk_error will be called. - * zero: The chunk was not handled, the chunk will be discarded - * unless png_set_keep_unknown_chunks has been used to set - * a 'keep' behavior for this particular chunk, in which - * case that will be used. A critical chunk will cause an - * error at this point unless it is to be saved. - * positive: The chunk was handled, libpng will ignore/discard it. + /* If the keep value is 'default' or 'never' override it, but + * still error out on critical chunks unless the keep value is + * 'always' While this is weird it is the behavior in 1.4.12. + * A possible improvement would be to obey the value set for the + * chunk, but this would be an API change that would probably + * damage some applications. + * + * The png_app_warning below catches the case that matters, where + * the application has not set specific save or ignore for this + * chunk or global save or ignore. */ - if (ret < 0) - png_chunk_error(png_ptr, "error in user chunk"); - - else if (ret == 0) + if (keep < PNG_HANDLE_CHUNK_IF_SAFE) { - /* If the keep value is 'default' or 'never' override it, but - * still error out on critical chunks unless the keep value is - * 'always' While this is weird it is the behavior in 1.4.12. - * A possible improvement would be to obey the value set for the - * chunk, but this would be an API change that would probably - * damage some applications. - * - * The png_app_warning below catches the case that matters, where - * the application has not set specific save or ignore for this - * chunk or global save or ignore. - */ - if (keep < PNG_HANDLE_CHUNK_IF_SAFE) +# ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED + if (png_ptr->unknown_default < PNG_HANDLE_CHUNK_IF_SAFE) { -# ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED - if (png_ptr->unknown_default < PNG_HANDLE_CHUNK_IF_SAFE) - { - png_chunk_warning(png_ptr, "Saving unknown chunk:"); - png_app_warning(png_ptr, - "forcing save of an unhandled chunk;" - " please call png_set_keep_unknown_chunks"); - /* with keep = PNG_HANDLE_CHUNK_IF_SAFE */ - } -# endif - keep = PNG_HANDLE_CHUNK_IF_SAFE; + png_chunk_warning(png_ptr, "Saving unknown chunk:"); + png_app_warning(png_ptr, + "forcing save of an unhandled chunk;" + " please call png_set_keep_unknown_chunks"); + /* with keep = PNG_HANDLE_CHUNK_IF_SAFE */ } - } - - else /* chunk was handled */ - { - handled = 1; - /* Critical chunks can be safely discarded at this point. */ - keep = PNG_HANDLE_CHUNK_NEVER; +# endif + keep = PNG_HANDLE_CHUNK_IF_SAFE; } } - else - keep = PNG_HANDLE_CHUNK_NEVER; /* insufficient memory */ + else /* chunk was handled */ + { + handled = 1; + /* Critical chunks can be safely discarded at this point. */ + keep = PNG_HANDLE_CHUNK_NEVER; + } } else - /* Use the SAVE_UNKNOWN_CHUNKS code or skip the chunk */ + keep = PNG_HANDLE_CHUNK_NEVER; /* insufficient memory */ + } + + else + /* Use the SAVE_UNKNOWN_CHUNKS code or skip the chunk */ # endif /* READ_USER_CHUNKS */ # ifdef PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED + { + /* keep is currently just the per-chunk setting, if there was no + * setting change it to the global default now (not that this may + * still be AS_DEFAULT) then obtain the cache of the chunk if required, + * if not simply skip the chunk. + */ + if (keep == PNG_HANDLE_CHUNK_AS_DEFAULT) + keep = png_ptr->unknown_default; + + if (keep == PNG_HANDLE_CHUNK_ALWAYS || + (keep == PNG_HANDLE_CHUNK_IF_SAFE && + PNG_CHUNK_ANCILLARY(png_ptr->chunk_name))) { - /* keep is currently just the per-chunk setting, if there was no - * setting change it to the global default now (not that this may - * still be AS_DEFAULT) then obtain the cache of the chunk if required, - * if not simply skip the chunk. - */ - if (keep == PNG_HANDLE_CHUNK_AS_DEFAULT) - keep = png_ptr->unknown_default; - - if (keep == PNG_HANDLE_CHUNK_ALWAYS || - (keep == PNG_HANDLE_CHUNK_IF_SAFE && - PNG_CHUNK_ANCILLARY(png_ptr->chunk_name))) - { - if (png_cache_unknown_chunk(png_ptr, length) == 0) - keep = PNG_HANDLE_CHUNK_NEVER; - } - - else - png_crc_finish(png_ptr, length); + if (png_cache_unknown_chunk(png_ptr, length) == 0) + keep = PNG_HANDLE_CHUNK_NEVER; } + + else + png_crc_finish(png_ptr, length); + } # else # ifndef PNG_READ_USER_CHUNKS_SUPPORTED # error no method to support READ_UNKNOWN_CHUNKS # endif - { - /* If here there is no read callback pointer set and no support is - * compiled in to just save the unknown chunks, so simply skip this - * chunk. If 'keep' is something other than AS_DEFAULT or NEVER then - * the app has erroneously asked for unknown chunk saving when there - * is no support. - */ - if (keep > PNG_HANDLE_CHUNK_NEVER) - png_app_error(png_ptr, "no unknown chunk support available"); + { + /* If here there is no read callback pointer set and no support is + * compiled in to just save the unknown chunks, so simply skip this + * chunk. If 'keep' is something other than AS_DEFAULT or NEVER then + * the app has erroneously asked for unknown chunk saving when there + * is no support. + */ + if (keep > PNG_HANDLE_CHUNK_NEVER) + png_app_error(png_ptr, "no unknown chunk support available"); - png_crc_finish(png_ptr, length); - } + png_crc_finish(png_ptr, length); + } # endif # ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED - /* Now store the chunk in the chunk list if appropriate, and if the limits - * permit it. - */ - if (keep == PNG_HANDLE_CHUNK_ALWAYS || - (keep == PNG_HANDLE_CHUNK_IF_SAFE && - PNG_CHUNK_ANCILLARY(png_ptr->chunk_name))) + /* Now store the chunk in the chunk list if appropriate, and if the limits + * permit it. + */ + if (keep == PNG_HANDLE_CHUNK_ALWAYS || + (keep == PNG_HANDLE_CHUNK_IF_SAFE && + PNG_CHUNK_ANCILLARY(png_ptr->chunk_name))) + { +# ifdef PNG_USER_LIMITS_SUPPORTED + switch (png_ptr->user_chunk_cache_max) { -# ifdef PNG_USER_LIMITS_SUPPORTED - switch (png_ptr->user_chunk_cache_max) - { - case 2: - png_ptr->user_chunk_cache_max = 1; - png_chunk_benign_error(png_ptr, "no space in chunk cache"); - /* FALL THROUGH */ - case 1: - /* NOTE: prior to 1.6.0 this case resulted in an unknown critical - * chunk being skipped, now there will be a hard error below. - */ - break; + case 2: + png_ptr->user_chunk_cache_max = 1; + png_chunk_benign_error(png_ptr, "no space in chunk cache"); + /* FALL THROUGH */ + case 1: + /* NOTE: prior to 1.6.0 this case resulted in an unknown critical + * chunk being skipped, now there will be a hard error below. + */ + break; - default: /* not at limit */ - --(png_ptr->user_chunk_cache_max); - /* FALL THROUGH */ - case 0: /* no limit */ -# endif /* USER_LIMITS */ - /* Here when the limit isn't reached or when limits are compiled - * out; store the chunk. - */ - png_set_unknown_chunks(png_ptr, info_ptr, - &png_ptr->unknown_chunk, 1); - handled = 1; -# ifdef PNG_USER_LIMITS_SUPPORTED - break; - } -# endif + default: /* not at limit */ + --(png_ptr->user_chunk_cache_max); + /* FALL THROUGH */ + case 0: /* no limit */ +# endif /* USER_LIMITS */ + /* Here when the limit isn't reached or when limits are compiled + * out; store the chunk. + */ + png_set_unknown_chunks(png_ptr, info_ptr, + &png_ptr->unknown_chunk, 1); + handled = 1; +# ifdef PNG_USER_LIMITS_SUPPORTED + break; } +# endif + } # else /* no store support: the chunk must be handled by the user callback */ - PNG_UNUSED(info_ptr) + PNG_UNUSED(info_ptr) # endif /* Regardless of the error handling below the cached data (if any) can be @@ -3068,13 +3123,13 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display) end_ptr = dp + PNG_ROWBYTES(pixel_depth, row_width) - 1; end_byte = *end_ptr; # ifdef PNG_READ_PACKSWAP_SUPPORTED - if ((png_ptr->transformations & PNG_PACKSWAP) != 0) - /* little-endian byte */ - end_mask = 0xff << end_mask; + if ((png_ptr->transformations & PNG_PACKSWAP) != 0) + /* little-endian byte */ + end_mask = 0xff << end_mask; - else /* big-endian byte */ + else /* big-endian byte */ # endif - end_mask = 0xff >> end_mask; + end_mask = 0xff >> end_mask; /* end_mask is now the bits to *keep* from the destination row */ } @@ -3232,12 +3287,12 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display) png_uint_32 mask; # ifdef PNG_READ_PACKSWAP_SUPPORTED - if ((png_ptr->transformations & PNG_PACKSWAP) != 0) - mask = MASK(pass, pixel_depth, display, 0); + if ((png_ptr->transformations & PNG_PACKSWAP) != 0) + mask = MASK(pass, pixel_depth, display, 0); - else + else # endif - mask = MASK(pass, pixel_depth, display, 1); + mask = MASK(pass, pixel_depth, display, 1); for (;;) { @@ -3838,15 +3893,15 @@ png_read_filter_row_paeth_1byte_pixel(png_row_infop row_info, png_bytep row, p = b - c; pc = a - c; -# ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -# else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -# endif +#ifdef PNG_USE_ABS + pa = abs(p); + pb = abs(pc); + pc = abs(p + pc); +#else + pa = p < 0 ? -p : p; + pb = pc < 0 ? -pc : pc; + pc = (p + pc) < 0 ? -(p + pc) : p + pc; +#endif /* Find the best predictor, the least of pa, pb, pc favoring the earlier * ones in the case of a tie. @@ -3893,15 +3948,15 @@ png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row, p = b - c; pc = a - c; -# ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -# else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -# endif +#ifdef PNG_USE_ABS + pa = abs(p); + pb = abs(pc); + pc = abs(p + pc); +#else + pa = p < 0 ? -p : p; + pb = pc < 0 ? -pc : pc; + pc = (p + pc) < 0 ? -(p + pc) : p + pc; +#endif if (pb < pa) pa = pb, a = b; if (pc < pa) a = c; @@ -4043,7 +4098,7 @@ png_read_IDAT_data(png_structrp png_ptr, png_bytep output, * * TODO: deal more elegantly with truncated IDAT lists. */ - ret = inflate(&png_ptr->zstream, Z_NO_FLUSH); + ret = PNG_INFLATE(png_ptr, Z_NO_FLUSH); /* Take the unconsumed output back. */ if (output != NULL) @@ -4306,18 +4361,18 @@ png_read_start_row(png_structrp png_ptr) #ifdef PNG_READ_EXPAND_16_SUPPORTED if ((png_ptr->transformations & PNG_EXPAND_16) != 0) { -# ifdef PNG_READ_EXPAND_SUPPORTED - /* In fact it is an error if it isn't supported, but checking is - * the safe way. - */ - if ((png_ptr->transformations & PNG_EXPAND) != 0) - { - if (png_ptr->bit_depth < 16) - max_pixel_depth *= 2; - } - else -# endif - png_ptr->transformations &= ~PNG_EXPAND_16; +# ifdef PNG_READ_EXPAND_SUPPORTED + /* In fact it is an error if it isn't supported, but checking is + * the safe way. + */ + if ((png_ptr->transformations & PNG_EXPAND) != 0) + { + if (png_ptr->bit_depth < 16) + max_pixel_depth *= 2; + } + else +# endif + png_ptr->transformations &= ~PNG_EXPAND_16; } #endif diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngset.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngset.c index d2c89b2a55f..748008eb70b 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngset.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngset.c @@ -29,8 +29,8 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.19 [November 12, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -151,12 +151,12 @@ png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X, png_fixed(png_ptr, red_X, "cHRM Red X"), png_fixed(png_ptr, red_Y, "cHRM Red Y"), png_fixed(png_ptr, red_Z, "cHRM Red Z"), - png_fixed(png_ptr, green_X, "cHRM Red X"), - png_fixed(png_ptr, green_Y, "cHRM Red Y"), - png_fixed(png_ptr, green_Z, "cHRM Red Z"), - png_fixed(png_ptr, blue_X, "cHRM Red X"), - png_fixed(png_ptr, blue_Y, "cHRM Red Y"), - png_fixed(png_ptr, blue_Z, "cHRM Red Z")); + png_fixed(png_ptr, green_X, "cHRM Green X"), + png_fixed(png_ptr, green_Y, "cHRM Green Y"), + png_fixed(png_ptr, green_Z, "cHRM Green Z"), + png_fixed(png_ptr, blue_X, "cHRM Blue X"), + png_fixed(png_ptr, blue_Y, "cHRM Blue Y"), + png_fixed(png_ptr, blue_Z, "cHRM Blue Z")); } # endif /* FLOATING_POINT */ @@ -218,6 +218,7 @@ png_set_hIST(png_const_structrp png_ptr, png_inforp info_ptr, if (info_ptr->hist == NULL) { png_warning(png_ptr, "Insufficient memory for hIST chunk data"); + return; } @@ -299,7 +300,7 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr, png_debug1(1, "in %s storage function", "pCAL"); if (png_ptr == NULL || info_ptr == NULL || purpose == NULL || units == NULL - || (nparams > 0 && params == NULL)) + || (nparams > 0 && params == NULL)) return; length = strlen(purpose) + 1; @@ -329,6 +330,7 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr, if (info_ptr->pcal_purpose == NULL) { png_warning(png_ptr, "Insufficient memory for pCAL purpose"); + return; } @@ -350,6 +352,7 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr, if (info_ptr->pcal_units == NULL) { png_warning(png_ptr, "Insufficient memory for pCAL units"); + return; } @@ -361,6 +364,7 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr, if (info_ptr->pcal_params == NULL) { png_warning(png_ptr, "Insufficient memory for pCAL params"); + return; } @@ -377,6 +381,7 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr, if (info_ptr->pcal_params[i] == NULL) { png_warning(png_ptr, "Insufficient memory for pCAL parameter"); + return; } @@ -426,6 +431,7 @@ png_set_sCAL_s(png_const_structrp png_ptr, png_inforp info_ptr, if (info_ptr->scal_s_width == NULL) { png_warning(png_ptr, "Memory allocation failed while processing sCAL"); + return; } @@ -444,6 +450,7 @@ png_set_sCAL_s(png_const_structrp png_ptr, png_inforp info_ptr, info_ptr->scal_s_width = NULL; png_warning(png_ptr, "Memory allocation failed while processing sCAL"); + return; } @@ -534,12 +541,17 @@ png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_const_colorp palette, int num_palette) { + png_uint_32 max_palette_length; + png_debug1(1, "in %s storage function", "PLTE"); if (png_ptr == NULL || info_ptr == NULL) return; - if (num_palette < 0 || num_palette > PNG_MAX_PALETTE_LENGTH) + max_palette_length = (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ? + (1 << info_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH; + + if (num_palette < 0 || num_palette > (int) max_palette_length) { if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) png_error(png_ptr, "Invalid palette length"); @@ -547,6 +559,7 @@ png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr, else { png_warning(png_ptr, "Invalid palette length"); + return; } } @@ -559,7 +572,6 @@ png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr, )) { png_error(png_ptr, "Invalid palette"); - return; } /* It may not actually be necessary to set png_ptr->palette here; @@ -572,8 +584,8 @@ png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0); /* Changed in libpng-1.2.1 to allocate PNG_MAX_PALETTE_LENGTH instead - * of num_palette entries, in case of an invalid PNG file that has - * too-large sample values. + * of num_palette entries, in case of an invalid PNG file or incorrect + * call to png_set_PLTE() with too-large sample values. */ png_ptr->palette = png_voidcast(png_colorp, png_calloc(png_ptr, PNG_MAX_PALETTE_LENGTH * (sizeof (png_color)))); @@ -683,6 +695,7 @@ png_set_iCCP(png_const_structrp png_ptr, png_inforp info_ptr, if (new_iccp_name == NULL) { png_benign_error(png_ptr, "Insufficient memory to process iCCP chunk"); + return; } @@ -693,9 +706,9 @@ png_set_iCCP(png_const_structrp png_ptr, png_inforp info_ptr, if (new_iccp_profile == NULL) { png_free(png_ptr, new_iccp_name); - new_iccp_name = NULL; png_benign_error(png_ptr, "Insufficient memory to process iCCP profile"); + return; } @@ -729,7 +742,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr, { int i; - png_debug1(1, "in %lx storage function", png_ptr == NULL ? "unexpected" : + png_debug1(1, "in %lx storage function", png_ptr == NULL ? 0xabadca11U : (unsigned long)png_ptr->chunk_name); if (png_ptr == NULL || info_ptr == NULL || num_text <= 0 || text_ptr == NULL) @@ -771,6 +784,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr, { png_chunk_report(png_ptr, "too many text chunks", PNG_CHUNK_WRITE_ERROR); + return 1; } @@ -826,7 +840,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr, else lang_key_len = 0; } -# else /* PNG_iTXt_SUPPORTED */ +# else /* iTXt */ { png_chunk_report(png_ptr, "iTXt chunk not supported", PNG_CHUNK_WRITE_ERROR); @@ -859,6 +873,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr, { png_chunk_report(png_ptr, "text chunk: out of memory", PNG_CHUNK_WRITE_ERROR); + return 1; } @@ -932,6 +947,7 @@ png_set_tIME(png_const_structrp png_ptr, png_inforp info_ptr, mod_time->second > 60) { png_warning(png_ptr, "Ignoring invalid time value"); + return; } @@ -948,6 +964,7 @@ png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr, png_debug1(1, "in %s storage function", "tRNS"); if (png_ptr == NULL || info_ptr == NULL) + return; if (trans_alpha != NULL) @@ -973,16 +990,21 @@ png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr, if (trans_color != NULL) { - int sample_max = (1 << info_ptr->bit_depth); +#ifdef PNG_WARNINGS_SUPPORTED + if (info_ptr->bit_depth < 16) + { + int sample_max = (1 << info_ptr->bit_depth) - 1; - if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY && - trans_color->gray > sample_max) || - (info_ptr->color_type == PNG_COLOR_TYPE_RGB && - (trans_color->red > sample_max || - trans_color->green > sample_max || - trans_color->blue > sample_max))) - png_warning(png_ptr, - "tRNS chunk has out-of-range samples for bit_depth"); + if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY && + trans_color->gray > sample_max) || + (info_ptr->color_type == PNG_COLOR_TYPE_RGB && + (trans_color->red > sample_max || + trans_color->green > sample_max || + trans_color->blue > sample_max))) + png_warning(png_ptr, + "tRNS chunk has out-of-range samples for bit_depth"); + } +#endif info_ptr->trans_color = *trans_color; @@ -1029,6 +1051,7 @@ png_set_sPLT(png_const_structrp png_ptr, { /* Out of memory or too many chunks */ png_chunk_report(png_ptr, "too many sPLT chunks", PNG_CHUNK_WRITE_ERROR); + return; } @@ -1144,7 +1167,7 @@ png_set_unknown_chunks(png_const_structrp png_ptr, png_unknown_chunkp np; if (png_ptr == NULL || info_ptr == NULL || num_unknowns <= 0 || - unknowns == NULL) + unknowns == NULL) return; /* Check for the failure cases where support has been disabled at compile @@ -1158,6 +1181,7 @@ png_set_unknown_chunks(png_const_structrp png_ptr, if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0) { png_app_error(png_ptr, "no unknown chunk support on read"); + return; } # endif @@ -1166,6 +1190,7 @@ png_set_unknown_chunks(png_const_structrp png_ptr, if ((png_ptr->mode & PNG_IS_READ_STRUCT) == 0) { png_app_error(png_ptr, "no unknown chunk support on write"); + return; } # endif @@ -1183,6 +1208,7 @@ png_set_unknown_chunks(png_const_structrp png_ptr, { png_chunk_report(png_ptr, "too many unknown chunks", PNG_CHUNK_WRITE_ERROR); + return; } @@ -1260,8 +1286,7 @@ png_set_unknown_chunk_location(png_const_structrp png_ptr, png_inforp info_ptr, check_location(png_ptr, location); } } -#endif - +#endif /* STORE_UNKNOWN_CHUNKS */ #ifdef PNG_MNG_FEATURES_SUPPORTED png_uint_32 PNGAPI @@ -1292,6 +1317,7 @@ add_one_chunk(png_bytep list, unsigned int count, png_const_bytep add, int keep) if (memcmp(list, add, 4) == 0) { list[4] = (png_byte)keep; + return count; } } @@ -1319,6 +1345,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep, if (keep < 0 || keep >= PNG_HANDLE_CHUNK_LAST) { png_app_error(png_ptr, "png_set_keep_unknown_chunks: invalid keep"); + return; } @@ -1368,6 +1395,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep, * which can be switched off. */ png_app_error(png_ptr, "png_set_keep_unknown_chunks: no chunk list"); + return; } @@ -1383,6 +1411,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep, if (num_chunks + old_num_chunks > UINT_MAX/5) { png_app_error(png_ptr, "png_set_keep_unknown_chunks: too many chunks"); + return; } @@ -1520,23 +1549,30 @@ png_set_compression_buffer_size(png_structrp png_ptr, png_size_t size) { png_warning(png_ptr, "Compression buffer size cannot be changed because it is in use"); + return; } +#ifndef __COVERITY__ + /* Some compilers complain that this is always false. However, it + * can be true when integer overflow happens. + */ if (size > ZLIB_IO_MAX) { png_warning(png_ptr, "Compression buffer size limited to system maximum"); size = ZLIB_IO_MAX; /* must fit */ } +#endif - else if (size < 6) + if (size < 6) { /* Deflate will potentially go into an infinite loop on a SYNC_FLUSH * if this is permitted. */ png_warning(png_ptr, "Compression buffer size cannot be reduced below 6"); + return; } @@ -1565,7 +1601,7 @@ png_set_user_limits (png_structrp png_ptr, png_uint_32 user_width_max, { /* Images with dimensions larger than these limits will be * rejected by png_set_IHDR(). To accept any PNG datastream - * regardless of dimensions, set both limits to 0x7ffffffL. + * regardless of dimensions, set both limits to 0x7fffffff. */ if (png_ptr == NULL) return; @@ -1578,8 +1614,8 @@ png_set_user_limits (png_structrp png_ptr, png_uint_32 user_width_max, void PNGAPI png_set_chunk_cache_max (png_structrp png_ptr, png_uint_32 user_chunk_cache_max) { - if (png_ptr != NULL) - png_ptr->user_chunk_cache_max = user_chunk_cache_max; + if (png_ptr != NULL) + png_ptr->user_chunk_cache_max = user_chunk_cache_max; } /* This function was added to libpng 1.4.1 */ diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngstruct.h b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngstruct.h index 8670a5a4e8d..e47c02d6fa6 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngstruct.h +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngstruct.h @@ -29,12 +29,11 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Copyright (c) 1998-2013 Glenn Randers-Pehrson + * Last changed in libpng 1.6.18 [July 23, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * - * Last changed in libpng 1.6.1 [March 28, 2013] - * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h @@ -129,7 +128,7 @@ typedef struct png_XYZ #endif /* COLORSPACE */ #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) -/* A colorspace is all the above plus, potentially, profile information, +/* A colorspace is all the above plus, potentially, profile information; * however at present libpng does not use the profile internally so it is only * stored in the png_info struct (if iCCP is supported.) The rendering intent * is retained here and is checked. @@ -248,16 +247,18 @@ struct png_struct_def png_uint_32 row_number; /* current row in interlace pass */ png_uint_32 chunk_name; /* PNG_CHUNK() id of current chunk */ png_bytep prev_row; /* buffer to save previous (unfiltered) row. - * This is a pointer into big_prev_row + * While reading this is a pointer into + * big_prev_row; while writing it is separately + * allocated if needed. */ png_bytep row_buf; /* buffer to save current (unfiltered) row. - * This is a pointer into big_row_buf + * While reading, this is a pointer into + * big_row_buf; while writing it is separately + * allocated. */ -#ifdef PNG_WRITE_SUPPORTED - png_bytep sub_row; /* buffer to save "sub" row when filtering */ - png_bytep up_row; /* buffer to save "up" row when filtering */ - png_bytep avg_row; /* buffer to save "avg" row when filtering */ - png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ +#ifdef PNG_WRITE_FILTER_SUPPORTED + png_bytep try_row; /* buffer to save trial row when filtering */ + png_bytep tst_row; /* buffer to save best trial row when filtering */ #endif png_size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */ @@ -290,6 +291,9 @@ struct png_struct_def /* pixel depth used for the row buffers */ png_byte transformed_pixel_depth; /* pixel depth after read/write transforms */ +#if PNG_ZLIB_VERNUM >= 0x1240 + png_byte zstream_start; /* at start of an input zlib stream */ +#endif /* Zlib >= 1.2.4 */ #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) png_uint_16 filler; /* filler bytes for pixel expansion */ #endif @@ -375,17 +379,7 @@ struct png_struct_def png_bytep quantize_index; /* index translation for palette files */ #endif -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - png_byte heuristic_method; /* heuristic for row filter selection */ - png_byte num_prev_filters; /* number of weights for previous rows */ - png_bytep prev_filters; /* filter type(s) of previous row(s) */ - png_uint_16p filter_weights; /* weight(s) for previous line(s) */ - png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ - png_uint_16p filter_costs; /* relative filter calculation cost */ - png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ -#endif - - /* Options */ +/* Options */ #ifdef PNG_SET_OPTION_SUPPORTED png_byte options; /* On/off state (up to 4 options) */ #endif diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngtest.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngtest.c index fdd51acd04d..ef3a4ab0e50 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngtest.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngtest.c @@ -29,8 +29,8 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.5.25 [December 3, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -89,10 +89,11 @@ defined PNG_READ_sBIT_SUPPORTED &&\ defined PNG_READ_sCAL_SUPPORTED &&\ defined PNG_READ_sRGB_SUPPORTED &&\ + defined PNG_READ_sPLT_SUPPORTED &&\ defined PNG_READ_tEXt_SUPPORTED &&\ defined PNG_READ_tIME_SUPPORTED &&\ defined PNG_READ_zTXt_SUPPORTED &&\ - defined PNG_WRITE_INTERLACING_SUPPORTED + (defined PNG_WRITE_INTERLACING_SUPPORTED || PNG_LIBPNG_VER >= 10700) #ifdef PNG_ZLIB_HEADER # include PNG_ZLIB_HEADER /* defined by pnglibconf.h from 1.7 */ @@ -129,6 +130,10 @@ typedef FILE * png_FILE_p; # define SINGLE_ROWBUF_ALLOC /* Makes buffer overruns easier to nail */ #endif +#ifndef PNG_UNUSED +# define PNG_UNUSED(param) (void)param; +#endif + /* Turn on CPU timing #define PNGTEST_TIMING */ @@ -146,6 +151,22 @@ static float t_start, t_stop, t_decode, t_encode, t_misc; #define PNG_tIME_STRING_LENGTH 29 static int tIME_chunk_present = 0; static char tIME_string[PNG_tIME_STRING_LENGTH] = "tIME chunk is not present"; + +#if PNG_LIBPNG_VER < 10619 +#define png_convert_to_rfc1123_buffer(ts, t) tIME_to_str(read_ptr, ts, t) + +static int +tIME_to_str(png_structp png_ptr, png_charp ts, png_const_timep t) +{ + png_const_charp str = png_convert_to_rfc1123(png_ptr, t); + + if (str == NULL) + return 0; + + strcpy(ts, str); + return 1; +} +#endif /* older libpng */ #endif static int verbose = 0; @@ -213,16 +234,14 @@ write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass) #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED -/* Example of using user transform callback (we don't transform anything, - * but merely examine the row filters. We set this to 256 rather than - * 5 in case illegal filter values are present.) +/* Example of using a user transform callback (doesn't do anything at present). */ -static png_uint_32 filters_used[256]; static void PNGCBAPI -count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data) +read_user_callback(png_structp png_ptr, png_row_infop row_info, png_bytep data) { - if (png_ptr != NULL && row_info != NULL) - ++filters_used[*(data - 1)]; + PNG_UNUSED(png_ptr) + PNG_UNUSED(row_info) + PNG_UNUSED(data) } #endif @@ -497,7 +516,7 @@ pngtest_error(png_structp png_ptr, png_const_charp message) #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG /* Allocate memory. For reasonable files, size should never exceed - * 64K. However, zlib may allocate more then 64K if you don't tell + * 64K. However, zlib may allocate more than 64K if you don't tell * it not to. See zconf.h and png.h for more information. zlib does * need to allocate exactly 64K, so whatever you call here must * have the ability to do that. @@ -593,6 +612,7 @@ png_debug_free(png_structp png_ptr, png_voidp ptr) } /* Unlink the element from the list. */ + if (pinformation != NULL) { memory_infop *ppinfo = &pinformation; @@ -609,8 +629,7 @@ png_debug_free(png_structp png_ptr, png_voidp ptr) /* We must free the list element too, but first kill the memory that is to be freed. */ memset(ptr, 0x55, pinfo->size); - if (pinfo != NULL) - free(pinfo); + free(pinfo); pinfo = NULL; break; } @@ -820,7 +839,7 @@ write_chunks(png_structp write_ptr, int location) */ #ifdef PNG_TEXT_SUPPORTED static void -pngtest_check_text_support(png_const_structp png_ptr, png_textp text_ptr, +pngtest_check_text_support(png_structp png_ptr, png_textp text_ptr, int num_text) { while (num_text > 0) @@ -833,6 +852,8 @@ pngtest_check_text_support(png_const_structp png_ptr, png_textp text_ptr, case PNG_TEXT_COMPRESSION_zTXt: # ifndef PNG_WRITE_zTXt_SUPPORTED ++unsupported_chunks; + /* In libpng 1.7 this now does an app-error, so stop it: */ + text_ptr[num_text].compression = PNG_TEXT_COMPRESSION_NONE; # endif break; @@ -840,6 +861,7 @@ pngtest_check_text_support(png_const_structp png_ptr, png_textp text_ptr, case PNG_ITXT_COMPRESSION_zTXt: # ifndef PNG_WRITE_iTXt_SUPPORTED ++unsupported_chunks; + text_ptr[num_text].compression = PNG_TEXT_COMPRESSION_NONE; # endif break; @@ -866,16 +888,19 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) png_structp write_ptr; png_infop write_info_ptr; png_infop write_end_info_ptr; +#ifdef PNG_WRITE_FILTER_SUPPORTED int interlace_preserved = 1; -#else +#endif /* WRITE_FILTER */ +#else /* !WRITE */ png_structp write_ptr = NULL; png_infop write_info_ptr = NULL; png_infop write_end_info_ptr = NULL; -#endif +#endif /* !WRITE */ png_bytep row_buf; png_uint_32 y; png_uint_32 width, height; - int num_pass = 1, pass; + volatile int num_passes; + int pass; int bit_depth, color_type; row_buf = NULL; @@ -1028,14 +1053,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) } #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED - { - int i; - - for (i = 0; i<256; i++) - filters_used[i] = 0; - - png_set_read_user_transform_fn(read_ptr, count_filters); - } + png_set_read_user_transform_fn(read_ptr, read_user_callback); #endif #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED zero_samples = 0; @@ -1082,27 +1100,27 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) { png_set_IHDR(write_ptr, write_info_ptr, width, height, bit_depth, color_type, interlace_type, compression_type, filter_type); -#ifndef PNG_READ_INTERLACING_SUPPORTED - /* num_pass will not be set below, set it here if the image is - * interlaced: what happens is that write interlacing is *not* turned - * on an the partial interlaced rows are written directly. + /* num_passes may not be available below if interlace support is not + * provided by libpng for both read and write. */ switch (interlace_type) { case PNG_INTERLACE_NONE: - num_pass = 1; + num_passes = 1; break; case PNG_INTERLACE_ADAM7: - num_pass = 7; - break; + num_passes = 7; + break; default: - png_error(read_ptr, "invalid interlace type"); - /*NOT REACHED*/ + png_error(read_ptr, "invalid interlace type"); + /*NOT REACHED*/ } -#endif } + + else + png_error(read_ptr, "png_get_IHDR failed"); } #ifdef PNG_FIXED_POINT_SUPPORTED #ifdef PNG_cHRM_SUPPORTED @@ -1273,6 +1291,19 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) #endif #endif #endif + +#ifdef PNG_sPLT_SUPPORTED + { + png_sPLT_tp entries; + + int num_entries = (int) png_get_sPLT(read_ptr, read_info_ptr, &entries); + if (num_entries) + { + png_set_sPLT(write_ptr, write_info_ptr, entries, num_entries); + } + } +#endif + #ifdef PNG_TEXT_SUPPORTED { png_textp text_ptr; @@ -1394,21 +1425,49 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) #endif /* SINGLE_ROWBUF_ALLOC */ pngtest_debug("Writing row data"); -#ifdef PNG_READ_INTERLACING_SUPPORTED - num_pass = png_set_interlace_handling(read_ptr); - if (png_set_interlace_handling(write_ptr) != num_pass) - png_error(write_ptr, "png_set_interlace_handling: inconsistent num_pass"); -#endif +#if defined(PNG_READ_INTERLACING_SUPPORTED) &&\ + defined(PNG_WRITE_INTERLACING_SUPPORTED) + /* Both must be defined for libpng to be able to handle the interlace, + * otherwise it gets handled below by simply reading and writing the passes + * directly. + */ + if (png_set_interlace_handling(read_ptr) != num_passes) + png_error(write_ptr, + "png_set_interlace_handling(read): wrong pass count "); + if (png_set_interlace_handling(write_ptr) != num_passes) + png_error(write_ptr, + "png_set_interlace_handling(write): wrong pass count "); +#else /* png_set_interlace_handling not called on either read or write */ +# define calc_pass_height +#endif /* not using libpng interlace handling */ #ifdef PNGTEST_TIMING t_stop = (float)clock(); t_misc += (t_stop - t_start); t_start = t_stop; #endif - for (pass = 0; pass < num_pass; pass++) + for (pass = 0; pass < num_passes; pass++) { +# ifdef calc_pass_height + png_uint_32 pass_height; + + if (num_passes == 7) /* interlaced */ + { + if (PNG_PASS_COLS(width, pass) > 0) + pass_height = PNG_PASS_ROWS(height, pass); + + else + pass_height = 0; + } + + else /* not interlaced */ + pass_height = height; +# else +# define pass_height height +# endif + pngtest_debug1("Writing row data for pass %d", pass); - for (y = 0; y < height; y++) + for (y = 0; y < pass_height; y++) { #ifndef SINGLE_ROWBUF_ALLOC pngtest_debug2("Allocating row buffer (pass %d, y = %u)...", pass, y); @@ -1598,7 +1657,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) } # ifdef PNG_WRITE_SUPPORTED - /* If there we no write support nothing was written! */ + /* If there is no write support nothing was written! */ else if (unsupported_chunks > 0) { fprintf(STDERR, "\n %s: unsupported chunks (%d)%s", @@ -1629,7 +1688,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) return (1); } -#ifdef PNG_WRITE_SUPPORTED /* else nothing was written */ +#if defined (PNG_WRITE_SUPPORTED) /* else nothing was written */ &&\ + defined (PNG_WRITE_FILTER_SUPPORTED) if (interlace_preserved != 0) /* else the files will be changed */ { for (;;) @@ -1706,7 +1766,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) } } } -#endif /* WRITE */ +#endif /* WRITE && WRITE_FILTER */ FCLOSE(fpin); FCLOSE(fpout); @@ -1729,6 +1789,8 @@ main(int argc, char *argv[]) int multiple = 0; int ierror = 0; + png_structp dummy_ptr; + fprintf(STDERR, "\n Testing libpng version %s\n", PNG_LIBPNG_VER_STRING); fprintf(STDERR, " with zlib version %s\n", ZLIB_VERSION); fprintf(STDERR, "%s", png_get_copyright(NULL)); @@ -1843,26 +1905,17 @@ main(int argc, char *argv[]) kerror = test_one_file(argv[i], outname); if (kerror == 0) { -#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED - int k; -#endif #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED fprintf(STDERR, "\n PASS (%lu zero samples)\n", (unsigned long)zero_samples); #else fprintf(STDERR, " PASS\n"); #endif -#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED - for (k = 0; k<256; k++) - if (filters_used[k] != 0) - fprintf(STDERR, " Filter %d was used %lu times\n", - k, (unsigned long)filters_used[k]); -#endif #ifdef PNG_TIME_RFC1123_SUPPORTED - if (tIME_chunk_present != 0) - fprintf(STDERR, " tIME = %s\n", tIME_string); + if (tIME_chunk_present != 0) + fprintf(STDERR, " tIME = %s\n", tIME_string); - tIME_chunk_present = 0; + tIME_chunk_present = 0; #endif /* TIME_RFC1123 */ } @@ -1934,21 +1987,12 @@ main(int argc, char *argv[]) { if (verbose == 1 || i == 2) { -#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED - int k; -#endif #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED fprintf(STDERR, "\n PASS (%lu zero samples)\n", (unsigned long)zero_samples); #else fprintf(STDERR, " PASS\n"); #endif -#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED - for (k = 0; k<256; k++) - if (filters_used[k] != 0) - fprintf(STDERR, " Filter %d was used %lu times\n", - k, (unsigned long)filters_used[k]); -#endif #ifdef PNG_TIME_RFC1123_SUPPORTED if (tIME_chunk_present != 0) fprintf(STDERR, " tIME = %s\n", tIME_string); @@ -2022,6 +2066,24 @@ main(int argc, char *argv[]) else fprintf(STDERR, " libpng FAILS test\n"); + dummy_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + fprintf(STDERR, " Default limits:\n"); + fprintf(STDERR, " width_max = %lu\n", + (unsigned long) png_get_user_width_max(dummy_ptr)); + fprintf(STDERR, " height_max = %lu\n", + (unsigned long) png_get_user_height_max(dummy_ptr)); + if (png_get_chunk_cache_max(dummy_ptr) == 0) + fprintf(STDERR, " cache_max = unlimited\n"); + else + fprintf(STDERR, " cache_max = %lu\n", + (unsigned long) png_get_chunk_cache_max(dummy_ptr)); + if (png_get_chunk_malloc_max(dummy_ptr) == 0) + fprintf(STDERR, " malloc_max = unlimited\n"); + else + fprintf(STDERR, " malloc_max = %lu\n", + (unsigned long) png_get_chunk_malloc_max(dummy_ptr)); + png_destroy_read_struct(&dummy_ptr, NULL, NULL); + return (int)(ierror != 0); } #else @@ -2036,4 +2098,4 @@ main(void) #endif /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_16 Your_png_h_is_not_version_1_6_16; +typedef png_libpng_version_1_6_20 Your_png_h_is_not_version_1_6_20; diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngtrans.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngtrans.c index 5b95db8c66b..d6016df53ec 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngtrans.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngtrans.c @@ -29,8 +29,8 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.18 [July 23, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -58,7 +58,7 @@ png_set_bgr(png_structrp png_ptr) #endif #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -/* Turn on 16 bit byte swapping */ +/* Turn on 16-bit byte swapping */ void PNGAPI png_set_swap(png_structrp png_ptr) { @@ -341,7 +341,7 @@ png_do_invert(png_row_infop row_info, png_bytep row) #ifdef PNG_16BIT_SUPPORTED #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -/* Swaps byte order on 16 bit depth images */ +/* Swaps byte order on 16-bit depth images */ void /* PRIVATE */ png_do_swap(png_row_infop row_info, png_bytep row) { @@ -732,7 +732,7 @@ png_do_check_palette_indexes(png_structrp png_ptr, png_row_infop row_info) */ for (; rp > png_ptr->row_buf; rp--) { - if (*rp >> padding != 0) + if ((*rp >> padding) != 0) png_ptr->num_palette_max = 1; padding = 0; } diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwio.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwio.c index 017a9d7b31b..7268523c3f9 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwio.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwio.c @@ -54,7 +54,7 @@ * writes to a file pointer. Note that this routine sometimes gets called * with very small lengths, so you should implement some kind of simple * buffering if you are using unbuffered writes. This should never be asked - * to write more than 64K on a 16 bit machine. + * to write more than 64K on a 16-bit machine. */ void /* PRIVATE */ diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwrite.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwrite.c index 1d39e7490f7..d7d751d36fe 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwrite.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwrite.c @@ -29,8 +29,8 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.19 [November 12, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -118,43 +118,44 @@ png_write_info_before_PLTE(png_structrp png_ptr, png_const_inforp info_ptr) if ((png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE) == 0) { - /* Write PNG signature */ - png_write_sig(png_ptr); + /* Write PNG signature */ + png_write_sig(png_ptr); #ifdef PNG_MNG_FEATURES_SUPPORTED - if ((png_ptr->mode & PNG_HAVE_PNG_SIGNATURE) != 0 && \ - png_ptr->mng_features_permitted != 0) - { - png_warning(png_ptr, "MNG features are not allowed in a PNG datastream"); - png_ptr->mng_features_permitted = 0; - } + if ((png_ptr->mode & PNG_HAVE_PNG_SIGNATURE) != 0 && \ + png_ptr->mng_features_permitted != 0) + { + png_warning(png_ptr, + "MNG features are not allowed in a PNG datastream"); + png_ptr->mng_features_permitted = 0; + } #endif - /* Write IHDR information. */ - png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height, - info_ptr->bit_depth, info_ptr->color_type, info_ptr->compression_type, - info_ptr->filter_type, + /* Write IHDR information. */ + png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height, + info_ptr->bit_depth, info_ptr->color_type, info_ptr->compression_type, + info_ptr->filter_type, #ifdef PNG_WRITE_INTERLACING_SUPPORTED - info_ptr->interlace_type + info_ptr->interlace_type #else - 0 + 0 #endif - ); + ); - /* The rest of these check to see if the valid field has the appropriate - * flag set, and if it does, writes the chunk. - * - * 1.6.0: COLORSPACE support controls the writing of these chunks too, and - * the chunks will be written if the WRITE routine is there and information - * is available in the COLORSPACE. (See png_colorspace_sync_info in png.c - * for where the valid flags get set.) - * - * Under certain circumstances the colorspace can be invalidated without - * syncing the info_struct 'valid' flags; this happens if libpng detects and - * error and calls png_error while the color space is being set, yet the - * application continues writing the PNG. So check the 'invalid' flag here - * too. - */ + /* The rest of these check to see if the valid field has the appropriate + * flag set, and if it does, writes the chunk. + * + * 1.6.0: COLORSPACE support controls the writing of these chunks too, and + * the chunks will be written if the WRITE routine is there and + * information * is available in the COLORSPACE. (See + * png_colorspace_sync_info in png.c for where the valid flags get set.) + * + * Under certain circumstances the colorspace can be invalidated without + * syncing the info_struct 'valid' flags; this happens if libpng detects + * an error and calls png_error while the color space is being set, yet + * the application continues writing the PNG. So check the 'invalid' + * flag here too. + */ #ifdef PNG_GAMMA_SUPPORTED # ifdef PNG_WRITE_gAMA_SUPPORTED if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && @@ -165,50 +166,50 @@ png_write_info_before_PLTE(png_structrp png_ptr, png_const_inforp info_ptr) #endif #ifdef PNG_COLORSPACE_SUPPORTED - /* Write only one of sRGB or an ICC profile. If a profile was supplied - * and it matches one of the known sRGB ones issue a warning. - */ + /* Write only one of sRGB or an ICC profile. If a profile was supplied + * and it matches one of the known sRGB ones issue a warning. + */ # ifdef PNG_WRITE_iCCP_SUPPORTED - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && - (info_ptr->valid & PNG_INFO_iCCP) != 0) - { -# ifdef PNG_WRITE_sRGB_SUPPORTED - if ((info_ptr->valid & PNG_INFO_sRGB) != 0) - png_app_warning(png_ptr, - "profile matches sRGB but writing iCCP instead"); -# endif + if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && + (info_ptr->valid & PNG_INFO_iCCP) != 0) + { +# ifdef PNG_WRITE_sRGB_SUPPORTED + if ((info_ptr->valid & PNG_INFO_sRGB) != 0) + png_app_warning(png_ptr, + "profile matches sRGB but writing iCCP instead"); +# endif - png_write_iCCP(png_ptr, info_ptr->iccp_name, - info_ptr->iccp_profile); - } + png_write_iCCP(png_ptr, info_ptr->iccp_name, + info_ptr->iccp_profile); + } # ifdef PNG_WRITE_sRGB_SUPPORTED else # endif # endif # ifdef PNG_WRITE_sRGB_SUPPORTED - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && - (info_ptr->valid & PNG_INFO_sRGB) != 0) - png_write_sRGB(png_ptr, info_ptr->colorspace.rendering_intent); + if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && + (info_ptr->valid & PNG_INFO_sRGB) != 0) + png_write_sRGB(png_ptr, info_ptr->colorspace.rendering_intent); # endif /* WRITE_sRGB */ #endif /* COLORSPACE */ #ifdef PNG_WRITE_sBIT_SUPPORTED - if ((info_ptr->valid & PNG_INFO_sBIT) != 0) - png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type); + if ((info_ptr->valid & PNG_INFO_sBIT) != 0) + png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type); #endif #ifdef PNG_COLORSPACE_SUPPORTED # ifdef PNG_WRITE_cHRM_SUPPORTED - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && - (info_ptr->colorspace.flags & PNG_COLORSPACE_FROM_cHRM) != 0 && - (info_ptr->valid & PNG_INFO_cHRM) != 0) - png_write_cHRM_fixed(png_ptr, &info_ptr->colorspace.end_points_xy); + if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && + (info_ptr->colorspace.flags & PNG_COLORSPACE_FROM_cHRM) != 0 && + (info_ptr->valid & PNG_INFO_cHRM) != 0) + png_write_cHRM_fixed(png_ptr, &info_ptr->colorspace.end_points_xy); # endif #endif #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED - write_unknown_chunks(png_ptr, info_ptr, PNG_HAVE_IHDR); + write_unknown_chunks(png_ptr, info_ptr, PNG_HAVE_IHDR); #endif png_ptr->mode |= PNG_WROTE_INFO_BEFORE_PLTE; @@ -233,7 +234,7 @@ png_write_info(png_structrp png_ptr, png_const_inforp info_ptr) png_write_PLTE(png_ptr, info_ptr->palette, (png_uint_32)info_ptr->num_palette); - else if ((info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) !=0) + else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) png_error(png_ptr, "Valid palette required for paletted images"); #ifdef PNG_WRITE_tRNS_SUPPORTED @@ -244,8 +245,13 @@ png_write_info(png_structrp png_ptr, png_const_inforp info_ptr) if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0 && info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { - int j; - for (j = 0; j<(int)info_ptr->num_trans; j++) + int j, jend; + + jend = info_ptr->num_trans; + if (jend > PNG_MAX_PALETTE_LENGTH) + jend = PNG_MAX_PALETTE_LENGTH; + + for (j = 0; jtrans_alpha[j] = (png_byte)(255 - info_ptr->trans_alpha[j]); } @@ -566,7 +572,7 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr, /* App warnings are warnings in release (or release candidate) builds but * are errors during development. */ -#if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC +#if PNG_RELEASE_BUILD png_ptr->flags |= PNG_FLAG_APP_WARNINGS_WARN; #endif @@ -666,8 +672,8 @@ png_do_write_intrapixel(png_row_infop row_info, png_bytep row) for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) { - *(rp) = (png_byte)((*rp - *(rp + 1)) & 0xff); - *(rp + 2) = (png_byte)((*(rp + 2) - *(rp + 1)) & 0xff); + *(rp) = (png_byte)(*rp - *(rp + 1)); + *(rp + 2) = (png_byte)(*(rp + 2) - *(rp + 1)); } } @@ -693,10 +699,10 @@ png_do_write_intrapixel(png_row_infop row_info, png_bytep row) png_uint_32 s2 = (*(rp + 4) << 8) | *(rp + 5); png_uint_32 red = (png_uint_32)((s0 - s1) & 0xffffL); png_uint_32 blue = (png_uint_32)((s2 - s1) & 0xffffL); - *(rp ) = (png_byte)((red >> 8) & 0xff); - *(rp + 1) = (png_byte)(red & 0xff); - *(rp + 4) = (png_byte)((blue >> 8) & 0xff); - *(rp + 5) = (png_byte)(blue & 0xff); + *(rp ) = (png_byte)(red >> 8); + *(rp + 1) = (png_byte)red; + *(rp + 4) = (png_byte)(blue >> 8); + *(rp + 5) = (png_byte)blue; } } #endif /* WRITE_16BIT */ @@ -877,7 +883,7 @@ png_write_row(png_structrp png_ptr, png_const_bytep row) * which is also the output depth. */ if (row_info.pixel_depth != png_ptr->pixel_depth || - row_info.pixel_depth != png_ptr->transformed_pixel_depth) + row_info.pixel_depth != png_ptr->transformed_pixel_depth) png_error(png_ptr, "internal write transform logic error"); #ifdef PNG_MNG_FEATURES_SUPPORTED @@ -945,10 +951,6 @@ png_write_flush(png_structrp png_ptr) } #endif /* WRITE_FLUSH */ -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED -static void png_reset_filter_heuristics(png_structrp png_ptr);/* forward decl */ -#endif - /* Free any memory used in png_ptr struct without freeing the struct itself. */ static void png_write_destroy(png_structrp png_ptr) @@ -965,24 +967,11 @@ png_write_destroy(png_structrp png_ptr) png_ptr->row_buf = NULL; #ifdef PNG_WRITE_FILTER_SUPPORTED png_free(png_ptr, png_ptr->prev_row); - png_free(png_ptr, png_ptr->sub_row); - png_free(png_ptr, png_ptr->up_row); - png_free(png_ptr, png_ptr->avg_row); - png_free(png_ptr, png_ptr->paeth_row); + png_free(png_ptr, png_ptr->try_row); + png_free(png_ptr, png_ptr->tst_row); png_ptr->prev_row = NULL; - png_ptr->sub_row = NULL; - png_ptr->up_row = NULL; - png_ptr->avg_row = NULL; - png_ptr->paeth_row = NULL; -#endif - -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - /* Use this to save a little code space, it doesn't free the filter_costs */ - png_reset_filter_heuristics(png_ptr); - png_free(png_ptr, png_ptr->filter_costs); - png_free(png_ptr, png_ptr->inv_filter_costs); - png_ptr->filter_costs = NULL; - png_ptr->inv_filter_costs = NULL; + png_ptr->try_row = NULL; + png_ptr->tst_row = NULL; #endif #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED @@ -1072,211 +1061,85 @@ png_set_filter(png_structrp png_ptr, int method, int filters) #endif /* WRITE_FILTER */ } +#ifdef PNG_WRITE_FILTER_SUPPORTED /* If we have allocated the row_buf, this means we have already started * with the image and we should have allocated all of the filter buffers * that have been selected. If prev_row isn't already allocated, then * it is too late to start using the filters that need it, since we * will be missing the data in the previous row. If an application * wants to start and stop using particular filters during compression, - * it should start out with all of the filters, and then add and - * remove them after the start of compression. + * it should start out with all of the filters, and then remove them + * or add them back after the start of compression. + * + * NOTE: this is a nasty constraint on the code, because it means that the + * prev_row buffer must be maintained even if there are currently no + * 'prev_row' requiring filters active. */ if (png_ptr->row_buf != NULL) { -#ifdef PNG_WRITE_FILTER_SUPPORTED - if ((png_ptr->do_filter & PNG_FILTER_SUB) != 0 && - png_ptr->sub_row == NULL) + int num_filters; + png_alloc_size_t buf_size; + + /* Repeat the checks in png_write_start_row; 1 pixel high or wide + * images cannot benefit from certain filters. If this isn't done here + * the check below will fire on 1 pixel high images. + */ + if (png_ptr->height == 1) + filters &= ~(PNG_FILTER_UP|PNG_FILTER_AVG|PNG_FILTER_PAETH); + + if (png_ptr->width == 1) + filters &= ~(PNG_FILTER_SUB|PNG_FILTER_AVG|PNG_FILTER_PAETH); + + if ((filters & (PNG_FILTER_UP|PNG_FILTER_AVG|PNG_FILTER_PAETH)) != 0 + && png_ptr->prev_row == NULL) { - png_ptr->sub_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB; + /* This is the error case, however it is benign - the previous row + * is not available so the filter can't be used. Just warn here. + */ + png_app_warning(png_ptr, + "png_set_filter: UP/AVG/PAETH cannot be added after start"); + filters &= ~(PNG_FILTER_UP|PNG_FILTER_AVG|PNG_FILTER_PAETH); } - if ((png_ptr->do_filter & PNG_FILTER_UP) != 0 && - png_ptr->up_row == NULL) + num_filters = 0; + + if (filters & PNG_FILTER_SUB) + num_filters++; + + if (filters & PNG_FILTER_UP) + num_filters++; + + if (filters & PNG_FILTER_AVG) + num_filters++; + + if (filters & PNG_FILTER_PAETH) + num_filters++; + + /* Allocate needed row buffers if they have not already been + * allocated. + */ + buf_size = PNG_ROWBYTES(png_ptr->usr_channels * png_ptr->usr_bit_depth, + png_ptr->width) + 1; + + if (png_ptr->try_row == NULL) + png_ptr->try_row = png_voidcast(png_bytep, + png_malloc(png_ptr, buf_size)); + + if (num_filters > 1) { - if (png_ptr->prev_row == NULL) - { - png_warning(png_ptr, "Can't add Up filter after starting"); - png_ptr->do_filter = (png_byte)(png_ptr->do_filter & - ~PNG_FILTER_UP); - } - - else - { - png_ptr->up_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->up_row[0] = PNG_FILTER_VALUE_UP; - } + if (png_ptr->tst_row == NULL) + png_ptr->tst_row = png_voidcast(png_bytep, + png_malloc(png_ptr, buf_size)); } - - if ((png_ptr->do_filter & PNG_FILTER_AVG) != 0 && - png_ptr->avg_row == NULL) - { - if (png_ptr->prev_row == NULL) - { - png_warning(png_ptr, "Can't add Average filter after starting"); - png_ptr->do_filter = (png_byte)(png_ptr->do_filter & - ~PNG_FILTER_AVG); - } - - else - { - png_ptr->avg_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG; - } - } - - if ((png_ptr->do_filter & PNG_FILTER_PAETH) != 0 && - png_ptr->paeth_row == NULL) - { - if (png_ptr->prev_row == NULL) - { - png_warning(png_ptr, "Can't add Paeth filter after starting"); - png_ptr->do_filter &= (png_byte)(~PNG_FILTER_PAETH); - } - - else - { - png_ptr->paeth_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH; - } - } - - if (png_ptr->do_filter == PNG_NO_FILTERS) -#endif /* WRITE_FILTER */ - png_ptr->do_filter = PNG_FILTER_NONE; } + png_ptr->do_filter = (png_byte)filters; +#endif } else png_error(png_ptr, "Unknown custom filter method"); } -/* This allows us to influence the way in which libpng chooses the "best" - * filter for the current scanline. While the "minimum-sum-of-absolute- - * differences metric is relatively fast and effective, there is some - * question as to whether it can be improved upon by trying to keep the - * filtered data going to zlib more consistent, hopefully resulting in - * better compression. - */ -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* GRR 970116 */ -/* Convenience reset API. */ -static void -png_reset_filter_heuristics(png_structrp png_ptr) -{ - /* Clear out any old values in the 'weights' - this must be done because if - * the app calls set_filter_heuristics multiple times with different - * 'num_weights' values we would otherwise potentially have wrong sized - * arrays. - */ - png_ptr->num_prev_filters = 0; - png_ptr->heuristic_method = PNG_FILTER_HEURISTIC_UNWEIGHTED; - if (png_ptr->prev_filters != NULL) - { - png_bytep old = png_ptr->prev_filters; - png_ptr->prev_filters = NULL; - png_free(png_ptr, old); - } - if (png_ptr->filter_weights != NULL) - { - png_uint_16p old = png_ptr->filter_weights; - png_ptr->filter_weights = NULL; - png_free(png_ptr, old); - } - - if (png_ptr->inv_filter_weights != NULL) - { - png_uint_16p old = png_ptr->inv_filter_weights; - png_ptr->inv_filter_weights = NULL; - png_free(png_ptr, old); - } - - /* Leave the filter_costs - this array is fixed size. */ -} - -static int -png_init_filter_heuristics(png_structrp png_ptr, int heuristic_method, - int num_weights) -{ - if (png_ptr == NULL) - return 0; - - /* Clear out the arrays */ - png_reset_filter_heuristics(png_ptr); - - /* Check arguments; the 'reset' function makes the correct settings for the - * unweighted case, but we must handle the weight case by initializing the - * arrays for the caller. - */ - if (heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int i; - - if (num_weights > 0) - { - png_ptr->prev_filters = (png_bytep)png_malloc(png_ptr, - (png_uint_32)((sizeof (png_byte)) * num_weights)); - - /* To make sure that the weighting starts out fairly */ - for (i = 0; i < num_weights; i++) - { - png_ptr->prev_filters[i] = 255; - } - - png_ptr->filter_weights = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)((sizeof (png_uint_16)) * num_weights)); - - png_ptr->inv_filter_weights = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)((sizeof (png_uint_16)) * num_weights)); - - for (i = 0; i < num_weights; i++) - { - png_ptr->inv_filter_weights[i] = - png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR; - } - - /* Safe to set this now */ - png_ptr->num_prev_filters = (png_byte)num_weights; - } - - /* If, in the future, there are other filter methods, this would - * need to be based on png_ptr->filter. - */ - if (png_ptr->filter_costs == NULL) - { - png_ptr->filter_costs = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)((sizeof (png_uint_16)) * PNG_FILTER_VALUE_LAST)); - - png_ptr->inv_filter_costs = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)((sizeof (png_uint_16)) * PNG_FILTER_VALUE_LAST)); - } - - for (i = 0; i < PNG_FILTER_VALUE_LAST; i++) - { - png_ptr->inv_filter_costs[i] = - png_ptr->filter_costs[i] = PNG_COST_FACTOR; - } - - /* All the arrays are inited, safe to set this: */ - png_ptr->heuristic_method = PNG_FILTER_HEURISTIC_WEIGHTED; - - /* Return the 'ok' code. */ - return 1; - } - else if (heuristic_method == PNG_FILTER_HEURISTIC_DEFAULT || - heuristic_method == PNG_FILTER_HEURISTIC_UNWEIGHTED) - { - return 1; - } - else - { - png_warning(png_ptr, "Unknown filter heuristic method"); - return 0; - } -} - +#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* DEPRECATED */ /* Provide floating and fixed point APIs */ #ifdef PNG_FLOATING_POINT_SUPPORTED void PNGAPI @@ -1284,52 +1147,11 @@ png_set_filter_heuristics(png_structrp png_ptr, int heuristic_method, int num_weights, png_const_doublep filter_weights, png_const_doublep filter_costs) { - png_debug(1, "in png_set_filter_heuristics"); - - /* The internal API allocates all the arrays and ensures that the elements of - * those arrays are set to the default value. - */ - if (png_init_filter_heuristics(png_ptr, heuristic_method, num_weights) == 0) - return; - - /* If using the weighted method copy in the weights. */ - if (heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int i; - for (i = 0; i < num_weights; i++) - { - if (filter_weights[i] <= 0.0) - { - png_ptr->inv_filter_weights[i] = - png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR; - } - - else - { - png_ptr->inv_filter_weights[i] = - (png_uint_16)(PNG_WEIGHT_FACTOR*filter_weights[i]+.5); - - png_ptr->filter_weights[i] = - (png_uint_16)(PNG_WEIGHT_FACTOR/filter_weights[i]+.5); - } - } - - /* Here is where we set the relative costs of the different filters. We - * should take the desired compression level into account when setting - * the costs, so that Paeth, for instance, has a high relative cost at low - * compression levels, while it has a lower relative cost at higher - * compression settings. The filter types are in order of increasing - * relative cost, so it would be possible to do this with an algorithm. - */ - for (i = 0; i < PNG_FILTER_VALUE_LAST; i++) if (filter_costs[i] >= 1.0) - { - png_ptr->inv_filter_costs[i] = - (png_uint_16)(PNG_COST_FACTOR / filter_costs[i] + .5); - - png_ptr->filter_costs[i] = - (png_uint_16)(PNG_COST_FACTOR * filter_costs[i] + .5); - } - } + PNG_UNUSED(png_ptr) + PNG_UNUSED(heuristic_method) + PNG_UNUSED(num_weights) + PNG_UNUSED(filter_weights) + PNG_UNUSED(filter_costs) } #endif /* FLOATING_POINT */ @@ -1339,67 +1161,16 @@ png_set_filter_heuristics_fixed(png_structrp png_ptr, int heuristic_method, int num_weights, png_const_fixed_point_p filter_weights, png_const_fixed_point_p filter_costs) { - png_debug(1, "in png_set_filter_heuristics_fixed"); - - /* The internal API allocates all the arrays and ensures that the elements of - * those arrays are set to the default value. - */ - if (png_init_filter_heuristics(png_ptr, heuristic_method, num_weights) == 0) - return; - - /* If using the weighted method copy in the weights. */ - if (heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int i; - for (i = 0; i < num_weights; i++) - { - if (filter_weights[i] <= 0) - { - png_ptr->inv_filter_weights[i] = - png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR; - } - - else - { - png_ptr->inv_filter_weights[i] = (png_uint_16) - ((PNG_WEIGHT_FACTOR*filter_weights[i]+PNG_FP_HALF)/PNG_FP_1); - - png_ptr->filter_weights[i] = (png_uint_16)((PNG_WEIGHT_FACTOR* - PNG_FP_1+(filter_weights[i]/2))/filter_weights[i]); - } - } - - /* Here is where we set the relative costs of the different filters. We - * should take the desired compression level into account when setting - * the costs, so that Paeth, for instance, has a high relative cost at low - * compression levels, while it has a lower relative cost at higher - * compression settings. The filter types are in order of increasing - * relative cost, so it would be possible to do this with an algorithm. - */ - for (i = 0; i < PNG_FILTER_VALUE_LAST; i++) - if (filter_costs[i] >= PNG_FP_1) - { - png_uint_32 tmp; - - /* Use a 32 bit unsigned temporary here because otherwise the - * intermediate value will be a 32 bit *signed* integer (ANSI rules) - * and this will get the wrong answer on division. - */ - tmp = PNG_COST_FACTOR*PNG_FP_1 + (filter_costs[i]/2); - tmp /= filter_costs[i]; - - png_ptr->inv_filter_costs[i] = (png_uint_16)tmp; - - tmp = PNG_COST_FACTOR * filter_costs[i] + PNG_FP_HALF; - tmp /= PNG_FP_1; - - png_ptr->filter_costs[i] = (png_uint_16)tmp; - } - } + PNG_UNUSED(png_ptr) + PNG_UNUSED(heuristic_method) + PNG_UNUSED(num_weights) + PNG_UNUSED(filter_weights) + PNG_UNUSED(filter_costs) } #endif /* FIXED_POINT */ #endif /* WRITE_WEIGHTED_FILTER */ +#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED void PNGAPI png_set_compression_level(png_structrp png_ptr, int level) { @@ -1445,8 +1216,8 @@ png_set_compression_window_bits(png_structrp png_ptr, int window_bits) if (png_ptr == NULL) return; - /* Prior to 1.6.0 this would warn but then set the window_bits value, this - * meant that negative window bits values could be selected which would cause + /* Prior to 1.6.0 this would warn but then set the window_bits value. This + * meant that negative window bits values could be selected that would cause * libpng to write a non-standard PNG file with raw deflate or gzip * compressed IDAT or ancillary chunks. Such files can be read and there is * no warning on read, so this seems like a very bad idea. @@ -1482,6 +1253,7 @@ png_set_compression_method(png_structrp png_ptr, int method) png_ptr->zlib_method = method; } +#endif /* WRITE_CUSTOMIZE_COMPRESSION */ /* The following were added to libpng-1.5.4 */ #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED @@ -1642,14 +1414,14 @@ png_write_png(png_structrp png_ptr, png_inforp info_ptr, * alpha channel. */ if ((transforms & (PNG_TRANSFORM_STRIP_FILLER_AFTER| - PNG_TRANSFORM_STRIP_FILLER_BEFORE)) != 0) + PNG_TRANSFORM_STRIP_FILLER_BEFORE)) != 0) { #ifdef PNG_WRITE_FILLER_SUPPORTED if ((transforms & PNG_TRANSFORM_STRIP_FILLER_AFTER) != 0) { if ((transforms & PNG_TRANSFORM_STRIP_FILLER_BEFORE) != 0) png_app_error(png_ptr, - "PNG_TRANSFORM_STRIP_FILLER: BEFORE+AFTER not supported"); + "PNG_TRANSFORM_STRIP_FILLER: BEFORE+AFTER not supported"); /* Continue if ignored - this is the pre-1.6.10 behavior */ png_set_filler(png_ptr, 0, PNG_FILLER_AFTER); @@ -1678,7 +1450,7 @@ png_write_png(png_structrp png_ptr, png_inforp info_ptr, png_app_error(png_ptr, "PNG_TRANSFORM_SWAP_ENDIAN not supported"); #endif - /* Swap bits of 1, 2, 4 bit packed pixel formats */ + /* Swap bits of 1-bit, 2-bit, 4-bit packed pixel formats */ if ((transforms & PNG_TRANSFORM_PACKSWAP) != 0) #ifdef PNG_WRITE_PACKSWAP_SUPPORTED png_set_packswap(png_ptr); @@ -1708,13 +1480,13 @@ png_write_png(png_structrp png_ptr, png_inforp info_ptr, #ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED -#ifdef PNG_STDIO_SUPPORTED /* currently required for png_image_write_* */ +# ifdef PNG_STDIO_SUPPORTED /* currently required for png_image_write_* */ /* Initialize the write structure - general purpose utility. */ static int png_image_write_init(png_imagep image) { png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, image, - png_safe_error, png_safe_warning); + png_safe_error, png_safe_warning); if (png_ptr != NULL) { @@ -1723,7 +1495,7 @@ png_image_write_init(png_imagep image) if (info_ptr != NULL) { png_controlp control = png_voidcast(png_controlp, - png_malloc_warn(png_ptr, (sizeof *control))); + png_malloc_warn(png_ptr, (sizeof *control))); if (control != NULL) { @@ -1770,12 +1542,12 @@ static int png_write_image_16bit(png_voidp argument) { png_image_write_control *display = png_voidcast(png_image_write_control*, - argument); + argument); png_imagep image = display->image; png_structrp png_ptr = image->opaque->png_ptr; png_const_uint_16p input_row = png_voidcast(png_const_uint_16p, - display->first_row); + display->first_row); png_uint_16p output_row = png_voidcast(png_uint_16p, display->local_row); png_uint_16p row_end; const int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? 3 : 1; @@ -1784,17 +1556,18 @@ png_write_image_16bit(png_voidp argument) if ((image->format & PNG_FORMAT_FLAG_ALPHA) != 0) { -# ifdef PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED - if ((image->format & PNG_FORMAT_FLAG_AFIRST) != 0) - { - aindex = -1; - ++input_row; /* To point to the first component */ - ++output_row; - } - +# ifdef PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED + if ((image->format & PNG_FORMAT_FLAG_AFIRST) != 0) + { + aindex = -1; + ++input_row; /* To point to the first component */ + ++output_row; + } else -# endif + aindex = channels; +# else aindex = channels; +# endif } else @@ -1876,7 +1649,7 @@ png_write_image_16bit(png_voidp argument) * calculation can be done to 15 bits of accuracy; however, the output needs to * be scaled in the range 0..255*65535, so include that scaling here. */ -#define UNP_RECIPROCAL(alpha) ((((0xffff*0xff)<<7)+(alpha>>1))/alpha) +# define UNP_RECIPROCAL(alpha) ((((0xffff*0xff)<<7)+(alpha>>1))/alpha) static png_byte png_unpremultiply(png_uint_32 component, png_uint_32 alpha, @@ -1927,12 +1700,12 @@ static int png_write_image_8bit(png_voidp argument) { png_image_write_control *display = png_voidcast(png_image_write_control*, - argument); + argument); png_imagep image = display->image; png_structrp png_ptr = image->opaque->png_ptr; png_const_uint_16p input_row = png_voidcast(png_const_uint_16p, - display->first_row); + display->first_row); png_bytep output_row = png_voidcast(png_bytep, display->local_row); png_uint_32 y = image->height; const int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? 3 : 1; @@ -1942,17 +1715,17 @@ png_write_image_8bit(png_voidp argument) png_bytep row_end; int aindex; -# ifdef PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED - if ((image->format & PNG_FORMAT_FLAG_AFIRST) != 0) - { - aindex = -1; - ++input_row; /* To point to the first component */ - ++output_row; - } +# ifdef PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED + if ((image->format & PNG_FORMAT_FLAG_AFIRST) != 0) + { + aindex = -1; + ++input_row; /* To point to the first component */ + ++output_row; + } - else -# endif - aindex = channels; + else +# endif + aindex = channels; /* Use row_end in place of a loop counter: */ row_end = output_row + image->width * (channels+1); @@ -1986,7 +1759,7 @@ png_write_image_8bit(png_voidp argument) } /* while out_ptr < row_end */ png_write_row(png_ptr, png_voidcast(png_const_bytep, - display->local_row)); + display->local_row)); input_row += display->row_bytes/(sizeof (png_uint_16)); } /* while y */ } @@ -2025,25 +1798,25 @@ png_image_set_PLTE(png_image_write_control *display) const png_imagep image = display->image; const void *cmap = display->colormap; const int entries = image->colormap_entries > 256 ? 256 : - (int)image->colormap_entries; + (int)image->colormap_entries; /* NOTE: the caller must check for cmap != NULL and entries != 0 */ const png_uint_32 format = image->format; const int channels = PNG_IMAGE_SAMPLE_CHANNELS(format); -# if defined(PNG_FORMAT_BGR_SUPPORTED) &&\ +# if defined(PNG_FORMAT_BGR_SUPPORTED) &&\ defined(PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED) const int afirst = (format & PNG_FORMAT_FLAG_AFIRST) != 0 && - (format & PNG_FORMAT_FLAG_ALPHA) != 0; -# else + (format & PNG_FORMAT_FLAG_ALPHA) != 0; +# else # define afirst 0 -# endif +# endif -# ifdef PNG_FORMAT_BGR_SUPPORTED +# ifdef PNG_FORMAT_BGR_SUPPORTED const int bgr = (format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0; -# else +# else # define bgr 0 -# endif +# endif int i, num_trans; png_color palette[256]; @@ -2068,11 +1841,11 @@ png_image_set_PLTE(png_image_write_control *display) if (channels >= 3) /* RGB */ { palette[i].blue = (png_byte)PNG_sRGB_FROM_LINEAR(255 * - entry[(2 ^ bgr)]); + entry[(2 ^ bgr)]); palette[i].green = (png_byte)PNG_sRGB_FROM_LINEAR(255 * - entry[1]); + entry[1]); palette[i].red = (png_byte)PNG_sRGB_FROM_LINEAR(255 * - entry[bgr]); + entry[bgr]); } else /* Gray */ @@ -2148,12 +1921,12 @@ png_image_set_PLTE(png_image_write_control *display) } } -# ifdef afirst +# ifdef afirst # undef afirst -# endif -# ifdef bgr +# endif +# ifdef bgr # undef bgr -# endif +# endif png_set_PLTE(image->opaque->png_ptr, image->opaque->info_ptr, palette, entries); @@ -2181,10 +1954,10 @@ png_image_write_main(png_voidp argument) int alpha = !colormap && (format & PNG_FORMAT_FLAG_ALPHA); int write_16bit = linear && !colormap && (display->convert_to_8bit == 0); -# ifdef PNG_BENIGN_ERRORS_SUPPORTED +# ifdef PNG_BENIGN_ERRORS_SUPPORTED /* Make sure we error out on any bad situation */ png_set_benign_errors(png_ptr, 0/*error*/); -# endif +# endif /* Default the 'row_stride' parameter if required. */ if (display->row_stride == 0) @@ -2253,7 +2026,7 @@ png_image_write_main(png_voidp argument) /* Now set up the data transformations (*after* the header is written), * remove the handled transformations from the 'format' flags for checking. * - * First check for a little endian system if writing 16 bit files. + * First check for a little endian system if writing 16-bit files. */ if (write_16bit != 0) { @@ -2263,23 +2036,23 @@ png_image_write_main(png_voidp argument) png_set_swap(png_ptr); } -# ifdef PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED +# ifdef PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED if ((format & PNG_FORMAT_FLAG_BGR) != 0) { if (colormap == 0 && (format & PNG_FORMAT_FLAG_COLOR) != 0) png_set_bgr(png_ptr); format &= ~PNG_FORMAT_FLAG_BGR; } -# endif +# endif -# ifdef PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED +# ifdef PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED if ((format & PNG_FORMAT_FLAG_AFIRST) != 0) { if (colormap == 0 && (format & PNG_FORMAT_FLAG_ALPHA) != 0) png_set_swap_alpha(png_ptr); format &= ~PNG_FORMAT_FLAG_AFIRST; } -# endif +# endif /* If there are 16 or fewer color-map entries we wrote a lower bit depth * above, but the application data is still byte packed. @@ -2315,7 +2088,9 @@ png_image_write_main(png_voidp argument) * it about 50 times. The speed-up in pngstest was about 10-20% of the * total (user) time on a heavily loaded system. */ +# ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED png_set_compression_level(png_ptr, 3); +# endif } /* Check for the cases that currently require a pre-transform on the row @@ -2478,6 +2253,6 @@ png_image_write_to_file(png_imagep image, const char *file_name, else return 0; } -#endif /* STDIO */ +# endif /* STDIO */ #endif /* SIMPLIFIED_WRITE */ #endif /* WRITE */ diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwtran.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwtran.c index ef015aeb7b9..44e7daf5614 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwtran.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwtran.c @@ -29,8 +29,8 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.18 [July 23, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -99,7 +99,8 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth) case 2: { png_bytep sp, dp; - int shift, v; + unsigned int shift; + int v; png_uint_32 i; png_uint_32 row_width = row_info->width; @@ -138,7 +139,8 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth) case 4: { png_bytep sp, dp; - int shift, v; + unsigned int shift; + int v; png_uint_32 i; png_uint_32 row_width = row_info->width; @@ -450,7 +452,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) *(dp++) = *(sp++); */ sp+=3; dp = sp; - *(dp++) = (png_byte)(255 - *(sp++)); + *dp = (png_byte)(255 - *(sp++)); } } @@ -474,7 +476,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) */ sp+=6; dp = sp; *(dp++) = (png_byte)(255 - *(sp++)); - *(dp++) = (png_byte)(255 - *(sp++)); + *dp = (png_byte)(255 - *(sp++)); } } #endif /* WRITE_16BIT */ @@ -512,7 +514,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) */ sp+=2; dp = sp; *(dp++) = (png_byte)(255 - *(sp++)); - *(dp++) = (png_byte)(255 - *(sp++)); + *dp = (png_byte)(255 - *(sp++)); } } #endif /* WRITE_16BIT */ diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwutil.c b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwutil.c index 66a8812d790..a51f24b94c4 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwutil.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngwutil.c @@ -29,8 +29,8 @@ * However, the following notice accompanied the original version of this * file and, per its terms, should not be removed: * - * Last changed in libpng 1.6.15 [November 20, 2014] - * Copyright (c) 1998-2014 Glenn Randers-Pehrson + * Last changed in libpng 1.6.19 [November 12, 2015] + * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -51,10 +51,10 @@ void PNGAPI png_save_uint_32(png_bytep buf, png_uint_32 i) { - buf[0] = (png_byte)((i >> 24) & 0xff); - buf[1] = (png_byte)((i >> 16) & 0xff); - buf[2] = (png_byte)((i >> 8) & 0xff); - buf[3] = (png_byte)(i & 0xff); + buf[0] = (png_byte)(i >> 24); + buf[1] = (png_byte)(i >> 16); + buf[2] = (png_byte)(i >> 8); + buf[3] = (png_byte)(i ); } /* Place a 16-bit number into a buffer in PNG byte order. @@ -64,8 +64,8 @@ png_save_uint_32(png_bytep buf, png_uint_32 i) void PNGAPI png_save_uint_16(png_bytep buf, unsigned int i) { - buf[0] = (png_byte)((i >> 8) & 0xff); - buf[1] = (png_byte)(i & 0xff); + buf[0] = (png_byte)(i >> 8); + buf[1] = (png_byte)(i ); } #endif @@ -207,7 +207,7 @@ png_write_complete_chunk(png_structrp png_ptr, png_uint_32 chunk_name, if (png_ptr == NULL) return; - /* On 64 bit architectures 'length' may not fit in a png_uint_32. */ + /* On 64-bit architectures 'length' may not fit in a png_uint_32. */ if (length > PNG_UINT_31_MAX) png_error(png_ptr, "length exceeds PNG maximum"); @@ -336,7 +336,7 @@ png_deflate_claim(png_structrp png_ptr, png_uint_32 owner, */ (void)png_safecat(msg, (sizeof msg), 10, " using zstream"); #endif -#if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC +#if PNG_RELEASE_BUILD png_warning(png_ptr, msg); /* Attempt sane error recovery */ @@ -723,7 +723,7 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key) while (*key && key_len < 79) { - png_byte ch = (png_byte)(0xff & *key++); + png_byte ch = (png_byte)*key++; if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/)) *new_key++ = ch, ++key_len, space = 0; @@ -899,7 +899,7 @@ png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height, interlace_type=PNG_INTERLACE_NONE; #endif - /* Save the relevent information */ + /* Save the relevant information */ png_ptr->bit_depth = (png_byte)bit_depth; png_ptr->color_type = (png_byte)color_type; png_ptr->interlaced = (png_byte)interlace_type; @@ -950,17 +950,20 @@ void /* PRIVATE */ png_write_PLTE(png_structrp png_ptr, png_const_colorp palette, png_uint_32 num_pal) { - png_uint_32 i; + png_uint_32 max_palette_length, i; png_const_colorp pal_ptr; png_byte buf[3]; png_debug(1, "in png_write_PLTE"); + max_palette_length = (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ? + (1 << png_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH; + if (( #ifdef PNG_MNG_FEATURES_SUPPORTED (png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) == 0 && #endif - num_pal == 0) || num_pal > 256) + num_pal == 0) || num_pal > max_palette_length) { if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { @@ -1472,7 +1475,7 @@ png_write_tRNS(png_structrp png_ptr, png_const_bytep trans_alpha, else if (color_type == PNG_COLOR_TYPE_GRAY) { - /* One 16 bit value */ + /* One 16-bit value */ if (tran->gray >= (1 << png_ptr->bit_depth)) { png_app_warning(png_ptr, @@ -1487,7 +1490,7 @@ png_write_tRNS(png_structrp png_ptr, png_const_bytep trans_alpha, else if (color_type == PNG_COLOR_TYPE_RGB) { - /* Three 16 bit values */ + /* Three 16-bit values */ png_save_uint_16(buf, tran->red); png_save_uint_16(buf + 2, tran->green); png_save_uint_16(buf + 4, tran->blue); @@ -1793,7 +1796,7 @@ png_write_iTXt(png_structrp png_ptr, int compression, png_const_charp key, png_write_compressed_data_out(png_ptr, &comp); else - png_write_chunk_data(png_ptr, (png_const_bytep)text, comp.input_len); + png_write_chunk_data(png_ptr, (png_const_bytep)text, comp.output_len); png_write_chunk_end(png_ptr); } @@ -1989,6 +1992,10 @@ png_write_start_row(png_structrp png_ptr) png_alloc_size_t buf_size; int usr_pixel_depth; +#ifdef PNG_WRITE_FILTER_SUPPORTED + png_byte filters; +#endif + png_debug(1, "in png_write_start_row"); usr_pixel_depth = png_ptr->usr_channels * png_ptr->usr_bit_depth; @@ -1999,50 +2006,54 @@ png_write_start_row(png_structrp png_ptr) png_ptr->maximum_pixel_depth = (png_byte)usr_pixel_depth; /* Set up row buffer */ - png_ptr->row_buf = (png_bytep)png_malloc(png_ptr, buf_size); + png_ptr->row_buf = png_voidcast(png_bytep, png_malloc(png_ptr, buf_size)); png_ptr->row_buf[0] = PNG_FILTER_VALUE_NONE; #ifdef PNG_WRITE_FILTER_SUPPORTED - /* Set up filtering buffer, if using this filter */ - if (png_ptr->do_filter & PNG_FILTER_SUB) - { - png_ptr->sub_row = (png_bytep)png_malloc(png_ptr, png_ptr->rowbytes + 1); + filters = png_ptr->do_filter; - png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB; + if (png_ptr->height == 1) + filters &= 0xff & ~(PNG_FILTER_UP|PNG_FILTER_AVG|PNG_FILTER_PAETH); + + if (png_ptr->width == 1) + filters &= 0xff & ~(PNG_FILTER_SUB|PNG_FILTER_AVG|PNG_FILTER_PAETH); + + if (filters == 0) + filters = PNG_FILTER_NONE; + + png_ptr->do_filter = filters; + + if (((filters & (PNG_FILTER_SUB | PNG_FILTER_UP | PNG_FILTER_AVG | + PNG_FILTER_PAETH)) != 0) && png_ptr->try_row == NULL) + { + int num_filters = 0; + + png_ptr->try_row = png_voidcast(png_bytep, png_malloc(png_ptr, buf_size)); + + if (filters & PNG_FILTER_SUB) + num_filters++; + + if (filters & PNG_FILTER_UP) + num_filters++; + + if (filters & PNG_FILTER_AVG) + num_filters++; + + if (filters & PNG_FILTER_PAETH) + num_filters++; + + if (num_filters > 1) + png_ptr->tst_row = png_voidcast(png_bytep, png_malloc(png_ptr, + buf_size)); } - /* We only need to keep the previous row if we are using one of these. */ - if ((png_ptr->do_filter & - (PNG_FILTER_AVG | PNG_FILTER_UP | PNG_FILTER_PAETH)) != 0) - { - /* Set up previous row buffer */ - png_ptr->prev_row = (png_bytep)png_calloc(png_ptr, buf_size); - - if ((png_ptr->do_filter & PNG_FILTER_UP) != 0) - { - png_ptr->up_row = (png_bytep)png_malloc(png_ptr, - png_ptr->rowbytes + 1); - - png_ptr->up_row[0] = PNG_FILTER_VALUE_UP; - } - - if ((png_ptr->do_filter & PNG_FILTER_AVG) != 0) - { - png_ptr->avg_row = (png_bytep)png_malloc(png_ptr, - png_ptr->rowbytes + 1); - - png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG; - } - - if ((png_ptr->do_filter & PNG_FILTER_PAETH) != 0) - { - png_ptr->paeth_row = (png_bytep)png_malloc(png_ptr, - png_ptr->rowbytes + 1); - - png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH; - } - } + /* We only need to keep the previous row if we are using one of the following + * filters. + */ + if ((filters & (PNG_FILTER_AVG | PNG_FILTER_UP | PNG_FILTER_PAETH)) != 0) + png_ptr->prev_row = png_voidcast(png_bytep, + png_calloc(png_ptr, buf_size)); #endif /* WRITE_FILTER */ #ifdef PNG_WRITE_INTERLACING_SUPPORTED @@ -2188,7 +2199,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass) { png_bytep sp; png_bytep dp; - int shift; + unsigned int shift; int d; int value; png_uint_32 i; @@ -2226,7 +2237,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass) { png_bytep sp; png_bytep dp; - int shift; + unsigned int shift; int d; int value; png_uint_32 i; @@ -2263,7 +2274,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass) { png_bytep sp; png_bytep dp; - int shift; + unsigned int shift; int d; int value; png_uint_32 i; @@ -2338,50 +2349,181 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass) } #endif + /* This filters the row, chooses which filter to use, if it has not already * been specified by the application, and then writes the row out with the * chosen filter. */ -static void +static void /* PRIVATE */ png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row, png_size_t row_bytes); -#define PNG_MAXSUM (((png_uint_32)(-1)) >> 1) -#define PNG_HISHIFT 10 -#define PNG_LOMASK ((png_uint_32)0xffffL) -#define PNG_HIMASK ((png_uint_32)(~PNG_LOMASK >> PNG_HISHIFT)) +#ifdef PNG_WRITE_FILTER_SUPPORTED +static png_size_t /* PRIVATE */ +png_setup_sub_row(png_structrp png_ptr, const png_uint_32 bpp, + const png_size_t row_bytes, const png_size_t lmins) +{ + png_bytep rp, dp, lp; + png_size_t i; + png_size_t sum = 0; + int v; + + png_ptr->try_row[0] = PNG_FILTER_VALUE_SUB; + + for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1; i < bpp; + i++, rp++, dp++) + { + v = *dp = *rp; + sum += (v < 128) ? v : 256 - v; + } + + for (lp = png_ptr->row_buf + 1; i < row_bytes; + i++, rp++, lp++, dp++) + { + v = *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff); + sum += (v < 128) ? v : 256 - v; + + if (sum > lmins) /* We are already worse, don't continue. */ + break; + } + + return (sum); +} + +static png_size_t /* PRIVATE */ +png_setup_up_row(png_structrp png_ptr, const png_size_t row_bytes, + const png_size_t lmins) +{ + png_bytep rp, dp, pp; + png_size_t i; + png_size_t sum = 0; + int v; + + png_ptr->try_row[0] = PNG_FILTER_VALUE_UP; + + for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1, + pp = png_ptr->prev_row + 1; i < row_bytes; + i++, rp++, pp++, dp++) + { + v = *dp = (png_byte)(((int)*rp - (int)*pp) & 0xff); + sum += (v < 128) ? v : 256 - v; + + if (sum > lmins) /* We are already worse, don't continue. */ + break; + } + + return (sum); +} + +static png_size_t /* PRIVATE */ +png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp, + const png_size_t row_bytes, const png_size_t lmins) +{ + png_bytep rp, dp, pp, lp; + png_uint_32 i; + png_size_t sum = 0; + int v; + + png_ptr->try_row[0] = PNG_FILTER_VALUE_AVG; + + for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1, + pp = png_ptr->prev_row + 1; i < bpp; i++) + { + v = *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); + + sum += (v < 128) ? v : 256 - v; + } + + for (lp = png_ptr->row_buf + 1; i < row_bytes; i++) + { + v = *dp++ = (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) + & 0xff); + + sum += (v < 128) ? v : 256 - v; + + if (sum > lmins) /* We are already worse, don't continue. */ + break; + } + + return (sum); +} + +static png_size_t /* PRIVATE */ +png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp, + const png_size_t row_bytes, const png_size_t lmins) +{ + png_bytep rp, dp, pp, cp, lp; + png_size_t i; + png_size_t sum = 0; + int v; + + png_ptr->try_row[0] = PNG_FILTER_VALUE_PAETH; + + for (i = 0, rp = png_ptr->row_buf + 1, dp = png_ptr->try_row + 1, + pp = png_ptr->prev_row + 1; i < bpp; i++) + { + v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); + + sum += (v < 128) ? v : 256 - v; + } + + for (lp = png_ptr->row_buf + 1, cp = png_ptr->prev_row + 1; i < row_bytes; + i++) + { + int a, b, c, pa, pb, pc, p; + + b = *pp++; + c = *cp++; + a = *lp++; + + p = b - c; + pc = a - c; + +#ifdef PNG_USE_ABS + pa = abs(p); + pb = abs(pc); + pc = abs(p + pc); +#else + pa = p < 0 ? -p : p; + pb = pc < 0 ? -pc : pc; + pc = (p + pc) < 0 ? -(p + pc) : p + pc; +#endif + + p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; + + v = *dp++ = (png_byte)(((int)*rp++ - p) & 0xff); + + sum += (v < 128) ? v : 256 - v; + + if (sum > lmins) /* We are already worse, don't continue. */ + break; + } + + return (sum); +} +#endif /* WRITE_FILTER */ + void /* PRIVATE */ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) { - png_bytep best_row; -#ifdef PNG_WRITE_FILTER_SUPPORTED - png_bytep prev_row, row_buf; - png_uint_32 mins, bpp; +#ifndef PNG_WRITE_FILTER_SUPPORTED + png_write_filtered_row(png_ptr, png_ptr->row_buf, row_info->rowbytes+1); +#else png_byte filter_to_do = png_ptr->do_filter; + png_bytep row_buf; + png_bytep best_row; + png_uint_32 bpp; + png_size_t mins; png_size_t row_bytes = row_info->rowbytes; -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - int num_p_filters = png_ptr->num_prev_filters; -#endif png_debug(1, "in png_write_find_filter"); -#ifndef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - if (png_ptr->row_number == 0 && filter_to_do == PNG_ALL_FILTERS) - { - /* These will never be selected so we need not test them. */ - filter_to_do &= ~(PNG_FILTER_UP | PNG_FILTER_PAETH); - } -#endif - /* Find out how many bytes offset each pixel is */ bpp = (row_info->pixel_depth + 7) >> 3; - prev_row = png_ptr->prev_row; -#endif - best_row = png_ptr->row_buf; -#ifdef PNG_WRITE_FILTER_SUPPORTED - row_buf = best_row; - mins = PNG_MAXSUM; + row_buf = png_ptr->row_buf; + mins = PNG_SIZE_MAX - 256/* so we can detect potential overflow of the + running sum */; /* The prediction method we use is to find which method provides the * smallest value when summing the absolute values of the distances @@ -2411,57 +2553,37 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) /* We don't need to test the 'no filter' case if this is the only filter * that has been chosen, as it doesn't actually do anything to the data. */ + best_row = png_ptr->row_buf; + + if ((filter_to_do & PNG_FILTER_NONE) != 0 && filter_to_do != PNG_FILTER_NONE) { png_bytep rp; - png_uint_32 sum = 0; + png_size_t sum = 0; png_size_t i; int v; - for (i = 0, rp = row_buf + 1; i < row_bytes; i++, rp++) + if (PNG_SIZE_MAX/128 <= row_bytes) { - v = *rp; - sum += (v < 128) ? v : 256 - v; - } - -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - png_uint_32 sumhi, sumlo; - int j; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; /* Gives us some footroom */ - - /* Reduce the sum if we match any of the previous rows */ - for (j = 0; j < num_p_filters; j++) + for (i = 0, rp = row_buf + 1; i < row_bytes; i++, rp++) { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE) - { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; + /* Check for overflow */ + if (sum > PNG_SIZE_MAX/128 - 256) + break; - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } + v = *rp; + sum += (v < 128) ? v : 256 - v; } - - /* Factor in the cost of this filter (this is here for completeness, - * but it makes no sense to have a "cost" for the NONE filter, as - * it has the minimum possible computational cost - none). - */ - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >> - PNG_COST_SHIFT; - - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - - else - sum = (sumhi << PNG_HISHIFT) + sumlo; } -#endif + else /* Overflow is not possible */ + { + for (i = 0, rp = row_buf + 1; i < row_bytes; i++, rp++) + { + v = *rp; + sum += (v < 128) ? v : 256 - v; + } + } + mins = sum; } @@ -2469,553 +2591,109 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info) if (filter_to_do == PNG_FILTER_SUB) /* It's the only filter so no testing is needed */ { - png_bytep rp, lp, dp; - png_size_t i; - - for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp; - i++, rp++, dp++) - { - *dp = *rp; - } - - for (lp = row_buf + 1; i < row_bytes; - i++, rp++, lp++, dp++) - { - *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff); - } - - best_row = png_ptr->sub_row; + (void) png_setup_sub_row(png_ptr, bpp, row_bytes, mins); + best_row = png_ptr->try_row; } else if ((filter_to_do & PNG_FILTER_SUB) != 0) { - png_bytep rp, dp, lp; - png_uint_32 sum = 0, lmins = mins; - png_size_t i; - int v; + png_size_t sum; + png_size_t lmins = mins; -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - /* We temporarily increase the "minimum sum" by the factor we - * would reduce the sum of this filter, so that we can do the - * early exit comparison without scaling the sum each time. - */ - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB) - { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; - - else - lmins = (lmhi << PNG_HISHIFT) + lmlo; - } -#endif - - for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp; - i++, rp++, dp++) - { - v = *dp = *rp; - - sum += (v < 128) ? v : 256 - v; - } - - for (lp = row_buf + 1; i < row_bytes; - i++, rp++, lp++, dp++) - { - v = *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff); - - sum += (v < 128) ? v : 256 - v; - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB) - { - sumlo = (sumlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - - sumhi = (sumhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - sumlo = (sumlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - - sumhi = (sumhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif + sum = png_setup_sub_row(png_ptr, bpp, row_bytes, lmins); if (sum < mins) { mins = sum; - best_row = png_ptr->sub_row; + best_row = png_ptr->try_row; + if (png_ptr->tst_row != NULL) + { + png_ptr->try_row = png_ptr->tst_row; + png_ptr->tst_row = best_row; + } } } /* Up filter */ if (filter_to_do == PNG_FILTER_UP) { - png_bytep rp, dp, pp; - png_size_t i; - - for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1, - pp = prev_row + 1; i < row_bytes; - i++, rp++, pp++, dp++) - { - *dp = (png_byte)(((int)*rp - (int)*pp) & 0xff); - } - - best_row = png_ptr->up_row; + (void) png_setup_up_row(png_ptr, row_bytes, mins); + best_row = png_ptr->try_row; } else if ((filter_to_do & PNG_FILTER_UP) != 0) { - png_bytep rp, dp, pp; - png_uint_32 sum = 0, lmins = mins; - png_size_t i; - int v; + png_size_t sum; + png_size_t lmins = mins; - -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP) - { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; - - else - lmins = (lmhi << PNG_HISHIFT) + lmlo; - } -#endif - - for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1, - pp = prev_row + 1; i < row_bytes; i++) - { - v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); - - sum += (v < 128) ? v : 256 - v; - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP) - { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif + sum = png_setup_up_row(png_ptr, row_bytes, lmins); if (sum < mins) { mins = sum; - best_row = png_ptr->up_row; + best_row = png_ptr->try_row; + if (png_ptr->tst_row != NULL) + { + png_ptr->try_row = png_ptr->tst_row; + png_ptr->tst_row = best_row; + } } } /* Avg filter */ if (filter_to_do == PNG_FILTER_AVG) { - png_bytep rp, dp, pp, lp; - png_uint_32 i; - - for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1, - pp = prev_row + 1; i < bpp; i++) - { - *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); - } - - for (lp = row_buf + 1; i < row_bytes; i++) - { - *dp++ = (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) - & 0xff); - } - best_row = png_ptr->avg_row; + (void) png_setup_avg_row(png_ptr, bpp, row_bytes, mins); + best_row = png_ptr->try_row; } else if ((filter_to_do & PNG_FILTER_AVG) != 0) { - png_bytep rp, dp, pp, lp; - png_uint_32 sum = 0, lmins = mins; - png_size_t i; - int v; + png_size_t sum; + png_size_t lmins = mins; -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_AVG) - { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; - - else - lmins = (lmhi << PNG_HISHIFT) + lmlo; - } -#endif - - for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1, - pp = prev_row + 1; i < bpp; i++) - { - v = *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); - - sum += (v < 128) ? v : 256 - v; - } - - for (lp = row_buf + 1; i < row_bytes; i++) - { - v = *dp++ = - (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) & 0xff); - - sum += (v < 128) ? v : 256 - v; - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE) - { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif + sum= png_setup_avg_row(png_ptr, bpp, row_bytes, lmins); if (sum < mins) { mins = sum; - best_row = png_ptr->avg_row; + best_row = png_ptr->try_row; + if (png_ptr->tst_row != NULL) + { + png_ptr->try_row = png_ptr->tst_row; + png_ptr->tst_row = best_row; + } } } /* Paeth filter */ if ((filter_to_do == PNG_FILTER_PAETH) != 0) { - png_bytep rp, dp, pp, cp, lp; - png_size_t i; - - for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1, - pp = prev_row + 1; i < bpp; i++) - { - *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); - } - - for (lp = row_buf + 1, cp = prev_row + 1; i < row_bytes; i++) - { - int a, b, c, pa, pb, pc, p; - - b = *pp++; - c = *cp++; - a = *lp++; - - p = b - c; - pc = a - c; - -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - - p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; - - *dp++ = (png_byte)(((int)*rp++ - p) & 0xff); - } - best_row = png_ptr->paeth_row; + (void) png_setup_paeth_row(png_ptr, bpp, row_bytes, mins); + best_row = png_ptr->try_row; } else if ((filter_to_do & PNG_FILTER_PAETH) != 0) { - png_bytep rp, dp, pp, cp, lp; - png_uint_32 sum = 0, lmins = mins; - png_size_t i; - int v; + png_size_t sum; + png_size_t lmins = mins; -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH) - { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; - - else - lmins = (lmhi << PNG_HISHIFT) + lmlo; - } -#endif - - for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1, - pp = prev_row + 1; i < bpp; i++) - { - v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); - - sum += (v < 128) ? v : 256 - v; - } - - for (lp = row_buf + 1, cp = prev_row + 1; i < row_bytes; i++) - { - int a, b, c, pa, pb, pc, p; - - b = *pp++; - c = *cp++; - a = *lp++; - -#ifndef PNG_SLOW_PAETH - p = b - c; - pc = a - c; -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; -#else /* SLOW_PAETH */ - p = a + b - c; - pa = abs(p - a); - pb = abs(p - b); - pc = abs(p - c); - - if (pa <= pb && pa <= pc) - p = a; - - else if (pb <= pc) - p = b; - - else - p = c; -#endif /* SLOW_PAETH */ - - v = *dp++ = (png_byte)(((int)*rp++ - p) & 0xff); - - sum += (v < 128) ? v : 256 - v; - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH) - { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif + sum = png_setup_paeth_row(png_ptr, bpp, row_bytes, lmins); if (sum < mins) { - best_row = png_ptr->paeth_row; + best_row = png_ptr->try_row; + if (png_ptr->tst_row != NULL) + { + png_ptr->try_row = png_ptr->tst_row; + png_ptr->tst_row = best_row; + } } } -#endif /* WRITE_FILTER */ /* Do the actual writing of the filtered row data from the chosen filter. */ png_write_filtered_row(png_ptr, best_row, row_info->rowbytes+1); -#ifdef PNG_WRITE_FILTER_SUPPORTED -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - /* Save the type of filter we picked this time for future calculations */ - if (png_ptr->num_prev_filters > 0) - { - int j; - - for (j = 1; j < num_p_filters; j++) - { - png_ptr->prev_filters[j] = png_ptr->prev_filters[j - 1]; - } - - png_ptr->prev_filters[j] = best_row[0]; - } -#endif #endif /* WRITE_FILTER */ } @@ -3031,6 +2709,7 @@ png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row, png_compress_IDAT(png_ptr, filtered_row, full_row_length, Z_NO_FLUSH); +#ifdef PNG_WRITE_FILTER_SUPPORTED /* Swap the current and previous rows */ if (png_ptr->prev_row != NULL) { @@ -3040,6 +2719,7 @@ png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row, png_ptr->prev_row = png_ptr->row_buf; png_ptr->row_buf = tptr; } +#endif /* WRITE_FILTER */ /* Finish row - updates counters and flushes zlib if last row */ png_write_finish_row(png_ptr); diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_png.c b/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_png.c index 3f77ea6d6d0..0ad3d448372 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_png.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_png.c @@ -103,6 +103,7 @@ SplashDecodePng(Splash * splash, png_rw_ptr read_func, void *io_ptr) if (png_get_gAMA(png_ptr, info_ptr, &gamma)) png_set_gamma(png_ptr, 2.2, gamma); + png_set_interlace_handling(png_ptr); png_read_update_info(png_ptr, info_ptr); rowbytes = png_get_rowbytes(png_ptr, info_ptr); From 238c184b1161cb916ee2a3caf56eab6c2e56f2b4 Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Wed, 9 Dec 2015 23:17:21 +0900 Subject: [PATCH 080/228] 8144965: Show oop pointer in call frame at HSDB Reviewed-by: jbachorik --- .../sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java index 342a96d6e36..37b730693f0 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java @@ -1921,6 +1921,15 @@ public class HTMLGenerator implements /* imports */ ClassConstants { buf.link(genPCHref(addressToLong(pc)), pc.toString()); } + if (!method.isStatic() && !method.isNative()) { + OopHandle oopHandle = vf.getLocals().oopHandleAt(0); + + if (oopHandle != null) { + buf.append(", oop = "); + buf.append(oopHandle.toString()); + } + } + if (vf.isCompiledFrame()) { buf.append(" (Compiled"); } From 30603c6599334c888670ad8e84263e99fac14221 Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Wed, 9 Dec 2015 21:24:57 +0900 Subject: [PATCH 081/228] 8144332: HSDB could not terminate when close button is pushed Reviewed-by: jbachorik --- .../share/classes/sun/jvm/hotspot/HSDB.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java index bac6fb7f548..901ac689e4c 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java @@ -125,10 +125,14 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { } } - // close this tool without calling System.exit - protected void closeUI() { - workerThread.shutdown(); - frame.dispose(); + private class CloseUI extends WindowAdapter { + + @Override + public void windowClosing(WindowEvent e) { + workerThread.shutdown(); + frame.dispose(); + } + } public void run() { @@ -144,7 +148,8 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { frame = new JFrame("HSDB - HotSpot Debugger"); frame.setSize(800, 600); - frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); + frame.addWindowListener(new CloseUI()); JMenuBar menuBar = new JMenuBar(); @@ -207,7 +212,8 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { item = createMenuItem("Exit", new ActionListener() { public void actionPerformed(ActionEvent e) { - closeUI(); + workerThread.shutdown(); + frame.dispose(); } }); item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK)); From bf5db7225437e03f0c0ec4e74468ea9538e32992 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Mon, 14 Dec 2015 17:02:02 -1000 Subject: [PATCH 082/228] 8134994: use separate VMStructs databases for SA and JVMCI Reviewed-by: kbarrett --- hotspot/src/cpu/x86/vm/vm_version_x86.hpp | 1 + .../hotspot/HotSpotResolvedJavaFieldImpl.java | 2 +- .../HotSpotResolvedObjectTypeImpl.java | 3 +- .../jdk/vm/ci/hotspot/HotSpotVMConfig.java | 322 +++---- .../ci/hotspotvmconfig/HotSpotVMManual.java | 44 - .../src/share/vm/classfile/javaClasses.hpp | 1 + hotspot/src/share/vm/classfile/vmSymbols.hpp | 1 + hotspot/src/share/vm/code/codeBlob.hpp | 2 + hotspot/src/share/vm/code/codeCache.hpp | 1 + hotspot/src/share/vm/code/nmethod.hpp | 1 + hotspot/src/share/vm/compiler/compileTask.hpp | 1 + hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp | 21 - .../src/share/vm/gc/shared/collectedHeap.hpp | 1 + .../vm/gc/shared/threadLocalAllocBuffer.hpp | 1 + .../src/share/vm/jvmci/jvmciCodeInstaller.hpp | 2 +- .../src/share/vm/jvmci/jvmciCompilerToVM.cpp | 203 +++-- .../src/share/vm/jvmci/jvmciCompilerToVM.hpp | 57 +- hotspot/src/share/vm/jvmci/jvmciEnv.hpp | 1 + hotspot/src/share/vm/jvmci/jvmciRuntime.cpp | 4 - .../src/share/vm/jvmci/vmStructs_jvmci.cpp | 849 ++++++++++++++++++ .../src/share/vm/jvmci/vmStructs_jvmci.hpp | 131 +-- hotspot/src/share/vm/oops/constMethod.hpp | 2 +- hotspot/src/share/vm/oops/constantPool.hpp | 1 + hotspot/src/share/vm/oops/instanceKlass.hpp | 1 + hotspot/src/share/vm/oops/klass.hpp | 1 + hotspot/src/share/vm/oops/klassVtable.hpp | 1 + hotspot/src/share/vm/oops/method.hpp | 1 + hotspot/src/share/vm/oops/methodCounters.hpp | 1 + hotspot/src/share/vm/oops/methodData.hpp | 9 + hotspot/src/share/vm/oops/objArrayKlass.hpp | 1 + hotspot/src/share/vm/oops/oop.hpp | 1 + hotspot/src/share/vm/runtime/basicLock.hpp | 1 + .../src/share/vm/runtime/deoptimization.hpp | 1 + .../src/share/vm/runtime/javaFrameAnchor.hpp | 1 + hotspot/src/share/vm/runtime/os.hpp | 1 + hotspot/src/share/vm/runtime/osThread.hpp | 1 + hotspot/src/share/vm/runtime/thread.hpp | 2 + hotspot/src/share/vm/runtime/vmStructs.cpp | 218 +---- hotspot/src/share/vm/runtime/vmStructs.hpp | 147 +++ hotspot/src/share/vm/utilities/array.hpp | 1 + hotspot/src/share/vm/utilities/exceptions.hpp | 1 + 41 files changed, 1367 insertions(+), 675 deletions(-) delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspotvmconfig/src/jdk/vm/ci/hotspotvmconfig/HotSpotVMManual.java create mode 100644 hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp index 784e8475da9..624f138d5be 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp @@ -30,6 +30,7 @@ class VM_Version : public Abstract_VM_Version { friend class VMStructs; + friend class JVMCIVMStructs; public: // cpuid result register layouts. These are all unions of a uint32_t // (in case anyone wants access to the register as a whole) and a bitfield. diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java index cd89be3e563..d565dfe4d39 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java @@ -190,7 +190,7 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField, HotSpotP @Override public boolean isSynthetic() { - return (config().syntheticFlag & modifiers) != 0; + return (config().jvmAccSynthetic & modifiers) != 0; } /** diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java index 4ef227ec823..65d92b1d8fd 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java @@ -324,8 +324,7 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem @Override public boolean hasFinalizer() { - HotSpotVMConfig config = config(); - return (getAccessFlags() & config.klassHasFinalizerFlag) != 0; + return (getAccessFlags() & config().jvmAccHasFinalizer) != 0; } @Override diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java index 2709c0807ac..228bff3a9a7 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @@ -37,7 +37,6 @@ import jdk.vm.ci.hotspotvmconfig.HotSpotVMConstant; import jdk.vm.ci.hotspotvmconfig.HotSpotVMData; import jdk.vm.ci.hotspotvmconfig.HotSpotVMField; import jdk.vm.ci.hotspotvmconfig.HotSpotVMFlag; -import jdk.vm.ci.hotspotvmconfig.HotSpotVMManual; import jdk.vm.ci.hotspotvmconfig.HotSpotVMType; import sun.misc.Unsafe; @@ -68,11 +67,11 @@ public class HotSpotVMConfig { assert gHotSpotVMData != 0; // Make FindBugs happy. - gHotSpotVMStructs = 0; - gHotSpotVMTypes = 0; - gHotSpotVMIntConstants = 0; - gHotSpotVMLongConstants = 0; - gHotSpotVMAddresses = 0; + jvmciHotSpotVMStructs = 0; + jvmciHotSpotVMTypes = 0; + jvmciHotSpotVMIntConstants = 0; + jvmciHotSpotVMLongConstants = 0; + jvmciHotSpotVMAddresses = 0; // Initialize the gHotSpotVM fields. for (Field f : HotSpotVMConfig.class.getDeclaredFields()) { @@ -89,41 +88,17 @@ public class HotSpotVMConfig { } // Quick sanity check. - assert gHotSpotVMStructs != 0; - assert gHotSpotVMTypes != 0; - assert gHotSpotVMIntConstants != 0; - assert gHotSpotVMLongConstants != 0; - assert gHotSpotVMAddresses != 0; + assert jvmciHotSpotVMStructs != 0; + assert jvmciHotSpotVMTypes != 0; + assert jvmciHotSpotVMIntConstants != 0; + assert jvmciHotSpotVMLongConstants != 0; + assert jvmciHotSpotVMAddresses != 0; initialize(); oopEncoding = new CompressEncoding(narrowOopBase, narrowOopShift, logMinObjAlignment()); klassEncoding = new CompressEncoding(narrowKlassBase, narrowKlassShift, logKlassAlignment); - final long barrierSetAddress = UNSAFE.getAddress(universeCollectedHeap + collectedHeapBarrierSetOffset); - final int kind = UNSAFE.getInt(barrierSetAddress + barrierSetFakeRttiOffset + fakeRttiConcreteTagOffset); - if ((kind == barrierSetCardTableModRef) || (kind == barrierSetCardTableForRS) || (kind == barrierSetCardTableExtension) || (kind == barrierSetG1SATBCT) || (kind == barrierSetG1SATBCTLogging)) { - final long base = UNSAFE.getAddress(barrierSetAddress + cardTableModRefBSByteMapBaseOffset); - assert base != 0 : "unexpected byte_map_base: " + base; - cardtableStartAddress = base; - cardtableShift = cardTableModRefBSCardShift; - } else if (kind == barrierSetModRef) { - // No post barriers - cardtableStartAddress = 0; - cardtableShift = 0; - } else { - cardtableStartAddress = -1; - cardtableShift = -1; - } - - // Now handle all HotSpotVMManual fields. - inlineCacheMissStub = inlineCacheMissBlob + UNSAFE.getInt(inlineCacheMissBlob + codeBlobCodeOffsetOffset); - handleWrongMethodStub = wrongMethodBlob + UNSAFE.getInt(wrongMethodBlob + codeBlobCodeOffsetOffset); - handleDeoptStub = deoptBlob + UNSAFE.getInt(deoptBlob + codeBlobCodeOffsetOffset) + UNSAFE.getInt(deoptBlob + deoptimizationBlobUnpackOffsetOffset); - uncommonTrapStub = deoptBlob + UNSAFE.getInt(deoptBlob + codeBlobCodeOffsetOffset) + UNSAFE.getInt(deoptBlob + deoptimizationBlobUncommonTrapOffsetOffset); - - tlabAlignmentReserve = roundUp(threadLocalAllocBufferEndReserve(), minObjAlignment()); - assert check(); assert HotSpotVMConfigVerifier.check(); } @@ -139,28 +114,28 @@ public class HotSpotVMConfig { private void initialize() { // Fill the VM fields hash map. HashMap vmFields = new HashMap<>(); - for (VMFields.Field e : new VMFields(gHotSpotVMStructs)) { + for (VMFields.Field e : new VMFields(jvmciHotSpotVMStructs)) { vmFields.put(e.getName(), e); } // Fill the VM types hash map. HashMap vmTypes = new HashMap<>(); - for (VMTypes.Type e : new VMTypes(gHotSpotVMTypes)) { + for (VMTypes.Type e : new VMTypes(jvmciHotSpotVMTypes)) { vmTypes.put(e.getTypeName(), e); } // Fill the VM constants hash map. HashMap vmConstants = new HashMap<>(); - for (AbstractConstant e : new VMIntConstants(gHotSpotVMIntConstants)) { + for (AbstractConstant e : new VMIntConstants(jvmciHotSpotVMIntConstants)) { vmConstants.put(e.getName(), e); } - for (AbstractConstant e : new VMAddresses(gHotSpotVMLongConstants)) { + for (AbstractConstant e : new VMLongConstants(jvmciHotSpotVMLongConstants)) { vmConstants.put(e.getName(), e); } // Fill the VM addresses hash map. HashMap vmAddresses = new HashMap<>(); - for (VMAddresses.Address e : new VMAddresses(gHotSpotVMAddresses)) { + for (VMAddresses.Address e : new VMAddresses(jvmciHotSpotVMAddresses)) { vmAddresses.put(e.getName(), e); } @@ -213,6 +188,7 @@ public class HotSpotVMConfig { if (entry == null) { throw new JVMCIError(f.getName() + ": expected VM type not found: " + name); } + switch (annotation.get()) { case SIZE: setField(f, entry.getSize()); @@ -371,14 +347,14 @@ public class HotSpotVMConfig { /** * VMStructEntry (see {@code vmStructs.hpp}). */ - @HotSpotVMData(index = 0) @Stable private long gHotSpotVMStructs; - @HotSpotVMData(index = 1) @Stable private long gHotSpotVMStructEntryTypeNameOffset; - @HotSpotVMData(index = 2) @Stable private long gHotSpotVMStructEntryFieldNameOffset; - @HotSpotVMData(index = 3) @Stable private long gHotSpotVMStructEntryTypeStringOffset; - @HotSpotVMData(index = 4) @Stable private long gHotSpotVMStructEntryIsStaticOffset; - @HotSpotVMData(index = 5) @Stable private long gHotSpotVMStructEntryOffsetOffset; - @HotSpotVMData(index = 6) @Stable private long gHotSpotVMStructEntryAddressOffset; - @HotSpotVMData(index = 7) @Stable private long gHotSpotVMStructEntryArrayStride; + @HotSpotVMData(index = 0) @Stable private long jvmciHotSpotVMStructs; + @HotSpotVMData(index = 1) @Stable private long jvmciHotSpotVMStructEntryTypeNameOffset; + @HotSpotVMData(index = 2) @Stable private long jvmciHotSpotVMStructEntryFieldNameOffset; + @HotSpotVMData(index = 3) @Stable private long jvmciHotSpotVMStructEntryTypeStringOffset; + @HotSpotVMData(index = 4) @Stable private long jvmciHotSpotVMStructEntryIsStaticOffset; + @HotSpotVMData(index = 5) @Stable private long jvmciHotSpotVMStructEntryOffsetOffset; + @HotSpotVMData(index = 6) @Stable private long jvmciHotSpotVMStructEntryAddressOffset; + @HotSpotVMData(index = 7) @Stable private long jvmciHotSpotVMStructEntryArrayStride; final class VMFields implements Iterable { @@ -394,7 +370,7 @@ public class HotSpotVMConfig { private int index = 0; private Field current() { - return new Field(address + gHotSpotVMStructEntryArrayStride * index); + return new Field(address + jvmciHotSpotVMStructEntryArrayStride * index); } /** @@ -422,30 +398,30 @@ public class HotSpotVMConfig { } public String getTypeName() { - long typeNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryTypeNameOffset); + long typeNameAddress = UNSAFE.getAddress(entryAddress + jvmciHotSpotVMStructEntryTypeNameOffset); return readCString(UNSAFE, typeNameAddress); } public String getFieldName() { - long fieldNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryFieldNameOffset); + long fieldNameAddress = UNSAFE.getAddress(entryAddress + jvmciHotSpotVMStructEntryFieldNameOffset); return readCString(UNSAFE, fieldNameAddress); } public String getTypeString() { - long typeStringAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryTypeStringOffset); + long typeStringAddress = UNSAFE.getAddress(entryAddress + jvmciHotSpotVMStructEntryTypeStringOffset); return readCString(UNSAFE, typeStringAddress); } public boolean isStatic() { - return UNSAFE.getInt(entryAddress + gHotSpotVMStructEntryIsStaticOffset) != 0; + return UNSAFE.getInt(entryAddress + jvmciHotSpotVMStructEntryIsStaticOffset) != 0; } public long getOffset() { - return UNSAFE.getLong(entryAddress + gHotSpotVMStructEntryOffsetOffset); + return UNSAFE.getLong(entryAddress + jvmciHotSpotVMStructEntryOffsetOffset); } public long getAddress() { - return UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryAddressOffset); + return UNSAFE.getAddress(entryAddress + jvmciHotSpotVMStructEntryAddressOffset); } public String getName() { @@ -466,6 +442,7 @@ public class HotSpotVMConfig { case "address": case "intptr_t": case "uintptr_t": + case "size_t": return UNSAFE.getAddress(getAddress()); default: // All foo* types are addresses. @@ -487,14 +464,14 @@ public class HotSpotVMConfig { /** * VMTypeEntry (see vmStructs.hpp). */ - @HotSpotVMData(index = 8) @Stable private long gHotSpotVMTypes; - @HotSpotVMData(index = 9) @Stable private long gHotSpotVMTypeEntryTypeNameOffset; - @HotSpotVMData(index = 10) @Stable private long gHotSpotVMTypeEntrySuperclassNameOffset; - @HotSpotVMData(index = 11) @Stable private long gHotSpotVMTypeEntryIsOopTypeOffset; - @HotSpotVMData(index = 12) @Stable private long gHotSpotVMTypeEntryIsIntegerTypeOffset; - @HotSpotVMData(index = 13) @Stable private long gHotSpotVMTypeEntryIsUnsignedOffset; - @HotSpotVMData(index = 14) @Stable private long gHotSpotVMTypeEntrySizeOffset; - @HotSpotVMData(index = 15) @Stable private long gHotSpotVMTypeEntryArrayStride; + @HotSpotVMData(index = 8) @Stable private long jvmciHotSpotVMTypes; + @HotSpotVMData(index = 9) @Stable private long jvmciHotSpotVMTypeEntryTypeNameOffset; + @HotSpotVMData(index = 10) @Stable private long jvmciHotSpotVMTypeEntrySuperclassNameOffset; + @HotSpotVMData(index = 11) @Stable private long jvmciHotSpotVMTypeEntryIsOopTypeOffset; + @HotSpotVMData(index = 12) @Stable private long jvmciHotSpotVMTypeEntryIsIntegerTypeOffset; + @HotSpotVMData(index = 13) @Stable private long jvmciHotSpotVMTypeEntryIsUnsignedOffset; + @HotSpotVMData(index = 14) @Stable private long jvmciHotSpotVMTypeEntrySizeOffset; + @HotSpotVMData(index = 15) @Stable private long jvmciHotSpotVMTypeEntryArrayStride; final class VMTypes implements Iterable { @@ -510,7 +487,7 @@ public class HotSpotVMConfig { private int index = 0; private Type current() { - return new Type(address + gHotSpotVMTypeEntryArrayStride * index); + return new Type(address + jvmciHotSpotVMTypeEntryArrayStride * index); } /** @@ -538,29 +515,29 @@ public class HotSpotVMConfig { } public String getTypeName() { - long typeNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMTypeEntryTypeNameOffset); + long typeNameAddress = UNSAFE.getAddress(entryAddress + jvmciHotSpotVMTypeEntryTypeNameOffset); return readCString(UNSAFE, typeNameAddress); } public String getSuperclassName() { - long superclassNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMTypeEntrySuperclassNameOffset); + long superclassNameAddress = UNSAFE.getAddress(entryAddress + jvmciHotSpotVMTypeEntrySuperclassNameOffset); return readCString(UNSAFE, superclassNameAddress); } public boolean isOopType() { - return UNSAFE.getInt(entryAddress + gHotSpotVMTypeEntryIsOopTypeOffset) != 0; + return UNSAFE.getInt(entryAddress + jvmciHotSpotVMTypeEntryIsOopTypeOffset) != 0; } public boolean isIntegerType() { - return UNSAFE.getInt(entryAddress + gHotSpotVMTypeEntryIsIntegerTypeOffset) != 0; + return UNSAFE.getInt(entryAddress + jvmciHotSpotVMTypeEntryIsIntegerTypeOffset) != 0; } public boolean isUnsigned() { - return UNSAFE.getInt(entryAddress + gHotSpotVMTypeEntryIsUnsignedOffset) != 0; + return UNSAFE.getInt(entryAddress + jvmciHotSpotVMTypeEntryIsUnsignedOffset) != 0; } public long getSize() { - return UNSAFE.getLong(entryAddress + gHotSpotVMTypeEntrySizeOffset); + return UNSAFE.getLong(entryAddress + jvmciHotSpotVMTypeEntrySizeOffset); } @Override @@ -594,10 +571,10 @@ public class HotSpotVMConfig { /** * VMIntConstantEntry (see vmStructs.hpp). */ - @HotSpotVMData(index = 16) @Stable private long gHotSpotVMIntConstants; - @HotSpotVMData(index = 17) @Stable private long gHotSpotVMIntConstantEntryNameOffset; - @HotSpotVMData(index = 18) @Stable private long gHotSpotVMIntConstantEntryValueOffset; - @HotSpotVMData(index = 19) @Stable private long gHotSpotVMIntConstantEntryArrayStride; + @HotSpotVMData(index = 16) @Stable private long jvmciHotSpotVMIntConstants; + @HotSpotVMData(index = 17) @Stable private long jvmciHotSpotVMIntConstantEntryNameOffset; + @HotSpotVMData(index = 18) @Stable private long jvmciHotSpotVMIntConstantEntryValueOffset; + @HotSpotVMData(index = 19) @Stable private long jvmciHotSpotVMIntConstantEntryArrayStride; final class VMIntConstants implements Iterable { @@ -613,7 +590,7 @@ public class HotSpotVMConfig { private int index = 0; private Constant current() { - return new Constant(address + gHotSpotVMIntConstantEntryArrayStride * index); + return new Constant(address + jvmciHotSpotVMIntConstantEntryArrayStride * index); } /** @@ -635,7 +612,7 @@ public class HotSpotVMConfig { final class Constant extends AbstractConstant { Constant(long address) { - super(address, gHotSpotVMIntConstantEntryNameOffset, gHotSpotVMIntConstantEntryValueOffset); + super(address, jvmciHotSpotVMIntConstantEntryNameOffset, jvmciHotSpotVMIntConstantEntryValueOffset); } @Override @@ -653,10 +630,10 @@ public class HotSpotVMConfig { /** * VMLongConstantEntry (see vmStructs.hpp). */ - @HotSpotVMData(index = 20) @Stable private long gHotSpotVMLongConstants; - @HotSpotVMData(index = 21) @Stable private long gHotSpotVMLongConstantEntryNameOffset; - @HotSpotVMData(index = 22) @Stable private long gHotSpotVMLongConstantEntryValueOffset; - @HotSpotVMData(index = 23) @Stable private long gHotSpotVMLongConstantEntryArrayStride; + @HotSpotVMData(index = 20) @Stable private long jvmciHotSpotVMLongConstants; + @HotSpotVMData(index = 21) @Stable private long jvmciHotSpotVMLongConstantEntryNameOffset; + @HotSpotVMData(index = 22) @Stable private long jvmciHotSpotVMLongConstantEntryValueOffset; + @HotSpotVMData(index = 23) @Stable private long jvmciHotSpotVMLongConstantEntryArrayStride; final class VMLongConstants implements Iterable { @@ -672,7 +649,7 @@ public class HotSpotVMConfig { private int index = 0; private Constant currentEntry() { - return new Constant(address + gHotSpotVMLongConstantEntryArrayStride * index); + return new Constant(address + jvmciHotSpotVMLongConstantEntryArrayStride * index); } /** @@ -694,7 +671,7 @@ public class HotSpotVMConfig { final class Constant extends AbstractConstant { Constant(long address) { - super(address, gHotSpotVMLongConstantEntryNameOffset, gHotSpotVMLongConstantEntryValueOffset); + super(address, jvmciHotSpotVMLongConstantEntryNameOffset, jvmciHotSpotVMLongConstantEntryValueOffset); } @Override @@ -712,10 +689,10 @@ public class HotSpotVMConfig { /** * VMAddressEntry (see vmStructs.hpp). */ - @HotSpotVMData(index = 24) @Stable private long gHotSpotVMAddresses; - @HotSpotVMData(index = 25) @Stable private long gHotSpotVMAddressEntryNameOffset; - @HotSpotVMData(index = 26) @Stable private long gHotSpotVMAddressEntryValueOffset; - @HotSpotVMData(index = 27) @Stable private long gHotSpotVMAddressEntryArrayStride; + @HotSpotVMData(index = 24) @Stable private long jvmciHotSpotVMAddresses; + @HotSpotVMData(index = 25) @Stable private long jvmciHotSpotVMAddressEntryNameOffset; + @HotSpotVMData(index = 26) @Stable private long jvmciHotSpotVMAddressEntryValueOffset; + @HotSpotVMData(index = 27) @Stable private long jvmciHotSpotVMAddressEntryArrayStride; final class VMAddresses implements Iterable { @@ -731,7 +708,7 @@ public class HotSpotVMConfig { private int index = 0; private Address currentEntry() { - return new Address(address + gHotSpotVMAddressEntryArrayStride * index); + return new Address(address + jvmciHotSpotVMAddressEntryArrayStride * index); } /** @@ -753,7 +730,7 @@ public class HotSpotVMConfig { final class Address extends AbstractConstant { Address(long address) { - super(address, gHotSpotVMAddressEntryNameOffset, gHotSpotVMAddressEntryValueOffset); + super(address, jvmciHotSpotVMAddressEntryNameOffset, jvmciHotSpotVMAddressEntryValueOffset); } @Override @@ -896,7 +873,7 @@ public class HotSpotVMConfig { @HotSpotVMFlag(name = "FlightRecorder", optional = true) @Stable public boolean flightRecorder; - @HotSpotVMField(name = "Universe::_collectedHeap", type = "CollectedHeap*", get = HotSpotVMField.Type.VALUE) @Stable private long universeCollectedHeap; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_collectedHeap", type = "CollectedHeap*", get = HotSpotVMField.Type.VALUE) @Stable private long universeCollectedHeap; @HotSpotVMField(name = "CollectedHeap::_total_collections", type = "unsigned int", get = HotSpotVMField.Type.OFFSET) @Stable private int collectedHeapTotalCollectionsOffset; public long gcTotalCollectionsAddress() { @@ -909,8 +886,8 @@ public class HotSpotVMConfig { @HotSpotVMFlag(name = "UseCompressedOops") @Stable public boolean useCompressedOops; @HotSpotVMFlag(name = "UseCompressedClassPointers") @Stable public boolean useCompressedClassPointers; - @HotSpotVMField(name = "Universe::_narrow_oop._base", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long narrowOopBase; - @HotSpotVMField(name = "Universe::_narrow_oop._shift", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int narrowOopShift; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_narrow_oop_base", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long narrowOopBase; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_narrow_oop_shift", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int narrowOopShift; @HotSpotVMFlag(name = "ObjectAlignmentInBytes") @Stable public int objectAlignment; public final int minObjAlignment() { @@ -922,16 +899,14 @@ public class HotSpotVMConfig { } @HotSpotVMType(name = "narrowKlass", get = HotSpotVMType.Type.SIZE) @Stable public int narrowKlassSize; - @HotSpotVMField(name = "Universe::_narrow_klass._base", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long narrowKlassBase; - @HotSpotVMField(name = "Universe::_narrow_klass._shift", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int narrowKlassShift; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_narrow_klass_base", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long narrowKlassBase; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_narrow_klass_shift", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int narrowKlassShift; @HotSpotVMConstant(name = "LogKlassAlignmentInBytes") @Stable public int logKlassAlignment; // CPU capabilities @HotSpotVMFlag(name = "UseSSE") @Stable public int useSSE; @HotSpotVMFlag(name = "UseAVX", archs = {"amd64"}) @Stable public int useAVX; - @HotSpotVMField(name = "Abstract_VM_Version::_reserve_for_allocation_prefetch", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int abstractVmVersionReserveForAllocationPrefetch; - // X86 specific values @HotSpotVMField(name = "VM_Version::_cpuFeatures", type = "uint64_t", get = HotSpotVMField.Type.VALUE, archs = {"amd64"}) @Stable public long x86CPUFeatures; @HotSpotVMConstant(name = "VM_Version::CPU_CX8", archs = {"amd64"}) @Stable public long cpuCX8; @@ -1054,7 +1029,8 @@ public class HotSpotVMConfig { @HotSpotVMField(name = "InstanceKlass::_init_state", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassInitStateOffset; @HotSpotVMField(name = "InstanceKlass::_constants", type = "ConstantPool*", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassConstantsOffset; @HotSpotVMField(name = "InstanceKlass::_fields", type = "Array*", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassFieldsOffset; - @HotSpotVMField(name = "InstanceKlass::_vtable_len", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassVtableLengthOffset; + @HotSpotVMField(name = "CompilerToVM::Data::InstanceKlass_vtable_start_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int instanceKlassVtableStartOffset; + @HotSpotVMField(name = "CompilerToVM::Data::InstanceKlass_vtable_length_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int instanceKlassVtableLengthOffset; @HotSpotVMConstant(name = "InstanceKlass::linked") @Stable public int instanceKlassStateLinked; @HotSpotVMConstant(name = "InstanceKlass::fully_initialized") @Stable public int instanceKlassStateFullyInitialized; @@ -1063,12 +1039,7 @@ public class HotSpotVMConfig { * See {@code InstanceKlass::vtable_start_offset()}. */ public final int instanceKlassVtableStartOffset() { - return roundUp(instanceKlassSize, heapWordSize); - } - - // TODO use CodeUtil method once it's moved from NumUtil - private static int roundUp(int number, int mod) { - return ((number + mod - 1) / mod) * mod; + return instanceKlassVtableStartOffset * heapWordSize; } @HotSpotVMType(name = "arrayOopDesc", get = HotSpotVMType.Type.SIZE) @Stable public int arrayOopDescSize; @@ -1100,11 +1071,22 @@ public class HotSpotVMConfig { @HotSpotVMConstant(name = "FIELDINFO_TAG_SIZE") @Stable public int fieldInfoTagSize; + @HotSpotVMConstant(name = "JVM_ACC_MONITOR_MATCH") @Stable public int jvmAccMonitorMatch; + @HotSpotVMConstant(name = "JVM_ACC_HAS_MONITOR_BYTECODES") @Stable public int jvmAccHasMonitorBytecodes; + @HotSpotVMConstant(name = "JVM_ACC_HAS_FINALIZER") @Stable public int jvmAccHasFinalizer; @HotSpotVMConstant(name = "JVM_ACC_FIELD_INTERNAL") @Stable public int jvmAccFieldInternal; @HotSpotVMConstant(name = "JVM_ACC_FIELD_STABLE") @Stable public int jvmAccFieldStable; @HotSpotVMConstant(name = "JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE") @Stable public int jvmAccFieldHasGenericSignature; @HotSpotVMConstant(name = "JVM_ACC_WRITTEN_FLAGS") @Stable public int jvmAccWrittenFlags; + // Modifier.SYNTHETIC is not public so we get it via vmStructs. + @HotSpotVMConstant(name = "JVM_ACC_SYNTHETIC") @Stable public int jvmAccSynthetic; + + /** + * @see HotSpotResolvedObjectTypeImpl#createField + */ + @HotSpotVMConstant(name = "JVM_RECOGNIZED_FIELD_MODIFIERS") @Stable public int recognizedFieldModifiers; + @HotSpotVMField(name = "Thread::_tlab", type = "ThreadLocalAllocBuffer", get = HotSpotVMField.Type.OFFSET) @Stable public int threadTlabOffset; @HotSpotVMField(name = "JavaThread::_anchor", type = "JavaFrameAnchor", get = HotSpotVMField.Type.OFFSET) @Stable public int javaThreadAnchorOffset; @@ -1202,16 +1184,17 @@ public class HotSpotVMConfig { @HotSpotVMField(name = "OSThread::_interrupted", type = "jint", get = HotSpotVMField.Type.OFFSET) @Stable public int osThreadInterruptedOffset; - @HotSpotVMConstant(name = "markOopDesc::unlocked_value") @Stable public int unlockedMask; + @HotSpotVMConstant(name = "markOopDesc::hash_shift") @Stable public long markOopDescHashShift; + @HotSpotVMConstant(name = "markOopDesc::biased_lock_mask_in_place") @Stable public int biasedLockMaskInPlace; @HotSpotVMConstant(name = "markOopDesc::age_mask_in_place") @Stable public int ageMaskInPlace; @HotSpotVMConstant(name = "markOopDesc::epoch_mask_in_place") @Stable public int epochMaskInPlace; - - @HotSpotVMConstant(name = "markOopDesc::hash_shift") @Stable public long markOopDescHashShift; @HotSpotVMConstant(name = "markOopDesc::hash_mask") @Stable public long markOopDescHashMask; @HotSpotVMConstant(name = "markOopDesc::hash_mask_in_place") @Stable public long markOopDescHashMaskInPlace; + @HotSpotVMConstant(name = "markOopDesc::unlocked_value") @Stable public int unlockedMask; @HotSpotVMConstant(name = "markOopDesc::biased_lock_pattern") @Stable public int biasedLockPattern; + @HotSpotVMConstant(name = "markOopDesc::no_hash_in_place") @Stable public int markWordNoHashInPlace; @HotSpotVMConstant(name = "markOopDesc::no_lock_in_place") @Stable public int markWordNoLockInPlace; @@ -1247,6 +1230,11 @@ public class HotSpotVMConfig { @HotSpotVMField(name = "Method::_flags", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int methodFlagsOffset; @HotSpotVMField(name = "Method::_vtable_index", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodVtableIndexOffset; + @HotSpotVMField(name = "Method::_method_counters", type = "MethodCounters*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCountersOffset; + @HotSpotVMField(name = "Method::_method_data", type = "MethodData*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOffset; + @HotSpotVMField(name = "Method::_from_compiled_entry", type = "address", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCompiledEntryOffset; + @HotSpotVMField(name = "Method::_code", type = "nmethod*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCodeOffset; + @HotSpotVMConstant(name = "Method::_jfr_towrite") @Stable public int methodFlagsJfrTowrite; @HotSpotVMConstant(name = "Method::_caller_sensitive") @Stable public int methodFlagsCallerSensitive; @HotSpotVMConstant(name = "Method::_force_inline") @Stable public int methodFlagsForceInline; @@ -1255,16 +1243,29 @@ public class HotSpotVMConfig { @HotSpotVMConstant(name = "Method::nonvirtual_vtable_index") @Stable public int nonvirtualVtableIndex; @HotSpotVMConstant(name = "Method::invalid_vtable_index") @Stable public int invalidVtableIndex; + @HotSpotVMField(name = "MethodCounters::_invocation_counter", type = "InvocationCounter", get = HotSpotVMField.Type.OFFSET) @Stable public int invocationCounterOffset; + @HotSpotVMField(name = "MethodCounters::_backedge_counter", type = "InvocationCounter", get = HotSpotVMField.Type.OFFSET) @Stable public int backedgeCounterOffset; + @HotSpotVMConstant(name = "InvocationCounter::count_increment") @Stable public int invocationCounterIncrement; + @HotSpotVMConstant(name = "InvocationCounter::count_shift") @Stable public int invocationCounterShift; + + @HotSpotVMField(name = "MethodData::_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataSize; + @HotSpotVMField(name = "MethodData::_data_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataDataSize; + @HotSpotVMField(name = "MethodData::_data[0]", type = "intptr_t", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOopDataOffset; + @HotSpotVMField(name = "MethodData::_trap_hist._array[0]", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOopTrapHistoryOffset; + @HotSpotVMField(name = "MethodData::_jvmci_ir_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataIRSizeOffset; + + @HotSpotVMField(name = "nmethod::_verified_entry_point", type = "address", get = HotSpotVMField.Type.OFFSET) @Stable public int nmethodEntryOffset; + @HotSpotVMField(name = "nmethod::_comp_level", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int nmethodCompLevelOffset; + + @HotSpotVMConstant(name = "CompLevel_full_optimization") @Stable public int compilationLevelFullOptimization; + @HotSpotVMConstant(name = "InvocationEntryBci") @Stable public int invocationEntryBci; @HotSpotVMField(name = "JVMCIEnv::_task", type = "CompileTask*", get = HotSpotVMField.Type.OFFSET) @Stable public int jvmciEnvTaskOffset; @HotSpotVMField(name = "JVMCIEnv::_jvmti_can_hotswap_or_post_breakpoint", type = "bool", get = HotSpotVMField.Type.OFFSET) @Stable public int jvmciEnvJvmtiCanHotswapOrPostBreakpointOffset; @HotSpotVMField(name = "CompileTask::_num_inlined_bytecodes", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int compileTaskNumInlinedBytecodesOffset; - /** - * See {@code Method::extra_stack_entries()}. - */ - @HotSpotVMConstant(name = "Method::extra_stack_entries_for_jsr292") @Stable public int extraStackEntries; + @HotSpotVMField(name = "CompilerToVM::Data::Method_extra_stack_entries", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int extraStackEntries; @HotSpotVMField(name = "ConstMethod::_constants", type = "ConstantPool*", get = HotSpotVMField.Type.OFFSET) @Stable public int constMethodConstantsOffset; @HotSpotVMField(name = "ConstMethod::_flags", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int constMethodFlagsOffset; @@ -1325,72 +1326,39 @@ public class HotSpotVMConfig { @HotSpotVMConstant(name = "HeapWordSize") @Stable public int heapWordSize; @HotSpotVMType(name = "Symbol*", get = HotSpotVMType.Type.SIZE) @Stable public int symbolPointerSize; - @HotSpotVMField(name = "Symbol::_length", type = "unsigned short", get = HotSpotVMField.Type.OFFSET) @Stable public int symbolLengthOffset; - @HotSpotVMField(name = "Symbol::_body[0]", type = "jbyte", get = HotSpotVMField.Type.OFFSET) @Stable public int symbolBodyOffset; @HotSpotVMField(name = "vmSymbols::_symbols[0]", type = "Symbol*", get = HotSpotVMField.Type.ADDRESS) @Stable public long vmSymbolsSymbols; @HotSpotVMConstant(name = "vmSymbols::FIRST_SID") @Stable public int vmSymbolsFirstSID; @HotSpotVMConstant(name = "vmSymbols::SID_LIMIT") @Stable public int vmSymbolsSIDLimit; - @HotSpotVMConstant(name = "JVM_ACC_HAS_FINALIZER") @Stable public int klassHasFinalizerFlag; - - // Modifier.SYNTHETIC is not public so we get it via vmStructs. - @HotSpotVMConstant(name = "JVM_ACC_SYNTHETIC") @Stable public int syntheticFlag; - - /** - * @see HotSpotResolvedObjectTypeImpl#createField - */ - @HotSpotVMConstant(name = "JVM_RECOGNIZED_FIELD_MODIFIERS") @Stable public int recognizedFieldModifiers; - /** * Bit pattern that represents a non-oop. Neither the high bits nor the low bits of this value * are allowed to look like (respectively) the high or low bits of a real oop. */ - @HotSpotVMField(name = "Universe::_non_oop_bits", type = "intptr_t", get = HotSpotVMField.Type.VALUE) @Stable public long nonOopBits; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_non_oop_bits", type = "void*", get = HotSpotVMField.Type.VALUE) @Stable public long nonOopBits; @HotSpotVMField(name = "StubRoutines::_verify_oop_count", type = "jint", get = HotSpotVMField.Type.ADDRESS) @Stable public long verifyOopCounterAddress; - @HotSpotVMField(name = "Universe::_verify_oop_mask", type = "uintptr_t", get = HotSpotVMField.Type.VALUE) @Stable public long verifyOopMask; - @HotSpotVMField(name = "Universe::_verify_oop_bits", type = "uintptr_t", get = HotSpotVMField.Type.VALUE) @Stable public long verifyOopBits; - @HotSpotVMField(name = "Universe::_base_vtable_size", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int universeBaseVtableSize; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_verify_oop_mask", type = "uintptr_t", get = HotSpotVMField.Type.VALUE) @Stable public long verifyOopMask; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_verify_oop_bits", type = "uintptr_t", get = HotSpotVMField.Type.VALUE) @Stable public long verifyOopBits; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_base_vtable_size", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int universeBaseVtableSize; public final int baseVtableLength() { return universeBaseVtableSize / vtableEntrySize; } - @HotSpotVMField(name = "CollectedHeap::_barrier_set", type = "BarrierSet*", get = HotSpotVMField.Type.OFFSET) @Stable public int collectedHeapBarrierSetOffset; - @HotSpotVMField(name = "HeapRegion::LogOfHRGrainBytes", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int logOfHRGrainBytes; - @HotSpotVMField(name = "BarrierSet::_fake_rtti", type = "BarrierSet::FakeRtti", get = HotSpotVMField.Type.OFFSET) @Stable private int barrierSetFakeRttiOffset; - @HotSpotVMConstant(name = "BarrierSet::CardTableModRef") @Stable public int barrierSetCardTableModRef; - @HotSpotVMConstant(name = "BarrierSet::CardTableForRS") @Stable public int barrierSetCardTableForRS; - @HotSpotVMConstant(name = "BarrierSet::CardTableExtension") @Stable public int barrierSetCardTableExtension; - @HotSpotVMConstant(name = "BarrierSet::G1SATBCT") @Stable public int barrierSetG1SATBCT; - @HotSpotVMConstant(name = "BarrierSet::G1SATBCTLogging") @Stable public int barrierSetG1SATBCTLogging; - @HotSpotVMConstant(name = "BarrierSet::ModRef") @Stable public int barrierSetModRef; - - @HotSpotVMField(name = "BarrierSet::FakeRtti::_concrete_tag", type = "BarrierSet::Name", get = HotSpotVMField.Type.OFFSET) @Stable private int fakeRttiConcreteTagOffset; - - @HotSpotVMField(name = "CardTableModRefBS::byte_map_base", type = "jbyte*", get = HotSpotVMField.Type.OFFSET) @Stable private int cardTableModRefBSByteMapBaseOffset; - @HotSpotVMConstant(name = "CardTableModRefBS::card_shift") @Stable public int cardTableModRefBSCardShift; - @HotSpotVMConstant(name = "CardTableModRefBS::dirty_card") @Stable public byte dirtyCardValue; @HotSpotVMConstant(name = "G1SATBCardTableModRefBS::g1_young_gen") @Stable public byte g1YoungCardValue; - private final long cardtableStartAddress; - private final int cardtableShift; + @HotSpotVMField(name = "CompilerToVM::Data::cardtable_start_address", type = "jbyte*", get = HotSpotVMField.Type.VALUE) @Stable private long cardtableStartAddress; + @HotSpotVMField(name = "CompilerToVM::Data::cardtable_shift", type = "int", get = HotSpotVMField.Type.VALUE) @Stable private int cardtableShift; public long cardtableStartAddress() { - if (cardtableStartAddress == -1) { - throw JVMCIError.shouldNotReachHere(); - } return cardtableStartAddress; } public int cardtableShift() { - if (cardtableShift == -1) { - throw JVMCIError.shouldNotReachHere(); - } return cardtableShift; } @@ -1421,34 +1389,12 @@ public class HotSpotVMConfig { @HotSpotVMField(name = "java_lang_Class::_klass_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int klassOffset; @HotSpotVMField(name = "java_lang_Class::_array_klass_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int arrayKlassOffset; - @HotSpotVMField(name = "Method::_method_counters", type = "MethodCounters*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCountersOffset; - @HotSpotVMField(name = "Method::_method_data", type = "MethodData*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOffset; - @HotSpotVMField(name = "Method::_from_compiled_entry", type = "address", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCompiledEntryOffset; - @HotSpotVMField(name = "Method::_code", type = "nmethod*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCodeOffset; - - @HotSpotVMField(name = "MethodCounters::_invocation_counter", type = "InvocationCounter", get = HotSpotVMField.Type.OFFSET) @Stable public int invocationCounterOffset; - @HotSpotVMField(name = "MethodCounters::_backedge_counter", type = "InvocationCounter", get = HotSpotVMField.Type.OFFSET) @Stable public int backedgeCounterOffset; - @HotSpotVMConstant(name = "InvocationCounter::count_increment") @Stable public int invocationCounterIncrement; - @HotSpotVMConstant(name = "InvocationCounter::count_shift") @Stable public int invocationCounterShift; - - @HotSpotVMField(name = "MethodData::_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataSize; - @HotSpotVMField(name = "MethodData::_data_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataDataSize; - @HotSpotVMField(name = "MethodData::_data[0]", type = "intptr_t", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOopDataOffset; - @HotSpotVMField(name = "MethodData::_trap_hist._array[0]", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOopTrapHistoryOffset; - @HotSpotVMField(name = "MethodData::_jvmci_ir_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataIRSizeOffset; - - @HotSpotVMField(name = "nmethod::_verified_entry_point", type = "address", get = HotSpotVMField.Type.OFFSET) @Stable public int nmethodEntryOffset; - @HotSpotVMField(name = "nmethod::_comp_level", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int nmethodCompLevelOffset; - - @HotSpotVMConstant(name = "CompLevel_full_optimization") @Stable public int compilationLevelFullOptimization; - @HotSpotVMType(name = "BasicLock", get = HotSpotVMType.Type.SIZE) @Stable public int basicLockSize; @HotSpotVMField(name = "BasicLock::_displaced_header", type = "markOop", get = HotSpotVMField.Type.OFFSET) @Stable public int basicLockDisplacedHeaderOffset; @HotSpotVMField(name = "Thread::_allocated_bytes", type = "jlong", get = HotSpotVMField.Type.OFFSET) @Stable public int threadAllocatedBytesOffset; @HotSpotVMFlag(name = "TLABWasteIncrement") @Stable public int tlabRefillWasteIncrement; - @HotSpotVMManual(name = "ThreadLocalAllocBuffer::alignment_reserve()") @Stable public int tlabAlignmentReserve; @HotSpotVMField(name = "ThreadLocalAllocBuffer::_start", type = "HeapWord*", get = HotSpotVMField.Type.OFFSET) @Stable private int threadLocalAllocBufferStartOffset; @HotSpotVMField(name = "ThreadLocalAllocBuffer::_end", type = "HeapWord*", get = HotSpotVMField.Type.OFFSET) @Stable private int threadLocalAllocBufferEndOffset; @@ -1496,22 +1442,14 @@ public class HotSpotVMConfig { return threadTlabOffset + threadLocalAllocBufferPfTopOffset; } - /** - * See: {@code ThreadLocalAllocBuffer::end_reserve()}. - */ - public final int threadLocalAllocBufferEndReserve() { - final int typeSizeInBytes = roundUp(arrayOopDescLengthOffset() + Integer.BYTES, heapWordSize); - // T_INT arrays need not be 8 byte aligned. - final int reserveSize = typeSizeInBytes / heapWordSize; - return Integer.max(reserveSize, abstractVmVersionReserveForAllocationPrefetch); - } + @HotSpotVMField(name = "CompilerToVM::Data::ThreadLocalAllocBuffer_alignment_reserve", type = "size_t", get = HotSpotVMField.Type.VALUE) @Stable public int tlabAlignmentReserve; @HotSpotVMFlag(name = "TLABStats") @Stable public boolean tlabStats; // FIXME This is only temporary until the GC code is changed. - @HotSpotVMField(name = "CompilerToVM::_supports_inline_contig_alloc", type = "bool", get = HotSpotVMField.Type.VALUE) @Stable public boolean inlineContiguousAllocationSupported; - @HotSpotVMField(name = "CompilerToVM::_heap_end_addr", type = "HeapWord**", get = HotSpotVMField.Type.VALUE) @Stable public long heapEndAddress; - @HotSpotVMField(name = "CompilerToVM::_heap_top_addr", type = "HeapWord**", get = HotSpotVMField.Type.VALUE) @Stable public long heapTopAddress; + @HotSpotVMField(name = "CompilerToVM::Data::_supports_inline_contig_alloc", type = "bool", get = HotSpotVMField.Type.VALUE) @Stable public boolean inlineContiguousAllocationSupported; + @HotSpotVMField(name = "CompilerToVM::Data::_heap_end_addr", type = "HeapWord**", get = HotSpotVMField.Type.VALUE) @Stable public long heapEndAddress; + @HotSpotVMField(name = "CompilerToVM::Data::_heap_top_addr", type = "HeapWord**", get = HotSpotVMField.Type.VALUE) @Stable public long heapTopAddress; /** * The DataLayout header size is the same as the cell size. @@ -1542,19 +1480,11 @@ public class HotSpotVMConfig { @HotSpotVMFlag(name = "TypeProfileWidth") @Stable public int typeProfileWidth; @HotSpotVMFlag(name = "MethodProfileWidth") @Stable public int methodProfileWidth; - @HotSpotVMField(name = "CodeBlob::_code_offset", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable private int codeBlobCodeOffsetOffset; - @HotSpotVMField(name = "DeoptimizationBlob::_unpack_offset", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable private int deoptimizationBlobUnpackOffsetOffset; - @HotSpotVMField(name = "DeoptimizationBlob::_uncommon_trap_offset", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable private int deoptimizationBlobUncommonTrapOffsetOffset; + @HotSpotVMField(name = "CompilerToVM::Data::SharedRuntime_ic_miss_stub", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long inlineCacheMissStub; + @HotSpotVMField(name = "CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long handleWrongMethodStub; - @HotSpotVMField(name = "SharedRuntime::_ic_miss_blob", type = "RuntimeStub*", get = HotSpotVMField.Type.VALUE) @Stable private long inlineCacheMissBlob; - @HotSpotVMField(name = "SharedRuntime::_wrong_method_blob", type = "RuntimeStub*", get = HotSpotVMField.Type.VALUE) @Stable private long wrongMethodBlob; - @HotSpotVMField(name = "SharedRuntime::_deopt_blob", type = "DeoptimizationBlob*", get = HotSpotVMField.Type.VALUE) @Stable private long deoptBlob; - - @HotSpotVMManual(name = "SharedRuntime::get_ic_miss_stub()") public final long inlineCacheMissStub; - @HotSpotVMManual(name = "SharedRuntime::get_handle_wrong_method_stub()") public final long handleWrongMethodStub; - - @HotSpotVMManual(name = "SharedRuntime::deopt_blob()->unpack()") public final long handleDeoptStub; - @HotSpotVMManual(name = "SharedRuntime::deopt_blob()->uncommon_trap()") public final long uncommonTrapStub; + @HotSpotVMField(name = "CompilerToVM::Data::SharedRuntime_deopt_blob_unpack", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long handleDeoptStub; + @HotSpotVMField(name = "CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long uncommonTrapStub; @HotSpotVMField(name = "CodeCache::_low_bound", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long codeCacheLowBound; @HotSpotVMField(name = "CodeCache::_high_bound", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long codeCacheHighBound; @@ -1717,9 +1647,6 @@ public class HotSpotVMConfig { return "unknown"; } - @HotSpotVMConstant(name = "CompilerToVM::KLASS_TAG") @Stable public int compilerToVMKlassTag; - @HotSpotVMConstant(name = "CompilerToVM::SYMBOL_TAG") @Stable public int compilerToVMSymbolTag; - // Checkstyle: stop @HotSpotVMConstant(name = "CodeInstaller::VERIFIED_ENTRY") @Stable public int MARKID_VERIFIED_ENTRY; @HotSpotVMConstant(name = "CodeInstaller::UNVERIFIED_ENTRY") @Stable public int MARKID_UNVERIFIED_ENTRY; @@ -1756,7 +1683,6 @@ public class HotSpotVMConfig { @HotSpotVMConstant(name = "ArrayData::array_len_off_set") @Stable public int arrayDataArrayLenOffset; @HotSpotVMConstant(name = "ArrayData::array_start_off_set") @Stable public int arrayDataArrayStartOffset; @HotSpotVMConstant(name = "MultiBranchData::per_case_cell_count") @Stable public int multiBranchDataPerCaseCellCount; - // Checkstyle: resume private boolean check() { diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspotvmconfig/src/jdk/vm/ci/hotspotvmconfig/HotSpotVMManual.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspotvmconfig/src/jdk/vm/ci/hotspotvmconfig/HotSpotVMManual.java deleted file mode 100644 index 91ddf950879..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspotvmconfig/src/jdk/vm/ci/hotspotvmconfig/HotSpotVMManual.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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. - */ -package jdk.vm.ci.hotspotvmconfig; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotates a field in HotSpotVMConfig which is not read from the VM but is calculated manually. - */ -@Target(ElementType.FIELD) -@Retention(RetentionPolicy.RUNTIME) -public @interface HotSpotVMManual { - - /** - * Returns the name associated with that field. - * - * @return name associated with field - */ - String name(); - -} diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index 192d11ccede..1aa88b399db 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -240,6 +240,7 @@ class java_lang_String : AllStatic { class java_lang_Class : AllStatic { friend class VMStructs; + friend class JVMCIVMStructs; private: // The fake offsets are added by the class loader when java.lang.Class is loaded diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index 6fff569a762..805bb45162c 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -1328,6 +1328,7 @@ class vmSymbols: AllStatic { friend class vmIntrinsics; friend class VMStructs; + friend class JVMCIVMStructs; public: // enum for figuring positions and size of array holding Symbol*s enum SID { diff --git a/hotspot/src/share/vm/code/codeBlob.hpp b/hotspot/src/share/vm/code/codeBlob.hpp index cf846940b60..a4a4cab7c8b 100644 --- a/hotspot/src/share/vm/code/codeBlob.hpp +++ b/hotspot/src/share/vm/code/codeBlob.hpp @@ -64,6 +64,7 @@ class DeoptimizationBlob; class CodeBlob VALUE_OBJ_CLASS_SPEC { friend class VMStructs; + friend class JVMCIVMStructs; friend class CodeCacheDumper; private: @@ -374,6 +375,7 @@ class SingletonBlob: public CodeBlob { class DeoptimizationBlob: public SingletonBlob { friend class VMStructs; + friend class JVMCIVMStructs; private: int _unpack_offset; int _unpack_with_exception; diff --git a/hotspot/src/share/vm/code/codeCache.hpp b/hotspot/src/share/vm/code/codeCache.hpp index 88594bd80a7..a3da713c9e5 100644 --- a/hotspot/src/share/vm/code/codeCache.hpp +++ b/hotspot/src/share/vm/code/codeCache.hpp @@ -76,6 +76,7 @@ class DepChange; class CodeCache : AllStatic { friend class VMStructs; + friend class JVMCIVMStructs; friend class NMethodIterator; friend class WhiteBox; friend class CodeCacheLoader; diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 2305f51bc24..f38ed2edb36 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -113,6 +113,7 @@ class xmlStream; class nmethod : public CodeBlob { friend class VMStructs; + friend class JVMCIVMStructs; friend class NMethodSweeper; friend class CodeCache; // scavengable oops private: diff --git a/hotspot/src/share/vm/compiler/compileTask.hpp b/hotspot/src/share/vm/compiler/compileTask.hpp index 1ec57bd00ab..17f77b34dee 100644 --- a/hotspot/src/share/vm/compiler/compileTask.hpp +++ b/hotspot/src/share/vm/compiler/compileTask.hpp @@ -38,6 +38,7 @@ class CompileTask : public CHeapObj { friend class VMStructs; + friend class JVMCIVMStructs; private: static CompileTask* _task_free_list; diff --git a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp index 1fad2b64637..b790d40a78c 100644 --- a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp +++ b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp @@ -70,27 +70,6 @@ #define VM_INT_CONSTANTS_G1(declare_constant, declare_constant_with_value) \ - \ - JVMCI_ONLY( \ - declare_constant_with_value( \ - "dirtyCardQueueBufferOffset", \ - in_bytes(DirtyCardQueue::byte_offset_of_buf())) \ - declare_constant_with_value( \ - "dirtyCardQueueIndexOffset", \ - in_bytes(DirtyCardQueue::byte_offset_of_index())) \ - ) /* JVMCI_ONLY */ \ - \ - JVMCI_ONLY( \ - declare_constant_with_value( \ - "satbMarkQueueBufferOffset", \ - in_bytes(SATBMarkQueue::byte_offset_of_buf())) \ - declare_constant_with_value( \ - "satbMarkQueueIndexOffset", \ - in_bytes(SATBMarkQueue::byte_offset_of_index())) \ - declare_constant_with_value( \ - "satbMarkQueueActiveOffset", \ - in_bytes(SATBMarkQueue::byte_offset_of_active())) \ - ) /* JVMCI_ONLY */ \ #define VM_TYPES_G1(declare_type, declare_toplevel_type) \ diff --git a/hotspot/src/share/vm/gc/shared/collectedHeap.hpp b/hotspot/src/share/vm/gc/shared/collectedHeap.hpp index d12941b14fe..02de82c7b83 100644 --- a/hotspot/src/share/vm/gc/shared/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc/shared/collectedHeap.hpp @@ -81,6 +81,7 @@ class GCHeapLog : public EventLogBase { // class CollectedHeap : public CHeapObj { friend class VMStructs; + friend class JVMCIVMStructs; friend class IsGCActiveMark; // Block structured external access to _is_gc_active private: diff --git a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp index 60e05dcab26..eca56006510 100644 --- a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp +++ b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp @@ -39,6 +39,7 @@ class GlobalTLABStats; // used to make it available for such multiplexing. class ThreadLocalAllocBuffer: public CHeapObj { friend class VMStructs; + friend class JVMCIVMStructs; private: HeapWord* _start; // address of TLAB HeapWord* _top; // address after last allocation diff --git a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp index 394d263f668..1157759d0ed 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp @@ -89,7 +89,7 @@ private: * This class handles the conversion from a InstalledCode to a CodeBlob or an nmethod. */ class CodeInstaller : public StackObj { - friend class VMStructs; + friend class JVMCIVMStructs; private: enum MarkId { VERIFIED_ENTRY = 1, diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp index 694513cc4a7..2205ff479fd 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp @@ -43,6 +43,7 @@ #include "jvmci/jvmciEnv.hpp" #include "jvmci/jvmciJavaClasses.hpp" #include "jvmci/jvmciCodeInstaller.hpp" +#include "jvmci/vmStructs_jvmci.hpp" #include "gc/g1/heapRegion.hpp" #include "runtime/javaCalls.hpp" #include "runtime/deoptimization.hpp" @@ -85,88 +86,160 @@ oop CompilerToVM::get_jvmci_type(KlassHandle klass, TRAPS) { } extern "C" { -extern VMStructEntry* gHotSpotVMStructs; -extern uint64_t gHotSpotVMStructEntryTypeNameOffset; -extern uint64_t gHotSpotVMStructEntryFieldNameOffset; -extern uint64_t gHotSpotVMStructEntryTypeStringOffset; -extern uint64_t gHotSpotVMStructEntryIsStaticOffset; -extern uint64_t gHotSpotVMStructEntryOffsetOffset; -extern uint64_t gHotSpotVMStructEntryAddressOffset; -extern uint64_t gHotSpotVMStructEntryArrayStride; +extern VMStructEntry* jvmciHotSpotVMStructs; +extern uint64_t jvmciHotSpotVMStructEntryTypeNameOffset; +extern uint64_t jvmciHotSpotVMStructEntryFieldNameOffset; +extern uint64_t jvmciHotSpotVMStructEntryTypeStringOffset; +extern uint64_t jvmciHotSpotVMStructEntryIsStaticOffset; +extern uint64_t jvmciHotSpotVMStructEntryOffsetOffset; +extern uint64_t jvmciHotSpotVMStructEntryAddressOffset; +extern uint64_t jvmciHotSpotVMStructEntryArrayStride; -extern VMTypeEntry* gHotSpotVMTypes; -extern uint64_t gHotSpotVMTypeEntryTypeNameOffset; -extern uint64_t gHotSpotVMTypeEntrySuperclassNameOffset; -extern uint64_t gHotSpotVMTypeEntryIsOopTypeOffset; -extern uint64_t gHotSpotVMTypeEntryIsIntegerTypeOffset; -extern uint64_t gHotSpotVMTypeEntryIsUnsignedOffset; -extern uint64_t gHotSpotVMTypeEntrySizeOffset; -extern uint64_t gHotSpotVMTypeEntryArrayStride; +extern VMTypeEntry* jvmciHotSpotVMTypes; +extern uint64_t jvmciHotSpotVMTypeEntryTypeNameOffset; +extern uint64_t jvmciHotSpotVMTypeEntrySuperclassNameOffset; +extern uint64_t jvmciHotSpotVMTypeEntryIsOopTypeOffset; +extern uint64_t jvmciHotSpotVMTypeEntryIsIntegerTypeOffset; +extern uint64_t jvmciHotSpotVMTypeEntryIsUnsignedOffset; +extern uint64_t jvmciHotSpotVMTypeEntrySizeOffset; +extern uint64_t jvmciHotSpotVMTypeEntryArrayStride; -extern VMIntConstantEntry* gHotSpotVMIntConstants; -extern uint64_t gHotSpotVMIntConstantEntryNameOffset; -extern uint64_t gHotSpotVMIntConstantEntryValueOffset; -extern uint64_t gHotSpotVMIntConstantEntryArrayStride; +extern VMIntConstantEntry* jvmciHotSpotVMIntConstants; +extern uint64_t jvmciHotSpotVMIntConstantEntryNameOffset; +extern uint64_t jvmciHotSpotVMIntConstantEntryValueOffset; +extern uint64_t jvmciHotSpotVMIntConstantEntryArrayStride; -extern VMLongConstantEntry* gHotSpotVMLongConstants; -extern uint64_t gHotSpotVMLongConstantEntryNameOffset; -extern uint64_t gHotSpotVMLongConstantEntryValueOffset; -extern uint64_t gHotSpotVMLongConstantEntryArrayStride; +extern VMLongConstantEntry* jvmciHotSpotVMLongConstants; +extern uint64_t jvmciHotSpotVMLongConstantEntryNameOffset; +extern uint64_t jvmciHotSpotVMLongConstantEntryValueOffset; +extern uint64_t jvmciHotSpotVMLongConstantEntryArrayStride; -extern VMAddressEntry* gHotSpotVMAddresses; -extern uint64_t gHotSpotVMAddressEntryNameOffset; -extern uint64_t gHotSpotVMAddressEntryValueOffset; -extern uint64_t gHotSpotVMAddressEntryArrayStride; +extern VMAddressEntry* jvmciHotSpotVMAddresses; +extern uint64_t jvmciHotSpotVMAddressEntryNameOffset; +extern uint64_t jvmciHotSpotVMAddressEntryValueOffset; +extern uint64_t jvmciHotSpotVMAddressEntryArrayStride; } -// FIXME This is only temporary until the GC code is changed. -bool CompilerToVM::_supports_inline_contig_alloc; -HeapWord** CompilerToVM::_heap_end_addr; -HeapWord** CompilerToVM::_heap_top_addr; +int CompilerToVM::Data::InstanceKlass_vtable_start_offset; +int CompilerToVM::Data::InstanceKlass_vtable_length_offset; + +int CompilerToVM::Data::Method_extra_stack_entries; + +address CompilerToVM::Data::SharedRuntime_ic_miss_stub; +address CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub; +address CompilerToVM::Data::SharedRuntime_deopt_blob_unpack; +address CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap; + +size_t CompilerToVM::Data::ThreadLocalAllocBuffer_alignment_reserve; + +CollectedHeap* CompilerToVM::Data::Universe_collectedHeap; +int CompilerToVM::Data::Universe_base_vtable_size; +address CompilerToVM::Data::Universe_narrow_oop_base; +int CompilerToVM::Data::Universe_narrow_oop_shift; +address CompilerToVM::Data::Universe_narrow_klass_base; +int CompilerToVM::Data::Universe_narrow_klass_shift; +void* CompilerToVM::Data::Universe_non_oop_bits; +uintptr_t CompilerToVM::Data::Universe_verify_oop_mask; +uintptr_t CompilerToVM::Data::Universe_verify_oop_bits; + +bool CompilerToVM::Data::_supports_inline_contig_alloc; +HeapWord** CompilerToVM::Data::_heap_end_addr; +HeapWord** CompilerToVM::Data::_heap_top_addr; + +jbyte* CompilerToVM::Data::cardtable_start_address; +int CompilerToVM::Data::cardtable_shift; + +void CompilerToVM::Data::initialize() { + InstanceKlass_vtable_start_offset = InstanceKlass::vtable_start_offset(); + InstanceKlass_vtable_length_offset = InstanceKlass::vtable_length_offset() * HeapWordSize; + + Method_extra_stack_entries = Method::extra_stack_entries(); + + SharedRuntime_ic_miss_stub = SharedRuntime::get_ic_miss_stub(); + SharedRuntime_handle_wrong_method_stub = SharedRuntime::get_handle_wrong_method_stub(); + SharedRuntime_deopt_blob_unpack = SharedRuntime::deopt_blob()->unpack(); + SharedRuntime_deopt_blob_uncommon_trap = SharedRuntime::deopt_blob()->uncommon_trap(); + + ThreadLocalAllocBuffer_alignment_reserve = ThreadLocalAllocBuffer::alignment_reserve(); + + Universe_collectedHeap = Universe::heap(); + Universe_base_vtable_size = Universe::base_vtable_size(); + Universe_narrow_oop_base = Universe::narrow_oop_base(); + Universe_narrow_oop_shift = Universe::narrow_oop_shift(); + Universe_narrow_klass_base = Universe::narrow_klass_base(); + Universe_narrow_klass_shift = Universe::narrow_klass_shift(); + Universe_non_oop_bits = Universe::non_oop_word(); + Universe_verify_oop_mask = Universe::verify_oop_mask(); + Universe_verify_oop_bits = Universe::verify_oop_bits(); + + _supports_inline_contig_alloc = Universe::heap()->supports_inline_contig_alloc(); + _heap_end_addr = _supports_inline_contig_alloc ? Universe::heap()->end_addr() : (HeapWord**) -1; + _heap_top_addr = _supports_inline_contig_alloc ? Universe::heap()->top_addr() : (HeapWord**) -1; + + BarrierSet* bs = Universe::heap()->barrier_set(); + switch (bs->kind()) { + case BarrierSet::CardTableModRef: + case BarrierSet::CardTableForRS: + case BarrierSet::CardTableExtension: + case BarrierSet::G1SATBCT: + case BarrierSet::G1SATBCTLogging: { + jbyte* base = barrier_set_cast(bs)->byte_map_base; + assert(base != 0, "unexpected byte_map_base"); + cardtable_start_address = base; + cardtable_shift = CardTableModRefBS::card_shift; + break; + } + case BarrierSet::ModRef: + cardtable_start_address = 0; + cardtable_shift = 0; + // No post barriers + break; + default: + ShouldNotReachHere(); + break; + } +} /** - * We put all gHotSpotVM values in an array so we can read them easily from Java. + * We put all jvmciHotSpotVM values in an array so we can read them easily from Java. */ static uintptr_t ciHotSpotVMData[28]; C2V_VMENTRY(jlong, initializeConfiguration, (JNIEnv *env, jobject)) - ciHotSpotVMData[0] = (uintptr_t) gHotSpotVMStructs; - ciHotSpotVMData[1] = gHotSpotVMStructEntryTypeNameOffset; - ciHotSpotVMData[2] = gHotSpotVMStructEntryFieldNameOffset; - ciHotSpotVMData[3] = gHotSpotVMStructEntryTypeStringOffset; - ciHotSpotVMData[4] = gHotSpotVMStructEntryIsStaticOffset; - ciHotSpotVMData[5] = gHotSpotVMStructEntryOffsetOffset; - ciHotSpotVMData[6] = gHotSpotVMStructEntryAddressOffset; - ciHotSpotVMData[7] = gHotSpotVMStructEntryArrayStride; + ciHotSpotVMData[0] = (uintptr_t) jvmciHotSpotVMStructs; + ciHotSpotVMData[1] = jvmciHotSpotVMStructEntryTypeNameOffset; + ciHotSpotVMData[2] = jvmciHotSpotVMStructEntryFieldNameOffset; + ciHotSpotVMData[3] = jvmciHotSpotVMStructEntryTypeStringOffset; + ciHotSpotVMData[4] = jvmciHotSpotVMStructEntryIsStaticOffset; + ciHotSpotVMData[5] = jvmciHotSpotVMStructEntryOffsetOffset; + ciHotSpotVMData[6] = jvmciHotSpotVMStructEntryAddressOffset; + ciHotSpotVMData[7] = jvmciHotSpotVMStructEntryArrayStride; - ciHotSpotVMData[8] = (uintptr_t) gHotSpotVMTypes; - ciHotSpotVMData[9] = gHotSpotVMTypeEntryTypeNameOffset; - ciHotSpotVMData[10] = gHotSpotVMTypeEntrySuperclassNameOffset; - ciHotSpotVMData[11] = gHotSpotVMTypeEntryIsOopTypeOffset; - ciHotSpotVMData[12] = gHotSpotVMTypeEntryIsIntegerTypeOffset; - ciHotSpotVMData[13] = gHotSpotVMTypeEntryIsUnsignedOffset; - ciHotSpotVMData[14] = gHotSpotVMTypeEntrySizeOffset; - ciHotSpotVMData[15] = gHotSpotVMTypeEntryArrayStride; + ciHotSpotVMData[8] = (uintptr_t) jvmciHotSpotVMTypes; + ciHotSpotVMData[9] = jvmciHotSpotVMTypeEntryTypeNameOffset; + ciHotSpotVMData[10] = jvmciHotSpotVMTypeEntrySuperclassNameOffset; + ciHotSpotVMData[11] = jvmciHotSpotVMTypeEntryIsOopTypeOffset; + ciHotSpotVMData[12] = jvmciHotSpotVMTypeEntryIsIntegerTypeOffset; + ciHotSpotVMData[13] = jvmciHotSpotVMTypeEntryIsUnsignedOffset; + ciHotSpotVMData[14] = jvmciHotSpotVMTypeEntrySizeOffset; + ciHotSpotVMData[15] = jvmciHotSpotVMTypeEntryArrayStride; - ciHotSpotVMData[16] = (uintptr_t) gHotSpotVMIntConstants; - ciHotSpotVMData[17] = gHotSpotVMIntConstantEntryNameOffset; - ciHotSpotVMData[18] = gHotSpotVMIntConstantEntryValueOffset; - ciHotSpotVMData[19] = gHotSpotVMIntConstantEntryArrayStride; + ciHotSpotVMData[16] = (uintptr_t) jvmciHotSpotVMIntConstants; + ciHotSpotVMData[17] = jvmciHotSpotVMIntConstantEntryNameOffset; + ciHotSpotVMData[18] = jvmciHotSpotVMIntConstantEntryValueOffset; + ciHotSpotVMData[19] = jvmciHotSpotVMIntConstantEntryArrayStride; - ciHotSpotVMData[20] = (uintptr_t) gHotSpotVMLongConstants; - ciHotSpotVMData[21] = gHotSpotVMLongConstantEntryNameOffset; - ciHotSpotVMData[22] = gHotSpotVMLongConstantEntryValueOffset; - ciHotSpotVMData[23] = gHotSpotVMLongConstantEntryArrayStride; + ciHotSpotVMData[20] = (uintptr_t) jvmciHotSpotVMLongConstants; + ciHotSpotVMData[21] = jvmciHotSpotVMLongConstantEntryNameOffset; + ciHotSpotVMData[22] = jvmciHotSpotVMLongConstantEntryValueOffset; + ciHotSpotVMData[23] = jvmciHotSpotVMLongConstantEntryArrayStride; - ciHotSpotVMData[24] = (uintptr_t) gHotSpotVMAddresses; - ciHotSpotVMData[25] = gHotSpotVMAddressEntryNameOffset; - ciHotSpotVMData[26] = gHotSpotVMAddressEntryValueOffset; - ciHotSpotVMData[27] = gHotSpotVMAddressEntryArrayStride; + ciHotSpotVMData[24] = (uintptr_t) jvmciHotSpotVMAddresses; + ciHotSpotVMData[25] = jvmciHotSpotVMAddressEntryNameOffset; + ciHotSpotVMData[26] = jvmciHotSpotVMAddressEntryValueOffset; + ciHotSpotVMData[27] = jvmciHotSpotVMAddressEntryArrayStride; - // FIXME This is only temporary until the GC code is changed. - CompilerToVM::_supports_inline_contig_alloc = Universe::heap()->supports_inline_contig_alloc(); - CompilerToVM::_heap_end_addr = CompilerToVM::_supports_inline_contig_alloc ? Universe::heap()->end_addr() : (HeapWord**) -1; - CompilerToVM::_heap_top_addr = CompilerToVM::_supports_inline_contig_alloc ? Universe::heap()->top_addr() : (HeapWord**) -1; + CompilerToVM::Data::initialize(); return (jlong) (address) &ciHotSpotVMData; C2V_END diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp index 35f17689f1e..1947324556b 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp @@ -29,28 +29,45 @@ #include "jvmci/jvmciJavaClasses.hpp" class CompilerToVM { -public: - /** - * Tag bits used by lookupKlassInPool to distinguish the types in Java. - */ - enum Tags { - KLASS_TAG = 0x0, - SYMBOL_TAG = 0x1 + public: + class Data { + friend class JVMCIVMStructs; + + private: + static int InstanceKlass_vtable_start_offset; + static int InstanceKlass_vtable_length_offset; + + static int Method_extra_stack_entries; + + static address SharedRuntime_ic_miss_stub; + static address SharedRuntime_handle_wrong_method_stub; + static address SharedRuntime_deopt_blob_unpack; + static address SharedRuntime_deopt_blob_uncommon_trap; + + static size_t ThreadLocalAllocBuffer_alignment_reserve; + + static CollectedHeap* Universe_collectedHeap; + static int Universe_base_vtable_size; + static address Universe_narrow_oop_base; + static int Universe_narrow_oop_shift; + static address Universe_narrow_klass_base; + static int Universe_narrow_klass_shift; + static uintptr_t Universe_verify_oop_mask; + static uintptr_t Universe_verify_oop_bits; + static void* Universe_non_oop_bits; + + static bool _supports_inline_contig_alloc; + static HeapWord** _heap_end_addr; + static HeapWord** _heap_top_addr; + + static jbyte* cardtable_start_address; + static int cardtable_shift; + + public: + static void initialize(); }; - // FIXME This is only temporary until the GC code is changed. - static bool _supports_inline_contig_alloc; - static HeapWord** _heap_end_addr; - static HeapWord** _heap_top_addr; - - static intptr_t tag_pointer(Klass* klass) { - return ((intptr_t) klass) | KLASS_TAG; - } - - static intptr_t tag_pointer(Symbol* symbol) { - return ((intptr_t) symbol) | SYMBOL_TAG; - } - + public: static JNINativeMethod methods[]; static int methods_count(); diff --git a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp index 173729259fe..2bc95d3308c 100644 --- a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp @@ -53,6 +53,7 @@ class CompileTask; class JVMCIEnv : StackObj { CI_PACKAGE_ACCESS_TO + friend class JVMCIVMStructs; friend class CompileBroker; friend class Dependencies; // for get_object, during logging diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp index afcbdf27f82..893a576699f 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp @@ -813,10 +813,6 @@ JVM_ENTRY(void, JVM_RegisterJVMCINatives(JNIEnv *env, jclass c2vmClass)) { ThreadToNativeFromVM trans(thread); - - // Ensure _non_oop_bits is initialized - Universe::non_oop_word(); - env->RegisterNatives(c2vmClass, CompilerToVM::methods, CompilerToVM::methods_count()); } JVM_END diff --git a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp new file mode 100644 index 00000000000..fdd816a1929 --- /dev/null +++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp @@ -0,0 +1,849 @@ +/* + * 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. + * + */ + +#include "precompiled.hpp" +#include "code/codeBlob.hpp" +#include "compiler/abstractCompiler.hpp" +#include "compiler/compileBroker.hpp" +#include "jvmci/jvmciCodeInstaller.hpp" +#include "jvmci/jvmciCompilerToVM.hpp" +#include "jvmci/jvmciEnv.hpp" +#include "jvmci/jvmciRuntime.hpp" +#include "jvmci/vmStructs_jvmci.hpp" +#include "oops/oop.hpp" +#include "oops/objArrayKlass.hpp" +#include "runtime/globals.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/thread.hpp" +#include "runtime/vm_version.hpp" + +#if INCLUDE_ALL_GCS +#include "gc/g1/g1SATBCardTableModRefBS.hpp" +#include "gc/g1/heapRegion.hpp" +#endif + + +#define VM_STRUCTS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field) \ + static_field(CompilerToVM::Data, InstanceKlass_vtable_start_offset, int) \ + static_field(CompilerToVM::Data, InstanceKlass_vtable_length_offset, int) \ + \ + static_field(CompilerToVM::Data, Method_extra_stack_entries, int) \ + \ + static_field(CompilerToVM::Data, SharedRuntime_ic_miss_stub, address) \ + static_field(CompilerToVM::Data, SharedRuntime_handle_wrong_method_stub, address) \ + static_field(CompilerToVM::Data, SharedRuntime_deopt_blob_unpack, address) \ + static_field(CompilerToVM::Data, SharedRuntime_deopt_blob_uncommon_trap, address) \ + \ + static_field(CompilerToVM::Data, ThreadLocalAllocBuffer_alignment_reserve, size_t) \ + \ + static_field(CompilerToVM::Data, Universe_collectedHeap, CollectedHeap*) \ + static_field(CompilerToVM::Data, Universe_base_vtable_size, int) \ + static_field(CompilerToVM::Data, Universe_narrow_oop_base, address) \ + static_field(CompilerToVM::Data, Universe_narrow_oop_shift, int) \ + static_field(CompilerToVM::Data, Universe_narrow_klass_base, address) \ + static_field(CompilerToVM::Data, Universe_narrow_klass_shift, int) \ + static_field(CompilerToVM::Data, Universe_non_oop_bits, void*) \ + static_field(CompilerToVM::Data, Universe_verify_oop_mask, uintptr_t) \ + static_field(CompilerToVM::Data, Universe_verify_oop_bits, uintptr_t) \ + \ + static_field(CompilerToVM::Data, _supports_inline_contig_alloc, bool) \ + static_field(CompilerToVM::Data, _heap_end_addr, HeapWord**) \ + static_field(CompilerToVM::Data, _heap_top_addr, HeapWord**) \ + \ + static_field(CompilerToVM::Data, cardtable_start_address, jbyte*) \ + static_field(CompilerToVM::Data, cardtable_shift, int) \ + \ + nonstatic_field(Array, _length, int) \ + unchecked_nonstatic_field(Array, _data, sizeof(u1)) \ + unchecked_nonstatic_field(Array, _data, sizeof(u2)) \ + nonstatic_field(Array, _length, int) \ + nonstatic_field(Array, _data[0], Klass*) \ + \ + volatile_nonstatic_field(BasicLock, _displaced_header, markOop) \ + \ + static_field(CodeCache, _low_bound, address) \ + static_field(CodeCache, _high_bound, address) \ + \ + nonstatic_field(CollectedHeap, _total_collections, unsigned int) \ + \ + nonstatic_field(CompileTask, _num_inlined_bytecodes, int) \ + \ + nonstatic_field(ConstantPool, _tags, Array*) \ + nonstatic_field(ConstantPool, _pool_holder, InstanceKlass*) \ + nonstatic_field(ConstantPool, _length, int) \ + \ + nonstatic_field(ConstMethod, _constants, ConstantPool*) \ + nonstatic_field(ConstMethod, _flags, u2) \ + nonstatic_field(ConstMethod, _code_size, u2) \ + nonstatic_field(ConstMethod, _name_index, u2) \ + nonstatic_field(ConstMethod, _signature_index, u2) \ + nonstatic_field(ConstMethod, _max_stack, u2) \ + nonstatic_field(ConstMethod, _max_locals, u2) \ + \ + nonstatic_field(DataLayout, _header._struct._tag, u1) \ + nonstatic_field(DataLayout, _header._struct._flags, u1) \ + nonstatic_field(DataLayout, _header._struct._bci, u2) \ + nonstatic_field(DataLayout, _cells[0], intptr_t) \ + \ + nonstatic_field(Deoptimization::UnrollBlock, _size_of_deoptimized_frame, int) \ + nonstatic_field(Deoptimization::UnrollBlock, _caller_adjustment, int) \ + nonstatic_field(Deoptimization::UnrollBlock, _number_of_frames, int) \ + nonstatic_field(Deoptimization::UnrollBlock, _total_frame_sizes, int) \ + nonstatic_field(Deoptimization::UnrollBlock, _frame_sizes, intptr_t*) \ + nonstatic_field(Deoptimization::UnrollBlock, _frame_pcs, address*) \ + nonstatic_field(Deoptimization::UnrollBlock, _initial_info, intptr_t) \ + nonstatic_field(Deoptimization::UnrollBlock, _unpack_kind, int) \ + \ + nonstatic_field(ExceptionTableElement, start_pc, u2) \ + nonstatic_field(ExceptionTableElement, end_pc, u2) \ + nonstatic_field(ExceptionTableElement, handler_pc, u2) \ + nonstatic_field(ExceptionTableElement, catch_type_index, u2) \ + \ + nonstatic_field(Flag, _type, const char*) \ + nonstatic_field(Flag, _name, const char*) \ + unchecked_nonstatic_field(Flag, _addr, sizeof(void*)) \ + nonstatic_field(Flag, _flags, Flag::Flags) \ + static_field(Flag, flags, Flag*) \ + \ + nonstatic_field(InstanceKlass, _fields, Array*) \ + nonstatic_field(InstanceKlass, _constants, ConstantPool*) \ + nonstatic_field(InstanceKlass, _source_file_name_index, u2) \ + nonstatic_field(InstanceKlass, _init_state, u1) \ + \ + volatile_nonstatic_field(JavaFrameAnchor, _last_Java_sp, intptr_t*) \ + volatile_nonstatic_field(JavaFrameAnchor, _last_Java_pc, address) \ + \ + nonstatic_field(JavaThread, _threadObj, oop) \ + nonstatic_field(JavaThread, _anchor, JavaFrameAnchor) \ + nonstatic_field(JavaThread, _vm_result, oop) \ + volatile_nonstatic_field(JavaThread, _exception_oop, oop) \ + volatile_nonstatic_field(JavaThread, _exception_pc, address) \ + volatile_nonstatic_field(JavaThread, _is_method_handle_return, int) \ + nonstatic_field(JavaThread, _osthread, OSThread*) \ + nonstatic_field(JavaThread, _satb_mark_queue, SATBMarkQueue) \ + nonstatic_field(JavaThread, _dirty_card_queue, DirtyCardQueue) \ + nonstatic_field(JavaThread, _pending_deoptimization, int) \ + nonstatic_field(JavaThread, _pending_failed_speculation, oop) \ + nonstatic_field(JavaThread, _pending_transfer_to_interpreter, bool) \ + nonstatic_field(JavaThread, _jvmci_counters, jlong*) \ + \ + static_field(java_lang_Class, _klass_offset, int) \ + static_field(java_lang_Class, _array_klass_offset, int) \ + \ + nonstatic_field(JVMCIEnv, _task, CompileTask*) \ + nonstatic_field(JVMCIEnv, _jvmti_can_hotswap_or_post_breakpoint, bool) \ + \ + nonstatic_field(Klass, _secondary_super_cache, Klass*) \ + nonstatic_field(Klass, _secondary_supers, Array*) \ + nonstatic_field(Klass, _super, Klass*) \ + nonstatic_field(Klass, _super_check_offset, juint) \ + nonstatic_field(Klass, _subklass, Klass*) \ + nonstatic_field(Klass, _layout_helper, jint) \ + nonstatic_field(Klass, _prototype_header, markOop) \ + nonstatic_field(Klass, _next_sibling, Klass*) \ + nonstatic_field(Klass, _java_mirror, oop) \ + nonstatic_field(Klass, _modifier_flags, jint) \ + nonstatic_field(Klass, _access_flags, AccessFlags) \ + \ + nonstatic_field(LocalVariableTableElement, start_bci, u2) \ + nonstatic_field(LocalVariableTableElement, length, u2) \ + nonstatic_field(LocalVariableTableElement, name_cp_index, u2) \ + nonstatic_field(LocalVariableTableElement, descriptor_cp_index, u2) \ + nonstatic_field(LocalVariableTableElement, signature_cp_index, u2) \ + nonstatic_field(LocalVariableTableElement, slot, u2) \ + \ + nonstatic_field(Method, _constMethod, ConstMethod*) \ + nonstatic_field(Method, _method_data, MethodData*) \ + nonstatic_field(Method, _method_counters, MethodCounters*) \ + nonstatic_field(Method, _access_flags, AccessFlags) \ + nonstatic_field(Method, _vtable_index, int) \ + nonstatic_field(Method, _intrinsic_id, u2) \ + nonstatic_field(Method, _flags, u1) \ + volatile_nonstatic_field(Method, _code, nmethod*) \ + volatile_nonstatic_field(Method, _from_compiled_entry, address) \ + \ + nonstatic_field(MethodCounters, _invocation_counter, InvocationCounter) \ + nonstatic_field(MethodCounters, _backedge_counter, InvocationCounter) \ + \ + nonstatic_field(MethodData, _size, int) \ + nonstatic_field(MethodData, _data_size, int) \ + nonstatic_field(MethodData, _data[0], intptr_t) \ + nonstatic_field(MethodData, _trap_hist._array[0], u1) \ + nonstatic_field(MethodData, _jvmci_ir_size, int) \ + \ + nonstatic_field(nmethod, _verified_entry_point, address) \ + nonstatic_field(nmethod, _comp_level, int) \ + \ + nonstatic_field(ObjArrayKlass, _element_klass, Klass*) \ + \ + volatile_nonstatic_field(oopDesc, _mark, markOop) \ + volatile_nonstatic_field(oopDesc, _metadata._klass, Klass*) \ + \ + static_field(os, _polling_page, address) \ + \ + volatile_nonstatic_field(OSThread, _interrupted, jint) \ + \ + static_field(StubRoutines, _verify_oop_count, jint) \ + \ + static_field(StubRoutines, _jbyte_arraycopy, address) \ + static_field(StubRoutines, _jshort_arraycopy, address) \ + static_field(StubRoutines, _jint_arraycopy, address) \ + static_field(StubRoutines, _jlong_arraycopy, address) \ + static_field(StubRoutines, _oop_arraycopy, address) \ + static_field(StubRoutines, _oop_arraycopy_uninit, address) \ + static_field(StubRoutines, _jbyte_disjoint_arraycopy, address) \ + static_field(StubRoutines, _jshort_disjoint_arraycopy, address) \ + static_field(StubRoutines, _jint_disjoint_arraycopy, address) \ + static_field(StubRoutines, _jlong_disjoint_arraycopy, address) \ + static_field(StubRoutines, _oop_disjoint_arraycopy, address) \ + static_field(StubRoutines, _oop_disjoint_arraycopy_uninit, address) \ + static_field(StubRoutines, _arrayof_jbyte_arraycopy, address) \ + static_field(StubRoutines, _arrayof_jshort_arraycopy, address) \ + static_field(StubRoutines, _arrayof_jint_arraycopy, address) \ + static_field(StubRoutines, _arrayof_jlong_arraycopy, address) \ + static_field(StubRoutines, _arrayof_oop_arraycopy, address) \ + static_field(StubRoutines, _arrayof_oop_arraycopy_uninit, address) \ + static_field(StubRoutines, _arrayof_jbyte_disjoint_arraycopy, address) \ + static_field(StubRoutines, _arrayof_jshort_disjoint_arraycopy, address) \ + static_field(StubRoutines, _arrayof_jint_disjoint_arraycopy, address) \ + static_field(StubRoutines, _arrayof_jlong_disjoint_arraycopy, address) \ + static_field(StubRoutines, _arrayof_oop_disjoint_arraycopy, address) \ + static_field(StubRoutines, _arrayof_oop_disjoint_arraycopy_uninit, address) \ + static_field(StubRoutines, _checkcast_arraycopy, address) \ + static_field(StubRoutines, _checkcast_arraycopy_uninit, address) \ + static_field(StubRoutines, _unsafe_arraycopy, address) \ + static_field(StubRoutines, _generic_arraycopy, address) \ + \ + static_field(StubRoutines, _aescrypt_encryptBlock, address) \ + static_field(StubRoutines, _aescrypt_decryptBlock, address) \ + static_field(StubRoutines, _cipherBlockChaining_encryptAESCrypt, address) \ + static_field(StubRoutines, _cipherBlockChaining_decryptAESCrypt, address) \ + static_field(StubRoutines, _updateBytesCRC32, address) \ + static_field(StubRoutines, _crc_table_adr, address) \ + \ + nonstatic_field(Thread, _tlab, ThreadLocalAllocBuffer) \ + nonstatic_field(Thread, _allocated_bytes, jlong) \ + \ + nonstatic_field(ThreadLocalAllocBuffer, _start, HeapWord*) \ + nonstatic_field(ThreadLocalAllocBuffer, _top, HeapWord*) \ + nonstatic_field(ThreadLocalAllocBuffer, _end, HeapWord*) \ + nonstatic_field(ThreadLocalAllocBuffer, _pf_top, HeapWord*) \ + nonstatic_field(ThreadLocalAllocBuffer, _desired_size, size_t) \ + nonstatic_field(ThreadLocalAllocBuffer, _refill_waste_limit, size_t) \ + nonstatic_field(ThreadLocalAllocBuffer, _number_of_refills, unsigned) \ + nonstatic_field(ThreadLocalAllocBuffer, _fast_refill_waste, unsigned) \ + nonstatic_field(ThreadLocalAllocBuffer, _slow_allocations, unsigned) \ + \ + nonstatic_field(ThreadShadow, _pending_exception, oop) \ + \ + static_field(vmSymbols, _symbols[0], Symbol*) \ + \ + nonstatic_field(vtableEntry, _method, Method*) \ + +#define VM_TYPES(declare_type, declare_toplevel_type, declare_integer_type, declare_unsigned_integer_type) \ + declare_integer_type(bool) \ + declare_unsigned_integer_type(size_t) \ + declare_integer_type(intx) \ + declare_unsigned_integer_type(uintx) \ + \ + declare_toplevel_type(BasicLock) \ + declare_toplevel_type(CompilerToVM) \ + declare_toplevel_type(ExceptionTableElement) \ + declare_toplevel_type(Flag) \ + declare_toplevel_type(Flag*) \ + declare_toplevel_type(JVMCIEnv) \ + declare_toplevel_type(LocalVariableTableElement) \ + declare_toplevel_type(narrowKlass) \ + declare_toplevel_type(Symbol*) \ + declare_toplevel_type(vtableEntry) \ + \ + declare_toplevel_type(oopDesc) \ + declare_type(arrayOopDesc, oopDesc) \ + \ + declare_toplevel_type(MetaspaceObj) \ + declare_type(Metadata, MetaspaceObj) \ + declare_type(Klass, Metadata) \ + declare_type(InstanceKlass, Klass) \ + declare_type(ConstantPool, Metadata) \ + +#define VM_INT_CONSTANTS(declare_constant, declare_constant_with_value, declare_preprocessor_constant) \ + declare_preprocessor_constant("ASSERT", DEBUG_ONLY(1) NOT_DEBUG(0)) \ + declare_preprocessor_constant("FIELDINFO_TAG_SIZE", FIELDINFO_TAG_SIZE) \ + declare_preprocessor_constant("STACK_BIAS", STACK_BIAS) \ + \ + declare_constant(CompLevel_full_optimization) \ + declare_constant(HeapWordSize) \ + declare_constant(InvocationEntryBci) \ + declare_constant(LogKlassAlignmentInBytes) \ + \ + declare_constant(JVM_ACC_WRITTEN_FLAGS) \ + declare_constant(JVM_ACC_MONITOR_MATCH) \ + declare_constant(JVM_ACC_HAS_MONITOR_BYTECODES) \ + declare_constant(JVM_ACC_HAS_FINALIZER) \ + declare_constant(JVM_ACC_FIELD_INTERNAL) \ + declare_constant(JVM_ACC_FIELD_STABLE) \ + declare_constant(JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE) \ + declare_preprocessor_constant("JVM_ACC_SYNTHETIC", JVM_ACC_SYNTHETIC) \ + declare_preprocessor_constant("JVM_RECOGNIZED_FIELD_MODIFIERS", JVM_RECOGNIZED_FIELD_MODIFIERS) \ + \ + declare_constant(JVM_CONSTANT_Utf8) \ + declare_constant(JVM_CONSTANT_Unicode) \ + declare_constant(JVM_CONSTANT_Integer) \ + declare_constant(JVM_CONSTANT_Float) \ + declare_constant(JVM_CONSTANT_Long) \ + declare_constant(JVM_CONSTANT_Double) \ + declare_constant(JVM_CONSTANT_Class) \ + declare_constant(JVM_CONSTANT_String) \ + declare_constant(JVM_CONSTANT_Fieldref) \ + declare_constant(JVM_CONSTANT_Methodref) \ + declare_constant(JVM_CONSTANT_InterfaceMethodref) \ + declare_constant(JVM_CONSTANT_NameAndType) \ + declare_constant(JVM_CONSTANT_MethodHandle) \ + declare_constant(JVM_CONSTANT_MethodType) \ + declare_constant(JVM_CONSTANT_InvokeDynamic) \ + declare_constant(JVM_CONSTANT_ExternalMax) \ + \ + declare_constant(JVM_CONSTANT_Invalid) \ + declare_constant(JVM_CONSTANT_InternalMin) \ + declare_constant(JVM_CONSTANT_UnresolvedClass) \ + declare_constant(JVM_CONSTANT_ClassIndex) \ + declare_constant(JVM_CONSTANT_StringIndex) \ + declare_constant(JVM_CONSTANT_UnresolvedClassInError) \ + declare_constant(JVM_CONSTANT_MethodHandleInError) \ + declare_constant(JVM_CONSTANT_MethodTypeInError) \ + declare_constant(JVM_CONSTANT_InternalMax) \ + \ + declare_constant(ArrayData::array_len_off_set) \ + declare_constant(ArrayData::array_start_off_set) \ + \ + declare_constant(BitData::exception_seen_flag) \ + declare_constant(BitData::null_seen_flag) \ + declare_constant(BranchData::not_taken_off_set) \ + \ + declare_constant_with_value("CardTableModRefBS::dirty_card", CardTableModRefBS::dirty_card_val()) \ + \ + declare_constant(CodeInstaller::VERIFIED_ENTRY) \ + declare_constant(CodeInstaller::UNVERIFIED_ENTRY) \ + declare_constant(CodeInstaller::OSR_ENTRY) \ + declare_constant(CodeInstaller::EXCEPTION_HANDLER_ENTRY) \ + declare_constant(CodeInstaller::DEOPT_HANDLER_ENTRY) \ + declare_constant(CodeInstaller::INVOKEINTERFACE) \ + declare_constant(CodeInstaller::INVOKEVIRTUAL) \ + declare_constant(CodeInstaller::INVOKESTATIC) \ + declare_constant(CodeInstaller::INVOKESPECIAL) \ + declare_constant(CodeInstaller::INLINE_INVOKE) \ + declare_constant(CodeInstaller::POLL_NEAR) \ + declare_constant(CodeInstaller::POLL_RETURN_NEAR) \ + declare_constant(CodeInstaller::POLL_FAR) \ + declare_constant(CodeInstaller::POLL_RETURN_FAR) \ + declare_constant(CodeInstaller::CARD_TABLE_SHIFT) \ + declare_constant(CodeInstaller::CARD_TABLE_ADDRESS) \ + declare_constant(CodeInstaller::HEAP_TOP_ADDRESS) \ + declare_constant(CodeInstaller::HEAP_END_ADDRESS) \ + declare_constant(CodeInstaller::NARROW_KLASS_BASE_ADDRESS) \ + declare_constant(CodeInstaller::CRC_TABLE_ADDRESS) \ + declare_constant(CodeInstaller::INVOKE_INVALID) \ + \ + declare_constant(ConstantPool::CPCACHE_INDEX_TAG) \ + \ + declare_constant(ConstMethod::_has_linenumber_table) \ + declare_constant(ConstMethod::_has_localvariable_table) \ + declare_constant(ConstMethod::_has_exception_table) \ + \ + declare_constant(CounterData::count_off) \ + \ + declare_constant(DataLayout::cell_size) \ + declare_constant(DataLayout::no_tag) \ + declare_constant(DataLayout::bit_data_tag) \ + declare_constant(DataLayout::counter_data_tag) \ + declare_constant(DataLayout::jump_data_tag) \ + declare_constant(DataLayout::receiver_type_data_tag) \ + declare_constant(DataLayout::virtual_call_data_tag) \ + declare_constant(DataLayout::ret_data_tag) \ + declare_constant(DataLayout::branch_data_tag) \ + declare_constant(DataLayout::multi_branch_data_tag) \ + declare_constant(DataLayout::arg_info_data_tag) \ + declare_constant(DataLayout::call_type_data_tag) \ + declare_constant(DataLayout::virtual_call_type_data_tag) \ + declare_constant(DataLayout::parameters_type_data_tag) \ + declare_constant(DataLayout::speculative_trap_data_tag) \ + \ + declare_constant(Deoptimization::Unpack_deopt) \ + declare_constant(Deoptimization::Unpack_exception) \ + declare_constant(Deoptimization::Unpack_uncommon_trap) \ + declare_constant(Deoptimization::Unpack_reexecute) \ + \ + declare_constant(Deoptimization::_action_bits) \ + declare_constant(Deoptimization::_reason_bits) \ + declare_constant(Deoptimization::_debug_id_bits) \ + declare_constant(Deoptimization::_action_shift) \ + declare_constant(Deoptimization::_reason_shift) \ + declare_constant(Deoptimization::_debug_id_shift) \ + \ + declare_constant(Deoptimization::Action_none) \ + declare_constant(Deoptimization::Action_maybe_recompile) \ + declare_constant(Deoptimization::Action_reinterpret) \ + declare_constant(Deoptimization::Action_make_not_entrant) \ + declare_constant(Deoptimization::Action_make_not_compilable) \ + \ + declare_constant(Deoptimization::Reason_none) \ + declare_constant(Deoptimization::Reason_null_check) \ + declare_constant(Deoptimization::Reason_range_check) \ + declare_constant(Deoptimization::Reason_class_check) \ + declare_constant(Deoptimization::Reason_array_check) \ + declare_constant(Deoptimization::Reason_unreached0) \ + declare_constant(Deoptimization::Reason_constraint) \ + declare_constant(Deoptimization::Reason_div0_check) \ + declare_constant(Deoptimization::Reason_loop_limit_check) \ + declare_constant(Deoptimization::Reason_type_checked_inlining) \ + declare_constant(Deoptimization::Reason_optimized_type_check) \ + declare_constant(Deoptimization::Reason_aliasing) \ + declare_constant(Deoptimization::Reason_transfer_to_interpreter) \ + declare_constant(Deoptimization::Reason_not_compiled_exception_handler) \ + declare_constant(Deoptimization::Reason_unresolved) \ + declare_constant(Deoptimization::Reason_jsr_mismatch) \ + declare_constant(Deoptimization::Reason_LIMIT) \ + \ + declare_constant_with_value("dirtyCardQueueBufferOffset", in_bytes(DirtyCardQueue::byte_offset_of_buf())) \ + declare_constant_with_value("dirtyCardQueueIndexOffset", in_bytes(DirtyCardQueue::byte_offset_of_index())) \ + \ + declare_constant(FieldInfo::access_flags_offset) \ + declare_constant(FieldInfo::name_index_offset) \ + declare_constant(FieldInfo::signature_index_offset) \ + declare_constant(FieldInfo::initval_index_offset) \ + declare_constant(FieldInfo::low_packed_offset) \ + declare_constant(FieldInfo::high_packed_offset) \ + declare_constant(FieldInfo::field_slots) \ + \ + declare_constant(InstanceKlass::linked) \ + declare_constant(InstanceKlass::fully_initialized) \ + \ + declare_constant(JumpData::taken_off_set) \ + declare_constant(JumpData::displacement_off_set) \ + \ + declare_constant(JVMCIEnv::ok) \ + declare_constant(JVMCIEnv::dependencies_failed) \ + declare_constant(JVMCIEnv::dependencies_invalid) \ + declare_constant(JVMCIEnv::cache_full) \ + declare_constant(JVMCIEnv::code_too_large) \ + \ + declare_constant(Klass::_lh_neutral_value) \ + declare_constant(Klass::_lh_instance_slow_path_bit) \ + declare_constant(Klass::_lh_log2_element_size_shift) \ + declare_constant(Klass::_lh_log2_element_size_mask) \ + declare_constant(Klass::_lh_element_type_shift) \ + declare_constant(Klass::_lh_element_type_mask) \ + declare_constant(Klass::_lh_header_size_shift) \ + declare_constant(Klass::_lh_header_size_mask) \ + declare_constant(Klass::_lh_array_tag_shift) \ + declare_constant(Klass::_lh_array_tag_type_value) \ + declare_constant(Klass::_lh_array_tag_obj_value) \ + \ + declare_constant(markOopDesc::no_hash) \ + \ + declare_constant(Method::_jfr_towrite) \ + declare_constant(Method::_caller_sensitive) \ + declare_constant(Method::_force_inline) \ + declare_constant(Method::_dont_inline) \ + declare_constant(Method::_hidden) \ + \ + declare_constant(Method::nonvirtual_vtable_index) \ + declare_constant(Method::invalid_vtable_index) \ + \ + declare_constant(MultiBranchData::per_case_cell_count) \ + \ + declare_constant(ReceiverTypeData::nonprofiled_count_off_set) \ + declare_constant(ReceiverTypeData::receiver_type_row_cell_count) \ + declare_constant(ReceiverTypeData::receiver0_offset) \ + declare_constant(ReceiverTypeData::count0_offset) \ + \ + declare_constant_with_value("satbMarkQueueBufferOffset", in_bytes(SATBMarkQueue::byte_offset_of_buf())) \ + declare_constant_with_value("satbMarkQueueIndexOffset", in_bytes(SATBMarkQueue::byte_offset_of_index())) \ + declare_constant_with_value("satbMarkQueueActiveOffset", in_bytes(SATBMarkQueue::byte_offset_of_active())) \ + \ + declare_constant(vmIntrinsics::_invokeBasic) \ + declare_constant(vmIntrinsics::_linkToVirtual) \ + declare_constant(vmIntrinsics::_linkToStatic) \ + declare_constant(vmIntrinsics::_linkToSpecial) \ + declare_constant(vmIntrinsics::_linkToInterface) \ + \ + declare_constant(vmSymbols::FIRST_SID) \ + declare_constant(vmSymbols::SID_LIMIT) \ + +#define VM_LONG_CONSTANTS(declare_constant, declare_preprocessor_constant) \ + declare_constant(InvocationCounter::count_increment) \ + declare_constant(InvocationCounter::count_shift) \ + \ + declare_constant(markOopDesc::hash_shift) \ + \ + declare_constant(markOopDesc::biased_lock_mask_in_place) \ + declare_constant(markOopDesc::age_mask_in_place) \ + declare_constant(markOopDesc::epoch_mask_in_place) \ + declare_constant(markOopDesc::hash_mask) \ + declare_constant(markOopDesc::hash_mask_in_place) \ + \ + declare_constant(markOopDesc::unlocked_value) \ + declare_constant(markOopDesc::biased_lock_pattern) \ + \ + declare_constant(markOopDesc::no_hash_in_place) \ + declare_constant(markOopDesc::no_lock_in_place) \ + +#define VM_ADDRESSES(declare_address, declare_preprocessor_address, declare_function) \ + declare_function(SharedRuntime::register_finalizer) \ + declare_function(SharedRuntime::exception_handler_for_return_address) \ + declare_function(SharedRuntime::OSR_migration_end) \ + declare_function(SharedRuntime::dsin) \ + declare_function(SharedRuntime::dcos) \ + declare_function(SharedRuntime::dtan) \ + declare_function(SharedRuntime::dexp) \ + declare_function(SharedRuntime::dlog) \ + declare_function(SharedRuntime::dlog10) \ + declare_function(SharedRuntime::dpow) \ + \ + declare_function(os::dll_load) \ + declare_function(os::dll_lookup) \ + declare_function(os::javaTimeMillis) \ + declare_function(os::javaTimeNanos) \ + \ + declare_function(Deoptimization::fetch_unroll_info) \ + COMPILER2_PRESENT(declare_function(Deoptimization::uncommon_trap)) \ + declare_function(Deoptimization::unpack_frames) \ + \ + declare_function(JVMCIRuntime::new_instance) \ + declare_function(JVMCIRuntime::new_array) \ + declare_function(JVMCIRuntime::new_multi_array) \ + declare_function(JVMCIRuntime::dynamic_new_array) \ + declare_function(JVMCIRuntime::dynamic_new_instance) \ + \ + declare_function(JVMCIRuntime::thread_is_interrupted) \ + declare_function(JVMCIRuntime::vm_message) \ + declare_function(JVMCIRuntime::identity_hash_code) \ + declare_function(JVMCIRuntime::exception_handler_for_pc) \ + declare_function(JVMCIRuntime::monitorenter) \ + declare_function(JVMCIRuntime::monitorexit) \ + declare_function(JVMCIRuntime::create_null_exception) \ + declare_function(JVMCIRuntime::create_out_of_bounds_exception) \ + declare_function(JVMCIRuntime::log_primitive) \ + declare_function(JVMCIRuntime::log_object) \ + declare_function(JVMCIRuntime::log_printf) \ + declare_function(JVMCIRuntime::vm_error) \ + declare_function(JVMCIRuntime::load_and_clear_exception) \ + declare_function(JVMCIRuntime::write_barrier_pre) \ + declare_function(JVMCIRuntime::write_barrier_post) \ + declare_function(JVMCIRuntime::validate_object) \ + \ + declare_function(JVMCIRuntime::test_deoptimize_call_int) + + +#if INCLUDE_ALL_GCS + +#define VM_STRUCTS_G1(nonstatic_field, static_field) \ + static_field(HeapRegion, LogOfHRGrainBytes, int) + +#define VM_INT_CONSTANTS_G1(declare_constant, declare_constant_with_value, declare_preprocessor_constant) \ + declare_constant_with_value("G1SATBCardTableModRefBS::g1_young_gen", G1SATBCardTableModRefBS::g1_young_card_val()) + +#endif // INCLUDE_ALL_GCS + + +#ifdef TARGET_OS_FAMILY_linux + +#define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) \ + declare_preprocessor_address("RTLD_DEFAULT", RTLD_DEFAULT) + +#endif // TARGET_OS_FAMILY_linux + + +#ifdef TARGET_OS_FAMILY_bsd + +#define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) \ + declare_preprocessor_address("RTLD_DEFAULT", RTLD_DEFAULT) + +#endif // TARGET_OS_FAMILY_bsd + + +#ifdef TARGET_ARCH_x86 + +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ + volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ + static_field(VM_Version, _cpuFeatures, uint64_t) + +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ + declare_toplevel_type(VM_Version) + +#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ + LP64_ONLY(declare_constant(frame::arg_reg_save_area_bytes)) \ + declare_constant(frame::interpreter_frame_sender_sp_offset) \ + declare_constant(frame::interpreter_frame_last_sp_offset) \ + declare_constant(VM_Version::CPU_CX8) \ + declare_constant(VM_Version::CPU_CMOV) \ + declare_constant(VM_Version::CPU_FXSR) \ + declare_constant(VM_Version::CPU_HT) \ + declare_constant(VM_Version::CPU_MMX) \ + declare_constant(VM_Version::CPU_3DNOW_PREFETCH) \ + declare_constant(VM_Version::CPU_SSE) \ + declare_constant(VM_Version::CPU_SSE2) \ + declare_constant(VM_Version::CPU_SSE3) \ + declare_constant(VM_Version::CPU_SSSE3) \ + declare_constant(VM_Version::CPU_SSE4A) \ + declare_constant(VM_Version::CPU_SSE4_1) \ + declare_constant(VM_Version::CPU_SSE4_2) \ + declare_constant(VM_Version::CPU_POPCNT) \ + declare_constant(VM_Version::CPU_LZCNT) \ + declare_constant(VM_Version::CPU_TSC) \ + declare_constant(VM_Version::CPU_TSCINV) \ + declare_constant(VM_Version::CPU_AVX) \ + declare_constant(VM_Version::CPU_AVX2) \ + declare_constant(VM_Version::CPU_AES) \ + declare_constant(VM_Version::CPU_ERMS) \ + declare_constant(VM_Version::CPU_CLMUL) \ + declare_constant(VM_Version::CPU_BMI1) \ + declare_constant(VM_Version::CPU_BMI2) \ + declare_constant(VM_Version::CPU_RTM) \ + declare_constant(VM_Version::CPU_ADX) \ + declare_constant(VM_Version::CPU_AVX512F) \ + declare_constant(VM_Version::CPU_AVX512DQ) \ + declare_constant(VM_Version::CPU_AVX512PF) \ + declare_constant(VM_Version::CPU_AVX512ER) \ + declare_constant(VM_Version::CPU_AVX512CD) \ + declare_constant(VM_Version::CPU_AVX512BW) + +#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ + declare_preprocessor_constant("VM_Version::CPU_AVX512VL", CPU_AVX512VL) + +#endif // TARGET_ARCH_x86 + + +/* + * Dummy defines for architectures that don't use these. + */ +#ifndef VM_STRUCTS_CPU +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) +#endif + +#ifndef VM_TYPES_CPU +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) +#endif + +#ifndef VM_INT_CONSTANTS_CPU +#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) +#endif + +#ifndef VM_LONG_CONSTANTS_CPU +#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) +#endif + +#ifndef VM_STRUCTS_OS +#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) +#endif + +#ifndef VM_TYPES_OS +#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) +#endif + +#ifndef VM_INT_CONSTANTS_OS +#define VM_INT_CONSTANTS_OS(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) +#endif + +#ifndef VM_LONG_CONSTANTS_OS +#define VM_LONG_CONSTANTS_OS(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) +#endif + +#ifndef VM_ADDRESSES_OS +#define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) +#endif + + +// whole purpose of this function is to work around bug c++/27724 in gcc 4.1.1 +// with optimization turned on it doesn't affect produced code +static inline uint64_t cast_uint64_t(size_t x) +{ + return x; +} + +#define ASSIGN_CONST_TO_64BIT_VAR(var, expr) \ + JNIEXPORT uint64_t var = cast_uint64_t(expr); + +#define ASSIGN_OFFSET_TO_64BIT_VAR(var, type, field) \ + ASSIGN_CONST_TO_64BIT_VAR(var, offset_of(type, field)) + +#define ASSIGN_STRIDE_TO_64BIT_VAR(var, array) \ + ASSIGN_CONST_TO_64BIT_VAR(var, (char*)&array[1] - (char*)&array[0]) + +// +// Instantiation of VMStructEntries, VMTypeEntries and VMIntConstantEntries +// + +// These initializers are allowed to access private fields in classes +// as long as class VMStructs is a friend +VMStructEntry JVMCIVMStructs::localHotSpotVMStructs[] = { + VM_STRUCTS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_STATIC_VM_STRUCT_ENTRY, + GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_NONSTATIC_VM_STRUCT_ENTRY) + + VM_STRUCTS_OS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_STATIC_VM_STRUCT_ENTRY, + GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, + GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY) + + VM_STRUCTS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_STATIC_VM_STRUCT_ENTRY, + GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, + GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY) + +#if INCLUDE_ALL_GCS + VM_STRUCTS_G1(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_STATIC_VM_STRUCT_ENTRY) +#endif + + GENERATE_VM_STRUCT_LAST_ENTRY() +}; + +VMTypeEntry JVMCIVMStructs::localHotSpotVMTypes[] = { + VM_TYPES(GENERATE_VM_TYPE_ENTRY, + GENERATE_TOPLEVEL_VM_TYPE_ENTRY, + GENERATE_INTEGER_VM_TYPE_ENTRY, + GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY) + + VM_TYPES_OS(GENERATE_VM_TYPE_ENTRY, + GENERATE_TOPLEVEL_VM_TYPE_ENTRY, + GENERATE_OOP_VM_TYPE_ENTRY, + GENERATE_INTEGER_VM_TYPE_ENTRY, + GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, + GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY, + GENERATE_C2_VM_TYPE_ENTRY, + GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) + + VM_TYPES_CPU(GENERATE_VM_TYPE_ENTRY, + GENERATE_TOPLEVEL_VM_TYPE_ENTRY, + GENERATE_OOP_VM_TYPE_ENTRY, + GENERATE_INTEGER_VM_TYPE_ENTRY, + GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, + GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY, + GENERATE_C2_VM_TYPE_ENTRY, + GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) + + GENERATE_VM_TYPE_LAST_ENTRY() +}; + +VMIntConstantEntry JVMCIVMStructs::localHotSpotVMIntConstants[] = { + VM_INT_CONSTANTS(GENERATE_VM_INT_CONSTANT_ENTRY, + GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY, + GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) + + VM_INT_CONSTANTS_OS(GENERATE_VM_INT_CONSTANT_ENTRY, + GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY, + GENERATE_C1_VM_INT_CONSTANT_ENTRY, + GENERATE_C2_VM_INT_CONSTANT_ENTRY, + GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) + + VM_INT_CONSTANTS_CPU(GENERATE_VM_INT_CONSTANT_ENTRY, + GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY, + GENERATE_C1_VM_INT_CONSTANT_ENTRY, + GENERATE_C2_VM_INT_CONSTANT_ENTRY, + GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) + +#if INCLUDE_ALL_GCS + VM_INT_CONSTANTS_G1(GENERATE_VM_INT_CONSTANT_ENTRY, + GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY, + GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) +#endif + + GENERATE_VM_INT_CONSTANT_LAST_ENTRY() +}; + +VMLongConstantEntry JVMCIVMStructs::localHotSpotVMLongConstants[] = { + VM_LONG_CONSTANTS(GENERATE_VM_LONG_CONSTANT_ENTRY, + GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY) + + VM_LONG_CONSTANTS_OS(GENERATE_VM_LONG_CONSTANT_ENTRY, + GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY, + GENERATE_C1_VM_LONG_CONSTANT_ENTRY, + GENERATE_C2_VM_LONG_CONSTANT_ENTRY, + GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY) + + VM_LONG_CONSTANTS_CPU(GENERATE_VM_LONG_CONSTANT_ENTRY, + GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY, + GENERATE_C1_VM_LONG_CONSTANT_ENTRY, + GENERATE_C2_VM_LONG_CONSTANT_ENTRY, + GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY) + + GENERATE_VM_LONG_CONSTANT_LAST_ENTRY() +}; + +VMAddressEntry JVMCIVMStructs::localHotSpotVMAddresses[] = { + VM_ADDRESSES(GENERATE_VM_ADDRESS_ENTRY, + GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY, + GENERATE_VM_FUNCTION_ENTRY) + + VM_ADDRESSES_OS(GENERATE_VM_ADDRESS_ENTRY, + GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY, + GENERATE_VM_FUNCTION_ENTRY) + + GENERATE_VM_ADDRESS_LAST_ENTRY() +}; + +extern "C" { +JNIEXPORT VMStructEntry* jvmciHotSpotVMStructs = JVMCIVMStructs::localHotSpotVMStructs; +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryTypeNameOffset, VMStructEntry, typeName); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryFieldNameOffset, VMStructEntry, fieldName); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryTypeStringOffset, VMStructEntry, typeString); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryIsStaticOffset, VMStructEntry, isStatic); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryOffsetOffset, VMStructEntry, offset); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryAddressOffset, VMStructEntry, address); +ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMStructEntryArrayStride, jvmciHotSpotVMStructs); + +JNIEXPORT VMTypeEntry* jvmciHotSpotVMTypes = JVMCIVMStructs::localHotSpotVMTypes; +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryTypeNameOffset, VMTypeEntry, typeName); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntrySuperclassNameOffset, VMTypeEntry, superclassName); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryIsOopTypeOffset, VMTypeEntry, isOopType); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryIsIntegerTypeOffset, VMTypeEntry, isIntegerType); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryIsUnsignedOffset, VMTypeEntry, isUnsigned); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntrySizeOffset, VMTypeEntry, size); +ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryArrayStride, jvmciHotSpotVMTypes); + +JNIEXPORT VMIntConstantEntry* jvmciHotSpotVMIntConstants = JVMCIVMStructs::localHotSpotVMIntConstants; +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMIntConstantEntryNameOffset, VMIntConstantEntry, name); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMIntConstantEntryValueOffset, VMIntConstantEntry, value); +ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMIntConstantEntryArrayStride, jvmciHotSpotVMIntConstants); + +JNIEXPORT VMLongConstantEntry* jvmciHotSpotVMLongConstants = JVMCIVMStructs::localHotSpotVMLongConstants; +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMLongConstantEntryNameOffset, VMLongConstantEntry, name); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMLongConstantEntryValueOffset, VMLongConstantEntry, value); +ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMLongConstantEntryArrayStride, jvmciHotSpotVMLongConstants); + +JNIEXPORT VMAddressEntry* jvmciHotSpotVMAddresses = JVMCIVMStructs::localHotSpotVMAddresses; +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMAddressEntryNameOffset, VMAddressEntry, name); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMAddressEntryValueOffset, VMAddressEntry, value); +ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMAddressEntryArrayStride, jvmciHotSpotVMAddresses); +} diff --git a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.hpp b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.hpp index a58a6ef74c7..36bfe7289c9 100644 --- a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.hpp +++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.hpp @@ -25,113 +25,36 @@ #ifndef SHARE_VM_JVMCI_VMSTRUCTS_JVMCI_HPP #define SHARE_VM_JVMCI_VMSTRUCTS_JVMCI_HPP -#include "compiler/abstractCompiler.hpp" -#include "jvmci/jvmciCodeInstaller.hpp" -#include "jvmci/jvmciCompilerToVM.hpp" -#include "jvmci/jvmciEnv.hpp" -#include "jvmci/jvmciRuntime.hpp" +#include "runtime/vmStructs.hpp" -#define VM_STRUCTS_JVMCI(nonstatic_field, static_field) \ - nonstatic_field(JavaThread, _pending_deoptimization, int) \ - nonstatic_field(JavaThread, _pending_failed_speculation, oop) \ - nonstatic_field(JavaThread, _pending_transfer_to_interpreter, bool) \ - nonstatic_field(JavaThread, _jvmci_counters, jlong*) \ - nonstatic_field(MethodData, _jvmci_ir_size, int) \ - nonstatic_field(JVMCIEnv, _task, CompileTask*) \ - nonstatic_field(JVMCIEnv, _jvmti_can_hotswap_or_post_breakpoint, bool) \ - nonstatic_field(DeoptimizationBlob, _uncommon_trap_offset, int) \ - \ - static_field(CompilerToVM, _supports_inline_contig_alloc, bool) \ - static_field(CompilerToVM, _heap_end_addr, HeapWord**) \ - static_field(CompilerToVM, _heap_top_addr, HeapWord**) +class JVMCIVMStructs { +public: + /** + * The last entry has a NULL fieldName. + */ + static VMStructEntry localHotSpotVMStructs[]; -#define VM_TYPES_JVMCI(declare_type, declare_toplevel_type) \ - declare_toplevel_type(CompilerToVM) \ - declare_toplevel_type(JVMCIEnv) \ + /** + * The last entry has a NULL typeName. + */ + static VMTypeEntry localHotSpotVMTypes[]; -#define VM_INT_CONSTANTS_JVMCI(declare_constant, declare_preprocessor_constant) \ - declare_constant(Deoptimization::Reason_unreached0) \ - declare_constant(Deoptimization::Reason_type_checked_inlining) \ - declare_constant(Deoptimization::Reason_optimized_type_check) \ - declare_constant(Deoptimization::Reason_aliasing) \ - declare_constant(Deoptimization::Reason_transfer_to_interpreter) \ - declare_constant(Deoptimization::Reason_not_compiled_exception_handler) \ - declare_constant(Deoptimization::Reason_unresolved) \ - declare_constant(Deoptimization::Reason_jsr_mismatch) \ - declare_constant(JVMCIEnv::ok) \ - declare_constant(JVMCIEnv::dependencies_failed) \ - declare_constant(JVMCIEnv::dependencies_invalid) \ - declare_constant(JVMCIEnv::cache_full) \ - declare_constant(JVMCIEnv::code_too_large) \ - \ - declare_preprocessor_constant("JVM_ACC_SYNTHETIC", JVM_ACC_SYNTHETIC) \ - declare_preprocessor_constant("JVM_RECOGNIZED_FIELD_MODIFIERS", JVM_RECOGNIZED_FIELD_MODIFIERS) \ - \ - declare_constant(CompilerToVM::KLASS_TAG) \ - declare_constant(CompilerToVM::SYMBOL_TAG) \ - \ - declare_constant(BitData::exception_seen_flag) \ - declare_constant(BitData::null_seen_flag) \ - declare_constant(CounterData::count_off) \ - declare_constant(JumpData::taken_off_set) \ - declare_constant(JumpData::displacement_off_set) \ - declare_constant(ReceiverTypeData::nonprofiled_count_off_set) \ - declare_constant(ReceiverTypeData::receiver_type_row_cell_count) \ - declare_constant(ReceiverTypeData::receiver0_offset) \ - declare_constant(ReceiverTypeData::count0_offset) \ - declare_constant(BranchData::not_taken_off_set) \ - declare_constant(ArrayData::array_len_off_set) \ - declare_constant(ArrayData::array_start_off_set) \ - declare_constant(MultiBranchData::per_case_cell_count) \ - \ - declare_constant(CodeInstaller::VERIFIED_ENTRY) \ - declare_constant(CodeInstaller::UNVERIFIED_ENTRY) \ - declare_constant(CodeInstaller::OSR_ENTRY) \ - declare_constant(CodeInstaller::EXCEPTION_HANDLER_ENTRY) \ - declare_constant(CodeInstaller::DEOPT_HANDLER_ENTRY) \ - declare_constant(CodeInstaller::INVOKEINTERFACE) \ - declare_constant(CodeInstaller::INVOKEVIRTUAL) \ - declare_constant(CodeInstaller::INVOKESTATIC) \ - declare_constant(CodeInstaller::INVOKESPECIAL) \ - declare_constant(CodeInstaller::INLINE_INVOKE) \ - declare_constant(CodeInstaller::POLL_NEAR) \ - declare_constant(CodeInstaller::POLL_RETURN_NEAR) \ - declare_constant(CodeInstaller::POLL_FAR) \ - declare_constant(CodeInstaller::POLL_RETURN_FAR) \ - declare_constant(CodeInstaller::CARD_TABLE_SHIFT) \ - declare_constant(CodeInstaller::CARD_TABLE_ADDRESS) \ - declare_constant(CodeInstaller::HEAP_TOP_ADDRESS) \ - declare_constant(CodeInstaller::HEAP_END_ADDRESS) \ - declare_constant(CodeInstaller::NARROW_KLASS_BASE_ADDRESS) \ - declare_constant(CodeInstaller::CRC_TABLE_ADDRESS) \ - declare_constant(CodeInstaller::INVOKE_INVALID) \ - \ - declare_constant(Method::invalid_vtable_index) \ + /** + * Table of integer constants. + * The last entry has a NULL typeName. + */ + static VMIntConstantEntry localHotSpotVMIntConstants[]; -#define VM_ADDRESSES_JVMCI(declare_address, declare_preprocessor_address, declare_function) \ - declare_function(JVMCIRuntime::new_instance) \ - declare_function(JVMCIRuntime::new_array) \ - declare_function(JVMCIRuntime::new_multi_array) \ - declare_function(JVMCIRuntime::dynamic_new_array) \ - declare_function(JVMCIRuntime::dynamic_new_instance) \ - \ - declare_function(JVMCIRuntime::thread_is_interrupted) \ - declare_function(JVMCIRuntime::vm_message) \ - declare_function(JVMCIRuntime::identity_hash_code) \ - declare_function(JVMCIRuntime::exception_handler_for_pc) \ - declare_function(JVMCIRuntime::monitorenter) \ - declare_function(JVMCIRuntime::monitorexit) \ - declare_function(JVMCIRuntime::create_null_exception) \ - declare_function(JVMCIRuntime::create_out_of_bounds_exception) \ - declare_function(JVMCIRuntime::log_primitive) \ - declare_function(JVMCIRuntime::log_object) \ - declare_function(JVMCIRuntime::log_printf) \ - declare_function(JVMCIRuntime::vm_error) \ - declare_function(JVMCIRuntime::load_and_clear_exception) \ - declare_function(JVMCIRuntime::write_barrier_pre) \ - declare_function(JVMCIRuntime::write_barrier_post) \ - declare_function(JVMCIRuntime::validate_object) \ - \ - declare_function(JVMCIRuntime::test_deoptimize_call_int) + /** + * Table of long constants. + * The last entry has a NULL typeName. + */ + static VMLongConstantEntry localHotSpotVMLongConstants[]; + + /** + * Table of addresses. + */ + static VMAddressEntry localHotSpotVMAddresses[]; +}; #endif // SHARE_VM_JVMCI_VMSTRUCTS_JVMCI_HPP diff --git a/hotspot/src/share/vm/oops/constMethod.hpp b/hotspot/src/share/vm/oops/constMethod.hpp index b5360571cdb..5bd135ebf17 100644 --- a/hotspot/src/share/vm/oops/constMethod.hpp +++ b/hotspot/src/share/vm/oops/constMethod.hpp @@ -166,9 +166,9 @@ class InlineTableSizes : StackObj { #undef INLINE_TABLE_PARAM #undef INLINE_TABLE_DECLARE - class ConstMethod : public MetaspaceObj { friend class VMStructs; + friend class JVMCIVMStructs; public: typedef enum { NORMAL, OVERPASS } MethodType; diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp index 99d77253be9..bbb099b22cb 100644 --- a/hotspot/src/share/vm/oops/constantPool.hpp +++ b/hotspot/src/share/vm/oops/constantPool.hpp @@ -74,6 +74,7 @@ class KlassSizeStats; class ConstantPool : public Metadata { friend class VMStructs; + friend class JVMCIVMStructs; friend class BytecodeInterpreter; // Directly extracts a klass in the pool for fast instanceof/checkcast friend class Universe; // For null constructor private: diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp index ca5262346a1..0d2dac711e4 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp @@ -108,6 +108,7 @@ struct JvmtiCachedClassFileData; class InstanceKlass: public Klass { friend class VMStructs; + friend class JVMCIVMStructs; friend class ClassFileParser; friend class CompileReplay; diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp index a7ddf019063..bfad79f5bb5 100644 --- a/hotspot/src/share/vm/oops/klass.hpp +++ b/hotspot/src/share/vm/oops/klass.hpp @@ -60,6 +60,7 @@ class fieldDescriptor; class Klass : public Metadata { friend class VMStructs; + friend class JVMCIVMStructs; protected: // note: put frequently-used fields together at start of klass structure // for better cache behavior (may not make much of a difference but sure won't hurt) diff --git a/hotspot/src/share/vm/oops/klassVtable.hpp b/hotspot/src/share/vm/oops/klassVtable.hpp index e4b4c9f5141..78a7bb39b1a 100644 --- a/hotspot/src/share/vm/oops/klassVtable.hpp +++ b/hotspot/src/share/vm/oops/klassVtable.hpp @@ -155,6 +155,7 @@ class klassVtable : public ResourceObj { // from_interpreter_entry_point -> i2cadapter class vtableEntry VALUE_OBJ_CLASS_SPEC { friend class VMStructs; + friend class JVMCIVMStructs; public: // size in words diff --git a/hotspot/src/share/vm/oops/method.hpp b/hotspot/src/share/vm/oops/method.hpp index 2b7bd268f5c..861b407c6cf 100644 --- a/hotspot/src/share/vm/oops/method.hpp +++ b/hotspot/src/share/vm/oops/method.hpp @@ -61,6 +61,7 @@ class KlassSizeStats; class Method : public Metadata { friend class VMStructs; + friend class JVMCIVMStructs; private: ConstMethod* _constMethod; // Method read-only data. MethodData* _method_data; diff --git a/hotspot/src/share/vm/oops/methodCounters.hpp b/hotspot/src/share/vm/oops/methodCounters.hpp index 039271b1c10..b52bff3104a 100644 --- a/hotspot/src/share/vm/oops/methodCounters.hpp +++ b/hotspot/src/share/vm/oops/methodCounters.hpp @@ -32,6 +32,7 @@ class MethodCounters: public MetaspaceObj { friend class VMStructs; + friend class JVMCIVMStructs; private: int _interpreter_invocation_count; // Count of times invoked (reused as prev_event_count in tiered) u2 _interpreter_throwout_count; // Count of times method was exited via exception while interpreting diff --git a/hotspot/src/share/vm/oops/methodData.hpp b/hotspot/src/share/vm/oops/methodData.hpp index 14afeccea57..c8d3d8fc247 100644 --- a/hotspot/src/share/vm/oops/methodData.hpp +++ b/hotspot/src/share/vm/oops/methodData.hpp @@ -73,6 +73,7 @@ class ProfileData; // Overlay for generic profiling data. class DataLayout VALUE_OBJ_CLASS_SPEC { friend class VMStructs; + friend class JVMCIVMStructs; private: // Every data layout begins with a header. This header @@ -536,6 +537,7 @@ public: // A BitData holds a flag or two in its header. class BitData : public ProfileData { friend class VMStructs; + friend class JVMCIVMStructs; protected: enum { // null_seen: @@ -605,6 +607,7 @@ public: // A CounterData corresponds to a simple counter. class CounterData : public BitData { friend class VMStructs; + friend class JVMCIVMStructs; protected: enum { count_off, @@ -670,6 +673,7 @@ public: // the corresponding target bci. class JumpData : public ProfileData { friend class VMStructs; + friend class JVMCIVMStructs; protected: enum { taken_off_set, @@ -1177,6 +1181,7 @@ public: // which are used to store a type profile for the receiver of the check. class ReceiverTypeData : public CounterData { friend class VMStructs; + friend class JVMCIVMStructs; protected: enum { #if INCLUDE_JVMCI @@ -1683,6 +1688,7 @@ public: // for the taken case. class BranchData : public JumpData { friend class VMStructs; + friend class JVMCIVMStructs; protected: enum { not_taken_off_set = jump_cell_count, @@ -1760,6 +1766,7 @@ public: // and an array start. class ArrayData : public ProfileData { friend class VMStructs; + friend class JVMCIVMStructs; protected: friend class DataLayout; @@ -1838,6 +1845,7 @@ public: // case was taken and specify the data displacment for each branch target. class MultiBranchData : public ArrayData { friend class VMStructs; + friend class JVMCIVMStructs; protected: enum { default_count_off_set, @@ -2137,6 +2145,7 @@ class CleanExtraDataClosure; class MethodData : public Metadata { friend class VMStructs; + friend class JVMCIVMStructs; CC_INTERP_ONLY(friend class BytecodeInterpreter;) private: friend class ProfileData; diff --git a/hotspot/src/share/vm/oops/objArrayKlass.hpp b/hotspot/src/share/vm/oops/objArrayKlass.hpp index d888fb7228a..560f266bc63 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.hpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.hpp @@ -33,6 +33,7 @@ class ObjArrayKlass : public ArrayKlass { friend class VMStructs; + friend class JVMCIVMStructs; private: Klass* _element_klass; // The klass of the elements of this array type Klass* _bottom_klass; // The one-dimensional type (InstanceKlass or TypeArrayKlass) diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp index b096f3f45c5..b7fa4c2de6e 100644 --- a/hotspot/src/share/vm/oops/oop.hpp +++ b/hotspot/src/share/vm/oops/oop.hpp @@ -58,6 +58,7 @@ class ParCompactionManager; class oopDesc { friend class VMStructs; + friend class JVMCIVMStructs; private: volatile markOop _mark; union _metadata { diff --git a/hotspot/src/share/vm/runtime/basicLock.hpp b/hotspot/src/share/vm/runtime/basicLock.hpp index 309e07c0bd0..cc4e37eed52 100644 --- a/hotspot/src/share/vm/runtime/basicLock.hpp +++ b/hotspot/src/share/vm/runtime/basicLock.hpp @@ -31,6 +31,7 @@ class BasicLock VALUE_OBJ_CLASS_SPEC { friend class VMStructs; + friend class JVMCIVMStructs; private: volatile markOop _displaced_header; public: diff --git a/hotspot/src/share/vm/runtime/deoptimization.hpp b/hotspot/src/share/vm/runtime/deoptimization.hpp index 7e63ab6bd38..82bb20af4e9 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.hpp +++ b/hotspot/src/share/vm/runtime/deoptimization.hpp @@ -168,6 +168,7 @@ JVMCI_ONLY(public:) // This is only a CheapObj to ease debugging after a deopt failure class UnrollBlock : public CHeapObj { friend class VMStructs; + friend class JVMCIVMStructs; private: int _size_of_deoptimized_frame; // Size, in bytes, of current deoptimized frame int _caller_adjustment; // Adjustment, in bytes, to caller's SP by initial interpreted frame diff --git a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp index fa3c279e001..efb4d415aa4 100644 --- a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp +++ b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp @@ -48,6 +48,7 @@ friend class StubGenerator; friend class JavaThread; friend class frame; friend class VMStructs; +friend class JVMCIVMStructs; friend class BytecodeInterpreter; friend class JavaCallWrapper; diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index 0e104226501..f4995159bcb 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -102,6 +102,7 @@ class MallocTracker; class os: AllStatic { friend class VMStructs; + friend class JVMCIVMStructs; friend class MallocTracker; public: enum { page_sizes_max = 9 }; // Size of _page_sizes array (8 plus a sentinel) diff --git a/hotspot/src/share/vm/runtime/osThread.hpp b/hotspot/src/share/vm/runtime/osThread.hpp index 02f3c0203fd..29912bd5187 100644 --- a/hotspot/src/share/vm/runtime/osThread.hpp +++ b/hotspot/src/share/vm/runtime/osThread.hpp @@ -60,6 +60,7 @@ enum ThreadState { class OSThread: public CHeapObj { friend class VMStructs; + friend class JVMCIVMStructs; private: OSThreadStartFunc _start_proc; // Thread start routine void* _start_parm; // Thread start routine parameter diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index 27c81f00346..de23fe565bd 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -101,6 +101,7 @@ class WorkerThread; class Thread: public ThreadShadow { friend class VMStructs; + friend class JVMCIVMStructs; private: // Exception handling // (Note: _pending_exception and friends are in ThreadShadow) @@ -775,6 +776,7 @@ typedef void (*ThreadFunction)(JavaThread*, TRAPS); class JavaThread: public Thread { friend class VMStructs; + friend class JVMCIVMStructs; friend class WhiteBox; private: JavaThread* _next; // The next thread in the Threads list diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index d3e1b44de02..edeb34ed0f6 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -2844,104 +2844,6 @@ typedef CompactHashtable SymbolCompactHashTable; //-------------------------------------------------------------------------------- -// VM_ADDRESSES -// - -#define VM_ADDRESSES(declare_address, declare_preprocessor_address, declare_function) \ - \ - declare_function(SharedRuntime::register_finalizer) \ - declare_function(SharedRuntime::exception_handler_for_return_address) \ - declare_function(SharedRuntime::OSR_migration_end) \ - declare_function(SharedRuntime::dsin) \ - declare_function(SharedRuntime::dcos) \ - declare_function(SharedRuntime::dtan) \ - declare_function(SharedRuntime::dexp) \ - declare_function(SharedRuntime::dlog) \ - declare_function(SharedRuntime::dlog10) \ - declare_function(SharedRuntime::dpow) \ - \ - declare_function(os::dll_load) \ - declare_function(os::dll_lookup) \ - declare_function(os::javaTimeMillis) \ - declare_function(os::javaTimeNanos) \ - \ - declare_function(Deoptimization::fetch_unroll_info) \ - COMPILER2_PRESENT(declare_function(Deoptimization::uncommon_trap)) \ - declare_function(Deoptimization::unpack_frames) - -//-------------------------------------------------------------------------------- -// Macros operating on the above lists -//-------------------------------------------------------------------------------- - -// This utility macro quotes the passed string -#define QUOTE(x) #x - -//-------------------------------------------------------------------------------- -// VMStructEntry macros -// - -// This macro generates a VMStructEntry line for a nonstatic field -#define GENERATE_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 0, offset_of(typeName, fieldName), NULL }, - -// This macro generates a VMStructEntry line for a static field -#define GENERATE_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, &typeName::fieldName }, - -// This macro generates a VMStructEntry line for a static pointer volatile field, -// e.g.: "static ObjectMonitor * volatile gBlockList;" -#define GENERATE_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, (void *)&typeName::fieldName }, - -// This macro generates a VMStructEntry line for an unchecked -// nonstatic field, in which the size of the type is also specified. -// The type string is given as NULL, indicating an "opaque" type. -#define GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, size) \ - { QUOTE(typeName), QUOTE(fieldName), NULL, 0, offset_of(typeName, fieldName), NULL }, - -// This macro generates a VMStructEntry line for an unchecked -// static field, in which the size of the type is also specified. -// The type string is given as NULL, indicating an "opaque" type. -#define GENERATE_UNCHECKED_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, size) \ - { QUOTE(typeName), QUOTE(fieldName), NULL, 1, 0, (void*) &typeName::fieldName }, - -// This macro generates the sentinel value indicating the end of the list -#define GENERATE_VM_STRUCT_LAST_ENTRY() \ - { NULL, NULL, NULL, 0, 0, NULL } - -// This macro checks the type of a VMStructEntry by comparing pointer types -#define CHECK_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - {typeName *dummyObj = NULL; type* dummy = &dummyObj->fieldName; \ - assert(offset_of(typeName, fieldName) < sizeof(typeName), "Illegal nonstatic struct entry, field offset too large"); } - -// This macro checks the type of a volatile VMStructEntry by comparing pointer types -#define CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - {typedef type dummyvtype; typeName *dummyObj = NULL; volatile dummyvtype* dummy = &dummyObj->fieldName; } - -// This macro checks the type of a static VMStructEntry by comparing pointer types -#define CHECK_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - {type* dummy = &typeName::fieldName; } - -// This macro checks the type of a static pointer volatile VMStructEntry by comparing pointer types, -// e.g.: "static ObjectMonitor * volatile gBlockList;" -#define CHECK_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - {type volatile * dummy = &typeName::fieldName; } - -// This macro ensures the type of a field and its containing type are -// present in the type table. The assertion string is shorter than -// preferable because (incredibly) of a bug in Solstice NFS client -// which seems to prevent very long lines from compiling. This assertion -// means that an entry in VMStructs::localHotSpotVMStructs[] was not -// found in VMStructs::localHotSpotVMTypes[]. -#define ENSURE_FIELD_TYPE_PRESENT(typeName, fieldName, type) \ - { assert(findType(QUOTE(typeName)) != 0, "type \"" QUOTE(typeName) "\" not found in type table"); \ - assert(findType(QUOTE(type)) != 0, "type \"" QUOTE(type) "\" not found in type table"); } - -// This is a no-op macro for unchecked fields -#define CHECK_NO_OP(a, b, c) - -// -// Build-specific macros: // // Generate and check a nonstatic field in non-product builds @@ -2997,35 +2899,7 @@ typedef CompactHashtable SymbolCompactHashTable; #endif /* COMPILER2 */ //-------------------------------------------------------------------------------- -// VMTypeEntry macros -// - -#define GENERATE_VM_TYPE_ENTRY(type, superclass) \ - { QUOTE(type), QUOTE(superclass), 0, 0, 0, sizeof(type) }, - -#define GENERATE_TOPLEVEL_VM_TYPE_ENTRY(type) \ - { QUOTE(type), NULL, 0, 0, 0, sizeof(type) }, - -#define GENERATE_OOP_VM_TYPE_ENTRY(type) \ - { QUOTE(type), NULL, 1, 0, 0, sizeof(type) }, - -#define GENERATE_INTEGER_VM_TYPE_ENTRY(type) \ - { QUOTE(type), NULL, 0, 1, 0, sizeof(type) }, - -#define GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY(type) \ - { QUOTE(type), NULL, 0, 1, 1, sizeof(type) }, - -#define GENERATE_VM_TYPE_LAST_ENTRY() \ - { NULL, NULL, 0, 0, 0, 0 } - -#define CHECK_VM_TYPE_ENTRY(type, superclass) \ - { type* dummyObj = NULL; superclass* dummySuperObj = dummyObj; } - -#define CHECK_VM_TYPE_NO_OP(a) -#define CHECK_SINGLE_ARG_VM_TYPE_NO_OP(a) - -// -// Build-specific macros: +// VMTypeEntry build-specific macros // #ifdef COMPILER1 @@ -3050,23 +2924,9 @@ typedef CompactHashtable SymbolCompactHashTable; //-------------------------------------------------------------------------------- -// VMIntConstantEntry macros +// VMIntConstantEntry build-specific macros // -#define GENERATE_VM_INT_CONSTANT_ENTRY(name) \ - { QUOTE(name), (int32_t) name }, - -#define GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY(name, value) \ - { (name), (int32_t)(value) }, - -#define GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY(name, value) \ - { name, (int32_t) value }, - -// This macro generates the sentinel value indicating the end of the list -#define GENERATE_VM_INT_CONSTANT_LAST_ENTRY() \ - { NULL, 0 } - - // Generate an int constant for a C1 build #ifdef COMPILER1 # define GENERATE_C1_VM_INT_CONSTANT_ENTRY(name) GENERATE_VM_INT_CONSTANT_ENTRY(name) @@ -3083,20 +2943,11 @@ typedef CompactHashtable SymbolCompactHashTable; # define GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY(name, value) #endif /* COMPILER1 */ + //-------------------------------------------------------------------------------- -// VMLongConstantEntry macros +// VMLongConstantEntry build-specific macros // -#define GENERATE_VM_LONG_CONSTANT_ENTRY(name) \ - { QUOTE(name), name }, - -#define GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY(name, value) \ - { name, value }, - -// This macro generates the sentinel value indicating the end of the list -#define GENERATE_VM_LONG_CONSTANT_LAST_ENTRY() \ - { NULL, 0 } - // Generate a long constant for a C1 build #ifdef COMPILER1 # define GENERATE_C1_VM_LONG_CONSTANT_ENTRY(name) GENERATE_VM_LONG_CONSTANT_ENTRY(name) @@ -3113,22 +2964,6 @@ typedef CompactHashtable SymbolCompactHashTable; # define GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY(name, value) #endif /* COMPILER1 */ -//-------------------------------------------------------------------------------- -// VMAddressEntry macros -// - -#define GENERATE_VM_ADDRESS_ENTRY(name) \ - { QUOTE(name), (void*) (name) }, - -#define GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY(name, value) \ - { name, (void*) (value) }, - -#define GENERATE_VM_FUNCTION_ENTRY(name) \ - { QUOTE(name), CAST_FROM_FN_PTR(void*, &(name)) }, - -// This macro generates the sentinel value indicating the end of the list -#define GENERATE_VM_ADDRESS_LAST_ENTRY() \ - { NULL, NULL } // // Instantiation of VMStructEntries, VMTypeEntries and VMIntConstantEntries @@ -3149,11 +2984,6 @@ VMStructEntry VMStructs::localHotSpotVMStructs[] = { GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY) -#if INCLUDE_JVMCI - VM_STRUCTS_JVMCI(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_STATIC_VM_STRUCT_ENTRY) -#endif - #if INCLUDE_ALL_GCS VM_STRUCTS_PARALLELGC(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_STATIC_VM_STRUCT_ENTRY) @@ -3215,11 +3045,6 @@ VMTypeEntry VMStructs::localHotSpotVMTypes[] = { GENERATE_C2_VM_TYPE_ENTRY, GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) -#if INCLUDE_JVMCI - VM_TYPES_JVMCI(GENERATE_VM_TYPE_ENTRY, - GENERATE_TOPLEVEL_VM_TYPE_ENTRY) -#endif - #if INCLUDE_ALL_GCS VM_TYPES_PARALLELGC(GENERATE_VM_TYPE_ENTRY, GENERATE_TOPLEVEL_VM_TYPE_ENTRY) @@ -3279,12 +3104,6 @@ VMIntConstantEntry VMStructs::localHotSpotVMIntConstants[] = { GENERATE_C2_VM_INT_CONSTANT_ENTRY, GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) -#if INCLUDE_JVMCI - VM_INT_CONSTANTS_JVMCI(GENERATE_VM_INT_CONSTANT_ENTRY, - GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) - -#endif - #if INCLUDE_ALL_GCS VM_INT_CONSTANTS_CMS(GENERATE_VM_INT_CONSTANT_ENTRY) @@ -3348,25 +3167,6 @@ VMLongConstantEntry VMStructs::localHotSpotVMLongConstants[] = { GENERATE_VM_LONG_CONSTANT_LAST_ENTRY() }; -VMAddressEntry VMStructs::localHotSpotVMAddresses[] = { - - VM_ADDRESSES(GENERATE_VM_ADDRESS_ENTRY, - GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY, - GENERATE_VM_FUNCTION_ENTRY) - - VM_ADDRESSES_OS(GENERATE_VM_ADDRESS_ENTRY, - GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY, - GENERATE_VM_FUNCTION_ENTRY) - -#if INCLUDE_JVMCI - VM_ADDRESSES_JVMCI(GENERATE_VM_ADDRESS_ENTRY, - GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY, - GENERATE_VM_FUNCTION_ENTRY) -#endif - - GENERATE_VM_ADDRESS_LAST_ENTRY() -}; - // This is used both to check the types of referenced fields and, in // debug builds, to ensure that all of the field types are present. void @@ -3575,11 +3375,6 @@ JNIEXPORT VMLongConstantEntry* gHotSpotVMLongConstants = VMStructs::localHotSpot JNIEXPORT uint64_t gHotSpotVMLongConstantEntryNameOffset = offset_of(VMLongConstantEntry, name); JNIEXPORT uint64_t gHotSpotVMLongConstantEntryValueOffset = offset_of(VMLongConstantEntry, value); JNIEXPORT uint64_t gHotSpotVMLongConstantEntryArrayStride = STRIDE(gHotSpotVMLongConstants); - -JNIEXPORT VMAddressEntry* gHotSpotVMAddresses = VMStructs::localHotSpotVMAddresses; -JNIEXPORT uint64_t gHotSpotVMAddressEntryNameOffset = offset_of(VMAddressEntry, name); -JNIEXPORT uint64_t gHotSpotVMAddressEntryValueOffset = offset_of(VMAddressEntry, value); -JNIEXPORT uint64_t gHotSpotVMAddressEntryArrayStride = STRIDE(gHotSpotVMAddresses); } #ifdef ASSERT @@ -3687,11 +3482,6 @@ void VMStructs::test() { &long_last_entry, sizeof(VMLongConstantEntry)) == 0, "Incorrect last entry in localHotSpotVMLongConstants"); - static VMAddressEntry address_last_entry = GENERATE_VM_ADDRESS_LAST_ENTRY(); - assert(memcmp(&localHotSpotVMAddresses[sizeof(localHotSpotVMAddresses) / sizeof(VMAddressEntry) - 1], - &address_last_entry, - sizeof(VMAddressEntry)) == 0, "Incorrect last entry in localHotSpotVMAddresses"); - // Check for duplicate entries in type array for (int i = 0; localHotSpotVMTypes[i].typeName != NULL; i++) { diff --git a/hotspot/src/share/vm/runtime/vmStructs.hpp b/hotspot/src/share/vm/runtime/vmStructs.hpp index 369ff9e9426..4f9f31dcd3e 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.hpp +++ b/hotspot/src/share/vm/runtime/vmStructs.hpp @@ -143,4 +143,151 @@ private: static int findType(const char* typeName); }; +// This utility macro quotes the passed string +#define QUOTE(x) #x + +//-------------------------------------------------------------------------------- +// VMStructEntry macros +// + +// This macro generates a VMStructEntry line for a nonstatic field +#define GENERATE_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 0, offset_of(typeName, fieldName), NULL }, + +// This macro generates a VMStructEntry line for a static field +#define GENERATE_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, &typeName::fieldName }, + +// This macro generates a VMStructEntry line for a static pointer volatile field, +// e.g.: "static ObjectMonitor * volatile gBlockList;" +#define GENERATE_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, (void *)&typeName::fieldName }, + +// This macro generates a VMStructEntry line for an unchecked +// nonstatic field, in which the size of the type is also specified. +// The type string is given as NULL, indicating an "opaque" type. +#define GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, size) \ + { QUOTE(typeName), QUOTE(fieldName), NULL, 0, offset_of(typeName, fieldName), NULL }, + +// This macro generates a VMStructEntry line for an unchecked +// static field, in which the size of the type is also specified. +// The type string is given as NULL, indicating an "opaque" type. +#define GENERATE_UNCHECKED_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, size) \ + { QUOTE(typeName), QUOTE(fieldName), NULL, 1, 0, (void*) &typeName::fieldName }, + +// This macro generates the sentinel value indicating the end of the list +#define GENERATE_VM_STRUCT_LAST_ENTRY() \ + { NULL, NULL, NULL, 0, 0, NULL } + +// This macro checks the type of a VMStructEntry by comparing pointer types +#define CHECK_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + {typeName *dummyObj = NULL; type* dummy = &dummyObj->fieldName; \ + assert(offset_of(typeName, fieldName) < sizeof(typeName), "Illegal nonstatic struct entry, field offset too large"); } + +// This macro checks the type of a volatile VMStructEntry by comparing pointer types +#define CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + {typedef type dummyvtype; typeName *dummyObj = NULL; volatile dummyvtype* dummy = &dummyObj->fieldName; } + +// This macro checks the type of a static VMStructEntry by comparing pointer types +#define CHECK_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + {type* dummy = &typeName::fieldName; } + +// This macro checks the type of a static pointer volatile VMStructEntry by comparing pointer types, +// e.g.: "static ObjectMonitor * volatile gBlockList;" +#define CHECK_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + {type volatile * dummy = &typeName::fieldName; } + +// This macro ensures the type of a field and its containing type are +// present in the type table. The assertion string is shorter than +// preferable because (incredibly) of a bug in Solstice NFS client +// which seems to prevent very long lines from compiling. This assertion +// means that an entry in VMStructs::localHotSpotVMStructs[] was not +// found in VMStructs::localHotSpotVMTypes[]. +#define ENSURE_FIELD_TYPE_PRESENT(typeName, fieldName, type) \ + { assert(findType(QUOTE(typeName)) != 0, "type \"" QUOTE(typeName) "\" not found in type table"); \ + assert(findType(QUOTE(type)) != 0, "type \"" QUOTE(type) "\" not found in type table"); } + +// This is a no-op macro for unchecked fields +#define CHECK_NO_OP(a, b, c) + + +//-------------------------------------------------------------------------------- +// VMTypeEntry macros +// + +#define GENERATE_VM_TYPE_ENTRY(type, superclass) \ + { QUOTE(type), QUOTE(superclass), 0, 0, 0, sizeof(type) }, + +#define GENERATE_TOPLEVEL_VM_TYPE_ENTRY(type) \ + { QUOTE(type), NULL, 0, 0, 0, sizeof(type) }, + +#define GENERATE_OOP_VM_TYPE_ENTRY(type) \ + { QUOTE(type), NULL, 1, 0, 0, sizeof(type) }, + +#define GENERATE_INTEGER_VM_TYPE_ENTRY(type) \ + { QUOTE(type), NULL, 0, 1, 0, sizeof(type) }, + +#define GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY(type) \ + { QUOTE(type), NULL, 0, 1, 1, sizeof(type) }, + +#define GENERATE_VM_TYPE_LAST_ENTRY() \ + { NULL, NULL, 0, 0, 0, 0 } + +#define CHECK_VM_TYPE_ENTRY(type, superclass) \ + { type* dummyObj = NULL; superclass* dummySuperObj = dummyObj; } + +#define CHECK_VM_TYPE_NO_OP(a) +#define CHECK_SINGLE_ARG_VM_TYPE_NO_OP(a) + + +//-------------------------------------------------------------------------------- +// VMIntConstantEntry macros +// + +#define GENERATE_VM_INT_CONSTANT_ENTRY(name) \ + { QUOTE(name), (int32_t) name }, + +#define GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY(name, value) \ + { (name), (int32_t)(value) }, + +#define GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY(name, value) \ + { name, (int32_t) value }, + +// This macro generates the sentinel value indicating the end of the list +#define GENERATE_VM_INT_CONSTANT_LAST_ENTRY() \ + { NULL, 0 } + + +//-------------------------------------------------------------------------------- +// VMLongConstantEntry macros +// + +#define GENERATE_VM_LONG_CONSTANT_ENTRY(name) \ + { QUOTE(name), name }, + +#define GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY(name, value) \ + { name, value }, + +// This macro generates the sentinel value indicating the end of the list +#define GENERATE_VM_LONG_CONSTANT_LAST_ENTRY() \ + { NULL, 0 } + + +//-------------------------------------------------------------------------------- +// VMAddressEntry macros +// + +#define GENERATE_VM_ADDRESS_ENTRY(name) \ + { QUOTE(name), (void*) (name) }, + +#define GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY(name, value) \ + { name, (void*) (value) }, + +#define GENERATE_VM_FUNCTION_ENTRY(name) \ + { QUOTE(name), CAST_FROM_FN_PTR(void*, &(name)) }, + +// This macro generates the sentinel value indicating the end of the list +#define GENERATE_VM_ADDRESS_LAST_ENTRY() \ + { NULL, NULL } + #endif // SHARE_VM_RUNTIME_VMSTRUCTS_HPP diff --git a/hotspot/src/share/vm/utilities/array.hpp b/hotspot/src/share/vm/utilities/array.hpp index 8df72304ef0..f759fe1c03f 100644 --- a/hotspot/src/share/vm/utilities/array.hpp +++ b/hotspot/src/share/vm/utilities/array.hpp @@ -304,6 +304,7 @@ template class Array: public MetaspaceObj { friend class MetadataFactory; friend class VMStructs; + friend class JVMCIVMStructs; friend class MethodHandleCompiler; // special case friend class WhiteBox; protected: diff --git a/hotspot/src/share/vm/utilities/exceptions.hpp b/hotspot/src/share/vm/utilities/exceptions.hpp index 02d9110ef74..5983f5e32f9 100644 --- a/hotspot/src/share/vm/utilities/exceptions.hpp +++ b/hotspot/src/share/vm/utilities/exceptions.hpp @@ -59,6 +59,7 @@ class JavaCallArguments; class ThreadShadow: public CHeapObj { friend class VMStructs; + friend class JVMCIVMStructs; protected: oop _pending_exception; // Thread has gc actions. From 1a135175c4a0c511c8dda22b4243c33e30d7062d Mon Sep 17 00:00:00 2001 From: Alexander Vorobyev Date: Tue, 15 Dec 2015 17:31:18 +0300 Subject: [PATCH 083/228] 8079667: port vm/compiler/AESIntrinsics/CheckIntrinsics into jtreg Reviewed-by: kvn --- .../compiler/cpuflags/AESIntrinsicsBase.java | 65 +++++ .../TestAESIntrinsicsOnSupportedConfig.java | 254 ++++++++++++++++++ .../TestAESIntrinsicsOnUnsupportedConfig.java | 112 ++++++++ .../predicate/AESSupportPredicate.java | 37 +++ .../test/lib/cli/CommandLineOptionTest.java | 48 +++- 5 files changed, 511 insertions(+), 5 deletions(-) create mode 100644 hotspot/test/compiler/cpuflags/AESIntrinsicsBase.java create mode 100644 hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java create mode 100644 hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java create mode 100644 hotspot/test/compiler/cpuflags/predicate/AESSupportPredicate.java diff --git a/hotspot/test/compiler/cpuflags/AESIntrinsicsBase.java b/hotspot/test/compiler/cpuflags/AESIntrinsicsBase.java new file mode 100644 index 00000000000..8e8deda71bd --- /dev/null +++ b/hotspot/test/compiler/cpuflags/AESIntrinsicsBase.java @@ -0,0 +1,65 @@ +/* + * 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. + * + */ +import jdk.test.lib.cli.CommandLineOptionTest; +import predicate.AESSupportPredicate; + +import java.util.Arrays; +import java.util.function.BooleanSupplier; + +public abstract class AESIntrinsicsBase extends CommandLineOptionTest { + public static final BooleanSupplier AES_SUPPORTED_PREDICATE + = new AESSupportPredicate(); + public static final String CIPHER_INTRINSIC = "com\\.sun\\.crypto\\" + + ".provider\\.CipherBlockChaining::" + + "(implEncrypt|implDecrypt) \\([0-9]+ bytes\\)\\s+\\(intrinsic[,\\)]"; + public static final String AES_INTRINSIC = "com\\.sun\\.crypto\\" + + ".provider\\.AESCrypt::(implEncryptBlock|implDecryptBlock) \\([0-9]+ " + + "bytes\\)\\s+\\(intrinsic[,\\)]"; + public static final String USE_AES = "UseAES"; + public static final String USE_AES_INTRINSICS = "UseAESIntrinsics"; + public static final String USE_SSE = "UseSSE"; + public static final String USE_VIS = "UseVIS"; + public static final String[] TEST_AES_CMD + = {"-XX:+IgnoreUnrecognizedVMOptions", "-XX:+PrintFlagsFinal", + "-Xbatch","-XX:+UnlockDiagnosticVMOptions", + "-XX:+PrintIntrinsics", "-DcheckOutput=true", "-Dmode=CBC", + "TestAESMain"}; + + protected AESIntrinsicsBase(BooleanSupplier predicate) { + super(predicate); + } + + /** + * Prepares command for TestAESMain execution. + * @param args flags that must be added to command + * @return command for TestAESMain execution + */ + public static String[] prepareArguments(String... args) { + String[] command = Arrays.copyOf(args, TEST_AES_CMD.length + + args.length); + System.arraycopy(TEST_AES_CMD, 0, command, args.length, + TEST_AES_CMD.length); + return command; + } +} diff --git a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java new file mode 100644 index 00000000000..4d655dee023 --- /dev/null +++ b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java @@ -0,0 +1,254 @@ +/* + * 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. + * + */ +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.Platform; +import jdk.test.lib.ProcessTools; + +/* + * @test + * @library /testlibrary /../../test/lib /compiler/whitebox + * /compiler/testlibrary /compiler/codegen/7184394 + * @modules java.base/sun.misc + * java.management + * @build TestAESIntrinsicsOnSupportedConfig TestAESMain + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -Xbatch + * TestAESIntrinsicsOnSupportedConfig + */ +public class TestAESIntrinsicsOnSupportedConfig extends AESIntrinsicsBase { + + /** + * Constructs new TestAESIntrinsicsOnSupportedConfig that will be executed + * only if AESSupportPredicate returns true + */ + private TestAESIntrinsicsOnSupportedConfig() { + super(AESIntrinsicsBase.AES_SUPPORTED_PREDICATE); + } + + @Override + protected void runTestCases() throws Throwable { + testUseAES(); + testUseAESUseSSE2(); + testUseAESUseVIS2(); + testNoUseAES(); + testNoUseAESUseSSE2(); + testNoUseAESUseVIS2(); + testNoUseAESIntrinsic(); + } + + /** + * Test checks following situation:
    + * UseAES flag is set to true, TestAESMain is executed
    + * Expected result: UseAESIntrinsics flag is set to true
    + * If vm type is server then output should contain intrinsics usage
    + * + * @throws Throwable + */ + private void testUseAES() throws Throwable { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES, true))); + final String errorMessage = "Case testUseAES failed"; + if (Platform.isServer()) { + verifyOutput(new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, null, errorMessage, + outputAnalyzer); + } else { + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, errorMessage, + outputAnalyzer); + } + verifyOptionValue(AESIntrinsicsBase.USE_AES, "true", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "true", + errorMessage, outputAnalyzer); + } + + /** + * Test checks following situation:
    + * UseAES flag is set to true, UseSSE flag is set to 2, + * Platform should support UseSSE (x86 or x64)
    + * TestAESMain is executed
    + * Expected result: UseAESIntrinsics flag is set to false
    + * Output shouldn't contain intrinsics usage
    + * + * @throws Throwable + */ + private void testUseAESUseSSE2() throws Throwable { + if (Platform.isX86() || Platform.isX64()) { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES_INTRINSICS, true), + prepareNumericFlag(AESIntrinsicsBase.USE_SSE, 2))); + final String errorMessage = "Case testUseAESUseSSE2 failed"; + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "true", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_SSE, "2", errorMessage, + outputAnalyzer); + } + } + + /** + * Test checks following situation:
    + * UseAES flag is set to false, UseSSE flag is set to 2, + * Platform should support UseSSE (x86 or x64)
    + * TestAESMain is executed
    + * Expected result: UseAESIntrinsics flag is set to false
    + * Output shouldn't contain intrinsics usage
    + * + * @throws Throwable + */ + private void testNoUseAESUseSSE2() throws Throwable { + if (Platform.isX86() || Platform.isX64()) { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES, false), + prepareNumericFlag(AESIntrinsicsBase.USE_SSE, 2))); + final String errorMessage = "Case testNoUseAESUseSSE2 failed"; + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "false", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_SSE, "2", errorMessage, + outputAnalyzer); + } + } + + /** + * Test checks following situation:
    + * UseAES flag is set to true, UseVIS flag is set to 2, + * Platform should support UseVIS (sparc)
    + * TestAESMain is executed
    + * Expected result: UseAESIntrinsics flag is set to false
    + * Output shouldn't contain intrinsics usage
    + * + * @throws Throwable + */ + private void testUseAESUseVIS2() throws Throwable { + if (Platform.isSparc()) { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES_INTRINSICS, true), + prepareNumericFlag(AESIntrinsicsBase.USE_VIS, 2))); + final String errorMessage = "Case testUseAESUseVIS2 failed"; + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "true", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_VIS, "2", errorMessage, + outputAnalyzer); + } + } + + + /** + * Test checks following situation:
    + * UseAES flag is set to false, UseVIS flag is set to 2, + * Platform should support UseVIS (sparc)
    + * TestAESMain is executed
    + * Expected result: UseAESIntrinsics flag is set to false
    + * Output shouldn't contain intrinsics usage
    + * + * @throws Throwable + */ + private void testNoUseAESUseVIS2() throws Throwable { + if (Platform.isSparc()) { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES, false), + prepareNumericFlag(AESIntrinsicsBase.USE_VIS, 2))); + final String errorMessage = "Case testNoUseAESUseVIS2 failed"; + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "false", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_VIS, "2", errorMessage, + outputAnalyzer); + } + } + + /** + * Test checks following situation:
    + * UseAES flag is set to false, TestAESMain is executed
    + * Expected result: UseAESIntrinsics flag is set to false
    + * Output shouldn't contain intrinsics usage
    + * + * @throws Throwable + */ + private void testNoUseAES() throws Throwable { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES, false))); + final String errorMessage = "Case testNoUseAES failed"; + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "false", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + } + + /** + * Test checks following situation:
    + * UseAESIntrinsics flag is set to false, TestAESMain is executed
    + * Expected result: UseAES flag is set to true
    + * Output shouldn't contain intrinsics usage
    + * + * @throws Throwable + */ + private void testNoUseAESIntrinsic() throws Throwable { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES_INTRINSICS, false))); + final String errorMessage = "Case testNoUseAESIntrinsic failed"; + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "true", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + } + + public static void main(String args[]) throws Throwable { + new TestAESIntrinsicsOnSupportedConfig().test(); + } +} diff --git a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java new file mode 100644 index 00000000000..fa5e3aaf46e --- /dev/null +++ b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java @@ -0,0 +1,112 @@ +/* + * 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. + * + */ + +import jdk.test.lib.cli.predicate.NotPredicate; +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + +/* + * @test + * @library /testlibrary /../../test/lib /compiler/whitebox + * /compiler/testlibrary /compiler/codegen/7184394 + * @modules java.base/sun.misc + * java.management + * @build TestAESIntrinsicsOnUnsupportedConfig TestAESMain + * @run main ClassFileInstaller + * sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -Xbatch TestAESIntrinsicsOnUnsupportedConfig + */ +public class TestAESIntrinsicsOnUnsupportedConfig extends AESIntrinsicsBase { + + private static final String INTRINSICS_NOT_AVAILABLE_MSG = "warning: AES " + + "intrinsics are not available on this CPU"; + private static final String AES_NOT_AVAILABLE_MSG = "warning: AES " + + "instructions are not available on this CPU"; + + /** + * Constructs new TestAESIntrinsicsOnUnsupportedConfig that will be + * executed only if AESSupportPredicate returns false + */ + private TestAESIntrinsicsOnUnsupportedConfig() { + super(new NotPredicate(AESIntrinsicsBase.AES_SUPPORTED_PREDICATE)); + } + + @Override + protected void runTestCases() throws Throwable { + testUseAES(); + testUseAESIntrinsics(); + } + + /** + * Test checks following situation:
    + * UseAESIntrinsics flag is set to true, TestAESMain is executed
    + * Expected result: UseAESIntrinsics flag is set to false
    + * UseAES flag is set to false
    + * Output shouldn't contain intrinsics usage
    + * Output should contain message about intrinsics unavailability + * @throws Throwable + */ + private void testUseAESIntrinsics() throws Throwable { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + AESIntrinsicsBase.prepareArguments(prepareBooleanFlag( + AESIntrinsicsBase.USE_AES_INTRINSICS, true))); + final String errorMessage = "Case testUseAESIntrinsics failed"; + verifyOutput(new String[] {INTRINSICS_NOT_AVAILABLE_MSG}, + new String[] {AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "false", errorMessage, + outputAnalyzer); + } + + /** + * Test checks following situation:
    + * UseAESIntrinsics flag is set to true, TestAESMain is executed
    + * Expected result: UseAES flag is set to false
    + * UseAES flag is set to false
    + * Output shouldn't contain intrinsics usage
    + * Output should contain message about AES unavailability
    + * @throws Throwable + */ + private void testUseAES() throws Throwable { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + AESIntrinsicsBase.prepareArguments(prepareBooleanFlag + (AESIntrinsicsBase.USE_AES, true))); + final String errorMessage = "Case testUseAES failed"; + verifyOutput(new String[] {AES_NOT_AVAILABLE_MSG}, + new String[] {AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "false", errorMessage, + outputAnalyzer); + } + + public static void main(String args[]) throws Throwable { + new TestAESIntrinsicsOnUnsupportedConfig().test(); + } +} diff --git a/hotspot/test/compiler/cpuflags/predicate/AESSupportPredicate.java b/hotspot/test/compiler/cpuflags/predicate/AESSupportPredicate.java new file mode 100644 index 00000000000..7b4f78b8d13 --- /dev/null +++ b/hotspot/test/compiler/cpuflags/predicate/AESSupportPredicate.java @@ -0,0 +1,37 @@ +/* + * 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. + * + */ +package predicate; + +import sun.hotspot.cpuinfo.CPUInfo; +import java.util.function.BooleanSupplier; + +public class AESSupportPredicate implements BooleanSupplier { + + private static final String AES = "aes"; + + @Override + public boolean getAsBoolean() { + return CPUInfo.getFeatures().contains(AES); + } +} diff --git a/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java b/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java index 031d58a4b54..e1bb112ceb3 100644 --- a/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java +++ b/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java @@ -121,7 +121,27 @@ public abstract class CommandLineOptionTest { throw new AssertionError(errorMessage, e); } + verifyOutput(expectedMessages, unexpectedMessages, + wrongWarningMessage, outputAnalyzer); + } + /** + * Verifies that JVM startup behavior matches our expectations. + * + * @param expectedMessages an array of patterns that should occur in JVM + * output. If {@code null} then + * JVM output could be empty. + * @param unexpectedMessages an array of patterns that should not occur + * in JVM output. If {@code null} then + * JVM output could be empty. + * @param wrongWarningMessage message that will be shown if messages are + * not as expected. + * @param outputAnalyzer OutputAnalyzer instance + * @throws AssertionError if verification fails. + */ + public static void verifyOutput(String[] expectedMessages, + String[] unexpectedMessages, String wrongWarningMessage, + OutputAnalyzer outputAnalyzer) { if (expectedMessages != null) { for (String expectedMessage : expectedMessages) { try { @@ -199,7 +219,7 @@ public abstract class CommandLineOptionTest { public static void verifyOptionValue(String optionName, String expectedValue, String optionErrorString, String... additionalVMOpts) throws Throwable { - verifyOptionValue(optionName, expectedValue, optionErrorString, + verifyOptionValue(optionName, expectedValue, optionErrorString, true, additionalVMOpts); } @@ -247,12 +267,30 @@ public abstract class CommandLineOptionTest { optionName); throw new AssertionError(errorMessage, e); } + verifyOptionValue(optionName, expectedValue, optionErrorString, + outputAnalyzer); + } + + /** + * Verifies that value of specified JVM option is the same as + * expected value. + * + * @param optionName a name of tested option. + * @param expectedValue expected value of tested option. + * @param optionErrorString message will be shown if option value is not + * as expected. + * @param outputAnalyzer OutputAnalyzer instance + * @throws AssertionError if verification fails + */ + public static void verifyOptionValue(String optionName, + String expectedValue, String optionErrorString, + OutputAnalyzer outputAnalyzer) { try { - outputAnalyzer.shouldMatch(String.format( - CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT, - optionName, expectedValue)); + outputAnalyzer.shouldMatch(String.format( + CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT, + optionName, expectedValue)); } catch (RuntimeException e) { - String errorMessage = String.format( + String errorMessage = String.format( "Option '%s' is expected to have '%s' value%n%s", optionName, expectedValue, optionErrorString); From dd5481cbbc702b33b4cff08a2cc2cb7e18fccea6 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Tue, 15 Dec 2015 19:18:05 +0000 Subject: [PATCH 084/228] 8145438: Guarantee failures since 8144028: Use AArch64 bit-test instructions in C2 Implement short and long versions of bit test instructions. Reviewed-by: kvn --- hotspot/src/cpu/aarch64/vm/aarch64.ad | 122 ++++++++++++++---- .../aarch64/vm/c1_MacroAssembler_aarch64.hpp | 1 + .../cpu/aarch64/vm/interp_masm_aarch64.cpp | 5 +- .../cpu/aarch64/vm/macroAssembler_aarch64.hpp | 26 ++++ hotspot/src/share/vm/adlc/formssel.cpp | 3 +- 5 files changed, 127 insertions(+), 30 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad index b6a1a242038..f19eb0e71c7 100644 --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad @@ -3484,10 +3484,14 @@ int Matcher::regnum_to_fpu_offset(int regnum) return 0; } -bool Matcher::is_short_branch_offset(int rule, int br_size, int offset) -{ - Unimplemented(); - return false; +// Is this branch offset short enough that a short branch can be used? +// +// NOTE: If the platform does not provide any short branch variants, then +// this method should return false for offset 0. +bool Matcher::is_short_branch_offset(int rule, int br_size, int offset) { + // The passed offset is relative to address of the branch. + + return (-32768 <= offset && offset < 32768); } const bool Matcher::isSimpleConstant64(jlong value) { @@ -13845,7 +13849,8 @@ instruct cmpP_narrowOop_imm0_branch(cmpOp cmp, iRegN oop, immP0 zero, label labl // Test bit and Branch -instruct cmpL_branch_sign(cmpOp cmp, iRegL op1, immL0 op2, label labl, rFlagsReg cr) %{ +// Patterns for short (< 32KiB) variants +instruct cmpL_branch_sign(cmpOp cmp, iRegL op1, immL0 op2, label labl) %{ match(If cmp (CmpL op1 op2)); predicate(n->in(1)->as_Bool()->_test._test == BoolTest::lt || n->in(1)->as_Bool()->_test._test == BoolTest::ge); @@ -13855,16 +13860,15 @@ instruct cmpL_branch_sign(cmpOp cmp, iRegL op1, immL0 op2, label labl, rFlagsReg format %{ "cb$cmp $op1, $labl # long" %} ins_encode %{ Label* L = $labl$$label; - Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode; - if (cond == Assembler::LT) - __ tbnz($op1$$Register, 63, *L); - else - __ tbz($op1$$Register, 63, *L); + Assembler::Condition cond = + ((Assembler::Condition)$cmp$$cmpcode == Assembler::LT) ? Assembler::NE : Assembler::EQ; + __ tbr(cond, $op1$$Register, 63, *L); %} ins_pipe(pipe_cmp_branch); + ins_short_branch(1); %} -instruct cmpI_branch_sign(cmpOp cmp, iRegIorL2I op1, immI0 op2, label labl, rFlagsReg cr) %{ +instruct cmpI_branch_sign(cmpOp cmp, iRegIorL2I op1, immI0 op2, label labl) %{ match(If cmp (CmpI op1 op2)); predicate(n->in(1)->as_Bool()->_test._test == BoolTest::lt || n->in(1)->as_Bool()->_test._test == BoolTest::ge); @@ -13874,16 +13878,15 @@ instruct cmpI_branch_sign(cmpOp cmp, iRegIorL2I op1, immI0 op2, label labl, rFla format %{ "cb$cmp $op1, $labl # int" %} ins_encode %{ Label* L = $labl$$label; - Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode; - if (cond == Assembler::LT) - __ tbnz($op1$$Register, 31, *L); - else - __ tbz($op1$$Register, 31, *L); + Assembler::Condition cond = + ((Assembler::Condition)$cmp$$cmpcode == Assembler::LT) ? Assembler::NE : Assembler::EQ; + __ tbr(cond, $op1$$Register, 31, *L); %} ins_pipe(pipe_cmp_branch); + ins_short_branch(1); %} -instruct cmpL_branch_bit(cmpOp cmp, iRegL op1, immL op2, immL0 op3, label labl, rFlagsReg cr) %{ +instruct cmpL_branch_bit(cmpOp cmp, iRegL op1, immL op2, immL0 op3, label labl) %{ match(If cmp (CmpL (AndL op1 op2) op3)); predicate((n->in(1)->as_Bool()->_test._test == BoolTest::ne || n->in(1)->as_Bool()->_test._test == BoolTest::eq) @@ -13896,15 +13899,13 @@ instruct cmpL_branch_bit(cmpOp cmp, iRegL op1, immL op2, immL0 op3, label labl, Label* L = $labl$$label; Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode; int bit = exact_log2($op2$$constant); - if (cond == Assembler::EQ) - __ tbz($op1$$Register, bit, *L); - else - __ tbnz($op1$$Register, bit, *L); + __ tbr(cond, $op1$$Register, bit, *L); %} ins_pipe(pipe_cmp_branch); + ins_short_branch(1); %} -instruct cmpI_branch_bit(cmpOp cmp, iRegIorL2I op1, immI op2, immI0 op3, label labl, rFlagsReg cr) %{ +instruct cmpI_branch_bit(cmpOp cmp, iRegIorL2I op1, immI op2, immI0 op3, label labl) %{ match(If cmp (CmpI (AndI op1 op2) op3)); predicate((n->in(1)->as_Bool()->_test._test == BoolTest::ne || n->in(1)->as_Bool()->_test._test == BoolTest::eq) @@ -13917,10 +13918,79 @@ instruct cmpI_branch_bit(cmpOp cmp, iRegIorL2I op1, immI op2, immI0 op3, label l Label* L = $labl$$label; Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode; int bit = exact_log2($op2$$constant); - if (cond == Assembler::EQ) - __ tbz($op1$$Register, bit, *L); - else - __ tbnz($op1$$Register, bit, *L); + __ tbr(cond, $op1$$Register, bit, *L); + %} + ins_pipe(pipe_cmp_branch); + ins_short_branch(1); +%} + +// And far variants +instruct far_cmpL_branch_sign(cmpOp cmp, iRegL op1, immL0 op2, label labl) %{ + match(If cmp (CmpL op1 op2)); + predicate(n->in(1)->as_Bool()->_test._test == BoolTest::lt + || n->in(1)->as_Bool()->_test._test == BoolTest::ge); + effect(USE labl); + + ins_cost(BRANCH_COST); + format %{ "cb$cmp $op1, $labl # long" %} + ins_encode %{ + Label* L = $labl$$label; + Assembler::Condition cond = + ((Assembler::Condition)$cmp$$cmpcode == Assembler::LT) ? Assembler::NE : Assembler::EQ; + __ tbr(cond, $op1$$Register, 63, *L, /*far*/true); + %} + ins_pipe(pipe_cmp_branch); +%} + +instruct far_cmpI_branch_sign(cmpOp cmp, iRegIorL2I op1, immI0 op2, label labl) %{ + match(If cmp (CmpI op1 op2)); + predicate(n->in(1)->as_Bool()->_test._test == BoolTest::lt + || n->in(1)->as_Bool()->_test._test == BoolTest::ge); + effect(USE labl); + + ins_cost(BRANCH_COST); + format %{ "cb$cmp $op1, $labl # int" %} + ins_encode %{ + Label* L = $labl$$label; + Assembler::Condition cond = + ((Assembler::Condition)$cmp$$cmpcode == Assembler::LT) ? Assembler::NE : Assembler::EQ; + __ tbr(cond, $op1$$Register, 31, *L, /*far*/true); + %} + ins_pipe(pipe_cmp_branch); +%} + +instruct far_cmpL_branch_bit(cmpOp cmp, iRegL op1, immL op2, immL0 op3, label labl) %{ + match(If cmp (CmpL (AndL op1 op2) op3)); + predicate((n->in(1)->as_Bool()->_test._test == BoolTest::ne + || n->in(1)->as_Bool()->_test._test == BoolTest::eq) + && is_power_of_2(n->in(2)->in(1)->in(2)->get_long())); + effect(USE labl); + + ins_cost(BRANCH_COST); + format %{ "tb$cmp $op1, $op2, $labl" %} + ins_encode %{ + Label* L = $labl$$label; + Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode; + int bit = exact_log2($op2$$constant); + __ tbr(cond, $op1$$Register, bit, *L, /*far*/true); + %} + ins_pipe(pipe_cmp_branch); +%} + +instruct far_cmpI_branch_bit(cmpOp cmp, iRegIorL2I op1, immI op2, immI0 op3, label labl) %{ + match(If cmp (CmpI (AndI op1 op2) op3)); + predicate((n->in(1)->as_Bool()->_test._test == BoolTest::ne + || n->in(1)->as_Bool()->_test._test == BoolTest::eq) + && is_power_of_2(n->in(2)->in(1)->in(2)->get_int())); + effect(USE labl); + + ins_cost(BRANCH_COST); + format %{ "tb$cmp $op1, $op2, $labl" %} + ins_encode %{ + Label* L = $labl$$label; + Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode; + int bit = exact_log2($op2$$constant); + __ tbr(cond, $op1$$Register, bit, *L, /*far*/true); %} ins_pipe(pipe_cmp_branch); %} diff --git a/hotspot/src/cpu/aarch64/vm/c1_MacroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/c1_MacroAssembler_aarch64.hpp index fe41973b106..24389643ca0 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_MacroAssembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/c1_MacroAssembler_aarch64.hpp @@ -27,6 +27,7 @@ #define CPU_AARCH64_VM_C1_MACROASSEMBLER_AARCH64_HPP using MacroAssembler::build_frame; +using MacroAssembler::null_check; // C1_MacroAssembler contains high-level macros for C1 diff --git a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp index d463f059978..73f35a6bb44 100644 --- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp @@ -1354,9 +1354,8 @@ void InterpreterMacroAssembler::notify_method_entry() { // the code to check if the event should be sent. if (JvmtiExport::can_post_interpreter_events()) { Label L; - ldr(r3, Address(rthread, JavaThread::interp_only_mode_offset())); - tst(r3, ~0); - br(Assembler::EQ, L); + ldrw(r3, Address(rthread, JavaThread::interp_only_mode_offset())); + cbzw(r3, L); call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_entry)); bind(L); diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp index 54c608fada0..ade0ba0eb97 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp @@ -487,6 +487,32 @@ public: orr(Vd, T, Vn, Vn); } +public: + + // Generalized Test Bit And Branch, including a "far" variety which + // spans more than 32KiB. + void tbr(Condition cond, Register Rt, int bitpos, Label &dest, bool far = false) { + assert(cond == EQ || cond == NE, "must be"); + + if (far) + cond = ~cond; + + void (Assembler::* branch)(Register Rt, int bitpos, Label &L); + if (cond == Assembler::EQ) + branch = &Assembler::tbz; + else + branch = &Assembler::tbnz; + + if (far) { + Label L; + (this->*branch)(Rt, bitpos, L); + b(dest); + bind(L); + } else { + (this->*branch)(Rt, bitpos, dest); + } + } + // macro instructions for accessing and updating floating point // status register // diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index 82ba5f9e2d7..90c965bfa88 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -1246,7 +1246,8 @@ bool InstructForm::check_branch_variant(ArchDesc &AD, InstructForm *short_branch !is_short_branch() && // Don't match another short branch variant reduce_result() != NULL && strcmp(reduce_result(), short_branch->reduce_result()) == 0 && - _matrule->equivalent(AD.globalNames(), short_branch->_matrule)) { + _matrule->equivalent(AD.globalNames(), short_branch->_matrule) && + equivalent_predicates(this, short_branch)) { // The instructions are equivalent. // Now verify that both instructions have the same parameters and From edb2af6a6d955e466cf66dcfcf51bb6b7bdcde9c Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Wed, 16 Dec 2015 11:35:59 +0000 Subject: [PATCH 085/228] 8144582: AArch64 does not generate correct branch profile data Reviewed-by: kvn --- hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp index fb339033869..c2da6264f6c 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp @@ -392,7 +392,7 @@ void InterpreterGenerator::generate_counter_incr( __ br(Assembler::LT, *profile_method_continue); // if no method data exists, go to profile_method - __ test_method_data_pointer(r0, *profile_method); + __ test_method_data_pointer(rscratch2, *profile_method); } { From 07512e7aece900b81032c429abff38e580137bce Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Wed, 16 Dec 2015 13:21:19 +0000 Subject: [PATCH 086/228] 8145553: Fix warnings in AArch64 directory Reviewed-by: kvn --- .../src/cpu/aarch64/vm/assembler_aarch64.hpp | 8 +--- .../aarch64/vm/c1_LIRAssembler_aarch64.cpp | 40 +++++++++++++------ .../aarch64/vm/c1_LIRGenerator_aarch64.cpp | 1 + .../cpu/aarch64/vm/interpreter_aarch64.cpp | 1 + .../aarch64/vm/jniFastGetField_aarch64.cpp | 2 + 5 files changed, 33 insertions(+), 19 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp index 76fdf876f90..ca617716562 100644 --- a/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp @@ -135,15 +135,10 @@ REGISTER_DECLARATION(Register, rlocals, r24); // bytecode pointer REGISTER_DECLARATION(Register, rbcp, r22); // Dispatch table base -REGISTER_DECLARATION(Register, rdispatch, r21); +REGISTER_DECLARATION(Register, rdispatch, r21); // Java stack pointer REGISTER_DECLARATION(Register, esp, r20); -// TODO : x86 uses rbp to save SP in method handle code -// we may need to do the same with fp -// JSR 292 fixed register usages: -//REGISTER_DECLARATION(Register, r_mh_SP_save, r29); - #define assert_cond(ARG1) assert(ARG1, #ARG1) namespace asm_util { @@ -551,6 +546,7 @@ class Address VALUE_OBJ_CLASS_SPEC { size = 0; break; default: ShouldNotReachHere(); + size = 0; // unreachable } } else { size = i->get(31, 31); diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp index 119d113aac5..210b29e1e75 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp @@ -173,6 +173,7 @@ static jlong as_long(LIR_Opr data) { break; default: ShouldNotReachHere(); + result = 0; // unreachable } return result; } @@ -720,6 +721,7 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi break; default: ShouldNotReachHere(); + insn = &Assembler::str; // unreachable } if (info) add_debug_info_for_null_check_here(info); @@ -1110,6 +1112,7 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) { case lir_cond_greaterEqual: acond = (is_unordered ? Assembler::HS : Assembler::GE); break; case lir_cond_greater: acond = (is_unordered ? Assembler::HI : Assembler::GT); break; default: ShouldNotReachHere(); + acond = Assembler::EQ; // unreachable } } else { switch (op->cond()) { @@ -1121,7 +1124,8 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) { case lir_cond_greater: acond = Assembler::GT; break; case lir_cond_belowEqual: acond = Assembler::LS; break; case lir_cond_aboveEqual: acond = Assembler::HS; break; - default: ShouldNotReachHere(); + default: ShouldNotReachHere(); + acond = Assembler::EQ; // unreachable } } __ br(acond,*(op->label())); @@ -1313,7 +1317,9 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L ciMethodData* md; ciProfileData* data; - if (op->should_profile()) { + const bool should_profile = op->should_profile(); + + if (should_profile) { ciMethod* method = op->profiled_method(); assert(method != NULL, "Should have method"); int bci = op->profiled_bci(); @@ -1324,8 +1330,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); } Label profile_cast_success, profile_cast_failure; - Label *success_target = op->should_profile() ? &profile_cast_success : success; - Label *failure_target = op->should_profile() ? &profile_cast_failure : failure; + Label *success_target = should_profile ? &profile_cast_success : success; + Label *failure_target = should_profile ? &profile_cast_failure : failure; if (obj == k_RInfo) { k_RInfo = dst; @@ -1341,7 +1347,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L assert_different_registers(obj, k_RInfo, klass_RInfo); - if (op->should_profile()) { + if (should_profile) { Label not_null; __ cbnz(obj, not_null); // Object is null; update MDO and exit @@ -1413,7 +1419,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L // successful cast, fall through to profile or jump } } - if (op->should_profile()) { + if (should_profile) { Register mdo = klass_RInfo, recv = k_RInfo; __ bind(profile_cast_success); __ mov_metadata(mdo, md->constant_encoding()); @@ -1438,6 +1444,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { + const bool should_profile = op->should_profile(); + LIR_Code code = op->code(); if (code == lir_store_check) { Register value = op->object()->as_register(); @@ -1452,7 +1460,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { ciMethodData* md; ciProfileData* data; - if (op->should_profile()) { + if (should_profile) { ciMethod* method = op->profiled_method(); assert(method != NULL, "Should have method"); int bci = op->profiled_bci(); @@ -1463,10 +1471,10 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); } Label profile_cast_success, profile_cast_failure, done; - Label *success_target = op->should_profile() ? &profile_cast_success : &done; - Label *failure_target = op->should_profile() ? &profile_cast_failure : stub->entry(); + Label *success_target = should_profile ? &profile_cast_success : &done; + Label *failure_target = should_profile ? &profile_cast_failure : stub->entry(); - if (op->should_profile()) { + if (should_profile) { Label not_null; __ cbnz(value, not_null); // Object is null; update MDO and exit @@ -1502,7 +1510,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { __ cbzw(k_RInfo, *failure_target); // fall through to the success case - if (op->should_profile()) { + if (should_profile) { Register mdo = klass_RInfo, recv = k_RInfo; __ bind(profile_cast_success); __ mov_metadata(mdo, md->constant_encoding()); @@ -1621,9 +1629,10 @@ void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, L case lir_cond_lessEqual: acond = Assembler::LE; ncond = Assembler::GT; break; case lir_cond_greaterEqual: acond = Assembler::GE; ncond = Assembler::LT; break; case lir_cond_greater: acond = Assembler::GT; ncond = Assembler::LE; break; - case lir_cond_belowEqual: Unimplemented(); break; - case lir_cond_aboveEqual: Unimplemented(); break; + case lir_cond_belowEqual: + case lir_cond_aboveEqual: default: ShouldNotReachHere(); + acond = Assembler::EQ; ncond = Assembler::NE; // unreachable } assert(result->is_single_cpu() || result->is_double_cpu(), @@ -1724,6 +1733,7 @@ void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr break; default: ShouldNotReachHere(); + c = 0; // unreachable break; } @@ -1926,6 +1936,7 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, break; default: ShouldNotReachHere(); + imm = 0; // unreachable break; } @@ -3123,6 +3134,9 @@ void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr break; default: ShouldNotReachHere(); + lda = &MacroAssembler::ldaxr; + add = &MacroAssembler::add; + stl = &MacroAssembler::stlxr; // unreachable } switch (code) { diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp index 21c7cfc93ff..191c4e45571 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp @@ -238,6 +238,7 @@ LIR_Opr LIRGenerator::load_immediate(int x, BasicType type) { } } else { ShouldNotReachHere(); + r = NULL; // unreachable } return r; } diff --git a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp index 96a967fb961..e29c1ec0e22 100644 --- a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp @@ -230,6 +230,7 @@ void InterpreterGenerator::generate_transcendental_entry(AbstractInterpreter::Me break; default: ShouldNotReachHere(); + fn = NULL; // unreachable } const int gpargs = 0, rtype = 3; __ mov(rscratch1, fn); diff --git a/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp index 14c8367f371..b2f21031f18 100644 --- a/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp @@ -61,6 +61,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { case T_FLOAT: name = "jni_fast_GetFloatField"; break; case T_DOUBLE: name = "jni_fast_GetDoubleField"; break; default: ShouldNotReachHere(); + name = NULL; // unreachable } ResourceMark rm; BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE); @@ -125,6 +126,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { case T_FLOAT: slow_case_addr = jni_GetFloatField_addr(); break; case T_DOUBLE: slow_case_addr = jni_GetDoubleField_addr(); break; default: ShouldNotReachHere(); + slow_case_addr = NULL; // unreachable } { From e699dcb655ccf905eb6bc47ca0c5807197edc06e Mon Sep 17 00:00:00 2001 From: Dmitrij Pochepko Date: Wed, 16 Dec 2015 18:38:02 +0300 Subject: [PATCH 087/228] 8141351: Create tests for direct invoke instructions testing Tests for invoke* instructions Reviewed-by: twisti --- hotspot/make/test/JtregNative.gmk | 1 + .../compiler/calls/common/CallInterface.java | 35 +++ .../test/compiler/calls/common/CallsBase.java | 217 ++++++++++++++++++ .../compiler/calls/common/InvokeDynamic.java | 99 ++++++++ .../calls/common/InvokeDynamicPatcher.java | 171 ++++++++++++++ .../calls/common/InvokeInterface.java | 84 +++++++ .../compiler/calls/common/InvokeSpecial.java | 80 +++++++ .../compiler/calls/common/InvokeStatic.java | 91 ++++++++ .../compiler/calls/common/InvokeVirtual.java | 81 +++++++ .../compiler/calls/common/libCallsNative.c | 148 ++++++++++++ .../CompiledInvokeDynamic2CompiledTest.java | 45 ++++ ...CompiledInvokeDynamic2InterpretedTest.java | 39 ++++ .../CompiledInvokeDynamic2NativeTest.java | 39 ++++ .../CompiledInvokeInterface2CompiledTest.java | 43 ++++ ...mpiledInvokeInterface2InterpretedTest.java | 37 +++ .../CompiledInvokeInterface2NativeTest.java | 37 +++ .../CompiledInvokeSpecial2CompiledTest.java | 43 ++++ ...CompiledInvokeSpecial2InterpretedTest.java | 37 +++ .../CompiledInvokeSpecial2NativeTest.java | 37 +++ .../CompiledInvokeStatic2CompiledTest.java | 43 ++++ .../CompiledInvokeStatic2InterpretedTest.java | 37 +++ .../CompiledInvokeStatic2NativeTest.java | 37 +++ .../CompiledInvokeVirtual2CompiledTest.java | 43 ++++ ...CompiledInvokeVirtual2InterpretedTest.java | 37 +++ .../CompiledInvokeVirtual2NativeTest.java | 37 +++ ...InterpretedInvokeDynamic2CompiledTest.java | 39 ++++ ...erpretedInvokeDynamic2InterpretedTest.java | 36 +++ .../InterpretedInvokeDynamic2NativeTest.java | 36 +++ ...terpretedInvokeInterface2CompiledTest.java | 37 +++ ...pretedInvokeInterface2InterpretedTest.java | 34 +++ ...InterpretedInvokeInterface2NativeTest.java | 34 +++ ...InterpretedInvokeSpecial2CompiledTest.java | 37 +++ ...erpretedInvokeSpecial2InterpretedTest.java | 34 +++ .../InterpretedInvokeSpecial2NativeTest.java | 34 +++ .../InterpretedInvokeStatic2CompiledTest.java | 37 +++ ...terpretedInvokeStatic2InterpretedTest.java | 34 +++ .../InterpretedInvokeStatic2NativeTest.java | 34 +++ ...InterpretedInvokeVirtual2CompiledTest.java | 37 +++ ...erpretedInvokeVirtual2InterpretedTest.java | 34 +++ .../InterpretedInvokeVirtual2NativeTest.java | 34 +++ .../NativeInvokeSpecial2CompiledTest.java | 37 +++ .../NativeInvokeSpecial2InterpretedTest.java | 34 +++ .../NativeInvokeSpecial2NativeTest.java | 34 +++ .../NativeInvokeStatic2CompiledTest.java | 37 +++ .../NativeInvokeStatic2InterpretedTest.java | 34 +++ .../NativeInvokeStatic2NativeTest.java | 34 +++ .../NativeInvokeVirtual2CompiledTest.java | 37 +++ .../NativeInvokeVirtual2InterpretedTest.java | 34 +++ .../NativeInvokeVirtual2NativeTest.java | 34 +++ 49 files changed, 2444 insertions(+) create mode 100644 hotspot/test/compiler/calls/common/CallInterface.java create mode 100644 hotspot/test/compiler/calls/common/CallsBase.java create mode 100644 hotspot/test/compiler/calls/common/InvokeDynamic.java create mode 100644 hotspot/test/compiler/calls/common/InvokeDynamicPatcher.java create mode 100644 hotspot/test/compiler/calls/common/InvokeInterface.java create mode 100644 hotspot/test/compiler/calls/common/InvokeSpecial.java create mode 100644 hotspot/test/compiler/calls/common/InvokeStatic.java create mode 100644 hotspot/test/compiler/calls/common/InvokeVirtual.java create mode 100644 hotspot/test/compiler/calls/common/libCallsNative.c create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java diff --git a/hotspot/make/test/JtregNative.gmk b/hotspot/make/test/JtregNative.gmk index d49a03757e7..109c04d37fb 100644 --- a/hotspot/make/test/JtregNative.gmk +++ b/hotspot/make/test/JtregNative.gmk @@ -47,6 +47,7 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC := \ $(HOTSPOT_TOPDIR)/test/runtime/jni/ToStringInInterfaceTest \ $(HOTSPOT_TOPDIR)/test/runtime/SameObject \ $(HOTSPOT_TOPDIR)/test/compiler/floatingpoint/ \ + $(HOTSPOT_TOPDIR)/test/compiler/calls \ # # Add conditional directories here when needed. diff --git a/hotspot/test/compiler/calls/common/CallInterface.java b/hotspot/test/compiler/calls/common/CallInterface.java new file mode 100644 index 00000000000..84b7b075150 --- /dev/null +++ b/hotspot/test/compiler/calls/common/CallInterface.java @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package compiler.calls.common; + +/** + * A test interface used for InvokeInterface + */ +public interface CallInterface { + public boolean callee(int param1, long param2, float param3, double param4, + String param5); + + public boolean calleeNative(int param1, long param2, float param3, + double param4, String param5); +} diff --git a/hotspot/test/compiler/calls/common/CallsBase.java b/hotspot/test/compiler/calls/common/CallsBase.java new file mode 100644 index 00000000000..f6a9ad93f23 --- /dev/null +++ b/hotspot/test/compiler/calls/common/CallsBase.java @@ -0,0 +1,217 @@ +/* + * 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. + */ + +package compiler.calls.common; + +import compiler.testlibrary.CompilerUtils; +import java.lang.reflect.Method; +import java.util.Arrays; +import jdk.test.lib.Asserts; +import sun.hotspot.WhiteBox; + +/** + * A common class for Invoke* classes + */ +public abstract class CallsBase { + public static final String CALL_ERR_MSG = "Call insuccessfull"; + protected final Method calleeMethod; + protected final Method callerMethod; + protected final WhiteBox wb = WhiteBox.getWhiteBox(); + protected int compileCallee = -1; + protected int compileCaller = -1; + protected boolean nativeCallee = false; + protected boolean nativeCaller = false; + protected boolean calleeVisited = false; + protected boolean checkCallerCompilationLevel; + protected boolean checkCalleeCompilationLevel; + protected int expectedCallerCompilationLevel; + protected int expectedCalleeCompilationLevel; + + protected CallsBase() { + try { + callerMethod = getClass().getDeclaredMethod("caller"); + calleeMethod = getClass().getDeclaredMethod("callee", + getCalleeParametersTypes()); + wb.testSetDontInlineMethod(callerMethod, /* dontinline= */ true); + wb.testSetDontInlineMethod(calleeMethod, /* dontinline= */ true); + } catch (NoSuchMethodException e) { + throw new Error("TEST BUG: can't find test method", e); + } + } + + /** + * Provides callee parameters types to search method + * @return array of types + */ + protected Class[] getCalleeParametersTypes() { + return new Class[] {int.class, long.class, float.class, + double.class, String.class}; + } + + /** + * Loads native library(libCallsNative.so) + */ + protected static void loadNativeLibrary() { + System.loadLibrary("CallsNative"); + } + + /** + * Checks if requested compilation levels are inside of current vm capabilities + * @return true if vm is capable of requested compilation levels + */ + protected final boolean compilationLevelsSupported() { + int[] compLevels = CompilerUtils.getAvailableCompilationLevels(); + boolean callerCompLevelSupported = compileCaller > 0 + && Arrays.stream(compLevels) + .filter(elem -> elem == compileCaller) + .findAny() + .isPresent(); + boolean calleeCompLevelSupported = compileCallee > 0 + && Arrays.stream(compLevels) + .filter(elem -> elem == compileCallee) + .findAny() + .isPresent(); + return callerCompLevelSupported && calleeCompLevelSupported; + } + + /** + * Parse test arguments + * @param args test arguments + */ + protected final void parseArgs(String args[]) { + for (int i = 0; i < args.length; i++) { + switch (args[i]) { + case "-nativeCallee": + nativeCallee = true; + break; + case "-nativeCaller": + nativeCaller = true; + break; + case "-compileCallee": + compileCallee = Integer.parseInt(args[++i]); + break; + case "-compileCaller": + compileCaller = Integer.parseInt(args[++i]); + break; + case "-checkCallerCompileLevel": + checkCallerCompilationLevel = true; + expectedCallerCompilationLevel = Integer.parseInt(args[++i]); + break; + case "-checkCalleeCompileLevel": + checkCalleeCompilationLevel = true; + expectedCalleeCompilationLevel = Integer.parseInt(args[++i]); + break; + default: + throw new Error("Can't parse test parameter:" + args[i]); + } + } + } + + /** + * Run basic logic of a test by doing compile + * action(if needed). An arguments can be -compileCallee + * $calleeCompilationLevel and/or -compileCaller $callerCompilationLevel + * and/or -nativeCaller and/or -nativeCallee to indicate that native methods + * for caller/callee should be used + * @param args test args + */ + protected final void runTest(String args[]) { + parseArgs(args); + if (compilationLevelsSupported()) { + if (nativeCaller || nativeCallee) { + CallsBase.loadNativeLibrary(); + } + Object lock = getLockObject(); + Asserts.assertNotNull(lock, "Lock object is null"); + /* a following lock is needed in case several instances of this + test are launched in same vm */ + synchronized (lock) { + if (compileCaller > 0 || compileCallee > 0) { + caller(); // call once to have everything loaded + calleeVisited = false; // reset state + } + // compile with requested level if needed + if (compileCallee > 0) { + compileMethod(calleeMethod, compileCallee); + } + if (checkCalleeCompilationLevel) { + Asserts.assertEQ(expectedCalleeCompilationLevel, + wb.getMethodCompilationLevel(calleeMethod), + "Unexpected callee compilation level"); + } + if (compileCaller > 0) { + compileMethod(callerMethod, compileCaller); + } + if (checkCallerCompilationLevel) { + Asserts.assertEQ(expectedCallerCompilationLevel, + wb.getMethodCompilationLevel(callerMethod), + "Unexpected caller compilation level"); + } + // do calling work + if (nativeCaller) { + callerNative(); + } else { + caller(); + } + } + } else { + System.out.println("WARNING: Requested compilation levels are " + + "out of current vm capabilities. Skipping."); + } + } + + /** + * A method to compile another method, searching it by name in current class + * @param method a method to compile + * @param compLevel a compilation level + */ + protected final void compileMethod(Method method, int compLevel) { + wb.deoptimizeMethod(method); + Asserts.assertTrue(wb.isMethodCompilable(method, compLevel)); + wb.enqueueMethodForCompilation(method, compLevel); + } + + /* + * @return Object to lock on during execution + */ + + protected abstract Object getLockObject(); + + protected abstract void caller(); + + protected abstract void callerNative(); + + /** + * A method checking values. Should be used to verify if all parameters are + * passed as expected. Parameter N should have a value indicating number "N" + * in respective type representation. + */ + public static void checkValues(int param1, long param2, float param3, + double param4, String param5) { + Asserts.assertEQ(param1, 1); + Asserts.assertEQ(param2, 2L); + Asserts.assertEQ(param3, 3.0f); + Asserts.assertEQ(param4, 4.0d); + Asserts.assertEQ(param5, "5"); + } +} diff --git a/hotspot/test/compiler/calls/common/InvokeDynamic.java b/hotspot/test/compiler/calls/common/InvokeDynamic.java new file mode 100644 index 00000000000..018a2992e80 --- /dev/null +++ b/hotspot/test/compiler/calls/common/InvokeDynamic.java @@ -0,0 +1,99 @@ +/* + * 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. + */ + +package compiler.calls.common; + +import java.lang.invoke.CallSite; +import java.lang.invoke.ConstantCallSite; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; + +/** + * A test class checking InvokeDynamic instruction. + * This is not quite "ready-to-use" class, since javac can't generate indy + * directly(only as part of lambda init) so, this class bytecode should be + * patched with method "caller" which uses indy. Other methods can be written in + * java for easier support and readability. + */ + +public class InvokeDynamic extends CallsBase { + private static final Object LOCK = new Object(); + + public static void main(String args[]) { + new InvokeDynamic().runTest(args); + } + + /** + * Caller method to call "callee" method. Must be overwritten with InvokeDynamicPatcher + */ + @Override + public void caller() { + } + + /** + * A bootstrap method for invokedynamic + * @param lookup a lookup object + * @param methodName methodName + * @param type method type + * @return CallSite for method + */ + public static CallSite bootstrapMethod(MethodHandles.Lookup lookup, + String methodName, MethodType type) throws IllegalAccessException, + NoSuchMethodException { + MethodType mtype = MethodType.methodType(boolean.class, + new Class[]{int.class, long.class, float.class, + double.class, String.class}); + return new ConstantCallSite(lookup.findVirtual(lookup.lookupClass(), + methodName, mtype)); + } + + /** + * A callee method, assumed to be called by "caller" + */ + public boolean callee(int param1, long param2, float param3, double param4, + String param5) { + calleeVisited = true; + CallsBase.checkValues(param1, param2, param3, param4, param5); + return true; + } + + /** + * A native callee method, assumed to be called by "caller" + */ + public native boolean calleeNative(int param1, long param2, float param3, + double param4, String param5); + + /** + * Returns object to lock execution on + * @return lock object + */ + @Override + protected Object getLockObject() { + return LOCK; + } + + @Override + protected void callerNative() { + throw new Error("No native call for invokedynamic"); + } +} diff --git a/hotspot/test/compiler/calls/common/InvokeDynamicPatcher.java b/hotspot/test/compiler/calls/common/InvokeDynamicPatcher.java new file mode 100644 index 00000000000..644f0a21b6e --- /dev/null +++ b/hotspot/test/compiler/calls/common/InvokeDynamicPatcher.java @@ -0,0 +1,171 @@ +/* + * 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. + */ + +package compiler.calls.common; + +import java.io.FileInputStream; +import java.io.IOException; +import java.lang.invoke.CallSite; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; +import jdk.internal.org.objectweb.asm.ClassReader; +import jdk.internal.org.objectweb.asm.ClassVisitor; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.Handle; +import jdk.internal.org.objectweb.asm.Label; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.internal.org.objectweb.asm.Opcodes; + +/** + * A class which patch InvokeDynamic class bytecode with invokydynamic + instruction, rewriting "caller" method to call "callee" method using + invokedynamic + */ +public class InvokeDynamicPatcher extends ClassVisitor { + + private static final String CLASS = InvokeDynamic.class.getName() + .replace('.', '/'); + private static final String CALLER_METHOD_NAME = "caller"; + private static final String CALLEE_METHOD_NAME = "callee"; + private static final String NATIVE_CALLEE_METHOD_NAME = "calleeNative"; + private static final String BOOTSTRAP_METHOD_NAME = "bootstrapMethod"; + private static final String CALL_NATIVE_FIELD = "nativeCallee"; + private static final String CALL_NATIVE_FIELD_DESC = "Z"; + private static final String CALLEE_METHOD_DESC + = "(L" + CLASS + ";IJFDLjava/lang/String;)Z"; + private static final String ASSERTTRUE_METHOD_DESC + = "(ZLjava/lang/String;)V"; + private static final String ASSERTS_CLASS = "jdk/test/lib/Asserts"; + private static final String ASSERTTRUE_METHOD_NAME = "assertTrue"; + + public static void main(String args[]) { + ClassReader cr; + Path filePath; + try { + filePath = Paths.get(InvokeDynamic.class.getProtectionDomain().getCodeSource() + .getLocation().toURI()).resolve(CLASS + ".class"); + } catch (URISyntaxException ex) { + throw new Error("TESTBUG: Can't get code source" + ex, ex); + } + try (FileInputStream fis = new FileInputStream(filePath.toFile())) { + cr = new ClassReader(fis); + } catch (IOException e) { + throw new Error("Error reading file", e); + } + ClassWriter cw = new ClassWriter(cr, + ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); + cr.accept(new InvokeDynamicPatcher(Opcodes.ASM5, cw), 0); + try { + Files.write(filePath, cw.toByteArray(), + StandardOpenOption.WRITE); + } catch (IOException e) { + throw new Error(e); + } + } + + public InvokeDynamicPatcher(int api, ClassWriter cw) { + super(api, cw); + } + + @Override + public MethodVisitor visitMethod(final int access, final String name, + final String desc, final String signature, + final String[] exceptions) { + /* a code generate looks like + * 0: aload_0 + * 1: ldc #125 // int 1 + * 3: ldc2_w #126 // long 2l + * 6: ldc #128 // float 3.0f + * 8: ldc2_w #129 // double 4.0d + * 11: ldc #132 // String 5 + * 13: aload_0 + * 14: getfield #135 // Field nativeCallee:Z + * 17: ifeq 28 + * 20: invokedynamic #181, 0 // InvokeDynamic #1:calleeNative:(Lcompiler/calls/common/InvokeDynamic;IJFDLjava/lang/String;)Z + * 25: goto 33 + * 28: invokedynamic #183, 0 // InvokeDynamic #1:callee:(Lcompiler/calls/common/InvokeDynamic;IJFDLjava/lang/String;)Z + * 33: ldc #185 // String Call insuccessfull + * 35: invokestatic #191 // Method jdk/test/lib/Asserts.assertTrue:(ZLjava/lang/String;)V + * 38: return + * + * or, using java-like pseudo-code + * if (this.nativeCallee == false) { + * invokedynamic-call-return-value = invokedynamic-of-callee + * } else { + * invokedynamic-call-return-value = invokedynamic-of-nativeCallee + * } + * Asserts.assertTrue(invokedynamic-call-return-value, error-message); + * return; + */ + if (name.equals(CALLER_METHOD_NAME)) { + MethodVisitor mv = cv.visitMethod(access, name, desc, + signature, exceptions); + Label nonNativeLabel = new Label(); + Label checkLabel = new Label(); + MethodType mtype = MethodType.methodType(CallSite.class, + MethodHandles.Lookup.class, String.class, MethodType.class); + Handle bootstrap = new Handle(Opcodes.H_INVOKESTATIC, CLASS, + BOOTSTRAP_METHOD_NAME, mtype.toMethodDescriptorString()); + mv.visitCode(); + // push callee parameters onto stack + mv.visitVarInsn(Opcodes.ALOAD, 0);//push "this" + mv.visitLdcInsn(1); + mv.visitLdcInsn(2L); + mv.visitLdcInsn(3.0f); + mv.visitLdcInsn(4.0d); + mv.visitLdcInsn("5"); + // params loaded. let's decide what method to call + mv.visitVarInsn(Opcodes.ALOAD, 0); // push "this" + // get nativeCallee field + mv.visitFieldInsn(Opcodes.GETFIELD, CLASS, CALL_NATIVE_FIELD, + CALL_NATIVE_FIELD_DESC); + // if nativeCallee == false goto nonNativeLabel + mv.visitJumpInsn(Opcodes.IFEQ, nonNativeLabel); + // invokedynamic nativeCalleeMethod using bootstrap method + mv.visitInvokeDynamicInsn(NATIVE_CALLEE_METHOD_NAME, + CALLEE_METHOD_DESC, bootstrap); + // goto checkLabel + mv.visitJumpInsn(Opcodes.GOTO, checkLabel); + // label: nonNativeLabel + mv.visitLabel(nonNativeLabel); + // invokedynamic calleeMethod using bootstrap method + mv.visitInvokeDynamicInsn(CALLEE_METHOD_NAME, CALLEE_METHOD_DESC, + bootstrap); + mv.visitLabel(checkLabel); + mv.visitLdcInsn(CallsBase.CALL_ERR_MSG); + mv.visitMethodInsn(Opcodes.INVOKESTATIC, ASSERTS_CLASS, + ASSERTTRUE_METHOD_NAME, ASSERTTRUE_METHOD_DESC, false); + // label: return + mv.visitInsn(Opcodes.RETURN); + mv.visitMaxs(0, 0); + mv.visitEnd(); + return null; + } + return super.visitMethod(access, name, desc, signature, exceptions); + } +} diff --git a/hotspot/test/compiler/calls/common/InvokeInterface.java b/hotspot/test/compiler/calls/common/InvokeInterface.java new file mode 100644 index 00000000000..7ae77d5c4ee --- /dev/null +++ b/hotspot/test/compiler/calls/common/InvokeInterface.java @@ -0,0 +1,84 @@ +/* + * 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. + */ + +package compiler.calls.common; + +import jdk.test.lib.Asserts; + +/** + * A test class checking InvokeInterface instruction + */ +public class InvokeInterface extends CallsBase implements CallInterface { + private static final Object LOCK = new Object(); + + public static void main(String args[]) { + new InvokeInterface().runTest(args); + } + + /** + * A caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public void caller() { + // cast to CallInterface to force invokeinterface usage + if (nativeCallee) { + Asserts.assertTrue(((CallInterface) this) + .calleeNative(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG); + } else { + Asserts.assertTrue(((CallInterface) this) + .callee(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG); + } + } + + /** + * A callee method, assumed to be called by "caller"/"callerNative" + */ + @Override + public boolean callee(int param1, long param2, float param3, double param4, + String param5) { + calleeVisited = true; + CallsBase.checkValues(param1, param2, param3, param4, param5); + return true; + } + + /** + * A native callee method, assumed to be called by "caller"/"callerNative" + */ + @Override + public native boolean calleeNative(int param1, long param2, float param3, + double param4, String param5); + + /** + * Returns object to lock execution on + * @return lock object + */ + @Override + protected Object getLockObject() { + return LOCK; + } + + @Override + protected void callerNative() { + throw new Error("No native call for invokeinterface"); + } +} diff --git a/hotspot/test/compiler/calls/common/InvokeSpecial.java b/hotspot/test/compiler/calls/common/InvokeSpecial.java new file mode 100644 index 00000000000..1eb34873a83 --- /dev/null +++ b/hotspot/test/compiler/calls/common/InvokeSpecial.java @@ -0,0 +1,80 @@ +/* + * 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. + */ + +package compiler.calls.common; + +import jdk.test.lib.Asserts; + +/** + * A test class checking InvokeSpecial instruction + */ +public class InvokeSpecial extends CallsBase { + private static final Object LOCK = new Object(); + + public static void main(String args[]) { + new InvokeSpecial().runTest(args); + } + + /** + * A native caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public native void callerNative(); + + /** + * A caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public void caller() { + if (nativeCallee) { + Asserts.assertTrue(calleeNative(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG); + } else { + Asserts.assertTrue(callee(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG); + } + } + + /** + * A callee method, assumed to be called by "caller"/"callerNative" + */ + private boolean callee(int param1, long param2, float param3, double param4, + String param5) { + calleeVisited = true; + CallsBase.checkValues(param1, param2, param3, param4, param5); + return true; + } + + /** + * A native callee method, assumed to be called by "caller"/"callerNative" + */ + public native boolean calleeNative(int param1, long param2, float param3, + double param4, String param5); + + /** + * Returns object to lock execution on + * @return lock object + */ + @Override + protected Object getLockObject() { + return LOCK; + } +} diff --git a/hotspot/test/compiler/calls/common/InvokeStatic.java b/hotspot/test/compiler/calls/common/InvokeStatic.java new file mode 100644 index 00000000000..18abcae7327 --- /dev/null +++ b/hotspot/test/compiler/calls/common/InvokeStatic.java @@ -0,0 +1,91 @@ +/* + * 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. + */ + +package compiler.calls.common; + +import jdk.test.lib.Asserts; + +/** + * A test class checking InvokeStatic instruction + */ +public class InvokeStatic extends CallsBase { + private static final Object LOCK = new Object(); + + public static void main(String args[]) { + new InvokeStatic().runTest(args); + } + + /** + * A native caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public native void callerNative(); + + /** + * A caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public void caller() { + if (nativeCallee) { + Asserts.assertTrue(calleeNative(this, 1, 2L, 3.0f, 4.0d, "5"), + CALL_ERR_MSG); + } else { + Asserts.assertTrue(callee(this, 1, 2L, 3.0f, 4.0d, "5"), + CALL_ERR_MSG); + } + } + + /** + * A callee method, assumed to be called by "caller"/"callerNative" + */ + public static boolean callee(InvokeStatic instance, int param1, + long param2, float param3, double param4, String param5) { + instance.calleeVisited = true; + CallsBase.checkValues(param1, param2, param3, param4, param5); + return true; + } + + /** + * A native callee method, assumed to be called by "caller"/"callerNative" + */ + public static native boolean calleeNative(InvokeStatic instance, + int param1, long param2, float param3, double param4, String param5); + + /** + * Returns object to lock execution on + * @return lock object + */ + @Override + protected Object getLockObject() { + return LOCK; + } + + /** + * Provides callee parameters types to search method + * @return array of types + */ + protected Class[] getCalleeParametersTypes() { + return new Class[]{InvokeStatic.class, int.class, long.class, + float.class, double.class, String.class}; + } +} diff --git a/hotspot/test/compiler/calls/common/InvokeVirtual.java b/hotspot/test/compiler/calls/common/InvokeVirtual.java new file mode 100644 index 00000000000..6443fd63bc3 --- /dev/null +++ b/hotspot/test/compiler/calls/common/InvokeVirtual.java @@ -0,0 +1,81 @@ +/* + * 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. + */ + +package compiler.calls.common; + +import jdk.test.lib.Asserts; + +/** + * A test class checking InvokeVirtual instruction + */ + +public class InvokeVirtual extends CallsBase { + private static final Object LOCK = new Object(); + + public static void main(String args[]) { + new InvokeVirtual().runTest(args); + } + + /** + * A native caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public native void callerNative(); + + /** + * A caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public void caller() { + if (nativeCallee) { + Asserts.assertTrue(calleeNative(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG); + } else { + Asserts.assertTrue(callee(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG); + } + } + + /** + * A callee method, assumed to be called by "caller"/"callerNative" + */ + public boolean callee(int param1, long param2, float param3, double param4, + String param5) { + calleeVisited = true; + CallsBase.checkValues(param1, param2, param3, param4, param5); + return true; + } + + /** + * A native callee method, assumed to be called by "caller"/"callerNative" + */ + public native boolean calleeNative(int param1, long param2, float param3, + double param4, String param5); + + /** + * Returns object to lock execution on + * @return lock object + */ + @Override + protected Object getLockObject() { + return LOCK; + } +} diff --git a/hotspot/test/compiler/calls/common/libCallsNative.c b/hotspot/test/compiler/calls/common/libCallsNative.c new file mode 100644 index 00000000000..aacaacc3de1 --- /dev/null +++ b/hotspot/test/compiler/calls/common/libCallsNative.c @@ -0,0 +1,148 @@ +/* + * 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. + */ + +#include + +#include "jni.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define METHOD_SIGNATURE "(IJFDLjava/lang/String;)Z" +#define STATIC_CALLEE_SIGNATURE "(Lcompiler/calls/common/InvokeStatic;IJFDLjava/lang/String;)Z" +#define BASE_CLASS "compiler/calls/common/CallsBase" + +#define CHECK_EXCEPTIONS if ((*env)->ExceptionCheck(env)) return +#define CHECK_EXCEPTIONS_FALSE if ((*env)->ExceptionCheck(env)) return JNI_FALSE + +#define IS_STATIC 1 +#define NOT_STATIC 0 + +jboolean doCalleeWork(JNIEnv *env, jobject self, jint param1, jlong param2, + jfloat param3, jdouble param4, jstring param5) { + jclass cls = (*env)->GetObjectClass(env, self); + jfieldID calleeVisitedID = (*env)->GetFieldID(env, cls, "calleeVisited", "Z"); + jclass CheckCallsBaseClass; + jmethodID checkValuesID; + CHECK_EXCEPTIONS_FALSE; + (*env)->SetBooleanField(env, self, calleeVisitedID, JNI_TRUE); + CHECK_EXCEPTIONS_FALSE; + CheckCallsBaseClass = (*env)->FindClass(env, BASE_CLASS); + CHECK_EXCEPTIONS_FALSE; + checkValuesID = (*env)->GetStaticMethodID(env, CheckCallsBaseClass, + "checkValues", "(IJFDLjava/lang/String;)V"); + CHECK_EXCEPTIONS_FALSE; + (*env)->CallStaticVoidMethod(env, CheckCallsBaseClass, checkValuesID, + param1, param2, param3, param4, param5); + return JNI_TRUE; +} + +JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeDynamic_calleeNative(JNIEnv *env, jobject obj, + jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) { + return doCalleeWork(env, obj, param1, param2, param3, param4, param5); +} + +JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeInterface_calleeNative(JNIEnv *env, jobject obj, + jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) { + return doCalleeWork(env, obj, param1, param2, param3, param4, param5); +} + +JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeSpecial_calleeNative(JNIEnv *env, jobject obj, + jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) { + return doCalleeWork(env, obj, param1, param2, param3, param4, param5); +} + +JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeVirtual_calleeNative(JNIEnv *env, jobject obj, + jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) { + return doCalleeWork(env, obj, param1, param2, param3, param4, param5); +} + +JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeStatic_calleeNative(JNIEnv *env, jclass obj, + jobject self, jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) { + return doCalleeWork(env, self, param1, param2, param3, param4, param5); +} + +void doCallerWork(JNIEnv *env, jobject obj, int isStatic) { + jclass cls = (*env)->GetObjectClass(env, obj); + jmethodID calleeMethodID = 0; + jfieldID errorMessageID; + jfieldID nativeCalleeID; + jobject errorMessage; + jmethodID assertTrue; + jboolean callNative; + jclass assertsClass; + jclass baseClass; + jboolean result; + char* methodName; + CHECK_EXCEPTIONS; + nativeCalleeID = (*env)->GetFieldID(env, cls, "nativeCallee", "Z"); + CHECK_EXCEPTIONS; + callNative = (*env)->GetBooleanField(env, obj, nativeCalleeID); + CHECK_EXCEPTIONS; + methodName = (callNative == JNI_TRUE) ? "calleeNative" : "callee"; + if (isStatic) { + calleeMethodID = (*env)->GetStaticMethodID(env, cls, methodName, + STATIC_CALLEE_SIGNATURE); + } else { + calleeMethodID = (*env)->GetMethodID(env, cls, methodName, METHOD_SIGNATURE); + } + CHECK_EXCEPTIONS; + if (isStatic) { + result = (*env)->CallStaticBooleanMethod(env, cls, calleeMethodID, obj, + (jint) 1, (jlong) 2L, (jfloat) 3.0f, (jdouble) 4.0, (*env)->NewStringUTF(env, "5")); + } else { + result = (*env)->CallBooleanMethod(env, obj, calleeMethodID, + (jint) 1, (jlong) 2L, (jfloat) 3.0f, (jdouble) 4.0, (*env)->NewStringUTF(env, "5")); + } + CHECK_EXCEPTIONS; + baseClass = (*env)->FindClass(env, BASE_CLASS); + CHECK_EXCEPTIONS; + errorMessageID = (*env)->GetStaticFieldID(env, baseClass, + "CALL_ERR_MSG", "Ljava/lang/String;"); + CHECK_EXCEPTIONS; + errorMessage = (*env)->GetStaticObjectField(env, baseClass, errorMessageID); + CHECK_EXCEPTIONS; + assertsClass = (*env)->FindClass(env, "jdk/test/lib/Asserts"); + CHECK_EXCEPTIONS; + assertTrue = (*env)->GetStaticMethodID(env, assertsClass, + "assertTrue", "(ZLjava/lang/String;)V"); + (*env)->CallStaticVoidMethod(env, assertsClass, assertTrue, result, + errorMessage); +} + +JNIEXPORT void JNICALL Java_compiler_calls_common_InvokeSpecial_callerNative(JNIEnv *env, jobject obj) { + doCallerWork(env, obj, NOT_STATIC); +} + +JNIEXPORT void JNICALL Java_compiler_calls_common_InvokeVirtual_callerNative(JNIEnv *env, jobject obj) { + doCallerWork(env, obj, NOT_STATIC); +} + +JNIEXPORT void JNICALL Java_compiler_calls_common_InvokeStatic_callerNative(JNIEnv *env, jobject obj) { + doCallerWork(env, obj, IS_STATIC); +} + +#ifdef __cplusplus +} +#endif diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java new file mode 100644 index 00000000000..dd4daef9849 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java @@ -0,0 +1,45 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeDynamic + * @build compiler.calls.common.InvokeDynamicPatcher + * @run driver compiler.calls.common.InvokeDynamicPatcher + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeDynamic + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeDynamic + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeDynamic + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeDynamic + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from compiled to compiled using InvokeDynamic + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java new file mode 100644 index 00000000000..3074acbc1a8 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java @@ -0,0 +1,39 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeDynamic + * @build compiler.calls.common.InvokeDynamicPatcher + * @run driver compiler.calls.common.InvokeDynamicPatcher + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::callee compiler.calls.common.InvokeDynamic + * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::callee compiler.calls.common.InvokeDynamic + * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 + * @summary check calls from compiled to interpreted using InvokeDynamic + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java new file mode 100644 index 00000000000..b06cbf5c89c --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java @@ -0,0 +1,39 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeDynamic + * @build compiler.calls.common.InvokeDynamicPatcher + * @run driver compiler.calls.common.InvokeDynamicPatcher + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeDynamic + * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeDynamic + * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee + * @summary check calls from compiled to native using InvokeDynamic + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java new file mode 100644 index 00000000000..fec0fda8aee --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java @@ -0,0 +1,43 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeInterface + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeInterface + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeInterface + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeInterface + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeInterface + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from compiled to compiled using InvokeInterface + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java new file mode 100644 index 00000000000..2baf4e7caa8 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeInterface + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::callee compiler.calls.common.InvokeInterface + * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::callee compiler.calls.common.InvokeInterface + * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 + * @summary check calls from compiled to interpreted using InvokeInterface + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java new file mode 100644 index 00000000000..ec394a10f93 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeInterface + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeInterface + * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeInterface + * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee + * @summary check calls from compiled to native using InvokeInterface + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java new file mode 100644 index 00000000000..5d659f5bbef --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java @@ -0,0 +1,43 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from compiled to compiled using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java new file mode 100644 index 00000000000..1a6c6c9ec17 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial + * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial + * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 + * @summary check calls from compiled to interpreted using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java new file mode 100644 index 00000000000..e1b64749d22 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee + * @summary check calls from compiled to native using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java new file mode 100644 index 00000000000..f31ef6ba9ff --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java @@ -0,0 +1,43 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from compiled to compiled using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java new file mode 100644 index 00000000000..8a8b8565a05 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic + * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic + * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 + * @summary check calls from compiled to interpreted using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java new file mode 100644 index 00000000000..955a727f00b --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee + * @summary check calls from compiled to native using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java new file mode 100644 index 00000000000..53fb39ac117 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java @@ -0,0 +1,43 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from compiled to compiled using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java new file mode 100644 index 00000000000..d875be780df --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual + * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual + * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 + * @summary check calls from compiled to interpreted using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java new file mode 100644 index 00000000000..0f69bb50cf4 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee + * @summary check calls from compiled to native using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java new file mode 100644 index 00000000000..28b38025db6 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java @@ -0,0 +1,39 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeDynamic + * @build compiler.calls.common.InvokeDynamicPatcher + * @run driver compiler.calls.common.InvokeDynamicPatcher + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller -Xbatch compiler.calls.common.InvokeDynamic + * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller -Xbatch compiler.calls.common.InvokeDynamic + * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from interpreted to compiled using InvokeDynamic + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java new file mode 100644 index 00000000000..3359e8104be --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java @@ -0,0 +1,36 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeDynamic + * @build compiler.calls.common.InvokeDynamicPatcher + * @run driver compiler.calls.common.InvokeDynamicPatcher + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::callee compiler.calls.common.InvokeDynamic + * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 + * @summary check calls from interpreted to interpreted using InvokeDynamic + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java new file mode 100644 index 00000000000..03fbfdda2a4 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java @@ -0,0 +1,36 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeDynamic + * @build compiler.calls.common.InvokeDynamicPatcher + * @run driver compiler.calls.common.InvokeDynamicPatcher + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller compiler.calls.common.InvokeDynamic + * -checkCallerCompileLevel 0 -nativeCallee + * @summary check calls from interpreted to native using InvokeDynamic + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java new file mode 100644 index 00000000000..84b4e5016ca --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeInterface + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller -Xbatch compiler.calls.common.InvokeInterface + * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller -Xbatch compiler.calls.common.InvokeInterface + * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from interpreted to compiled using InvokeInterface + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java new file mode 100644 index 00000000000..a4f204f1d34 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeInterface + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::callee compiler.calls.common.InvokeInterface + * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 + * @summary check calls from interpreted to interpreted using InvokeInterface + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java new file mode 100644 index 00000000000..ca0044524e0 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeInterface + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller compiler.calls.common.InvokeInterface + * -checkCallerCompileLevel 0 -nativeCallee + * @summary check calls from interpreted to native using InvokeInterface + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2CompiledTest.java new file mode 100644 index 00000000000..d47585abf29 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller -Xbatch compiler.calls.common.InvokeSpecial + * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller -Xbatch compiler.calls.common.InvokeSpecial + * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from interpreted to compiled using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java new file mode 100644 index 00000000000..9c047fa9502 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial + * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 + * @summary check calls from interpreted to interpreted using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java new file mode 100644 index 00000000000..768d5eb9dae --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller compiler.calls.common.InvokeSpecial + * -checkCallerCompileLevel 0 -nativeCallee + * @summary check calls from interpreted to native using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java new file mode 100644 index 00000000000..de4f6c2b995 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller -Xbatch compiler.calls.common.InvokeStatic + * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller -Xbatch compiler.calls.common.InvokeStatic + * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from interpreted to compiled using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java new file mode 100644 index 00000000000..06339099281 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic + * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 + * @summary check calls from interpreted to interpreted using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java new file mode 100644 index 00000000000..2a7deda7655 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller compiler.calls.common.InvokeStatic + * -checkCallerCompileLevel 0 -nativeCallee + * @summary check calls from interpreted to native using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java new file mode 100644 index 00000000000..fb7a645ec8d --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller -Xbatch compiler.calls.common.InvokeVirtual + * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller -Xbatch compiler.calls.common.InvokeVirtual + * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from interpreted to compiled using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java new file mode 100644 index 00000000000..c4eecef1d80 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual + * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 + * @summary check calls from interpreted to interpreted using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java new file mode 100644 index 00000000000..2ac9911b4d3 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller compiler.calls.common.InvokeVirtual + * -checkCallerCompileLevel 0 -nativeCallee + * @summary check calls from interpreted to native using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java new file mode 100644 index 00000000000..1a303bdf088 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from native to compiled using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java new file mode 100644 index 00000000000..517422adf6e --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial + * -nativeCaller -checkCalleeCompileLevel 0 + * @summary check calls from native to interpreted using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java new file mode 100644 index 00000000000..9b3d7ad166a --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * compiler.calls.common.InvokeSpecial + * -nativeCaller -nativeCallee + * @summary check calls from native to native using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java new file mode 100644 index 00000000000..546ed827801 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from native to compiled using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java new file mode 100644 index 00000000000..5e480d82f36 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic + * -nativeCaller -checkCalleeCompileLevel 0 + * @summary check calls from native to interpreted using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java new file mode 100644 index 00000000000..9ace6ea67b5 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * compiler.calls.common.InvokeStatic + * -nativeCaller -nativeCallee + * @summary check calls from native to native using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java new file mode 100644 index 00000000000..56059718e81 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from native to compiled using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java new file mode 100644 index 00000000000..09777265bc3 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual + * -nativeCaller -checkCalleeCompileLevel 0 + * @summary check calls from native to interpreted using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java new file mode 100644 index 00000000000..d4ddd119fc3 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java @@ -0,0 +1,34 @@ +/* + * 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 + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * compiler.calls.common.InvokeVirtual + * -nativeCaller -nativeCallee + * @summary check calls from native to native using InvokeVirtual + */ From 8c0ad215bc399e86467b76ef5240aa8f4aded866 Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Wed, 16 Dec 2015 15:38:28 +0100 Subject: [PATCH 088/228] 8144246: adding lots of directives via jcmd may produce OOM crash Add a limit to the number of directives Reviewed-by: kvn --- .../src/share/vm/compiler/compileBroker.cpp | 2 +- .../share/vm/compiler/compilerDirectives.cpp | 8 +++++ .../share/vm/compiler/compilerDirectives.hpp | 1 + .../share/vm/compiler/directivesParser.cpp | 32 ++++++++++++++++--- .../share/vm/compiler/directivesParser.hpp | 2 ++ hotspot/src/share/vm/runtime/globals.hpp | 7 ++-- hotspot/src/share/vm/utilities/json.cpp | 1 - .../parser/DirectiveStressTest.java | 2 +- .../parser/HugeDirectiveUtil.java | 1 + 9 files changed, 46 insertions(+), 10 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index 9881a31435e..eea5af567bd 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -215,7 +215,7 @@ bool compileBroker_init() { if (DirectivesParser::has_file()) { return DirectivesParser::parse_from_flag(); - } else if (PrintCompilerDirectives) { + } else if (CompilerDirectivesPrint) { // Print default directive even when no other was added DirectivesStack::print(tty); } diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.cpp b/hotspot/src/share/vm/compiler/compilerDirectives.cpp index 4d10aec5307..3d1c9a2fcb1 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.cpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.cpp @@ -487,6 +487,14 @@ void DirectivesStack::pop_inner() { DirectivesStack::release(tmp); } +bool DirectivesStack::check_capacity(int request_size, outputStream* st) { + if ((request_size + _depth) > CompilerDirectivesLimit) { + st->print_cr("Could not add %i more directives. Currently %i/%i directives.", request_size, _depth, CompilerDirectivesLimit); + return false; + } + return true; +} + void DirectivesStack::clear() { // holding the lock during the whole operation ensuring consistent result MutexLockerEx locker(DirectivesStack_lock, Mutex::_no_safepoint_check_flag); diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.hpp b/hotspot/src/share/vm/compiler/compilerDirectives.hpp index 421012c687e..e345a54ee5a 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.hpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.hpp @@ -89,6 +89,7 @@ public: static DirectiveSet* getDefaultDirective(AbstractCompiler* comp); static void push(CompilerDirectives* directive); static void pop(); + static bool check_capacity(int request_size, outputStream* st); static void clear(); static void print(outputStream* st); static void release(DirectiveSet* set); diff --git a/hotspot/src/share/vm/compiler/directivesParser.cpp b/hotspot/src/share/vm/compiler/directivesParser.cpp index 7c2b15404ac..bd69cf1799e 100644 --- a/hotspot/src/share/vm/compiler/directivesParser.cpp +++ b/hotspot/src/share/vm/compiler/directivesParser.cpp @@ -30,6 +30,7 @@ #include void DirectivesParser::push_tmp(CompilerDirectives* dir) { + _tmp_depth++; dir->set_next(_tmp_top); _tmp_top = dir; } @@ -41,17 +42,29 @@ CompilerDirectives* DirectivesParser::pop_tmp() { CompilerDirectives* tmp = _tmp_top; _tmp_top = _tmp_top->next(); tmp->set_next(NULL); + _tmp_depth--; return tmp; } +void DirectivesParser::clean_tmp() { + CompilerDirectives* tmp = pop_tmp(); + while (tmp != NULL) { + delete tmp; + tmp = pop_tmp(); + } + assert(_tmp_depth == 0, "Consistency"); +} + bool DirectivesParser::parse_string(const char* text, outputStream* st) { DirectivesParser cd(text, st); if (cd.valid()) { return cd.install_directives(); + } else { + cd.clean_tmp(); + st->flush(); + st->print_cr("Parsing of compiler directives failed"); + return false; } - st->flush(); - st->print_cr("Parsing of compiler directives failed"); - return false; } bool DirectivesParser::has_file() { @@ -91,6 +104,12 @@ bool DirectivesParser::parse_from_file_inner(const char* filename, outputStream* } bool DirectivesParser::install_directives() { + // Check limit + if (!DirectivesStack::check_capacity(_tmp_depth, _st)) { + clean_tmp(); + return false; + } + // Pop from internal temporary stack and push to compileBroker. CompilerDirectives* tmp = pop_tmp(); int i = 0; @@ -104,7 +123,7 @@ bool DirectivesParser::install_directives() { return false; } else { _st->print_cr("%i compiler directives added", i); - if (PrintCompilerDirectives) { + if (CompilerDirectivesPrint) { // Print entire directives stack after new has been pushed. DirectivesStack::print(_st); } @@ -113,7 +132,7 @@ bool DirectivesParser::install_directives() { } DirectivesParser::DirectivesParser(const char* text, outputStream* st) -: JSON(text, false, st), depth(0), current_directive(NULL), current_directiveset(NULL), _tmp_top(NULL) { +: JSON(text, false, st), depth(0), current_directive(NULL), current_directiveset(NULL), _tmp_top(NULL), _tmp_depth(0) { #ifndef PRODUCT memset(stack, 0, MAX_DEPTH * sizeof(stack[0])); #endif @@ -121,6 +140,8 @@ DirectivesParser::DirectivesParser(const char* text, outputStream* st) } DirectivesParser::~DirectivesParser() { + assert(_tmp_top == NULL, "Consistency"); + assert(_tmp_depth == 0, "Consistency"); } const DirectivesParser::key DirectivesParser::keys[] = { @@ -584,6 +605,7 @@ void DirectivesParser::test(const char* text, bool should_pass) { tty->print("-- DirectivesParser test failed as expected --\n"); } } + cd.clean_tmp(); } bool DirectivesParser::test() { diff --git a/hotspot/src/share/vm/compiler/directivesParser.hpp b/hotspot/src/share/vm/compiler/directivesParser.hpp index 9defc95fab9..d0d7eb31388 100644 --- a/hotspot/src/share/vm/compiler/directivesParser.hpp +++ b/hotspot/src/share/vm/compiler/directivesParser.hpp @@ -126,8 +126,10 @@ private: DirectiveSet* current_directiveset; void push_tmp(CompilerDirectives* dir); + void clean_tmp(); CompilerDirectives* pop_tmp(); CompilerDirectives* _tmp_top; // temporary storage for dirs while parsing + int _tmp_depth; // Number of directives that has been parsed but not installed. static uint mask(keytype kt); diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index acfcd6735f4..eef5fbb3120 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -4268,8 +4268,11 @@ public: diagnostic(bool, CompilerDirectivesIgnoreCompileCommands, false, \ "Disable backwards compatibility for compile commands.") \ \ - diagnostic(bool, PrintCompilerDirectives, false, \ - "Print compiler directives on installation.") + diagnostic(bool, CompilerDirectivesPrint, false, \ + "Print compiler directives on installation.") \ + diagnostic(int, CompilerDirectivesLimit, 50, \ + "Limit on number of compiler directives.") + /* * Macros for factoring of globals diff --git a/hotspot/src/share/vm/utilities/json.cpp b/hotspot/src/share/vm/utilities/json.cpp index e7df3d0de70..2064bb81e7a 100644 --- a/hotspot/src/share/vm/utilities/json.cpp +++ b/hotspot/src/share/vm/utilities/json.cpp @@ -750,7 +750,6 @@ bool JSONTest::test() { JSONTest::test("{ key : 1 }", true); JSONTest::test("{ key : 1, }", true); - JSONTest::test("{ key : 1.2 }", true); JSONTest::test("{ key : true }", true); JSONTest::test("{ key : true, }", true); JSONTest::test("{ key : false }", true); diff --git a/hotspot/test/compiler/compilercontrol/parser/DirectiveStressTest.java b/hotspot/test/compiler/compilercontrol/parser/DirectiveStressTest.java index 8e23273e643..ef1a311beca 100644 --- a/hotspot/test/compiler/compilercontrol/parser/DirectiveStressTest.java +++ b/hotspot/test/compiler/compilercontrol/parser/DirectiveStressTest.java @@ -44,7 +44,7 @@ import java.util.stream.Collectors; public class DirectiveStressTest { private static final int AMOUNT = Integer.getInteger( "compiler.compilercontrol.parser.DirectiveStressTest.amount", - Short.MAX_VALUE * 2 + 2); + 999); private static final List DESCRIPTORS = new PoolHelper().getAllMethods().stream() .map(pair -> AbstractTestBase.getValidMethodDescriptor( diff --git a/hotspot/test/compiler/compilercontrol/parser/HugeDirectiveUtil.java b/hotspot/test/compiler/compilercontrol/parser/HugeDirectiveUtil.java index d5100ccc33d..6bf59324810 100644 --- a/hotspot/test/compiler/compilercontrol/parser/HugeDirectiveUtil.java +++ b/hotspot/test/compiler/compilercontrol/parser/HugeDirectiveUtil.java @@ -117,6 +117,7 @@ public final class HugeDirectiveUtil { try { output = ProcessTools.executeTestJvm( "-XX:+UnlockDiagnosticVMOptions", + "-XX:CompilerDirectivesLimit=1000", "-XX:CompilerDirectivesFile=" + fileName, "-version"); } catch (Throwable thr) { From 2bb757d0eb1999b86bc983d5bcec6c79ed2a0ef3 Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Wed, 16 Dec 2015 15:39:11 +0100 Subject: [PATCH 089/228] 8145345: LogCompilation output is empty after JEP165: Compiler Control Fix default init and compilecommand update Reviewed-by: kvn --- .../share/vm/compiler/compilerDirectives.cpp | 21 ++++++++++++------- .../share/vm/compiler/compilerDirectives.hpp | 6 +++--- .../share/vm/compiler/directivesParser.cpp | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.cpp b/hotspot/src/share/vm/compiler/compilerDirectives.cpp index 3d1c9a2fcb1..4f6162a96eb 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.cpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.cpp @@ -86,16 +86,21 @@ void CompilerDirectives::print(outputStream* st) { //--- } -void CompilerDirectives::finalize() { +void CompilerDirectives::finalize(outputStream* st) { if (_c1_store != NULL) { - _c1_store->finalize(); + _c1_store->finalize(st); } if (_c2_store != NULL) { - _c2_store->finalize(); + _c2_store->finalize(st); } } -void DirectiveSet::finalize() { +void DirectiveSet::finalize(outputStream* st) { + // Check LogOption and warn + if (LogOption && !LogCompilation) { + st->print_cr("Warning: +LogCompilation must be set to enable compilation logging from directives"); + } + // if any flag has been modified - set directive as enabled // unless it already has been explicitly set. if (!_modified[EnableIndex]) { @@ -252,12 +257,14 @@ DirectiveSet* DirectiveSet::compilecommand_compatibility_init(methodHandle metho changed = true; } } - if (CompilerOracle::should_log(method)) { - if (!_modified[LogIndex]) { - set->LogOption = true; + if (!_modified[LogIndex]) { + bool log = CompilerOracle::should_log(method); + if (log != set->LogOption) { + set->LogOption = log; changed = true; } } + if (CompilerOracle::should_print(method)) { if (!_modified[PrintAssemblyIndex]) { set->PrintAssemblyOption = true; diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.hpp b/hotspot/src/share/vm/compiler/compilerDirectives.hpp index e345a54ee5a..1720aa4c4b3 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.hpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.hpp @@ -39,7 +39,7 @@ cflags(Exclude, bool, false, X) \ cflags(BreakAtExecute, bool, false, X) \ cflags(BreakAtCompile, bool, false, X) \ - cflags(Log, bool, false, X) \ + cflags(Log, bool, LogCompilation, X) \ cflags(PrintAssembly, bool, PrintAssembly, PrintAssembly) \ cflags(PrintInlining, bool, PrintInlining, PrintInlining) \ cflags(PrintNMethods, bool, PrintNMethods, PrintNMethods) \ @@ -117,7 +117,7 @@ public: bool matches_inline(methodHandle method, int inline_action); static DirectiveSet* clone(DirectiveSet const* src); bool is_intrinsic_disabled(methodHandle method); - void finalize(); + void finalize(outputStream* st); typedef enum { #define enum_of_flags(name, type, dvalue, cc_flag) name##Index, @@ -177,7 +177,7 @@ public: DirectiveSet* get_for(AbstractCompiler *comp); void print(outputStream* st); bool is_default_directive() { return _next == NULL; } - void finalize(); + void finalize(outputStream* st); void inc_refcount(); void dec_refcount(); diff --git a/hotspot/src/share/vm/compiler/directivesParser.cpp b/hotspot/src/share/vm/compiler/directivesParser.cpp index bd69cf1799e..16720ceb4db 100644 --- a/hotspot/src/share/vm/compiler/directivesParser.cpp +++ b/hotspot/src/share/vm/compiler/directivesParser.cpp @@ -542,7 +542,7 @@ bool DirectivesParser::callback(JSON_TYPE t, JSON_VAL* v, uint rlimit) { error(INTERNAL_ERROR, "Directive missing required match."); return false; } - current_directive->finalize(); + current_directive->finalize(_st); push_tmp(current_directive); current_directive = NULL; break; From 74cff677d4c9acd1b566442eb09e197a015831f6 Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Wed, 9 Dec 2015 13:37:59 +0100 Subject: [PATCH 090/228] 8144091: CompilerControl: directive file doesn't override inlining rules Fix correct overrides Reviewed-by: roland --- .../share/vm/compiler/compilerDirectives.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.cpp b/hotspot/src/share/vm/compiler/compilerDirectives.cpp index 4f6162a96eb..6ffeaa5a6c4 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.cpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.cpp @@ -313,7 +313,7 @@ CompilerDirectives* DirectiveSet::directive() { bool DirectiveSet::matches_inline(methodHandle method, int inline_action) { if (_inlinematchers != NULL) { - if (_inlinematchers->match(method, InlineMatcher::force_inline)) { + if (_inlinematchers->match(method, inline_action)) { return true; } } @@ -325,11 +325,11 @@ bool DirectiveSet::should_inline(ciMethod* inlinee) { VM_ENTRY_MARK; methodHandle mh(THREAD, inlinee->get_Method()); - if (matches_inline(mh, InlineMatcher::force_inline)) { - return true; + if (_inlinematchers != NULL) { + return matches_inline(mh, InlineMatcher::force_inline); } - if (!CompilerDirectivesIgnoreCompileCommandsOption && CompilerOracle::should_inline(mh)) { - return true; + if (!CompilerDirectivesIgnoreCompileCommandsOption) { + return CompilerOracle::should_inline(mh); } return false; } @@ -339,11 +339,11 @@ bool DirectiveSet::should_not_inline(ciMethod* inlinee) { VM_ENTRY_MARK; methodHandle mh(THREAD, inlinee->get_Method()); - if (matches_inline(mh, InlineMatcher::dont_inline)) { - return true; + if (_inlinematchers != NULL) { + return matches_inline(mh, InlineMatcher::dont_inline); } - if (!CompilerDirectivesIgnoreCompileCommandsOption && CompilerOracle::should_not_inline(mh)) { - return true; + if (!CompilerDirectivesIgnoreCompileCommandsOption) { + return CompilerOracle::should_not_inline(mh); } return false; } From 6996edcbb5af817d4ad616bef6714e2ed9364432 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Wed, 9 Dec 2015 14:56:02 +0100 Subject: [PATCH 091/228] 8144219: [posix] Remove redundant code around os::print_siginfo() For posix platforms, consolidate os::print_siginfo() in os_posix.cpp and remove cds fault special handling Reviewed-by: dholmes, simonis --- hotspot/src/os/aix/vm/os_aix.cpp | 5 -- hotspot/src/os/bsd/vm/os_bsd.cpp | 18 ------- hotspot/src/os/linux/vm/os_linux.cpp | 19 -------- hotspot/src/os/posix/vm/os_posix.cpp | 48 +++++++++++-------- hotspot/src/os/posix/vm/os_posix.hpp | 3 -- hotspot/src/os/posix/vm/vmError_posix.cpp | 20 ++++++++ hotspot/src/os/solaris/vm/os_solaris.cpp | 17 ------- hotspot/src/os/windows/vm/os_windows.cpp | 13 +---- hotspot/src/os/windows/vm/vmError_windows.cpp | 20 ++++++++ hotspot/src/share/vm/runtime/os.hpp | 2 +- hotspot/src/share/vm/utilities/vmError.cpp | 8 ++++ hotspot/src/share/vm/utilities/vmError.hpp | 4 ++ 12 files changed, 84 insertions(+), 93 deletions(-) diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index 560fe57ea54..691ee9b8fb7 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -1647,11 +1647,6 @@ void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) { st->cr(); } -void os::print_siginfo(outputStream* st, void* siginfo) { - os::Posix::print_siginfo_brief(st, (const siginfo_t*) siginfo); - st->cr(); -} - static void print_signal_handler(outputStream* st, int sig, char* buf, size_t buflen); diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index 0ce150c9989..891a66b8d25 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -1710,24 +1710,6 @@ void os::print_memory_info(outputStream* st) { st->cr(); } -void os::print_siginfo(outputStream* st, void* siginfo) { - const siginfo_t* si = (const siginfo_t*)siginfo; - - os::Posix::print_siginfo_brief(st, si); - - if (si && (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && - UseSharedSpaces) { - FileMapInfo* mapinfo = FileMapInfo::current_info(); - if (mapinfo->is_in_shared_space(si->si_addr)) { - st->print("\n\nError accessing class data sharing archive." \ - " Mapped file inaccessible during execution, " \ - " possible disk/network problem."); - } - } - st->cr(); -} - - static void print_signal_handler(outputStream* st, int sig, char* buf, size_t buflen); diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index d667b561773..4b8cb0bbde1 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -2237,25 +2237,6 @@ void os::get_summary_cpu_info(char* cpuinfo, size_t length) { #endif } -void os::print_siginfo(outputStream* st, void* siginfo) { - const siginfo_t* si = (const siginfo_t*)siginfo; - - os::Posix::print_siginfo_brief(st, si); -#if INCLUDE_CDS - if (si && (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && - UseSharedSpaces) { - FileMapInfo* mapinfo = FileMapInfo::current_info(); - if (mapinfo->is_in_shared_space(si->si_addr)) { - st->print("\n\nError accessing class data sharing archive." \ - " Mapped file inaccessible during execution, " \ - " possible disk/network problem."); - } - } -#endif - st->cr(); -} - - static void print_signal_handler(outputStream* st, int sig, char* buf, size_t buflen); diff --git a/hotspot/src/os/posix/vm/os_posix.cpp b/hotspot/src/os/posix/vm/os_posix.cpp index 8e442f3dfcd..029004337cd 100644 --- a/hotspot/src/os/posix/vm/os_posix.cpp +++ b/hotspot/src/os/posix/vm/os_posix.cpp @@ -981,50 +981,60 @@ static bool get_signal_code_description(const siginfo_t* si, enum_sigcode_desc_t return true; } -// A POSIX conform, platform-independend siginfo print routine. -// Short print out on one line. -void os::Posix::print_siginfo_brief(outputStream* os, const siginfo_t* si) { +void os::print_siginfo(outputStream* os, const void* si0) { + + const siginfo_t* const si = (const siginfo_t*) si0; + char buf[20]; - os->print("siginfo: "); + os->print("siginfo:"); if (!si) { - os->print(""); + os->print(" "); return; } - // See print_siginfo_full() for details. const int sig = si->si_signo; - os->print("si_signo: %d (%s)", sig, os::Posix::get_signal_name(sig, buf, sizeof(buf))); + os->print(" si_signo: %d (%s)", sig, os::Posix::get_signal_name(sig, buf, sizeof(buf))); enum_sigcode_desc_t ed; - if (get_signal_code_description(si, &ed)) { - os->print(", si_code: %d (%s)", si->si_code, ed.s_name); - } else { - os->print(", si_code: %d (unknown)", si->si_code); - } + get_signal_code_description(si, &ed); + os->print(", si_code: %d (%s)", si->si_code, ed.s_name); if (si->si_errno) { os->print(", si_errno: %d", si->si_errno); } - const int me = (int) ::getpid(); - const int pid = (int) si->si_pid; + // Output additional information depending on the signal code. + // Note: Many implementations lump si_addr, si_pid, si_uid etc. together as unions, + // so it depends on the context which member to use. For synchronous error signals, + // we print si_addr, unless the signal was sent by another process or thread, in + // which case we print out pid or tid of the sender. if (si->si_code == SI_USER || si->si_code == SI_QUEUE) { - if (IS_VALID_PID(pid) && pid != me) { - os->print(", sent from pid: %d (uid: %d)", pid, (int) si->si_uid); + const pid_t pid = si->si_pid; + os->print(", si_pid: %ld", (long) pid); + if (IS_VALID_PID(pid)) { + const pid_t me = getpid(); + if (me == pid) { + os->print(" (current process)"); + } + } else { + os->print(" (invalid)"); + } + os->print(", si_uid: %ld", (long) si->si_uid); + if (sig == SIGCHLD) { + os->print(", si_status: %d", si->si_status); } } else if (sig == SIGSEGV || sig == SIGBUS || sig == SIGILL || sig == SIGTRAP || sig == SIGFPE) { os->print(", si_addr: " PTR_FORMAT, p2i(si->si_addr)); #ifdef SIGPOLL } else if (sig == SIGPOLL) { - os->print(", si_band: " PTR64_FORMAT, (uint64_t)si->si_band); + os->print(", si_band: %ld", si->si_band); #endif - } else if (sig == SIGCHLD) { - os->print_cr(", si_pid: %d, si_uid: %d, si_status: %d", (int) si->si_pid, si->si_uid, si->si_status); } + } int os::Posix::unblock_thread_signal_mask(const sigset_t *set) { diff --git a/hotspot/src/os/posix/vm/os_posix.hpp b/hotspot/src/os/posix/vm/os_posix.hpp index c3d9967186c..be464ea8fa1 100644 --- a/hotspot/src/os/posix/vm/os_posix.hpp +++ b/hotspot/src/os/posix/vm/os_posix.hpp @@ -73,9 +73,6 @@ public: // Prints a one-line description of a combination of sigaction.sa_flags. static void print_sa_flags(outputStream* st, int flags); - // A POSIX conform, platform-independend siginfo print routine. - static void print_siginfo_brief(outputStream* os, const siginfo_t* si); - static address ucontext_get_pc(const ucontext_t* ctx); // Set PC into context. Needed for continuation after signal. static void ucontext_set_pc(ucontext_t* ctx, address pc); diff --git a/hotspot/src/os/posix/vm/vmError_posix.cpp b/hotspot/src/os/posix/vm/vmError_posix.cpp index 6fb04af4dd3..23cafc4aeeb 100644 --- a/hotspot/src/os/posix/vm/vmError_posix.cpp +++ b/hotspot/src/os/posix/vm/vmError_posix.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "memory/filemap.hpp" #include "runtime/arguments.hpp" #include "runtime/os.hpp" #include "runtime/thread.hpp" @@ -122,3 +123,22 @@ void VMError::reset_signal_handlers() { os::Posix::unblock_thread_signal_mask(&newset); } + +// Write a hint to the stream in case siginfo relates to a segv/bus error +// and the offending address points into CDS archive. +void VMError::check_failing_cds_access(outputStream* st, const void* siginfo) { + if (siginfo && UseSharedSpaces) { + const siginfo_t* const si = (siginfo_t*)siginfo; + if (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) { + const void* const fault_addr = si->si_addr; + if (fault_addr != NULL) { + FileMapInfo* const mapinfo = FileMapInfo::current_info(); + if (mapinfo->is_in_shared_space(fault_addr)) { + st->print("Error accessing class data sharing archive. " + "Mapped file inaccessible during execution, possible disk/network problem."); + } + } + } + } +} + diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 5b49ce9d95f..2191b9ea658 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -1906,23 +1906,6 @@ void os::print_memory_info(outputStream* st) { (void) check_addr0(st); } -void os::print_siginfo(outputStream* st, void* siginfo) { - const siginfo_t* si = (const siginfo_t*)siginfo; - - os::Posix::print_siginfo_brief(st, si); - - if (si && (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && - UseSharedSpaces) { - FileMapInfo* mapinfo = FileMapInfo::current_info(); - if (mapinfo->is_in_shared_space(si->si_addr)) { - st->print("\n\nError accessing class data sharing archive." \ - " Mapped file inaccessible during execution, " \ - " possible disk/network problem."); - } - } - st->cr(); -} - // Moved from whole group, because we need them here for diagnostic // prints. #define OLDMAXSIGNUM 32 diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index e35a2810f5d..24ea2e71321 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -1798,8 +1798,8 @@ void os::print_memory_info(outputStream* st) { st->cr(); } -void os::print_siginfo(outputStream *st, void *siginfo) { - EXCEPTION_RECORD* er = (EXCEPTION_RECORD*)siginfo; +void os::print_siginfo(outputStream *st, const void* siginfo) { + const EXCEPTION_RECORD* const er = (EXCEPTION_RECORD*)siginfo; st->print("siginfo:"); char tmp[64]; @@ -1819,15 +1819,6 @@ void os::print_siginfo(outputStream *st, void *siginfo) { er->ExceptionInformation[0]); } st->print(" " INTPTR_FORMAT, er->ExceptionInformation[1]); - - if (er->ExceptionCode == EXCEPTION_IN_PAGE_ERROR && UseSharedSpaces) { - FileMapInfo* mapinfo = FileMapInfo::current_info(); - if (mapinfo->is_in_shared_space((void*)er->ExceptionInformation[1])) { - st->print("\n\nError accessing class data sharing archive." \ - " Mapped file inaccessible during execution, " \ - " possible disk/network problem."); - } - } } else { int num = er->NumberParameters; if (num > 0) { diff --git a/hotspot/src/os/windows/vm/vmError_windows.cpp b/hotspot/src/os/windows/vm/vmError_windows.cpp index d80fe55fe3b..ea6821be344 100644 --- a/hotspot/src/os/windows/vm/vmError_windows.cpp +++ b/hotspot/src/os/windows/vm/vmError_windows.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "memory/filemap.hpp" #include "runtime/arguments.hpp" #include "runtime/os.hpp" #include "runtime/thread.hpp" @@ -46,3 +47,22 @@ LONG WINAPI crash_handler(struct _EXCEPTION_POINTERS* exceptionInfo) { void VMError::reset_signal_handlers() { SetUnhandledExceptionFilter(crash_handler); } + +// Write a hint to the stream in case siginfo relates to a segv/bus error +// and the offending address points into CDS archive. +void VMError::check_failing_cds_access(outputStream* st, const void* siginfo) { + if (siginfo && UseSharedSpaces) { + const EXCEPTION_RECORD* const er = (const EXCEPTION_RECORD*)siginfo; + if (er->ExceptionCode == EXCEPTION_IN_PAGE_ERROR && + er->NumberParameters >= 2) { + const void* const fault_addr = (const void*) er->ExceptionInformation[1]; + if (fault_addr != NULL) { + FileMapInfo* const mapinfo = FileMapInfo::current_info(); + if (mapinfo->is_in_shared_space(fault_addr)) { + st->print("Error accessing class data sharing archive. " + "Mapped file inaccessible during execution, possible disk/network problem."); + } + } + } + } +} diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index bebfaaa375a..3dda79cf0ce 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -606,7 +606,7 @@ class os: AllStatic { static void print_environment_variables(outputStream* st, const char** env_list); static void print_context(outputStream* st, const void* context); static void print_register_info(outputStream* st, const void* context); - static void print_siginfo(outputStream* st, void* siginfo); + static void print_siginfo(outputStream* st, const void* siginfo); static void print_signal_handlers(outputStream* st, char* buf, size_t buflen); static void print_date_and_time(outputStream* st, char* buf, size_t buflen); diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index c12e37526e5..23c3195db4d 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -597,6 +597,14 @@ void VMError::report(outputStream* st, bool _verbose) { st->cr(); } + STEP(245, "(CDS archive access warning)" ) + + // Print an explicit hint if we crashed on access to the CDS archive. + if (_verbose && _siginfo) { + check_failing_cds_access(st, _siginfo); + st->cr(); + } + STEP(250, "(printing register info)") // decode register contents if possible diff --git a/hotspot/src/share/vm/utilities/vmError.hpp b/hotspot/src/share/vm/utilities/vmError.hpp index e7cce398fd3..62ce62e3e30 100644 --- a/hotspot/src/share/vm/utilities/vmError.hpp +++ b/hotspot/src/share/vm/utilities/vmError.hpp @@ -92,6 +92,10 @@ class VMError : public AllStatic { return (id != OOM_MALLOC_ERROR) && (id != OOM_MMAP_ERROR); } + // Write a hint to the stream in case siginfo relates to a segv/bus error + // and the offending address points into CDS store. + static void check_failing_cds_access(outputStream* st, const void* siginfo); + static void report_and_die(Thread* thread, unsigned int sig, address pc, void* siginfo, void* context, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(6, 7); static void report_and_die(const char* message, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(2, 3); From ae65f88b0f3f54dd9bed0bd533f742d64d647ef3 Mon Sep 17 00:00:00 2001 From: Mikael Gerdin Date: Wed, 9 Dec 2015 16:05:24 +0100 Subject: [PATCH 092/228] 8144714: Add extension point to G1 evacuation closures Reviewed-by: ehelin, jmasa --- .../src/share/vm/gc/g1/g1CollectedHeap.hpp | 3 +++ hotspot/src/share/vm/gc/g1/g1InCSetState.hpp | 19 +++++++++++++++---- hotspot/src/share/vm/gc/g1/g1OopClosures.hpp | 2 +- .../share/vm/gc/g1/g1OopClosures.inline.hpp | 15 ++++++++++++--- .../share/vm/gc/g1/g1ParScanThreadState.hpp | 1 + .../vm/gc/g1/g1ParScanThreadState.inline.hpp | 4 ++-- .../vm/gc/g1/g1ParScanThreadState_ext.cpp | 7 +++++++ .../src/share/vm/gc/g1/g1SharedClosures.hpp | 14 +++++++------- 8 files changed, 48 insertions(+), 17 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp index cfedf798e2d..eb1292876d6 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp @@ -573,6 +573,9 @@ public: void register_old_region_with_cset(HeapRegion* r) { _in_cset_fast_test.set_in_old(r->hrm_index()); } + inline void register_ext_region_with_cset(HeapRegion* r) { + _in_cset_fast_test.set_ext(r->hrm_index()); + } void clear_in_cset(const HeapRegion* hr) { _in_cset_fast_test.clear(hr); } diff --git a/hotspot/src/share/vm/gc/g1/g1InCSetState.hpp b/hotspot/src/share/vm/gc/g1/g1InCSetState.hpp index 6490fea9ad3..8343a9c3f4d 100644 --- a/hotspot/src/share/vm/gc/g1/g1InCSetState.hpp +++ b/hotspot/src/share/vm/gc/g1/g1InCSetState.hpp @@ -53,8 +53,12 @@ struct InCSetState { // frequency of the checks. // The most common check is whether the region is in the collection set or not, // this encoding allows us to use an > 0 check. - // The other values are simply encoded in increasing generation order, which - // makes getting the next generation fast by a simple increment. + // The positive values are encoded in increasing generation order, which + // makes getting the next generation fast by a simple increment. They are also + // used to index into arrays. + // The negative values are used for objects requiring various special cases, + // for example eager reclamation of humongous objects. + Ext = -2, // Extension point Humongous = -1, // The region is humongous NotInCSet = 0, // The region is not in the collection set. Young = 1, // The region is in the collection set and a young region. @@ -76,10 +80,11 @@ struct InCSetState { bool is_humongous() const { return _value == Humongous; } bool is_young() const { return _value == Young; } bool is_old() const { return _value == Old; } + bool is_ext() const { return _value == Ext; } #ifdef ASSERT - bool is_default() const { return !is_in_cset_or_humongous(); } - bool is_valid() const { return (_value >= Humongous) && (_value < Num); } + bool is_default() const { return _value == NotInCSet; } + bool is_valid() const { return (_value >= Ext) && (_value < Num); } bool is_valid_gen() const { return (_value >= Young && _value <= Old); } #endif }; @@ -105,6 +110,12 @@ class G1InCSetStateFastTestBiasedMappedArray : public G1BiasedMappedArray +template class G1ParCopyClosure : public G1ParCopyHelper { public: G1ParCopyClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp index 82a997eca79..efad4ae2caa 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp @@ -90,6 +90,8 @@ inline void G1ParScanClosure::do_oop_nv(T* p) { } else { if (state.is_humongous()) { _g1->set_humongous_is_live(obj); + } else if (state.is_ext()) { + _par_scan_state->do_oop_ext(p); } _par_scan_state->update_rs(_from, p, obj); } @@ -102,12 +104,15 @@ inline void G1ParPushHeapRSClosure::do_oop_nv(T* p) { if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); - if (_g1->is_in_cset_or_humongous(obj)) { + const InCSetState state = _g1->in_cset_state(obj); + if (state.is_in_cset_or_humongous()) { Prefetch::write(obj->mark_addr(), 0); Prefetch::read(obj->mark_addr(), (HeapWordSize*2)); // Place on the references queue _par_scan_state->push_on_queue(p); + } else if (state.is_ext()) { + _par_scan_state->do_oop_ext(p); } else { assert(!_g1->obj_in_cs(obj), "checking"); } @@ -249,9 +254,9 @@ void G1ParCopyHelper::mark_forwarded_object(oop from_obj, oop to_obj) { _cm->grayRoot(to_obj, (size_t) from_obj->size(), _worker_id); } -template +template template -void G1ParCopyClosure::do_oop_nv(T* p) { +void G1ParCopyClosure::do_oop_nv(T* p) { T heap_oop = oopDesc::load_heap_oop(p); if (oopDesc::is_null(heap_oop)) { @@ -286,6 +291,10 @@ void G1ParCopyClosure::do_oop_nv(T* p) { if (state.is_humongous()) { _g1->set_humongous_is_live(obj); } + + if (use_ext && state.is_ext()) { + _par_scan_state->do_oop_ext(p); + } // The object is not in collection set. If we're a root scanning // closure during an initial mark pause then attempt to mark the object. if (do_mark_object == G1MarkFromRoot) { diff --git a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp index 0b86e4c9c71..9f3ace0705b 100644 --- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp +++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp @@ -96,6 +96,7 @@ class G1ParScanThreadState : public CHeapObj { bool verify_task(StarTask ref) const; #endif // ASSERT + template void do_oop_ext(T* ref); template void push_on_queue(T* ref); template void update_rs(HeapRegion* from, T* p, oop o) { diff --git a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp index 86774c4723e..23d9a1bd462 100644 --- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp @@ -50,8 +50,8 @@ template void G1ParScanThreadState::do_oop_evac(T* p, HeapRegion* from } else if (in_cset_state.is_humongous()) { _g1h->set_humongous_is_live(obj); } else { - assert(!in_cset_state.is_in_cset_or_humongous(), - "In_cset_state must be NotInCSet here, but is " CSETSTATE_FORMAT, in_cset_state.value()); + assert(in_cset_state.is_default() || in_cset_state.is_ext(), + "In_cset_state must be NotInCSet or Ext here, but is " CSETSTATE_FORMAT, in_cset_state.value()); } assert(obj != NULL, "Must be"); diff --git a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState_ext.cpp b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState_ext.cpp index 0e91d3ae448..9183f0d5a92 100644 --- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState_ext.cpp +++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState_ext.cpp @@ -29,3 +29,10 @@ G1ParScanThreadState* G1ParScanThreadStateSet::new_par_scan_state(uint worker_id, size_t young_cset_length) { return new G1ParScanThreadState(_g1h, worker_id, young_cset_length); } + +template +void G1ParScanThreadState::do_oop_ext(T* ref) { +} + +template void G1ParScanThreadState::do_oop_ext(oop* ref); +template void G1ParScanThreadState::do_oop_ext(narrowOop* ref); diff --git a/hotspot/src/share/vm/gc/g1/g1SharedClosures.hpp b/hotspot/src/share/vm/gc/g1/g1SharedClosures.hpp index 85ee225227c..2c9352394ae 100644 --- a/hotspot/src/share/vm/gc/g1/g1SharedClosures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1SharedClosures.hpp @@ -31,15 +31,15 @@ class G1CollectedHeap; class G1ParScanThreadState; // Simple holder object for a complete set of closures used by the G1 evacuation code. -template +template class G1SharedClosures VALUE_OBJ_CLASS_SPEC { public: - G1ParCopyClosure _oops; - G1ParCopyClosure _oop_in_klass; - G1KlassScanClosure _klass_in_cld_closure; - CLDToKlassAndOopClosure _clds; - G1CodeBlobClosure _codeblobs; - BufferingOopClosure _buffered_oops; + G1ParCopyClosure _oops; + G1ParCopyClosure _oop_in_klass; + G1KlassScanClosure _klass_in_cld_closure; + CLDToKlassAndOopClosure _clds; + G1CodeBlobClosure _codeblobs; + BufferingOopClosure _buffered_oops; G1SharedClosures(G1CollectedHeap* g1h, G1ParScanThreadState* pss, bool process_only_dirty_klasses, bool must_claim_cld) : _oops(g1h, pss), From a39fa54251bcb6b5284a5c7becc09ad8f71f743f Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Thu, 10 Dec 2015 09:42:22 -0800 Subject: [PATCH 093/228] 8015396: double a%b returns NaN for some (a,b) (|a| < inf, |b|>0) Reviewed-by: coleenp, gtriantafill --- .../src/os/windows/vm/sharedRuntimeRem.cpp | 162 ++++++++++++++++++ .../src/share/vm/runtime/sharedRuntime.cpp | 8 +- .../src/share/vm/runtime/sharedRuntime.hpp | 6 + .../test/compiler/floatingpoint/ModNaN.java | 1 - 4 files changed, 174 insertions(+), 3 deletions(-) create mode 100644 hotspot/src/os/windows/vm/sharedRuntimeRem.cpp diff --git a/hotspot/src/os/windows/vm/sharedRuntimeRem.cpp b/hotspot/src/os/windows/vm/sharedRuntimeRem.cpp new file mode 100644 index 00000000000..23b2619882d --- /dev/null +++ b/hotspot/src/os/windows/vm/sharedRuntimeRem.cpp @@ -0,0 +1,162 @@ +/* +* 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. +* +*/ + +#include "precompiled.hpp" + +#ifdef _WIN64 +// These are copied defines from fdlibm.h, this allows us to keep the code +// the same as in the JDK, for easier maintenance. + +#define __HI(x) *(1+(int*)&x) +#define __LO(x) *(int*)&x + +// This code is a copy of __ieee754_fmod() from the JDK's libfdlibm and is +// used as a workaround for issues with the Windows x64 CRT implementation +// of fmod. Microsoft has acknowledged that this is an issue in Visual Studio +// 2012 and forward, but has not provided a time frame for a fix other than that +// it'll not be fixed in Visual Studio 2013 or 2015. + +static const double one = 1.0, Zero[] = { 0.0, -0.0, }; + +double SharedRuntime::fmod_winx64(double x, double y) +{ + int n, hx, hy, hz, ix, iy, sx, i; + unsigned lx, ly, lz; + + hx = __HI(x); /* high word of x */ + lx = __LO(x); /* low word of x */ + hy = __HI(y); /* high word of y */ + ly = __LO(y); /* low word of y */ + sx = hx & 0x80000000; /* sign of x */ + hx ^= sx; /* |x| */ + hy &= 0x7fffffff; /* |y| */ + +#pragma warning( disable : 4146 ) + /* purge off exception values */ + if ((hy | ly) == 0 || (hx >= 0x7ff00000) || /* y=0,or x not finite */ + ((hy | ((ly | -ly) >> 31))>0x7ff00000)) /* or y is NaN */ +#pragma warning( default : 4146 ) + return (x*y) / (x*y); + if (hx <= hy) { + if ((hx> 31]; /* |x|=|y| return x*0*/ + } + + /* determine ix = ilogb(x) */ + if (hx<0x00100000) { /* subnormal x */ + if (hx == 0) { + for (ix = -1043, i = lx; i>0; i <<= 1) ix -= 1; + } + else { + for (ix = -1022, i = (hx << 11); i>0; i <<= 1) ix -= 1; + } + } + else ix = (hx >> 20) - 1023; + + /* determine iy = ilogb(y) */ + if (hy<0x00100000) { /* subnormal y */ + if (hy == 0) { + for (iy = -1043, i = ly; i>0; i <<= 1) iy -= 1; + } + else { + for (iy = -1022, i = (hy << 11); i>0; i <<= 1) iy -= 1; + } + } + else iy = (hy >> 20) - 1023; + + /* set up {hx,lx}, {hy,ly} and align y to x */ + if (ix >= -1022) + hx = 0x00100000 | (0x000fffff & hx); + else { /* subnormal x, shift x to normal */ + n = -1022 - ix; + if (n <= 31) { + hx = (hx << n) | (lx >> (32 - n)); + lx <<= n; + } + else { + hx = lx << (n - 32); + lx = 0; + } + } + if (iy >= -1022) + hy = 0x00100000 | (0x000fffff & hy); + else { /* subnormal y, shift y to normal */ + n = -1022 - iy; + if (n <= 31) { + hy = (hy << n) | (ly >> (32 - n)); + ly <<= n; + } + else { + hy = ly << (n - 32); + ly = 0; + } + } + + /* fix point fmod */ + n = ix - iy; + while (n--) { + hz = hx - hy; lz = lx - ly; if (lx> 31); lx = lx + lx; } + else { + if ((hz | lz) == 0) /* return sign(x)*0 */ + return Zero[(unsigned)sx >> 31]; + hx = hz + hz + (lz >> 31); lx = lz + lz; + } + } + hz = hx - hy; lz = lx - ly; if (lx= 0) { hx = hz; lx = lz; } + + /* convert back to floating value and restore the sign */ + if ((hx | lx) == 0) /* return sign(x)*0 */ + return Zero[(unsigned)sx >> 31]; + while (hx<0x00100000) { /* normalize x */ + hx = hx + hx + (lx >> 31); lx = lx + lx; + iy -= 1; + } + if (iy >= -1022) { /* normalize output */ + hx = ((hx - 0x00100000) | ((iy + 1023) << 20)); + __HI(x) = hx | sx; + __LO(x) = lx; + } + else { /* subnormal output */ + n = -1022 - iy; + if (n <= 20) { + lx = (lx >> n) | ((unsigned)hx << (32 - n)); + hx >>= n; + } + else if (n <= 31) { + lx = (hx << (32 - n)) | (lx >> n); hx = sx; + } + else { + lx = hx >> (n - 32); hx = sx; + } + __HI(x) = hx | sx; + __LO(x) = lx; + x *= one; /* create necessary signal */ + } + return x; /* exact output */ +} + +#endif diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index 68440ee89cf..e1d1392131d 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -254,8 +254,10 @@ JRT_LEAF(jfloat, SharedRuntime::frem(jfloat x, jfloat y)) ((ybits.i & float_sign_mask) == float_infinity) ) { return x; } -#endif + return ((jfloat)fmod_winx64((double)x, (double)y)); +#else return ((jfloat)fmod((double)x,(double)y)); +#endif JRT_END @@ -269,8 +271,10 @@ JRT_LEAF(jdouble, SharedRuntime::drem(jdouble x, jdouble y)) ((ybits.l & double_sign_mask) == double_infinity) ) { return x; } -#endif + return ((jdouble)fmod_winx64((double)x, (double)y)); +#else return ((jdouble)fmod((double)x,(double)y)); +#endif JRT_END #ifdef __SOFTFP__ diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.hpp b/hotspot/src/share/vm/runtime/sharedRuntime.hpp index cfb63f37dee..d41145435bb 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp @@ -100,6 +100,12 @@ class SharedRuntime: AllStatic { static jfloat frem(jfloat x, jfloat y); static jdouble drem(jdouble x, jdouble y); + +#ifdef _WIN64 + // Workaround for fmod issue in the Windows x64 CRT + static double fmod_winx64(double x, double y); +#endif + #ifdef __SOFTFP__ static jfloat fadd(jfloat x, jfloat y); static jfloat fsub(jfloat x, jfloat y); diff --git a/hotspot/test/compiler/floatingpoint/ModNaN.java b/hotspot/test/compiler/floatingpoint/ModNaN.java index 4cd2f4aefde..32313dd2370 100644 --- a/hotspot/test/compiler/floatingpoint/ModNaN.java +++ b/hotspot/test/compiler/floatingpoint/ModNaN.java @@ -25,7 +25,6 @@ * @test * @bug 8015396 * @summary double a%b returns NaN for some (a,b) (|a| < inf, |b|>0) (on Core i7 980X) - * @ignore 8015396 * @run main ModNaN */ public class ModNaN { From c7396ec06d76a0489552d8cfade9acf3462fd8d0 Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Wed, 9 Dec 2015 11:00:38 -0800 Subject: [PATCH 094/228] 8144921: Remove JDK6_OR_EARLIER code from os_windows Reviewed-by: dholmes, mseledtsov, gtriantafill --- hotspot/src/os/windows/vm/os_windows.cpp | 257 ----------------------- hotspot/src/os/windows/vm/os_windows.hpp | 45 ---- 2 files changed, 302 deletions(-) diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index a1b18f68966..b7083b1f0d4 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -5529,8 +5529,6 @@ bool os::start_debugging(char *buf, int buflen) { return yes; } -#ifndef JDK6_OR_EARLIER - void os::Kernel32Dll::initialize() { initializeCommon(); } @@ -5705,261 +5703,6 @@ char* os::build_agent_function_name(const char *sym_name, const char *lib_name, return agent_entry_name; } -#else -// Kernel32 API -typedef BOOL (WINAPI* SwitchToThread_Fn)(void); -typedef HANDLE (WINAPI* CreateToolhelp32Snapshot_Fn)(DWORD, DWORD); -typedef BOOL (WINAPI* Module32First_Fn)(HANDLE, LPMODULEENTRY32); -typedef BOOL (WINAPI* Module32Next_Fn)(HANDLE, LPMODULEENTRY32); -typedef void (WINAPI* GetNativeSystemInfo_Fn)(LPSYSTEM_INFO); - -SwitchToThread_Fn os::Kernel32Dll::_SwitchToThread = NULL; -CreateToolhelp32Snapshot_Fn os::Kernel32Dll::_CreateToolhelp32Snapshot = NULL; -Module32First_Fn os::Kernel32Dll::_Module32First = NULL; -Module32Next_Fn os::Kernel32Dll::_Module32Next = NULL; -GetNativeSystemInfo_Fn os::Kernel32Dll::_GetNativeSystemInfo = NULL; - -void os::Kernel32Dll::initialize() { - if (!initialized) { - HMODULE handle = ::GetModuleHandle("Kernel32.dll"); - assert(handle != NULL, "Just check"); - - _SwitchToThread = (SwitchToThread_Fn)::GetProcAddress(handle, "SwitchToThread"); - _CreateToolhelp32Snapshot = (CreateToolhelp32Snapshot_Fn) - ::GetProcAddress(handle, "CreateToolhelp32Snapshot"); - _Module32First = (Module32First_Fn)::GetProcAddress(handle, "Module32First"); - _Module32Next = (Module32Next_Fn)::GetProcAddress(handle, "Module32Next"); - _GetNativeSystemInfo = (GetNativeSystemInfo_Fn)::GetProcAddress(handle, "GetNativeSystemInfo"); - initializeCommon(); // resolve the functions that always need resolving - - initialized = TRUE; - } -} - -BOOL os::Kernel32Dll::SwitchToThread() { - assert(initialized && _SwitchToThread != NULL, - "SwitchToThreadAvailable() not yet called"); - return _SwitchToThread(); -} - - -BOOL os::Kernel32Dll::SwitchToThreadAvailable() { - if (!initialized) { - initialize(); - } - return _SwitchToThread != NULL; -} - -// Help tools -BOOL os::Kernel32Dll::HelpToolsAvailable() { - if (!initialized) { - initialize(); - } - return _CreateToolhelp32Snapshot != NULL && - _Module32First != NULL && - _Module32Next != NULL; -} - -HANDLE os::Kernel32Dll::CreateToolhelp32Snapshot(DWORD dwFlags, - DWORD th32ProcessId) { - assert(initialized && _CreateToolhelp32Snapshot != NULL, - "HelpToolsAvailable() not yet called"); - - return _CreateToolhelp32Snapshot(dwFlags, th32ProcessId); -} - -BOOL os::Kernel32Dll::Module32First(HANDLE hSnapshot,LPMODULEENTRY32 lpme) { - assert(initialized && _Module32First != NULL, - "HelpToolsAvailable() not yet called"); - - return _Module32First(hSnapshot, lpme); -} - -inline BOOL os::Kernel32Dll::Module32Next(HANDLE hSnapshot, - LPMODULEENTRY32 lpme) { - assert(initialized && _Module32Next != NULL, - "HelpToolsAvailable() not yet called"); - - return _Module32Next(hSnapshot, lpme); -} - - -BOOL os::Kernel32Dll::GetNativeSystemInfoAvailable() { - if (!initialized) { - initialize(); - } - return _GetNativeSystemInfo != NULL; -} - -void os::Kernel32Dll::GetNativeSystemInfo(LPSYSTEM_INFO lpSystemInfo) { - assert(initialized && _GetNativeSystemInfo != NULL, - "GetNativeSystemInfoAvailable() not yet called"); - - _GetNativeSystemInfo(lpSystemInfo); -} - -// PSAPI API - - -typedef BOOL (WINAPI *EnumProcessModules_Fn)(HANDLE, HMODULE *, DWORD, LPDWORD); -typedef BOOL (WINAPI *GetModuleFileNameEx_Fn)(HANDLE, HMODULE, LPTSTR, DWORD); -typedef BOOL (WINAPI *GetModuleInformation_Fn)(HANDLE, HMODULE, LPMODULEINFO, DWORD); - -EnumProcessModules_Fn os::PSApiDll::_EnumProcessModules = NULL; -GetModuleFileNameEx_Fn os::PSApiDll::_GetModuleFileNameEx = NULL; -GetModuleInformation_Fn os::PSApiDll::_GetModuleInformation = NULL; -BOOL os::PSApiDll::initialized = FALSE; - -void os::PSApiDll::initialize() { - if (!initialized) { - HMODULE handle = os::win32::load_Windows_dll("PSAPI.DLL", NULL, 0); - if (handle != NULL) { - _EnumProcessModules = (EnumProcessModules_Fn)::GetProcAddress(handle, - "EnumProcessModules"); - _GetModuleFileNameEx = (GetModuleFileNameEx_Fn)::GetProcAddress(handle, - "GetModuleFileNameExA"); - _GetModuleInformation = (GetModuleInformation_Fn)::GetProcAddress(handle, - "GetModuleInformation"); - } - initialized = TRUE; - } -} - - - -BOOL os::PSApiDll::EnumProcessModules(HANDLE hProcess, HMODULE *lpModule, - DWORD cb, LPDWORD lpcbNeeded) { - assert(initialized && _EnumProcessModules != NULL, - "PSApiAvailable() not yet called"); - return _EnumProcessModules(hProcess, lpModule, cb, lpcbNeeded); -} - -DWORD os::PSApiDll::GetModuleFileNameEx(HANDLE hProcess, HMODULE hModule, - LPTSTR lpFilename, DWORD nSize) { - assert(initialized && _GetModuleFileNameEx != NULL, - "PSApiAvailable() not yet called"); - return _GetModuleFileNameEx(hProcess, hModule, lpFilename, nSize); -} - -BOOL os::PSApiDll::GetModuleInformation(HANDLE hProcess, HMODULE hModule, - LPMODULEINFO lpmodinfo, DWORD cb) { - assert(initialized && _GetModuleInformation != NULL, - "PSApiAvailable() not yet called"); - return _GetModuleInformation(hProcess, hModule, lpmodinfo, cb); -} - -BOOL os::PSApiDll::PSApiAvailable() { - if (!initialized) { - initialize(); - } - return _EnumProcessModules != NULL && - _GetModuleFileNameEx != NULL && - _GetModuleInformation != NULL; -} - - -// WinSock2 API -typedef int (PASCAL FAR* WSAStartup_Fn)(WORD, LPWSADATA); -typedef struct hostent *(PASCAL FAR *gethostbyname_Fn)(...); - -WSAStartup_Fn os::WinSock2Dll::_WSAStartup = NULL; -gethostbyname_Fn os::WinSock2Dll::_gethostbyname = NULL; -BOOL os::WinSock2Dll::initialized = FALSE; - -void os::WinSock2Dll::initialize() { - if (!initialized) { - HMODULE handle = os::win32::load_Windows_dll("ws2_32.dll", NULL, 0); - if (handle != NULL) { - _WSAStartup = (WSAStartup_Fn)::GetProcAddress(handle, "WSAStartup"); - _gethostbyname = (gethostbyname_Fn)::GetProcAddress(handle, "gethostbyname"); - } - initialized = TRUE; - } -} - - -BOOL os::WinSock2Dll::WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData) { - assert(initialized && _WSAStartup != NULL, - "WinSock2Available() not yet called"); - return _WSAStartup(wVersionRequested, lpWSAData); -} - -struct hostent* os::WinSock2Dll::gethostbyname(const char *name) { - assert(initialized && _gethostbyname != NULL, - "WinSock2Available() not yet called"); - return _gethostbyname(name); -} - -BOOL os::WinSock2Dll::WinSock2Available() { - if (!initialized) { - initialize(); - } - return _WSAStartup != NULL && - _gethostbyname != NULL; -} - -typedef BOOL (WINAPI *AdjustTokenPrivileges_Fn)(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD); -typedef BOOL (WINAPI *OpenProcessToken_Fn)(HANDLE, DWORD, PHANDLE); -typedef BOOL (WINAPI *LookupPrivilegeValue_Fn)(LPCTSTR, LPCTSTR, PLUID); - -AdjustTokenPrivileges_Fn os::Advapi32Dll::_AdjustTokenPrivileges = NULL; -OpenProcessToken_Fn os::Advapi32Dll::_OpenProcessToken = NULL; -LookupPrivilegeValue_Fn os::Advapi32Dll::_LookupPrivilegeValue = NULL; -BOOL os::Advapi32Dll::initialized = FALSE; - -void os::Advapi32Dll::initialize() { - if (!initialized) { - HMODULE handle = os::win32::load_Windows_dll("advapi32.dll", NULL, 0); - if (handle != NULL) { - _AdjustTokenPrivileges = (AdjustTokenPrivileges_Fn)::GetProcAddress(handle, - "AdjustTokenPrivileges"); - _OpenProcessToken = (OpenProcessToken_Fn)::GetProcAddress(handle, - "OpenProcessToken"); - _LookupPrivilegeValue = (LookupPrivilegeValue_Fn)::GetProcAddress(handle, - "LookupPrivilegeValueA"); - } - initialized = TRUE; - } -} - -BOOL os::Advapi32Dll::AdjustTokenPrivileges(HANDLE TokenHandle, - BOOL DisableAllPrivileges, - PTOKEN_PRIVILEGES NewState, - DWORD BufferLength, - PTOKEN_PRIVILEGES PreviousState, - PDWORD ReturnLength) { - assert(initialized && _AdjustTokenPrivileges != NULL, - "AdvapiAvailable() not yet called"); - return _AdjustTokenPrivileges(TokenHandle, DisableAllPrivileges, NewState, - BufferLength, PreviousState, ReturnLength); -} - -BOOL os::Advapi32Dll::OpenProcessToken(HANDLE ProcessHandle, - DWORD DesiredAccess, - PHANDLE TokenHandle) { - assert(initialized && _OpenProcessToken != NULL, - "AdvapiAvailable() not yet called"); - return _OpenProcessToken(ProcessHandle, DesiredAccess, TokenHandle); -} - -BOOL os::Advapi32Dll::LookupPrivilegeValue(LPCTSTR lpSystemName, - LPCTSTR lpName, PLUID lpLuid) { - assert(initialized && _LookupPrivilegeValue != NULL, - "AdvapiAvailable() not yet called"); - return _LookupPrivilegeValue(lpSystemName, lpName, lpLuid); -} - -BOOL os::Advapi32Dll::AdvapiAvailable() { - if (!initialized) { - initialize(); - } - return _AdjustTokenPrivileges != NULL && - _OpenProcessToken != NULL && - _LookupPrivilegeValue != NULL; -} - -#endif - #ifndef PRODUCT // test the code path in reserve_memory_special() that tries to allocate memory in a single diff --git a/hotspot/src/os/windows/vm/os_windows.hpp b/hotspot/src/os/windows/vm/os_windows.hpp index 19de558ce85..dd3911c48a7 100644 --- a/hotspot/src/os/windows/vm/os_windows.hpp +++ b/hotspot/src/os/windows/vm/os_windows.hpp @@ -183,26 +183,11 @@ class PlatformParker : public CHeapObj { } ; -// JDK7 requires VS2010 -#if _MSC_VER < 1600 -#define JDK6_OR_EARLIER 1 -#endif - - - class WinSock2Dll: AllStatic { public: static BOOL WSAStartup(WORD, LPWSADATA); static struct hostent* gethostbyname(const char *name); static BOOL WinSock2Available(); -#ifdef JDK6_OR_EARLIER -private: - static int (PASCAL FAR* _WSAStartup)(WORD, LPWSADATA); - static struct hostent *(PASCAL FAR *_gethostbyname)(...); - static BOOL initialized; - - static void initialize(); -#endif }; class Kernel32Dll: AllStatic { @@ -244,16 +229,6 @@ private: static void initialize(); static void initializeCommon(); - -#ifdef JDK6_OR_EARLIER -private: - static BOOL (WINAPI *_SwitchToThread)(void); - static HANDLE (WINAPI* _CreateToolhelp32Snapshot)(DWORD,DWORD); - static BOOL (WINAPI* _Module32First)(HANDLE,LPMODULEENTRY32); - static BOOL (WINAPI* _Module32Next)(HANDLE,LPMODULEENTRY32); - static void (WINAPI *_GetNativeSystemInfo)(LPSYSTEM_INFO); -#endif - }; class Advapi32Dll: AllStatic { @@ -263,16 +238,6 @@ public: static BOOL LookupPrivilegeValue(LPCTSTR, LPCTSTR, PLUID); static BOOL AdvapiAvailable(); - -#ifdef JDK6_OR_EARLIER -private: - static BOOL (WINAPI *_AdjustTokenPrivileges)(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD); - static BOOL (WINAPI *_OpenProcessToken)(HANDLE, DWORD, PHANDLE); - static BOOL (WINAPI *_LookupPrivilegeValue)(LPCTSTR, LPCTSTR, PLUID); - static BOOL initialized; - - static void initialize(); -#endif }; class PSApiDll: AllStatic { @@ -282,16 +247,6 @@ public: static BOOL GetModuleInformation(HANDLE, HMODULE, LPMODULEINFO, DWORD); static BOOL PSApiAvailable(); - -#ifdef JDK6_OR_EARLIER -private: - static BOOL (WINAPI *_EnumProcessModules)(HANDLE, HMODULE *, DWORD, LPDWORD); - static BOOL (WINAPI *_GetModuleFileNameEx)(HANDLE, HMODULE, LPTSTR, DWORD);; - static BOOL (WINAPI *_GetModuleInformation)(HANDLE, HMODULE, LPMODULEINFO, DWORD); - static BOOL initialized; - - static void initialize(); -#endif }; #endif // OS_WINDOWS_VM_OS_WINDOWS_HPP From 1f55a9122c23404171f40294fc30fc2f24518491 Mon Sep 17 00:00:00 2001 From: David Lindholm Date: Thu, 10 Dec 2015 08:50:36 +0100 Subject: [PATCH 095/228] 8145073: Filename and linenumber are not printed for asserts any more Reviewed-by: dholmes, stuefe --- hotspot/src/os/posix/vm/os_posix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/os/posix/vm/os_posix.cpp b/hotspot/src/os/posix/vm/os_posix.cpp index 55de3ebc259..dd4f0f3486d 100644 --- a/hotspot/src/os/posix/vm/os_posix.cpp +++ b/hotspot/src/os/posix/vm/os_posix.cpp @@ -736,12 +736,12 @@ bool os::Posix::is_valid_signal(int sig) { } // Returns: -// "invalid ()" for an invalid signal number +// NULL for an invalid signal number // "SIG" for a valid but unknown signal number // signal name otherwise. const char* os::exception_name(int sig, char* buf, size_t size) { if (!os::Posix::is_valid_signal(sig)) { - jio_snprintf(buf, size, "invalid (%d)", sig); + return NULL; } const char* const name = os::Posix::get_signal_name(sig, buf, size); if (strcmp(name, "UNKNOWN") == 0) { From d7bb6e9a9719f499c154bfa71b9947e6397519e7 Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Thu, 10 Dec 2015 12:05:53 +0300 Subject: [PATCH 096/228] 8139484: [Findbugs] new sun.jvm.hotspot.SAGetopt(String[]) may expose internal representation Clone array instead of just assign it Reviewed-by: dholmes --- hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java index bae1d3dcc28..e3a0793abad 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java @@ -37,7 +37,7 @@ public class SAGetopt { private boolean _optreset; // special handling of first call public SAGetopt(String[] args) { - _argv = args; + _argv = args.clone(); _optind = 0; _optopt = 1; _optarg = null; From 730f05c91c2ff7b43428a87b581d25343b58a58a Mon Sep 17 00:00:00 2001 From: Vadim Pakhnushev Date: Thu, 10 Dec 2015 12:13:12 +0300 Subject: [PATCH 097/228] 8143002: [Parfait] JNI exception pending in fontpath.c:1300 Reviewed-by: prr, serb --- .../unix/native/common/awt/fontpath.c | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/jdk/src/java.desktop/unix/native/common/awt/fontpath.c b/jdk/src/java.desktop/unix/native/common/awt/fontpath.c index 6355e273a58..c0d99e5eb98 100644 --- a/jdk/src/java.desktop/unix/native/common/awt/fontpath.c +++ b/jdk/src/java.desktop/unix/native/common/awt/fontpath.c @@ -1156,8 +1156,8 @@ Java_sun_font_FontConfigManager_getFontConfig continue; } pattern = (*FcNameParse)((FcChar8 *)fcName); + (*env)->ReleaseStringUTFChars(env, fcNameStr, (const char*)fcName); if (pattern == NULL) { - (*env)->ReleaseStringUTFChars(env, fcNameStr, (const char*)fcName); closeFontConfig(libfontconfig, JNI_FALSE); return; } @@ -1175,7 +1175,6 @@ Java_sun_font_FontConfigManager_getFontConfig fontset = (*FcFontSort)(NULL, pattern, FcTrue, NULL, &result); if (fontset == NULL) { (*FcPatternDestroy)(pattern); - (*env)->ReleaseStringUTFChars(env, fcNameStr, (const char*)fcName); closeFontConfig(libfontconfig, JNI_FALSE); return; } @@ -1207,7 +1206,6 @@ Java_sun_font_FontConfigManager_getFontConfig } (*FcPatternDestroy)(pattern); (*FcFontSetDestroy)(fontset); - (*env)->ReleaseStringUTFChars(env, fcNameStr, (const char*)fcName); closeFontConfig(libfontconfig, JNI_FALSE); return; } @@ -1249,8 +1247,6 @@ Java_sun_font_FontConfigManager_getFontConfig free(file); (*FcPatternDestroy)(pattern); (*FcFontSetDestroy)(fontset); - (*env)->ReleaseStringUTFChars(env, - fcNameStr, (const char*)fcName); closeFontConfig(libfontconfig, JNI_FALSE); return; } @@ -1298,6 +1294,16 @@ Java_sun_font_FontConfigManager_getFontConfig if (includeFallbacks) { fcFontArr = (*env)->NewObjectArray(env, fontCount, fcFontClass, NULL); + if (IS_NULL(fcFontArr)) { + free(family); + free(fullname); + free(styleStr); + free(file); + (*FcPatternDestroy)(pattern); + (*FcFontSetDestroy)(fontset); + closeFontConfig(libfontconfig, JNI_FALSE); + return; + } (*env)->SetObjectField(env,fcCompFontObj, fcAllFontsID, fcFontArr); } fn=0; @@ -1306,18 +1312,23 @@ Java_sun_font_FontConfigManager_getFontConfig if (family[j] != NULL) { jobject fcFont = (*env)->NewObject(env, fcFontClass, fcFontCons); + if (IS_NULL(fcFont)) break; jstr = (*env)->NewStringUTF(env, (const char*)family[j]); + if (IS_NULL(jstr)) break; (*env)->SetObjectField(env, fcFont, familyNameID, jstr); if (file[j] != NULL) { jstr = (*env)->NewStringUTF(env, (const char*)file[j]); + if (IS_NULL(jstr)) break; (*env)->SetObjectField(env, fcFont, fontFileID, jstr); } if (styleStr[j] != NULL) { jstr = (*env)->NewStringUTF(env, (const char*)styleStr[j]); + if (IS_NULL(jstr)) break; (*env)->SetObjectField(env, fcFont, styleNameID, jstr); } if (fullname[j] != NULL) { jstr = (*env)->NewStringUTF(env, (const char*)fullname[j]); + if (IS_NULL(jstr)) break; (*env)->SetObjectField(env, fcFont, fullNameID, jstr); } if (fn==0) { @@ -1331,7 +1342,6 @@ Java_sun_font_FontConfigManager_getFontConfig } } } - (*env)->ReleaseStringUTFChars (env, fcNameStr, (const char*)fcName); (*FcFontSetDestroy)(fontset); (*FcPatternDestroy)(pattern); free(family); From f9b7fc0201c8e0c92bac4feabe8af56355ac8507 Mon Sep 17 00:00:00 2001 From: Dmitry Dmitriev Date: Thu, 10 Dec 2015 14:50:47 +0300 Subject: [PATCH 098/228] 8144197: Possible use after free in Arguments::add_property function Reviewed-by: dholmes, goetz --- hotspot/src/share/vm/runtime/arguments.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index a2d34ccdc6e..017f4693dd7 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -1308,18 +1308,20 @@ bool Arguments::add_property(const char* prop) { PropertyList_unique_add(&_system_properties, key, value, true); } else { if (strcmp(key, "sun.java.command") == 0) { - if (_java_command != NULL) { - os::free(_java_command); - } + char *old_java_command = _java_command; _java_command = os::strdup_check_oom(value, mtInternal); - } else if (strcmp(key, "java.vendor.url.bug") == 0) { - if (_java_vendor_url_bug != DEFAULT_VENDOR_URL_BUG) { - assert(_java_vendor_url_bug != NULL, "_java_vendor_url_bug is NULL"); - os::free((void *)_java_vendor_url_bug); + if (old_java_command != NULL) { + os::free(old_java_command); } + } else if (strcmp(key, "java.vendor.url.bug") == 0) { + const char* old_java_vendor_url_bug = _java_vendor_url_bug; // save it in _java_vendor_url_bug, so JVM fatal error handler can access // its value without going through the property list or making a Java call. _java_vendor_url_bug = os::strdup_check_oom(value, mtInternal); + if (old_java_vendor_url_bug != DEFAULT_VENDOR_URL_BUG) { + assert(old_java_vendor_url_bug != NULL, "_java_vendor_url_bug is NULL"); + os::free((void *)old_java_vendor_url_bug); + } } // Create new property and add at the end of the list From 57d8a71115b8fc9a2eb2be876a396c474c207cf3 Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Thu, 10 Dec 2015 16:09:36 +0100 Subject: [PATCH 099/228] 8145099: Better error message when SA can't attach to a process Reviewed-by: jbachorik, stuefe --- hotspot/agent/src/os/linux/LinuxDebuggerLocal.c | 7 +++++-- hotspot/agent/src/os/linux/libproc.h | 2 +- hotspot/agent/src/os/linux/ps_proc.c | 16 ++++++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c index 6a80036daf8..f4ed4db6d33 100644 --- a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c +++ b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c @@ -223,9 +223,12 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_at verifyBitness(env, (char *) &buf); CHECK_EXCEPTION; + char err_buf[200]; struct ps_prochandle* ph; - if ( (ph = Pgrab(jpid)) == NULL) { - THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process"); + if ( (ph = Pgrab(jpid, err_buf, sizeof(err_buf))) == NULL) { + char msg[230]; + snprintf(msg, sizeof(msg), "Can't attach to the process: %s", err_buf); + THROW_NEW_DEBUGGER_EXCEPTION(msg); } (*env)->SetLongField(env, this_obj, p_ps_prochandle_ID, (jlong)(intptr_t)ph); fillThreadsAndLoadObjects(env, this_obj, ph); diff --git a/hotspot/agent/src/os/linux/libproc.h b/hotspot/agent/src/os/linux/libproc.h index 0f5423ea5fb..f4ddec2e371 100644 --- a/hotspot/agent/src/os/linux/libproc.h +++ b/hotspot/agent/src/os/linux/libproc.h @@ -86,7 +86,7 @@ typedef int bool; struct ps_prochandle; // attach to a process -struct ps_prochandle* Pgrab(pid_t pid); +struct ps_prochandle* Pgrab(pid_t pid, char* err_buf, size_t err_buf_len); // attach to a core dump struct ps_prochandle* Pgrab_core(const char* execfile, const char* corefile); diff --git a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/agent/src/os/linux/ps_proc.c index 7d9d2611c3b..dc02008a90c 100644 --- a/hotspot/agent/src/os/linux/ps_proc.c +++ b/hotspot/agent/src/os/linux/ps_proc.c @@ -215,9 +215,12 @@ static bool ptrace_waitpid(pid_t pid) { } // attach to a process/thread specified by "pid" -static bool ptrace_attach(pid_t pid) { +static bool ptrace_attach(pid_t pid, char* err_buf, size_t err_buf_len) { if (ptrace(PTRACE_ATTACH, pid, NULL, NULL) < 0) { - print_debug("ptrace(PTRACE_ATTACH, ..) failed for %d\n", pid); + char buf[200]; + char* msg = strerror_r(errno, buf, sizeof(buf)); + snprintf(err_buf, err_buf_len, "ptrace(PTRACE_ATTACH, ..) failed for %d: %s", pid, msg); + print_debug("%s\n", err_buf); return false; } else { return ptrace_waitpid(pid); @@ -370,16 +373,17 @@ static ps_prochandle_ops process_ops = { }; // attach to the process. One and only one exposed stuff -struct ps_prochandle* Pgrab(pid_t pid) { +struct ps_prochandle* Pgrab(pid_t pid, char* err_buf, size_t err_buf_len) { struct ps_prochandle* ph = NULL; thread_info* thr = NULL; if ( (ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle))) == NULL) { - print_debug("can't allocate memory for ps_prochandle\n"); + snprintf(err_buf, err_buf_len, "can't allocate memory for ps_prochandle"); + print_debug("%s\n", err_buf); return NULL; } - if (ptrace_attach(pid) != true) { + if (ptrace_attach(pid, err_buf, err_buf_len) != true) { free(ph); return NULL; } @@ -402,7 +406,7 @@ struct ps_prochandle* Pgrab(pid_t pid) { thr = ph->threads; while (thr) { // don't attach to the main thread again - if (ph->pid != thr->lwp_id && ptrace_attach(thr->lwp_id) != true) { + if (ph->pid != thr->lwp_id && ptrace_attach(thr->lwp_id, err_buf, err_buf_len) != true) { // even if one attach fails, we get return NULL Prelease(ph); return NULL; From 4fd73ebe16a69b37f99d15873cda2bebc12c07c3 Mon Sep 17 00:00:00 2001 From: Joseph Provino Date: Thu, 10 Dec 2015 13:38:18 -0500 Subject: [PATCH 100/228] 8139871: G1CollectorPolicy::_cur_mark_stop_world_time_ms is never read from Remove dead code Reviewed-by: tschatzl, jwilhelm --- hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp | 3 --- hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp | 1 - 2 files changed, 4 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp index e3c39c71a6e..fb22b840d8b 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp @@ -901,7 +901,6 @@ void G1CollectorPolicy::record_concurrent_mark_init_end(double collector_state()->set_during_marking(true); assert(!collector_state()->initiate_conc_mark_if_possible(), "we should have cleared it by now"); collector_state()->set_during_initial_mark_pause(false); - _cur_mark_stop_world_time_ms = mark_init_elapsed_time_ms; } void G1CollectorPolicy::record_concurrent_mark_remark_start() { @@ -913,7 +912,6 @@ void G1CollectorPolicy::record_concurrent_mark_remark_end() { double end_time_sec = os::elapsedTime(); double elapsed_time_ms = (end_time_sec - _mark_remark_start_sec)*1000.0; _concurrent_mark_remark_times_ms->add(elapsed_time_ms); - _cur_mark_stop_world_time_ms += elapsed_time_ms; _prev_collection_pause_end_ms += elapsed_time_ms; record_pause(Remark, _mark_remark_start_sec, end_time_sec); @@ -1833,7 +1831,6 @@ void G1CollectorPolicy::record_concurrent_mark_cleanup_end() { double end_sec = os::elapsedTime(); double elapsed_time_ms = (end_sec - _mark_cleanup_start_sec) * 1000.0; _concurrent_mark_cleanup_times_ms->add(elapsed_time_ms); - _cur_mark_stop_world_time_ms += elapsed_time_ms; _prev_collection_pause_end_ms += elapsed_time_ms; record_pause(Cleanup, _mark_cleanup_start_sec, end_sec); diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp index 232f14488d5..b2abdb8fcc5 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp @@ -492,7 +492,6 @@ private: // This set of variables tracks the collector efficiency, in order to // determine whether we should initiate a new marking. - double _cur_mark_stop_world_time_ms; double _mark_remark_start_sec; double _mark_cleanup_start_sec; From ffeb0bdad07683a9658bac407b87bb369767a63c Mon Sep 17 00:00:00 2001 From: Bengt Rutisson Date: Thu, 10 Dec 2015 14:57:55 +0100 Subject: [PATCH 101/228] 8145092: Use Unified Logging for the GC logging JEP-271. VM changes contributed by brutisso, test changes contributed by david. Co-authored-by: David Lindholm Reviewed-by: sjohanss, david, brutisso --- hotspot/src/os/windows/vm/os_windows.cpp | 6 +- hotspot/src/share/vm/Xusage.txt | 1 - .../src/share/vm/gc/cms/allocationStats.hpp | 9 +- .../vm/gc/cms/compactibleFreeListSpace.cpp | 141 ++-- .../vm/gc/cms/compactibleFreeListSpace.hpp | 13 +- .../gc/cms/concurrentMarkSweepGeneration.cpp | 781 ++++++------------ .../gc/cms/concurrentMarkSweepGeneration.hpp | 13 +- .../src/share/vm/gc/cms/parNewGeneration.cpp | 63 +- .../share/vm/gc/cms/parOopClosures.inline.hpp | 9 +- hotspot/src/share/vm/gc/cms/promotionInfo.hpp | 2 +- .../src/share/vm/gc/cms/vmCMSOperations.cpp | 6 +- .../share/vm/gc/g1/collectionSetChooser.cpp | 5 +- .../vm/gc/g1/concurrentG1RefineThread.cpp | 21 +- hotspot/src/share/vm/gc/g1/concurrentMark.cpp | 308 +++---- hotspot/src/share/vm/gc/g1/concurrentMark.hpp | 4 +- .../share/vm/gc/g1/concurrentMarkThread.cpp | 48 +- .../share/vm/gc/g1/concurrentMarkThread.hpp | 1 - .../src/share/vm/gc/g1/g1BlockOffsetTable.cpp | 12 +- .../src/share/vm/gc/g1/g1CollectedHeap.cpp | 583 +++++-------- .../src/share/vm/gc/g1/g1CollectedHeap.hpp | 25 +- .../src/share/vm/gc/g1/g1CollectorPolicy.cpp | 323 ++------ .../src/share/vm/gc/g1/g1CollectorPolicy.hpp | 7 +- hotspot/src/share/vm/gc/g1/g1ErgoVerbose.cpp | 66 -- hotspot/src/share/vm/gc/g1/g1ErgoVerbose.hpp | 204 ----- hotspot/src/share/vm/gc/g1/g1EvacStats.cpp | 150 ++-- hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp | 232 +++--- hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp | 4 +- hotspot/src/share/vm/gc/g1/g1HRPrinter.cpp | 37 +- hotspot/src/share/vm/gc/g1/g1HRPrinter.hpp | 42 +- hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp | 47 +- hotspot/src/share/vm/gc/g1/g1Log.cpp | 70 -- hotspot/src/share/vm/gc/g1/g1Log.hpp | 65 -- hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp | 20 +- hotspot/src/share/vm/gc/g1/g1RemSet.cpp | 60 +- hotspot/src/share/vm/gc/g1/g1RemSet.hpp | 5 +- .../src/share/vm/gc/g1/g1RemSetSummary.cpp | 4 +- .../src/share/vm/gc/g1/g1RemSetSummary.hpp | 1 + .../vm/gc/g1/g1SATBCardTableModRefBS.cpp | 16 +- .../src/share/vm/gc/g1/g1StringDedupQueue.cpp | 8 +- .../src/share/vm/gc/g1/g1StringDedupQueue.hpp | 2 +- .../src/share/vm/gc/g1/g1StringDedupStat.cpp | 44 +- .../src/share/vm/gc/g1/g1StringDedupStat.hpp | 4 +- .../src/share/vm/gc/g1/g1StringDedupTable.cpp | 28 +- .../src/share/vm/gc/g1/g1StringDedupTable.hpp | 2 +- .../share/vm/gc/g1/g1StringDedupThread.cpp | 20 +- .../share/vm/gc/g1/g1StringDedupThread.hpp | 2 +- hotspot/src/share/vm/gc/g1/g1_globals.hpp | 46 +- hotspot/src/share/vm/gc/g1/heapRegion.cpp | 141 ++-- .../src/share/vm/gc/g1/heapRegionRemSet.cpp | 40 +- .../src/share/vm/gc/g1/heapRegionRemSet.hpp | 2 +- hotspot/src/share/vm/gc/g1/heapRegionSet.cpp | 18 - hotspot/src/share/vm/gc/g1/heapRegionSet.hpp | 2 - hotspot/src/share/vm/gc/g1/satbMarkQueue.cpp | 24 +- hotspot/src/share/vm/gc/g1/survRateGroup.cpp | 35 +- .../src/share/vm/gc/g1/vm_operations_g1.cpp | 9 +- .../src/share/vm/gc/g1/workerDataArray.cpp | 4 +- .../src/share/vm/gc/g1/workerDataArray.hpp | 6 - .../share/vm/gc/g1/workerDataArray.inline.hpp | 2 - hotspot/src/share/vm/gc/g1/youngList.cpp | 32 +- .../vm/gc/parallel/adjoiningGenerations.cpp | 67 +- .../src/share/vm/gc/parallel/asPSOldGen.cpp | 30 +- .../src/share/vm/gc/parallel/asPSYoungGen.cpp | 180 ++-- .../vm/gc/parallel/cardTableExtension.cpp | 35 +- .../share/vm/gc/parallel/gcTaskManager.cpp | 63 +- .../src/share/vm/gc/parallel/gcTaskThread.cpp | 37 +- .../vm/gc/parallel/parallelScavengeHeap.cpp | 30 +- .../vm/gc/parallel/parallelScavengeHeap.hpp | 31 +- hotspot/src/share/vm/gc/parallel/pcTasks.cpp | 26 +- .../vm/gc/parallel/psAdaptiveSizePolicy.cpp | 402 ++++----- .../vm/gc/parallel/psAdaptiveSizePolicy.hpp | 2 +- .../vm/gc/parallel/psCompactionManager.cpp | 26 +- .../src/share/vm/gc/parallel/psMarkSweep.cpp | 65 +- hotspot/src/share/vm/gc/parallel/psOldGen.cpp | 71 +- .../vm/gc/parallel/psParallelCompact.cpp | 440 +++++----- .../vm/gc/parallel/psParallelCompact.hpp | 12 +- .../vm/gc/parallel/psPromotionManager.cpp | 26 +- .../vm/gc/parallel/psPromotionManager.hpp | 2 +- .../gc/parallel/psPromotionManager.inline.hpp | 17 +- .../src/share/vm/gc/parallel/psScavenge.cpp | 112 +-- .../vm/gc/parallel/psScavenge.inline.hpp | 13 +- .../share/vm/gc/parallel/psVirtualspace.cpp | 14 - .../share/vm/gc/parallel/psVirtualspace.hpp | 1 - .../src/share/vm/gc/parallel/psYoungGen.cpp | 229 ++--- .../share/vm/gc/serial/defNewGeneration.cpp | 121 +-- .../share/vm/gc/serial/defNewGeneration.hpp | 1 - .../src/share/vm/gc/serial/genMarkSweep.cpp | 19 +- hotspot/src/share/vm/gc/serial/markSweep.cpp | 26 +- .../share/vm/gc/serial/tenuredGeneration.cpp | 56 +- .../share/vm/gc/shared/adaptiveSizePolicy.cpp | 125 ++- .../share/vm/gc/shared/adaptiveSizePolicy.hpp | 56 +- hotspot/src/share/vm/gc/shared/ageTable.cpp | 17 +- .../share/vm/gc/shared/blockOffsetTable.cpp | 19 +- .../src/share/vm/gc/shared/cardGeneration.cpp | 105 +-- .../share/vm/gc/shared/cardTableModRefBS.cpp | 50 +- .../src/share/vm/gc/shared/collectedHeap.cpp | 64 +- .../src/share/vm/gc/shared/collectedHeap.hpp | 19 +- .../share/vm/gc/shared/collectorPolicy.cpp | 38 +- hotspot/src/share/vm/gc/shared/gcCause.hpp | 32 - hotspot/src/share/vm/gc/shared/gcId.cpp | 13 + hotspot/src/share/vm/gc/shared/gcId.hpp | 1 + hotspot/src/share/vm/gc/shared/gcLocker.cpp | 28 +- hotspot/src/share/vm/gc/shared/gcLocker.hpp | 1 + .../src/share/vm/gc/shared/gcTraceTime.cpp | 79 +- .../src/share/vm/gc/shared/gcTraceTime.hpp | 48 +- .../share/vm/gc/shared/gcTraceTime.inline.hpp | 149 ++++ .../share/vm/gc/shared/genCollectedHeap.cpp | 120 +-- .../share/vm/gc/shared/genCollectedHeap.hpp | 13 +- hotspot/src/share/vm/gc/shared/generation.cpp | 23 +- hotspot/src/share/vm/gc/shared/generation.hpp | 3 - hotspot/src/share/vm/gc/shared/plab.cpp | 13 +- hotspot/src/share/vm/gc/shared/plab.hpp | 2 - .../share/vm/gc/shared/referenceProcessor.cpp | 174 ++-- .../share/vm/gc/shared/referenceProcessor.hpp | 4 +- hotspot/src/share/vm/gc/shared/space.hpp | 2 - .../src/share/vm/gc/shared/spaceDecorator.cpp | 9 +- hotspot/src/share/vm/gc/shared/taskqueue.cpp | 10 +- .../vm/gc/shared/threadLocalAllocBuffer.cpp | 98 +-- .../shared/threadLocalAllocBuffer.inline.hpp | 30 +- .../src/share/vm/gc/shared/vmGCOperations.cpp | 18 +- hotspot/src/share/vm/logging/logPrefix.hpp | 33 +- hotspot/src/share/vm/logging/logTag.hpp | 41 + .../share/vm/memory/binaryTreeDictionary.cpp | 78 +- .../share/vm/memory/binaryTreeDictionary.hpp | 4 +- hotspot/src/share/vm/memory/filemap.cpp | 4 +- .../share/vm/memory/freeBlockDictionary.hpp | 6 +- hotspot/src/share/vm/memory/metaspace.cpp | 275 +++--- hotspot/src/share/vm/memory/universe.cpp | 79 +- hotspot/src/share/vm/memory/universe.hpp | 23 +- hotspot/src/share/vm/oops/instanceKlass.cpp | 2 +- .../share/vm/oops/instanceRefKlass.inline.hpp | 8 +- hotspot/src/share/vm/prims/jni.cpp | 1 - hotspot/src/share/vm/prims/jvmtiEnv.cpp | 18 +- hotspot/src/share/vm/prims/whitebox.cpp | 2 +- hotspot/src/share/vm/runtime/arguments.cpp | 157 +--- hotspot/src/share/vm/runtime/arguments.hpp | 4 - hotspot/src/share/vm/runtime/globals.hpp | 172 +--- .../src/share/vm/runtime/interfaceSupport.cpp | 12 +- hotspot/src/share/vm/runtime/java.cpp | 13 +- hotspot/src/share/vm/runtime/jniHandles.cpp | 5 +- hotspot/src/share/vm/runtime/os.cpp | 2 +- hotspot/src/share/vm/runtime/safepoint.cpp | 5 - hotspot/src/share/vm/runtime/timer.cpp | 2 - hotspot/src/share/vm/runtime/vmThread.cpp | 2 +- .../src/share/vm/runtime/vm_operations.cpp | 2 +- .../src/share/vm/runtime/vm_operations.hpp | 14 - .../share/vm/services/diagnosticCommand.cpp | 10 - .../share/vm/services/diagnosticCommand.hpp | 17 - .../src/share/vm/services/memoryService.cpp | 9 +- .../src/share/vm/services/memoryService.hpp | 3 +- .../src/share/vm/services/runtimeService.cpp | 21 +- hotspot/src/share/vm/utilities/debug.cpp | 2 +- hotspot/src/share/vm/utilities/numberSeq.cpp | 2 +- hotspot/src/share/vm/utilities/ostream.cpp | 316 +------ hotspot/src/share/vm/utilities/ostream.hpp | 26 - hotspot/test/TEST.groups | 1 - hotspot/test/gc/7072527/TestFullGCCount.java | 2 +- hotspot/test/gc/TestDisableExplicitGC.java | 6 +- hotspot/test/gc/TestGCLogRotationViaJcmd.java | 79 -- hotspot/test/gc/TestVerifyDuringStartup.java | 3 +- hotspot/test/gc/TestVerifySilently.java | 6 +- .../TestTargetSurvivorRatioFlag.java | 4 +- .../TestUnrecognizedVMOptionsHandling.java | 8 +- .../TestVerifyBeforeAndAfterGCFlags.java | 7 +- .../TestCMSClassUnloadingEnabledHWM.java | 12 +- .../TestG1ClassUnloadingHWM.java | 11 +- hotspot/test/gc/cms/DisableResizePLAB.java | 2 +- .../gc/cms/TestCMSScavengeBeforeRemark.java | 2 +- .../TestDynamicNumberOfGCThreads.java | 2 +- .../g1/TestEagerReclaimHumongousRegions.java | 2 +- ...rReclaimHumongousRegionsClearMarkBits.java | 2 +- ...tEagerReclaimHumongousRegionsWithRefs.java | 2 +- ...stG1TraceEagerReclaimHumongousObjects.java | 24 +- hotspot/test/gc/g1/TestGCLogMessages.java | 82 +- .../gc/g1/TestHumongousAllocInitialMark.java | 4 +- .../TestHumongousAllocNearlyFullRegion.java | 4 +- .../TestNoEagerReclaimOfHumongousRegions.java | 2 +- hotspot/test/gc/g1/TestPLABOutput.java | 5 +- hotspot/test/gc/g1/TestPrintGCDetails.java | 59 -- .../g1/TestPrintRegionRememberedSetInfo.java | 5 +- hotspot/test/gc/g1/TestRemsetLogging.java | 87 ++ ...n.java => TestRemsetLoggingPerRegion.java} | 20 +- ...ads.java => TestRemsetLoggingThreads.java} | 16 +- ...Tools.java => TestRemsetLoggingTools.java} | 5 +- .../test/gc/g1/TestShrinkAuxiliaryData.java | 2 +- .../gc/g1/TestStringDeduplicationTools.java | 48 +- .../gc/g1/TestStringSymbolTableStats.java | 2 +- .../test/gc/g1/TestSummarizeRSetStats.java | 87 -- hotspot/test/gc/g1/mixedgc/TestLogging.java | 10 +- hotspot/test/gc/logging/TestGCId.java | 39 +- .../test/gc/logging/TestPrintReferences.java | 16 +- hotspot/test/gc/serial/HeapChangeLogging.java | 4 +- hotspot/test/gc/whitebox/TestWBGC.java | 2 +- .../test/runtime/7158988/FieldMonitor.java | 2 +- .../PrintGCApplicationConcurrentTime.java | 2 +- .../runtime/CommandLine/TestVMOptions.java | 2 +- .../CompressedClassPointers.java | 8 +- .../CompressedClassSpaceSize.java | 4 +- .../serviceability/dcmd/gc/RunGCTest.java | 4 +- .../serviceability/dcmd/vm/FlagsTest.java | 3 +- .../logging/TestLogRotation.java} | 17 +- 200 files changed, 3331 insertions(+), 6147 deletions(-) delete mode 100644 hotspot/src/share/vm/gc/g1/g1ErgoVerbose.cpp delete mode 100644 hotspot/src/share/vm/gc/g1/g1ErgoVerbose.hpp delete mode 100644 hotspot/src/share/vm/gc/g1/g1Log.cpp delete mode 100644 hotspot/src/share/vm/gc/g1/g1Log.hpp create mode 100644 hotspot/src/share/vm/gc/shared/gcTraceTime.inline.hpp delete mode 100644 hotspot/test/gc/TestGCLogRotationViaJcmd.java delete mode 100644 hotspot/test/gc/g1/TestPrintGCDetails.java create mode 100644 hotspot/test/gc/g1/TestRemsetLogging.java rename hotspot/test/gc/g1/{TestSummarizeRSetStatsPerRegion.java => TestRemsetLoggingPerRegion.java} (66%) rename hotspot/test/gc/g1/{TestSummarizeRSetStatsThreads.java => TestRemsetLoggingThreads.java} (83%) rename hotspot/test/gc/g1/{TestSummarizeRSetStatsTools.java => TestRemsetLoggingTools.java} (97%) delete mode 100644 hotspot/test/gc/g1/TestSummarizeRSetStats.java rename hotspot/test/{gc/6941923/Test6941923.java => serviceability/logging/TestLogRotation.java} (89%) diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index b7083b1f0d4..7b2bf6d9e9c 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -5719,7 +5719,7 @@ char* os::build_agent_function_name(const char *sym_name, const char *lib_name, void TestReserveMemorySpecial_test() { if (!UseLargePages) { if (VerboseInternalVMTests) { - gclog_or_tty->print("Skipping test because large pages are disabled"); + tty->print("Skipping test because large pages are disabled"); } return; } @@ -5735,7 +5735,7 @@ void TestReserveMemorySpecial_test() { char* result = os::reserve_memory_special(large_allocation_size, os::large_page_size(), NULL, false); if (result == NULL) { if (VerboseInternalVMTests) { - gclog_or_tty->print("Failed to allocate control block with size " SIZE_FORMAT ". Skipping remainder of test.", + tty->print("Failed to allocate control block with size " SIZE_FORMAT ". Skipping remainder of test.", large_allocation_size); } } else { @@ -5748,7 +5748,7 @@ void TestReserveMemorySpecial_test() { char* actual_location = os::reserve_memory_special(expected_allocation_size, os::large_page_size(), expected_location, false); if (actual_location == NULL) { if (VerboseInternalVMTests) { - gclog_or_tty->print("Failed to allocate any memory at " PTR_FORMAT " size " SIZE_FORMAT ". Skipping remainder of test.", + tty->print("Failed to allocate any memory at " PTR_FORMAT " size " SIZE_FORMAT ". Skipping remainder of test.", expected_location, large_allocation_size); } } else { diff --git a/hotspot/src/share/vm/Xusage.txt b/hotspot/src/share/vm/Xusage.txt index 8b3d4650a72..3849f8f8e2c 100644 --- a/hotspot/src/share/vm/Xusage.txt +++ b/hotspot/src/share/vm/Xusage.txt @@ -8,7 +8,6 @@ prepend in front of bootstrap class path -Xnoclassgc disable class garbage collection -Xlog: control JVM logging, use -Xlog:help for details - -Xloggc: log GC status to a file with time stamps -Xbatch disable background compilation -Xms set initial Java heap size -Xmx set maximum Java heap size diff --git a/hotspot/src/share/vm/gc/cms/allocationStats.hpp b/hotspot/src/share/vm/gc/cms/allocationStats.hpp index a2259276fe3..747b2904bed 100644 --- a/hotspot/src/share/vm/gc/cms/allocationStats.hpp +++ b/hotspot/src/share/vm/gc/cms/allocationStats.hpp @@ -26,6 +26,7 @@ #define SHARE_VM_GC_CMS_ALLOCATIONSTATS_HPP #include "gc/shared/gcUtil.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" @@ -119,11 +120,9 @@ class AllocationStats VALUE_OBJ_CLASS_SPEC { ssize_t old_desired = _desired; float delta_ise = (CMSExtrapolateSweep ? intra_sweep_estimate : 0.0); _desired = (ssize_t)(new_rate * (inter_sweep_estimate + delta_ise)); - if (PrintFLSStatistics > 1) { - gclog_or_tty->print_cr("demand: " SSIZE_FORMAT ", old_rate: %f, current_rate: %f, " - "new_rate: %f, old_desired: " SSIZE_FORMAT ", new_desired: " SSIZE_FORMAT, - demand, old_rate, rate, new_rate, old_desired, _desired); - } + log_trace(gc, freelist)("demand: " SSIZE_FORMAT ", old_rate: %f, current_rate: %f, " + "new_rate: %f, old_desired: " SSIZE_FORMAT ", new_desired: " SSIZE_FORMAT, + demand, old_rate, rate, new_rate, old_desired, _desired); } } diff --git a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp index 933186d34fe..f302a7f9678 100644 --- a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp +++ b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp @@ -400,17 +400,16 @@ void CompactibleFreeListSpace::print_on(outputStream* st) const { void CompactibleFreeListSpace::print_indexed_free_lists(outputStream* st) const { - reportIndexedFreeListStatistics(); - gclog_or_tty->print_cr("Layout of Indexed Freelists"); - gclog_or_tty->print_cr("---------------------------"); + reportIndexedFreeListStatistics(st); + st->print_cr("Layout of Indexed Freelists"); + st->print_cr("---------------------------"); AdaptiveFreeList::print_labels_on(st, "size"); for (size_t i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { - _indexedFreeList[i].print_on(gclog_or_tty); - for (FreeChunk* fc = _indexedFreeList[i].head(); fc != NULL; - fc = fc->next()) { - gclog_or_tty->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ") %s", - p2i(fc), p2i((HeapWord*)fc + i), - fc->cantCoalesce() ? "\t CC" : ""); + _indexedFreeList[i].print_on(st); + for (FreeChunk* fc = _indexedFreeList[i].head(); fc != NULL; fc = fc->next()) { + st->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ") %s", + p2i(fc), p2i((HeapWord*)fc + i), + fc->cantCoalesce() ? "\t CC" : ""); } } } @@ -422,7 +421,7 @@ const { void CompactibleFreeListSpace::print_dictionary_free_lists(outputStream* st) const { - _dictionary->report_statistics(); + _dictionary->report_statistics(st); st->print_cr("Layout of Freelists in Tree"); st->print_cr("---------------------------"); _dictionary->print_free_lists(st); @@ -472,54 +471,58 @@ size_t BlkPrintingClosure::do_blk(HeapWord* addr) { return sz; } -void CompactibleFreeListSpace::dump_at_safepoint_with_locks(CMSCollector* c, - outputStream* st) { - st->print_cr("\n========================="); +void CompactibleFreeListSpace::dump_at_safepoint_with_locks(CMSCollector* c, outputStream* st) { + st->print_cr("========================="); st->print_cr("Block layout in CMS Heap:"); st->print_cr("========================="); BlkPrintingClosure bpcl(c, this, c->markBitMap(), st); blk_iterate(&bpcl); - st->print_cr("\n======================================="); + st->print_cr("======================================="); st->print_cr("Order & Layout of Promotion Info Blocks"); st->print_cr("======================================="); print_promo_info_blocks(st); - st->print_cr("\n==========================="); + st->print_cr("==========================="); st->print_cr("Order of Indexed Free Lists"); st->print_cr("========================="); print_indexed_free_lists(st); - st->print_cr("\n================================="); + st->print_cr("================================="); st->print_cr("Order of Free Lists in Dictionary"); st->print_cr("================================="); print_dictionary_free_lists(st); } -void CompactibleFreeListSpace::reportFreeListStatistics() const { +void CompactibleFreeListSpace::reportFreeListStatistics(const char* title) const { assert_lock_strong(&_freelistLock); - assert(PrintFLSStatistics != 0, "Reporting error"); - _dictionary->report_statistics(); - if (PrintFLSStatistics > 1) { - reportIndexedFreeListStatistics(); + LogHandle(gc, freelist, stats) log; + if (!log.is_debug()) { + return; + } + log.debug("%s", title); + _dictionary->report_statistics(log.debug_stream()); + if (log.is_trace()) { + ResourceMark rm; + reportIndexedFreeListStatistics(log.trace_stream()); size_t total_size = totalSizeInIndexedFreeLists() + _dictionary->total_chunk_size(DEBUG_ONLY(freelistLock())); - gclog_or_tty->print(" free=" SIZE_FORMAT " frag=%1.4f\n", total_size, flsFrag()); + log.trace(" free=" SIZE_FORMAT " frag=%1.4f", total_size, flsFrag()); } } -void CompactibleFreeListSpace::reportIndexedFreeListStatistics() const { +void CompactibleFreeListSpace::reportIndexedFreeListStatistics(outputStream* st) const { assert_lock_strong(&_freelistLock); - gclog_or_tty->print("Statistics for IndexedFreeLists:\n" - "--------------------------------\n"); + st->print_cr("Statistics for IndexedFreeLists:"); + st->print_cr("--------------------------------"); size_t total_size = totalSizeInIndexedFreeLists(); - size_t free_blocks = numFreeBlocksInIndexedFreeLists(); - gclog_or_tty->print("Total Free Space: " SIZE_FORMAT "\n", total_size); - gclog_or_tty->print("Max Chunk Size: " SIZE_FORMAT "\n", maxChunkSizeInIndexedFreeLists()); - gclog_or_tty->print("Number of Blocks: " SIZE_FORMAT "\n", free_blocks); + size_t free_blocks = numFreeBlocksInIndexedFreeLists(); + st->print_cr("Total Free Space: " SIZE_FORMAT, total_size); + st->print_cr("Max Chunk Size: " SIZE_FORMAT, maxChunkSizeInIndexedFreeLists()); + st->print_cr("Number of Blocks: " SIZE_FORMAT, free_blocks); if (free_blocks != 0) { - gclog_or_tty->print("Av. Block Size: " SIZE_FORMAT "\n", total_size/free_blocks); + st->print_cr("Av. Block Size: " SIZE_FORMAT, total_size/free_blocks); } } @@ -1824,10 +1827,7 @@ CompactibleFreeListSpace::sweep_completed() { void CompactibleFreeListSpace::gc_prologue() { assert_locked(); - if (PrintFLSStatistics != 0) { - gclog_or_tty->print("Before GC:\n"); - reportFreeListStatistics(); - } + reportFreeListStatistics("Before GC:"); refillLinearAllocBlocksIfNeeded(); } @@ -1837,11 +1837,7 @@ CompactibleFreeListSpace::gc_epilogue() { assert(_promoInfo.noPromotions(), "_promoInfo inconsistency"); _promoInfo.stopTrackingPromotions(); repairLinearAllocationBlocks(); - // Print Space's stats - if (PrintFLSStatistics != 0) { - gclog_or_tty->print("After GC:\n"); - reportFreeListStatistics(); - } + reportFreeListStatistics("After GC:"); } // Iteration support, mostly delegated from a CMS generation @@ -2014,9 +2010,7 @@ void CompactibleFreeListSpace::beginSweepFLCensus( size_t i; for (i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { AdaptiveFreeList* fl = &_indexedFreeList[i]; - if (PrintFLSStatistics > 1) { - gclog_or_tty->print("size[" SIZE_FORMAT "] : ", i); - } + log_trace(gc, freelist)("size[" SIZE_FORMAT "] : ", i); fl->compute_desired(inter_sweep_current, inter_sweep_estimate, intra_sweep_estimate); fl->set_coal_desired((ssize_t)((double)fl->desired() * CMSSmallCoalSurplusPercent)); fl->set_before_sweep(fl->count()); @@ -2065,16 +2059,10 @@ void CompactibleFreeListSpace::clearFLCensus() { } void CompactibleFreeListSpace::endSweepFLCensus(size_t sweep_count) { - if (PrintFLSStatistics > 0) { - HeapWord* largestAddr = (HeapWord*) dictionary()->find_largest_dict(); - gclog_or_tty->print_cr("CMS: Large block " PTR_FORMAT, - p2i(largestAddr)); - } + log_debug(gc, freelist)("CMS: Large block " PTR_FORMAT, p2i(dictionary()->find_largest_dict())); setFLSurplus(); setFLHints(); - if (PrintGC && PrintFLSCensus > 0) { - printFLCensus(sweep_count); - } + printFLCensus(sweep_count); clearFLCensus(); assert_locked(); _dictionary->end_sweep_dict_census(CMSLargeSplitSurplusPercent); @@ -2213,14 +2201,15 @@ class VerifyAllBlksClosure: public BlkClosure { } } if (res == 0) { - gclog_or_tty->print_cr("Livelock: no rank reduction!"); - gclog_or_tty->print_cr( - " Current: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n" - " Previous: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n", + LogHandle(gc, verify) log; + log.info("Livelock: no rank reduction!"); + log.info(" Current: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n" + " Previous: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n", p2i(addr), res, was_obj ?"true":"false", was_live ?"true":"false", p2i(_last_addr), _last_size, _last_was_obj?"true":"false", _last_was_live?"true":"false"); - _sp->print_on(gclog_or_tty); - guarantee(false, "Seppuku!"); + ResourceMark rm; + _sp->print_on(log.info_stream()); + guarantee(false, "Verification failed."); } _last_addr = addr; _last_size = res; @@ -2386,17 +2375,23 @@ void CompactibleFreeListSpace::check_free_list_consistency() const { void CompactibleFreeListSpace::printFLCensus(size_t sweep_count) const { assert_lock_strong(&_freelistLock); + LogHandle(gc, freelist, census) log; + if (!log.is_debug()) { + return; + } AdaptiveFreeList total; - gclog_or_tty->print("end sweep# " SIZE_FORMAT "\n", sweep_count); - AdaptiveFreeList::print_labels_on(gclog_or_tty, "size"); + log.debug("end sweep# " SIZE_FORMAT, sweep_count); + ResourceMark rm; + outputStream* out = log.debug_stream(); + AdaptiveFreeList::print_labels_on(out, "size"); size_t total_free = 0; for (size_t i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { const AdaptiveFreeList *fl = &_indexedFreeList[i]; total_free += fl->count() * fl->size(); if (i % (40*IndexSetStride) == 0) { - AdaptiveFreeList::print_labels_on(gclog_or_tty, "size"); + AdaptiveFreeList::print_labels_on(out, "size"); } - fl->print_on(gclog_or_tty); + fl->print_on(out); total.set_bfr_surp( total.bfr_surp() + fl->bfr_surp() ); total.set_surplus( total.surplus() + fl->surplus() ); total.set_desired( total.desired() + fl->desired() ); @@ -2408,14 +2403,13 @@ void CompactibleFreeListSpace::printFLCensus(size_t sweep_count) const { total.set_split_births(total.split_births() + fl->split_births()); total.set_split_deaths(total.split_deaths() + fl->split_deaths()); } - total.print_on(gclog_or_tty, "TOTAL"); - gclog_or_tty->print_cr("Total free in indexed lists " - SIZE_FORMAT " words", total_free); - gclog_or_tty->print("growth: %8.5f deficit: %8.5f\n", - (double)(total.split_births()+total.coal_births()-total.split_deaths()-total.coal_deaths())/ - (total.prev_sweep() != 0 ? (double)total.prev_sweep() : 1.0), - (double)(total.desired() - total.count())/(total.desired() != 0 ? (double)total.desired() : 1.0)); - _dictionary->print_dict_census(); + total.print_on(out, "TOTAL"); + log.debug("Total free in indexed lists " SIZE_FORMAT " words", total_free); + log.debug("growth: %8.5f deficit: %8.5f", + (double)(total.split_births()+total.coal_births()-total.split_deaths()-total.coal_deaths())/ + (total.prev_sweep() != 0 ? (double)total.prev_sweep() : 1.0), + (double)(total.desired() - total.count())/(total.desired() != 0 ? (double)total.desired() : 1.0)); + _dictionary->print_dict_census(out); } /////////////////////////////////////////////////////////////////////////// @@ -2544,10 +2538,7 @@ void CFLS_LAB::compute_desired_plab_size() { // Reset counters for next round _global_num_workers[i] = 0; _global_num_blocks[i] = 0; - if (PrintOldPLAB) { - gclog_or_tty->print_cr("[" SIZE_FORMAT "]: " SIZE_FORMAT, - i, (size_t)_blocks_to_claim[i].average()); - } + log_trace(gc, plab)("[" SIZE_FORMAT "]: " SIZE_FORMAT, i, (size_t)_blocks_to_claim[i].average()); } } } @@ -2584,10 +2575,8 @@ void CFLS_LAB::retire(int tid) { _indexedFreeList[i].set_size(i); } } - if (PrintOldPLAB) { - gclog_or_tty->print_cr("%d[" SIZE_FORMAT "]: " SIZE_FORMAT "/" SIZE_FORMAT "/" SIZE_FORMAT, - tid, i, num_retire, _num_blocks[i], (size_t)_blocks_to_claim[i].average()); - } + log_trace(gc, plab)("%d[" SIZE_FORMAT "]: " SIZE_FORMAT "/" SIZE_FORMAT "/" SIZE_FORMAT, + tid, i, num_retire, _num_blocks[i], (size_t)_blocks_to_claim[i].average()); // Reset stats for next round _num_blocks[i] = 0; } diff --git a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp index 3cfc3a665f5..5c233452a16 100644 --- a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp +++ b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp @@ -29,6 +29,7 @@ #include "gc/cms/promotionInfo.hpp" #include "gc/shared/blockOffsetTable.hpp" #include "gc/shared/space.hpp" +#include "logging/log.hpp" #include "memory/binaryTreeDictionary.hpp" #include "memory/freeList.hpp" @@ -275,8 +276,8 @@ class CompactibleFreeListSpace: public CompactibleSpace { void verify_objects_initialized() const; // Statistics reporting helper functions - void reportFreeListStatistics() const; - void reportIndexedFreeListStatistics() const; + void reportFreeListStatistics(const char* title) const; + void reportIndexedFreeListStatistics(outputStream* st) const; size_t maxChunkSizeInIndexedFreeLists() const; size_t numFreeBlocksInIndexedFreeLists() const; // Accessor @@ -450,11 +451,9 @@ class CompactibleFreeListSpace: public CompactibleSpace { void save_sweep_limit() { _sweep_limit = BlockOffsetArrayUseUnallocatedBlock ? unallocated_block() : end(); - if (CMSTraceSweeper) { - gclog_or_tty->print_cr(">>>>> Saving sweep limit " PTR_FORMAT - " for space [" PTR_FORMAT "," PTR_FORMAT ") <<<<<<", - p2i(_sweep_limit), p2i(bottom()), p2i(end())); - } + log_develop_trace(gc, sweep)(">>>>> Saving sweep limit " PTR_FORMAT + " for space [" PTR_FORMAT "," PTR_FORMAT ") <<<<<<", + p2i(_sweep_limit), p2i(bottom()), p2i(end())); } NOT_PRODUCT( void clear_sweep_limit() { _sweep_limit = NULL; } diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp index 3b7a7d91605..92ede42baef 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp @@ -47,13 +47,14 @@ #include "gc/shared/gcPolicyCounters.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/strongRootsScope.hpp" #include "gc/shared/taskqueue.inline.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/iterator.inline.hpp" #include "memory/padded.hpp" @@ -65,6 +66,7 @@ #include "runtime/handles.inline.hpp" #include "runtime/java.hpp" #include "runtime/orderAccess.inline.hpp" +#include "runtime/timer.hpp" #include "runtime/vmThread.hpp" #include "services/memoryService.hpp" #include "services/runtimeService.hpp" @@ -367,13 +369,9 @@ double CMSStats::time_until_cms_gen_full() const { cms_adjustment = cms_adjustment * cms_free_adjustment_factor(cms_free); cms_free_dbl = cms_free_dbl * cms_adjustment; - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("CMSStats::time_until_cms_gen_full: cms_free " - SIZE_FORMAT " expected_promotion " SIZE_FORMAT, - cms_free, expected_promotion); - gclog_or_tty->print_cr(" cms_free_dbl %f cms_consumption_rate %f", - cms_free_dbl, cms_consumption_rate() + 1.0); - } + log_trace(gc)("CMSStats::time_until_cms_gen_full: cms_free " SIZE_FORMAT " expected_promotion " SIZE_FORMAT, + cms_free, expected_promotion); + log_trace(gc)(" cms_free_dbl %f cms_consumption_rate %f", cms_free_dbl, cms_consumption_rate() + 1.0); // Add 1 in case the consumption rate goes to zero. return cms_free_dbl / (cms_consumption_rate() + 1.0); } @@ -402,12 +400,8 @@ double CMSStats::time_until_cms_start() const { // If a concurrent mode failure occurred recently, we want to be // more conservative and halve our expected time_until_cms_gen_full() if (work > deadline) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print( - " CMSCollector: collect because of anticipated promotion " - "before full %3.7f + %3.7f > %3.7f ", cms_duration(), - gc0_period(), time_until_cms_gen_full()); - } + log_develop_trace(gc)("CMSCollector: collect because of anticipated promotion before full %3.7f + %3.7f > %3.7f ", + cms_duration(), gc0_period(), time_until_cms_gen_full()); return 0.0; } return work - deadline; @@ -669,31 +663,6 @@ void ConcurrentMarkSweepGeneration::print_statistics() { } #endif -void ConcurrentMarkSweepGeneration::printOccupancy(const char *s) { - GenCollectedHeap* gch = GenCollectedHeap::heap(); - if (PrintGCDetails) { - // I didn't want to change the logging when removing the level concept, - // but I guess this logging could say "old" or something instead of "1". - assert(gch->is_old_gen(this), - "The CMS generation should be the old generation"); - uint level = 1; - if (Verbose) { - gclog_or_tty->print("[%u %s-%s: " SIZE_FORMAT "(" SIZE_FORMAT ")]", - level, short_name(), s, used(), capacity()); - } else { - gclog_or_tty->print("[%u %s-%s: " SIZE_FORMAT "K(" SIZE_FORMAT "K)]", - level, short_name(), s, used() / K, capacity() / K); - } - } - if (Verbose) { - gclog_or_tty->print(" " SIZE_FORMAT "(" SIZE_FORMAT ")", - gch->used(), gch->capacity()); - } else { - gclog_or_tty->print(" " SIZE_FORMAT "K(" SIZE_FORMAT "K)", - gch->used() / K, gch->capacity() / K); - } -} - size_t ConcurrentMarkSweepGeneration::contiguous_available() const { // dld proposes an improvement in precision here. If the committed @@ -717,21 +686,18 @@ bool ConcurrentMarkSweepGeneration::promotion_attempt_is_safe(size_t max_promoti size_t available = max_available(); size_t av_promo = (size_t)gc_stats()->avg_promoted()->padded_average(); bool res = (available >= av_promo) || (available >= max_promotion_in_bytes); - if (Verbose && PrintGCDetails) { - gclog_or_tty->print_cr( - "CMS: promo attempt is%s safe: available(" SIZE_FORMAT ") %s av_promo(" SIZE_FORMAT ")," - "max_promo(" SIZE_FORMAT ")", - res? "":" not", available, res? ">=":"<", - av_promo, max_promotion_in_bytes); - } + log_trace(gc, promotion)("CMS: promo attempt is%s safe: available(" SIZE_FORMAT ") %s av_promo(" SIZE_FORMAT "), max_promo(" SIZE_FORMAT ")", + res? "":" not", available, res? ">=":"<", av_promo, max_promotion_in_bytes); return res; } // At a promotion failure dump information on block layout in heap // (cms old generation). void ConcurrentMarkSweepGeneration::promotion_failure_occurred() { - if (CMSDumpAtPromotionFailure) { - cmsSpace()->dump_at_safepoint_with_locks(collector(), gclog_or_tty); + LogHandle(gc, promotion) log; + if (log.is_trace()) { + ResourceMark rm; + cmsSpace()->dump_at_safepoint_with_locks(collector(), log.trace_stream()); } } @@ -787,27 +753,26 @@ void ConcurrentMarkSweepGeneration::compute_new_size_free_list() { size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage)); assert(desired_capacity >= capacity(), "invalid expansion size"); size_t expand_bytes = MAX2(desired_capacity - capacity(), MinHeapDeltaBytes); - if (PrintGCDetails && Verbose) { + LogHandle(gc) log; + if (log.is_trace()) { size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage)); - gclog_or_tty->print_cr("\nFrom compute_new_size: "); - gclog_or_tty->print_cr(" Free fraction %f", free_percentage); - gclog_or_tty->print_cr(" Desired free fraction %f", desired_free_percentage); - gclog_or_tty->print_cr(" Maximum free fraction %f", maximum_free_percentage); - gclog_or_tty->print_cr(" Capacity " SIZE_FORMAT, capacity() / 1000); - gclog_or_tty->print_cr(" Desired capacity " SIZE_FORMAT, desired_capacity / 1000); + log.trace("From compute_new_size: "); + log.trace(" Free fraction %f", free_percentage); + log.trace(" Desired free fraction %f", desired_free_percentage); + log.trace(" Maximum free fraction %f", maximum_free_percentage); + log.trace(" Capacity " SIZE_FORMAT, capacity() / 1000); + log.trace(" Desired capacity " SIZE_FORMAT, desired_capacity / 1000); GenCollectedHeap* gch = GenCollectedHeap::heap(); assert(gch->is_old_gen(this), "The CMS generation should always be the old generation"); size_t young_size = gch->young_gen()->capacity(); - gclog_or_tty->print_cr(" Young gen size " SIZE_FORMAT, young_size / 1000); - gclog_or_tty->print_cr(" unsafe_max_alloc_nogc " SIZE_FORMAT, unsafe_max_alloc_nogc() / 1000); - gclog_or_tty->print_cr(" contiguous available " SIZE_FORMAT, contiguous_available() / 1000); - gclog_or_tty->print_cr(" Expand by " SIZE_FORMAT " (bytes)", expand_bytes); + log.trace(" Young gen size " SIZE_FORMAT, young_size / 1000); + log.trace(" unsafe_max_alloc_nogc " SIZE_FORMAT, unsafe_max_alloc_nogc() / 1000); + log.trace(" contiguous available " SIZE_FORMAT, contiguous_available() / 1000); + log.trace(" Expand by " SIZE_FORMAT " (bytes)", expand_bytes); } // safe if expansion fails expand_for_gc_cause(expand_bytes, 0, CMSExpansionCause::_satisfy_free_ratio); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr(" Expanded free fraction %f", ((double) free()) / capacity()); - } + log.trace(" Expanded free fraction %f", ((double) free()) / capacity()); } else { size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage)); assert(desired_capacity <= capacity(), "invalid expansion size"); @@ -1145,10 +1110,7 @@ bool ConcurrentMarkSweepGeneration::should_collect(bool full, bool CMSCollector::shouldConcurrentCollect() { if (_full_gc_requested) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print_cr("CMSCollector: collect because of explicit " - " gc request (or gc_locker)"); - } + log_trace(gc)("CMSCollector: collect because of explicit gc request (or gc_locker)"); return true; } @@ -1156,24 +1118,21 @@ bool CMSCollector::shouldConcurrentCollect() { // ------------------------------------------------------------------ // Print out lots of information which affects the initiation of // a collection. - if (PrintCMSInitiationStatistics && stats().valid()) { - gclog_or_tty->print("CMSCollector shouldConcurrentCollect: "); - gclog_or_tty->stamp(); - gclog_or_tty->cr(); - stats().print_on(gclog_or_tty); - gclog_or_tty->print_cr("time_until_cms_gen_full %3.7f", - stats().time_until_cms_gen_full()); - gclog_or_tty->print_cr("free=" SIZE_FORMAT, _cmsGen->free()); - gclog_or_tty->print_cr("contiguous_available=" SIZE_FORMAT, - _cmsGen->contiguous_available()); - gclog_or_tty->print_cr("promotion_rate=%g", stats().promotion_rate()); - gclog_or_tty->print_cr("cms_allocation_rate=%g", stats().cms_allocation_rate()); - gclog_or_tty->print_cr("occupancy=%3.7f", _cmsGen->occupancy()); - gclog_or_tty->print_cr("initiatingOccupancy=%3.7f", _cmsGen->initiating_occupancy()); - gclog_or_tty->print_cr("cms_time_since_begin=%3.7f", stats().cms_time_since_begin()); - gclog_or_tty->print_cr("cms_time_since_end=%3.7f", stats().cms_time_since_end()); - gclog_or_tty->print_cr("metadata initialized %d", - MetaspaceGC::should_concurrent_collect()); + LogHandle(gc) log; + if (log.is_trace() && stats().valid()) { + log.trace("CMSCollector shouldConcurrentCollect: "); + ResourceMark rm; + stats().print_on(log.debug_stream()); + log.trace("time_until_cms_gen_full %3.7f", stats().time_until_cms_gen_full()); + log.trace("free=" SIZE_FORMAT, _cmsGen->free()); + log.trace("contiguous_available=" SIZE_FORMAT, _cmsGen->contiguous_available()); + log.trace("promotion_rate=%g", stats().promotion_rate()); + log.trace("cms_allocation_rate=%g", stats().cms_allocation_rate()); + log.trace("occupancy=%3.7f", _cmsGen->occupancy()); + log.trace("initiatingOccupancy=%3.7f", _cmsGen->initiating_occupancy()); + log.trace("cms_time_since_begin=%3.7f", stats().cms_time_since_begin()); + log.trace("cms_time_since_end=%3.7f", stats().cms_time_since_end()); + log.trace("metadata initialized %d", MetaspaceGC::should_concurrent_collect()); } // ------------------------------------------------------------------ @@ -1191,12 +1150,8 @@ bool CMSCollector::shouldConcurrentCollect() { // this branch will not fire after the first successful CMS // collection because the stats should then be valid. if (_cmsGen->occupancy() >= _bootstrap_occupancy) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print_cr( - " CMSCollector: collect for bootstrapping statistics:" - " occupancy = %f, boot occupancy = %f", _cmsGen->occupancy(), - _bootstrap_occupancy); - } + log_trace(gc)(" CMSCollector: collect for bootstrapping statistics: occupancy = %f, boot occupancy = %f", + _cmsGen->occupancy(), _bootstrap_occupancy); return true; } } @@ -1208,9 +1163,7 @@ bool CMSCollector::shouldConcurrentCollect() { // XXX We need to make sure that the gen expansion // criterion dovetails well with this. XXX NEED TO FIX THIS if (_cmsGen->should_concurrent_collect()) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print_cr("CMS old gen initiated"); - } + log_trace(gc)("CMS old gen initiated"); return true; } @@ -1221,16 +1174,12 @@ bool CMSCollector::shouldConcurrentCollect() { assert(gch->collector_policy()->is_generation_policy(), "You may want to check the correctness of the following"); if (gch->incremental_collection_will_fail(true /* consult_young */)) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("CMSCollector: collect because incremental collection will fail "); - } + log_trace(gc)("CMSCollector: collect because incremental collection will fail "); return true; } if (MetaspaceGC::should_concurrent_collect()) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("CMSCollector: collect for metadata allocation "); - } + log_trace(gc)("CMSCollector: collect for metadata allocation "); return true; } @@ -1244,13 +1193,11 @@ bool CMSCollector::shouldConcurrentCollect() { // Check the CMS time since begin (we do not check the stats validity // as we want to be able to trigger the first CMS cycle as well) if (stats().cms_time_since_begin() >= (CMSTriggerInterval / ((double) MILLIUNITS))) { - if (Verbose && PrintGCDetails) { - if (stats().valid()) { - gclog_or_tty->print_cr("CMSCollector: collect because of trigger interval (time since last begin %3.7f secs)", - stats().cms_time_since_begin()); - } else { - gclog_or_tty->print_cr("CMSCollector: collect because of trigger interval (first collection)"); - } + if (stats().valid()) { + log_trace(gc)("CMSCollector: collect because of trigger interval (time since last begin %3.7f secs)", + stats().cms_time_since_begin()); + } else { + log_trace(gc)("CMSCollector: collect because of trigger interval (first collection)"); } return true; } @@ -1293,20 +1240,15 @@ bool ConcurrentMarkSweepGeneration::should_concurrent_collect() const { assert_lock_strong(freelistLock()); if (occupancy() > initiating_occupancy()) { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(" %s: collect because of occupancy %f / %f ", - short_name(), occupancy(), initiating_occupancy()); - } + log_trace(gc)(" %s: collect because of occupancy %f / %f ", + short_name(), occupancy(), initiating_occupancy()); return true; } if (UseCMSInitiatingOccupancyOnly) { return false; } if (expansion_cause() == CMSExpansionCause::_satisfy_allocation) { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(" %s: collect because expanded for allocation ", - short_name()); - } + log_trace(gc)(" %s: collect because expanded for allocation ", short_name()); return true; } return false; @@ -1363,13 +1305,9 @@ bool CMSCollector::is_external_interruption() { void CMSCollector::report_concurrent_mode_interruption() { if (is_external_interruption()) { - if (PrintGCDetails) { - gclog_or_tty->print(" (concurrent mode interrupted)"); - } + log_debug(gc)("Concurrent mode interrupted"); } else { - if (PrintGCDetails) { - gclog_or_tty->print(" (concurrent mode failure)"); - } + log_debug(gc)("Concurrent mode failure"); _gc_tracer_cm->report_concurrent_mode_failure(); } } @@ -1503,11 +1441,9 @@ void CMSCollector::acquire_control_and_collect(bool full, "VM thread should have CMS token"); getFreelistLocks(); bitMapLock()->lock_without_safepoint_check(); - if (TraceCMSState) { - gclog_or_tty->print_cr("CMS foreground collector has asked for control " - INTPTR_FORMAT " with first state %d", p2i(Thread::current()), first_state); - gclog_or_tty->print_cr(" gets control with state %d", _collectorState); - } + log_debug(gc, state)("CMS foreground collector has asked for control " INTPTR_FORMAT " with first state %d", + p2i(Thread::current()), first_state); + log_debug(gc, state)(" gets control with state %d", _collectorState); // Inform cms gen if this was due to partial collection failing. // The CMS gen may use this fact to determine its expansion policy. @@ -1581,7 +1517,7 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) { SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer(); gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start()); - GCTraceTime t("CMS:MSC ", PrintGCDetails && Verbose, true, NULL); + GCTraceTime(Trace, gc) t("CMS:MSC"); // Temporarily widen the span of the weak reference processing to // the entire heap. @@ -1666,33 +1602,34 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) { } void CMSCollector::print_eden_and_survivor_chunk_arrays() { + LogHandle(gc, heap) log; + if (!log.is_trace()) { + return; + } + ContiguousSpace* eden_space = _young_gen->eden(); ContiguousSpace* from_space = _young_gen->from(); ContiguousSpace* to_space = _young_gen->to(); // Eden if (_eden_chunk_array != NULL) { - gclog_or_tty->print_cr("eden " PTR_FORMAT "-" PTR_FORMAT "-" PTR_FORMAT "(" SIZE_FORMAT ")", - p2i(eden_space->bottom()), p2i(eden_space->top()), - p2i(eden_space->end()), eden_space->capacity()); - gclog_or_tty->print_cr("_eden_chunk_index=" SIZE_FORMAT ", " - "_eden_chunk_capacity=" SIZE_FORMAT, - _eden_chunk_index, _eden_chunk_capacity); + log.trace("eden " PTR_FORMAT "-" PTR_FORMAT "-" PTR_FORMAT "(" SIZE_FORMAT ")", + p2i(eden_space->bottom()), p2i(eden_space->top()), + p2i(eden_space->end()), eden_space->capacity()); + log.trace("_eden_chunk_index=" SIZE_FORMAT ", _eden_chunk_capacity=" SIZE_FORMAT, + _eden_chunk_index, _eden_chunk_capacity); for (size_t i = 0; i < _eden_chunk_index; i++) { - gclog_or_tty->print_cr("_eden_chunk_array[" SIZE_FORMAT "]=" PTR_FORMAT, - i, p2i(_eden_chunk_array[i])); + log.trace("_eden_chunk_array[" SIZE_FORMAT "]=" PTR_FORMAT, i, p2i(_eden_chunk_array[i])); } } // Survivor if (_survivor_chunk_array != NULL) { - gclog_or_tty->print_cr("survivor " PTR_FORMAT "-" PTR_FORMAT "-" PTR_FORMAT "(" SIZE_FORMAT ")", - p2i(from_space->bottom()), p2i(from_space->top()), - p2i(from_space->end()), from_space->capacity()); - gclog_or_tty->print_cr("_survivor_chunk_index=" SIZE_FORMAT ", " - "_survivor_chunk_capacity=" SIZE_FORMAT, - _survivor_chunk_index, _survivor_chunk_capacity); + log.trace("survivor " PTR_FORMAT "-" PTR_FORMAT "-" PTR_FORMAT "(" SIZE_FORMAT ")", + p2i(from_space->bottom()), p2i(from_space->top()), + p2i(from_space->end()), from_space->capacity()); + log.trace("_survivor_chunk_index=" SIZE_FORMAT ", _survivor_chunk_capacity=" SIZE_FORMAT, + _survivor_chunk_index, _survivor_chunk_capacity); for (size_t i = 0; i < _survivor_chunk_index; i++) { - gclog_or_tty->print_cr("_survivor_chunk_array[" SIZE_FORMAT "]=" PTR_FORMAT, - i, p2i(_survivor_chunk_array[i])); + log.trace("_survivor_chunk_array[" SIZE_FORMAT "]=" PTR_FORMAT, i, p2i(_survivor_chunk_array[i])); } } } @@ -1781,11 +1718,7 @@ void CMSCollector::collect_in_background(GCCause::Cause cause) { _collection_count_start = gch->total_full_collections(); } - // Used for PrintGC - size_t prev_used = 0; - if (PrintGC && Verbose) { - prev_used = _cmsGen->used(); - } + size_t prev_used = _cmsGen->used(); // The change of the collection state is normally done at this level; // the exceptions are phases that are executed while the world is @@ -1796,10 +1729,8 @@ void CMSCollector::collect_in_background(GCCause::Cause cause) { // while the world is stopped because the foreground collector already // has the world stopped and would deadlock. while (_collectorState != Idling) { - if (TraceCMSState) { - gclog_or_tty->print_cr("Thread " INTPTR_FORMAT " in CMS state %d", - p2i(Thread::current()), _collectorState); - } + log_debug(gc, state)("Thread " INTPTR_FORMAT " in CMS state %d", + p2i(Thread::current()), _collectorState); // The foreground collector // holds the Heap_lock throughout its collection. // holds the CMS token (but not the lock) @@ -1829,11 +1760,8 @@ void CMSCollector::collect_in_background(GCCause::Cause cause) { // done this round. assert(_foregroundGCShouldWait == false, "We set it to false in " "waitForForegroundGC()"); - if (TraceCMSState) { - gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT - " exiting collection CMS state %d", - p2i(Thread::current()), _collectorState); - } + log_debug(gc, state)("CMS Thread " INTPTR_FORMAT " exiting collection CMS state %d", + p2i(Thread::current()), _collectorState); return; } else { // The background collector can run but check to see if the @@ -1937,10 +1865,8 @@ void CMSCollector::collect_in_background(GCCause::Cause cause) { ShouldNotReachHere(); break; } - if (TraceCMSState) { - gclog_or_tty->print_cr(" Thread " INTPTR_FORMAT " done - next CMS state %d", - p2i(Thread::current()), _collectorState); - } + log_debug(gc, state)(" Thread " INTPTR_FORMAT " done - next CMS state %d", + p2i(Thread::current()), _collectorState); assert(_foregroundGCShouldWait, "block post-condition"); } @@ -1959,14 +1885,10 @@ void CMSCollector::collect_in_background(GCCause::Cause cause) { assert(!ConcurrentMarkSweepThread::cms_thread_has_cms_token(), "Possible deadlock"); } - if (TraceCMSState) { - gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT - " exiting collection CMS state %d", - p2i(Thread::current()), _collectorState); - } - if (PrintGC && Verbose) { - _cmsGen->print_heap_change(prev_used); - } + log_debug(gc, state)("CMS Thread " INTPTR_FORMAT " exiting collection CMS state %d", + p2i(Thread::current()), _collectorState); + log_info(gc, heap)("Old: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + prev_used / K, _cmsGen->used()/K, _cmsGen->capacity() /K); } void CMSCollector::register_gc_start(GCCause::Cause cause) { @@ -2018,10 +1940,8 @@ bool CMSCollector::waitForForegroundGC() { ConcurrentMarkSweepThread::CMS_cms_wants_token); // Get a possibly blocked foreground thread going CGC_lock->notify(); - if (TraceCMSState) { - gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT " waiting at CMS state %d", - p2i(Thread::current()), _collectorState); - } + log_debug(gc, state)("CMS Thread " INTPTR_FORMAT " waiting at CMS state %d", + p2i(Thread::current()), _collectorState); while (_foregroundGCIsActive) { CGC_lock->wait(Mutex::_no_safepoint_check_flag); } @@ -2030,10 +1950,8 @@ bool CMSCollector::waitForForegroundGC() { ConcurrentMarkSweepThread::clear_CMS_flag( ConcurrentMarkSweepThread::CMS_cms_wants_token); } - if (TraceCMSState) { - gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT " continuing at CMS state %d", - p2i(Thread::current()), _collectorState); - } + log_debug(gc, state)("CMS Thread " INTPTR_FORMAT " continuing at CMS state %d", + p2i(Thread::current()), _collectorState); return res; } @@ -2130,11 +2048,8 @@ void ConcurrentMarkSweepGeneration::gc_prologue_work(bool full, NOT_PRODUCT( assert(_numObjectsPromoted == 0, "check"); assert(_numWordsPromoted == 0, "check"); - if (Verbose && PrintGC) { - gclog_or_tty->print("Allocated " SIZE_FORMAT " objects, " - SIZE_FORMAT " bytes concurrently", - _numObjectsAllocated, _numWordsAllocated*sizeof(HeapWord)); - } + log_develop_trace(gc, alloc)("Allocated " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes concurrently", + _numObjectsAllocated, _numWordsAllocated*sizeof(HeapWord)); _numObjectsAllocated = 0; _numWordsAllocated = 0; ) @@ -2211,21 +2126,15 @@ void ConcurrentMarkSweepGeneration::gc_epilogue_work(bool full) { NOT_PRODUCT( assert(_numObjectsAllocated == 0, "check"); assert(_numWordsAllocated == 0, "check"); - if (Verbose && PrintGC) { - gclog_or_tty->print("Promoted " SIZE_FORMAT " objects, " - SIZE_FORMAT " bytes", - _numObjectsPromoted, _numWordsPromoted*sizeof(HeapWord)); - } + log_develop_trace(gc, promotion)("Promoted " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes", + _numObjectsPromoted, _numWordsPromoted*sizeof(HeapWord)); _numObjectsPromoted = 0; _numWordsPromoted = 0; ) - if (PrintGC && Verbose) { - // Call down the chain in contiguous_available needs the freelistLock - // so print this out before releasing the freeListLock. - gclog_or_tty->print(" Contiguous available " SIZE_FORMAT " bytes ", - contiguous_available()); - } + // Call down the chain in contiguous_available needs the freelistLock + // so print this out before releasing the freeListLock. + log_develop_trace(gc)(" Contiguous available " SIZE_FORMAT " bytes ", contiguous_available()); } #ifndef PRODUCT @@ -2309,8 +2218,10 @@ class VerifyMarkedClosure: public BitMapClosure { bool do_bit(size_t offset) { HeapWord* addr = _marks->offsetToHeapWord(offset); if (!_marks->isMarked(addr)) { - oop(addr)->print_on(gclog_or_tty); - gclog_or_tty->print_cr(" (" INTPTR_FORMAT " should have been marked)", p2i(addr)); + LogHandle(gc, verify) log; + ResourceMark rm; + oop(addr)->print_on(log.info_stream()); + log.info(" (" INTPTR_FORMAT " should have been marked)", p2i(addr)); _failed = true; } return true; @@ -2319,8 +2230,8 @@ class VerifyMarkedClosure: public BitMapClosure { bool failed() { return _failed; } }; -bool CMSCollector::verify_after_remark(bool silent) { - if (!silent) gclog_or_tty->print(" [Verifying CMS Marking... "); +bool CMSCollector::verify_after_remark() { + GCTraceTime(Info, gc, verify) tm("Verifying CMS Marking."); MutexLockerEx ml(verification_mark_bm()->lock(), Mutex::_no_safepoint_check_flag); static bool init = false; @@ -2383,7 +2294,6 @@ bool CMSCollector::verify_after_remark(bool silent) { warning("Unrecognized value " UINTX_FORMAT " for CMSRemarkVerifyVariant", CMSRemarkVerifyVariant); } - if (!silent) gclog_or_tty->print(" done] "); return true; } @@ -2435,8 +2345,10 @@ void CMSCollector::verify_after_remark_work_1() { VerifyMarkedClosure vcl(markBitMap()); verification_mark_bm()->iterate(&vcl); if (vcl.failed()) { - gclog_or_tty->print("Verification failed"); - gch->print_on(gclog_or_tty); + LogHandle(gc, verify) log; + log.info("Verification failed"); + ResourceMark rm; + gch->print_on(log.info_stream()); fatal("CMS: failed marking verification after remark"); } } @@ -2729,10 +2641,7 @@ void ConcurrentMarkSweepGeneration::expand_for_gc_cause( // a new CMS cycle. if (success) { set_expansion_cause(cause); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("Expanded CMS gen for %s", - CMSExpansionCause::to_string(cause)); - } + log_trace(gc)("Expanded CMS gen for %s", CMSExpansionCause::to_string(cause)); } } @@ -2800,9 +2709,7 @@ void ConcurrentMarkSweepGeneration::assert_correct_size_change_locking() { void ConcurrentMarkSweepGeneration::shrink_free_list_by(size_t bytes) { assert_locked_or_safepoint(Heap_lock); assert_lock_strong(freelistLock()); - if (PrintGCDetails && Verbose) { - warning("Shrinking of CMS not yet implemented"); - } + log_trace(gc)("Shrinking of CMS not yet implemented"); return; } @@ -2812,63 +2719,35 @@ void ConcurrentMarkSweepGeneration::shrink_free_list_by(size_t bytes) { class CMSPhaseAccounting: public StackObj { public: CMSPhaseAccounting(CMSCollector *collector, - const char *phase, - bool print_cr = true); + const char *title); ~CMSPhaseAccounting(); private: CMSCollector *_collector; - const char *_phase; - elapsedTimer _wallclock; - bool _print_cr; + const char *_title; + GCTraceConcTime(Info, gc) _trace_time; public: // Not MT-safe; so do not pass around these StackObj's // where they may be accessed by other threads. jlong wallclock_millis() { - assert(_wallclock.is_active(), "Wall clock should not stop"); - _wallclock.stop(); // to record time - jlong ret = _wallclock.milliseconds(); - _wallclock.start(); // restart - return ret; + return TimeHelper::counter_to_millis(os::elapsed_counter() - _trace_time.start_time()); } }; CMSPhaseAccounting::CMSPhaseAccounting(CMSCollector *collector, - const char *phase, - bool print_cr) : - _collector(collector), _phase(phase), _print_cr(print_cr) { + const char *title) : + _collector(collector), _title(title), _trace_time(title) { - if (PrintCMSStatistics != 0) { - _collector->resetYields(); - } - if (PrintGCDetails) { - gclog_or_tty->gclog_stamp(); - gclog_or_tty->print_cr("[%s-concurrent-%s-start]", - _collector->cmsGen()->short_name(), _phase); - } + _collector->resetYields(); _collector->resetTimer(); - _wallclock.start(); _collector->startTimer(); } CMSPhaseAccounting::~CMSPhaseAccounting() { - assert(_wallclock.is_active(), "Wall clock should not have stopped"); _collector->stopTimer(); - _wallclock.stop(); - if (PrintGCDetails) { - gclog_or_tty->gclog_stamp(); - gclog_or_tty->print("[%s-concurrent-%s: %3.3f/%3.3f secs]", - _collector->cmsGen()->short_name(), - _phase, _collector->timerValue(), _wallclock.seconds()); - if (_print_cr) { - gclog_or_tty->cr(); - } - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr(" (CMS-concurrent-%s yielded %d times)", _phase, - _collector->yields()); - } - } + log_debug(gc)("Concurrent active time: %.3fms", TimeHelper::counter_to_seconds(_collector->timerTicks())); + log_trace(gc)(" (CMS %s yielded %d times)", _title, _collector->yields()); } // CMS work @@ -2935,8 +2814,7 @@ void CMSCollector::checkpointRootsInitialWork() { // CMS collection cycle. setup_cms_unloading_and_verification_state(); - NOT_PRODUCT(GCTraceTime t("\ncheckpointRootsInitialWork", - PrintGCDetails && Verbose, true, _gc_timer_cm);) + GCTraceTime(Trace, gc) ts("checkpointRootsInitialWork", _gc_timer_cm); // Reset all the PLAB chunk arrays if necessary. if (_survivor_plab_array != NULL && !CMSPLABRecordAlways) { @@ -2967,9 +2845,7 @@ void CMSCollector::checkpointRootsInitialWork() { // the klasses. The claimed marks need to be cleared before marking starts. ClassLoaderDataGraph::clear_claimed_marks(); - if (CMSPrintEdenSurvivorChunks) { - print_eden_and_survivor_chunk_arrays(); - } + print_eden_and_survivor_chunk_arrays(); { #if defined(COMPILER2) || INCLUDE_JVMCI @@ -3040,17 +2916,15 @@ bool CMSCollector::markFromRoots() { // weak ref discovery by the young generation collector. CMSTokenSyncWithLocks ts(true, bitMapLock()); - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - CMSPhaseAccounting pa(this, "mark", !PrintGCDetails); + GCTraceCPUTime tcpu; + CMSPhaseAccounting pa(this, "Concrurrent Mark"); bool res = markFromRootsWork(); if (res) { _collectorState = Precleaning; } else { // We failed and a foreground collection wants to take over assert(_foregroundGCIsActive, "internal state inconsistency"); assert(_restart_addr == NULL, "foreground will restart from scratch"); - if (PrintGCDetails) { - gclog_or_tty->print_cr("bailing out to foreground collection"); - } + log_debug(gc)("bailing out to foreground collection"); } verify_overflow_empty(); return res; @@ -3255,22 +3129,14 @@ void CMSConcMarkingTask::work(uint worker_id) { _timer.start(); do_scan_and_mark(worker_id, _cms_space); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("Finished cms space scanning in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - // XXX: need xxx/xxx type of notation, two timers - } + log_trace(gc, task)("Finished cms space scanning in %dth thread: %3.3f sec", worker_id, _timer.seconds()); // ... do work stealing _timer.reset(); _timer.start(); do_work_steal(worker_id); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("Finished work stealing in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - // XXX: need xxx/xxx type of notation, two timers - } + log_trace(gc, task)("Finished work stealing in %dth thread: %3.3f sec", worker_id, _timer.seconds()); assert(_collector->_markStack.isEmpty(), "Should have been emptied"); assert(work_queue(worker_id)->size() == 0, "Should have been emptied"); // Note that under the current task protocol, the @@ -3485,10 +3351,7 @@ void Par_ConcMarkingClosure::do_oop(oop obj) { if (simulate_overflow || !(_work_queue->push(obj) || _overflow_stack->par_push(obj))) { // stack overflow - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("CMS marking stack overflow (benign) at " - SIZE_FORMAT, _overflow_stack->capacity()); - } + log_trace(gc)("CMS marking stack overflow (benign) at " SIZE_FORMAT, _overflow_stack->capacity()); // We cannot assert that the overflow stack is full because // it may have been emptied since. assert(simulate_overflow || @@ -3573,9 +3436,7 @@ void CMSConcMarkingTask::coordinator_yield() { _bit_map_lock->unlock(); ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // It is possible for whichever thread initiated the yield request // not to get a chance to wake up and take the bitmap lock between @@ -3737,8 +3598,8 @@ void CMSCollector::preclean() { } else { _start_sampling = false; } - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - CMSPhaseAccounting pa(this, "preclean", !PrintGCDetails); + GCTraceCPUTime tcpu; + CMSPhaseAccounting pa(this, "Concurrent Preclean"); preclean_work(CMSPrecleanRefLists1, CMSPrecleanSurvivors1); } CMSTokenSync x(true); // is cms thread @@ -3766,8 +3627,8 @@ void CMSCollector::abortable_preclean() { // CMSScheduleRemarkEdenSizeThreshold >= max eden size // we will never do an actual abortable preclean cycle. if (get_eden_used() > CMSScheduleRemarkEdenSizeThreshold) { - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - CMSPhaseAccounting pa(this, "abortable-preclean", !PrintGCDetails); + GCTraceCPUTime tcpu; + CMSPhaseAccounting pa(this, "Concurrent Abortable Preclean"); // We need more smarts in the abortable preclean // loop below to deal with cases where allocation // in young gen is very very slow, and our precleaning @@ -3789,15 +3650,11 @@ void CMSCollector::abortable_preclean() { // been at it for too long. if ((CMSMaxAbortablePrecleanLoops != 0) && loops >= CMSMaxAbortablePrecleanLoops) { - if (PrintGCDetails) { - gclog_or_tty->print(" CMS: abort preclean due to loops "); - } + log_debug(gc)(" CMS: abort preclean due to loops "); break; } if (pa.wallclock_millis() > CMSMaxAbortablePrecleanTime) { - if (PrintGCDetails) { - gclog_or_tty->print(" CMS: abort preclean due to time "); - } + log_debug(gc)(" CMS: abort preclean due to time "); break; } // If we are doing little work each iteration, we should @@ -3810,10 +3667,8 @@ void CMSCollector::abortable_preclean() { waited++; } } - if (PrintCMSStatistics > 0) { - gclog_or_tty->print(" [" SIZE_FORMAT " iterations, " SIZE_FORMAT " waits, " SIZE_FORMAT " cards)] ", - loops, waited, cumworkdone); - } + log_trace(gc)(" [" SIZE_FORMAT " iterations, " SIZE_FORMAT " waits, " SIZE_FORMAT " cards)] ", + loops, waited, cumworkdone); } CMSTokenSync x(true); // is cms thread if (_collectorState != Idling) { @@ -3957,9 +3812,7 @@ size_t CMSCollector::preclean_work(bool clean_refs, bool clean_survivor) { numIter < CMSPrecleanIter; numIter++, lastNumCards = curNumCards, cumNumCards += curNumCards) { curNumCards = preclean_mod_union_table(_cmsGen, &smoac_cl); - if (Verbose && PrintGCDetails) { - gclog_or_tty->print(" (modUnionTable: " SIZE_FORMAT " cards)", curNumCards); - } + log_trace(gc)(" (modUnionTable: " SIZE_FORMAT " cards)", curNumCards); // Either there are very few dirty cards, so re-mark // pause will be small anyway, or our pre-cleaning isn't // that much faster than the rate at which cards are being @@ -3979,10 +3832,8 @@ size_t CMSCollector::preclean_work(bool clean_refs, bool clean_survivor) { curNumCards = preclean_card_table(_cmsGen, &smoac_cl); cumNumCards += curNumCards; - if (PrintGCDetails && PrintCMSStatistics != 0) { - gclog_or_tty->print_cr(" (cardTable: " SIZE_FORMAT " cards, re-scanned " SIZE_FORMAT " cards, " SIZE_FORMAT " iterations)", - curNumCards, cumNumCards, numIter); - } + log_trace(gc)(" (cardTable: " SIZE_FORMAT " cards, re-scanned " SIZE_FORMAT " cards, " SIZE_FORMAT " iterations)", + curNumCards, cumNumCards, numIter); return cumNumCards; // as a measure of useful work done } @@ -4236,19 +4087,17 @@ void CMSCollector::checkpointRootsFinal() { verify_work_stacks_empty(); verify_overflow_empty(); - if (PrintGCDetails) { - gclog_or_tty->print("[YG occupancy: " SIZE_FORMAT " K (" SIZE_FORMAT " K)]", - _young_gen->used() / K, - _young_gen->capacity() / K); - } + log_debug(gc)("YG occupancy: " SIZE_FORMAT " K (" SIZE_FORMAT " K)", + _young_gen->used() / K, _young_gen->capacity() / K); { if (CMSScavengeBeforeRemark) { GenCollectedHeap* gch = GenCollectedHeap::heap(); // Temporarily set flag to false, GCH->do_collection will // expect it to be false and set to true FlagSetting fl(gch->_is_gc_active, false); - NOT_PRODUCT(GCTraceTime t("Scavenge-Before-Remark", - PrintGCDetails && Verbose, true, _gc_timer_cm);) + + GCTraceTime(Trace, gc) tm("Pause Scavenge Before Remark", _gc_timer_cm); + gch->do_collection(true, // full (i.e. force, see below) false, // !clear_all_soft_refs 0, // size @@ -4266,7 +4115,7 @@ void CMSCollector::checkpointRootsFinal() { } void CMSCollector::checkpointRootsFinalWork() { - NOT_PRODUCT(GCTraceTime tr("checkpointRootsFinalWork", PrintGCDetails, false, _gc_timer_cm);) + GCTraceTime(Trace, gc) tm("checkpointRootsFinalWork", _gc_timer_cm); assert(haveFreelistLocks(), "must have free list locks"); assert_lock_strong(bitMapLock()); @@ -4298,9 +4147,7 @@ void CMSCollector::checkpointRootsFinalWork() { // Update the saved marks which may affect the root scans. gch->save_marks(); - if (CMSPrintEdenSurvivorChunks) { - print_eden_and_survivor_chunk_arrays(); - } + print_eden_and_survivor_chunk_arrays(); { #if defined(COMPILER2) || INCLUDE_JVMCI @@ -4318,10 +4165,10 @@ void CMSCollector::checkpointRootsFinalWork() { // the most recent young generation GC, minus those cleaned up by the // concurrent precleaning. if (CMSParallelRemarkEnabled) { - GCTraceTime t("Rescan (parallel) ", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Debug, gc) t("Rescan (parallel)", _gc_timer_cm); do_remark_parallel(); } else { - GCTraceTime t("Rescan (non-parallel) ", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Debug, gc) t("Rescan (non-parallel)", _gc_timer_cm); do_remark_non_parallel(); } } @@ -4329,7 +4176,7 @@ void CMSCollector::checkpointRootsFinalWork() { verify_overflow_empty(); { - NOT_PRODUCT(GCTraceTime ts("refProcessingWork", PrintGCDetails, false, _gc_timer_cm);) + GCTraceTime(Trace, gc) ts("refProcessingWork", _gc_timer_cm); refProcessingWork(); } verify_work_stacks_empty(); @@ -4348,13 +4195,8 @@ void CMSCollector::checkpointRootsFinalWork() { size_t ser_ovflw = _ser_pmc_remark_ovflw + _ser_pmc_preclean_ovflw + _ser_kac_ovflw + _ser_kac_preclean_ovflw; if (ser_ovflw > 0) { - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("Marking stack overflow (benign) " - "(pmc_pc=" SIZE_FORMAT ", pmc_rm=" SIZE_FORMAT ", kac=" SIZE_FORMAT - ", kac_preclean=" SIZE_FORMAT ")", - _ser_pmc_preclean_ovflw, _ser_pmc_remark_ovflw, - _ser_kac_ovflw, _ser_kac_preclean_ovflw); - } + log_trace(gc)("Marking stack overflow (benign) (pmc_pc=" SIZE_FORMAT ", pmc_rm=" SIZE_FORMAT ", kac=" SIZE_FORMAT ", kac_preclean=" SIZE_FORMAT ")", + _ser_pmc_preclean_ovflw, _ser_pmc_remark_ovflw, _ser_kac_ovflw, _ser_kac_preclean_ovflw); _markStack.expand(); _ser_pmc_remark_ovflw = 0; _ser_pmc_preclean_ovflw = 0; @@ -4362,26 +4204,19 @@ void CMSCollector::checkpointRootsFinalWork() { _ser_kac_ovflw = 0; } if (_par_pmc_remark_ovflw > 0 || _par_kac_ovflw > 0) { - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("Work queue overflow (benign) " - "(pmc_rm=" SIZE_FORMAT ", kac=" SIZE_FORMAT ")", - _par_pmc_remark_ovflw, _par_kac_ovflw); - } - _par_pmc_remark_ovflw = 0; + log_trace(gc)("Work queue overflow (benign) (pmc_rm=" SIZE_FORMAT ", kac=" SIZE_FORMAT ")", + _par_pmc_remark_ovflw, _par_kac_ovflw); + _par_pmc_remark_ovflw = 0; _par_kac_ovflw = 0; } - if (PrintCMSStatistics != 0) { - if (_markStack._hit_limit > 0) { - gclog_or_tty->print_cr(" (benign) Hit max stack size limit (" SIZE_FORMAT ")", - _markStack._hit_limit); - } - if (_markStack._failed_double > 0) { - gclog_or_tty->print_cr(" (benign) Failed stack doubling (" SIZE_FORMAT ")," - " current capacity " SIZE_FORMAT, - _markStack._failed_double, - _markStack.capacity()); - } - } + if (_markStack._hit_limit > 0) { + log_trace(gc)(" (benign) Hit max stack size limit (" SIZE_FORMAT ")", + _markStack._hit_limit); + } + if (_markStack._failed_double > 0) { + log_trace(gc)(" (benign) Failed stack doubling (" SIZE_FORMAT "), current capacity " SIZE_FORMAT, + _markStack._failed_double, _markStack.capacity()); + } _markStack._hit_limit = 0; _markStack._failed_double = 0; @@ -4415,11 +4250,7 @@ void CMSParInitialMarkTask::work(uint worker_id) { { work_on_young_gen_roots(worker_id, &par_mri_cl); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished young gen initial mark scan work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished young gen initial mark scan work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); } // ---------- remaining roots -------------- @@ -4440,11 +4271,7 @@ void CMSParInitialMarkTask::work(uint worker_id) { || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache), "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops"); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished remaining root initial mark scan work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished remaining root initial mark scan work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); } // Parallel remark task @@ -4557,11 +4384,7 @@ void CMSParRemarkTask::work(uint worker_id) { { work_on_young_gen_roots(worker_id, &par_mrias_cl); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished young gen rescan work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished young gen rescan work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); } // ---------- remaining roots -------------- @@ -4580,11 +4403,7 @@ void CMSParRemarkTask::work(uint worker_id) { || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache), "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops"); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished remaining root rescan work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished remaining root rescan work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); // ---------- unhandled CLD scanning ---------- if (worker_id == 0) { // Single threaded at the moment. @@ -4603,11 +4422,7 @@ void CMSParRemarkTask::work(uint worker_id) { ClassLoaderDataGraph::remember_new_clds(false); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished unhandled CLD scanning work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished unhandled CLD scanning work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); } // ---------- dirty klass scanning ---------- @@ -4620,11 +4435,7 @@ void CMSParRemarkTask::work(uint worker_id) { ClassLoaderDataGraph::classes_do(&remark_klass_closure); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished dirty klass scanning work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished dirty klass scanning work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); } // We might have added oops to ClassLoaderData::_handles during the @@ -4642,11 +4453,7 @@ void CMSParRemarkTask::work(uint worker_id) { // "worker_id" is passed to select the task_queue for "worker_id" do_dirty_card_rescan_tasks(_cms_space, worker_id, &par_mrias_cl); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished dirty card rescan work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished dirty card rescan work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); // ---------- steal work from other threads ... // ---------- ... and drain overflow list. @@ -4654,11 +4461,7 @@ void CMSParRemarkTask::work(uint worker_id) { _timer.start(); do_work_steal(worker_id, &par_mrias_cl, _collector->hash_seed(worker_id)); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished work stealing in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished work stealing in %dth thread: %3.3f sec", worker_id, _timer.seconds()); } // Note that parameter "i" is not used. @@ -4852,11 +4655,7 @@ CMSParRemarkTask::do_work_steal(int i, Par_MarkRefsIntoAndScanClosure* cl, break; // nirvana from the infinite cycle } } - NOT_PRODUCT( - if (PrintCMSStatistics != 0) { - gclog_or_tty->print("\n\t(%d: stole %d oops)", i, num_steals); - } - ) + log_develop_trace(gc, task)("\t(%d: stole %d oops)", i, num_steals); assert(work_q->size() == 0 && _collector->overflow_list_is_empty(), "Else our work is not yet done"); } @@ -4953,9 +4752,7 @@ void CMSCollector::merge_survivor_plab_arrays(ContiguousSpace* surv, } // We are all done; record the size of the _survivor_chunk_array _survivor_chunk_index = i; // exclusive: [0, i) - if (PrintCMSStatistics > 0) { - gclog_or_tty->print(" (Survivor:" SIZE_FORMAT "chunks) ", i); - } + log_trace(gc, survivor)(" (Survivor:" SIZE_FORMAT "chunks) ", i); // Verify that we used up all the recorded entries #ifdef ASSERT size_t total = 0; @@ -4967,10 +4764,8 @@ void CMSCollector::merge_survivor_plab_arrays(ContiguousSpace* surv, // Check that the merged array is in sorted order if (total > 0) { for (size_t i = 0; i < total - 1; i++) { - if (PrintCMSStatistics > 0) { - gclog_or_tty->print(" (chunk" SIZE_FORMAT ":" INTPTR_FORMAT ") ", - i, p2i(_survivor_chunk_array[i])); - } + log_develop_trace(gc, survivor)(" (chunk" SIZE_FORMAT ":" INTPTR_FORMAT ") ", + i, p2i(_survivor_chunk_array[i])); assert(_survivor_chunk_array[i] < _survivor_chunk_array[i+1], "Not sorted"); } @@ -5104,7 +4899,7 @@ void CMSCollector::do_remark_non_parallel() { NULL, // space is set further below &_markBitMap, &_markStack, &mrias_cl); { - GCTraceTime t("grey object rescan", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Trace, gc) t("Grey Object Rescan", _gc_timer_cm); // Iterate over the dirty cards, setting the corresponding bits in the // mod union table. { @@ -5129,10 +4924,7 @@ void CMSCollector::do_remark_non_parallel() { _modUnionTable.dirty_range_iterate_clear(cms_span, &markFromDirtyCardsClosure); verify_work_stacks_empty(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print(" (re-scanned " SIZE_FORMAT " dirty cards in cms gen) ", - markFromDirtyCardsClosure.num_dirty_cards()); - } + log_trace(gc)(" (re-scanned " SIZE_FORMAT " dirty cards in cms gen) ", markFromDirtyCardsClosure.num_dirty_cards()); } } if (VerifyDuringGC && @@ -5141,7 +4933,7 @@ void CMSCollector::do_remark_non_parallel() { Universe::verify(); } { - GCTraceTime t("root rescan", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Trace, gc) t("Root Rescan", _gc_timer_cm); verify_work_stacks_empty(); @@ -5163,7 +4955,7 @@ void CMSCollector::do_remark_non_parallel() { } { - GCTraceTime t("visit unhandled CLDs", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Trace, gc) t("Visit Unhandled CLDs", _gc_timer_cm); verify_work_stacks_empty(); @@ -5182,7 +4974,7 @@ void CMSCollector::do_remark_non_parallel() { } { - GCTraceTime t("dirty klass scan", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Trace, gc) t("Dirty Klass Scan", _gc_timer_cm); verify_work_stacks_empty(); @@ -5344,11 +5136,7 @@ void CMSRefProcTaskProxy::do_work_steal(int i, break; // nirvana from the infinite cycle } } - NOT_PRODUCT( - if (PrintCMSStatistics != 0) { - gclog_or_tty->print("\n\t(%d: stole %d oops)", i, num_steals); - } - ) + log_develop_trace(gc, task)("\t(%d: stole %d oops)", i, num_steals); } void CMSRefProcTaskExecutor::execute(ProcessTask& task) @@ -5390,7 +5178,7 @@ void CMSCollector::refProcessingWork() { _span, &_markBitMap, &_markStack, &cmsKeepAliveClosure, false /* !preclean */); { - GCTraceTime t("weak refs processing", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Debug, gc) t("Weak Refs Processing", _gc_timer_cm); ReferenceProcessorStats stats; if (rp->processing_is_mt()) { @@ -5432,7 +5220,7 @@ void CMSCollector::refProcessingWork() { if (should_unload_classes()) { { - GCTraceTime t("class unloading", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Debug, gc) t("Class Unloading", _gc_timer_cm); // Unload classes and purge the SystemDictionary. bool purged_class = SystemDictionary::do_unloading(&_is_alive_closure); @@ -5445,13 +5233,13 @@ void CMSCollector::refProcessingWork() { } { - GCTraceTime t("scrub symbol table", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Debug, gc) t("Scrub Symbol Table", _gc_timer_cm); // Clean up unreferenced symbols in symbol table. SymbolTable::unlink(); } { - GCTraceTime t("scrub string table", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Debug, gc) t("Scrub String Table", _gc_timer_cm); // Delete entries for dead interned strings. StringTable::unlink(&_is_alive_closure); } @@ -5518,8 +5306,8 @@ void CMSCollector::sweep() { _intra_sweep_timer.reset(); _intra_sweep_timer.start(); { - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - CMSPhaseAccounting pa(this, "sweep", !PrintGCDetails); + GCTraceCPUTime tcpu; + CMSPhaseAccounting pa(this, "Concurrent Sweep"); // First sweep the old gen { CMSTokenSyncWithLocks ts(true, _cmsGen->freelistLock(), @@ -5602,13 +5390,8 @@ void ConcurrentMarkSweepGeneration::setNearLargestChunk() { size_t largestOffset = pointer_delta(largestAddr, minAddr); size_t nearLargestOffset = (size_t)((double)largestOffset * nearLargestPercent) - MinChunkSize; - if (PrintFLSStatistics != 0) { - gclog_or_tty->print_cr( - "CMS: Large Block: " PTR_FORMAT ";" - " Proximity: " PTR_FORMAT " -> " PTR_FORMAT, - p2i(largestAddr), - p2i(_cmsSpace->nearLargestChunk()), p2i(minAddr + nearLargestOffset)); - } + log_debug(gc, freelist)("CMS: Large Block: " PTR_FORMAT "; Proximity: " PTR_FORMAT " -> " PTR_FORMAT, + p2i(largestAddr), p2i(_cmsSpace->nearLargestChunk()), p2i(minAddr + nearLargestOffset)); _cmsSpace->set_nearLargestChunk(minAddr + nearLargestOffset); } @@ -5702,8 +5485,8 @@ void CMSCollector::reset_concurrent() { // Clear the mark bitmap (no grey objects to start with) // for the next cycle. - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - CMSPhaseAccounting cmspa(this, "reset", !PrintGCDetails); + GCTraceCPUTime tcpu; + CMSPhaseAccounting cmspa(this, "Concurrent Reset"); HeapWord* curAddr = _markBitMap.startWord(); while (curAddr < _markBitMap.endWord()) { @@ -5719,9 +5502,7 @@ void CMSCollector::reset_concurrent() { bitMapLock()->unlock(); ConcurrentMarkSweepThread::desynchronize(true); stopTimer(); - if (PrintCMSStatistics != 0) { - incrementYields(); - } + incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; i < CMSYieldSleepCount && @@ -5758,25 +5539,20 @@ void CMSCollector::reset_stw() { } void CMSCollector::do_CMS_operation(CMS_op_type op, GCCause::Cause gc_cause) { - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - GCTraceTime t(GCCauseString("GC", gc_cause), PrintGC, !PrintGCDetails, NULL); + GCTraceCPUTime tcpu; TraceCollectorStats tcs(counters()); switch (op) { case CMS_op_checkpointRootsInitial: { + GCTraceTime(Info, gc) t("Pause Initial Mark", NULL, GCCause::_no_gc, true); SvcGCMarker sgcm(SvcGCMarker::OTHER); checkpointRootsInitial(); - if (PrintGC) { - _cmsGen->printOccupancy("initial-mark"); - } break; } case CMS_op_checkpointRootsFinal: { + GCTraceTime(Info, gc) t("Pause Remark", NULL, GCCause::_no_gc, true); SvcGCMarker sgcm(SvcGCMarker::OTHER); checkpointRootsFinal(); - if (PrintGC) { - _cmsGen->printOccupancy("remark"); - } break; } default: @@ -5989,9 +5765,9 @@ bool CMSMarkStack::allocate(size_t size) { void CMSMarkStack::expand() { assert(_capacity <= MarkStackSizeMax, "stack bigger than permitted"); if (_capacity == MarkStackSizeMax) { - if (_hit_limit++ == 0 && !CMSConcurrentMTEnabled && PrintGCDetails) { + if (_hit_limit++ == 0 && !CMSConcurrentMTEnabled) { // We print a warning message only once per CMS cycle. - gclog_or_tty->print_cr(" (benign) Hit CMSMarkStack max size limit"); + log_debug(gc)(" (benign) Hit CMSMarkStack max size limit"); } return; } @@ -6011,12 +5787,11 @@ void CMSMarkStack::expand() { _base = (oop*)(_virtual_space.low()); _index = 0; _capacity = new_capacity; - } else if (_failed_double++ == 0 && !CMSConcurrentMTEnabled && PrintGCDetails) { + } else if (_failed_double++ == 0 && !CMSConcurrentMTEnabled) { // Failed to double capacity, continue; // we print a detail message only once per CMS cycle. - gclog_or_tty->print(" (benign) Failed to expand marking stack from " SIZE_FORMAT "K to " - SIZE_FORMAT "K", - _capacity / K, new_capacity / K); + log_debug(gc)(" (benign) Failed to expand marking stack from " SIZE_FORMAT "K to " SIZE_FORMAT "K", + _capacity / K, new_capacity / K); } } @@ -6093,8 +5868,10 @@ void MarkRefsIntoVerifyClosure::do_oop(oop obj) { if (_span.contains(addr)) { _verification_bm->mark(addr); if (!_cms_bm->isMarked(addr)) { - oop(addr)->print(); - gclog_or_tty->print_cr(" (" INTPTR_FORMAT " should have been marked)", p2i(addr)); + LogHandle(gc, verify) log; + ResourceMark rm; + oop(addr)->print_on(log.info_stream()); + log.info(" (" INTPTR_FORMAT " should have been marked)", p2i(addr)); fatal("... aborting"); } } @@ -6190,9 +5967,7 @@ void MarkRefsIntoAndScanClosure::do_yield_work() { _freelistLock->unlock(); ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; @@ -6348,9 +6123,7 @@ void ScanMarkedObjectsAgainCarefullyClosure::do_yield_work() { _freelistLock->unlock(); ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; i < CMSYieldSleepCount && @@ -6417,9 +6190,7 @@ void SurvivorSpacePrecleanClosure::do_yield_work() { _bit_map->lock()->unlock(); ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; i < CMSYieldSleepCount && @@ -6572,9 +6343,7 @@ void MarkFromRootsClosure::do_yield_work() { _bitMap->lock()->unlock(); ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; i < CMSYieldSleepCount && @@ -6880,17 +6649,15 @@ void PushAndMarkVerifyClosure::do_oop(oop obj) { // Oop lies in _span and isn't yet grey or black _verification_bm->mark(addr); // now grey if (!_cms_bm->isMarked(addr)) { - oop(addr)->print(); - gclog_or_tty->print_cr(" (" INTPTR_FORMAT " should have been marked)", - p2i(addr)); + LogHandle(gc, verify) log; + ResourceMark rm; + oop(addr)->print_on(log.info_stream()); + log.info(" (" INTPTR_FORMAT " should have been marked)", p2i(addr)); fatal("... aborting"); } if (!_mark_stack->push(obj)) { // stack overflow - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("CMS marking stack overflow (benign) at " - SIZE_FORMAT, _mark_stack->capacity()); - } + log_trace(gc)("CMS marking stack overflow (benign) at " SIZE_FORMAT, _mark_stack->capacity()); assert(_mark_stack->isFull(), "Else push should have succeeded"); handle_stack_overflow(addr); } @@ -6990,10 +6757,7 @@ void PushOrMarkClosure::do_oop(oop obj) { } ) if (simulate_overflow || !_markStack->push(obj)) { // stack overflow - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("CMS marking stack overflow (benign) at " - SIZE_FORMAT, _markStack->capacity()); - } + log_trace(gc)("CMS marking stack overflow (benign) at " SIZE_FORMAT, _markStack->capacity()); assert(simulate_overflow || _markStack->isFull(), "Else push should have succeeded"); handle_stack_overflow(addr); } @@ -7042,10 +6806,7 @@ void Par_PushOrMarkClosure::do_oop(oop obj) { if (simulate_overflow || !(_work_queue->push(obj) || _overflow_stack->par_push(obj))) { // stack overflow - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("CMS marking stack overflow (benign) at " - SIZE_FORMAT, _overflow_stack->capacity()); - } + log_trace(gc)("CMS marking stack overflow (benign) at " SIZE_FORMAT, _overflow_stack->capacity()); // We cannot assert that the overflow stack is full because // it may have been emptied since. assert(simulate_overflow || @@ -7207,9 +6968,7 @@ void CMSPrecleanRefsYieldClosure::do_yield_work() { ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; i < CMSYieldSleepCount && @@ -7240,10 +6999,7 @@ void MarkFromDirtyCardsClosure::do_MemRegion(MemRegion mr) { // However, that would be too strong in one case -- the last // partition ends at _unallocated_block which, in general, can be // an arbitrary boundary, not necessarily card aligned. - if (PrintCMSStatistics != 0) { - _num_dirty_cards += - mr.word_size()/CardTableModRefBS::card_size_in_words; - } + _num_dirty_cards += mr.word_size()/CardTableModRefBS::card_size_in_words; _space->object_iterate_mem(mr, &_scan_cl); } @@ -7276,10 +7032,8 @@ SweepClosure::SweepClosure(CMSCollector* collector, ) assert(_limit >= _sp->bottom() && _limit <= _sp->end(), "sweep _limit out of bounds"); - if (CMSTraceSweeper) { - gclog_or_tty->print_cr("\n====================\nStarting new sweep with limit " PTR_FORMAT, - p2i(_limit)); - } + log_develop_trace(gc, sweep)("===================="); + log_develop_trace(gc, sweep)("Starting new sweep with limit " PTR_FORMAT, p2i(_limit)); } void SweepClosure::print_on(outputStream* st) const { @@ -7306,42 +7060,32 @@ SweepClosure::~SweepClosure() { print(); ShouldNotReachHere(); } - if (Verbose && PrintGC) { - gclog_or_tty->print("Collected " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes", - _numObjectsFreed, _numWordsFreed*sizeof(HeapWord)); - gclog_or_tty->print_cr("\nLive " SIZE_FORMAT " objects, " - SIZE_FORMAT " bytes " - "Already free " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes", - _numObjectsLive, _numWordsLive*sizeof(HeapWord), - _numObjectsAlreadyFree, _numWordsAlreadyFree*sizeof(HeapWord)); - size_t totalBytes = (_numWordsFreed + _numWordsLive + _numWordsAlreadyFree) - * sizeof(HeapWord); - gclog_or_tty->print_cr("Total sweep: " SIZE_FORMAT " bytes", totalBytes); - if (PrintCMSStatistics && CMSVerifyReturnedBytes) { - size_t indexListReturnedBytes = _sp->sumIndexedFreeListArrayReturnedBytes(); - size_t dict_returned_bytes = _sp->dictionary()->sum_dict_returned_bytes(); - size_t returned_bytes = indexListReturnedBytes + dict_returned_bytes; - gclog_or_tty->print("Returned " SIZE_FORMAT " bytes", returned_bytes); - gclog_or_tty->print(" Indexed List Returned " SIZE_FORMAT " bytes", - indexListReturnedBytes); - gclog_or_tty->print_cr(" Dictionary Returned " SIZE_FORMAT " bytes", - dict_returned_bytes); - } + if (log_is_enabled(Debug, gc, sweep)) { + log_debug(gc, sweep)("Collected " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes", + _numObjectsFreed, _numWordsFreed*sizeof(HeapWord)); + log_debug(gc, sweep)("Live " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes Already free " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes", + _numObjectsLive, _numWordsLive*sizeof(HeapWord), _numObjectsAlreadyFree, _numWordsAlreadyFree*sizeof(HeapWord)); + size_t totalBytes = (_numWordsFreed + _numWordsLive + _numWordsAlreadyFree) * sizeof(HeapWord); + log_debug(gc, sweep)("Total sweep: " SIZE_FORMAT " bytes", totalBytes); } - if (CMSTraceSweeper) { - gclog_or_tty->print_cr("end of sweep with _limit = " PTR_FORMAT "\n================", - p2i(_limit)); + + if (log_is_enabled(Trace, gc, sweep) && CMSVerifyReturnedBytes) { + size_t indexListReturnedBytes = _sp->sumIndexedFreeListArrayReturnedBytes(); + size_t dict_returned_bytes = _sp->dictionary()->sum_dict_returned_bytes(); + size_t returned_bytes = indexListReturnedBytes + dict_returned_bytes; + log_trace(gc, sweep)("Returned " SIZE_FORMAT " bytes Indexed List Returned " SIZE_FORMAT " bytes Dictionary Returned " SIZE_FORMAT " bytes", + returned_bytes, indexListReturnedBytes, dict_returned_bytes); } + log_develop_trace(gc, sweep)("end of sweep with _limit = " PTR_FORMAT, p2i(_limit)); + log_develop_trace(gc, sweep)("================"); } #endif // PRODUCT void SweepClosure::initialize_free_range(HeapWord* freeFinger, bool freeRangeInFreeLists) { - if (CMSTraceSweeper) { - gclog_or_tty->print("---- Start free range at " PTR_FORMAT " with free block (%d)\n", - p2i(freeFinger), freeRangeInFreeLists); - } + log_develop_trace(gc, sweep)("---- Start free range at " PTR_FORMAT " with free block (%d)", + p2i(freeFinger), freeRangeInFreeLists); assert(!inFreeRange(), "Trampling existing free range"); set_inFreeRange(true); set_lastFreeRangeCoalesced(false); @@ -7407,13 +7151,9 @@ size_t SweepClosure::do_blk_careful(HeapWord* addr) { "freeFinger() " PTR_FORMAT " is out-of-bounds", p2i(freeFinger())); flush_cur_free_chunk(freeFinger(), pointer_delta(addr, freeFinger())); - if (CMSTraceSweeper) { - gclog_or_tty->print("Sweep: last chunk: "); - gclog_or_tty->print("put_free_blk " PTR_FORMAT " (" SIZE_FORMAT ") " - "[coalesced:%d]\n", - p2i(freeFinger()), pointer_delta(addr, freeFinger()), - lastFreeRangeCoalesced() ? 1 : 0); - } + log_develop_trace(gc, sweep)("Sweep: last chunk: put_free_blk " PTR_FORMAT " (" SIZE_FORMAT ") [coalesced:%d]", + p2i(freeFinger()), pointer_delta(addr, freeFinger()), + lastFreeRangeCoalesced() ? 1 : 0); } // help the iterator loop finish @@ -7624,9 +7364,7 @@ void SweepClosure::do_post_free_or_garbage_chunk(FreeChunk* fc, assert(_sp->verify_chunk_in_free_list(fc), "free chunk is not in free lists"); } - if (CMSTraceSweeper) { - gclog_or_tty->print_cr(" -- pick up another chunk at " PTR_FORMAT " (" SIZE_FORMAT ")", p2i(fc), chunkSize); - } + log_develop_trace(gc, sweep)(" -- pick up another chunk at " PTR_FORMAT " (" SIZE_FORMAT ")", p2i(fc), chunkSize); HeapWord* const fc_addr = (HeapWord*) fc; @@ -7727,16 +7465,12 @@ void SweepClosure::lookahead_and_flush(FreeChunk* fc, size_t chunk_size) { p2i(eob), p2i(eob-1), p2i(_limit), p2i(_sp->bottom()), p2i(_sp->end()), p2i(fc), chunk_size); if (eob >= _limit) { assert(eob == _limit || fc->is_free(), "Only a free chunk should allow us to cross over the limit"); - if (CMSTraceSweeper) { - gclog_or_tty->print_cr("_limit " PTR_FORMAT " reached or crossed by block " - "[" PTR_FORMAT "," PTR_FORMAT ") in space " - "[" PTR_FORMAT "," PTR_FORMAT ")", - p2i(_limit), p2i(fc), p2i(eob), p2i(_sp->bottom()), p2i(_sp->end())); - } + log_develop_trace(gc, sweep)("_limit " PTR_FORMAT " reached or crossed by block " + "[" PTR_FORMAT "," PTR_FORMAT ") in space " + "[" PTR_FORMAT "," PTR_FORMAT ")", + p2i(_limit), p2i(fc), p2i(eob), p2i(_sp->bottom()), p2i(_sp->end())); // Return the storage we are tracking back into the free lists. - if (CMSTraceSweeper) { - gclog_or_tty->print_cr("Flushing ... "); - } + log_develop_trace(gc, sweep)("Flushing ... "); assert(freeFinger() < eob, "Error"); flush_cur_free_chunk( freeFinger(), pointer_delta(eob, freeFinger())); } @@ -7753,10 +7487,7 @@ void SweepClosure::flush_cur_free_chunk(HeapWord* chunk, size_t size) { assert(!_sp->verify_chunk_in_free_list(fc), "chunk should not be in free lists yet"); } - if (CMSTraceSweeper) { - gclog_or_tty->print_cr(" -- add free block " PTR_FORMAT " (" SIZE_FORMAT ") to free lists", - p2i(chunk), size); - } + log_develop_trace(gc, sweep)(" -- add free block " PTR_FORMAT " (" SIZE_FORMAT ") to free lists", p2i(chunk), size); // A new free range is going to be starting. The current // free range has not been added to the free lists yet or // was removed so add it back. @@ -7767,8 +7498,8 @@ void SweepClosure::flush_cur_free_chunk(HeapWord* chunk, size_t size) { } _sp->addChunkAndRepairOffsetTable(chunk, size, lastFreeRangeCoalesced()); - } else if (CMSTraceSweeper) { - gclog_or_tty->print_cr("Already in free list: nothing to flush"); + } else { + log_develop_trace(gc, sweep)("Already in free list: nothing to flush"); } set_inFreeRange(false); set_freeRangeInFreeLists(false); @@ -7799,9 +7530,7 @@ void SweepClosure::do_yield_work(HeapWord* addr) { _freelistLock->unlock(); ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; i < CMSYieldSleepCount && @@ -7826,10 +7555,8 @@ bool debug_verify_chunk_in_free_list(FreeChunk* fc) { #endif void SweepClosure::print_free_block_coalesced(FreeChunk* fc) const { - if (CMSTraceSweeper) { - gclog_or_tty->print_cr("Sweep:coal_free_blk " PTR_FORMAT " (" SIZE_FORMAT ")", - p2i(fc), fc->size()); - } + log_develop_trace(gc, sweep)("Sweep:coal_free_blk " PTR_FORMAT " (" SIZE_FORMAT ")", + p2i(fc), fc->size()); } // CMSIsAliveClosure diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp index 10eb76fb35b..2e579152e38 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp @@ -35,6 +35,7 @@ #include "gc/shared/generationCounters.hpp" #include "gc/shared/space.hpp" #include "gc/shared/taskqueue.hpp" +#include "logging/log.hpp" #include "memory/freeBlockDictionary.hpp" #include "memory/iterator.hpp" #include "memory/virtualspace.hpp" @@ -308,9 +309,8 @@ class ChunkArray: public CHeapObj { void reset() { _index = 0; - if (_overflows > 0 && PrintCMSStatistics > 1) { - warning("CMS: ChunkArray[" SIZE_FORMAT "] overflowed " SIZE_FORMAT " times", - _capacity, _overflows); + if (_overflows > 0) { + log_trace(gc)("CMS: ChunkArray[" SIZE_FORMAT "] overflowed " SIZE_FORMAT " times", _capacity, _overflows); } _overflows = 0; } @@ -451,7 +451,7 @@ class CMSStats VALUE_OBJ_CLASS_SPEC { // Debugging. void print_on(outputStream* st) const PRODUCT_RETURN; - void print() const { print_on(gclog_or_tty); } + void print() const { print_on(tty); } }; // A closure related to weak references processing which @@ -935,7 +935,7 @@ class CMSCollector: public CHeapObj { void startTimer() { assert(!_timer.is_active(), "Error"); _timer.start(); } void stopTimer() { assert( _timer.is_active(), "Error"); _timer.stop(); } void resetTimer() { assert(!_timer.is_active(), "Error"); _timer.reset(); } - double timerValue() { assert(!_timer.is_active(), "Error"); return _timer.seconds(); } + jlong timerTicks() { assert(!_timer.is_active(), "Error"); return _timer.ticks(); } int yields() { return _numYields; } void resetYields() { _numYields = 0; } @@ -961,7 +961,7 @@ class CMSCollector: public CHeapObj { // Debugging void verify(); - bool verify_after_remark(bool silent = VerifySilently); + bool verify_after_remark(); void verify_ok_to_terminate() const PRODUCT_RETURN; void verify_work_stacks_empty() const PRODUCT_RETURN; void verify_overflow_empty() const PRODUCT_RETURN; @@ -1234,7 +1234,6 @@ class ConcurrentMarkSweepGeneration: public CardGeneration { const char* name() const; virtual const char* short_name() const { return "CMS"; } void print() const; - void printOccupancy(const char* s); // Resize the generation after a compacting GC. The // generation can be treated as a contiguous space diff --git a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp index 890c84bc694..2cd32b097dc 100644 --- a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp @@ -34,7 +34,7 @@ #include "gc/shared/gcHeapSummary.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/generation.hpp" @@ -45,6 +45,7 @@ #include "gc/shared/strongRootsScope.hpp" #include "gc/shared/taskqueue.inline.hpp" #include "gc/shared/workgroup.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" @@ -270,9 +271,9 @@ void ParScanThreadState::undo_alloc_in_to_space(HeapWord* obj, size_t word_sz) { } void ParScanThreadState::print_promotion_failure_size() { - if (_promotion_failed_info.has_failed() && PrintPromotionFailure) { - gclog_or_tty->print(" (%d: promotion failure size = " SIZE_FORMAT ") ", - _thread_num, _promotion_failed_info.first_size()); + if (_promotion_failed_info.has_failed()) { + log_trace(gc, promotion)(" (%d: promotion failure size = " SIZE_FORMAT ") ", + _thread_num, _promotion_failed_info.first_size()); } } @@ -298,11 +299,11 @@ public: #if TASKQUEUE_STATS static void - print_termination_stats_hdr(outputStream* const st = gclog_or_tty); - void print_termination_stats(outputStream* const st = gclog_or_tty); + print_termination_stats_hdr(outputStream* const st); + void print_termination_stats(); static void - print_taskqueue_stats_hdr(outputStream* const st = gclog_or_tty); - void print_taskqueue_stats(outputStream* const st = gclog_or_tty); + print_taskqueue_stats_hdr(outputStream* const st); + void print_taskqueue_stats(); void reset_stats(); #endif // TASKQUEUE_STATS @@ -383,7 +384,15 @@ void ParScanThreadStateSet::print_termination_stats_hdr(outputStream* const st) st->print_raw_cr("--- --------- --------- ------ --------- ------ --------"); } -void ParScanThreadStateSet::print_termination_stats(outputStream* const st) { +void ParScanThreadStateSet::print_termination_stats() { + LogHandle(gc, task, stats) log; + if (!log.is_debug()) { + return; + } + + ResourceMark rm; + outputStream* st = log.debug_stream(); + print_termination_stats_hdr(st); for (int i = 0; i < length(); ++i) { @@ -404,7 +413,13 @@ void ParScanThreadStateSet::print_taskqueue_stats_hdr(outputStream* const st) { st->print_raw("--- "); TaskQueueStats::print_header(2, st); st->cr(); } -void ParScanThreadStateSet::print_taskqueue_stats(outputStream* const st) { +void ParScanThreadStateSet::print_taskqueue_stats() { + if (!develop_log_is_enabled(Trace, gc, task, stats)) { + return; + } + LogHandle(gc, task, stats) log; + ResourceMark rm; + outputStream* st = log.trace_stream(); print_taskqueue_stats_hdr(st); TaskQueueStats totals; @@ -823,9 +838,7 @@ void ParNewGeneration::handle_promotion_failed(GenCollectedHeap* gch, ParScanThr _promo_failure_scan_stack.clear(true); // Clear cached segments. remove_forwarding_pointers(); - if (PrintGCDetails) { - gclog_or_tty->print(" (promotion failed)"); - } + log_info(gc, promotion)("Promotion failed"); // All the spaces are in play for mark-sweep. swap_spaces(); // Make life simpler for CMS || rescan; see 6483690. from()->set_next_compaction_space(to()); @@ -882,9 +895,7 @@ void ParNewGeneration::collect(bool full, size_policy->minor_collection_begin(); } - GCTraceTime t1(GCCauseString("GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL); - // Capture heap used before collection (for printing). - size_t gch_prev_used = gch->used(); + GCTraceTime(Trace, gc) t1("ParNew", NULL, gch->gc_cause()); age_table()->clear(); to()->clear(SpaceDecorator::Mangle); @@ -990,12 +1001,8 @@ void ParNewGeneration::collect(bool full, plab_stats()->adjust_desired_plab_sz(); } - if (PrintGC && !PrintGCDetails) { - gch->print_heap_change(gch_prev_used); - } - - TASKQUEUE_STATS_ONLY(if (PrintTerminationStats) thread_state_set.print_termination_stats()); - TASKQUEUE_STATS_ONLY(if (PrintTaskqueue) thread_state_set.print_taskqueue_stats()); + TASKQUEUE_STATS_ONLY(thread_state_set.print_termination_stats()); + TASKQUEUE_STATS_ONLY(thread_state_set.print_taskqueue_stats()); if (UseAdaptiveSizePolicy) { size_policy->minor_collection_end(gch->gc_cause()); @@ -1150,11 +1157,9 @@ oop ParNewGeneration::copy_to_survivor_space(ParScanThreadState* par_scan_state, // This code must come after the CAS test, or it will print incorrect // information. - if (TraceScavenge) { - gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", - is_in_reserved(new_obj) ? "copying" : "tenuring", - new_obj->klass()->internal_name(), p2i(old), p2i(new_obj), new_obj->size()); - } + log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", + is_in_reserved(new_obj) ? "copying" : "tenuring", + new_obj->klass()->internal_name(), p2i(old), p2i(new_obj), new_obj->size()); if (forward_ptr == NULL) { oop obj_to_push = new_obj; @@ -1176,9 +1181,7 @@ oop ParNewGeneration::copy_to_survivor_space(ParScanThreadState* par_scan_state, ) if (simulate_overflow || !par_scan_state->work_queue()->push(obj_to_push)) { // Add stats for overflow pushes. - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("queue overflow!\n"); - } + log_develop_trace(gc)("Queue Overflow"); push_on_overflow_list(old, par_scan_state); TASKQUEUE_STATS_ONLY(par_scan_state->taskqueue_stats().record_overflow(0)); } diff --git a/hotspot/src/share/vm/gc/cms/parOopClosures.inline.hpp b/hotspot/src/share/vm/gc/cms/parOopClosures.inline.hpp index 6619cb09225..6f8011eefd7 100644 --- a/hotspot/src/share/vm/gc/cms/parOopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/cms/parOopClosures.inline.hpp @@ -30,6 +30,7 @@ #include "gc/shared/cardTableRS.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/genOopClosures.inline.hpp" +#include "logging/log.hpp" template inline void ParScanWeakRefClosure::do_oop_work(T* p) { assert (!oopDesc::is_null(*p), "null weak reference?"); @@ -108,11 +109,9 @@ inline void ParScanClosure::do_oop_work(T* p, if (m->is_marked()) { // Contains forwarding pointer. new_obj = ParNewGeneration::real_forwardee(obj); oopDesc::encode_store_heap_oop_not_null(p, new_obj); - if (TraceScavenge) { - gclog_or_tty->print_cr("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", - "forwarded ", - new_obj->klass()->internal_name(), p2i(p), p2i((void *)obj), p2i((void *)new_obj), new_obj->size()); - } + log_develop_trace(gc, scavenge)("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", + "forwarded ", + new_obj->klass()->internal_name(), p2i(p), p2i((void *)obj), p2i((void *)new_obj), new_obj->size()); } else { size_t obj_sz = obj->size_given_klass(objK); new_obj = _g->copy_to_survivor_space(_par_scan_state, obj, obj_sz, m); diff --git a/hotspot/src/share/vm/gc/cms/promotionInfo.hpp b/hotspot/src/share/vm/gc/cms/promotionInfo.hpp index beb9d4d6068..d42a8dbd119 100644 --- a/hotspot/src/share/vm/gc/cms/promotionInfo.hpp +++ b/hotspot/src/share/vm/gc/cms/promotionInfo.hpp @@ -132,7 +132,7 @@ class SpoolBlock: public FreeChunk { } void print_on(outputStream* st) const; - void print() const { print_on(gclog_or_tty); } + void print() const { print_on(tty); } }; class PromotionInfo VALUE_OBJ_CLASS_SPEC { diff --git a/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp b/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp index 426c41e1d67..dcdfa854377 100644 --- a/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp +++ b/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp @@ -28,7 +28,7 @@ #include "gc/cms/vmCMSOperations.hpp" #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcTimer.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/os.hpp" @@ -58,7 +58,7 @@ void VM_CMS_Operation::release_and_notify_pending_list_lock() { void VM_CMS_Operation::verify_before_gc() { if (VerifyBeforeGC && GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { - GCTraceTime tm("Verify Before", false, false, _collector->_gc_timer_cm); + GCTraceTime(Info, gc, verify) tm("Verify Before", _collector->_gc_timer_cm); HandleMark hm; FreelistLocker x(_collector); MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag); @@ -70,7 +70,7 @@ void VM_CMS_Operation::verify_before_gc() { void VM_CMS_Operation::verify_after_gc() { if (VerifyAfterGC && GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { - GCTraceTime tm("Verify After", false, false, _collector->_gc_timer_cm); + GCTraceTime(Info, gc, verify) tm("Verify After", _collector->_gc_timer_cm); HandleMark hm; FreelistLocker x(_collector); MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag); diff --git a/hotspot/src/share/vm/gc/g1/collectionSetChooser.cpp b/hotspot/src/share/vm/gc/g1/collectionSetChooser.cpp index 9ac0304a02b..fcc1f8e526f 100644 --- a/hotspot/src/share/vm/gc/g1/collectionSetChooser.cpp +++ b/hotspot/src/share/vm/gc/g1/collectionSetChooser.cpp @@ -26,7 +26,6 @@ #include "gc/g1/collectionSetChooser.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" -#include "gc/g1/g1ErgoVerbose.hpp" #include "gc/shared/space.inline.hpp" #include "runtime/atomic.inline.hpp" @@ -136,8 +135,8 @@ void CollectionSetChooser::sort_regions() { assert(regions_at(i) != NULL, "Should be true by sorting!"); } #endif // ASSERT - if (G1PrintRegionLivenessInfo) { - G1PrintRegionLivenessInfoClosure cl(gclog_or_tty, "Post-Sorting"); + if (log_is_enabled(Trace, gc, liveness)) { + G1PrintRegionLivenessInfoClosure cl("Post-Sorting"); for (uint i = 0; i < _end; ++i) { HeapRegion* r = regions_at(i); cl.doHeapRegion(r); diff --git a/hotspot/src/share/vm/gc/g1/concurrentG1RefineThread.cpp b/hotspot/src/share/vm/gc/g1/concurrentG1RefineThread.cpp index a65b0638a82..aabf6790d80 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentG1RefineThread.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentG1RefineThread.cpp @@ -28,6 +28,7 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/g1/suspendibleThreadSet.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "runtime/handles.inline.hpp" #include "runtime/mutexLocker.hpp" @@ -88,11 +89,8 @@ bool ConcurrentG1RefineThread::is_active() { void ConcurrentG1RefineThread::activate() { MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag); if (!is_primary()) { - if (G1TraceConcRefinement) { - DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); - gclog_or_tty->print_cr("G1-Refine-activated worker %d, on threshold %d, current %d", - _worker_id, _threshold, (int)dcqs.completed_buffers_num()); - } + log_debug(gc, refine)("G1-Refine-activated worker %d, on threshold %d, current %d", + _worker_id, _threshold, JavaThread::dirty_card_queue_set().completed_buffers_num()); set_active(true); } else { DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); @@ -104,11 +102,8 @@ void ConcurrentG1RefineThread::activate() { void ConcurrentG1RefineThread::deactivate() { MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag); if (!is_primary()) { - if (G1TraceConcRefinement) { - DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); - gclog_or_tty->print_cr("G1-Refine-deactivated worker %d, off threshold %d, current %d", - _worker_id, _deactivation_threshold, (int)dcqs.completed_buffers_num()); - } + log_debug(gc, refine)("G1-Refine-deactivated worker %d, off threshold %d, current %d", + _worker_id, _deactivation_threshold, JavaThread::dirty_card_queue_set().completed_buffers_num()); set_active(false); } else { DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); @@ -174,9 +169,7 @@ void ConcurrentG1RefineThread::run_service() { } } - if (G1TraceConcRefinement) { - gclog_or_tty->print_cr("G1-Refine-stop"); - } + log_debug(gc, refine)("G1-Refine-stop"); } void ConcurrentG1RefineThread::stop() { @@ -199,4 +192,4 @@ void ConcurrentG1RefineThread::stop() { void ConcurrentG1RefineThread::stop_service() { MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag); _monitor->notify(); -} \ No newline at end of file +} diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp index 5ad17675ed3..e1f73491452 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp @@ -31,8 +31,6 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/g1/g1CollectorState.hpp" -#include "gc/g1/g1ErgoVerbose.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/g1OopClosures.inline.hpp" #include "gc/g1/g1RemSet.hpp" #include "gc/g1/g1StringDedup.hpp" @@ -44,12 +42,13 @@ #include "gc/shared/gcId.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/strongRootsScope.hpp" #include "gc/shared/taskqueue.inline.hpp" #include "gc/shared/vmGCOperations.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" @@ -232,9 +231,7 @@ void CMMarkStack::expand() { // Clear expansion flag _should_expand = false; if (_capacity == (jint) MarkStackSizeMax) { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr(" (benign) Can't expand marking stack capacity, at max size limit"); - } + log_trace(gc)("(benign) Can't expand marking stack capacity, at max size limit"); return; } // Double capacity if possible @@ -254,12 +251,9 @@ void CMMarkStack::expand() { _index = 0; _capacity = new_capacity; } else { - if (PrintGCDetails && Verbose) { - // Failed to double capacity, continue; - gclog_or_tty->print(" (benign) Failed to expand marking stack capacity from " - SIZE_FORMAT "K to " SIZE_FORMAT "K", - _capacity / K, new_capacity / K); - } + // Failed to double capacity, continue; + log_trace(gc)("(benign) Failed to expand marking stack capacity from " SIZE_FORMAT "K to " SIZE_FORMAT "K", + _capacity / K, new_capacity / K); } } @@ -848,10 +842,7 @@ void ConcurrentMark::enter_first_sync_barrier(uint worker_id) { // marking. reset_marking_state(true /* clear_overflow */); - if (G1Log::fine()) { - gclog_or_tty->gclog_stamp(); - gclog_or_tty->print_cr("[GC concurrent-mark-reset-for-overflow]"); - } + log_info(gc)("Concurrent Mark reset for overflow"); } } @@ -987,8 +978,6 @@ public: }; void ConcurrentMark::scanRootRegions() { - double scan_start = os::elapsedTime(); - // Start of concurrent marking. ClassLoaderDataGraph::clear_claimed_marks(); @@ -996,10 +985,7 @@ void ConcurrentMark::scanRootRegions() { // at least one root region to scan. So, if it's false, we // should not attempt to do any further work. if (root_regions()->scan_in_progress()) { - if (G1Log::fine()) { - gclog_or_tty->gclog_stamp(); - gclog_or_tty->print_cr("[GC concurrent-root-region-scan-start]"); - } + GCTraceConcTime(Info, gc) tt("Concurrent Root Region Scan"); _parallel_marking_threads = calc_parallel_marking_threads(); assert(parallel_marking_threads() <= max_parallel_marking_threads(), @@ -1010,11 +996,6 @@ void ConcurrentMark::scanRootRegions() { _parallel_workers->set_active_workers(active_workers); _parallel_workers->run_task(&task); - if (G1Log::fine()) { - gclog_or_tty->gclog_stamp(); - gclog_or_tty->print_cr("[GC concurrent-root-region-scan-end, %1.7lf secs]", os::elapsedTime() - scan_start); - } - // It's possible that has_aborted() is true here without actually // aborting the survivor scan earlier. This is OK as it's // mainly used for sanity checking. @@ -1049,22 +1030,6 @@ void ConcurrentMark::markFromRoots() { print_stats(); } -// Helper class to get rid of some boilerplate code. -class G1CMTraceTime : public StackObj { - GCTraceTimeImpl _gc_trace_time; - static bool doit_and_prepend(bool doit) { - if (doit) { - gclog_or_tty->put(' '); - } - return doit; - } - - public: - G1CMTraceTime(const char* title, bool doit) - : _gc_trace_time(title, doit_and_prepend(doit), false, G1CollectedHeap::heap()->gc_timer_cm()) { - } -}; - void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { // world is stopped at this checkpoint assert(SafepointSynchronize::is_at_safepoint(), @@ -1083,8 +1048,7 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { if (VerifyDuringGC) { HandleMark hm; // handle scope g1h->prepare_for_verify(); - Universe::verify(VerifyOption_G1UsePrevMarking, - " VerifyDuringGC:(before)"); + Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (before)"); } g1h->check_bitmaps("Remark Start"); @@ -1102,16 +1066,13 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { if (has_overflown()) { // Oops. We overflowed. Restart concurrent marking. _restart_for_overflow = true; - if (G1TraceMarkStackOverflow) { - gclog_or_tty->print_cr("\nRemark led to restart for overflow."); - } + log_develop_trace(gc)("Remark led to restart for overflow."); // Verify the heap w.r.t. the previous marking bitmap. if (VerifyDuringGC) { HandleMark hm; // handle scope g1h->prepare_for_verify(); - Universe::verify(VerifyOption_G1UsePrevMarking, - " VerifyDuringGC:(overflow)"); + Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (overflow)"); } // Clear the marking state because we will be restarting @@ -1119,7 +1080,7 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { reset_marking_state(); } else { { - G1CMTraceTime trace("GC aggregate-data", G1Log::finer()); + GCTraceTime(Debug, gc) trace("GC Aggregate Data", g1h->gc_timer_cm()); // Aggregate the per-task counting data that we have accumulated // while marking. @@ -1136,8 +1097,7 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { if (VerifyDuringGC) { HandleMark hm; // handle scope g1h->prepare_for_verify(); - Universe::verify(VerifyOption_G1UseNextMarking, - " VerifyDuringGC:(after)"); + Universe::verify(VerifyOption_G1UseNextMarking, "During GC (after)"); } g1h->check_bitmaps("Remark End"); assert(!restart_for_overflow(), "sanity"); @@ -1656,8 +1616,7 @@ void ConcurrentMark::cleanup() { if (VerifyDuringGC) { HandleMark hm; // handle scope g1h->prepare_for_verify(); - Universe::verify(VerifyOption_G1UsePrevMarking, - " VerifyDuringGC:(before)"); + Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (before)"); } g1h->check_bitmaps("Cleanup Start"); @@ -1699,8 +1658,8 @@ void ConcurrentMark::cleanup() { double this_final_counting_time = (count_end - start); _total_counting_time += this_final_counting_time; - if (G1PrintRegionLivenessInfo) { - G1PrintRegionLivenessInfoClosure cl(gclog_or_tty, "Post-Marking"); + if (log_is_enabled(Trace, gc, liveness)) { + G1PrintRegionLivenessInfoClosure cl("Post-Marking"); _g1h->heap_region_iterate(&cl); } @@ -1743,10 +1702,6 @@ void ConcurrentMark::cleanup() { double end = os::elapsedTime(); _cleanup_times.add((end - start) * 1000.0); - if (G1Log::fine()) { - g1h->g1_policy()->print_heap_transition(start_used_bytes); - } - // Clean up will have freed any regions completely full of garbage. // Update the soft reference policy with the new heap occupancy. Universe::update_heap_info_at_gc(); @@ -1754,8 +1709,7 @@ void ConcurrentMark::cleanup() { if (VerifyDuringGC) { HandleMark hm; // handle scope g1h->prepare_for_verify(); - Universe::verify(VerifyOption_G1UsePrevMarking, - " VerifyDuringGC:(after)"); + Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (after)"); } g1h->check_bitmaps("Cleanup End"); @@ -1788,11 +1742,9 @@ void ConcurrentMark::completeCleanup() { _cleanup_list.verify_optional(); FreeRegionList tmp_free_list("Tmp Free List"); - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [complete cleanup] : " - "cleanup list has %u entries", - _cleanup_list.length()); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [complete cleanup] : " + "cleanup list has %u entries", + _cleanup_list.length()); // No one else should be accessing the _cleanup_list at this point, // so it is not necessary to take any locks @@ -1810,13 +1762,11 @@ void ConcurrentMark::completeCleanup() { // region from the _cleanup_list). if ((tmp_free_list.length() % G1SecondaryFreeListAppendLength == 0) || _cleanup_list.is_empty()) { - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [complete cleanup] : " - "appending %u entries to the secondary_free_list, " - "cleanup list still has %u entries", - tmp_free_list.length(), - _cleanup_list.length()); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [complete cleanup] : " + "appending %u entries to the secondary_free_list, " + "cleanup list still has %u entries", + tmp_free_list.length(), + _cleanup_list.length()); { MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag); @@ -2073,7 +2023,7 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { // Inner scope to exclude the cleaning of the string and symbol // tables from the displayed time. { - G1CMTraceTime t("GC ref-proc", G1Log::finer()); + GCTraceTime(Debug, gc) trace("GC Ref Proc", g1h->gc_timer_cm()); ReferenceProcessor* rp = g1h->ref_processor_cm(); @@ -2163,24 +2113,24 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { // Unload Klasses, String, Symbols, Code Cache, etc. { - G1CMTraceTime trace("Unloading", G1Log::finer()); + GCTraceTime(Debug, gc) trace("Unloading", g1h->gc_timer_cm()); if (ClassUnloadingWithConcurrentMark) { bool purged_classes; { - G1CMTraceTime trace("System Dictionary Unloading", G1Log::finest()); + GCTraceTime(Trace, gc) trace("System Dictionary Unloading", g1h->gc_timer_cm()); purged_classes = SystemDictionary::do_unloading(&g1_is_alive, false /* Defer klass cleaning */); } { - G1CMTraceTime trace("Parallel Unloading", G1Log::finest()); + GCTraceTime(Trace, gc) trace("Parallel Unloading", g1h->gc_timer_cm()); weakRefsWorkParallelPart(&g1_is_alive, purged_classes); } } if (G1StringDedup::is_enabled()) { - G1CMTraceTime trace("String Deduplication Unlink", G1Log::finest()); + GCTraceTime(Trace, gc) trace("String Deduplication Unlink", g1h->gc_timer_cm()); G1StringDedup::unlink(&g1_is_alive); } } @@ -2301,7 +2251,7 @@ void ConcurrentMark::checkpointRootsFinalWork() { HandleMark hm; G1CollectedHeap* g1h = G1CollectedHeap::heap(); - G1CMTraceTime trace("Finalize Marking", G1Log::finer()); + GCTraceTime(Debug, gc) trace("Finalize Marking", g1h->gc_timer_cm()); g1h->ensure_parsability(false); @@ -2614,12 +2564,13 @@ void ConcurrentMark::clear_all_count_data() { } void ConcurrentMark::print_stats() { - if (G1MarkingVerboseLevel > 0) { - gclog_or_tty->print_cr("---------------------------------------------------------------------"); - for (size_t i = 0; i < _active_tasks; ++i) { - _tasks[i]->print_stats(); - gclog_or_tty->print_cr("---------------------------------------------------------------------"); - } + if (!log_is_enabled(Debug, gc, stats)) { + return; + } + log_debug(gc, stats)("---------------------------------------------------------------------"); + for (size_t i = 0; i < _active_tasks; ++i) { + _tasks[i]->print_stats(); + log_debug(gc, stats)("---------------------------------------------------------------------"); } } @@ -2663,16 +2614,21 @@ void ConcurrentMark::abort() { static void print_ms_time_info(const char* prefix, const char* name, NumberSeq& ns) { - gclog_or_tty->print_cr("%s%5d %12s: total time = %8.2f s (avg = %8.2f ms).", + log_trace(gc, marking)("%s%5d %12s: total time = %8.2f s (avg = %8.2f ms).", prefix, ns.num(), name, ns.sum()/1000.0, ns.avg()); if (ns.num() > 0) { - gclog_or_tty->print_cr("%s [std. dev = %8.2f ms, max = %8.2f ms]", + log_trace(gc, marking)("%s [std. dev = %8.2f ms, max = %8.2f ms]", prefix, ns.sd(), ns.maximum()); } } void ConcurrentMark::print_summary_info() { - gclog_or_tty->print_cr(" Concurrent marking:"); + LogHandle(gc, marking) log; + if (!log.is_trace()) { + return; + } + + log.trace(" Concurrent marking:"); print_ms_time_info(" ", "init marks", _init_times); print_ms_time_info(" ", "remarks", _remark_times); { @@ -2681,25 +2637,16 @@ void ConcurrentMark::print_summary_info() { } print_ms_time_info(" ", "cleanups", _cleanup_times); - gclog_or_tty->print_cr(" Final counting total time = %8.2f s (avg = %8.2f ms).", - _total_counting_time, - (_cleanup_times.num() > 0 ? _total_counting_time * 1000.0 / - (double)_cleanup_times.num() - : 0.0)); + log.trace(" Final counting total time = %8.2f s (avg = %8.2f ms).", + _total_counting_time, (_cleanup_times.num() > 0 ? _total_counting_time * 1000.0 / (double)_cleanup_times.num() : 0.0)); if (G1ScrubRemSets) { - gclog_or_tty->print_cr(" RS scrub total time = %8.2f s (avg = %8.2f ms).", - _total_rs_scrub_time, - (_cleanup_times.num() > 0 ? _total_rs_scrub_time * 1000.0 / - (double)_cleanup_times.num() - : 0.0)); + log.trace(" RS scrub total time = %8.2f s (avg = %8.2f ms).", + _total_rs_scrub_time, (_cleanup_times.num() > 0 ? _total_rs_scrub_time * 1000.0 / (double)_cleanup_times.num() : 0.0)); } - gclog_or_tty->print_cr(" Total stop_world time = %8.2f s.", - (_init_times.sum() + _remark_times.sum() + - _cleanup_times.sum())/1000.0); - gclog_or_tty->print_cr(" Total concurrent time = %8.2f s " - "(%8.2f s marking).", - cmThread()->vtime_accum(), - cmThread()->vtime_mark_accum()); + log.trace(" Total stop_world time = %8.2f s.", + (_init_times.sum() + _remark_times.sum() + _cleanup_times.sum())/1000.0); + log.trace(" Total concurrent time = %8.2f s (%8.2f s marking).", + cmThread()->vtime_accum(), cmThread()->vtime_mark_accum()); } void ConcurrentMark::print_worker_threads_on(outputStream* st) const { @@ -3079,15 +3026,15 @@ void CMTask::drain_satb_buffers() { } void CMTask::print_stats() { - gclog_or_tty->print_cr("Marking Stats, task = %u, calls = %d", - _worker_id, _calls); - gclog_or_tty->print_cr(" Elapsed time = %1.2lfms, Termination time = %1.2lfms", - _elapsed_time_ms, _termination_time_ms); - gclog_or_tty->print_cr(" Step Times (cum): num = %d, avg = %1.2lfms, sd = %1.2lfms", - _step_times_ms.num(), _step_times_ms.avg(), - _step_times_ms.sd()); - gclog_or_tty->print_cr(" max = %1.2lfms, total = %1.2lfms", - _step_times_ms.maximum(), _step_times_ms.sum()); + log_debug(gc, stats)("Marking Stats, task = %u, calls = %d", + _worker_id, _calls); + log_debug(gc, stats)(" Elapsed time = %1.2lfms, Termination time = %1.2lfms", + _elapsed_time_ms, _termination_time_ms); + log_debug(gc, stats)(" Step Times (cum): num = %d, avg = %1.2lfms, sd = %1.2lfms", + _step_times_ms.num(), _step_times_ms.avg(), + _step_times_ms.sd()); + log_debug(gc, stats)(" max = %1.2lfms, total = %1.2lfms", + _step_times_ms.maximum(), _step_times_ms.sum()); } bool ConcurrentMark::try_stealing(uint worker_id, int* hash_seed, oop& obj) { @@ -3587,9 +3534,8 @@ CMTask::CMTask(uint worker_id, #define G1PPRL_SUM_MB_PERC_FORMAT(tag) G1PPRL_SUM_MB_FORMAT(tag) " / %1.2f %%" G1PrintRegionLivenessInfoClosure:: -G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name) - : _out(out), - _total_used_bytes(0), _total_capacity_bytes(0), +G1PrintRegionLivenessInfoClosure(const char* phase_name) + : _total_used_bytes(0), _total_capacity_bytes(0), _total_prev_live_bytes(0), _total_next_live_bytes(0), _hum_used_bytes(0), _hum_capacity_bytes(0), _hum_prev_live_bytes(0), _hum_next_live_bytes(0), @@ -3599,38 +3545,37 @@ G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name) double now = os::elapsedTime(); // Print the header of the output. - _out->cr(); - _out->print_cr(G1PPRL_LINE_PREFIX" PHASE %s @ %1.3f", phase_name, now); - _out->print_cr(G1PPRL_LINE_PREFIX" HEAP" - G1PPRL_SUM_ADDR_FORMAT("reserved") - G1PPRL_SUM_BYTE_FORMAT("region-size"), - p2i(g1_reserved.start()), p2i(g1_reserved.end()), - HeapRegion::GrainBytes); - _out->print_cr(G1PPRL_LINE_PREFIX); - _out->print_cr(G1PPRL_LINE_PREFIX - G1PPRL_TYPE_H_FORMAT - G1PPRL_ADDR_BASE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_DOUBLE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_BYTE_H_FORMAT, - "type", "address-range", - "used", "prev-live", "next-live", "gc-eff", - "remset", "code-roots"); - _out->print_cr(G1PPRL_LINE_PREFIX - G1PPRL_TYPE_H_FORMAT - G1PPRL_ADDR_BASE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_DOUBLE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_BYTE_H_FORMAT, - "", "", - "(bytes)", "(bytes)", "(bytes)", "(bytes/ms)", - "(bytes)", "(bytes)"); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX" PHASE %s @ %1.3f", phase_name, now); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX" HEAP" + G1PPRL_SUM_ADDR_FORMAT("reserved") + G1PPRL_SUM_BYTE_FORMAT("region-size"), + p2i(g1_reserved.start()), p2i(g1_reserved.end()), + HeapRegion::GrainBytes); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX + G1PPRL_TYPE_H_FORMAT + G1PPRL_ADDR_BASE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_DOUBLE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_BYTE_H_FORMAT, + "type", "address-range", + "used", "prev-live", "next-live", "gc-eff", + "remset", "code-roots"); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX + G1PPRL_TYPE_H_FORMAT + G1PPRL_ADDR_BASE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_DOUBLE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_BYTE_H_FORMAT, + "", "", + "(bytes)", "(bytes)", "(bytes)", "(bytes/ms)", + "(bytes)", "(bytes)"); } // It takes as a parameter a reference to one of the _hum_* fields, it @@ -3701,18 +3646,18 @@ bool G1PrintRegionLivenessInfoClosure::doHeapRegion(HeapRegion* r) { _total_strong_code_roots_bytes += strong_code_roots_bytes; // Print a line for this particular region. - _out->print_cr(G1PPRL_LINE_PREFIX - G1PPRL_TYPE_FORMAT - G1PPRL_ADDR_BASE_FORMAT - G1PPRL_BYTE_FORMAT - G1PPRL_BYTE_FORMAT - G1PPRL_BYTE_FORMAT - G1PPRL_DOUBLE_FORMAT - G1PPRL_BYTE_FORMAT - G1PPRL_BYTE_FORMAT, - type, p2i(bottom), p2i(end), - used_bytes, prev_live_bytes, next_live_bytes, gc_eff, - remset_bytes, strong_code_roots_bytes); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX + G1PPRL_TYPE_FORMAT + G1PPRL_ADDR_BASE_FORMAT + G1PPRL_BYTE_FORMAT + G1PPRL_BYTE_FORMAT + G1PPRL_BYTE_FORMAT + G1PPRL_DOUBLE_FORMAT + G1PPRL_BYTE_FORMAT + G1PPRL_BYTE_FORMAT, + type, p2i(bottom), p2i(end), + used_bytes, prev_live_bytes, next_live_bytes, gc_eff, + remset_bytes, strong_code_roots_bytes); return false; } @@ -3721,23 +3666,22 @@ G1PrintRegionLivenessInfoClosure::~G1PrintRegionLivenessInfoClosure() { // add static memory usages to remembered set sizes _total_remset_bytes += HeapRegionRemSet::fl_mem_size() + HeapRegionRemSet::static_mem_size(); // Print the footer of the output. - _out->print_cr(G1PPRL_LINE_PREFIX); - _out->print_cr(G1PPRL_LINE_PREFIX - " SUMMARY" - G1PPRL_SUM_MB_FORMAT("capacity") - G1PPRL_SUM_MB_PERC_FORMAT("used") - G1PPRL_SUM_MB_PERC_FORMAT("prev-live") - G1PPRL_SUM_MB_PERC_FORMAT("next-live") - G1PPRL_SUM_MB_FORMAT("remset") - G1PPRL_SUM_MB_FORMAT("code-roots"), - bytes_to_mb(_total_capacity_bytes), - bytes_to_mb(_total_used_bytes), - perc(_total_used_bytes, _total_capacity_bytes), - bytes_to_mb(_total_prev_live_bytes), - perc(_total_prev_live_bytes, _total_capacity_bytes), - bytes_to_mb(_total_next_live_bytes), - perc(_total_next_live_bytes, _total_capacity_bytes), - bytes_to_mb(_total_remset_bytes), - bytes_to_mb(_total_strong_code_roots_bytes)); - _out->cr(); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX + " SUMMARY" + G1PPRL_SUM_MB_FORMAT("capacity") + G1PPRL_SUM_MB_PERC_FORMAT("used") + G1PPRL_SUM_MB_PERC_FORMAT("prev-live") + G1PPRL_SUM_MB_PERC_FORMAT("next-live") + G1PPRL_SUM_MB_FORMAT("remset") + G1PPRL_SUM_MB_FORMAT("code-roots"), + bytes_to_mb(_total_capacity_bytes), + bytes_to_mb(_total_used_bytes), + perc(_total_used_bytes, _total_capacity_bytes), + bytes_to_mb(_total_prev_live_bytes), + perc(_total_prev_live_bytes, _total_capacity_bytes), + bytes_to_mb(_total_next_live_bytes), + perc(_total_next_live_bytes, _total_capacity_bytes), + bytes_to_mb(_total_remset_bytes), + bytes_to_mb(_total_strong_code_roots_bytes)); } diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc/g1/concurrentMark.hpp index 6a4260ed323..d6710dc283a 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMark.hpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMark.hpp @@ -978,8 +978,6 @@ public: // after we sort the old regions at the end of the cleanup operation. class G1PrintRegionLivenessInfoClosure: public HeapRegionClosure { private: - outputStream* _out; - // Accumulators for these values. size_t _total_used_bytes; size_t _total_capacity_bytes; @@ -1024,7 +1022,7 @@ private: public: // The header and footer are printed in the constructor and // destructor respectively. - G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name); + G1PrintRegionLivenessInfoClosure(const char* phase_name); virtual bool doHeapRegion(HeapRegion* r); ~G1PrintRegionLivenessInfoClosure(); }; diff --git a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp index 4884a7742fd..67b31e6683d 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp @@ -26,12 +26,13 @@ #include "gc/g1/concurrentMarkThread.inline.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/g1MMUTracker.hpp" #include "gc/g1/suspendibleThreadSet.hpp" #include "gc/g1/vm_operations_g1.hpp" #include "gc/shared/gcId.hpp" #include "gc/shared/gcTrace.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "runtime/vmThread.hpp" @@ -78,20 +79,6 @@ public: } }; -// We want to avoid that the logging from the concurrent thread is mixed -// with the logging from a STW GC. So, if necessary join the STS to ensure -// that the logging is done either before or after the STW logging. -void ConcurrentMarkThread::cm_log(bool doit, bool join_sts, const char* fmt, ...) { - if (doit) { - SuspendibleThreadSetJoiner sts_joiner(join_sts); - va_list args; - va_start(args, fmt); - gclog_or_tty->gclog_stamp(); - gclog_or_tty->vprint_cr(fmt, args); - va_end(args); - } -} - // Marking pauses can be scheduled flexibly, so we might delay marking to meet MMU. void ConcurrentMarkThread::delay_to_keep_mmu(G1CollectorPolicy* g1_policy, bool remark) { if (g1_policy->adaptive_young_list_length()) { @@ -143,8 +130,11 @@ void ConcurrentMarkThread::run_service() { _cm->scanRootRegions(); } - double mark_start_sec = os::elapsedTime(); - cm_log(G1Log::fine(), true, "[GC concurrent-mark-start]"); + // It would be nice to use the GCTraceConcTime class here but + // the "end" logging is inside the loop and not at the end of + // a scope. Mimicking the same log output as GCTraceConcTime instead. + jlong mark_start = os::elapsed_counter(); + log_info(gc)("Concurrent Mark (%.3fs)", TimeHelper::counter_to_seconds(mark_start)); int iter = 0; do { @@ -154,20 +144,22 @@ void ConcurrentMarkThread::run_service() { } double mark_end_time = os::elapsedVTime(); - double mark_end_sec = os::elapsedTime(); + jlong mark_end = os::elapsed_counter(); _vtime_mark_accum += (mark_end_time - cycle_start); if (!cm()->has_aborted()) { delay_to_keep_mmu(g1_policy, true /* remark */); - - cm_log(G1Log::fine(), true, "[GC concurrent-mark-end, %1.7lf secs]", mark_end_sec - mark_start_sec); + log_info(gc)("Concurrent Mark (%.3fs, %.3fs) %.3fms", + TimeHelper::counter_to_seconds(mark_start), + TimeHelper::counter_to_seconds(mark_end), + TimeHelper::counter_to_millis(mark_end - mark_start)); CMCheckpointRootsFinalClosure final_cl(_cm); - VM_CGC_Operation op(&final_cl, "GC remark", true /* needs_pll */); + VM_CGC_Operation op(&final_cl, "Pause Remark", true /* needs_pll */); VMThread::execute(&op); } if (cm()->restart_for_overflow()) { - cm_log(G1TraceMarkStackOverflow, true, "Restarting conc marking because of MS overflow in remark (restart #%d).", iter); - cm_log(G1Log::fine(), true, "[GC concurrent-mark-restart-for-overflow]"); + log_debug(gc)("Restarting conc marking because of MS overflow in remark (restart #%d).", iter); + log_info(gc)("Concurrent Mark restart for overflow"); } } while (cm()->restart_for_overflow()); @@ -181,7 +173,7 @@ void ConcurrentMarkThread::run_service() { delay_to_keep_mmu(g1_policy, false /* cleanup */); CMCleanUp cl_cl(_cm); - VM_CGC_Operation op(&cl_cl, "GC cleanup", false /* needs_pll */); + VM_CGC_Operation op(&cl_cl, "Pause Cleanup", false /* needs_pll */); VMThread::execute(&op); } else { // We don't want to update the marking status if a GC pause @@ -201,8 +193,7 @@ void ConcurrentMarkThread::run_service() { // place, it would wait for us to process the regions // reclaimed by cleanup. - double cleanup_start_sec = os::elapsedTime(); - cm_log(G1Log::fine(), false, "[GC concurrent-cleanup-start]"); + GCTraceConcTime(Info, gc) tt("Concurrent Cleanup"); // Now do the concurrent cleanup operation. _cm->completeCleanup(); @@ -217,9 +208,6 @@ void ConcurrentMarkThread::run_service() { // while it's trying to join the STS, which is conditional on // the GC workers finishing. g1h->reset_free_regions_coming(); - - double cleanup_end_sec = os::elapsedTime(); - cm_log(G1Log::fine(), true, "[GC concurrent-cleanup-end, %1.7lf secs]", cleanup_end_sec - cleanup_start_sec); } guarantee(cm()->cleanup_list_is_empty(), "at this point there should be no regions on the cleanup list"); @@ -253,7 +241,7 @@ void ConcurrentMarkThread::run_service() { if (!cm()->has_aborted()) { g1_policy->record_concurrent_mark_cleanup_completed(); } else { - cm_log(G1Log::fine(), false, "[GC concurrent-mark-abort]"); + log_info(gc)("Concurrent Mark abort"); } } diff --git a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp index 13f34d676a9..2dd170916da 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp @@ -40,7 +40,6 @@ class ConcurrentMarkThread: public ConcurrentGCThread { double _vtime_accum; // Accumulated virtual time. double _vtime_mark_accum; - void cm_log(bool doit, bool join_sts, const char* fmt, ...) ATTRIBUTE_PRINTF(4, 5); public: virtual void run(); diff --git a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp index a1542adf8e5..a123477e58e 100644 --- a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp @@ -27,6 +27,7 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/heapRegion.hpp" #include "gc/shared/space.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" #include "services/memTracker.hpp" @@ -50,14 +51,9 @@ G1BlockOffsetSharedArray::G1BlockOffsetSharedArray(MemRegion heap, G1RegionToSpa storage->set_mapping_changed_listener(&_listener); - if (TraceBlockOffsetTable) { - gclog_or_tty->print_cr("G1BlockOffsetSharedArray::G1BlockOffsetSharedArray: "); - gclog_or_tty->print_cr(" " - " rs.base(): " PTR_FORMAT - " rs.size(): " SIZE_FORMAT - " rs end(): " PTR_FORMAT, - p2i(bot_reserved.start()), bot_reserved.byte_size(), p2i(bot_reserved.end())); - } + log_trace(gc, bot)("G1BlockOffsetSharedArray::G1BlockOffsetSharedArray: "); + log_trace(gc, bot)(" rs.base(): " PTR_FORMAT " rs.size(): " SIZE_FORMAT " rs end(): " PTR_FORMAT, + p2i(bot_reserved.start()), bot_reserved.byte_size(), p2i(bot_reserved.end())); } bool G1BlockOffsetSharedArray::is_card_boundary(HeapWord* p) const { diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index e02f80494cd..59fdc8b1381 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -36,10 +36,8 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/g1/g1CollectorState.hpp" -#include "gc/g1/g1ErgoVerbose.hpp" #include "gc/g1/g1EvacStats.inline.hpp" #include "gc/g1/g1GCPhaseTimes.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/g1MarkSweep.hpp" #include "gc/g1/g1OopClosures.inline.hpp" #include "gc/g1/g1ParScanThreadState.inline.hpp" @@ -59,11 +57,12 @@ #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/generationSpec.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/taskqueue.inline.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/iterator.hpp" #include "oops/oop.inline.hpp" @@ -224,11 +223,9 @@ G1CollectedHeap::new_region_try_secondary_free_list(bool is_old) { MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag); while (!_secondary_free_list.is_empty() || free_regions_coming()) { if (!_secondary_free_list.is_empty()) { - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [region alloc] : " - "secondary_free_list has %u entries", - _secondary_free_list.length()); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [region alloc] : " + "secondary_free_list has %u entries", + _secondary_free_list.length()); // It looks as if there are free regions available on the // secondary_free_list. Let's move them to the free_list and try // again to allocate from it. @@ -237,11 +234,9 @@ G1CollectedHeap::new_region_try_secondary_free_list(bool is_old) { assert(_hrm.num_free_regions() > 0, "if the secondary_free_list was not " "empty we should have moved at least one entry to the free_list"); HeapRegion* res = _hrm.allocate_free_region(is_old); - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [region alloc] : " - "allocated " HR_FORMAT " from secondary_free_list", - HR_FORMAT_PARAMS(res)); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [region alloc] : " + "allocated " HR_FORMAT " from secondary_free_list", + HR_FORMAT_PARAMS(res)); return res; } @@ -251,10 +246,8 @@ G1CollectedHeap::new_region_try_secondary_free_list(bool is_old) { SecondaryFreeList_lock->wait(Mutex::_no_safepoint_check_flag); } - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [region alloc] : " - "could not allocate from secondary_free_list"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [region alloc] : " + "could not allocate from secondary_free_list"); return NULL; } @@ -266,10 +259,8 @@ HeapRegion* G1CollectedHeap::new_region(size_t word_size, bool is_old, bool do_e HeapRegion* res; if (G1StressConcRegionFreeing) { if (!_secondary_free_list.is_empty()) { - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [region alloc] : " - "forced to look at the secondary_free_list"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [region alloc] : " + "forced to look at the secondary_free_list"); res = new_region_try_secondary_free_list(is_old); if (res != NULL) { return res; @@ -280,10 +271,8 @@ HeapRegion* G1CollectedHeap::new_region(size_t word_size, bool is_old, bool do_e res = _hrm.allocate_free_region(is_old); if (res == NULL) { - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [region alloc] : " - "res == NULL, trying the secondary_free_list"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [region alloc] : " + "res == NULL, trying the secondary_free_list"); res = new_region_try_secondary_free_list(is_old); } if (res == NULL && do_expand && _expand_heap_after_alloc_failure) { @@ -293,11 +282,9 @@ HeapRegion* G1CollectedHeap::new_region(size_t word_size, bool is_old, bool do_e // reconsider the use of _expand_heap_after_alloc_failure. assert(SafepointSynchronize::is_at_safepoint(), "invariant"); - ergo_verbose1(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("region allocation request failed") - ergo_format_byte("allocation request"), - word_size * HeapWordSize); + log_debug(gc, ergo, heap)("Attempt heap expansion (region allocation request failed). Allocation request: " SIZE_FORMAT "B", + word_size * HeapWordSize); + if (expand(word_size * HeapWordSize)) { // Given that expand() succeeded in expanding the heap, and we // always expand the heap by an amount aligned to the heap @@ -485,11 +472,9 @@ HeapWord* G1CollectedHeap::humongous_obj_allocate(size_t word_size, AllocationCo if (first != G1_NO_HRM_INDEX) { // We found something. Make sure these regions are committed, i.e. expand // the heap. Alternatively we could do a defragmentation GC. - ergo_verbose1(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("humongous allocation request failed") - ergo_format_byte("allocation request"), - word_size * HeapWordSize); + log_debug(gc, ergo, heap)("Attempt heap expansion (humongous allocation request failed). Allocation request: " SIZE_FORMAT "B", + word_size * HeapWordSize); + _hrm.expand_at(first, obj_regions); g1_policy()->record_new_heap_size(num_regions()); @@ -808,11 +793,9 @@ bool G1CollectedHeap::alloc_archive_regions(MemRegion* ranges, size_t count) { } increase_used(word_size * HeapWordSize); if (commits != 0) { - ergo_verbose1(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("allocate archive regions") - ergo_format_byte("total size"), - HeapRegion::GrainWords * HeapWordSize * commits); + log_debug(gc, ergo, heap)("Attempt heap expansion (allocate archive regions). Total size: " SIZE_FORMAT "B", + HeapRegion::GrainWords * HeapWordSize * commits); + } // Mark each G1 region touched by the range as archive, add it to the old set, @@ -993,11 +976,8 @@ void G1CollectedHeap::dealloc_archive_regions(MemRegion* ranges, size_t count) { } if (uncommitted_regions != 0) { - ergo_verbose1(ErgoHeapSizing, - "attempt heap shrinking", - ergo_format_reason("uncommitted archive regions") - ergo_format_byte("total size"), - HeapRegion::GrainWords * HeapWordSize * uncommitted_regions); + log_debug(gc, ergo, heap)("Attempt heap shrinking (uncommitted archive regions). Total size: " SIZE_FORMAT "B", + HeapRegion::GrainWords * HeapWordSize * uncommitted_regions); } decrease_used(size_used); } @@ -1236,8 +1216,11 @@ public: }; void G1CollectedHeap::print_hrm_post_compaction() { - PostCompactionPrinterClosure cl(hr_printer()); - heap_region_iterate(&cl); + if (_hr_printer.is_active()) { + PostCompactionPrinterClosure cl(hr_printer()); + heap_region_iterate(&cl); + } + } bool G1CollectedHeap::do_full_collection(bool explicit_gc, @@ -1258,7 +1241,6 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, SvcGCMarker sgcm(SvcGCMarker::FULL); ResourceMark rm; - G1Log::update_level(); print_heap_before_gc(); trace_heap_before_gc(gc_tracer); @@ -1276,10 +1258,10 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, // Timing assert(!GCCause::is_user_requested_gc(gc_cause()) || explicit_gc, "invariant"); - TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); + GCTraceCPUTime tcpu; { - GCTraceTime t(GCCauseString("Full GC", gc_cause()), G1Log::fine(), true, NULL); + GCTraceTime(Info, gc) tm("Pause Full", NULL, gc_cause(), true); TraceCollectorStats tcs(g1mm()->full_collection_counters()); TraceMemoryManagerStats tms(true /* fullGC */, gc_cause()); @@ -1330,11 +1312,6 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, _allocator->abandon_gc_alloc_regions(); g1_rem_set()->cleanupHRRS(); - // We should call this after we retire any currently active alloc - // regions so that all the ALLOC / RETIRE events are generated - // before the start GC event. - _hr_printer.start_gc(true /* full */, (size_t) total_collections()); - // We may have added regions to the current incremental collection // set between the last GC or pause and now. We need to clear the // incremental collection set and then start rebuilding it afresh @@ -1401,14 +1378,10 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, resize_if_necessary_after_full_collection(); - if (_hr_printer.is_active()) { - // We should do this after we potentially resize the heap so - // that all the COMMIT / UNCOMMIT events are generated before - // the end GC event. - - print_hrm_post_compaction(); - _hr_printer.end_gc(true /* full */, (size_t) total_collections()); - } + // We should do this after we potentially resize the heap so + // that all the COMMIT / UNCOMMIT events are generated before + // the compaction events. + print_hrm_post_compaction(); G1HotCardCache* hot_card_cache = _cg1r->hot_card_cache(); if (hot_card_cache->use_cache()) { @@ -1477,10 +1450,6 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, g1_policy()->record_full_collection_end(); - if (G1Log::fine()) { - g1_policy()->print_heap_transition(); - } - // We must call G1MonitoringSupport::update_sizes() in the same scoping level // as an active TraceMemoryManagerStats object (i.e. before the destructor for the // TraceMemoryManagerStats is called) so that the G1 memory pools are updated @@ -1490,9 +1459,7 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, gc_epilogue(true); } - if (G1Log::finer()) { - g1_policy()->print_detailed_heap_transition(true /* full */); - } + g1_policy()->print_detailed_heap_transition(); print_heap_after_gc(); trace_heap_after_gc(gc_tracer); @@ -1570,30 +1537,22 @@ void G1CollectedHeap::resize_if_necessary_after_full_collection() { if (capacity_after_gc < minimum_desired_capacity) { // Don't expand unless it's significant size_t expand_bytes = minimum_desired_capacity - capacity_after_gc; - ergo_verbose4(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("capacity lower than " - "min desired capacity after Full GC") - ergo_format_byte("capacity") - ergo_format_byte("occupancy") - ergo_format_byte_perc("min desired capacity"), - capacity_after_gc, used_after_gc, - minimum_desired_capacity, (double) MinHeapFreeRatio); + + log_debug(gc, ergo, heap)("Attempt heap expansion (capacity lower than min desired capacity after Full GC). " + "Capacity: " SIZE_FORMAT "B occupancy: " SIZE_FORMAT "B min_desired_capacity: " SIZE_FORMAT "B (" UINTX_FORMAT " %%)", + capacity_after_gc, used_after_gc, minimum_desired_capacity, MinHeapFreeRatio); + expand(expand_bytes); // No expansion, now see if we want to shrink } else if (capacity_after_gc > maximum_desired_capacity) { // Capacity too large, compute shrinking size size_t shrink_bytes = capacity_after_gc - maximum_desired_capacity; - ergo_verbose4(ErgoHeapSizing, - "attempt heap shrinking", - ergo_format_reason("capacity higher than " - "max desired capacity after Full GC") - ergo_format_byte("capacity") - ergo_format_byte("occupancy") - ergo_format_byte_perc("max desired capacity"), - capacity_after_gc, used_after_gc, - maximum_desired_capacity, (double) MaxHeapFreeRatio); + + log_debug(gc, ergo, heap)("Attempt heap shrinking (capacity higher than max desired capacity after Full GC). " + "Capacity: " SIZE_FORMAT "B occupancy: " SIZE_FORMAT "B min_desired_capacity: " SIZE_FORMAT "B (" UINTX_FORMAT " %%)", + capacity_after_gc, used_after_gc, minimum_desired_capacity, MinHeapFreeRatio); + shrink(shrink_bytes); } } @@ -1699,11 +1658,10 @@ HeapWord* G1CollectedHeap::expand_and_allocate(size_t word_size, AllocationConte verify_region_sets_optional(); size_t expand_bytes = MAX2(word_size * HeapWordSize, MinHeapDeltaBytes); - ergo_verbose1(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("allocation request failed") - ergo_format_byte("allocation request"), - word_size * HeapWordSize); + log_debug(gc, ergo, heap)("Attempt heap expansion (allocation request failed). Allocation request: " SIZE_FORMAT "B", + word_size * HeapWordSize); + + if (expand(expand_bytes)) { _hrm.verify_optional(); verify_region_sets_optional(); @@ -1718,16 +1676,12 @@ bool G1CollectedHeap::expand(size_t expand_bytes, double* expand_time_ms) { size_t aligned_expand_bytes = ReservedSpace::page_align_size_up(expand_bytes); aligned_expand_bytes = align_size_up(aligned_expand_bytes, HeapRegion::GrainBytes); - ergo_verbose2(ErgoHeapSizing, - "expand the heap", - ergo_format_byte("requested expansion amount") - ergo_format_byte("attempted expansion amount"), - expand_bytes, aligned_expand_bytes); + + log_debug(gc, ergo, heap)("Expand the heap. requested expansion amount:" SIZE_FORMAT "B expansion amount:" SIZE_FORMAT "B", + expand_bytes, aligned_expand_bytes); if (is_maximal_no_gc()) { - ergo_verbose0(ErgoHeapSizing, - "did not expand the heap", - ergo_format_reason("heap already fully expanded")); + log_debug(gc, ergo, heap)("Did not expand the heap (heap already fully expanded)"); return false; } @@ -1745,9 +1699,8 @@ bool G1CollectedHeap::expand(size_t expand_bytes, double* expand_time_ms) { assert(actual_expand_bytes <= aligned_expand_bytes, "post-condition"); g1_policy()->record_new_heap_size(num_regions()); } else { - ergo_verbose0(ErgoHeapSizing, - "did not expand the heap", - ergo_format_reason("heap expansion operation failed")); + log_debug(gc, ergo, heap)("Did not expand the heap (heap expansion operation failed)"); + // The expansion of the virtual storage space was unsuccessful. // Let's see if it was because we ran out of swap. if (G1ExitOnExpansionFailure && @@ -1769,18 +1722,13 @@ void G1CollectedHeap::shrink_helper(size_t shrink_bytes) { uint num_regions_removed = _hrm.shrink_by(num_regions_to_remove); size_t shrunk_bytes = num_regions_removed * HeapRegion::GrainBytes; - ergo_verbose3(ErgoHeapSizing, - "shrink the heap", - ergo_format_byte("requested shrinking amount") - ergo_format_byte("aligned shrinking amount") - ergo_format_byte("attempted shrinking amount"), - shrink_bytes, aligned_shrink_bytes, shrunk_bytes); + + log_debug(gc, ergo, heap)("Shrink the heap. requested shrinking amount: " SIZE_FORMAT "B aligned shrinking amount: " SIZE_FORMAT "B attempted shrinking amount: " SIZE_FORMAT "B", + shrink_bytes, aligned_shrink_bytes, shrunk_bytes); if (num_regions_removed > 0) { g1_policy()->record_new_heap_size(num_regions()); } else { - ergo_verbose0(ErgoHeapSizing, - "did not shrink the heap", - ergo_format_reason("heap shrinking operation failed")); + log_debug(gc, ergo, heap)("Did not expand the heap (heap shrinking operation failed)"); } } @@ -1892,8 +1840,8 @@ G1RegionToSpaceMapper* G1CollectedHeap::create_aux_memory_mapper(const char* des translation_factor, mtGC); if (TracePageSizes) { - gclog_or_tty->print_cr("G1 '%s': pg_sz=" SIZE_FORMAT " base=" PTR_FORMAT " size=" SIZE_FORMAT " alignment=" SIZE_FORMAT " reqsize=" SIZE_FORMAT, - description, preferred_page_size, p2i(rs.base()), rs.size(), rs.alignment(), size); + tty->print_cr("G1 '%s': pg_sz=" SIZE_FORMAT " base=" PTR_FORMAT " size=" SIZE_FORMAT " alignment=" SIZE_FORMAT " reqsize=" SIZE_FORMAT, + description, preferred_page_size, p2i(rs.base()), rs.size(), rs.alignment(), size); } return result; } @@ -1902,16 +1850,10 @@ jint G1CollectedHeap::initialize() { CollectedHeap::pre_initialize(); os::enable_vtime(); - G1Log::init(); - // Necessary to satisfy locking discipline assertions. MutexLocker x(Heap_lock); - // We have to initialize the printer before committing the heap, as - // it will be used then. - _hr_printer.set_active(G1PrintHeapRegions); - // While there are no constraints in the GC code that HeapWordSize // be any particular value, there are multiple other areas in the // system which believe this to be true (e.g. oop->object_size in some @@ -2104,7 +2046,7 @@ jint G1CollectedHeap::initialize() { void G1CollectedHeap::stop() { // Stop all concurrent threads. We do this to make sure these threads - // do not continue to execute and access resources (e.g. gclog_or_tty) + // do not continue to execute and access resources (e.g. logging) // that are destroyed during shutdown. _cg1r->stop(); _cmThread->stop(); @@ -2221,9 +2163,8 @@ public: virtual bool doHeapRegion(HeapRegion* hr) { unsigned region_gc_time_stamp = hr->get_gc_time_stamp(); if (_gc_time_stamp != region_gc_time_stamp) { - gclog_or_tty->print_cr("Region " HR_FORMAT " has GC time stamp = %d, " - "expected %d", HR_FORMAT_PARAMS(hr), - region_gc_time_stamp, _gc_time_stamp); + log_info(gc, verify)("Region " HR_FORMAT " has GC time stamp = %d, expected %d", HR_FORMAT_PARAMS(hr), + region_gc_time_stamp, _gc_time_stamp); _failures = true; } return false; @@ -2816,12 +2757,13 @@ public: if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); if (_g1h->is_obj_dead_cond(obj, _vo)) { - gclog_or_tty->print_cr("Root location " PTR_FORMAT " " - "points to dead obj " PTR_FORMAT, p2i(p), p2i(obj)); + LogHandle(gc, verify) log; + log.info("Root location " PTR_FORMAT " points to dead obj " PTR_FORMAT, p2i(p), p2i(obj)); if (_vo == VerifyOption_G1UseMarkWord) { - gclog_or_tty->print_cr(" Mark word: " INTPTR_FORMAT, (intptr_t)obj->mark()); + log.info(" Mark word: " PTR_FORMAT, p2i(obj->mark())); } - obj->print_on(gclog_or_tty); + ResourceMark rm; + obj->print_on(log.info_stream()); _failures = true; } } @@ -2866,10 +2808,10 @@ class G1VerifyCodeRootOopClosure: public OopClosure { // Verify that the strong code root list for this region // contains the nmethod if (!hrrs->strong_code_roots_list_contains(_nm)) { - gclog_or_tty->print_cr("Code root location " PTR_FORMAT " " - "from nmethod " PTR_FORMAT " not in strong " - "code roots for region [" PTR_FORMAT "," PTR_FORMAT ")", - p2i(p), p2i(_nm), p2i(hr->bottom()), p2i(hr->end())); + log_info(gc, verify)("Code root location " PTR_FORMAT " " + "from nmethod " PTR_FORMAT " not in strong " + "code roots for region [" PTR_FORMAT "," PTR_FORMAT ")", + p2i(p), p2i(_nm), p2i(hr->bottom()), p2i(hr->end())); _failures = true; } } @@ -3047,12 +2989,8 @@ public: r->object_iterate(¬_dead_yet_cl); if (_vo != VerifyOption_G1UseNextMarking) { if (r->max_live_bytes() < not_dead_yet_cl.live_bytes()) { - gclog_or_tty->print_cr("[" PTR_FORMAT "," PTR_FORMAT "] " - "max_live_bytes " SIZE_FORMAT " " - "< calculated " SIZE_FORMAT, - p2i(r->bottom()), p2i(r->end()), - r->max_live_bytes(), - not_dead_yet_cl.live_bytes()); + log_info(gc, verify)("[" PTR_FORMAT "," PTR_FORMAT "] max_live_bytes " SIZE_FORMAT " < calculated " SIZE_FORMAT, + p2i(r->bottom()), p2i(r->end()), r->max_live_bytes(), not_dead_yet_cl.live_bytes()); _failures = true; } } else { @@ -3100,85 +3038,75 @@ public: } }; -void G1CollectedHeap::verify(bool silent, VerifyOption vo) { - if (SafepointSynchronize::is_at_safepoint()) { - assert(Thread::current()->is_VM_thread(), - "Expected to be executed serially by the VM thread at this point"); +void G1CollectedHeap::verify(VerifyOption vo) { + if (!SafepointSynchronize::is_at_safepoint()) { + log_info(gc, verify)("Skipping verification. Not at safepoint."); + } - if (!silent) { gclog_or_tty->print("Roots "); } - VerifyRootsClosure rootsCl(vo); - VerifyKlassClosure klassCl(this, &rootsCl); - CLDToKlassAndOopClosure cldCl(&klassCl, &rootsCl, false); + assert(Thread::current()->is_VM_thread(), + "Expected to be executed serially by the VM thread at this point"); - // We apply the relevant closures to all the oops in the - // system dictionary, class loader data graph, the string table - // and the nmethods in the code cache. - G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo); - G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl); + log_debug(gc, verify)("Roots"); + VerifyRootsClosure rootsCl(vo); + VerifyKlassClosure klassCl(this, &rootsCl); + CLDToKlassAndOopClosure cldCl(&klassCl, &rootsCl, false); - { - G1RootProcessor root_processor(this, 1); - root_processor.process_all_roots(&rootsCl, - &cldCl, - &blobsCl); + // We apply the relevant closures to all the oops in the + // system dictionary, class loader data graph, the string table + // and the nmethods in the code cache. + G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo); + G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl); + + { + G1RootProcessor root_processor(this, 1); + root_processor.process_all_roots(&rootsCl, + &cldCl, + &blobsCl); + } + + bool failures = rootsCl.failures() || codeRootsCl.failures(); + + if (vo != VerifyOption_G1UseMarkWord) { + // If we're verifying during a full GC then the region sets + // will have been torn down at the start of the GC. Therefore + // verifying the region sets will fail. So we only verify + // the region sets when not in a full GC. + log_debug(gc, verify)("HeapRegionSets"); + verify_region_sets(); + } + + log_debug(gc, verify)("HeapRegions"); + if (GCParallelVerificationEnabled && ParallelGCThreads > 1) { + + G1ParVerifyTask task(this, vo); + workers()->run_task(&task); + if (task.failures()) { + failures = true; } - bool failures = rootsCl.failures() || codeRootsCl.failures(); - - if (vo != VerifyOption_G1UseMarkWord) { - // If we're verifying during a full GC then the region sets - // will have been torn down at the start of the GC. Therefore - // verifying the region sets will fail. So we only verify - // the region sets when not in a full GC. - if (!silent) { gclog_or_tty->print("HeapRegionSets "); } - verify_region_sets(); - } - - if (!silent) { gclog_or_tty->print("HeapRegions "); } - if (GCParallelVerificationEnabled && ParallelGCThreads > 1) { - - G1ParVerifyTask task(this, vo); - workers()->run_task(&task); - if (task.failures()) { - failures = true; - } - - } else { - VerifyRegionClosure blk(false, vo); - heap_region_iterate(&blk); - if (blk.failures()) { - failures = true; - } - } - - if (G1StringDedup::is_enabled()) { - if (!silent) gclog_or_tty->print("StrDedup "); - G1StringDedup::verify(); - } - - if (failures) { - gclog_or_tty->print_cr("Heap:"); - // It helps to have the per-region information in the output to - // help us track down what went wrong. This is why we call - // print_extended_on() instead of print_on(). - print_extended_on(gclog_or_tty); - gclog_or_tty->cr(); - gclog_or_tty->flush(); - } - guarantee(!failures, "there should not have been any failures"); } else { - if (!silent) { - gclog_or_tty->print("(SKIPPING Roots, HeapRegionSets, HeapRegions, RemSet"); - if (G1StringDedup::is_enabled()) { - gclog_or_tty->print(", StrDedup"); - } - gclog_or_tty->print(") "); + VerifyRegionClosure blk(false, vo); + heap_region_iterate(&blk); + if (blk.failures()) { + failures = true; } } -} -void G1CollectedHeap::verify(bool silent) { - verify(silent, VerifyOption_G1UsePrevMarking); + if (G1StringDedup::is_enabled()) { + log_debug(gc, verify)("StrDedup"); + G1StringDedup::verify(); + } + + if (failures) { + log_info(gc, verify)("Heap after failed verification:"); + // It helps to have the per-region information in the output to + // help us track down what went wrong. This is why we call + // print_extended_on() instead of print_on(). + LogHandle(gc, verify) log; + ResourceMark rm; + print_extended_on(log.info_stream()); + } + guarantee(!failures, "there should not have been any failures"); } double G1CollectedHeap::verify(bool guard, const char* msg) { @@ -3196,12 +3124,12 @@ double G1CollectedHeap::verify(bool guard, const char* msg) { } void G1CollectedHeap::verify_before_gc() { - double verify_time_ms = verify(VerifyBeforeGC, " VerifyBeforeGC:"); + double verify_time_ms = verify(VerifyBeforeGC, "Before GC"); g1_policy()->phase_times()->record_verify_before_time_ms(verify_time_ms); } void G1CollectedHeap::verify_after_gc() { - double verify_time_ms = verify(VerifyAfterGC, " VerifyAfterGC:"); + double verify_time_ms = verify(VerifyAfterGC, "After GC"); g1_policy()->phase_times()->record_verify_after_time_ms(verify_time_ms); } @@ -3311,12 +3239,8 @@ void G1CollectedHeap::print_tracing_info() const { // to that. g1_policy()->print_tracing_info(); } - if (G1SummarizeRSetStats) { - g1_rem_set()->print_summary_info(); - } - if (G1SummarizeConcMark) { - concurrent_mark()->print_summary_info(); - } + g1_rem_set()->print_summary_info(); + concurrent_mark()->print_summary_info(); g1_policy()->print_yg_surv_rate_info(); } @@ -3334,28 +3258,27 @@ public: size_t occupied = hrrs->occupied(); _occupied_sum += occupied; - gclog_or_tty->print_cr("Printing RSet for region " HR_FORMAT, - HR_FORMAT_PARAMS(r)); + tty->print_cr("Printing RSet for region " HR_FORMAT, HR_FORMAT_PARAMS(r)); if (occupied == 0) { - gclog_or_tty->print_cr(" RSet is empty"); + tty->print_cr(" RSet is empty"); } else { hrrs->print(); } - gclog_or_tty->print_cr("----------"); + tty->print_cr("----------"); return false; } PrintRSetsClosure(const char* msg) : _msg(msg), _occupied_sum(0) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("========================================"); - gclog_or_tty->print_cr("%s", msg); - gclog_or_tty->cr(); + tty->cr(); + tty->print_cr("========================================"); + tty->print_cr("%s", msg); + tty->cr(); } ~PrintRSetsClosure() { - gclog_or_tty->print_cr("Occupied Sum: " SIZE_FORMAT, _occupied_sum); - gclog_or_tty->print_cr("========================================"); - gclog_or_tty->cr(); + tty->print_cr("Occupied Sum: " SIZE_FORMAT, _occupied_sum); + tty->print_cr("========================================"); + tty->cr(); } }; @@ -3413,20 +3336,12 @@ void G1CollectedHeap::gc_prologue(bool full /* Ignored */) { accumulate_statistics_all_tlabs(); ensure_parsability(true); - if (G1SummarizeRSetStats && (G1SummarizeRSetStatsPeriod > 0) && - (total_collections() % G1SummarizeRSetStatsPeriod == 0)) { - g1_rem_set()->print_periodic_summary_info("Before GC RS summary"); - } + g1_rem_set()->print_periodic_summary_info("Before GC RS summary", total_collections()); } void G1CollectedHeap::gc_epilogue(bool full) { - - if (G1SummarizeRSetStats && - (G1SummarizeRSetStatsPeriod > 0) && - // we are at the end of the GC. Total collections has already been increased. - ((total_collections() - 1) % G1SummarizeRSetStatsPeriod == 0)) { - g1_rem_set()->print_periodic_summary_info("After GC RS summary"); - } + // we are at the end of the GC. Total collections has already been increased. + g1_rem_set()->print_periodic_summary_info("After GC RS summary", total_collections() - 1); // FIXME: what is this about? // I'm ignoring the "fill_newgen()" call if "alloc_event_enabled" @@ -3672,7 +3587,14 @@ void G1CollectedHeap::print_taskqueue_stats_hdr(outputStream* const st) { st->print_raw("--- "); TaskQueueStats::print_header(2, st); st->cr(); } -void G1CollectedHeap::print_taskqueue_stats(outputStream* const st) const { +void G1CollectedHeap::print_taskqueue_stats() const { + if (!develop_log_is_enabled(Trace, gc, task, stats)) { + return; + } + LogHandle(gc, task, stats) log; + ResourceMark rm; + outputStream* st = log.trace_stream(); + print_taskqueue_stats_hdr(st); TaskQueueStats totals; @@ -3694,41 +3616,17 @@ void G1CollectedHeap::reset_taskqueue_stats() { } #endif // TASKQUEUE_STATS -void G1CollectedHeap::log_gc_header() { - if (!G1Log::fine()) { - return; +void G1CollectedHeap::log_gc_footer(double pause_time_counter) { + if (evacuation_failed()) { + log_info(gc)("To-space exhausted"); } - gclog_or_tty->gclog_stamp(); + double pause_time_sec = TimeHelper::counter_to_seconds(pause_time_counter); + g1_policy()->print_phases(pause_time_sec); - GCCauseString gc_cause_str = GCCauseString("GC pause", gc_cause()) - .append(collector_state()->gcs_are_young() ? "(young)" : "(mixed)") - .append(collector_state()->during_initial_mark_pause() ? " (initial-mark)" : ""); - - gclog_or_tty->print("[%s", (const char*)gc_cause_str); + g1_policy()->print_detailed_heap_transition(); } -void G1CollectedHeap::log_gc_footer(double pause_time_sec) { - if (!G1Log::fine()) { - return; - } - - if (G1Log::finer()) { - if (evacuation_failed()) { - gclog_or_tty->print(" (to-space exhausted)"); - } - gclog_or_tty->print_cr(", %3.7f secs]", pause_time_sec); - g1_policy()->print_phases(pause_time_sec); - g1_policy()->print_detailed_heap_transition(); - } else { - if (evacuation_failed()) { - gclog_or_tty->print("--"); - } - g1_policy()->print_heap_transition(); - gclog_or_tty->print_cr(", %3.7f secs]", pause_time_sec); - } - gclog_or_tty->flush(); -} void G1CollectedHeap::wait_for_root_region_scanning() { double scan_wait_start = os::elapsedTime(); @@ -3764,7 +3662,6 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { wait_for_root_region_scanning(); - G1Log::update_level(); print_heap_before_gc(); trace_heap_before_gc(_gc_tracer_stw); @@ -3801,16 +3698,25 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { _gc_tracer_stw->report_yc_type(collector_state()->yc_type()); - TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); + GCTraceCPUTime tcpu; uint active_workers = AdaptiveSizePolicy::calc_active_workers(workers()->total_workers(), workers()->active_workers(), Threads::number_of_non_daemon_threads()); workers()->set_active_workers(active_workers); + FormatBuffer<> gc_string("Pause "); + if (collector_state()->during_initial_mark_pause()) { + gc_string.append("Initial Mark"); + } else if (collector_state()->gcs_are_young()) { + gc_string.append("Young"); + } else { + gc_string.append("Mixed"); + } + GCTraceTime(Info, gc) tm(gc_string, NULL, gc_cause(), true); double pause_start_sec = os::elapsedTime(); + double pause_start_counter = os::elapsed_counter(); g1_policy()->note_gc_start(active_workers); - log_gc_header(); TraceCollectorStats tcs(g1mm()->incremental_collection_counters()); TraceMemoryManagerStats tms(false /* fullGC */, gc_cause()); @@ -3868,11 +3774,6 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { // of the collection set!). _allocator->release_mutator_alloc_region(); - // We should call this after we retire the mutator alloc - // region(s) so that all the ALLOC / RETIRE events are generated - // before the start GC event. - _hr_printer.start_gc(false /* full */, (size_t) total_collections()); - // This timing is only used by the ergonomics to handle our pause target. // It is unclear why this should not include the full pause. We will // investigate this in CR 7178365. @@ -3996,7 +3897,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { size_t expand_bytes = g1_policy()->expansion_amount(); if (expand_bytes > 0) { size_t bytes_before = capacity(); - // No need for an ergo verbose message here, + // No need for an ergo logging here, // expansion_amount() does this when it returns a value > 0. double expand_ms; if (!expand(expand_bytes, &expand_ms)) { @@ -4056,12 +3957,6 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { // CM reference discovery will be re-enabled if necessary. } - // We should do this after we potentially expand the heap so - // that all the COMMIT events are generated before the end GC - // event, and after we retire the GC alloc regions so that all - // RETIRE events are generated before the end GC event. - _hr_printer.end_gc(false /* full */, (size_t) total_collections()); - #ifdef TRACESPINNING ParallelTaskTerminator::print_termination_counts(); #endif @@ -4070,7 +3965,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { } // Print the remainder of the GC log output. - log_gc_footer(os::elapsedTime() - pause_start_sec); + log_gc_footer(os::elapsed_counter() - pause_start_counter); // It is not yet to safe to tell the concurrent mark to // start as we have some optional output below. We don't want the @@ -4080,7 +3975,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { _hrm.verify_optional(); verify_region_sets_optional(); - TASKQUEUE_STATS_ONLY(if (PrintTaskqueue) print_taskqueue_stats()); + TASKQUEUE_STATS_ONLY(print_taskqueue_stats()); TASKQUEUE_STATS_ONLY(reset_taskqueue_stats()); print_heap_after_gc(); @@ -4235,13 +4130,12 @@ public: assert(pss->queue_is_empty(), "should be empty"); - if (PrintTerminationStats) { + if (log_is_enabled(Debug, gc, task, stats)) { MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); size_t lab_waste; size_t lab_undo_waste; pss->waste(lab_waste, lab_undo_waste); - _g1h->print_termination_stats(gclog_or_tty, - worker_id, + _g1h->print_termination_stats(worker_id, (os::elapsedTime() - start_sec) * 1000.0, /* elapsed time */ strong_roots_sec * 1000.0, /* strong roots time */ term_sec * 1000.0, /* evac term time */ @@ -4259,22 +4153,22 @@ public: } }; -void G1CollectedHeap::print_termination_stats_hdr(outputStream* const st) { - st->print_raw_cr("GC Termination Stats"); - st->print_raw_cr(" elapsed --strong roots-- -------termination------- ------waste (KiB)------"); - st->print_raw_cr("thr ms ms % ms % attempts total alloc undo"); - st->print_raw_cr("--- --------- --------- ------ --------- ------ -------- ------- ------- -------"); +void G1CollectedHeap::print_termination_stats_hdr() { + log_debug(gc, task, stats)("GC Termination Stats"); + log_debug(gc, task, stats)(" elapsed --strong roots-- -------termination------- ------waste (KiB)------"); + log_debug(gc, task, stats)("thr ms ms %% ms %% attempts total alloc undo"); + log_debug(gc, task, stats)("--- --------- --------- ------ --------- ------ -------- ------- ------- -------"); } -void G1CollectedHeap::print_termination_stats(outputStream* const st, - uint worker_id, +void G1CollectedHeap::print_termination_stats(uint worker_id, double elapsed_ms, double strong_roots_ms, double term_ms, size_t term_attempts, size_t alloc_buffer_waste, size_t undo_waste) const { - st->print_cr("%3d %9.2f %9.2f %6.2f " + log_debug(gc, task, stats) + ("%3d %9.2f %9.2f %6.2f " "%9.2f %6.2f " SIZE_FORMAT_W(8) " " SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7), worker_id, elapsed_ms, strong_roots_ms, strong_roots_ms * 100 / elapsed_ms, @@ -4323,13 +4217,11 @@ public: "claim value %d after unlink less than initial symbol table size %d", SymbolTable::parallel_claimed_index(), _initial_symbol_table_size); - if (G1TraceStringSymbolTableScrubbing) { - gclog_or_tty->print_cr("Cleaned string and symbol table, " - "strings: " SIZE_FORMAT " processed, " SIZE_FORMAT " removed, " - "symbols: " SIZE_FORMAT " processed, " SIZE_FORMAT " removed", - strings_processed(), strings_removed(), - symbols_processed(), symbols_removed()); - } + log_debug(gc, stringdedup)("Cleaned string and symbol table, " + "strings: " SIZE_FORMAT " processed, " SIZE_FORMAT " removed, " + "symbols: " SIZE_FORMAT " processed, " SIZE_FORMAT " removed", + strings_processed(), strings_removed(), + symbols_processed(), symbols_removed()); } void work(uint worker_id) { @@ -5169,10 +5061,7 @@ void G1CollectedHeap::evacuate_collection_set(EvacuationInfo& evacuation_info, G ClassLoaderDataGraph::clear_claimed_marks(); } - // The individual threads will set their evac-failure closures. - if (PrintTerminationStats) { - print_termination_stats_hdr(gclog_or_tty); - } + print_termination_stats_hdr(); workers()->run_task(&g1_par_task); end_par_time_sec = os::elapsedTime(); @@ -5411,11 +5300,8 @@ bool G1CollectedHeap::verify_no_bits_over_tams(const char* bitmap_name, CMBitMap "tams: " PTR_FORMAT " end: " PTR_FORMAT, p2i(tams), p2i(end)); HeapWord* result = bitmap->getNextMarkedWordAddress(tams, end); if (result < end) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("## wrong marked address on %s bitmap: " PTR_FORMAT, - bitmap_name, p2i(result)); - gclog_or_tty->print_cr("## %s tams: " PTR_FORMAT " end: " PTR_FORMAT, - bitmap_name, p2i(tams), p2i(end)); + log_info(gc, verify)("## wrong marked address on %s bitmap: " PTR_FORMAT, bitmap_name, p2i(result)); + log_info(gc, verify)("## %s tams: " PTR_FORMAT " end: " PTR_FORMAT, bitmap_name, p2i(tams), p2i(end)); return false; } return true; @@ -5440,9 +5326,8 @@ bool G1CollectedHeap::verify_bitmaps(const char* caller, HeapRegion* hr) { res_n = verify_no_bits_over_tams("next", next_bitmap, ntams, end); } if (!res_p || !res_n) { - gclog_or_tty->print_cr("#### Bitmap verification failed for " HR_FORMAT, - HR_FORMAT_PARAMS(hr)); - gclog_or_tty->print_cr("#### Caller: %s", caller); + log_info(gc, verify)("#### Bitmap verification failed for " HR_FORMAT, HR_FORMAT_PARAMS(hr)); + log_info(gc, verify)("#### Caller: %s", caller); return false; } return true; @@ -5494,42 +5379,42 @@ class G1CheckCSetFastTableClosure : public HeapRegionClosure { InCSetState cset_state = (InCSetState) G1CollectedHeap::heap()->_in_cset_fast_test.get_by_index(i); if (hr->is_humongous()) { if (hr->in_collection_set()) { - gclog_or_tty->print_cr("\n## humongous region %u in CSet", i); + log_info(gc, verify)("## humongous region %u in CSet", i); _failures = true; return true; } if (cset_state.is_in_cset()) { - gclog_or_tty->print_cr("\n## inconsistent cset state " CSETSTATE_FORMAT " for humongous region %u", cset_state.value(), i); + log_info(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for humongous region %u", cset_state.value(), i); _failures = true; return true; } if (hr->is_continues_humongous() && cset_state.is_humongous()) { - gclog_or_tty->print_cr("\n## inconsistent cset state " CSETSTATE_FORMAT " for continues humongous region %u", cset_state.value(), i); + log_info(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for continues humongous region %u", cset_state.value(), i); _failures = true; return true; } } else { if (cset_state.is_humongous()) { - gclog_or_tty->print_cr("\n## inconsistent cset state " CSETSTATE_FORMAT " for non-humongous region %u", cset_state.value(), i); + log_info(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for non-humongous region %u", cset_state.value(), i); _failures = true; return true; } if (hr->in_collection_set() != cset_state.is_in_cset()) { - gclog_or_tty->print_cr("\n## in CSet %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", - hr->in_collection_set(), cset_state.value(), i); + log_info(gc, verify)("## in CSet %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", + hr->in_collection_set(), cset_state.value(), i); _failures = true; return true; } if (cset_state.is_in_cset()) { if (hr->is_young() != (cset_state.is_young())) { - gclog_or_tty->print_cr("\n## is_young %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", - hr->is_young(), cset_state.value(), i); + log_info(gc, verify)("## is_young %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", + hr->is_young(), cset_state.value(), i); _failures = true; return true; } if (hr->is_old() != (cset_state.is_old())) { - gclog_or_tty->print_cr("\n## is_old %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", - hr->is_old(), cset_state.value(), i); + log_info(gc, verify)("## is_old %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", + hr->is_old(), cset_state.value(), i); _failures = true; return true; } @@ -5746,9 +5631,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { uint region_idx = r->hrm_index(); if (!g1h->is_humongous_reclaim_candidate(region_idx) || !r->rem_set()->is_empty()) { - - if (G1TraceEagerReclaimHumongousObjects) { - gclog_or_tty->print_cr("Live humongous region %u object size " SIZE_FORMAT " start " PTR_FORMAT " with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d", + log_debug(gc, humongous)("Live humongous region %u object size " SIZE_FORMAT " start " PTR_FORMAT " with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d", region_idx, (size_t)obj->size() * HeapWordSize, p2i(r->bottom()), @@ -5758,8 +5641,6 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { g1h->is_humongous_reclaim_candidate(region_idx), obj->is_typeArray() ); - } - return false; } @@ -5767,8 +5648,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { "Only eagerly reclaiming type arrays is supported, but the object " PTR_FORMAT " is not.", p2i(r->bottom())); - if (G1TraceEagerReclaimHumongousObjects) { - gclog_or_tty->print_cr("Dead humongous region %u object size " SIZE_FORMAT " start " PTR_FORMAT " with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d", + log_debug(gc, humongous)("Dead humongous region %u object size " SIZE_FORMAT " start " PTR_FORMAT " with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d", region_idx, (size_t)obj->size() * HeapWordSize, p2i(r->bottom()), @@ -5778,7 +5658,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { g1h->is_humongous_reclaim_candidate(region_idx), obj->is_typeArray() ); - } + // Need to clear mark bit of the humongous object if already set. if (next_bitmap->isMarked(r->bottom())) { next_bitmap->clear(r->bottom()); @@ -5812,7 +5692,7 @@ void G1CollectedHeap::eagerly_reclaim_humongous_regions() { assert_at_safepoint(true); if (!G1EagerReclaimHumongousObjects || - (!_has_humongous_reclaim_candidates && !G1TraceEagerReclaimHumongousObjects)) { + (!_has_humongous_reclaim_candidates && !log_is_enabled(Debug, gc, humongous))) { g1_policy()->phase_times()->record_fast_reclaim_humongous_time_ms(0.0, 0); return; } @@ -5865,10 +5745,7 @@ void G1CollectedHeap::abandon_collection_set(HeapRegion* cs_head) { } void G1CollectedHeap::set_free_regions_coming() { - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [cm thread] : " - "setting free regions coming"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [cm thread] : setting free regions coming"); assert(!free_regions_coming(), "pre-condition"); _free_regions_coming = true; @@ -5883,10 +5760,7 @@ void G1CollectedHeap::reset_free_regions_coming() { SecondaryFreeList_lock->notify_all(); } - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [cm thread] : " - "reset free regions coming"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [cm thread] : reset free regions coming"); } void G1CollectedHeap::wait_while_free_regions_coming() { @@ -5896,10 +5770,7 @@ void G1CollectedHeap::wait_while_free_regions_coming() { return; } - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [other] : " - "waiting for free regions"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [other] : waiting for free regions"); { MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag); @@ -5908,10 +5779,7 @@ void G1CollectedHeap::wait_while_free_regions_coming() { } } - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [other] : " - "done waiting for free regions"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [other] : done waiting for free regions"); } bool G1CollectedHeap::is_old_gc_alloc_region(HeapRegion* hr) { @@ -5929,8 +5797,8 @@ public: NoYoungRegionsClosure() : _success(true) { } bool doHeapRegion(HeapRegion* r) { if (r->is_young()) { - gclog_or_tty->print_cr("Region [" PTR_FORMAT ", " PTR_FORMAT ") tagged as young", - p2i(r->bottom()), p2i(r->end())); + log_info(gc, verify)("Region [" PTR_FORMAT ", " PTR_FORMAT ") tagged as young", + p2i(r->bottom()), p2i(r->end())); _success = false; } return false; @@ -6180,11 +6048,8 @@ HeapRegion* G1CollectedHeap::alloc_highest_free_region() { if (index != G1_NO_HRM_INDEX) { if (expanded) { - ergo_verbose1(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("requested address range outside heap bounds") - ergo_format_byte("region size"), - HeapRegion::GrainWords * HeapWordSize); + log_debug(gc, ergo, heap)("Attempt heap expansion (requested address range outside heap bounds). region size: " SIZE_FORMAT "B", + HeapRegion::GrainWords * HeapWordSize); } _hrm.allocate_free_regions_starting_at(index, 1); return region_at(index); diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp index eb1292876d6..9bd26d31175 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp @@ -290,8 +290,7 @@ private: void verify_before_gc(); void verify_after_gc(); - void log_gc_header(); - void log_gc_footer(double pause_time_sec); + void log_gc_footer(double pause_time_counter); void trace_heap(GCWhen::Type when, const GCTracer* tracer); @@ -704,8 +703,8 @@ protected: void shrink_helper(size_t expand_bytes); #if TASKQUEUE_STATS - static void print_taskqueue_stats_hdr(outputStream* const st = gclog_or_tty); - void print_taskqueue_stats(outputStream* const st = gclog_or_tty) const; + static void print_taskqueue_stats_hdr(outputStream* const st); + void print_taskqueue_stats() const; void reset_taskqueue_stats(); #endif // TASKQUEUE_STATS @@ -738,10 +737,9 @@ protected: void post_evacuate_collection_set(EvacuationInfo& evacuation_info, G1ParScanThreadStateSet* pss); // Print the header for the per-thread termination statistics. - static void print_termination_stats_hdr(outputStream* const st); + static void print_termination_stats_hdr(); // Print actual per-thread termination statistics. - void print_termination_stats(outputStream* const st, - uint worker_id, + void print_termination_stats(uint worker_id, double elapsed_ms, double strong_roots_ms, double term_ms, @@ -968,6 +966,10 @@ public: return CollectedHeap::G1CollectedHeap; } + virtual const char* name() const { + return "G1"; + } + const G1CollectorState* collector_state() const { return &_collector_state; } G1CollectorState* collector_state() { return &_collector_state; } @@ -1365,6 +1367,10 @@ public: YoungList* young_list() const { return _young_list; } + uint old_regions_count() const { return _old_set.length(); } + + uint humongous_regions_count() const { return _humongous_set.length(); } + // debugging bool check_young_list_well_formed() { return _young_list->check_list_well_formed(); @@ -1482,10 +1488,7 @@ public: // Currently there is only one place where this is called with // vo == UseMarkWord, which is to verify the marking during a // full GC. - void verify(bool silent, VerifyOption vo); - - // Override; it uses the "prev" marking information - virtual void verify(bool silent); + void verify(VerifyOption vo); // The methods below are here for convenience and dispatch the // appropriate method depending on value of the given VerifyOption diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp index 9bccfb27fdc..d19bf2faab8 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp @@ -29,9 +29,7 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/g1/g1IHOPControl.hpp" -#include "gc/g1/g1ErgoVerbose.hpp" #include "gc/g1/g1GCPhaseTimes.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/heapRegion.inline.hpp" #include "gc/g1/heapRegionRemSet.hpp" #include "gc/shared/gcPolicyCounters.hpp" @@ -121,6 +119,8 @@ G1CollectorPolicy::G1CollectorPolicy() : _eden_used_bytes_before_gc(0), _survivor_used_bytes_before_gc(0), + _old_used_bytes_before_gc(0), + _humongous_used_bytes_before_gc(0), _heap_used_bytes_before_gc(0), _metaspace_used_bytes_before_gc(0), _eden_capacity_bytes_before_gc(0), @@ -177,18 +177,6 @@ G1CollectorPolicy::G1CollectorPolicy() : HeapRegion::setup_heap_region_size(InitialHeapSize, MaxHeapSize); HeapRegionRemSet::setup_remset_size(); - G1ErgoVerbose::initialize(); - if (PrintAdaptiveSizePolicy) { - // Currently, we only use a single switch for all the heuristics. - G1ErgoVerbose::set_enabled(true); - // Given that we don't currently have a verboseness level - // parameter, we'll hardcode this to high. This can be easily - // changed in the future. - G1ErgoVerbose::set_level(ErgoHigh); - } else { - G1ErgoVerbose::set_enabled(false); - } - _recent_prev_end_times_for_all_gcs_sec->add(os::elapsedTime()); _prev_collection_pause_end_ms = os::elapsedTime() * 1000.0; clear_ratio_check_data(); @@ -791,7 +779,7 @@ G1CollectorPolicy::verify_young_ages(HeapRegion* head, curr = curr->get_next_young_region()) { SurvRateGroup* group = curr->surv_rate_group(); if (group == NULL && !curr->is_survivor()) { - gclog_or_tty->print_cr("## %s: encountered NULL surv_rate_group", name); + log_info(gc, verify)("## %s: encountered NULL surv_rate_group", name); ret = false; } @@ -799,13 +787,12 @@ G1CollectorPolicy::verify_young_ages(HeapRegion* head, int age = curr->age_in_surv_rate_group(); if (age < 0) { - gclog_or_tty->print_cr("## %s: encountered negative age", name); + log_info(gc, verify)("## %s: encountered negative age", name); ret = false; } if (age <= prev_age) { - gclog_or_tty->print_cr("## %s: region ages are not strictly increasing " - "(%d, %d)", name, age, prev_age); + log_info(gc, verify)("## %s: region ages are not strictly increasing (%d, %d)", name, age, prev_age); ret = false; } prev_age = age; @@ -982,38 +969,15 @@ bool G1CollectorPolicy::need_to_start_conc_mark(const char* source, size_t alloc size_t alloc_byte_size = alloc_word_size * HeapWordSize; size_t marking_request_bytes = cur_used_bytes + alloc_byte_size; + bool result = false; if (marking_request_bytes > marking_initiating_used_threshold) { - if (collector_state()->gcs_are_young() && !collector_state()->last_young_gc()) { - ergo_verbose5(ErgoConcCycles, - "request concurrent cycle initiation", - ergo_format_reason("occupancy higher than threshold") - ergo_format_byte("occupancy") - ergo_format_byte("allocation request") - ergo_format_byte_perc("threshold") - ergo_format_str("source"), - cur_used_bytes, - alloc_byte_size, - marking_initiating_used_threshold, - (double) marking_initiating_used_threshold / _g1->capacity() * 100, - source); - return true; - } else { - ergo_verbose5(ErgoConcCycles, - "do not request concurrent cycle initiation", - ergo_format_reason("still doing mixed collections") - ergo_format_byte("occupancy") - ergo_format_byte("allocation request") - ergo_format_byte_perc("threshold") - ergo_format_str("source"), - cur_used_bytes, - alloc_byte_size, - marking_initiating_used_threshold, - (double) InitiatingHeapOccupancyPercent, - source); - } + result = collector_state()->gcs_are_young() && !collector_state()->last_young_gc(); + log_debug(gc, ergo, ihop)("%s occupancy: " SIZE_FORMAT "B allocation request: " SIZE_FORMAT "B threshold: " SIZE_FORMAT "B (%1.2f) source: %s", + result ? "Request concurrent cycle initiation (occupancy higher than threshold)" : "Do not request concurrent cycle initiation (still doing mixed collections)", + cur_used_bytes, alloc_byte_size, marking_initiating_used_threshold, (double) marking_initiating_used_threshold / _g1->capacity() * 100, source); } - return false; + return result; } // Anything below that is considered to be zero @@ -1027,13 +991,7 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, size_t bool last_pause_included_initial_mark = false; bool update_stats = !_g1->evacuation_failed(); -#ifndef PRODUCT - if (G1YoungSurvRateVerbose) { - gclog_or_tty->cr(); - _short_lived_surv_rate_group->print(); - // do that for any other surv rate groups too - } -#endif // PRODUCT + NOT_PRODUCT(_short_lived_surv_rate_group->print()); record_pause(young_gc_pause_kind(), end_time_sec - pause_time_ms / 1000.0, end_time_sec); @@ -1228,13 +1186,9 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, size_t double scan_hcc_time_ms = average_time_ms(G1GCPhaseTimes::ScanHCC); if (update_rs_time_goal_ms < scan_hcc_time_ms) { - ergo_verbose2(ErgoTiming, - "adjust concurrent refinement thresholds", - ergo_format_reason("Scanning the HCC expected to take longer than Update RS time goal") - ergo_format_ms("Update RS time goal") - ergo_format_ms("Scan HCC time"), - update_rs_time_goal_ms, - scan_hcc_time_ms); + log_debug(gc, ergo, refine)("Adjust concurrent refinement thresholds (scanning the HCC expected to take longer than Update RS time goal)." + "Update RS time goal: %1.2fms Scan HCC time: %1.2fms", + update_rs_time_goal_ms, scan_hcc_time_ms); update_rs_time_goal_ms = 0; } else { @@ -1312,65 +1266,37 @@ void G1CollectorPolicy::record_heap_size_info_at_start(bool full) { _eden_used_bytes_before_gc = young_list->eden_used_bytes(); _survivor_used_bytes_before_gc = young_list->survivor_used_bytes(); _heap_capacity_bytes_before_gc = _g1->capacity(); + _old_used_bytes_before_gc = _g1->old_regions_count() * HeapRegion::GrainBytes; + _humongous_used_bytes_before_gc = _g1->humongous_regions_count() * HeapRegion::GrainBytes; _heap_used_bytes_before_gc = _g1->used(); - - _eden_capacity_bytes_before_gc = - (_young_list_target_length * HeapRegion::GrainBytes) - _survivor_used_bytes_before_gc; - - if (full) { - _metaspace_used_bytes_before_gc = MetaspaceAux::used_bytes(); - } + _eden_capacity_bytes_before_gc = (_young_list_target_length * HeapRegion::GrainBytes) - _survivor_used_bytes_before_gc; + _metaspace_used_bytes_before_gc = MetaspaceAux::used_bytes(); } -void G1CollectorPolicy::print_heap_transition(size_t bytes_before) const { - size_t bytes_after = _g1->used(); - size_t capacity = _g1->capacity(); - - gclog_or_tty->print(" " SIZE_FORMAT "%s->" SIZE_FORMAT "%s(" SIZE_FORMAT "%s)", - byte_size_in_proper_unit(bytes_before), - proper_unit_for_byte_size(bytes_before), - byte_size_in_proper_unit(bytes_after), - proper_unit_for_byte_size(bytes_after), - byte_size_in_proper_unit(capacity), - proper_unit_for_byte_size(capacity)); -} - -void G1CollectorPolicy::print_heap_transition() const { - print_heap_transition(_heap_used_bytes_before_gc); -} - -void G1CollectorPolicy::print_detailed_heap_transition(bool full) const { +void G1CollectorPolicy::print_detailed_heap_transition() const { YoungList* young_list = _g1->young_list(); size_t eden_used_bytes_after_gc = young_list->eden_used_bytes(); size_t survivor_used_bytes_after_gc = young_list->survivor_used_bytes(); size_t heap_used_bytes_after_gc = _g1->used(); + size_t old_used_bytes_after_gc = _g1->old_regions_count() * HeapRegion::GrainBytes; + size_t humongous_used_bytes_after_gc = _g1->humongous_regions_count() * HeapRegion::GrainBytes; size_t heap_capacity_bytes_after_gc = _g1->capacity(); size_t eden_capacity_bytes_after_gc = (_young_list_target_length * HeapRegion::GrainBytes) - survivor_used_bytes_after_gc; + size_t survivor_capacity_bytes_after_gc = _max_survivor_regions * HeapRegion::GrainBytes; - gclog_or_tty->print( - " [Eden: " EXT_SIZE_FORMAT "(" EXT_SIZE_FORMAT ")->" EXT_SIZE_FORMAT "(" EXT_SIZE_FORMAT ") " - "Survivors: " EXT_SIZE_FORMAT "->" EXT_SIZE_FORMAT " " - "Heap: " EXT_SIZE_FORMAT "(" EXT_SIZE_FORMAT ")->" - EXT_SIZE_FORMAT "(" EXT_SIZE_FORMAT ")]", - EXT_SIZE_PARAMS(_eden_used_bytes_before_gc), - EXT_SIZE_PARAMS(_eden_capacity_bytes_before_gc), - EXT_SIZE_PARAMS(eden_used_bytes_after_gc), - EXT_SIZE_PARAMS(eden_capacity_bytes_after_gc), - EXT_SIZE_PARAMS(_survivor_used_bytes_before_gc), - EXT_SIZE_PARAMS(survivor_used_bytes_after_gc), - EXT_SIZE_PARAMS(_heap_used_bytes_before_gc), - EXT_SIZE_PARAMS(_heap_capacity_bytes_before_gc), - EXT_SIZE_PARAMS(heap_used_bytes_after_gc), - EXT_SIZE_PARAMS(heap_capacity_bytes_after_gc)); + log_info(gc, heap)("Eden: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + _eden_used_bytes_before_gc / K, eden_used_bytes_after_gc /K, eden_capacity_bytes_after_gc /K); + log_info(gc, heap)("Survivor: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + _survivor_used_bytes_before_gc / K, survivor_used_bytes_after_gc /K, survivor_capacity_bytes_after_gc /K); + log_info(gc, heap)("Old: " SIZE_FORMAT "K->" SIZE_FORMAT "K", + _old_used_bytes_before_gc / K, old_used_bytes_after_gc /K); + log_info(gc, heap)("Humongous: " SIZE_FORMAT "K->" SIZE_FORMAT "K", + _humongous_used_bytes_before_gc / K, humongous_used_bytes_after_gc /K); - if (full) { - MetaspaceAux::print_metaspace_change(_metaspace_used_bytes_before_gc); - } - - gclog_or_tty->cr(); + MetaspaceAux::print_metaspace_change(_metaspace_used_bytes_before_gc); } void G1CollectorPolicy::print_phases(double pause_time_sec) { @@ -1690,17 +1616,9 @@ size_t G1CollectorPolicy::expansion_amount() { } } - ergo_verbose5(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("recent GC overhead higher than " - "threshold after GC") - ergo_format_perc("recent GC overhead") - ergo_format_perc("current threshold") - ergo_format_byte("uncommitted") - ergo_format_byte_perc("base expansion amount and scale"), - recent_gc_overhead, threshold, - uncommitted_bytes, - expand_bytes, scale_factor * 100); + log_debug(gc, ergo, heap)("Attempt heap expansion (recent GC overhead higher than threshold after GC) " + "recent GC overhead: %1.2f %% threshold: %1.2f %% uncommitted: " SIZE_FORMAT "B base expansion amount and scale: " SIZE_FORMAT "B (%1.2f%%)", + recent_gc_overhead, threshold, uncommitted_bytes, expand_bytes, scale_factor * 100); expand_bytes = static_cast(expand_bytes * scale_factor); @@ -1783,19 +1701,11 @@ bool G1CollectorPolicy::force_initial_mark_if_outside_cycle(GCCause::Cause gc_ca // even while we are still in the process of reclaiming memory. bool during_cycle = _g1->concurrent_mark()->cmThread()->during_cycle(); if (!during_cycle) { - ergo_verbose1(ErgoConcCycles, - "request concurrent cycle initiation", - ergo_format_reason("requested by GC cause") - ergo_format_str("GC cause"), - GCCause::to_string(gc_cause)); + log_debug(gc, ergo)("Request concurrent cycle initiation (requested by GC cause). GC cause: %s", GCCause::to_string(gc_cause)); collector_state()->set_initiate_conc_mark_if_possible(true); return true; } else { - ergo_verbose1(ErgoConcCycles, - "do not request concurrent cycle initiation", - ergo_format_reason("concurrent cycle already in progress") - ergo_format_str("GC cause"), - GCCause::to_string(gc_cause)); + log_debug(gc, ergo)("Do not request concurrent cycle initiation (concurrent cycle already in progress). GC cause: %s", GCCause::to_string(gc_cause)); return false; } } @@ -1823,9 +1733,7 @@ void G1CollectorPolicy::decide_on_conc_mark_initiation() { if (!about_to_start_mixed_phase() && collector_state()->gcs_are_young()) { // Initiate a new initial mark if there is no marking or reclamation going on. initiate_conc_mark(); - ergo_verbose0(ErgoConcCycles, - "initiate concurrent cycle", - ergo_format_reason("concurrent cycle initiation requested")); + log_debug(gc, ergo)("Initiate concurrent cycle (concurrent cycle initiation requested)"); } else if (_g1->is_user_requested_concurrent_full_gc(_g1->gc_cause())) { // Initiate a user requested initial mark. An initial mark must be young only // GC, so the collector state must be updated to reflect this. @@ -1834,9 +1742,7 @@ void G1CollectorPolicy::decide_on_conc_mark_initiation() { abort_time_to_mixed_tracking(); initiate_conc_mark(); - ergo_verbose0(ErgoConcCycles, - "initiate concurrent cycle", - ergo_format_reason("user requested concurrent cycle")); + log_debug(gc, ergo)("Initiate concurrent cycle (user requested concurrent cycle)"); } else { // The concurrent marking thread is still finishing up the // previous cycle. If we start one right now the two cycles @@ -1850,9 +1756,7 @@ void G1CollectorPolicy::decide_on_conc_mark_initiation() { // and, if it's in a yield point, it's waiting for us to // finish. So, at this point we will not start a cycle and we'll // let the concurrent marking thread complete the last one. - ergo_verbose0(ErgoConcCycles, - "do not initiate concurrent cycle", - ergo_format_reason("concurrent cycle already in progress")); + log_debug(gc, ergo)("Do not initiate concurrent cycle (concurrent cycle already in progress)"); } } } @@ -2197,9 +2101,7 @@ void G1CollectorPolicy::abort_time_to_mixed_tracking() { bool G1CollectorPolicy::next_gc_should_be_mixed(const char* true_action_str, const char* false_action_str) const { if (cset_chooser()->is_empty()) { - ergo_verbose0(ErgoMixedGCs, - false_action_str, - ergo_format_reason("candidate old regions not available")); + log_debug(gc, ergo)("%s (candidate old regions not available)", false_action_str); return false; } @@ -2208,27 +2110,12 @@ bool G1CollectorPolicy::next_gc_should_be_mixed(const char* true_action_str, double reclaimable_perc = reclaimable_bytes_perc(reclaimable_bytes); double threshold = (double) G1HeapWastePercent; if (reclaimable_perc <= threshold) { - ergo_verbose4(ErgoMixedGCs, - false_action_str, - ergo_format_reason("reclaimable percentage not over threshold") - ergo_format_region("candidate old regions") - ergo_format_byte_perc("reclaimable") - ergo_format_perc("threshold"), - cset_chooser()->remaining_regions(), - reclaimable_bytes, - reclaimable_perc, threshold); + log_debug(gc, ergo)("%s (reclaimable percentage not over threshold). candidate old regions: %u reclaimable: " SIZE_FORMAT " (%1.2f) threshold: " UINTX_FORMAT, + false_action_str, cset_chooser()->remaining_regions(), reclaimable_bytes, reclaimable_perc, G1HeapWastePercent); return false; } - - ergo_verbose4(ErgoMixedGCs, - true_action_str, - ergo_format_reason("candidate old regions available") - ergo_format_region("candidate old regions") - ergo_format_byte_perc("reclaimable") - ergo_format_perc("threshold"), - cset_chooser()->remaining_regions(), - reclaimable_bytes, - reclaimable_perc, threshold); + log_debug(gc, ergo)("%s (candidate old regions available). candidate old regions: %u reclaimable: " SIZE_FORMAT " (%1.2f) threshold: " UINTX_FORMAT, + true_action_str, cset_chooser()->remaining_regions(), reclaimable_bytes, reclaimable_perc, G1HeapWastePercent); return true; } @@ -2284,13 +2171,8 @@ double G1CollectorPolicy::finalize_young_cset_part(double target_pause_time_ms) double base_time_ms = predict_base_elapsed_time_ms(_pending_cards); double time_remaining_ms = MAX2(target_pause_time_ms - base_time_ms, 0.0); - ergo_verbose4(ErgoCSetConstruction | ErgoHigh, - "start choosing CSet", - ergo_format_size("_pending_cards") - ergo_format_ms("predicted base time") - ergo_format_ms("remaining time") - ergo_format_ms("target pause time"), - _pending_cards, base_time_ms, time_remaining_ms, target_pause_time_ms); + log_trace(gc, ergo, cset)("Start choosing CSet. pending cards: " SIZE_FORMAT " predicted base time: %1.2fms remaining time: %1.2fms target pause time: %1.2fms", + _pending_cards, base_time_ms, time_remaining_ms, target_pause_time_ms); collector_state()->set_last_gc_was_young(collector_state()->gcs_are_young()); @@ -2326,15 +2208,8 @@ double G1CollectorPolicy::finalize_young_cset_part(double target_pause_time_ms) _collection_set_bytes_used_before = _inc_cset_bytes_used_before; time_remaining_ms = MAX2(time_remaining_ms - _inc_cset_predicted_elapsed_time_ms, 0.0); - ergo_verbose4(ErgoCSetConstruction | ErgoHigh, - "add young regions to CSet", - ergo_format_region("eden") - ergo_format_region("survivors") - ergo_format_ms("predicted young region time") - ergo_format_ms("target pause time"), - eden_region_length, survivor_region_length, - _inc_cset_predicted_elapsed_time_ms, - target_pause_time_ms); + log_trace(gc, ergo, cset)("Add young regions to CSet. eden: %u regions, survivors: %u regions, predicted young region time: %1.2fms, target pause time: %1.2fms", + eden_region_length, survivor_region_length, _inc_cset_predicted_elapsed_time_ms, target_pause_time_ms); // The number of recorded young regions is the incremental // collection set's current size @@ -2363,12 +2238,8 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { while (hr != NULL) { if (old_cset_region_length() >= max_old_cset_length) { // Added maximum number of old regions to the CSet. - ergo_verbose2(ErgoCSetConstruction, - "finish adding old regions to CSet", - ergo_format_reason("old CSet region num reached max") - ergo_format_region("old") - ergo_format_region("max"), - old_cset_region_length(), max_old_cset_length); + log_debug(gc, ergo, cset)("Finish adding old regions to CSet (old CSet region num reached max). old %u regions, max %u regions", + old_cset_region_length(), max_old_cset_length); break; } @@ -2382,17 +2253,9 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { // We've added enough old regions that the amount of uncollected // reclaimable space is at or below the waste threshold. Stop // adding old regions to the CSet. - ergo_verbose5(ErgoCSetConstruction, - "finish adding old regions to CSet", - ergo_format_reason("reclaimable percentage not over threshold") - ergo_format_region("old") - ergo_format_region("max") - ergo_format_byte_perc("reclaimable") - ergo_format_perc("threshold"), - old_cset_region_length(), - max_old_cset_length, - reclaimable_bytes, - reclaimable_perc, threshold); + log_debug(gc, ergo, cset)("Finish adding old regions to CSet (reclaimable percentage not over threshold). " + "old %u regions, max %u regions, reclaimable: " SIZE_FORMAT "B (%1.2f%%) threshold: " UINTX_FORMAT "%%", + old_cset_region_length(), max_old_cset_length, reclaimable_bytes, reclaimable_perc, G1HeapWastePercent); break; } @@ -2404,15 +2267,9 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { if (old_cset_region_length() >= min_old_cset_length) { // We have added the minimum number of old regions to the CSet, // we are done with this CSet. - ergo_verbose4(ErgoCSetConstruction, - "finish adding old regions to CSet", - ergo_format_reason("predicted time is too high") - ergo_format_ms("predicted time") - ergo_format_ms("remaining time") - ergo_format_region("old") - ergo_format_region("min"), - predicted_time_ms, time_remaining_ms, - old_cset_region_length(), min_old_cset_length); + log_debug(gc, ergo, cset)("Finish adding old regions to CSet (predicted time is too high). " + "predicted time: %1.2fms, remaining time: %1.2fms old %u regions, min %u regions", + predicted_time_ms, time_remaining_ms, old_cset_region_length(), min_old_cset_length); break; } @@ -2424,12 +2281,9 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { if (old_cset_region_length() >= min_old_cset_length) { // In the non-auto-tuning case, we'll finish adding regions // to the CSet if we reach the minimum. - ergo_verbose2(ErgoCSetConstruction, - "finish adding old regions to CSet", - ergo_format_reason("old CSet region num reached min") - ergo_format_region("old") - ergo_format_region("min"), - old_cset_region_length(), min_old_cset_length); + + log_debug(gc, ergo, cset)("Finish adding old regions to CSet (old CSet region num reached min). old %u regions, min %u regions", + old_cset_region_length(), min_old_cset_length); break; } } @@ -2444,26 +2298,16 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { hr = cset_chooser()->peek(); } if (hr == NULL) { - ergo_verbose0(ErgoCSetConstruction, - "finish adding old regions to CSet", - ergo_format_reason("candidate old regions not available")); + log_debug(gc, ergo, cset)("Finish adding old regions to CSet (candidate old regions not available)"); } if (expensive_region_num > 0) { // We print the information once here at the end, predicated on // whether we added any apparently expensive regions or not, to // avoid generating output per region. - ergo_verbose4(ErgoCSetConstruction, - "added expensive regions to CSet", - ergo_format_reason("old CSet region num not reached min") - ergo_format_region("old") - ergo_format_region("expensive") - ergo_format_region("min") - ergo_format_ms("remaining time"), - old_cset_region_length(), - expensive_region_num, - min_old_cset_length, - time_remaining_ms); + log_debug(gc, ergo, cset)("Added expensive regions to CSet (old CSet region num not reached min)." + "old %u regions, expensive: %u regions, min %u regions, remaining time: %1.2fms", + old_cset_region_length(), expensive_region_num, min_old_cset_length, time_remaining_ms); } cset_chooser()->verify(); @@ -2471,13 +2315,8 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { stop_incremental_cset_building(); - ergo_verbose3(ErgoCSetConstruction, - "finish choosing CSet", - ergo_format_region("old") - ergo_format_ms("predicted old region time") - ergo_format_ms("time remaining"), - old_cset_region_length(), - predicted_old_time_ms, time_remaining_ms); + log_debug(gc, ergo, cset)("Finish choosing CSet. old %u regions, predicted old region time: %1.2fms, time remaining: %1.2f", + old_cset_region_length(), predicted_old_time_ms, time_remaining_ms); double non_young_end_time_sec = os::elapsedTime(); phase_times()->record_non_young_cset_choice_time_ms((non_young_end_time_sec - non_young_start_time_sec) * 1000.0); @@ -2536,14 +2375,14 @@ void TraceYoungGenTimeData::increment_mixed_collection_count() { void TraceYoungGenTimeData::print_summary(const char* str, const NumberSeq* seq) const { double sum = seq->sum(); - gclog_or_tty->print_cr("%-27s = %8.2lf s (avg = %8.2lf ms)", + tty->print_cr("%-27s = %8.2lf s (avg = %8.2lf ms)", str, sum / 1000.0, seq->avg()); } void TraceYoungGenTimeData::print_summary_sd(const char* str, const NumberSeq* seq) const { print_summary(str, seq); - gclog_or_tty->print_cr("%45s = %5d, std dev = %8.2lf ms, max = %8.2lf ms)", + tty->print_cr("%45s = %5d, std dev = %8.2lf ms, max = %8.2lf ms)", "(num", seq->num(), seq->sd(), seq->maximum()); } @@ -2552,18 +2391,18 @@ void TraceYoungGenTimeData::print() const { return; } - gclog_or_tty->print_cr("ALL PAUSES"); + tty->print_cr("ALL PAUSES"); print_summary_sd(" Total", &_total); - gclog_or_tty->cr(); - gclog_or_tty->cr(); - gclog_or_tty->print_cr(" Young GC Pauses: %8d", _young_pause_num); - gclog_or_tty->print_cr(" Mixed GC Pauses: %8d", _mixed_pause_num); - gclog_or_tty->cr(); + tty->cr(); + tty->cr(); + tty->print_cr(" Young GC Pauses: %8d", _young_pause_num); + tty->print_cr(" Mixed GC Pauses: %8d", _mixed_pause_num); + tty->cr(); - gclog_or_tty->print_cr("EVACUATION PAUSES"); + tty->print_cr("EVACUATION PAUSES"); if (_young_pause_num == 0 && _mixed_pause_num == 0) { - gclog_or_tty->print_cr("none"); + tty->print_cr("none"); } else { print_summary_sd(" Evacuation Pauses", &_total); print_summary(" Root Region Scan Wait", &_root_region_scan_wait); @@ -2578,9 +2417,9 @@ void TraceYoungGenTimeData::print() const { print_summary(" Clear CT", &_clear_ct); print_summary(" Other", &_other); } - gclog_or_tty->cr(); + tty->cr(); - gclog_or_tty->print_cr("MISC"); + tty->print_cr("MISC"); print_summary_sd(" Stop World", &_all_stop_world_times_ms); print_summary_sd(" Yields", &_all_yield_times_ms); } @@ -2597,11 +2436,11 @@ void TraceOldGenTimeData::print() const { } if (_all_full_gc_times.num() > 0) { - gclog_or_tty->print("\n%4d full_gcs: total time = %8.2f s", + tty->print("\n%4d full_gcs: total time = %8.2f s", _all_full_gc_times.num(), _all_full_gc_times.sum() / 1000.0); - gclog_or_tty->print_cr(" (avg = %8.2fms).", _all_full_gc_times.avg()); - gclog_or_tty->print_cr(" [std. dev = %8.2f ms, max = %8.2f ms]", + tty->print_cr(" (avg = %8.2fms).", _all_full_gc_times.avg()); + tty->print_cr(" [std. dev = %8.2f ms, max = %8.2f ms]", _all_full_gc_times.sd(), _all_full_gc_times.maximum()); } diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp index 264bab00c3d..7c7cf4d0a5e 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp @@ -159,6 +159,7 @@ public: uint max_desired_young_length() { return _max_desired_young_length; } + bool adaptive_young_list_length() const { return _adaptive_size; } @@ -658,9 +659,7 @@ public: // Print heap sizing transition (with less and more detail). - void print_heap_transition(size_t bytes_before) const; - void print_heap_transition() const; - void print_detailed_heap_transition(bool full = false) const; + void print_detailed_heap_transition() const; virtual void print_phases(double pause_time_sec); @@ -827,6 +826,8 @@ private: size_t _eden_used_bytes_before_gc; // Eden occupancy before GC size_t _survivor_used_bytes_before_gc; // Survivor occupancy before GC + size_t _old_used_bytes_before_gc; // Old occupancy before GC + size_t _humongous_used_bytes_before_gc; // Humongous occupancy before GC size_t _heap_used_bytes_before_gc; // Heap occupancy before GC size_t _metaspace_used_bytes_before_gc; // Metaspace occupancy before GC diff --git a/hotspot/src/share/vm/gc/g1/g1ErgoVerbose.cpp b/hotspot/src/share/vm/gc/g1/g1ErgoVerbose.cpp deleted file mode 100644 index 72a2217b0d5..00000000000 --- a/hotspot/src/share/vm/gc/g1/g1ErgoVerbose.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2011, 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. - * - */ - -#include "precompiled.hpp" -#include "gc/g1/g1ErgoVerbose.hpp" -#include "utilities/ostream.hpp" - -ErgoLevel G1ErgoVerbose::_level; -bool G1ErgoVerbose::_enabled[ErgoHeuristicNum]; - -void G1ErgoVerbose::initialize() { - set_level(ErgoLow); - set_enabled(false); -} - -void G1ErgoVerbose::set_level(ErgoLevel level) { - _level = level; -} - -void G1ErgoVerbose::set_enabled(ErgoHeuristic n, bool enabled) { - assert(0 <= n && n < ErgoHeuristicNum, "pre-condition"); - _enabled[n] = enabled; -} - -void G1ErgoVerbose::set_enabled(bool enabled) { - for (int n = 0; n < ErgoHeuristicNum; n += 1) { - set_enabled((ErgoHeuristic) n, enabled); - } -} - -const char* G1ErgoVerbose::to_string(int tag) { - ErgoHeuristic n = extract_heuristic(tag); - switch (n) { - case ErgoHeapSizing: return "Heap Sizing"; - case ErgoCSetConstruction: return "CSet Construction"; - case ErgoConcCycles: return "Concurrent Cycles"; - case ErgoMixedGCs: return "Mixed GCs"; - case ErgoTiming: return "Timing"; - case ErgoIHOP: return "IHOP"; - default: - ShouldNotReachHere(); - // Keep the Windows compiler happy - return NULL; - } -} diff --git a/hotspot/src/share/vm/gc/g1/g1ErgoVerbose.hpp b/hotspot/src/share/vm/gc/g1/g1ErgoVerbose.hpp deleted file mode 100644 index 8021f46beaf..00000000000 --- a/hotspot/src/share/vm/gc/g1/g1ErgoVerbose.hpp +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2011, 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. - * - */ - -#ifndef SHARE_VM_GC_G1_G1ERGOVERBOSE_HPP -#define SHARE_VM_GC_G1_G1ERGOVERBOSE_HPP - -#include "memory/allocation.hpp" -#include "utilities/debug.hpp" - -// The log of G1's heuristic decisions comprises of a series of -// records which have a similar format in order to maintain -// consistency across records and ultimately easier parsing of the -// output, if we ever choose to do that. Each record consists of: -// * A time stamp to be able to easily correlate each record with -// other events. -// * A unique string to allow us to easily identify such records. -// * The name of the heuristic the record corresponds to. -// * An action string which describes the action that G1 did or is -// about to do. -// * An optional reason string which describes the reason for the -// action. -// * An optional number of name/value pairs which contributed to the -// decision to take the action described in the record. -// -// Each record is associated with a "tag" which is the combination of -// the heuristic the record corresponds to, as well as the min level -// of verboseness at which the record should be printed. The tag is -// checked against the current settings to determine whether the record -// should be printed or not. - -// The available verboseness levels. -typedef enum { - // Determine which part of the tag is occupied by the level. - ErgoLevelShift = 8, - ErgoLevelMask = ~((1 << ErgoLevelShift) - 1), - - // ErgoLow is 0 so that we don't have to explicitly or a heuristic - // id with ErgoLow to keep its use simpler. - ErgoLow = 0, - ErgoHigh = 1 << ErgoLevelShift -} ErgoLevel; - -// The available heuristics. -typedef enum { - // Determines which part of the tag is occupied by the heuristic id. - ErgoHeuristicMask = ~ErgoLevelMask, - - ErgoHeapSizing = 0, - ErgoCSetConstruction, - ErgoConcCycles, - ErgoMixedGCs, - ErgoTiming, - ErgoIHOP, - - ErgoHeuristicNum -} ErgoHeuristic; - -class G1ErgoVerbose : AllStatic { -private: - // Determines the minimum verboseness level at which records will be - // printed. - static ErgoLevel _level; - // Determines which heuristics are currently enabled. - static bool _enabled[ErgoHeuristicNum]; - - static ErgoLevel extract_level(int tag) { - return (ErgoLevel) (tag & ErgoLevelMask); - } - - static ErgoHeuristic extract_heuristic(int tag) { - return (ErgoHeuristic) (tag & ErgoHeuristicMask); - } - -public: - // Needs to be explicitly called at GC initialization. - static void initialize(); - - static void set_level(ErgoLevel level); - static void set_enabled(ErgoHeuristic h, bool enabled); - // It is applied to all heuristics. - static void set_enabled(bool enabled); - - static bool enabled(int tag) { - ErgoLevel level = extract_level(tag); - ErgoHeuristic n = extract_heuristic(tag); - return level <= _level && _enabled[n]; - } - - // Extract the heuristic id from the tag and return a string with - // its name. - static const char* to_string(int tag); -}; - -// The macros below generate the format string for values of different -// types and/or metrics. - -// The reason for the action is optional and is handled specially: the -// reason string is concatenated here so it's not necessary to pass it -// as a parameter. -#define ergo_format_reason(_reason_) ", reason: " _reason_ - -// Single parameter format strings -#define ergo_format_str(_name_) ", " _name_ ": %s" -#define ergo_format_region(_name_) ", " _name_ ": %u regions" -#define ergo_format_byte(_name_) ", " _name_ ": " SIZE_FORMAT " bytes" -#define ergo_format_double(_name_) ", " _name_ ": %1.2f" -#define ergo_format_perc(_name_) ", " _name_ ": %1.2f %%" -#define ergo_format_ms(_name_) ", " _name_ ": %1.2f ms" -#define ergo_format_size(_name_) ", " _name_ ": " SIZE_FORMAT - -// Double parameter format strings -#define ergo_format_byte_perc(_name_) \ - ", " _name_ ": " SIZE_FORMAT " bytes (%1.2f %%)" - -// Generates the format string -#define ergo_format(_extra_format_) \ - " %1.3f: [G1Ergonomics (%s) %s" _extra_format_ "]" - -// Conditionally, prints an ergonomic decision record. _extra_format_ -// is the format string for the optional items we'd like to print -// (i.e., the decision's reason and any associated values). This -// string should be built up using the ergo_*_format macros (see -// above) to ensure consistency. -// -// Since we cannot rely on the compiler supporting variable argument -// macros, this macro accepts a fixed number of arguments and passes -// them to the print method. For convenience, we have wrapper macros -// below which take a specific number of arguments and set the rest to -// a default value. -#define ergo_verbose_common(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_, _arg4_, _arg5_) \ - do { \ - if (G1ErgoVerbose::enabled((_tag_))) { \ - gclog_or_tty->print_cr(ergo_format(_extra_format_), \ - os::elapsedTime(), \ - G1ErgoVerbose::to_string((_tag_)), \ - (_action_), \ - (_arg0_), (_arg1_), (_arg2_), \ - (_arg3_), (_arg4_), (_arg5_)); \ - } \ - } while (0) - - -#define ergo_verbose6(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_, _arg4_, _arg5_) \ - ergo_verbose_common(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_, _arg4_, _arg5_) - -#define ergo_verbose5(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_, _arg4_) \ - ergo_verbose6(_tag_, _action_, _extra_format_ "%s", \ - _arg0_, _arg1_, _arg2_, _arg3_, _arg4_, "") - -#define ergo_verbose4(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_) \ - ergo_verbose5(_tag_, _action_, _extra_format_ "%s", \ - _arg0_, _arg1_, _arg2_, _arg3_, "") - -#define ergo_verbose3(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_) \ - ergo_verbose4(_tag_, _action_, _extra_format_ "%s", \ - _arg0_, _arg1_, _arg2_, "") - -#define ergo_verbose2(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_) \ - ergo_verbose3(_tag_, _action_, _extra_format_ "%s", \ - _arg0_, _arg1_, "") - -#define ergo_verbose1(_tag_, _action_, _extra_format_, \ - _arg0_) \ - ergo_verbose2(_tag_, _action_, _extra_format_ "%s", \ - _arg0_, "") - - -#define ergo_verbose0(_tag_, _action_, _extra_format_) \ - ergo_verbose1(_tag_, _action_, _extra_format_ "%s", \ - "") - -#define ergo_verbose(_tag_, _action_) \ - ergo_verbose0(_tag_, _action_, "") - - -#endif // SHARE_VM_GC_G1_G1ERGOVERBOSE_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp b/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp index 8a2317c59bd..a000a1e40ce 100644 --- a/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp +++ b/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp @@ -26,91 +26,97 @@ #include "memory/allocation.inline.hpp" #include "gc/g1/g1EvacStats.hpp" #include "gc/shared/gcId.hpp" +#include "logging/log.hpp" #include "trace/tracing.hpp" void G1EvacStats::adjust_desired_plab_sz() { - if (PrintPLAB) { - gclog_or_tty->print(" (allocated = " SIZE_FORMAT " wasted = " SIZE_FORMAT " " + if (!ResizePLAB) { + log_debug(gc, plab)(" (allocated = " SIZE_FORMAT " wasted = " SIZE_FORMAT " " "unused = " SIZE_FORMAT " used = " SIZE_FORMAT " " "undo_waste = " SIZE_FORMAT " region_end_waste = " SIZE_FORMAT " " "regions filled = %u direct_allocated = " SIZE_FORMAT " " "failure_used = " SIZE_FORMAT " failure_waste = " SIZE_FORMAT ") ", _allocated, _wasted, _unused, used(), _undo_wasted, _region_end_waste, _regions_filled, _direct_allocated, _failure_used, _failure_waste); + // Clear accumulators for next round. + reset(); + return; } - if (ResizePLAB) { + assert(is_object_aligned(max_size()) && min_size() <= max_size(), + "PLAB clipping computation may be incorrect"); - assert(is_object_aligned(max_size()) && min_size() <= max_size(), - "PLAB clipping computation may be incorrect"); - - if (_allocated == 0) { - assert((_unused == 0), - "Inconsistency in PLAB stats: " - "_allocated: " SIZE_FORMAT ", " - "_wasted: " SIZE_FORMAT ", " - "_region_end_waste: " SIZE_FORMAT ", " - "_unused: " SIZE_FORMAT ", " - "_used : " SIZE_FORMAT, - _allocated, _wasted, _region_end_waste, _unused, used()); - _allocated = 1; - } - // The size of the PLAB caps the amount of space that can be wasted at the - // end of the collection. In the worst case the last PLAB could be completely - // empty. - // This allows us to calculate the new PLAB size to achieve the - // TargetPLABWastePct given the latest memory usage and that the last buffer - // will be G1LastPLABAverageOccupancy full. - // - // E.g. assume that if in the current GC 100 words were allocated and a - // TargetPLABWastePct of 10 had been set. - // - // So we could waste up to 10 words to meet that percentage. Given that we - // also assume that that buffer is typically half-full, the new desired PLAB - // size is set to 20 words. - // - // The amount of allocation performed should be independent of the number of - // threads, so should the maximum waste we can spend in total. So if - // we used n threads to allocate, each of them can spend maximum waste/n words in - // a first rough approximation. The number of threads only comes into play later - // when actually retrieving the actual desired PLAB size. - // - // After calculating this optimal PLAB size the algorithm applies the usual - // exponential decaying average over this value to guess the next PLAB size. - // - // We account region end waste fully to PLAB allocation (in the calculation of - // what we consider as "used_for_waste_calculation" below). This is not - // completely fair, but is a conservative assumption because PLABs may be sized - // flexibly while we cannot adjust inline allocations. - // Allocation during GC will try to minimize region end waste so this impact - // should be minimal. - // - // We need to cover overflow when calculating the amount of space actually used - // by objects in PLABs when subtracting the region end waste. - // Region end waste may be higher than actual allocation. This may occur if many - // threads do not allocate anything but a few rather large objects. In this - // degenerate case the PLAB size would simply quickly tend to minimum PLAB size, - // which is an okay reaction. - size_t const used_for_waste_calculation = used() > _region_end_waste ? used() - _region_end_waste : 0; - - size_t const total_waste_allowed = used_for_waste_calculation * TargetPLABWastePct; - size_t const cur_plab_sz = (size_t)((double)total_waste_allowed / G1LastPLABAverageOccupancy); - // Take historical weighted average - _filter.sample(cur_plab_sz); - // Clip from above and below, and align to object boundary - size_t plab_sz; - plab_sz = MAX2(min_size(), (size_t)_filter.average()); - plab_sz = MIN2(max_size(), plab_sz); - plab_sz = align_object_size(plab_sz); - // Latch the result - _desired_net_plab_sz = plab_sz; - if (PrintPLAB) { - gclog_or_tty->print(" (plab_sz = " SIZE_FORMAT " desired_plab_sz = " SIZE_FORMAT ") ", cur_plab_sz, plab_sz); - } - } - if (PrintPLAB) { - gclog_or_tty->cr(); + if (_allocated == 0) { + assert((_unused == 0), + "Inconsistency in PLAB stats: " + "_allocated: " SIZE_FORMAT ", " + "_wasted: " SIZE_FORMAT ", " + "_region_end_waste: " SIZE_FORMAT ", " + "_unused: " SIZE_FORMAT ", " + "_used : " SIZE_FORMAT, + _allocated, _wasted, _region_end_waste, _unused, used()); + _allocated = 1; } + // The size of the PLAB caps the amount of space that can be wasted at the + // end of the collection. In the worst case the last PLAB could be completely + // empty. + // This allows us to calculate the new PLAB size to achieve the + // TargetPLABWastePct given the latest memory usage and that the last buffer + // will be G1LastPLABAverageOccupancy full. + // + // E.g. assume that if in the current GC 100 words were allocated and a + // TargetPLABWastePct of 10 had been set. + // + // So we could waste up to 10 words to meet that percentage. Given that we + // also assume that that buffer is typically half-full, the new desired PLAB + // size is set to 20 words. + // + // The amount of allocation performed should be independent of the number of + // threads, so should the maximum waste we can spend in total. So if + // we used n threads to allocate, each of them can spend maximum waste/n words in + // a first rough approximation. The number of threads only comes into play later + // when actually retrieving the actual desired PLAB size. + // + // After calculating this optimal PLAB size the algorithm applies the usual + // exponential decaying average over this value to guess the next PLAB size. + // + // We account region end waste fully to PLAB allocation (in the calculation of + // what we consider as "used_for_waste_calculation" below). This is not + // completely fair, but is a conservative assumption because PLABs may be sized + // flexibly while we cannot adjust inline allocations. + // Allocation during GC will try to minimize region end waste so this impact + // should be minimal. + // + // We need to cover overflow when calculating the amount of space actually used + // by objects in PLABs when subtracting the region end waste. + // Region end waste may be higher than actual allocation. This may occur if many + // threads do not allocate anything but a few rather large objects. In this + // degenerate case the PLAB size would simply quickly tend to minimum PLAB size, + // which is an okay reaction. + size_t const used_for_waste_calculation = used() > _region_end_waste ? used() - _region_end_waste : 0; + + size_t const total_waste_allowed = used_for_waste_calculation * TargetPLABWastePct; + size_t const cur_plab_sz = (size_t)((double)total_waste_allowed / G1LastPLABAverageOccupancy); + // Take historical weighted average + _filter.sample(cur_plab_sz); + // Clip from above and below, and align to object boundary + size_t plab_sz; + plab_sz = MAX2(min_size(), (size_t)_filter.average()); + plab_sz = MIN2(max_size(), plab_sz); + plab_sz = align_object_size(plab_sz); + // Latch the result + _desired_net_plab_sz = plab_sz; + + log_debug(gc, plab)(" (allocated = " SIZE_FORMAT " wasted = " SIZE_FORMAT " " + "unused = " SIZE_FORMAT " used = " SIZE_FORMAT " " + "undo_waste = " SIZE_FORMAT " region_end_waste = " SIZE_FORMAT " " + "regions filled = %u direct_allocated = " SIZE_FORMAT " " + "failure_used = " SIZE_FORMAT " failure_waste = " SIZE_FORMAT ") " + " (plab_sz = " SIZE_FORMAT " desired_plab_sz = " SIZE_FORMAT ")", + _allocated, _wasted, _unused, used(), _undo_wasted, _region_end_waste, + _regions_filled, _direct_allocated, _failure_used, _failure_waste, + cur_plab_sz, plab_sz); + // Clear accumulators for next round. reset(); } diff --git a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp index 836ca8f09b8..84e749c2ab9 100644 --- a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp +++ b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp @@ -26,10 +26,10 @@ #include "gc/g1/concurrentG1Refine.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1GCPhaseTimes.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/g1StringDedup.hpp" #include "gc/g1/workerDataArray.inline.hpp" #include "memory/allocation.hpp" +#include "logging/log.hpp" #include "runtime/os.hpp" // Helper class for avoiding interleaved logging @@ -73,66 +73,60 @@ public: va_end(ap); } - void print_cr() { - gclog_or_tty->print_cr("%s", _buffer); + const char* to_string() { _cur = _indent_level * INDENT_CHARS; - } - - void append_and_print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) { - va_list ap; - va_start(ap, format); - vappend(format, ap); - va_end(ap); - print_cr(); + return _buffer; } }; +static const char* Indents[4] = {"", " ", " ", " "}; + G1GCPhaseTimes::G1GCPhaseTimes(uint max_gc_threads) : _max_gc_threads(max_gc_threads) { assert(max_gc_threads > 0, "Must have some GC threads"); - _gc_par_phases[GCWorkerStart] = new WorkerDataArray(max_gc_threads, "GC Worker Start (ms)", false, G1Log::LevelFiner, 2); - _gc_par_phases[ExtRootScan] = new WorkerDataArray(max_gc_threads, "Ext Root Scanning (ms)", true, G1Log::LevelFiner, 2); + _gc_par_phases[GCWorkerStart] = new WorkerDataArray(max_gc_threads, "GC Worker Start:", false, 2); + _gc_par_phases[ExtRootScan] = new WorkerDataArray(max_gc_threads, "Ext Root Scanning:", true, 2); // Root scanning phases - _gc_par_phases[ThreadRoots] = new WorkerDataArray(max_gc_threads, "Thread Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[StringTableRoots] = new WorkerDataArray(max_gc_threads, "StringTable Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[UniverseRoots] = new WorkerDataArray(max_gc_threads, "Universe Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[JNIRoots] = new WorkerDataArray(max_gc_threads, "JNI Handles Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray(max_gc_threads, "ObjectSynchronizer Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[FlatProfilerRoots] = new WorkerDataArray(max_gc_threads, "FlatProfiler Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[ManagementRoots] = new WorkerDataArray(max_gc_threads, "Management Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray(max_gc_threads, "SystemDictionary Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[CLDGRoots] = new WorkerDataArray(max_gc_threads, "CLDG Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[JVMTIRoots] = new WorkerDataArray(max_gc_threads, "JVMTI Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[CMRefRoots] = new WorkerDataArray(max_gc_threads, "CM RefProcessor Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[WaitForStrongCLD] = new WorkerDataArray(max_gc_threads, "Wait For Strong CLD (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[WeakCLDRoots] = new WorkerDataArray(max_gc_threads, "Weak CLD Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[SATBFiltering] = new WorkerDataArray(max_gc_threads, "SATB Filtering (ms)", true, G1Log::LevelFinest, 3); + _gc_par_phases[ThreadRoots] = new WorkerDataArray(max_gc_threads, "Thread Roots:", true, 3); + _gc_par_phases[StringTableRoots] = new WorkerDataArray(max_gc_threads, "StringTable Roots:", true, 3); + _gc_par_phases[UniverseRoots] = new WorkerDataArray(max_gc_threads, "Universe Roots:", true, 3); + _gc_par_phases[JNIRoots] = new WorkerDataArray(max_gc_threads, "JNI Handles Roots:", true, 3); + _gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray(max_gc_threads, "ObjectSynchronizer Roots:", true, 3); + _gc_par_phases[FlatProfilerRoots] = new WorkerDataArray(max_gc_threads, "FlatProfiler Roots:", true, 3); + _gc_par_phases[ManagementRoots] = new WorkerDataArray(max_gc_threads, "Management Roots:", true, 3); + _gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray(max_gc_threads, "SystemDictionary Roots:", true, 3); + _gc_par_phases[CLDGRoots] = new WorkerDataArray(max_gc_threads, "CLDG Roots:", true, 3); + _gc_par_phases[JVMTIRoots] = new WorkerDataArray(max_gc_threads, "JVMTI Roots:", true, 3); + _gc_par_phases[CMRefRoots] = new WorkerDataArray(max_gc_threads, "CM RefProcessor Roots:", true, 3); + _gc_par_phases[WaitForStrongCLD] = new WorkerDataArray(max_gc_threads, "Wait For Strong CLD:", true, 3); + _gc_par_phases[WeakCLDRoots] = new WorkerDataArray(max_gc_threads, "Weak CLD Roots:", true, 3); + _gc_par_phases[SATBFiltering] = new WorkerDataArray(max_gc_threads, "SATB Filtering:", true, 3); - _gc_par_phases[UpdateRS] = new WorkerDataArray(max_gc_threads, "Update RS (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[ScanHCC] = new WorkerDataArray(max_gc_threads, "Scan HCC (ms)", true, G1Log::LevelFiner, 3); + _gc_par_phases[UpdateRS] = new WorkerDataArray(max_gc_threads, "Update RS:", true, 2); + _gc_par_phases[ScanHCC] = new WorkerDataArray(max_gc_threads, "Scan HCC:", true, 3); _gc_par_phases[ScanHCC]->set_enabled(ConcurrentG1Refine::hot_card_cache_enabled()); - _gc_par_phases[ScanRS] = new WorkerDataArray(max_gc_threads, "Scan RS (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[CodeRoots] = new WorkerDataArray(max_gc_threads, "Code Root Scanning (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[ObjCopy] = new WorkerDataArray(max_gc_threads, "Object Copy (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[Termination] = new WorkerDataArray(max_gc_threads, "Termination (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[GCWorkerTotal] = new WorkerDataArray(max_gc_threads, "GC Worker Total (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[GCWorkerEnd] = new WorkerDataArray(max_gc_threads, "GC Worker End (ms)", false, G1Log::LevelFiner, 2); - _gc_par_phases[Other] = new WorkerDataArray(max_gc_threads, "GC Worker Other (ms)", true, G1Log::LevelFiner, 2); + _gc_par_phases[ScanRS] = new WorkerDataArray(max_gc_threads, "Scan RS:", true, 2); + _gc_par_phases[CodeRoots] = new WorkerDataArray(max_gc_threads, "Code Root Scanning:", true, 2); + _gc_par_phases[ObjCopy] = new WorkerDataArray(max_gc_threads, "Object Copy:", true, 2); + _gc_par_phases[Termination] = new WorkerDataArray(max_gc_threads, "Termination:", true, 2); + _gc_par_phases[GCWorkerTotal] = new WorkerDataArray(max_gc_threads, "GC Worker Total:", true, 2); + _gc_par_phases[GCWorkerEnd] = new WorkerDataArray(max_gc_threads, "GC Worker End:", false, 2); + _gc_par_phases[Other] = new WorkerDataArray(max_gc_threads, "GC Worker Other:", true, 2); - _update_rs_processed_buffers = new WorkerDataArray(max_gc_threads, "Processed Buffers", true, G1Log::LevelFiner, 3); + _update_rs_processed_buffers = new WorkerDataArray(max_gc_threads, "Processed Buffers:", true, 3); _gc_par_phases[UpdateRS]->link_thread_work_items(_update_rs_processed_buffers); - _termination_attempts = new WorkerDataArray(max_gc_threads, "Termination Attempts", true, G1Log::LevelFinest, 3); + _termination_attempts = new WorkerDataArray(max_gc_threads, "Termination Attempts:", true, 3); _gc_par_phases[Termination]->link_thread_work_items(_termination_attempts); - _gc_par_phases[StringDedupQueueFixup] = new WorkerDataArray(max_gc_threads, "Queue Fixup (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[StringDedupTableFixup] = new WorkerDataArray(max_gc_threads, "Table Fixup (ms)", true, G1Log::LevelFiner, 2); + _gc_par_phases[StringDedupQueueFixup] = new WorkerDataArray(max_gc_threads, "Queue Fixup:", true, 2); + _gc_par_phases[StringDedupTableFixup] = new WorkerDataArray(max_gc_threads, "Table Fixup:", true, 2); - _gc_par_phases[RedirtyCards] = new WorkerDataArray(max_gc_threads, "Parallel Redirty", true, G1Log::LevelFinest, 3); - _redirtied_cards = new WorkerDataArray(max_gc_threads, "Redirtied Cards", true, G1Log::LevelFinest, 3); + _gc_par_phases[RedirtyCards] = new WorkerDataArray(max_gc_threads, "Parallel Redirty", true, 3); + _redirtied_cards = new WorkerDataArray(max_gc_threads, "Redirtied Cards:", true, 3); _gc_par_phases[RedirtyCards]->link_thread_work_items(_redirtied_cards); } @@ -173,16 +167,8 @@ void G1GCPhaseTimes::note_gc_end() { } } -void G1GCPhaseTimes::print_stats(int level, const char* str, double value) { - LineBuffer(level).append_and_print_cr("[%s: %.1lf ms]", str, value); -} - -void G1GCPhaseTimes::print_stats(int level, const char* str, size_t value) { - LineBuffer(level).append_and_print_cr("[%s: " SIZE_FORMAT "]", str, value); -} - -void G1GCPhaseTimes::print_stats(int level, const char* str, double value, uint workers) { - LineBuffer(level).append_and_print_cr("[%s: %.1lf ms, GC Workers: %u]", str, value, workers); +void G1GCPhaseTimes::print_stats(const char* indent, const char* str, double value) { + log_debug(gc, phases)("%s%s: %.1lf ms", indent, str, value); } double G1GCPhaseTimes::accounted_time_ms() { @@ -284,10 +270,6 @@ class G1GCParPhasePrinter : public StackObj { void print(G1GCPhaseTimes::GCParPhases phase_id) { WorkerDataArray* phase = _phase_times->_gc_par_phases[phase_id]; - if (phase->_log_level > G1Log::level() || !phase->_enabled) { - return; - } - if (phase->_length == 1) { print_single_length(phase_id, phase); } else { @@ -295,69 +277,71 @@ class G1GCParPhasePrinter : public StackObj { } } - private: + private: void print_single_length(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray* phase) { // No need for min, max, average and sum for only one worker - LineBuffer buf(phase->_indent_level); - buf.append_and_print_cr("[%s: %.1lf]", phase->_title, _phase_times->get_time_ms(phase_id, 0)); + log_debug(gc, phases)("%s%s: %.1lf", Indents[phase->_indent_level], phase->_title, _phase_times->get_time_ms(phase_id, 0)); - if (phase->_thread_work_items != NULL) { - LineBuffer buf2(phase->_thread_work_items->_indent_level); - buf2.append_and_print_cr("[%s: " SIZE_FORMAT "]", phase->_thread_work_items->_title, _phase_times->sum_thread_work_items(phase_id)); + WorkerDataArray* work_items = phase->_thread_work_items; + if (work_items != NULL) { + log_debug(gc, phases)("%s%s: " SIZE_FORMAT, Indents[work_items->_indent_level], work_items->_title, _phase_times->sum_thread_work_items(phase_id)); } } - void print_time_values(LineBuffer& buf, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray* phase) { - uint active_length = _phase_times->_active_gc_threads; - for (uint i = 0; i < active_length; ++i) { - buf.append(" %.1lf", _phase_times->get_time_ms(phase_id, i)); + void print_time_values(const char* indent, G1GCPhaseTimes::GCParPhases phase_id) { + if (log_is_enabled(Trace, gc)) { + LineBuffer buf(0); + uint active_length = _phase_times->_active_gc_threads; + for (uint i = 0; i < active_length; ++i) { + buf.append(" %4.1lf", _phase_times->get_time_ms(phase_id, i)); + } + const char* line = buf.to_string(); + log_trace(gc, phases)("%s%-25s%s", indent, "", line); } - buf.print_cr(); } - void print_count_values(LineBuffer& buf, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray* thread_work_items) { - uint active_length = _phase_times->_active_gc_threads; - for (uint i = 0; i < active_length; ++i) { - buf.append(" " SIZE_FORMAT, _phase_times->get_thread_work_item(phase_id, i)); + void print_count_values(const char* indent, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray* thread_work_items) { + if (log_is_enabled(Trace, gc)) { + LineBuffer buf(0); + uint active_length = _phase_times->_active_gc_threads; + for (uint i = 0; i < active_length; ++i) { + buf.append(" " SIZE_FORMAT, _phase_times->get_thread_work_item(phase_id, i)); + } + const char* line = buf.to_string(); + log_trace(gc, phases)("%s%-25s%s", indent, "", line); } - buf.print_cr(); } void print_thread_work_items(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray* thread_work_items) { - LineBuffer buf(thread_work_items->_indent_level); - buf.append("[%s:", thread_work_items->_title); - - if (G1Log::finest()) { - print_count_values(buf, phase_id, thread_work_items); - } + const char* indent = Indents[thread_work_items->_indent_level]; assert(thread_work_items->_print_sum, "%s does not have print sum true even though it is a count", thread_work_items->_title); - buf.append_and_print_cr(" Min: " SIZE_FORMAT ", Avg: %.1lf, Max: " SIZE_FORMAT ", Diff: " SIZE_FORMAT ", Sum: " SIZE_FORMAT "]", + log_debug(gc, phases)("%s%-25s Min: " SIZE_FORMAT ", Avg: %4.1lf, Max: " SIZE_FORMAT ", Diff: " SIZE_FORMAT ", Sum: " SIZE_FORMAT, + indent, thread_work_items->_title, _phase_times->min_thread_work_items(phase_id), _phase_times->average_thread_work_items(phase_id), _phase_times->max_thread_work_items(phase_id), _phase_times->max_thread_work_items(phase_id) - _phase_times->min_thread_work_items(phase_id), _phase_times->sum_thread_work_items(phase_id)); + + print_count_values(indent, phase_id, thread_work_items); } void print_multi_length(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray* phase) { - LineBuffer buf(phase->_indent_level); - buf.append("[%s:", phase->_title); - - if (G1Log::finest()) { - print_time_values(buf, phase_id, phase); - } - - buf.append(" Min: %.1lf, Avg: %.1lf, Max: %.1lf, Diff: %.1lf", - _phase_times->min_time_ms(phase_id), _phase_times->average_time_ms(phase_id), _phase_times->max_time_ms(phase_id), - _phase_times->max_time_ms(phase_id) - _phase_times->min_time_ms(phase_id)); + const char* indent = Indents[phase->_indent_level]; if (phase->_print_sum) { - // for things like the start and end times the sum is not - // that relevant - buf.append(", Sum: %.1lf", _phase_times->sum_time_ms(phase_id)); + log_debug(gc, phases)("%s%-25s Min: %4.1lf, Avg: %4.1lf, Max: %4.1lf, Diff: %4.1lf, Sum: %4.1lf", + indent, phase->_title, + _phase_times->min_time_ms(phase_id), _phase_times->average_time_ms(phase_id), _phase_times->max_time_ms(phase_id), + _phase_times->max_time_ms(phase_id) - _phase_times->min_time_ms(phase_id), _phase_times->sum_time_ms(phase_id)); + } else { + log_debug(gc, phases)("%s%-25s Min: %4.1lf, Avg: %4.1lf, Max: %4.1lf, Diff: %4.1lf", + indent, phase->_title, + _phase_times->min_time_ms(phase_id), _phase_times->average_time_ms(phase_id), _phase_times->max_time_ms(phase_id), + _phase_times->max_time_ms(phase_id) - _phase_times->min_time_ms(phase_id)); } - buf.append_and_print_cr("]"); + print_time_values(indent, phase_id); if (phase->_thread_work_items != NULL) { print_thread_work_items(phase_id, phase->_thread_work_items); @@ -371,67 +355,59 @@ void G1GCPhaseTimes::print(double pause_time_sec) { G1GCParPhasePrinter par_phase_printer(this); if (_root_region_scan_wait_time_ms > 0.0) { - print_stats(1, "Root Region Scan Waiting", _root_region_scan_wait_time_ms); + print_stats(Indents[1], "Root Region Scan Waiting", _root_region_scan_wait_time_ms); } - print_stats(1, "Parallel Time", _cur_collection_par_time_ms, _active_gc_threads); + print_stats(Indents[1], "Parallel Time", _cur_collection_par_time_ms); for (int i = 0; i <= GCMainParPhasesLast; i++) { par_phase_printer.print((GCParPhases) i); } - print_stats(1, "Code Root Fixup", _cur_collection_code_root_fixup_time_ms); - print_stats(1, "Code Root Purge", _cur_strong_code_root_purge_time_ms); + print_stats(Indents[1], "Code Root Fixup", _cur_collection_code_root_fixup_time_ms); + print_stats(Indents[1], "Code Root Purge", _cur_strong_code_root_purge_time_ms); if (G1StringDedup::is_enabled()) { - print_stats(1, "String Dedup Fixup", _cur_string_dedup_fixup_time_ms, _active_gc_threads); + print_stats(Indents[1], "String Dedup Fixup", _cur_string_dedup_fixup_time_ms); for (int i = StringDedupPhasesFirst; i <= StringDedupPhasesLast; i++) { par_phase_printer.print((GCParPhases) i); } } - print_stats(1, "Clear CT", _cur_clear_ct_time_ms); - print_stats(1, "Expand Heap After Collection", _cur_expand_heap_time_ms); - + print_stats(Indents[1], "Clear CT", _cur_clear_ct_time_ms); + print_stats(Indents[1], "Expand Heap After Collection", _cur_expand_heap_time_ms); double misc_time_ms = pause_time_sec * MILLIUNITS - accounted_time_ms(); - print_stats(1, "Other", misc_time_ms); + print_stats(Indents[1], "Other", misc_time_ms); if (_cur_verify_before_time_ms > 0.0) { - print_stats(2, "Verify Before", _cur_verify_before_time_ms); + print_stats(Indents[2], "Verify Before", _cur_verify_before_time_ms); } if (G1CollectedHeap::heap()->evacuation_failed()) { double evac_fail_handling = _cur_evac_fail_recalc_used + _cur_evac_fail_remove_self_forwards + _cur_evac_fail_restore_remsets; - print_stats(2, "Evacuation Failure", evac_fail_handling); - if (G1Log::finest()) { - print_stats(3, "Recalculate Used", _cur_evac_fail_recalc_used); - print_stats(3, "Remove Self Forwards", _cur_evac_fail_remove_self_forwards); - print_stats(3, "Restore RemSet", _cur_evac_fail_restore_remsets); - } + print_stats(Indents[2], "Evacuation Failure", evac_fail_handling); + log_trace(gc, phases)("%sRecalculate Used: %.1lf ms", Indents[3], _cur_evac_fail_recalc_used); + log_trace(gc, phases)("%sRemove Self Forwards: %.1lf ms", Indents[3], _cur_evac_fail_remove_self_forwards); + log_trace(gc, phases)("%sRestore RemSet: %.1lf ms", Indents[3], _cur_evac_fail_restore_remsets); } - print_stats(2, "Choose CSet", + print_stats(Indents[2], "Choose CSet", (_recorded_young_cset_choice_time_ms + _recorded_non_young_cset_choice_time_ms)); - print_stats(2, "Ref Proc", _cur_ref_proc_time_ms); - print_stats(2, "Ref Enq", _cur_ref_enq_time_ms); - print_stats(2, "Redirty Cards", _recorded_redirty_logged_cards_time_ms); + print_stats(Indents[2], "Ref Proc", _cur_ref_proc_time_ms); + print_stats(Indents[2], "Ref Enq", _cur_ref_enq_time_ms); + print_stats(Indents[2], "Redirty Cards", _recorded_redirty_logged_cards_time_ms); par_phase_printer.print(RedirtyCards); if (G1EagerReclaimHumongousObjects) { - print_stats(2, "Humongous Register", _cur_fast_reclaim_humongous_register_time_ms); - if (G1Log::finest()) { - print_stats(3, "Humongous Total", _cur_fast_reclaim_humongous_total); - print_stats(3, "Humongous Candidate", _cur_fast_reclaim_humongous_candidates); - } - print_stats(2, "Humongous Reclaim", _cur_fast_reclaim_humongous_time_ms); - if (G1Log::finest()) { - print_stats(3, "Humongous Reclaimed", _cur_fast_reclaim_humongous_reclaimed); - } + print_stats(Indents[2], "Humongous Register", _cur_fast_reclaim_humongous_register_time_ms); + + log_trace(gc, phases)("%sHumongous Total: " SIZE_FORMAT, Indents[3], _cur_fast_reclaim_humongous_total); + log_trace(gc, phases)("%sHumongous Candidate: " SIZE_FORMAT, Indents[3], _cur_fast_reclaim_humongous_candidates); + print_stats(Indents[2], "Humongous Reclaim", _cur_fast_reclaim_humongous_time_ms); + log_trace(gc, phases)("%sHumongous Reclaimed: " SIZE_FORMAT, Indents[3], _cur_fast_reclaim_humongous_reclaimed); } - print_stats(2, "Free CSet", + print_stats(Indents[2], "Free CSet", (_recorded_young_free_cset_time_ms + _recorded_non_young_free_cset_time_ms)); - if (G1Log::finest()) { - print_stats(3, "Young Free CSet", _recorded_young_free_cset_time_ms); - print_stats(3, "Non-Young Free CSet", _recorded_non_young_free_cset_time_ms); - } + log_trace(gc, phases)("%sYoung Free CSet: %.1lf ms", Indents[3], _recorded_young_free_cset_time_ms); + log_trace(gc, phases)("%sNon-Young Free CSet: %.1lf ms", Indents[3], _recorded_non_young_free_cset_time_ms); if (_cur_verify_after_time_ms > 0.0) { - print_stats(2, "Verify After", _cur_verify_after_time_ms); + print_stats(Indents[2], "Verify After", _cur_verify_after_time_ms); } } diff --git a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp index 3c84ed89ac8..9803fef0c5b 100644 --- a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp +++ b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp @@ -119,9 +119,7 @@ class G1GCPhaseTimes : public CHeapObj { double _cur_verify_after_time_ms; // Helper methods for detailed logging - void print_stats(int level, const char* str, double value); - void print_stats(int level, const char* str, size_t value); - void print_stats(int level, const char* str, double value, uint workers); + void print_stats(const char*, const char* str, double value); void note_gc_end(); diff --git a/hotspot/src/share/vm/gc/g1/g1HRPrinter.cpp b/hotspot/src/share/vm/gc/g1/g1HRPrinter.cpp index 3e71725274d..36c060ced6f 100644 --- a/hotspot/src/share/vm/gc/g1/g1HRPrinter.cpp +++ b/hotspot/src/share/vm/gc/g1/g1HRPrinter.cpp @@ -60,18 +60,6 @@ const char* G1HRPrinter::region_type_name(RegionType type) { return NULL; } -const char* G1HRPrinter::phase_name(PhaseType phase) { - switch (phase) { - case StartGC: return "StartGC"; - case EndGC: return "EndGC"; - case StartFullGC: return "StartFullGC"; - case EndFullGC: return "EndFullGC"; - default: ShouldNotReachHere(); - } - // trying to keep the Windows compiler happy - return NULL; -} - #define G1HR_PREFIX " G1HR" void G1HRPrinter::print(ActionType action, RegionType type, @@ -82,19 +70,19 @@ void G1HRPrinter::print(ActionType action, RegionType type, if (type_str != NULL) { if (top != NULL) { - gclog_or_tty->print_cr(G1HR_PREFIX " %s(%s) " PTR_FORMAT " " PTR_FORMAT, - action_str, type_str, p2i(bottom), p2i(top)); + log_trace(gc, region)(G1HR_PREFIX " %s(%s) " PTR_FORMAT " " PTR_FORMAT, + action_str, type_str, p2i(bottom), p2i(top)); } else { - gclog_or_tty->print_cr(G1HR_PREFIX " %s(%s) " PTR_FORMAT, - action_str, type_str, p2i(bottom)); + log_trace(gc, region)(G1HR_PREFIX " %s(%s) " PTR_FORMAT, + action_str, type_str, p2i(bottom)); } } else { if (top != NULL) { - gclog_or_tty->print_cr(G1HR_PREFIX " %s " PTR_FORMAT " " PTR_FORMAT, - action_str, p2i(bottom), p2i(top)); + log_trace(gc, region)(G1HR_PREFIX " %s " PTR_FORMAT " " PTR_FORMAT, + action_str, p2i(bottom), p2i(top)); } else { - gclog_or_tty->print_cr(G1HR_PREFIX " %s " PTR_FORMAT, - action_str, p2i(bottom)); + log_trace(gc, region)(G1HR_PREFIX " %s " PTR_FORMAT, + action_str, p2i(bottom)); } } } @@ -102,11 +90,6 @@ void G1HRPrinter::print(ActionType action, RegionType type, void G1HRPrinter::print(ActionType action, HeapWord* bottom, HeapWord* end) { const char* action_str = action_name(action); - gclog_or_tty->print_cr(G1HR_PREFIX " %s [" PTR_FORMAT "," PTR_FORMAT "]", - action_str, p2i(bottom), p2i(end)); -} - -void G1HRPrinter::print(PhaseType phase, size_t phase_num) { - const char* phase_str = phase_name(phase); - gclog_or_tty->print_cr(G1HR_PREFIX " #%s " SIZE_FORMAT, phase_str, phase_num); + log_trace(gc, region)(G1HR_PREFIX " %s [" PTR_FORMAT "," PTR_FORMAT "]", + action_str, p2i(bottom), p2i(end)); } diff --git a/hotspot/src/share/vm/gc/g1/g1HRPrinter.hpp b/hotspot/src/share/vm/gc/g1/g1HRPrinter.hpp index 6bd1dc49f48..064c4956269 100644 --- a/hotspot/src/share/vm/gc/g1/g1HRPrinter.hpp +++ b/hotspot/src/share/vm/gc/g1/g1HRPrinter.hpp @@ -26,6 +26,7 @@ #define SHARE_VM_GC_G1_G1HRPRINTER_HPP #include "gc/g1/heapRegion.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #define SKIP_RETIRED_FULL_REGIONS 1 @@ -55,19 +56,9 @@ public: Archive } RegionType; - typedef enum { - StartGC, - EndGC, - StartFullGC, - EndFullGC - } PhaseType; - private: - bool _active; - static const char* action_name(ActionType action); static const char* region_type_name(RegionType type); - static const char* phase_name(PhaseType phase); // Print an action event. This version is used in most scenarios and // only prints the region's bottom. The parameters type and top are @@ -79,18 +70,11 @@ private: // bottom and end. Used for Commit / Uncommit events. static void print(ActionType action, HeapWord* bottom, HeapWord* end); - // Print a phase event. - static void print(PhaseType phase, size_t phase_num); - public: // In some places we iterate over a list in order to generate output // for the list's elements. By exposing this we can avoid this // iteration if the printer is not active. - const bool is_active() { return _active; } - - // Have to set this explicitly as we have to do this during the - // heap's initialize() method, not in the constructor. - void set_active(bool active) { _active = active; } + const bool is_active() { return log_is_enabled(Trace, gc, region); } // The methods below are convenient wrappers for the print() methods. @@ -155,28 +139,6 @@ public: print(Uncommit, bottom, end); } } - - void start_gc(bool full, size_t gc_num) { - if (is_active()) { - if (!full) { - print(StartGC, gc_num); - } else { - print(StartFullGC, gc_num); - } - } - } - - void end_gc(bool full, size_t gc_num) { - if (is_active()) { - if (!full) { - print(EndGC, gc_num); - } else { - print(EndFullGC, gc_num); - } - } - } - - G1HRPrinter() : _active(false) { } }; #endif // SHARE_VM_GC_G1_G1HRPRINTER_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp b/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp index 077f7b7ecf5..705d3af6fd7 100644 --- a/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp +++ b/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp @@ -24,10 +24,10 @@ #include "precompiled.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" -#include "gc/g1/g1ErgoVerbose.hpp" #include "gc/g1/g1IHOPControl.hpp" #include "gc/g1/g1Predictions.hpp" #include "gc/shared/gcTrace.hpp" +#include "logging/log.hpp" G1IHOPControl::G1IHOPControl(double initial_ihop_percent, size_t target_occupancy) : _initial_ihop_percent(initial_ihop_percent), @@ -47,20 +47,14 @@ void G1IHOPControl::update_allocation_info(double allocation_time_s, size_t allo void G1IHOPControl::print() { size_t cur_conc_mark_start_threshold = get_conc_mark_start_threshold(); - ergo_verbose6(ErgoIHOP, - "basic information", - ergo_format_reason("value update") - ergo_format_byte_perc("threshold") - ergo_format_byte("target occupancy") - ergo_format_byte("current occupancy") - ergo_format_double("recent old gen allocation rate") - ergo_format_double("recent marking phase length"), - cur_conc_mark_start_threshold, - cur_conc_mark_start_threshold * 100.0 / _target_occupancy, - _target_occupancy, - G1CollectedHeap::heap()->used(), - _last_allocation_time_s > 0.0 ? _last_allocated_bytes / _last_allocation_time_s : 0.0, - last_marking_length_s()); + log_debug(gc, ihop)("Basic information (value update), threshold: " SIZE_FORMAT "B (%1.2f), target occupancy: " SIZE_FORMAT "B, current occupancy: " SIZE_FORMAT "B," + " recent old gen allocation rate: %1.2f, recent marking phase length: %1.2f", + cur_conc_mark_start_threshold, + cur_conc_mark_start_threshold * 100.0 / _target_occupancy, + _target_occupancy, + G1CollectedHeap::heap()->used(), + _last_allocation_time_s > 0.0 ? _last_allocated_bytes / _last_allocation_time_s : 0.0, + last_marking_length_s()); } void G1IHOPControl::send_trace_event(G1NewTracer* tracer) { @@ -192,21 +186,14 @@ void G1AdaptiveIHOPControl::update_marking_length(double marking_length_s) { void G1AdaptiveIHOPControl::print() { G1IHOPControl::print(); size_t actual_target = actual_target_threshold(); - ergo_verbose6(ErgoIHOP, - "adaptive IHOP information", - ergo_format_reason("value update") - ergo_format_byte_perc("threshold") - ergo_format_byte("internal target occupancy") - ergo_format_double("predicted old gen allocation rate") - ergo_format_double("predicted marking phase length") - ergo_format_str("prediction active"), - get_conc_mark_start_threshold(), - percent_of(get_conc_mark_start_threshold(), actual_target), - actual_target, - _predictor->get_new_prediction(&_allocation_rate_s), - _predictor->get_new_prediction(&_marking_times_s), - have_enough_data_for_prediction() ? "true" : "false" - ); + log_debug(gc, ihop)("Adaptive IHOP information (value update), threshold: " SIZE_FORMAT "B (%1.2f), internal target occupancy: " SIZE_FORMAT "B," + " predicted old gen allocation rate: %1.2f, predicted marking phase length: %1.2f, prediction active: %s", + get_conc_mark_start_threshold(), + percent_of(get_conc_mark_start_threshold(), actual_target), + actual_target, + _predictor->get_new_prediction(&_allocation_rate_s), + _predictor->get_new_prediction(&_marking_times_s), + have_enough_data_for_prediction() ? "true" : "false"); } void G1AdaptiveIHOPControl::send_trace_event(G1NewTracer* tracer) { diff --git a/hotspot/src/share/vm/gc/g1/g1Log.cpp b/hotspot/src/share/vm/gc/g1/g1Log.cpp deleted file mode 100644 index 40c1da28812..00000000000 --- a/hotspot/src/share/vm/gc/g1/g1Log.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 - * 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. - * - */ - -#include "precompiled.hpp" -#include "gc/g1/g1Log.hpp" -#include "gc/g1/g1_globals.hpp" -#include "runtime/globals_extension.hpp" - -G1Log::LogLevel G1Log::_level = G1Log::LevelNone; - - -// Updates _level based on PrintGC and PrintGCDetails values (unless -// G1LogLevel is set explicitly) -// - PrintGC maps to "fine". -// - PrintGCDetails maps to "finer". -void G1Log::update_level() { - if (FLAG_IS_DEFAULT(G1LogLevel)) { - _level = LevelNone; - if (PrintGCDetails) { - _level = LevelFiner; - } else if (PrintGC) { - _level = LevelFine; - } - } -} - - -// If G1LogLevel has not been set up we will use the values of PrintGC -// and PrintGCDetails for the logging level. -void G1Log::init() { - if (!FLAG_IS_DEFAULT(G1LogLevel)) { - // PrintGC flags change won't have any affect, because G1LogLevel - // is set explicitly - if (G1LogLevel[0] == '\0' || strncmp("none", G1LogLevel, 4) == 0 && G1LogLevel[4] == '\0') { - _level = LevelNone; - } else if (strncmp("fine", G1LogLevel, 4) == 0 && G1LogLevel[4] == '\0') { - _level = LevelFine; - } else if (strncmp("finer", G1LogLevel, 5) == 0 && G1LogLevel[5] == '\0') { - _level = LevelFiner; - } else if (strncmp("finest", G1LogLevel, 6) == 0 && G1LogLevel[6] == '\0') { - _level = LevelFinest; - } else { - warning("Unknown logging level '%s', should be one of 'fine', 'finer' or 'finest'.", G1LogLevel); - } - } else { - update_level(); - } -} - diff --git a/hotspot/src/share/vm/gc/g1/g1Log.hpp b/hotspot/src/share/vm/gc/g1/g1Log.hpp deleted file mode 100644 index 7a313e360cd..00000000000 --- a/hotspot/src/share/vm/gc/g1/g1Log.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 - * 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. - * - */ - -#ifndef SHARE_VM_GC_G1_G1LOG_HPP -#define SHARE_VM_GC_G1_G1LOG_HPP - -#include "memory/allocation.hpp" - -class G1Log : public AllStatic { - public: - typedef enum { - LevelNone, - LevelFine, - LevelFiner, - LevelFinest - } LogLevel; - - private: - static LogLevel _level; - - public: - inline static bool fine() { - return _level >= LevelFine; - } - - inline static bool finer() { - return _level >= LevelFiner; - } - - inline static bool finest() { - return _level == LevelFinest; - } - - static LogLevel level() { - return _level; - } - - static void init(); - - // Update to log level to reflect runtime changes to manageable flags - static void update_level(); -}; - -#endif // SHARE_VM_GC_G1_G1LOG_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp index ca5aa98b62e..d1feefe2de5 100644 --- a/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp +++ b/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp @@ -29,7 +29,6 @@ #include "classfile/vmSymbols.hpp" #include "code/codeCache.hpp" #include "code/icBuffer.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/g1MarkSweep.hpp" #include "gc/g1/g1RootProcessor.hpp" #include "gc/g1/g1StringDedup.hpp" @@ -38,7 +37,7 @@ #include "gc/shared/gcLocker.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/modRefBarrierSet.hpp" #include "gc/shared/referencePolicy.hpp" @@ -123,7 +122,7 @@ void G1MarkSweep::allocate_stacks() { void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading, bool clear_all_softrefs) { // Recursively traverse all live objects and mark them - GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer()); + GCTraceTime(Trace, gc) tm("Phase 1: Mark live objects", gc_timer()); G1CollectedHeap* g1h = G1CollectedHeap::heap(); @@ -183,13 +182,8 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading, // fail. At the end of the GC, the original mark word values // (including hash values) are restored to the appropriate // objects. - if (!VerifySilently) { - gclog_or_tty->print(" VerifyDuringGC:(full)[Verifying "); - } - g1h->verify(VerifySilently, VerifyOption_G1UseMarkWord); - if (!VerifySilently) { - gclog_or_tty->print_cr("]"); - } + GCTraceTime(Info, gc, verify)("During GC (full)"); + g1h->verify(VerifyOption_G1UseMarkWord); } gc_tracer()->report_object_count_after_gc(&GenMarkSweep::is_alive); @@ -203,7 +197,7 @@ void G1MarkSweep::mark_sweep_phase2() { // phase2, phase3 and phase4, but the ValidateMarkSweep live oops // tracking expects us to do so. See comment under phase4. - GCTraceTime tm("phase 2", G1Log::fine() && Verbose, true, gc_timer()); + GCTraceTime(Trace, gc) tm("Phase 2: Compute new object addresses", gc_timer()); prepare_compaction(); } @@ -236,7 +230,7 @@ void G1MarkSweep::mark_sweep_phase3() { G1CollectedHeap* g1h = G1CollectedHeap::heap(); // Adjust the pointers to reflect the new locations - GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer()); + GCTraceTime(Trace, gc) tm("Phase 3: Adjust pointers", gc_timer()); // Need cleared claim bits for the roots processing ClassLoaderDataGraph::clear_claimed_marks(); @@ -297,7 +291,7 @@ void G1MarkSweep::mark_sweep_phase4() { // to use a higher index (saved from phase2) when verifying perm_gen. G1CollectedHeap* g1h = G1CollectedHeap::heap(); - GCTraceTime tm("phase 4", G1Log::fine() && Verbose, true, gc_timer()); + GCTraceTime(Trace, gc) tm("Phase 4: Move objects", gc_timer()); G1SpaceCompactClosure blk; g1h->heap_region_iterate(&blk); diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp index ea395791423..0b812183c84 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp @@ -52,7 +52,7 @@ G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs) for (uint i = 0; i < n_workers(); i++) { _cset_rs_update_cl[i] = NULL; } - if (G1SummarizeRSetStats) { + if (log_is_enabled(Trace, gc, remset)) { _prev_period_summary.initialize(this); } // Initialize the card queue set used to hold cards containing @@ -109,17 +109,6 @@ void ScanRSClosure::scanCard(size_t index, HeapRegion *r) { } } -void ScanRSClosure::printCard(HeapRegion* card_region, size_t card_index, - HeapWord* card_start) { - gclog_or_tty->print_cr("T %u Region [" PTR_FORMAT ", " PTR_FORMAT ") " - "RS names card " SIZE_FORMAT_HEX ": " - "[" PTR_FORMAT ", " PTR_FORMAT ")", - _worker_i, - p2i(card_region->bottom()), p2i(card_region->end()), - card_index, - p2i(card_start), p2i(card_start + G1BlockOffsetSharedArray::N_words)); -} - void ScanRSClosure::scan_strong_code_roots(HeapRegion* r) { double scan_start = os::elapsedTime(); r->strong_code_roots_do(_code_root_cl); @@ -152,10 +141,6 @@ bool ScanRSClosure::doHeapRegion(HeapRegion* r) { } if (current_card < jump_to_card) continue; HeapWord* card_start = _g1h->bot_shared()->address_for_index(card_index); -#if 0 - gclog_or_tty->print("Rem set iteration yielded card [" PTR_FORMAT ", " PTR_FORMAT ").\n", - card_start, card_start + CardTableModRefBS::card_size_in_words); -#endif HeapRegion* card_region = _g1h->heap_region_containing(card_start); _cards++; @@ -526,31 +511,36 @@ bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i, return has_refs_into_cset; } -void G1RemSet::print_periodic_summary_info(const char* header) { - G1RemSetSummary current; - current.initialize(this); +void G1RemSet::print_periodic_summary_info(const char* header, uint period_count) { + if ((G1SummarizeRSetStatsPeriod > 0) && log_is_enabled(Trace, gc, remset) && + (period_count % G1SummarizeRSetStatsPeriod == 0)) { - _prev_period_summary.subtract_from(¤t); - print_summary_info(&_prev_period_summary, header); + if (!_prev_period_summary.initialized()) { + _prev_period_summary.initialize(this); + } - _prev_period_summary.set(¤t); + G1RemSetSummary current; + current.initialize(this); + _prev_period_summary.subtract_from(¤t); + + LogHandle(gc, remset) log; + log.trace("%s", header); + ResourceMark rm; + _prev_period_summary.print_on(log.trace_stream()); + + _prev_period_summary.set(¤t); + } } void G1RemSet::print_summary_info() { - G1RemSetSummary current; - current.initialize(this); - - print_summary_info(¤t, " Cumulative RS summary"); -} - -void G1RemSet::print_summary_info(G1RemSetSummary * summary, const char * header) { - assert(summary != NULL, "just checking"); - - if (header != NULL) { - gclog_or_tty->print_cr("%s", header); + LogHandle(gc, remset, exit) log; + if (log.is_trace()) { + log.trace(" Cumulative RS summary"); + G1RemSetSummary current; + current.initialize(this); + ResourceMark rm; + current.print_on(log.trace_stream()); } - - summary->print_on(gclog_or_tty); } void G1RemSet::prepare_for_verify() { diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp index 72a259ef417..1fe97fb7a81 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp @@ -33,6 +33,7 @@ class G1CollectedHeap; class ConcurrentG1Refine; class G1ParPushHeapRSClosure; +class outputStream; // A G1RemSet in which each heap region has a rem set that records the // external heap references into it. Uses a mod ref bs to track updates, @@ -63,8 +64,6 @@ protected: // references into the collection set. G1ParPushHeapRSClosure** _cset_rs_update_cl; - // Print the given summary info - virtual void print_summary_info(G1RemSetSummary * summary, const char * header = NULL); public: // This is called to reset dual hash tables after the gc pause // is finished and the initial hash table is no longer being @@ -135,7 +134,7 @@ public: virtual void print_summary_info(); // Print accumulated summary info from the last time called. - virtual void print_periodic_summary_info(const char* header); + virtual void print_periodic_summary_info(const char* header, uint period_count); // Prepare remembered set for verification. virtual void prepare_for_verify(); diff --git a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp index 2a9c9332770..2d4e6d9d670 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp @@ -271,7 +271,7 @@ public: void print_summary_on(outputStream* out) { RegionTypeCounter* counters[] = { &_young, &_humonguous, &_free, &_old, NULL }; - out->print_cr("\n Current rem set statistics"); + out->print_cr(" Current rem set statistics"); out->print_cr(" Total per region rem sets sizes = " SIZE_FORMAT "K." " Max = " SIZE_FORMAT "K.", round_to_K(total_rs_mem_sz()), round_to_K(max_rs_mem_sz())); @@ -323,7 +323,7 @@ public: }; void G1RemSetSummary::print_on(outputStream* out) { - out->print_cr("\n Recent concurrent refinement statistics"); + out->print_cr(" Recent concurrent refinement statistics"); out->print_cr(" Processed " SIZE_FORMAT " cards", num_concurrent_refined_cards()); out->print_cr(" Of " SIZE_FORMAT " completed buffers:", num_processed_buf_total()); diff --git a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp index b18fedd98ee..19faacd2ceb 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp @@ -85,6 +85,7 @@ public: // initialize and get the first sampling void initialize(G1RemSet* remset); + bool const initialized() { return _rs_threads_vtimes != NULL; } void print_on(outputStream* out); diff --git a/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp b/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp index 1f872134941..5cd8b594e8e 100644 --- a/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp @@ -28,6 +28,7 @@ #include "gc/g1/heapRegion.hpp" #include "gc/g1/satbMarkQueue.hpp" #include "gc/shared/memset_with_concurrent_readers.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/mutexLocker.hpp" @@ -147,17 +148,10 @@ void G1SATBCardTableLoggingModRefBS::initialize(G1RegionToSpaceMapper* mapper) { assert(byte_for(low_bound) == &_byte_map[0], "Checking start of map"); assert(byte_for(high_bound-1) <= &_byte_map[_last_valid_index], "Checking end of map"); - if (TraceCardTableModRefBS) { - gclog_or_tty->print_cr("G1SATBCardTableModRefBS::G1SATBCardTableModRefBS: "); - gclog_or_tty->print_cr(" " - " &_byte_map[0]: " INTPTR_FORMAT - " &_byte_map[_last_valid_index]: " INTPTR_FORMAT, - p2i(&_byte_map[0]), - p2i(&_byte_map[_last_valid_index])); - gclog_or_tty->print_cr(" " - " byte_map_base: " INTPTR_FORMAT, - p2i(byte_map_base)); - } + log_trace(gc, barrier)("G1SATBCardTableModRefBS::G1SATBCardTableModRefBS: "); + log_trace(gc, barrier)(" &_byte_map[0]: " INTPTR_FORMAT " &_byte_map[_last_valid_index]: " INTPTR_FORMAT, + p2i(&_byte_map[0]), p2i(&_byte_map[_last_valid_index])); + log_trace(gc, barrier)(" byte_map_base: " INTPTR_FORMAT, p2i(byte_map_base)); } void diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp index b2f66630ac6..95b5bccff10 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp @@ -28,6 +28,7 @@ #include "gc/g1/g1StringDedup.hpp" #include "gc/g1/g1StringDedupQueue.hpp" #include "gc/shared/gcLocker.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/mutexLocker.hpp" @@ -152,10 +153,9 @@ void G1StringDedupQueue::unlink_or_oops_do(G1StringDedupUnlinkOrOopsDoClosure* c } } -void G1StringDedupQueue::print_statistics(outputStream* st) { - st->print_cr( - " [Queue]\n" - " [Dropped: " UINTX_FORMAT "]", _queue->_dropped); +void G1StringDedupQueue::print_statistics() { + log_debug(gc, stringdedup)(" [Queue]"); + log_debug(gc, stringdedup)(" [Dropped: " UINTX_FORMAT "]", _queue->_dropped); } void G1StringDedupQueue::verify() { diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.hpp b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.hpp index 3c9bbd1360f..6bc37c2679c 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.hpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.hpp @@ -94,7 +94,7 @@ public: static void unlink_or_oops_do(G1StringDedupUnlinkOrOopsDoClosure* cl); - static void print_statistics(outputStream* st); + static void print_statistics(); static void verify(); }; diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupStat.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupStat.cpp index 7e2a3da5436..a90515e8693 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupStat.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupStat.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "gc/g1/g1StringDedupStat.hpp" +#include "logging/log.hpp" G1StringDedupStat::G1StringDedupStat() : _inspected(0), @@ -68,7 +69,7 @@ void G1StringDedupStat::add(const G1StringDedupStat& stat) { _block_elapsed += stat._block_elapsed; } -void G1StringDedupStat::print_summary(outputStream* st, const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat) { +void G1StringDedupStat::print_summary(const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat) { double total_deduped_bytes_percent = 0.0; if (total_stat._new_bytes > 0) { @@ -76,10 +77,8 @@ void G1StringDedupStat::print_summary(outputStream* st, const G1StringDedupStat& total_deduped_bytes_percent = (double)total_stat._deduped_bytes / (double)total_stat._new_bytes * 100.0; } - st->date_stamp(PrintGCDateStamps); - st->stamp(PrintGCTimeStamps); - st->print_cr( - "[GC concurrent-string-deduplication, " + log_info(gc, stringdedup)( + "Concurrent String Deduplication " G1_STRDEDUP_BYTES_FORMAT_NS "->" G1_STRDEDUP_BYTES_FORMAT_NS "(" G1_STRDEDUP_BYTES_FORMAT_NS "), avg " G1_STRDEDUP_PERCENT_FORMAT_NS ", " G1_STRDEDUP_TIME_FORMAT "]", G1_STRDEDUP_BYTES_PARAM(last_stat._new_bytes), @@ -89,7 +88,7 @@ void G1StringDedupStat::print_summary(outputStream* st, const G1StringDedupStat& last_stat._exec_elapsed); } -void G1StringDedupStat::print_statistics(outputStream* st, const G1StringDedupStat& stat, bool total) { +void G1StringDedupStat::print_statistics(const G1StringDedupStat& stat, bool total) { double young_percent = 0.0; double old_percent = 0.0; double skipped_percent = 0.0; @@ -134,29 +133,24 @@ void G1StringDedupStat::print_statistics(outputStream* st, const G1StringDedupSt } if (total) { - st->print_cr( + log_debug(gc, stringdedup)( " [Total Exec: " UINTX_FORMAT "/" G1_STRDEDUP_TIME_FORMAT ", Idle: " UINTX_FORMAT "/" G1_STRDEDUP_TIME_FORMAT ", Blocked: " UINTX_FORMAT "/" G1_STRDEDUP_TIME_FORMAT "]", stat._exec, stat._exec_elapsed, stat._idle, stat._idle_elapsed, stat._block, stat._block_elapsed); } else { - st->print_cr( + log_debug(gc, stringdedup)( " [Last Exec: " G1_STRDEDUP_TIME_FORMAT ", Idle: " G1_STRDEDUP_TIME_FORMAT ", Blocked: " UINTX_FORMAT "/" G1_STRDEDUP_TIME_FORMAT "]", stat._exec_elapsed, stat._idle_elapsed, stat._block, stat._block_elapsed); } - st->print_cr( - " [Inspected: " G1_STRDEDUP_OBJECTS_FORMAT "]\n" - " [Skipped: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]\n" - " [Hashed: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]\n" - " [Known: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]\n" - " [New: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "]\n" - " [Deduplicated: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]\n" - " [Young: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]\n" - " [Old: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", - stat._inspected, - stat._skipped, skipped_percent, - stat._hashed, hashed_percent, - stat._known, known_percent, - stat._new, new_percent, G1_STRDEDUP_BYTES_PARAM(stat._new_bytes), - stat._deduped, deduped_percent, G1_STRDEDUP_BYTES_PARAM(stat._deduped_bytes), deduped_bytes_percent, - stat._deduped_young, deduped_young_percent, G1_STRDEDUP_BYTES_PARAM(stat._deduped_young_bytes), deduped_young_bytes_percent, - stat._deduped_old, deduped_old_percent, G1_STRDEDUP_BYTES_PARAM(stat._deduped_old_bytes), deduped_old_bytes_percent); + log_debug(gc, stringdedup)(" [Inspected: " G1_STRDEDUP_OBJECTS_FORMAT "]", stat._inspected); + log_debug(gc, stringdedup)(" [Skipped: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", stat._skipped, skipped_percent); + log_debug(gc, stringdedup)(" [Hashed: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", stat._hashed, hashed_percent); + log_debug(gc, stringdedup)(" [Known: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", stat._known, known_percent); + log_debug(gc, stringdedup)(" [New: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "]", + stat._new, new_percent, G1_STRDEDUP_BYTES_PARAM(stat._new_bytes)); + log_debug(gc, stringdedup)(" [Deduplicated: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", + stat._deduped, deduped_percent, G1_STRDEDUP_BYTES_PARAM(stat._deduped_bytes), deduped_bytes_percent); + log_debug(gc, stringdedup)(" [Young: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", + stat._deduped_young, deduped_young_percent, G1_STRDEDUP_BYTES_PARAM(stat._deduped_young_bytes), deduped_young_bytes_percent); + log_debug(gc, stringdedup)(" [Old: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", + stat._deduped_old, deduped_old_percent, G1_STRDEDUP_BYTES_PARAM(stat._deduped_old_bytes), deduped_old_bytes_percent); } diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupStat.hpp b/hotspot/src/share/vm/gc/g1/g1StringDedupStat.hpp index 1e0367c013b..ff0dbb51ad7 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupStat.hpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupStat.hpp @@ -135,8 +135,8 @@ public: void add(const G1StringDedupStat& stat); - static void print_summary(outputStream* st, const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat); - static void print_statistics(outputStream* st, const G1StringDedupStat& stat, bool total); + static void print_summary(const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat); + static void print_statistics(const G1StringDedupStat& stat, bool total); }; #endif // SHARE_VM_GC_G1_G1STRINGDEDUPSTAT_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp index 276cbabeca7..16519b4a3e5 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp @@ -30,6 +30,7 @@ #include "gc/g1/g1StringDedup.hpp" #include "gc/g1/g1StringDedupTable.hpp" #include "gc/shared/gcLocker.hpp" +#include "logging/log.hpp" #include "memory/padded.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/typeArrayOop.hpp" @@ -568,19 +569,16 @@ void G1StringDedupTable::trim_entry_cache() { _entry_cache->trim(max_cache_size); } -void G1StringDedupTable::print_statistics(outputStream* st) { - st->print_cr( - " [Table]\n" - " [Memory Usage: " G1_STRDEDUP_BYTES_FORMAT_NS "]\n" - " [Size: " SIZE_FORMAT ", Min: " SIZE_FORMAT ", Max: " SIZE_FORMAT "]\n" - " [Entries: " UINTX_FORMAT ", Load: " G1_STRDEDUP_PERCENT_FORMAT_NS ", Cached: " UINTX_FORMAT ", Added: " UINTX_FORMAT ", Removed: " UINTX_FORMAT "]\n" - " [Resize Count: " UINTX_FORMAT ", Shrink Threshold: " UINTX_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT_NS "), Grow Threshold: " UINTX_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT_NS ")]\n" - " [Rehash Count: " UINTX_FORMAT ", Rehash Threshold: " UINTX_FORMAT ", Hash Seed: 0x%x]\n" - " [Age Threshold: " UINTX_FORMAT "]", - G1_STRDEDUP_BYTES_PARAM(_table->_size * sizeof(G1StringDedupEntry*) + (_table->_entries + _entry_cache->size()) * sizeof(G1StringDedupEntry)), - _table->_size, _min_size, _max_size, - _table->_entries, (double)_table->_entries / (double)_table->_size * 100.0, _entry_cache->size(), _entries_added, _entries_removed, - _resize_count, _table->_shrink_threshold, _shrink_load_factor * 100.0, _table->_grow_threshold, _grow_load_factor * 100.0, - _rehash_count, _rehash_threshold, _table->_hash_seed, - StringDeduplicationAgeThreshold); +void G1StringDedupTable::print_statistics() { + LogHandle(gc, stringdedup) log; + log.debug(" [Table]"); + log.debug(" [Memory Usage: " G1_STRDEDUP_BYTES_FORMAT_NS "]", + G1_STRDEDUP_BYTES_PARAM(_table->_size * sizeof(G1StringDedupEntry*) + (_table->_entries + _entry_cache->size()) * sizeof(G1StringDedupEntry))); + log.debug(" [Size: " SIZE_FORMAT ", Min: " SIZE_FORMAT ", Max: " SIZE_FORMAT "]", _table->_size, _min_size, _max_size); + log.debug(" [Entries: " UINTX_FORMAT ", Load: " G1_STRDEDUP_PERCENT_FORMAT_NS ", Cached: " UINTX_FORMAT ", Added: " UINTX_FORMAT ", Removed: " UINTX_FORMAT "]", + _table->_entries, (double)_table->_entries / (double)_table->_size * 100.0, _entry_cache->size(), _entries_added, _entries_removed); + log.debug(" [Resize Count: " UINTX_FORMAT ", Shrink Threshold: " UINTX_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT_NS "), Grow Threshold: " UINTX_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT_NS ")]", + _resize_count, _table->_shrink_threshold, _shrink_load_factor * 100.0, _table->_grow_threshold, _grow_load_factor * 100.0); + log.debug(" [Rehash Count: " UINTX_FORMAT ", Rehash Threshold: " UINTX_FORMAT ", Hash Seed: 0x%x]", _rehash_count, _rehash_threshold, _table->_hash_seed); + log.debug(" [Age Threshold: " UINTX_FORMAT "]", StringDeduplicationAgeThreshold); } diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupTable.hpp b/hotspot/src/share/vm/gc/g1/g1StringDedupTable.hpp index 1aff126f813..4375f4dafb3 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupTable.hpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupTable.hpp @@ -234,7 +234,7 @@ public: static void unlink_or_oops_do(G1StringDedupUnlinkOrOopsDoClosure* cl, uint worker_id); - static void print_statistics(outputStream* st); + static void print_statistics(); static void verify(); }; diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupThread.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupThread.cpp index d6c2a30ee6b..bd4d9b89648 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupThread.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupThread.cpp @@ -24,12 +24,12 @@ #include "precompiled.hpp" #include "classfile/stringTable.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/g1StringDedup.hpp" #include "gc/g1/g1StringDedupQueue.hpp" #include "gc/g1/g1StringDedupTable.hpp" #include "gc/g1/g1StringDedupThread.hpp" #include "gc/g1/suspendibleThreadSet.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" @@ -129,7 +129,7 @@ void G1StringDedupThread::run() { // Print statistics total_stat.add(stat); - print(gclog_or_tty, stat, total_stat); + print(stat, total_stat); } } @@ -152,14 +152,14 @@ void G1StringDedupThread::stop() { } } -void G1StringDedupThread::print(outputStream* st, const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat) { - if (G1Log::fine() || PrintStringDeduplicationStatistics) { - G1StringDedupStat::print_summary(st, last_stat, total_stat); - if (PrintStringDeduplicationStatistics) { - G1StringDedupStat::print_statistics(st, last_stat, false); - G1StringDedupStat::print_statistics(st, total_stat, true); - G1StringDedupTable::print_statistics(st); - G1StringDedupQueue::print_statistics(st); +void G1StringDedupThread::print(const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat) { + if (log_is_enabled(Info, gc, stringdedup)) { + G1StringDedupStat::print_summary(last_stat, total_stat); + if (log_is_enabled(Debug, gc, stringdedup)) { + G1StringDedupStat::print_statistics(last_stat, false); + G1StringDedupStat::print_statistics(total_stat, true); + G1StringDedupTable::print_statistics(); + G1StringDedupQueue::print_statistics(); } } } diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupThread.hpp b/hotspot/src/share/vm/gc/g1/g1StringDedupThread.hpp index 2e87b737c80..6c8a275f666 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupThread.hpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupThread.hpp @@ -43,7 +43,7 @@ private: G1StringDedupThread(); ~G1StringDedupThread(); - void print(outputStream* st, const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat); + void print(const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat); public: static void create(); diff --git a/hotspot/src/share/vm/gc/g1/g1_globals.hpp b/hotspot/src/share/vm/gc/g1/g1_globals.hpp index 5d2d9da0a23..086e27bd589 100644 --- a/hotspot/src/share/vm/gc/g1/g1_globals.hpp +++ b/hotspot/src/share/vm/gc/g1/g1_globals.hpp @@ -53,32 +53,14 @@ "Overhead of concurrent marking") \ range(0, 100) \ \ - develop(intx, G1MarkingVerboseLevel, 0, \ - "Level (0-4) of verboseness of the marking code") \ - range(0, 4) \ - \ - develop(bool, G1TraceMarkStackOverflow, false, \ - "If true, extra debugging code for CM restart for ovflw.") \ - \ - diagnostic(bool, G1SummarizeConcMark, false, \ - "Summarize concurrent mark info") \ - \ - diagnostic(bool, G1SummarizeRSetStats, false, \ - "Summarize remembered set processing info") \ - \ diagnostic(intx, G1SummarizeRSetStatsPeriod, 0, \ "The period (in number of GCs) at which we will generate " \ "update buffer processing info " \ "(0 means do not periodically generate this info); " \ - "it also requires -XX:+G1SummarizeRSetStats") \ + "it also requires that logging is enabled on the trace" \ + "level for gc+remset") \ range(0, max_intx) \ \ - diagnostic(bool, G1TraceConcRefinement, false, \ - "Trace G1 concurrent refinement") \ - \ - experimental(bool, G1TraceStringSymbolTableScrubbing, false, \ - "Trace information string and symbol table scrubbing.") \ - \ product(double, G1ConcMarkStepDurationMillis, 10.0, \ "Target duration of individual concurrent marking steps " \ "in milliseconds.") \ @@ -121,10 +103,6 @@ develop(bool, G1RSBarrierRegionFilter, true, \ "If true, generate region filtering code in RS barrier") \ \ - diagnostic(bool, G1PrintRegionLivenessInfo, false, \ - "Prints the liveness information for all regions in the heap " \ - "at the end of a marking cycle.") \ - \ product(size_t, G1UpdateBufferSize, 256, \ "Size of an update buffer") \ range(1, NOT_LP64(32*M) LP64_ONLY(1*G)) \ @@ -205,12 +183,6 @@ develop(bool, G1ScrubRemSets, true, \ "When true, do RS scrubbing after cleanup.") \ \ - develop(bool, G1RSScrubVerbose, false, \ - "When true, do RS scrubbing with verbose output.") \ - \ - develop(bool, G1YoungSurvRateVerbose, false, \ - "print out the survival rate of young regions according to age.") \ - \ develop(intx, G1YoungSurvRateNumRegionsSummary, 0, \ "the number of regions for which we'll print a surv rate " \ "summary.") \ @@ -222,10 +194,6 @@ "to minimize the probability of promotion failure.") \ range(0, 50) \ \ - diagnostic(bool, G1PrintHeapRegions, false, \ - "If set G1 will print information on which regions are being " \ - "allocated and which are reclaimed.") \ - \ develop(bool, G1HRRSUseSparseTable, true, \ "When true, use sparse table to save space.") \ \ @@ -254,9 +222,6 @@ "The number of regions we will add to the secondary free list " \ "at every append operation") \ \ - develop(bool, G1ConcRegionFreeingVerbose, false, \ - "Enables verboseness during concurrent region freeing") \ - \ develop(bool, G1StressConcRegionFreeing, false, \ "It stresses the concurrent region freeing operation") \ \ @@ -310,18 +275,11 @@ "Try to reclaim dead large objects that have a few stale " \ "references at every young GC.") \ \ - experimental(bool, G1TraceEagerReclaimHumongousObjects, false, \ - "Print some information about large object liveness " \ - "at every young GC.") \ - \ experimental(uintx, G1OldCSetRegionThresholdPercent, 10, \ "An upper bound for the number of old CSet regions expressed " \ "as a percentage of the heap size.") \ range(0, 100) \ \ - experimental(ccstr, G1LogLevel, NULL, \ - "Log level for G1 logging: fine, finer, finest") \ - \ notproduct(bool, G1EvacuationFailureALot, false, \ "Force use of evacuation failure handling during certain " \ "evacuation pauses") \ diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.cpp b/hotspot/src/share/vm/gc/g1/heapRegion.cpp index f212b9ddeec..a393f22be9e 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp @@ -34,6 +34,7 @@ #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/liveRange.hpp" #include "gc/shared/space.inline.hpp" +#include "logging/log.hpp" #include "memory/iterator.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" @@ -479,10 +480,8 @@ class VerifyStrongCodeRootOopClosure: public OopClosure { // Object is in the region. Check that its less than top if (_hr->top() <= (HeapWord*)obj) { // Object is above top - gclog_or_tty->print_cr("Object " PTR_FORMAT " in region " - "[" PTR_FORMAT ", " PTR_FORMAT ") is above " - "top " PTR_FORMAT, - p2i(obj), p2i(_hr->bottom()), p2i(_hr->end()), p2i(_hr->top())); + log_info(gc, verify)("Object " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ") is above top " PTR_FORMAT, + p2i(obj), p2i(_hr->bottom()), p2i(_hr->end()), p2i(_hr->top())); _failures = true; return; } @@ -515,23 +514,19 @@ public: if (nm != NULL) { // Verify that the nemthod is live if (!nm->is_alive()) { - gclog_or_tty->print_cr("region [" PTR_FORMAT "," PTR_FORMAT "] has dead nmethod " - PTR_FORMAT " in its strong code roots", - p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm)); + log_info(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has dead nmethod " PTR_FORMAT " in its strong code roots", + p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm)); _failures = true; } else { VerifyStrongCodeRootOopClosure oop_cl(_hr, nm); nm->oops_do(&oop_cl); if (!oop_cl.has_oops_in_region()) { - gclog_or_tty->print_cr("region [" PTR_FORMAT "," PTR_FORMAT "] has nmethod " - PTR_FORMAT " in its strong code roots " - "with no pointers into region", - p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm)); + log_info(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has nmethod " PTR_FORMAT " in its strong code roots with no pointers into region", + p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm)); _failures = true; } else if (oop_cl.failures()) { - gclog_or_tty->print_cr("region [" PTR_FORMAT "," PTR_FORMAT "] has other " - "failures for nmethod " PTR_FORMAT, - p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm)); + log_info(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has other failures for nmethod " PTR_FORMAT, + p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm)); _failures = true; } } @@ -564,9 +559,8 @@ void HeapRegion::verify_strong_code_roots(VerifyOption vo, bool* failures) const // on its strong code root list if (is_empty()) { if (strong_code_roots_length > 0) { - gclog_or_tty->print_cr("region [" PTR_FORMAT "," PTR_FORMAT "] is empty " - "but has " SIZE_FORMAT " code root entries", - p2i(bottom()), p2i(end()), strong_code_roots_length); + log_info(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] is empty but has " SIZE_FORMAT " code root entries", + p2i(bottom()), p2i(end()), strong_code_roots_length); *failures = true; } return; @@ -574,9 +568,8 @@ void HeapRegion::verify_strong_code_roots(VerifyOption vo, bool* failures) const if (is_continues_humongous()) { if (strong_code_roots_length > 0) { - gclog_or_tty->print_cr("region " HR_FORMAT " is a continuation of a humongous " - "region but has " SIZE_FORMAT " code root entries", - HR_FORMAT_PARAMS(this), strong_code_roots_length); + log_info(gc, verify)("region " HR_FORMAT " is a continuation of a humongous region but has " SIZE_FORMAT " code root entries", + HR_FORMAT_PARAMS(this), strong_code_roots_length); *failures = true; } return; @@ -590,7 +583,7 @@ void HeapRegion::verify_strong_code_roots(VerifyOption vo, bool* failures) const } } -void HeapRegion::print() const { print_on(gclog_or_tty); } +void HeapRegion::print() const { print_on(tty); } void HeapRegion::print_on(outputStream* st) const { st->print("|%4u", this->_hrm_index); st->print("|" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT, @@ -651,6 +644,7 @@ public: assert(!_g1h->is_obj_dead_cond(_containing_obj, _vo), "Precondition"); T heap_oop = oopDesc::load_heap_oop(p); + LogHandle(gc, verify) log; if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); bool failed = false; @@ -659,35 +653,26 @@ public: Mutex::_no_safepoint_check_flag); if (!_failures) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("----------"); + log.info("----------"); } + ResourceMark rm; if (!_g1h->is_in_closed_subset(obj)) { HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); - gclog_or_tty->print_cr("Field " PTR_FORMAT - " of live obj " PTR_FORMAT " in region " - "[" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(p), p2i(_containing_obj), - p2i(from->bottom()), p2i(from->end())); - print_object(gclog_or_tty, _containing_obj); - gclog_or_tty->print_cr("points to obj " PTR_FORMAT " not in the heap", - p2i(obj)); + log.info("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end())); + print_object(log.info_stream(), _containing_obj); + log.info("points to obj " PTR_FORMAT " not in the heap", p2i(obj)); } else { HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj); - gclog_or_tty->print_cr("Field " PTR_FORMAT - " of live obj " PTR_FORMAT " in region " - "[" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(p), p2i(_containing_obj), - p2i(from->bottom()), p2i(from->end())); - print_object(gclog_or_tty, _containing_obj); - gclog_or_tty->print_cr("points to dead obj " PTR_FORMAT " in region " - "[" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(obj), p2i(to->bottom()), p2i(to->end())); - print_object(gclog_or_tty, obj); + log.info("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end())); + print_object(log.info_stream(), _containing_obj); + log.info("points to dead obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(obj), p2i(to->bottom()), p2i(to->end())); + print_object(log.info_stream(), obj); } - gclog_or_tty->print_cr("----------"); - gclog_or_tty->flush(); + log.info("----------"); _failures = true; failed = true; _n_failures++; @@ -714,25 +699,17 @@ public: Mutex::_no_safepoint_check_flag); if (!_failures) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("----------"); + log.info("----------"); } - gclog_or_tty->print_cr("Missing rem set entry:"); - gclog_or_tty->print_cr("Field " PTR_FORMAT " " - "of obj " PTR_FORMAT ", " - "in region " HR_FORMAT, - p2i(p), p2i(_containing_obj), - HR_FORMAT_PARAMS(from)); - _containing_obj->print_on(gclog_or_tty); - gclog_or_tty->print_cr("points to obj " PTR_FORMAT " " - "in region " HR_FORMAT, - p2i(obj), - HR_FORMAT_PARAMS(to)); - obj->print_on(gclog_or_tty); - gclog_or_tty->print_cr("Obj head CTE = %d, field CTE = %d.", - cv_obj, cv_field); - gclog_or_tty->print_cr("----------"); - gclog_or_tty->flush(); + log.info("Missing rem set entry:"); + log.info("Field " PTR_FORMAT " of obj " PTR_FORMAT ", in region " HR_FORMAT, + p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from)); + ResourceMark rm; + _containing_obj->print_on(log.info_stream()); + log.info("points to obj " PTR_FORMAT " in region " HR_FORMAT, p2i(obj), HR_FORMAT_PARAMS(to)); + obj->print_on(log.info_stream()); + log.info("Obj head CTE = %d, field CTE = %d.", cv_obj, cv_field); + log.info("----------"); _failures = true; if (!failed) _n_failures++; } @@ -766,13 +743,13 @@ void HeapRegion::verify(VerifyOption vo, (vo == VerifyOption_G1UsePrevMarking && ClassLoaderDataGraph::unload_list_contains(klass)); if (!is_metaspace_object) { - gclog_or_tty->print_cr("klass " PTR_FORMAT " of object " PTR_FORMAT " " - "not metadata", p2i(klass), p2i(obj)); + log_info(gc, verify)("klass " PTR_FORMAT " of object " PTR_FORMAT " " + "not metadata", p2i(klass), p2i(obj)); *failures = true; return; } else if (!klass->is_klass()) { - gclog_or_tty->print_cr("klass " PTR_FORMAT " of object " PTR_FORMAT " " - "not a klass", p2i(klass), p2i(obj)); + log_info(gc, verify)("klass " PTR_FORMAT " of object " PTR_FORMAT " " + "not a klass", p2i(klass), p2i(obj)); *failures = true; return; } else { @@ -787,7 +764,7 @@ void HeapRegion::verify(VerifyOption vo, } } } else { - gclog_or_tty->print_cr(PTR_FORMAT " no an oop", p2i(obj)); + log_info(gc, verify)(PTR_FORMAT " no an oop", p2i(obj)); *failures = true; return; } @@ -803,13 +780,13 @@ void HeapRegion::verify(VerifyOption vo, if (is_region_humongous) { oop obj = oop(this->humongous_start_region()->bottom()); if ((HeapWord*)obj > bottom() || (HeapWord*)obj + obj->size() < bottom()) { - gclog_or_tty->print_cr("this humongous region is not part of its' humongous object " PTR_FORMAT, p2i(obj)); + log_info(gc, verify)("this humongous region is not part of its' humongous object " PTR_FORMAT, p2i(obj)); } } if (!is_region_humongous && p != top()) { - gclog_or_tty->print_cr("end of last object " PTR_FORMAT " " - "does not match top " PTR_FORMAT, p2i(p), p2i(top())); + log_info(gc, verify)("end of last object " PTR_FORMAT " " + "does not match top " PTR_FORMAT, p2i(p), p2i(top())); *failures = true; return; } @@ -823,9 +800,9 @@ void HeapRegion::verify(VerifyOption vo, HeapWord* addr_1 = p; HeapWord* b_start_1 = _offsets.block_start_const(addr_1); if (b_start_1 != p) { - gclog_or_tty->print_cr("BOT look up for top: " PTR_FORMAT " " - " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, - p2i(addr_1), p2i(b_start_1), p2i(p)); + log_info(gc, verify)("BOT look up for top: " PTR_FORMAT " " + " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, + p2i(addr_1), p2i(b_start_1), p2i(p)); *failures = true; return; } @@ -835,9 +812,9 @@ void HeapRegion::verify(VerifyOption vo, if (addr_2 < the_end) { HeapWord* b_start_2 = _offsets.block_start_const(addr_2); if (b_start_2 != p) { - gclog_or_tty->print_cr("BOT look up for top + 1: " PTR_FORMAT " " - " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, - p2i(addr_2), p2i(b_start_2), p2i(p)); + log_info(gc, verify)("BOT look up for top + 1: " PTR_FORMAT " " + " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, + p2i(addr_2), p2i(b_start_2), p2i(p)); *failures = true; return; } @@ -849,9 +826,9 @@ void HeapRegion::verify(VerifyOption vo, if (addr_3 < the_end) { HeapWord* b_start_3 = _offsets.block_start_const(addr_3); if (b_start_3 != p) { - gclog_or_tty->print_cr("BOT look up for top + diff: " PTR_FORMAT " " - " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, - p2i(addr_3), p2i(b_start_3), p2i(p)); + log_info(gc, verify)("BOT look up for top + diff: " PTR_FORMAT " " + " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, + p2i(addr_3), p2i(b_start_3), p2i(p)); *failures = true; return; } @@ -861,9 +838,9 @@ void HeapRegion::verify(VerifyOption vo, HeapWord* addr_4 = the_end - 1; HeapWord* b_start_4 = _offsets.block_start_const(addr_4); if (b_start_4 != p) { - gclog_or_tty->print_cr("BOT look up for end - 1: " PTR_FORMAT " " - " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, - p2i(addr_4), p2i(b_start_4), p2i(p)); + log_info(gc, verify)("BOT look up for end - 1: " PTR_FORMAT " " + " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, + p2i(addr_4), p2i(b_start_4), p2i(p)); *failures = true; return; } @@ -914,7 +891,7 @@ void G1OffsetTableContigSpace::mangle_unused_area_complete() { void G1OffsetTableContigSpace::print() const { print_short(); - gclog_or_tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " + tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", p2i(bottom()), p2i(top()), p2i(_offsets.threshold()), p2i(end())); } diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp index c732e2a5614..74aaaf569f0 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp @@ -560,20 +560,13 @@ PerRegionTable* OtherRegionsTable::delete_region_table() { void OtherRegionsTable::scrub(CardTableModRefBS* ctbs, BitMap* region_bm, BitMap* card_bm) { // First eliminated garbage regions from the coarse map. - if (G1RSScrubVerbose) { - gclog_or_tty->print_cr("Scrubbing region %u:", _hr->hrm_index()); - } + log_develop_trace(gc, remset, scrub)("Scrubbing region %u:", _hr->hrm_index()); assert(_coarse_map.size() == region_bm->size(), "Precondition"); - if (G1RSScrubVerbose) { - gclog_or_tty->print(" Coarse map: before = " SIZE_FORMAT "...", - _n_coarse_entries); - } + log_develop_trace(gc, remset, scrub)(" Coarse map: before = " SIZE_FORMAT "...", _n_coarse_entries); _coarse_map.set_intersection(*region_bm); _n_coarse_entries = _coarse_map.count_one_bits(); - if (G1RSScrubVerbose) { - gclog_or_tty->print_cr(" after = " SIZE_FORMAT ".", _n_coarse_entries); - } + log_develop_trace(gc, remset, scrub)(" after = " SIZE_FORMAT ".", _n_coarse_entries); // Now do the fine-grained maps. for (size_t i = 0; i < _max_fine_entries; i++) { @@ -582,28 +575,19 @@ void OtherRegionsTable::scrub(CardTableModRefBS* ctbs, while (cur != NULL) { PerRegionTable* nxt = cur->collision_list_next(); // If the entire region is dead, eliminate. - if (G1RSScrubVerbose) { - gclog_or_tty->print_cr(" For other region %u:", - cur->hr()->hrm_index()); - } + log_develop_trace(gc, remset, scrub)(" For other region %u:", cur->hr()->hrm_index()); if (!region_bm->at((size_t) cur->hr()->hrm_index())) { *prev = nxt; cur->set_collision_list_next(NULL); _n_fine_entries--; - if (G1RSScrubVerbose) { - gclog_or_tty->print_cr(" deleted via region map."); - } + log_develop_trace(gc, remset, scrub)(" deleted via region map."); unlink_from_all(cur); PerRegionTable::free(cur); } else { // Do fine-grain elimination. - if (G1RSScrubVerbose) { - gclog_or_tty->print(" occ: before = %4d.", cur->occupied()); - } + log_develop_trace(gc, remset, scrub)(" occ: before = %4d.", cur->occupied()); cur->scrub(ctbs, card_bm); - if (G1RSScrubVerbose) { - gclog_or_tty->print_cr(" after = %4d.", cur->occupied()); - } + log_develop_trace(gc, remset, scrub)(" after = %4d.", cur->occupied()); // Did that empty the table completely? if (cur->occupied() == 0) { *prev = nxt; @@ -799,15 +783,15 @@ void HeapRegionRemSet::print() { while (iter.has_next(card_index)) { HeapWord* card_start = G1CollectedHeap::heap()->bot_shared()->address_for_index(card_index); - gclog_or_tty->print_cr(" Card " PTR_FORMAT, p2i(card_start)); + tty->print_cr(" Card " PTR_FORMAT, p2i(card_start)); } if (iter.n_yielded() != occupied()) { - gclog_or_tty->print_cr("Yielded disagrees with occupied:"); - gclog_or_tty->print_cr(" " SIZE_FORMAT_W(6) " yielded (" SIZE_FORMAT_W(6) + tty->print_cr("Yielded disagrees with occupied:"); + tty->print_cr(" " SIZE_FORMAT_W(6) " yielded (" SIZE_FORMAT_W(6) " coarse, " SIZE_FORMAT_W(6) " fine).", iter.n_yielded(), iter.n_yielded_coarse(), iter.n_yielded_fine()); - gclog_or_tty->print_cr(" " SIZE_FORMAT_W(6) " occ (" SIZE_FORMAT_W(6) + tty->print_cr(" " SIZE_FORMAT_W(6) " occ (" SIZE_FORMAT_W(6) " coarse, " SIZE_FORMAT_W(6) " fine).", occupied(), occ_coarse(), occ_fine()); } @@ -1071,7 +1055,7 @@ void HeapRegionRemSet::test() { while (iter.has_next(card_index)) { HeapWord* card_start = G1CollectedHeap::heap()->bot_shared()->address_for_index(card_index); - gclog_or_tty->print_cr(" Card " PTR_FORMAT ".", p2i(card_start)); + tty->print_cr(" Card " PTR_FORMAT ".", p2i(card_start)); sum++; } guarantee(sum == 11 - 3 + 2048, "Failure"); diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp index 324f2a8cef8..02f346313ae 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp @@ -86,7 +86,7 @@ class FromCardCache : public AllStatic { static void invalidate(uint start_idx, size_t num_regions); - static void print(outputStream* out = gclog_or_tty) PRODUCT_RETURN; + static void print(outputStream* out = tty) PRODUCT_RETURN; static size_t static_mem_size() { return _static_mem_size; diff --git a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp index fc18e92c9cb..e0dc38be982 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp @@ -261,24 +261,6 @@ void FreeRegionList::clear() { _last = NULL; } -void FreeRegionList::print_on(outputStream* out, bool print_contents) { - HeapRegionSetBase::print_on(out, print_contents); - out->print_cr(" Linking"); - out->print_cr(" head : " PTR_FORMAT, p2i(_head)); - out->print_cr(" tail : " PTR_FORMAT, p2i(_tail)); - - if (print_contents) { - out->print_cr(" Contents"); - FreeRegionListIterator iter(this); - while (iter.more_available()) { - HeapRegion* hr = iter.get_next(); - hr->print_on(out); - } - } - - out->cr(); -} - void FreeRegionList::verify_list() { HeapRegion* curr = _head; HeapRegion* prev1 = NULL; diff --git a/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp index c291a119e2a..1fb4c53330f 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp @@ -250,8 +250,6 @@ public: void remove_starting_at(HeapRegion* first, uint num_regions); virtual void verify(); - - virtual void print_on(outputStream* out, bool print_contents = false); }; // Iterator class that provides a convenient way to iterate over the diff --git a/hotspot/src/share/vm/gc/g1/satbMarkQueue.cpp b/hotspot/src/share/vm/gc/g1/satbMarkQueue.cpp index c10dcff1301..900e45ebf25 100644 --- a/hotspot/src/share/vm/gc/g1/satbMarkQueue.cpp +++ b/hotspot/src/share/vm/gc/g1/satbMarkQueue.cpp @@ -199,9 +199,8 @@ void SATBMarkQueue::print(const char* name) { void SATBMarkQueue::print(const char* name, void** buf, size_t index, size_t sz) { - gclog_or_tty->print_cr(" SATB BUFFER [%s] buf: " PTR_FORMAT " " - "index: " SIZE_FORMAT " sz: " SIZE_FORMAT, - name, p2i(buf), index, sz); + tty->print_cr(" SATB BUFFER [%s] buf: " PTR_FORMAT " index: " SIZE_FORMAT " sz: " SIZE_FORMAT, + name, p2i(buf), index, sz); } #endif // PRODUCT @@ -222,16 +221,13 @@ void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) { #ifdef ASSERT void SATBMarkQueueSet::dump_active_states(bool expected_active) { - gclog_or_tty->print_cr("Expected SATB active state: %s", - expected_active ? "ACTIVE" : "INACTIVE"); - gclog_or_tty->print_cr("Actual SATB active states:"); - gclog_or_tty->print_cr(" Queue set: %s", is_active() ? "ACTIVE" : "INACTIVE"); + log_info(gc, verify)("Expected SATB active state: %s", expected_active ? "ACTIVE" : "INACTIVE"); + log_info(gc, verify)("Actual SATB active states:"); + log_info(gc, verify)(" Queue set: %s", is_active() ? "ACTIVE" : "INACTIVE"); for (JavaThread* t = Threads::first(); t; t = t->next()) { - gclog_or_tty->print_cr(" Thread \"%s\" queue: %s", t->name(), - t->satb_mark_queue().is_active() ? "ACTIVE" : "INACTIVE"); + log_info(gc, verify)(" Thread \"%s\" queue: %s", t->name(), t->satb_mark_queue().is_active() ? "ACTIVE" : "INACTIVE"); } - gclog_or_tty->print_cr(" Shared queue: %s", - shared_satb_queue()->is_active() ? "ACTIVE" : "INACTIVE"); + log_info(gc, verify)(" Shared queue: %s", shared_satb_queue()->is_active() ? "ACTIVE" : "INACTIVE"); } void SATBMarkQueueSet::verify_active_states(bool expected_active) { @@ -318,8 +314,8 @@ void SATBMarkQueueSet::print_all(const char* msg) { char buffer[SATB_PRINTER_BUFFER_SIZE]; assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint."); - gclog_or_tty->cr(); - gclog_or_tty->print_cr("SATB BUFFERS [%s]", msg); + tty->cr(); + tty->print_cr("SATB BUFFERS [%s]", msg); BufferNode* nd = _completed_buffers_head; int i = 0; @@ -338,7 +334,7 @@ void SATBMarkQueueSet::print_all(const char* msg) { shared_satb_queue()->print("Shared"); - gclog_or_tty->cr(); + tty->cr(); } #endif // PRODUCT diff --git a/hotspot/src/share/vm/gc/g1/survRateGroup.cpp b/hotspot/src/share/vm/gc/g1/survRateGroup.cpp index 653efa7148d..e201d259491 100644 --- a/hotspot/src/share/vm/gc/g1/survRateGroup.cpp +++ b/hotspot/src/share/vm/gc/g1/survRateGroup.cpp @@ -27,6 +27,7 @@ #include "gc/g1/g1Predictions.hpp" #include "gc/g1/heapRegion.hpp" #include "gc/g1/survRateGroup.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" SurvRateGroup::SurvRateGroup(G1Predictions* predictor, @@ -163,12 +164,11 @@ void SurvRateGroup::all_surviving_words_recorded(bool update_predictors) { #ifndef PRODUCT void SurvRateGroup::print() { - gclog_or_tty->print_cr("Surv Rate Group: %s (" SIZE_FORMAT " entries)", - _name, _region_num); + log_develop_trace(gc, survivor)("Surv Rate Group: %s (" SIZE_FORMAT " entries)", _name, _region_num); for (size_t i = 0; i < _region_num; ++i) { - gclog_or_tty->print_cr(" age " SIZE_FORMAT_W(4) " surv rate %6.2lf %% pred %6.2lf %%", - i, _surv_rate[i] * 100.0, - _predictor->get_new_prediction(_surv_rate_pred[i]) * 100.0); + log_develop_trace(gc, survivor)(" age " SIZE_FORMAT_W(4) " surv rate %6.2lf %% pred %6.2lf %%", + i, _surv_rate[i] * 100.0, + _predictor->get_new_prediction(_surv_rate_pred[i]) * 100.0); } } @@ -178,22 +178,20 @@ SurvRateGroup::print_surv_rate_summary() { if (length == 0) return; - gclog_or_tty->cr(); - gclog_or_tty->print_cr("%s Rate Summary (for up to age " SIZE_FORMAT ")", _name, length-1); - gclog_or_tty->print_cr(" age range survival rate (avg) samples (avg)"); - gclog_or_tty->print_cr(" ---------------------------------------------------------"); + log_trace(gc, survivor)("%s Rate Summary (for up to age " SIZE_FORMAT ")", _name, length-1); + log_trace(gc, survivor)(" age range survival rate (avg) samples (avg)"); + log_trace(gc, survivor)(" ---------------------------------------------------------"); size_t index = 0; size_t limit = MIN2((int) length, 10); while (index < limit) { - gclog_or_tty->print_cr(" " SIZE_FORMAT_W(4) - " %6.2lf%% %6.2lf", - index, _summary_surv_rates[index]->avg() * 100.0, - (double) _summary_surv_rates[index]->num()); + log_trace(gc, survivor)(" " SIZE_FORMAT_W(4) " %6.2lf%% %6.2lf", + index, _summary_surv_rates[index]->avg() * 100.0, + (double) _summary_surv_rates[index]->num()); ++index; } - gclog_or_tty->print_cr(" ---------------------------------------------------------"); + log_trace(gc, survivor)(" ---------------------------------------------------------"); int num = 0; double sum = 0.0; @@ -205,16 +203,15 @@ SurvRateGroup::print_surv_rate_summary() { ++index; if (index == length || num % 10 == 0) { - gclog_or_tty->print_cr(" " SIZE_FORMAT_W(4) " .. " SIZE_FORMAT_W(4) - " %6.2lf%% %6.2lf", - (index-1) / 10 * 10, index-1, sum / (double) num, - (double) samples / (double) num); + log_trace(gc, survivor)(" " SIZE_FORMAT_W(4) " .. " SIZE_FORMAT_W(4) " %6.2lf%% %6.2lf", + (index-1) / 10 * 10, index-1, sum / (double) num, + (double) samples / (double) num); sum = 0.0; num = 0; samples = 0; } } - gclog_or_tty->print_cr(" ---------------------------------------------------------"); + log_trace(gc, survivor)(" ---------------------------------------------------------"); } #endif // PRODUCT diff --git a/hotspot/src/share/vm/gc/g1/vm_operations_g1.cpp b/hotspot/src/share/vm/gc/g1/vm_operations_g1.cpp index 0040a4f1422..8d7300854de 100644 --- a/hotspot/src/share/vm/gc/g1/vm_operations_g1.cpp +++ b/hotspot/src/share/vm/gc/g1/vm_operations_g1.cpp @@ -27,10 +27,9 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/shared/gcId.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/vm_operations_g1.hpp" #include "gc/shared/gcTimer.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "runtime/interfaceSupport.hpp" @@ -226,10 +225,10 @@ void VM_CGC_Operation::release_and_notify_pending_list_lock() { } void VM_CGC_Operation::doit() { - TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); - G1CollectedHeap* g1h = G1CollectedHeap::heap(); GCIdMark gc_id_mark(_gc_id); - GCTraceTime t(_printGCMessage, G1Log::fine(), true, g1h->gc_timer_cm()); + GCTraceCPUTime tcpu; + G1CollectedHeap* g1h = G1CollectedHeap::heap(); + GCTraceTime(Info, gc) t(_printGCMessage, g1h->gc_timer_cm(), GCCause::_no_gc, true); IsGCActiveMark x; _cl->do_void(); } diff --git a/hotspot/src/share/vm/gc/g1/workerDataArray.cpp b/hotspot/src/share/vm/gc/g1/workerDataArray.cpp index 420fc9c6ef8..0e3305d5c2a 100644 --- a/hotspot/src/share/vm/gc/g1/workerDataArray.cpp +++ b/hotspot/src/share/vm/gc/g1/workerDataArray.cpp @@ -30,13 +30,11 @@ void WorkerDataArray_test() { const uint length = 3; const char* title = "Test array"; const bool print_sum = false; - const int log_level = 3; const uint indent_level = 2; - WorkerDataArray array(length, title, print_sum, log_level, indent_level); + WorkerDataArray array(length, title, print_sum, indent_level); assert(strncmp(array.title(), title, strlen(title)) == 0 , "Expected titles to match"); assert(array.should_print_sum() == print_sum, "Expected should_print_sum to match print_sum"); - assert(array.log_level() == log_level, "Expected log levels to match"); assert(array.indentation() == indent_level, "Expected indentation to match"); const size_t expected[length] = {5, 3, 7}; diff --git a/hotspot/src/share/vm/gc/g1/workerDataArray.hpp b/hotspot/src/share/vm/gc/g1/workerDataArray.hpp index c96c4f9e65d..09f0b61a5f7 100644 --- a/hotspot/src/share/vm/gc/g1/workerDataArray.hpp +++ b/hotspot/src/share/vm/gc/g1/workerDataArray.hpp @@ -32,7 +32,6 @@ class WorkerDataArray : public CHeapObj { uint _length; const char* _title; bool _print_sum; - int _log_level; uint _indent_level; bool _enabled; @@ -46,7 +45,6 @@ class WorkerDataArray : public CHeapObj { WorkerDataArray(uint length, const char* title, bool print_sum, - int log_level, uint indent_level); ~WorkerDataArray(); @@ -80,10 +78,6 @@ class WorkerDataArray : public CHeapObj { return _print_sum; } - int log_level() const { - return _log_level; - } - void clear(); void set_enabled(bool enabled) { _enabled = enabled; diff --git a/hotspot/src/share/vm/gc/g1/workerDataArray.inline.hpp b/hotspot/src/share/vm/gc/g1/workerDataArray.inline.hpp index a228dc2309f..713eb125cff 100644 --- a/hotspot/src/share/vm/gc/g1/workerDataArray.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/workerDataArray.inline.hpp @@ -29,12 +29,10 @@ template WorkerDataArray::WorkerDataArray(uint length, const char* title, bool print_sum, - int log_level, uint indent_level) : _title(title), _length(0), _print_sum(print_sum), - _log_level(log_level), _indent_level(indent_level), _thread_work_items(NULL), _enabled(true) { diff --git a/hotspot/src/share/vm/gc/g1/youngList.cpp b/hotspot/src/share/vm/gc/g1/youngList.cpp index 4224541a72d..f975f1142be 100644 --- a/hotspot/src/share/vm/gc/g1/youngList.cpp +++ b/hotspot/src/share/vm/gc/g1/youngList.cpp @@ -29,6 +29,7 @@ #include "gc/g1/heapRegion.inline.hpp" #include "gc/g1/heapRegionRemSet.hpp" #include "gc/g1/youngList.hpp" +#include "logging/log.hpp" #include "utilities/ostream.hpp" YoungList::YoungList(G1CollectedHeap* g1h) : @@ -98,10 +99,10 @@ bool YoungList::check_list_well_formed() { HeapRegion* last = NULL; while (curr != NULL) { if (!curr->is_young()) { - gclog_or_tty->print_cr("### YOUNG REGION " PTR_FORMAT "-" PTR_FORMAT " " - "incorrectly tagged (y: %d, surv: %d)", - p2i(curr->bottom()), p2i(curr->end()), - curr->is_young(), curr->is_survivor()); + log_info(gc, verify)("### YOUNG REGION " PTR_FORMAT "-" PTR_FORMAT " " + "incorrectly tagged (y: %d, surv: %d)", + p2i(curr->bottom()), p2i(curr->end()), + curr->is_young(), curr->is_survivor()); ret = false; } ++length; @@ -111,9 +112,8 @@ bool YoungList::check_list_well_formed() { ret = ret && (length == _length); if (!ret) { - gclog_or_tty->print_cr("### YOUNG LIST seems not well formed!"); - gclog_or_tty->print_cr("### list has %u entries, _length is %u", - length, _length); + log_info(gc, verify)("### YOUNG LIST seems not well formed!"); + log_info(gc, verify)("### list has %u entries, _length is %u", length, _length); } return ret; @@ -123,20 +123,19 @@ bool YoungList::check_list_empty(bool check_sample) { bool ret = true; if (_length != 0) { - gclog_or_tty->print_cr("### YOUNG LIST should have 0 length, not %u", - _length); + log_info(gc, verify)("### YOUNG LIST should have 0 length, not %u", _length); ret = false; } if (check_sample && _last_sampled_rs_lengths != 0) { - gclog_or_tty->print_cr("### YOUNG LIST has non-zero last sampled RS lengths"); + log_info(gc, verify)("### YOUNG LIST has non-zero last sampled RS lengths"); ret = false; } if (_head != NULL) { - gclog_or_tty->print_cr("### YOUNG LIST does not have a NULL head"); + log_info(gc, verify)("### YOUNG LIST does not have a NULL head"); ret = false; } if (!ret) { - gclog_or_tty->print_cr("### YOUNG LIST does not seem empty"); + log_info(gc, verify)("### YOUNG LIST does not seem empty"); } return ret; @@ -171,7 +170,6 @@ YoungList::rs_length_sampling_next() { _curr = _curr->get_next_young_region(); if (_curr == NULL) { _last_sampled_rs_lengths = _sampled_rs_lengths; - // gclog_or_tty->print_cr("last sampled RS lengths = %d", _last_sampled_rs_lengths); } } @@ -222,13 +220,13 @@ void YoungList::print() { const char* names[] = {"YOUNG", "SURVIVOR"}; for (uint list = 0; list < ARRAY_SIZE(lists); ++list) { - gclog_or_tty->print_cr("%s LIST CONTENTS", names[list]); + tty->print_cr("%s LIST CONTENTS", names[list]); HeapRegion *curr = lists[list]; if (curr == NULL) { - gclog_or_tty->print_cr(" empty"); + tty->print_cr(" empty"); } while (curr != NULL) { - gclog_or_tty->print_cr(" " HR_FORMAT ", P: " PTR_FORMAT ", N: " PTR_FORMAT ", age: %4d", + tty->print_cr(" " HR_FORMAT ", P: " PTR_FORMAT ", N: " PTR_FORMAT ", age: %4d", HR_FORMAT_PARAMS(curr), p2i(curr->prev_top_at_mark_start()), p2i(curr->next_top_at_mark_start()), @@ -237,5 +235,5 @@ void YoungList::print() { } } - gclog_or_tty->cr(); + tty->cr(); } diff --git a/hotspot/src/share/vm/gc/parallel/adjoiningGenerations.cpp b/hotspot/src/share/vm/gc/parallel/adjoiningGenerations.cpp index 9f9361afcad..f5c591775ba 100644 --- a/hotspot/src/share/vm/gc/parallel/adjoiningGenerations.cpp +++ b/hotspot/src/share/vm/gc/parallel/adjoiningGenerations.cpp @@ -27,6 +27,9 @@ #include "gc/parallel/adjoiningVirtualSpaces.hpp" #include "gc/parallel/generationSizer.hpp" #include "gc/parallel/parallelScavengeHeap.hpp" +#include "logging/log.hpp" +#include "memory/resourceArea.hpp" +#include "utilities/ostream.hpp" // If boundary moving is being used, create the young gen and old // gen with ASPSYoungGen and ASPSOldGen, respectively. Revert to @@ -116,6 +119,29 @@ size_t AdjoiningGenerations::reserved_byte_size() { return virtual_spaces()->reserved_space().size(); } +void log_before_expansion(bool old, size_t expand_in_bytes, size_t change_in_bytes, size_t max_size) { + LogHandle(heap, ergo) log; + if (!log.is_debug()) { + return; + } + log.debug("Before expansion of %s gen with boundary move", old ? "old" : "young"); + log.debug(" Requested change: " SIZE_FORMAT_HEX " Attempted change: " SIZE_FORMAT_HEX, + expand_in_bytes, change_in_bytes); + ResourceMark rm; + ParallelScavengeHeap::heap()->print_on(log.debug_stream()); + log.debug(" PS%sGen max size: " SIZE_FORMAT "K", old ? "Old" : "Young", max_size/K); +} + +void log_after_expansion(bool old, size_t max_size) { + LogHandle(heap, ergo) log; + if (!log.is_debug()) { + return; + } + log.debug("After expansion of %s gen with boundary move", old ? "old" : "young"); + ResourceMark rm; + ParallelScavengeHeap::heap()->print_on(log.debug_stream()); + log.debug(" PS%sGen max size: " SIZE_FORMAT "K", old ? "Old" : "Young", max_size/K); +} // Make checks on the current sizes of the generations and // the constraints on the sizes of the generations. Push @@ -141,17 +167,7 @@ void AdjoiningGenerations::request_old_gen_expansion(size_t expand_in_bytes) { return; } - if (TraceAdaptiveGCBoundary) { - gclog_or_tty->print_cr("Before expansion of old gen with boundary move"); - gclog_or_tty->print_cr(" Requested change: " SIZE_FORMAT_HEX - " Attempted change: " SIZE_FORMAT_HEX, - expand_in_bytes, change_in_bytes); - if (!PrintHeapAtGC) { - Universe::print_on(gclog_or_tty); - } - gclog_or_tty->print_cr(" PSOldGen max size: " SIZE_FORMAT "K", - old_gen()->max_gen_size()/K); - } + log_before_expansion(true, expand_in_bytes, change_in_bytes, old_gen()->max_gen_size()); // Move the boundary between the generations up (smaller young gen). if (virtual_spaces()->adjust_boundary_up(change_in_bytes)) { @@ -167,14 +183,7 @@ void AdjoiningGenerations::request_old_gen_expansion(size_t expand_in_bytes) { young_gen()->space_invariants(); old_gen()->space_invariants(); - if (TraceAdaptiveGCBoundary) { - gclog_or_tty->print_cr("After expansion of old gen with boundary move"); - if (!PrintHeapAtGC) { - Universe::print_on(gclog_or_tty); - } - gclog_or_tty->print_cr(" PSOldGen max size: " SIZE_FORMAT "K", - old_gen()->max_gen_size()/K); - } + log_after_expansion(true, old_gen()->max_gen_size()); } // See comments on request_old_gen_expansion() @@ -200,16 +209,7 @@ bool AdjoiningGenerations::request_young_gen_expansion(size_t expand_in_bytes) { return false; } - if (TraceAdaptiveGCBoundary) { - gclog_or_tty->print_cr("Before expansion of young gen with boundary move"); - gclog_or_tty->print_cr(" Requested change: " SIZE_FORMAT_HEX " Attempted change: " SIZE_FORMAT_HEX, - expand_in_bytes, change_in_bytes); - if (!PrintHeapAtGC) { - Universe::print_on(gclog_or_tty); - } - gclog_or_tty->print_cr(" PSYoungGen max size: " SIZE_FORMAT "K", - young_gen()->max_size()/K); - } + log_before_expansion(false, expand_in_bytes, change_in_bytes, young_gen()->max_size()); // Move the boundary between the generations down (smaller old gen). MutexLocker x(ExpandHeap_lock); @@ -227,14 +227,7 @@ bool AdjoiningGenerations::request_young_gen_expansion(size_t expand_in_bytes) { young_gen()->space_invariants(); old_gen()->space_invariants(); - if (TraceAdaptiveGCBoundary) { - gclog_or_tty->print_cr("After expansion of young gen with boundary move"); - if (!PrintHeapAtGC) { - Universe::print_on(gclog_or_tty); - } - gclog_or_tty->print_cr(" PSYoungGen max size: " SIZE_FORMAT "K", - young_gen()->max_size()/K); - } + log_after_expansion(false, young_gen()->max_size()); return result; } diff --git a/hotspot/src/share/vm/gc/parallel/asPSOldGen.cpp b/hotspot/src/share/vm/gc/parallel/asPSOldGen.cpp index fa5837bcbf6..3adbe0c24ad 100644 --- a/hotspot/src/share/vm/gc/parallel/asPSOldGen.cpp +++ b/hotspot/src/share/vm/gc/parallel/asPSOldGen.cpp @@ -125,25 +125,21 @@ size_t ASPSOldGen::available_for_contraction() { size_t result = policy->promo_increment_aligned_down(max_contraction); // Also adjust for inter-generational alignment size_t result_aligned = align_size_down(result, gen_alignment); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr("\nASPSOldGen::available_for_contraction:" - " " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, result_aligned/K, result_aligned); - gclog_or_tty->print_cr(" reserved().byte_size() " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, - reserved().byte_size()/K, reserved().byte_size()); + + LogHandle(gc, ergo) log; + if (log.is_trace()) { size_t working_promoted = (size_t) policy->avg_promoted()->padded_average(); - gclog_or_tty->print_cr(" padded promoted " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, - working_promoted/K, working_promoted); - gclog_or_tty->print_cr(" used " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, - used_in_bytes()/K, used_in_bytes()); - gclog_or_tty->print_cr(" min_gen_size() " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, - min_gen_size()/K, min_gen_size()); - gclog_or_tty->print_cr(" max_contraction " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, - max_contraction/K, max_contraction); - gclog_or_tty->print_cr(" without alignment " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, - policy->promo_increment(max_contraction)/K, - policy->promo_increment(max_contraction)); - gclog_or_tty->print_cr(" alignment " SIZE_FORMAT_HEX, gen_alignment); + size_t promo_increment = policy->promo_increment(max_contraction); + log.trace("ASPSOldGen::available_for_contraction: " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, result_aligned/K, result_aligned); + log.trace(" reserved().byte_size() " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, reserved().byte_size()/K, reserved().byte_size()); + log.trace(" padded promoted " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, working_promoted/K, working_promoted); + log.trace(" used " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, used_in_bytes()/K, used_in_bytes()); + log.trace(" min_gen_size() " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, min_gen_size()/K, min_gen_size()); + log.trace(" max_contraction " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, max_contraction/K, max_contraction); + log.trace(" without alignment " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, promo_increment/K, promo_increment); + log.trace(" alignment " SIZE_FORMAT_HEX, gen_alignment); } + assert(result_aligned <= max_contraction, "arithmetic is wrong"); return result_aligned; } diff --git a/hotspot/src/share/vm/gc/parallel/asPSYoungGen.cpp b/hotspot/src/share/vm/gc/parallel/asPSYoungGen.cpp index b3e1d83e41f..130e51ab5d5 100644 --- a/hotspot/src/share/vm/gc/parallel/asPSYoungGen.cpp +++ b/hotspot/src/share/vm/gc/parallel/asPSYoungGen.cpp @@ -111,13 +111,12 @@ size_t ASPSYoungGen::available_for_contraction() { PSAdaptiveSizePolicy* policy = heap->size_policy(); size_t result = policy->eden_increment_aligned_down(max_contraction); size_t result_aligned = align_size_down(result, gen_alignment); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr("ASPSYoungGen::available_for_contraction: " SIZE_FORMAT " K", - result_aligned/K); - gclog_or_tty->print_cr(" max_contraction " SIZE_FORMAT " K", max_contraction/K); - gclog_or_tty->print_cr(" eden_avail " SIZE_FORMAT " K", eden_avail/K); - gclog_or_tty->print_cr(" gen_avail " SIZE_FORMAT " K", gen_avail/K); - } + + log_trace(gc, ergo)("ASPSYoungGen::available_for_contraction: " SIZE_FORMAT " K", result_aligned/K); + log_trace(gc, ergo)(" max_contraction " SIZE_FORMAT " K", max_contraction/K); + log_trace(gc, ergo)(" eden_avail " SIZE_FORMAT " K", eden_avail/K); + log_trace(gc, ergo)(" gen_avail " SIZE_FORMAT " K", gen_avail/K); + return result_aligned; } @@ -199,25 +198,17 @@ bool ASPSYoungGen::resize_generation(size_t eden_size, size_t survivor_size) { virtual_space()->shrink_by(change); size_changed = true; } else { - if (Verbose && PrintGC) { - if (orig_size == gen_size_limit()) { - gclog_or_tty->print_cr("ASPSYoung generation size at maximum: " - SIZE_FORMAT "K", orig_size/K); - } else if (orig_size == min_gen_size()) { - gclog_or_tty->print_cr("ASPSYoung generation size at minium: " - SIZE_FORMAT "K", orig_size/K); - } + if (orig_size == gen_size_limit()) { + log_trace(gc)("ASPSYoung generation size at maximum: " SIZE_FORMAT "K", orig_size/K); + } else if (orig_size == min_gen_size()) { + log_trace(gc)("ASPSYoung generation size at minium: " SIZE_FORMAT "K", orig_size/K); } } if (size_changed) { reset_after_change(); - if (Verbose && PrintGC) { - size_t current_size = virtual_space()->committed_size(); - gclog_or_tty->print_cr("ASPSYoung generation size changed: " - SIZE_FORMAT "K->" SIZE_FORMAT "K", - orig_size/K, current_size/K); - } + log_trace(gc)("ASPSYoung generation size changed: " SIZE_FORMAT "K->" SIZE_FORMAT "K", + orig_size/K, virtual_space()->committed_size()/K); } guarantee(eden_plus_survivors <= virtual_space()->committed_size() || @@ -245,41 +236,31 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, return; } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr("PSYoungGen::resize_spaces(requested_eden_size: " - SIZE_FORMAT - ", requested_survivor_size: " SIZE_FORMAT ")", - requested_eden_size, requested_survivor_size); - gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " - SIZE_FORMAT, - p2i(eden_space()->bottom()), - p2i(eden_space()->end()), - pointer_delta(eden_space()->end(), - eden_space()->bottom(), - sizeof(char))); - gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " - SIZE_FORMAT, - p2i(from_space()->bottom()), - p2i(from_space()->end()), - pointer_delta(from_space()->end(), - from_space()->bottom(), - sizeof(char))); - gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " - SIZE_FORMAT, - p2i(to_space()->bottom()), - p2i(to_space()->end()), - pointer_delta( to_space()->end(), - to_space()->bottom(), - sizeof(char))); - } + log_trace(gc, ergo)("PSYoungGen::resize_spaces(requested_eden_size: " + SIZE_FORMAT + ", requested_survivor_size: " SIZE_FORMAT ")", + requested_eden_size, requested_survivor_size); + log_trace(gc, ergo)(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " + SIZE_FORMAT, + p2i(eden_space()->bottom()), + p2i(eden_space()->end()), + pointer_delta(eden_space()->end(), eden_space()->bottom(), sizeof(char))); + log_trace(gc, ergo)(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " + SIZE_FORMAT, + p2i(from_space()->bottom()), + p2i(from_space()->end()), + pointer_delta(from_space()->end(), from_space()->bottom(), sizeof(char))); + log_trace(gc, ergo)(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " + SIZE_FORMAT, + p2i(to_space()->bottom()), + p2i(to_space()->end()), + pointer_delta( to_space()->end(), to_space()->bottom(), sizeof(char))); // There's nothing to do if the new sizes are the same as the current if (requested_survivor_size == to_space()->capacity_in_bytes() && requested_survivor_size == from_space()->capacity_in_bytes() && requested_eden_size == eden_space()->capacity_in_bytes()) { - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" capacities are the right sizes, returning"); - } + log_trace(gc, ergo)(" capacities are the right sizes, returning"); return; } @@ -302,9 +283,7 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, if (eden_from_to_order) { // Eden, from, to - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" Eden, from, to:"); - } + log_trace(gc, ergo)(" Eden, from, to:"); // Set eden // "requested_eden_size" is a goal for the size of eden @@ -368,28 +347,24 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, guarantee(to_start != to_end, "to space is zero sized"); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" [eden_start .. eden_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(eden_start), - p2i(eden_end), - pointer_delta(eden_end, eden_start, sizeof(char))); - gclog_or_tty->print_cr(" [from_start .. from_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(from_start), - p2i(from_end), - pointer_delta(from_end, from_start, sizeof(char))); - gclog_or_tty->print_cr(" [ to_start .. to_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(to_start), - p2i(to_end), - pointer_delta( to_end, to_start, sizeof(char))); - } + log_trace(gc, ergo)(" [eden_start .. eden_end): " + "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(eden_start), + p2i(eden_end), + pointer_delta(eden_end, eden_start, sizeof(char))); + log_trace(gc, ergo)(" [from_start .. from_end): " + "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(from_start), + p2i(from_end), + pointer_delta(from_end, from_start, sizeof(char))); + log_trace(gc, ergo)(" [ to_start .. to_end): " + "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(to_start), + p2i(to_end), + pointer_delta( to_end, to_start, sizeof(char))); } else { // Eden, to, from - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" Eden, to, from:"); - } + log_trace(gc, ergo)(" Eden, to, from:"); // To space gets priority over eden resizing. Note that we position // to space as if we were able to resize from space, even though from @@ -422,23 +397,21 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, eden_end = MAX2(eden_end, eden_start + alignment); to_start = MAX2(to_start, eden_end); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" [eden_start .. eden_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(eden_start), - p2i(eden_end), - pointer_delta(eden_end, eden_start, sizeof(char))); - gclog_or_tty->print_cr(" [ to_start .. to_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(to_start), - p2i(to_end), - pointer_delta( to_end, to_start, sizeof(char))); - gclog_or_tty->print_cr(" [from_start .. from_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(from_start), - p2i(from_end), - pointer_delta(from_end, from_start, sizeof(char))); - } + log_trace(gc, ergo)(" [eden_start .. eden_end): " + "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(eden_start), + p2i(eden_end), + pointer_delta(eden_end, eden_start, sizeof(char))); + log_trace(gc, ergo)(" [ to_start .. to_end): " + "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(to_start), + p2i(to_end), + pointer_delta( to_end, to_start, sizeof(char))); + log_trace(gc, ergo)(" [from_start .. from_end): " + "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(from_start), + p2i(from_end), + pointer_delta(from_end, from_start, sizeof(char))); } @@ -457,7 +430,7 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, // Let's make sure the call to initialize doesn't reset "top"! DEBUG_ONLY(HeapWord* old_from_top = from_space()->top();) - // For PrintAdaptiveSizePolicy block below + // For logging block below size_t old_from = from_space()->capacity_in_bytes(); size_t old_to = to_space()->capacity_in_bytes(); @@ -506,19 +479,16 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, assert(from_space()->top() == old_from_top, "from top changed!"); - if (PrintAdaptiveSizePolicy) { - ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); - gclog_or_tty->print("AdaptiveSizePolicy::survivor space sizes: " - "collection: %d " - "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> " - "(" SIZE_FORMAT ", " SIZE_FORMAT ") ", - heap->total_collections(), - old_from, old_to, - from_space()->capacity_in_bytes(), - to_space()->capacity_in_bytes()); - gclog_or_tty->cr(); - } - space_invariants(); + log_trace(gc, ergo)("AdaptiveSizePolicy::survivor space sizes: " + "collection: %d " + "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> " + "(" SIZE_FORMAT ", " SIZE_FORMAT ") ", + ParallelScavengeHeap::heap()->total_collections(), + old_from, old_to, + from_space()->capacity_in_bytes(), + to_space()->capacity_in_bytes()); + + space_invariants(); } void ASPSYoungGen::reset_after_change() { assert_locked_or_safepoint(Heap_lock); diff --git a/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp b/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp index a2ce06fd768..083fb2a2fb0 100644 --- a/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp +++ b/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp @@ -468,30 +468,17 @@ void CardTableExtension::resize_covered_region_by_end(int changed_region, // Update the covered region resize_update_covered_table(changed_region, new_region); - if (TraceCardTableModRefBS) { - int ind = changed_region; - gclog_or_tty->print_cr("CardTableModRefBS::resize_covered_region: "); - gclog_or_tty->print_cr(" " - " _covered[%d].start(): " INTPTR_FORMAT - " _covered[%d].last(): " INTPTR_FORMAT, - ind, p2i(_covered[ind].start()), - ind, p2i(_covered[ind].last())); - gclog_or_tty->print_cr(" " - " _committed[%d].start(): " INTPTR_FORMAT - " _committed[%d].last(): " INTPTR_FORMAT, - ind, p2i(_committed[ind].start()), - ind, p2i(_committed[ind].last())); - gclog_or_tty->print_cr(" " - " byte_for(start): " INTPTR_FORMAT - " byte_for(last): " INTPTR_FORMAT, - p2i(byte_for(_covered[ind].start())), - p2i(byte_for(_covered[ind].last()))); - gclog_or_tty->print_cr(" " - " addr_for(start): " INTPTR_FORMAT - " addr_for(last): " INTPTR_FORMAT, - p2i(addr_for((jbyte*) _committed[ind].start())), - p2i(addr_for((jbyte*) _committed[ind].last()))); - } + int ind = changed_region; + log_trace(gc, barrier)("CardTableModRefBS::resize_covered_region: "); + log_trace(gc, barrier)(" _covered[%d].start(): " INTPTR_FORMAT " _covered[%d].last(): " INTPTR_FORMAT, + ind, p2i(_covered[ind].start()), ind, p2i(_covered[ind].last())); + log_trace(gc, barrier)(" _committed[%d].start(): " INTPTR_FORMAT " _committed[%d].last(): " INTPTR_FORMAT, + ind, p2i(_committed[ind].start()), ind, p2i(_committed[ind].last())); + log_trace(gc, barrier)(" byte_for(start): " INTPTR_FORMAT " byte_for(last): " INTPTR_FORMAT, + p2i(byte_for(_covered[ind].start())), p2i(byte_for(_covered[ind].last()))); + log_trace(gc, barrier)(" addr_for(start): " INTPTR_FORMAT " addr_for(last): " INTPTR_FORMAT, + p2i(addr_for((jbyte*) _committed[ind].start())), p2i(addr_for((jbyte*) _committed[ind].last()))); + debug_only(verify_guard();) } diff --git a/hotspot/src/share/vm/gc/parallel/gcTaskManager.cpp b/hotspot/src/share/vm/gc/parallel/gcTaskManager.cpp index 85a908ed794..4cd339886c2 100644 --- a/hotspot/src/share/vm/gc/parallel/gcTaskManager.cpp +++ b/hotspot/src/share/vm/gc/parallel/gcTaskManager.cpp @@ -27,6 +27,7 @@ #include "gc/parallel/gcTaskThread.hpp" #include "gc/shared/adaptiveSizePolicy.hpp" #include "gc/shared/gcId.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/allocation.inline.hpp" #include "runtime/mutex.hpp" @@ -465,13 +466,11 @@ void GCTaskManager::set_active_gang() { "all_workers_active() is incorrect: " "active %d ParallelGCThreads %u", active_workers(), ParallelGCThreads); - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("GCTaskManager::set_active_gang(): " - "all_workers_active() %d workers %d " - "active %d ParallelGCThreads %u", - all_workers_active(), workers(), active_workers(), - ParallelGCThreads); - } + log_trace(gc, task)("GCTaskManager::set_active_gang(): " + "all_workers_active() %d workers %d " + "active %d ParallelGCThreads %u", + all_workers_active(), workers(), active_workers(), + ParallelGCThreads); } // Create IdleGCTasks for inactive workers. @@ -502,15 +501,12 @@ void GCTaskManager::task_idle_workers() { set_active_workers(reduced_active_workers); more_inactive_workers = 0; } - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("JT: %d workers %d active %d " - "idle %d more %d", - Threads::number_of_non_daemon_threads(), - workers(), - active_workers(), - idle_workers(), - more_inactive_workers); - } + log_trace(gc, task)("JT: %d workers %d active %d idle %d more %d", + Threads::number_of_non_daemon_threads(), + workers(), + active_workers(), + idle_workers(), + more_inactive_workers); } GCTaskQueue* q = GCTaskQueue::create(); for(uint i = 0; i < (uint) more_inactive_workers; i++) { @@ -536,6 +532,9 @@ void GCTaskManager::release_idle_workers() { } void GCTaskManager::print_task_time_stamps() { + if (!log_is_enabled(Debug, gc, task, time)) { + return; + } for(uint i=0; iprint_task_time_stamps(); @@ -828,38 +827,24 @@ IdleGCTask* IdleGCTask::create_on_c_heap() { void IdleGCTask::do_it(GCTaskManager* manager, uint which) { WaitHelper* wait_helper = manager->wait_helper(); - if (TraceGCTaskManager) { - tty->print_cr("[" INTPTR_FORMAT "]" - " IdleGCTask:::do_it()" - " should_wait: %s", + log_trace(gc, task)("[" INTPTR_FORMAT "] IdleGCTask:::do_it() should_wait: %s", p2i(this), wait_helper->should_wait() ? "true" : "false"); - } + MutexLockerEx ml(manager->monitor(), Mutex::_no_safepoint_check_flag); - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("--- idle %d", which); - } + log_trace(gc, task)("--- idle %d", which); // Increment has to be done when the idle tasks are created. // manager->increment_idle_workers(); manager->monitor()->notify_all(); while (wait_helper->should_wait()) { - if (TraceGCTaskManager) { - tty->print_cr("[" INTPTR_FORMAT "]" - " IdleGCTask::do_it()" - " [" INTPTR_FORMAT "] (%s)->wait()", - p2i(this), p2i(manager->monitor()), manager->monitor()->name()); - } + log_trace(gc, task)("[" INTPTR_FORMAT "] IdleGCTask::do_it() [" INTPTR_FORMAT "] (%s)->wait()", + p2i(this), p2i(manager->monitor()), manager->monitor()->name()); manager->monitor()->wait(Mutex::_no_safepoint_check_flag, 0); } manager->decrement_idle_workers(); - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("--- release %d", which); - } - if (TraceGCTaskManager) { - tty->print_cr("[" INTPTR_FORMAT "]" - " IdleGCTask::do_it() returns" - " should_wait: %s", - p2i(this), wait_helper->should_wait() ? "true" : "false"); - } + + log_trace(gc, task)("--- release %d", which); + log_trace(gc, task)("[" INTPTR_FORMAT "] IdleGCTask::do_it() returns should_wait: %s", + p2i(this), wait_helper->should_wait() ? "true" : "false"); // Release monitor(). } diff --git a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp index c8ce9969b38..752ef109f2d 100644 --- a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp +++ b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp @@ -26,9 +26,11 @@ #include "gc/parallel/gcTaskManager.hpp" #include "gc/parallel/gcTaskThread.hpp" #include "gc/shared/gcId.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" +#include "runtime/atomic.inline.hpp" #include "runtime/handles.hpp" #include "runtime/handles.inline.hpp" #include "runtime/os.hpp" @@ -45,11 +47,6 @@ GCTaskThread::GCTaskThread(GCTaskManager* manager, if (!os::create_thread(this, os::pgc_thread)) vm_exit_out_of_memory(0, OOM_MALLOC_ERROR, "Cannot create GC thread. Out of system resources."); - if (PrintGCTaskTimeStamps) { - _time_stamps = NEW_C_HEAP_ARRAY(GCTaskTimeStamp, GCTaskTimeStampEntries, mtGC); - - guarantee(_time_stamps != NULL, "Sanity"); - } set_id(which); set_name("ParGC Thread#%d", which); } @@ -66,21 +63,30 @@ void GCTaskThread::start() { GCTaskTimeStamp* GCTaskThread::time_stamp_at(uint index) { guarantee(index < GCTaskTimeStampEntries, "increase GCTaskTimeStampEntries"); + if (_time_stamps == NULL) { + // We allocate the _time_stamps array lazily since logging can be enabled dynamically + GCTaskTimeStamp* time_stamps = NEW_C_HEAP_ARRAY(GCTaskTimeStamp, GCTaskTimeStampEntries, mtGC); + void* old = Atomic::cmpxchg_ptr(time_stamps, &_time_stamps, NULL); + if (old != NULL) { + // Someone already setup the time stamps + FREE_C_HEAP_ARRAY(GCTaskTimeStamp, time_stamps); + } + } return &(_time_stamps[index]); } void GCTaskThread::print_task_time_stamps() { - assert(PrintGCTaskTimeStamps, "Sanity"); - assert(_time_stamps != NULL, "Sanity (Probably set PrintGCTaskTimeStamps late)"); + assert(log_is_enabled(Debug, gc, task, time), "Sanity"); + assert(_time_stamps != NULL, "Sanity"); - tty->print_cr("GC-Thread %u entries: %d", id(), _time_stamp_index); + log_debug(gc, task, time)("GC-Thread %u entries: %d", id(), _time_stamp_index); for(uint i=0; i<_time_stamp_index; i++) { GCTaskTimeStamp* time_stamp = time_stamp_at(i); - tty->print_cr("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]", - time_stamp->name(), - time_stamp->entry_time(), - time_stamp->exit_time()); + log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]", + time_stamp->name(), + time_stamp->entry_time(), + time_stamp->exit_time()); } // Reset after dumping the data @@ -127,7 +133,7 @@ void GCTaskThread::run() { // Record if this is an idle task for later use. bool is_idle_task = task->is_idle_task(); // In case the update is costly - if (PrintGCTaskTimeStamps) { + if (log_is_enabled(Debug, gc, task, time)) { timer.update(); } @@ -143,10 +149,7 @@ void GCTaskThread::run() { if (!is_idle_task) { manager()->note_completion(which()); - if (PrintGCTaskTimeStamps) { - assert(_time_stamps != NULL, - "Sanity (PrintGCTaskTimeStamps set late?)"); - + if (log_is_enabled(Debug, gc, task, time)) { timer.update(); GCTaskTimeStamp* time_stamp = time_stamp_at(_time_stamp_index++); diff --git a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp index a1c94ad4b86..f14aefa7943 100644 --- a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp +++ b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp @@ -38,6 +38,7 @@ #include "gc/shared/gcHeapSummary.hpp" #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcWhen.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/java.hpp" @@ -307,10 +308,7 @@ HeapWord* ParallelScavengeHeap::mem_allocate( if (limit_exceeded && softrefs_clear) { *gc_overhead_limit_was_exceeded = true; size_policy()->set_gc_overhead_limit_exceeded(false); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("ParallelScavengeHeap::mem_allocate: " - "return NULL because gc_overhead_limit_exceeded is set"); - } + log_trace(gc)("ParallelScavengeHeap::mem_allocate: return NULL because gc_overhead_limit_exceeded is set"); if (op.result() != NULL) { CollectedHeap::fill_with_object(op.result(), size); } @@ -584,35 +582,17 @@ void ParallelScavengeHeap::print_tracing_info() const { } -void ParallelScavengeHeap::verify(bool silent, VerifyOption option /* ignored */) { +void ParallelScavengeHeap::verify(VerifyOption option /* ignored */) { // Why do we need the total_collections()-filter below? if (total_collections() > 0) { - if (!silent) { - gclog_or_tty->print("tenured "); - } + log_debug(gc, verify)("Tenured"); old_gen()->verify(); - if (!silent) { - gclog_or_tty->print("eden "); - } + log_debug(gc, verify)("Eden"); young_gen()->verify(); } } -void ParallelScavengeHeap::print_heap_change(size_t prev_used) { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(" " SIZE_FORMAT - "->" SIZE_FORMAT - "(" SIZE_FORMAT ")", - prev_used, used(), capacity()); - } else { - gclog_or_tty->print(" " SIZE_FORMAT "K" - "->" SIZE_FORMAT "K" - "(" SIZE_FORMAT "K)", - prev_used / K, used() / K, capacity() / K); - } -} - void ParallelScavengeHeap::trace_heap(GCWhen::Type when, const GCTracer* gc_tracer) { const PSHeapSummary& heap_summary = create_ps_heap_summary(); gc_tracer->report_gc_heap_summary(when, heap_summary); diff --git a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.hpp b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.hpp index 86953f7572d..e2794db1478 100644 --- a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.hpp +++ b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.hpp @@ -35,6 +35,7 @@ #include "gc/shared/gcPolicyCounters.hpp" #include "gc/shared/gcWhen.hpp" #include "gc/shared/strongRootsScope.hpp" +#include "memory/metaspace.hpp" #include "utilities/ostream.hpp" class AdjoiningGenerations; @@ -87,6 +88,10 @@ class ParallelScavengeHeap : public CollectedHeap { return CollectedHeap::ParallelScavengeHeap; } + virtual const char* name() const { + return "Parallel"; + } + virtual CollectorPolicy* collector_policy() const { return _collector_policy; } static PSYoungGen* young_gen() { return _young_gen; } @@ -215,9 +220,7 @@ class ParallelScavengeHeap : public CollectedHeap { virtual void gc_threads_do(ThreadClosure* tc) const; virtual void print_tracing_info() const; - void verify(bool silent, VerifyOption option /* ignored */); - - void print_heap_change(size_t prev_used); + void verify(VerifyOption option /* ignored */); // Resize the young generation. The reserved space for the // generation may be expanded in preparation for the resize. @@ -241,4 +244,26 @@ class ParallelScavengeHeap : public CollectedHeap { }; }; +// Simple class for storing info about the heap at the start of GC, to be used +// after GC for comparison/printing. +class PreGCValues { +public: + PreGCValues(ParallelScavengeHeap* heap) : + _heap_used(heap->used()), + _young_gen_used(heap->young_gen()->used_in_bytes()), + _old_gen_used(heap->old_gen()->used_in_bytes()), + _metadata_used(MetaspaceAux::used_bytes()) { }; + + size_t heap_used() const { return _heap_used; } + size_t young_gen_used() const { return _young_gen_used; } + size_t old_gen_used() const { return _old_gen_used; } + size_t metadata_used() const { return _metadata_used; } + +private: + size_t _heap_used; + size_t _young_gen_used; + size_t _old_gen_used; + size_t _metadata_used; +}; + #endif // SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP diff --git a/hotspot/src/share/vm/gc/parallel/pcTasks.cpp b/hotspot/src/share/vm/gc/parallel/pcTasks.cpp index 54d75e73aab..8d0768556d6 100644 --- a/hotspot/src/share/vm/gc/parallel/pcTasks.cpp +++ b/hotspot/src/share/vm/gc/parallel/pcTasks.cpp @@ -31,7 +31,8 @@ #include "gc/parallel/psParallelCompact.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/gcTimer.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" +#include "logging/log.hpp" #include "memory/universe.hpp" #include "oops/objArrayKlass.inline.hpp" #include "oops/oop.inline.hpp" @@ -251,14 +252,6 @@ void StealRegionCompactionTask::do_it(GCTaskManager* manager, uint which) { cm->set_region_stack_index(which_stack_index); cm->set_region_stack(ParCompactionManager::region_list(which_stack_index)); - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("StealRegionCompactionTask::do_it " - "region_stack_index %d region_stack = " PTR_FORMAT " " - " empty (%d) use all workers %d", - which_stack_index, p2i(ParCompactionManager::region_list(which_stack_index)), - cm->region_stack()->is_empty(), - use_all_workers); - } // Has to drain stacks first because there may be regions on // preloaded onto the stack and this thread may never have @@ -323,14 +316,6 @@ void DrainStacksCompactionTask::do_it(GCTaskManager* manager, uint which) { } cm->set_region_stack(ParCompactionManager::region_list(which_stack_index)); - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("DrainStacksCompactionTask::do_it which = %d " - "which_stack_index = %d/empty(%d) " - "use all workers %d", - which, which_stack_index, - cm->region_stack()->is_empty(), - use_all_workers); - } cm->set_region_stack_index(which_stack_index); @@ -346,13 +331,6 @@ void DrainStacksCompactionTask::do_it(GCTaskManager* manager, uint which) { "region_stack and region_stack_index are inconsistent"); ParCompactionManager::push_recycled_stack_index(cm->region_stack_index()); - if (TraceDynamicGCThreads) { - void* old_region_stack = (void*) cm->region_stack(); - int old_region_stack_index = cm->region_stack_index(); - gclog_or_tty->print_cr("Pushing region stack " PTR_FORMAT "/%d", - p2i(old_region_stack), old_region_stack_index); - } - cm->set_region_stack(NULL); cm->set_region_stack_index((uint)max_uintx); } diff --git a/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.cpp b/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.cpp index 69720fb3e4e..4506ed67ee3 100644 --- a/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.cpp +++ b/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.cpp @@ -30,6 +30,7 @@ #include "gc/shared/collectorPolicy.hpp" #include "gc/shared/gcCause.hpp" #include "gc/shared/gcPolicyCounters.hpp" +#include "logging/log.hpp" #include "runtime/timer.hpp" #include "utilities/top.hpp" @@ -159,14 +160,10 @@ void PSAdaptiveSizePolicy::major_collection_end(size_t amount_live, _major_pause_young_estimator->update(eden_size_in_mbytes, major_pause_in_ms); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print("psAdaptiveSizePolicy::major_collection_end: " - "major gc cost: %f average: %f", collection_cost, - avg_major_gc_cost()->average()); - gclog_or_tty->print_cr(" major pause: %f major period %f", - major_pause_in_ms, - _latest_major_mutator_interval_seconds * MILLIUNITS); - } + log_trace(gc, ergo)("psAdaptiveSizePolicy::major_collection_end: major gc cost: %f average: %f", + collection_cost,avg_major_gc_cost()->average()); + log_trace(gc, ergo)(" major pause: %f major period %f", + major_pause_in_ms, _latest_major_mutator_interval_seconds * MILLIUNITS); // Calculate variable used to estimate collection cost vs. gen sizes assert(collection_cost >= 0.0, "Expected to be non-negative"); @@ -197,19 +194,11 @@ bool PSAdaptiveSizePolicy::should_full_GC(size_t old_free_in_bytes) { // A similar test is done in the scavenge's should_attempt_scavenge(). If // this is changed, decide if that test should also be changed. bool result = padded_average_promoted_in_bytes() > (float) old_free_in_bytes; - if (PrintGCDetails && Verbose) { - if (result) { - gclog_or_tty->print(" full after scavenge: "); - } else { - gclog_or_tty->print(" no full after scavenge: "); - } - gclog_or_tty->print_cr(" average_promoted " SIZE_FORMAT - " padded_average_promoted " SIZE_FORMAT - " free in old gen " SIZE_FORMAT, - (size_t) average_promoted_in_bytes(), - (size_t) padded_average_promoted_in_bytes(), - old_free_in_bytes); - } + log_trace(gc, ergo)("%s after scavenge average_promoted " SIZE_FORMAT " padded_average_promoted " SIZE_FORMAT " free in old gen " SIZE_FORMAT, + result ? "Full" : "No full", + (size_t) average_promoted_in_bytes(), + (size_t) padded_average_promoted_in_bytes(), + old_free_in_bytes); return result; } @@ -361,26 +350,24 @@ void PSAdaptiveSizePolicy::compute_eden_space_size( // Note we make the same tests as in the code block below; the code // seems a little easier to read with the printing in another block. - if (PrintAdaptiveSizePolicy) { - if (desired_eden_size > eden_limit) { - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::compute_eden_space_size limits:" - " desired_eden_size: " SIZE_FORMAT - " old_eden_size: " SIZE_FORMAT - " eden_limit: " SIZE_FORMAT - " cur_eden: " SIZE_FORMAT - " max_eden_size: " SIZE_FORMAT - " avg_young_live: " SIZE_FORMAT, - desired_eden_size, _eden_size, eden_limit, cur_eden, - max_eden_size, (size_t)avg_young_live()->average()); - } - if (gc_cost() > gc_cost_limit) { - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::compute_eden_space_size: gc time limit" - " gc_cost: %f " - " GCTimeLimit: " UINTX_FORMAT, - gc_cost(), GCTimeLimit); - } + if (desired_eden_size > eden_limit) { + log_debug(gc, ergo)( + "PSAdaptiveSizePolicy::compute_eden_space_size limits:" + " desired_eden_size: " SIZE_FORMAT + " old_eden_size: " SIZE_FORMAT + " eden_limit: " SIZE_FORMAT + " cur_eden: " SIZE_FORMAT + " max_eden_size: " SIZE_FORMAT + " avg_young_live: " SIZE_FORMAT, + desired_eden_size, _eden_size, eden_limit, cur_eden, + max_eden_size, (size_t)avg_young_live()->average()); + } + if (gc_cost() > gc_cost_limit) { + log_debug(gc, ergo)( + "PSAdaptiveSizePolicy::compute_eden_space_size: gc time limit" + " gc_cost: %f " + " GCTimeLimit: " UINTX_FORMAT, + gc_cost(), GCTimeLimit); } // Align everything and make a final limit check @@ -399,51 +386,26 @@ void PSAdaptiveSizePolicy::compute_eden_space_size( desired_eden_size = MAX2(eden_limit, cur_eden); } - if (PrintAdaptiveSizePolicy) { - // Timing stats - gclog_or_tty->print( - "PSAdaptiveSizePolicy::compute_eden_space_size: costs" - " minor_time: %f" - " major_cost: %f" - " mutator_cost: %f" - " throughput_goal: %f", - minor_gc_cost(), major_gc_cost(), mutator_cost(), - _throughput_goal); + log_debug(gc, ergo)("PSAdaptiveSizePolicy::compute_eden_space_size: costs minor_time: %f major_cost: %f mutator_cost: %f throughput_goal: %f", + minor_gc_cost(), major_gc_cost(), mutator_cost(), _throughput_goal); - // We give more details if Verbose is set - if (Verbose) { - gclog_or_tty->print( " minor_pause: %f" - " major_pause: %f" - " minor_interval: %f" - " major_interval: %f" - " pause_goal: %f", - _avg_minor_pause->padded_average(), - _avg_major_pause->padded_average(), - _avg_minor_interval->average(), - _avg_major_interval->average(), - gc_pause_goal_sec()); - } + log_trace(gc, ergo)("Minor_pause: %f major_pause: %f minor_interval: %f major_interval: %fpause_goal: %f", + _avg_minor_pause->padded_average(), + _avg_major_pause->padded_average(), + _avg_minor_interval->average(), + _avg_major_interval->average(), + gc_pause_goal_sec()); - // Footprint stats - gclog_or_tty->print( " live_space: " SIZE_FORMAT - " free_space: " SIZE_FORMAT, - live_space(), free_space()); - // More detail - if (Verbose) { - gclog_or_tty->print( " base_footprint: " SIZE_FORMAT - " avg_young_live: " SIZE_FORMAT - " avg_old_live: " SIZE_FORMAT, - (size_t)_avg_base_footprint->average(), - (size_t)avg_young_live()->average(), - (size_t)avg_old_live()->average()); - } + log_debug(gc, ergo)("Live_space: " SIZE_FORMAT " free_space: " SIZE_FORMAT, + live_space(), free_space()); - // And finally, our old and new sizes. - gclog_or_tty->print(" old_eden_size: " SIZE_FORMAT - " desired_eden_size: " SIZE_FORMAT, - _eden_size, desired_eden_size); - gclog_or_tty->cr(); - } + log_trace(gc, ergo)("Base_footprint: " SIZE_FORMAT " avg_young_live: " SIZE_FORMAT " avg_old_live: " SIZE_FORMAT, + (size_t)_avg_base_footprint->average(), + (size_t)avg_young_live()->average(), + (size_t)avg_old_live()->average()); + + log_debug(gc, ergo)("Old eden_size: " SIZE_FORMAT " desired_eden_size: " SIZE_FORMAT, + _eden_size, desired_eden_size); set_eden_size(desired_eden_size); } @@ -564,27 +526,25 @@ void PSAdaptiveSizePolicy::compute_old_gen_free_space( // Note we make the same tests as in the code block below; the code // seems a little easier to read with the printing in another block. - if (PrintAdaptiveSizePolicy) { - if (desired_promo_size > promo_limit) { - // "free_in_old_gen" was the original value for used for promo_limit - size_t free_in_old_gen = (size_t)(max_old_gen_size - avg_old_live()->average()); - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::compute_old_gen_free_space limits:" - " desired_promo_size: " SIZE_FORMAT - " promo_limit: " SIZE_FORMAT - " free_in_old_gen: " SIZE_FORMAT - " max_old_gen_size: " SIZE_FORMAT - " avg_old_live: " SIZE_FORMAT, - desired_promo_size, promo_limit, free_in_old_gen, - max_old_gen_size, (size_t) avg_old_live()->average()); - } - if (gc_cost() > gc_cost_limit) { - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::compute_old_gen_free_space: gc time limit" - " gc_cost: %f " - " GCTimeLimit: " UINTX_FORMAT, - gc_cost(), GCTimeLimit); - } + if (desired_promo_size > promo_limit) { + // "free_in_old_gen" was the original value for used for promo_limit + size_t free_in_old_gen = (size_t)(max_old_gen_size - avg_old_live()->average()); + log_debug(gc, ergo)( + "PSAdaptiveSizePolicy::compute_old_gen_free_space limits:" + " desired_promo_size: " SIZE_FORMAT + " promo_limit: " SIZE_FORMAT + " free_in_old_gen: " SIZE_FORMAT + " max_old_gen_size: " SIZE_FORMAT + " avg_old_live: " SIZE_FORMAT, + desired_promo_size, promo_limit, free_in_old_gen, + max_old_gen_size, (size_t) avg_old_live()->average()); + } + if (gc_cost() > gc_cost_limit) { + log_debug(gc, ergo)( + "PSAdaptiveSizePolicy::compute_old_gen_free_space: gc time limit" + " gc_cost: %f " + " GCTimeLimit: " UINTX_FORMAT, + gc_cost(), GCTimeLimit); } // Align everything and make a final limit check @@ -596,51 +556,28 @@ void PSAdaptiveSizePolicy::compute_old_gen_free_space( // And one last limit check, now that we've aligned things. desired_promo_size = MIN2(desired_promo_size, promo_limit); - if (PrintAdaptiveSizePolicy) { - // Timing stats - gclog_or_tty->print( - "PSAdaptiveSizePolicy::compute_old_gen_free_space: costs" - " minor_time: %f" - " major_cost: %f" - " mutator_cost: %f" - " throughput_goal: %f", - minor_gc_cost(), major_gc_cost(), mutator_cost(), - _throughput_goal); + // Timing stats + log_debug(gc, ergo)("PSAdaptiveSizePolicy::compute_old_gen_free_space: costs minor_time: %f major_cost: %f mutator_cost: %f throughput_goal: %f", + minor_gc_cost(), major_gc_cost(), mutator_cost(), _throughput_goal); - // We give more details if Verbose is set - if (Verbose) { - gclog_or_tty->print( " minor_pause: %f" - " major_pause: %f" - " minor_interval: %f" - " major_interval: %f" - " pause_goal: %f", - _avg_minor_pause->padded_average(), - _avg_major_pause->padded_average(), - _avg_minor_interval->average(), - _avg_major_interval->average(), - gc_pause_goal_sec()); - } + log_trace(gc, ergo)("Minor_pause: %f major_pause: %f minor_interval: %f major_interval: %f pause_goal: %f", + _avg_minor_pause->padded_average(), + _avg_major_pause->padded_average(), + _avg_minor_interval->average(), + _avg_major_interval->average(), + gc_pause_goal_sec()); - // Footprint stats - gclog_or_tty->print( " live_space: " SIZE_FORMAT - " free_space: " SIZE_FORMAT, - live_space(), free_space()); - // More detail - if (Verbose) { - gclog_or_tty->print( " base_footprint: " SIZE_FORMAT - " avg_young_live: " SIZE_FORMAT - " avg_old_live: " SIZE_FORMAT, - (size_t)_avg_base_footprint->average(), - (size_t)avg_young_live()->average(), - (size_t)avg_old_live()->average()); - } + // Footprint stats + log_debug(gc, ergo)("Live_space: " SIZE_FORMAT " free_space: " SIZE_FORMAT, + live_space(), free_space()); - // And finally, our old and new sizes. - gclog_or_tty->print(" old_promo_size: " SIZE_FORMAT - " desired_promo_size: " SIZE_FORMAT, - _promo_size, desired_promo_size); - gclog_or_tty->cr(); - } + log_trace(gc, ergo)("Base_footprint: " SIZE_FORMAT " avg_young_live: " SIZE_FORMAT " avg_old_live: " SIZE_FORMAT, + (size_t)_avg_base_footprint->average(), + (size_t)avg_young_live()->average(), + (size_t)avg_old_live()->average()); + + log_debug(gc, ergo)("Old promo_size: " SIZE_FORMAT " desired_promo_size: " SIZE_FORMAT, + _promo_size, desired_promo_size); set_promo_size(desired_promo_size); } @@ -719,14 +656,12 @@ void PSAdaptiveSizePolicy::adjust_promo_for_pause_time(bool is_full_gc, } } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::adjust_promo_for_pause_time " - "adjusting gen sizes for major pause (avg %f goal %f). " - "desired_promo_size " SIZE_FORMAT " promo delta " SIZE_FORMAT, - _avg_major_pause->average(), gc_pause_goal_sec(), - *desired_promo_size_ptr, promo_heap_delta); - } + log_trace(gc, ergo)( + "PSAdaptiveSizePolicy::adjust_promo_for_pause_time " + "adjusting gen sizes for major pause (avg %f goal %f). " + "desired_promo_size " SIZE_FORMAT " promo delta " SIZE_FORMAT, + _avg_major_pause->average(), gc_pause_goal_sec(), + *desired_promo_size_ptr, promo_heap_delta); } void PSAdaptiveSizePolicy::adjust_eden_for_pause_time(bool is_full_gc, @@ -740,14 +675,12 @@ void PSAdaptiveSizePolicy::adjust_eden_for_pause_time(bool is_full_gc, if (_avg_minor_pause->padded_average() > _avg_major_pause->padded_average()) { adjust_eden_for_minor_pause_time(is_full_gc, desired_eden_size_ptr); } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::adjust_eden_for_pause_time " - "adjusting gen sizes for major pause (avg %f goal %f). " - "desired_eden_size " SIZE_FORMAT " eden delta " SIZE_FORMAT, - _avg_major_pause->average(), gc_pause_goal_sec(), - *desired_eden_size_ptr, eden_heap_delta); - } + log_trace(gc, ergo)( + "PSAdaptiveSizePolicy::adjust_eden_for_pause_time " + "adjusting gen sizes for major pause (avg %f goal %f). " + "desired_eden_size " SIZE_FORMAT " eden delta " SIZE_FORMAT, + _avg_major_pause->average(), gc_pause_goal_sec(), + *desired_eden_size_ptr, eden_heap_delta); } void PSAdaptiveSizePolicy::adjust_promo_for_throughput(bool is_full_gc, @@ -761,13 +694,8 @@ void PSAdaptiveSizePolicy::adjust_promo_for_throughput(bool is_full_gc, return; } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print("\nPSAdaptiveSizePolicy::adjust_promo_for_throughput(" - "is_full: %d, promo: " SIZE_FORMAT "): ", - is_full_gc, *desired_promo_size_ptr); - gclog_or_tty->print_cr("mutator_cost %f major_gc_cost %f " - "minor_gc_cost %f", mutator_cost(), major_gc_cost(), minor_gc_cost()); - } + log_trace(gc, ergo)("PSAdaptiveSizePolicy::adjust_promo_for_throughput(is_full: %d, promo: " SIZE_FORMAT "): mutator_cost %f major_gc_cost %f minor_gc_cost %f", + is_full_gc, *desired_promo_size_ptr, mutator_cost(), major_gc_cost(), minor_gc_cost()); // Tenured generation if (is_full_gc) { @@ -780,12 +708,8 @@ void PSAdaptiveSizePolicy::adjust_promo_for_throughput(bool is_full_gc, double scale_by_ratio = major_gc_cost() / gc_cost(); scaled_promo_heap_delta = (size_t) (scale_by_ratio * (double) promo_heap_delta); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "Scaled tenured increment: " SIZE_FORMAT " by %f down to " - SIZE_FORMAT, - promo_heap_delta, scale_by_ratio, scaled_promo_heap_delta); - } + log_trace(gc, ergo)("Scaled tenured increment: " SIZE_FORMAT " by %f down to " SIZE_FORMAT, + promo_heap_delta, scale_by_ratio, scaled_promo_heap_delta); } else if (major_gc_cost() >= 0.0) { // Scaling is not going to work. If the major gc time is the // larger, give it a full increment. @@ -839,13 +763,10 @@ void PSAdaptiveSizePolicy::adjust_promo_for_throughput(bool is_full_gc, _old_gen_change_for_major_throughput++; } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "adjusting tenured gen for throughput (avg %f goal %f). " - "desired_promo_size " SIZE_FORMAT " promo_delta " SIZE_FORMAT , - mutator_cost(), _throughput_goal, - *desired_promo_size_ptr, scaled_promo_heap_delta); - } + log_trace(gc, ergo)("Adjusting tenured gen for throughput (avg %f goal %f). desired_promo_size " SIZE_FORMAT " promo_delta " SIZE_FORMAT , + mutator_cost(), + _throughput_goal, + *desired_promo_size_ptr, scaled_promo_heap_delta); } } @@ -860,13 +781,8 @@ void PSAdaptiveSizePolicy::adjust_eden_for_throughput(bool is_full_gc, return; } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print("\nPSAdaptiveSizePolicy::adjust_eden_for_throughput(" - "is_full: %d, cur_eden: " SIZE_FORMAT "): ", - is_full_gc, *desired_eden_size_ptr); - gclog_or_tty->print_cr("mutator_cost %f major_gc_cost %f " - "minor_gc_cost %f", mutator_cost(), major_gc_cost(), minor_gc_cost()); - } + log_trace(gc, ergo)("PSAdaptiveSizePolicy::adjust_eden_for_throughput(is_full: %d, cur_eden: " SIZE_FORMAT "): mutator_cost %f major_gc_cost %f minor_gc_cost %f", + is_full_gc, *desired_eden_size_ptr, mutator_cost(), major_gc_cost(), minor_gc_cost()); // Young generation size_t scaled_eden_heap_delta = 0; @@ -878,12 +794,8 @@ void PSAdaptiveSizePolicy::adjust_eden_for_throughput(bool is_full_gc, assert(scale_by_ratio <= 1.0 && scale_by_ratio >= 0.0, "Scaling is wrong"); scaled_eden_heap_delta = (size_t) (scale_by_ratio * (double) eden_heap_delta); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "Scaled eden increment: " SIZE_FORMAT " by %f down to " - SIZE_FORMAT, - eden_heap_delta, scale_by_ratio, scaled_eden_heap_delta); - } + log_trace(gc, ergo)("Scaled eden increment: " SIZE_FORMAT " by %f down to " SIZE_FORMAT, + eden_heap_delta, scale_by_ratio, scaled_eden_heap_delta); } else if (minor_gc_cost() >= 0.0) { // Scaling is not going to work. If the minor gc time is the // larger, give it a full increment. @@ -936,13 +848,8 @@ void PSAdaptiveSizePolicy::adjust_eden_for_throughput(bool is_full_gc, _young_gen_change_for_minor_throughput++; } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "adjusting eden for throughput (avg %f goal %f). desired_eden_size " - SIZE_FORMAT " eden delta " SIZE_FORMAT "\n", - mutator_cost(), _throughput_goal, - *desired_eden_size_ptr, scaled_eden_heap_delta); - } + log_trace(gc, ergo)("Adjusting eden for throughput (avg %f goal %f). desired_eden_size " SIZE_FORMAT " eden delta " SIZE_FORMAT, + mutator_cost(), _throughput_goal, *desired_eden_size_ptr, scaled_eden_heap_delta); } size_t PSAdaptiveSizePolicy::adjust_promo_for_footprint( @@ -955,15 +862,13 @@ size_t PSAdaptiveSizePolicy::adjust_promo_for_footprint( size_t reduced_size = desired_promo_size - change; - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "AdaptiveSizePolicy::adjust_promo_for_footprint " - "adjusting tenured gen for footprint. " - "starting promo size " SIZE_FORMAT - " reduced promo size " SIZE_FORMAT - " promo delta " SIZE_FORMAT, - desired_promo_size, reduced_size, change ); - } + log_trace(gc, ergo)( + "AdaptiveSizePolicy::adjust_promo_for_footprint " + "adjusting tenured gen for footprint. " + "starting promo size " SIZE_FORMAT + " reduced promo size " SIZE_FORMAT + " promo delta " SIZE_FORMAT, + desired_promo_size, reduced_size, change ); assert(reduced_size <= desired_promo_size, "Inconsistent result"); return reduced_size; @@ -979,15 +884,13 @@ size_t PSAdaptiveSizePolicy::adjust_eden_for_footprint( size_t reduced_size = desired_eden_size - change; - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "AdaptiveSizePolicy::adjust_eden_for_footprint " - "adjusting eden for footprint. " - " starting eden size " SIZE_FORMAT - " reduced eden size " SIZE_FORMAT - " eden delta " SIZE_FORMAT, - desired_eden_size, reduced_size, change); - } + log_trace(gc, ergo)( + "AdaptiveSizePolicy::adjust_eden_for_footprint " + "adjusting eden for footprint. " + " starting eden size " SIZE_FORMAT + " reduced eden size " SIZE_FORMAT + " eden delta " SIZE_FORMAT, + desired_eden_size, reduced_size, change); assert(reduced_size <= desired_eden_size, "Inconsistent result"); return reduced_size; @@ -1187,33 +1090,14 @@ uint PSAdaptiveSizePolicy::compute_survivor_space_size_and_threshold( // the amount of old gen free space is less than what we expect to // promote). - if (PrintAdaptiveSizePolicy) { - // A little more detail if Verbose is on - if (Verbose) { - gclog_or_tty->print( " avg_survived: %f" - " avg_deviation: %f", - _avg_survived->average(), - _avg_survived->deviation()); - } + log_trace(gc, ergo)("avg_survived: %f avg_deviation: %f", _avg_survived->average(), _avg_survived->deviation()); + log_debug(gc, ergo)("avg_survived_padded_avg: %f", _avg_survived->padded_average()); - gclog_or_tty->print( " avg_survived_padded_avg: %f", - _avg_survived->padded_average()); - - if (Verbose) { - gclog_or_tty->print( " avg_promoted_avg: %f" - " avg_promoted_dev: %f", - avg_promoted()->average(), - avg_promoted()->deviation()); - } - - gclog_or_tty->print_cr( " avg_promoted_padded_avg: %f" - " avg_pretenured_padded_avg: %f" - " tenuring_thresh: %d" - " target_size: " SIZE_FORMAT, - avg_promoted()->padded_average(), - _avg_pretenured->padded_average(), - tenuring_threshold, target_size); - } + log_trace(gc, ergo)("avg_promoted_avg: %f avg_promoted_dev: %f", avg_promoted()->average(), avg_promoted()->deviation()); + log_debug(gc, ergo)("avg_promoted_padded_avg: %f avg_pretenured_padded_avg: %f tenuring_thresh: %d target_size: " SIZE_FORMAT, + avg_promoted()->padded_average(), + _avg_pretenured->padded_average(), + tenuring_threshold, target_size); set_survivor_size(target_size); @@ -1233,24 +1117,22 @@ void PSAdaptiveSizePolicy::update_averages(bool is_survivor_overflow, } avg_promoted()->sample(promoted); - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print_cr( - "AdaptiveSizePolicy::update_averages:" - " survived: " SIZE_FORMAT - " promoted: " SIZE_FORMAT - " overflow: %s", - survived, promoted, is_survivor_overflow ? "true" : "false"); - } + log_trace(gc, ergo)("AdaptiveSizePolicy::update_averages: survived: " SIZE_FORMAT " promoted: " SIZE_FORMAT " overflow: %s", + survived, promoted, is_survivor_overflow ? "true" : "false"); } -bool PSAdaptiveSizePolicy::print_adaptive_size_policy_on(outputStream* st) - const { +bool PSAdaptiveSizePolicy::print() const { - if (!UseAdaptiveSizePolicy) return false; + if (!UseAdaptiveSizePolicy) { + return false; + } - return AdaptiveSizePolicy::print_adaptive_size_policy_on( - st, - PSScavenge::tenuring_threshold()); + if (AdaptiveSizePolicy::print()) { + AdaptiveSizePolicy::print_tenuring_threshold(PSScavenge::tenuring_threshold()); + return true; + } + + return false; } #ifndef PRODUCT diff --git a/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.hpp b/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.hpp index 2d3899c878c..5f5306e1da7 100644 --- a/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.hpp +++ b/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.hpp @@ -395,7 +395,7 @@ class PSAdaptiveSizePolicy : public AdaptiveSizePolicy { size_t promoted); // Printing support - virtual bool print_adaptive_size_policy_on(outputStream* st) const; + virtual bool print() const; // Decay the supplemental growth additive. void decay_supplemental_growth(bool is_full_gc); diff --git a/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp b/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp index 1047e0bbc7f..261098b0c49 100644 --- a/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp +++ b/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp @@ -32,6 +32,7 @@ #include "gc/parallel/psOldGen.hpp" #include "gc/parallel/psParallelCompact.inline.hpp" #include "gc/shared/taskqueue.inline.hpp" +#include "logging/log.hpp" #include "memory/iterator.inline.hpp" #include "oops/instanceKlass.inline.hpp" #include "oops/instanceMirrorKlass.inline.hpp" @@ -229,30 +230,18 @@ template static void oop_pc_follow_contents_specialized(InstanceRefKlass* klass, oop obj, ParCompactionManager* cm) { T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); T heap_oop = oopDesc::load_heap_oop(referent_addr); - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("InstanceRefKlass::oop_pc_follow_contents " PTR_FORMAT, p2i(obj)); - } - ) + log_develop_trace(gc, ref)("InstanceRefKlass::oop_pc_follow_contents " PTR_FORMAT, p2i(obj)); if (!oopDesc::is_null(heap_oop)) { oop referent = oopDesc::decode_heap_oop_not_null(heap_oop); if (PSParallelCompact::mark_bitmap()->is_unmarked(referent) && PSParallelCompact::ref_processor()->discover_reference(obj, klass->reference_type())) { // reference already enqueued, referent will be traversed later klass->InstanceKlass::oop_pc_follow_contents(obj, cm); - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Non NULL enqueued " PTR_FORMAT, p2i(obj)); - } - ) + log_develop_trace(gc, ref)(" Non NULL enqueued " PTR_FORMAT, p2i(obj)); return; } else { // treat referent as normal oop - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Non NULL normal " PTR_FORMAT, p2i(obj)); - } - ) + log_develop_trace(gc, ref)(" Non NULL normal " PTR_FORMAT, p2i(obj)); cm->mark_and_push(referent_addr); } } @@ -262,12 +251,7 @@ static void oop_pc_follow_contents_specialized(InstanceRefKlass* klass, oop obj, T next_oop = oopDesc::load_heap_oop(next_addr); if (!oopDesc::is_null(next_oop)) { // i.e. ref is not "active" T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Process discovered as normal " - PTR_FORMAT, p2i(discovered_addr)); - } - ) + log_develop_trace(gc, ref)(" Process discovered as normal " PTR_FORMAT, p2i(discovered_addr)); cm->mark_and_push(discovered_addr); } cm->mark_and_push(next_addr); diff --git a/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp b/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp index d860fe9b728..75fed6c0c40 100644 --- a/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp +++ b/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp @@ -41,11 +41,12 @@ #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/fprofiler.hpp" @@ -137,8 +138,6 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { // We need to track unique mark sweep invocations as well. _total_invocations++; - AdaptiveSizePolicyOutput(size_policy, heap->total_collections()); - heap->print_heap_before_gc(); heap->trace_heap_before_gc(_gc_tracer); @@ -148,7 +147,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyBeforeGC:"); + Universe::verify("Before GC"); } // Verify object start arrays @@ -167,8 +166,8 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { { HandleMark hm; - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL); + GCTraceCPUTime tcpu; + GCTraceTime(Info, gc) t("Pause Full", NULL, gc_cause, true); TraceCollectorStats tcs(counters()); TraceMemoryManagerStats tms(true /* Full GC */,gc_cause); @@ -180,13 +179,9 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { CodeCache::gc_prologue(); BiasedLocking::preserve_marks(); - // Capture heap size before collection for printing. - size_t prev_used = heap->used(); - // Capture metadata size before collection for sizing. size_t metadata_prev_used = MetaspaceAux::used_bytes(); - // For PrintGCDetails size_t old_gen_prev_used = old_gen->used_in_bytes(); size_t young_gen_prev_used = young_gen->used_in_bytes(); @@ -266,17 +261,9 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { if (UseAdaptiveSizePolicy) { - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print("AdaptiveSizeStart: "); - gclog_or_tty->stamp(); - gclog_or_tty->print_cr(" collection: %d ", - heap->total_collections()); - if (Verbose) { - gclog_or_tty->print("old_gen_capacity: " SIZE_FORMAT - " young_gen_capacity: " SIZE_FORMAT, - old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes()); - } - } + log_debug(gc, ergo)("AdaptiveSizeStart: collection: %d ", heap->total_collections()); + log_trace(gc, ergo)("old_gen_capacity: " SIZE_FORMAT " young_gen_capacity: " SIZE_FORMAT, + old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes()); // Don't check if the size_policy is ready here. Let // the size_policy check that internally. @@ -333,10 +320,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(), size_policy->calculated_survivor_size_in_bytes()); } - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ", - heap->total_collections()); - } + log_debug(gc, ergo)("AdaptiveSizeStop: collection: %d ", heap->total_collections()); } if (UsePerfData) { @@ -354,18 +338,9 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { if (TraceOldGenTime) accumulated_time()->stop(); - if (PrintGC) { - if (PrintGCDetails) { - // Don't print a GC timestamp here. This is after the GC so - // would be confusing. - young_gen->print_used_change(young_gen_prev_used); - old_gen->print_used_change(old_gen_prev_used); - } - heap->print_heap_change(prev_used); - if (PrintGCDetails) { - MetaspaceAux::print_metaspace_change(metadata_prev_used); - } - } + young_gen->print_used_change(young_gen_prev_used); + old_gen->print_used_change(old_gen_prev_used); + MetaspaceAux::print_metaspace_change(metadata_prev_used); // Track memory usage and detect low memory MemoryService::track_memory_usage(); @@ -374,7 +349,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyAfterGC:"); + Universe::verify("After GC"); } // Re-verify object start arrays @@ -398,6 +373,8 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { ParallelTaskTerminator::print_termination_counts(); #endif + AdaptiveSizePolicyOutput::print(size_policy, heap->total_collections()); + _gc_timer->register_gc_end(); _gc_tracer->report_gc_end(_gc_timer->gc_end(), _gc_timer->time_partitions()); @@ -443,8 +420,7 @@ bool PSMarkSweep::absorb_live_data_from_eden(PSAdaptiveSizePolicy* size_policy, return false; // Respect young gen minimum size. } - if (TraceAdaptiveGCBoundary && Verbose) { - gclog_or_tty->print(" absorbing " SIZE_FORMAT "K: " + log_trace(heap, ergo)(" absorbing " SIZE_FORMAT "K: " "eden " SIZE_FORMAT "K->" SIZE_FORMAT "K " "from " SIZE_FORMAT "K, to " SIZE_FORMAT "K " "young_gen " SIZE_FORMAT "K->" SIZE_FORMAT "K ", @@ -453,7 +429,6 @@ bool PSMarkSweep::absorb_live_data_from_eden(PSAdaptiveSizePolicy* size_policy, young_gen->from_space()->used_in_bytes() / K, young_gen->to_space()->used_in_bytes() / K, young_gen->capacity_in_bytes() / K, new_young_size / K); - } // Fill the unused part of the old gen. MutableSpace* const old_space = old_gen->object_space(); @@ -517,7 +492,7 @@ void PSMarkSweep::deallocate_stacks() { void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { // Recursively traverse all live objects and mark them - GCTraceTime tm("phase 1", PrintGCDetails && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 1: Mark live objects", _gc_timer); ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); @@ -576,7 +551,7 @@ void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { void PSMarkSweep::mark_sweep_phase2() { - GCTraceTime tm("phase 2", PrintGCDetails && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 2: Compute new object addresses", _gc_timer); // Now all live objects are marked, compute the new object addresses. @@ -603,7 +578,7 @@ static PSAlwaysTrueClosure always_true; void PSMarkSweep::mark_sweep_phase3() { // Adjust the pointers to reflect the new locations - GCTraceTime tm("phase 3", PrintGCDetails && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 3: Adjust pointers", _gc_timer); ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSYoungGen* young_gen = heap->young_gen(); @@ -643,7 +618,7 @@ void PSMarkSweep::mark_sweep_phase3() { void PSMarkSweep::mark_sweep_phase4() { EventMark m("4 compact heap"); - GCTraceTime tm("phase 4", PrintGCDetails && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 4: Move objects", _gc_timer); // All pointers are now adjusted, move objects accordingly diff --git a/hotspot/src/share/vm/gc/parallel/psOldGen.cpp b/hotspot/src/share/vm/gc/parallel/psOldGen.cpp index ee47f5e43d8..42160922637 100644 --- a/hotspot/src/share/vm/gc/parallel/psOldGen.cpp +++ b/hotspot/src/share/vm/gc/parallel/psOldGen.cpp @@ -30,6 +30,7 @@ #include "gc/shared/cardTableModRefBS.hpp" #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" @@ -256,10 +257,8 @@ void PSOldGen::expand(size_t bytes) { success = expand_to_reserved(); } - if (PrintGC && Verbose) { - if (success && GC_locker::is_active_and_needs_gc()) { - gclog_or_tty->print_cr("Garbage collection disabled, expanded heap instead"); - } + if (success && GC_locker::is_active_and_needs_gc()) { + log_debug(gc)("Garbage collection disabled, expanded heap instead"); } } @@ -291,13 +290,11 @@ bool PSOldGen::expand_by(size_t bytes) { } } - if (result && Verbose && PrintGC) { + if (result) { size_t new_mem_size = virtual_space()->committed_size(); size_t old_mem_size = new_mem_size - bytes; - gclog_or_tty->print_cr("Expanding %s from " SIZE_FORMAT "K by " - SIZE_FORMAT "K to " - SIZE_FORMAT "K", - name(), old_mem_size/K, bytes/K, new_mem_size/K); + log_debug(gc)("Expanding %s from " SIZE_FORMAT "K by " SIZE_FORMAT "K to " SIZE_FORMAT "K", + name(), old_mem_size/K, bytes/K, new_mem_size/K); } return result; @@ -326,14 +323,10 @@ void PSOldGen::shrink(size_t bytes) { virtual_space()->shrink_by(bytes); post_resize(); - if (Verbose && PrintGC) { - size_t new_mem_size = virtual_space()->committed_size(); - size_t old_mem_size = new_mem_size + bytes; - gclog_or_tty->print_cr("Shrinking %s from " SIZE_FORMAT "K by " - SIZE_FORMAT "K to " - SIZE_FORMAT "K", - name(), old_mem_size/K, bytes/K, new_mem_size/K); - } + size_t new_mem_size = virtual_space()->committed_size(); + size_t old_mem_size = new_mem_size + bytes; + log_debug(gc)("Shrinking %s from " SIZE_FORMAT "K by " SIZE_FORMAT "K to " SIZE_FORMAT "K", + name(), old_mem_size/K, bytes/K, new_mem_size/K); } } @@ -353,14 +346,12 @@ void PSOldGen::resize(size_t desired_free_space) { const size_t current_size = capacity_in_bytes(); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr("AdaptiveSizePolicy::old generation size: " - "desired free: " SIZE_FORMAT " used: " SIZE_FORMAT - " new size: " SIZE_FORMAT " current size " SIZE_FORMAT - " gen limits: " SIZE_FORMAT " / " SIZE_FORMAT, - desired_free_space, used_in_bytes(), new_size, current_size, - gen_size_limit(), min_gen_size()); - } + log_trace(gc, ergo)("AdaptiveSizePolicy::old generation size: " + "desired free: " SIZE_FORMAT " used: " SIZE_FORMAT + " new size: " SIZE_FORMAT " current size " SIZE_FORMAT + " gen limits: " SIZE_FORMAT " / " SIZE_FORMAT, + desired_free_space, used_in_bytes(), new_size, current_size, + gen_size_limit(), min_gen_size()); if (new_size == current_size) { // No change requested @@ -376,14 +367,10 @@ void PSOldGen::resize(size_t desired_free_space) { shrink(change_bytes); } - if (PrintAdaptiveSizePolicy) { - ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); - gclog_or_tty->print_cr("AdaptiveSizePolicy::old generation size: " - "collection: %d " - "(" SIZE_FORMAT ") -> (" SIZE_FORMAT ") ", - heap->total_collections(), - size_before, virtual_space()->committed_size()); - } + log_trace(gc, ergo)("AdaptiveSizePolicy::old generation size: collection: %d (" SIZE_FORMAT ") -> (" SIZE_FORMAT ") ", + ParallelScavengeHeap::heap()->total_collections(), + size_before, + virtual_space()->committed_size()); } // NOTE! We need to be careful about resizing. During a GC, multiple @@ -430,13 +417,8 @@ size_t PSOldGen::available_for_contraction() { void PSOldGen::print() const { print_on(tty);} void PSOldGen::print_on(outputStream* st) const { st->print(" %-15s", name()); - if (PrintGCDetails && Verbose) { - st->print(" total " SIZE_FORMAT ", used " SIZE_FORMAT, - capacity_in_bytes(), used_in_bytes()); - } else { - st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", - capacity_in_bytes()/K, used_in_bytes()/K); - } + st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", + capacity_in_bytes()/K, used_in_bytes()/K); st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", p2i(virtual_space()->low_boundary()), p2i(virtual_space()->high()), @@ -446,13 +428,8 @@ void PSOldGen::print_on(outputStream* st) const { } void PSOldGen::print_used_change(size_t prev_used) const { - gclog_or_tty->print(" [%s:", name()); - gclog_or_tty->print(" " SIZE_FORMAT "K" - "->" SIZE_FORMAT "K" - "(" SIZE_FORMAT "K)", - prev_used / K, used_in_bytes() / K, - capacity_in_bytes() / K); - gclog_or_tty->print("]"); + log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + name(), prev_used / K, used_in_bytes() / K, capacity_in_bytes() / K); } void PSOldGen::update_counters() { diff --git a/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp b/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp index 35de7fc5909..2e5e266a4fd 100644 --- a/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp @@ -45,11 +45,12 @@ #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "logging/log.hpp" #include "oops/instanceKlass.inline.hpp" #include "oops/instanceMirrorKlass.inline.hpp" #include "oops/methodData.hpp" @@ -107,7 +108,6 @@ const ParallelCompactData::RegionData::region_sz_t ParallelCompactData::RegionData::dc_completed = 0xcU << dc_shift; SpaceInfo PSParallelCompact::_space_info[PSParallelCompact::last_space_id]; -bool PSParallelCompact::_print_phases = false; ReferenceProcessor* PSParallelCompact::_ref_processor = NULL; @@ -194,21 +194,26 @@ const char* PSParallelCompact::space_names[] = { "old ", "eden", "from", "to " }; -void PSParallelCompact::print_region_ranges() -{ - tty->print_cr("space bottom top end new_top"); - tty->print_cr("------ ---------- ---------- ---------- ----------"); +void PSParallelCompact::print_region_ranges() { + if (!develop_log_is_enabled(Trace, gc, compaction, phases)) { + return; + } + LogHandle(gc, compaction, phases) log; + ResourceMark rm; + Universe::print_on(log.trace_stream()); + log.trace("space bottom top end new_top"); + log.trace("------ ---------- ---------- ---------- ----------"); for (unsigned int id = 0; id < last_space_id; ++id) { const MutableSpace* space = _space_info[id].space(); - tty->print_cr("%u %s " - SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) " " - SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) " ", - id, space_names[id], - summary_data().addr_to_region_idx(space->bottom()), - summary_data().addr_to_region_idx(space->top()), - summary_data().addr_to_region_idx(space->end()), - summary_data().addr_to_region_idx(_space_info[id].new_top())); + log.trace("%u %s " + SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) " " + SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) " ", + id, space_names[id], + summary_data().addr_to_region_idx(space->bottom()), + summary_data().addr_to_region_idx(space->top()), + summary_data().addr_to_region_idx(space->end()), + summary_data().addr_to_region_idx(_space_info[id].new_top())); } } @@ -220,13 +225,14 @@ print_generic_summary_region(size_t i, const ParallelCompactData::RegionData* c) ParallelCompactData& sd = PSParallelCompact::summary_data(); size_t dci = c->destination() ? sd.addr_to_region_idx(c->destination()) : 0; - tty->print_cr(REGION_IDX_FORMAT " " PTR_FORMAT " " - REGION_IDX_FORMAT " " PTR_FORMAT " " - REGION_DATA_FORMAT " " REGION_DATA_FORMAT " " - REGION_DATA_FORMAT " " REGION_IDX_FORMAT " %d", - i, p2i(c->data_location()), dci, p2i(c->destination()), - c->partial_obj_size(), c->live_obj_size(), - c->data_size(), c->source_region(), c->destination_count()); + log_develop_trace(gc, compaction, phases)( + REGION_IDX_FORMAT " " PTR_FORMAT " " + REGION_IDX_FORMAT " " PTR_FORMAT " " + REGION_DATA_FORMAT " " REGION_DATA_FORMAT " " + REGION_DATA_FORMAT " " REGION_IDX_FORMAT " %d", + i, p2i(c->data_location()), dci, p2i(c->destination()), + c->partial_obj_size(), c->live_obj_size(), + c->data_size(), c->source_region(), c->destination_count()); #undef REGION_IDX_FORMAT #undef REGION_DATA_FORMAT @@ -252,13 +258,17 @@ print_generic_summary_data(ParallelCompactData& summary_data, ++i; } - tty->print_cr("summary_data_bytes=" SIZE_FORMAT, total_words * HeapWordSize); + log_develop_trace(gc, compaction, phases)("summary_data_bytes=" SIZE_FORMAT, total_words * HeapWordSize); } void print_generic_summary_data(ParallelCompactData& summary_data, SpaceInfo* space_info) { + if (!develop_log_is_enabled(Trace, gc, compaction, phases)) { + return; + } + for (unsigned int id = 0; id < PSParallelCompact::last_space_id; ++id) { const MutableSpace* space = space_info[id].space(); print_generic_summary_data(summary_data, space->bottom(), @@ -266,20 +276,6 @@ print_generic_summary_data(ParallelCompactData& summary_data, } } -void -print_initial_summary_region(size_t i, - const ParallelCompactData::RegionData* c, - bool newline = true) -{ - tty->print(SIZE_FORMAT_W(5) " " PTR_FORMAT " " - SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " - SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " %d", - i, p2i(c->destination()), - c->partial_obj_size(), c->live_obj_size(), - c->data_size(), c->source_region(), c->destination_count()); - if (newline) tty->cr(); -} - void print_initial_summary_data(ParallelCompactData& summary_data, const MutableSpace* space) { @@ -299,7 +295,12 @@ print_initial_summary_data(ParallelCompactData& summary_data, size_t full_region_count = 0; size_t i = summary_data.addr_to_region_idx(space->bottom()); while (i < end_region && summary_data.region(i)->data_size() == region_size) { - print_initial_summary_region(i, summary_data.region(i)); + ParallelCompactData::RegionData* c = summary_data.region(i); + log_develop_trace(gc, compaction, phases)( + SIZE_FORMAT_W(5) " " PTR_FORMAT " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " %d", + i, p2i(c->destination()), + c->partial_obj_size(), c->live_obj_size(), + c->data_size(), c->source_region(), c->destination_count()); ++full_region_count; ++i; } @@ -328,9 +329,15 @@ print_initial_summary_data(ParallelCompactData& summary_data, max_live_to_right = live_to_right; } - print_initial_summary_region(i, c, false); - tty->print_cr(" %12.10f " SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10), - reclaimed_ratio, dead_to_right, live_to_right); + ParallelCompactData::RegionData* c = summary_data.region(i); + log_develop_trace(gc, compaction, phases)( + SIZE_FORMAT_W(5) " " PTR_FORMAT " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " %d" + "%12.10f " SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10), + i, p2i(c->destination()), + c->partial_obj_size(), c->live_obj_size(), + c->data_size(), c->source_region(), c->destination_count(), + reclaimed_ratio, dead_to_right, live_to_right); + live_to_right -= c->data_size(); ++i; @@ -338,18 +345,25 @@ print_initial_summary_data(ParallelCompactData& summary_data, // Any remaining regions are empty. Print one more if there is one. if (i < end_region) { - print_initial_summary_region(i, summary_data.region(i)); + ParallelCompactData::RegionData* c = summary_data.region(i); + log_develop_trace(gc, compaction, phases)( + SIZE_FORMAT_W(5) " " PTR_FORMAT " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " %d", + i, p2i(c->destination()), + c->partial_obj_size(), c->live_obj_size(), + c->data_size(), c->source_region(), c->destination_count()); } - tty->print_cr("max: " SIZE_FORMAT_W(4) " d2r=" SIZE_FORMAT_W(10) " " - "l2r=" SIZE_FORMAT_W(10) " max_ratio=%14.12f", - max_reclaimed_ratio_region, max_dead_to_right, - max_live_to_right, max_reclaimed_ratio); + log_develop_trace(gc, compaction, phases)("max: " SIZE_FORMAT_W(4) " d2r=" SIZE_FORMAT_W(10) " l2r=" SIZE_FORMAT_W(10) " max_ratio=%14.12f", + max_reclaimed_ratio_region, max_dead_to_right, max_live_to_right, max_reclaimed_ratio); } void print_initial_summary_data(ParallelCompactData& summary_data, SpaceInfo* space_info) { + if (!develop_log_is_enabled(Trace, gc, compaction, phases)) { + return; + } + unsigned int id = PSParallelCompact::old_space_id; const MutableSpace* space; do { @@ -607,11 +621,7 @@ ParallelCompactData::summarize_split_space(size_t src_region, sr->partial_obj_size())); const size_t end_idx = addr_to_region_idx(target_end); - if (TraceParallelOldGCSummaryPhase) { - gclog_or_tty->print_cr("split: clearing source_region field in [" - SIZE_FORMAT ", " SIZE_FORMAT ")", - beg_idx, end_idx); - } + log_develop_trace(gc, compaction, phases)("split: clearing source_region field in [" SIZE_FORMAT ", " SIZE_FORMAT ")", beg_idx, end_idx); for (size_t idx = beg_idx; idx < end_idx; ++idx) { _region_data[idx].set_source_region(0); } @@ -631,27 +641,22 @@ ParallelCompactData::summarize_split_space(size_t src_region, *target_next = split_destination + partial_obj_size; HeapWord* const source_next = region_to_addr(split_region) + partial_obj_size; - if (TraceParallelOldGCSummaryPhase) { + if (develop_log_is_enabled(Trace, gc, compaction, phases)) { const char * split_type = partial_obj_size == 0 ? "easy" : "hard"; - gclog_or_tty->print_cr("%s split: src=" PTR_FORMAT " src_c=" SIZE_FORMAT - " pos=" SIZE_FORMAT, - split_type, p2i(source_next), split_region, - partial_obj_size); - gclog_or_tty->print_cr("%s split: dst=" PTR_FORMAT " dst_c=" SIZE_FORMAT - " tn=" PTR_FORMAT, - split_type, p2i(split_destination), - addr_to_region_idx(split_destination), - p2i(*target_next)); + log_develop_trace(gc, compaction, phases)("%s split: src=" PTR_FORMAT " src_c=" SIZE_FORMAT " pos=" SIZE_FORMAT, + split_type, p2i(source_next), split_region, partial_obj_size); + log_develop_trace(gc, compaction, phases)("%s split: dst=" PTR_FORMAT " dst_c=" SIZE_FORMAT " tn=" PTR_FORMAT, + split_type, p2i(split_destination), + addr_to_region_idx(split_destination), + p2i(*target_next)); if (partial_obj_size != 0) { HeapWord* const po_beg = split_info.destination(); HeapWord* const po_end = po_beg + split_info.partial_obj_size(); - gclog_or_tty->print_cr("%s split: " - "po_beg=" PTR_FORMAT " " SIZE_FORMAT " " - "po_end=" PTR_FORMAT " " SIZE_FORMAT, - split_type, - p2i(po_beg), addr_to_region_idx(po_beg), - p2i(po_end), addr_to_region_idx(po_end)); + log_develop_trace(gc, compaction, phases)("%s split: po_beg=" PTR_FORMAT " " SIZE_FORMAT " po_end=" PTR_FORMAT " " SIZE_FORMAT, + split_type, + p2i(po_beg), addr_to_region_idx(po_beg), + p2i(po_end), addr_to_region_idx(po_end)); } } @@ -664,13 +669,12 @@ bool ParallelCompactData::summarize(SplitInfo& split_info, HeapWord* target_beg, HeapWord* target_end, HeapWord** target_next) { - if (TraceParallelOldGCSummaryPhase) { - HeapWord* const source_next_val = source_next == NULL ? NULL : *source_next; - tty->print_cr("sb=" PTR_FORMAT " se=" PTR_FORMAT " sn=" PTR_FORMAT - "tb=" PTR_FORMAT " te=" PTR_FORMAT " tn=" PTR_FORMAT, - p2i(source_beg), p2i(source_end), p2i(source_next_val), - p2i(target_beg), p2i(target_end), p2i(*target_next)); - } + HeapWord* const source_next_val = source_next == NULL ? NULL : *source_next; + log_develop_trace(gc, compaction, phases)( + "sb=" PTR_FORMAT " se=" PTR_FORMAT " sn=" PTR_FORMAT + "tb=" PTR_FORMAT " te=" PTR_FORMAT " tn=" PTR_FORMAT, + p2i(source_beg), p2i(source_end), p2i(source_next_val), + p2i(target_beg), p2i(target_end), p2i(*target_next)); size_t cur_region = addr_to_region_idx(source_beg); const size_t end_region = addr_to_region_idx(region_align_up(source_end)); @@ -901,32 +905,6 @@ void PSParallelCompact::initialize_dead_wood_limiter() _dwl_adjustment = normal_distribution(1.0); } -// Simple class for storing info about the heap at the start of GC, to be used -// after GC for comparison/printing. -class PreGCValues { -public: - PreGCValues() { } - PreGCValues(ParallelScavengeHeap* heap) { fill(heap); } - - void fill(ParallelScavengeHeap* heap) { - _heap_used = heap->used(); - _young_gen_used = heap->young_gen()->used_in_bytes(); - _old_gen_used = heap->old_gen()->used_in_bytes(); - _metadata_used = MetaspaceAux::used_bytes(); - }; - - size_t heap_used() const { return _heap_used; } - size_t young_gen_used() const { return _young_gen_used; } - size_t old_gen_used() const { return _old_gen_used; } - size_t metadata_used() const { return _metadata_used; } - -private: - size_t _heap_used; - size_t _young_gen_used; - size_t _old_gen_used; - size_t _metadata_used; -}; - void PSParallelCompact::clear_data_covering_space(SpaceId id) { @@ -956,19 +934,17 @@ PSParallelCompact::clear_data_covering_space(SpaceId id) DEBUG_ONLY(split_info.verify_clear();) } -void PSParallelCompact::pre_compact(PreGCValues* pre_gc_values) +void PSParallelCompact::pre_compact() { // Update the from & to space pointers in space_info, since they are swapped // at each young gen gc. Do the update unconditionally (even though a // promotion failure does not swap spaces) because an unknown number of young // collections will have swapped the spaces an unknown number of times. - GCTraceTime tm("pre compact", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Pre Compact", &_gc_timer); ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); _space_info[from_space_id].set_space(heap->young_gen()->from_space()); _space_info[to_space_id].set_space(heap->young_gen()->to_space()); - pre_gc_values->fill(heap); - DEBUG_ONLY(add_obj_count = add_obj_size = 0;) DEBUG_ONLY(mark_bitmap_count = mark_bitmap_size = 0;) @@ -987,7 +963,7 @@ void PSParallelCompact::pre_compact(PreGCValues* pre_gc_values) if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyBeforeGC:"); + Universe::verify("Before GC"); } // Verify object start arrays @@ -1005,7 +981,7 @@ void PSParallelCompact::pre_compact(PreGCValues* pre_gc_values) void PSParallelCompact::post_compact() { - GCTraceTime tm("post compact", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Post Compact", &_gc_timer); for (unsigned int id = old_space_id; id < last_space_id; ++id) { // Clear the marking bitmap, summary data and split info. @@ -1559,7 +1535,7 @@ PSParallelCompact::summarize_space(SpaceId id, bool maximum_compaction) } } - if (TraceParallelOldGCSummaryPhase) { + if (develop_log_is_enabled(Trace, gc, compaction, phases)) { const size_t region_size = ParallelCompactData::RegionSize; HeapWord* const dense_prefix_end = _space_info[id].dense_prefix(); const size_t dp_region = _summary_data.addr_to_region_idx(dense_prefix_end); @@ -1567,12 +1543,13 @@ PSParallelCompact::summarize_space(SpaceId id, bool maximum_compaction) HeapWord* const new_top = _space_info[id].new_top(); const HeapWord* nt_aligned_up = _summary_data.region_align_up(new_top); const size_t cr_words = pointer_delta(nt_aligned_up, dense_prefix_end); - tty->print_cr("id=%d cap=" SIZE_FORMAT " dp=" PTR_FORMAT " " - "dp_region=" SIZE_FORMAT " " "dp_count=" SIZE_FORMAT " " - "cr_count=" SIZE_FORMAT " " "nt=" PTR_FORMAT, - id, space->capacity_in_words(), p2i(dense_prefix_end), - dp_region, dp_words / region_size, - cr_words / region_size, p2i(new_top)); + log_develop_trace(gc, compaction, phases)( + "id=%d cap=" SIZE_FORMAT " dp=" PTR_FORMAT " " + "dp_region=" SIZE_FORMAT " " "dp_count=" SIZE_FORMAT " " + "cr_count=" SIZE_FORMAT " " "nt=" PTR_FORMAT, + id, space->capacity_in_words(), p2i(dense_prefix_end), + dp_region, dp_words / region_size, + cr_words / region_size, p2i(new_top)); } } @@ -1582,29 +1559,27 @@ void PSParallelCompact::summary_phase_msg(SpaceId dst_space_id, SpaceId src_space_id, HeapWord* src_beg, HeapWord* src_end) { - if (TraceParallelOldGCSummaryPhase) { - tty->print_cr("summarizing %d [%s] into %d [%s]: " - "src=" PTR_FORMAT "-" PTR_FORMAT " " - SIZE_FORMAT "-" SIZE_FORMAT " " - "dst=" PTR_FORMAT "-" PTR_FORMAT " " - SIZE_FORMAT "-" SIZE_FORMAT, - src_space_id, space_names[src_space_id], - dst_space_id, space_names[dst_space_id], - p2i(src_beg), p2i(src_end), - _summary_data.addr_to_region_idx(src_beg), - _summary_data.addr_to_region_idx(src_end), - p2i(dst_beg), p2i(dst_end), - _summary_data.addr_to_region_idx(dst_beg), - _summary_data.addr_to_region_idx(dst_end)); - } + log_develop_trace(gc, compaction, phases)( + "Summarizing %d [%s] into %d [%s]: " + "src=" PTR_FORMAT "-" PTR_FORMAT " " + SIZE_FORMAT "-" SIZE_FORMAT " " + "dst=" PTR_FORMAT "-" PTR_FORMAT " " + SIZE_FORMAT "-" SIZE_FORMAT, + src_space_id, space_names[src_space_id], + dst_space_id, space_names[dst_space_id], + p2i(src_beg), p2i(src_end), + _summary_data.addr_to_region_idx(src_beg), + _summary_data.addr_to_region_idx(src_end), + p2i(dst_beg), p2i(dst_end), + _summary_data.addr_to_region_idx(dst_beg), + _summary_data.addr_to_region_idx(dst_end)); } #endif // #ifndef PRODUCT void PSParallelCompact::summary_phase(ParCompactionManager* cm, bool maximum_compaction) { - GCTraceTime tm("summary phase", print_phases(), true, &_gc_timer); - // trace("2"); + GCTraceTime(Trace, gc, phases) tm("Summary Phase", &_gc_timer); #ifdef ASSERT if (TraceParallelOldGCMarkingPhase) { @@ -1620,14 +1595,9 @@ void PSParallelCompact::summary_phase(ParCompactionManager* cm, // Quick summarization of each space into itself, to see how much is live. summarize_spaces_quick(); - if (TraceParallelOldGCSummaryPhase) { - tty->print_cr("summary_phase: after summarizing each space to self"); - Universe::print(); - NOT_PRODUCT(print_region_ranges()); - if (Verbose) { - NOT_PRODUCT(print_initial_summary_data(_summary_data, _space_info)); - } - } + log_develop_trace(gc, compaction, phases)("summary phase: after summarizing each space to self"); + NOT_PRODUCT(print_region_ranges()); + NOT_PRODUCT(print_initial_summary_data(_summary_data, _space_info)); // The amount of live data that will end up in old space (assuming it fits). size_t old_space_total_live = 0; @@ -1701,14 +1671,9 @@ void PSParallelCompact::summary_phase(ParCompactionManager* cm, } } - if (TraceParallelOldGCSummaryPhase) { - tty->print_cr("summary_phase: after final summarization"); - Universe::print(); - NOT_PRODUCT(print_region_ranges()); - if (Verbose) { - NOT_PRODUCT(print_generic_summary_data(_summary_data, _space_info)); - } - } + log_develop_trace(gc, compaction, phases)("Summary_phase: after final summarization"); + NOT_PRODUCT(print_region_ranges()); + NOT_PRODUCT(print_initial_summary_data(_summary_data, _space_info)); } // This method should contain all heap-specific policy for invoking a full @@ -1783,20 +1748,16 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { heap->pre_full_gc_dump(&_gc_timer); - _print_phases = PrintGCDetails && PrintParallelOldGCPhaseTimes; - // Make sure data structures are sane, make the heap parsable, and do other // miscellaneous bookkeeping. - PreGCValues pre_gc_values; - pre_compact(&pre_gc_values); + pre_compact(); + + PreGCValues pre_gc_values(heap); // Get the compaction manager reserved for the VM thread. ParCompactionManager* const vmthread_cm = ParCompactionManager::manager_array(gc_task_manager()->workers()); - // Place after pre_compact() where the number of invocations is incremented. - AdaptiveSizePolicyOutput(size_policy, heap->total_collections()); - { ResourceMark rm; HandleMark hm; @@ -1805,8 +1766,8 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { gc_task_manager()->set_active_gang(); gc_task_manager()->task_idle_workers(); - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL); + GCTraceCPUTime tcpu; + GCTraceTime(Info, gc) tm("Pause Full", NULL, gc_cause, true); TraceCollectorStats tcs(counters()); TraceMemoryManagerStats tms(true /* Full GC */,gc_cause); @@ -1853,17 +1814,9 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { size_policy->major_collection_end(old_gen->used_in_bytes(), gc_cause); if (UseAdaptiveSizePolicy) { - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print("AdaptiveSizeStart: "); - gclog_or_tty->stamp(); - gclog_or_tty->print_cr(" collection: %d ", - heap->total_collections()); - if (Verbose) { - gclog_or_tty->print("old_gen_capacity: " SIZE_FORMAT - " young_gen_capacity: " SIZE_FORMAT, - old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes()); - } - } + log_debug(gc, ergo)("AdaptiveSizeStart: collection: %d ", heap->total_collections()); + log_trace(gc, ergo)("old_gen_capacity: " SIZE_FORMAT " young_gen_capacity: " SIZE_FORMAT, + old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes()); // Don't check if the size_policy is ready here. Let // the size_policy check that internally. @@ -1921,10 +1874,8 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(), size_policy->calculated_survivor_size_in_bytes()); } - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ", - heap->total_collections()); - } + + log_debug(gc, ergo)("AdaptiveSizeStop: collection: %d ", heap->total_collections()); } if (UsePerfData) { @@ -1939,20 +1890,14 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { // Resize the metaspace capacity after a collection MetaspaceGC::compute_new_size(); - if (TraceOldGenTime) accumulated_time()->stop(); - - if (PrintGC) { - if (PrintGCDetails) { - // No GC timestamp here. This is after GC so it would be confusing. - young_gen->print_used_change(pre_gc_values.young_gen_used()); - old_gen->print_used_change(pre_gc_values.old_gen_used()); - heap->print_heap_change(pre_gc_values.heap_used()); - MetaspaceAux::print_metaspace_change(pre_gc_values.metadata_used()); - } else { - heap->print_heap_change(pre_gc_values.heap_used()); - } + if (TraceOldGenTime) { + accumulated_time()->stop(); } + young_gen->print_used_change(pre_gc_values.young_gen_used()); + old_gen->print_used_change(pre_gc_values.old_gen_used()); + MetaspaceAux::print_metaspace_change(pre_gc_values.metadata_used()); + // Track memory usage and detect low memory MemoryService::track_memory_usage(); heap->update_counters(); @@ -1970,7 +1915,7 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyAfterGC:"); + Universe::verify("After GC"); } // Re-verify object start arrays @@ -1990,13 +1935,10 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { heap->print_heap_after_gc(); heap->trace_heap_after_gc(&_gc_tracer); - if (PrintGCTaskTimeStamps) { - gclog_or_tty->print_cr("VM-Thread " JLONG_FORMAT " " JLONG_FORMAT " " - JLONG_FORMAT, - marking_start.ticks(), compaction_start.ticks(), - collection_exit.ticks()); - gc_task_manager()->print_task_time_stamps(); - } + log_debug(gc, task, time)("VM-Thread " JLONG_FORMAT " " JLONG_FORMAT " " JLONG_FORMAT, + marking_start.ticks(), compaction_start.ticks(), + collection_exit.ticks()); + gc_task_manager()->print_task_time_stamps(); heap->post_full_gc_dump(&_gc_timer); @@ -2004,6 +1946,8 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { ParallelTaskTerminator::print_termination_counts(); #endif + AdaptiveSizePolicyOutput::print(size_policy, heap->total_collections()); + _gc_timer.register_gc_end(); _gc_tracer.report_dense_prefix(dense_prefix(old_space_id)); @@ -2050,8 +1994,7 @@ bool PSParallelCompact::absorb_live_data_from_eden(PSAdaptiveSizePolicy* size_po return false; // Respect young gen minimum size. } - if (TraceAdaptiveGCBoundary && Verbose) { - gclog_or_tty->print(" absorbing " SIZE_FORMAT "K: " + log_trace(heap, ergo)(" absorbing " SIZE_FORMAT "K: " "eden " SIZE_FORMAT "K->" SIZE_FORMAT "K " "from " SIZE_FORMAT "K, to " SIZE_FORMAT "K " "young_gen " SIZE_FORMAT "K->" SIZE_FORMAT "K ", @@ -2060,7 +2003,6 @@ bool PSParallelCompact::absorb_live_data_from_eden(PSAdaptiveSizePolicy* size_po young_gen->from_space()->used_in_bytes() / K, young_gen->to_space()->used_in_bytes() / K, young_gen->capacity_in_bytes() / K, new_young_size / K); - } // Fill the unused part of the old gen. MutableSpace* const old_space = old_gen->object_space(); @@ -2110,7 +2052,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm, bool maximum_heap_compaction, ParallelOldTracer *gc_tracer) { // Recursively traverse all live objects and mark them - GCTraceTime tm("marking phase", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Marking Phase", &_gc_timer); ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); uint parallel_gc_threads = heap->gc_task_manager()->workers(); @@ -2125,7 +2067,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm, ClassLoaderDataGraph::clear_claimed_marks(); { - GCTraceTime tm_m("par mark", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Par Mark", &_gc_timer); ParallelScavengeHeap::ParStrongRootsScope psrs; @@ -2154,7 +2096,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm, // Process reference objects found during marking { - GCTraceTime tm_r("reference processing", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Reference Processing", &_gc_timer); ReferenceProcessorStats stats; if (ref_processor()->processing_is_mt()) { @@ -2171,7 +2113,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm, gc_tracer->report_gc_reference_stats(stats); } - GCTraceTime tm_c("class unloading", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc) tm_m("Class Unloading", &_gc_timer); // This is the point where the entire marking should have completed. assert(cm->marking_stacks_empty(), "Marking should have completed"); @@ -2202,7 +2144,7 @@ static PSAlwaysTrueClosure always_true; void PSParallelCompact::adjust_roots() { // Adjust the pointers to reflect the new locations - GCTraceTime tm("adjust roots", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Adjust Roots", &_gc_timer); // Need new claim bits when tracing through and adjusting pointers. ClassLoaderDataGraph::clear_claimed_marks(); @@ -2235,10 +2177,49 @@ void PSParallelCompact::adjust_roots() { PSScavenge::reference_processor()->weak_oops_do(adjust_pointer_closure()); } +// Helper class to print 8 region numbers per line and then print the total at the end. +class FillableRegionLogger : public StackObj { +private: + LogHandle(gc, compaction) log; + static const int LineLength = 8; + size_t _regions[LineLength]; + int _next_index; + bool _enabled; + size_t _total_regions; +public: + FillableRegionLogger() : _next_index(0), _total_regions(0), _enabled(develop_log_is_enabled(Trace, gc, compaction)) { } + ~FillableRegionLogger() { + log.trace(SIZE_FORMAT " initially fillable regions", _total_regions); + } + + void print_line() { + if (!_enabled || _next_index == 0) { + return; + } + FormatBuffer<> line("Fillable: "); + for (int i = 0; i < _next_index; i++) { + line.append(" " SIZE_FORMAT_W(7), _regions[i]); + } + log.trace("%s", line.buffer()); + _next_index = 0; + } + + void handle(size_t region) { + if (!_enabled) { + return; + } + _regions[_next_index++] = region; + if (_next_index == LineLength) { + print_line(); + } + _total_regions++; + } +}; + void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q, uint parallel_gc_threads) { - GCTraceTime tm("drain task setup", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Drain Task Setup", &_gc_timer); // Find the threads that are active unsigned int which = 0; @@ -2263,13 +2244,13 @@ void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q, const ParallelCompactData& sd = PSParallelCompact::summary_data(); - size_t fillable_regions = 0; // A count for diagnostic purposes. // A region index which corresponds to the tasks created above. // "which" must be 0 <= which < task_count which = 0; // id + 1 is used to test termination so unsigned can // be used with an old_space_id == 0. + FillableRegionLogger region_logger; for (unsigned int id = to_space_id; id + 1 > old_space_id; --id) { SpaceInfo* const space_info = _space_info + id; MutableSpace* const space = space_info->space(); @@ -2282,16 +2263,7 @@ void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q, for (size_t cur = end_region - 1; cur + 1 > beg_region; --cur) { if (sd.region(cur)->claim_unsafe()) { ParCompactionManager::region_list_push(which, cur); - - if (TraceParallelOldGCCompactionPhase && Verbose) { - const size_t count_mod_8 = fillable_regions & 7; - if (count_mod_8 == 0) gclog_or_tty->print("fillable: "); - gclog_or_tty->print(" " SIZE_FORMAT_W(7), cur); - if (count_mod_8 == 7) gclog_or_tty->cr(); - } - - NOT_PRODUCT(++fillable_regions;) - + region_logger.handle(cur); // Assign regions to tasks in round-robin fashion. if (++which == task_count) { assert(which <= parallel_gc_threads, @@ -2300,11 +2272,7 @@ void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q, } } } - } - - if (TraceParallelOldGCCompactionPhase) { - if (Verbose && (fillable_regions & 7) != 0) gclog_or_tty->cr(); - gclog_or_tty->print_cr(SIZE_FORMAT " initially fillable regions", fillable_regions); + region_logger.print_line(); } } @@ -2312,7 +2280,7 @@ void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q, void PSParallelCompact::enqueue_dense_prefix_tasks(GCTaskQueue* q, uint parallel_gc_threads) { - GCTraceTime tm("dense prefix task setup", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Dense Prefix Task Setup", &_gc_timer); ParallelCompactData& sd = PSParallelCompact::summary_data(); @@ -2394,7 +2362,7 @@ void PSParallelCompact::enqueue_region_stealing_tasks( GCTaskQueue* q, ParallelTaskTerminator* terminator_ptr, uint parallel_gc_threads) { - GCTraceTime tm("steal task setup", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Steal Task Setup", &_gc_timer); // Once a thread has drained it's stack, it should try to steal regions from // other threads. @@ -2408,9 +2376,15 @@ void PSParallelCompact::enqueue_region_stealing_tasks( #ifdef ASSERT // Write a histogram of the number of times the block table was filled for a // region. -void PSParallelCompact::write_block_fill_histogram(outputStream* const out) +void PSParallelCompact::write_block_fill_histogram() { - if (!TraceParallelOldGCCompactionPhase) return; + if (!develop_log_is_enabled(Trace, gc, compaction)) { + return; + } + + LogHandle(gc, compaction) log; + ResourceMark rm; + outputStream* out = log.trace_stream(); typedef ParallelCompactData::RegionData rd_t; ParallelCompactData& sd = summary_data(); @@ -2429,7 +2403,7 @@ void PSParallelCompact::write_block_fill_histogram(outputStream* const out) for (const rd_t* cur = beg; cur < end; ++cur) { ++histo[MIN2(cur->blocks_filled_count(), histo_len - 1)]; } - out->print("%u %-4s" SIZE_FORMAT_W(5), id, space_names[id], region_cnt); + out->print("Block fill histogram: %u %-4s" SIZE_FORMAT_W(5), id, space_names[id], region_cnt); for (size_t i = 0; i < histo_len; ++i) { out->print(" " SIZE_FORMAT_W(5) " %5.1f%%", histo[i], 100.0 * histo[i] / region_cnt); @@ -2441,8 +2415,7 @@ void PSParallelCompact::write_block_fill_histogram(outputStream* const out) #endif // #ifdef ASSERT void PSParallelCompact::compact() { - // trace("5"); - GCTraceTime tm("compaction phase", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Compaction Phase", &_gc_timer); ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSOldGen* old_gen = heap->old_gen(); @@ -2458,7 +2431,7 @@ void PSParallelCompact::compact() { enqueue_region_stealing_tasks(q, &terminator, active_gc_threads); { - GCTraceTime tm_pc("par compact", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Par Compact", &_gc_timer); gc_task_manager()->execute_and_wait(q); @@ -2472,14 +2445,14 @@ void PSParallelCompact::compact() { { // Update the deferred objects, if any. Any compaction manager can be used. - GCTraceTime tm_du("deferred updates", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Deferred Updates", &_gc_timer); ParCompactionManager* cm = ParCompactionManager::manager_array(0); for (unsigned int id = old_space_id; id < last_space_id; ++id) { update_deferred_objects(cm, SpaceId(id)); } } - DEBUG_ONLY(write_block_fill_histogram(gclog_or_tty)); + DEBUG_ONLY(write_block_fill_histogram()); } #ifdef ASSERT @@ -3108,18 +3081,13 @@ template static void trace_reference_gc(const char *s, oop obj, T* referent_addr, T* next_addr, T* discovered_addr) { - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("%s obj " PTR_FORMAT, s, p2i(obj)); - gclog_or_tty->print_cr(" referent_addr/* " PTR_FORMAT " / " - PTR_FORMAT, p2i(referent_addr), - referent_addr ? p2i(oopDesc::load_decode_heap_oop(referent_addr)) : NULL); - gclog_or_tty->print_cr(" next_addr/* " PTR_FORMAT " / " - PTR_FORMAT, p2i(next_addr), - next_addr ? p2i(oopDesc::load_decode_heap_oop(next_addr)) : NULL); - gclog_or_tty->print_cr(" discovered_addr/* " PTR_FORMAT " / " - PTR_FORMAT, p2i(discovered_addr), - discovered_addr ? p2i(oopDesc::load_decode_heap_oop(discovered_addr)) : NULL); - } + log_develop_trace(gc, ref)("%s obj " PTR_FORMAT, s, p2i(obj)); + log_develop_trace(gc, ref)(" referent_addr/* " PTR_FORMAT " / " PTR_FORMAT, + p2i(referent_addr), referent_addr ? p2i(oopDesc::load_decode_heap_oop(referent_addr)) : NULL); + log_develop_trace(gc, ref)(" next_addr/* " PTR_FORMAT " / " PTR_FORMAT, + p2i(next_addr), next_addr ? p2i(oopDesc::load_decode_heap_oop(next_addr)) : NULL); + log_develop_trace(gc, ref)(" discovered_addr/* " PTR_FORMAT " / " PTR_FORMAT, + p2i(discovered_addr), discovered_addr ? p2i(oopDesc::load_decode_heap_oop(discovered_addr)) : NULL); } #endif diff --git a/hotspot/src/share/vm/gc/parallel/psParallelCompact.hpp b/hotspot/src/share/vm/gc/parallel/psParallelCompact.hpp index 0adf7ae4202..76e55666d34 100644 --- a/hotspot/src/share/vm/gc/parallel/psParallelCompact.hpp +++ b/hotspot/src/share/vm/gc/parallel/psParallelCompact.hpp @@ -966,7 +966,6 @@ class PSParallelCompact : AllStatic { static ParallelCompactData _summary_data; static IsAliveClosure _is_alive_closure; static SpaceInfo _space_info[last_space_id]; - static bool _print_phases; static AdjustPointerClosure _adjust_pointer_closure; static AdjustKlassClosure _adjust_klass_closure; @@ -989,13 +988,10 @@ class PSParallelCompact : AllStatic { static void initialize_space_info(); - // Return true if details about individual phases should be printed. - static inline bool print_phases(); - // Clear the marking bitmap and summary data that cover the specified space. static void clear_data_covering_space(SpaceId id); - static void pre_compact(PreGCValues* pre_gc_values); + static void pre_compact(); static void post_compact(); // Mark live objects @@ -1069,7 +1065,7 @@ class PSParallelCompact : AllStatic { // Adjust addresses in roots. Does not adjust addresses in heap. static void adjust_roots(); - DEBUG_ONLY(static void write_block_fill_histogram(outputStream* const out);) + DEBUG_ONLY(static void write_block_fill_histogram();) // Move objects to new locations. static void compact_perm(ParCompactionManager* cm); @@ -1260,10 +1256,6 @@ inline bool PSParallelCompact::is_marked(oop obj) { return mark_bitmap()->is_marked(obj); } -inline bool PSParallelCompact::print_phases() { - return _print_phases; -} - inline double PSParallelCompact::normal_distribution(double density) { assert(_dwl_initialized, "uninitialized"); const double squared_term = (density - _dwl_mean) / _dwl_std_dev; diff --git a/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp b/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp index 6e54c638f22..fce698b6ee1 100644 --- a/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp +++ b/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp @@ -30,6 +30,7 @@ #include "gc/parallel/psScavenge.inline.hpp" #include "gc/shared/gcTrace.hpp" #include "gc/shared/taskqueue.inline.hpp" +#include "logging/log.hpp" #include "memory/allocation.inline.hpp" #include "memory/memRegion.hpp" #include "memory/padded.inline.hpp" @@ -99,7 +100,7 @@ void PSPromotionManager::pre_scavenge() { bool PSPromotionManager::post_scavenge(YoungGCTracer& gc_tracer) { bool promotion_failure_occurred = false; - TASKQUEUE_STATS_ONLY(if (PrintTaskqueue) print_taskqueue_stats()); + TASKQUEUE_STATS_ONLY(print_taskqueue_stats()); for (uint i = 0; i < ParallelGCThreads + 1; i++) { PSPromotionManager* manager = manager_array(i); assert(manager->claimed_stack_depth()->is_empty(), "should be empty"); @@ -128,7 +129,13 @@ static const char* const pm_stats_hdr[] = { }; void -PSPromotionManager::print_taskqueue_stats(outputStream* const out) { +PSPromotionManager::print_taskqueue_stats() { + if (!develop_log_is_enabled(Trace, gc, task, stats)) { + return; + } + LogHandle(gc, task, stats) log; + ResourceMark rm; + outputStream* out = log.trace_stream(); out->print_cr("== GC Tasks Stats, GC %3d", ParallelScavengeHeap::heap()->total_collections()); @@ -368,12 +375,7 @@ static void oop_ps_push_contents_specialized(oop obj, InstanceRefKlass *klass, P T next_oop = oopDesc::load_heap_oop(next_addr); if (!oopDesc::is_null(next_oop)) { // i.e. ref is not "active" T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Process discovered as normal " - PTR_FORMAT, p2i(discovered_addr)); - } - ) + log_develop_trace(gc, ref)(" Process discovered as normal " PTR_FORMAT, p2i(discovered_addr)); if (PSScavenge::should_scavenge(discovered_addr)) { pm->claim_or_forward_depth(discovered_addr); } @@ -430,13 +432,7 @@ oop PSPromotionManager::oop_promotion_failed(oop obj, markOop obj_mark) { obj = obj->forwardee(); } - if (TraceScavenge) { - gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " (%d)}", - "promotion-failure", - obj->klass()->internal_name(), - p2i(obj), obj->size()); - - } + log_develop_trace(gc, scavenge)("{promotion-failure %s " PTR_FORMAT " (%d)}", obj->klass()->internal_name(), p2i(obj), obj->size()); return obj; } diff --git a/hotspot/src/share/vm/gc/parallel/psPromotionManager.hpp b/hotspot/src/share/vm/gc/parallel/psPromotionManager.hpp index de86263fc56..ba51850550d 100644 --- a/hotspot/src/share/vm/gc/parallel/psPromotionManager.hpp +++ b/hotspot/src/share/vm/gc/parallel/psPromotionManager.hpp @@ -65,7 +65,7 @@ class PSPromotionManager VALUE_OBJ_CLASS_SPEC { size_t _array_chunks_processed; void print_local_stats(outputStream* const out, uint i) const; - static void print_taskqueue_stats(outputStream* const out = gclog_or_tty); + static void print_taskqueue_stats(); void reset_stats(); #endif // TASKQUEUE_STATS diff --git a/hotspot/src/share/vm/gc/parallel/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc/parallel/psPromotionManager.inline.hpp index ef3aa4732e0..2b6ac4a595c 100644 --- a/hotspot/src/share/vm/gc/parallel/psPromotionManager.inline.hpp +++ b/hotspot/src/share/vm/gc/parallel/psPromotionManager.inline.hpp @@ -31,6 +31,7 @@ #include "gc/parallel/psPromotionManager.hpp" #include "gc/parallel/psScavenge.hpp" #include "gc/shared/taskqueue.inline.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" inline PSPromotionManager* PSPromotionManager::manager_array(uint index) { @@ -262,11 +263,9 @@ inline oop PSPromotionManager::copy_to_survivor_space(oop o) { // This code must come after the CAS test, or it will print incorrect // information. - if (TraceScavenge) { - gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", - should_scavenge(&new_obj) ? "copying" : "tenuring", - new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); - } + log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", + should_scavenge(&new_obj) ? "copying" : "tenuring", + new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); return new_obj; } @@ -285,10 +284,10 @@ inline void PSPromotionManager::copy_and_push_safe_barrier(T* p) { // This code must come after the CAS test, or it will print incorrect // information. - if (TraceScavenge && o->is_forwarded()) { - gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", - "forwarding", - new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); + if (develop_log_is_enabled(Trace, gc, scavenge) && o->is_forwarded()) { + log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", + "forwarding", + new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); } oopDesc::encode_store_heap_oop_not_null(p, new_obj); diff --git a/hotspot/src/share/vm/gc/parallel/psScavenge.cpp b/hotspot/src/share/vm/gc/parallel/psScavenge.cpp index 0d4a6dad31d..648db23dab7 100644 --- a/hotspot/src/share/vm/gc/parallel/psScavenge.cpp +++ b/hotspot/src/share/vm/gc/parallel/psScavenge.cpp @@ -40,12 +40,13 @@ #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/spaceDecorator.hpp" #include "memory/resourceArea.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/fprofiler.hpp" @@ -290,8 +291,6 @@ bool PSScavenge::invoke_no_policy() { heap->increment_total_collections(); - AdaptiveSizePolicyOutput(size_policy, heap->total_collections()); - if (AdaptiveSizePolicy::should_update_eden_stats(gc_cause)) { // Gather the feedback data for eden occupancy. young_gen->eden_space()->accumulate_statistics(); @@ -303,23 +302,21 @@ bool PSScavenge::invoke_no_policy() { assert(!NeverTenure || _tenuring_threshold == markOopDesc::max_age + 1, "Sanity"); assert(!AlwaysTenure || _tenuring_threshold == 0, "Sanity"); - size_t prev_used = heap->used(); - // Fill in TLABs heap->accumulate_statistics_all_tlabs(); heap->ensure_parsability(true); // retire TLABs if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyBeforeGC:"); + Universe::verify("Before GC"); } { ResourceMark rm; HandleMark hm; - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - GCTraceTime t1(GCCauseString("GC", gc_cause), PrintGC, !PrintGCDetails, NULL); + GCTraceCPUTime tcpu; + GCTraceTime(Info, gc) tm("Pause Young", NULL, gc_cause, true); TraceCollectorStats tcs(counters()); TraceMemoryManagerStats tms(false /* not full GC */,gc_cause); @@ -352,12 +349,7 @@ bool PSScavenge::invoke_no_policy() { reference_processor()->enable_discovery(); reference_processor()->setup_policy(false); - // We track how much was promoted to the next generation for - // the AdaptiveSizePolicy. - size_t old_gen_used_before = old_gen->used_in_bytes(); - - // For PrintGCDetails - size_t young_gen_used_before = young_gen->used_in_bytes(); + PreGCValues pre_gc_values(heap); // Reset our survivor overflow. set_survivor_overflow(false); @@ -383,7 +375,7 @@ bool PSScavenge::invoke_no_policy() { // We'll use the promotion manager again later. PSPromotionManager* promotion_manager = PSPromotionManager::vm_thread_promotion_manager(); { - GCTraceTime tm("Scavenge", false, false, &_gc_timer); + GCTraceTime(Debug, gc, phases) tm("Scavenge", &_gc_timer); ParallelScavengeHeap::ParStrongRootsScope psrs; GCTaskQueue* q = GCTaskQueue::create(); @@ -425,7 +417,7 @@ bool PSScavenge::invoke_no_policy() { // Process reference objects discovered during scavenge { - GCTraceTime tm("References", false, false, &_gc_timer); + GCTraceTime(Debug, gc, phases) tm("References", &_gc_timer); reference_processor()->setup_policy(false); // not always_clear reference_processor()->set_active_mt_degree(active_workers); @@ -454,7 +446,7 @@ bool PSScavenge::invoke_no_policy() { } { - GCTraceTime tm("StringTable", false, false, &_gc_timer); + GCTraceTime(Debug, gc, phases) tm("StringTable", &_gc_timer); // Unlink any dead interned Strings and process the remaining live ones. PSScavengeRootsClosure root_closure(promotion_manager); StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure); @@ -464,9 +456,7 @@ bool PSScavenge::invoke_no_policy() { promotion_failure_occurred = PSPromotionManager::post_scavenge(_gc_tracer); if (promotion_failure_occurred) { clean_up_failed_promotion(); - if (PrintGC) { - gclog_or_tty->print("--"); - } + log_info(gc)("Promotion failed"); } _gc_tracer.report_tenuring_threshold(tenuring_threshold()); @@ -483,7 +473,7 @@ bool PSScavenge::invoke_no_policy() { young_gen->swap_spaces(); size_t survived = young_gen->from_space()->used_in_bytes(); - size_t promoted = old_gen->used_in_bytes() - old_gen_used_before; + size_t promoted = old_gen->used_in_bytes() - pre_gc_values.old_gen_used(); size_policy->update_averages(_survivor_overflow, survived, promoted); // A successful scavenge should restart the GC time limit count which is @@ -492,19 +482,9 @@ bool PSScavenge::invoke_no_policy() { if (UseAdaptiveSizePolicy) { // Calculate the new survivor size and tenuring threshold - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print("AdaptiveSizeStart: "); - gclog_or_tty->stamp(); - gclog_or_tty->print_cr(" collection: %d ", - heap->total_collections()); - - if (Verbose) { - gclog_or_tty->print("old_gen_capacity: " SIZE_FORMAT - " young_gen_capacity: " SIZE_FORMAT, - old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes()); - } - } - + log_debug(gc, ergo)("AdaptiveSizeStart: collection: %d ", heap->total_collections()); + log_trace(gc, ergo)("old_gen_capacity: " SIZE_FORMAT " young_gen_capacity: " SIZE_FORMAT, + old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes()); if (UsePerfData) { PSGCAdaptivePolicyCounters* counters = heap->gc_policy_counters(); @@ -538,13 +518,9 @@ bool PSScavenge::invoke_no_policy() { _tenuring_threshold, survivor_limit); - if (PrintTenuringDistribution) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold %u" - " (max threshold " UINTX_FORMAT ")", - size_policy->calculated_survivor_size_in_bytes(), - _tenuring_threshold, MaxTenuringThreshold); - } + log_debug(gc, age)("Desired survivor size " SIZE_FORMAT " bytes, new threshold %u (max threshold " UINTX_FORMAT ")", + size_policy->calculated_survivor_size_in_bytes(), + _tenuring_threshold, MaxTenuringThreshold); if (UsePerfData) { PSGCAdaptivePolicyCounters* counters = heap->gc_policy_counters(); @@ -602,10 +578,7 @@ bool PSScavenge::invoke_no_policy() { heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(), size_policy->calculated_survivor_size_in_bytes()); - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ", - heap->total_collections()); - } + log_debug(gc, ergo)("AdaptiveSizeStop: collection: %d ", heap->total_collections()); } // Update the structure of the eden. With NUMA-eden CPU hotplugging or offlining can @@ -628,7 +601,7 @@ bool PSScavenge::invoke_no_policy() { NOT_PRODUCT(reference_processor()->verify_no_references_recorded()); { - GCTraceTime tm("Prune Scavenge Root Methods", false, false, &_gc_timer); + GCTraceTime(Debug, gc, phases) tm("Prune Scavenge Root Methods", &_gc_timer); CodeCache::prune_scavenge_root_nmethods(); } @@ -649,14 +622,9 @@ bool PSScavenge::invoke_no_policy() { if (TraceYoungGenTime) accumulated_time()->stop(); - if (PrintGC) { - if (PrintGCDetails) { - // Don't print a GC timestamp here. This is after the GC so - // would be confusing. - young_gen->print_used_change(young_gen_used_before); - } - heap->print_heap_change(prev_used); - } + young_gen->print_used_change(pre_gc_values.young_gen_used()); + old_gen->print_used_change(pre_gc_values.old_gen_used()); + MetaspaceAux::print_metaspace_change(pre_gc_values.metadata_used()); // Track memory usage and detect low memory MemoryService::track_memory_usage(); @@ -667,7 +635,7 @@ bool PSScavenge::invoke_no_policy() { if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyAfterGC:"); + Universe::verify("After GC"); } heap->print_heap_after_gc(); @@ -675,17 +643,16 @@ bool PSScavenge::invoke_no_policy() { scavenge_exit.update(); - if (PrintGCTaskTimeStamps) { - tty->print_cr("VM-Thread " JLONG_FORMAT " " JLONG_FORMAT " " JLONG_FORMAT, - scavenge_entry.ticks(), scavenge_midpoint.ticks(), - scavenge_exit.ticks()); - gc_task_manager()->print_task_time_stamps(); - } + log_debug(gc, task, time)("VM-Thread " JLONG_FORMAT " " JLONG_FORMAT " " JLONG_FORMAT, + scavenge_entry.ticks(), scavenge_midpoint.ticks(), + scavenge_exit.ticks()); + gc_task_manager()->print_task_time_stamps(); #ifdef TRACESPINNING ParallelTaskTerminator::print_termination_counts(); #endif + AdaptiveSizePolicyOutput::print(size_policy, heap->total_collections()); _gc_timer.register_gc_end(); @@ -708,9 +675,7 @@ void PSScavenge::clean_up_failed_promotion() { PSPromotionFailedClosure unforward_closure; young_gen->object_iterate(&unforward_closure); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("Restoring " SIZE_FORMAT " marks", _preserved_oop_stack.size()); - } + log_trace(gc, ergo)("Restoring " SIZE_FORMAT " marks", _preserved_oop_stack.size()); // Restore any saved marks. while (!_preserved_oop_stack.is_empty()) { @@ -772,19 +737,12 @@ bool PSScavenge::should_attempt_scavenge() { size_t promotion_estimate = MIN2(avg_promoted, young_gen->used_in_bytes()); bool result = promotion_estimate < old_gen->free_in_bytes(); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(result ? " do scavenge: " : " skip scavenge: "); - gclog_or_tty->print_cr(" average_promoted " SIZE_FORMAT - " padded_average_promoted " SIZE_FORMAT - " free in old gen " SIZE_FORMAT, - (size_t) policy->average_promoted_in_bytes(), - (size_t) policy->padded_average_promoted_in_bytes(), - old_gen->free_in_bytes()); - if (young_gen->used_in_bytes() < - (size_t) policy->padded_average_promoted_in_bytes()) { - gclog_or_tty->print_cr(" padded_promoted_average is greater" - " than maximum promotion = " SIZE_FORMAT, young_gen->used_in_bytes()); - } + log_trace(ergo)("%s scavenge: average_promoted " SIZE_FORMAT " padded_average_promoted " SIZE_FORMAT " free in old gen " SIZE_FORMAT, + result ? "Do" : "Skip", (size_t) policy->average_promoted_in_bytes(), + (size_t) policy->padded_average_promoted_in_bytes(), + old_gen->free_in_bytes()); + if (young_gen->used_in_bytes() < (size_t) policy->padded_average_promoted_in_bytes()) { + log_trace(ergo)(" padded_promoted_average is greater than maximum promotion = " SIZE_FORMAT, young_gen->used_in_bytes()); } if (result) { diff --git a/hotspot/src/share/vm/gc/parallel/psScavenge.inline.hpp b/hotspot/src/share/vm/gc/parallel/psScavenge.inline.hpp index 0a4d2ef94ed..5dab7373a72 100644 --- a/hotspot/src/share/vm/gc/parallel/psScavenge.inline.hpp +++ b/hotspot/src/share/vm/gc/parallel/psScavenge.inline.hpp @@ -29,6 +29,7 @@ #include "gc/parallel/parallelScavengeHeap.hpp" #include "gc/parallel/psPromotionManager.inline.hpp" #include "gc/parallel/psScavenge.hpp" +#include "logging/log.hpp" #include "memory/iterator.hpp" #include "utilities/globalDefinitions.hpp" @@ -138,13 +139,11 @@ class PSScavengeKlassClosure: public KlassClosure { // If the klass has not been dirtied we know that there's // no references into the young gen and we can skip it. - if (TraceScavenge) { - ResourceMark rm; - gclog_or_tty->print_cr("PSScavengeKlassClosure::do_klass " PTR_FORMAT ", %s, dirty: %s", - p2i(klass), - klass->external_name(), - klass->has_modified_oops() ? "true" : "false"); - } + NOT_PRODUCT(ResourceMark rm); + log_develop_trace(gc, scavenge)("PSScavengeKlassClosure::do_klass " PTR_FORMAT ", %s, dirty: %s", + p2i(klass), + klass->external_name(), + klass->has_modified_oops() ? "true" : "false"); if (klass->has_modified_oops()) { // Clean the klass since we're going to scavenge all the metadata. diff --git a/hotspot/src/share/vm/gc/parallel/psVirtualspace.cpp b/hotspot/src/share/vm/gc/parallel/psVirtualspace.cpp index a74eb32d2d7..3572c722af1 100644 --- a/hotspot/src/share/vm/gc/parallel/psVirtualspace.cpp +++ b/hotspot/src/share/vm/gc/parallel/psVirtualspace.cpp @@ -213,20 +213,6 @@ void PSVirtualSpace::verify() const { } } -void PSVirtualSpace::print() const { - gclog_or_tty->print_cr("virtual space [" PTR_FORMAT "]: alignment=" - SIZE_FORMAT "K grows %s%s", - p2i(this), alignment() / K, grows_up() ? "up" : "down", - special() ? " (pinned in memory)" : ""); - gclog_or_tty->print_cr(" reserved=" SIZE_FORMAT "K" - " [" PTR_FORMAT "," PTR_FORMAT "]" - " committed=" SIZE_FORMAT "K" - " [" PTR_FORMAT "," PTR_FORMAT "]", - reserved_size() / K, - p2i(reserved_low_addr()), p2i(reserved_high_addr()), - committed_size() / K, - p2i(committed_low_addr()), p2i(committed_high_addr())); -} #endif // #ifndef PRODUCT void PSVirtualSpace::print_space_boundaries_on(outputStream* st) const { diff --git a/hotspot/src/share/vm/gc/parallel/psVirtualspace.hpp b/hotspot/src/share/vm/gc/parallel/psVirtualspace.hpp index d39e59ee8c5..f6ece810206 100644 --- a/hotspot/src/share/vm/gc/parallel/psVirtualspace.hpp +++ b/hotspot/src/share/vm/gc/parallel/psVirtualspace.hpp @@ -96,7 +96,6 @@ class PSVirtualSpace : public CHeapObj { bool is_aligned(size_t val) const; bool is_aligned(char* val) const; void verify() const; - void print() const; virtual bool grows_up() const { return true; } bool grows_down() const { return !grows_up(); } diff --git a/hotspot/src/share/vm/gc/parallel/psYoungGen.cpp b/hotspot/src/share/vm/gc/parallel/psYoungGen.cpp index 047443ff054..51e85900012 100644 --- a/hotspot/src/share/vm/gc/parallel/psYoungGen.cpp +++ b/hotspot/src/share/vm/gc/parallel/psYoungGen.cpp @@ -30,6 +30,7 @@ #include "gc/parallel/psYoungGen.hpp" #include "gc/shared/gcUtil.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" @@ -268,14 +269,12 @@ void PSYoungGen::resize(size_t eden_size, size_t survivor_size) { space_invariants(); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr("Young generation size: " - "desired eden: " SIZE_FORMAT " survivor: " SIZE_FORMAT - " used: " SIZE_FORMAT " capacity: " SIZE_FORMAT - " gen limits: " SIZE_FORMAT " / " SIZE_FORMAT, - eden_size, survivor_size, used_in_bytes(), capacity_in_bytes(), - _max_gen_size, min_gen_size()); - } + log_trace(gc, ergo)("Young generation size: " + "desired eden: " SIZE_FORMAT " survivor: " SIZE_FORMAT + " used: " SIZE_FORMAT " capacity: " SIZE_FORMAT + " gen limits: " SIZE_FORMAT " / " SIZE_FORMAT, + eden_size, survivor_size, used_in_bytes(), capacity_in_bytes(), + _max_gen_size, min_gen_size()); } } @@ -330,26 +329,17 @@ bool PSYoungGen::resize_generation(size_t eden_size, size_t survivor_size) { size_changed = true; } } else { - if (Verbose && PrintGC) { - if (orig_size == gen_size_limit()) { - gclog_or_tty->print_cr("PSYoung generation size at maximum: " - SIZE_FORMAT "K", orig_size/K); - } else if (orig_size == min_gen_size()) { - gclog_or_tty->print_cr("PSYoung generation size at minium: " - SIZE_FORMAT "K", orig_size/K); - } + if (orig_size == gen_size_limit()) { + log_trace(gc)("PSYoung generation size at maximum: " SIZE_FORMAT "K", orig_size/K); + } else if (orig_size == min_gen_size()) { + log_trace(gc)("PSYoung generation size at minium: " SIZE_FORMAT "K", orig_size/K); } } if (size_changed) { post_resize(); - - if (Verbose && PrintGC) { - size_t current_size = virtual_space()->committed_size(); - gclog_or_tty->print_cr("PSYoung generation size changed: " - SIZE_FORMAT "K->" SIZE_FORMAT "K", - orig_size/K, current_size/K); - } + log_trace(gc)("PSYoung generation size changed: " SIZE_FORMAT "K->" SIZE_FORMAT "K", + orig_size/K, virtual_space()->committed_size()/K); } guarantee(eden_plus_survivors <= virtual_space()->committed_size() || @@ -412,28 +402,25 @@ void PSYoungGen::mangle_survivors(MutableSpace* s1, s2->mangle_region(delta2_right); } - if (TraceZapUnusedHeapArea) { - // s1 - gclog_or_tty->print_cr("Current region: [" PTR_FORMAT ", " PTR_FORMAT ") " - "New region: [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(s1->bottom()), p2i(s1->end()), - p2i(s1MR.start()), p2i(s1MR.end())); - gclog_or_tty->print_cr(" Mangle before: [" PTR_FORMAT ", " - PTR_FORMAT ") Mangle after: [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(delta1_left.start()), p2i(delta1_left.end()), - p2i(delta1_right.start()), p2i(delta1_right.end())); - - // s2 - gclog_or_tty->print_cr("Current region: [" PTR_FORMAT ", " PTR_FORMAT ") " - "New region: [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(s2->bottom()), p2i(s2->end()), - p2i(s2MR.start()), p2i(s2MR.end())); - gclog_or_tty->print_cr(" Mangle before: [" PTR_FORMAT ", " - PTR_FORMAT ") Mangle after: [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(delta2_left.start()), p2i(delta2_left.end()), - p2i(delta2_right.start()), p2i(delta2_right.end())); - } + // s1 + log_develop_trace(gc)("Current region: [" PTR_FORMAT ", " PTR_FORMAT ") " + "New region: [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(s1->bottom()), p2i(s1->end()), + p2i(s1MR.start()), p2i(s1MR.end())); + log_develop_trace(gc)(" Mangle before: [" PTR_FORMAT ", " + PTR_FORMAT ") Mangle after: [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(delta1_left.start()), p2i(delta1_left.end()), + p2i(delta1_right.start()), p2i(delta1_right.end())); + // s2 + log_develop_trace(gc)("Current region: [" PTR_FORMAT ", " PTR_FORMAT ") " + "New region: [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(s2->bottom()), p2i(s2->end()), + p2i(s2MR.start()), p2i(s2MR.end())); + log_develop_trace(gc)(" Mangle before: [" PTR_FORMAT ", " + PTR_FORMAT ") Mangle after: [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(delta2_left.start()), p2i(delta2_left.end()), + p2i(delta2_right.start()), p2i(delta2_right.end())); } #endif // NOT PRODUCT @@ -448,41 +435,32 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, return; } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr("PSYoungGen::resize_spaces(requested_eden_size: " - SIZE_FORMAT - ", requested_survivor_size: " SIZE_FORMAT ")", - requested_eden_size, requested_survivor_size); - gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " - SIZE_FORMAT, - p2i(eden_space()->bottom()), - p2i(eden_space()->end()), - pointer_delta(eden_space()->end(), - eden_space()->bottom(), - sizeof(char))); - gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " - SIZE_FORMAT, - p2i(from_space()->bottom()), - p2i(from_space()->end()), - pointer_delta(from_space()->end(), - from_space()->bottom(), - sizeof(char))); - gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " - SIZE_FORMAT, - p2i(to_space()->bottom()), - p2i(to_space()->end()), - pointer_delta( to_space()->end(), - to_space()->bottom(), - sizeof(char))); - } + log_trace(gc, ergo)("PSYoungGen::resize_spaces(requested_eden_size: " SIZE_FORMAT ", requested_survivor_size: " SIZE_FORMAT ")", + requested_eden_size, requested_survivor_size); + log_trace(gc, ergo)(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT, + p2i(eden_space()->bottom()), + p2i(eden_space()->end()), + pointer_delta(eden_space()->end(), + eden_space()->bottom(), + sizeof(char))); + log_trace(gc, ergo)(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT, + p2i(from_space()->bottom()), + p2i(from_space()->end()), + pointer_delta(from_space()->end(), + from_space()->bottom(), + sizeof(char))); + log_trace(gc, ergo)(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT, + p2i(to_space()->bottom()), + p2i(to_space()->end()), + pointer_delta( to_space()->end(), + to_space()->bottom(), + sizeof(char))); // There's nothing to do if the new sizes are the same as the current if (requested_survivor_size == to_space()->capacity_in_bytes() && requested_survivor_size == from_space()->capacity_in_bytes() && requested_eden_size == eden_space()->capacity_in_bytes()) { - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" capacities are the right sizes, returning"); - } + log_trace(gc, ergo)(" capacities are the right sizes, returning"); return; } @@ -503,9 +481,7 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, if (eden_from_to_order) { // Eden, from, to eden_from_to_order = true; - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" Eden, from, to:"); - } + log_trace(gc, ergo)(" Eden, from, to:"); // Set eden // "requested_eden_size" is a goal for the size of eden @@ -566,28 +542,21 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, guarantee(to_start != to_end, "to space is zero sized"); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" [eden_start .. eden_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(eden_start), - p2i(eden_end), - pointer_delta(eden_end, eden_start, sizeof(char))); - gclog_or_tty->print_cr(" [from_start .. from_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(from_start), - p2i(from_end), - pointer_delta(from_end, from_start, sizeof(char))); - gclog_or_tty->print_cr(" [ to_start .. to_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(to_start), - p2i(to_end), - pointer_delta( to_end, to_start, sizeof(char))); - } + log_trace(gc, ergo)(" [eden_start .. eden_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(eden_start), + p2i(eden_end), + pointer_delta(eden_end, eden_start, sizeof(char))); + log_trace(gc, ergo)(" [from_start .. from_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(from_start), + p2i(from_end), + pointer_delta(from_end, from_start, sizeof(char))); + log_trace(gc, ergo)(" [ to_start .. to_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(to_start), + p2i(to_end), + pointer_delta( to_end, to_start, sizeof(char))); } else { // Eden, to, from - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" Eden, to, from:"); - } + log_trace(gc, ergo)(" Eden, to, from:"); // To space gets priority over eden resizing. Note that we position // to space as if we were able to resize from space, even though from @@ -623,23 +592,18 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, eden_end = MAX2(eden_end, eden_start + alignment); to_start = MAX2(to_start, eden_end); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" [eden_start .. eden_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(eden_start), - p2i(eden_end), - pointer_delta(eden_end, eden_start, sizeof(char))); - gclog_or_tty->print_cr(" [ to_start .. to_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(to_start), - p2i(to_end), - pointer_delta( to_end, to_start, sizeof(char))); - gclog_or_tty->print_cr(" [from_start .. from_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(from_start), - p2i(from_end), - pointer_delta(from_end, from_start, sizeof(char))); - } + log_trace(gc, ergo)(" [eden_start .. eden_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(eden_start), + p2i(eden_end), + pointer_delta(eden_end, eden_start, sizeof(char))); + log_trace(gc, ergo)(" [ to_start .. to_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(to_start), + p2i(to_end), + pointer_delta( to_end, to_start, sizeof(char))); + log_trace(gc, ergo)(" [from_start .. from_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(from_start), + p2i(from_end), + pointer_delta(from_end, from_start, sizeof(char))); } @@ -658,7 +622,7 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, // Let's make sure the call to initialize doesn't reset "top"! HeapWord* old_from_top = from_space()->top(); - // For PrintAdaptiveSizePolicy block below + // For logging block below size_t old_from = from_space()->capacity_in_bytes(); size_t old_to = to_space()->capacity_in_bytes(); @@ -704,18 +668,11 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, assert(from_space()->top() == old_from_top, "from top changed!"); - if (PrintAdaptiveSizePolicy) { - ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); - gclog_or_tty->print("AdaptiveSizePolicy::survivor space sizes: " - "collection: %d " - "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> " - "(" SIZE_FORMAT ", " SIZE_FORMAT ") ", - heap->total_collections(), - old_from, old_to, - from_space()->capacity_in_bytes(), - to_space()->capacity_in_bytes()); - gclog_or_tty->cr(); - } + log_trace(gc, ergo)("AdaptiveSizePolicy::survivor space sizes: collection: %d (" SIZE_FORMAT ", " SIZE_FORMAT ") -> (" SIZE_FORMAT ", " SIZE_FORMAT ") ", + ParallelScavengeHeap::heap()->total_collections(), + old_from, old_to, + from_space()->capacity_in_bytes(), + to_space()->capacity_in_bytes()); } void PSYoungGen::swap_spaces() { @@ -794,13 +751,8 @@ void PSYoungGen::compact() { void PSYoungGen::print() const { print_on(tty); } void PSYoungGen::print_on(outputStream* st) const { st->print(" %-15s", "PSYoungGen"); - if (PrintGCDetails && Verbose) { - st->print(" total " SIZE_FORMAT ", used " SIZE_FORMAT, - capacity_in_bytes(), used_in_bytes()); - } else { - st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", - capacity_in_bytes()/K, used_in_bytes()/K); - } + st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", + capacity_in_bytes()/K, used_in_bytes()/K); virtual_space()->print_space_boundaries_on(st); st->print(" eden"); eden_space()->print_on(st); st->print(" from"); from_space()->print_on(st); @@ -809,13 +761,8 @@ void PSYoungGen::print_on(outputStream* st) const { // Note that a space is not printed before the [NAME: void PSYoungGen::print_used_change(size_t prev_used) const { - gclog_or_tty->print("[%s:", name()); - gclog_or_tty->print(" " SIZE_FORMAT "K" - "->" SIZE_FORMAT "K" - "(" SIZE_FORMAT "K)", - prev_used / K, used_in_bytes() / K, - capacity_in_bytes() / K); - gclog_or_tty->print("]"); + log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + name(), prev_used / K, used_in_bytes() / K, capacity_in_bytes() / K); } size_t PSYoungGen::available_for_expansion() { diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp index 54243df64f9..eaaf9a213e5 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp @@ -31,7 +31,7 @@ #include "gc/shared/gcPolicyCounters.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/generationSpec.hpp" @@ -39,6 +39,7 @@ #include "gc/shared/space.inline.hpp" #include "gc/shared/spaceDecorator.hpp" #include "gc/shared/strongRootsScope.hpp" +#include "logging/log.hpp" #include "memory/iterator.hpp" #include "oops/instanceRefKlass.hpp" #include "oops/oop.inline.hpp" @@ -134,13 +135,11 @@ void FastScanClosure::do_oop(oop* p) { FastScanClosure::do_oop_work(p); } void FastScanClosure::do_oop(narrowOop* p) { FastScanClosure::do_oop_work(p); } void KlassScanClosure::do_klass(Klass* klass) { - if (TraceScavenge) { - ResourceMark rm; - gclog_or_tty->print_cr("KlassScanClosure::do_klass " PTR_FORMAT ", %s, dirty: %s", - p2i(klass), - klass->external_name(), - klass->has_modified_oops() ? "true" : "false"); - } + NOT_PRODUCT(ResourceMark rm); + log_develop_trace(gc, scavenge)("KlassScanClosure::do_klass " PTR_FORMAT ", %s, dirty: %s", + p2i(klass), + klass->external_name(), + klass->has_modified_oops() ? "true" : "false"); // If the klass has not been dirtied we know that there's // no references into the young gen and we can skip it. @@ -359,10 +358,7 @@ bool DefNewGeneration::expand(size_t bytes) { // but the second succeeds and expands the heap to its maximum // value. if (GC_locker::is_active()) { - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("Garbage collection disabled, " - "expanded heap instead"); - } + log_debug(gc)("Garbage collection disabled, expanded heap instead"); } return success; @@ -429,22 +425,15 @@ void DefNewGeneration::compute_new_size() { MemRegion cmr((HeapWord*)_virtual_space.low(), (HeapWord*)_virtual_space.high()); gch->barrier_set()->resize_covered_region(cmr); - if (Verbose && PrintGC) { - size_t new_size_after = _virtual_space.committed_size(); - size_t eden_size_after = eden()->capacity(); - size_t survivor_size_after = from()->capacity(); - gclog_or_tty->print("New generation size " SIZE_FORMAT "K->" - SIZE_FORMAT "K [eden=" - SIZE_FORMAT "K,survivor=" SIZE_FORMAT "K]", - new_size_before/K, new_size_after/K, - eden_size_after/K, survivor_size_after/K); - if (WizardMode) { - gclog_or_tty->print("[allowed " SIZE_FORMAT "K extra for %d threads]", + + log_debug(gc, heap, ergo)( + "New generation size " SIZE_FORMAT "K->" SIZE_FORMAT "K [eden=" SIZE_FORMAT "K,survivor=" SIZE_FORMAT "K]", + new_size_before/K, _virtual_space.committed_size()/K, + eden()->capacity()/K, from()->capacity()/K); + log_trace(gc, heap, ergo)( + " [allowed " SIZE_FORMAT "K extra for %d threads]", thread_increase_size/K, threads_count); } - gclog_or_tty->cr(); - } - } } void DefNewGeneration::younger_refs_iterate(OopsInGenClosure* cl, uint n_threads) { @@ -507,34 +496,27 @@ void DefNewGeneration::space_iterate(SpaceClosure* blk, // The last collection bailed out, we are running out of heap space, // so we try to allocate the from-space, too. HeapWord* DefNewGeneration::allocate_from_space(size_t size) { + bool should_try_alloc = should_allocate_from_space() || GC_locker::is_active_and_needs_gc(); + + // If the Heap_lock is not locked by this thread, this will be called + // again later with the Heap_lock held. + bool do_alloc = should_try_alloc && (Heap_lock->owned_by_self() || (SafepointSynchronize::is_at_safepoint() && Thread::current()->is_VM_thread())); + HeapWord* result = NULL; - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("DefNewGeneration::allocate_from_space(" SIZE_FORMAT "):" - " will_fail: %s" - " heap_lock: %s" - " free: " SIZE_FORMAT, + if (do_alloc) { + result = from()->allocate(size); + } + + log_trace(gc, alloc)("DefNewGeneration::allocate_from_space(" SIZE_FORMAT "): will_fail: %s heap_lock: %s free: " SIZE_FORMAT "%s%s returns %s", size, GenCollectedHeap::heap()->incremental_collection_will_fail(false /* don't consult_young */) ? "true" : "false", Heap_lock->is_locked() ? "locked" : "unlocked", - from()->free()); - } - if (should_allocate_from_space() || GC_locker::is_active_and_needs_gc()) { - if (Heap_lock->owned_by_self() || - (SafepointSynchronize::is_at_safepoint() && - Thread::current()->is_VM_thread())) { - // If the Heap_lock is not locked by this thread, this will be called - // again later with the Heap_lock held. - result = from()->allocate(size); - } else if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" Heap_lock is not owned by self"); - } - } else if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" should_allocate_from_space: NOT"); - } - if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" returns %s", result == NULL ? "NULL" : "object"); - } + from()->free(), + should_try_alloc ? "" : " should_allocate_from_space: NOT", + do_alloc ? " Heap_lock is not owned by self" : "", + result == NULL ? "NULL" : "object"); + return result; } @@ -570,9 +552,7 @@ void DefNewGeneration::collect(bool full, // from this generation, pass on collection; let the next generation // do it. if (!collection_attempt_is_safe()) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print(" :: Collection attempt not safe :: "); - } + log_trace(gc)(":: Collection attempt not safe ::"); gch->set_incremental_collection_failed(); // Slight lie: we did not even attempt one return; } @@ -580,9 +560,7 @@ void DefNewGeneration::collect(bool full, init_assuming_no_promotion_failure(); - GCTraceTime t1(GCCauseString("GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL); - // Capture heap used before collection (for printing). - size_t gch_prev_used = gch->used(); + GCTraceTime(Trace, gc) tm("DefNew", NULL, gch->gc_cause()); gch->trace_heap_before_gc(&gc_tracer); @@ -677,9 +655,7 @@ void DefNewGeneration::collect(bool full, _promo_failure_scan_stack.clear(true); // Clear cached segments. remove_forwarding_pointers(); - if (PrintGCDetails) { - gclog_or_tty->print(" (promotion failed) "); - } + log_debug(gc)("Promotion failed"); // Add to-space to the list of space to compact // when a promotion failure has occurred. In that // case there can be live objects in to-space @@ -696,9 +672,6 @@ void DefNewGeneration::collect(bool full, // Reset the PromotionFailureALot counters. NOT_PRODUCT(gch->reset_promotion_should_fail();) } - if (PrintGC && !PrintGCDetails) { - gch->print_heap_change(gch_prev_used); - } // set new iteration safe limit for the survivor spaces from()->set_concurrent_iteration_safe_limit(from()->top()); to()->set_concurrent_iteration_safe_limit(to()->top()); @@ -760,10 +733,8 @@ void DefNewGeneration::preserve_mark_if_necessary(oop obj, markOop m) { } void DefNewGeneration::handle_promotion_failure(oop old) { - if (PrintPromotionFailure && !_promotion_failed) { - gclog_or_tty->print(" (promotion failure size = %d) ", - old->size()); - } + log_debug(gc, promotion)("Promotion failure size = %d) ", old->size()); + _promotion_failed = true; _promotion_failed_info.register_copy_failure(old->size()); preserve_mark_if_necessary(old, old->mark()); @@ -895,9 +866,7 @@ void DefNewGeneration::reset_scratch() { bool DefNewGeneration::collection_attempt_is_safe() { if (!to()->is_empty()) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print(" :: to is not empty :: "); - } + log_trace(gc)(":: to is not empty ::"); return false; } if (_old_gen == NULL) { @@ -919,17 +888,13 @@ void DefNewGeneration::gc_epilogue(bool full) { if (full) { DEBUG_ONLY(seen_incremental_collection_failed = false;) if (!collection_attempt_is_safe() && !_eden_space->is_empty()) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("DefNewEpilogue: cause(%s), full, not safe, set_failed, set_alloc_from, clear_seen", + log_trace(gc)("DefNewEpilogue: cause(%s), full, not safe, set_failed, set_alloc_from, clear_seen", GCCause::to_string(gch->gc_cause())); - } gch->set_incremental_collection_failed(); // Slight lie: a full gc left us in that state set_should_allocate_from_space(); // we seem to be running out of space } else { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("DefNewEpilogue: cause(%s), full, safe, clear_failed, clear_alloc_from, clear_seen", + log_trace(gc)("DefNewEpilogue: cause(%s), full, safe, clear_failed, clear_alloc_from, clear_seen", GCCause::to_string(gch->gc_cause())); - } gch->clear_incremental_collection_failed(); // We just did a full collection clear_should_allocate_from_space(); // if set } @@ -943,16 +908,12 @@ void DefNewGeneration::gc_epilogue(bool full) { // a full collection in between. if (!seen_incremental_collection_failed && gch->incremental_collection_failed()) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("DefNewEpilogue: cause(%s), not full, not_seen_failed, failed, set_seen_failed", + log_trace(gc)("DefNewEpilogue: cause(%s), not full, not_seen_failed, failed, set_seen_failed", GCCause::to_string(gch->gc_cause())); - } seen_incremental_collection_failed = true; } else if (seen_incremental_collection_failed) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("DefNewEpilogue: cause(%s), not full, seen_failed, will_clear_seen_failed", + log_trace(gc)("DefNewEpilogue: cause(%s), not full, seen_failed, will_clear_seen_failed", GCCause::to_string(gch->gc_cause())); - } assert(gch->gc_cause() == GCCause::_scavenge_alot || (GCCause::is_user_requested_gc(gch->gc_cause()) && UseConcMarkSweepGC && ExplicitGCInvokesConcurrent) || !gch->incremental_collection_failed(), diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp index c62b8606ba8..f537a6d6a4f 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp @@ -339,7 +339,6 @@ protected: virtual const char* name() const; virtual const char* short_name() const { return "DefNew"; } - // PrintHeapAtGC support. void print_on(outputStream* st) const; void verify(); diff --git a/hotspot/src/share/vm/gc/serial/genMarkSweep.cpp b/hotspot/src/share/vm/gc/serial/genMarkSweep.cpp index 20fd3d02ae8..8bb4c203a16 100644 --- a/hotspot/src/share/vm/gc/serial/genMarkSweep.cpp +++ b/hotspot/src/share/vm/gc/serial/genMarkSweep.cpp @@ -35,7 +35,7 @@ #include "gc/shared/gcHeapSummary.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/generation.hpp" #include "gc/shared/genOopClosures.inline.hpp" @@ -71,8 +71,6 @@ void GenMarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, bool clear_all_so set_ref_processor(rp); rp->setup_policy(clear_all_softrefs); - GCTraceTime t1(GCCauseString("Full GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL); - gch->trace_heap_before_gc(_gc_tracer); // When collecting the permanent generation Method*s may be moving, @@ -82,9 +80,6 @@ void GenMarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, bool clear_all_so // Increment the invocation count _total_invocations++; - // Capture heap size before collection for printing. - size_t gch_prev_used = gch->used(); - // Capture used regions for each generation that will be // subject to collection, so that card table adjustments can // be made intelligently (see clear / invalidate further below). @@ -134,10 +129,6 @@ void GenMarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, bool clear_all_so CodeCache::gc_epilogue(); JvmtiExport::gc_epilogue(); - if (PrintGC && !PrintGCDetails) { - gch->print_heap_change(gch_prev_used); - } - // refs processing: clean slate set_ref_processor(NULL); @@ -189,7 +180,7 @@ void GenMarkSweep::deallocate_stacks() { void GenMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { // Recursively traverse all live objects and mark them - GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 1: Mark live objects", _gc_timer); GenCollectedHeap* gch = GenCollectedHeap::heap(); @@ -262,7 +253,7 @@ void GenMarkSweep::mark_sweep_phase2() { GenCollectedHeap* gch = GenCollectedHeap::heap(); - GCTraceTime tm("phase 2", PrintGC && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 2: Compute new object addresses", _gc_timer); gch->prepare_for_compaction(); } @@ -278,7 +269,7 @@ void GenMarkSweep::mark_sweep_phase3() { GenCollectedHeap* gch = GenCollectedHeap::heap(); // Adjust the pointers to reflect the new locations - GCTraceTime tm("phase 3", PrintGC && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 3: Adjust pointers", _gc_timer); // Need new claim bits for the pointer adjustment tracing. ClassLoaderDataGraph::clear_claimed_marks(); @@ -330,7 +321,7 @@ void GenMarkSweep::mark_sweep_phase4() { // to use a higher index (saved from phase2) when verifying perm_gen. GenCollectedHeap* gch = GenCollectedHeap::heap(); - GCTraceTime tm("phase 4", PrintGC && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 4: Move objects", _gc_timer); GenCompactClosure blk; gch->generation_iterate(&blk, true); diff --git a/hotspot/src/share/vm/gc/serial/markSweep.cpp b/hotspot/src/share/vm/gc/serial/markSweep.cpp index 52f284624f9..489fe2a0cd0 100644 --- a/hotspot/src/share/vm/gc/serial/markSweep.cpp +++ b/hotspot/src/share/vm/gc/serial/markSweep.cpp @@ -250,10 +250,7 @@ void MarkSweep::adjust_marks() { void MarkSweep::restore_marks() { assert(_preserved_oop_stack.size() == _preserved_mark_stack.size(), "inconsistent preserved oop stacks"); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("Restoring " SIZE_FORMAT " marks", - _preserved_count + _preserved_oop_stack.size()); - } + log_trace(gc)("Restoring " SIZE_FORMAT " marks", _preserved_count + _preserved_oop_stack.size()); // restore the marks we saved earlier for (size_t i = 0; i < _preserved_count; i++) { @@ -305,20 +302,13 @@ template static void trace_reference_gc(const char *s, oop obj, T* referent_addr, T* next_addr, T* discovered_addr) { - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("%s obj " PTR_FORMAT, s, p2i(obj)); - gclog_or_tty->print_cr(" referent_addr/* " PTR_FORMAT " / " - PTR_FORMAT, p2i(referent_addr), - p2i(referent_addr ? - (address)oopDesc::load_decode_heap_oop(referent_addr) : NULL)); - gclog_or_tty->print_cr(" next_addr/* " PTR_FORMAT " / " - PTR_FORMAT, p2i(next_addr), - p2i(next_addr ? (address)oopDesc::load_decode_heap_oop(next_addr) : NULL)); - gclog_or_tty->print_cr(" discovered_addr/* " PTR_FORMAT " / " - PTR_FORMAT, p2i(discovered_addr), - p2i(discovered_addr ? - (address)oopDesc::load_decode_heap_oop(discovered_addr) : NULL)); - } + log_develop_trace(gc, ref)("%s obj " PTR_FORMAT, s, p2i(obj)); + log_develop_trace(gc, ref)(" referent_addr/* " PTR_FORMAT " / " PTR_FORMAT, + p2i(referent_addr), p2i(referent_addr ? (address)oopDesc::load_decode_heap_oop(referent_addr) : NULL)); + log_develop_trace(gc, ref)(" next_addr/* " PTR_FORMAT " / " PTR_FORMAT, + p2i(next_addr), p2i(next_addr ? (address)oopDesc::load_decode_heap_oop(next_addr) : NULL)); + log_develop_trace(gc, ref)(" discovered_addr/* " PTR_FORMAT " / " PTR_FORMAT, + p2i(discovered_addr), p2i(discovered_addr ? (address)oopDesc::load_decode_heap_oop(discovered_addr) : NULL)); } #endif diff --git a/hotspot/src/share/vm/gc/serial/tenuredGeneration.cpp b/hotspot/src/share/vm/gc/serial/tenuredGeneration.cpp index 8a526938e10..a4958b71d3a 100644 --- a/hotspot/src/share/vm/gc/serial/tenuredGeneration.cpp +++ b/hotspot/src/share/vm/gc/serial/tenuredGeneration.cpp @@ -32,6 +32,7 @@ #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/generationSpec.hpp" #include "gc/shared/space.hpp" +#include "logging/log.hpp" #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" @@ -81,42 +82,28 @@ bool TenuredGeneration::should_collect(bool full, // why it returns what it returns (without re-evaluating the conditionals // in case they aren't idempotent), so I'm doing it this way. // DeMorgan says it's okay. - bool result = false; - if (!result && full) { - result = true; - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("TenuredGeneration::should_collect: because" - " full"); - } + if (full) { + log_trace(gc)("TenuredGeneration::should_collect: because full"); + return true; } - if (!result && should_allocate(size, is_tlab)) { - result = true; - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("TenuredGeneration::should_collect: because" - " should_allocate(" SIZE_FORMAT ")", - size); - } + if (should_allocate(size, is_tlab)) { + log_trace(gc)("TenuredGeneration::should_collect: because should_allocate(" SIZE_FORMAT ")", size); + return true; } // If we don't have very much free space. // XXX: 10000 should be a percentage of the capacity!!! - if (!result && free() < 10000) { - result = true; - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("TenuredGeneration::should_collect: because" - " free(): " SIZE_FORMAT, - free()); - } + if (free() < 10000) { + log_trace(gc)("TenuredGeneration::should_collect: because free(): " SIZE_FORMAT, free()); + return true; } // If we had to expand to accommodate promotions from the young generation - if (!result && _capacity_at_prologue < capacity()) { - result = true; - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("TenuredGeneration::should_collect: because" - "_capacity_at_prologue: " SIZE_FORMAT " < capacity(): " SIZE_FORMAT, - _capacity_at_prologue, capacity()); - } + if (_capacity_at_prologue < capacity()) { + log_trace(gc)("TenuredGeneration::should_collect: because_capacity_at_prologue: " SIZE_FORMAT " < capacity(): " SIZE_FORMAT, + _capacity_at_prologue, capacity()); + return true; } - return result; + + return false; } void TenuredGeneration::compute_new_size() { @@ -165,13 +152,10 @@ bool TenuredGeneration::promotion_attempt_is_safe(size_t max_promotion_in_bytes) size_t available = max_contiguous_available(); size_t av_promo = (size_t)gc_stats()->avg_promoted()->padded_average(); bool res = (available >= av_promo) || (available >= max_promotion_in_bytes); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr( - "Tenured: promo attempt is%s safe: available(" SIZE_FORMAT ") %s av_promo(" SIZE_FORMAT ")," - "max_promo(" SIZE_FORMAT ")", - res? "":" not", available, res? ">=":"<", - av_promo, max_promotion_in_bytes); - } + + log_trace(gc)("Tenured: promo attempt is%s safe: available(" SIZE_FORMAT ") %s av_promo(" SIZE_FORMAT "), max_promo(" SIZE_FORMAT ")", + res? "":" not", available, res? ">=":"<", av_promo, max_promotion_in_bytes); + return res; } diff --git a/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.cpp b/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.cpp index 2b7f3f747c2..8365c62766f 100644 --- a/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.cpp +++ b/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.cpp @@ -27,6 +27,7 @@ #include "gc/shared/collectorPolicy.hpp" #include "gc/shared/gcCause.hpp" #include "gc/shared/workgroup.hpp" +#include "logging/log.hpp" #include "runtime/timer.hpp" #include "utilities/ostream.hpp" elapsedTimer AdaptiveSizePolicy::_minor_timer; @@ -166,14 +167,12 @@ uint AdaptiveSizePolicy::calc_default_active_workers(uintx total_workers, "Jiggled active workers too much"); } - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("GCTaskManager::calc_default_active_workers() : " - "active_workers(): " UINTX_FORMAT " new_active_workers: " UINTX_FORMAT " " - "prev_active_workers: " UINTX_FORMAT "\n" - " active_workers_by_JT: " UINTX_FORMAT " active_workers_by_heap_size: " UINTX_FORMAT, - active_workers, new_active_workers, prev_active_workers, - active_workers_by_JT, active_workers_by_heap_size); - } + log_trace(gc, task)("GCTaskManager::calc_default_active_workers() : " + "active_workers(): " UINTX_FORMAT " new_active_workers: " UINTX_FORMAT " " + "prev_active_workers: " UINTX_FORMAT "\n" + " active_workers_by_JT: " UINTX_FORMAT " active_workers_by_heap_size: " UINTX_FORMAT, + active_workers, new_active_workers, prev_active_workers, + active_workers_by_JT, active_workers_by_heap_size); assert(new_active_workers > 0, "Always need at least 1"); return new_active_workers; } @@ -275,14 +274,10 @@ void AdaptiveSizePolicy::minor_collection_end(GCCause::Cause gc_cause) { update_minor_pause_young_estimator(minor_pause_in_ms); update_minor_pause_old_estimator(minor_pause_in_ms); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print("AdaptiveSizePolicy::minor_collection_end: " - "minor gc cost: %f average: %f", collection_cost, - _avg_minor_gc_cost->average()); - gclog_or_tty->print_cr(" minor pause: %f minor period %f", - minor_pause_in_ms, - _latest_minor_mutator_interval_seconds * MILLIUNITS); - } + log_trace(gc, ergo)("AdaptiveSizePolicy::minor_collection_end: minor gc cost: %f average: %f", + collection_cost, _avg_minor_gc_cost->average()); + log_trace(gc, ergo)(" minor pause: %f minor period %f", + minor_pause_in_ms, _latest_minor_mutator_interval_seconds * MILLIUNITS); // Calculate variable used to estimate collection cost vs. gen sizes assert(collection_cost >= 0.0, "Expected to be non-negative"); @@ -388,13 +383,10 @@ double AdaptiveSizePolicy::decaying_gc_cost() const { // Decay using the time-since-last-major-gc decayed_major_gc_cost = decaying_major_gc_cost(); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("\ndecaying_gc_cost: major interval average:" - " %f time since last major gc: %f", - avg_major_interval, time_since_last_major_gc); - gclog_or_tty->print_cr(" major gc cost: %f decayed major gc cost: %f", - major_gc_cost(), decayed_major_gc_cost); - } + log_trace(gc, ergo)("decaying_gc_cost: major interval average: %f time since last major gc: %f", + avg_major_interval, time_since_last_major_gc); + log_trace(gc, ergo)(" major gc cost: %f decayed major gc cost: %f", + major_gc_cost(), decayed_major_gc_cost); } } double result = MIN2(1.0, decayed_major_gc_cost + minor_gc_cost()); @@ -461,21 +453,17 @@ void AdaptiveSizePolicy::check_gc_overhead_limit( promo_limit = MAX2(promo_limit, _promo_size); - if (PrintAdaptiveSizePolicy && (Verbose || - (free_in_old_gen < (size_t) mem_free_old_limit && - free_in_eden < (size_t) mem_free_eden_limit))) { - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::check_gc_overhead_limit:" - " promo_limit: " SIZE_FORMAT - " max_eden_size: " SIZE_FORMAT - " total_free_limit: " SIZE_FORMAT - " max_old_gen_size: " SIZE_FORMAT - " max_eden_size: " SIZE_FORMAT - " mem_free_limit: " SIZE_FORMAT, - promo_limit, max_eden_size, total_free_limit, - max_old_gen_size, max_eden_size, - (size_t) mem_free_limit); - } + log_trace(gc, ergo)( + "PSAdaptiveSizePolicy::check_gc_overhead_limit:" + " promo_limit: " SIZE_FORMAT + " max_eden_size: " SIZE_FORMAT + " total_free_limit: " SIZE_FORMAT + " max_old_gen_size: " SIZE_FORMAT + " max_eden_size: " SIZE_FORMAT + " mem_free_limit: " SIZE_FORMAT, + promo_limit, max_eden_size, total_free_limit, + max_old_gen_size, max_eden_size, + (size_t) mem_free_limit); bool print_gc_overhead_limit_would_be_exceeded = false; if (is_full_gc) { @@ -521,10 +509,7 @@ void AdaptiveSizePolicy::check_gc_overhead_limit( bool near_limit = gc_overhead_limit_near(); if (near_limit) { collector_policy->set_should_clear_all_soft_refs(true); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr(" Nearing GC overhead limit, " - "will be clearing all SoftReference"); - } + log_trace(gc, ergo)("Nearing GC overhead limit, will be clearing all SoftReference"); } } } @@ -540,26 +525,25 @@ void AdaptiveSizePolicy::check_gc_overhead_limit( } } - if (UseGCOverheadLimit && PrintGCDetails && Verbose) { + if (UseGCOverheadLimit) { if (gc_overhead_limit_exceeded()) { - gclog_or_tty->print_cr(" GC is exceeding overhead limit " - "of " UINTX_FORMAT "%%", GCTimeLimit); + log_trace(gc, ergo)("GC is exceeding overhead limit of " UINTX_FORMAT "%%", GCTimeLimit); reset_gc_overhead_limit_count(); } else if (print_gc_overhead_limit_would_be_exceeded) { assert(gc_overhead_limit_count() > 0, "Should not be printing"); - gclog_or_tty->print_cr(" GC would exceed overhead limit " - "of " UINTX_FORMAT "%% %d consecutive time(s)", - GCTimeLimit, gc_overhead_limit_count()); + log_trace(gc, ergo)("GC would exceed overhead limit of " UINTX_FORMAT "%% %d consecutive time(s)", + GCTimeLimit, gc_overhead_limit_count()); } } } // Printing -bool AdaptiveSizePolicy::print_adaptive_size_policy_on(outputStream* st) const { +bool AdaptiveSizePolicy::print() const { + assert(UseAdaptiveSizePolicy, "UseAdaptiveSizePolicy need to be enabled."); - // Should only be used with adaptive size policy turned on. - // Otherwise, there may be variables that are undefined. - if (!UseAdaptiveSizePolicy) return false; + if (!log_is_enabled(Debug, gc, ergo)) { + return false; + } // Print goal for which action is needed. char* action = NULL; @@ -627,41 +611,24 @@ bool AdaptiveSizePolicy::print_adaptive_size_policy_on(outputStream* st) const { tenured_gen_action = shrink_msg; } - st->print_cr(" UseAdaptiveSizePolicy actions to meet %s", action); - st->print_cr(" GC overhead (%%)"); - st->print_cr(" Young generation: %7.2f\t %s", - 100.0 * avg_minor_gc_cost()->average(), - young_gen_action); - st->print_cr(" Tenured generation: %7.2f\t %s", - 100.0 * avg_major_gc_cost()->average(), - tenured_gen_action); + log_debug(gc, ergo)("UseAdaptiveSizePolicy actions to meet %s", action); + log_debug(gc, ergo)(" GC overhead (%%)"); + log_debug(gc, ergo)(" Young generation: %7.2f\t %s", + 100.0 * avg_minor_gc_cost()->average(), young_gen_action); + log_debug(gc, ergo)(" Tenured generation: %7.2f\t %s", + 100.0 * avg_major_gc_cost()->average(), tenured_gen_action); return true; } -bool AdaptiveSizePolicy::print_adaptive_size_policy_on( - outputStream* st, - uint tenuring_threshold_arg) const { - if (!AdaptiveSizePolicy::print_adaptive_size_policy_on(st)) { - return false; - } - +void AdaptiveSizePolicy::print_tenuring_threshold( uint new_tenuring_threshold_arg) const { // Tenuring threshold - bool tenuring_threshold_changed = true; if (decrement_tenuring_threshold_for_survivor_limit()) { - st->print(" Tenuring threshold: (attempted to decrease to avoid" - " survivor space overflow) = "); + log_debug(gc, ergo)("Tenuring threshold: (attempted to decrease to avoid survivor space overflow) = %u", new_tenuring_threshold_arg); } else if (decrement_tenuring_threshold_for_gc_cost()) { - st->print(" Tenuring threshold: (attempted to decrease to balance" - " GC costs) = "); + log_debug(gc, ergo)("Tenuring threshold: (attempted to decrease to balance GC costs) = %u", new_tenuring_threshold_arg); } else if (increment_tenuring_threshold_for_gc_cost()) { - st->print(" Tenuring threshold: (attempted to increase to balance" - " GC costs) = "); + log_debug(gc, ergo)("Tenuring threshold: (attempted to increase to balance GC costs) = %u", new_tenuring_threshold_arg); } else { - tenuring_threshold_changed = false; assert(!tenuring_threshold_change(), "(no change was attempted)"); } - if (tenuring_threshold_changed) { - st->print_cr("%u", tenuring_threshold_arg); - } - return true; } diff --git a/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.hpp b/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.hpp index 49c2b945fc9..eb483623d20 100644 --- a/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.hpp +++ b/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.hpp @@ -28,6 +28,7 @@ #include "gc/shared/collectedHeap.hpp" #include "gc/shared/gcCause.hpp" #include "gc/shared/gcUtil.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/universe.hpp" @@ -500,9 +501,8 @@ class AdaptiveSizePolicy : public CHeapObj { } // Printing support - virtual bool print_adaptive_size_policy_on(outputStream* st) const; - bool print_adaptive_size_policy_on(outputStream* st, - uint tenuring_threshold) const; + virtual bool print() const; + void print_tenuring_threshold(uint new_tenuring_threshold) const; }; // Class that can be used to print information about the @@ -510,46 +510,26 @@ class AdaptiveSizePolicy : public CHeapObj { // AdaptiveSizePolicyOutputInterval. Only print information // if an adaptive size policy is in use. class AdaptiveSizePolicyOutput : StackObj { - AdaptiveSizePolicy* _size_policy; - bool _do_print; - bool print_test(uint count) { - // A count of zero is a special value that indicates that the - // interval test should be ignored. An interval is of zero is - // a special value that indicates that the interval test should - // always fail (never do the print based on the interval test). - return PrintGCDetails && + static bool enabled() { + return UseParallelGC && UseAdaptiveSizePolicy && - UseParallelGC && - (AdaptiveSizePolicyOutputInterval > 0) && - ((count == 0) || - ((count % AdaptiveSizePolicyOutputInterval) == 0)); + log_is_enabled(Debug, gc, ergo); } public: - // The special value of a zero count can be used to ignore - // the count test. - AdaptiveSizePolicyOutput(uint count) { - if (UseAdaptiveSizePolicy && (AdaptiveSizePolicyOutputInterval > 0)) { - CollectedHeap* heap = Universe::heap(); - _size_policy = heap->size_policy(); - _do_print = print_test(count); - } else { - _size_policy = NULL; - _do_print = false; + static void print() { + if (enabled()) { + Universe::heap()->size_policy()->print(); } } - AdaptiveSizePolicyOutput(AdaptiveSizePolicy* size_policy, - uint count) : - _size_policy(size_policy) { - if (UseAdaptiveSizePolicy && (AdaptiveSizePolicyOutputInterval > 0)) { - _do_print = print_test(count); - } else { - _do_print = false; - } - } - ~AdaptiveSizePolicyOutput() { - if (_do_print) { - assert(UseAdaptiveSizePolicy, "Should not be in use"); - _size_policy->print_adaptive_size_policy_on(gclog_or_tty); + + static void print(AdaptiveSizePolicy* size_policy, uint count) { + bool do_print = + enabled() && + (AdaptiveSizePolicyOutputInterval > 0) && + (count % AdaptiveSizePolicyOutputInterval) == 0; + + if (do_print) { + size_policy->print(); } } }; diff --git a/hotspot/src/share/vm/gc/shared/ageTable.cpp b/hotspot/src/share/vm/gc/shared/ageTable.cpp index 638ce40c7ec..2b9b46321c2 100644 --- a/hotspot/src/share/vm/gc/shared/ageTable.cpp +++ b/hotspot/src/share/vm/gc/shared/ageTable.cpp @@ -28,6 +28,7 @@ #include "gc/shared/collectorPolicy.hpp" #include "gc/shared/gcPolicyCounters.hpp" #include "memory/resourceArea.hpp" +#include "logging/log.hpp" #include "utilities/copy.hpp" /* Copyright (c) 1992, 2015, Oracle and/or its affiliates, and Stanford University. @@ -94,24 +95,18 @@ uint ageTable::compute_tenuring_threshold(size_t survivor_capacity, GCPolicyCoun result = age < MaxTenuringThreshold ? age : MaxTenuringThreshold; } - if (PrintTenuringDistribution || UsePerfData) { - if (PrintTenuringDistribution) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold " - UINTX_FORMAT " (max threshold " UINTX_FORMAT ")", - desired_survivor_size*oopSize, (uintx) result, MaxTenuringThreshold); - } + log_debug(gc, age)("Desired survivor size " SIZE_FORMAT " bytes, new threshold " UINTX_FORMAT " (max threshold " UINTX_FORMAT ")", + desired_survivor_size*oopSize, (uintx) result, MaxTenuringThreshold); + if (log_is_enabled(Trace, gc, age) || UsePerfData) { size_t total = 0; uint age = 1; while (age < table_size) { total += sizes[age]; if (sizes[age] > 0) { - if (PrintTenuringDistribution) { - gclog_or_tty->print_cr("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total", - age, sizes[age]*oopSize, total*oopSize); - } + log_trace(gc, age)("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total", + age, sizes[age]*oopSize, total*oopSize); } if (UsePerfData) { _perf_sizes[age]->set_value(sizes[age]*oopSize); diff --git a/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp b/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp index 9bf2eb5bdb1..9588d223bba 100644 --- a/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp @@ -28,6 +28,7 @@ #include "gc/shared/space.inline.hpp" #include "memory/iterator.hpp" #include "memory/universe.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" #include "services/memTracker.hpp" @@ -53,19 +54,11 @@ BlockOffsetSharedArray::BlockOffsetSharedArray(MemRegion reserved, } _offset_array = (u_char*)_vs.low_boundary(); resize(init_word_size); - if (TraceBlockOffsetTable) { - gclog_or_tty->print_cr("BlockOffsetSharedArray::BlockOffsetSharedArray: "); - gclog_or_tty->print_cr(" " - " rs.base(): " INTPTR_FORMAT - " rs.size(): " INTPTR_FORMAT - " rs end(): " INTPTR_FORMAT, - p2i(rs.base()), rs.size(), p2i(rs.base() + rs.size())); - gclog_or_tty->print_cr(" " - " _vs.low_boundary(): " INTPTR_FORMAT - " _vs.high_boundary(): " INTPTR_FORMAT, - p2i(_vs.low_boundary()), - p2i(_vs.high_boundary())); - } + log_trace(gc, bot)("BlockOffsetSharedArray::BlockOffsetSharedArray: "); + log_trace(gc, bot)(" rs.base(): " INTPTR_FORMAT " rs.size(): " INTPTR_FORMAT " rs end(): " INTPTR_FORMAT, + p2i(rs.base()), rs.size(), p2i(rs.base() + rs.size())); + log_trace(gc, bot)(" _vs.low_boundary(): " INTPTR_FORMAT " _vs.high_boundary(): " INTPTR_FORMAT, + p2i(_vs.low_boundary()), p2i(_vs.high_boundary())); } void BlockOffsetSharedArray::resize(size_t new_word_size) { diff --git a/hotspot/src/share/vm/gc/shared/cardGeneration.cpp b/hotspot/src/share/vm/gc/shared/cardGeneration.cpp index 1eff9c9fa3a..c43f0822358 100644 --- a/hotspot/src/share/vm/gc/shared/cardGeneration.cpp +++ b/hotspot/src/share/vm/gc/shared/cardGeneration.cpp @@ -33,6 +33,7 @@ #include "gc/shared/space.inline.hpp" #include "memory/iterator.hpp" #include "memory/memRegion.hpp" +#include "logging/log.hpp" #include "runtime/java.hpp" CardGeneration::CardGeneration(ReservedSpace rs, @@ -96,13 +97,10 @@ bool CardGeneration::grow_by(size_t bytes) { // update the space and generation capacity counters update_counters(); - if (Verbose && PrintGC) { - size_t new_mem_size = _virtual_space.committed_size(); - size_t old_mem_size = new_mem_size - bytes; - gclog_or_tty->print_cr("Expanding %s from " SIZE_FORMAT "K by " - SIZE_FORMAT "K to " SIZE_FORMAT "K", - name(), old_mem_size/K, bytes/K, new_mem_size/K); - } + size_t new_mem_size = _virtual_space.committed_size(); + size_t old_mem_size = new_mem_size - bytes; + log_trace(gc, heap)("Expanding %s from " SIZE_FORMAT "K by " SIZE_FORMAT "K to " SIZE_FORMAT "K", + name(), old_mem_size/K, bytes/K, new_mem_size/K); } return result; } @@ -133,10 +131,8 @@ bool CardGeneration::expand(size_t bytes, size_t expand_bytes) { if (!success) { success = grow_to_reserved(); } - if (PrintGC && Verbose) { - if (success && GC_locker::is_active_and_needs_gc()) { - gclog_or_tty->print_cr("Garbage collection disabled, expanded heap instead"); - } + if (success && GC_locker::is_active_and_needs_gc()) { + log_trace(gc, heap)("Garbage collection disabled, expanded heap instead"); } return success; @@ -172,12 +168,10 @@ void CardGeneration::shrink(size_t bytes) { // Shrink the card table GenCollectedHeap::heap()->barrier_set()->resize_covered_region(mr); - if (Verbose && PrintGC) { - size_t new_mem_size = _virtual_space.committed_size(); - size_t old_mem_size = new_mem_size + size; - gclog_or_tty->print_cr("Shrinking %s from " SIZE_FORMAT "K to " SIZE_FORMAT "K", - name(), old_mem_size/K, new_mem_size/K); - } + size_t new_mem_size = _virtual_space.committed_size(); + size_t old_mem_size = new_mem_size + size; + log_trace(gc, heap)("Shrinking %s from " SIZE_FORMAT "K to " SIZE_FORMAT "K", + name(), old_mem_size/K, new_mem_size/K); } // No young generation references, clear this generation's cards. @@ -211,26 +205,17 @@ void CardGeneration::compute_new_size() { minimum_desired_capacity = MAX2(minimum_desired_capacity, initial_size()); assert(used_after_gc <= minimum_desired_capacity, "sanity check"); - if (PrintGC && Verbose) { const size_t free_after_gc = free(); const double free_percentage = ((double)free_after_gc) / capacity_after_gc; - gclog_or_tty->print_cr("TenuredGeneration::compute_new_size: "); - gclog_or_tty->print_cr(" " - " minimum_free_percentage: %6.2f" - " maximum_used_percentage: %6.2f", + log_trace(gc, heap)("TenuredGeneration::compute_new_size:"); + log_trace(gc, heap)(" minimum_free_percentage: %6.2f maximum_used_percentage: %6.2f", minimum_free_percentage, maximum_used_percentage); - gclog_or_tty->print_cr(" " - " free_after_gc : %6.1fK" - " used_after_gc : %6.1fK" - " capacity_after_gc : %6.1fK", + log_trace(gc, heap)(" free_after_gc : %6.1fK used_after_gc : %6.1fK capacity_after_gc : %6.1fK", free_after_gc / (double) K, used_after_gc / (double) K, capacity_after_gc / (double) K); - gclog_or_tty->print_cr(" " - " free_percentage: %6.2f", - free_percentage); - } + log_trace(gc, heap)(" free_percentage: %6.2f", free_percentage); if (capacity_after_gc < minimum_desired_capacity) { // If we have less free space than we want then expand @@ -239,15 +224,10 @@ void CardGeneration::compute_new_size() { if (expand_bytes >= _min_heap_delta_bytes) { expand(expand_bytes, 0); // safe if expansion fails } - if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" expanding:" - " minimum_desired_capacity: %6.1fK" - " expand_bytes: %6.1fK" - " _min_heap_delta_bytes: %6.1fK", - minimum_desired_capacity / (double) K, - expand_bytes / (double) K, - _min_heap_delta_bytes / (double) K); - } + log_trace(gc, heap)(" expanding: minimum_desired_capacity: %6.1fK expand_bytes: %6.1fK _min_heap_delta_bytes: %6.1fK", + minimum_desired_capacity / (double) K, + expand_bytes / (double) K, + _min_heap_delta_bytes / (double) K); return; } @@ -262,20 +242,12 @@ void CardGeneration::compute_new_size() { const double max_tmp = used_after_gc / minimum_used_percentage; size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx)); maximum_desired_capacity = MAX2(maximum_desired_capacity, initial_size()); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" " - " maximum_free_percentage: %6.2f" - " minimum_used_percentage: %6.2f", - maximum_free_percentage, - minimum_used_percentage); - gclog_or_tty->print_cr(" " - " _capacity_at_prologue: %6.1fK" - " minimum_desired_capacity: %6.1fK" - " maximum_desired_capacity: %6.1fK", + log_trace(gc, heap)(" maximum_free_percentage: %6.2f minimum_used_percentage: %6.2f", + maximum_free_percentage, minimum_used_percentage); + log_trace(gc, heap)(" _capacity_at_prologue: %6.1fK minimum_desired_capacity: %6.1fK maximum_desired_capacity: %6.1fK", _capacity_at_prologue / (double) K, minimum_desired_capacity / (double) K, maximum_desired_capacity / (double) K); - } assert(minimum_desired_capacity <= maximum_desired_capacity, "sanity check"); @@ -295,23 +267,13 @@ void CardGeneration::compute_new_size() { } else { _shrink_factor = MIN2(current_shrink_factor * 4, (size_t) 100); } - if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" " - " shrinking:" - " initSize: %.1fK" - " maximum_desired_capacity: %.1fK", - initial_size() / (double) K, - maximum_desired_capacity / (double) K); - gclog_or_tty->print_cr(" " - " shrink_bytes: %.1fK" - " current_shrink_factor: " SIZE_FORMAT - " new shrink factor: " SIZE_FORMAT - " _min_heap_delta_bytes: %.1fK", + log_trace(gc, heap)(" shrinking: initSize: %.1fK maximum_desired_capacity: %.1fK", + initial_size() / (double) K, maximum_desired_capacity / (double) K); + log_trace(gc, heap)(" shrink_bytes: %.1fK current_shrink_factor: " SIZE_FORMAT " new shrink factor: " SIZE_FORMAT " _min_heap_delta_bytes: %.1fK", shrink_bytes / (double) K, current_shrink_factor, _shrink_factor, _min_heap_delta_bytes / (double) K); - } } } @@ -324,18 +286,11 @@ void CardGeneration::compute_new_size() { // We have two shrinking computations, take the largest shrink_bytes = MAX2(shrink_bytes, expansion_for_promotion); assert(shrink_bytes <= max_shrink_bytes, "invalid shrink size"); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" " - " aggressive shrinking:" - " _capacity_at_prologue: %.1fK" - " capacity_after_gc: %.1fK" - " expansion_for_promotion: %.1fK" - " shrink_bytes: %.1fK", - capacity_after_gc / (double) K, - _capacity_at_prologue / (double) K, - expansion_for_promotion / (double) K, - shrink_bytes / (double) K); - } + log_trace(gc, heap)(" aggressive shrinking: _capacity_at_prologue: %.1fK capacity_after_gc: %.1fK expansion_for_promotion: %.1fK shrink_bytes: %.1fK", + capacity_after_gc / (double) K, + _capacity_at_prologue / (double) K, + expansion_for_promotion / (double) K, + shrink_bytes / (double) K); } // Don't shrink unless it's significant if (shrink_bytes >= _min_heap_delta_bytes) { diff --git a/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp b/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp index 45ad7777201..ec37fb7cd9f 100644 --- a/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp @@ -28,6 +28,7 @@ #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/space.inline.hpp" #include "memory/virtualspace.hpp" +#include "logging/log.hpp" #include "services/memTracker.hpp" #include "utilities/macros.hpp" @@ -115,17 +116,10 @@ void CardTableModRefBS::initialize() { !ExecMem, "card table last card"); *guard_card = last_card; - if (TraceCardTableModRefBS) { - gclog_or_tty->print_cr("CardTableModRefBS::CardTableModRefBS: "); - gclog_or_tty->print_cr(" " - " &_byte_map[0]: " INTPTR_FORMAT - " &_byte_map[_last_valid_index]: " INTPTR_FORMAT, - p2i(&_byte_map[0]), - p2i(&_byte_map[_last_valid_index])); - gclog_or_tty->print_cr(" " - " byte_map_base: " INTPTR_FORMAT, - p2i(byte_map_base)); - } + log_trace(gc, barrier)("CardTableModRefBS::CardTableModRefBS: "); + log_trace(gc, barrier)(" &_byte_map[0]: " INTPTR_FORMAT " &_byte_map[_last_valid_index]: " INTPTR_FORMAT, + p2i(&_byte_map[0]), p2i(&_byte_map[_last_valid_index])); + log_trace(gc, barrier)(" byte_map_base: " INTPTR_FORMAT, p2i(byte_map_base)); } CardTableModRefBS::~CardTableModRefBS() { @@ -350,29 +344,17 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) { } // In any case, the covered size changes. _covered[ind].set_word_size(new_region.word_size()); - if (TraceCardTableModRefBS) { - gclog_or_tty->print_cr("CardTableModRefBS::resize_covered_region: "); - gclog_or_tty->print_cr(" " - " _covered[%d].start(): " INTPTR_FORMAT - " _covered[%d].last(): " INTPTR_FORMAT, - ind, p2i(_covered[ind].start()), - ind, p2i(_covered[ind].last())); - gclog_or_tty->print_cr(" " - " _committed[%d].start(): " INTPTR_FORMAT - " _committed[%d].last(): " INTPTR_FORMAT, - ind, p2i(_committed[ind].start()), - ind, p2i(_committed[ind].last())); - gclog_or_tty->print_cr(" " - " byte_for(start): " INTPTR_FORMAT - " byte_for(last): " INTPTR_FORMAT, - p2i(byte_for(_covered[ind].start())), - p2i(byte_for(_covered[ind].last()))); - gclog_or_tty->print_cr(" " - " addr_for(start): " INTPTR_FORMAT - " addr_for(last): " INTPTR_FORMAT, - p2i(addr_for((jbyte*) _committed[ind].start())), - p2i(addr_for((jbyte*) _committed[ind].last()))); - } + + log_trace(gc, barrier)("CardTableModRefBS::resize_covered_region: "); + log_trace(gc, barrier)(" _covered[%d].start(): " INTPTR_FORMAT " _covered[%d].last(): " INTPTR_FORMAT, + ind, p2i(_covered[ind].start()), ind, p2i(_covered[ind].last())); + log_trace(gc, barrier)(" _committed[%d].start(): " INTPTR_FORMAT " _committed[%d].last(): " INTPTR_FORMAT, + ind, p2i(_committed[ind].start()), ind, p2i(_committed[ind].last())); + log_trace(gc, barrier)(" byte_for(start): " INTPTR_FORMAT " byte_for(last): " INTPTR_FORMAT, + p2i(byte_for(_covered[ind].start())), p2i(byte_for(_covered[ind].last()))); + log_trace(gc, barrier)(" addr_for(start): " INTPTR_FORMAT " addr_for(last): " INTPTR_FORMAT, + p2i(addr_for((jbyte*) _committed[ind].start())), p2i(addr_for((jbyte*) _committed[ind].last()))); + // Touch the last card of the covered region to show that it // is committed (or SEGV). debug_only((void) (*byte_for(_covered[ind].last()));) diff --git a/hotspot/src/share/vm/gc/shared/collectedHeap.cpp b/hotspot/src/share/vm/gc/shared/collectedHeap.cpp index e581bbb47c2..d0fb006d2ed 100644 --- a/hotspot/src/share/vm/gc/shared/collectedHeap.cpp +++ b/hotspot/src/share/vm/gc/shared/collectedHeap.cpp @@ -30,9 +30,10 @@ #include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/gcHeapSummary.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/gcWhen.hpp" #include "gc/shared/vmGCOperations.hpp" +#include "logging/log.hpp" #include "memory/metaspace.hpp" #include "oops/instanceMirrorKlass.hpp" #include "oops/oop.inline.hpp" @@ -53,7 +54,7 @@ void EventLogBase::print(outputStream* st, GCMessage& m) { st->print_raw(m); } -void GCHeapLog::log_heap(bool before) { +void GCHeapLog::log_heap(CollectedHeap* heap, bool before) { if (!should_log()) { return; } @@ -65,11 +66,14 @@ void GCHeapLog::log_heap(bool before) { _records[index].timestamp = timestamp; _records[index].data.is_before = before; stringStream st(_records[index].data.buffer(), _records[index].data.size()); - if (before) { - Universe::print_heap_before_gc(&st, true); - } else { - Universe::print_heap_after_gc(&st, true); - } + + st.print_cr("{Heap %s GC invocations=%u (full %u):", + before ? "before" : "after", + heap->total_collections(), + heap->total_full_collections()); + + heap->print_on(&st); + st.print_cr("}"); } VirtualSpaceSummary CollectedHeap::create_heap_space_summary() { @@ -108,20 +112,16 @@ MetaspaceSummary CollectedHeap::create_metaspace_summary() { } void CollectedHeap::print_heap_before_gc() { - if (PrintHeapAtGC) { - Universe::print_heap_before_gc(); - } + Universe::print_heap_before_gc(); if (_gc_heap_log != NULL) { - _gc_heap_log->log_heap_before(); + _gc_heap_log->log_heap_before(this); } } void CollectedHeap::print_heap_after_gc() { - if (PrintHeapAtGC) { - Universe::print_heap_after_gc(); - } + Universe::print_heap_after_gc(); if (_gc_heap_log != NULL) { - _gc_heap_log->log_heap_after(); + _gc_heap_log->log_heap_after(this); } } @@ -571,34 +571,30 @@ void CollectedHeap::resize_all_tlabs() { } } -void CollectedHeap::pre_full_gc_dump(GCTimer* timer) { - if (HeapDumpBeforeFullGC) { +void CollectedHeap::full_gc_dump(GCTimer* timer, const char* when) { + if (HeapDumpBeforeFullGC || HeapDumpAfterFullGC) { GCIdMarkAndRestore gc_id_mark; - GCTraceTime tt("Heap Dump (before full gc): ", PrintGCDetails, false, timer); - // We are doing a full collection and a heap dump before - // full collection has been requested. + FormatBuffer<> title("Heap Dump (%s full gc)", when); + GCTraceTime(Info, gc) tm(title.buffer(), timer); HeapDumper::dump_heap(); } - if (PrintClassHistogramBeforeFullGC) { + LogHandle(gc, classhisto) log; + if (log.is_trace()) { + ResourceMark rm; GCIdMarkAndRestore gc_id_mark; - GCTraceTime tt("Class Histogram (before full gc): ", PrintGCDetails, true, timer); - VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */); + FormatBuffer<> title("Class Histogram (%s full gc)", when); + GCTraceTime(Trace, gc, classhisto) tm(title.buffer(), timer); + VM_GC_HeapInspection inspector(log.trace_stream(), false /* ! full gc */); inspector.doit(); } } +void CollectedHeap::pre_full_gc_dump(GCTimer* timer) { + full_gc_dump(timer, "before"); +} + void CollectedHeap::post_full_gc_dump(GCTimer* timer) { - if (HeapDumpAfterFullGC) { - GCIdMarkAndRestore gc_id_mark; - GCTraceTime tt("Heap Dump (after full gc): ", PrintGCDetails, false, timer); - HeapDumper::dump_heap(); - } - if (PrintClassHistogramAfterFullGC) { - GCIdMarkAndRestore gc_id_mark; - GCTraceTime tt("Class Histogram (after full gc): ", PrintGCDetails, true, timer); - VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */); - inspector.doit(); - } + full_gc_dump(timer, "after"); } void CollectedHeap::initialize_reserved_region(HeapWord *start, HeapWord *end) { diff --git a/hotspot/src/share/vm/gc/shared/collectedHeap.hpp b/hotspot/src/share/vm/gc/shared/collectedHeap.hpp index d12941b14fe..b0da1f7a1f1 100644 --- a/hotspot/src/share/vm/gc/shared/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc/shared/collectedHeap.hpp @@ -58,18 +58,20 @@ class GCMessage : public FormatBuffer<1024> { GCMessage() {} }; +class CollectedHeap; + class GCHeapLog : public EventLogBase { private: - void log_heap(bool before); + void log_heap(CollectedHeap* heap, bool before); public: GCHeapLog() : EventLogBase("GC Heap History") {} - void log_heap_before() { - log_heap(true); + void log_heap_before(CollectedHeap* heap) { + log_heap(heap, true); } - void log_heap_after() { - log_heap(false); + void log_heap_after(CollectedHeap* heap) { + log_heap(heap, false); } }; @@ -195,6 +197,8 @@ class CollectedHeap : public CHeapObj { virtual Name kind() const = 0; + virtual const char* name() const = 0; + /** * Returns JNI error code JNI_ENOMEM if memory could not be allocated, * and JNI_OK on success. @@ -519,6 +523,9 @@ class CollectedHeap : public CHeapObj { virtual void prepare_for_verify() = 0; // Generate any dumps preceding or following a full gc + private: + void full_gc_dump(GCTimer* timer, const char* when); + public: void pre_full_gc_dump(GCTimer* timer); void post_full_gc_dump(GCTimer* timer); @@ -569,7 +576,7 @@ class CollectedHeap : public CHeapObj { void trace_heap_after_gc(const GCTracer* gc_tracer); // Heap verification - virtual void verify(bool silent, VerifyOption option) = 0; + virtual void verify(VerifyOption option) = 0; // Non product verification and debugging. #ifndef PRODUCT diff --git a/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp b/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp index 568de2d0ef8..223c9063b12 100644 --- a/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp @@ -32,6 +32,7 @@ #include "gc/shared/generationSpec.hpp" #include "gc/shared/space.hpp" #include "gc/shared/vmGCOperations.hpp" +#include "logging/log.hpp" #include "memory/universe.hpp" #include "runtime/arguments.hpp" #include "runtime/globals_extension.hpp" @@ -137,11 +138,8 @@ void CollectorPolicy::initialize_flags() { } void CollectorPolicy::initialize_size_info() { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("Minimum heap " SIZE_FORMAT " Initial heap " - SIZE_FORMAT " Maximum heap " SIZE_FORMAT, - _min_heap_byte_size, _initial_heap_byte_size, _max_heap_byte_size); - } + log_debug(gc, heap)("Minimum heap " SIZE_FORMAT " Initial heap " SIZE_FORMAT " Maximum heap " SIZE_FORMAT, + _min_heap_byte_size, _initial_heap_byte_size, _max_heap_byte_size); DEBUG_ONLY(CollectorPolicy::assert_size_info();) } @@ -488,11 +486,8 @@ void GenCollectorPolicy::initialize_size_info() { } } - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("1: Minimum young " SIZE_FORMAT " Initial young " - SIZE_FORMAT " Maximum young " SIZE_FORMAT, - _min_young_size, _initial_young_size, _max_young_size); - } + log_trace(gc, heap)("1: Minimum young " SIZE_FORMAT " Initial young " SIZE_FORMAT " Maximum young " SIZE_FORMAT, + _min_young_size, _initial_young_size, _max_young_size); // At this point the minimum, initial and maximum sizes // of the overall heap and of the young generation have been determined. @@ -558,11 +553,8 @@ void GenCollectorPolicy::initialize_size_info() { _initial_young_size = desired_young_size; } - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("2: Minimum young " SIZE_FORMAT " Initial young " - SIZE_FORMAT " Maximum young " SIZE_FORMAT, - _min_young_size, _initial_young_size, _max_young_size); - } + log_trace(gc, heap)("2: Minimum young " SIZE_FORMAT " Initial young " SIZE_FORMAT " Maximum young " SIZE_FORMAT, + _min_young_size, _initial_young_size, _max_young_size); } // Write back to flags if necessary. @@ -578,11 +570,8 @@ void GenCollectorPolicy::initialize_size_info() { FLAG_SET_ERGO(size_t, OldSize, _initial_old_size); } - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("Minimum old " SIZE_FORMAT " Initial old " - SIZE_FORMAT " Maximum old " SIZE_FORMAT, - _min_old_size, _initial_old_size, _max_old_size); - } + log_trace(gc, heap)("Minimum old " SIZE_FORMAT " Initial old " SIZE_FORMAT " Maximum old " SIZE_FORMAT, + _min_old_size, _initial_old_size, _max_old_size); DEBUG_ONLY(GenCollectorPolicy::assert_size_info();) } @@ -620,10 +609,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size, uint gc_count_before; // Read inside the Heap_lock locked region. { MutexLocker ml(Heap_lock); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("GenCollectorPolicy::mem_allocate_work:" - " attempting locked slow path allocation"); - } + log_trace(gc, alloc)("GenCollectorPolicy::mem_allocate_work: attempting locked slow path allocation"); // Note that only large objects get a shot at being // allocated in later generations. bool first_only = ! should_try_older_generation_allocation(size); @@ -757,9 +743,7 @@ HeapWord* GenCollectorPolicy::satisfy_failed_allocation(size_t size, is_tlab, // is_tlab GenCollectedHeap::OldGen); // max_generation } else { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print(" :: Trying full because partial may fail :: "); - } + log_trace(gc)(" :: Trying full because partial may fail :: "); // Try a full collection; see delta for bug id 6266275 // for the original code and why this has been simplified // with from-space allocation criteria modified and diff --git a/hotspot/src/share/vm/gc/shared/gcCause.hpp b/hotspot/src/share/vm/gc/shared/gcCause.hpp index 39cee93ed9c..bc9e83c62e8 100644 --- a/hotspot/src/share/vm/gc/shared/gcCause.hpp +++ b/hotspot/src/share/vm/gc/shared/gcCause.hpp @@ -125,36 +125,4 @@ class GCCause : public AllStatic { static const char* to_string(GCCause::Cause cause); }; -// Helper class for doing logging that includes the GC Cause -// as a string. -class GCCauseString : StackObj { - private: - static const int _length = 128; - char _buffer[_length]; - int _position; - - public: - GCCauseString(const char* prefix, GCCause::Cause cause) { - if (PrintGCCause) { - _position = jio_snprintf(_buffer, _length, "%s (%s) ", prefix, GCCause::to_string(cause)); - } else { - _position = jio_snprintf(_buffer, _length, "%s ", prefix); - } - assert(_position >= 0 && _position <= _length, - "Need to increase the buffer size in GCCauseString? %d", _position); - } - - GCCauseString& append(const char* str) { - int res = jio_snprintf(_buffer + _position, _length - _position, "%s", str); - _position += res; - assert(res >= 0 && _position <= _length, - "Need to increase the buffer size in GCCauseString? %d", res); - return *this; - } - - operator const char*() { - return _buffer; - } -}; - #endif // SHARE_VM_GC_SHARED_GCCAUSE_HPP diff --git a/hotspot/src/share/vm/gc/shared/gcId.cpp b/hotspot/src/share/vm/gc/shared/gcId.cpp index a87bbe9d31e..f6ef9bce386 100644 --- a/hotspot/src/share/vm/gc/shared/gcId.cpp +++ b/hotspot/src/share/vm/gc/shared/gcId.cpp @@ -26,6 +26,7 @@ #include "gc/shared/gcId.hpp" #include "runtime/safepoint.hpp" #include "runtime/thread.inline.hpp" +#include "runtime/threadLocalStorage.hpp" uint GCId::_next_id = 0; @@ -47,6 +48,18 @@ const uint GCId::current_raw() { return currentNamedthread()->gc_id(); } +size_t GCId::print_prefix(char* buf, size_t len) { + if (ThreadLocalStorage::is_initialized() && ThreadLocalStorage::thread()->is_Named_thread()) { + uint gc_id = current_raw(); + if (gc_id != undefined()) { + int ret = jio_snprintf(buf, len, "GC(%u) ", gc_id); + assert(ret > 0, "Failed to print prefix. Log buffer too small?"); + return (size_t)ret; + } + } + return 0; +} + GCIdMark::GCIdMark() : _gc_id(GCId::create()) { currentNamedthread()->set_gc_id(_gc_id); } diff --git a/hotspot/src/share/vm/gc/shared/gcId.hpp b/hotspot/src/share/vm/gc/shared/gcId.hpp index 2e09fd84a67..8fc525a31de 100644 --- a/hotspot/src/share/vm/gc/shared/gcId.hpp +++ b/hotspot/src/share/vm/gc/shared/gcId.hpp @@ -40,6 +40,7 @@ class GCId : public AllStatic { // Same as current() but can return undefined() if no GC id is currently active static const uint current_raw(); static const uint undefined() { return UNDEFINED; } + static size_t print_prefix(char* buf, size_t len); }; class GCIdMark : public StackObj { diff --git a/hotspot/src/share/vm/gc/shared/gcLocker.cpp b/hotspot/src/share/vm/gc/shared/gcLocker.cpp index 7935ded6ec7..3b3b8448f7d 100644 --- a/hotspot/src/share/vm/gc/shared/gcLocker.cpp +++ b/hotspot/src/share/vm/gc/shared/gcLocker.cpp @@ -26,6 +26,7 @@ #include "gc/shared/collectedHeap.hpp" #include "gc/shared/gcLocker.inline.hpp" #include "memory/resourceArea.hpp" +#include "logging/log.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/thread.inline.hpp" @@ -73,17 +74,20 @@ void GC_locker::decrement_debug_jni_lock_count() { } #endif +void GC_locker::log_debug_jni(const char* msg) { + LogHandle(gc, jni) log; + if (log.is_debug()) { + ResourceMark rm; // JavaThread::name() allocates to convert to UTF8 + log.debug("%s Thread \"%s\" %d locked.", msg, Thread::current()->name(), _jni_lock_count); + } +} + bool GC_locker::check_active_before_gc() { assert(SafepointSynchronize::is_at_safepoint(), "only read at safepoint"); if (is_active() && !_needs_gc) { verify_critical_count(); _needs_gc = true; - if (PrintJNIGCStalls && PrintGCDetails) { - ResourceMark rm; // JavaThread::name() allocates to convert to UTF8 - gclog_or_tty->print_cr("%.3f: Setting _needs_gc. Thread \"%s\" %d locked.", - gclog_or_tty->time_stamp().seconds(), Thread::current()->name(), _jni_lock_count); - } - + log_debug_jni("Setting _needs_gc."); } return is_active(); } @@ -93,11 +97,7 @@ void GC_locker::stall_until_clear() { MutexLocker ml(JNICritical_lock); if (needs_gc()) { - if (PrintJNIGCStalls && PrintGCDetails) { - ResourceMark rm; // JavaThread::name() allocates to convert to UTF8 - gclog_or_tty->print_cr("%.3f: Allocation failed. Thread \"%s\" is stalled by JNI critical section, %d locked.", - gclog_or_tty->time_stamp().seconds(), Thread::current()->name(), _jni_lock_count); - } + log_debug_jni("Allocation failed. Thread stalled by JNI critical section."); } // Wait for _needs_gc to be cleared @@ -134,11 +134,7 @@ void GC_locker::jni_unlock(JavaThread* thread) { { // Must give up the lock while at a safepoint MutexUnlocker munlock(JNICritical_lock); - if (PrintJNIGCStalls && PrintGCDetails) { - ResourceMark rm; // JavaThread::name() allocates to convert to UTF8 - gclog_or_tty->print_cr("%.3f: Thread \"%s\" is performing GC after exiting critical section, %d locked", - gclog_or_tty->time_stamp().seconds(), Thread::current()->name(), _jni_lock_count); - } + log_debug_jni("Performing GC after exiting critical section."); Universe::heap()->collect(GCCause::_gc_locker); } _doing_gc = false; diff --git a/hotspot/src/share/vm/gc/shared/gcLocker.hpp b/hotspot/src/share/vm/gc/shared/gcLocker.hpp index 41ad0aec738..d4134dc2fb6 100644 --- a/hotspot/src/share/vm/gc/shared/gcLocker.hpp +++ b/hotspot/src/share/vm/gc/shared/gcLocker.hpp @@ -64,6 +64,7 @@ class GC_locker: public AllStatic { return _jni_lock_count > 0; } + static void log_debug_jni(const char* msg); public: // Accessors static bool is_active() { diff --git a/hotspot/src/share/vm/gc/shared/gcTraceTime.cpp b/hotspot/src/share/vm/gc/shared/gcTraceTime.cpp index dc63333b955..fd4c25281c5 100644 --- a/hotspot/src/share/vm/gc/shared/gcTraceTime.cpp +++ b/hotspot/src/share/vm/gc/shared/gcTraceTime.cpp @@ -23,57 +23,38 @@ */ #include "precompiled.hpp" -#include "gc/shared/gcTimer.hpp" -#include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" -#include "runtime/globals.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" +#include "logging/log.hpp" #include "runtime/os.hpp" -#include "runtime/safepoint.hpp" -#include "runtime/thread.inline.hpp" -#include "runtime/timer.hpp" -#include "utilities/ostream.hpp" -#include "utilities/ticks.inline.hpp" - -GCTraceTimeImpl::GCTraceTimeImpl(const char* title, bool doit, bool print_cr, GCTimer* timer) : - _title(title), _doit(doit), _print_cr(print_cr), _timer(timer), _start_counter() { - if (_doit || _timer != NULL) { - _start_counter.stamp(); - } - - if (_timer != NULL) { - assert(SafepointSynchronize::is_at_safepoint(), "Tracing currently only supported at safepoints"); - assert(Thread::current()->is_VM_thread(), "Tracing currently only supported from the VM thread"); - - _timer->register_gc_phase_start(title, _start_counter); - } - - if (_doit) { - gclog_or_tty->gclog_stamp(); - gclog_or_tty->print("[%s", title); - gclog_or_tty->flush(); - } -} - -GCTraceTimeImpl::~GCTraceTimeImpl() { - Ticks stop_counter; - - if (_doit || _timer != NULL) { - stop_counter.stamp(); - } - - if (_timer != NULL) { - _timer->register_gc_phase_end(stop_counter); - } - - if (_doit) { - const Tickspan duration = stop_counter - _start_counter; - double duration_in_seconds = TicksToTimeHelper::seconds(duration); - if (_print_cr) { - gclog_or_tty->print_cr(", %3.7f secs]", duration_in_seconds); - } else { - gclog_or_tty->print(", %3.7f secs]", duration_in_seconds); +GCTraceCPUTime::GCTraceCPUTime() : + _active(log_is_enabled(Info, gc, cpu)), + _starting_user_time(0.0), + _starting_system_time(0.0), + _starting_real_time(0.0) +{ + if (_active) { + bool valid = os::getTimesSecs(&_starting_real_time, + &_starting_user_time, + &_starting_system_time); + if (!valid) { + log_warning(gc, cpu)("TraceCPUTime: os::getTimesSecs() returned invalid result"); + _active = false; + } + } +} + +GCTraceCPUTime::~GCTraceCPUTime() { + if (_active) { + double real_time, user_time, system_time; + bool valid = os::getTimesSecs(&real_time, &user_time, &system_time); + if (valid) { + log_info(gc, cpu)("User=%3.2fs Sys=%3.2fs Real=%3.2fs", + user_time - _starting_user_time, + system_time - _starting_system_time, + real_time - _starting_real_time); + } else { + log_warning(gc, cpu)("TraceCPUTime: os::getTimesSecs() returned invalid result"); } - gclog_or_tty->flush(); } } diff --git a/hotspot/src/share/vm/gc/shared/gcTraceTime.hpp b/hotspot/src/share/vm/gc/shared/gcTraceTime.hpp index 19fb32f9db6..b6555dff2ce 100644 --- a/hotspot/src/share/vm/gc/shared/gcTraceTime.hpp +++ b/hotspot/src/share/vm/gc/shared/gcTraceTime.hpp @@ -25,31 +25,55 @@ #ifndef SHARE_VM_GC_SHARED_GCTRACETIME_HPP #define SHARE_VM_GC_SHARED_GCTRACETIME_HPP -#include "gc/shared/gcTrace.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" -#include "prims/jni_md.h" #include "utilities/ticks.hpp" +class GCTraceCPUTime : public StackObj { + bool _active; // true if times will be measured and printed + double _starting_user_time; // user time at start of measurement + double _starting_system_time; // system time at start of measurement + double _starting_real_time; // real time at start of measurement + public: + GCTraceCPUTime(); + ~GCTraceCPUTime(); +}; + class GCTimer; -class GCTraceTimeImpl VALUE_OBJ_CLASS_SPEC { +template +class GCTraceTimeImpl : public StackObj { + private: + bool _enabled; + Ticks _start_ticks; const char* _title; - bool _doit; - bool _print_cr; + GCCause::Cause _gc_cause; GCTimer* _timer; - Ticks _start_counter; + size_t _heap_usage_before; + + void log_start(jlong start_counter); + void log_stop(jlong start_counter, jlong stop_counter); + void time_stamp(Ticks& ticks); public: - GCTraceTimeImpl(const char* title, bool doit, bool print_cr, GCTimer* timer); + GCTraceTimeImpl(const char* title, GCTimer* timer = NULL, GCCause::Cause gc_cause = GCCause::_no_gc, bool log_heap_usage = false); ~GCTraceTimeImpl(); }; -class GCTraceTime : public StackObj { - GCTraceTimeImpl _gc_trace_time_impl; - +// Similar to GCTraceTimeImpl but is intended for concurrent phase logging, +// which is a bit simpler and should always print the start line, i.e. not add the "start" tag. +template +class GCTraceConcTimeImpl : public StackObj { + private: + bool _enabled; + jlong _start_time; + const char* _title; public: - GCTraceTime(const char* title, bool doit, bool print_cr, GCTimer* timer) : - _gc_trace_time_impl(title, doit, print_cr, timer) {}; + GCTraceConcTimeImpl(const char* title); + ~GCTraceConcTimeImpl(); + jlong start_time() { return _start_time; } }; #endif // SHARE_VM_GC_SHARED_GCTRACETIME_HPP diff --git a/hotspot/src/share/vm/gc/shared/gcTraceTime.inline.hpp b/hotspot/src/share/vm/gc/shared/gcTraceTime.inline.hpp new file mode 100644 index 00000000000..e6ea94ecf5f --- /dev/null +++ b/hotspot/src/share/vm/gc/shared/gcTraceTime.inline.hpp @@ -0,0 +1,149 @@ +/* + * 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 + * 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. + * + */ + +#ifndef SHARE_VM_GC_SHARED_GCTRACETIME_INLINE_HPP +#define SHARE_VM_GC_SHARED_GCTRACETIME_INLINE_HPP + +#include "gc/shared/collectedHeap.hpp" +#include "gc/shared/gcTimer.hpp" +#include "gc/shared/gcTrace.hpp" +#include "gc/shared/gcTraceTime.hpp" +#include "logging/log.hpp" +#include "memory/universe.hpp" +#include "prims/jni_md.h" +#include "utilities/ticks.hpp" +#include "runtime/timer.hpp" + +#define LOG_STOP_TIME_FORMAT "(%.3fs, %.3fs) %.3fms" +#define LOG_STOP_HEAP_FORMAT SIZE_FORMAT "M->" SIZE_FORMAT "M(" SIZE_FORMAT "M)" + +template +void GCTraceTimeImpl::log_start(jlong start_counter) { + if (Log::is_level(Level)) { + FormatBuffer<> start_msg("%s", _title); + if (_gc_cause != GCCause::_no_gc) { + start_msg.append(" (%s)", GCCause::to_string(_gc_cause)); + } + start_msg.append(" (%.3fs)", TimeHelper::counter_to_seconds(start_counter)); + // Make sure to put the "start" tag last in the tag set + STATIC_ASSERT(T0 != LogTag::__NO_TAG); // Need some tag to log on. + STATIC_ASSERT(T4 == LogTag::__NO_TAG); // Need to leave at least the last tag for the "start" tag in log_start() + if (T1 == LogTag::__NO_TAG) { + Log::template write("%s", start_msg.buffer()); + } else if (T2 == LogTag::__NO_TAG) { + Log::template write("%s", start_msg.buffer()); + } else if (T3 == LogTag::__NO_TAG) { + Log::template write("%s", start_msg.buffer()); + } else { + Log::template write("%s", start_msg.buffer()); + } + } +} + +template +void GCTraceTimeImpl::log_stop(jlong start_counter, jlong stop_counter) { + double duration_in_ms = TimeHelper::counter_to_millis(stop_counter - start_counter); + double start_time_in_secs = TimeHelper::counter_to_seconds(start_counter); + double stop_time_in_secs = TimeHelper::counter_to_seconds(stop_counter); + FormatBuffer<> stop_msg("%s", _title); + if (_gc_cause != GCCause::_no_gc) { + stop_msg.append(" (%s)", GCCause::to_string(_gc_cause)); + } + if (_heap_usage_before == SIZE_MAX) { + Log::template write("%s " LOG_STOP_TIME_FORMAT, + stop_msg.buffer(), start_time_in_secs, stop_time_in_secs, duration_in_ms); + } else { + CollectedHeap* heap = Universe::heap(); + size_t used_before_m = _heap_usage_before / M; + size_t used_m = heap->used() / M; + size_t capacity_m = heap->capacity() / M; + Log::template write("%s " LOG_STOP_HEAP_FORMAT " " LOG_STOP_TIME_FORMAT, + stop_msg.buffer(), used_before_m, used_m, capacity_m, start_time_in_secs, stop_time_in_secs, duration_in_ms); + } +} + +template +void GCTraceTimeImpl::time_stamp(Ticks& ticks) { + if (_enabled || _timer != NULL) { + ticks.stamp(); + } +} + +template +GCTraceTimeImpl::GCTraceTimeImpl(const char* title, GCTimer* timer, GCCause::Cause gc_cause, bool log_heap_usage) : + _enabled(Log::is_level(Level)), + _start_ticks(), + _heap_usage_before(SIZE_MAX), + _title(title), + _gc_cause(gc_cause), + _timer(timer) { + + time_stamp(_start_ticks); + if (_enabled) { + if (log_heap_usage) { + _heap_usage_before = Universe::heap()->used(); + } + log_start(_start_ticks.value()); + } + if (_timer != NULL) { + _timer->register_gc_phase_start(_title, _start_ticks); + } +} + +template +GCTraceTimeImpl::~GCTraceTimeImpl() { + Ticks stop_ticks; + time_stamp(stop_ticks); + if (_enabled) { + log_stop(_start_ticks.value(), stop_ticks.value()); + } + if (_timer != NULL) { + _timer->register_gc_phase_end(stop_ticks); + } +} + +template +GCTraceConcTimeImpl::GCTraceConcTimeImpl(const char* title) : + _enabled(Log::is_level(Level)), _start_time(os::elapsed_counter()), _title(title) { + if (_enabled) { + Log::template write("%s (%.3fs)", _title, TimeHelper::counter_to_seconds(_start_time)); + } +} + +template +GCTraceConcTimeImpl::~GCTraceConcTimeImpl() { + if (_enabled) { + jlong stop_time = os::elapsed_counter(); + Log::template write("%s " LOG_STOP_TIME_FORMAT, + _title, + TimeHelper::counter_to_seconds(_start_time), + TimeHelper::counter_to_seconds(stop_time), + TimeHelper::counter_to_millis(stop_time - _start_time)); + } +} + +#define GCTraceTime(Level, ...) GCTraceTimeImpl +#define GCTraceConcTime(Level, ...) GCTraceConcTimeImpl + +#endif // SHARE_VM_GC_SHARED_GCTRACETIME_INLINE_HPP diff --git a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp index bfa47a3734a..5c732a15ced 100644 --- a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp @@ -33,7 +33,7 @@ #include "gc/shared/gcId.hpp" #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/generationSpec.hpp" @@ -314,13 +314,11 @@ bool GenCollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) { void GenCollectedHeap::collect_generation(Generation* gen, bool full, size_t size, bool is_tlab, bool run_verification, bool clear_soft_refs, bool restore_marks_for_biased_locking) { - // Timer for individual generations. Last argument is false: no CR - // FIXME: We should try to start the timing earlier to cover more of the GC pause - GCTraceTime t1(gen->short_name(), PrintGCDetails, false, NULL); + FormatBuffer<> title("Collect gen: %s", gen->short_name()); + GCTraceTime(Debug, gc) t1(title); TraceCollectorStats tcs(gen->counters()); TraceMemoryManagerStats tmms(gen->kind(),gc_cause()); - size_t prev_used = gen->used(); gen->stat_record()->invocations++; gen->stat_record()->accumulated_time.start(); @@ -329,24 +327,11 @@ void GenCollectedHeap::collect_generation(Generation* gen, bool full, size_t siz // change top of some spaces. record_gen_tops_before_GC(); - if (PrintGC && Verbose) { - // I didn't want to change the logging when removing the level concept, - // but I guess this logging could say young/old or something instead of 0/1. - uint level; - if (heap()->is_young_gen(gen)) { - level = 0; - } else { - level = 1; - } - gclog_or_tty->print("level=%u invoke=%d size=" SIZE_FORMAT, - level, - gen->stat_record()->invocations, - size * HeapWordSize); - } + log_trace(gc)("%s invoke=%d size=" SIZE_FORMAT, heap()->is_young_gen(gen) ? "Young" : "Old", gen->stat_record()->invocations, size * HeapWordSize); if (run_verification && VerifyBeforeGC) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyBeforeGC:"); + Universe::verify("Before GC"); } COMPILER2_PRESENT(DerivedPointerTable::clear()); @@ -404,12 +389,7 @@ void GenCollectedHeap::collect_generation(Generation* gen, bool full, size_t siz if (run_verification && VerifyAfterGC) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyAfterGC:"); - } - - if (PrintGCDetails) { - gclog_or_tty->print(":"); - gen->print_heap_change(prev_used); + Universe::verify("After GC"); } } @@ -448,21 +428,31 @@ void GenCollectedHeap::do_collection(bool full, FlagSetting fl(_is_gc_active, true); bool complete = full && (max_generation == OldGen); - const char* gc_cause_prefix = complete ? "Full GC" : "GC"; - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - GCTraceTime t(GCCauseString(gc_cause_prefix, gc_cause()), PrintGCDetails, false, NULL); + bool old_collects_young = complete && !ScavengeBeforeFullGC; + bool do_young_collection = !old_collects_young && _young_gen->should_collect(full, size, is_tlab); + + FormatBuffer<> gc_string("%s", "Pause "); + if (do_young_collection) { + gc_string.append("Young"); + } else { + gc_string.append("Full"); + } + + GCTraceCPUTime tcpu; + GCTraceTime(Info, gc) t(gc_string, NULL, gc_cause(), true); gc_prologue(complete); increment_total_collections(complete); - size_t gch_prev_used = used(); + size_t young_prev_used = _young_gen->used(); + size_t old_prev_used = _old_gen->used(); + bool run_verification = total_collections() >= VerifyGCStartAt; bool prepared_for_verification = false; bool collected_old = false; - bool old_collects_young = complete && !ScavengeBeforeFullGC; - if (!old_collects_young && _young_gen->should_collect(full, size, is_tlab)) { + if (do_young_collection) { if (run_verification && VerifyGCLevel <= 0 && VerifyBeforeGC) { prepare_for_verify(); prepared_for_verification = true; @@ -487,7 +477,6 @@ void GenCollectedHeap::do_collection(bool full, bool must_restore_marks_for_biased_locking = false; if (max_generation == OldGen && _old_gen->should_collect(full, size, is_tlab)) { - GCIdMarkAndRestore gc_id_mark; if (!complete) { // The full_collections increment was missed above. increment_total_full_collections(); @@ -501,13 +490,16 @@ void GenCollectedHeap::do_collection(bool full, } assert(_old_gen->performs_in_place_marking(), "All old generations do in place marking"); - collect_generation(_old_gen, - full, - size, - is_tlab, - run_verification && VerifyGCLevel <= 1, - do_clear_all_soft_refs, - true); + + if (do_young_collection) { + // We did a young GC. Need a new GC id for the old GC. + GCIdMarkAndRestore gc_id_mark; + GCTraceTime(Info, gc) t("Pause Full", NULL, gc_cause(), true); + collect_generation(_old_gen, full, size, is_tlab, run_verification && VerifyGCLevel <= 1, do_clear_all_soft_refs, true); + } else { + // No young GC done. Use the same GC id as was set up earlier in this method. + collect_generation(_old_gen, full, size, is_tlab, run_verification && VerifyGCLevel <= 1, do_clear_all_soft_refs, true); + } must_restore_marks_for_biased_locking = true; collected_old = true; @@ -523,14 +515,8 @@ void GenCollectedHeap::do_collection(bool full, post_full_gc_dump(NULL); // do any post full gc dumps } - if (PrintGCDetails) { - print_heap_change(gch_prev_used); - - // Print metaspace info for full GC with PrintGCDetails flag. - if (complete) { - MetaspaceAux::print_metaspace_change(metadata_prev_used); - } - } + print_heap_change(young_prev_used, old_prev_used); + MetaspaceAux::print_metaspace_change(metadata_prev_used); // Adjust generation sizes. if (collected_old) { @@ -874,10 +860,7 @@ void GenCollectedHeap::do_full_collection(bool clear_all_soft_refs, // been attempted and failed, because the old gen was too full if (local_last_generation == YoungGen && gc_cause() == GCCause::_gc_locker && incremental_collection_will_fail(false /* don't consult_young */)) { - if (PrintGCDetails) { - gclog_or_tty->print_cr("GC locker: Trying a full collection " - "because scavenge failed"); - } + log_debug(gc, jni)("GC locker: Trying a full collection because scavenge failed"); // This time allow the old gen to be collected as well do_collection(true, // full clear_all_soft_refs, // clear_all_soft_refs @@ -1106,22 +1089,14 @@ void GenCollectedHeap::prepare_for_compaction() { _young_gen->prepare_for_compaction(&cp); } -void GenCollectedHeap::verify(bool silent, VerifyOption option /* ignored */) { - if (!silent) { - gclog_or_tty->print("%s", _old_gen->name()); - gclog_or_tty->print(" "); - } +void GenCollectedHeap::verify(VerifyOption option /* ignored */) { + log_debug(gc, verify)("%s", _old_gen->name()); _old_gen->verify(); - if (!silent) { - gclog_or_tty->print("%s", _young_gen->name()); - gclog_or_tty->print(" "); - } + log_debug(gc, verify)("%s", _old_gen->name()); _young_gen->verify(); - if (!silent) { - gclog_or_tty->print("remset "); - } + log_debug(gc, verify)("RemSet"); rem_set()->verify(); } @@ -1171,18 +1146,11 @@ void GenCollectedHeap::print_tracing_info() const { } } -void GenCollectedHeap::print_heap_change(size_t prev_used) const { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(" " SIZE_FORMAT - "->" SIZE_FORMAT - "(" SIZE_FORMAT ")", - prev_used, used(), capacity()); - } else { - gclog_or_tty->print(" " SIZE_FORMAT "K" - "->" SIZE_FORMAT "K" - "(" SIZE_FORMAT "K)", - prev_used / K, used() / K, capacity() / K); - } +void GenCollectedHeap::print_heap_change(size_t young_prev_used, size_t old_prev_used) const { + log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + _young_gen->short_name(), young_prev_used / K, _young_gen->used() /K, _young_gen->capacity() /K); + log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + _old_gen->short_name(), old_prev_used / K, _old_gen->used() /K, _old_gen->capacity() /K); } class GenGCPrologueClosure: public GenCollectedHeap::GenClosure { diff --git a/hotspot/src/share/vm/gc/shared/genCollectedHeap.hpp b/hotspot/src/share/vm/gc/shared/genCollectedHeap.hpp index 11114dd38f0..fad2457c595 100644 --- a/hotspot/src/share/vm/gc/shared/genCollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/shared/genCollectedHeap.hpp @@ -142,6 +142,14 @@ public: return CollectedHeap::GenCollectedHeap; } + virtual const char* name() const { + if (UseConcMarkSweepGC) { + return "Concurrent Mark Sweep"; + } else { + return "Serial"; + } + } + Generation* young_gen() const { return _young_gen; } Generation* old_gen() const { return _old_gen; } @@ -329,7 +337,7 @@ public: void prepare_for_verify(); // Override. - void verify(bool silent, VerifyOption option); + void verify(VerifyOption option); // Override. virtual void print_on(outputStream* st) const; @@ -338,8 +346,7 @@ public: virtual void print_tracing_info() const; virtual void print_on_error(outputStream* st) const; - // PrintGC, PrintGCDetails support - void print_heap_change(size_t prev_used) const; + void print_heap_change(size_t young_prev_used, size_t old_prev_used) const; // The functions below are helper functions that a subclass of // "CollectedHeap" can use in the implementation of its virtual diff --git a/hotspot/src/share/vm/gc/shared/generation.cpp b/hotspot/src/share/vm/gc/shared/generation.cpp index 8663f5449cd..d86103ae077 100644 --- a/hotspot/src/share/vm/gc/shared/generation.cpp +++ b/hotspot/src/share/vm/gc/shared/generation.cpp @@ -36,6 +36,7 @@ #include "gc/shared/generation.hpp" #include "gc/shared/space.inline.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "logging/log.hpp" #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" @@ -70,20 +71,6 @@ size_t Generation::max_capacity() const { return reserved().byte_size(); } -void Generation::print_heap_change(size_t prev_used) const { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(" " SIZE_FORMAT - "->" SIZE_FORMAT - "(" SIZE_FORMAT ")", - prev_used, used(), capacity()); - } else { - gclog_or_tty->print(" " SIZE_FORMAT "K" - "->" SIZE_FORMAT "K" - "(" SIZE_FORMAT "K)", - prev_used / K, used() / K, capacity() / K); - } -} - // By default we get a single threaded default reference processor; // generations needing multi-threaded refs processing or discovery override this method. void Generation::ref_processor_init() { @@ -171,12 +158,8 @@ size_t Generation::max_contiguous_available() const { bool Generation::promotion_attempt_is_safe(size_t max_promotion_in_bytes) const { size_t available = max_contiguous_available(); bool res = (available >= max_promotion_in_bytes); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr( - "Generation: promo attempt is%s safe: available(" SIZE_FORMAT ") %s max_promo(" SIZE_FORMAT ")", - res? "":" not", available, res? ">=":"<", - max_promotion_in_bytes); - } + log_trace(gc)("Generation: promo attempt is%s safe: available(" SIZE_FORMAT ") %s max_promo(" SIZE_FORMAT ")", + res? "":" not", available, res? ">=":"<", max_promotion_in_bytes); return res; } diff --git a/hotspot/src/share/vm/gc/shared/generation.hpp b/hotspot/src/share/vm/gc/shared/generation.hpp index 7e35485510b..9e1eed7d9f4 100644 --- a/hotspot/src/share/vm/gc/shared/generation.hpp +++ b/hotspot/src/share/vm/gc/shared/generation.hpp @@ -536,11 +536,8 @@ class Generation: public CHeapObj { // the block is an object. virtual bool block_is_obj(const HeapWord* addr) const; - - // PrintGC, PrintGCDetails support void print_heap_change(size_t prev_used) const; - // PrintHeapAtGC support virtual void print() const; virtual void print_on(outputStream* st) const; diff --git a/hotspot/src/share/vm/gc/shared/plab.cpp b/hotspot/src/share/vm/gc/shared/plab.cpp index ba8052d8d28..d8566523e7c 100644 --- a/hotspot/src/share/vm/gc/shared/plab.cpp +++ b/hotspot/src/share/vm/gc/shared/plab.cpp @@ -26,6 +26,7 @@ #include "gc/shared/collectedHeap.hpp" #include "gc/shared/plab.inline.hpp" #include "gc/shared/threadLocalAllocBuffer.hpp" +#include "logging/log.hpp" #include "oops/arrayOop.hpp" #include "oops/oop.inline.hpp" @@ -149,18 +150,8 @@ void PLABStats::adjust_desired_plab_sz() { new_plab_sz = MIN2(max_size(), new_plab_sz); new_plab_sz = align_object_size(new_plab_sz); // Latch the result - if (PrintPLAB) { - gclog_or_tty->print(" (plab_sz = " SIZE_FORMAT " desired_net_plab_sz = " SIZE_FORMAT ") ", recent_plab_sz, new_plab_sz); - } + log_trace(gc, plab)("plab_size = " SIZE_FORMAT " desired_net_plab_sz = " SIZE_FORMAT ") ", recent_plab_sz, new_plab_sz); _desired_net_plab_sz = new_plab_sz; reset(); } - -#ifndef PRODUCT -void PLAB::print() { - gclog_or_tty->print_cr("PLAB: _bottom: " PTR_FORMAT " _top: " PTR_FORMAT - " _end: " PTR_FORMAT " _hard_end: " PTR_FORMAT ")", - p2i(_bottom), p2i(_top), p2i(_end), p2i(_hard_end)); -} -#endif // !PRODUCT diff --git a/hotspot/src/share/vm/gc/shared/plab.hpp b/hotspot/src/share/vm/gc/shared/plab.hpp index 60dc080a45c..b684769ed61 100644 --- a/hotspot/src/share/vm/gc/shared/plab.hpp +++ b/hotspot/src/share/vm/gc/shared/plab.hpp @@ -141,8 +141,6 @@ public: // Fills in the unallocated portion of the buffer with a garbage object and updates // statistics. To be called during GC. virtual void retire(); - - void print() PRODUCT_RETURN; }; // PLAB book-keeping. diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp index 684b64e2b21..1b71b4d3d29 100644 --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp @@ -28,9 +28,10 @@ #include "gc/shared/collectedHeap.hpp" #include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/gcTimer.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/referenceProcessor.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" @@ -186,21 +187,6 @@ size_t ReferenceProcessor::total_count(DiscoveredList lists[]) { return total; } -static void log_ref_count(size_t count, bool doit) { - if (doit) { - gclog_or_tty->print(", " SIZE_FORMAT " refs", count); - } -} - -class GCRefTraceTime : public StackObj { - GCTraceTimeImpl _gc_trace_time; - public: - GCRefTraceTime(const char* title, bool doit, GCTimer* timer, size_t count) : - _gc_trace_time(title, doit, false, timer) { - log_ref_count(count, doit); - } -}; - ReferenceProcessorStats ReferenceProcessor::process_discovered_references( BoolObjectClosure* is_alive, OopClosure* keep_alive, @@ -222,8 +208,6 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( _soft_ref_timestamp_clock = java_lang_ref_SoftReference::clock(); - bool trace_time = PrintGCDetails && PrintReferenceGC; - // Include cleaners in phantom statistics. We expect Cleaner // references to be temporary, and don't want to deal with // possible incompatibilities arising from making it more visible. @@ -235,7 +219,7 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( // Soft references { - GCRefTraceTime tt("SoftReference", trace_time, gc_timer, stats.soft_count()); + GCTraceTime(Debug, gc, ref) tt("SoftReference", gc_timer); process_discovered_reflist(_discoveredSoftRefs, _current_soft_ref_policy, true, is_alive, keep_alive, complete_gc, task_executor); } @@ -244,21 +228,21 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( // Weak references { - GCRefTraceTime tt("WeakReference", trace_time, gc_timer, stats.weak_count()); + GCTraceTime(Debug, gc, ref) tt("WeakReference", gc_timer); process_discovered_reflist(_discoveredWeakRefs, NULL, true, is_alive, keep_alive, complete_gc, task_executor); } // Final references { - GCRefTraceTime tt("FinalReference", trace_time, gc_timer, stats.final_count()); + GCTraceTime(Debug, gc, ref) tt("FinalReference", gc_timer); process_discovered_reflist(_discoveredFinalRefs, NULL, false, is_alive, keep_alive, complete_gc, task_executor); } // Phantom references { - GCRefTraceTime tt("PhantomReference", trace_time, gc_timer, stats.phantom_count()); + GCTraceTime(Debug, gc, ref) tt("PhantomReference", gc_timer); process_discovered_reflist(_discoveredPhantomRefs, NULL, false, is_alive, keep_alive, complete_gc, task_executor); @@ -275,20 +259,23 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( // thus use JNI weak references to circumvent the phantom references and // resurrect a "post-mortem" object. { - GCTraceTime tt("JNI Weak Reference", trace_time, false, gc_timer); - NOT_PRODUCT(log_ref_count(count_jni_refs(), trace_time);) + GCTraceTime(Debug, gc, ref) tt("JNI Weak Reference", gc_timer); if (task_executor != NULL) { task_executor->set_single_threaded_mode(); } process_phaseJNI(is_alive, keep_alive, complete_gc); } + log_debug(gc, ref)("Ref Counts: Soft: " SIZE_FORMAT " Weak: " SIZE_FORMAT " Final: " SIZE_FORMAT " Phantom: " SIZE_FORMAT, + stats.soft_count(), stats.weak_count(), stats.final_count(), stats.phantom_count()); + log_develop_trace(gc, ref)("JNI Weak Reference count: " SIZE_FORMAT, count_jni_refs()); + return stats; } #ifndef PRODUCT // Calculate the number of jni handles. -uint ReferenceProcessor::count_jni_refs() { +size_t ReferenceProcessor::count_jni_refs() { class AlwaysAliveClosure: public BoolObjectClosure { public: virtual bool do_object_b(oop obj) { return true; } @@ -296,12 +283,12 @@ uint ReferenceProcessor::count_jni_refs() { class CountHandleClosure: public OopClosure { private: - int _count; + size_t _count; public: CountHandleClosure(): _count(0) {} void do_oop(oop* unused) { _count++; } void do_oop(narrowOop* unused) { ShouldNotReachHere(); } - int count() { return _count; } + size_t count() { return _count; } }; CountHandleClosure global_handle_count; AlwaysAliveClosure always_alive; @@ -362,10 +349,7 @@ void ReferenceProcessor::enqueue_discovered_reflist(DiscoveredList& refs_list, // all linked Reference objects. Note that it is important to not dirty any // cards during reference processing since this will cause card table // verification to fail for G1. - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("ReferenceProcessor::enqueue_discovered_reflist list " - INTPTR_FORMAT, p2i(refs_list.head())); - } + log_develop_trace(gc, ref)("ReferenceProcessor::enqueue_discovered_reflist list " INTPTR_FORMAT, p2i(refs_list.head())); oop obj = NULL; oop next_d = refs_list.head(); @@ -376,10 +360,7 @@ void ReferenceProcessor::enqueue_discovered_reflist(DiscoveredList& refs_list, assert(obj->is_instance(), "should be an instance object"); assert(InstanceKlass::cast(obj->klass())->is_reference_instance_klass(), "should be reference object"); next_d = java_lang_ref_Reference::discovered(obj); - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT, - p2i(obj), p2i(next_d)); - } + log_develop_trace(gc, ref)(" obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT, p2i(obj), p2i(next_d)); assert(java_lang_ref_Reference::next(obj) == NULL, "Reference not active; should not be discovered"); // Self-loop next, so as to make Ref not active. @@ -517,10 +498,8 @@ ReferenceProcessor::process_phase1(DiscoveredList& refs_list, bool referent_is_dead = (iter.referent() != NULL) && !iter.is_referent_alive(); if (referent_is_dead && !policy->should_clear_reference(iter.obj(), _soft_ref_timestamp_clock)) { - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Dropping reference (" INTPTR_FORMAT ": %s" ") by policy", - p2i(iter.obj()), iter.obj()->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Dropping reference (" INTPTR_FORMAT ": %s" ") by policy", + p2i(iter.obj()), iter.obj()->klass()->internal_name()); // Remove Reference object from list iter.remove(); // keep the referent around @@ -532,14 +511,9 @@ ReferenceProcessor::process_phase1(DiscoveredList& refs_list, } // Close the reachable set complete_gc->do_void(); - NOT_PRODUCT( - if (PrintGCDetails && TraceReferenceGC) { - gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " dead Refs out of " SIZE_FORMAT - " discovered Refs by policy, from list " INTPTR_FORMAT, - iter.removed(), iter.processed(), p2i(refs_list.head())); + log_develop_trace(gc, ref)(" Dropped " SIZE_FORMAT " dead Refs out of " SIZE_FORMAT " discovered Refs by policy, from list " INTPTR_FORMAT, + iter.removed(), iter.processed(), p2i(refs_list.head())); } - ) -} // Traverse the list and remove any Refs that are not active, or // whose referents are either alive or NULL. @@ -554,10 +528,8 @@ ReferenceProcessor::pp2_work(DiscoveredList& refs_list, DEBUG_ONLY(oop next = java_lang_ref_Reference::next(iter.obj());) assert(next == NULL, "Should not discover inactive Reference"); if (iter.is_referent_alive()) { - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Dropping strongly reachable reference (" INTPTR_FORMAT ": %s)", - p2i(iter.obj()), iter.obj()->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Dropping strongly reachable reference (" INTPTR_FORMAT ": %s)", + p2i(iter.obj()), iter.obj()->klass()->internal_name()); // The referent is reachable after all. // Remove Reference object from list. iter.remove(); @@ -571,8 +543,8 @@ ReferenceProcessor::pp2_work(DiscoveredList& refs_list, } } NOT_PRODUCT( - if (PrintGCDetails && TraceReferenceGC && (iter.processed() > 0)) { - gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT + if (iter.processed() > 0) { + log_develop_trace(gc, ref)(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT " Refs in discovered list " INTPTR_FORMAT, iter.removed(), iter.processed(), p2i(refs_list.head())); } @@ -610,8 +582,8 @@ ReferenceProcessor::pp2_work_concurrent_discovery(DiscoveredList& refs_list, // Now close the newly reachable set complete_gc->do_void(); NOT_PRODUCT( - if (PrintGCDetails && TraceReferenceGC && (iter.processed() > 0)) { - gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT + if (iter.processed() > 0) { + log_develop_trace(gc, ref)(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT " Refs in discovered list " INTPTR_FORMAT, iter.removed(), iter.processed(), p2i(refs_list.head())); } @@ -638,11 +610,8 @@ ReferenceProcessor::process_phase3(DiscoveredList& refs_list, // keep the referent around iter.make_referent_alive(); } - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Adding %sreference (" INTPTR_FORMAT ": %s) as pending", - clear_referent ? "cleared " : "", - p2i(iter.obj()), iter.obj()->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Adding %sreference (" INTPTR_FORMAT ": %s) as pending", + clear_referent ? "cleared " : "", p2i(iter.obj()), iter.obj()->klass()->internal_name()); assert(iter.obj()->is_oop(UseConcMarkSweepGC), "Adding a bad reference"); iter.next(); } @@ -666,8 +635,8 @@ ReferenceProcessor::clear_discovered_references(DiscoveredList& refs_list) { void ReferenceProcessor::abandon_partial_discovery() { // loop over the lists for (uint i = 0; i < _max_num_q * number_of_subclasses_of_ref(); i++) { - if (TraceReferenceGC && PrintGCDetails && ((i % _max_num_q) == 0)) { - gclog_or_tty->print_cr("\nAbandoning %s discovered list", list_name(i)); + if ((i % _max_num_q) == 0) { + log_develop_trace(gc, ref)("Abandoning %s discovered list", list_name(i)); } clear_discovered_references(_discovered_refs[i]); } @@ -736,6 +705,20 @@ private: bool _clear_referent; }; +#ifndef PRODUCT +void ReferenceProcessor::log_reflist_counts(DiscoveredList ref_lists[], size_t total_refs) { + if (!log_is_enabled(Trace, gc, ref)) { + return; + } + + stringStream st; + for (uint i = 0; i < _max_num_q; ++i) { + st.print(SIZE_FORMAT " ", ref_lists[i].length()); + } + log_develop_trace(gc, ref)("%s= " SIZE_FORMAT, st.as_string(), total_refs); +} +#endif + // Balances reference queues. // Move entries from all queues[0, 1, ..., _max_num_q-1] to // queues[0, 1, ..., _num_q-1] because only the first _num_q @@ -744,19 +727,12 @@ void ReferenceProcessor::balance_queues(DiscoveredList ref_lists[]) { // calculate total length size_t total_refs = 0; - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("\nBalance ref_lists "); - } + log_develop_trace(gc, ref)("Balance ref_lists "); for (uint i = 0; i < _max_num_q; ++i) { total_refs += ref_lists[i].length(); - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print(SIZE_FORMAT " ", ref_lists[i].length()); } - } - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" = " SIZE_FORMAT, total_refs); - } + log_reflist_counts(ref_lists, total_refs); size_t avg_refs = total_refs / _num_q + 1; uint to_idx = 0; for (uint from_idx = 0; from_idx < _max_num_q; from_idx++) { @@ -820,14 +796,8 @@ void ReferenceProcessor::balance_queues(DiscoveredList ref_lists[]) size_t balanced_total_refs = 0; for (uint i = 0; i < _max_num_q; ++i) { balanced_total_refs += ref_lists[i].length(); - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print(SIZE_FORMAT " ", ref_lists[i].length()); } - } - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" = " SIZE_FORMAT, balanced_total_refs); - gclog_or_tty->flush(); - } + log_reflist_counts(ref_lists, balanced_total_refs); assert(total_refs == balanced_total_refs, "Balancing was incomplete"); #endif } @@ -950,9 +920,7 @@ inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt) default: ShouldNotReachHere(); } - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("Thread %d gets list " INTPTR_FORMAT, id, p2i(list)); - } + log_develop_trace(gc, ref)("Thread %d gets list " INTPTR_FORMAT, id, p2i(list)); return list; } @@ -976,19 +944,15 @@ ReferenceProcessor::add_to_discovered_list_mt(DiscoveredList& refs_list, refs_list.set_head(obj); refs_list.inc_length(1); - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Discovered reference (mt) (" INTPTR_FORMAT ": %s)", - p2i(obj), obj->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Discovered reference (mt) (" INTPTR_FORMAT ": %s)", + p2i(obj), obj->klass()->internal_name()); } else { // If retest was non NULL, another thread beat us to it: // The reference has already been discovered... - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)", - p2i(obj), obj->klass()->internal_name()); + log_develop_trace(gc, ref)("Already discovered reference (" INTPTR_FORMAT ": %s)", + p2i(obj), obj->klass()->internal_name()); } } -} #ifndef PRODUCT // Non-atomic (i.e. concurrent) discovery might allow us @@ -1078,10 +1042,8 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) { assert(discovered->is_oop_or_null(), "Expected an oop or NULL for discovered field at " PTR_FORMAT, p2i(discovered)); if (discovered != NULL) { // The reference has already been discovered... - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)", - p2i(obj), obj->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Already discovered reference (" INTPTR_FORMAT ": %s)", + p2i(obj), obj->klass()->internal_name()); if (RefDiscoveryPolicy == ReferentBasedDiscovery) { // assumes that an object is not processed twice; // if it's been already discovered it must be on another @@ -1136,10 +1098,7 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) { list->set_head(obj); list->inc_length(1); - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Discovered reference (" INTPTR_FORMAT ": %s)", - p2i(obj), obj->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Discovered reference (" INTPTR_FORMAT ": %s)", p2i(obj), obj->klass()->internal_name()); } assert(obj->is_oop(), "Discovered a bad reference"); verify_referent(obj); @@ -1159,8 +1118,7 @@ void ReferenceProcessor::preclean_discovered_references( // Soft references { - GCTraceTime tt("Preclean SoftReferences", PrintGCDetails && PrintReferenceGC, - false, gc_timer); + GCTraceTime(Debug, gc, ref) tm("Preclean SoftReferences", gc_timer); for (uint i = 0; i < _max_num_q; i++) { if (yield->should_return()) { return; @@ -1172,8 +1130,7 @@ void ReferenceProcessor::preclean_discovered_references( // Weak references { - GCTraceTime tt("Preclean WeakReferences", PrintGCDetails && PrintReferenceGC, - false, gc_timer); + GCTraceTime(Debug, gc, ref) tm("Preclean WeakReferences", gc_timer); for (uint i = 0; i < _max_num_q; i++) { if (yield->should_return()) { return; @@ -1185,8 +1142,7 @@ void ReferenceProcessor::preclean_discovered_references( // Final references { - GCTraceTime tt("Preclean FinalReferences", PrintGCDetails && PrintReferenceGC, - false, gc_timer); + GCTraceTime(Debug, gc, ref) tm("Preclean FinalReferences", gc_timer); for (uint i = 0; i < _max_num_q; i++) { if (yield->should_return()) { return; @@ -1198,8 +1154,7 @@ void ReferenceProcessor::preclean_discovered_references( // Phantom references { - GCTraceTime tt("Preclean PhantomReferences", PrintGCDetails && PrintReferenceGC, - false, gc_timer); + GCTraceTime(Debug, gc, ref) tm("Preclean PhantomReferences", gc_timer); for (uint i = 0; i < _max_num_q; i++) { if (yield->should_return()) { return; @@ -1244,10 +1199,8 @@ ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_list, next != NULL) { // The referent has been cleared, or is alive, or the Reference is not // active; we need to trace and mark its cohort. - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Precleaning Reference (" INTPTR_FORMAT ": %s)", - p2i(iter.obj()), iter.obj()->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Precleaning Reference (" INTPTR_FORMAT ": %s)", + p2i(iter.obj()), iter.obj()->klass()->internal_name()); // Remove Reference object from list iter.remove(); // Keep alive its cohort. @@ -1268,9 +1221,8 @@ ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_list, complete_gc->do_void(); NOT_PRODUCT( - if (PrintGCDetails && PrintReferenceGC && (iter.processed() > 0)) { - gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " Refs out of " SIZE_FORMAT - " Refs in discovered list " INTPTR_FORMAT, + if (iter.processed() > 0) { + log_develop_trace(gc, ref)(" Dropped " SIZE_FORMAT " Refs out of " SIZE_FORMAT " Refs in discovered list " INTPTR_FORMAT, iter.removed(), iter.processed(), p2i(refs_list.head())); } ) diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp index 20c405de7e0..fcfcbccd02d 100644 --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp @@ -364,7 +364,9 @@ class ReferenceProcessor : public CHeapObj { void clear_discovered_references(DiscoveredList& refs_list); // Calculate the number of jni handles. - unsigned int count_jni_refs(); + size_t count_jni_refs(); + + void log_reflist_counts(DiscoveredList ref_lists[], size_t total_count) PRODUCT_RETURN; // Balances reference queues. void balance_queues(DiscoveredList ref_lists[]); diff --git a/hotspot/src/share/vm/gc/shared/space.hpp b/hotspot/src/share/vm/gc/shared/space.hpp index 6b74b872619..036677410bd 100644 --- a/hotspot/src/share/vm/gc/shared/space.hpp +++ b/hotspot/src/share/vm/gc/shared/space.hpp @@ -220,7 +220,6 @@ class Space: public CHeapObj { // moving as a part of compaction. virtual void adjust_pointers() = 0; - // PrintHeapAtGC support virtual void print() const; virtual void print_on(outputStream* st) const; virtual void print_short() const; @@ -659,7 +658,6 @@ class ContiguousSpace: public CompactibleSpace { // Overrides for more efficient compaction support. void prepare_for_compaction(CompactPoint* cp); - // PrintHeapAtGC support. virtual void print_on(outputStream* st) const; // Checked dynamic downcasts. diff --git a/hotspot/src/share/vm/gc/shared/spaceDecorator.cpp b/hotspot/src/share/vm/gc/shared/spaceDecorator.cpp index b69e68762af..636f09ba1e9 100644 --- a/hotspot/src/share/vm/gc/shared/spaceDecorator.cpp +++ b/hotspot/src/share/vm/gc/shared/spaceDecorator.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "gc/shared/space.inline.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "logging/log.hpp" #include "utilities/copy.hpp" // Catch-all file for utility classes @@ -83,13 +84,9 @@ void SpaceMangler::mangle_unused_area_complete() { void SpaceMangler::mangle_region(MemRegion mr) { assert(ZapUnusedHeapArea, "Mangling should not be in use"); #ifdef ASSERT - if(TraceZapUnusedHeapArea) { - gclog_or_tty->print("Mangling [" PTR_FORMAT " to " PTR_FORMAT ")", p2i(mr.start()), p2i(mr.end())); - } + log_develop_trace(gc)("Mangling [" PTR_FORMAT " to " PTR_FORMAT ")", p2i(mr.start()), p2i(mr.end())); Copy::fill_to_words(mr.start(), mr.word_size(), badHeapWord); - if(TraceZapUnusedHeapArea) { - gclog_or_tty->print_cr(" done"); - } + log_develop_trace(gc)("Mangling done."); #endif } diff --git a/hotspot/src/share/vm/gc/shared/taskqueue.cpp b/hotspot/src/share/vm/gc/shared/taskqueue.cpp index cc21a1e731f..57b65fbcc73 100644 --- a/hotspot/src/share/vm/gc/shared/taskqueue.cpp +++ b/hotspot/src/share/vm/gc/shared/taskqueue.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "gc/shared/taskqueue.hpp" #include "oops/oop.inline.hpp" +#include "logging/log.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/os.hpp" #include "runtime/thread.inline.hpp" @@ -212,11 +213,8 @@ ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) { #endif } } else { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("ParallelTaskTerminator::offer_termination() " - "thread " PTR_FORMAT " sleeps after %u yields", - p2i(Thread::current()), yield_count); - } + log_develop_trace(gc, task)("ParallelTaskTerminator::offer_termination() thread " PTR_FORMAT " sleeps after %u yields", + p2i(Thread::current()), yield_count); yield_count = 0; // A sleep will cause this processor to seek work on another processor's // runqueue, if it has nothing else to run (as opposed to the yield @@ -240,7 +238,7 @@ ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) { #ifdef TRACESPINNING void ParallelTaskTerminator::print_termination_counts() { - gclog_or_tty->print_cr("ParallelTaskTerminator Total yields: %u" + log_trace(gc, task)("ParallelTaskTerminator Total yields: %u" " Total spins: %u Total peeks: %u", total_yields(), total_spins(), diff --git a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp index fe24138088e..43389fb4613 100644 --- a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp +++ b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/threadLocalAllocBuffer.inline.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.inline.hpp" #include "oops/oop.inline.hpp" @@ -54,9 +55,7 @@ void ThreadLocalAllocBuffer::accumulate_statistics_before_gc() { // Publish new stats if some allocation occurred. if (global_stats()->allocation() != 0) { global_stats()->publish(); - if (PrintTLAB) { - global_stats()->print(); - } + global_stats()->print(); } } @@ -70,9 +69,7 @@ void ThreadLocalAllocBuffer::accumulate_statistics() { size_t allocated_since_last_gc = total_allocated - _allocated_before_last_gc; _allocated_before_last_gc = total_allocated; - if (PrintTLAB && (_number_of_refills > 0 || Verbose)) { - print_stats("gc"); - } + print_stats("gc"); if (_number_of_refills > 0) { // Update allocation history if a reasonable amount of eden was allocated. @@ -149,12 +146,11 @@ void ThreadLocalAllocBuffer::resize() { size_t aligned_new_size = align_object_size(new_size); - if (PrintTLAB && Verbose) { - gclog_or_tty->print("TLAB new size: thread: " INTPTR_FORMAT " [id: %2d]" - " refills %d alloc: %8.6f desired_size: " SIZE_FORMAT " -> " SIZE_FORMAT "\n", - p2i(myThread()), myThread()->osthread()->thread_id(), - _target_refills, _allocation_fraction.average(), desired_size(), aligned_new_size); - } + log_trace(gc, tlab)("TLAB new size: thread: " INTPTR_FORMAT " [id: %2d]" + " refills %d alloc: %8.6f desired_size: " SIZE_FORMAT " -> " SIZE_FORMAT, + p2i(myThread()), myThread()->osthread()->thread_id(), + _target_refills, _allocation_fraction.average(), desired_size(), aligned_new_size); + set_desired_size(aligned_new_size); set_refill_waste_limit(initial_refill_waste_limit()); } @@ -171,9 +167,7 @@ void ThreadLocalAllocBuffer::fill(HeapWord* start, HeapWord* top, size_t new_size) { _number_of_refills++; - if (PrintTLAB && Verbose) { - print_stats("fill"); - } + print_stats("fill"); assert(top <= start + new_size - alignment_reserve(), "size too small"); initialize(start, top, start + new_size - alignment_reserve()); @@ -226,10 +220,8 @@ void ThreadLocalAllocBuffer::startup_initialization() { guarantee(Thread::current()->is_Java_thread(), "tlab initialization thread not Java thread"); Thread::current()->tlab().initialize(); - if (PrintTLAB && Verbose) { - gclog_or_tty->print("TLAB min: " SIZE_FORMAT " initial: " SIZE_FORMAT " max: " SIZE_FORMAT "\n", - min_size(), Thread::current()->tlab().initial_desired_size(), max_size()); - } + log_develop_trace(gc, tlab)("TLAB min: " SIZE_FORMAT " initial: " SIZE_FORMAT " max: " SIZE_FORMAT, + min_size(), Thread::current()->tlab().initial_desired_size(), max_size()); } size_t ThreadLocalAllocBuffer::initial_desired_size() { @@ -250,26 +242,31 @@ size_t ThreadLocalAllocBuffer::initial_desired_size() { } void ThreadLocalAllocBuffer::print_stats(const char* tag) { + LogHandle(gc, tlab) log; + if (!log.is_trace()) { + return; + } + Thread* thrd = myThread(); size_t waste = _gc_waste + _slow_refill_waste + _fast_refill_waste; size_t alloc = _number_of_refills * _desired_size; double waste_percent = alloc == 0 ? 0.0 : 100.0 * waste / alloc; size_t tlab_used = Universe::heap()->tlab_used(thrd); - gclog_or_tty->print("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]" - " desired_size: " SIZE_FORMAT "KB" - " slow allocs: %d refill waste: " SIZE_FORMAT "B" - " alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB" - " slow: %dB fast: %dB\n", - tag, p2i(thrd), thrd->osthread()->thread_id(), - _desired_size / (K / HeapWordSize), - _slow_allocations, _refill_waste_limit * HeapWordSize, - _allocation_fraction.average(), - _allocation_fraction.average() * tlab_used / K, - _number_of_refills, waste_percent, - _gc_waste * HeapWordSize, - _slow_refill_waste * HeapWordSize, - _fast_refill_waste * HeapWordSize); + log.trace("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]" + " desired_size: " SIZE_FORMAT "KB" + " slow allocs: %d refill waste: " SIZE_FORMAT "B" + " alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB" + " slow: %dB fast: %dB", + tag, p2i(thrd), thrd->osthread()->thread_id(), + _desired_size / (K / HeapWordSize), + _slow_allocations, _refill_waste_limit * HeapWordSize, + _allocation_fraction.average(), + _allocation_fraction.average() * tlab_used / K, + _number_of_refills, waste_percent, + _gc_waste * HeapWordSize, + _slow_refill_waste * HeapWordSize, + _fast_refill_waste * HeapWordSize); } void ThreadLocalAllocBuffer::verify() { @@ -388,22 +385,27 @@ void GlobalTLABStats::publish() { } void GlobalTLABStats::print() { + LogHandle(gc, tlab) log; + if (!log.is_debug()) { + return; + } + size_t waste = _total_gc_waste + _total_slow_refill_waste + _total_fast_refill_waste; double waste_percent = _total_allocation == 0 ? 0.0 : 100.0 * waste / _total_allocation; - gclog_or_tty->print("TLAB totals: thrds: %d refills: %d max: %d" - " slow allocs: %d max %d waste: %4.1f%%" - " gc: " SIZE_FORMAT "B max: " SIZE_FORMAT "B" - " slow: " SIZE_FORMAT "B max: " SIZE_FORMAT "B" - " fast: " SIZE_FORMAT "B max: " SIZE_FORMAT "B\n", - _allocating_threads, - _total_refills, _max_refills, - _total_slow_allocations, _max_slow_allocations, - waste_percent, - _total_gc_waste * HeapWordSize, - _max_gc_waste * HeapWordSize, - _total_slow_refill_waste * HeapWordSize, - _max_slow_refill_waste * HeapWordSize, - _total_fast_refill_waste * HeapWordSize, - _max_fast_refill_waste * HeapWordSize); + log.debug("TLAB totals: thrds: %d refills: %d max: %d" + " slow allocs: %d max %d waste: %4.1f%%" + " gc: " SIZE_FORMAT "B max: " SIZE_FORMAT "B" + " slow: " SIZE_FORMAT "B max: " SIZE_FORMAT "B" + " fast: " SIZE_FORMAT "B max: " SIZE_FORMAT "B", + _allocating_threads, + _total_refills, _max_refills, + _total_slow_allocations, _max_slow_allocations, + waste_percent, + _total_gc_waste * HeapWordSize, + _max_gc_waste * HeapWordSize, + _total_slow_refill_waste * HeapWordSize, + _max_slow_refill_waste * HeapWordSize, + _total_fast_refill_waste * HeapWordSize, + _max_fast_refill_waste * HeapWordSize); } diff --git a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.inline.hpp b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.inline.hpp index 809760fc1b2..8c1178b8cdf 100644 --- a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.inline.hpp +++ b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.inline.hpp @@ -27,6 +27,7 @@ #include "gc/shared/collectedHeap.hpp" #include "gc/shared/threadLocalAllocBuffer.hpp" +#include "logging/log.hpp" #include "runtime/thread.hpp" #include "utilities/copy.hpp" @@ -66,18 +67,12 @@ inline size_t ThreadLocalAllocBuffer::compute_size(size_t obj_size) { const size_t obj_plus_filler_size = aligned_obj_size + alignment_reserve(); if (new_tlab_size < obj_plus_filler_size) { // If there isn't enough room for the allocation, return failure. - if (PrintTLAB && Verbose) { - gclog_or_tty->print_cr("ThreadLocalAllocBuffer::compute_size(" SIZE_FORMAT ")" - " returns failure", - obj_size); - } + log_trace(gc, tlab)("ThreadLocalAllocBuffer::compute_size(" SIZE_FORMAT ") returns failure", + obj_size); return 0; } - if (PrintTLAB && Verbose) { - gclog_or_tty->print_cr("ThreadLocalAllocBuffer::compute_size(" SIZE_FORMAT ")" - " returns " SIZE_FORMAT, - obj_size, new_tlab_size); - } + log_trace(gc, tlab)("ThreadLocalAllocBuffer::compute_size(" SIZE_FORMAT ") returns " SIZE_FORMAT, + obj_size, new_tlab_size); return new_tlab_size; } @@ -91,15 +86,12 @@ void ThreadLocalAllocBuffer::record_slow_allocation(size_t obj_size) { _slow_allocations++; - if (PrintTLAB && Verbose) { - Thread* thrd = myThread(); - gclog_or_tty->print("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]" - " obj: " SIZE_FORMAT - " free: " SIZE_FORMAT - " waste: " SIZE_FORMAT "\n", - "slow", p2i(thrd), thrd->osthread()->thread_id(), - obj_size, free(), refill_waste_limit()); - } + log_develop_trace(gc, tlab)("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]" + " obj: " SIZE_FORMAT + " free: " SIZE_FORMAT + " waste: " SIZE_FORMAT, + "slow", p2i(myThread()), myThread()->osthread()->thread_id(), + obj_size, free(), refill_waste_limit()); } #endif // SHARE_VM_GC_SHARED_THREADLOCALALLOCBUFFER_INLINE_HPP diff --git a/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp index 20d3d1d74ae..7b022a7e23e 100644 --- a/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp +++ b/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp @@ -29,6 +29,7 @@ #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/vmGCOperations.hpp" #include "memory/oopFactory.hpp" +#include "logging/log.hpp" #include "oops/instanceKlass.hpp" #include "oops/instanceRefKlass.hpp" #include "runtime/handles.inline.hpp" @@ -216,16 +217,6 @@ bool VM_CollectForMetadataAllocation::initiate_concurrent_GC() { return false; } -static void log_metaspace_alloc_failure_for_concurrent_GC() { - if (Verbose && PrintGCDetails) { - if (UseConcMarkSweepGC) { - gclog_or_tty->print_cr("\nCMS full GC for Metaspace"); - } else if (UseG1GC) { - gclog_or_tty->print_cr("\nG1 full GC for Metaspace"); - } - } -} - void VM_CollectForMetadataAllocation::doit() { SvcGCMarker sgcm(SvcGCMarker::FULL); @@ -249,7 +240,7 @@ void VM_CollectForMetadataAllocation::doit() { return; } - log_metaspace_alloc_failure_for_concurrent_GC(); + log_debug(gc)("%s full GC for Metaspace", UseConcMarkSweepGC ? "CMS" : "G1"); } // Don't clear the soft refs yet. @@ -282,10 +273,7 @@ void VM_CollectForMetadataAllocation::doit() { return; } - if (Verbose && PrintGCDetails) { - gclog_or_tty->print_cr("\nAfter Metaspace GC failed to allocate size " - SIZE_FORMAT, _size); - } + log_debug(gc)("After Metaspace GC failed to allocate size " SIZE_FORMAT, _size); if (GC_locker::is_active_and_needs_gc()) { set_gc_locked(); diff --git a/hotspot/src/share/vm/logging/logPrefix.hpp b/hotspot/src/share/vm/logging/logPrefix.hpp index 443f20a0a4d..2948e6cddce 100644 --- a/hotspot/src/share/vm/logging/logPrefix.hpp +++ b/hotspot/src/share/vm/logging/logPrefix.hpp @@ -38,7 +38,38 @@ // List of prefixes for specific tags and/or tagsets. // Syntax: LOG_PREFIX(, LOG_TAGS()) // Where the prefixer function matches the following signature: size_t (*)(char*, size_t) -#define LOG_PREFIX_LIST // Currently unused/empty +#define LOG_PREFIX_LIST \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, age)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, alloc)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, barrier)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, compaction)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, compaction, phases)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, cpu)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ergo)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ergo, cset)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ergo, heap)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ergo, ihop)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, heap)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, freelist)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ihop)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, liveness)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, metaspace)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, phases)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, phases, start)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, plab)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, region)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, remset)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ref)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ref, start)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, start)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, sweep)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, task)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, task, start)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, task, stats)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, task, time)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, tlab)) + // The empty prefix, used when there's no prefix defined. template diff --git a/hotspot/src/share/vm/logging/logTag.hpp b/hotspot/src/share/vm/logging/logTag.hpp index 4dd9e35baf3..de21a9e6f11 100644 --- a/hotspot/src/share/vm/logging/logTag.hpp +++ b/hotspot/src/share/vm/logging/logTag.hpp @@ -31,11 +31,52 @@ // (The tags 'all', 'disable' and 'help' are special tags that can // not be used in log calls, and should not be listed below.) #define LOG_TAG_LIST \ + LOG_TAG(alloc) \ + LOG_TAG(age) \ + LOG_TAG(barrier) \ + LOG_TAG(bot) \ + LOG_TAG(census) \ + LOG_TAG(classhisto) \ LOG_TAG(classinit) \ + LOG_TAG(comp) \ + LOG_TAG(compaction) \ + LOG_TAG(cpu) \ + LOG_TAG(cset) \ LOG_TAG(defaultmethods) \ + LOG_TAG(ergo) \ + LOG_TAG(exit) \ + LOG_TAG(freelist) \ LOG_TAG(gc) \ + LOG_TAG(heap) \ + LOG_TAG(humongous) \ + LOG_TAG(ihop) \ + LOG_TAG(jni) \ + LOG_TAG(liveness) \ LOG_TAG(logging) \ + LOG_TAG(marking) \ + LOG_TAG(metaspace) \ + LOG_TAG(phases) \ + LOG_TAG(plab) \ + LOG_TAG(promotion) \ + LOG_TAG(ref) \ + LOG_TAG(refine) \ + LOG_TAG(region) \ + LOG_TAG(remset) \ + LOG_TAG(rt) \ LOG_TAG(safepoint) \ + LOG_TAG(scavenge) \ + LOG_TAG(scrub) \ + LOG_TAG(start) \ + LOG_TAG(state) \ + LOG_TAG(stats) \ + LOG_TAG(stringdedup) \ + LOG_TAG(survivor) \ + LOG_TAG(svc) \ + LOG_TAG(sweep) \ + LOG_TAG(task) \ + LOG_TAG(tlab) \ + LOG_TAG(time) \ + LOG_TAG(verify) \ LOG_TAG(vmoperation) #define PREFIX_LOG_TAG(T) (LogTag::_##T) diff --git a/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp b/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp index 8837c8a6e2d..c96fd6a32f1 100644 --- a/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp +++ b/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp @@ -29,6 +29,7 @@ #include "memory/freeBlockDictionary.hpp" #include "memory/freeList.hpp" #include "memory/metachunk.hpp" +#include "memory/resourceArea.hpp" #include "runtime/globals.hpp" #include "utilities/macros.hpp" #include "utilities/ostream.hpp" @@ -1189,27 +1190,29 @@ void BinaryTreeDictionary::end_sweep_dict_census(double spl // Does walking the tree 3 times hurt? set_tree_surplus(splitSurplusPercent); set_tree_hints(); - if (PrintGC && Verbose) { - report_statistics(); + LogHandle(gc, freelist, stats) log; + if (log.is_trace()) { + ResourceMark rm; + report_statistics(log.trace_stream()); } clear_tree_census(); } // Print summary statistics template -void BinaryTreeDictionary::report_statistics() const { +void BinaryTreeDictionary::report_statistics(outputStream* st) const { FreeBlockDictionary::verify_par_locked(); - gclog_or_tty->print("Statistics for BinaryTreeDictionary:\n" - "------------------------------------\n"); + st->print_cr("Statistics for BinaryTreeDictionary:"); + st->print_cr("------------------------------------"); size_t total_size = total_chunk_size(debug_only(NULL)); - size_t free_blocks = num_free_blocks(); - gclog_or_tty->print("Total Free Space: " SIZE_FORMAT "\n", total_size); - gclog_or_tty->print("Max Chunk Size: " SIZE_FORMAT "\n", max_chunk_size()); - gclog_or_tty->print("Number of Blocks: " SIZE_FORMAT "\n", free_blocks); + size_t free_blocks = num_free_blocks(); + st->print_cr("Total Free Space: " SIZE_FORMAT, total_size); + st->print_cr("Max Chunk Size: " SIZE_FORMAT, max_chunk_size()); + st->print_cr("Number of Blocks: " SIZE_FORMAT, free_blocks); if (free_blocks > 0) { - gclog_or_tty->print("Av. Block Size: " SIZE_FORMAT "\n", total_size/free_blocks); + st->print_cr("Av. Block Size: " SIZE_FORMAT, total_size/free_blocks); } - gclog_or_tty->print("Tree Height: " SIZE_FORMAT "\n", tree_height()); + st->print_cr("Tree Height: " SIZE_FORMAT, tree_height()); } // Print census information - counts, births, deaths, etc. @@ -1229,22 +1232,27 @@ class PrintTreeCensusClosure : public AscendTreeCensusClosure* fl) { + LogHandle(gc, freelist, census) log; + outputStream* out = log.debug_stream(); if (++_print_line >= 40) { - FreeList_t::print_labels_on(gclog_or_tty, "size"); + ResourceMark rm; + FreeList_t::print_labels_on(out, "size"); _print_line = 0; } - fl->print_on(gclog_or_tty); - _total_free += fl->count() * fl->size() ; - total()->set_count( total()->count() + fl->count() ); + fl->print_on(out); + _total_free += fl->count() * fl->size(); + total()->set_count(total()->count() + fl->count()); } #if INCLUDE_ALL_GCS void do_list(AdaptiveFreeList* fl) { + LogHandle(gc, freelist, census) log; + outputStream* out = log.debug_stream(); if (++_print_line >= 40) { - FreeList_t::print_labels_on(gclog_or_tty, "size"); + FreeList_t::print_labels_on(out, "size"); _print_line = 0; } - fl->print_on(gclog_or_tty); + fl->print_on(out); _total_free += fl->count() * fl->size() ; total()->set_count( total()->count() + fl->count() ); total()->set_bfr_surp( total()->bfr_surp() + fl->bfr_surp() ); @@ -1261,38 +1269,36 @@ class PrintTreeCensusClosure : public AscendTreeCensusClosure -void BinaryTreeDictionary::print_dict_census(void) const { +void BinaryTreeDictionary::print_dict_census(outputStream* st) const { - gclog_or_tty->print("\nBinaryTree\n"); - FreeList_t::print_labels_on(gclog_or_tty, "size"); + st->print("BinaryTree"); + FreeList_t::print_labels_on(st, "size"); PrintTreeCensusClosure ptc; ptc.do_tree(root()); FreeList_t* total = ptc.total(); - FreeList_t::print_labels_on(gclog_or_tty, " "); + FreeList_t::print_labels_on(st, " "); } #if INCLUDE_ALL_GCS template <> -void AFLBinaryTreeDictionary::print_dict_census(void) const { +void AFLBinaryTreeDictionary::print_dict_census(outputStream* st) const { - gclog_or_tty->print("\nBinaryTree\n"); - AdaptiveFreeList::print_labels_on(gclog_or_tty, "size"); + st->print_cr("BinaryTree"); + AdaptiveFreeList::print_labels_on(st, "size"); PrintTreeCensusClosure > ptc; ptc.do_tree(root()); AdaptiveFreeList* total = ptc.total(); - AdaptiveFreeList::print_labels_on(gclog_or_tty, " "); - total->print_on(gclog_or_tty, "TOTAL\t"); - gclog_or_tty->print( - "total_free(words): " SIZE_FORMAT_W(16) - " growth: %8.5f deficit: %8.5f\n", - ptc.total_free(), - (double)(total->split_births() + total->coal_births() - - total->split_deaths() - total->coal_deaths()) - /(total->prev_sweep() != 0 ? (double)total->prev_sweep() : 1.0), - (double)(total->desired() - total->count()) - /(total->desired() != 0 ? (double)total->desired() : 1.0)); + AdaptiveFreeList::print_labels_on(st, " "); + total->print_on(st, "TOTAL\t"); + st->print_cr("total_free(words): " SIZE_FORMAT_W(16) " growth: %8.5f deficit: %8.5f", + ptc.total_free(), + (double)(total->split_births() + total->coal_births() + - total->split_deaths() - total->coal_deaths()) + /(total->prev_sweep() != 0 ? (double)total->prev_sweep() : 1.0), + (double)(total->desired() - total->count()) + /(total->desired() != 0 ? (double)total->desired() : 1.0)); } #endif // INCLUDE_ALL_GCS @@ -1311,7 +1317,7 @@ class PrintFreeListsClosure : public AscendTreeCensusClosureprint_on(gclog_or_tty); + fl->print_on(_st); size_t sz = fl->size(); for (Chunk_t* fc = fl->head(); fc != NULL; fc = fc->next()) { diff --git a/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp b/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp index 8377912f242..9221f3406d5 100644 --- a/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp +++ b/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp @@ -324,7 +324,7 @@ class BinaryTreeDictionary: public FreeBlockDictionary { void clear_tree_census(void); // Print the statistics for all the lists in the tree. Also may // print out summaries. - void print_dict_census(void) const; + void print_dict_census(outputStream* st) const; void print_free_lists(outputStream* st) const; // For debugging. Returns the sum of the _returned_bytes for @@ -335,7 +335,7 @@ class BinaryTreeDictionary: public FreeBlockDictionary { // For debugging. Return the total number of chunks in the dictionary. size_t total_count() PRODUCT_RETURN0; - void report_statistics() const; + void report_statistics(outputStream* st) const; void verify() const; }; diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp index b05df839cb1..59c82277c07 100644 --- a/hotspot/src/share/vm/memory/filemap.cpp +++ b/hotspot/src/share/vm/memory/filemap.cpp @@ -954,11 +954,11 @@ bool FileMapInfo::is_in_shared_space(const void* p) { } void FileMapInfo::print_shared_spaces() { - gclog_or_tty->print_cr("Shared Spaces:"); + tty->print_cr("Shared Spaces:"); for (int i = 0; i < MetaspaceShared::n_regions; i++) { struct FileMapInfo::FileMapHeader::space_info* si = &_header->_space[i]; char *base = _header->region_addr(i); - gclog_or_tty->print(" %s " INTPTR_FORMAT "-" INTPTR_FORMAT, + tty->print(" %s " INTPTR_FORMAT "-" INTPTR_FORMAT, shared_region_name[i], p2i(base), p2i(base + si->_used)); } diff --git a/hotspot/src/share/vm/memory/freeBlockDictionary.hpp b/hotspot/src/share/vm/memory/freeBlockDictionary.hpp index 2502e362d9c..a989396f6bf 100644 --- a/hotspot/src/share/vm/memory/freeBlockDictionary.hpp +++ b/hotspot/src/share/vm/memory/freeBlockDictionary.hpp @@ -89,11 +89,11 @@ class FreeBlockDictionary: public CHeapObj { virtual size_t total_count() = 0; ) - virtual void report_statistics() const { - gclog_or_tty->print("No statistics available"); + virtual void report_statistics(outputStream* st) const { + st->print_cr("No statistics available"); } - virtual void print_dict_census() const = 0; + virtual void print_dict_census(outputStream* st) const = 0; virtual void print_free_lists(outputStream* st) const = 0; virtual void verify() const = 0; diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index 74ee0877ba9..a59bf063d51 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -25,6 +25,7 @@ #include "gc/shared/collectedHeap.hpp" #include "gc/shared/collectorPolicy.hpp" #include "gc/shared/gcLocker.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/binaryTreeDictionary.hpp" #include "memory/filemap.hpp" @@ -811,8 +812,10 @@ void VirtualSpaceNode::verify_container_count() { BlockFreelist::BlockFreelist() : _dictionary(new BlockTreeDictionary()) {} BlockFreelist::~BlockFreelist() { - if (Verbose && TraceMetadataChunkAllocation) { - dictionary()->print_free_lists(gclog_or_tty); + LogHandle(gc, metaspace, freelist) log; + if (log.is_trace()) { + ResourceMark rm; + dictionary()->print_free_lists(log.trace_stream()); } delete _dictionary; } @@ -892,11 +895,11 @@ Metachunk* VirtualSpaceNode::take_from_committed(size_t chunk_word_size) { "The committed memory doesn't match the expanded memory."); if (!is_available(chunk_word_size)) { - if (TraceMetadataChunkAllocation) { - gclog_or_tty->print("VirtualSpaceNode::take_from_committed() not available " SIZE_FORMAT " words ", chunk_word_size); - // Dump some information about the virtual space that is nearly full - print_on(gclog_or_tty); - } + LogHandle(gc, metaspace, freelist) log; + log.debug("VirtualSpaceNode::take_from_committed() not available " SIZE_FORMAT " words ", chunk_word_size); + // Dump some information about the virtual space that is nearly full + ResourceMark rm; + print_on(log.debug_stream()); return NULL; } @@ -1231,9 +1234,11 @@ void VirtualSpaceList::link_vs(VirtualSpaceNode* new_entry) { #ifdef ASSERT new_entry->mangle(); #endif - if (TraceMetavirtualspaceAllocation && Verbose) { + if (develop_log_is_enabled(Trace, gc, metaspace)) { + LogHandle(gc, metaspace) log; VirtualSpaceNode* vsl = current_virtual_space(); - vsl->print_on(gclog_or_tty); + ResourceMark rm; + vsl->print_on(log.trace_stream()); } } @@ -1330,12 +1335,10 @@ Metachunk* VirtualSpaceList::get_new_chunk(size_t word_size, } void VirtualSpaceList::print_on(outputStream* st) const { - if (TraceMetadataChunkAllocation && Verbose) { - VirtualSpaceListIterator iter(virtual_space_list()); - while (iter.repeat()) { - VirtualSpaceNode* node = iter.get_next(); - node->print_on(st); - } + VirtualSpaceListIterator iter(virtual_space_list()); + while (iter.repeat()) { + VirtualSpaceNode* node = iter.get_next(); + node->print_on(st); } } @@ -1497,17 +1500,10 @@ void MetaspaceGC::compute_new_size() { minimum_desired_capacity = MAX2(minimum_desired_capacity, MetaspaceSize); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("\nMetaspaceGC::compute_new_size: "); - gclog_or_tty->print_cr(" " - " minimum_free_percentage: %6.2f" - " maximum_used_percentage: %6.2f", - minimum_free_percentage, - maximum_used_percentage); - gclog_or_tty->print_cr(" " - " used_after_gc : %6.1fKB", - used_after_gc / (double) K); - } + log_trace(gc, metaspace)("MetaspaceGC::compute_new_size: "); + log_trace(gc, metaspace)(" minimum_free_percentage: %6.2f maximum_used_percentage: %6.2f", + minimum_free_percentage, maximum_used_percentage); + log_trace(gc, metaspace)(" used_after_gc : %6.1fKB", used_after_gc / (double) K); size_t shrink_bytes = 0; @@ -1525,17 +1521,11 @@ void MetaspaceGC::compute_new_size() { Metaspace::tracer()->report_gc_threshold(capacity_until_GC, new_capacity_until_GC, MetaspaceGCThresholdUpdater::ComputeNewSize); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr(" expanding:" - " minimum_desired_capacity: %6.1fKB" - " expand_bytes: %6.1fKB" - " MinMetaspaceExpansion: %6.1fKB" - " new metaspace HWM: %6.1fKB", - minimum_desired_capacity / (double) K, - expand_bytes / (double) K, - MinMetaspaceExpansion / (double) K, - new_capacity_until_GC / (double) K); - } + log_trace(gc, metaspace)(" expanding: minimum_desired_capacity: %6.1fKB expand_bytes: %6.1fKB MinMetaspaceExpansion: %6.1fKB new metaspace HWM: %6.1fKB", + minimum_desired_capacity / (double) K, + expand_bytes / (double) K, + MinMetaspaceExpansion / (double) K, + new_capacity_until_GC / (double) K); } return; } @@ -1555,18 +1545,10 @@ void MetaspaceGC::compute_new_size() { size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx)); maximum_desired_capacity = MAX2(maximum_desired_capacity, MetaspaceSize); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr(" " - " maximum_free_percentage: %6.2f" - " minimum_used_percentage: %6.2f", - maximum_free_percentage, - minimum_used_percentage); - gclog_or_tty->print_cr(" " - " minimum_desired_capacity: %6.1fKB" - " maximum_desired_capacity: %6.1fKB", - minimum_desired_capacity / (double) K, - maximum_desired_capacity / (double) K); - } + log_trace(gc, metaspace)(" maximum_free_percentage: %6.2f minimum_used_percentage: %6.2f", + maximum_free_percentage, minimum_used_percentage); + log_trace(gc, metaspace)(" minimum_desired_capacity: %6.1fKB maximum_desired_capacity: %6.1fKB", + minimum_desired_capacity / (double) K, maximum_desired_capacity / (double) K); assert(minimum_desired_capacity <= maximum_desired_capacity, "sanity check"); @@ -1592,23 +1574,10 @@ void MetaspaceGC::compute_new_size() { } else { _shrink_factor = MIN2(current_shrink_factor * 4, (uint) 100); } - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr(" " - " shrinking:" - " initSize: %.1fK" - " maximum_desired_capacity: %.1fK", - MetaspaceSize / (double) K, - maximum_desired_capacity / (double) K); - gclog_or_tty->print_cr(" " - " shrink_bytes: %.1fK" - " current_shrink_factor: %d" - " new shrink factor: %d" - " MinMetaspaceExpansion: %.1fK", - shrink_bytes / (double) K, - current_shrink_factor, - _shrink_factor, - MinMetaspaceExpansion / (double) K); - } + log_trace(gc, metaspace)(" shrinking: initSize: %.1fK maximum_desired_capacity: %.1fK", + MetaspaceSize / (double) K, maximum_desired_capacity / (double) K); + log_trace(gc, metaspace)(" shrink_bytes: %.1fK current_shrink_factor: %d new shrink factor: %d MinMetaspaceExpansion: %.1fK", + shrink_bytes / (double) K, current_shrink_factor, _shrink_factor, MinMetaspaceExpansion / (double) K); } } @@ -1638,10 +1607,7 @@ bool Metadebug::test_metadata_failure() { if (_allocation_fail_alot_count > 0) { _allocation_fail_alot_count--; } else { - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("Metadata allocation failing for " - "MetadataAllocationFailALot"); - } + log_trace(gc, metaspace, freelist)("Metadata allocation failing for MetadataAllocationFailALot"); init_allocation_fail_alot_count(); return true; } @@ -1786,11 +1752,8 @@ Metachunk* ChunkManager::free_chunks_get(size_t word_size) { // Remove the chunk as the head of the list. free_list->remove_chunk(chunk); - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("ChunkManager::free_chunks_get: free_list " - PTR_FORMAT " head " PTR_FORMAT " size " SIZE_FORMAT, - p2i(free_list), p2i(chunk), chunk->word_size()); - } + log_trace(gc, metaspace, freelist)("ChunkManager::free_chunks_get: free_list " PTR_FORMAT " head " PTR_FORMAT " size " SIZE_FORMAT, + p2i(free_list), p2i(chunk), chunk->word_size()); } else { chunk = humongous_dictionary()->get_chunk( word_size, @@ -1800,13 +1763,8 @@ Metachunk* ChunkManager::free_chunks_get(size_t word_size) { return NULL; } - if (TraceMetadataHumongousAllocation) { - size_t waste = chunk->word_size() - word_size; - gclog_or_tty->print_cr("Free list allocate humongous chunk size " - SIZE_FORMAT " for requested size " SIZE_FORMAT - " waste " SIZE_FORMAT, - chunk->word_size(), word_size, waste); - } + log_debug(gc, metaspace, alloc)("Free list allocate humongous chunk size " SIZE_FORMAT " for requested size " SIZE_FORMAT " waste " SIZE_FORMAT, + chunk->word_size(), word_size, chunk->word_size() - word_size); } // Chunk is being removed from the chunks free list. @@ -1839,7 +1797,8 @@ Metachunk* ChunkManager::chunk_freelist_allocate(size_t word_size) { assert((word_size <= chunk->word_size()) || list_index(chunk->word_size() == HumongousIndex), "Non-humongous variable sized chunk"); - if (TraceMetadataChunkAllocation) { + LogHandle(gc, metaspace, freelist) log; + if (log.is_debug()) { size_t list_count; if (list_index(word_size) < HumongousIndex) { ChunkList* list = find_free_chunks_list(word_size); @@ -1847,19 +1806,17 @@ Metachunk* ChunkManager::chunk_freelist_allocate(size_t word_size) { } else { list_count = humongous_dictionary()->total_count(); } - gclog_or_tty->print("ChunkManager::chunk_freelist_allocate: " PTR_FORMAT " chunk " - PTR_FORMAT " size " SIZE_FORMAT " count " SIZE_FORMAT " ", - p2i(this), p2i(chunk), chunk->word_size(), list_count); - locked_print_free_chunks(gclog_or_tty); + log.debug("ChunkManager::chunk_freelist_allocate: " PTR_FORMAT " chunk " PTR_FORMAT " size " SIZE_FORMAT " count " SIZE_FORMAT " ", + p2i(this), p2i(chunk), chunk->word_size(), list_count); + ResourceMark rm; + locked_print_free_chunks(log.debug_stream()); } return chunk; } void ChunkManager::print_on(outputStream* out) const { - if (PrintFLSStatistics != 0) { - const_cast(this)->humongous_dictionary()->report_statistics(); - } + const_cast(this)->humongous_dictionary()->report_statistics(out); } // SpaceManager methods @@ -2039,14 +1996,12 @@ size_t SpaceManager::calc_chunk_size(size_t word_size) { "Size calculation is wrong, word_size " SIZE_FORMAT " chunk_word_size " SIZE_FORMAT, word_size, chunk_word_size); - if (TraceMetadataHumongousAllocation && - SpaceManager::is_humongous(word_size)) { - gclog_or_tty->print_cr("Metadata humongous allocation:"); - gclog_or_tty->print_cr(" word_size " PTR_FORMAT, word_size); - gclog_or_tty->print_cr(" chunk_word_size " PTR_FORMAT, - chunk_word_size); - gclog_or_tty->print_cr(" chunk overhead " PTR_FORMAT, - Metachunk::overhead()); + LogHandle(gc, metaspace, alloc) log; + if (log.is_debug() && SpaceManager::is_humongous(word_size)) { + log.debug("Metadata humongous allocation:"); + log.debug(" word_size " PTR_FORMAT, word_size); + log.debug(" chunk_word_size " PTR_FORMAT, chunk_word_size); + log.debug(" chunk overhead " PTR_FORMAT, Metachunk::overhead()); } return chunk_word_size; } @@ -2068,17 +2023,15 @@ MetaWord* SpaceManager::grow_and_allocate(size_t word_size) { "Don't need to expand"); MutexLockerEx cl(SpaceManager::expand_lock(), Mutex::_no_safepoint_check_flag); - if (TraceMetadataChunkAllocation && Verbose) { + if (log_is_enabled(Trace, gc, metaspace, freelist)) { size_t words_left = 0; size_t words_used = 0; if (current_chunk() != NULL) { words_left = current_chunk()->free_word_size(); words_used = current_chunk()->used_word_size(); } - gclog_or_tty->print_cr("SpaceManager::grow_and_allocate for " SIZE_FORMAT - " words " SIZE_FORMAT " words used " SIZE_FORMAT - " words left", - word_size, words_used, words_left); + log_trace(gc, metaspace, freelist)("SpaceManager::grow_and_allocate for " SIZE_FORMAT " words " SIZE_FORMAT " words used " SIZE_FORMAT " words left", + word_size, words_used, words_left); } // Get another chunk @@ -2169,9 +2122,7 @@ void SpaceManager::initialize() { _chunks_in_use[i] = NULL; } _current_chunk = NULL; - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("SpaceManager(): " PTR_FORMAT, p2i(this)); - } + log_trace(gc, metaspace, freelist)("SpaceManager(): " PTR_FORMAT, p2i(this)); } void ChunkManager::return_chunks(ChunkIndex index, Metachunk* chunks) { @@ -2213,9 +2164,11 @@ SpaceManager::~SpaceManager() { dec_total_from_size_metrics(); - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("~SpaceManager(): " PTR_FORMAT, p2i(this)); - locked_print_chunks_in_use_on(gclog_or_tty); + LogHandle(gc, metaspace, freelist) log; + if (log.is_trace()) { + log.trace("~SpaceManager(): " PTR_FORMAT, p2i(this)); + ResourceMark rm; + locked_print_chunks_in_use_on(log.trace_stream()); } // Do not mangle freed Metachunks. The chunk size inside Metachunks @@ -2233,19 +2186,11 @@ SpaceManager::~SpaceManager() { // free lists. Each list is NULL terminated. for (ChunkIndex i = ZeroIndex; i < HumongousIndex; i = next_chunk_index(i)) { - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("returned " SIZE_FORMAT " %s chunks to freelist", - sum_count_in_chunks_in_use(i), - chunk_size_name(i)); - } + log.trace("returned " SIZE_FORMAT " %s chunks to freelist", sum_count_in_chunks_in_use(i), chunk_size_name(i)); Metachunk* chunks = chunks_in_use(i); chunk_manager()->return_chunks(i, chunks); set_chunks_in_use(i, NULL); - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("updated freelist count " SSIZE_FORMAT " %s", - chunk_manager()->free_chunks(i)->count(), - chunk_size_name(i)); - } + log.trace("updated freelist count " SSIZE_FORMAT " %s", chunk_manager()->free_chunks(i)->count(), chunk_size_name(i)); assert(i != HumongousIndex, "Humongous chunks are handled explicitly later"); } @@ -2254,12 +2199,9 @@ SpaceManager::~SpaceManager() { // the current chunk but there are probably exceptions. // Humongous chunks - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("returned " SIZE_FORMAT " %s humongous chunks to dictionary", - sum_count_in_chunks_in_use(HumongousIndex), - chunk_size_name(HumongousIndex)); - gclog_or_tty->print("Humongous chunk dictionary: "); - } + log.trace("returned " SIZE_FORMAT " %s humongous chunks to dictionary", + sum_count_in_chunks_in_use(HumongousIndex), chunk_size_name(HumongousIndex)); + log.trace("Humongous chunk dictionary: "); // Humongous chunks are never the current chunk. Metachunk* humongous_chunks = chunks_in_use(HumongousIndex); @@ -2267,11 +2209,7 @@ SpaceManager::~SpaceManager() { #ifdef ASSERT humongous_chunks->set_is_tagged_free(true); #endif - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print(PTR_FORMAT " (" SIZE_FORMAT ") ", - p2i(humongous_chunks), - humongous_chunks->word_size()); - } + log.trace(PTR_FORMAT " (" SIZE_FORMAT ") ", p2i(humongous_chunks), humongous_chunks->word_size()); assert(humongous_chunks->word_size() == (size_t) align_size_up(humongous_chunks->word_size(), smallest_chunk_size()), @@ -2283,12 +2221,7 @@ SpaceManager::~SpaceManager() { chunk_manager()->humongous_dictionary()->return_chunk(humongous_chunks); humongous_chunks = next_humongous_chunks; } - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("updated dictionary count " SIZE_FORMAT " %s", - chunk_manager()->humongous_dictionary()->total_count(), - chunk_size_name(HumongousIndex)); - } + log.trace("updated dictionary count " SIZE_FORMAT " %s", chunk_manager()->humongous_dictionary()->total_count(), chunk_size_name(HumongousIndex)); chunk_manager()->slow_locked_verify(); } @@ -2374,11 +2307,13 @@ void SpaceManager::add_chunk(Metachunk* new_chunk, bool make_current) { inc_size_metrics(new_chunk->word_size()); assert(new_chunk->is_empty(), "Not ready for reuse"); - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print("SpaceManager::add_chunk: " SIZE_FORMAT ") ", - sum_count_in_chunks_in_use()); - new_chunk->print_on(gclog_or_tty); - chunk_manager()->locked_print_free_chunks(gclog_or_tty); + LogHandle(gc, metaspace, freelist) log; + if (log.is_trace()) { + log.trace("SpaceManager::add_chunk: " SIZE_FORMAT ") ", sum_count_in_chunks_in_use()); + ResourceMark rm; + outputStream* out = log.trace_stream(); + new_chunk->print_on(out); + chunk_manager()->locked_print_free_chunks(out); } } @@ -2403,10 +2338,10 @@ Metachunk* SpaceManager::get_new_chunk(size_t word_size, medium_chunk_bunch()); } - if (TraceMetadataHumongousAllocation && next != NULL && + LogHandle(gc, metaspace, alloc) log; + if (log.is_debug() && next != NULL && SpaceManager::is_humongous(next->word_size())) { - gclog_or_tty->print_cr(" new humongous chunk word size " - PTR_FORMAT, next->word_size()); + log.debug(" new humongous chunk word size " PTR_FORMAT, next->word_size()); } return next; @@ -2571,7 +2506,7 @@ void SpaceManager::dump(outputStream* const out) const { } } - if (TraceMetadataChunkAllocation && Verbose) { + if (log_is_enabled(Trace, gc, metaspace, freelist)) { block_freelists()->print_on(out); } @@ -2756,27 +2691,10 @@ MetaspaceChunkFreeListSummary MetaspaceAux::chunk_free_list_summary(Metaspace::M } void MetaspaceAux::print_metaspace_change(size_t prev_metadata_used) { - gclog_or_tty->print(", [Metaspace:"); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(" " SIZE_FORMAT - "->" SIZE_FORMAT - "(" SIZE_FORMAT ")", - prev_metadata_used, - used_bytes(), - reserved_bytes()); - } else { - gclog_or_tty->print(" " SIZE_FORMAT "K" - "->" SIZE_FORMAT "K" - "(" SIZE_FORMAT "K)", - prev_metadata_used/K, - used_bytes()/K, - reserved_bytes()/K); - } - - gclog_or_tty->print("]"); + log_info(gc, metaspace)("Metaspace: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + prev_metadata_used/K, used_bytes()/K, reserved_bytes()/K); } -// This is printed when PrintGCDetails void MetaspaceAux::print_on(outputStream* out) { Metaspace::MetadataType nct = Metaspace::NonClassType; @@ -3133,8 +3051,10 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a initialize_class_space(metaspace_rs); - if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) { - print_compressed_class_space(gclog_or_tty, requested_addr); + if (develop_log_is_enabled(Trace, gc, metaspace)) { + LogHandle(gc, metaspace) log; + ResourceMark rm; + print_compressed_class_space(log.trace_stream(), requested_addr); } } @@ -3256,10 +3176,8 @@ void Metaspace::global_initialize() { assert(UseCompressedOops && UseCompressedClassPointers, "UseCompressedOops and UseCompressedClassPointers must be set"); Universe::set_narrow_klass_base((address)_space_list->current_virtual_space()->bottom()); - if (TraceMetavirtualspaceAllocation && Verbose) { - gclog_or_tty->print_cr("Setting_narrow_klass_base to Address: " PTR_FORMAT, - p2i(_space_list->current_virtual_space()->bottom())); - } + log_develop_trace(gc, metaspace)("Setting_narrow_klass_base to Address: " PTR_FORMAT, + p2i(_space_list->current_virtual_space()->bottom())); Universe::set_narrow_klass_shift(0); #endif // _LP64 @@ -3446,10 +3364,7 @@ MetaWord* Metaspace::expand_and_allocate(size_t word_size, MetadataType mdtype) if (incremented) { tracer()->report_gc_threshold(before, after, MetaspaceGCThresholdUpdater::ExpandAndAllocate); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("Increase capacity to GC from " SIZE_FORMAT - " to " SIZE_FORMAT, before, after); - } + log_trace(gc, metaspace)("Increase capacity to GC from " SIZE_FORMAT " to " SIZE_FORMAT, before, after); } return res; @@ -3612,13 +3527,15 @@ void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_s tracer()->report_metadata_oom(loader_data, word_size, type, mdtype); // If result is still null, we are out of memory. - if (Verbose && TraceMetadataChunkAllocation) { - gclog_or_tty->print_cr("Metaspace allocation failed for size " - SIZE_FORMAT, word_size); + LogHandle(gc, metaspace, freelist) log; + if (log.is_trace()) { + log.trace("Metaspace allocation failed for size " SIZE_FORMAT, word_size); + ResourceMark rm; + outputStream* out = log.trace_stream(); if (loader_data->metaspace_or_null() != NULL) { - loader_data->dump(gclog_or_tty); + loader_data->dump(out); } - MetaspaceAux::dump(gclog_or_tty); + MetaspaceAux::dump(out); } bool out_of_compressed_class_space = false; diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index 3985cd832a3..630afe63abf 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -36,8 +36,10 @@ #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/generation.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/space.hpp" #include "interpreter/interpreter.hpp" +#include "logging/log.hpp" #include "memory/filemap.hpp" #include "memory/metadataFactory.hpp" #include "memory/metaspaceShared.hpp" @@ -72,6 +74,7 @@ #include "utilities/events.hpp" #include "utilities/hashtable.inline.hpp" #include "utilities/macros.hpp" +#include "utilities/ostream.hpp" #include "utilities/preserveException.hpp" #if INCLUDE_ALL_GCS #include "gc/cms/cmsCollectorPolicy.hpp" @@ -489,7 +492,7 @@ void Universe::run_finalizers_on_exit() { has_run_finalizers_on_exit = true; // Called on VM exit. This ought to be run in a separate thread. - if (TraceReferenceGC) tty->print_cr("Callback to run finalizers on exit"); + log_trace(ref)("Callback to run finalizers on exit"); { PRESERVE_EXCEPTION_MARK; KlassHandle finalizer_klass(THREAD, SystemDictionary::Finalizer_klass()); @@ -713,6 +716,7 @@ jint Universe::initialize_heap() { if (status != JNI_OK) { return status; } + log_info(gc)("Using %s", _collectedHeap->name()); ThreadLocalAllocBuffer::set_max_size(Universe::heap()->max_tlab_size()); @@ -1059,18 +1063,9 @@ void Universe::compute_base_vtable_size() { _base_vtable_size = ClassLoader::compute_Object_vtable(); } - -void Universe::print() { - print_on(gclog_or_tty); -} - -void Universe::print_on(outputStream* st, bool extended) { +void Universe::print_on(outputStream* st) { st->print_cr("Heap"); - if (!extended) { - heap()->print_on(st); - } else { - heap()->print_extended_on(st); - } + heap()->print_on(st); } void Universe::print_heap_at_SIGBREAK() { @@ -1082,30 +1077,25 @@ void Universe::print_heap_at_SIGBREAK() { } } -void Universe::print_heap_before_gc(outputStream* st, bool ignore_extended) { - st->print_cr("{Heap before GC invocations=%u (full %u):", - heap()->total_collections(), - heap()->total_full_collections()); - if (!PrintHeapAtGCExtended || ignore_extended) { - heap()->print_on(st); - } else { - heap()->print_extended_on(st); +void Universe::print_heap_before_gc() { + LogHandle(gc, heap) log; + if (log.is_trace()) { + log.trace("Heap before GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections()); + ResourceMark rm; + heap()->print_on(log.trace_stream()); } } -void Universe::print_heap_after_gc(outputStream* st, bool ignore_extended) { - st->print_cr("Heap after GC invocations=%u (full %u):", - heap()->total_collections(), - heap()->total_full_collections()); - if (!PrintHeapAtGCExtended || ignore_extended) { - heap()->print_on(st); - } else { - heap()->print_extended_on(st); +void Universe::print_heap_after_gc() { + LogHandle(gc, heap) log; + if (log.is_trace()) { + log.trace("Heap after GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections()); + ResourceMark rm; + heap()->print_on(log.trace_stream()); } - st->print_cr("}"); } -void Universe::verify(VerifyOption option, const char* prefix, bool silent) { +void Universe::verify(VerifyOption option, const char* prefix) { // The use of _verify_in_progress is a temporary work around for // 6320749. Don't bother with a creating a class to set and clear // it since it is only used in this method and the control flow is @@ -1122,36 +1112,35 @@ void Universe::verify(VerifyOption option, const char* prefix, bool silent) { HandleMark hm; // Handles created during verification can be zapped _verify_count++; - if (!silent) gclog_or_tty->print("%s", prefix); - if (!silent) gclog_or_tty->print("[Verifying "); - if (!silent) gclog_or_tty->print("threads "); + FormatBuffer<> title("Verifying %s", prefix); + GCTraceTime(Info, gc, verify) tm(title.buffer()); + log_debug(gc, verify)("Threads"); Threads::verify(); - if (!silent) gclog_or_tty->print("heap "); - heap()->verify(silent, option); - if (!silent) gclog_or_tty->print("syms "); + log_debug(gc, verify)("Heap"); + heap()->verify(option); + log_debug(gc, verify)("SymbolTable"); SymbolTable::verify(); - if (!silent) gclog_or_tty->print("strs "); + log_debug(gc, verify)("StringTable"); StringTable::verify(); { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - if (!silent) gclog_or_tty->print("zone "); + log_debug(gc, verify)("CodeCache"); CodeCache::verify(); } - if (!silent) gclog_or_tty->print("dict "); + log_debug(gc, verify)("SystemDictionary"); SystemDictionary::verify(); #ifndef PRODUCT - if (!silent) gclog_or_tty->print("cldg "); + log_debug(gc, verify)("ClassLoaderDataGraph"); ClassLoaderDataGraph::verify(); #endif - if (!silent) gclog_or_tty->print("metaspace chunks "); + log_debug(gc, verify)("MetaspaceAux"); MetaspaceAux::verify_free_chunks(); - if (!silent) gclog_or_tty->print("hand "); + log_debug(gc, verify)("JNIHandles"); JNIHandles::verify(); - if (!silent) gclog_or_tty->print("C-heap "); + log_debug(gc, verify)("C-heap"); os::check_heap(); - if (!silent) gclog_or_tty->print("code cache "); + log_debug(gc, verify)("CodeCache Oops"); CodeCache::verify_oops(); - if (!silent) gclog_or_tty->print_cr("]"); _verify_in_progress = false; } diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp index f2dc42e6cfe..e55c3e121b2 100644 --- a/hotspot/src/share/vm/memory/universe.hpp +++ b/hotspot/src/share/vm/memory/universe.hpp @@ -460,26 +460,19 @@ class Universe: AllStatic { // Debugging static bool verify_in_progress() { return _verify_in_progress; } - static void verify(VerifyOption option, const char* prefix, bool silent = VerifySilently); - static void verify(const char* prefix, bool silent = VerifySilently) { - verify(VerifyOption_Default, prefix, silent); + static void verify(VerifyOption option, const char* prefix); + static void verify(const char* prefix) { + verify(VerifyOption_Default, prefix); } - static void verify(bool silent = VerifySilently) { - verify("", silent); + static void verify() { + verify(""); } static int verify_count() { return _verify_count; } - // The default behavior is to call print_on() on gclog_or_tty. - static void print(); - // The extended parameter determines which method on the heap will - // be called: print_on() (extended == false) or print_extended_on() - // (extended == true). - static void print_on(outputStream* st, bool extended = false); + static void print_on(outputStream* st); static void print_heap_at_SIGBREAK(); - static void print_heap_before_gc() { print_heap_before_gc(gclog_or_tty); } - static void print_heap_after_gc() { print_heap_after_gc(gclog_or_tty); } - static void print_heap_before_gc(outputStream* st, bool ignore_extended = false); - static void print_heap_after_gc(outputStream* st, bool ignore_extended = false); + static void print_heap_before_gc(); + static void print_heap_after_gc(); // Change the number of dummy objects kept reachable by the full gc dummy // array; this should trigger relocation in a sliding compaction collector. diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index 808b9327679..d54d593594b 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -2957,7 +2957,7 @@ class VerifyFieldClosure: public OopClosure { oop obj = oopDesc::load_decode_heap_oop(p); if (!obj->is_oop_or_null()) { tty->print_cr("Failed: " PTR_FORMAT " -> " PTR_FORMAT, p2i(p), p2i(obj)); - Universe::print(); + Universe::print_on(tty); guarantee(false, "boom"); } } diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp b/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp index 4581a23e8c7..580d99346b3 100644 --- a/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp +++ b/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp @@ -27,6 +27,7 @@ #include "classfile/javaClasses.hpp" #include "gc/shared/referenceProcessor.hpp" +#include "logging/log.hpp" #include "oops/instanceKlass.inline.hpp" #include "oops/instanceRefKlass.hpp" #include "oops/oop.inline.hpp" @@ -59,12 +60,7 @@ void InstanceRefKlass::oop_oop_iterate_ref_processing_specialized(oop obj, OopCl // Treat discovered as normal oop, if ref is not "active" (next non-NULL) if (!oopDesc::is_null(next_oop) && contains(disc_addr)) { // i.e. ref is not "active" - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Process discovered as normal " - PTR_FORMAT, p2i(disc_addr)); - } - ) + log_develop_trace(gc, ref)(" Process discovered as normal " PTR_FORMAT, p2i(disc_addr)); Devirtualizer::do_oop(closure, disc_addr); } // treat next as normal oop diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index 96785e24952..724d75b8495 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -3917,7 +3917,6 @@ void execute_internal_vm_tests() { run_unit_test(QuickSort::test_quick_sort()); run_unit_test(GuardedMemory::test_guarded_memory()); run_unit_test(AltHashing::test_alt_hash()); - run_unit_test(test_loggc_filename()); run_unit_test(TestNewSize_test()); run_unit_test(TestOldSize_test()); run_unit_test(TestKlass_test()); diff --git a/hotspot/src/share/vm/prims/jvmtiEnv.cpp b/hotspot/src/share/vm/prims/jvmtiEnv.cpp index 741f2329626..ab6d8258358 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp @@ -29,6 +29,7 @@ #include "interpreter/bytecodeStream.hpp" #include "interpreter/interpreter.hpp" #include "jvmtifiles/jvmtiEnv.hpp" +#include "logging/logConfiguration.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.inline.hpp" #include "oops/instanceKlass.hpp" @@ -628,7 +629,22 @@ JvmtiEnv::SetVerboseFlag(jvmtiVerboseFlag flag, jboolean value) { TraceClassUnloading = value != 0; break; case JVMTI_VERBOSE_GC: - PrintGC = value != 0; + { + // This is a temporary solution to work around initialization issues. + // JDK-8145083 will fix this. + Mutex* conf_mutex = LogConfiguration_lock; + if (Threads::number_of_threads() == 0) { + // We're too early in the initialization to use mutexes + LogConfiguration_lock = NULL; + } + MutexLockerEx ml(LogConfiguration_lock); + if (value == 0) { + LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL); + } else { + LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); + } + LogConfiguration_lock = conf_mutex; + } break; case JVMTI_VERBOSE_JNI: PrintJNIResolving = value != 0; diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 6c68a00d29c..59944c9ea76 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -159,7 +159,7 @@ WB_END WB_ENTRY(void, WB_PrintHeapSizes(JNIEnv* env, jobject o)) { CollectorPolicy * p = Universe::heap()->collector_policy(); - gclog_or_tty->print_cr("Minimum heap " SIZE_FORMAT " Initial heap " + tty->print_cr("Minimum heap " SIZE_FORMAT " Initial heap " SIZE_FORMAT " Maximum heap " SIZE_FORMAT " Space alignment " SIZE_FORMAT " Heap alignment " SIZE_FORMAT, p->min_heap_byte_size(), p->initial_heap_byte_size(), p->max_heap_byte_size(), p->space_alignment(), p->heap_alignment()); diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 017f4693dd7..a33b676ce7c 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -32,6 +32,7 @@ #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/taskqueue.hpp" +#include "logging/log.hpp" #include "logging/logConfiguration.hpp" #include "memory/allocation.inline.hpp" #include "memory/universe.inline.hpp" @@ -81,7 +82,6 @@ char** Arguments::_jvm_args_array = NULL; int Arguments::_num_jvm_args = 0; char* Arguments::_java_command = NULL; SystemProperty* Arguments::_system_properties = NULL; -const char* Arguments::_gc_log_filename = NULL; bool Arguments::_has_profile = false; size_t Arguments::_conservative_max_heap_alignment = 0; size_t Arguments::_min_heap_size = 0; @@ -1602,19 +1602,11 @@ void Arguments::set_cms_and_parnew_gc_flags() { } else { FLAG_SET_ERGO(size_t, MaxNewSize, preferred_max_new_size); } - if (PrintGCDetails && Verbose) { - // Too early to use gclog_or_tty - tty->print_cr("CMS ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize); - } + log_trace(gc, heap)("CMS ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize); // Code along this path potentially sets NewSize and OldSize - if (PrintGCDetails && Verbose) { - // Too early to use gclog_or_tty - tty->print_cr("CMS set min_heap_size: " SIZE_FORMAT - " initial_heap_size: " SIZE_FORMAT - " max_heap: " SIZE_FORMAT, - min_heap_size(), InitialHeapSize, max_heap); - } + log_trace(gc, heap)("CMS set min_heap_size: " SIZE_FORMAT " initial_heap_size: " SIZE_FORMAT " max_heap: " SIZE_FORMAT, + min_heap_size(), InitialHeapSize, max_heap); size_t min_new = preferred_max_new_size; if (FLAG_IS_CMDLINE(NewSize)) { min_new = NewSize; @@ -1625,20 +1617,14 @@ void Arguments::set_cms_and_parnew_gc_flags() { if (FLAG_IS_DEFAULT(NewSize)) { FLAG_SET_ERGO(size_t, NewSize, MAX2(NewSize, min_new)); FLAG_SET_ERGO(size_t, NewSize, MIN2(preferred_max_new_size, NewSize)); - if (PrintGCDetails && Verbose) { - // Too early to use gclog_or_tty - tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize); - } + log_trace(gc, heap)("CMS ergo set NewSize: " SIZE_FORMAT, NewSize); } // Unless explicitly requested otherwise, size old gen // so it's NewRatio x of NewSize. if (FLAG_IS_DEFAULT(OldSize)) { if (max_heap > NewSize) { FLAG_SET_ERGO(size_t, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize)); - if (PrintGCDetails && Verbose) { - // Too early to use gclog_or_tty - tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize); - } + log_trace(gc, heap)("CMS ergo set OldSize: " SIZE_FORMAT, OldSize); } } } @@ -1682,11 +1668,8 @@ void Arguments::set_cms_and_parnew_gc_flags() { FLAG_SET_CMDLINE(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false); } - if (PrintGCDetails && Verbose) { - tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", - (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); - tty->print_cr("ConcGCThreads: %u", ConcGCThreads); - } + log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); + log_trace(gc)("ConcGCThreads: %u", ConcGCThreads); } #endif // INCLUDE_ALL_GCS @@ -1733,11 +1716,7 @@ bool Arguments::should_auto_select_low_pause_collector() { if (UseAutoGCSelectPolicy && !FLAG_IS_DEFAULT(MaxGCPauseMillis) && (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) { - if (PrintGCDetails) { - // Cannot use gclog_or_tty yet. - tty->print_cr("Automatic selection of the low pause collector" - " based on pause goal of %d (ms)", (int) MaxGCPauseMillis); - } + log_trace(gc)("Automatic selection of the low pause collector based on pause goal of %d (ms)", (int) MaxGCPauseMillis); return true; } return false; @@ -1956,11 +1935,8 @@ void Arguments::set_g1_gc_flags() { FLAG_SET_DEFAULT(GCTimeRatio, 12); } - if (PrintGCDetails && Verbose) { - tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", - (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); - tty->print_cr("ConcGCThreads: %u", ConcGCThreads); - } + log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); + log_trace(gc)("ConcGCThreads: %u", ConcGCThreads); } #if !INCLUDE_ALL_GCS @@ -2072,10 +2048,7 @@ void Arguments::set_heap_size() { reasonable_max = MAX2(reasonable_max, (julong)InitialHeapSize); } - if (PrintGCDetails && Verbose) { - // Cannot use gclog_or_tty yet. - tty->print_cr(" Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max); - } + log_trace(gc, heap)(" Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max); FLAG_SET_ERGO(size_t, MaxHeapSize, (size_t)reasonable_max); } @@ -2096,20 +2069,14 @@ void Arguments::set_heap_size() { reasonable_initial = limit_by_allocatable_memory(reasonable_initial); - if (PrintGCDetails && Verbose) { - // Cannot use gclog_or_tty yet. - tty->print_cr(" Initial heap size " SIZE_FORMAT, (size_t)reasonable_initial); - } + log_trace(gc, heap)(" Initial heap size " SIZE_FORMAT, (size_t)reasonable_initial); FLAG_SET_ERGO(size_t, InitialHeapSize, (size_t)reasonable_initial); } // If the minimum heap size has not been set (via -Xms), // synchronize with InitialHeapSize to avoid errors with the default value. if (min_heap_size() == 0) { set_min_heap_size(MIN2((size_t)reasonable_minimum, InitialHeapSize)); - if (PrintGCDetails && Verbose) { - // Cannot use gclog_or_tty yet. - tty->print_cr(" Minimum heap size " SIZE_FORMAT, min_heap_size()); - } + log_trace(gc, heap)(" Minimum heap size " SIZE_FORMAT, min_heap_size()); } } } @@ -2312,77 +2279,8 @@ bool Arguments::sun_java_launcher_is_altjvm() { //=========================================================================================================== // Parsing of main arguments -// check if do gclog rotation -// +UseGCLogFileRotation is a must, -// no gc log rotation when log file not supplied or -// NumberOfGCLogFiles is 0 -void check_gclog_consistency() { - if (UseGCLogFileRotation) { - if ((Arguments::gc_log_filename() == NULL) || (NumberOfGCLogFiles == 0)) { - jio_fprintf(defaultStream::output_stream(), - "To enable GC log rotation, use -Xloggc: -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=\n" - "where num_of_file > 0\n" - "GC log rotation is turned off\n"); - UseGCLogFileRotation = false; - } - } - - if (UseGCLogFileRotation && (GCLogFileSize != 0) && (GCLogFileSize < 8*K)) { - if (FLAG_SET_CMDLINE(size_t, GCLogFileSize, 8*K) == Flag::SUCCESS) { - jio_fprintf(defaultStream::output_stream(), - "GCLogFileSize changed to minimum 8K\n"); - } - } -} - -// This function is called for -Xloggc:, it can be used -// to check if a given file name(or string) conforms to the following -// specification: -// A valid string only contains "[A-Z][a-z][0-9].-_%[p|t]" -// %p and %t only allowed once. We only limit usage of filename not path -bool is_filename_valid(const char *file_name) { - const char* p = file_name; - char file_sep = os::file_separator()[0]; - const char* cp; - // skip prefix path - for (cp = file_name; *cp != '\0'; cp++) { - if (*cp == '/' || *cp == file_sep) { - p = cp + 1; - } - } - - int count_p = 0; - int count_t = 0; - while (*p != '\0') { - if ((*p >= '0' && *p <= '9') || - (*p >= 'A' && *p <= 'Z') || - (*p >= 'a' && *p <= 'z') || - *p == '-' || - *p == '_' || - *p == '.') { - p++; - continue; - } - if (*p == '%') { - if(*(p + 1) == 'p') { - p += 2; - count_p ++; - continue; - } - if (*(p + 1) == 't') { - p += 2; - count_t ++; - continue; - } - } - return false; - } - return count_p < 2 && count_t < 2; -} - // Check consistency of GC selection bool Arguments::check_gc_consistency() { - check_gclog_consistency(); // Ensure that the user has not selected conflicting sets // of collectors. uint i = 0; @@ -2725,7 +2623,9 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, return JNI_EINVAL; } } else if (!strcmp(tail, ":gc")) { - if (FLAG_SET_CMDLINE(bool, PrintGC, true) != Flag::SUCCESS) { + // LogConfiguration_lock is not set up yet, but this code is executed by a single thread + bool ret = LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); + if (!ret) { return JNI_EINVAL; } } else if (!strcmp(tail, ":jni")) { @@ -3158,24 +3058,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, // -Xnoagent } else if (match_option(option, "-Xnoagent")) { // For compatibility with classic. HotSpot refuses to load the old style agent.dll. - } else if (match_option(option, "-Xloggc:", &tail)) { - // Redirect GC output to the file. -Xloggc: - // ostream_init_log(), when called will use this filename - // to initialize a fileStream. - _gc_log_filename = os::strdup_check_oom(tail); - if (!is_filename_valid(_gc_log_filename)) { - jio_fprintf(defaultStream::output_stream(), - "Invalid file name for use with -Xloggc: Filename can only contain the " - "characters [A-Z][a-z][0-9]-_.%%[p|t] but it has been %s\n" - "Note %%p or %%t can only be used once\n", _gc_log_filename); - return JNI_EINVAL; - } - if (FLAG_SET_CMDLINE(bool, PrintGC, true) != Flag::SUCCESS) { - return JNI_EINVAL; - } - if (FLAG_SET_CMDLINE(bool, PrintGCTimeStamps, true) != Flag::SUCCESS) { - return JNI_EINVAL; - } } else if (match_option(option, "-Xlog", &tail)) { bool ret = false; if (strcmp(tail, ":help") == 0) { @@ -4180,11 +4062,6 @@ jint Arguments::parse(const JavaVMInitArgs* args) { ScavengeRootsInCode = 1; } - if (PrintGCDetails) { - // Turn on -verbose:gc options as well - PrintGC = true; - } - // Set object alignment values. set_object_alignment(); diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index 2322f05bb64..fc07f0f9c0e 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -284,7 +284,6 @@ class Arguments : AllStatic { // Option flags static bool _has_profile; - static const char* _gc_log_filename; // Value of the conservative maximum heap alignment needed static size_t _conservative_max_heap_alignment; @@ -543,9 +542,6 @@ class Arguments : AllStatic { // -Dsun.java.launcher.pid static int sun_java_launcher_pid() { return _sun_java_launcher_pid; } - // -Xloggc:, if not specified will be NULL - static const char* gc_log_filename() { return _gc_log_filename; } - // -Xprof static bool has_profile() { return _has_profile; } diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index f7ced655614..c0764db8f92 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -985,9 +985,6 @@ public: develop(bool, ZapUnusedHeapArea, trueInDebug, \ "Zap unused heap space with 0xBAADBABE") \ \ - develop(bool, TraceZapUnusedHeapArea, false, \ - "Trace zapping of unused heap space") \ - \ develop(bool, CheckZapUnusedHeapArea, false, \ "Check zapping of unused heap space") \ \ @@ -997,12 +994,6 @@ public: develop(bool, PrintVMMessages, true, \ "Print VM messages on console") \ \ - product(bool, PrintGCApplicationConcurrentTime, false, \ - "Print the time the application has been running") \ - \ - product(bool, PrintGCApplicationStoppedTime, false, \ - "Print the time the application has been stopped") \ - \ diagnostic(bool, VerboseVerification, false, \ "Display detailed verification details") \ \ @@ -1576,9 +1567,6 @@ public: "number of GC threads") \ range((size_t)os::vm_page_size(), (size_t)max_uintx) \ \ - product(bool, TraceDynamicGCThreads, false, \ - "Trace the dynamic GC thread usage") \ - \ product(uint, ConcGCThreads, 0, \ "Number of threads concurrent gc will use") \ constraint(ConcGCThreadsConstraintFunc,AfterErgo) \ @@ -1629,12 +1617,6 @@ public: product(bool, UseParNewGC, false, \ "Use parallel threads in the new generation") \ \ - product(bool, PrintTaskqueue, false, \ - "Print taskqueue statistics for parallel collectors") \ - \ - product(bool, PrintTerminationStats, false, \ - "Print termination statistics for parallel collectors") \ - \ product(uintx, ParallelGCBufferWastePct, 10, \ "Wasted fraction of parallel allocation buffer") \ range(0, 100) \ @@ -1652,9 +1634,6 @@ public: product(bool, ResizePLAB, true, \ "Dynamically resize (survivor space) promotion LAB's") \ \ - product(bool, PrintPLAB, false, \ - "Print (survivor space) promotion LAB's sizing decisions") \ - \ product(intx, ParGCArrayScanChunk, 50, \ "Scan a subset of object array and push remainder, if array is " \ "bigger than this") \ @@ -1698,9 +1677,6 @@ public: product(bool, ResizeOldPLAB, true, \ "Dynamically resize (old gen) promotion LAB's") \ \ - product(bool, PrintOldPLAB, false, \ - "Print (old gen) promotion LAB's sizing decisions") \ - \ product(size_t, CMSOldPLABMax, 1024, \ "Maximum size of CMS gen promotion LAB caches per worker " \ "per block size") \ @@ -1899,10 +1875,6 @@ public: "Always record eden chunks used for the parallel initial mark " \ "or remark of eden") \ \ - product(bool, CMSPrintEdenSurvivorChunks, false, \ - "Print the eden and the survivor chunks used for the parallel " \ - "initial mark or remark of the eden/survivor spaces") \ - \ product(bool, CMSConcurrentMTEnabled, true, \ "Whether multi-threaded concurrent work enabled " \ "(effective only if ParNewGC)") \ @@ -1971,9 +1943,6 @@ public: product(bool, CMSScavengeBeforeRemark, false, \ "Attempt scavenge before the CMS remark step") \ \ - develop(bool, CMSTraceSweeper, false, \ - "Trace some actions of the CMS sweeper") \ - \ product(uintx, CMSWorkQueueDrainThreshold, 10, \ "Don't drain below this size per parallel worker/thief") \ range(1, max_juint) \ @@ -1995,17 +1964,15 @@ public: "between yields") \ range(1, max_uintx) \ \ - product(bool, CMSDumpAtPromotionFailure, false, \ - "Dump useful information about the state of the CMS old " \ - "generation upon a promotion failure") \ - \ product(bool, CMSPrintChunksInDump, false, \ - "In a dump enabled by CMSDumpAtPromotionFailure, include " \ - "more detailed information about the free chunks") \ + "If logging for the \"gc\" and \"promotion\" tags is enabled on" \ + "trace level include more detailed information about the" \ + "free chunks") \ \ product(bool, CMSPrintObjectsInDump, false, \ - "In a dump enabled by CMSDumpAtPromotionFailure, include " \ - "more detailed information about the allocated objects") \ + "If logging for the \"gc\" and \"promotion\" tags is enabled on" \ + "trace level include more detailed information about the" \ + "allocated objects") \ \ diagnostic(bool, FLSVerifyAllHeapReferences, false, \ "Verify that all references across the FLS boundary " \ @@ -2027,9 +1994,6 @@ public: "Maintain _unallocated_block in BlockOffsetArray " \ "(currently applicable only to CMS collector)") \ \ - develop(bool, TraceCMSState, false, \ - "Trace the state of the CMS collection") \ - \ product(intx, RefDiscoveryPolicy, 0, \ "Select type of reference discovery policy: " \ "reference-based(0) or referent-based(1)") \ @@ -2097,10 +2061,6 @@ public: notproduct(bool, GCALotAtAllSafepoints, false, \ "Enforce ScavengeALot/GCALot at all potential safepoints") \ \ - product(bool, PrintPromotionFailure, false, \ - "Print additional diagnostic information following " \ - "promotion failure") \ - \ notproduct(bool, PromotionFailureALot, false, \ "Use promotion failure handling on every youngest generation " \ "collection") \ @@ -2140,12 +2100,6 @@ public: develop(bool, TraceMetadataChunkAllocation, false, \ "Trace chunk metadata allocations") \ \ - product(bool, TraceMetadataHumongousAllocation, false, \ - "Trace humongous metadata allocations") \ - \ - develop(bool, TraceMetavirtualspaceAllocation, false, \ - "Trace virtual space metadata allocations") \ - \ notproduct(bool, ExecuteInternalVMTests, false, \ "Enable execution of internal VM tests") \ \ @@ -2163,12 +2117,8 @@ public: product(bool, FastTLABRefill, true, \ "Use fast TLAB refill code") \ \ - product(bool, PrintTLAB, false, \ - "Print various TLAB related information") \ - \ product(bool, TLABStats, true, \ - "Provide more detailed and expensive TLAB statistics " \ - "(with PrintTLAB)") \ + "Provide more detailed and expensive TLAB statistics.") \ \ product_pd(bool, NeverActAsServerClassMachine, \ "Never act like a server-class machine") \ @@ -2228,9 +2178,6 @@ public: product(bool, UseAdaptiveGCBoundary, false, \ "Allow young-old boundary to move") \ \ - develop(bool, TraceAdaptiveGCBoundary, false, \ - "Trace young-old boundary moves") \ - \ develop(intx, PSAdaptiveSizePolicyResizeVirtualSpaceAlot, -1, \ "Resize the virtual spaces of the young or old generations") \ range(-1, 1) \ @@ -2366,9 +2313,6 @@ public: "Number of consecutive collections before gc time limit fires") \ range(1, max_uintx) \ \ - product(bool, PrintAdaptiveSizePolicy, false, \ - "Print information about AdaptiveSizePolicy") \ - \ product(intx, PrefetchCopyIntervalInBytes, -1, \ "How far ahead to prefetch destination area (<= 0 means off)") \ range(-1, max_jint) \ @@ -2381,9 +2325,6 @@ public: "How many fields ahead to prefetch in oop scan (<= 0 means off)") \ range(-1, max_jint) \ \ - diagnostic(bool, VerifySilently, false, \ - "Do not print the verification progress") \ - \ diagnostic(bool, VerifyDuringStartup, false, \ "Verify memory system before executing any Java code " \ "during VM initialization") \ @@ -2449,37 +2390,11 @@ public: "will sleep while yielding before giving up and resuming GC") \ range(0, max_juint) \ \ - /* gc tracing */ \ - manageable(bool, PrintGC, false, \ - "Print message at garbage collection") \ - \ - manageable(bool, PrintGCDetails, false, \ - "Print more details at garbage collection") \ - \ - manageable(bool, PrintGCDateStamps, false, \ - "Print date stamps at garbage collection") \ - \ - manageable(bool, PrintGCTimeStamps, false, \ - "Print timestamps at garbage collection") \ - \ - manageable(bool, PrintGCID, true, \ - "Print an identifier for each garbage collection") \ - \ - product(bool, PrintGCTaskTimeStamps, false, \ - "Print timestamps for individual gc worker thread tasks") \ - \ develop(intx, ConcGCYieldTimeout, 0, \ "If non-zero, assert that GC threads yield within this " \ "number of milliseconds") \ range(0, max_intx) \ \ - product(bool, PrintReferenceGC, false, \ - "Print times spent handling reference objects during GC " \ - "(enabled only when PrintGCDetails)") \ - \ - develop(bool, TraceReferenceGC, false, \ - "Trace handling of soft/weak/final/phantom references") \ - \ develop(bool, TraceFinalizerRegistration, false, \ "Trace registration of final references") \ \ @@ -2519,37 +2434,15 @@ public: product(bool, TraceOldGenTime, false, \ "Trace accumulated time for old collection") \ \ - product(bool, PrintTenuringDistribution, false, \ - "Print tenuring age information") \ - \ - product_rw(bool, PrintHeapAtGC, false, \ - "Print heap layout before and after each GC") \ - \ - product_rw(bool, PrintHeapAtGCExtended, false, \ - "Print extended information about the layout of the heap " \ - "when -XX:+PrintHeapAtGC is set") \ - \ product(bool, PrintHeapAtSIGBREAK, true, \ "Print heap layout in response to SIGBREAK") \ \ - manageable(bool, PrintClassHistogramBeforeFullGC, false, \ - "Print a class histogram before any major stop-world GC") \ - \ - manageable(bool, PrintClassHistogramAfterFullGC, false, \ - "Print a class histogram after any major stop-world GC") \ - \ manageable(bool, PrintClassHistogram, false, \ "Print a histogram of class instances") \ \ develop(bool, TraceWorkGang, false, \ "Trace activities of work gangs") \ \ - develop(bool, TraceBlockOffsetTable, false, \ - "Print BlockOffsetTable maps") \ - \ - develop(bool, TraceCardTableModRefBS, false, \ - "Print CardTableModRefBS maps") \ - \ develop(bool, TraceGCTaskManager, false, \ "Trace actions of the GC task manager") \ \ @@ -2559,50 +2452,20 @@ public: diagnostic(bool, TraceGCTaskThread, false, \ "Trace actions of the GC task threads") \ \ - product(bool, PrintParallelOldGCPhaseTimes, false, \ - "Print the time taken by each phase in ParallelOldGC " \ - "(PrintGCDetails must also be enabled)") \ - \ develop(bool, TraceParallelOldGCMarkingPhase, false, \ "Trace marking phase in ParallelOldGC") \ \ - develop(bool, TraceParallelOldGCSummaryPhase, false, \ - "Trace summary phase in ParallelOldGC") \ - \ - develop(bool, TraceParallelOldGCCompactionPhase, false, \ - "Trace compaction phase in ParallelOldGC") \ - \ develop(bool, TraceParallelOldGCDensePrefix, false, \ "Trace dense prefix computation for ParallelOldGC") \ \ develop(bool, IgnoreLibthreadGPFault, false, \ "Suppress workaround for libthread GP fault") \ \ - product(bool, PrintJNIGCStalls, false, \ - "Print diagnostic message when GC is stalled " \ - "by JNI critical section") \ - \ experimental(double, ObjectCountCutOffPercent, 0.5, \ "The percentage of the used heap that the instances of a class " \ "must occupy for the class to generate a trace event") \ range(0.0, 100.0) \ \ - /* GC log rotation setting */ \ - \ - product(bool, UseGCLogFileRotation, false, \ - "Rotate gclog files (for long running applications). It requires "\ - "-Xloggc:") \ - \ - product(uintx, NumberOfGCLogFiles, 0, \ - "Number of gclog files in rotation " \ - "(default: 0, no rotation)") \ - range(0, max_uintx) \ - \ - product(size_t, GCLogFileSize, 8*K, \ - "GC log file size, requires UseGCLogFileRotation. " \ - "Set to 0 to only trigger rotation via jcmd") \ - range(0, max_uintx) \ - \ /* JVMTI heap profiling */ \ \ diagnostic(bool, TraceJVMTIObjectTagging, false, \ @@ -3539,21 +3402,6 @@ public: "space parameters)") \ range(1, max_uintx) \ \ - product(intx, PrintCMSStatistics, 0, \ - "Statistics for CMS") \ - range(0, 2) \ - \ - product(bool, PrintCMSInitiationStatistics, false, \ - "Statistics for initiating a CMS collection") \ - \ - product(intx, PrintFLSStatistics, 0, \ - "Statistics for CMS' FreeListSpace") \ - range(0, 2) \ - \ - product(intx, PrintFLSCensus, 0, \ - "Census for CMS' FreeListSpace") \ - range(0, 1) \ - \ develop(uintx, GCExpandToAllocateDelayMillis, 0, \ "Delay between expansion and allocation (in milliseconds)") \ \ @@ -4248,9 +4096,6 @@ public: product(bool, UseStringDeduplication, false, \ "Use string deduplication") \ \ - product(bool, PrintStringDeduplicationStatistics, false, \ - "Print string deduplication statistics") \ - \ product(uintx, StringDeduplicationAgeThreshold, 3, \ "A string must reach this age (or be promoted to an old region) " \ "to be considered for deduplication") \ @@ -4265,9 +4110,6 @@ public: diagnostic(bool, WhiteBoxAPI, false, \ "Enable internal testing APIs") \ \ - product(bool, PrintGCCause, true, \ - "Include GC cause in GC logging") \ - \ experimental(intx, SurvivorAlignmentInBytes, 0, \ "Default survivor space alignment in bytes") \ constraint(SurvivorAlignmentInBytesConstraintFunc,AfterErgo) \ diff --git a/hotspot/src/share/vm/runtime/interfaceSupport.cpp b/hotspot/src/share/vm/runtime/interfaceSupport.cpp index e8dcb72d2fb..cd0d20a65e2 100644 --- a/hotspot/src/share/vm/runtime/interfaceSupport.cpp +++ b/hotspot/src/share/vm/runtime/interfaceSupport.cpp @@ -101,15 +101,13 @@ void InterfaceSupport::gc_alot() { // Compute new interval if (FullGCALotInterval > 1) { _fullgc_alot_counter = 1+(long)((double)FullGCALotInterval*os::random()/(max_jint+1.0)); - if (PrintGCDetails && Verbose) { - tty->print_cr("Full gc no: %u\tInterval: %ld", invocations, _fullgc_alot_counter); - } + log_trace(gc)("Full gc no: %u\tInterval: %ld", invocations, _fullgc_alot_counter); } else { _fullgc_alot_counter = 1; } // Print progress message if (invocations % 100 == 0) { - if (PrintGCDetails && Verbose) tty->print_cr("Full gc no: %u", invocations); + log_trace(gc)("Full gc no: %u", invocations); } } else { if (ScavengeALot) _scavenge_alot_counter--; @@ -121,15 +119,13 @@ void InterfaceSupport::gc_alot() { // Compute new interval if (ScavengeALotInterval > 1) { _scavenge_alot_counter = 1+(long)((double)ScavengeALotInterval*os::random()/(max_jint+1.0)); - if (PrintGCDetails && Verbose) { - tty->print_cr("Scavenge no: %u\tInterval: %ld", invocations, _scavenge_alot_counter); - } + log_trace(gc)("Scavenge no: %u\tInterval: %ld", invocations, _scavenge_alot_counter); } else { _scavenge_alot_counter = 1; } // Print progress message if (invocations % 1000 == 0) { - if (PrintGCDetails && Verbose) tty->print_cr("Scavenge no: %u", invocations); + log_trace(gc)("Scavenge no: %u", invocations); } } } diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index 4ce260ae193..b65c2c2e1aa 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -35,6 +35,7 @@ #include "jvmci/jvmciCompiler.hpp" #include "jvmci/jvmciRuntime.hpp" #endif +#include "logging/log.hpp" #include "memory/oopFactory.hpp" #include "memory/universe.hpp" #include "oops/constantPool.hpp" @@ -453,13 +454,15 @@ void before_exit(JavaThread * thread) { Universe::heap()->stop(); // Print GC/heap related information. - if (PrintGCDetails) { - Universe::print(); - AdaptiveSizePolicyOutput(0); - if (Verbose) { - ClassLoaderDataGraph::dump_on(gclog_or_tty); + LogHandle(gc, heap, exit) log; + if (log.is_info()) { + ResourceMark rm; + Universe::print_on(log.info_stream()); + if (log.is_trace()) { + ClassLoaderDataGraph::dump_on(log.trace_stream()); } } + AdaptiveSizePolicyOutput::print(); if (PrintBytecodeHistogram) { BytecodeHistogram::print(); diff --git a/hotspot/src/share/vm/runtime/jniHandles.cpp b/hotspot/src/share/vm/runtime/jniHandles.cpp index a19283eb432..3c4baed8e0e 100644 --- a/hotspot/src/share/vm/runtime/jniHandles.cpp +++ b/hotspot/src/share/vm/runtime/jniHandles.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" #include "runtime/jniHandles.hpp" @@ -393,9 +394,7 @@ void JNIHandleBlock::weak_oops_do(BoolObjectClosure* is_alive, f->do_oop(root); } else { // The weakly referenced object is not alive, clear the reference by storing NULL - if (TraceReferenceGC) { - tty->print_cr("Clearing JNI weak reference (" INTPTR_FORMAT ")", p2i(root)); - } + log_develop_trace(gc, ref)("Clearing JNI weak reference (" INTPTR_FORMAT ")", p2i(root)); *root = NULL; } } diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 5c0ebf54c79..4be64a724d2 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -262,7 +262,7 @@ static void signal_thread_entry(JavaThread* thread, TRAPS) { VMThread::execute(&op1); Universe::print_heap_at_SIGBREAK(); if (PrintClassHistogram) { - VM_GC_HeapInspection op1(gclog_or_tty, true /* force full GC before heap inspection */); + VM_GC_HeapInspection op1(tty, true /* force full GC before heap inspection */); VMThread::execute(&op1); } if (JvmtiExport::should_post_data_dump()) { diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp index e6e2c6f30c0..09f6ea8d1a4 100644 --- a/hotspot/src/share/vm/runtime/safepoint.cpp +++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -515,11 +515,6 @@ void SafepointSynchronize::do_cleanup_tasks() { StringTable::rehash_table(); } - // rotate log files? - if (UseGCLogFileRotation) { - gclog_or_tty->rotate_log(false); - } - { // CMS delays purging the CLDG until the beginning of the next safepoint and to // make sure concurrent sweep is done diff --git a/hotspot/src/share/vm/runtime/timer.cpp b/hotspot/src/share/vm/runtime/timer.cpp index 0a869a43b8a..ec4ec0fa662 100644 --- a/hotspot/src/share/vm/runtime/timer.cpp +++ b/hotspot/src/share/vm/runtime/timer.cpp @@ -120,7 +120,6 @@ TraceTime::TraceTime(const char* title, if (_active) { _accum = NULL; - tty->stamp(PrintGCTimeStamps); tty->print("[%s", title); tty->flush(); _t.start(); @@ -135,7 +134,6 @@ TraceTime::TraceTime(const char* title, _verbose = verbose; if (_active) { if (_verbose) { - tty->stamp(PrintGCTimeStamps); tty->print("[%s", title); tty->flush(); } diff --git a/hotspot/src/share/vm/runtime/vmThread.cpp b/hotspot/src/share/vm/runtime/vmThread.cpp index e91faff6b28..77935603075 100644 --- a/hotspot/src/share/vm/runtime/vmThread.cpp +++ b/hotspot/src/share/vm/runtime/vmThread.cpp @@ -285,7 +285,7 @@ void VMThread::run() { os::check_heap(); // Silent verification so as not to pollute normal output, // unless we really asked for it. - Universe::verify(!(PrintGCDetails || Verbose) || VerifySilently); + Universe::verify(); } CompileBroker::set_should_block(); diff --git a/hotspot/src/share/vm/runtime/vm_operations.cpp b/hotspot/src/share/vm/runtime/vm_operations.cpp index edc3876a78f..7e5d06c0162 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.cpp +++ b/hotspot/src/share/vm/runtime/vm_operations.cpp @@ -189,7 +189,7 @@ void VM_UnlinkSymbols::doit() { void VM_Verify::doit() { Universe::heap()->prepare_for_verify(); - Universe::verify(_silent); + Universe::verify(); } bool VM_PrintThreads::doit_prologue() { diff --git a/hotspot/src/share/vm/runtime/vm_operations.hpp b/hotspot/src/share/vm/runtime/vm_operations.hpp index ac53ea63913..14f837ec1a1 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.hpp +++ b/hotspot/src/share/vm/runtime/vm_operations.hpp @@ -311,10 +311,7 @@ class VM_UnlinkSymbols: public VM_Operation { }; class VM_Verify: public VM_Operation { - private: - bool _silent; public: - VM_Verify(bool silent = VerifySilently) : _silent(silent) {} VMOp_Type type() const { return VMOp_Verify; } void doit(); }; @@ -418,17 +415,6 @@ class VM_Exit: public VM_Operation { void doit(); }; - -class VM_RotateGCLog: public VM_Operation { - private: - outputStream* _out; - - public: - VM_RotateGCLog(outputStream* st) : _out(st) {} - VMOp_Type type() const { return VMOp_RotateGCLog; } - void doit() { gclog_or_tty->rotate_log(true, _out); } -}; - class VM_PrintCompileQueue: public VM_Operation { private: outputStream* _out; diff --git a/hotspot/src/share/vm/services/diagnosticCommand.cpp b/hotspot/src/share/vm/services/diagnosticCommand.cpp index 89b616931b5..bf531a4d100 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.cpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp @@ -73,7 +73,6 @@ void DCmdRegistrant::register_dcmds(){ DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); #endif // INCLUDE_JVMTI DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); - DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); @@ -826,15 +825,6 @@ void VMDynamicLibrariesDCmd::execute(DCmdSource source, TRAPS) { output()->cr(); } -void RotateGCLogDCmd::execute(DCmdSource source, TRAPS) { - if (UseGCLogFileRotation) { - VM_RotateGCLog rotateop(output()); - VMThread::execute(&rotateop); - } else { - output()->print_cr("Target VM does not support GC log file rotation."); - } -} - void CompileQueueDCmd::execute(DCmdSource source, TRAPS) { VM_PrintCompileQueue printCompileQueueOp(output()); VMThread::execute(&printCompileQueueOp); diff --git a/hotspot/src/share/vm/services/diagnosticCommand.hpp b/hotspot/src/share/vm/services/diagnosticCommand.hpp index 3b0505a7347..d7e86f2dbd0 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.hpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp @@ -549,23 +549,6 @@ public: }; -class RotateGCLogDCmd : public DCmd { -public: - RotateGCLogDCmd(outputStream* output, bool heap) : DCmd(output, heap) {} - static const char* name() { return "GC.rotate_log"; } - static const char* description() { - return "Force the GC log file to be rotated."; - } - static const char* impact() { return "Low"; } - virtual void execute(DCmdSource source, TRAPS); - static int num_arguments() { return 0; } - static const JavaPermission permission() { - JavaPermission p = {"java.lang.management.ManagementPermission", - "control", NULL}; - return p; - } -}; - class CompileQueueDCmd : public DCmd { public: CompileQueueDCmd(outputStream* output, bool heap) : DCmd(output, heap) {} diff --git a/hotspot/src/share/vm/services/memoryService.cpp b/hotspot/src/share/vm/services/memoryService.cpp index 187425ba92b..ea2ae889563 100644 --- a/hotspot/src/share/vm/services/memoryService.cpp +++ b/hotspot/src/share/vm/services/memoryService.cpp @@ -32,6 +32,7 @@ #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/generation.hpp" #include "gc/shared/generationSpec.hpp" +#include "logging/logConfiguration.hpp" #include "memory/heap.hpp" #include "memory/memRegion.hpp" #include "oops/oop.inline.hpp" @@ -517,8 +518,12 @@ void MemoryService::oops_do(OopClosure* f) { bool MemoryService::set_verbose(bool verbose) { MutexLocker m(Management_lock); // verbose will be set to the previous value - Flag::Error error = CommandLineFlags::boolAtPut("PrintGC", &verbose, Flag::MANAGEMENT); - assert(error==Flag::SUCCESS, "Setting PrintGC flag failed with error %s", Flag::flag_error_str(error)); + MutexLocker ml(LogConfiguration_lock); + if (verbose) { + LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); + } else { + LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL); + } ClassLoadingService::reset_trace_class_unloading(); return verbose; diff --git a/hotspot/src/share/vm/services/memoryService.hpp b/hotspot/src/share/vm/services/memoryService.hpp index d03eb86f873..86a6a95fa90 100644 --- a/hotspot/src/share/vm/services/memoryService.hpp +++ b/hotspot/src/share/vm/services/memoryService.hpp @@ -27,6 +27,7 @@ #include "gc/shared/gcCause.hpp" #include "gc/shared/generation.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "runtime/handles.hpp" #include "services/memoryUsage.hpp" @@ -164,7 +165,7 @@ public: static void oops_do(OopClosure* f); - static bool get_verbose() { return PrintGC; } + static bool get_verbose() { return log_is_enabled(Info, gc); } static bool set_verbose(bool verbose); // Create an instance of java/lang/management/MemoryUsage diff --git a/hotspot/src/share/vm/services/runtimeService.cpp b/hotspot/src/share/vm/services/runtimeService.cpp index 13ddd03740f..48f14646303 100644 --- a/hotspot/src/share/vm/services/runtimeService.cpp +++ b/hotspot/src/share/vm/services/runtimeService.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/classLoader.hpp" +#include "logging/log.hpp" #include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/management.hpp" @@ -87,11 +88,8 @@ void RuntimeService::record_safepoint_begin() { HS_PRIVATE_SAFEPOINT_BEGIN(); // Print the time interval in which the app was executing - if (PrintGCApplicationConcurrentTime && _app_timer.is_updated()) { - gclog_or_tty->date_stamp(PrintGCDateStamps); - gclog_or_tty->stamp(PrintGCTimeStamps); - gclog_or_tty->print_cr("Application time: %3.7f seconds", - last_application_time_sec()); + if (_app_timer.is_updated()) { + log_info(safepoint)("Application time: %3.7f seconds", last_application_time_sec()); } // update the time stamp to begin recording safepoint time @@ -109,7 +107,7 @@ void RuntimeService::record_safepoint_synchronized() { if (UsePerfData) { _sync_time_ticks->inc(_safepoint_timer.ticks_since_update()); } - if (PrintGCApplicationStoppedTime) { + if (log_is_enabled(Info, safepoint)) { _last_safepoint_sync_time_sec = last_safepoint_time_sec(); } } @@ -119,15 +117,8 @@ void RuntimeService::record_safepoint_end() { // Print the time interval for which the app was stopped // during the current safepoint operation. - if (PrintGCApplicationStoppedTime) { - gclog_or_tty->date_stamp(PrintGCDateStamps); - gclog_or_tty->stamp(PrintGCTimeStamps); - gclog_or_tty->print_cr("Total time for which application threads " - "were stopped: %3.7f seconds, " - "Stopping threads took: %3.7f seconds", - last_safepoint_time_sec(), - _last_safepoint_sync_time_sec); - } + log_info(safepoint)("Total time for which application threads were stopped: %3.7f seconds, Stopping threads took: %3.7f seconds", + last_safepoint_time_sec(), _last_safepoint_sync_time_sec); // update the time stamp to begin recording app time _app_timer.update(); diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp index 8f6569e80c0..29ccf223721 100644 --- a/hotspot/src/share/vm/utilities/debug.cpp +++ b/hotspot/src/share/vm/utilities/debug.cpp @@ -505,7 +505,7 @@ extern "C" void printnm(intptr_t p) { extern "C" void universe() { Command c("universe"); - Universe::print(); + Universe::print_on(tty); } diff --git a/hotspot/src/share/vm/utilities/numberSeq.cpp b/hotspot/src/share/vm/utilities/numberSeq.cpp index 702a16a2a7f..ddb1683b74b 100644 --- a/hotspot/src/share/vm/utilities/numberSeq.cpp +++ b/hotspot/src/share/vm/utilities/numberSeq.cpp @@ -234,7 +234,7 @@ double TruncatedSeq::predict_next() const { // Printing/Debugging Support -void AbsSeq::dump() { dump_on(gclog_or_tty); } +void AbsSeq::dump() { dump_on(tty); } void AbsSeq::dump_on(outputStream* s) { s->print_cr("\t _num = %d, _sum = %7.3f, _sum_of_squares = %7.3f", diff --git a/hotspot/src/share/vm/utilities/ostream.cpp b/hotspot/src/share/vm/utilities/ostream.cpp index 0c09556e72a..d3583a006ff 100644 --- a/hotspot/src/share/vm/utilities/ostream.cpp +++ b/hotspot/src/share/vm/utilities/ostream.cpp @@ -239,14 +239,6 @@ void outputStream::date_stamp(bool guard, return; } -void outputStream::gclog_stamp() { - date_stamp(PrintGCDateStamps); - stamp(PrintGCTimeStamps); - if (PrintGCID) { - print("#%u: ", GCId::current()); - } -} - outputStream& outputStream::indent() { while (_position < _indentation) sp(); return *this; @@ -366,7 +358,6 @@ stringStream::~stringStream() {} xmlStream* xtty; outputStream* tty; -outputStream* gclog_or_tty; CDS_ONLY(fileStream* classlist_file;) // Only dump the classes that can be stored into the CDS archive extern Mutex* tty_lock; @@ -482,7 +473,7 @@ static const char* make_log_name_internal(const char* log_name, const char* forc return buf; } -// log_name comes from -XX:LogFile=log_name, -Xloggc:log_name or +// log_name comes from -XX:LogFile=log_name or // -XX:DumpLoadedClassList= // in log_name, %p => pid1234 and // %t => YYYY-MM-DD_HH-MM-SS @@ -493,95 +484,6 @@ static const char* make_log_name(const char* log_name, const char* force_directo timestr); } -#ifndef PRODUCT -void test_loggc_filename() { - int pid; - char tms[32]; - char i_result[JVM_MAXPATHLEN]; - const char* o_result; - get_datetime_string(tms, sizeof(tms)); - pid = os::current_process_id(); - - // test.log - jio_snprintf(i_result, JVM_MAXPATHLEN, "test.log", tms); - o_result = make_log_name_internal("test.log", NULL, pid, tms); - assert(strcmp(i_result, o_result) == 0, "failed on testing make_log_name(\"test.log\", NULL)"); - FREE_C_HEAP_ARRAY(char, o_result); - - // test-%t-%p.log - jio_snprintf(i_result, JVM_MAXPATHLEN, "test-%s-pid%u.log", tms, pid); - o_result = make_log_name_internal("test-%t-%p.log", NULL, pid, tms); - assert(strcmp(i_result, o_result) == 0, "failed on testing make_log_name(\"test-%%t-%%p.log\", NULL)"); - FREE_C_HEAP_ARRAY(char, o_result); - - // test-%t%p.log - jio_snprintf(i_result, JVM_MAXPATHLEN, "test-%spid%u.log", tms, pid); - o_result = make_log_name_internal("test-%t%p.log", NULL, pid, tms); - assert(strcmp(i_result, o_result) == 0, "failed on testing make_log_name(\"test-%%t%%p.log\", NULL)"); - FREE_C_HEAP_ARRAY(char, o_result); - - // %p%t.log - jio_snprintf(i_result, JVM_MAXPATHLEN, "pid%u%s.log", pid, tms); - o_result = make_log_name_internal("%p%t.log", NULL, pid, tms); - assert(strcmp(i_result, o_result) == 0, "failed on testing make_log_name(\"%%p%%t.log\", NULL)"); - FREE_C_HEAP_ARRAY(char, o_result); - - // %p-test.log - jio_snprintf(i_result, JVM_MAXPATHLEN, "pid%u-test.log", pid); - o_result = make_log_name_internal("%p-test.log", NULL, pid, tms); - assert(strcmp(i_result, o_result) == 0, "failed on testing make_log_name(\"%%p-test.log\", NULL)"); - FREE_C_HEAP_ARRAY(char, o_result); - - // %t.log - jio_snprintf(i_result, JVM_MAXPATHLEN, "%s.log", tms); - o_result = make_log_name_internal("%t.log", NULL, pid, tms); - assert(strcmp(i_result, o_result) == 0, "failed on testing make_log_name(\"%%t.log\", NULL)"); - FREE_C_HEAP_ARRAY(char, o_result); - - { - // longest filename - char longest_name[JVM_MAXPATHLEN]; - memset(longest_name, 'a', sizeof(longest_name)); - longest_name[JVM_MAXPATHLEN - 1] = '\0'; - o_result = make_log_name_internal((const char*)&longest_name, NULL, pid, tms); - assert(strcmp(longest_name, o_result) == 0, "longest name does not match. expected '%s' but got '%s'", longest_name, o_result); - FREE_C_HEAP_ARRAY(char, o_result); - } - - { - // too long file name - char too_long_name[JVM_MAXPATHLEN + 100]; - int too_long_length = sizeof(too_long_name); - memset(too_long_name, 'a', too_long_length); - too_long_name[too_long_length - 1] = '\0'; - o_result = make_log_name_internal((const char*)&too_long_name, NULL, pid, tms); - assert(o_result == NULL, "Too long file name should return NULL, but got '%s'", o_result); - } - - { - // too long with timestamp - char longest_name[JVM_MAXPATHLEN]; - memset(longest_name, 'a', JVM_MAXPATHLEN); - longest_name[JVM_MAXPATHLEN - 3] = '%'; - longest_name[JVM_MAXPATHLEN - 2] = 't'; - longest_name[JVM_MAXPATHLEN - 1] = '\0'; - o_result = make_log_name_internal((const char*)&longest_name, NULL, pid, tms); - assert(o_result == NULL, "Too long file name after timestamp expansion should return NULL, but got '%s'", o_result); - } - - { - // too long with pid - char longest_name[JVM_MAXPATHLEN]; - memset(longest_name, 'a', JVM_MAXPATHLEN); - longest_name[JVM_MAXPATHLEN - 3] = '%'; - longest_name[JVM_MAXPATHLEN - 2] = 'p'; - longest_name[JVM_MAXPATHLEN - 1] = '\0'; - o_result = make_log_name_internal((const char*)&longest_name, NULL, pid, tms); - assert(o_result == NULL, "Too long file name after pid expansion should return NULL, but got '%s'", o_result); - } -} -#endif // PRODUCT - fileStream::fileStream(const char* file_name) { _file = fopen(file_name, "w"); if (_file != NULL) { @@ -660,202 +562,6 @@ void fdStream::write(const char* s, size_t len) { update_position(s, len); } -// dump vm version, os version, platform info, build id, -// memory usage and command line flags into header -void gcLogFileStream::dump_loggc_header() { - if (is_open()) { - print_cr("%s", Abstract_VM_Version::internal_vm_info_string()); - os::print_memory_info(this); - print("CommandLine flags: "); - CommandLineFlags::printSetFlags(this); - } -} - -gcLogFileStream::~gcLogFileStream() { - if (_file != NULL) { - if (_need_close) fclose(_file); - _file = NULL; - } - if (_file_name != NULL) { - FREE_C_HEAP_ARRAY(char, _file_name); - _file_name = NULL; - } -} - -gcLogFileStream::gcLogFileStream(const char* file_name) { - _cur_file_num = 0; - _bytes_written = 0L; - _file_name = make_log_name(file_name, NULL); - - if (_file_name == NULL) { - warning("Cannot open file %s: file name is too long.\n", file_name); - _need_close = false; - UseGCLogFileRotation = false; - return; - } - - // gc log file rotation - if (UseGCLogFileRotation && NumberOfGCLogFiles > 1) { - char tempbuf[JVM_MAXPATHLEN]; - jio_snprintf(tempbuf, sizeof(tempbuf), "%s.%d" CURRENTAPPX, _file_name, _cur_file_num); - _file = fopen(tempbuf, "w"); - } else { - _file = fopen(_file_name, "w"); - } - if (_file != NULL) { - _need_close = true; - dump_loggc_header(); - } else { - warning("Cannot open file %s due to %s\n", _file_name, strerror(errno)); - _need_close = false; - } -} - -void gcLogFileStream::write(const char* s, size_t len) { - if (_file != NULL) { - size_t count = fwrite(s, 1, len, _file); - _bytes_written += count; - } - update_position(s, len); -} - -// rotate_log must be called from VMThread at safepoint. In case need change parameters -// for gc log rotation from thread other than VMThread, a sub type of VM_Operation -// should be created and be submitted to VMThread's operation queue. DO NOT call this -// function directly. Currently, it is safe to rotate log at safepoint through VMThread. -// That is, no mutator threads and concurrent GC threads run parallel with VMThread to -// write to gc log file at safepoint. If in future, changes made for mutator threads or -// concurrent GC threads to run parallel with VMThread at safepoint, write and rotate_log -// must be synchronized. -void gcLogFileStream::rotate_log(bool force, outputStream* out) { - char time_msg[O_BUFLEN]; - char time_str[EXTRACHARLEN]; - char current_file_name[JVM_MAXPATHLEN]; - char renamed_file_name[JVM_MAXPATHLEN]; - - if (!should_rotate(force)) { - return; - } - -#ifdef ASSERT - Thread *thread = Thread::current_or_null(); - assert(thread == NULL || - (thread->is_VM_thread() && SafepointSynchronize::is_at_safepoint()), - "Must be VMThread at safepoint"); -#endif - if (NumberOfGCLogFiles == 1) { - // rotate in same file - rewind(); - _bytes_written = 0L; - jio_snprintf(time_msg, sizeof(time_msg), "File %s rotated at %s\n", - _file_name, os::local_time_string((char *)time_str, sizeof(time_str))); - write(time_msg, strlen(time_msg)); - - if (out != NULL) { - out->print("%s", time_msg); - } - - dump_loggc_header(); - return; - } - -#if defined(_WINDOWS) -#ifndef F_OK -#define F_OK 0 -#endif -#endif // _WINDOWS - - // rotate file in names extended_filename.0, extended_filename.1, ..., - // extended_filename.. Current rotation file name will - // have a form of extended_filename..current where i is the current rotation - // file number. After it reaches max file size, the file will be saved and renamed - // with .current removed from its tail. - if (_file != NULL) { - jio_snprintf(renamed_file_name, JVM_MAXPATHLEN, "%s.%d", - _file_name, _cur_file_num); - int result = jio_snprintf(current_file_name, JVM_MAXPATHLEN, - "%s.%d" CURRENTAPPX, _file_name, _cur_file_num); - if (result >= JVM_MAXPATHLEN) { - warning("Cannot create new log file name: %s: file name is too long.\n", current_file_name); - return; - } - - const char* msg = force ? "GC log rotation request has been received." - : "GC log file has reached the maximum size."; - jio_snprintf(time_msg, sizeof(time_msg), "%s %s Saved as %s\n", - os::local_time_string((char *)time_str, sizeof(time_str)), - msg, renamed_file_name); - write(time_msg, strlen(time_msg)); - - if (out != NULL) { - out->print("%s", time_msg); - } - - fclose(_file); - _file = NULL; - - bool can_rename = true; - if (access(current_file_name, F_OK) != 0) { - // current file does not exist? - warning("No source file exists, cannot rename\n"); - can_rename = false; - } - if (can_rename) { - if (access(renamed_file_name, F_OK) == 0) { - if (remove(renamed_file_name) != 0) { - warning("Could not delete existing file %s\n", renamed_file_name); - can_rename = false; - } - } else { - // file does not exist, ok to rename - } - } - if (can_rename && rename(current_file_name, renamed_file_name) != 0) { - warning("Could not rename %s to %s\n", _file_name, renamed_file_name); - } - } - - _cur_file_num++; - if (_cur_file_num > NumberOfGCLogFiles - 1) _cur_file_num = 0; - int result = jio_snprintf(current_file_name, JVM_MAXPATHLEN, "%s.%d" CURRENTAPPX, - _file_name, _cur_file_num); - if (result >= JVM_MAXPATHLEN) { - warning("Cannot create new log file name: %s: file name is too long.\n", current_file_name); - return; - } - - _file = fopen(current_file_name, "w"); - - if (_file != NULL) { - _bytes_written = 0L; - _need_close = true; - // reuse current_file_name for time_msg - jio_snprintf(current_file_name, JVM_MAXPATHLEN, - "%s.%d", _file_name, _cur_file_num); - jio_snprintf(time_msg, sizeof(time_msg), "%s GC log file created %s\n", - os::local_time_string((char *)time_str, sizeof(time_str)), current_file_name); - write(time_msg, strlen(time_msg)); - - if (out != NULL) { - out->print("%s", time_msg); - } - - dump_loggc_header(); - // remove the existing file - if (access(current_file_name, F_OK) == 0) { - if (remove(current_file_name) != 0) { - warning("Could not delete existing file %s\n", current_file_name); - } - } - } else { - warning("failed to open rotation log file %s due to %s\n" - "Turned off GC log file rotation\n", - _file_name, strerror(errno)); - _need_close = false; - FLAG_SET_DEFAULT(UseGCLogFileRotation, false); - } -} - defaultStream* defaultStream::instance = NULL; int defaultStream::_output_fd = 1; int defaultStream::_error_fd = 2; @@ -1194,21 +900,8 @@ void ostream_init() { } void ostream_init_log() { - // For -Xloggc: option - called in runtime/thread.cpp // Note : this must be called AFTER ostream_init() - gclog_or_tty = tty; // default to tty - if (Arguments::gc_log_filename() != NULL) { - fileStream * gclog = new(ResourceObj::C_HEAP, mtInternal) - gcLogFileStream(Arguments::gc_log_filename()); - if (gclog->is_open()) { - // now we update the time stamp of the GC log to be synced up - // with tty. - gclog->time_stamp().update_to(tty->time_stamp().ticks()); - } - gclog_or_tty = gclog; - } - #if INCLUDE_CDS // For -XX:DumpLoadedClassList= option if (DumpLoadedClassList != NULL) { @@ -1236,9 +929,6 @@ void ostream_exit() { delete classlist_file; } #endif - if (gclog_or_tty != tty) { - delete gclog_or_tty; - } { // we temporaly disable PrintMallocFree here // as otherwise it'll lead to using of almost deleted @@ -1254,14 +944,12 @@ void ostream_exit() { } tty = NULL; xtty = NULL; - gclog_or_tty = NULL; defaultStream::instance = NULL; } // ostream_abort() is called by os::abort() when VM is about to die. void ostream_abort() { - // Here we can't delete gclog_or_tty and tty, just flush their output - if (gclog_or_tty) gclog_or_tty->flush(); + // Here we can't delete tty, just flush its output if (tty) tty->flush(); if (defaultStream::instance != NULL) { diff --git a/hotspot/src/share/vm/utilities/ostream.hpp b/hotspot/src/share/vm/utilities/ostream.hpp index a9447b64c60..627ba90fb92 100644 --- a/hotspot/src/share/vm/utilities/ostream.hpp +++ b/hotspot/src/share/vm/utilities/ostream.hpp @@ -108,7 +108,6 @@ class outputStream : public ResourceObj { void date_stamp(bool guard) { date_stamp(guard, "", ": "); } - void gclog_stamp(); // portable printing of 64 bit integers void print_jlong(jlong value); @@ -127,7 +126,6 @@ class outputStream : public ResourceObj { // standard output // ANSI C++ name collision extern outputStream* tty; // tty output -extern outputStream* gclog_or_tty; // stream for gc log if -Xloggc:, or tty class streamIndentor : public StackObj { private: @@ -247,30 +245,6 @@ public: } }; -class gcLogFileStream : public fileStream { - protected: - const char* _file_name; - jlong _bytes_written; - uintx _cur_file_num; // current logfile rotation number, from 0 to NumberOfGCLogFiles-1 - public: - gcLogFileStream(const char* file_name); - ~gcLogFileStream(); - virtual void write(const char* c, size_t len); - virtual void rotate_log(bool force, outputStream* out = NULL); - void dump_loggc_header(); - - /* If "force" sets true, force log file rotation from outside JVM */ - bool should_rotate(bool force) { - return force || - ((GCLogFileSize != 0) && (_bytes_written >= (jlong)GCLogFileSize)); - } -}; - -#ifndef PRODUCT -// unit test for checking -Xloggc: parsing result -void test_loggc_filename(); -#endif - void ostream_init(); void ostream_init_log(); void ostream_exit(); diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index ab2b89acaf8..0ab5b18b6e1 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -145,7 +145,6 @@ needs_compact3 = \ gc/g1/TestShrinkAuxiliaryData25.java \ gc/g1/TestShrinkAuxiliaryData30.java \ gc/survivorAlignment \ - gc/TestGCLogRotationViaJcmd.java \ runtime/InternalApi/ThreadCpuTimesDeadlock.java \ runtime/NMT/JcmdSummaryDiff.java \ runtime/RedefineTests/RedefineAnnotations.java diff --git a/hotspot/test/gc/7072527/TestFullGCCount.java b/hotspot/test/gc/7072527/TestFullGCCount.java index fcd422ff389..6732a01c355 100644 --- a/hotspot/test/gc/7072527/TestFullGCCount.java +++ b/hotspot/test/gc/7072527/TestFullGCCount.java @@ -26,7 +26,7 @@ * @bug 7072527 * @summary CMS: JMM GC counters overcount in some cases * @modules java.management - * @run main/othervm -XX:+PrintGC TestFullGCCount + * @run main/othervm -Xlog:gc TestFullGCCount */ import java.util.*; import java.lang.management.*; diff --git a/hotspot/test/gc/TestDisableExplicitGC.java b/hotspot/test/gc/TestDisableExplicitGC.java index 9f0d5c7cbb8..10199fd0bb0 100644 --- a/hotspot/test/gc/TestDisableExplicitGC.java +++ b/hotspot/test/gc/TestDisableExplicitGC.java @@ -26,9 +26,9 @@ * @requires vm.opt.DisableExplicitGC == null * @summary Verify GC behavior with DisableExplicitGC flag. * @library /testlibrary - * @run main/othervm -XX:+PrintGCDetails TestDisableExplicitGC - * @run main/othervm/fail -XX:+DisableExplicitGC -XX:+PrintGCDetails TestDisableExplicitGC - * @run main/othervm -XX:-DisableExplicitGC -XX:+PrintGCDetails TestDisableExplicitGC + * @run main/othervm -Xlog:gc=debug TestDisableExplicitGC + * @run main/othervm/fail -XX:+DisableExplicitGC -Xlog:gc=debug TestDisableExplicitGC + * @run main/othervm -XX:-DisableExplicitGC -Xlog:gc=debug TestDisableExplicitGC */ import java.lang.management.GarbageCollectorMXBean; import java.util.List; diff --git a/hotspot/test/gc/TestGCLogRotationViaJcmd.java b/hotspot/test/gc/TestGCLogRotationViaJcmd.java deleted file mode 100644 index fd0e331ffa6..00000000000 --- a/hotspot/test/gc/TestGCLogRotationViaJcmd.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 - * 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 TestGCLogRotationViaJcmd.java - * @bug 7090324 - * @summary test for gc log rotation via jcmd - * @library /testlibrary - * @modules java.base/sun.misc - * java.management - * @run main/othervm -Xloggc:test.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=3 TestGCLogRotationViaJcmd - * - */ -import jdk.test.lib.*; -import java.io.File; -import java.io.FilenameFilter; - -public class TestGCLogRotationViaJcmd { - - static final File currentDirectory = new File("."); - static final String LOG_FILE_NAME = "test.log"; - static final int NUM_LOGS = 3; - - static FilenameFilter logFilter = new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - return name.startsWith(LOG_FILE_NAME); - } - }; - - public static void main(String[] args) throws Exception { - // Grab the pid from the current java process - String pid = Integer.toString(ProcessTools.getProcessId()); - - // Create a JDKToolLauncher - JDKToolLauncher jcmd = JDKToolLauncher.create("jcmd") - .addToolArg(pid) - .addToolArg("GC.rotate_log"); - - for (int times = 1; times < NUM_LOGS; times++) { - // Run jcmd GC.rotate_log - ProcessBuilder pb = new ProcessBuilder(jcmd.getCommand()); - - // Make sure we didn't crash - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldHaveExitValue(0); - } - - // GC log check - File[] logs = currentDirectory.listFiles(logFilter); - if (logs.length != NUM_LOGS) { - throw new Error("There are only " + logs.length - + " logs instead " + NUM_LOGS); - } - - } - -} - diff --git a/hotspot/test/gc/TestVerifyDuringStartup.java b/hotspot/test/gc/TestVerifyDuringStartup.java index 95643aee4ce..69466673a16 100644 --- a/hotspot/test/gc/TestVerifyDuringStartup.java +++ b/hotspot/test/gc/TestVerifyDuringStartup.java @@ -48,6 +48,7 @@ public class TestVerifyDuringStartup { Collections.addAll(vmOpts, new String[] {"-XX:-UseTLAB", "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyDuringStartup", + "-Xlog:gc+verify=debug", "-version"}); System.out.print("Testing:\n" + JDKToolFinder.getJDKTool("java")); @@ -62,7 +63,7 @@ public class TestVerifyDuringStartup { System.out.println("Output:\n" + output.getOutput()); - output.shouldContain("[Verifying"); + output.shouldContain("Verifying"); output.shouldHaveExitValue(0); } } diff --git a/hotspot/test/gc/TestVerifySilently.java b/hotspot/test/gc/TestVerifySilently.java index b2861d6026a..3694f2f027b 100644 --- a/hotspot/test/gc/TestVerifySilently.java +++ b/hotspot/test/gc/TestVerifySilently.java @@ -60,7 +60,7 @@ public class TestVerifySilently { "-XX:+VerifyDuringStartup", "-XX:+VerifyBeforeGC", "-XX:+VerifyAfterGC", - "-XX:" + (verifySilently ? "+":"-") + "VerifySilently", + (verifySilently ? "-Xlog:gc":"-Xlog:gc+verify=debug"), RunSystemGC.class.getName()}); ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(vmOpts.toArray(new String[vmOpts.size()])); @@ -76,11 +76,11 @@ public class TestVerifySilently { OutputAnalyzer output; output = runTest(false); - output.shouldContain("[Verifying"); + output.shouldContain("Verifying"); output.shouldHaveExitValue(0); output = runTest(true); - output.shouldNotContain("[Verifying"); + output.shouldNotContain("Verifying"); output.shouldHaveExitValue(0); } } diff --git a/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java b/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java index a9d8a984d0b..3dc2980a9ee 100644 --- a/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java +++ b/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java @@ -79,7 +79,7 @@ public class TestTargetSurvivorRatioFlag { // Patterns used during log parsing public static final String TENURING_DISTRIBUTION = "Desired survivor size"; - public static final String AGE_TABLE_ENTRY = "-[\\s]+age[\\s]+([0-9]+):[\\s]+([0-9]+)[\\s]+bytes,[\\s]+([0-9]+)[\\s]+total"; + public static final String AGE_TABLE_ENTRY = ".*-[\\s]+age[\\s]+([0-9]+):[\\s]+([0-9]+)[\\s]+bytes,[\\s]+([0-9]+)[\\s]+total"; public static final String MAX_SURVIVOR_SIZE = "Max survivor size: ([0-9]+)"; public static void main(String args[]) throws Exception { @@ -133,7 +133,7 @@ public class TestTargetSurvivorRatioFlag { "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-XX:+UseAdaptiveSizePolicy", - "-XX:+PrintTenuringDistribution", + "-Xlog:gc+age=trace", "-XX:MaxTenuringThreshold=" + MAX_TENURING_THRESHOLD, "-XX:NewSize=" + MAX_NEW_SIZE, "-XX:MaxNewSize=" + MAX_NEW_SIZE, diff --git a/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java b/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java index 1e08a1088ca..787e23e8156 100644 --- a/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java +++ b/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java @@ -39,11 +39,11 @@ public class TestUnrecognizedVMOptionsHandling { public static void main(String args[]) throws Exception { // The first two JAVA processes are expected to fail, but with a correct VM option suggestion ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+PrintGc", + "-XX:+UseDynamicNumberOfGcThreads", "-version" ); OutputAnalyzer outputWithError = new OutputAnalyzer(pb.start()); - outputWithError.shouldContain("Did you mean '(+/-)PrintGC'?"); + outputWithError.shouldContain("Did you mean '(+/-)UseDynamicNumberOfGCThreads'?"); if (outputWithError.getExitValue() == 0) { throw new RuntimeException("Not expected to get exit value 0"); } @@ -60,11 +60,11 @@ public class TestUnrecognizedVMOptionsHandling { // The last JAVA process should run successfully for the purpose of sanity check pb = ProcessTools.createJavaProcessBuilder( - "-XX:+PrintGC", + "-XX:+UseDynamicNumberOfGCThreads", "-version" ); OutputAnalyzer outputWithNoError = new OutputAnalyzer(pb.start()); - outputWithNoError.shouldNotContain("Did you mean '(+/-)PrintGC'?"); + outputWithNoError.shouldNotContain("Did you mean '(+/-)UseDynamicNumberOfGCThreads'?"); outputWithNoError.shouldHaveExitValue(0); } } diff --git a/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java b/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java index f716bdc67de..3706d955bda 100644 --- a/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java +++ b/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java @@ -43,18 +43,18 @@ import jdk.test.lib.ProcessTools; public class TestVerifyBeforeAndAfterGCFlags { // VerifyBeforeGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand C-heap code cache ] - public static final String VERIFY_BEFORE_GC_PATTERN = "VerifyBeforeGC:\\[Verifying\\s+([^]\\s]+\\s+)+\\]"; + public static final String VERIFY_BEFORE_GC_PATTERN = "Verifying Before GC"; // VerifyBeforeGC: VerifyBeforeGC: VerifyBeforeGC: public static final String VERIFY_BEFORE_GC_CORRUPTED_PATTERN = "VerifyBeforeGC:(?!\\[Verifying[^]]+\\])"; // VerifyAfterGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand C-heap code cache ] - public static final String VERIFY_AFTER_GC_PATTERN = "VerifyAfterGC:\\[Verifying\\s+([^]\\s]+\\s+)+\\]"; + public static final String VERIFY_AFTER_GC_PATTERN = "Verifying After GC"; // VerifyAfterGC: VerifyAfterGC: VerifyAfterGC: public static final String VERIFY_AFTER_GC_CORRUPTED_PATTERN = "VerifyAfterGC:(?!\\[Verifying[^]]+\\])"; public static void main(String args[]) throws Exception { String[] filteredOpts = Utils.getFilteredTestJavaOpts( - new String[] { "-Xloggc:", + new String[] { "-Xlog:gc+verify=debug", "-XX:+UseGCLogFileRotation", "-XX:-DisplayVMOutput", "VerifyBeforeGC", @@ -74,6 +74,7 @@ public class TestVerifyBeforeAndAfterGCFlags { } Collections.addAll(vmOpts, new String[] { + "-Xlog:gc+verify=debug", "-Xmx5m", "-Xms5m", "-Xmn3m", diff --git a/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java b/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java index 634cc87edf5..12acc0fe0a9 100644 --- a/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java +++ b/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java @@ -59,9 +59,7 @@ public class TestCMSClassUnloadingEnabledHWM { "-Xmn" + YoungGenSize, "-XX:+UseConcMarkSweepGC", "-XX:" + (enableUnloading ? "+" : "-") + "CMSClassUnloadingEnabled", - "-XX:+PrintHeapAtGC", - "-XX:+PrintGCDetails", - "-XX:+PrintGCTimeStamps", + "-Xlog:gc", TestCMSClassUnloadingEnabledHWM.AllocateBeyondMetaspaceSize.class.getName(), "" + MetaspaceSize); return new OutputAnalyzer(pb.start()); @@ -79,16 +77,16 @@ public class TestCMSClassUnloadingEnabledHWM { // -XX:-CMSClassUnloadingEnabled is used, so we expect a full GC instead of a concurrent cycle. OutputAnalyzer out = runWithoutCMSClassUnloading(); - out.shouldMatch(".*Full GC.*"); - out.shouldNotMatch(".*CMS Initial Mark.*"); + out.shouldMatch(".*Pause Full.*"); + out.shouldNotMatch(".*Pause Initial Mark.*"); } public static void testWithCMSClassUnloading() throws Exception { // -XX:+CMSClassUnloadingEnabled is used, so we expect a concurrent cycle instead of a full GC. OutputAnalyzer out = runWithCMSClassUnloading(); - out.shouldMatch(".*CMS Initial Mark.*"); - out.shouldNotMatch(".*Full GC.*"); + out.shouldMatch(".*Pause Initial Mark.*"); + out.shouldNotMatch(".*Pause Full.*"); } public static void main(String args[]) throws Exception { diff --git a/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java b/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java index 8637e6f4b9c..3d382c91c25 100644 --- a/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java +++ b/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java @@ -54,8 +54,7 @@ public class TestG1ClassUnloadingHWM { "-Xmn" + YoungGenSize, "-XX:+UseG1GC", "-XX:" + (enableUnloading ? "+" : "-") + "ClassUnloadingWithConcurrentMark", - "-XX:+PrintHeapAtGC", - "-XX:+PrintGCDetails", + "-Xlog:gc", TestG1ClassUnloadingHWM.AllocateBeyondMetaspaceSize.class.getName(), "" + MetaspaceSize, "" + YoungGenSize); @@ -74,16 +73,16 @@ public class TestG1ClassUnloadingHWM { // -XX:-ClassUnloadingWithConcurrentMark is used, so we expect a full GC instead of a concurrent cycle. OutputAnalyzer out = runWithoutG1ClassUnloading(); - out.shouldMatch(".*Full GC.*"); - out.shouldNotMatch(".*initial-mark.*"); + out.shouldMatch(".*Pause Full.*"); + out.shouldNotMatch(".*Pause Initial Mark.*"); } public static void testWithG1ClassUnloading() throws Exception { // -XX:+ClassUnloadingWithConcurrentMark is used, so we expect a concurrent cycle instead of a full GC. OutputAnalyzer out = runWithG1ClassUnloading(); - out.shouldMatch(".*initial-mark.*"); - out.shouldNotMatch(".*Full GC.*"); + out.shouldMatch(".*Pause Initial Mark.*"); + out.shouldNotMatch(".*Pause Full.*"); } public static void main(String args[]) throws Exception { diff --git a/hotspot/test/gc/cms/DisableResizePLAB.java b/hotspot/test/gc/cms/DisableResizePLAB.java index b7cad24eae6..d1e4e681eb1 100644 --- a/hotspot/test/gc/cms/DisableResizePLAB.java +++ b/hotspot/test/gc/cms/DisableResizePLAB.java @@ -28,7 +28,7 @@ * @author filipp.zhinkin@oracle.com, john.coomes@oracle.com * @requires vm.gc=="ConcMarkSweep" | vm.gc=="null" * @summary Run CMS with PLAB resizing disabled and a small OldPLABSize - * @run main/othervm -XX:+UseConcMarkSweepGC -XX:-ResizePLAB -XX:OldPLABSize=1k -Xmx256m -XX:+PrintGCDetails DisableResizePLAB + * @run main/othervm -XX:+UseConcMarkSweepGC -XX:-ResizePLAB -XX:OldPLABSize=1k -Xmx256m -Xlog:gc=debug DisableResizePLAB */ public class DisableResizePLAB { diff --git a/hotspot/test/gc/cms/TestCMSScavengeBeforeRemark.java b/hotspot/test/gc/cms/TestCMSScavengeBeforeRemark.java index b124541e1e0..91376c18ced 100644 --- a/hotspot/test/gc/cms/TestCMSScavengeBeforeRemark.java +++ b/hotspot/test/gc/cms/TestCMSScavengeBeforeRemark.java @@ -27,7 +27,7 @@ * @bug 8139868 * @requires vm.gc=="ConcMarkSweep" | vm.gc=="null" * @summary Run CMS with CMSScavengeBeforeRemark - * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+CMSScavengeBeforeRemark -XX:+ExplicitGCInvokesConcurrent -Xmx256m -XX:+PrintGCDetails TestCMSScavengeBeforeRemark + * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+CMSScavengeBeforeRemark -XX:+ExplicitGCInvokesConcurrent -Xmx256m -Xlog:gc=debug TestCMSScavengeBeforeRemark */ public class TestCMSScavengeBeforeRemark { diff --git a/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java b/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java index 3bcec291cdc..afa2103783c 100644 --- a/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java +++ b/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java @@ -50,7 +50,7 @@ public class TestDynamicNumberOfGCThreads { private static void testDynamicNumberOfGCThreads(String gcFlag) throws Exception { // UseDynamicNumberOfGCThreads and TraceDynamicGCThreads enabled - String[] baseArgs = {"-XX:+" + gcFlag, "-Xmx10M", "-XX:+PrintGCDetails", "-XX:+UseDynamicNumberOfGCThreads", "-XX:+TraceDynamicGCThreads", GCTest.class.getName()}; + String[] baseArgs = {"-XX:+" + gcFlag, "-Xmx10M", "-XX:+UseDynamicNumberOfGCThreads", "-Xlog:gc+task=trace", GCTest.class.getName()}; // Base test with gc and +UseDynamicNumberOfGCThreads: ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder(baseArgs); diff --git a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java index 3876dc092ef..487a4b10c43 100644 --- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java +++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java @@ -82,7 +82,7 @@ public class TestEagerReclaimHumongousRegions { "-Xms128M", "-Xmx128M", "-Xmn16M", - "-XX:+PrintGC", + "-Xlog:gc", ReclaimRegionFast.class.getName()); Pattern p = Pattern.compile("Full GC"); diff --git a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java index 0dfe7ac0b3d..5dde4f48b9f 100644 --- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java +++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java @@ -120,7 +120,7 @@ public class TestEagerReclaimHumongousRegionsClearMarkBits { "-Xmn2M", "-XX:G1HeapRegionSize=1M", "-XX:InitiatingHeapOccupancyPercent=0", // Want to have as much as possible initial marks. - "-XX:+PrintGC", + "-Xlog:gc", "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyAfterGC", "-XX:ConcGCThreads=1", // Want to make marking as slow as possible. diff --git a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java index 0dcd882a0f7..eacc9454701 100644 --- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java +++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java @@ -94,7 +94,7 @@ public class TestEagerReclaimHumongousRegionsWithRefs { "-Xms128M", "-Xmx128M", "-Xmn16M", - "-XX:+PrintGC", + "-Xlog:gc", ReclaimRegionFast.class.getName()); Pattern p = Pattern.compile("Full GC"); diff --git a/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java b/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java index cd87f2cd586..6ce8613468e 100644 --- a/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java +++ b/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java @@ -49,20 +49,18 @@ public class TestG1TraceEagerReclaimHumongousObjects { "-Xmx128M", "-Xmn16M", "-XX:G1HeapRegionSize=1M", - "-XX:+PrintGC", + "-Xlog:gc+phases=trace", "-XX:+UnlockExperimentalVMOptions", - "-XX:G1LogLevel=finest", - "-XX:+G1TraceEagerReclaimHumongousObjects", GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); // As G1EagerReclaimHumongousObjects is set(default), below logs should be displayed. // And GCTest doesn't have humongous objects, so values should be zero. - output.shouldContain("[Humongous Reclaim"); - output.shouldContain("[Humongous Total: 0]"); - output.shouldContain("[Humongous Candidate: 0]"); - output.shouldContain("[Humongous Reclaimed: 0]"); + output.shouldContain("Humongous Reclaim"); + output.shouldContain("Humongous Total: 0"); + output.shouldContain("Humongous Candidate: 0"); + output.shouldContain("Humongous Reclaimed: 0"); output.shouldHaveExitValue(0); } @@ -73,19 +71,17 @@ public class TestG1TraceEagerReclaimHumongousObjects { "-Xmx128M", "-Xmn16M", "-XX:G1HeapRegionSize=1M", - "-XX:+PrintGC", + "-Xlog:gc+phases=trace,gc+humongous=trace", "-XX:+UnlockExperimentalVMOptions", - "-XX:G1LogLevel=finest", - "-XX:+G1TraceEagerReclaimHumongousObjects", GCWithHumongousObjectTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); // As G1ReclaimDeadHumongousObjectsAtYoungGC is set(default), below logs should be displayed. - output.shouldContain("[Humongous Reclaim"); - output.shouldContain("[Humongous Total"); - output.shouldContain("[Humongous Candidate"); - output.shouldContain("[Humongous Reclaimed"); + output.shouldContain("Humongous Reclaim"); + output.shouldContain("Humongous Total"); + output.shouldContain("Humongous Candidate"); + output.shouldContain("Humongous Reclaimed"); // As G1TraceReclaimDeadHumongousObjectsAtYoungGC is set and GCWithHumongousObjectTest has humongous objects, // these logs should be displayed. diff --git a/hotspot/test/gc/g1/TestGCLogMessages.java b/hotspot/test/gc/g1/TestGCLogMessages.java index ec5b87d3081..8ab921b0186 100644 --- a/hotspot/test/gc/g1/TestGCLogMessages.java +++ b/hotspot/test/gc/g1/TestGCLogMessages.java @@ -24,7 +24,7 @@ /* * @test TestGCLogMessages * @bug 8035406 8027295 8035398 8019342 8027959 8048179 8027962 8069330 - * @summary Ensure that the PrintGCDetails output for a minor GC with G1 + * @summary Ensure the output for a minor GC with G1 * includes the expected necessary messages. * @key gc * @library /testlibrary @@ -38,7 +38,7 @@ import jdk.test.lib.OutputAnalyzer; public class TestGCLogMessages { private enum Level { - OFF, FINER, FINEST; + OFF, DEBUG, TRACE; public boolean lessOrEqualTo(Level other) { return this.compareTo(other) < 0; } @@ -56,36 +56,36 @@ public class TestGCLogMessages { private LogMessageWithLevel allLogMessages[] = new LogMessageWithLevel[] { // Update RS - new LogMessageWithLevel("Scan HCC (ms)", Level.FINER), + new LogMessageWithLevel("Scan HCC", Level.DEBUG), // Ext Root Scan - new LogMessageWithLevel("Thread Roots (ms)", Level.FINEST), - new LogMessageWithLevel("StringTable Roots (ms)", Level.FINEST), - new LogMessageWithLevel("Universe Roots (ms)", Level.FINEST), - new LogMessageWithLevel("JNI Handles Roots (ms)", Level.FINEST), - new LogMessageWithLevel("ObjectSynchronizer Roots (ms)", Level.FINEST), - new LogMessageWithLevel("FlatProfiler Roots", Level.FINEST), - new LogMessageWithLevel("Management Roots", Level.FINEST), - new LogMessageWithLevel("SystemDictionary Roots", Level.FINEST), - new LogMessageWithLevel("CLDG Roots", Level.FINEST), - new LogMessageWithLevel("JVMTI Roots", Level.FINEST), - new LogMessageWithLevel("SATB Filtering", Level.FINEST), - new LogMessageWithLevel("CM RefProcessor Roots", Level.FINEST), - new LogMessageWithLevel("Wait For Strong CLD", Level.FINEST), - new LogMessageWithLevel("Weak CLD Roots", Level.FINEST), + new LogMessageWithLevel("Thread Roots:", Level.DEBUG), + new LogMessageWithLevel("StringTable Roots:", Level.DEBUG), + new LogMessageWithLevel("Universe Roots:", Level.DEBUG), + new LogMessageWithLevel("JNI Handles Roots:", Level.DEBUG), + new LogMessageWithLevel("ObjectSynchronizer Roots:", Level.DEBUG), + new LogMessageWithLevel("FlatProfiler Roots", Level.DEBUG), + new LogMessageWithLevel("Management Roots", Level.DEBUG), + new LogMessageWithLevel("SystemDictionary Roots", Level.DEBUG), + new LogMessageWithLevel("CLDG Roots", Level.DEBUG), + new LogMessageWithLevel("JVMTI Roots", Level.DEBUG), + new LogMessageWithLevel("SATB Filtering", Level.DEBUG), + new LogMessageWithLevel("CM RefProcessor Roots", Level.DEBUG), + new LogMessageWithLevel("Wait For Strong CLD", Level.DEBUG), + new LogMessageWithLevel("Weak CLD Roots", Level.DEBUG), // Redirty Cards - new LogMessageWithLevel("Redirty Cards", Level.FINER), - new LogMessageWithLevel("Parallel Redirty", Level.FINEST), - new LogMessageWithLevel("Redirtied Cards", Level.FINEST), + new LogMessageWithLevel("Redirty Cards", Level.DEBUG), + new LogMessageWithLevel("Parallel Redirty", Level.DEBUG), + new LogMessageWithLevel("Redirtied Cards", Level.DEBUG), // Misc Top-level - new LogMessageWithLevel("Code Root Purge", Level.FINER), - new LogMessageWithLevel("String Dedup Fixup", Level.FINER), - new LogMessageWithLevel("Expand Heap After Collection", Level.FINER), + new LogMessageWithLevel("Code Root Purge", Level.DEBUG), + new LogMessageWithLevel("String Dedup Fixup", Level.DEBUG), + new LogMessageWithLevel("Expand Heap After Collection", Level.DEBUG), // Free CSet - new LogMessageWithLevel("Young Free CSet", Level.FINEST), - new LogMessageWithLevel("Non-Young Free CSet", Level.FINEST), + new LogMessageWithLevel("Young Free CSet", Level.TRACE), + new LogMessageWithLevel("Non-Young Free CSet", Level.TRACE), // Humongous Eager Reclaim - new LogMessageWithLevel("Humongous Reclaim", Level.FINER), - new LogMessageWithLevel("Humongous Register", Level.FINER), + new LogMessageWithLevel("Humongous Reclaim", Level.DEBUG), + new LogMessageWithLevel("Humongous Register", Level.DEBUG), }; void checkMessagesAtLevel(OutputAnalyzer output, LogMessageWithLevel messages[], Level level) throws Exception { @@ -116,53 +116,49 @@ public class TestGCLogMessages { pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-XX:+UseStringDeduplication", "-Xmx10M", - "-XX:+PrintGCDetails", + "-Xlog:gc+phases=debug", GCTest.class.getName()); output = new OutputAnalyzer(pb.start()); - checkMessagesAtLevel(output, allLogMessages, Level.FINER); + checkMessagesAtLevel(output, allLogMessages, Level.DEBUG); pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-XX:+UseStringDeduplication", "-Xmx10M", - "-XX:+PrintGCDetails", - "-XX:+UnlockExperimentalVMOptions", - "-XX:G1LogLevel=finest", + "-Xlog:gc+phases=trace", GCTest.class.getName()); output = new OutputAnalyzer(pb.start()); - checkMessagesAtLevel(output, allLogMessages, Level.FINEST); + checkMessagesAtLevel(output, allLogMessages, Level.TRACE); output.shouldHaveExitValue(0); } LogMessageWithLevel exhFailureMessages[] = new LogMessageWithLevel[] { - new LogMessageWithLevel("Evacuation Failure", Level.FINER), - new LogMessageWithLevel("Recalculate Used", Level.FINEST), - new LogMessageWithLevel("Remove Self Forwards", Level.FINEST), - new LogMessageWithLevel("Restore RemSet", Level.FINEST), + new LogMessageWithLevel("Evacuation Failure", Level.DEBUG), + new LogMessageWithLevel("Recalculate Used", Level.TRACE), + new LogMessageWithLevel("Remove Self Forwards", Level.TRACE), + new LogMessageWithLevel("Restore RemSet", Level.TRACE), }; private void testWithToSpaceExhaustionLogs() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-Xmx32M", "-Xmn16M", - "-XX:+PrintGCDetails", + "-Xlog:gc+phases=debug", GCTestWithToSpaceExhaustion.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - checkMessagesAtLevel(output, exhFailureMessages, Level.FINER); + checkMessagesAtLevel(output, exhFailureMessages, Level.DEBUG); output.shouldHaveExitValue(0); pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-Xmx32M", "-Xmn16M", - "-XX:+PrintGCDetails", - "-XX:+UnlockExperimentalVMOptions", - "-XX:G1LogLevel=finest", + "-Xlog:gc+phases=trace", GCTestWithToSpaceExhaustion.class.getName()); output = new OutputAnalyzer(pb.start()); - checkMessagesAtLevel(output, exhFailureMessages, Level.FINEST); + checkMessagesAtLevel(output, exhFailureMessages, Level.TRACE); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java b/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java index 120c0d85ca6..ef0109679ef 100644 --- a/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java +++ b/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java @@ -46,11 +46,11 @@ public class TestHumongousAllocInitialMark { "-Xmx" + heapSize + "m", "-XX:G1HeapRegionSize=" + heapRegionSize + "m", "-XX:InitiatingHeapOccupancyPercent=" + initiatingHeapOccupancyPercent, - "-XX:+PrintGC", + "-Xlog:gc", HumongousObjectAllocator.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("GC pause (G1 Humongous Allocation) (young) (initial-mark)"); + output.shouldContain("Pause Initial Mark (G1 Humongous Allocation)"); output.shouldNotContain("Full GC"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/g1/TestHumongousAllocNearlyFullRegion.java b/hotspot/test/gc/g1/TestHumongousAllocNearlyFullRegion.java index 2e5a470f18d..2173dbdb9f4 100644 --- a/hotspot/test/gc/g1/TestHumongousAllocNearlyFullRegion.java +++ b/hotspot/test/gc/g1/TestHumongousAllocNearlyFullRegion.java @@ -44,11 +44,11 @@ public class TestHumongousAllocNearlyFullRegion { "-Xms" + heapSize + "m", "-Xmx" + heapSize + "m", "-XX:G1HeapRegionSize=" + heapRegionSize + "m", - "-XX:+PrintGC", + "-Xlog:gc", HumongousObjectAllocator.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("GC pause (G1 Humongous Allocation) (young) (initial-mark)"); + output.shouldContain("Pause Initial Mark (G1 Humongous Allocation)"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/g1/TestNoEagerReclaimOfHumongousRegions.java b/hotspot/test/gc/g1/TestNoEagerReclaimOfHumongousRegions.java index 7d505d5ae5c..5090309c7f9 100644 --- a/hotspot/test/gc/g1/TestNoEagerReclaimOfHumongousRegions.java +++ b/hotspot/test/gc/g1/TestNoEagerReclaimOfHumongousRegions.java @@ -34,7 +34,7 @@ * @build TestNoEagerReclaimOfHumongousRegions * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+PrintGC -XX:+UseG1GC -XX:MaxTenuringThreshold=0 -XX:G1RSetSparseRegionEntries=32 -XX:G1HeapRegionSize=1m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+G1TraceEagerReclaimHumongousObjects TestNoEagerReclaimOfHumongousRegions + * @run main/othervm -Xbootclasspath/a:. -Xlog:gc,gc+humongous=debug -XX:+UseG1GC -XX:MaxTenuringThreshold=0 -XX:G1RSetSparseRegionEntries=32 -XX:G1HeapRegionSize=1m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI TestNoEagerReclaimOfHumongousRegions */ import java.util.LinkedList; diff --git a/hotspot/test/gc/g1/TestPLABOutput.java b/hotspot/test/gc/g1/TestPLABOutput.java index 7c60731d4f1..44c99b928c2 100644 --- a/hotspot/test/gc/g1/TestPLABOutput.java +++ b/hotspot/test/gc/g1/TestPLABOutput.java @@ -54,8 +54,7 @@ public class TestPLABOutput { "-XX:+WhiteBoxAPI", "-XX:+UseG1GC", "-Xmx10M", - "-XX:+PrintGC", - "-XX:+PrintPLAB", + "-Xlog:gc+plab=debug", GCTest.class.getName() }; @@ -66,7 +65,7 @@ public class TestPLABOutput { System.out.println(output.getStdout()); - String pattern = "#0:.*allocated = (\\d+).*"; + String pattern = ".*GC\\(0\\) .*allocated = (\\d+).*"; Pattern r = Pattern.compile(pattern); Matcher m = r.matcher(output.getStdout()); diff --git a/hotspot/test/gc/g1/TestPrintGCDetails.java b/hotspot/test/gc/g1/TestPrintGCDetails.java deleted file mode 100644 index e6572b908af..00000000000 --- a/hotspot/test/gc/g1/TestPrintGCDetails.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 - * 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 TestPrintGCDetails - * @bug 8010738 - * @summary Ensure that the PrintGCDetails for a full GC with G1 includes Metaspace. - * @key gc - * @key regression - * @library /testlibrary - * @modules java.base/sun.misc - * java.management - */ - -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; - -public class TestPrintGCDetails { - public static void main(String[] args) throws Exception { - - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:+PrintGCDetails", - SystemGCTest.class.getName()); - - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - - System.out.println("Output:\n" + output.getOutput()); - - output.shouldContain("Metaspace"); - output.shouldHaveExitValue(0); - } - - static class SystemGCTest { - public static void main(String [] args) { - System.out.println("Calling System.gc()"); - System.gc(); - } - } -} diff --git a/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java b/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java index c319416514c..7d51fb6a97b 100644 --- a/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java +++ b/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java @@ -57,7 +57,6 @@ public class TestPrintRegionRememberedSetInfo { "-Xmx10m", "-XX:+ExplicitGCInvokesConcurrent", "-XX:+UnlockDiagnosticVMOptions", - "-XX:+G1PrintRegionLivenessInfo", "-XX:G1HeapRegionSize=1M", "-XX:InitiatingHeapOccupancyPercent=0", }; @@ -79,13 +78,13 @@ public class TestPrintRegionRememberedSetInfo { public static void main(String[] args) throws Exception { String result; - result = runTest("-XX:+G1PrintRegionLivenessInfo"); + result = runTest("-Xlog:gc+liveness=trace"); // check that we got region statistics output if (result.indexOf("PHASE") == -1) { throw new RuntimeException("Unexpected output from -XX:+PrintRegionLivenessInfo found."); } - result = runTest("-XX:-G1PrintRegionLivenessInfo"); + result = runTest("-Xlog:gc+liveness"); if (result.indexOf("remset") != -1) { throw new RuntimeException("Should find remembered set information in output."); } diff --git a/hotspot/test/gc/g1/TestRemsetLogging.java b/hotspot/test/gc/g1/TestRemsetLogging.java new file mode 100644 index 00000000000..a03b8b9c45d --- /dev/null +++ b/hotspot/test/gc/g1/TestRemsetLogging.java @@ -0,0 +1,87 @@ +/* + * 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 + * 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 TestRemsetLogging.java + * @bug 8013895 8129977 + * @library /testlibrary + * @modules java.base/sun.misc + * java.management/sun.management + * @build TestRemsetLoggingTools TestRemsetLogging + * @summary Verify output of -Xlog:gc+remset*=trace + * @run main TestRemsetLogging + * + * Test the output of -Xlog:gc+remset*=trace in conjunction with G1SummarizeRSetStatsPeriod. + */ + +public class TestRemsetLogging { + + public static void main(String[] args) throws Exception { + String result; + + if (!TestRemsetLoggingTools.testingG1GC()) { + return; + } + + // no remembered set summary output + result = TestRemsetLoggingTools.runTest(null, 0); + TestRemsetLoggingTools.expectRSetSummaries(result, 0, 0); + + // no remembered set summary output + result = TestRemsetLoggingTools.runTest(null, 2); + TestRemsetLoggingTools.expectRSetSummaries(result, 0, 0); + + // no remembered set summary output + result = TestRemsetLoggingTools.runTest(new String[] { "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); + TestRemsetLoggingTools.expectRSetSummaries(result, 0, 0); + + // single remembered set summary output at the end + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace" }, 0); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 0); + + // single remembered set summary output at the end + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace" }, 2); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 0); + + // single remembered set summary output + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace", "-XX:G1SummarizeRSetStatsPeriod=1" }, 0); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 0); + + // two times remembered set summary output + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 2); + + // four times remembered set summary output + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace", "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 6); + + // three times remembered set summary output + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace", "-XX:G1SummarizeRSetStatsPeriod=2" }, 3); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 4); + + // single remembered set summary output + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace", "-XX:G1SummarizeRSetStatsPeriod=100" }, 3); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 2); + } +} + diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java b/hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java similarity index 66% rename from hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java rename to hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java index 78ec6544d07..e61c181f5f7 100644 --- a/hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java +++ b/hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java @@ -22,14 +22,14 @@ */ /* - * @test TestSummarizeRSetStatsPerRegion.java + * @test TestRemsetLoggingPerRegion.java * @bug 8014078 8129977 * @library /testlibrary * @modules java.base/sun.misc * java.management/sun.management - * @build TestSummarizeRSetStatsTools TestSummarizeRSetStatsPerRegion - * @summary Verify output of -XX:+G1SummarizeRSetStats in regards to per-region type output - * @run main TestSummarizeRSetStatsPerRegion + * @build TestRemsetLoggingTools TestRemsetLoggingPerRegion + * @summary Verify output of -Xlog:gc+remset*=trace in regards to per-region type output + * @run main TestRemsetLoggingPerRegion */ import jdk.test.lib.*; @@ -37,21 +37,21 @@ import java.lang.Thread; import java.util.ArrayList; import java.util.Arrays; -public class TestSummarizeRSetStatsPerRegion { +public class TestRemsetLoggingPerRegion { public static void main(String[] args) throws Exception { String result; - if (!TestSummarizeRSetStatsTools.testingG1GC()) { + if (!TestRemsetLoggingTools.testingG1GC()) { return; } // single remembered set summary output at the end - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 0); - TestSummarizeRSetStatsTools.expectPerRegionRSetSummaries(result, 1, 0); + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace" }, 0); + TestRemsetLoggingTools.expectPerRegionRSetSummaries(result, 1, 0); // two times remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1); - TestSummarizeRSetStatsTools.expectPerRegionRSetSummaries(result, 1, 2); + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1); + TestRemsetLoggingTools.expectPerRegionRSetSummaries(result, 1, 2); } } diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java b/hotspot/test/gc/g1/TestRemsetLoggingThreads.java similarity index 83% rename from hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java rename to hotspot/test/gc/g1/TestRemsetLoggingThreads.java index 0743d66e404..12362a472e2 100644 --- a/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java +++ b/hotspot/test/gc/g1/TestRemsetLoggingThreads.java @@ -22,7 +22,7 @@ */ /* - * @test TestSummarizeRSetStatsThreads + * @test TestRemsetLoggingThreads * @bug 8025441 * @summary Ensure that various values of worker threads/concurrent * refinement threads do not crash the VM. @@ -38,29 +38,23 @@ import java.util.regex.Pattern; import jdk.test.lib.ProcessTools; import jdk.test.lib.OutputAnalyzer; -public class TestSummarizeRSetStatsThreads { +public class TestRemsetLoggingThreads { private static void runTest(int refinementThreads, int workerThreads) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-XX:+UnlockDiagnosticVMOptions", - "-XX:+G1SummarizeRSetStats", + "-Xlog:gc+remset+exit=trace", "-XX:G1ConcRefinementThreads=" + refinementThreads, "-XX:ParallelGCThreads=" + workerThreads, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - // check output to contain the string "Concurrent RS threads times (s)" followed by - // the correct number of values in the next line. - // a zero in refinement thread numbers indicates that the value in ParallelGCThreads should be used. // Additionally use at least one thread. int expectedNumRefinementThreads = refinementThreads; - // create the pattern made up of n copies of a floating point number pattern - String numberPattern = String.format("%0" + expectedNumRefinementThreads + "d", 0) - .replace("0", "\\s+\\d+\\.\\d+"); - String pattern = "Concurrent RS threads times \\(s\\)$" + numberPattern + "$"; + String pattern = "Concurrent RS threads times \\(s\\)$"; Matcher m = Pattern.compile(pattern, Pattern.MULTILINE).matcher(output.getStdout()); if (!m.find()) { @@ -71,7 +65,7 @@ public class TestSummarizeRSetStatsThreads { } public static void main(String[] args) throws Exception { - if (!TestSummarizeRSetStatsTools.testingG1GC()) { + if (!TestRemsetLoggingTools.testingG1GC()) { return; } // different valid combinations of number of refinement and gc worker threads diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java b/hotspot/test/gc/g1/TestRemsetLoggingTools.java similarity index 97% rename from hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java rename to hotspot/test/gc/g1/TestRemsetLoggingTools.java index 648a5cd08f0..24ba4048ff5 100644 --- a/hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java +++ b/hotspot/test/gc/g1/TestRemsetLoggingTools.java @@ -22,7 +22,7 @@ */ /* - * Common helpers for TestSummarizeRSetStats* tests + * Common helpers for TestRemsetLogging* tests */ import com.sun.management.HotSpotDiagnosticMXBean; @@ -67,7 +67,7 @@ class VerifySummaryOutput { } } -public class TestSummarizeRSetStatsTools { +public class TestRemsetLoggingTools { // the VM is currently run using G1GC, i.e. trying to test G1 functionality. public static boolean testingG1GC() { @@ -90,7 +90,6 @@ public class TestSummarizeRSetStatsTools { "-Xms20m", "-Xmx20m", "-XX:InitiatingHeapOccupancyPercent=100", // we don't want the additional GCs due to initial marking - "-XX:+PrintGC", "-XX:+UnlockDiagnosticVMOptions", "-XX:G1HeapRegionSize=1M", }; diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java index 069ee189da1..65247c6edf4 100644 --- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java +++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java @@ -49,7 +49,7 @@ public class TestShrinkAuxiliaryData { "-XX:+UseG1GC", "-XX:G1HeapRegionSize=" + REGION_SIZE, "-XX:-ExplicitGCInvokesConcurrent", - "-XX:+PrintGCDetails", + "-Xlog:gc=debug", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-Xbootclasspath/a:.", diff --git a/hotspot/test/gc/g1/TestStringDeduplicationTools.java b/hotspot/test/gc/g1/TestStringDeduplicationTools.java index 583b7545b20..3e725f78132 100644 --- a/hotspot/test/gc/g1/TestStringDeduplicationTools.java +++ b/hotspot/test/gc/g1/TestStringDeduplicationTools.java @@ -304,10 +304,8 @@ class TestStringDeduplicationTools { } public static OutputAnalyzer run() throws Exception { - return runTest("-XX:+PrintGC", - "-XX:+PrintGCDetails", + return runTest("-Xlog:gc=debug,gc+stringdedup=trace", "-XX:+UseStringDeduplication", - "-XX:+PrintStringDeduplicationStatistics", "-XX:StringDeduplicationAgeThreshold=" + DefaultAgeThreshold, InternedTest.class.getName(), "" + DefaultAgeThreshold); @@ -333,11 +331,10 @@ class TestStringDeduplicationTools { OutputAnalyzer output = DeduplicationTest.run(LargeNumberOfStrings, DefaultAgeThreshold, YoungGC, - "-XX:+PrintGC", - "-XX:+PrintStringDeduplicationStatistics"); + "-Xlog:gc,gc+stringdedup=trace"); output.shouldNotContain("Full GC"); - output.shouldContain("GC pause (G1 Evacuation Pause) (young)"); - output.shouldContain("GC concurrent-string-deduplication"); + output.shouldContain("Pause Young (G1 Evacuation Pause)"); + output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); output.shouldHaveExitValue(0); } @@ -347,11 +344,10 @@ class TestStringDeduplicationTools { OutputAnalyzer output = DeduplicationTest.run(LargeNumberOfStrings, DefaultAgeThreshold, FullGC, - "-XX:+PrintGC", - "-XX:+PrintStringDeduplicationStatistics"); - output.shouldNotContain("GC pause (G1 Evacuation Pause) (young)"); + "-Xlog:gc,gc+stringdedup=trace"); + output.shouldNotContain("Pause Young (G1 Evacuation Pause)"); output.shouldContain("Full GC"); - output.shouldContain("GC concurrent-string-deduplication"); + output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); output.shouldHaveExitValue(0); } @@ -361,10 +357,9 @@ class TestStringDeduplicationTools { OutputAnalyzer output = DeduplicationTest.run(LargeNumberOfStrings, DefaultAgeThreshold, YoungGC, - "-XX:+PrintGC", - "-XX:+PrintStringDeduplicationStatistics", + "-Xlog:gc,gc+stringdedup=trace", "-XX:+StringDeduplicationResizeALot"); - output.shouldContain("GC concurrent-string-deduplication"); + output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); output.shouldNotContain("Resize Count: 0"); output.shouldHaveExitValue(0); @@ -375,10 +370,9 @@ class TestStringDeduplicationTools { OutputAnalyzer output = DeduplicationTest.run(LargeNumberOfStrings, DefaultAgeThreshold, YoungGC, - "-XX:+PrintGC", - "-XX:+PrintStringDeduplicationStatistics", + "-Xlog:gc,gc+stringdedup=trace", "-XX:+StringDeduplicationRehashALot"); - output.shouldContain("GC concurrent-string-deduplication"); + output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); output.shouldNotContain("Rehash Count: 0"); output.shouldNotContain("Hash Seed: 0x0"); @@ -392,9 +386,8 @@ class TestStringDeduplicationTools { output = DeduplicationTest.run(SmallNumberOfStrings, MaxAgeThreshold, YoungGC, - "-XX:+PrintGC", - "-XX:+PrintStringDeduplicationStatistics"); - output.shouldContain("GC concurrent-string-deduplication"); + "-Xlog:gc,gc+stringdedup=trace"); + output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); output.shouldHaveExitValue(0); @@ -402,9 +395,8 @@ class TestStringDeduplicationTools { output = DeduplicationTest.run(SmallNumberOfStrings, MinAgeThreshold, YoungGC, - "-XX:+PrintGC", - "-XX:+PrintStringDeduplicationStatistics"); - output.shouldContain("GC concurrent-string-deduplication"); + "-Xlog:gc,gc+stringdedup=trace"); + output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); output.shouldHaveExitValue(0); @@ -426,20 +418,20 @@ class TestStringDeduplicationTools { public static void testPrintOptions() throws Exception { OutputAnalyzer output; - // Test without PrintGC and without PrintStringDeduplicationStatistics + // Test without -Xlog:gc output = DeduplicationTest.run(SmallNumberOfStrings, DefaultAgeThreshold, YoungGC); - output.shouldNotContain("GC concurrent-string-deduplication"); + output.shouldNotContain("Concurrent String Deduplication"); output.shouldNotContain("Deduplicated:"); output.shouldHaveExitValue(0); - // Test with PrintGC but without PrintStringDeduplicationStatistics + // Test with -Xlog:gc+stringdedup output = DeduplicationTest.run(SmallNumberOfStrings, DefaultAgeThreshold, YoungGC, - "-XX:+PrintGC"); - output.shouldContain("GC concurrent-string-deduplication"); + "-Xlog:gc+stringdedup"); + output.shouldContain("Concurrent String Deduplication"); output.shouldNotContain("Deduplicated:"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/g1/TestStringSymbolTableStats.java b/hotspot/test/gc/g1/TestStringSymbolTableStats.java index aeef3f742cb..f50bcf3e73f 100644 --- a/hotspot/test/gc/g1/TestStringSymbolTableStats.java +++ b/hotspot/test/gc/g1/TestStringSymbolTableStats.java @@ -39,7 +39,7 @@ public class TestStringSymbolTableStats { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-XX:+UnlockExperimentalVMOptions", - "-XX:+G1TraceStringSymbolTableScrubbing", + "-Xlog:gc+stringdedup=trace", SystemGCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStats.java b/hotspot/test/gc/g1/TestSummarizeRSetStats.java deleted file mode 100644 index 577c48c99cd..00000000000 --- a/hotspot/test/gc/g1/TestSummarizeRSetStats.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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 - * 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 TestSummarizeRSetStats.java - * @bug 8013895 8129977 - * @library /testlibrary - * @modules java.base/sun.misc - * java.management/sun.management - * @build TestSummarizeRSetStatsTools TestSummarizeRSetStats - * @summary Verify output of -XX:+G1SummarizeRSetStats - * @run main TestSummarizeRSetStats - * - * Test the output of G1SummarizeRSetStats in conjunction with G1SummarizeRSetStatsPeriod. - */ - -public class TestSummarizeRSetStats { - - public static void main(String[] args) throws Exception { - String result; - - if (!TestSummarizeRSetStatsTools.testingG1GC()) { - return; - } - - // no remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(null, 0); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); - - // no remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(null, 2); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); - - // no remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); - - // single remembered set summary output at the end - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 0); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); - - // single remembered set summary output at the end - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 2); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); - - // single remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 0); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); - - // two times remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 2); - - // four times remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 6); - - // three times remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=2" }, 3); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 4); - - // single remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=100" }, 3); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 2); - } -} - diff --git a/hotspot/test/gc/g1/mixedgc/TestLogging.java b/hotspot/test/gc/g1/mixedgc/TestLogging.java index 7e1ce49e642..913097d50ae 100644 --- a/hotspot/test/gc/g1/mixedgc/TestLogging.java +++ b/hotspot/test/gc/g1/mixedgc/TestLogging.java @@ -68,10 +68,10 @@ public class TestLogging { public static final int ALLOCATION_COUNT = 15; public static void main(String args[]) throws Exception { - // Test turns logging on by giving -XX:+PrintGC flag - test("-XX:+PrintGC"); - // Test turns logging on by giving -XX:+PrintGCDetails - test("-XX:+PrintGCDetails"); + // Test turns logging on by giving -Xlog:gc flag + test("-Xlog:gc"); + // Test turns logging on by giving -Xlog:gc=debug flag + test("-Xlog:gc=debug"); } private static void test(String vmFlag) throws Exception { @@ -79,7 +79,7 @@ public class TestLogging { OutputAnalyzer output = spawnMixedGCProvoker(vmFlag); System.out.println(output.getStdout()); output.shouldHaveExitValue(0); - output.shouldContain("GC pause (G1 Evacuation Pause) (mixed)"); + output.shouldContain("Pause Mixed (G1 Evacuation Pause)"); } /** diff --git a/hotspot/test/gc/logging/TestGCId.java b/hotspot/test/gc/logging/TestGCId.java index 976ab8ab958..5204d914f20 100644 --- a/hotspot/test/gc/logging/TestGCId.java +++ b/hotspot/test/gc/logging/TestGCId.java @@ -36,44 +36,21 @@ import jdk.test.lib.OutputAnalyzer; public class TestGCId { public static void main(String[] args) throws Exception { - testGCId("UseParallelGC", "PrintGC"); - testGCId("UseParallelGC", "PrintGCDetails"); - - testGCId("UseG1GC", "PrintGC"); - testGCId("UseG1GC", "PrintGCDetails"); - - testGCId("UseConcMarkSweepGC", "PrintGC"); - testGCId("UseConcMarkSweepGC", "PrintGCDetails"); - - testGCId("UseSerialGC", "PrintGC"); - testGCId("UseSerialGC", "PrintGCDetails"); + testGCId("UseParallelGC"); + testGCId("UseG1GC"); + testGCId("UseConcMarkSweepGC"); + testGCId("UseSerialGC"); } private static void verifyContainsGCIDs(OutputAnalyzer output) { - output.shouldMatch("^#0: \\["); - output.shouldMatch("^#1: \\["); + output.shouldMatch("\\[.*\\]\\[.*\\]\\[.*\\] GC\\(0\\) "); + output.shouldMatch("\\[.*\\]\\[.*\\]\\[.*\\] GC\\(1\\) "); output.shouldHaveExitValue(0); } - private static void verifyContainsNoGCIDs(OutputAnalyzer output) { - output.shouldNotMatch("^#[0-9]+: \\["); - output.shouldHaveExitValue(0); - } - - private static void testGCId(String gcFlag, String logFlag) throws Exception { - // GCID logging enabled - ProcessBuilder pb_enabled = - ProcessTools.createJavaProcessBuilder("-XX:+" + gcFlag, "-XX:+" + logFlag, "-Xmx10M", "-XX:+PrintGCID", GCTest.class.getName()); - verifyContainsGCIDs(new OutputAnalyzer(pb_enabled.start())); - - // GCID logging disabled - ProcessBuilder pb_disabled = - ProcessTools.createJavaProcessBuilder("-XX:+" + gcFlag, "-XX:+" + logFlag, "-Xmx10M", "-XX:-PrintGCID", GCTest.class.getName()); - verifyContainsNoGCIDs(new OutputAnalyzer(pb_disabled.start())); - - // GCID logging default + private static void testGCId(String gcFlag) throws Exception { ProcessBuilder pb_default = - ProcessTools.createJavaProcessBuilder("-XX:+" + gcFlag, "-XX:+" + logFlag, "-Xmx10M", GCTest.class.getName()); + ProcessTools.createJavaProcessBuilder("-XX:+" + gcFlag, "-Xlog:gc", "-Xmx10M", GCTest.class.getName()); verifyContainsGCIDs(new OutputAnalyzer(pb_default.start())); } diff --git a/hotspot/test/gc/logging/TestPrintReferences.java b/hotspot/test/gc/logging/TestPrintReferences.java index 65485708f3f..b8b94cd04be 100644 --- a/hotspot/test/gc/logging/TestPrintReferences.java +++ b/hotspot/test/gc/logging/TestPrintReferences.java @@ -37,18 +37,18 @@ import jdk.test.lib.OutputAnalyzer; public class TestPrintReferences { public static void main(String[] args) throws Exception { ProcessBuilder pb_enabled = - ProcessTools.createJavaProcessBuilder("-XX:+PrintGCDetails", "-XX:+PrintReferenceGC", "-Xmx10M", GCTest.class.getName()); + ProcessTools.createJavaProcessBuilder("-Xlog:gc+ref=debug", "-Xmx10M", GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb_enabled.start()); String countRegex = "[0-9]+ refs"; - String timeRegex = "[0-9]+[.,][0-9]+ secs"; + String timeRegex = "\\([0-9]+[.,][0-9]+s, [0-9]+[.,][0-9]+s\\) [0-9]+[.,][0-9]+ms"; - output.shouldMatch( - "#[0-9]+: \\[SoftReference, " + countRegex + ", " + timeRegex + "\\]" + - "#[0-9]+: \\[WeakReference, " + countRegex + ", " + timeRegex + "\\]" + - "#[0-9]+: \\[FinalReference, " + countRegex + ", " + timeRegex + "\\]" + - "#[0-9]+: \\[PhantomReference, " + countRegex + ", " + timeRegex + "\\]" + - "#[0-9]+: \\[JNI Weak Reference, (" + countRegex + ", )?" + timeRegex + "\\]"); + output.shouldMatch(".* GC\\([0-9]+\\) SoftReference " + timeRegex + "\n" + + ".* GC\\([0-9]+\\) WeakReference " + timeRegex + "\n" + + ".* GC\\([0-9]+\\) FinalReference " + timeRegex + "\n" + + ".* GC\\([0-9]+\\) PhantomReference " + timeRegex + "\n" + + ".* GC\\([0-9]+\\) JNI Weak Reference " + timeRegex + "\n" + + ".* GC\\([0-9]+\\) Ref Counts: Soft: [0-9]+ Weak: [0-9]+ Final: [0-9]+ Phantom: [0-9]+\n"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/serial/HeapChangeLogging.java b/hotspot/test/gc/serial/HeapChangeLogging.java index ff4555c23ba..27823a320ec 100644 --- a/hotspot/test/gc/serial/HeapChangeLogging.java +++ b/hotspot/test/gc/serial/HeapChangeLogging.java @@ -39,11 +39,11 @@ import jdk.test.lib.*; public class HeapChangeLogging { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128m", "-Xmn100m", "-XX:+UseSerialGC", "-XX:+PrintGC", "HeapFiller"); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128m", "-Xmn100m", "-XX:+UseSerialGC", "-Xlog:gc", "HeapFiller"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); String stdout = output.getStdout(); System.out.println(stdout); - Matcher stdoutMatcher = Pattern.compile("\\[GC .Allocation Failure.*K->.*K\\(.*K\\), .* secs\\]", Pattern.MULTILINE).matcher(stdout); + Matcher stdoutMatcher = Pattern.compile(".*\\(Allocation Failure\\) [0-9]+[KMG]->[0-9]+[KMG]\\([0-9]+[KMG]\\)", Pattern.MULTILINE).matcher(stdout); if (!stdoutMatcher.find()) { throw new RuntimeException("No proper GC log line found"); } diff --git a/hotspot/test/gc/whitebox/TestWBGC.java b/hotspot/test/gc/whitebox/TestWBGC.java index 707edbd8386..509456a2860 100644 --- a/hotspot/test/gc/whitebox/TestWBGC.java +++ b/hotspot/test/gc/whitebox/TestWBGC.java @@ -44,7 +44,7 @@ public class TestWBGC { "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-XX:MaxTenuringThreshold=1", - "-XX:+PrintGC", + "-Xlog:gc", GCYoungTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/hotspot/test/runtime/7158988/FieldMonitor.java b/hotspot/test/runtime/7158988/FieldMonitor.java index 231884ece03..42b82768530 100644 --- a/hotspot/test/runtime/7158988/FieldMonitor.java +++ b/hotspot/test/runtime/7158988/FieldMonitor.java @@ -63,7 +63,7 @@ public class FieldMonitor { public static final String CLASS_NAME = "TestPostFieldModification"; public static final String FIELD_NAME = "value"; - public static final String ARGUMENTS = "-Xshare:off -XX:+PrintGC"; + public static final String ARGUMENTS = "-Xshare:off -Xlog:gc"; public static void main(String[] args) throws IOException, InterruptedException { diff --git a/hotspot/test/runtime/CommandLine/PrintGCApplicationConcurrentTime.java b/hotspot/test/runtime/CommandLine/PrintGCApplicationConcurrentTime.java index e6cf34962a4..2e68f07140f 100644 --- a/hotspot/test/runtime/CommandLine/PrintGCApplicationConcurrentTime.java +++ b/hotspot/test/runtime/CommandLine/PrintGCApplicationConcurrentTime.java @@ -24,7 +24,7 @@ /* * @test * @bug 8026041 - * @run main/othervm -XX:+PrintGCApplicationConcurrentTime -Xcomp PrintGCApplicationConcurrentTime + * @run main/othervm -Xlog:safepoint -Xcomp PrintGCApplicationConcurrentTime */ public class PrintGCApplicationConcurrentTime { diff --git a/hotspot/test/runtime/CommandLine/TestVMOptions.java b/hotspot/test/runtime/CommandLine/TestVMOptions.java index 36bfd5d5f9f..a725fa7704d 100644 --- a/hotspot/test/runtime/CommandLine/TestVMOptions.java +++ b/hotspot/test/runtime/CommandLine/TestVMOptions.java @@ -41,7 +41,7 @@ public class TestVMOptions { "-XX:+IgnoreUnrecognizedVMOptions", "-XX:+PrintFlagsInitial"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("bool PrintGCDetails"); + output.shouldContain("bool UseSerialGC"); pb = ProcessTools.createJavaProcessBuilder( "-XX:-PrintVMOptions", "-version"); diff --git a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java index 12afc40c37d..54616e4b176 100644 --- a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java +++ b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java @@ -39,7 +39,7 @@ public class CompressedClassPointers { "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedBaseAddress=8g", "-Xmx128m", - "-XX:+PrintCompressedOopsMode", + "-Xlog:gc+metaspace=trace", "-XX:+VerifyBeforeGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Narrow klass base: 0x0000000000000000"); @@ -51,7 +51,7 @@ public class CompressedClassPointers { "-XX:+UnlockDiagnosticVMOptions", "-XX:CompressedClassSpaceSize=3g", "-Xmx128m", - "-XX:+PrintCompressedOopsMode", + "-Xlog:gc+metaspace=trace", "-XX:+VerifyBeforeGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Narrow klass base: 0x0000000000000000, Narrow klass shift: 3"); @@ -62,7 +62,7 @@ public class CompressedClassPointers { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx30g", - "-XX:+PrintCompressedOopsMode", + "-Xlog:gc+metaspace=trace", "-XX:+VerifyBeforeGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Narrow klass base: 0x0000000000000000"); @@ -75,7 +75,7 @@ public class CompressedClassPointers { "-XX:+UnlockDiagnosticVMOptions", "-Xmx128m", "-XX:+UseLargePages", - "-XX:+PrintCompressedOopsMode", + "-Xlog:gc+metaspace=trace", "-XX:+VerifyBeforeGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Narrow klass base:"); diff --git a/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java b/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java index bf7eed4fc95..5192c3b4c99 100644 --- a/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java +++ b/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java @@ -64,7 +64,7 @@ public class CompressedClassSpaceSize { // Make sure the minimum size is set correctly and printed pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:CompressedClassSpaceSize=1m", - "-XX:+PrintCompressedOopsMode", + "-Xlog:gc+metaspace=trace", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Compressed class space size: 1048576") @@ -74,7 +74,7 @@ public class CompressedClassSpaceSize { // Make sure the maximum size is set correctly and printed pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:CompressedClassSpaceSize=3g", - "-XX:+PrintCompressedOopsMode", + "-Xlog:gc+metaspace=trace", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Compressed class space size: 3221225472") diff --git a/hotspot/test/serviceability/dcmd/gc/RunGCTest.java b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java index 8746f7f26d6..acb1f9c57d4 100644 --- a/hotspot/test/serviceability/dcmd/gc/RunGCTest.java +++ b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java @@ -43,7 +43,7 @@ import jdk.test.lib.dcmd.JMXExecutor; * jdk.jvmstat/sun.jvmstat.monitor * @build jdk.test.lib.* * @build jdk.test.lib.dcmd.* - * @run testng/othervm -XX:+PrintGCDetails -Xloggc:RunGC.gclog -XX:-ExplicitGCInvokesConcurrent RunGCTest + * @run testng/othervm -Xlog:gc=debug:RunGC.gclog -XX:-ExplicitGCInvokesConcurrent RunGCTest */ public class RunGCTest { public void run(CommandExecutor executor) { @@ -59,7 +59,7 @@ public class RunGCTest { } OutputAnalyzer output = new OutputAnalyzer(gcLog, ""); - output.shouldContain("[Full GC (Diagnostic Command)"); + output.shouldContain("Pause Full (Diagnostic Command)"); } @Test diff --git a/hotspot/test/serviceability/dcmd/vm/FlagsTest.java b/hotspot/test/serviceability/dcmd/vm/FlagsTest.java index cd4c021854f..69d2771f2eb 100644 --- a/hotspot/test/serviceability/dcmd/vm/FlagsTest.java +++ b/hotspot/test/serviceability/dcmd/vm/FlagsTest.java @@ -36,14 +36,13 @@ import org.testng.annotations.Test; * jdk.jvmstat/sun.jvmstat.monitor * @build jdk.test.lib.* * @build jdk.test.lib.dcmd.* - * @run testng/othervm -Xmx129m -XX:+PrintGC -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis_Right -XX:-TieredCompilation FlagsTest + * @run testng/othervm -Xmx129m -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis_Right -XX:-TieredCompilation FlagsTest */ public class FlagsTest { public void run(CommandExecutor executor) { OutputAnalyzer output = executor.execute("VM.flags"); /* The following are interpreted by the JVM as actual "flags" */ - output.shouldContain("-XX:+PrintGC"); output.shouldContain("-XX:+UnlockDiagnosticVMOptions"); output.shouldContain("-XX:+IgnoreUnrecognizedVMOptions"); output.shouldContain("-XX:-TieredCompilation"); diff --git a/hotspot/test/gc/6941923/Test6941923.java b/hotspot/test/serviceability/logging/TestLogRotation.java similarity index 89% rename from hotspot/test/gc/6941923/Test6941923.java rename to hotspot/test/serviceability/logging/TestLogRotation.java index 86f2456f391..cd056dec1fe 100644 --- a/hotspot/test/gc/6941923/Test6941923.java +++ b/hotspot/test/serviceability/logging/TestLogRotation.java @@ -22,13 +22,12 @@ */ /* - * @test Test6941923.java - * @bug 6941923 - * @summary test flags for gc log rotation + * @test TestLogRotation.java + * @summary test flags for log rotation * @library /testlibrary * @modules java.base/sun.misc * java.management - * @run main/othervm/timeout=600 Test6941923 + * @run main/othervm/timeout=600 TestLogRotation * */ import jdk.test.lib.*; @@ -51,7 +50,7 @@ class GCLoggingGenerator { } } -public class Test6941923 { +public class TestLogRotation { static final File currentDirectory = new File("."); static final String logFileName = "test.log"; @@ -76,11 +75,9 @@ public class Test6941923 { ArrayList args = new ArrayList(); String[] logOpts = new String[]{ "-cp", System.getProperty("java.class.path"), - "-Xloggc:" + logFileName, - "-XX:-DisableExplicitGC", // to sure that System.gc() works - "-XX:+PrintGC", "-XX:+PrintGCDetails", "-XX:+UseGCLogFileRotation", - "-XX:NumberOfGCLogFiles=" + numberOfFiles, - "-XX:GCLogFileSize=" + logFileSizeK + "K", "-Xmx128M"}; + "-Xlog:gc=debug:" + logFileName + "::filesize=" + logFileSizeK + ",filecount=" + numberOfFiles, + "-XX:-DisableExplicitGC", // to ensure that System.gc() works + "-Xmx128M"}; // System.getProperty("test.java.opts") is '' if no options is set // need to skip such empty String[] externalVMopts = System.getProperty("test.java.opts").length() == 0 From 97e8a96fe1488c0f6ae5e2a756dc8d593a42e13a Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Fri, 11 Dec 2015 09:08:08 +0100 Subject: [PATCH 102/228] 8144486: Change G1UpdateRSOrPushRefOopClosure to inherit OopClosure Reviewed-by: mgerdin, stefank --- hotspot/src/share/vm/gc/g1/g1OopClosures.hpp | 10 ++++------ hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp | 2 +- .../src/share/vm/gc/g1/g1_specialized_oop_closures.hpp | 4 +--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp index 3ba370e7882..c995b9c5d0b 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp @@ -242,7 +242,7 @@ public: virtual void do_oop(narrowOop* p) { do_oop_nv(p); } }; -class G1UpdateRSOrPushRefOopClosure: public ExtendedOopClosure { +class G1UpdateRSOrPushRefOopClosure: public OopClosure { G1CollectedHeap* _g1; G1RemSet* _g1_rem_set; HeapRegion* _from; @@ -268,11 +268,9 @@ public: return result; } - bool apply_to_weak_ref_discovered_field() { return true; } - - template void do_oop_nv(T* p); - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } - virtual void do_oop(oop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop(oop* p) { do_oop_work(p); } }; #endif // SHARE_VM_GC_G1_G1OOPCLOSURES_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp index efad4ae2caa..ff07495f9f6 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp @@ -156,7 +156,7 @@ inline void G1InvokeIfNotTriggeredClosure::do_oop_nv(T* p) { } template -inline void G1UpdateRSOrPushRefOopClosure::do_oop_nv(T* p) { +inline void G1UpdateRSOrPushRefOopClosure::do_oop_work(T* p) { oop obj = oopDesc::load_decode_heap_oop(p); if (obj == NULL) { return; diff --git a/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp b/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp index 68708b891cc..5243d76c4e3 100644 --- a/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp @@ -44,7 +44,6 @@ class G1RootRegionScanClosure; class G1Mux2Closure; class G1TriggerClosure; class G1InvokeIfNotTriggeredClosure; -class G1UpdateRSOrPushRefOopClosure; #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f) \ f(G1ParScanClosure,_nv) \ @@ -55,7 +54,6 @@ class G1UpdateRSOrPushRefOopClosure; f(G1RootRegionScanClosure,_nv) \ f(G1Mux2Closure,_nv) \ f(G1TriggerClosure,_nv) \ - f(G1InvokeIfNotTriggeredClosure,_nv) \ - f(G1UpdateRSOrPushRefOopClosure,_nv) + f(G1InvokeIfNotTriggeredClosure,_nv) #endif // SHARE_VM_GC_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP From faf57db7c80a219e0499a4084362093b83b213c5 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Thu, 10 Dec 2015 15:27:16 +0100 Subject: [PATCH 103/228] 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code Reviewed-by: stuefe, goetz --- .../src/cpu/ppc/vm/globalDefinitions_ppc.hpp | 5 + .../src/cpu/ppc/vm/metaspaceShared_ppc.cpp | 19 ++- hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp | 19 ++- hotspot/src/os/aix/vm/libodm_aix.cpp | 118 ++++++++++++++++++ hotspot/src/os/aix/vm/libodm_aix.hpp | 106 ++++++++++++++++ hotspot/src/os/aix/vm/os_aix.cpp | 47 ++++--- hotspot/src/os/aix/vm/os_aix.hpp | 34 +++-- .../aix_ppc/vm/atomic_aix_ppc.inline.hpp | 65 ++++++++++ .../linux_ppc/vm/atomic_linux_ppc.inline.hpp | 65 ++++++++++ 9 files changed, 440 insertions(+), 38 deletions(-) create mode 100644 hotspot/src/os/aix/vm/libodm_aix.cpp create mode 100644 hotspot/src/os/aix/vm/libodm_aix.hpp diff --git a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp index da5c8b008c5..43fe93146a9 100644 --- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp @@ -36,4 +36,9 @@ const int StackAlignmentInBytes = 16; // The PPC CPUs are NOT multiple-copy-atomic. #define CPU_NOT_MULTIPLE_COPY_ATOMIC +#if defined(COMPILER2) && defined(AIX) +// Include Transactional Memory lock eliding optimization +#define INCLUDE_RTM_OPT 1 +#endif + #endif // CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp b/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp index 9d68ca0f79b..9aa479a0e09 100644 --- a/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp @@ -50,12 +50,29 @@ // to be 'vtbl_list_size' instances of the vtable in order to // differentiate between the 'vtable_list_size' original Klass objects. +#define __ masm-> + void MetaspaceShared::generate_vtable_methods(void** vtbl_list, void** vtable, char** md_top, char* md_end, char** mc_top, char* mc_end) { - Unimplemented(); + intptr_t vtable_bytes = (num_virtuals * vtbl_list_size) * sizeof(void*); + *(intptr_t *)(*md_top) = vtable_bytes; + *md_top += sizeof(intptr_t); + void** dummy_vtable = (void**)*md_top; + *vtable = dummy_vtable; + *md_top += vtable_bytes; + + // Get ready to generate dummy methods. + + CodeBuffer cb((unsigned char*)*mc_top, mc_end - *mc_top); + MacroAssembler* masm = new MacroAssembler(&cb); + + // There are more general problems with CDS on ppc, so I can not + // really test this. But having this instead of Unimplementd() allows + // us to pass TestOptionsWithRanges.java. + __ unimplemented(); } diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index 90bd9c2ad7a..443c26aba54 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -210,12 +210,27 @@ void VM_Version::initialize() { } // Adjust RTM (Restricted Transactional Memory) flags. - if (!has_tcheck() && UseRTMLocking) { + if (UseRTMLocking) { + // If CPU or OS are too old: // Can't continue because UseRTMLocking affects UseBiasedLocking flag // setting during arguments processing. See use_biased_locking(). // VM_Version_init() is executed after UseBiasedLocking is used // in Thread::allocate(). - vm_exit_during_initialization("RTM instructions are not available on this CPU"); + if (!has_tcheck()) { + vm_exit_during_initialization("RTM instructions are not available on this CPU"); + } + bool os_too_old = true; +#ifdef AIX + if (os::Aix::os_version() >= 0x0701031e) { // at least AIX 7.1.3.30 + os_too_old = false; + } +#endif +#ifdef linux + // TODO: check kernel version (we currently have too old versions only) +#endif + if (os_too_old) { + vm_exit_during_initialization("RTM is not supported on this OS version."); + } } if (UseRTMLocking) { diff --git a/hotspot/src/os/aix/vm/libodm_aix.cpp b/hotspot/src/os/aix/vm/libodm_aix.cpp new file mode 100644 index 00000000000..e39a97d9f77 --- /dev/null +++ b/hotspot/src/os/aix/vm/libodm_aix.cpp @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2015, 2015 SAP AG. 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. + * + */ + +#include "libodm_aix.hpp" +#include "misc_aix.hpp" +#include +#include +#include +#include "runtime/arguments.hpp" + + +dynamicOdm::dynamicOdm() { + const char *libodmname = "/usr/lib/libodm.a(shr_64.o)"; + _libhandle = dlopen(libodmname, RTLD_MEMBER | RTLD_NOW); + if (!_libhandle) { + trcVerbose("Couldn't open %s", libodmname); + return; + } + _odm_initialize = (fun_odm_initialize )dlsym(_libhandle, "odm_initialize" ); + _odm_set_path = (fun_odm_set_path )dlsym(_libhandle, "odm_set_path" ); + _odm_mount_class = (fun_odm_mount_class)dlsym(_libhandle, "odm_mount_class"); + _odm_get_obj = (fun_odm_get_obj )dlsym(_libhandle, "odm_get_obj" ); + _odm_terminate = (fun_odm_terminate )dlsym(_libhandle, "odm_terminate" ); + if (!_odm_initialize || !_odm_set_path || !_odm_mount_class || !_odm_get_obj || !_odm_terminate) { + trcVerbose("Couldn't find all required odm symbols from %s", libodmname); + dlclose(_libhandle); + _libhandle = NULL; + return; + } +} + +dynamicOdm::~dynamicOdm() { + if (_libhandle) { dlclose(_libhandle); } +} + + +void odmWrapper::clean_data() { if (_data) { free(_data); _data = NULL; } } + + +int odmWrapper::class_offset(char *field, bool is_aix_5) +{ + assert(has_class(), "initialization"); + for (int i = 0; i < odm_class()->nelem; i++) { + if (strcmp(odm_class()->elem[i].elemname, field) == 0) { + int offset = odm_class()->elem[i].offset; + if (is_aix_5) { offset += LINK_VAL_OFFSET; } + return offset; + } + } + return -1; +} + + +void odmWrapper::determine_os_kernel_version(uint32_t* p_ver) { + int major_aix_version = ((*p_ver) >> 24) & 0xFF, + minor_aix_version = ((*p_ver) >> 16) & 0xFF; + assert(*p_ver, "must be initialized"); + + odmWrapper odm("product", "/usr/lib/objrepos"); // could also use "lpp" + if (!odm.has_class()) { + trcVerbose("try_determine_os_kernel_version: odm init problem"); + return; + } + int voff, roff, moff, foff; + bool is_aix_5 = (major_aix_version == 5); + voff = odm.class_offset("ver", is_aix_5); + roff = odm.class_offset("rel", is_aix_5); + moff = odm.class_offset("mod", is_aix_5); + foff = odm.class_offset("fix", is_aix_5); + if (voff == -1 || roff == -1 || moff == -1 || foff == -1) { + trcVerbose("try_determine_os_kernel_version: could not get offsets"); + return; + } + if (!odm.retrieve_obj("name='bos.mp64'")) { + trcVerbose("try_determine_os_kernel_version: odm_get_obj failed"); + return; + } + int version, release, modification, fix_level; + do { + version = odm.read_short(voff); + release = odm.read_short(roff); + modification = odm.read_short(moff); + fix_level = odm.read_short(foff); + trcVerbose("odm found version: %d.%d.%d.%d", version, release, modification, fix_level); + if (version >> 8 != 0 || release >> 8 != 0 || modification >> 8 != 0 || fix_level >> 8 != 0) { + trcVerbose("8 bit numbers expected"); + return; + } + } while (odm.retrieve_obj()); + + if (version != major_aix_version || release != minor_aix_version) { + trcVerbose("version determined by odm does not match uname"); + return; + } + *p_ver = version << 24 | release << 16 | modification << 8 | fix_level; +} diff --git a/hotspot/src/os/aix/vm/libodm_aix.hpp b/hotspot/src/os/aix/vm/libodm_aix.hpp new file mode 100644 index 00000000000..908bb2686a4 --- /dev/null +++ b/hotspot/src/os/aix/vm/libodm_aix.hpp @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2015, 2015 SAP AG. 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. + * + */ + +// Encapsulates the libodm library and provides more convenient interfaces. + +#ifndef OS_AIX_VM_LIBODM_AIX_HPP +#define OS_AIX_VM_LIBODM_AIX_HPP + +#include + + +// The purpose of this code is to dynamically load the libodm library +// instead of statically linking against it. The library is AIX-specific. +// It only exists on AIX, not on PASE. In order to share binaries +// between AIX and PASE, we can't directly link against it. + +typedef int (*fun_odm_initialize )(void); +typedef char* (*fun_odm_set_path )(char*); +typedef CLASS_SYMBOL (*fun_odm_mount_class)(char*); +typedef void* (*fun_odm_get_obj )(CLASS_SYMBOL, char*, void*, int); +typedef int (*fun_odm_terminate )(void); + +class dynamicOdm { + void *_libhandle; + protected: + fun_odm_initialize _odm_initialize; + fun_odm_set_path _odm_set_path; + fun_odm_mount_class _odm_mount_class; + fun_odm_get_obj _odm_get_obj; + fun_odm_terminate _odm_terminate; + public: + dynamicOdm(); + ~dynamicOdm(); + bool odm_loaded() {return _libhandle != NULL; } +}; + + +// We provide a more convenient interface for odm access and +// especially to determine the exact AIX kernel version. + +class odmWrapper : private dynamicOdm { + CLASS_SYMBOL _odm_class; + char *_data; + bool _initialized; + void clean_data(); + + public: + // Make sure everything gets initialized and cleaned up properly. + explicit odmWrapper(char* odm_class_name, char* odm_path = NULL) : _odm_class((CLASS_SYMBOL)-1), + _data(NULL), _initialized(false) { + if (!odm_loaded()) { return; } + _initialized = ((*_odm_initialize)() != -1); + if (_initialized) { + if (odm_path) { (*_odm_set_path)(odm_path); } + _odm_class = (*_odm_mount_class)(odm_class_name); + } + } + ~odmWrapper() { + if (_initialized) { (*_odm_terminate)(); clean_data(); } + } + + CLASS_SYMBOL odm_class() { return _odm_class; } + bool has_class() { return odm_class() != (CLASS_SYMBOL)-1; } + int class_offset(char *field, bool is_aix_5); + char* data() { return _data; } + + char* retrieve_obj(char* name = NULL) { + clean_data(); + char *cnp = (char*)(void*)(*_odm_get_obj)(odm_class(), name, NULL, (name == NULL) ? ODM_NEXT : ODM_FIRST); + if (cnp != (char*)-1) { _data = cnp; } + return data(); + } + + int read_short(int offs) { + short *addr = (short*)(data() + offs); + return *addr; + } + + // Determine the exact AIX kernel version as 4 byte value. + // The high order 2 bytes must be initialized already. They can be determined by uname. + static void determine_os_kernel_version(uint32_t* p_ver); +}; + +#endif // OS_AIX_VM_LIBODM_AIX_HPP diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index a0a1e38239a..2cc40ed4d7f 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -38,6 +38,7 @@ #include "jvm_aix.h" #include "libo4.hpp" #include "libperfstat_aix.hpp" +#include "libodm_aix.hpp" #include "loadlib_aix.hpp" #include "memory/allocation.inline.hpp" #include "memory/filemap.hpp" @@ -197,9 +198,13 @@ int os::Aix::_page_size = -1; // -1 = uninitialized, 0 if AIX, 1 if OS/400 pase int os::Aix::_on_pase = -1; -// -1 = uninitialized, otherwise os version in the form 0xMMmm - MM:major, mm:minor -// E.g. 0x0601 for AIX 6.1 or 0x0504 for OS/400 V5R4 -int os::Aix::_os_version = -1; +// 0 = uninitialized, otherwise 32 bit number: +// 0xVVRRTTSS +// VV - major version +// RR - minor version +// TT - tech level, if known, 0 otherwise +// SS - service pack, if known, 0 otherwise +uint32_t os::Aix::_os_version = 0; int os::Aix::_stack_page_size = -1; @@ -358,7 +363,7 @@ static char cpu_arch[] = "ppc64"; // Wrap the function "vmgetinfo" which is not available on older OS releases. static int checked_vmgetinfo(void *out, int command, int arg) { - if (os::Aix::on_pase() && os::Aix::os_version() < 0x0601) { + if (os::Aix::on_pase() && os::Aix::os_version_short() < 0x0601) { guarantee(false, "cannot call vmgetinfo on AS/400 older than V6R1"); } return ::vmgetinfo(out, command, arg); @@ -367,7 +372,7 @@ static int checked_vmgetinfo(void *out, int command, int arg) { // Given an address, returns the size of the page backing that address. size_t os::Aix::query_pagesize(void* addr) { - if (os::Aix::on_pase() && os::Aix::os_version() < 0x0601) { + if (os::Aix::on_pase() && os::Aix::os_version_short() < 0x0601) { // AS/400 older than V6R1: no vmgetinfo here, default to 4K return SIZE_4K; } @@ -1491,6 +1496,10 @@ void os::print_os_info(outputStream* st) { st->print(name.machine); st->cr(); + uint32_t ver = os::Aix::os_version(); + st->print_cr("AIX kernel version %u.%u.%u.%u", + (ver >> 24) & 0xFF, (ver >> 16) & 0xFF, (ver >> 8) & 0xFF, ver & 0xFF); + // rlimit st->print("rlimit:"); struct rlimit rlim; @@ -4255,7 +4264,7 @@ bool os::Aix::is_primordial_thread() { // one of Aix::on_pase(), Aix::os_version() static void os::Aix::initialize_os_info() { - assert(_on_pase == -1 && _os_version == -1, "already called."); + assert(_on_pase == -1 && _os_version == 0, "already called."); struct utsname uts; memset(&uts, 0, sizeof(uts)); @@ -4271,28 +4280,34 @@ void os::Aix::initialize_os_info() { assert(major > 0, "invalid OS version"); const int minor = atoi(uts.release); assert(minor > 0, "invalid OS release"); - _os_version = (major << 8) | minor; + _os_version = (major << 24) | (minor << 16); + char ver_str[20] = {0}; + char *name_str = "unknown OS"; if (strcmp(uts.sysname, "OS400") == 0) { // We run on AS/400 PASE. We do not support versions older than V5R4M0. _on_pase = 1; - if (_os_version < 0x0504) { + if (os_version_short() < 0x0504) { trcVerbose("OS/400 releases older than V5R4M0 not supported."); assert(false, "OS/400 release too old."); - } else { - trcVerbose("We run on OS/400 (pase) V%dR%d", major, minor); } + name_str = "OS/400 (pase)"; + jio_snprintf(ver_str, sizeof(ver_str), "%u.%u", major, minor); } else if (strcmp(uts.sysname, "AIX") == 0) { // We run on AIX. We do not support versions older than AIX 5.3. _on_pase = 0; - if (_os_version < 0x0503) { + // Determine detailed AIX version: Version, Release, Modification, Fix Level. + odmWrapper::determine_os_kernel_version(&_os_version); + if (os_version_short() < 0x0503) { trcVerbose("AIX release older than AIX 5.3 not supported."); assert(false, "AIX release too old."); - } else { - trcVerbose("We run on AIX %d.%d", major, minor); } + name_str = "AIX"; + jio_snprintf(ver_str, sizeof(ver_str), "%u.%u.%u.%u", + major, minor, (_os_version >> 8) & 0xFF, _os_version & 0xFF); } else { - assert(false, "unknown OS"); + assert(false, name_str); } + trcVerbose("We run on %s %s", name_str, ver_str); } guarantee(_on_pase != -1 && _os_version, "Could not determine AIX/OS400 release"); @@ -4357,7 +4372,7 @@ void os::Aix::scan_environment() { p = ::getenv("LDR_CNTRL"); trcVerbose("LDR_CNTRL=%s.", p ? p : ""); - if (os::Aix::on_pase() && os::Aix::os_version() == 0x0701) { + if (os::Aix::on_pase() && os::Aix::os_version_short() == 0x0701) { if (p && ::strstr(p, "TEXTPSIZE")) { trcVerbose("*** WARNING - LDR_CNTRL contains TEXTPSIZE. " "you may experience hangs or crashes on OS/400 V7R1."); @@ -5016,7 +5031,7 @@ void TestReserveMemorySpecial_test() { } #endif -bool os::start_debugging(char *buf, int buflen) { +bool os::start_debugging(char *buf, int buflen) { int len = (int)strlen(buf); char *p = &buf[len]; diff --git a/hotspot/src/os/aix/vm/os_aix.hpp b/hotspot/src/os/aix/vm/os_aix.hpp index 11942fc9fb1..7cd372807e6 100644 --- a/hotspot/src/os/aix/vm/os_aix.hpp +++ b/hotspot/src/os/aix/vm/os_aix.hpp @@ -55,15 +55,12 @@ class Aix { // -1 = uninitialized, 0 = AIX, 1 = OS/400 (PASE) static int _on_pase; - // -1 = uninitialized, otherwise 16 bit number: + // 0 = uninitialized, otherwise 16 bit number: // lower 8 bit - minor version // higher 8 bit - major version // For AIX, e.g. 0x0601 for AIX 6.1 // for OS/400 e.g. 0x0504 for OS/400 V5R4 - static int _os_version; - - // 4 Byte kernel version: Version, Release, Tech Level, Service Pack. - static unsigned int _os_kernel_version; + static uint32_t _os_version; // -1 = uninitialized, // 0 - SPEC1170 not requested (XPG_SUS_ENV is OFF or not set) @@ -175,32 +172,31 @@ class Aix { return _on_pase ? false : true; } - // -1 = uninitialized, otherwise 16 bit number: + // Get 4 byte AIX kernel version number: + // highest 2 bytes: Version, Release + // if available: lowest 2 bytes: Tech Level, Service Pack. + static uint32_t os_version() { + assert(_os_version != 0, "not initialized"); + return _os_version; + } + + // 0 = uninitialized, otherwise 16 bit number: // lower 8 bit - minor version // higher 8 bit - major version // For AIX, e.g. 0x0601 for AIX 6.1 // for OS/400 e.g. 0x0504 for OS/400 V5R4 - static int os_version () { - assert(_os_version != -1, "not initialized"); - return _os_version; - } - - // Get 4 byte AIX kernel version number: - // highest 2 bytes: Version, Release - // if available: lowest 2 bytes: Tech Level, Service Pack. - static unsigned int os_kernel_version() { - if (_os_kernel_version) return _os_kernel_version; - return os_version() << 16; + static int os_version_short() { + return os_version() >> 16; } // Convenience method: returns true if running on PASE V5R4 or older. static bool on_pase_V5R4_or_older() { - return on_pase() && os_version() <= 0x0504; + return on_pase() && os_version_short() <= 0x0504; } // Convenience method: returns true if running on AIX 5.3 or older. static bool on_aix_53_or_older() { - return on_aix() && os_version() <= 0x0503; + return on_aix() && os_version_short() <= 0x0503; } // Returns true if we run in SPEC1170 compliant mode (XPG_SUS_ENV=ON). diff --git a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp index 046912a2c24..d3afeeb399d 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp @@ -291,6 +291,71 @@ inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest) { return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest); } +#define VM_HAS_SPECIALIZED_CMPXCHG_BYTE +inline jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) { + + // Note that cmpxchg guarantees a two-way memory barrier across + // the cmpxchg, so it's really a a 'fence_cmpxchg_acquire' + // (see atomic.hpp). + + // Using 32 bit internally. + volatile int *dest_base = (volatile int*)((uintptr_t)dest & ~3); + +#ifdef VM_LITTLE_ENDIAN + const unsigned int shift_amount = ((uintptr_t)dest & 3) * 8; +#else + const unsigned int shift_amount = ((~(uintptr_t)dest) & 3) * 8; +#endif + const unsigned int masked_compare_val = ((unsigned int)(unsigned char)compare_value), + masked_exchange_val = ((unsigned int)(unsigned char)exchange_value), + xor_value = (masked_compare_val ^ masked_exchange_val) << shift_amount; + + unsigned int old_value, value32; + + __asm__ __volatile__ ( + /* fence */ + strasm_sync + /* simple guard */ + " lbz %[old_value], 0(%[dest]) \n" + " cmpw %[masked_compare_val], %[old_value] \n" + " bne- 2f \n" + /* atomic loop */ + "1: \n" + " lwarx %[value32], 0, %[dest_base] \n" + /* extract byte and compare */ + " srd %[old_value], %[value32], %[shift_amount] \n" + " clrldi %[old_value], %[old_value], 56 \n" + " cmpw %[masked_compare_val], %[old_value] \n" + " bne- 2f \n" + /* replace byte and try to store */ + " xor %[value32], %[xor_value], %[value32] \n" + " stwcx. %[value32], 0, %[dest_base] \n" + " bne- 1b \n" + /* acquire */ + strasm_sync + /* exit */ + "2: \n" + /* out */ + : [old_value] "=&r" (old_value), + [value32] "=&r" (value32), + "=m" (*dest), + "=m" (*dest_base) + /* in */ + : [dest] "b" (dest), + [dest_base] "b" (dest_base), + [shift_amount] "r" (shift_amount), + [masked_compare_val] "r" (masked_compare_val), + [xor_value] "r" (xor_value), + "m" (*dest), + "m" (*dest_base) + /* clobber */ + : "cc", + "memory" + ); + + return (jbyte)(unsigned char)old_value; +} + inline jint Atomic::cmpxchg(jint exchange_value, volatile jint* dest, jint compare_value) { // Note that cmpxchg guarantees a two-way memory barrier across diff --git a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp index 39ed85ea361..d9e1f5d84e0 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp @@ -291,6 +291,71 @@ inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest) { return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest); } +#define VM_HAS_SPECIALIZED_CMPXCHG_BYTE +inline jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) { + + // Note that cmpxchg guarantees a two-way memory barrier across + // the cmpxchg, so it's really a a 'fence_cmpxchg_acquire' + // (see atomic.hpp). + + // Using 32 bit internally. + volatile int *dest_base = (volatile int*)((uintptr_t)dest & ~3); + +#ifdef VM_LITTLE_ENDIAN + const unsigned int shift_amount = ((uintptr_t)dest & 3) * 8; +#else + const unsigned int shift_amount = ((~(uintptr_t)dest) & 3) * 8; +#endif + const unsigned int masked_compare_val = ((unsigned int)(unsigned char)compare_value), + masked_exchange_val = ((unsigned int)(unsigned char)exchange_value), + xor_value = (masked_compare_val ^ masked_exchange_val) << shift_amount; + + unsigned int old_value, value32; + + __asm__ __volatile__ ( + /* fence */ + strasm_sync + /* simple guard */ + " lbz %[old_value], 0(%[dest]) \n" + " cmpw %[masked_compare_val], %[old_value] \n" + " bne- 2f \n" + /* atomic loop */ + "1: \n" + " lwarx %[value32], 0, %[dest_base] \n" + /* extract byte and compare */ + " srd %[old_value], %[value32], %[shift_amount] \n" + " clrldi %[old_value], %[old_value], 56 \n" + " cmpw %[masked_compare_val], %[old_value] \n" + " bne- 2f \n" + /* replace byte and try to store */ + " xor %[value32], %[xor_value], %[value32] \n" + " stwcx. %[value32], 0, %[dest_base] \n" + " bne- 1b \n" + /* acquire */ + strasm_sync + /* exit */ + "2: \n" + /* out */ + : [old_value] "=&r" (old_value), + [value32] "=&r" (value32), + "=m" (*dest), + "=m" (*dest_base) + /* in */ + : [dest] "b" (dest), + [dest_base] "b" (dest_base), + [shift_amount] "r" (shift_amount), + [masked_compare_val] "r" (masked_compare_val), + [xor_value] "r" (xor_value), + "m" (*dest), + "m" (*dest_base) + /* clobber */ + : "cc", + "memory" + ); + + return (jbyte)(unsigned char)old_value; +} + inline jint Atomic::cmpxchg(jint exchange_value, volatile jint* dest, jint compare_value) { // Note that cmpxchg guarantees a two-way memory barrier across From f9ecfbf758e7c6954960936f1dcf30d1fbe918fc Mon Sep 17 00:00:00 2001 From: Sebastian Sickelmann Date: Thu, 10 Dec 2015 17:48:44 +0100 Subject: [PATCH 104/228] 8145061: Too many instances of java.lang.Boolean created in Java application (hotspot repo) Avoid creating unused instances of Long and Boolean Reviewed-by: dholmes, sla --- .../share/classes/sun/jvm/hotspot/runtime/VM.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java index 18237d636fc..09bb426cfb3 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @@ -229,17 +229,17 @@ public class VM { public String getValue() { if (isBool()) { - return new Boolean(getBool()).toString(); + return Boolean.toString(getBool()); } else if (isInt()) { - return new Long(getInt()).toString(); + return Long.toString(getInt()); } else if (isUInt()) { - return new Long(getUInt()).toString(); + return Long.toString(getUInt()); } else if (isIntx()) { - return new Long(getIntx()).toString(); + return Long.toString(getIntx()); } else if (isUIntx()) { - return new Long(getUIntx()).toString(); + return Long.toString(getUIntx()); } else if (isSizet()) { - return new Long(getSizet()).toString(); + return Long.toString(getSizet()); } else { return null; } From a1a959760b9904e482367abf25030019a4fefa95 Mon Sep 17 00:00:00 2001 From: David Lindholm Date: Fri, 11 Dec 2015 13:48:52 +0100 Subject: [PATCH 105/228] 8144996: Replace the HeapRegionSetCount class with an uint Reviewed-by: brutisso, jwilhelm --- .../jvm/hotspot/gc/g1/HeapRegionSetBase.java | 11 ++- .../jvm/hotspot/gc/g1/HeapRegionSetCount.java | 73 ------------------- .../sun/jvm/hotspot/tools/HeapSummary.java | 3 +- hotspot/src/share/vm/gc/g1/concurrentMark.cpp | 16 ++-- .../src/share/vm/gc/g1/g1CollectedHeap.cpp | 49 +++++-------- .../src/share/vm/gc/g1/g1CollectedHeap.hpp | 4 +- hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp | 5 +- hotspot/src/share/vm/gc/g1/g1MarkSweep.hpp | 4 +- hotspot/src/share/vm/gc/g1/heapRegionSet.cpp | 14 ++-- hotspot/src/share/vm/gc/g1/heapRegionSet.hpp | 64 +++++----------- .../share/vm/gc/g1/heapRegionSet.inline.hpp | 6 +- hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp | 6 +- 12 files changed, 65 insertions(+), 190 deletions(-) delete mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetCount.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java index bd64e0249e4..5e79ebaace8 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java @@ -41,7 +41,8 @@ import sun.jvm.hotspot.types.TypeDataBase; public class HeapRegionSetBase extends VMObject { - static private long countField; + // uint _length + static private CIntegerField lengthField; static { VM.registerVMInitializedObserver(new Observer() { @@ -54,13 +55,11 @@ public class HeapRegionSetBase extends VMObject { static private synchronized void initialize(TypeDataBase db) { Type type = db.lookupType("HeapRegionSetBase"); - countField = type.getField("_count").getOffset(); + lengthField = type.getCIntegerField("_length"); } - - public HeapRegionSetCount count() { - Address countFieldAddr = addr.addOffsetTo(countField); - return (HeapRegionSetCount) VMObjectFactory.newObject(HeapRegionSetCount.class, countFieldAddr); + public long length() { + return lengthField.getValue(addr); } public HeapRegionSetBase(Address addr) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetCount.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetCount.java deleted file mode 100644 index 2c9fd8280c8..00000000000 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetCount.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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 - * 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. - * - */ - -package sun.jvm.hotspot.gc.g1; - -import java.util.Iterator; -import java.util.Observable; -import java.util.Observer; - -import sun.jvm.hotspot.debugger.Address; -import sun.jvm.hotspot.runtime.VM; -import sun.jvm.hotspot.runtime.VMObject; -import sun.jvm.hotspot.runtime.VMObjectFactory; -import sun.jvm.hotspot.types.AddressField; -import sun.jvm.hotspot.types.CIntegerField; -import sun.jvm.hotspot.types.Type; -import sun.jvm.hotspot.types.TypeDataBase; - -// Mirror class for HeapRegionSetCount. Represents a group of regions. - -public class HeapRegionSetCount extends VMObject { - - static private CIntegerField lengthField; - static private CIntegerField capacityField; - - static { - VM.registerVMInitializedObserver(new Observer() { - public void update(Observable o, Object data) { - initialize(VM.getVM().getTypeDataBase()); - } - }); - } - - static private synchronized void initialize(TypeDataBase db) { - Type type = db.lookupType("HeapRegionSetCount"); - - lengthField = type.getCIntegerField("_length"); - capacityField = type.getCIntegerField("_capacity"); - } - - public long length() { - return lengthField.getValue(addr); - } - - public long capacity() { - return capacityField.getValue(addr); - } - - public HeapRegionSetCount(Address addr) { - super(addr); - } -} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java index 893c5e1e31b..601283072ff 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java @@ -112,8 +112,7 @@ public class HeapSummary extends Tool { long survivorRegionNum = g1mm.survivorRegionNum(); HeapRegionSetBase oldSet = g1h.oldSet(); HeapRegionSetBase humongousSet = g1h.humongousSet(); - long oldRegionNum = oldSet.count().length() - + humongousSet.count().capacity() / HeapRegion.grainBytes(); + long oldRegionNum = oldSet.length() + humongousSet.length(); printG1Space("G1 Heap:", g1h.n_regions(), g1h.used(), g1h.capacity()); System.out.println("G1 Young Generation:"); diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp index e1f73491452..02c4a718e71 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp @@ -1483,8 +1483,8 @@ class G1NoteEndOfConcMarkClosure : public HeapRegionClosure { G1CollectedHeap* _g1; size_t _freed_bytes; FreeRegionList* _local_cleanup_list; - HeapRegionSetCount _old_regions_removed; - HeapRegionSetCount _humongous_regions_removed; + uint _old_regions_removed; + uint _humongous_regions_removed; HRRSCleanupTask* _hrrs_cleanup_task; public: @@ -1494,13 +1494,13 @@ public: _g1(g1), _freed_bytes(0), _local_cleanup_list(local_cleanup_list), - _old_regions_removed(), - _humongous_regions_removed(), + _old_regions_removed(0), + _humongous_regions_removed(0), _hrrs_cleanup_task(hrrs_cleanup_task) { } size_t freed_bytes() { return _freed_bytes; } - const HeapRegionSetCount& old_regions_removed() { return _old_regions_removed; } - const HeapRegionSetCount& humongous_regions_removed() { return _humongous_regions_removed; } + const uint old_regions_removed() { return _old_regions_removed; } + const uint humongous_regions_removed() { return _humongous_regions_removed; } bool doHeapRegion(HeapRegion *hr) { if (hr->is_archive()) { @@ -1515,10 +1515,10 @@ public: _freed_bytes += hr->used(); hr->set_containing_set(NULL); if (hr->is_humongous()) { - _humongous_regions_removed.increment(1u, hr->capacity()); + _humongous_regions_removed++; _g1->free_humongous_region(hr, _local_cleanup_list, true); } else { - _old_regions_removed.increment(1u, hr->capacity()); + _old_regions_removed++; _g1->free_region(hr, _local_cleanup_list, true); } } else { diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index 59fdc8b1381..56fbe83186c 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -5195,9 +5195,9 @@ void G1CollectedHeap::free_humongous_region(HeapRegion* hr, free_region(hr, free_list, par); } -void G1CollectedHeap::remove_from_old_sets(const HeapRegionSetCount& old_regions_removed, - const HeapRegionSetCount& humongous_regions_removed) { - if (old_regions_removed.length() > 0 || humongous_regions_removed.length() > 0) { +void G1CollectedHeap::remove_from_old_sets(const uint old_regions_removed, + const uint humongous_regions_removed) { + if (old_regions_removed > 0 || humongous_regions_removed > 0) { MutexLockerEx x(OldSets_lock, Mutex::_no_safepoint_check_flag); _old_set.bulk_remove(old_regions_removed); _humongous_set.bulk_remove(humongous_regions_removed); @@ -5582,12 +5582,12 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { private: FreeRegionList* _free_region_list; HeapRegionSet* _proxy_set; - HeapRegionSetCount _humongous_regions_removed; + uint _humongous_regions_removed; size_t _freed_bytes; public: G1FreeHumongousRegionClosure(FreeRegionList* free_region_list) : - _free_region_list(free_region_list), _humongous_regions_removed(), _freed_bytes(0) { + _free_region_list(free_region_list), _humongous_regions_removed(0), _freed_bytes(0) { } virtual bool doHeapRegion(HeapRegion* r) { @@ -5667,7 +5667,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { HeapRegion* next = g1h->next_region_in_humongous(r); _freed_bytes += r->used(); r->set_containing_set(NULL); - _humongous_regions_removed.increment(1u, r->capacity()); + _humongous_regions_removed++; g1h->free_humongous_region(r, _free_region_list, false); r = next; } while (r != NULL); @@ -5675,17 +5675,13 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { return false; } - HeapRegionSetCount& humongous_free_count() { + uint humongous_free_count() { return _humongous_regions_removed; } size_t bytes_freed() const { return _freed_bytes; } - - size_t humongous_reclaimed() const { - return _humongous_regions_removed.length(); - } }; void G1CollectedHeap::eagerly_reclaim_humongous_regions() { @@ -5704,8 +5700,7 @@ void G1CollectedHeap::eagerly_reclaim_humongous_regions() { G1FreeHumongousRegionClosure cl(&local_cleanup_list); heap_region_iterate(&cl); - HeapRegionSetCount empty_set; - remove_from_old_sets(empty_set, cl.humongous_free_count()); + remove_from_old_sets(0, cl.humongous_free_count()); G1HRPrinter* hrp = hr_printer(); if (hrp->is_active()) { @@ -5720,7 +5715,7 @@ void G1CollectedHeap::eagerly_reclaim_humongous_regions() { decrement_summary_bytes(cl.bytes_freed()); g1_policy()->phase_times()->record_fast_reclaim_humongous_time_ms((os::elapsedTime() - start_time) * 1000.0, - cl.humongous_reclaimed()); + cl.humongous_free_count()); } // This routine is similar to the above but does not record @@ -6066,9 +6061,9 @@ private: HeapRegionManager* _hrm; public: - HeapRegionSetCount _old_count; - HeapRegionSetCount _humongous_count; - HeapRegionSetCount _free_count; + uint _old_count; + uint _humongous_count; + uint _free_count; VerifyRegionListsClosure(HeapRegionSet* old_set, HeapRegionSet* humongous_set, @@ -6081,13 +6076,13 @@ public: // TODO } else if (hr->is_humongous()) { assert(hr->containing_set() == _humongous_set, "Heap region %u is humongous but not in humongous set.", hr->hrm_index()); - _humongous_count.increment(1u, hr->capacity()); + _humongous_count++; } else if (hr->is_empty()) { assert(_hrm->is_free(hr), "Heap region %u is empty but not on the free list.", hr->hrm_index()); - _free_count.increment(1u, hr->capacity()); + _free_count++; } else if (hr->is_old()) { assert(hr->containing_set() == _old_set, "Heap region %u is old but not in the old set.", hr->hrm_index()); - _old_count.increment(1u, hr->capacity()); + _old_count++; } else { // There are no other valid region types. Check for one invalid // one we can identify: pinned without old or humongous set. @@ -6098,17 +6093,9 @@ public: } void verify_counts(HeapRegionSet* old_set, HeapRegionSet* humongous_set, HeapRegionManager* free_list) { - guarantee(old_set->length() == _old_count.length(), "Old set count mismatch. Expected %u, actual %u.", old_set->length(), _old_count.length()); - guarantee(old_set->total_capacity_bytes() == _old_count.capacity(), "Old set capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, - old_set->total_capacity_bytes(), _old_count.capacity()); - - guarantee(humongous_set->length() == _humongous_count.length(), "Hum set count mismatch. Expected %u, actual %u.", humongous_set->length(), _humongous_count.length()); - guarantee(humongous_set->total_capacity_bytes() == _humongous_count.capacity(), "Hum set capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, - humongous_set->total_capacity_bytes(), _humongous_count.capacity()); - - guarantee(free_list->num_free_regions() == _free_count.length(), "Free list count mismatch. Expected %u, actual %u.", free_list->num_free_regions(), _free_count.length()); - guarantee(free_list->total_capacity_bytes() == _free_count.capacity(), "Free list capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, - free_list->total_capacity_bytes(), _free_count.capacity()); + guarantee(old_set->length() == _old_count, "Old set count mismatch. Expected %u, actual %u.", old_set->length(), _old_count); + guarantee(humongous_set->length() == _humongous_count, "Hum set count mismatch. Expected %u, actual %u.", humongous_set->length(), _humongous_count); + guarantee(free_list->num_free_regions() == _free_count, "Free list count mismatch. Expected %u, actual %u.", free_list->num_free_regions(), _free_count); } }; diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp index 9bd26d31175..dafd2cd102b 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp @@ -1132,7 +1132,7 @@ public: inline void old_set_remove(HeapRegion* hr); size_t non_young_capacity_bytes() { - return _old_set.total_capacity_bytes() + _humongous_set.total_capacity_bytes(); + return (_old_set.length() + _humongous_set.length()) * HeapRegion::GrainBytes; } void set_free_regions_coming(); @@ -1157,7 +1157,7 @@ public: // True iff an evacuation has failed in the most-recent collection. bool evacuation_failed() { return _evacuation_failed; } - void remove_from_old_sets(const HeapRegionSetCount& old_regions_removed, const HeapRegionSetCount& humongous_regions_removed); + void remove_from_old_sets(const uint old_regions_removed, const uint humongous_regions_removed); void prepend_to_freelist(FreeRegionList* list); void decrement_summary_bytes(size_t bytes); diff --git a/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp index d1feefe2de5..7218472cc3c 100644 --- a/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp +++ b/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp @@ -329,7 +329,7 @@ void G1PrepareCompactClosure::free_humongous_region(HeapRegion* hr) { FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep"); hr->set_containing_set(NULL); - _humongous_regions_removed.increment(1u, hr->capacity()); + _humongous_regions_removed++; _g1h->free_humongous_region(hr, &dummy_free_list, false /* par */); prepare_for_compaction(hr, end); @@ -358,8 +358,7 @@ void G1PrepareCompactClosure::prepare_for_compaction_work(CompactPoint* cp, void G1PrepareCompactClosure::update_sets() { // We'll recalculate total used bytes and recreate the free list // at the end of the GC, so no point in updating those values here. - HeapRegionSetCount empty_set; - _g1h->remove_from_old_sets(empty_set, _humongous_regions_removed); + _g1h->remove_from_old_sets(0, _humongous_regions_removed); } bool G1PrepareCompactClosure::doHeapRegion(HeapRegion* hr) { diff --git a/hotspot/src/share/vm/gc/g1/g1MarkSweep.hpp b/hotspot/src/share/vm/gc/g1/g1MarkSweep.hpp index fc54b9ee79f..a6dab8a4324 100644 --- a/hotspot/src/share/vm/gc/g1/g1MarkSweep.hpp +++ b/hotspot/src/share/vm/gc/g1/g1MarkSweep.hpp @@ -92,7 +92,7 @@ class G1PrepareCompactClosure : public HeapRegionClosure { G1CollectedHeap* _g1h; ModRefBarrierSet* _mrbs; CompactPoint _cp; - HeapRegionSetCount _humongous_regions_removed; + uint _humongous_regions_removed; virtual void prepare_for_compaction(HeapRegion* hr, HeapWord* end); void prepare_for_compaction_work(CompactPoint* cp, HeapRegion* hr, HeapWord* end); @@ -103,7 +103,7 @@ class G1PrepareCompactClosure : public HeapRegionClosure { G1PrepareCompactClosure() : _g1h(G1CollectedHeap::heap()), _mrbs(_g1h->g1_barrier_set()), - _humongous_regions_removed() { } + _humongous_regions_removed(0) { } void update_sets(); bool doHeapRegion(HeapRegion* hr); diff --git a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp index e0dc38be982..1240a43c028 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp @@ -49,8 +49,8 @@ void HeapRegionSetBase::verify() { // verification might fail and send us on a wild goose chase. check_mt_safety(); - guarantee_heap_region_set(( is_empty() && length() == 0 && total_capacity_bytes() == 0) || - (!is_empty() && length() > 0 && total_capacity_bytes() > 0) , + guarantee_heap_region_set(( is_empty() && length() == 0) || + (!is_empty() && length() > 0), "invariant"); } @@ -81,14 +81,12 @@ void HeapRegionSetBase::print_on(outputStream* out, bool print_contents) { out->print_cr(" free : %s", BOOL_TO_STR(regions_free())); out->print_cr(" Attributes"); out->print_cr(" length : %14u", length()); - out->print_cr(" total capacity : " SIZE_FORMAT_W(14) " bytes", - total_capacity_bytes()); } HeapRegionSetBase::HeapRegionSetBase(const char* name, bool humongous, bool free, HRSMtSafeChecker* mt_safety_checker) : _name(name), _verify_in_progress(false), _is_humongous(humongous), _is_free(free), _mt_safety_checker(mt_safety_checker), - _count() + _length(0) { } void FreeRegionList::set_unrealistically_long_length(uint len) { @@ -177,7 +175,7 @@ void FreeRegionList::add_ordered(FreeRegionList* from_list) { } } - _count.increment(from_list->length(), from_list->total_capacity_bytes()); + _length += from_list->length(); from_list->clear(); verify_optional(); @@ -255,7 +253,7 @@ void FreeRegionList::verify() { } void FreeRegionList::clear() { - _count = HeapRegionSetCount(); + _length = 0; _head = NULL; _tail = NULL; _last = NULL; @@ -294,8 +292,6 @@ void FreeRegionList::verify_list() { guarantee(_tail == prev0, "Expected %s to end with %u but it ended with %u.", name(), _tail->hrm_index(), prev0->hrm_index()); guarantee(_tail == NULL || _tail->next() == NULL, "_tail should not have a next"); guarantee(length() == count, "%s count mismatch. Expected %u, actual %u.", name(), length(), count); - guarantee(total_capacity_bytes() == capacity, "%s capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, - name(), total_capacity_bytes(), capacity); } // Note on the check_mt_safety() methods below: diff --git a/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp index 1fb4c53330f..f953097ce97 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp @@ -27,22 +27,22 @@ #include "gc/g1/heapRegion.hpp" -#define assert_heap_region_set(p, message) \ - do { \ - assert((p), "[%s] %s ln: %u cy: " SIZE_FORMAT, \ - name(), message, length(), total_capacity_bytes()); \ +#define assert_heap_region_set(p, message) \ + do { \ + assert((p), "[%s] %s ln: %u", \ + name(), message, length()); \ } while (0) -#define guarantee_heap_region_set(p, message) \ - do { \ - guarantee((p), "[%s] %s ln: %u cy: " SIZE_FORMAT, \ - name(), message, length(), total_capacity_bytes()); \ +#define guarantee_heap_region_set(p, message) \ + do { \ + guarantee((p), "[%s] %s ln: %u", \ + name(), message, length()); \ } while (0) -#define assert_free_region_list(p, message) \ - do { \ - assert((p), "[%s] %s ln: %u cy: " SIZE_FORMAT " hd: " PTR_FORMAT " tl: " PTR_FORMAT, \ - name(), message, length(), total_capacity_bytes(), p2i(_head), p2i(_tail)); \ +#define assert_free_region_list(p, message) \ + do { \ + assert((p), "[%s] %s ln: %u hd: " PTR_FORMAT " tl: " PTR_FORMAT, \ + name(), message, length(), p2i(_head), p2i(_tail)); \ } while (0) @@ -63,28 +63,6 @@ class SecondaryFreeRegionListMtSafeChecker : public HRSMtSafeChecker { public: v class HumongousRegionSetMtSafeChecker : public HRSMtSafeChecker { public: void check(); }; class OldRegionSetMtSafeChecker : public HRSMtSafeChecker { public: void check(); }; -class HeapRegionSetCount VALUE_OBJ_CLASS_SPEC { - friend class VMStructs; - uint _length; - size_t _capacity; - -public: - HeapRegionSetCount() : _length(0), _capacity(0) { } - - const uint length() const { return _length; } - const size_t capacity() const { return _capacity; } - - void increment(uint length_to_add, size_t capacity_to_add) { - _length += length_to_add; - _capacity += capacity_to_add; - } - - void decrement(const uint length_to_remove, const size_t capacity_to_remove) { - _length -= length_to_remove; - _capacity -= capacity_to_remove; - } -}; - // Base class for all the classes that represent heap region sets. It // contains the basic attributes that each set needs to maintain // (e.g., length, region num, used bytes sum) plus any shared @@ -98,10 +76,8 @@ private: HRSMtSafeChecker* _mt_safety_checker; protected: - // The number of regions added to the set. If the set contains - // only humongous regions, this reflects only 'starts humongous' - // regions and does not include 'continues humongous' ones. - HeapRegionSetCount _count; + // The number of regions in to the set. + uint _length; const char* _name; @@ -130,13 +106,9 @@ protected: public: const char* name() { return _name; } - uint length() const { return _count.length(); } + uint length() const { return _length; } - bool is_empty() { return _count.length() == 0; } - - size_t total_capacity_bytes() { - return _count.capacity(); - } + bool is_empty() { return _length == 0; } // It updates the fields of the set to reflect hr being added to // the set and tags the region appropriately. @@ -181,8 +153,8 @@ public: HeapRegionSet(const char* name, bool humongous, HRSMtSafeChecker* mt_safety_checker): HeapRegionSetBase(name, humongous, false /* free */, mt_safety_checker) { } - void bulk_remove(const HeapRegionSetCount& removed) { - _count.decrement(removed.length(), removed.capacity()); + void bulk_remove(const uint removed) { + _length -= removed; } }; diff --git a/hotspot/src/share/vm/gc/g1/heapRegionSet.inline.hpp b/hotspot/src/share/vm/gc/g1/heapRegionSet.inline.hpp index f733d567f34..06cdd773840 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionSet.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionSet.inline.hpp @@ -33,7 +33,7 @@ inline void HeapRegionSetBase::add(HeapRegion* hr) { assert_heap_region_set(hr->next() == NULL, "should not already be linked"); assert_heap_region_set(hr->prev() == NULL, "should not already be linked"); - _count.increment(1u, hr->capacity()); + _length++; hr->set_containing_set(this); verify_region(hr); } @@ -45,8 +45,8 @@ inline void HeapRegionSetBase::remove(HeapRegion* hr) { assert_heap_region_set(hr->prev() == NULL, "should already be unlinked"); hr->set_containing_set(NULL); - assert_heap_region_set(_count.length() > 0, "pre-condition"); - _count.decrement(1u, hr->capacity()); + assert_heap_region_set(_length > 0, "pre-condition"); + _length--; } inline void FreeRegionList::add_ordered(HeapRegion* hr) { diff --git a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp index 1fad2b64637..672c4f855ac 100644 --- a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp +++ b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp @@ -59,10 +59,7 @@ nonstatic_field(G1MonitoringSupport, _old_committed, size_t) \ nonstatic_field(G1MonitoringSupport, _old_used, size_t) \ \ - nonstatic_field(HeapRegionSetBase, _count, HeapRegionSetCount) \ - \ - nonstatic_field(HeapRegionSetCount, _length, uint) \ - nonstatic_field(HeapRegionSetCount, _capacity, size_t) \ + nonstatic_field(HeapRegionSetBase, _length, uint) \ \ nonstatic_field(PtrQueue, _active, bool) \ nonstatic_field(PtrQueue, _buf, void**) \ @@ -103,7 +100,6 @@ declare_type(HeapRegion, G1OffsetTableContigSpace) \ declare_toplevel_type(HeapRegionManager) \ declare_toplevel_type(HeapRegionSetBase) \ - declare_toplevel_type(HeapRegionSetCount) \ declare_toplevel_type(G1MonitoringSupport) \ declare_toplevel_type(PtrQueue) \ \ From 27c56ca8af12e7013bbc8228c7060b71e072097c Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Fri, 11 Dec 2015 17:49:40 +0100 Subject: [PATCH 106/228] 8144505: Change G1ParCopyHelper to inherit OopClosure Reviewed-by: mgerdin, stefank --- hotspot/src/share/vm/gc/g1/g1OopClosures.cpp | 3 ++- hotspot/src/share/vm/gc/g1/g1OopClosures.hpp | 14 +++++++------- .../src/share/vm/gc/g1/g1OopClosures.inline.hpp | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp index 1d1c5cb0503..aef1e961d44 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp @@ -31,7 +31,8 @@ #include "utilities/stack.inline.hpp" G1ParCopyHelper::G1ParCopyHelper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : - G1ParClosureSuper(g1, par_scan_state), + _g1(g1), + _par_scan_state(par_scan_state), _worker_id(par_scan_state->worker_id()), _scanned_klass(NULL), _cm(_g1->concurrent_mark()) diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp index c995b9c5d0b..86fadd14a10 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp @@ -86,8 +86,10 @@ public: }; // Add back base class for metadata -class G1ParCopyHelper : public G1ParClosureSuper { +class G1ParCopyHelper : public OopClosure { protected: + G1CollectedHeap* _g1; + G1ParScanThreadState* _par_scan_state; uint _worker_id; // Cache value from par_scan_state. Klass* _scanned_klass; ConcurrentMark* _cm; @@ -125,13 +127,11 @@ template class G1ParCopyClosure : public G1ParCopyHelper { public: G1ParCopyClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : - G1ParCopyHelper(g1, par_scan_state) { - assert(ref_processor() == NULL, "sanity"); - } + G1ParCopyHelper(g1, par_scan_state) { } - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; class G1KlassScanClosure : public KlassClosure { diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp index ff07495f9f6..815c6e1bbc8 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp @@ -256,7 +256,7 @@ void G1ParCopyHelper::mark_forwarded_object(oop from_obj, oop to_obj) { template template -void G1ParCopyClosure::do_oop_nv(T* p) { +void G1ParCopyClosure::do_oop_work(T* p) { T heap_oop = oopDesc::load_heap_oop(p); if (oopDesc::is_null(heap_oop)) { From 79ddc1524897bb7f8083fea68c7675fcb51beca7 Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Fri, 11 Dec 2015 17:49:40 +0100 Subject: [PATCH 107/228] 8144584: Change FilterIntoCSClosure to inherit OopClosure Reviewed-by: kbarrett, mgerdin --- hotspot/src/share/vm/gc/g1/g1OopClosures.hpp | 15 +++++---------- .../src/share/vm/gc/g1/g1OopClosures.inline.hpp | 2 +- hotspot/src/share/vm/gc/g1/g1RemSet.cpp | 2 +- .../vm/gc/g1/g1_specialized_oop_closures.hpp | 2 -- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp index 86fadd14a10..f1cbae22bc7 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp @@ -144,20 +144,15 @@ class G1KlassScanClosure : public KlassClosure { void do_klass(Klass* klass); }; -class FilterIntoCSClosure: public ExtendedOopClosure { +class FilterIntoCSClosure: public OopClosure { G1CollectedHeap* _g1; OopClosure* _oc; - DirtyCardToOopClosure* _dcto_cl; public: - FilterIntoCSClosure( DirtyCardToOopClosure* dcto_cl, - G1CollectedHeap* g1, - OopClosure* oc) : - _dcto_cl(dcto_cl), _g1(g1), _oc(oc) { } + FilterIntoCSClosure(G1CollectedHeap* g1, OopClosure* oc) : _g1(g1), _oc(oc) { } - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } - bool apply_to_weak_ref_discovered_field() { return true; } + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; class FilterOutOfRegionClosure: public ExtendedOopClosure { diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp index 815c6e1bbc8..9aaa408d3e8 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp @@ -42,7 +42,7 @@ */ template -inline void FilterIntoCSClosure::do_oop_nv(T* p) { +inline void FilterIntoCSClosure::do_oop_work(T* p) { T heap_oop = oopDesc::load_heap_oop(p); if (!oopDesc::is_null(heap_oop) && _g1->is_in_cset_or_humongous(oopDesc::decode_heap_oop_not_null(heap_oop))) { diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp index 0b812183c84..7bf28b5debf 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp @@ -448,7 +448,7 @@ bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i, update_rs_oop_cl.set_from(r); G1TriggerClosure trigger_cl; - FilterIntoCSClosure into_cs_cl(NULL, _g1, &trigger_cl); + FilterIntoCSClosure into_cs_cl(_g1, &trigger_cl); G1InvokeIfNotTriggeredClosure invoke_cl(&trigger_cl, &into_cs_cl); G1Mux2Closure mux(&invoke_cl, &update_rs_oop_cl); diff --git a/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp b/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp index 5243d76c4e3..453165471be 100644 --- a/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp @@ -35,7 +35,6 @@ class G1ParScanClosure; class G1ParPushHeapRSClosure; -class FilterIntoCSClosure; class FilterOutOfRegionClosure; class G1CMOopClosure; class G1RootRegionScanClosure; @@ -48,7 +47,6 @@ class G1InvokeIfNotTriggeredClosure; #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f) \ f(G1ParScanClosure,_nv) \ f(G1ParPushHeapRSClosure,_nv) \ - f(FilterIntoCSClosure,_nv) \ f(FilterOutOfRegionClosure,_nv) \ f(G1CMOopClosure,_nv) \ f(G1RootRegionScanClosure,_nv) \ From 33d3e19b81bd476a15bc43e90467cefd491c5bdb Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Fri, 11 Dec 2015 17:49:41 +0100 Subject: [PATCH 108/228] 8144701: Change three G1 remembererd set closures to be OopClosures Reviewed-by: mgerdin, stefank --- hotspot/src/share/vm/gc/g1/g1OopClosures.hpp | 24 +++++++++---------- .../share/vm/gc/g1/g1OopClosures.inline.hpp | 6 ++--- .../vm/gc/g1/g1_specialized_oop_closures.hpp | 10 +------- 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp index f1cbae22bc7..2ba19e33d6c 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp @@ -201,40 +201,40 @@ public: // during an evacuation pause) to record cards containing // pointers into the collection set. -class G1Mux2Closure : public ExtendedOopClosure { +class G1Mux2Closure : public OopClosure { OopClosure* _c1; OopClosure* _c2; public: G1Mux2Closure(OopClosure *c1, OopClosure *c2); - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; // A closure that returns true if it is actually applied // to a reference -class G1TriggerClosure : public ExtendedOopClosure { +class G1TriggerClosure : public OopClosure { bool _triggered; public: G1TriggerClosure(); bool triggered() const { return _triggered; } - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; // A closure which uses a triggering closure to determine // whether to apply an oop closure. -class G1InvokeIfNotTriggeredClosure: public ExtendedOopClosure { +class G1InvokeIfNotTriggeredClosure: public OopClosure { G1TriggerClosure* _trigger_cl; OopClosure* _oop_cl; public: G1InvokeIfNotTriggeredClosure(G1TriggerClosure* t, OopClosure* oc); - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; class G1UpdateRSOrPushRefOopClosure: public OopClosure { diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp index 9aaa408d3e8..b65002af6b4 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp @@ -136,20 +136,20 @@ inline void G1RootRegionScanClosure::do_oop_nv(T* p) { } template -inline void G1Mux2Closure::do_oop_nv(T* p) { +inline void G1Mux2Closure::do_oop_work(T* p) { // Apply first closure; then apply the second. _c1->do_oop(p); _c2->do_oop(p); } template -inline void G1TriggerClosure::do_oop_nv(T* p) { +inline void G1TriggerClosure::do_oop_work(T* p) { // Record that this closure was actually applied (triggered). _triggered = true; } template -inline void G1InvokeIfNotTriggeredClosure::do_oop_nv(T* p) { +inline void G1InvokeIfNotTriggeredClosure::do_oop_work(T* p) { if (!_trigger_cl->triggered()) { _oop_cl->do_oop(p); } diff --git a/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp b/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp index 453165471be..e2698be9963 100644 --- a/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp @@ -39,19 +39,11 @@ class FilterOutOfRegionClosure; class G1CMOopClosure; class G1RootRegionScanClosure; -// Specialized oop closures from g1RemSet.cpp -class G1Mux2Closure; -class G1TriggerClosure; -class G1InvokeIfNotTriggeredClosure; - #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f) \ f(G1ParScanClosure,_nv) \ f(G1ParPushHeapRSClosure,_nv) \ f(FilterOutOfRegionClosure,_nv) \ f(G1CMOopClosure,_nv) \ - f(G1RootRegionScanClosure,_nv) \ - f(G1Mux2Closure,_nv) \ - f(G1TriggerClosure,_nv) \ - f(G1InvokeIfNotTriggeredClosure,_nv) + f(G1RootRegionScanClosure,_nv) #endif // SHARE_VM_GC_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP From d95b280d791fc36cf2b9fc3092ff2264210ddda8 Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Fri, 11 Dec 2015 17:49:42 +0100 Subject: [PATCH 109/228] 8144908: Remove apply_to_weak_ref_discovered_field override for UpdateRSOopClosure Reviewed-by: kbarrett, jmasa --- hotspot/src/share/vm/gc/g1/g1RemSet.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp index 1fe97fb7a81..73034313786 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp @@ -198,10 +198,6 @@ public: virtual void do_oop(narrowOop* p) { do_oop_work(p); } virtual void do_oop(oop* p) { do_oop_work(p); } - - // Override: this closure is idempotent. - // bool idempotent() { return true; } - bool apply_to_weak_ref_discovered_field() { return true; } }; #endif // SHARE_VM_GC_G1_G1REMSET_HPP From ef800bd53f831e1554f04f5a7857501f29d7ef49 Mon Sep 17 00:00:00 2001 From: Frederic Parain Date: Fri, 11 Dec 2015 09:07:07 -0800 Subject: [PATCH 110/228] 8046936: JEP 270: Reserved Stack Areas for Critical Sections Reviewed-by: acorn, dcubed --- .../src/cpu/aarch64/vm/globals_aarch64.hpp | 3 + .../cpu/sparc/vm/c1_LIRAssembler_sparc.cpp | 3 + hotspot/src/cpu/sparc/vm/frame_sparc.cpp | 2 +- .../cpu/sparc/vm/globalDefinitions_sparc.hpp | 4 + hotspot/src/cpu/sparc/vm/globals_sparc.hpp | 3 + .../src/cpu/sparc/vm/interp_masm_sparc.cpp | 13 + .../src/cpu/sparc/vm/macroAssembler_sparc.cpp | 18 ++ .../src/cpu/sparc/vm/macroAssembler_sparc.hpp | 3 + hotspot/src/cpu/sparc/vm/sparc.ad | 4 + .../src/cpu/sparc/vm/stubGenerator_sparc.cpp | 7 +- .../src/cpu/x86/vm/c1_LIRAssembler_x86.cpp | 4 + .../src/cpu/x86/vm/globalDefinitions_x86.hpp | 4 + hotspot/src/cpu/x86/vm/globals_x86.hpp | 3 + hotspot/src/cpu/x86/vm/interp_masm_x86.cpp | 19 ++ hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 16 ++ hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp | 5 +- .../src/cpu/x86/vm/stubGenerator_x86_32.cpp | 5 +- .../src/cpu/x86/vm/stubGenerator_x86_64.cpp | 5 + .../vm/templateInterpreterGenerator_x86.cpp | 4 +- hotspot/src/cpu/x86/vm/x86_32.ad | 12 +- hotspot/src/cpu/x86/vm/x86_64.ad | 7 +- hotspot/src/cpu/zero/vm/globals_zero.hpp | 3 + .../HotSpotResolvedJavaMethodImpl.java | 4 +- .../jdk/vm/ci/hotspot/HotSpotVMConfig.java | 2 +- hotspot/src/os/bsd/vm/os_bsd.cpp | 2 +- hotspot/src/os/bsd/vm/os_bsd.hpp | 2 + hotspot/src/os/linux/vm/os_linux.cpp | 11 +- hotspot/src/os/linux/vm/os_linux.hpp | 2 + hotspot/src/os/solaris/vm/os_solaris.cpp | 3 +- hotspot/src/os/solaris/vm/os_solaris.hpp | 4 +- hotspot/src/os/windows/vm/os_windows.cpp | 44 +++- hotspot/src/os/windows/vm/os_windows.hpp | 4 + hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp | 63 ++++- .../src/os_cpu/linux_x86/vm/os_linux_x86.cpp | 68 ++++- .../solaris_sparc/vm/os_solaris_sparc.cpp | 55 +++- .../os_cpu/solaris_x86/vm/os_solaris_x86.cpp | 64 ++++- hotspot/src/share/vm/c1/c1_Compilation.cpp | 1 + hotspot/src/share/vm/c1/c1_Compilation.hpp | 6 +- hotspot/src/share/vm/c1/c1_GraphBuilder.cpp | 17 +- hotspot/src/share/vm/c1/c1_Runtime1.cpp | 2 +- hotspot/src/share/vm/ci/ciMethod.cpp | 1 + hotspot/src/share/vm/ci/ciMethod.hpp | 4 +- .../share/vm/classfile/classFileParser.cpp | 8 + hotspot/src/share/vm/classfile/vmSymbols.hpp | 1 + .../vm/interpreter/interpreterRuntime.cpp | 21 ++ .../vm/interpreter/interpreterRuntime.hpp | 3 + hotspot/src/share/vm/jvmci/jvmciRuntime.cpp | 2 +- hotspot/src/share/vm/memory/universe.cpp | 10 +- hotspot/src/share/vm/memory/universe.hpp | 4 + hotspot/src/share/vm/oops/method.hpp | 27 +- hotspot/src/share/vm/opto/compile.cpp | 3 +- hotspot/src/share/vm/opto/compile.hpp | 3 + hotspot/src/share/vm/opto/parse1.cpp | 6 +- hotspot/src/share/vm/runtime/arguments.cpp | 6 + .../src/share/vm/runtime/deoptimization.cpp | 2 +- hotspot/src/share/vm/runtime/globals.hpp | 7 + hotspot/src/share/vm/runtime/javaCalls.cpp | 4 +- hotspot/src/share/vm/runtime/os.cpp | 5 +- hotspot/src/share/vm/runtime/os.hpp | 1 + .../src/share/vm/runtime/sharedRuntime.cpp | 86 ++++++- .../src/share/vm/runtime/sharedRuntime.hpp | 5 + hotspot/src/share/vm/runtime/stubRoutines.cpp | 1 + hotspot/src/share/vm/runtime/stubRoutines.hpp | 2 + hotspot/src/share/vm/runtime/thread.cpp | 60 ++++- hotspot/src/share/vm/runtime/thread.hpp | 26 +- .../src/share/vm/runtime/thread.inline.hpp | 8 +- hotspot/src/share/vm/runtime/vmStructs.cpp | 2 +- hotspot/src/share/vm/trace/trace.xml | 7 +- .../ReservedStack/ReservedStackTest.java | 235 ++++++++++++++++++ 69 files changed, 987 insertions(+), 64 deletions(-) create mode 100644 hotspot/test/runtime/ReservedStack/ReservedStackTest.java diff --git a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp index 0182af2400f..8e5ed8c43f0 100644 --- a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp @@ -58,14 +58,17 @@ define_pd_global(intx, InlineFrequencyCount, 100); #define DEFAULT_STACK_YELLOW_PAGES (2) #define DEFAULT_STACK_RED_PAGES (1) #define DEFAULT_STACK_SHADOW_PAGES (4 DEBUG_ONLY(+5)) +#define DEFAULT_STACK_RESERVED_PAGES (0) #define MIN_STACK_YELLOW_PAGES 1 #define MIN_STACK_RED_PAGES 1 #define MIN_STACK_SHADOW_PAGES 1 +#define MIN_STACK_RESERVED_PAGES (0) define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES); define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES); define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES); +define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES); define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp index aa242573d66..82e9bbddf2a 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp @@ -1453,6 +1453,9 @@ void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type, void LIR_Assembler::return_op(LIR_Opr result) { + if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) { + __ reserved_stack_check(); + } // the poll may need a register so just pick one that isn't the return register #if defined(TIERED) && !defined(_LP64) if (result->type_field() == LIR_OprDesc::long_type) { diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp index 6a7df76bfeb..6ee253c4d0b 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp @@ -632,7 +632,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { // stack frames shouldn't be much larger than max_stack elements - if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) { + if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) { return false; } diff --git a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp index 93432223e8d..17492911197 100644 --- a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp @@ -54,4 +54,8 @@ const int StackAlignmentInBytes = (2*wordSize); #endif #endif +#if defined(SOLARIS) +#define SUPPORT_RESERVED_STACK_AREA +#endif + #endif // CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp index 06867066fc1..6c6e3fb15c2 100644 --- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp @@ -54,6 +54,7 @@ define_pd_global(intx, InlineSmallCode, 1500); #define DEFAULT_STACK_YELLOW_PAGES (2) #define DEFAULT_STACK_RED_PAGES (1) +#define DEFAULT_STACK_RESERVED_PAGES (SOLARIS_ONLY(1) NOT_SOLARIS(0)) #ifdef _LP64 // Stack slots are 2X larger in LP64 than in the 32 bit VM. @@ -69,10 +70,12 @@ define_pd_global(intx, VMThreadStackSize, 512); #define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES #define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES #define MIN_STACK_SHADOW_PAGES DEFAULT_STACK_SHADOW_PAGES +#define MIN_STACK_RESERVED_PAGES (0) define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES); define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES); define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES); +define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES); define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp index b53156f1393..1e8d36fbb88 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp @@ -1140,6 +1140,19 @@ void InterpreterMacroAssembler::remove_activation(TosState state, // save result (push state before jvmti call and pop it afterwards) and notify jvmti notify_method_exit(false, state, NotifyJVMTI); + if (StackReservedPages > 0) { + // testing if Stack Reserved Area needs to be re-enabled + Label no_reserved_zone_enabling; + ld_ptr(G2_thread, JavaThread::reserved_stack_activation_offset(), G3_scratch); + cmp_and_brx_short(SP, G3_scratch, Assembler::lessUnsigned, Assembler::pt, no_reserved_zone_enabling); + + call_VM_leaf(noreg, CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), G2_thread); + call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_delayed_StackOverflowError), G2_thread); + should_not_reach_here(); + + bind(no_reserved_zone_enabling); + } + interp_verify_oop(Otos_i, state, __FILE__, __LINE__); verify_thread(); diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index 0d069a48ea5..1759df552e3 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -3601,6 +3601,24 @@ void MacroAssembler::bang_stack_size(Register Rsize, Register Rtsp, } } +void MacroAssembler::reserved_stack_check() { + // testing if reserved zone needs to be enabled + Label no_reserved_zone_enabling; + + ld_ptr(G2_thread, JavaThread::reserved_stack_activation_offset(), G4_scratch); + cmp_and_brx_short(SP, G4_scratch, Assembler::lessUnsigned, Assembler::pt, no_reserved_zone_enabling); + + call_VM_leaf(L0, CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), G2_thread); + + AddressLiteral stub(StubRoutines::throw_delayed_StackOverflowError_entry()); + jump_to(stub, G4_scratch); + delayed()->restore(); + + should_not_reach_here(); + + bind(no_reserved_zone_enabling); +} + /////////////////////////////////////////////////////////////////////////////////// #if INCLUDE_ALL_GCS diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp index d58fc54f1c9..a7703fa0262 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp @@ -1422,6 +1422,9 @@ public: // stack overflow + shadow pages. Clobbers tsp and scratch registers. void bang_stack_size(Register Rsize, Register Rtsp, Register Rscratch); + // Check for reserved stack access in method being exited (for JIT) + void reserved_stack_check(); + virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset); void verify_tlab(); diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index 3b3a848cdb5..336a3cdd19e 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -1294,6 +1294,10 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { __ verify_thread(); + if (StackReservedPages > 0 && C->has_reserved_stack_access()) { + __ reserved_stack_check(); + } + // If this does safepoint polling, then do it here if(do_polling() && ra_->C->is_method_compilation()) { AddressLiteral polling_page(os::get_polling_page()); diff --git a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp index df1b5be8097..98d82ee07e5 100644 --- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp @@ -5355,7 +5355,12 @@ class StubGenerator: public StubCodeGenerator { #endif // COMPILER2 !=> _LP64 // Build this early so it's available for the interpreter. - StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError)); + StubRoutines::_throw_StackOverflowError_entry = + generate_throw_exception("StackOverflowError throw_exception", + CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError)); + StubRoutines::_throw_delayed_StackOverflowError_entry = + generate_throw_exception("delayed StackOverflowError throw_exception", + CAST_FROM_FN_PTR(address, SharedRuntime::throw_delayed_StackOverflowError)); if (UseCRC32Intrinsics) { // set table address before stub generation which use it diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index 6e62429a7ed..bfe8b8c86e9 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -518,6 +518,10 @@ void LIR_Assembler::return_op(LIR_Opr result) { // Pop the stack before the safepoint code __ remove_frame(initial_frame_size_in_bytes()); + if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) { + __ reserved_stack_check(); + } + bool result_is_oop = result->is_valid() ? result->is_oop() : false; // Note: we do not need to round double result; float result has the right precision diff --git a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp index 8ddbdf82ca4..5118e01130b 100644 --- a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp @@ -57,4 +57,8 @@ const int StackAlignmentInBytes = 16; #define INCLUDE_RTM_OPT 1 #endif +#if defined(LINUX) || defined(SOLARIS) || defined(__APPLE__) +#define SUPPORT_RESERVED_STACK_AREA +#endif + #endif // CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index 43c4cca5b2a..07fc7d511b4 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -57,9 +57,11 @@ define_pd_global(intx, InlineSmallCode, 1000); #define DEFAULT_STACK_YELLOW_PAGES (NOT_WINDOWS(2) WINDOWS_ONLY(3)) #define DEFAULT_STACK_RED_PAGES (1) +#define DEFAULT_STACK_RESERVED_PAGES (NOT_WINDOWS(1) WINDOWS_ONLY(0)) #define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES #define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES +#define MIN_STACK_RESERVED_PAGES (0) #ifdef AMD64 // Very large C++ stack frames using solaris-amd64 optimized builds @@ -76,6 +78,7 @@ define_pd_global(intx, InlineSmallCode, 1000); define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES); define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES); define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES); +define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES); define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp index ea4c18d11c6..2ac94e22e17 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp @@ -1023,6 +1023,25 @@ void InterpreterMacroAssembler::remove_activation( // get sender sp movptr(rbx, Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize)); + if (StackReservedPages > 0) { + // testing if reserved zone needs to be re-enabled + Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx); + Label no_reserved_zone_enabling; + + NOT_LP64(get_thread(rthread);) + + cmpptr(rbx, Address(rthread, JavaThread::reserved_stack_activation_offset())); + jcc(Assembler::lessEqual, no_reserved_zone_enabling); + + call_VM_leaf( + CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), rthread); + push(rthread); + call_VM(noreg, CAST_FROM_FN_PTR(address, + InterpreterRuntime::throw_delayed_StackOverflowError)); + should_not_reach_here(); + + bind(no_reserved_zone_enabling); + } leave(); // remove frame anchor pop(ret_addr); // get return address mov(rsp, rbx); // set sp to sender sp diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 50f85fbfa84..59364c7d1df 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -1067,6 +1067,22 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) { } } +void MacroAssembler::reserved_stack_check() { + // testing if reserved zone needs to be enabled + Label no_reserved_zone_enabling; + Register thread = NOT_LP64(rsi) LP64_ONLY(r15_thread); + NOT_LP64(get_thread(rsi);) + + cmpptr(rsp, Address(thread, JavaThread::reserved_stack_activation_offset())); + jcc(Assembler::below, no_reserved_zone_enabling); + + call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), thread); + jump(RuntimeAddress(StubRoutines::throw_delayed_StackOverflowError_entry())); + should_not_reach_here(); + + bind(no_reserved_zone_enabling); +} + int MacroAssembler::biased_locking_enter(Register lock_reg, Register obj_reg, Register swap_reg, diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index b4e440f4383..e185330f231 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -641,6 +641,9 @@ class MacroAssembler: public Assembler { // stack overflow + shadow pages. Also, clobbers tmp void bang_stack_size(Register size, Register tmp); + // Check for reserved stack access in method being exited (for JIT) + void reserved_stack_check(); + virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset); diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 6298be79e33..41373cb3bfe 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -3290,7 +3290,10 @@ class StubGenerator: public StubCodeGenerator { CAST_FROM_FN_PTR(address, SharedRuntime::d2l)); // Build this early so it's available for the interpreter - StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError)); + StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", + CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError)); + StubRoutines::_throw_delayed_StackOverflowError_entry = generate_throw_exception("delayed StackOverflowError throw_exception", + CAST_FROM_FN_PTR(address, SharedRuntime::throw_delayed_StackOverflowError)); if (UseCRC32Intrinsics) { // set table address before stub generation which use it diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index b68bedf1ad6..fa9ae3a14e1 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -4410,6 +4410,11 @@ class StubGenerator: public StubCodeGenerator { CAST_FROM_FN_PTR(address, SharedRuntime:: throw_StackOverflowError)); + StubRoutines::_throw_delayed_StackOverflowError_entry = + generate_throw_exception("delayed StackOverflowError throw_exception", + CAST_FROM_FN_PTR(address, + SharedRuntime:: + throw_delayed_StackOverflowError)); if (UseCRC32Intrinsics) { // set table address before stub generation which use it StubRoutines::_crc_table_adr = (address)StubRoutines::x86::_crc_table; diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp index e011552dfcb..42be5f952b2 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp @@ -541,8 +541,8 @@ void InterpreterGenerator::generate_stack_overflow_check(void) { __ subptr(rax, stack_size); // Use the maximum number of pages we might bang. - const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages) ? StackShadowPages : - (StackRedPages+StackYellowPages); + const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages+StackReservedPages) ? StackShadowPages : + (StackRedPages+StackYellowPages+StackReservedPages); // add in the red and yellow zone sizes __ addptr(rax, max_pages * page_size); diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index 1f38927626c..79f5e2b4462 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -670,17 +670,16 @@ void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream* st ) const { void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { Compile *C = ra_->C; + MacroAssembler _masm(&cbuf); if (C->max_vector_size() > 16) { // Clear upper bits of YMM registers when current compiled code uses // wide vectors to avoid AVX <-> SSE transition penalty during call. - MacroAssembler masm(&cbuf); - masm.vzeroupper(); + _masm.vzeroupper(); } // If method set FPU control word, restore to standard control word if (C->in_24_bit_fp_mode()) { - MacroAssembler masm(&cbuf); - masm.fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std())); + _masm.fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std())); } int framesize = C->frame_size_in_bytes(); @@ -702,6 +701,10 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { emit_opcode(cbuf, 0x58 | EBP_enc); + if (StackReservedPages > 0 && C->has_reserved_stack_access()) { + __ reserved_stack_check(); + } + if (do_polling() && C->is_method_compilation()) { cbuf.relocate(cbuf.insts_end(), relocInfo::poll_return_type, 0); emit_opcode(cbuf,0x85); @@ -729,6 +732,7 @@ uint MachEpilogNode::size(PhaseRegAlloc *ra_) const { } else { size += framesize ? 3 : 0; } + size += 64; // added to support ReservedStackAccess return size; } diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index 9b4f9f9ebce..8a3cd428499 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -953,10 +953,11 @@ void MachEpilogNode::format(PhaseRegAlloc* ra_, outputStream* st) const void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const { Compile* C = ra_->C; + MacroAssembler _masm(&cbuf); + if (C->max_vector_size() > 16) { // Clear upper bits of YMM registers when current compiled code uses // wide vectors to avoid AVX <-> SSE transition penalty during call. - MacroAssembler _masm(&cbuf); __ vzeroupper(); } @@ -984,6 +985,10 @@ void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const // popq rbp emit_opcode(cbuf, 0x58 | RBP_enc); + if (StackReservedPages > 0 && C->has_reserved_stack_access()) { + __ reserved_stack_check(); + } + if (do_polling() && C->is_method_compilation()) { MacroAssembler _masm(&cbuf); AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_return_type); diff --git a/hotspot/src/cpu/zero/vm/globals_zero.hpp b/hotspot/src/cpu/zero/vm/globals_zero.hpp index 00c9d7e8a94..a85e5a92509 100644 --- a/hotspot/src/cpu/zero/vm/globals_zero.hpp +++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp @@ -48,14 +48,17 @@ define_pd_global(intx, InlineSmallCode, 1000 ); #define DEFAULT_STACK_YELLOW_PAGES (2) #define DEFAULT_STACK_RED_PAGES (1) #define DEFAULT_STACK_SHADOW_PAGES (5 LP64_ONLY(+1) DEBUG_ONLY(+3)) +#define DEFAULT_STACK_RESERVED_PAGES (0) #define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES #define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES #define MIN_STACK_SHADOW_PAGES DEFAULT_STACK_SHADOW_PAGES +#define MIN_STACK_RESERVED_PAGES (0) define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES); define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES); define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES); +define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES); define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java index 4b7184e0529..34647ae886c 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -170,7 +170,7 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp * @return flags of this method */ private int getFlags() { - return UNSAFE.getByte(metaspaceMethod + config().methodFlagsOffset); + return UNSAFE.getShort(metaspaceMethod + config().methodFlagsOffset); } /** diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java index 2709c0807ac..2f8decbdeab 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @@ -1244,7 +1244,7 @@ public class HotSpotVMConfig { @HotSpotVMField(name = "Method::_access_flags", type = "AccessFlags", get = HotSpotVMField.Type.OFFSET) @Stable public int methodAccessFlagsOffset; @HotSpotVMField(name = "Method::_constMethod", type = "ConstMethod*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodConstMethodOffset; @HotSpotVMField(name = "Method::_intrinsic_id", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int methodIntrinsicIdOffset; - @HotSpotVMField(name = "Method::_flags", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int methodFlagsOffset; + @HotSpotVMField(name = "Method::_flags", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int methodFlagsOffset; @HotSpotVMField(name = "Method::_vtable_index", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodVtableIndexOffset; @HotSpotVMConstant(name = "Method::_jfr_towrite") @Stable public int methodFlagsJfrTowrite; diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index 058b634e598..0efe55d829d 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -3497,7 +3497,7 @@ jint os::init_2(void) { // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. os::Bsd::min_stack_allowed = MAX2(os::Bsd::min_stack_allowed, - (size_t)(StackYellowPages+StackRedPages+StackShadowPages+ + (size_t)(StackReservedPages+StackYellowPages+StackRedPages+StackShadowPages+ 2*BytesPerWord COMPILER2_PRESENT(+1)) * Bsd::page_size()); size_t threadStackSizeInBytes = ThreadStackSize * K; diff --git a/hotspot/src/os/bsd/vm/os_bsd.hpp b/hotspot/src/os/bsd/vm/os_bsd.hpp index 4c63d532043..22c241ee3cc 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.hpp +++ b/hotspot/src/os/bsd/vm/os_bsd.hpp @@ -99,6 +99,8 @@ class Bsd { static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp); + static bool get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr); + // This boolean allows users to forward their own non-matching signals // to JVM_handle_bsd_signal, harmlessly. static bool signal_handlers_are_installed; diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 3a1769020b8..335a462b254 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -1861,8 +1861,8 @@ void * os::Linux::dll_load_in_vmthread(const char *filename, char *ebuf, JavaThread *jt = Threads::first(); while (jt) { - if (!jt->stack_guard_zone_unused() && // Stack not yet fully initialized - jt->stack_yellow_zone_enabled()) { // No pending stack overflow exceptions + if (!jt->stack_guard_zone_unused() && // Stack not yet fully initialized + jt->stack_guards_enabled()) { // No pending stack overflow exceptions if (!os::guard_memory((char *) jt->stack_red_zone_base() - jt->stack_red_zone_size(), jt->stack_yellow_zone_size() + jt->stack_red_zone_size())) { warning("Attempt to reguard stack yellow zone failed."); @@ -4603,6 +4603,11 @@ void os::init(void) { if (vm_page_size() > (int)Linux::vm_default_page_size()) { StackYellowPages = 1; StackRedPages = 1; +#if defined(IA32) || defined(IA64) + StackReservedPages = 1; +#else + StackReservedPages = 0; +#endif StackShadowPages = round_to((StackShadowPages*Linux::vm_default_page_size()), vm_page_size()) / vm_page_size(); } @@ -4664,7 +4669,7 @@ jint os::init_2(void) { // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed, - (size_t)(StackYellowPages+StackRedPages+StackShadowPages) * Linux::page_size() + + (size_t)(StackReservedPages+StackYellowPages+StackRedPages+StackShadowPages) * Linux::page_size() + (2*BytesPerWord COMPILER2_PRESENT(+1)) * Linux::vm_default_page_size()); size_t threadStackSizeInBytes = ThreadStackSize * K; diff --git a/hotspot/src/os/linux/vm/os_linux.hpp b/hotspot/src/os/linux/vm/os_linux.hpp index cbb649179fb..981dfe3fa2d 100644 --- a/hotspot/src/os/linux/vm/os_linux.hpp +++ b/hotspot/src/os/linux/vm/os_linux.hpp @@ -136,6 +136,8 @@ class Linux { static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp); + static bool get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr); + // This boolean allows users to forward their own non-matching signals // to JVM_handle_linux_signal, harmlessly. static bool signal_handlers_are_installed; diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 6604a3b148a..3f47808051e 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -4382,6 +4382,7 @@ void os::init(void) { if (vm_page_size() > 8*K) { StackYellowPages = 1; StackRedPages = 1; + StackReservedPages = 1; StackShadowPages = round_to((StackShadowPages*8*K), vm_page_size()) / vm_page_size(); } } @@ -4438,7 +4439,7 @@ jint os::init_2(void) { // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. os::Solaris::min_stack_allowed = MAX2(os::Solaris::min_stack_allowed, - (size_t)(StackYellowPages+StackRedPages+StackShadowPages+ + (size_t)(StackReservedPages+StackYellowPages+StackRedPages+StackShadowPages+ 2*BytesPerWord COMPILER2_PRESENT(+1)) * page_size); size_t threadStackSizeInBytes = ThreadStackSize * K; diff --git a/hotspot/src/os/solaris/vm/os_solaris.hpp b/hotspot/src/os/solaris/vm/os_solaris.hpp index 9f5a450fb9a..7928349b63d 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.hpp +++ b/hotspot/src/os/solaris/vm/os_solaris.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -150,6 +150,8 @@ class Solaris { static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp); + static bool get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr); + static void hotspot_sigmask(Thread* thread); // SR_handler diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 7b2bf6d9e9c..47b28e3e43b 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -2374,6 +2374,39 @@ static inline void report_error(Thread* t, DWORD exception_code, // somewhere where we can find it in the minidump. } +bool os::win32::get_frame_at_stack_banging_point(JavaThread* thread, + struct _EXCEPTION_POINTERS* exceptionInfo, address pc, frame* fr) { + PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; + address addr = (address) exceptionRecord->ExceptionInformation[1]; + if (Interpreter::contains(pc)) { + *fr = os::fetch_frame_from_context((void*)exceptionInfo->ContextRecord); + if (!fr->is_first_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } else { + // more complex code with compiled code + assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above"); + CodeBlob* cb = CodeCache::find_blob(pc); + if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) { + // Not sure where the pc points to, fallback to default + // stack overflow handling + return false; + } else { + *fr = os::fetch_frame_from_context((void*)exceptionInfo->ContextRecord); + // in compiled code, the stack banging is performed just after the return pc + // has been pushed on the stack + *fr = frame(fr->sp() + 1, fr->fp(), (address)*(fr->sp())); + if (!fr->is_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } + } + assert(fr->is_java_frame(), "Safety check"); + return true; +} + //----------------------------------------------------------------------------- LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { if (InterceptOSException) return EXCEPTION_CONTINUE_SEARCH; @@ -2550,7 +2583,16 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW)); } #endif - if (thread->stack_yellow_zone_enabled()) { + if (thread->stack_guards_enabled()) { + if (_thread_in_Java) { + frame fr; + PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; + address addr = (address) exceptionRecord->ExceptionInformation[1]; + if (os::win32::get_frame_at_stack_banging_point(thread, exceptionInfo, pc, &fr)) { + assert(fr.is_java_frame(), "Must be a Java frame"); + SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + } + } // Yellow zone violation. The o/s has unprotected the first yellow // zone page for us. Note: must call disable_stack_yellow_zone to // update the enabled status, even if the zone contains only one page. diff --git a/hotspot/src/os/windows/vm/os_windows.hpp b/hotspot/src/os/windows/vm/os_windows.hpp index dd3911c48a7..58abc3510fd 100644 --- a/hotspot/src/os/windows/vm/os_windows.hpp +++ b/hotspot/src/os/windows/vm/os_windows.hpp @@ -110,6 +110,10 @@ class win32 { // Default stack size for the current process. static size_t default_stack_size() { return _default_stack_size; } + static bool get_frame_at_stack_banging_point(JavaThread* thread, + struct _EXCEPTION_POINTERS* exceptionInfo, + address pc, frame* fr); + #ifndef _WIN64 // A wrapper to install a structured exception handler for fast JNI accesors. static address fast_jni_accessor_wrapper(BasicType); diff --git a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp index 413cfc69560..4baa7301553 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp @@ -325,6 +325,7 @@ intptr_t* os::Bsd::ucontext_get_fp(ucontext_t * uc) { // os::Solaris::fetch_frame_from_ucontext() tries to skip nested signal // frames. Currently we don't do that on Bsd, so it's the same as // os::fetch_frame_from_context(). +// This method is also used for stack overflow signal handling. ExtendedPC os::Bsd::fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp) { @@ -362,6 +363,48 @@ frame os::fetch_frame_from_context(void* ucVoid) { return frame(sp, fp, epc.pc()); } +frame os::fetch_frame_from_ucontext(Thread* thread, void* ucVoid) { + intptr_t* sp; + intptr_t* fp; + ExtendedPC epc = os::Bsd::fetch_frame_from_ucontext(thread, (ucontext_t*)ucVoid, &sp, &fp); + return frame(sp, fp, epc.pc()); +} + +bool os::Bsd::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr) { + address pc = (address) os::Bsd::ucontext_get_pc(uc); + if (Interpreter::contains(pc)) { + // interpreter performs stack banging after the fixed frame header has + // been generated while the compilers perform it before. To maintain + // semantic consistency between interpreted and compiled frames, the + // method returns the Java sender of the current frame. + *fr = os::fetch_frame_from_ucontext(thread, uc); + if (!fr->is_first_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } else { + // more complex code with compiled code + assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above"); + CodeBlob* cb = CodeCache::find_blob(pc); + if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) { + // Not sure where the pc points to, fallback to default + // stack overflow handling + return false; + } else { + *fr = os::fetch_frame_from_ucontext(thread, uc); + // in compiled code, the stack banging is performed just after the return pc + // has been pushed on the stack + *fr = frame(fr->sp() + 1, fr->fp(), (address)*(fr->sp())); + if (!fr->is_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } + } + assert(fr->is_java_frame(), "Safety check"); + return true; +} + // By default, gcc always save frame pointer (%ebp/%rbp) on stack. It may get // turned off by -fomit-frame-pointer, frame os::get_sender_for_C_frame(frame* fr) { @@ -479,13 +522,31 @@ JVM_handle_bsd_signal(int sig, addr >= thread->stack_base() - thread->stack_size()) { // stack overflow if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); if (thread->thread_state() == _thread_in_Java) { + if (thread->in_stack_reserved_zone(addr)) { + frame fr; + if (os::Bsd::get_frame_at_stack_banging_point(thread, uc, &fr)) { + assert(fr.is_java_frame(), "Must be a Java frame"); + frame activation = SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + if (activation.sp() != NULL) { + thread->disable_stack_reserved_zone(); + if (activation.is_interpreted_frame()) { + thread->set_reserved_stack_activation((address)( + activation.fp() + frame::interpreter_frame_initial_sp_offset)); + } else { + thread->set_reserved_stack_activation((address)activation.unextended_sp()); + } + return 1; + } + } + } // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. + thread->disable_stack_yellow_zone(); stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); } else { // Thread was in the vm or native code. Return and try to finish. + thread->disable_stack_yellow_zone(); return 1; } } else if (thread->in_stack_red_zone(addr)) { diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp index 438b2673e66..0beebb05add 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp @@ -138,6 +138,7 @@ intptr_t* os::Linux::ucontext_get_fp(ucontext_t * uc) { // os::Solaris::fetch_frame_from_ucontext() tries to skip nested signal // frames. Currently we don't do that on Linux, so it's the same as // os::fetch_frame_from_context(). +// This method is also used for stack overflow signal handling. ExtendedPC os::Linux::fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp) { @@ -175,6 +176,50 @@ frame os::fetch_frame_from_context(void* ucVoid) { return frame(sp, fp, epc.pc()); } +frame os::fetch_frame_from_ucontext(Thread* thread, void* ucVoid) { + intptr_t* sp; + intptr_t* fp; + ExtendedPC epc = os::Linux::fetch_frame_from_ucontext(thread, (ucontext_t*)ucVoid, &sp, &fp); + return frame(sp, fp, epc.pc()); +} + +bool os::Linux::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr) { + address pc = (address) os::Linux::ucontext_get_pc(uc); + if (Interpreter::contains(pc)) { + // interpreter performs stack banging after the fixed frame header has + // been generated while the compilers perform it before. To maintain + // semantic consistency between interpreted and compiled frames, the + // method returns the Java sender of the current frame. + *fr = os::fetch_frame_from_ucontext(thread, uc); + if (!fr->is_first_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } else { + // more complex code with compiled code + assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above"); + CodeBlob* cb = CodeCache::find_blob(pc); + if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) { + // Not sure where the pc points to, fallback to default + // stack overflow handling + return false; + } else { + // in compiled code, the stack banging is performed just after the return pc + // has been pushed on the stack + intptr_t* fp = os::Linux::ucontext_get_fp(uc); + intptr_t* sp = os::Linux::ucontext_get_sp(uc); + *fr = frame(sp + 1, fp, (address)*sp); + if (!fr->is_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + assert(!fr->is_first_frame(), "Safety check"); + *fr = fr->java_sender(); + } + } + } + assert(fr->is_java_frame(), "Safety check"); + return true; +} + // By default, gcc always save frame pointer (%ebp/%rbp) on stack. It may get // turned off by -fomit-frame-pointer, frame os::get_sender_for_C_frame(frame* fr) { @@ -305,13 +350,32 @@ JVM_handle_linux_signal(int sig, addr >= thread->stack_base() - thread->stack_size()) { // stack overflow if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); if (thread->thread_state() == _thread_in_Java) { + if (thread->in_stack_reserved_zone(addr)) { + frame fr; + if (os::Linux::get_frame_at_stack_banging_point(thread, uc, &fr)) { + assert(fr.is_java_frame(), "Must be a Java frame"); + frame activation = + SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + if (activation.sp() != NULL) { + thread->disable_stack_reserved_zone(); + if (activation.is_interpreted_frame()) { + thread->set_reserved_stack_activation((address)( + activation.fp() + frame::interpreter_frame_initial_sp_offset)); + } else { + thread->set_reserved_stack_activation((address)activation.unextended_sp()); + } + return 1; + } + } + } // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. + thread->disable_stack_yellow_zone(); stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); } else { // Thread was in the vm or native code. Return and try to finish. + thread->disable_stack_yellow_zone(); return 1; } } else if (thread->in_stack_red_zone(addr)) { @@ -868,7 +932,7 @@ void os::workaround_expand_exec_shield_cs_limit() { * we don't have much control or understanding of the address space, just let it slide. */ char* hint = (char*) (Linux::initial_thread_stack_bottom() - - ((StackYellowPages + StackRedPages + 1) * page_size)); + ((StackReservedPages + StackYellowPages + StackRedPages + 1) * page_size)); char* codebuf = os::attempt_reserve_memory_at(page_size, hint); if ( (codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true)) ) { return; // No matter, we tried, best effort. diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp index faa33919e98..27666d6b951 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -213,6 +213,7 @@ address os::Solaris::ucontext_get_pc(ucontext_t *uc) { // // The difference between this and os::fetch_frame_from_context() is that // here we try to skip nested signal frames. +// This method is also used for stack overflow signal handling. ExtendedPC os::Solaris::fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp) { @@ -252,6 +253,41 @@ frame os::fetch_frame_from_context(void* ucVoid) { return frame(sp, frame::unpatchable, epc.pc()); } +frame os::fetch_frame_from_ucontext(Thread* thread, void* ucVoid) { + intptr_t* sp; + ExtendedPC epc = os::Solaris::fetch_frame_from_ucontext(thread, (ucontext_t*)ucVoid, &sp, NULL); + return frame(sp, frame::unpatchable, epc.pc()); +} + +bool os::Solaris::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr) { + address pc = (address) os::Solaris::ucontext_get_pc(uc); + if (Interpreter::contains(pc)) { + *fr = os::fetch_frame_from_ucontext(thread, uc); + if (!fr->is_first_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } else { + // more complex code with compiled code + assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above"); + CodeBlob* cb = CodeCache::find_blob(pc); + if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) { + // Not sure where the pc points to, fallback to default + // stack overflow handling + return false; + } else { + *fr = os::fetch_frame_from_ucontext(thread, uc); + *fr = frame(fr->sender_sp(), frame::unpatchable, fr->sender_pc()); + if (!fr->is_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } + } + assert(fr->is_java_frame(), "Safety check"); + return true; +} + frame os::get_sender_for_C_frame(frame* fr) { return frame(fr->sender_sp(), frame::unpatchable, fr->sender_pc()); } @@ -367,17 +403,32 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, if (sig == SIGSEGV && info->si_code == SEGV_ACCERR) { address addr = (address) info->si_addr; if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); // Sometimes the register windows are not properly flushed. if(uc->uc_mcontext.gwins != NULL) { ::handle_unflushed_register_windows(uc->uc_mcontext.gwins); } if (thread->thread_state() == _thread_in_Java) { + if (thread->in_stack_reserved_zone(addr)) { + frame fr; + if (os::Solaris::get_frame_at_stack_banging_point(thread, uc, &fr)) { + assert(fr.is_java_frame(), "Must be a Java frame"); + frame activation = SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + if (activation.sp() != NULL) { + thread->disable_stack_reserved_zone(); + RegisterMap map(thread); + int frame_size = activation.frame_size(&map); + thread->set_reserved_stack_activation((address)(((address)activation.sp()) - STACK_BIAS)); + return true; + } + } + } // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. + thread->disable_stack_yellow_zone(); stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); } else { // Thread was in the vm or native code. Return and try to finish. + thread->disable_stack_yellow_zone(); return true; } } else if (thread->in_stack_red_zone(addr)) { diff --git a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp index a28440fc9ff..e430553f2c2 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp @@ -198,6 +198,7 @@ address os::Solaris::ucontext_get_pc(ucontext_t *uc) { // // The difference between this and os::fetch_frame_from_context() is that // here we try to skip nested signal frames. +// This method is also used for stack overflow signal handling. ExtendedPC os::Solaris::fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp) { @@ -236,6 +237,49 @@ frame os::fetch_frame_from_context(void* ucVoid) { return frame(sp, fp, epc.pc()); } +frame os::fetch_frame_from_ucontext(Thread* thread, void* ucVoid) { + intptr_t* sp; + intptr_t* fp; + ExtendedPC epc = os::Solaris::fetch_frame_from_ucontext(thread, (ucontext_t*)ucVoid, &sp, &fp); + return frame(sp, fp, epc.pc()); +} + +bool os::Solaris::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr) { + address pc = (address) os::Solaris::ucontext_get_pc(uc); + if (Interpreter::contains(pc)) { + // interpreter performs stack banging after the fixed frame header has + // been generated while the compilers perform it before. To maintain + // semantic consistency between interpreted and compiled frames, the + // method returns the Java sender of the current frame. + *fr = os::fetch_frame_from_ucontext(thread, uc); + if (!fr->is_first_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } else { + // more complex code with compiled code + assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above"); + CodeBlob* cb = CodeCache::find_blob(pc); + if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) { + // Not sure where the pc points to, fallback to default + // stack overflow handling + return false; + } else { + // in compiled code, the stack banging is performed just after the return pc + // has been pushed on the stack + intptr_t* fp = os::Solaris::ucontext_get_fp(uc); + intptr_t* sp = os::Solaris::ucontext_get_sp(uc); + *fr = frame(sp + 1, fp, (address)*sp); + if (!fr->is_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } + } + assert(fr->is_java_frame(), "Safety check"); + return true; +} + frame os::get_sender_for_C_frame(frame* fr) { return frame(fr->sender_sp(), fr->link(), fr->sender_pc()); } @@ -422,13 +466,31 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, if (sig == SIGSEGV && info->si_code == SEGV_ACCERR) { address addr = (address) info->si_addr; if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); if (thread->thread_state() == _thread_in_Java) { + if (thread->in_stack_reserved_zone(addr)) { + frame fr; + if (os::Solaris::get_frame_at_stack_banging_point(thread, uc, &fr)) { + assert(fr.is_java_frame(), "Must be Java frame"); + frame activation = SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + if (activation.sp() != NULL) { + thread->disable_stack_reserved_zone(); + if (activation.is_interpreted_frame()) { + thread->set_reserved_stack_activation((address)( + activation.fp() + frame::interpreter_frame_initial_sp_offset)); + } else { + thread->set_reserved_stack_activation((address)activation.unextended_sp()); + } + return true; + } + } + } // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. + thread->disable_stack_yellow_zone(); stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); } else { // Thread was in the vm or native code. Return and try to finish. + thread->disable_stack_yellow_zone(); return true; } } else if (thread->in_stack_red_zone(addr)) { diff --git a/hotspot/src/share/vm/c1/c1_Compilation.cpp b/hotspot/src/share/vm/c1/c1_Compilation.cpp index fc805143d92..c8db6252c85 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.cpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp @@ -551,6 +551,7 @@ Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* metho , _would_profile(false) , _has_unsafe_access(false) , _has_method_handle_invokes(false) +, _has_reserved_stack_access(method->has_reserved_stack_access()) , _bailout_msg(NULL) , _exception_info_list(NULL) , _allocator(NULL) diff --git a/hotspot/src/share/vm/c1/c1_Compilation.hpp b/hotspot/src/share/vm/c1/c1_Compilation.hpp index 66e277d263e..f9f6eca889c 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.hpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,6 +81,7 @@ class Compilation: public StackObj { bool _has_unsafe_access; bool _would_profile; bool _has_method_handle_invokes; // True if this method has MethodHandle invokes. + bool _has_reserved_stack_access; const char* _bailout_msg; ExceptionInfoList* _exception_info_list; ExceptionHandlerTable _exception_handler_table; @@ -171,6 +172,9 @@ class Compilation: public StackObj { bool has_method_handle_invokes() const { return _has_method_handle_invokes; } void set_has_method_handle_invokes(bool z) { _has_method_handle_invokes = z; } + bool has_reserved_stack_access() const { return _has_reserved_stack_access; } + void set_has_reserved_stack_access(bool z) { _has_reserved_stack_access = z; } + DebugInformationRecorder* debug_info_recorder() const; // = _env->debug_info(); Dependencies* dependency_recorder() const; // = _env->dependencies() ImplicitExceptionTable* implicit_exception_table() { return &_implicit_exception_table; } diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 6fac3e7b56d..952ce683db7 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -3322,7 +3322,13 @@ bool GraphBuilder::try_inline(ciMethod* callee, bool holder_known, Bytecodes::Co // method handle invokes if (callee->is_method_handle_intrinsic()) { - return try_method_handle_inline(callee); + if (try_method_handle_inline(callee)) { + if (callee->has_reserved_stack_access()) { + compilation()->set_has_reserved_stack_access(true); + } + return true; + } + return false; } // handle intrinsics @@ -3330,6 +3336,9 @@ bool GraphBuilder::try_inline(ciMethod* callee, bool holder_known, Bytecodes::Co (CheckIntrinsics ? callee->intrinsic_candidate() : true)) { if (try_inline_intrinsics(callee)) { print_inlining(callee, "intrinsic"); + if (callee->has_reserved_stack_access()) { + compilation()->set_has_reserved_stack_access(true); + } return true; } // try normal inlining @@ -3346,8 +3355,12 @@ bool GraphBuilder::try_inline(ciMethod* callee, bool holder_known, Bytecodes::Co if (bc == Bytecodes::_illegal) { bc = code(); } - if (try_inline_full(callee, holder_known, bc, receiver)) + if (try_inline_full(callee, holder_known, bc, receiver)) { + if (callee->has_reserved_stack_access()) { + compilation()->set_has_reserved_stack_access(true); + } return true; + } // Entire compilation could fail during try_inline_full call. // In that case printing inlining decision info is useless. diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index faff84dcbe7..bfd902c9a0b 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -502,7 +502,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // Check the stack guard pages and reenable them if necessary and there is // enough space on the stack to do so. Use fast exceptions only if the guard // pages are enabled. - bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); + bool guard_pages_enabled = thread->stack_guards_enabled(); if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); if (JvmtiExport::can_post_on_exceptions()) { diff --git a/hotspot/src/share/vm/ci/ciMethod.cpp b/hotspot/src/share/vm/ci/ciMethod.cpp index e8d69c1ae3b..cb98f25e1c3 100644 --- a/hotspot/src/share/vm/ci/ciMethod.cpp +++ b/hotspot/src/share/vm/ci/ciMethod.cpp @@ -91,6 +91,7 @@ ciMethod::ciMethod(methodHandle h_m, ciInstanceKlass* holder) : _balanced_monitors = !_uses_monitors || h_m()->access_flags().is_monitor_matching(); _is_c1_compilable = !h_m()->is_not_c1_compilable(); _is_c2_compilable = !h_m()->is_not_c2_compilable(); + _has_reserved_stack_access = h_m()->has_reserved_stack_access(); // Lazy fields, filled in on demand. Require allocation. _code = NULL; _exception_handlers = NULL; diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp index 5b19e95d39f..2adb4e52bb9 100644 --- a/hotspot/src/share/vm/ci/ciMethod.hpp +++ b/hotspot/src/share/vm/ci/ciMethod.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -81,6 +81,7 @@ class ciMethod : public ciMetadata { bool _is_c1_compilable; bool _is_c2_compilable; bool _can_be_statically_bound; + bool _has_reserved_stack_access; // Lazy fields, filled in on demand address _code; @@ -316,6 +317,7 @@ class ciMethod : public ciMetadata { bool is_accessor () const; bool is_initializer () const; bool can_be_statically_bound() const { return _can_be_statically_bound; } + bool has_reserved_stack_access() const { return _has_reserved_stack_access; } bool is_boxing_method() const; bool is_unboxing_method() const; diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 14d6efdba08..cd4518cf201 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -946,6 +946,7 @@ public: _method_HotSpotIntrinsicCandidate, _jdk_internal_vm_annotation_Contended, _field_Stable, + _jdk_internal_vm_annotation_ReservedStackAccess, _annotation_LIMIT }; const Location _location; @@ -2016,6 +2017,11 @@ AnnotationCollector::annotation_index(const ClassLoaderData* loader_data, } return _jdk_internal_vm_annotation_Contended; } + case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_ReservedStackAccess_signature): { + if (_location != _in_method) break; // only allow for methods + if (RestrictReservedStack && !privileged) break; // honor privileges + return _jdk_internal_vm_annotation_ReservedStackAccess; + } default: { break; } @@ -2051,6 +2057,8 @@ void MethodAnnotationCollector::apply_to(methodHandle m) { m->set_hidden(true); if (has_annotation(_method_HotSpotIntrinsicCandidate) && !m->is_synthetic()) m->set_intrinsic_candidate(true); + if (has_annotation(_jdk_internal_vm_annotation_ReservedStackAccess)) + m->set_has_reserved_stack_access(true); } void ClassFileParser::ClassAnnotationCollector::apply_to(InstanceKlass* ik) { diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index da0fca85e5b..cef61cc3aa2 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -212,6 +212,7 @@ template(java_util_concurrent_atomic_AtomicLongFieldUpdater_LockedUpdater, "java/util/concurrent/atomic/AtomicLongFieldUpdater$LockedUpdater") \ template(java_util_concurrent_atomic_AtomicReferenceFieldUpdater_Impl, "java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl") \ template(jdk_internal_vm_annotation_Contended_signature, "Ljdk/internal/vm/annotation/Contended;") \ + template(jdk_internal_vm_annotation_ReservedStackAccess_signature, "Ljdk/internal/vm/annotation/ReservedStackAccess;") \ \ /* class symbols needed by intrinsics */ \ VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, template, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \ diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index 60991b96ca8..077732802f5 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -314,6 +314,27 @@ IRT_ENTRY(void, InterpreterRuntime::throw_StackOverflowError(JavaThread* thread) THROW_HANDLE(exception); IRT_END +IRT_ENTRY(address, InterpreterRuntime::check_ReservedStackAccess_annotated_methods(JavaThread* thread)) + frame fr = thread->last_frame(); + assert(fr.is_java_frame(), "Must be a Java frame"); + frame activation = SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + if (activation.sp() != NULL) { + thread->disable_stack_reserved_zone(); + thread->set_reserved_stack_activation((address)activation.unextended_sp()); + } + return (address)activation.sp(); +IRT_END + + IRT_ENTRY(void, InterpreterRuntime::throw_delayed_StackOverflowError(JavaThread* thread)) + Handle exception = get_preinitialized_exception( + SystemDictionary::StackOverflowError_klass(), + CHECK); + java_lang_Throwable::set_message(exception(), + Universe::delayed_stack_overflow_error_message()); + // Increment counter for hs_err file reporting + Atomic::inc(&Exceptions::_stack_overflow_errors); + THROW_HANDLE(exception); +IRT_END IRT_ENTRY(void, InterpreterRuntime::create_exception(JavaThread* thread, char* name, char* message)) // lookup exception klass diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp index 297102c4f1a..8bf2722442a 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp @@ -91,10 +91,13 @@ class InterpreterRuntime: AllStatic { // Quicken instance-of and check-cast bytecodes static void quicken_io_cc(JavaThread* thread); + static address check_ReservedStackAccess_annotated_methods(JavaThread* thread); + // Exceptions thrown by the interpreter static void throw_AbstractMethodError(JavaThread* thread); static void throw_IncompatibleClassChangeError(JavaThread* thread); static void throw_StackOverflowError(JavaThread* thread); + static void throw_delayed_StackOverflowError(JavaThread* thread); static void throw_ArrayIndexOutOfBoundsException(JavaThread* thread, char* name, jint index); static void throw_ClassCastException(JavaThread* thread, oopDesc* obj); static void create_exception(JavaThread* thread, char* name, char* message); diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp index afcbdf27f82..c401c698fde 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp @@ -248,7 +248,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // Check the stack guard pages and reenable them if necessary and there is // enough space on the stack to do so. Use fast exceptions only if the guard // pages are enabled. - bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); + bool guard_pages_enabled = thread->stack_guards_enabled(); if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); if (JvmtiExport::can_post_on_exceptions()) { diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index 630afe63abf..d9c17bc71d1 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -125,6 +125,7 @@ oop Universe::_out_of_memory_error_class_metaspace = NULL; oop Universe::_out_of_memory_error_array_size = NULL; oop Universe::_out_of_memory_error_gc_overhead_limit = NULL; oop Universe::_out_of_memory_error_realloc_objects = NULL; +oop Universe::_delayed_stack_overflow_error_message = NULL; objArrayOop Universe::_preallocated_out_of_memory_error_array = NULL; volatile jint Universe::_preallocated_out_of_memory_error_avail_count = 0; bool Universe::_verify_in_progress = false; @@ -200,7 +201,8 @@ void Universe::oops_do(OopClosure* f, bool do_all) { f->do_oop((oop*)&_out_of_memory_error_array_size); f->do_oop((oop*)&_out_of_memory_error_gc_overhead_limit); f->do_oop((oop*)&_out_of_memory_error_realloc_objects); - f->do_oop((oop*)&_preallocated_out_of_memory_error_array); + f->do_oop((oop*)&_delayed_stack_overflow_error_message); + f->do_oop((oop*)&_preallocated_out_of_memory_error_array); f->do_oop((oop*)&_null_ptr_exception_instance); f->do_oop((oop*)&_arithmetic_exception_instance); f->do_oop((oop*)&_virtual_machine_error_instance); @@ -909,6 +911,12 @@ bool universe_post_init() { k_h->allocate_instance(CHECK_false); Universe::_out_of_memory_error_realloc_objects = k_h->allocate_instance(CHECK_false); + // Setup preallocated cause message for delayed StackOverflowError + if (StackReservedPages > 0) { + Universe::_delayed_stack_overflow_error_message = + java_lang_String::create_oop_from_str("Delayed StackOverflowError due to ReservedStackAccess annotated method", CHECK_false); + } + // Setup preallocated NullPointerException // (this is currently used for a cheap & dirty solution in compiler exception handling) k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_NullPointerException(), true, CHECK_false); diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp index e55c3e121b2..e7ba90dba12 100644 --- a/hotspot/src/share/vm/memory/universe.hpp +++ b/hotspot/src/share/vm/memory/universe.hpp @@ -159,6 +159,9 @@ class Universe: AllStatic { static oop _out_of_memory_error_gc_overhead_limit; static oop _out_of_memory_error_realloc_objects; + // preallocated cause message for delayed StackOverflowError + static oop _delayed_stack_overflow_error_message; + static Array* _the_empty_int_array; // Canonicalized int array static Array* _the_empty_short_array; // Canonicalized short array static Array* _the_empty_klass_array; // Canonicalized klass obj array @@ -339,6 +342,7 @@ class Universe: AllStatic { static oop out_of_memory_error_array_size() { return gen_out_of_memory_error(_out_of_memory_error_array_size); } static oop out_of_memory_error_gc_overhead_limit() { return gen_out_of_memory_error(_out_of_memory_error_gc_overhead_limit); } static oop out_of_memory_error_realloc_objects() { return gen_out_of_memory_error(_out_of_memory_error_realloc_objects); } + static oop delayed_stack_overflow_error_message() { return _delayed_stack_overflow_error_message; } // Accessors needed for fast allocation static Klass** boolArrayKlassObj_addr() { return &_boolArrayKlassObj; } diff --git a/hotspot/src/share/vm/oops/method.hpp b/hotspot/src/share/vm/oops/method.hpp index fd4e0245068..662d66555a5 100644 --- a/hotspot/src/share/vm/oops/method.hpp +++ b/hotspot/src/share/vm/oops/method.hpp @@ -75,16 +75,17 @@ class Method : public Metadata { // Flags enum Flags { - _jfr_towrite = 1 << 0, - _caller_sensitive = 1 << 1, - _force_inline = 1 << 2, - _dont_inline = 1 << 3, - _hidden = 1 << 4, - _has_injected_profile = 1 << 5, - _running_emcp = 1 << 6, - _intrinsic_candidate = 1 << 7 + _jfr_towrite = 1 << 0, + _caller_sensitive = 1 << 1, + _force_inline = 1 << 2, + _dont_inline = 1 << 3, + _hidden = 1 << 4, + _has_injected_profile = 1 << 5, + _running_emcp = 1 << 6, + _intrinsic_candidate = 1 << 7, + _reserved_stack_access = 1 << 8 }; - mutable u1 _flags; + mutable u2 _flags; #ifndef PRODUCT int _compiled_invocation_count; // Number of nmethod invocations so far (for perf. debugging) @@ -835,6 +836,14 @@ class Method : public Metadata { _flags = x ? (_flags | _has_injected_profile) : (_flags & ~_has_injected_profile); } + bool has_reserved_stack_access() { + return (_flags & _reserved_stack_access) != 0; + } + + void set_has_reserved_stack_access(bool x) { + _flags = x ? (_flags | _reserved_stack_access) : (_flags & ~_reserved_stack_access); + } + ConstMethod::MethodType method_type() const { return _constMethod->method_type(); } diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index 474aee8d8ea..41483faf907 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -672,7 +672,8 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr _print_inlining_idx(0), _print_inlining_output(NULL), _interpreter_frame_size(0), - _max_node_limit(MaxNodeLimit) { + _max_node_limit(MaxNodeLimit), + _has_reserved_stack_access(target->has_reserved_stack_access()) { C = this; #ifndef PRODUCT if (_printer != NULL) { diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp index 27342ed12be..e012ea660f1 100644 --- a/hotspot/src/share/vm/opto/compile.hpp +++ b/hotspot/src/share/vm/opto/compile.hpp @@ -364,6 +364,7 @@ class Compile : public Phase { bool _has_unsafe_access; // True if the method _may_ produce faults in unsafe loads or stores. bool _has_stringbuilder; // True StringBuffers or StringBuilders are allocated bool _has_boxed_value; // True if a boxed object is allocated + bool _has_reserved_stack_access; // True if the method or an inlined method is annotated with ReservedStackAccess int _max_vector_size; // Maximum size of generated vectors uint _trap_hist[trapHistLength]; // Cumulative traps bool _trap_can_recompile; // Have we emitted a recompiling trap? @@ -637,6 +638,8 @@ class Compile : public Phase { void set_has_stringbuilder(bool z) { _has_stringbuilder = z; } bool has_boxed_value() const { return _has_boxed_value; } void set_has_boxed_value(bool z) { _has_boxed_value = z; } + bool has_reserved_stack_access() const { return _has_reserved_stack_access; } + void set_has_reserved_stack_access(bool z) { _has_reserved_stack_access = z; } int max_vector_size() const { return _max_vector_size; } void set_max_vector_size(int s) { _max_vector_size = s; } void set_trap_count(uint r, uint c) { assert(r < trapHistLength, "oob"); _trap_hist[r] = c; } diff --git a/hotspot/src/share/vm/opto/parse1.cpp b/hotspot/src/share/vm/opto/parse1.cpp index f33cc2a2acc..77154c5da07 100644 --- a/hotspot/src/share/vm/opto/parse1.cpp +++ b/hotspot/src/share/vm/opto/parse1.cpp @@ -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 @@ -415,6 +415,10 @@ Parse::Parse(JVMState* caller, ciMethod* parse_method, float expected_uses) _est_switch_depth = 0; #endif + if (parse_method->has_reserved_stack_access()) { + C->set_has_reserved_stack_access(true); + } + _tf = TypeFunc::make(method()); _iter.reset_to_method(method()); _flow = method()->get_flow_analysis(); diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index a33b676ce7c..285e9e228e7 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -2426,6 +2426,12 @@ bool Arguments::check_vm_args_consistency() { warning("The VM option CICompilerCountPerCPU overrides CICompilerCount."); } +#ifndef SUPPORT_RESERVED_STACK_AREA + if (StackReservedPages != 0) { + FLAG_SET_CMDLINE(intx, StackReservedPages, 0); + warning("Reserved Stack Area not supported on this platform"); + } +#endif return status; } diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index 3b061d36bf9..a1711971464 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -1431,7 +1431,7 @@ void Deoptimization::load_class_by_index(const constantPoolHandle& constant_pool // stack bang causes a stack overflow we crash. assert(THREAD->is_Java_thread(), "only a java thread can be here"); JavaThread* thread = (JavaThread*)THREAD; - bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); + bool guard_pages_enabled = thread->stack_guards_enabled(); if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); assert(guard_pages_enabled, "stack banging in uncommon trap blob may cause crash"); } diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index c0764db8f92..18625166245 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -3438,6 +3438,13 @@ public: "Number of red zone (unrecoverable overflows) pages") \ range(MIN_STACK_RED_PAGES, (DEFAULT_STACK_RED_PAGES+2)) \ \ + product_pd(intx, StackReservedPages, \ + "Number of reserved zone (reserved to annotated methods) pages") \ + range(MIN_STACK_RESERVED_PAGES, (DEFAULT_STACK_RESERVED_PAGES+10))\ + \ + product(bool, RestrictReservedStack, true, \ + "Restrict @ReservedStackAccess to trusted classes") \ + \ /* greater stack shadow pages can't generate instruction to bang stack */ \ product_pd(intx, StackShadowPages, \ "Number of shadow zone (for overflow checking) pages " \ diff --git a/hotspot/src/share/vm/runtime/javaCalls.cpp b/hotspot/src/share/vm/runtime/javaCalls.cpp index 9acd0200b29..e0a04e6d3bc 100644 --- a/hotspot/src/share/vm/runtime/javaCalls.cpp +++ b/hotspot/src/share/vm/runtime/javaCalls.cpp @@ -371,9 +371,9 @@ void JavaCalls::call_helper(JavaValue* result, const methodHandle& method, JavaC // Find receiver Handle receiver = (!method->is_static()) ? args->receiver() : Handle(); - // When we reenter Java, we need to reenable the yellow zone which + // When we reenter Java, we need to reenable the reserved/yellow zone which // might already be disabled when we are in VM. - if (thread->stack_yellow_zone_disabled()) { + if (!thread->stack_guards_enabled()) { thread->reguard_stack(); } diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 4be64a724d2..e1c71bf1406 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -1386,8 +1386,9 @@ bool os::stack_shadow_pages_available(Thread *thread, const methodHandle& method // respectively. const int framesize_in_bytes = Interpreter::size_top_interpreter_activation(method()) * wordSize; - int reserved_area = ((StackShadowPages + StackRedPages + StackYellowPages) - * vm_page_size()) + framesize_in_bytes; + int reserved_area = ((StackShadowPages + StackRedPages + StackYellowPages + + StackReservedPages) * vm_page_size()) + + framesize_in_bytes; // The very lower end of the stack address stack_limit = thread->stack_base() - thread->stack_size(); return (sp > (stack_limit + reserved_area)); diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index ef8b2954518..1dd6f1bebf5 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -473,6 +473,7 @@ class os: AllStatic { static ExtendedPC fetch_frame_from_context(void* ucVoid, intptr_t** sp, intptr_t** fp); static frame fetch_frame_from_context(void* ucVoid); + static frame fetch_frame_from_ucontext(Thread* thread, void* ucVoid); static ExtendedPC get_thread_pc(Thread *thread); static void breakpoint(); diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index e1d1392131d..12a657ea589 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -57,6 +57,7 @@ #include "runtime/stubRoutines.hpp" #include "runtime/vframe.hpp" #include "runtime/vframeArray.hpp" +#include "trace/tracing.hpp" #include "utilities/copy.hpp" #include "utilities/dtrace.hpp" #include "utilities/events.hpp" @@ -487,8 +488,11 @@ address SharedRuntime::raw_exception_handler_for_return_address(JavaThread* thre // unguarded. Reguard the stack otherwise if we return to the // deopt blob and the stack bang causes a stack overflow we // crash. - bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); + bool guard_pages_enabled = thread->stack_guards_enabled(); if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); + if (thread->reserved_stack_activation() != thread->stack_base()) { + thread->set_reserved_stack_activation(thread->stack_base()); + } assert(guard_pages_enabled, "stack banging in deopt blob may cause crash"); return SharedRuntime::deopt_blob()->unpack_with_exception(); } else { @@ -761,10 +765,23 @@ JRT_ENTRY(void, SharedRuntime::throw_NullPointerException_at_call(JavaThread* th JRT_END JRT_ENTRY(void, SharedRuntime::throw_StackOverflowError(JavaThread* thread)) + throw_StackOverflowError_common(thread, false); +JRT_END + +JRT_ENTRY(void, SharedRuntime::throw_delayed_StackOverflowError(JavaThread* thread)) + throw_StackOverflowError_common(thread, true); +JRT_END + +void SharedRuntime::throw_StackOverflowError_common(JavaThread* thread, bool delayed) { // We avoid using the normal exception construction in this case because // it performs an upcall to Java, and we're already out of stack space. + Thread* THREAD = thread; Klass* k = SystemDictionary::StackOverflowError_klass(); oop exception_oop = InstanceKlass::cast(k)->allocate_instance(CHECK); + if (delayed) { + java_lang_Throwable::set_message(exception_oop, + Universe::delayed_stack_overflow_error_message()); + } Handle exception (thread, exception_oop); if (StackTraceInThrowable) { java_lang_Throwable::fill_in_stack_trace(exception); @@ -772,7 +789,7 @@ JRT_ENTRY(void, SharedRuntime::throw_StackOverflowError(JavaThread* thread)) // Increment counter for hs_err file reporting Atomic::inc(&Exceptions::_stack_overflow_errors); throw_and_post_jvmti_exception(thread, exception); -JRT_END +} #if INCLUDE_JVMCI address SharedRuntime::deoptimize_for_implicit_exception(JavaThread* thread, address pc, nmethod* nm, int deopt_reason) { @@ -2934,3 +2951,68 @@ void AdapterHandlerLibrary::print_statistics() { } #endif /* PRODUCT */ + +JRT_LEAF(void, SharedRuntime::enable_stack_reserved_zone(JavaThread* thread)) + assert(thread->is_Java_thread(), "Only Java threads have a stack reserved zone"); + thread->enable_stack_reserved_zone(); + thread->set_reserved_stack_activation(thread->stack_base()); +JRT_END + +frame SharedRuntime::look_for_reserved_stack_annotated_method(JavaThread* thread, frame fr) { + frame activation; + int decode_offset = 0; + nmethod* nm = NULL; + frame prv_fr = fr; + int count = 1; + + assert(fr.is_java_frame(), "Must start on Java frame"); + + while (!fr.is_first_frame()) { + Method* method = NULL; + // Compiled java method case. + if (decode_offset != 0) { + DebugInfoReadStream stream(nm, decode_offset); + decode_offset = stream.read_int(); + method = (Method*)nm->metadata_at(stream.read_int()); + } else { + if (fr.is_first_java_frame()) break; + address pc = fr.pc(); + prv_fr = fr; + if (fr.is_interpreted_frame()) { + method = fr.interpreter_frame_method(); + fr = fr.java_sender(); + } else { + CodeBlob* cb = fr.cb(); + fr = fr.java_sender(); + if (cb == NULL || !cb->is_nmethod()) { + continue; + } + nm = (nmethod*)cb; + if (nm->method()->is_native()) { + method = nm->method(); + } else { + PcDesc* pd = nm->pc_desc_at(pc); + assert(pd != NULL, "PcDesc must not be NULL"); + decode_offset = pd->scope_decode_offset(); + // if decode_offset is not equal to 0, it will execute the + // "compiled java method case" at the beginning of the loop. + continue; + } + } + } + if (method->has_reserved_stack_access()) { + ResourceMark rm(thread); + activation = prv_fr; + warning("Potentially dangerous stack overflow in " + "ReservedStackAccess annotated method %s [%d]", + method->name_and_sig_as_C_string(), count++); + EventReservedStackActivation event; + if (event.should_commit()) { + event.set_method(method); + event.commit(); + } + } + } + return activation; +} + diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.hpp b/hotspot/src/share/vm/runtime/sharedRuntime.hpp index d41145435bb..b46a5037896 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp @@ -201,6 +201,8 @@ class SharedRuntime: AllStatic { static void throw_NullPointerException(JavaThread* thread); static void throw_NullPointerException_at_call(JavaThread* thread); static void throw_StackOverflowError(JavaThread* thread); + static void throw_delayed_StackOverflowError(JavaThread* thread); + static void throw_StackOverflowError_common(JavaThread* thread, bool delayed); static address continuation_for_implicit_exception(JavaThread* thread, address faulting_pc, ImplicitExceptionKind exception_kind); @@ -208,6 +210,9 @@ class SharedRuntime: AllStatic { static address deoptimize_for_implicit_exception(JavaThread* thread, address pc, nmethod* nm, int deopt_reason); #endif + static void enable_stack_reserved_zone(JavaThread* thread); + static frame look_for_reserved_stack_annotated_method(JavaThread* thread, frame fr); + // Shared stub locations static address get_poll_stub(address pc); diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp index fef7c0b3b03..7bce6760d07 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.cpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp @@ -54,6 +54,7 @@ address StubRoutines::_throw_AbstractMethodError_entry = NULL; address StubRoutines::_throw_IncompatibleClassChangeError_entry = NULL; address StubRoutines::_throw_NullPointerException_at_call_entry = NULL; address StubRoutines::_throw_StackOverflowError_entry = NULL; +address StubRoutines::_throw_delayed_StackOverflowError_entry = NULL; address StubRoutines::_handler_for_unsafe_access_entry = NULL; jint StubRoutines::_verify_oop_count = 0; address StubRoutines::_verify_oop_subroutine_entry = NULL; diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index ac198d0746c..edc3acb3ac1 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -111,6 +111,7 @@ class StubRoutines: AllStatic { static address _throw_IncompatibleClassChangeError_entry; static address _throw_NullPointerException_at_call_entry; static address _throw_StackOverflowError_entry; + static address _throw_delayed_StackOverflowError_entry; static address _handler_for_unsafe_access_entry; static address _atomic_xchg_entry; @@ -275,6 +276,7 @@ class StubRoutines: AllStatic { static address throw_IncompatibleClassChangeError_entry(){ return _throw_IncompatibleClassChangeError_entry; } static address throw_NullPointerException_at_call_entry(){ return _throw_NullPointerException_at_call_entry; } static address throw_StackOverflowError_entry() { return _throw_StackOverflowError_entry; } + static address throw_delayed_StackOverflowError_entry() { return _throw_delayed_StackOverflowError_entry; } // Exceptions during unsafe access - should throw Java exception rather // than crash. diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 6ee4c82dc73..12773612f19 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -307,6 +307,7 @@ void Thread::record_stack_base_and_size() { set_stack_size(os::current_stack_size()); if (is_Java_thread()) { ((JavaThread*) this)->set_stack_overflow_limit(); + ((JavaThread*) this)->set_reserved_stack_activation(stack_base()); } // CR 7190089: on Solaris, primordial thread's stack is adjusted // in initialize_thread(). Without the adjustment, stack size is @@ -908,7 +909,7 @@ bool Thread::is_in_stack(address adr) const { bool Thread::is_in_usable_stack(address adr) const { - size_t stack_guard_size = os::uses_stack_guard_pages() ? (StackYellowPages + StackRedPages) * os::vm_page_size() : 0; + size_t stack_guard_size = os::uses_stack_guard_pages() ? (StackReservedPages + StackYellowPages + StackRedPages) * os::vm_page_size() : 0; size_t usable_stack_size = _stack_size - stack_guard_size; return ((adr < stack_base()) && (adr >= stack_base() - usable_stack_size)); @@ -1460,6 +1461,7 @@ void JavaThread::initialize() { _jvmci_counters = NULL; } #endif // INCLUDE_JVMCI + _reserved_stack_activation = NULL; // stack base not known yet (void)const_cast(_exception_oop = oop(NULL)); _exception_pc = 0; _exception_handler_pc = 0; @@ -1532,7 +1534,8 @@ JavaThread::JavaThread(bool is_attaching_via_jni) : } bool JavaThread::reguard_stack(address cur_sp) { - if (_stack_guard_state != stack_guard_yellow_disabled) { + if (_stack_guard_state != stack_guard_yellow_disabled + && _stack_guard_state != stack_guard_reserved_disabled) { return true; // Stack already guarded or guard pages not needed. } @@ -1549,8 +1552,15 @@ bool JavaThread::reguard_stack(address cur_sp) { // some exception code in c1, c2 or the interpreter isn't unwinding // when it should. guarantee(cur_sp > stack_yellow_zone_base(), "not enough space to reguard - increase StackShadowPages"); - - enable_stack_yellow_zone(); + if (_stack_guard_state == stack_guard_yellow_disabled) { + enable_stack_yellow_zone(); + if (reserved_stack_activation() != stack_base()) { + set_reserved_stack_activation(stack_base()); + } + } else if (_stack_guard_state == stack_guard_reserved_disabled) { + set_reserved_stack_activation(stack_base()); + enable_stack_reserved_zone(); + } return true; } @@ -2473,7 +2483,7 @@ void JavaThread::java_resume() { void JavaThread::create_stack_guard_pages() { if (! os::uses_stack_guard_pages() || _stack_guard_state != stack_guard_unused) return; address low_addr = stack_base() - stack_size(); - size_t len = (StackYellowPages + StackRedPages) * os::vm_page_size(); + size_t len = (StackReservedPages + StackYellowPages + StackRedPages) * os::vm_page_size(); int allocate = os::allocate_stack_guard_pages(); // warning("Guarding at " PTR_FORMAT " for len " SIZE_FORMAT "\n", low_addr, len); @@ -2497,7 +2507,7 @@ void JavaThread::remove_stack_guard_pages() { assert(Thread::current() == this, "from different thread"); if (_stack_guard_state == stack_guard_unused) return; address low_addr = stack_base() - stack_size(); - size_t len = (StackYellowPages + StackRedPages) * os::vm_page_size(); + size_t len = (StackReservedPages + StackYellowPages + StackRedPages) * os::vm_page_size(); if (os::allocate_stack_guard_pages()) { if (os::remove_stack_guard_pages((char *) low_addr, len)) { @@ -2515,6 +2525,44 @@ void JavaThread::remove_stack_guard_pages() { } } +void JavaThread::enable_stack_reserved_zone() { + assert(_stack_guard_state != stack_guard_unused, "must be using guard pages."); + assert(_stack_guard_state != stack_guard_enabled, "already enabled"); + + // The base notation is from the stack's point of view, growing downward. + // We need to adjust it to work correctly with guard_memory() + address base = stack_reserved_zone_base() - stack_reserved_zone_size(); + + guarantee(base < stack_base(),"Error calculating stack reserved zone"); + guarantee(base < os::current_stack_pointer(),"Error calculating stack reserved zone"); + + if (os::guard_memory((char *) base, stack_reserved_zone_size())) { + _stack_guard_state = stack_guard_enabled; + } else { + warning("Attempt to guard stack reserved zone failed."); + } + enable_register_stack_guard(); +} + +void JavaThread::disable_stack_reserved_zone() { + assert(_stack_guard_state != stack_guard_unused, "must be using guard pages."); + assert(_stack_guard_state != stack_guard_reserved_disabled, "already disabled"); + + // Simply return if called for a thread that does not use guard pages. + if (_stack_guard_state == stack_guard_unused) return; + + // The base notation is from the stack's point of view, growing downward. + // We need to adjust it to work correctly with guard_memory() + address base = stack_reserved_zone_base() - stack_reserved_zone_size(); + + if (os::unguard_memory((char *)base, stack_reserved_zone_size())) { + _stack_guard_state = stack_guard_reserved_disabled; + } else { + warning("Attempt to unguard stack reserved zone failed."); + } + disable_register_stack_guard(); +} + void JavaThread::enable_stack_yellow_zone() { assert(_stack_guard_state != stack_guard_unused, "must be using guard pages."); assert(_stack_guard_state != stack_guard_enabled, "already enabled"); diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index c74d54f4b7a..8948ed0ddaf 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -909,6 +909,7 @@ class JavaThread: public Thread { // State of the stack guard pages for this thread. enum StackGuardState { stack_guard_unused, // not needed + stack_guard_reserved_disabled, stack_guard_yellow_disabled,// disabled (temporarily) after stack overflow stack_guard_enabled // enabled }; @@ -957,6 +958,7 @@ class JavaThread: public Thread { // Precompute the limit of the stack as used in stack overflow checks. // We load it from here to simplify the stack overflow check in assembly. address _stack_overflow_limit; + address _reserved_stack_activation; // Compiler exception handling (NOTE: The _exception_oop is *NOT* the same as _pending_exception. It is // used to temp. parsing values into and out of the runtime system during exception handling for compiled @@ -1343,18 +1345,25 @@ class JavaThread: public Thread { // Stack overflow support inline size_t stack_available(address cur_sp); + address stack_reserved_zone_base() { + return stack_yellow_zone_base(); } + size_t stack_reserved_zone_size() { + return StackReservedPages * os::vm_page_size(); } address stack_yellow_zone_base() { return (address)(stack_base() - (stack_size() - (stack_red_zone_size() + stack_yellow_zone_size()))); } size_t stack_yellow_zone_size() { - return StackYellowPages * os::vm_page_size(); + return StackYellowPages * os::vm_page_size() + stack_reserved_zone_size(); } address stack_red_zone_base() { return (address)(stack_base() - (stack_size() - stack_red_zone_size())); } size_t stack_red_zone_size() { return StackRedPages * os::vm_page_size(); } + bool in_stack_reserved_zone(address a) { + return (a <= stack_reserved_zone_base()) && (a >= (address)((intptr_t)stack_reserved_zone_base() - stack_reserved_zone_size())); + } bool in_stack_yellow_zone(address a) { return (a <= stack_yellow_zone_base()) && (a >= stack_red_zone_base()); } @@ -1366,6 +1375,8 @@ class JavaThread: public Thread { void create_stack_guard_pages(); void remove_stack_guard_pages(); + void enable_stack_reserved_zone(); + void disable_stack_reserved_zone(); void enable_stack_yellow_zone(); void disable_stack_yellow_zone(); void enable_stack_red_zone(); @@ -1373,7 +1384,16 @@ class JavaThread: public Thread { inline bool stack_guard_zone_unused(); inline bool stack_yellow_zone_disabled(); - inline bool stack_yellow_zone_enabled(); + inline bool stack_reserved_zone_disabled(); + inline bool stack_guards_enabled(); + + address reserved_stack_activation() const { return _reserved_stack_activation; } + void set_reserved_stack_activation(address addr) { + assert(_reserved_stack_activation == stack_base() + || _reserved_stack_activation == NULL + || addr == stack_base(), "Must not be set twice"); + _reserved_stack_activation = addr; + } // Attempt to reguard the stack after a stack overflow may have occurred. // Returns true if (a) guard pages are not needed on this thread, (b) the @@ -1390,6 +1410,7 @@ class JavaThread: public Thread { void set_stack_overflow_limit() { _stack_overflow_limit = _stack_base - _stack_size + ((StackShadowPages + + StackReservedPages + StackYellowPages + StackRedPages) * os::vm_page_size()); } @@ -1439,6 +1460,7 @@ class JavaThread: public Thread { static ByteSize stack_overflow_limit_offset() { return byte_offset_of(JavaThread, _stack_overflow_limit); } static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); } static ByteSize stack_guard_state_offset() { return byte_offset_of(JavaThread, _stack_guard_state); } + static ByteSize reserved_stack_activation_offset() { return byte_offset_of(JavaThread, _reserved_stack_activation); } static ByteSize suspend_flags_offset() { return byte_offset_of(JavaThread, _suspend_flags); } static ByteSize do_not_unlock_if_synchronized_offset() { return byte_offset_of(JavaThread, _do_not_unlock_if_synchronized); } diff --git a/hotspot/src/share/vm/runtime/thread.inline.hpp b/hotspot/src/share/vm/runtime/thread.inline.hpp index a6fb4a63979..213d5ecffa0 100644 --- a/hotspot/src/share/vm/runtime/thread.inline.hpp +++ b/hotspot/src/share/vm/runtime/thread.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -130,6 +130,10 @@ inline bool JavaThread::stack_yellow_zone_disabled() { return _stack_guard_state == stack_guard_yellow_disabled; } +inline bool JavaThread::stack_reserved_zone_disabled() { + return _stack_guard_state == stack_guard_reserved_disabled; +} + inline size_t JavaThread::stack_available(address cur_sp) { // This code assumes java stacks grow down address low_addr; // Limit on the address for deepest stack depth @@ -141,7 +145,7 @@ inline size_t JavaThread::stack_available(address cur_sp) { return cur_sp > low_addr ? cur_sp - low_addr : 0; } -inline bool JavaThread::stack_yellow_zone_enabled() { +inline bool JavaThread::stack_guards_enabled() { #ifdef ASSERT if (os::uses_stack_guard_pages()) { assert(_stack_guard_state != stack_guard_unused, "guard pages must be in use"); diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 7ceb45ebd5e..5be0aaaba95 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -396,7 +396,7 @@ typedef CompactHashtable SymbolCompactHashTable; nonstatic_field(Method, _access_flags, AccessFlags) \ nonstatic_field(Method, _vtable_index, int) \ nonstatic_field(Method, _intrinsic_id, u2) \ - nonstatic_field(Method, _flags, u1) \ + nonstatic_field(Method, _flags, u2) \ nonproduct_nonstatic_field(Method, _compiled_invocation_count, int) \ volatile_nonstatic_field(Method, _code, nmethod*) \ nonstatic_field(Method, _i2i_entry, address) \ diff --git a/hotspot/src/share/vm/trace/trace.xml b/hotspot/src/share/vm/trace/trace.xml index c1f4dfb88de..d2c5625c015 100644 --- a/hotspot/src/share/vm/trace/trace.xml +++ b/hotspot/src/share/vm/trace/trace.xml @@ -1,6 +1,6 @@ 8-------- /etc/hosts ----------->8--- + * 127.0.0.1 localhost + * 192.168.0.1 localhost + * ----->8-------- /etc/hosts ----------->8--- + * + * @test + * @bug 6425769 + * @summary Test JMX agent host address binding. Same ports but different + * interfaces to bind to (using plain sockets and SSL sockets). + * + * @modules java.management/sun.management + * java.management/sun.management.jmxremote + * @library /lib/testlibrary + * @build jdk.testlibrary.* JMXAgentInterfaceBinding + * @run main/timeout=5 JMXInterfaceBindingTest + */ +public class JMXInterfaceBindingTest { + + public static final int COMMUNICATION_ERROR_EXIT_VAL = 1; + public static final int STOP_PROCESS_EXIT_VAL = 143; + public static final int JMX_PORT = 9111; + public static final int RMI_PORT = 9112; + public static final String READY_MSG = "MainThread: Ready for connections"; + public static final String TEST_CLASS = JMXAgentInterfaceBinding.class.getSimpleName(); + public static final String KEYSTORE_LOC = System.getProperty("test.src", ".") + + File.separator + + "ssl" + + File.separator + + "keystore"; + public static final String TRUSTSTORE_LOC = System.getProperty("test.src", ".") + + File.separator + + "ssl" + + File.separator + + "truststore"; + public static final String TEST_CLASSPATH = System.getProperty("test.classes", "."); + + public void run(InetAddress[] addrs) { + System.out.println("DEBUG: Running tests with plain sockets."); + runTests(addrs, false); + System.out.println("DEBUG: Running tests with SSL sockets."); + runTests(addrs, true); + } + + private void runTests(InetAddress[] addrs, boolean useSSL) { + ProcessThread[] jvms = new ProcessThread[addrs.length]; + for (int i = 0; i < addrs.length; i++) { + System.out.println(); + String msg = String.format("DEBUG: Launching java tester for triplet (HOSTNAME,JMX_PORT,RMI_PORT) == (%s,%d,%d)", + addrs[i].getHostAddress(), + JMX_PORT, + RMI_PORT); + System.out.println(msg); + jvms[i] = runJMXBindingTest(addrs[i], useSSL); + jvms[i].start(); + System.out.println("DEBUG: Started " + (i + 1) + " Process(es)."); + } + int failedProcesses = 0; + for (ProcessThread pt: jvms) { + try { + pt.stopProcess(); + pt.join(); + } catch (InterruptedException e) { + System.err.println("Failed to stop process: " + pt.getName()); + throw new RuntimeException("Test failed", e); + } + int exitValue = pt.getOutput().getExitValue(); + // If there is a communication error (the case we care about) + // we get a exit code of 1 + if (exitValue == COMMUNICATION_ERROR_EXIT_VAL) { + // Failure case since the java processes should still be + // running. + System.err.println("Test FAILURE on " + pt.getName()); + failedProcesses++; + } else if (exitValue == STOP_PROCESS_EXIT_VAL) { + System.out.println("DEBUG: OK. Spawned java process terminated with expected exit code of " + STOP_PROCESS_EXIT_VAL); + } else { + System.err.println("Test FAILURE on " + pt.getName() + " reason: Unexpected exit code => " + exitValue); + failedProcesses++; + } + } + if (failedProcesses > 0) { + throw new RuntimeException("Test FAILED. " + failedProcesses + " out of " + addrs.length + " process(es) failed to start the JMX agent."); + } + } + + private ProcessThread runJMXBindingTest(InetAddress a, boolean useSSL) { + List args = new ArrayList<>(); + args.add("-classpath"); + args.add(TEST_CLASSPATH); + args.add("-Dcom.sun.management.jmxremote.host=" + a.getHostAddress()); + args.add("-Dcom.sun.management.jmxremote.port=" + JMX_PORT); + args.add("-Dcom.sun.management.jmxremote.rmi.port=" + RMI_PORT); + args.add("-Dcom.sun.management.jmxremote.authenticate=false"); + args.add("-Dcom.sun.management.jmxremote.ssl=" + Boolean.toString(useSSL)); + if (useSSL) { + args.add("-Dcom.sun.management.jmxremote.registry.ssl=true"); + args.add("-Djavax.net.ssl.keyStore=" + KEYSTORE_LOC); + args.add("-Djavax.net.ssl.trustStore=" + TRUSTSTORE_LOC); + args.add("-Djavax.net.ssl.keyStorePassword=password"); + args.add("-Djavax.net.ssl.trustStorePassword=trustword"); + } + args.add(TEST_CLASS); + args.add(a.getHostAddress()); + args.add(Integer.toString(JMX_PORT)); + args.add(Integer.toString(RMI_PORT)); + args.add(Boolean.toString(useSSL)); + try { + ProcessBuilder builder = ProcessTools.createJavaProcessBuilder(args.toArray(new String[] {})); + System.out.println(ProcessTools.getCommandLine(builder)); + ProcessThread jvm = new ProcessThread("JMX-Tester-" + a.getHostAddress(), JMXInterfaceBindingTest::isJMXAgentResponseAvailable, builder); + return jvm; + } catch (Exception e) { + throw new RuntimeException("Test failed", e); + } + + } + + private static boolean isJMXAgentResponseAvailable(String line) { + if (line.equals(READY_MSG)) { + System.out.println("DEBUG: Found expected READY_MSG."); + return true; + } else if (line.startsWith("Error:")) { + // Allow for a JVM process that exits with + // "Error: JMX connector server communication error: ..." + // to continue as well since we handle that case elsewhere. + // This has the effect that the test does not timeout and + // fails with an exception in the test. + System.err.println("PROBLEM: JMX agent of target JVM did not start as it should."); + return true; + } else { + return false; + } + } + + public static void main(String[] args) { + InetAddress[] addrs = getAddressesForLocalHost(); + if (addrs.length < 2) { + System.out.println("Ignoring manual test since no more than one IPs are configured for 'localhost'"); + System.exit(0); + } + JMXInterfaceBindingTest test = new JMXInterfaceBindingTest(); + test.run(addrs); + System.out.println("All tests PASSED."); + } + + private static InetAddress[] getAddressesForLocalHost() { + InetAddress[] addrs; + try { + addrs = InetAddress.getAllByName("localhost"); + } catch (UnknownHostException e) { + throw new RuntimeException("Test failed", e); + } + return addrs; + } +} From adeb2daf12410e57c4fc2a13f32550d89bb8f761 Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Fri, 18 Dec 2015 08:55:47 +0100 Subject: [PATCH 140/228] 6425769: Allow specifying an address to bind JMX remote connector Reviewed-by: jbachorik, dfuchs --- hotspot/src/share/vm/services/diagnosticCommand.cpp | 6 ++++++ hotspot/src/share/vm/services/diagnosticCommand.hpp | 1 + 2 files changed, 7 insertions(+) diff --git a/hotspot/src/share/vm/services/diagnosticCommand.cpp b/hotspot/src/share/vm/services/diagnosticCommand.cpp index bf531a4d100..bad2098eb17 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.cpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp @@ -564,6 +564,10 @@ JMXStartRemoteDCmd::JMXStartRemoteDCmd(outputStream *output, bool heap_allocated ("config.file", "set com.sun.management.config.file", "STRING", false), + _jmxremote_host + ("jmxremote.host", + "set com.sun.management.jmxremote.host", "STRING", false), + _jmxremote_port ("jmxremote.port", "set com.sun.management.jmxremote.port", "STRING", false), @@ -643,6 +647,7 @@ JMXStartRemoteDCmd::JMXStartRemoteDCmd(outputStream *output, bool heap_allocated { _dcmdparser.add_dcmd_option(&_config_file); + _dcmdparser.add_dcmd_option(&_jmxremote_host); _dcmdparser.add_dcmd_option(&_jmxremote_port); _dcmdparser.add_dcmd_option(&_jmxremote_rmi_port); _dcmdparser.add_dcmd_option(&_jmxremote_ssl); @@ -718,6 +723,7 @@ void JMXStartRemoteDCmd::execute(DCmdSource source, TRAPS) { PUT_OPTION(_config_file); + PUT_OPTION(_jmxremote_host); PUT_OPTION(_jmxremote_port); PUT_OPTION(_jmxremote_rmi_port); PUT_OPTION(_jmxremote_ssl); diff --git a/hotspot/src/share/vm/services/diagnosticCommand.hpp b/hotspot/src/share/vm/services/diagnosticCommand.hpp index d7e86f2dbd0..ea3ddfe588a 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.hpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp @@ -446,6 +446,7 @@ class JMXStartRemoteDCmd : public DCmdWithParser { // com.sun.management is omitted DCmdArgument _config_file; + DCmdArgument _jmxremote_host; DCmdArgument _jmxremote_port; DCmdArgument _jmxremote_rmi_port; DCmdArgument _jmxremote_ssl; From 07bec70d2639e0f6801383125181e2d682ce698b Mon Sep 17 00:00:00 2001 From: Frederic Parain Date: Fri, 18 Dec 2015 11:04:59 +0100 Subject: [PATCH 141/228] 8145317: ReservedStackTest fails with ReentrantLock looks corrupted Reviewed-by: acorn, dcubed --- .../ReservedStack/ReservedStackTest.java | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/hotspot/test/runtime/ReservedStack/ReservedStackTest.java b/hotspot/test/runtime/ReservedStack/ReservedStackTest.java index 35892557b53..b8d93be3eb7 100644 --- a/hotspot/test/runtime/ReservedStack/ReservedStackTest.java +++ b/hotspot/test/runtime/ReservedStack/ReservedStackTest.java @@ -23,6 +23,8 @@ /* * @test ReservedStackTest + * @library /testlibrary + * @build jdk.test.lib.* * @run main/othervm -XX:-Inline -XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread ReservedStackTest */ @@ -107,13 +109,10 @@ */ import java.util.concurrent.locks.ReentrantLock; +import jdk.test.lib.Platform; public class ReservedStackTest { - private static boolean isWindows() { - return System.getProperty("os.name").toLowerCase().startsWith("win"); - } - static class ReentrantLockTest { private ReentrantLock lockArray[]; @@ -194,11 +193,22 @@ public class ReservedStackTest { System.out.println("Framework got StackOverflowError at frame = " + counter); System.out.println("Test started execution at frame = " + (counter - deframe)); String result = test.getResult(); - System.out.println(result); - // The feature is not fully implemented on Windows platforms, + // The feature is not fully implemented on all platforms, // corruptions are still possible - if (!isWindows() && !result.contains("PASSED")) { - System.exit(-1); + boolean supportedPlatform = Platform.isSolaris() || Platform.isOSX() + || (Platform.isLinux() && (Platform.isX86() || Platform.isX64())); + if (supportedPlatform && !result.contains("PASSED")) { + System.out.println(result); + throw new Error(result); + } else { + // Either the test passed or this platform is not supported. + // On not supported platforms, we only expect the VM to + // not crash during the test. This is especially important + // on Windows where the detection of SOE in annotated + // sections is implemented but the reserved zone mechanism + // to avoid the corruption cannot be implemented yet + // because of JDK-8067946 + System.out.println("PASSED"); } } From 7806389bef8a1be01aed1fa4546f380c9377a247 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Fri, 18 Dec 2015 11:30:29 +0100 Subject: [PATCH 142/228] 8145534: TestRemsetLogging.java takes a long time Improve the test and test settings to decrease the time it takes. Reviewed-by: brutisso, jmasa, dfazunen --- hotspot/test/gc/g1/TestRemsetLogging.java | 11 ++-- .../gc/g1/TestRemsetLoggingPerRegion.java | 16 ++---- .../test/gc/g1/TestRemsetLoggingThreads.java | 10 ++-- .../test/gc/g1/TestRemsetLoggingTools.java | 50 +++++-------------- 4 files changed, 26 insertions(+), 61 deletions(-) diff --git a/hotspot/test/gc/g1/TestRemsetLogging.java b/hotspot/test/gc/g1/TestRemsetLogging.java index a03b8b9c45d..54186bf568c 100644 --- a/hotspot/test/gc/g1/TestRemsetLogging.java +++ b/hotspot/test/gc/g1/TestRemsetLogging.java @@ -23,11 +23,14 @@ /* * @test TestRemsetLogging.java - * @bug 8013895 8129977 - * @library /testlibrary + * @requires vm.gc=="G1" | vm.gc =="null" + * @bug 8013895 8129977 8145534 + * @library /testlibrary /test/lib * @modules java.base/sun.misc * java.management/sun.management * @build TestRemsetLoggingTools TestRemsetLogging + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @summary Verify output of -Xlog:gc+remset*=trace * @run main TestRemsetLogging * @@ -39,10 +42,6 @@ public class TestRemsetLogging { public static void main(String[] args) throws Exception { String result; - if (!TestRemsetLoggingTools.testingG1GC()) { - return; - } - // no remembered set summary output result = TestRemsetLoggingTools.runTest(null, 0); TestRemsetLoggingTools.expectRSetSummaries(result, 0, 0); diff --git a/hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java b/hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java index e61c181f5f7..a19f7aeb719 100644 --- a/hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java +++ b/hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java @@ -23,29 +23,23 @@ /* * @test TestRemsetLoggingPerRegion.java - * @bug 8014078 8129977 - * @library /testlibrary + * @requires vm.gc=="G1" | vm.gc =="null" + * @bug 8014078 8129977 8145534 + * @library /testlibrary /test/lib * @modules java.base/sun.misc * java.management/sun.management * @build TestRemsetLoggingTools TestRemsetLoggingPerRegion + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @summary Verify output of -Xlog:gc+remset*=trace in regards to per-region type output * @run main TestRemsetLoggingPerRegion */ -import jdk.test.lib.*; -import java.lang.Thread; -import java.util.ArrayList; -import java.util.Arrays; - public class TestRemsetLoggingPerRegion { public static void main(String[] args) throws Exception { String result; - if (!TestRemsetLoggingTools.testingG1GC()) { - return; - } - // single remembered set summary output at the end result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace" }, 0); TestRemsetLoggingTools.expectPerRegionRSetSummaries(result, 1, 0); diff --git a/hotspot/test/gc/g1/TestRemsetLoggingThreads.java b/hotspot/test/gc/g1/TestRemsetLoggingThreads.java index 12362a472e2..a654548ddeb 100644 --- a/hotspot/test/gc/g1/TestRemsetLoggingThreads.java +++ b/hotspot/test/gc/g1/TestRemsetLoggingThreads.java @@ -23,13 +23,14 @@ /* * @test TestRemsetLoggingThreads - * @bug 8025441 - * @summary Ensure that various values of worker threads/concurrent - * refinement threads do not crash the VM. + * @requires vm.gc=="G1" | vm.gc=="null" + * @bug 8025441 8145534 * @key gc * @library /testlibrary * @modules java.base/sun.misc * java.management/sun.management + * @summary Ensure that various values of worker threads/concurrent + * refinement threads do not crash the VM. */ import java.util.regex.Matcher; @@ -65,9 +66,6 @@ public class TestRemsetLoggingThreads { } public static void main(String[] args) throws Exception { - if (!TestRemsetLoggingTools.testingG1GC()) { - return; - } // different valid combinations of number of refinement and gc worker threads runTest(1, 1); runTest(1, 5); diff --git a/hotspot/test/gc/g1/TestRemsetLoggingTools.java b/hotspot/test/gc/g1/TestRemsetLoggingTools.java index 24ba4048ff5..905d572ba15 100644 --- a/hotspot/test/gc/g1/TestRemsetLoggingTools.java +++ b/hotspot/test/gc/g1/TestRemsetLoggingTools.java @@ -27,6 +27,7 @@ import com.sun.management.HotSpotDiagnosticMXBean; import com.sun.management.VMOption; +import sun.hotspot.WhiteBox; import jdk.test.lib.*; import java.lang.management.ManagementFactory; @@ -34,61 +35,34 @@ import java.util.ArrayList; import java.util.Arrays; class VerifySummaryOutput { - // 4M size, both are directly allocated into the old gen - static Object[] largeObject1 = new Object[1024 * 1024]; - static Object[] largeObject2 = new Object[1024 * 1024]; - - static int[] temp; - public static void main(String[] args) { - // create some cross-references between these objects - for (int i = 0; i < largeObject1.length; i++) { - largeObject1[i] = largeObject2; - } - - for (int i = 0; i < largeObject2.length; i++) { - largeObject2[i] = largeObject1; - } - int numGCs = Integer.parseInt(args[0]); - if (numGCs > 0) { - // try to force a minor collection: the young gen is 4M, the - // amount of data allocated below is roughly that (4*1024*1024 + - // some header data) - for (int i = 0; i < 1024 ; i++) { - temp = new int[1024]; - } - } - + // Perform the requested amount of GCs. + WhiteBox wb = WhiteBox.getWhiteBox(); for (int i = 0; i < numGCs - 1; i++) { - System.gc(); + wb.youngGC(); + } + if (numGCs > 0) { + wb.fullGC(); } } } public class TestRemsetLoggingTools { - // the VM is currently run using G1GC, i.e. trying to test G1 functionality. - public static boolean testingG1GC() { - HotSpotDiagnosticMXBean diagnostic = - ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class); - - VMOption option = diagnostic.getVMOption("UseG1GC"); - if (option.getValue().equals("false")) { - System.out.println("Skipping this test. It is only a G1 test."); - return false; - } - return true; - } - public static String runTest(String[] additionalArgs, int numGCs) throws Exception { ArrayList finalargs = new ArrayList(); String[] defaultArgs = new String[] { + "-Xbootclasspath/a:.", + "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", + "-cp", System.getProperty("java.class.path"), "-XX:+UseG1GC", "-Xmn4m", + "-Xint", // -Xint makes the test run faster "-Xms20m", "-Xmx20m", + "-XX:ParallelGCThreads=1", "-XX:InitiatingHeapOccupancyPercent=100", // we don't want the additional GCs due to initial marking "-XX:+UnlockDiagnosticVMOptions", "-XX:G1HeapRegionSize=1M", From 92c56ccb9c77fd24de973b6a39ae79cb0ae88f25 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Fri, 18 Dec 2015 14:27:51 +0100 Subject: [PATCH 143/228] 8145673: G1RemSetSummary.hpp uses FREE_C_HEAP_ARRAY Move destructor work into cpp file Reviewed-by: mgerdin, stefank --- .../src/share/vm/gc/g1/g1RemSetSummary.cpp | 18 ++++++++++++++++++ .../src/share/vm/gc/g1/g1RemSetSummary.hpp | 19 +++---------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp index 2d4e6d9d670..8cd76fd9ffc 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp @@ -30,6 +30,7 @@ #include "gc/g1/g1RemSetSummary.hpp" #include "gc/g1/heapRegion.hpp" #include "gc/g1/heapRegionRemSet.hpp" +#include "memory/allocation.inline.hpp" #include "runtime/thread.inline.hpp" class GetRSThreadVTimeClosure : public ThreadClosure { @@ -89,6 +90,23 @@ void G1RemSetSummary::initialize(G1RemSet* remset) { update(); } +G1RemSetSummary::G1RemSetSummary() : + _remset(NULL), + _num_refined_cards(0), + _num_processed_buf_mutator(0), + _num_processed_buf_rs_threads(0), + _num_coarsenings(0), + _rs_threads_vtimes(NULL), + _num_vtimes(0), + _sampling_thread_vtime(0.0f) { +} + +G1RemSetSummary::~G1RemSetSummary() { + if (_rs_threads_vtimes) { + FREE_C_HEAP_ARRAY(double, _rs_threads_vtimes); + } +} + void G1RemSetSummary::set(G1RemSetSummary* other) { assert(other != NULL, "just checking"); assert(remset() == other->remset(), "just checking"); diff --git a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp index 19faacd2ceb..f3cbfc783b4 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp @@ -25,6 +25,7 @@ #ifndef SHARE_VM_GC_G1_G1REMSETSUMMARY_HPP #define SHARE_VM_GC_G1_G1REMSETSUMMARY_HPP +#include "utilities/globalDefinitions.hpp" #include "utilities/ostream.hpp" class G1RemSet; @@ -57,26 +58,12 @@ private: _sampling_thread_vtime = value; } - void free_and_null() { - if (_rs_threads_vtimes) { - FREE_C_HEAP_ARRAY(double, _rs_threads_vtimes); - _rs_threads_vtimes = NULL; - _num_vtimes = 0; - } - } - // update this summary with current data from various places void update(); public: - G1RemSetSummary() : _remset(NULL), _num_refined_cards(0), - _num_processed_buf_mutator(0), _num_processed_buf_rs_threads(0), _num_coarsenings(0), - _rs_threads_vtimes(NULL), _num_vtimes(0), _sampling_thread_vtime(0.0f) { - } - - ~G1RemSetSummary() { - free_and_null(); - } + G1RemSetSummary(); + ~G1RemSetSummary(); // set the counters in this summary to the values of the others void set(G1RemSetSummary* other); From 01bbb7f8a9cd8cccd4225d254caa07e4cb4d4582 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Fri, 18 Dec 2015 14:32:16 +0100 Subject: [PATCH 144/228] 8145752: Fix include guards in GC code Reviewed-by: mgerdin, stefank --- hotspot/src/share/vm/gc/g1/g1CollectorState.hpp | 2 +- hotspot/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp | 2 +- hotspot/src/share/vm/gc/g1/g1RegionToSpaceMapper.hpp | 2 +- hotspot/src/share/vm/gc/g1/g1YoungRemSetSamplingThread.hpp | 2 +- hotspot/src/share/vm/gc/shared/allocTracer.hpp | 2 +- hotspot/src/share/vm/gc/shared/copyFailedInfo.hpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorState.hpp b/hotspot/src/share/vm/gc/g1/g1CollectorState.hpp index 3a14fcee41f..ed83b5f9639 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorState.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorState.hpp @@ -134,4 +134,4 @@ class G1CollectorState VALUE_OBJ_CLASS_SPEC { } }; -#endif /* SHARE_VM_GC_G1_G1COLLECTORSTATE_HPP */ +#endif // SHARE_VM_GC_G1_G1COLLECTORSTATE_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp index 23d9a1bd462..162b8dc68a7 100644 --- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp @@ -143,5 +143,5 @@ void G1ParScanThreadState::steal_and_trim_queue(RefToScanQueueSet *task_queues) } } -#endif /* SHARE_VM_GC_G1_G1PARSCANTHREADSTATE_INLINE_HPP */ +#endif // SHARE_VM_GC_G1_G1PARSCANTHREADSTATE_INLINE_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1RegionToSpaceMapper.hpp b/hotspot/src/share/vm/gc/g1/g1RegionToSpaceMapper.hpp index fff6ec7605b..a6d085e0b8e 100644 --- a/hotspot/src/share/vm/gc/g1/g1RegionToSpaceMapper.hpp +++ b/hotspot/src/share/vm/gc/g1/g1RegionToSpaceMapper.hpp @@ -89,4 +89,4 @@ class G1RegionToSpaceMapper : public CHeapObj { MemoryType type); }; -#endif /* SHARE_VM_GC_G1_G1REGIONTOSPACEMAPPER_HPP */ +#endif // SHARE_VM_GC_G1_G1REGIONTOSPACEMAPPER_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1YoungRemSetSamplingThread.hpp b/hotspot/src/share/vm/gc/g1/g1YoungRemSetSamplingThread.hpp index 0e251451c02..d5837e42aee 100644 --- a/hotspot/src/share/vm/gc/g1/g1YoungRemSetSamplingThread.hpp +++ b/hotspot/src/share/vm/gc/g1/g1YoungRemSetSamplingThread.hpp @@ -60,4 +60,4 @@ public: void stop(); }; -#endif /* SHARE_VM_GC_G1_G1YOUNGREMSETSAMPLINGTHREAD_HPP */ +#endif // SHARE_VM_GC_G1_G1YOUNGREMSETSAMPLINGTHREAD_HPP diff --git a/hotspot/src/share/vm/gc/shared/allocTracer.hpp b/hotspot/src/share/vm/gc/shared/allocTracer.hpp index 9271ff3fbe1..aba0a1ed579 100644 --- a/hotspot/src/share/vm/gc/shared/allocTracer.hpp +++ b/hotspot/src/share/vm/gc/shared/allocTracer.hpp @@ -34,4 +34,4 @@ class AllocTracer : AllStatic { static void send_allocation_in_new_tlab_event(KlassHandle klass, size_t tlab_size, size_t alloc_size); }; -#endif /* SHARE_VM_GC_SHARED_ALLOCTRACER_HPP */ +#endif // SHARE_VM_GC_SHARED_ALLOCTRACER_HPP diff --git a/hotspot/src/share/vm/gc/shared/copyFailedInfo.hpp b/hotspot/src/share/vm/gc/shared/copyFailedInfo.hpp index 7d96a03413b..6a6a64e31eb 100644 --- a/hotspot/src/share/vm/gc/shared/copyFailedInfo.hpp +++ b/hotspot/src/share/vm/gc/shared/copyFailedInfo.hpp @@ -87,4 +87,4 @@ class PromotionFailedInfo : public CopyFailedInfo { class EvacuationFailedInfo : public CopyFailedInfo {}; -#endif /* SHARE_VM_GC_SHARED_COPYFAILEDINFO_HPP */ +#endif // SHARE_VM_GC_SHARED_COPYFAILEDINFO_HPP From 07af24b8ac4bbd6668644dd9fa3a7b0f83e3c04b Mon Sep 17 00:00:00 2001 From: Rachel Protacio Date: Fri, 18 Dec 2015 14:30:13 -0500 Subject: [PATCH 145/228] 8145445: [TESTBUG] runtime/logging tests need to properly build and import libraries Adds the proper @build and import lines to the jtreg tests in the runtime/logging directory. Reviewed-by: iklam, hseigel --- hotspot/test/runtime/logging/ClassInitializationTest.java | 5 ++++- hotspot/test/runtime/logging/DefaultMethodsTest.java | 4 +++- hotspot/test/runtime/logging/MonitorInflationTest.java | 5 +++-- hotspot/test/runtime/logging/SafepointTest.java | 4 +++- hotspot/test/runtime/logging/VMOperationTest.java | 4 +++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/hotspot/test/runtime/logging/ClassInitializationTest.java b/hotspot/test/runtime/logging/ClassInitializationTest.java index 23c17f9aca3..eb0583d4386 100644 --- a/hotspot/test/runtime/logging/ClassInitializationTest.java +++ b/hotspot/test/runtime/logging/ClassInitializationTest.java @@ -27,10 +27,13 @@ * @bug 8142976 * @library /testlibrary * @compile BadMap50.jasm + * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.Platform jdk.test.lib.ProcessTools * @run driver ClassInitializationTest */ -import jdk.test.lib.*; +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.Platform; +import jdk.test.lib.ProcessTools; public class ClassInitializationTest { diff --git a/hotspot/test/runtime/logging/DefaultMethodsTest.java b/hotspot/test/runtime/logging/DefaultMethodsTest.java index 007da7bf8fb..d3bf4304e2e 100644 --- a/hotspot/test/runtime/logging/DefaultMethodsTest.java +++ b/hotspot/test/runtime/logging/DefaultMethodsTest.java @@ -28,10 +28,12 @@ * @library /testlibrary * @modules java.base/sun.misc * java.management + * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver DefaultMethodsTest */ -import jdk.test.lib.*; +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; public class DefaultMethodsTest { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/logging/MonitorInflationTest.java b/hotspot/test/runtime/logging/MonitorInflationTest.java index 79cfe014b85..07ff1c3b864 100644 --- a/hotspot/test/runtime/logging/MonitorInflationTest.java +++ b/hotspot/test/runtime/logging/MonitorInflationTest.java @@ -29,11 +29,12 @@ * @ignore 8145587 * @modules java.base/sun.misc * java.management - * @build MonitorInflationTest + * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver MonitorInflationTest */ -import jdk.test.lib.*; +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; public class MonitorInflationTest { static void analyzeOutputOn(ProcessBuilder pb) throws Exception { diff --git a/hotspot/test/runtime/logging/SafepointTest.java b/hotspot/test/runtime/logging/SafepointTest.java index a5bc00ece3d..100edfad9e9 100644 --- a/hotspot/test/runtime/logging/SafepointTest.java +++ b/hotspot/test/runtime/logging/SafepointTest.java @@ -28,11 +28,13 @@ * @library /testlibrary * @modules java.base/sun.misc * java.management + * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver SafepointTest */ -import jdk.test.lib.*; import java.lang.ref.WeakReference; +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; public class SafepointTest { public static void main(String[] args) throws Exception { diff --git a/hotspot/test/runtime/logging/VMOperationTest.java b/hotspot/test/runtime/logging/VMOperationTest.java index 4d2ae411e1c..8b8c9c3e210 100644 --- a/hotspot/test/runtime/logging/VMOperationTest.java +++ b/hotspot/test/runtime/logging/VMOperationTest.java @@ -28,11 +28,13 @@ * @library /testlibrary * @modules java.base/sun.misc * java.management + * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools * @run driver VMOperationTest */ -import jdk.test.lib.*; import java.lang.ref.WeakReference; +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; public class VMOperationTest { public static void main(String[] args) throws Exception { From e858a1cd9a64928943ec595b4e85f20cc53ffbcf Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Fri, 18 Dec 2015 15:50:33 -0500 Subject: [PATCH 146/228] 8144256: compiler/uncommontrap/TestStackBangRbp.java crashes VM on Solaris Take out inlining of methodHandle copy constructors and destructors Reviewed-by: hseigel, gtriantafill --- .../src/share/vm/classfile/stackMapFrame.cpp | 4 +- .../src/share/vm/classfile/stackMapFrame.hpp | 4 +- hotspot/src/share/vm/classfile/verifier.cpp | 6 +-- hotspot/src/share/vm/classfile/verifier.hpp | 4 +- .../share/vm/interpreter/bytecodeStream.hpp | 2 +- hotspot/src/share/vm/runtime/handles.cpp | 51 ++++++++++++++++++- .../src/share/vm/runtime/handles.inline.hpp | 44 +--------------- 7 files changed, 61 insertions(+), 54 deletions(-) diff --git a/hotspot/src/share/vm/classfile/stackMapFrame.cpp b/hotspot/src/share/vm/classfile/stackMapFrame.cpp index 1332a081c76..1199a1d453e 100644 --- a/hotspot/src/share/vm/classfile/stackMapFrame.cpp +++ b/hotspot/src/share/vm/classfile/stackMapFrame.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -74,7 +74,7 @@ void StackMapFrame::initialize_object( } VerificationType StackMapFrame::set_locals_from_arg( - const methodHandle m, VerificationType thisKlass, TRAPS) { + const methodHandle& m, VerificationType thisKlass, TRAPS) { SignatureStream ss(m->signature()); int init_local_num = 0; if (!m->is_static()) { diff --git a/hotspot/src/share/vm/classfile/stackMapFrame.hpp b/hotspot/src/share/vm/classfile/stackMapFrame.hpp index 24cbae330bb..43dfde0184c 100644 --- a/hotspot/src/share/vm/classfile/stackMapFrame.hpp +++ b/hotspot/src/share/vm/classfile/stackMapFrame.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -152,7 +152,7 @@ class StackMapFrame : public ResourceObj { // Set local variable type array based on m's signature. VerificationType set_locals_from_arg( - const methodHandle m, VerificationType thisKlass, TRAPS); + const methodHandle& m, VerificationType thisKlass, TRAPS); // Search local variable type array and stack type array. // Set every element with type of old_object to new_object. diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index cc6f22795e6..5db828ce66e 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -1745,7 +1745,7 @@ void ClassVerifier::verify_method(const methodHandle& m, TRAPS) { #undef bad_type_message -char* ClassVerifier::generate_code_data(methodHandle m, u4 code_length, TRAPS) { +char* ClassVerifier::generate_code_data(const methodHandle& m, u4 code_length, TRAPS) { char* code_data = NEW_RESOURCE_ARRAY(char, code_length); memset(code_data, 0, sizeof(char) * code_length); RawBytecodeStream bcs(m); @@ -1814,9 +1814,9 @@ void ClassVerifier::verify_exception_handler_table(u4 code_length, char* code_da } void ClassVerifier::verify_local_variable_table(u4 code_length, char* code_data, TRAPS) { - int localvariable_table_length = _method()->localvariable_table_length(); + int localvariable_table_length = _method->localvariable_table_length(); if (localvariable_table_length > 0) { - LocalVariableTableElement* table = _method()->localvariable_table_start(); + LocalVariableTableElement* table = _method->localvariable_table_start(); for (int i = 0; i < localvariable_table_length; i++) { u2 start_bci = table[i].start_bci; u2 length = table[i].length; diff --git a/hotspot/src/share/vm/classfile/verifier.hpp b/hotspot/src/share/vm/classfile/verifier.hpp index ce3d9beaa10..8580cddbe41 100644 --- a/hotspot/src/share/vm/classfile/verifier.hpp +++ b/hotspot/src/share/vm/classfile/verifier.hpp @@ -264,7 +264,7 @@ class ClassVerifier : public StackObj { ErrorContext _error_context; // contains information about an error void verify_method(const methodHandle& method, TRAPS); - char* generate_code_data(methodHandle m, u4 code_length, TRAPS); + char* generate_code_data(const methodHandle& m, u4 code_length, TRAPS); void verify_exception_handler_table(u4 code_length, char* code_data, int& min, int& max, TRAPS); void verify_local_variable_table(u4 code_length, char* code_data, TRAPS); @@ -378,7 +378,7 @@ class ClassVerifier : public StackObj { ~ClassVerifier(); Thread* thread() { return _thread; } - methodHandle method() { return _method; } + const methodHandle& method() { return _method; } instanceKlassHandle current_class() const { return _klass; } VerificationType current_type() const { return _this_type; } diff --git a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp index 65a0aa4631a..23d0a651494 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp @@ -86,7 +86,7 @@ class BaseBytecodeStream: StackObj { bool is_raw() const { return _is_raw; } // Stream attributes - methodHandle method() const { return _method; } + const methodHandle& method() const { return _method; } int bci() const { return _bci; } int next_bci() const { return _next_bci; } diff --git a/hotspot/src/share/vm/runtime/handles.cpp b/hotspot/src/share/vm/runtime/handles.cpp index 98ff1ffc424..db1270b7a94 100644 --- a/hotspot/src/share/vm/runtime/handles.cpp +++ b/hotspot/src/share/vm/runtime/handles.cpp @@ -46,9 +46,58 @@ Handle::Handle(Thread* thread, oop obj) { _handle = thread->handle_area()->allocate_handle(obj); } } - #endif +// Copy constructors and destructors for metadata handles +// These do too much to inline. +#define DEF_METADATA_HANDLE_FN_NOINLINE(name, type) \ +name##Handle::name##Handle(const name##Handle &h) { \ + _value = h._value; \ + if (_value != NULL) { \ + assert(_value->is_valid(), "obj is valid"); \ + if (h._thread != NULL) { \ + assert(h._thread == Thread::current(), "thread must be current");\ + _thread = h._thread; \ + } else { \ + _thread = Thread::current(); \ + } \ + assert (_thread->is_in_stack((address)this), "not on stack?"); \ + _thread->metadata_handles()->push((Metadata*)_value); \ + } else { \ + _thread = NULL; \ + } \ +} \ +name##Handle& name##Handle::operator=(const name##Handle &s) { \ + remove(); \ + _value = s._value; \ + if (_value != NULL) { \ + assert(_value->is_valid(), "obj is valid"); \ + if (s._thread != NULL) { \ + assert(s._thread == Thread::current(), "thread must be current");\ + _thread = s._thread; \ + } else { \ + _thread = Thread::current(); \ + } \ + assert (_thread->is_in_stack((address)this), "not on stack?"); \ + _thread->metadata_handles()->push((Metadata*)_value); \ + } else { \ + _thread = NULL; \ + } \ + return *this; \ +} \ +inline void name##Handle::remove() { \ + if (_value != NULL) { \ + int i = _thread->metadata_handles()->find_from_end((Metadata*)_value); \ + assert(i!=-1, "not in metadata_handles list"); \ + _thread->metadata_handles()->remove_at(i); \ + } \ +} \ +name##Handle::~name##Handle () { remove(); } \ + +DEF_METADATA_HANDLE_FN_NOINLINE(method, Method) +DEF_METADATA_HANDLE_FN_NOINLINE(constantPool, ConstantPool) + + static uintx chunk_oops_do(OopClosure* f, Chunk* chunk, char* chunk_top) { oop* bottom = (oop*) chunk->bottom(); oop* top = (oop*) chunk_top; diff --git a/hotspot/src/share/vm/runtime/handles.inline.hpp b/hotspot/src/share/vm/runtime/handles.inline.hpp index 761596a5004..ede935dbd15 100644 --- a/hotspot/src/share/vm/runtime/handles.inline.hpp +++ b/hotspot/src/share/vm/runtime/handles.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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,48 +69,6 @@ inline name##Handle::name##Handle(Thread* thread, type* obj) : _value(obj), _thr _thread->metadata_handles()->push((Metadata*)obj); \ } \ } \ -inline name##Handle::name##Handle(const name##Handle &h) { \ - _value = h._value; \ - if (_value != NULL) { \ - assert(_value->is_valid(), "obj is valid"); \ - if (h._thread != NULL) { \ - assert(h._thread == Thread::current(), "thread must be current");\ - _thread = h._thread; \ - } else { \ - _thread = Thread::current(); \ - } \ - assert (_thread->is_in_stack((address)this), "not on stack?"); \ - _thread->metadata_handles()->push((Metadata*)_value); \ - } else { \ - _thread = NULL; \ - } \ -} \ -inline name##Handle& name##Handle::operator=(const name##Handle &s) { \ - remove(); \ - _value = s._value; \ - if (_value != NULL) { \ - assert(_value->is_valid(), "obj is valid"); \ - if (s._thread != NULL) { \ - assert(s._thread == Thread::current(), "thread must be current");\ - _thread = s._thread; \ - } else { \ - _thread = Thread::current(); \ - } \ - assert (_thread->is_in_stack((address)this), "not on stack?"); \ - _thread->metadata_handles()->push((Metadata*)_value); \ - } else { \ - _thread = NULL; \ - } \ - return *this; \ -} \ -inline void name##Handle::remove() { \ - if (_value != NULL) { \ - int i = _thread->metadata_handles()->find_from_end((Metadata*)_value); \ - assert(i!=-1, "not in metadata_handles list"); \ - _thread->metadata_handles()->remove_at(i); \ - } \ -} \ -inline name##Handle::~name##Handle () { remove(); } \ DEF_METADATA_HANDLE_FN(method, Method) DEF_METADATA_HANDLE_FN(constantPool, ConstantPool) From b5bca5cc1bc0c9afa4c6e3e9af56a7e2f5a67f0d Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Sun, 20 Dec 2015 10:37:23 -0500 Subject: [PATCH 147/228] 8139864: Improve handling of stack protection zones Reviewed-by: stuefe, coleenp, fparain --- hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp | 3 +- .../cpu/aarch64/vm/macroAssembler_aarch64.cpp | 2 +- .../cpu/aarch64/vm/sharedRuntime_aarch64.cpp | 4 +- .../templateInterpreterGenerator_aarch64.cpp | 13 +- hotspot/src/cpu/ppc/vm/globals_ppc.hpp | 4 +- hotspot/src/cpu/ppc/vm/ppc.ad | 2 +- hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp | 2 +- .../src/cpu/sparc/vm/macroAssembler_sparc.cpp | 2 +- .../src/cpu/sparc/vm/sharedRuntime_sparc.cpp | 6 +- .../vm/templateInterpreterGenerator_sparc.cpp | 2 +- hotspot/src/cpu/x86/vm/frame_x86.cpp | 3 +- hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 4 +- .../src/cpu/x86/vm/sharedRuntime_x86_32.cpp | 4 +- .../src/cpu/x86/vm/sharedRuntime_x86_64.cpp | 4 +- .../vm/templateInterpreterGenerator_x86.cpp | 10 +- hotspot/src/cpu/zero/vm/stack_zero.hpp | 2 +- hotspot/src/cpu/zero/vm/stack_zero.inline.hpp | 9 +- hotspot/src/os/aix/vm/os_aix.cpp | 18 +- hotspot/src/os/bsd/vm/os_bsd.cpp | 5 +- hotspot/src/os/linux/vm/os_linux.cpp | 24 +-- hotspot/src/os/solaris/vm/os_solaris.cpp | 17 +- hotspot/src/os/windows/vm/os_windows.cpp | 17 +- .../src/os/windows/vm/os_windows.inline.hpp | 3 +- hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp | 7 +- hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp | 9 +- .../src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp | 7 +- .../linux_aarch64/vm/os_linux_aarch64.cpp | 7 +- .../src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp | 7 +- .../os_cpu/linux_sparc/vm/os_linux_sparc.cpp | 7 +- .../src/os_cpu/linux_x86/vm/os_linux_x86.cpp | 15 +- .../os_cpu/linux_zero/vm/os_linux_zero.cpp | 7 +- .../solaris_sparc/vm/os_solaris_sparc.cpp | 6 +- .../os_cpu/solaris_x86/vm/os_solaris_x86.cpp | 6 +- .../solaris_x86/vm/thread_solaris_x86.cpp | 14 +- hotspot/src/share/vm/asm/assembler.cpp | 5 +- .../src/share/vm/interpreter/interpreter.cpp | 5 +- hotspot/src/share/vm/prims/whitebox.cpp | 2 +- hotspot/src/share/vm/runtime/globals.hpp | 18 +- hotspot/src/share/vm/runtime/os.cpp | 29 +-- hotspot/src/share/vm/runtime/thread.cpp | 53 +++--- hotspot/src/share/vm/runtime/thread.hpp | 168 ++++++++++++++---- .../src/share/vm/runtime/thread.inline.hpp | 8 +- hotspot/src/share/vm/shark/sharkStack.cpp | 2 +- 43 files changed, 314 insertions(+), 228 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp index 52a0bb25c47..141d9a8fa93 100644 --- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp @@ -58,7 +58,8 @@ bool frame::safe_for_sender(JavaThread *thread) { address unextended_sp = (address)_unextended_sp; // consider stack guards when trying to determine "safe" stack pointers - static size_t stack_guard_size = os::uses_stack_guard_pages() ? (StackYellowPages + StackRedPages) * os::vm_page_size() : 0; + static size_t stack_guard_size = os::uses_stack_guard_pages() ? + (JavaThread::stack_red_zone_size() + JavaThread::stack_yellow_zone_size()) : 0; size_t usable_stack_size = thread->stack_size() - stack_guard_size; // sp must be within the usable part of the stack (not in guards) diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp index eae6417b08b..dea64b41bc6 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp @@ -3938,7 +3938,7 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) { // was post-decremented.) Skip this address by starting at i=1, and // touch a few more pages below. N.B. It is important to touch all // the way down to and including i=StackShadowPages. - for (int i = 0; i< StackShadowPages-1; i++) { + for (int i = 0; i < (JavaThread::stack_shadow_zone_size() / os::vm_page_size()) - 1; i++) { // this could be any sized move but this is can be a debugging crumb // so the bigger the better. lea(tmp, Address(tmp, -os::vm_page_size())); diff --git a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp index 1533c8d024e..bf677ce43dc 100644 --- a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp @@ -1542,7 +1542,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, // Generate stack overflow check if (UseStackBanging) { - __ bang_stack_with_offset(StackShadowPages*os::vm_page_size()); + __ bang_stack_with_offset(JavaThread::stack_shadow_zone_size()); } else { Unimplemented(); } @@ -1949,7 +1949,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, Label reguard; Label reguard_done; __ ldrb(rscratch1, Address(rthread, JavaThread::stack_guard_state_offset())); - __ cmpw(rscratch1, JavaThread::stack_guard_yellow_disabled); + __ cmpw(rscratch1, JavaThread::stack_guard_yellow_reserved_disabled); __ br(Assembler::EQ, reguard); __ bind(reguard_done); diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp index b9501b948f1..1ae3d7f77ae 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp @@ -474,12 +474,12 @@ void InterpreterGenerator::generate_stack_overflow_check(void) { __ sub(rscratch1, rscratch1, rscratch2); // Stack limit __ add(r0, r0, rscratch1); - // Use the maximum number of pages we might bang. - const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages) ? StackShadowPages : - (StackRedPages+StackYellowPages); + // Use the bigger size for banging. + const int max_bang_size = MAX2(JavaThread::stack_shadow_zone_size(), + JavaThread::stack_red_zone_size() + JavaThread::stack_yellow_zone_size()); // add in the red and yellow zone sizes - __ add(r0, r0, max_pages * page_size * 2); + __ add(r0, r0, max_bang_size * 2); // check against the current stack bottom __ cmp(sp, r0); @@ -826,9 +826,10 @@ void InterpreterGenerator::bang_stack_shadow_pages(bool native_call) { // an interpreter frame with greater than a page of locals, so each page // needs to be checked. Only true for non-native. if (UseStackBanging) { - const int start_page = native_call ? StackShadowPages : 1; + const int size_t n_shadow_pages = JavaThread::stack_shadow_zone_size() / os::vm_page_size(); + const int start_page = native_call ? n_shadow_pages : 1; const int page_size = os::vm_page_size(); - for (int pages = start_page; pages <= StackShadowPages ; pages++) { + for (int pages = start_page; pages <= n_shadow_pages ; pages++) { __ sub(rscratch2, sp, pages*page_size); __ str(zr, Address(rscratch2)); } diff --git a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp index e2bb00a07b1..b3a1ef5d729 100644 --- a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp @@ -46,9 +46,9 @@ define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NULLs pas #define DEFAULT_STACK_SHADOW_PAGES (6 DEBUG_ONLY(+2)) #define DEFAULT_STACK_RESERVED_PAGES (0) -#define MIN_STACK_YELLOW_PAGES (1) +#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES #define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES -#define MIN_STACK_SHADOW_PAGES (1) +#define MIN_STACK_SHADOW_PAGES (3 DEBUG_ONLY(+1)) #define MIN_STACK_RESERVED_PAGES (0) define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES); diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index daa35899360..10598812c5c 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -1308,7 +1308,7 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { // insert the code of generate_stack_overflow_check(), see // assembler.cpp for some illuminative comments. const int page_size = os::vm_page_size(); - int bang_end = StackShadowPages * page_size; + int bang_end = JavaThread::stack_shadow_zone_size(); // This is how far the previous frame's stack banging extended. const int bang_end_safe = bang_end; diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp index 098e1ba4da0..d6642b5ca9b 100644 --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp @@ -2388,7 +2388,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm, Label no_reguard; __ lwz(r_temp_1, thread_(stack_guard_state)); - __ cmpwi(CCR0, r_temp_1, JavaThread::stack_guard_yellow_disabled); + __ cmpwi(CCR0, r_temp_1, JavaThread::stack_guard_yellow_reserved_disabled); __ bne(CCR0, no_reguard); save_native_result(masm, ret_type, workspace_slot_offset); diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index 1759df552e3..15e2e791114 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -3595,7 +3595,7 @@ void MacroAssembler::bang_stack_size(Register Rsize, Register Rtsp, // was post-decremented.) Skip this address by starting at i=1, and // touch a few more pages below. N.B. It is important to touch all // the way down to and including i=StackShadowPages. - for (int i = 1; i < StackShadowPages; i++) { + for (int i = 1; i < JavaThread::stack_shadow_zone_size() / os::vm_page_size(); i++) { set((-i*offset)+STACK_BIAS, Rscratch); st(G0, Rtsp, Rscratch); } diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp index 4357bdc7298..2c3e3b7c10a 100644 --- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp @@ -2643,7 +2643,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, Label no_reguard; __ ld(G2_thread, JavaThread::stack_guard_state_offset(), G3_scratch); - __ cmp_and_br_short(G3_scratch, JavaThread::stack_guard_yellow_disabled, Assembler::notEqual, Assembler::pt, no_reguard); + __ cmp_and_br_short(G3_scratch, JavaThread::stack_guard_yellow_reserved_disabled, Assembler::notEqual, Assembler::pt, no_reguard); save_native_result(masm, ret_type, stack_slots); __ call(CAST_FROM_FN_PTR(address, SharedRuntime::reguard_yellow_pages)); @@ -2936,7 +2936,7 @@ void SharedRuntime::generate_deopt_blob() { int pad = VerifyThread ? 512 : 0;// Extra slop space for more verify code #ifdef ASSERT if (UseStackBanging) { - pad += StackShadowPages*16 + 32; + pad += (JavaThread::stack_shadow_zone_size() / os::vm_page_size())*16 + 32; } #endif #if INCLUDE_JVMCI @@ -3225,7 +3225,7 @@ void SharedRuntime::generate_uncommon_trap_blob() { int pad = VerifyThread ? 512 : 0; #ifdef ASSERT if (UseStackBanging) { - pad += StackShadowPages*16 + 32; + pad += (JavaThread::stack_shadow_zone_size() / os::vm_page_size())*16 + 32; } #endif #ifdef _LP64 diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp index 31545256045..fc1a8f3124c 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp @@ -437,7 +437,7 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(Register Rframe // compute the beginning of the protected zone minus the requested frame size __ sub( Rscratch, Rscratch2, Rscratch ); - __ set( (StackRedPages+StackYellowPages) * page_size, Rscratch2 ); + __ set( JavaThread::stack_red_zone_size() + JavaThread::stack_yellow_zone_size(), Rscratch2 ); __ add( Rscratch, Rscratch2, Rscratch ); // Add in the size of the frame (which is the same as subtracting it from the diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index 695902087f4..9d77b092d4b 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -56,7 +56,8 @@ bool frame::safe_for_sender(JavaThread *thread) { address unextended_sp = (address)_unextended_sp; // consider stack guards when trying to determine "safe" stack pointers - static size_t stack_guard_size = os::uses_stack_guard_pages() ? (StackYellowPages + StackRedPages) * os::vm_page_size() : 0; + static size_t stack_guard_size = os::uses_stack_guard_pages() ? + JavaThread::stack_red_zone_size() + JavaThread::stack_yellow_zone_size() : 0; size_t usable_stack_size = thread->stack_size() - stack_guard_size; // sp must be within the usable part of the stack (not in guards) diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 59364c7d1df..4cd0855dc3f 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -1059,8 +1059,8 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) { // touch it again. (It was touched as (tmp-pagesize) but then tmp // was post-decremented.) Skip this address by starting at i=1, and // touch a few more pages below. N.B. It is important to touch all - // the way down to and including i=StackShadowPages. - for (int i = 1; i < StackShadowPages; i++) { + // the way down including all pages in the shadow zone. + for (int i = 1; i < ((int)JavaThread::stack_shadow_zone_size() / os::vm_page_size()); i++) { // this could be any sized move but this is can be a debugging crumb // so the bigger the better. movptr(Address(tmp, (-i*os::vm_page_size())), size ); diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index 96cfbe56ea1..6da8628bd49 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp @@ -1776,7 +1776,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, // Generate stack overflow check if (UseStackBanging) { - __ bang_stack_with_offset(StackShadowPages*os::vm_page_size()); + __ bang_stack_with_offset((int)JavaThread::stack_shadow_zone_size()); } else { // need a 5 byte instruction to allow MT safe patching to non-entrant __ fat_nop(); @@ -2151,7 +2151,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, Label reguard; Label reguard_done; - __ cmpl(Address(thread, JavaThread::stack_guard_state_offset()), JavaThread::stack_guard_yellow_disabled); + __ cmpl(Address(thread, JavaThread::stack_guard_state_offset()), JavaThread::stack_guard_yellow_reserved_disabled); __ jcc(Assembler::equal, reguard); // slow path reguard re-enters here diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index 79b2a0f1db6..2af5ee60a1c 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -2065,7 +2065,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, // Generate stack overflow check if (UseStackBanging) { - __ bang_stack_with_offset(StackShadowPages*os::vm_page_size()); + __ bang_stack_with_offset((int)JavaThread::stack_shadow_zone_size()); } else { // need a 5 byte instruction to allow MT safe patching to non-entrant __ fat_nop(); @@ -2499,7 +2499,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, Label reguard; Label reguard_done; - __ cmpl(Address(r15_thread, JavaThread::stack_guard_state_offset()), JavaThread::stack_guard_yellow_disabled); + __ cmpl(Address(r15_thread, JavaThread::stack_guard_state_offset()), JavaThread::stack_guard_yellow_reserved_disabled); __ jcc(Assembler::equal, reguard); __ bind(reguard_done); diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp index 42be5f952b2..fc242b183c4 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp @@ -540,12 +540,12 @@ void InterpreterGenerator::generate_stack_overflow_check(void) { __ addptr(rax, stack_base); __ subptr(rax, stack_size); - // Use the maximum number of pages we might bang. - const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages+StackReservedPages) ? StackShadowPages : - (StackRedPages+StackYellowPages+StackReservedPages); + // Use the bigger size for banging. + const int max_bang_size = (int)MAX2(JavaThread::stack_shadow_zone_size(), + JavaThread::stack_guard_zone_size()); // add in the red and yellow zone sizes - __ addptr(rax, max_pages * page_size); + __ addptr(rax, max_bang_size); // check against the current stack bottom __ cmpptr(rsp, rax); @@ -1187,7 +1187,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { { Label no_reguard; __ cmpl(Address(thread, JavaThread::stack_guard_state_offset()), - JavaThread::stack_guard_yellow_disabled); + JavaThread::stack_guard_yellow_reserved_disabled); __ jcc(Assembler::notEqual, no_reguard); __ pusha(); // XXX only save smashed registers diff --git a/hotspot/src/cpu/zero/vm/stack_zero.hpp b/hotspot/src/cpu/zero/vm/stack_zero.hpp index 5f34b7c1cb7..df1ea7235c8 100644 --- a/hotspot/src/cpu/zero/vm/stack_zero.hpp +++ b/hotspot/src/cpu/zero/vm/stack_zero.hpp @@ -40,7 +40,7 @@ class ZeroStack { public: ZeroStack() : _base(NULL), _top(NULL), _sp(NULL) { - _shadow_pages_size = StackShadowPages * os::vm_page_size(); + _shadow_pages_size = JavaThread::stack_shadow_zone_size(); } bool needs_setup() const { diff --git a/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp b/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp index 0f868823f69..7123098dfbb 100644 --- a/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp +++ b/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp @@ -49,10 +49,11 @@ inline void ZeroStack::overflow_check(int required_words, TRAPS) { // value can be negative. inline int ZeroStack::abi_stack_available(Thread *thread) const { guarantee(Thread::current() == thread, "should run in the same thread"); - int stack_used = thread->stack_base() - (address) &stack_used - + (StackYellowPages+StackRedPages+StackShadowPages) * os::vm_page_size(); - int stack_free = thread->stack_size() - stack_used; - return stack_free; + assert(thread->stack_size() - + (thread->stack_base() - (address) &stack_used + + JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size()) == + (address)&stack_used - thread->stack_overflow_limit(), "sanity"); + return (address)&stack_used - stack_overflow_limit(); } #endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index 7a14eaad3ab..5b8ed99bf0d 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -845,7 +845,7 @@ static void *java_start(Thread *thread) { trcVerbose("newborn Thread : pthread-id %u, ktid " UINT64_FORMAT ", stack %p ... %p, stacksize 0x%IX (%IB)", pthread_id, kernel_thread_id, - thread->stack_base() - thread->stack_size(), + thread->stack_end(), thread->stack_base(), thread->stack_size(), thread->stack_size()); @@ -1014,7 +1014,7 @@ bool os::create_attached_thread(JavaThread* thread) { trcVerbose("attaching Thread : pthread-id %u, ktid " UINT64_FORMAT ", stack %p ... %p, stacksize 0x%IX (%IB)", pthread_id, kernel_thread_id, - thread->stack_base() - thread->stack_size(), + thread->stack_end(), thread->stack_base(), thread->stack_size(), thread->stack_size()); @@ -3570,15 +3570,6 @@ void os::init(void) { Aix::_main_thread = pthread_self(); initial_time_count = os::elapsed_counter(); - - // If the pagesize of the VM is greater than 8K determine the appropriate - // number of initial guard pages. The user can change this with the - // command line arguments, if needed. - if (vm_page_size() > (int)Aix::vm_default_page_size()) { - StackYellowPages = 1; - StackRedPages = 1; - StackShadowPages = round_to((StackShadowPages*Aix::vm_default_page_size()), vm_page_size()) / vm_page_size(); - } } // This is called _after_ the global arguments have been parsed. @@ -3684,8 +3675,9 @@ jint os::init_2(void) { // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. os::Aix::min_stack_allowed = MAX2(os::Aix::min_stack_allowed, - (size_t)(StackYellowPages+StackRedPages+StackShadowPages) * Aix::page_size() + - (2*BytesPerWord COMPILER2_PRESENT(+1)) * Aix::vm_default_page_size()); + JavaThread::stack_guard_zone_size() + + JavaThread::stack_shadow_zone_size() + + (2*BytesPerWord COMPILER2_PRESENT(+1)) * Aix::vm_default_page_size()); os::Aix::min_stack_allowed = align_size_up(os::Aix::min_stack_allowed, os::Aix::page_size()); diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index 891a66b8d25..664bd02b904 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -3479,8 +3479,9 @@ jint os::init_2(void) { // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. os::Bsd::min_stack_allowed = MAX2(os::Bsd::min_stack_allowed, - (size_t)(StackReservedPages+StackYellowPages+StackRedPages+StackShadowPages+ - 2*BytesPerWord COMPILER2_PRESENT(+1)) * Bsd::page_size()); + JavaThread::stack_guard_zone_size() + + JavaThread::stack_shadow_zone_size() + + 2*BytesPerWord COMPILER2_PRESENT(+1) * Bsd::page_size()); size_t threadStackSizeInBytes = ThreadStackSize * K; if (threadStackSizeInBytes != 0 && diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 4b8cb0bbde1..7e01a577d5b 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -621,7 +621,7 @@ bool os::Linux::manually_expand_stack(JavaThread * t, address addr) { assert(t->osthread()->expanding_stack(), "expand should be set"); assert(t->stack_base() != NULL, "stack_base was not initialized"); - if (addr < t->stack_base() && addr >= t->stack_yellow_zone_base()) { + if (addr < t->stack_base() && addr >= t->stack_reserved_zone_base()) { sigset_t mask_all, old_sigset; sigfillset(&mask_all); pthread_sigmask(SIG_SETMASK, &mask_all, &old_sigset); @@ -836,7 +836,7 @@ bool os::create_attached_thread(JavaThread* thread) { // is no gap between the last two virtual memory regions. JavaThread *jt = (JavaThread *)thread; - address addr = jt->stack_yellow_zone_base(); + address addr = jt->stack_reserved_zone_base(); assert(addr != NULL, "initialization problem?"); assert(jt->stack_available(addr) > 0, "stack guard should not be enabled"); @@ -1863,8 +1863,7 @@ void * os::Linux::dll_load_in_vmthread(const char *filename, char *ebuf, while (jt) { if (!jt->stack_guard_zone_unused() && // Stack not yet fully initialized jt->stack_guards_enabled()) { // No pending stack overflow exceptions - if (!os::guard_memory((char *) jt->stack_red_zone_base() - jt->stack_red_zone_size(), - jt->stack_yellow_zone_size() + jt->stack_red_zone_size())) { + if (!os::guard_memory((char *)jt->stack_end(), jt->stack_guard_zone_size())) { warning("Attempt to reguard stack yellow zone failed."); } } @@ -4580,20 +4579,6 @@ void os::init(void) { } // else it defaults to CLOCK_REALTIME - // If the pagesize of the VM is greater than 8K determine the appropriate - // number of initial guard pages. The user can change this with the - // command line arguments, if needed. - if (vm_page_size() > (int)Linux::vm_default_page_size()) { - StackYellowPages = 1; - StackRedPages = 1; -#if defined(IA32) || defined(IA64) - StackReservedPages = 1; -#else - StackReservedPages = 0; -#endif - StackShadowPages = round_to((StackShadowPages*Linux::vm_default_page_size()), vm_page_size()) / vm_page_size(); - } - // retrieve entry point for pthread_setname_np Linux::_pthread_setname_np = (int(*)(pthread_t, const char*))dlsym(RTLD_DEFAULT, "pthread_setname_np"); @@ -4652,7 +4637,8 @@ jint os::init_2(void) { // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed, - (size_t)(StackReservedPages+StackYellowPages+StackRedPages+StackShadowPages) * Linux::page_size() + + JavaThread::stack_guard_zone_size() + + JavaThread::stack_shadow_zone_size() + (2*BytesPerWord COMPILER2_PRESENT(+1)) * Linux::vm_default_page_size()); size_t threadStackSizeInBytes = ThreadStackSize * K; diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 2191b9ea658..2a88667f34b 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -4359,15 +4359,6 @@ void os::init(void) { // the minimum of what the OS supports (thr_min_stack()), and // enough to allow the thread to get to user bytecode execution. Solaris::min_stack_allowed = MAX2(thr_min_stack(), Solaris::min_stack_allowed); - // If the pagesize of the VM is greater than 8K determine the appropriate - // number of initial guard pages. The user can change this with the - // command line arguments, if needed. - if (vm_page_size() > 8*K) { - StackYellowPages = 1; - StackRedPages = 1; - StackReservedPages = 1; - StackShadowPages = round_to((StackShadowPages*8*K), vm_page_size()) / vm_page_size(); - } } // To install functions for atexit system call @@ -4422,8 +4413,9 @@ jint os::init_2(void) { // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. os::Solaris::min_stack_allowed = MAX2(os::Solaris::min_stack_allowed, - (size_t)(StackReservedPages+StackYellowPages+StackRedPages+StackShadowPages+ - 2*BytesPerWord COMPILER2_PRESENT(+1)) * page_size); + JavaThread::stack_guard_zone_size() + + JavaThread::stack_shadow_zone_size() + + 2*BytesPerWord COMPILER2_PRESENT(+1) * page_size); size_t threadStackSizeInBytes = ThreadStackSize * K; if (threadStackSizeInBytes != 0 && @@ -4443,7 +4435,8 @@ jint os::init_2(void) { if (vm_page_size() > 8*K) { threadStackSizeInBytes = (threadStackSizeInBytes != 0) ? threadStackSizeInBytes + - ((StackYellowPages + StackRedPages) * vm_page_size()) + JavaThread::stack_red_zone_size() + + JavaThread::stack_yellow_zone_size() : 0; ThreadStackSize = threadStackSizeInBytes/K; } diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 24ea2e71321..d384aa48df0 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -2551,8 +2551,8 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { } else if(thread->addr_inside_register_stack(addr)) { // Disable the yellow zone which sets the state that // we've got a stack overflow problem. - if (thread->stack_yellow_zone_enabled()) { - thread->disable_stack_yellow_zone(); + if (thread->stack_yellow_reserved_zone_enabled()) { + thread->disable_stack_yellow_reserved_zone(); } // Give us some room to process the exception. thread->disable_register_stack_guard(); @@ -2587,7 +2587,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { // Yellow zone violation. The o/s has unprotected the first yellow // zone page for us. Note: must call disable_stack_yellow_zone to // update the enabled status, even if the zone contains only one page. - thread->disable_stack_yellow_zone(); + thread->disable_stack_yellow_reserved_zone(); // If not in java code, return and hope for the best. return in_java ? Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW)) @@ -2616,7 +2616,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { if (in_java) { PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; address addr = (address) exceptionRecord->ExceptionInformation[1]; - address stack_end = thread->stack_base() - thread->stack_size(); + address stack_end = thread->stack_end(); if (addr < stack_end && addr >= stack_end - os::vm_page_size()) { // Stack overflow. assert(!os::uses_stack_guard_pages(), @@ -2640,7 +2640,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { // PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; address addr = (address) exceptionRecord->ExceptionInformation[1]; - if (addr > thread->stack_yellow_zone_base() && addr < thread->stack_base()) { + if (addr > thread->stack_reserved_zone_base() && addr < thread->stack_base()) { addr = (address)((uintptr_t)addr & (~((uintptr_t)os::vm_page_size() - (uintptr_t)1))); os::commit_memory((char *)addr, thread->stack_base() - addr, @@ -4080,7 +4080,7 @@ void nx_check_protection() { #endif // _WIN64 #endif // PRODUCT -// this is called _before_ the global arguments have been parsed +// This is called _before_ the global arguments have been parsed void os::init(void) { _initial_pid = _getpid(); @@ -4185,8 +4185,9 @@ jint os::init_2(void) { // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. size_t min_stack_allowed = - (size_t)(StackYellowPages+StackRedPages+StackShadowPages+ - 2*BytesPerWord COMPILER2_PRESENT(+1)) * os::vm_page_size(); + (size_t)(JavaThread::stack_yellow_zone_size() + JavaThread::stack_red_zone_size() + + JavaThread::stack_shadow_zone_size() + + (2*BytesPerWord COMPILER2_PRESENT(+1)) * os::vm_page_size()); if (actual_reserve_size < min_stack_allowed) { tty->print_cr("\nThe stack size specified is too small, " "Specify at least %dk", diff --git a/hotspot/src/os/windows/vm/os_windows.inline.hpp b/hotspot/src/os/windows/vm/os_windows.inline.hpp index 3227e069c38..be0b9e94a9b 100644 --- a/hotspot/src/os/windows/vm/os_windows.inline.hpp +++ b/hotspot/src/os/windows/vm/os_windows.inline.hpp @@ -26,6 +26,7 @@ #define OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP #include "runtime/os.hpp" +#include "runtime/thread.hpp" inline const char* os::dll_file_extension() { return ".dll"; } @@ -72,7 +73,7 @@ inline void os::bang_stack_shadow_pages() { // the OS may not map an intervening page into our space // and may fault on a memory access to interior of our frame. address sp = current_stack_pointer(); - for (int pages = 1; pages <= StackShadowPages; pages++) { + for (size_t pages = 1; pages <= (JavaThread::stack_shadow_zone_size() / os::vm_page_size()); pages++) { *((int *)(sp - (pages * vm_page_size()))) = 0; } } diff --git a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp index b380e88301b..d89c28fa85b 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp @@ -238,8 +238,7 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec if (thread != NULL) { // Handle ALL stack overflow variations here - if (sig == SIGSEGV && (addr < thread->stack_base() && - addr >= thread->stack_base() - thread->stack_size())) { + if (sig == SIGSEGV && thread->on_local_stack(addr)) { // stack overflow // // If we are in a yellow zone and we are inside java, we disable the yellow zone and @@ -247,8 +246,8 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec // If we are in native code or VM C code, we report-and-die. The original coding tried // to continue with yellow zone disabled, but that doesn't buy us much and prevents // hs_err_pid files. - if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); + if (thread->in_stack_yellow_reserved_zone(addr)) { + thread->disable_stack_yellow_reserved_zone(); if (thread->thread_state() == _thread_in_Java) { // Throw a stack overflow exception. // Guard pages will be reenabled while unwinding the stack. diff --git a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp index 77352cb789b..f8e7dc509b9 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp @@ -518,10 +518,9 @@ JVM_handle_bsd_signal(int sig, address addr = (address) info->si_addr; // check if fault address is within thread stack - if (addr < thread->stack_base() && - addr >= thread->stack_base() - thread->stack_size()) { + if (thread->on_local_stack(addr)) { // stack overflow - if (thread->in_stack_yellow_zone(addr)) { + if (thread->in_stack_yellow_reserved_zone(addr)) { if (thread->thread_state() == _thread_in_Java) { if (thread->in_stack_reserved_zone(addr)) { frame fr; @@ -542,11 +541,11 @@ JVM_handle_bsd_signal(int sig, } // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. - thread->disable_stack_yellow_zone(); + thread->disable_stack_yellow_reserved_zone(); stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); } else { // Thread was in the vm or native code. Return and try to finish. - thread->disable_stack_yellow_zone(); + thread->disable_stack_yellow_reserved_zone(); return 1; } } else if (thread->in_stack_red_zone(addr)) { diff --git a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp index 189aa8f40d4..c3801dfab64 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp @@ -187,11 +187,10 @@ JVM_handle_bsd_signal(int sig, address addr = (address) info->si_addr; // check if fault address is within thread stack - if (addr < thread->stack_base() && - addr >= thread->stack_base() - thread->stack_size()) { + if (thread->on_local_stack(addr)) { // stack overflow - if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); + if (thread->in_stack_yellow_reserved_zone(addr)) { + thread->disable_stack_yellow_reserved_zone(); ShouldNotCallThis(); } else if (thread->in_stack_red_zone(addr)) { diff --git a/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp b/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp index 2504e73cf9b..4e47e27628f 100644 --- a/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp +++ b/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp @@ -330,11 +330,10 @@ JVM_handle_linux_signal(int sig, address addr = (address) info->si_addr; // check if fault address is within thread stack - if (addr < thread->stack_base() && - addr >= thread->stack_base() - thread->stack_size()) { + if (thread->on_local_stack(addr)) { // stack overflow - if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); + if (thread->in_stack_yellow_reserved_zone(addr)) { + thread->disable_stack_yellow_reserved_zone(); if (thread->thread_state() == _thread_in_Java) { // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. diff --git a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp index 6a69f1b7a57..f9401d13c9b 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp @@ -242,11 +242,10 @@ JVM_handle_linux_signal(int sig, address addr = ((NativeInstruction*)pc)->get_stack_bang_address(uc); // Check if fault address is within thread stack. - if (addr < thread->stack_base() && - addr >= thread->stack_base() - thread->stack_size()) { + if (thread->on_local_stack(addr)) { // stack overflow - if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); + if (thread->in_stack_yellow_reserved_zone(addr)) { + thread->disable_stack_yellow_reserved_zone(); if (thread->thread_state() == _thread_in_Java) { // Throw a stack overflow exception. // Guard pages will be reenabled while unwinding the stack. diff --git a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp index dcc778b7262..30b321dc228 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp @@ -380,11 +380,10 @@ inline static bool checkOverflow(sigcontext* uc, JavaThread* thread, address* stub) { // check if fault address is within thread stack - if (addr < thread->stack_base() && - addr >= thread->stack_base() - thread->stack_size()) { + if (thread->on_local_stack(addr)) { // stack overflow - if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); + if (thread->in_stack_yellow_reserved_zone(addr)) { + thread->disable_stack_yellow_reserved_zone(); if (thread->thread_state() == _thread_in_Java) { // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp index 6a0d68de449..ec6ba97235a 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp @@ -346,10 +346,9 @@ JVM_handle_linux_signal(int sig, address addr = (address) info->si_addr; // check if fault address is within thread stack - if (addr < thread->stack_base() && - addr >= thread->stack_base() - thread->stack_size()) { + if (thread->on_local_stack(addr)) { // stack overflow - if (thread->in_stack_yellow_zone(addr)) { + if (thread->in_stack_yellow_reserved_zone(addr)) { if (thread->thread_state() == _thread_in_Java) { if (thread->in_stack_reserved_zone(addr)) { frame fr; @@ -371,11 +370,11 @@ JVM_handle_linux_signal(int sig, } // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. - thread->disable_stack_yellow_zone(); + thread->disable_stack_yellow_reserved_zone(); stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); } else { // Thread was in the vm or native code. Return and try to finish. - thread->disable_stack_yellow_zone(); + thread->disable_stack_yellow_reserved_zone(); return 1; } } else if (thread->in_stack_red_zone(addr)) { @@ -931,10 +930,10 @@ void os::workaround_expand_exec_shield_cs_limit() { * If we are embedded in an app other than launcher (initial != main stack), * we don't have much control or understanding of the address space, just let it slide. */ - char* hint = (char*) (Linux::initial_thread_stack_bottom() - - ((StackReservedPages + StackYellowPages + StackRedPages + 1) * page_size)); + char* hint = (char*)(Linux::initial_thread_stack_bottom() - + (JavaThread::stack_guard_zone_size() + page_size)); char* codebuf = os::attempt_reserve_memory_at(page_size, hint); - if ( (codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true)) ) { + if ((codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true))) { return; // No matter, we tried, best effort. } diff --git a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp index a1d5d000ba0..f57f89ad02f 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp @@ -178,11 +178,10 @@ JVM_handle_linux_signal(int sig, address addr = (address) info->si_addr; // check if fault address is within thread stack - if (addr < thread->stack_base() && - addr >= thread->stack_base() - thread->stack_size()) { + if (thread->on_local_stack(addr)) { // stack overflow - if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); + if (thread->in_stack_yellow_reserved_zone(addr)) { + thread->disable_stack_yellow_reserved_zone(); ShouldNotCallThis(); } else if (thread->in_stack_red_zone(addr)) { diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp index 5942a07d366..5fd0e0a78af 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp @@ -402,7 +402,7 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, // Handle ALL stack overflow variations here if (sig == SIGSEGV && info->si_code == SEGV_ACCERR) { address addr = (address) info->si_addr; - if (thread->in_stack_yellow_zone(addr)) { + if (thread->in_stack_yellow_reserved_zone(addr)) { // Sometimes the register windows are not properly flushed. if(uc->uc_mcontext.gwins != NULL) { ::handle_unflushed_register_windows(uc->uc_mcontext.gwins); @@ -424,11 +424,11 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, } // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. - thread->disable_stack_yellow_zone(); + thread->disable_stack_yellow_reserved_zone(); stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); } else { // Thread was in the vm or native code. Return and try to finish. - thread->disable_stack_yellow_zone(); + thread->disable_stack_yellow_reserved_zone(); return true; } } else if (thread->in_stack_red_zone(addr)) { diff --git a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp index 1a9e6c8c015..79a7f19a281 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp @@ -465,7 +465,7 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, // Handle ALL stack overflow variations here if (sig == SIGSEGV && info->si_code == SEGV_ACCERR) { address addr = (address) info->si_addr; - if (thread->in_stack_yellow_zone(addr)) { + if (thread->in_stack_yellow_reserved_zone(addr)) { if (thread->thread_state() == _thread_in_Java) { if (thread->in_stack_reserved_zone(addr)) { frame fr; @@ -486,11 +486,11 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, } // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. - thread->disable_stack_yellow_zone(); + thread->disable_stack_yellow_reserved_zone(); stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); } else { // Thread was in the vm or native code. Return and try to finish. - thread->disable_stack_yellow_zone(); + thread->disable_stack_yellow_reserved_zone(); return true; } } else if (thread->in_stack_red_zone(addr)) { diff --git a/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp index 3007c6bee79..d41f3e7167f 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp @@ -65,23 +65,19 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, // Something would really have to be screwed up to get a NULL pc - if (addr.pc() == NULL ) { + if (addr.pc() == NULL) { assert(false, "NULL pc from signal handler!"); return false; - } // If sp and fp are nonsense just leave them out - if ((address)ret_sp >= jt->stack_base() || - (address)ret_sp < jt->stack_base() - jt->stack_size() ) { - - ret_sp = NULL; - ret_fp = NULL; + if (!jt->on_local_stack((address)ret_sp)) { + ret_sp = NULL; + ret_fp = NULL; } else { - // sp is reasonable is fp reasonable? - if ( (address)ret_fp >= jt->stack_base() || ret_fp < ret_sp) { + if ((address)ret_fp >= jt->stack_base() || ret_fp < ret_sp) { ret_fp = NULL; } } diff --git a/hotspot/src/share/vm/asm/assembler.cpp b/hotspot/src/share/vm/asm/assembler.cpp index bc8610875c1..fe8dbb1b401 100644 --- a/hotspot/src/share/vm/asm/assembler.cpp +++ b/hotspot/src/share/vm/asm/assembler.cpp @@ -23,12 +23,13 @@ */ #include "precompiled.hpp" +#include "asm/codeBuffer.hpp" #include "asm/macroAssembler.hpp" #include "asm/macroAssembler.inline.hpp" -#include "asm/codeBuffer.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/icache.hpp" #include "runtime/os.hpp" +#include "runtime/thread.hpp" // Implementation of AbstractAssembler @@ -132,7 +133,7 @@ void AbstractAssembler::generate_stack_overflow_check(int frame_size_in_bytes) { // is greater than a page. const int page_size = os::vm_page_size(); - int bang_end = StackShadowPages * page_size; + int bang_end = (int)JavaThread::stack_shadow_zone_size(); // This is how far the previous frame's stack banging extended. const int bang_end_safe = bang_end; diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index 0897270af93..a8a71c4c9a5 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -532,9 +532,10 @@ void AbstractInterpreterGenerator::bang_stack_shadow_pages(bool native_call) { // an interpreter frame with greater than a page of locals, so each page // needs to be checked. Only true for non-native. if (UseStackBanging) { - const int start_page = native_call ? StackShadowPages : 1; const int page_size = os::vm_page_size(); - for (int pages = start_page; pages <= StackShadowPages ; pages++) { + const int n_shadow_pages = ((int)JavaThread::stack_shadow_zone_size()) / page_size; + const int start_page = native_call ? n_shadow_pages : 1; + for (int pages = start_page; pages <= n_shadow_pages; pages++) { __ bang_stack_with_offset(pages*page_size); } } diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 59944c9ea76..873dd07f43b 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -1201,7 +1201,7 @@ WB_END WB_ENTRY(jlong, WB_GetThreadRemainingStackSize(JNIEnv* env, jobject o)) JavaThread* t = JavaThread::current(); - return (jlong) t->stack_available(os::current_stack_pointer()) - (jlong) StackShadowPages * os::vm_page_size(); + return (jlong) t->stack_available(os::current_stack_pointer()) - (jlong)JavaThread::stack_shadow_zone_size(); WB_END diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 6292486d48e..8743d72cad4 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -3428,15 +3428,18 @@ public: \ /* stack parameters */ \ product_pd(intx, StackYellowPages, \ - "Number of yellow zone (recoverable overflows) pages") \ + "Number of yellow zone (recoverable overflows) pages of size " \ + "4KB. If pages are bigger yellow zone is aligned up.") \ range(MIN_STACK_YELLOW_PAGES, (DEFAULT_STACK_YELLOW_PAGES+5)) \ \ product_pd(intx, StackRedPages, \ - "Number of red zone (unrecoverable overflows) pages") \ + "Number of red zone (unrecoverable overflows) pages of size " \ + "4KB. If pages are bigger red zone is aligned up.") \ range(MIN_STACK_RED_PAGES, (DEFAULT_STACK_RED_PAGES+2)) \ \ product_pd(intx, StackReservedPages, \ - "Number of reserved zone (reserved to annotated methods) pages") \ + "Number of reserved zone (reserved to annotated methods) pages" \ + " of size 4KB. If pages are bigger reserved zone is aligned up.") \ range(MIN_STACK_RESERVED_PAGES, (DEFAULT_STACK_RESERVED_PAGES+10))\ \ product(bool, RestrictReservedStack, true, \ @@ -3444,13 +3447,14 @@ public: \ /* greater stack shadow pages can't generate instruction to bang stack */ \ product_pd(intx, StackShadowPages, \ - "Number of shadow zone (for overflow checking) pages " \ - "this should exceed the depth of the VM and native call stack") \ + "Number of shadow zone (for overflow checking) pages of size " \ + "4KB. If pages are bigger shadow zone is aligned up. " \ + "This should exceed the depth of the VM and native call stack.") \ range(MIN_STACK_SHADOW_PAGES, (DEFAULT_STACK_SHADOW_PAGES+30)) \ \ product_pd(intx, ThreadStackSize, \ "Thread Stack Size (in Kbytes)") \ - range(0, max_intx-os::vm_page_size()) \ + range(0, (max_intx-os::vm_page_size())/(1 * K)) \ \ product_pd(intx, VMThreadStackSize, \ "Non-Java Thread Stack Size (in Kbytes)") \ @@ -3458,7 +3462,7 @@ public: \ product_pd(intx, CompilerThreadStackSize, \ "Compiler Thread Stack Size (in Kbytes)") \ - range(0, max_intx /(1 * K)) \ + range(0, max_intx/(1 * K)) \ \ develop_pd(size_t, JVMInvokeMethodSlack, \ "Stack space (bytes) required for JVM_InvokeMethod to complete") \ diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index e1c71bf1406..c0019941ae2 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -316,8 +316,16 @@ void os::init_before_ergo() { // decisions depending on large page support and the calculated large page size. large_page_init(); + // We need to adapt the configured number of stack protection pages given + // in 4K pages to the actual os page size. We must do this before setting + // up minimal stack sizes etc. in os::init_2(). + JavaThread::set_stack_red_zone_size (align_size_up(StackRedPages * 4 * K, vm_page_size())); + JavaThread::set_stack_yellow_zone_size (align_size_up(StackYellowPages * 4 * K, vm_page_size())); + JavaThread::set_stack_reserved_zone_size(align_size_up(StackReservedPages * 4 * K, vm_page_size())); + JavaThread::set_stack_shadow_zone_size (align_size_up(StackShadowPages * 4 * K, vm_page_size())); + // VM version initialization identifies some characteristics of the - // the platform that are used during ergonomic decisions. + // platform that are used during ergonomic decisions. VM_Version::init_before_ergo(); } @@ -1015,8 +1023,7 @@ void os::print_location(outputStream* st, intptr_t x, bool verbose) { } // If the addr is in the stack region for this thread then report that // and print thread info - if (thread->stack_base() >= addr && - addr > (thread->stack_base() - thread->stack_size())) { + if (thread->on_local_stack(addr)) { st->print_cr(INTPTR_FORMAT " is pointing into the stack for thread: " INTPTR_FORMAT, p2i(addr), p2i(thread)); if (verbose) thread->print_on(st); @@ -1375,9 +1382,8 @@ void os::serialize_thread_states() { // Returns true if the current stack pointer is above the stack shadow // pages, false otherwise. - bool os::stack_shadow_pages_available(Thread *thread, const methodHandle& method) { - assert(StackRedPages > 0 && StackYellowPages > 0,"Sanity check"); + if (!thread->is_Java_thread()) return false; address sp = current_stack_pointer(); // Check if we have StackShadowPages above the yellow zone. This parameter // is dependent on the depth of the maximum VM call stack possible from @@ -1386,12 +1392,13 @@ bool os::stack_shadow_pages_available(Thread *thread, const methodHandle& method // respectively. const int framesize_in_bytes = Interpreter::size_top_interpreter_activation(method()) * wordSize; - int reserved_area = ((StackShadowPages + StackRedPages + StackYellowPages - + StackReservedPages) * vm_page_size()) - + framesize_in_bytes; - // The very lower end of the stack - address stack_limit = thread->stack_base() - thread->stack_size(); - return (sp > (stack_limit + reserved_area)); + + assert((thread->stack_base() - thread->stack_size()) + + (JavaThread::stack_guard_zone_size() + + JavaThread::stack_shadow_zone_size() + framesize_in_bytes) == + ((JavaThread*)thread)->stack_overflow_limit() + framesize_in_bytes, "sanity"); + + return (sp > ((JavaThread*)thread)->stack_overflow_limit() + framesize_in_bytes); } size_t os::page_size_for_region(size_t region_size, size_t min_pages, bool must_be_aligned) { diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 12773612f19..e750a234ce5 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -319,8 +319,7 @@ void Thread::record_stack_base_and_size() { #if INCLUDE_NMT // record thread's native stack, stack grows downward - address stack_low_addr = stack_base() - stack_size(); - MemTracker::record_thread_stack(stack_low_addr, stack_size()); + MemTracker::record_thread_stack(stack_end(), stack_size()); #endif // INCLUDE_NMT } @@ -337,8 +336,7 @@ Thread::~Thread() { // not proper way to enforce that. #if INCLUDE_NMT if (_stack_base != NULL) { - address low_stack_addr = stack_base() - stack_size(); - MemTracker::release_thread_stack(low_stack_addr, stack_size()); + MemTracker::release_thread_stack(stack_end(), stack_size()); #ifdef ASSERT set_stack_base(NULL); #endif @@ -821,7 +819,7 @@ void Thread::print_on_error(outputStream* st, char* buf, int buflen) const { else st->print("Thread"); st->print(" [stack: " PTR_FORMAT "," PTR_FORMAT "]", - p2i(_stack_base - _stack_size), p2i(_stack_base)); + p2i(stack_end()), p2i(stack_base())); if (osthread()) { st->print(" [id=%d]", osthread()->thread_id()); @@ -907,9 +905,8 @@ bool Thread::is_in_stack(address adr) const { return false; } - bool Thread::is_in_usable_stack(address adr) const { - size_t stack_guard_size = os::uses_stack_guard_pages() ? (StackReservedPages + StackYellowPages + StackRedPages) * os::vm_page_size() : 0; + size_t stack_guard_size = os::uses_stack_guard_pages() ? JavaThread::stack_guard_zone_size() : 0; size_t usable_stack_size = _stack_size - stack_guard_size; return ((adr < stack_base()) && (adr >= stack_base() - usable_stack_size)); @@ -1534,7 +1531,7 @@ JavaThread::JavaThread(bool is_attaching_via_jni) : } bool JavaThread::reguard_stack(address cur_sp) { - if (_stack_guard_state != stack_guard_yellow_disabled + if (_stack_guard_state != stack_guard_yellow_reserved_disabled && _stack_guard_state != stack_guard_reserved_disabled) { return true; // Stack already guarded or guard pages not needed. } @@ -1551,9 +1548,10 @@ bool JavaThread::reguard_stack(address cur_sp) { // is executing there, either StackShadowPages should be larger, or // some exception code in c1, c2 or the interpreter isn't unwinding // when it should. - guarantee(cur_sp > stack_yellow_zone_base(), "not enough space to reguard - increase StackShadowPages"); - if (_stack_guard_state == stack_guard_yellow_disabled) { - enable_stack_yellow_zone(); + guarantee(cur_sp > stack_reserved_zone_base(), + "not enough space to reguard - increase StackShadowPages"); + if (_stack_guard_state == stack_guard_yellow_reserved_disabled) { + enable_stack_yellow_reserved_zone(); if (reserved_stack_activation() != stack_base()) { set_reserved_stack_activation(stack_base()); } @@ -2480,10 +2478,15 @@ void JavaThread::java_resume() { } } +size_t JavaThread::_stack_red_zone_size = 0; +size_t JavaThread::_stack_yellow_zone_size = 0; +size_t JavaThread::_stack_reserved_zone_size = 0; +size_t JavaThread::_stack_shadow_zone_size = 0; + void JavaThread::create_stack_guard_pages() { - if (! os::uses_stack_guard_pages() || _stack_guard_state != stack_guard_unused) return; - address low_addr = stack_base() - stack_size(); - size_t len = (StackReservedPages + StackYellowPages + StackRedPages) * os::vm_page_size(); + if (!os::uses_stack_guard_pages() || _stack_guard_state != stack_guard_unused) { return; } + address low_addr = stack_end(); + size_t len = stack_guard_zone_size(); int allocate = os::allocate_stack_guard_pages(); // warning("Guarding at " PTR_FORMAT " for len " SIZE_FORMAT "\n", low_addr, len); @@ -2506,8 +2509,8 @@ void JavaThread::create_stack_guard_pages() { void JavaThread::remove_stack_guard_pages() { assert(Thread::current() == this, "from different thread"); if (_stack_guard_state == stack_guard_unused) return; - address low_addr = stack_base() - stack_size(); - size_t len = (StackReservedPages + StackYellowPages + StackRedPages) * os::vm_page_size(); + address low_addr = stack_end(); + size_t len = stack_guard_zone_size(); if (os::allocate_stack_guard_pages()) { if (os::remove_stack_guard_pages((char *) low_addr, len)) { @@ -2563,18 +2566,18 @@ void JavaThread::disable_stack_reserved_zone() { disable_register_stack_guard(); } -void JavaThread::enable_stack_yellow_zone() { +void JavaThread::enable_stack_yellow_reserved_zone() { assert(_stack_guard_state != stack_guard_unused, "must be using guard pages."); assert(_stack_guard_state != stack_guard_enabled, "already enabled"); // The base notation is from the stacks point of view, growing downward. // We need to adjust it to work correctly with guard_memory() - address base = stack_yellow_zone_base() - stack_yellow_zone_size(); + address base = stack_red_zone_base(); guarantee(base < stack_base(), "Error calculating stack yellow zone"); guarantee(base < os::current_stack_pointer(), "Error calculating stack yellow zone"); - if (os::guard_memory((char *) base, stack_yellow_zone_size())) { + if (os::guard_memory((char *) base, stack_yellow_reserved_zone_size())) { _stack_guard_state = stack_guard_enabled; } else { warning("Attempt to guard stack yellow zone failed."); @@ -2582,19 +2585,19 @@ void JavaThread::enable_stack_yellow_zone() { enable_register_stack_guard(); } -void JavaThread::disable_stack_yellow_zone() { +void JavaThread::disable_stack_yellow_reserved_zone() { assert(_stack_guard_state != stack_guard_unused, "must be using guard pages."); - assert(_stack_guard_state != stack_guard_yellow_disabled, "already disabled"); + assert(_stack_guard_state != stack_guard_yellow_reserved_disabled, "already disabled"); // Simply return if called for a thread that does not use guard pages. if (_stack_guard_state == stack_guard_unused) return; // The base notation is from the stacks point of view, growing downward. // We need to adjust it to work correctly with guard_memory() - address base = stack_yellow_zone_base() - stack_yellow_zone_size(); + address base = stack_red_zone_base(); - if (os::unguard_memory((char *)base, stack_yellow_zone_size())) { - _stack_guard_state = stack_guard_yellow_disabled; + if (os::unguard_memory((char *)base, stack_yellow_reserved_zone_size())) { + _stack_guard_state = stack_guard_yellow_reserved_disabled; } else { warning("Attempt to unguard stack yellow zone failed."); } @@ -2899,7 +2902,7 @@ void JavaThread::print_on_error(outputStream* st, char *buf, int buflen) const { st->print(", id=%d", osthread()->thread_id()); } st->print(", stack(" PTR_FORMAT "," PTR_FORMAT ")", - p2i(_stack_base - _stack_size), p2i(_stack_base)); + p2i(stack_end()), p2i(stack_base())); st->print("]"); return; } diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index 8948ed0ddaf..6904cd5c36c 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -549,15 +549,15 @@ protected: public: // Stack overflow support address stack_base() const { assert(_stack_base != NULL,"Sanity check"); return _stack_base; } - void set_stack_base(address base) { _stack_base = base; } size_t stack_size() const { return _stack_size; } void set_stack_size(size_t size) { _stack_size = size; } + address stack_end() const { return stack_base() - stack_size(); } void record_stack_base_and_size(); bool on_local_stack(address adr) const { // QQQ this has knowledge of direction, ought to be a stack method - return (_stack_base >= adr && adr >= (_stack_base - _stack_size)); + return (_stack_base >= adr && adr >= stack_end()); } uintptr_t self_raw_id() { return _self_raw_id; } @@ -910,7 +910,7 @@ class JavaThread: public Thread { enum StackGuardState { stack_guard_unused, // not needed stack_guard_reserved_disabled, - stack_guard_yellow_disabled,// disabled (temporarily) after stack overflow + stack_guard_yellow_reserved_disabled,// disabled (temporarily) after stack overflow stack_guard_enabled // enabled }; @@ -1344,32 +1344,138 @@ class JavaThread: public Thread { } // Stack overflow support + // + // (small addresses) + // + // -- <-- stack_end() --- + // | | + // | red pages | + // | | + // -- <-- stack_red_zone_base() | + // | | + // | guard + // | yellow pages zone + // | | + // | | + // -- <-- stack_yellow_zone_base() | + // | | + // | | + // | reserved pages | + // | | + // -- <-- stack_reserved_zone_base() --- --- + // /|\ shadow + // | zone + // \|/ size + // some untouched memory --- <-- stack_overflow_limit() + // + // + // -- + // | + // | shadow zone + // | + // -- + // x frame n + // -- + // x frame n-1 + // x + // -- + // ... + // + // -- + // x frame 0 + // -- <-- stack_base() + // + // (large addresses) + // + + private: + // These values are derived from flags StackRedPages, StackYellowPages, + // StackReservedPages and StackShadowPages. The zone size is determined + // ergonomically if page_size > 4K. + static size_t _stack_red_zone_size; + static size_t _stack_yellow_zone_size; + static size_t _stack_reserved_zone_size; + static size_t _stack_shadow_zone_size; + public: inline size_t stack_available(address cur_sp); - address stack_reserved_zone_base() { - return stack_yellow_zone_base(); } - size_t stack_reserved_zone_size() { - return StackReservedPages * os::vm_page_size(); } - address stack_yellow_zone_base() { - return (address)(stack_base() - - (stack_size() - - (stack_red_zone_size() + stack_yellow_zone_size()))); + + static size_t stack_red_zone_size() { + assert(_stack_red_zone_size > 0, "Don't call this before the field is initialized."); + return _stack_red_zone_size; } - size_t stack_yellow_zone_size() { - return StackYellowPages * os::vm_page_size() + stack_reserved_zone_size(); + static void set_stack_red_zone_size(size_t s) { + assert(is_size_aligned(s, os::vm_page_size()), + "We can not protect if the red zone size is not page aligned."); + assert(_stack_red_zone_size == 0, "This should be called only once."); + _stack_red_zone_size = s; } address stack_red_zone_base() { - return (address)(stack_base() - (stack_size() - stack_red_zone_size())); - } - size_t stack_red_zone_size() { return StackRedPages * os::vm_page_size(); } - bool in_stack_reserved_zone(address a) { - return (a <= stack_reserved_zone_base()) && (a >= (address)((intptr_t)stack_reserved_zone_base() - stack_reserved_zone_size())); - } - bool in_stack_yellow_zone(address a) { - return (a <= stack_yellow_zone_base()) && (a >= stack_red_zone_base()); + return (address)(stack_end() + stack_red_zone_size()); } bool in_stack_red_zone(address a) { - return (a <= stack_red_zone_base()) && - (a >= (address)((intptr_t)stack_base() - stack_size())); + return a <= stack_red_zone_base() && a >= stack_end(); + } + + static size_t stack_yellow_zone_size() { + assert(_stack_yellow_zone_size > 0, "Don't call this before the field is initialized."); + return _stack_yellow_zone_size; + } + static void set_stack_yellow_zone_size(size_t s) { + assert(is_size_aligned(s, os::vm_page_size()), + "We can not protect if the yellow zone size is not page aligned."); + assert(_stack_yellow_zone_size == 0, "This should be called only once."); + _stack_yellow_zone_size = s; + } + + static size_t stack_reserved_zone_size() { + // _stack_reserved_zone_size may be 0. This indicates the feature is off. + return _stack_reserved_zone_size; + } + static void set_stack_reserved_zone_size(size_t s) { + assert(is_size_aligned(s, os::vm_page_size()), + "We can not protect if the reserved zone size is not page aligned."); + assert(_stack_reserved_zone_size == 0, "This should be called only once."); + _stack_reserved_zone_size = s; + } + address stack_reserved_zone_base() { + return (address)(stack_end() + + (stack_red_zone_size() + stack_yellow_zone_size() + stack_reserved_zone_size())); + } + bool in_stack_reserved_zone(address a) { + return (a <= stack_reserved_zone_base()) && + (a >= (address)((intptr_t)stack_reserved_zone_base() - stack_reserved_zone_size())); + } + + static size_t stack_yellow_reserved_zone_size() { + return _stack_yellow_zone_size + _stack_reserved_zone_size; + } + bool in_stack_yellow_reserved_zone(address a) { + return (a <= stack_reserved_zone_base()) && (a >= stack_red_zone_base()); + } + + // Size of red + yellow + reserved zones. + static size_t stack_guard_zone_size() { + return stack_red_zone_size() + stack_yellow_reserved_zone_size(); + } + + static size_t stack_shadow_zone_size() { + assert(_stack_shadow_zone_size > 0, "Don't call this before the field is initialized."); + return _stack_shadow_zone_size; + } + static void set_stack_shadow_zone_size(size_t s) { + // The shadow area is not allocated or protected, so + // it needs not be page aligned. + // But the stack bang currently assumes that it is a + // multiple of page size. This guarantees that the bang + // loop touches all pages in the shadow zone. + // This can be guaranteed differently, as well. E.g., if + // the page size is a multiple of 4K, banging in 4K steps + // suffices to touch all pages. (Some pages are banged + // several times, though.) + assert(is_size_aligned(s, os::vm_page_size()), + "Stack bang assumes multiple of page size."); + assert(_stack_shadow_zone_size == 0, "This should be called only once."); + _stack_shadow_zone_size = s; } void create_stack_guard_pages(); @@ -1377,18 +1483,18 @@ class JavaThread: public Thread { void enable_stack_reserved_zone(); void disable_stack_reserved_zone(); - void enable_stack_yellow_zone(); - void disable_stack_yellow_zone(); + void enable_stack_yellow_reserved_zone(); + void disable_stack_yellow_reserved_zone(); void enable_stack_red_zone(); void disable_stack_red_zone(); inline bool stack_guard_zone_unused(); - inline bool stack_yellow_zone_disabled(); + inline bool stack_yellow_reserved_zone_disabled(); inline bool stack_reserved_zone_disabled(); inline bool stack_guards_enabled(); address reserved_stack_activation() const { return _reserved_stack_activation; } - void set_reserved_stack_activation(address addr) { + void set_reserved_stack_activation(address addr) { assert(_reserved_stack_activation == stack_base() || _reserved_stack_activation == NULL || addr == stack_base(), "Must not be set twice"); @@ -1408,11 +1514,9 @@ class JavaThread: public Thread { address stack_overflow_limit() { return _stack_overflow_limit; } void set_stack_overflow_limit() { - _stack_overflow_limit = _stack_base - _stack_size + - ((StackShadowPages + - StackReservedPages + - StackYellowPages + - StackRedPages) * os::vm_page_size()); + _stack_overflow_limit = stack_end() + + (JavaThread::stack_guard_zone_size() + + JavaThread::stack_shadow_zone_size()); } // Misc. accessors/mutators diff --git a/hotspot/src/share/vm/runtime/thread.inline.hpp b/hotspot/src/share/vm/runtime/thread.inline.hpp index 213d5ecffa0..4510bf2695f 100644 --- a/hotspot/src/share/vm/runtime/thread.inline.hpp +++ b/hotspot/src/share/vm/runtime/thread.inline.hpp @@ -126,8 +126,8 @@ inline bool JavaThread::stack_guard_zone_unused() { return _stack_guard_state == stack_guard_unused; } -inline bool JavaThread::stack_yellow_zone_disabled() { - return _stack_guard_state == stack_guard_yellow_disabled; +inline bool JavaThread::stack_yellow_reserved_zone_disabled() { + return _stack_guard_state == stack_guard_yellow_reserved_disabled; } inline bool JavaThread::stack_reserved_zone_disabled() { @@ -138,9 +138,9 @@ inline size_t JavaThread::stack_available(address cur_sp) { // This code assumes java stacks grow down address low_addr; // Limit on the address for deepest stack depth if (_stack_guard_state == stack_guard_unused) { - low_addr = stack_base() - stack_size(); + low_addr = stack_end(); } else { - low_addr = stack_yellow_zone_base(); + low_addr = stack_reserved_zone_base(); } return cur_sp > low_addr ? cur_sp - low_addr : 0; } diff --git a/hotspot/src/share/vm/shark/sharkStack.cpp b/hotspot/src/share/vm/shark/sharkStack.cpp index ce868d61d56..c819586dd40 100644 --- a/hotspot/src/share/vm/shark/sharkStack.cpp +++ b/hotspot/src/share/vm/shark/sharkStack.cpp @@ -133,7 +133,7 @@ void SharkStack::CreateStackOverflowCheck(Value* sp) { builder()->CreateCondBr( builder()->CreateICmpULT( free_stack, - LLVMValue::intptr_constant(StackShadowPages * os::vm_page_size())), + LLVMValue::intptr_constant(JavaThread::stack_shadow_zone_size())), overflow, abi_ok); // Handle overflows From c415f566518dcb283abe00f69d3aafdab6c8ef92 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Mon, 21 Dec 2015 12:02:03 +0100 Subject: [PATCH 148/228] 8145674: Fix includes and forward declarations in g1Remset files Reviewed-by: simonis, stefank --- hotspot/src/share/vm/gc/g1/g1RemSet.cpp | 31 ++++++++++++++----------- hotspot/src/share/vm/gc/g1/g1RemSet.hpp | 14 +++++++++-- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp index 7bf28b5debf..01493ef58e2 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp @@ -32,6 +32,7 @@ #include "gc/g1/g1HotCardCache.hpp" #include "gc/g1/g1OopClosures.inline.hpp" #include "gc/g1/g1RemSet.inline.hpp" +#include "gc/g1/heapRegion.inline.hpp" #include "gc/g1/heapRegionManager.inline.hpp" #include "gc/g1/heapRegionRemSet.hpp" #include "memory/iterator.hpp" @@ -40,13 +41,15 @@ #include "utilities/intHisto.hpp" #include "utilities/stack.inline.hpp" -G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs) - : _g1(g1), _conc_refine_cards(0), - _ct_bs(ct_bs), _g1p(_g1->g1_policy()), - _cg1r(g1->concurrent_g1_refine()), - _cset_rs_update_cl(NULL), - _prev_period_summary(), - _into_cset_dirty_card_queue_set(false) +G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs) : + _g1(g1), + _conc_refine_cards(0), + _ct_bs(ct_bs), + _g1p(_g1->g1_policy()), + _cg1r(g1->concurrent_g1_refine()), + _cset_rs_update_cl(NULL), + _prev_period_summary(), + _into_cset_dirty_card_queue_set(false) { _cset_rs_update_cl = NEW_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, n_workers(), mtGC); for (uint i = 0; i < n_workers(); i++) { @@ -76,13 +79,13 @@ G1RemSet::~G1RemSet() { ScanRSClosure::ScanRSClosure(G1ParPushHeapRSClosure* oc, CodeBlobClosure* code_root_cl, uint worker_i) : - _oc(oc), - _code_root_cl(code_root_cl), - _strong_code_root_scan_time_sec(0.0), - _cards(0), - _cards_done(0), - _worker_i(worker_i), - _try_claimed(false) { + _oc(oc), + _code_root_cl(code_root_cl), + _strong_code_root_scan_time_sec(0.0), + _cards(0), + _cards_done(0), + _worker_i(worker_i), + _try_claimed(false) { _g1h = G1CollectedHeap::heap(); _bot_shared = _g1h->bot_shared(); _ct_bs = _g1h->g1_barrier_set(); diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp index 73034313786..c0453a1db38 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp @@ -25,15 +25,25 @@ #ifndef SHARE_VM_GC_G1_G1REMSET_HPP #define SHARE_VM_GC_G1_G1REMSET_HPP +#include "gc/g1/dirtyCardQueue.hpp" #include "gc/g1/g1RemSetSummary.hpp" +#include "gc/g1/heapRegion.hpp" +#include "memory/allocation.hpp" +#include "memory/iterator.hpp" // A G1RemSet provides ways of iterating over pointers into a selected // collection set. -class G1CollectedHeap; +class BitMap; +class CardTableModRefBS; +class G1BlockOffsetSharedArray; class ConcurrentG1Refine; +class CodeBlobClosure; +class G1CollectedHeap; +class G1CollectorPolicy; class G1ParPushHeapRSClosure; -class outputStream; +class G1SATBCardTableModRefBS; +class HeapRegionClaimer; // A G1RemSet in which each heap region has a rem set that records the // external heap references into it. Uses a mod ref bs to track updates, From 8188ad75a70530af43d39e5cb1210458cb56e0c8 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Mon, 21 Dec 2015 12:02:08 +0100 Subject: [PATCH 149/228] 8145667: Move FromCardCache into separate files Reviewed-by: mgerdin, stefank --- .../src/share/vm/gc/g1/g1FromCardCache.cpp | 75 ++++++++++++++++++ .../src/share/vm/gc/g1/g1FromCardCache.hpp | 79 +++++++++++++++++++ .../src/share/vm/gc/g1/heapRegionRemSet.cpp | 46 ----------- .../src/share/vm/gc/g1/heapRegionRemSet.hpp | 49 +----------- 4 files changed, 155 insertions(+), 94 deletions(-) create mode 100644 hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp create mode 100644 hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp diff --git a/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp b/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp new file mode 100644 index 00000000000..a9814e2b6ba --- /dev/null +++ b/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp @@ -0,0 +1,75 @@ +/* + * 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 + * 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. + * + */ + +#include "precompiled.hpp" +#include "gc/g1/g1FromCardCache.hpp" +#include "gc/g1/heapRegionRemSet.hpp" +#include "memory/padded.inline.hpp" +#include "utilities/debug.hpp" + +int** FromCardCache::_cache = NULL; +uint FromCardCache::_max_regions = 0; +size_t FromCardCache::_static_mem_size = 0; + +void FromCardCache::initialize(uint n_par_rs, uint max_num_regions) { + guarantee(_cache == NULL, "Should not call this multiple times"); + + _max_regions = max_num_regions; + _cache = Padded2DArray::create_unfreeable(n_par_rs, + _max_regions, + &_static_mem_size); + + invalidate(0, _max_regions); +} + +void FromCardCache::invalidate(uint start_idx, size_t new_num_regions) { + guarantee((size_t)start_idx + new_num_regions <= max_uintx, + "Trying to invalidate beyond maximum region, from %u size " SIZE_FORMAT, + start_idx, new_num_regions); + for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) { + uint end_idx = (start_idx + (uint)new_num_regions); + assert(end_idx <= _max_regions, "Must be within max."); + for (uint j = start_idx; j < end_idx; j++) { + set(i, j, InvalidCard); + } + } +} + +#ifndef PRODUCT +void FromCardCache::print(outputStream* out) { + for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) { + for (uint j = 0; j < _max_regions; j++) { + out->print_cr("_from_card_cache[%u][%u] = %d.", + i, j, at(i, j)); + } + } +} +#endif + +void FromCardCache::clear(uint region_idx) { + uint num_par_remsets = HeapRegionRemSet::num_par_rem_sets(); + for (uint i = 0; i < num_par_remsets; i++) { + set(i, region_idx, InvalidCard); + } +} diff --git a/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp b/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp new file mode 100644 index 00000000000..7627e0c3425 --- /dev/null +++ b/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp @@ -0,0 +1,79 @@ +/* + * 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 + * 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. + * + */ + +#ifndef SHARE_VM_GC_G1_G1FROMCARDCACHE_HPP +#define SHARE_VM_GC_G1_G1FROMCARDCACHE_HPP + +#include "memory/allocation.hpp" +#include "utilities/ostream.hpp" + +// The FromCardCache remembers the most recently processed card on the heap on +// a per-region and per-thread basis. +class FromCardCache : public AllStatic { + private: + // Array of card indices. Indexed by thread X and heap region to minimize + // thread contention. + static int** _cache; + static uint _max_regions; + static size_t _static_mem_size; + + public: + enum { + InvalidCard = -1 // Card value of an invalid card, i.e. a card index not otherwise used. + }; + + static void clear(uint region_idx); + + // Returns true if the given card is in the cache at the given location, or + // replaces the card at that location and returns false. + static bool contains_or_replace(uint worker_id, uint region_idx, int card) { + int card_in_cache = at(worker_id, region_idx); + if (card_in_cache == card) { + return true; + } else { + set(worker_id, region_idx, card); + return false; + } + } + + static int at(uint worker_id, uint region_idx) { + return _cache[worker_id][region_idx]; + } + + static void set(uint worker_id, uint region_idx, int val) { + _cache[worker_id][region_idx] = val; + } + + static void initialize(uint n_par_rs, uint max_num_regions); + + static void invalidate(uint start_idx, size_t num_regions); + + static void print(outputStream* out = tty) PRODUCT_RETURN; + + static size_t static_mem_size() { + return _static_mem_size; + } +}; + +#endif // SHARE_VM_GC_G1_G1FROMCARDCACHE_HPP diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp index 74aaaf569f0..01c98adfaab 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp @@ -351,52 +351,6 @@ void OtherRegionsTable::unlink_from_all(PerRegionTable* prt) { "just checking"); } -int** FromCardCache::_cache = NULL; -uint FromCardCache::_max_regions = 0; -size_t FromCardCache::_static_mem_size = 0; - -void FromCardCache::initialize(uint n_par_rs, uint max_num_regions) { - guarantee(_cache == NULL, "Should not call this multiple times"); - - _max_regions = max_num_regions; - _cache = Padded2DArray::create_unfreeable(n_par_rs, - _max_regions, - &_static_mem_size); - - invalidate(0, _max_regions); -} - -void FromCardCache::invalidate(uint start_idx, size_t new_num_regions) { - guarantee((size_t)start_idx + new_num_regions <= max_uintx, - "Trying to invalidate beyond maximum region, from %u size " SIZE_FORMAT, - start_idx, new_num_regions); - for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) { - uint end_idx = (start_idx + (uint)new_num_regions); - assert(end_idx <= _max_regions, "Must be within max."); - for (uint j = start_idx; j < end_idx; j++) { - set(i, j, InvalidCard); - } - } -} - -#ifndef PRODUCT -void FromCardCache::print(outputStream* out) { - for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) { - for (uint j = 0; j < _max_regions; j++) { - out->print_cr("_from_card_cache[%u][%u] = %d.", - i, j, at(i, j)); - } - } -} -#endif - -void FromCardCache::clear(uint region_idx) { - uint num_par_remsets = HeapRegionRemSet::num_par_rem_sets(); - for (uint i = 0; i < num_par_remsets; i++) { - set(i, region_idx, InvalidCard); - } -} - void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) { uint cur_hrm_ind = _hr->hrm_index(); diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp index 02f346313ae..a9d20332e78 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp @@ -26,6 +26,7 @@ #define SHARE_VM_GC_G1_HEAPREGIONREMSET_HPP #include "gc/g1/g1CodeCacheRemSet.hpp" +#include "gc/g1/g1FromCardCache.hpp" #include "gc/g1/sparsePRT.hpp" // Remembered set for a heap region. Represent a set of "cards" that @@ -45,54 +46,6 @@ class nmethod; class HRRSCleanupTask : public SparsePRTCleanupTask { }; -// The FromCardCache remembers the most recently processed card on the heap on -// a per-region and per-thread basis. -class FromCardCache : public AllStatic { - private: - // Array of card indices. Indexed by thread X and heap region to minimize - // thread contention. - static int** _cache; - static uint _max_regions; - static size_t _static_mem_size; - - public: - enum { - InvalidCard = -1 // Card value of an invalid card, i.e. a card index not otherwise used. - }; - - static void clear(uint region_idx); - - // Returns true if the given card is in the cache at the given location, or - // replaces the card at that location and returns false. - static bool contains_or_replace(uint worker_id, uint region_idx, int card) { - int card_in_cache = at(worker_id, region_idx); - if (card_in_cache == card) { - return true; - } else { - set(worker_id, region_idx, card); - return false; - } - } - - static int at(uint worker_id, uint region_idx) { - return _cache[worker_id][region_idx]; - } - - static void set(uint worker_id, uint region_idx, int val) { - _cache[worker_id][region_idx] = val; - } - - static void initialize(uint n_par_rs, uint max_num_regions); - - static void invalidate(uint start_idx, size_t num_regions); - - static void print(outputStream* out = tty) PRODUCT_RETURN; - - static size_t static_mem_size() { - return _static_mem_size; - } -}; - // The "_coarse_map" is a bitmap with one bit for each region, where set // bits indicate that the corresponding region may contain some pointer // into the owning region. From 5e297b4308bac9d41dd936107bc4fe426210bfc3 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Mon, 21 Dec 2015 12:04:32 +0100 Subject: [PATCH 150/228] 8145671: Rename FromCardCache to G1FromCardCache Reviewed-by: jmasa, mgerdin --- hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp | 14 +++++++------- hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp | 4 ++-- hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp | 6 +++--- hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp b/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp index a9814e2b6ba..21367225411 100644 --- a/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp +++ b/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp @@ -28,11 +28,11 @@ #include "memory/padded.inline.hpp" #include "utilities/debug.hpp" -int** FromCardCache::_cache = NULL; -uint FromCardCache::_max_regions = 0; -size_t FromCardCache::_static_mem_size = 0; +int** G1FromCardCache::_cache = NULL; +uint G1FromCardCache::_max_regions = 0; +size_t G1FromCardCache::_static_mem_size = 0; -void FromCardCache::initialize(uint n_par_rs, uint max_num_regions) { +void G1FromCardCache::initialize(uint n_par_rs, uint max_num_regions) { guarantee(_cache == NULL, "Should not call this multiple times"); _max_regions = max_num_regions; @@ -43,7 +43,7 @@ void FromCardCache::initialize(uint n_par_rs, uint max_num_regions) { invalidate(0, _max_regions); } -void FromCardCache::invalidate(uint start_idx, size_t new_num_regions) { +void G1FromCardCache::invalidate(uint start_idx, size_t new_num_regions) { guarantee((size_t)start_idx + new_num_regions <= max_uintx, "Trying to invalidate beyond maximum region, from %u size " SIZE_FORMAT, start_idx, new_num_regions); @@ -57,7 +57,7 @@ void FromCardCache::invalidate(uint start_idx, size_t new_num_regions) { } #ifndef PRODUCT -void FromCardCache::print(outputStream* out) { +void G1FromCardCache::print(outputStream* out) { for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) { for (uint j = 0; j < _max_regions; j++) { out->print_cr("_from_card_cache[%u][%u] = %d.", @@ -67,7 +67,7 @@ void FromCardCache::print(outputStream* out) { } #endif -void FromCardCache::clear(uint region_idx) { +void G1FromCardCache::clear(uint region_idx) { uint num_par_remsets = HeapRegionRemSet::num_par_rem_sets(); for (uint i = 0; i < num_par_remsets; i++) { set(i, region_idx, InvalidCard); diff --git a/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp b/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp index 7627e0c3425..5515d73638e 100644 --- a/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp +++ b/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp @@ -28,9 +28,9 @@ #include "memory/allocation.hpp" #include "utilities/ostream.hpp" -// The FromCardCache remembers the most recently processed card on the heap on +// G1FromCardCache remembers the most recently processed card on the heap on // a per-region and per-thread basis. -class FromCardCache : public AllStatic { +class G1FromCardCache : public AllStatic { private: // Array of card indices. Indexed by thread X and heap region to minimize // thread contention. diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp index 01c98adfaab..270225a7e1f 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp @@ -356,7 +356,7 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) { int from_card = (int)(uintptr_t(from) >> CardTableModRefBS::card_shift); - if (FromCardCache::contains_or_replace(tid, cur_hrm_ind, from_card)) { + if (G1FromCardCache::contains_or_replace(tid, cur_hrm_ind, from_card)) { assert(contains_reference(from), "We just added it!"); return; } @@ -622,7 +622,7 @@ size_t OtherRegionsTable::mem_size() const { } size_t OtherRegionsTable::static_mem_size() { - return FromCardCache::static_mem_size(); + return G1FromCardCache::static_mem_size(); } size_t OtherRegionsTable::fl_mem_size() { @@ -630,7 +630,7 @@ size_t OtherRegionsTable::fl_mem_size() { } void OtherRegionsTable::clear_fcc() { - FromCardCache::clear(_hr->hrm_index()); + G1FromCardCache::clear(_hr->hrm_index()); } void OtherRegionsTable::clear() { diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp index a9d20332e78..3906620f7a3 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp @@ -324,16 +324,16 @@ public: // Declare the heap size (in # of regions) to the HeapRegionRemSet(s). // (Uses it to initialize from_card_cache). static void init_heap(uint max_regions) { - FromCardCache::initialize(num_par_rem_sets(), max_regions); + G1FromCardCache::initialize(num_par_rem_sets(), max_regions); } static void invalidate_from_card_cache(uint start_idx, size_t num_regions) { - FromCardCache::invalidate(start_idx, num_regions); + G1FromCardCache::invalidate(start_idx, num_regions); } #ifndef PRODUCT static void print_from_card_cache() { - FromCardCache::print(); + G1FromCardCache::print(); } #endif From 93bd48e615dc9e9bd9f789b024d09fec3a218bb0 Mon Sep 17 00:00:00 2001 From: Sangheon Kim Date: Fri, 18 Dec 2015 08:17:30 -0800 Subject: [PATCH 151/228] 8068394: Trace event for concurrent GC phases Add concurrent phase events for CMS and G1 Reviewed-by: brutisso, stefank --- .../gc/cms/concurrentMarkSweepGeneration.cpp | 74 ++++++++------- .../gc/cms/concurrentMarkSweepGeneration.hpp | 2 + hotspot/src/share/vm/gc/g1/concurrentMark.cpp | 18 ++++ hotspot/src/share/vm/gc/g1/concurrentMark.hpp | 6 ++ .../share/vm/gc/g1/concurrentMarkThread.cpp | 18 ++++ .../src/share/vm/gc/g1/g1CollectedHeap.cpp | 2 +- hotspot/src/share/vm/gc/shared/gcTimer.cpp | 91 ++++++++++++------- hotspot/src/share/vm/gc/shared/gcTimer.hpp | 41 +++++---- .../src/share/vm/gc/shared/gcTraceSend.cpp | 46 +++++++--- hotspot/src/share/vm/trace/trace.xml | 5 + 10 files changed, 203 insertions(+), 100 deletions(-) diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp index f112552d0ff..3e335a8e164 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp @@ -2742,9 +2742,11 @@ CMSPhaseAccounting::CMSPhaseAccounting(CMSCollector *collector, _collector->resetYields(); _collector->resetTimer(); _collector->startTimer(); + _collector->gc_timer_cm()->register_gc_concurrent_start(title); } CMSPhaseAccounting::~CMSPhaseAccounting() { + _collector->gc_timer_cm()->register_gc_concurrent_end(); _collector->stopTimer(); log_debug(gc)("Concurrent active time: %.3fms", TimeHelper::counter_to_seconds(_collector->timerTicks())); log_trace(gc)(" (CMS %s yielded %d times)", _title, _collector->yields()); @@ -5483,46 +5485,48 @@ void CMSCollector::reset_concurrent() { return; } - // Clear the mark bitmap (no grey objects to start with) - // for the next cycle. - GCTraceCPUTime tcpu; - CMSPhaseAccounting cmspa(this, "Concurrent Reset"); + { + // Clear the mark bitmap (no grey objects to start with) + // for the next cycle. + GCTraceCPUTime tcpu; + CMSPhaseAccounting cmspa(this, "Concurrent Reset"); - HeapWord* curAddr = _markBitMap.startWord(); - while (curAddr < _markBitMap.endWord()) { - size_t remaining = pointer_delta(_markBitMap.endWord(), curAddr); - MemRegion chunk(curAddr, MIN2(CMSBitMapYieldQuantum, remaining)); - _markBitMap.clear_large_range(chunk); - if (ConcurrentMarkSweepThread::should_yield() && - !foregroundGCIsActive() && - CMSYield) { - assert(ConcurrentMarkSweepThread::cms_thread_has_cms_token(), - "CMS thread should hold CMS token"); - assert_lock_strong(bitMapLock()); - bitMapLock()->unlock(); - ConcurrentMarkSweepThread::desynchronize(true); - stopTimer(); - incrementYields(); + HeapWord* curAddr = _markBitMap.startWord(); + while (curAddr < _markBitMap.endWord()) { + size_t remaining = pointer_delta(_markBitMap.endWord(), curAddr); + MemRegion chunk(curAddr, MIN2(CMSBitMapYieldQuantum, remaining)); + _markBitMap.clear_large_range(chunk); + if (ConcurrentMarkSweepThread::should_yield() && + !foregroundGCIsActive() && + CMSYield) { + assert(ConcurrentMarkSweepThread::cms_thread_has_cms_token(), + "CMS thread should hold CMS token"); + assert_lock_strong(bitMapLock()); + bitMapLock()->unlock(); + ConcurrentMarkSweepThread::desynchronize(true); + stopTimer(); + incrementYields(); - // See the comment in coordinator_yield() - for (unsigned i = 0; i < CMSYieldSleepCount && - ConcurrentMarkSweepThread::should_yield() && - !CMSCollector::foregroundGCIsActive(); ++i) { - os::sleep(Thread::current(), 1, false); + // See the comment in coordinator_yield() + for (unsigned i = 0; i < CMSYieldSleepCount && + ConcurrentMarkSweepThread::should_yield() && + !CMSCollector::foregroundGCIsActive(); ++i) { + os::sleep(Thread::current(), 1, false); + } + + ConcurrentMarkSweepThread::synchronize(true); + bitMapLock()->lock_without_safepoint_check(); + startTimer(); } - - ConcurrentMarkSweepThread::synchronize(true); - bitMapLock()->lock_without_safepoint_check(); - startTimer(); + curAddr = chunk.end(); } - curAddr = chunk.end(); + // A successful mostly concurrent collection has been done. + // Because only the full (i.e., concurrent mode failure) collections + // are being measured for gc overhead limits, clean the "near" flag + // and count. + size_policy()->reset_gc_overhead_limit_count(); + _collectorState = Idling; } - // A successful mostly concurrent collection has been done. - // Because only the full (i.e., concurrent mode failure) collections - // are being measured for gc overhead limits, clean the "near" flag - // and count. - size_policy()->reset_gc_overhead_limit_count(); - _collectorState = Idling; register_gc_end(); } diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp index 2e579152e38..ead101fce85 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp @@ -978,6 +978,8 @@ class CMSCollector: public CHeapObj { bool completed_initialization() { return _completed_initialization; } void print_eden_and_survivor_chunk_arrays(); + + ConcurrentGCTimer* gc_timer_cm() const { return _gc_timer_cm; } }; class CMSExpansionCause : public AllStatic { diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp index 02c4a718e71..8024a3a2b09 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp @@ -436,6 +436,7 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev _has_aborted(false), _restart_for_overflow(false), _concurrent_marking_in_progress(false), + _concurrent_phase_started(false), // _verbose_level set below @@ -1003,6 +1004,19 @@ void ConcurrentMark::scanRootRegions() { } } +void ConcurrentMark::register_concurrent_phase_start(const char* title) { + assert(!_concurrent_phase_started, "Sanity"); + _concurrent_phase_started = true; + _g1h->gc_timer_cm()->register_gc_concurrent_start(title); +} + +void ConcurrentMark::register_concurrent_phase_end() { + if (_concurrent_phase_started) { + _concurrent_phase_started = false; + _g1h->gc_timer_cm()->register_gc_concurrent_end(); + } +} + void ConcurrentMark::markFromRoots() { // we might be tempted to assert that: // assert(asynch == !SafepointSynchronize::is_at_safepoint(), @@ -2609,6 +2623,10 @@ void ConcurrentMark::abort() { satb_mq_set.is_active() /* expected_active */); _g1h->trace_heap_after_concurrent_cycle(); + + // Close any open concurrent phase timing + register_concurrent_phase_end(); + _g1h->register_concurrent_cycle_end(); } diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc/g1/concurrentMark.hpp index d6710dc283a..5d195e51cb1 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMark.hpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMark.hpp @@ -353,6 +353,9 @@ protected: // time of remark. volatile bool _concurrent_marking_in_progress; + // Keep track of whether we have started concurrent phase or not. + bool _concurrent_phase_started; + // All of these times are in ms NumberSeq _init_times; NumberSeq _remark_times; @@ -516,6 +519,9 @@ public: _concurrent_marking_in_progress = false; } + void register_concurrent_phase_start(const char* title); + void register_concurrent_phase_end(); + void update_accum_task_vtime(int i, double vtime) { _accum_task_vtime[i] += vtime; } diff --git a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp index 67b31e6683d..56753b35673 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp @@ -90,6 +90,20 @@ void ConcurrentMarkThread::delay_to_keep_mmu(G1CollectorPolicy* g1_policy, bool os::sleep(this, sleep_time_ms, false); } } + +class GCConcPhaseTimer : StackObj { + ConcurrentMark* _cm; + + public: + GCConcPhaseTimer(ConcurrentMark* cm, const char* title) : _cm(cm) { + _cm->register_concurrent_phase_start(title); + } + + ~GCConcPhaseTimer() { + _cm->register_concurrent_phase_end(); + } +}; + void ConcurrentMarkThread::run() { initialize_in_thread(); wait_for_universe_init(); @@ -127,6 +141,7 @@ void ConcurrentMarkThread::run_service() { // correctness issue. if (!cm()->has_aborted()) { + GCConcPhaseTimer(_cm, "Concurrent Root Region Scanning"); _cm->scanRootRegions(); } @@ -140,6 +155,7 @@ void ConcurrentMarkThread::run_service() { do { iter++; if (!cm()->has_aborted()) { + GCConcPhaseTimer(_cm, "Concurrent Mark"); _cm->markFromRoots(); } @@ -194,6 +210,7 @@ void ConcurrentMarkThread::run_service() { // reclaimed by cleanup. GCTraceConcTime(Info, gc) tt("Concurrent Cleanup"); + GCConcPhaseTimer(_cm, "Concurrent Cleanup"); // Now do the concurrent cleanup operation. _cm->completeCleanup(); @@ -250,6 +267,7 @@ void ConcurrentMarkThread::run_service() { // We may have aborted just before the remark. Do not bother clearing the // bitmap then, as it has been done during mark abort. if (!cm()->has_aborted()) { + GCConcPhaseTimer(_cm, "Concurrent Bitmap Clearing"); _cm->clearNextBitmap(); } else { assert(!G1VerifyBitmaps || _cm->nextMarkBitmapIsClear(), "Next mark bitmap must be clear"); diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index 3fba02e69a7..2da2ca3fb21 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -2336,7 +2336,7 @@ void G1CollectedHeap::register_concurrent_cycle_end() { _gc_tracer_cm->report_gc_end(_gc_timer_cm->gc_end(), _gc_timer_cm->time_partitions()); // Clear state variables to prepare for the next concurrent cycle. - collector_state()->set_concurrent_cycle_started(false); + collector_state()->set_concurrent_cycle_started(false); _heap_summary_sent = false; } } diff --git a/hotspot/src/share/vm/gc/shared/gcTimer.cpp b/hotspot/src/share/vm/gc/shared/gcTimer.cpp index b2ad94bc1ab..29b19e4679a 100644 --- a/hotspot/src/share/vm/gc/shared/gcTimer.cpp +++ b/hotspot/src/share/vm/gc/shared/gcTimer.cpp @@ -69,13 +69,27 @@ void STWGCTimer::register_gc_end(const Ticks& time) { } void ConcurrentGCTimer::register_gc_pause_start(const char* name) { + assert(!_is_concurrent_phase_active, "A pause phase can't be started while a concurrent phase is active."); GCTimer::register_gc_pause_start(name); } void ConcurrentGCTimer::register_gc_pause_end() { + assert(!_is_concurrent_phase_active, "A pause phase can't be ended while a concurrent phase is active."); GCTimer::register_gc_pause_end(); } +void ConcurrentGCTimer::register_gc_concurrent_start(const char* name, const Ticks& time) { + assert(!_is_concurrent_phase_active, "A concurrent phase is already active."); + _time_partitions.report_gc_phase_start(name, time, GCPhase::ConcurrentPhaseType); + _is_concurrent_phase_active = true; +} + +void ConcurrentGCTimer::register_gc_concurrent_end(const Ticks& time) { + assert(_is_concurrent_phase_active, "A concurrent phase is not active."); + _time_partitions.report_gc_phase_end(time, GCPhase::ConcurrentPhaseType); + _is_concurrent_phase_active = false; +} + void PhasesStack::clear() { _next_phase_level = 0; } @@ -84,7 +98,6 @@ void PhasesStack::push(int phase_index) { assert(_next_phase_level < PHASE_LEVELS, "Overflow"); _phase_indices[_next_phase_level] = phase_index; - _next_phase_level++; } @@ -92,7 +105,6 @@ int PhasesStack::pop() { assert(_next_phase_level > 0, "Underflow"); _next_phase_level--; - return _phase_indices[_next_phase_level]; } @@ -100,9 +112,8 @@ int PhasesStack::count() const { return _next_phase_level; } - TimePartitions::TimePartitions() { - _phases = new (ResourceObj::C_HEAP, mtGC) GrowableArray(INITIAL_CAPACITY, true, mtGC); + _phases = new (ResourceObj::C_HEAP, mtGC) GrowableArray(INITIAL_CAPACITY, true, mtGC); clear(); } @@ -118,12 +129,13 @@ void TimePartitions::clear() { _longest_pause = Tickspan(); } -void TimePartitions::report_gc_phase_start(const char* name, const Ticks& time) { +void TimePartitions::report_gc_phase_start(const char* name, const Ticks& time, GCPhase::PhaseType type) { assert(_phases->length() <= 1000, "Too many recored phases?"); int level = _active_phases.count(); - PausePhase phase; + GCPhase phase; + phase.set_type(type); phase.set_level(level); phase.set_name(name); phase.set_start(time); @@ -134,15 +146,14 @@ void TimePartitions::report_gc_phase_start(const char* name, const Ticks& time) } void TimePartitions::update_statistics(GCPhase* phase) { - // FIXME: This should only be done for pause phases - if (phase->level() == 0) { + if ((phase->type() == GCPhase::PausePhaseType) && (phase->level() == 0)) { const Tickspan pause = phase->end() - phase->start(); _sum_of_pauses += pause; _longest_pause = MAX2(pause, _longest_pause); } } -void TimePartitions::report_gc_phase_end(const Ticks& time) { +void TimePartitions::report_gc_phase_end(const Ticks& time, GCPhase::PhaseType type) { int phase_index = _active_phases.pop(); GCPhase* phase = _phases->adr_at(phase_index); phase->set_end(time); @@ -187,9 +198,10 @@ class TimePartitionPhasesIteratorTest { many_sub_pause_phases(); many_sub_pause_phases2(); max_nested_pause_phases(); + one_concurrent(); } - static void validate_pause_phase(GCPhase* phase, int level, const char* name, const Ticks& start, const Ticks& end) { + static void validate_gc_phase(GCPhase* phase, int level, const char* name, const Ticks& start, const Ticks& end) { assert(phase->level() == level, "Incorrect level"); assert(strcmp(phase->name(), name) == 0, "Incorrect name"); assert(phase->start() == start, "Incorrect start"); @@ -203,7 +215,7 @@ class TimePartitionPhasesIteratorTest { TimePartitionPhasesIterator iter(&time_partitions); - validate_pause_phase(iter.next(), 0, "PausePhase", 2, 8); + validate_gc_phase(iter.next(), 0, "PausePhase", 2, 8); assert(time_partitions.sum_of_pauses() == Ticks(8) - Ticks(2), "Incorrect"); assert(time_partitions.longest_pause() == Ticks(8) - Ticks(2), "Incorrect"); @@ -219,8 +231,8 @@ class TimePartitionPhasesIteratorTest { TimePartitionPhasesIterator iter(&time_partitions); - validate_pause_phase(iter.next(), 0, "PausePhase1", 2, 3); - validate_pause_phase(iter.next(), 0, "PausePhase2", 4, 6); + validate_gc_phase(iter.next(), 0, "PausePhase1", 2, 3); + validate_gc_phase(iter.next(), 0, "PausePhase2", 4, 6); assert(time_partitions.sum_of_pauses() == Ticks(3) - Ticks(0), "Incorrect"); assert(time_partitions.longest_pause() == Ticks(2) - Ticks(0), "Incorrect"); @@ -237,8 +249,8 @@ class TimePartitionPhasesIteratorTest { TimePartitionPhasesIterator iter(&time_partitions); - validate_pause_phase(iter.next(), 0, "PausePhase", 2, 5); - validate_pause_phase(iter.next(), 1, "SubPhase", 3, 4); + validate_gc_phase(iter.next(), 0, "PausePhase", 2, 5); + validate_gc_phase(iter.next(), 1, "SubPhase", 3, 4); assert(time_partitions.sum_of_pauses() == Ticks(3) - Ticks(0), "Incorrect"); assert(time_partitions.longest_pause() == Ticks(3) - Ticks(0), "Incorrect"); @@ -259,10 +271,10 @@ class TimePartitionPhasesIteratorTest { TimePartitionPhasesIterator iter(&time_partitions); - validate_pause_phase(iter.next(), 0, "PausePhase", 2, 9); - validate_pause_phase(iter.next(), 1, "SubPhase1", 3, 8); - validate_pause_phase(iter.next(), 2, "SubPhase2", 4, 7); - validate_pause_phase(iter.next(), 3, "SubPhase3", 5, 6); + validate_gc_phase(iter.next(), 0, "PausePhase", 2, 9); + validate_gc_phase(iter.next(), 1, "SubPhase1", 3, 8); + validate_gc_phase(iter.next(), 2, "SubPhase2", 4, 7); + validate_gc_phase(iter.next(), 3, "SubPhase3", 5, 6); assert(time_partitions.sum_of_pauses() == Ticks(7) - Ticks(0), "Incorrect"); assert(time_partitions.longest_pause() == Ticks(7) - Ticks(0), "Incorrect"); @@ -287,11 +299,11 @@ class TimePartitionPhasesIteratorTest { TimePartitionPhasesIterator iter(&time_partitions); - validate_pause_phase(iter.next(), 0, "PausePhase", 2, 11); - validate_pause_phase(iter.next(), 1, "SubPhase1", 3, 4); - validate_pause_phase(iter.next(), 1, "SubPhase2", 5, 6); - validate_pause_phase(iter.next(), 1, "SubPhase3", 7, 8); - validate_pause_phase(iter.next(), 1, "SubPhase4", 9, 10); + validate_gc_phase(iter.next(), 0, "PausePhase", 2, 11); + validate_gc_phase(iter.next(), 1, "SubPhase1", 3, 4); + validate_gc_phase(iter.next(), 1, "SubPhase2", 5, 6); + validate_gc_phase(iter.next(), 1, "SubPhase3", 7, 8); + validate_gc_phase(iter.next(), 1, "SubPhase4", 9, 10); assert(time_partitions.sum_of_pauses() == Ticks(9) - Ticks(0), "Incorrect"); assert(time_partitions.longest_pause() == Ticks(9) - Ticks(0), "Incorrect"); @@ -322,20 +334,35 @@ class TimePartitionPhasesIteratorTest { TimePartitionPhasesIterator iter(&time_partitions); - validate_pause_phase(iter.next(), 0, "PausePhase", 2, 17); - validate_pause_phase(iter.next(), 1, "SubPhase1", 3, 8); - validate_pause_phase(iter.next(), 2, "SubPhase11", 4, 5); - validate_pause_phase(iter.next(), 2, "SubPhase12", 6, 7); - validate_pause_phase(iter.next(), 1, "SubPhase2", 9, 14); - validate_pause_phase(iter.next(), 2, "SubPhase21", 10, 11); - validate_pause_phase(iter.next(), 2, "SubPhase22", 12, 13); - validate_pause_phase(iter.next(), 1, "SubPhase3", 15, 16); + validate_gc_phase(iter.next(), 0, "PausePhase", 2, 17); + validate_gc_phase(iter.next(), 1, "SubPhase1", 3, 8); + validate_gc_phase(iter.next(), 2, "SubPhase11", 4, 5); + validate_gc_phase(iter.next(), 2, "SubPhase12", 6, 7); + validate_gc_phase(iter.next(), 1, "SubPhase2", 9, 14); + validate_gc_phase(iter.next(), 2, "SubPhase21", 10, 11); + validate_gc_phase(iter.next(), 2, "SubPhase22", 12, 13); + validate_gc_phase(iter.next(), 1, "SubPhase3", 15, 16); assert(time_partitions.sum_of_pauses() == Ticks(15) - Ticks(0), "Incorrect"); assert(time_partitions.longest_pause() == Ticks(15) - Ticks(0), "Incorrect"); assert(!iter.has_next(), "Too many elements"); } + + static void one_concurrent() { + TimePartitions time_partitions; + time_partitions.report_gc_phase_start("ConcurrentPhase", 2, GCPhase::ConcurrentPhaseType); + time_partitions.report_gc_phase_end(8, GCPhase::ConcurrentPhaseType); + + TimePartitionPhasesIterator iter(&time_partitions); + + validate_gc_phase(iter.next(), 0, "ConcurrentPhase", 2, 8); + // ConcurrentPhaseType should not affect to both 'sum_of_pauses()' and 'longest_pause()'. + assert(time_partitions.sum_of_pauses() == Tickspan(), "Incorrect"); + assert(time_partitions.longest_pause() == Tickspan(), "Incorrect"); + + assert(!iter.has_next(), "Too many elements"); + } }; class GCTimerTest { diff --git a/hotspot/src/share/vm/gc/shared/gcTimer.hpp b/hotspot/src/share/vm/gc/shared/gcTimer.hpp index a4bd2dd775c..d520dab8714 100644 --- a/hotspot/src/share/vm/gc/shared/gcTimer.hpp +++ b/hotspot/src/share/vm/gc/shared/gcTimer.hpp @@ -39,15 +39,21 @@ template class GrowableArray; class PhaseVisitor { public: virtual void visit(GCPhase* phase) = 0; - virtual void visit(PausePhase* phase) { visit((GCPhase*)phase); } - virtual void visit(ConcurrentPhase* phase) { visit((GCPhase*)phase); } }; class GCPhase { + public: + enum PhaseType { + PausePhaseType = 0, + ConcurrentPhaseType = 1 + }; + + private: const char* _name; int _level; Ticks _start; Ticks _end; + PhaseType _type; public: void set_name(const char* name) { _name = name; } @@ -62,17 +68,9 @@ class GCPhase { const Ticks end() const { return _end; } void set_end(const Ticks& time) { _end = time; } - virtual void accept(PhaseVisitor* visitor) = 0; -}; + PhaseType type() const { return _type; } + void set_type(PhaseType type) { _type = type; } -class PausePhase : public GCPhase { - public: - void accept(PhaseVisitor* visitor) { - visitor->visit(this); - } -}; - -class ConcurrentPhase : public GCPhase { void accept(PhaseVisitor* visitor) { visitor->visit(this); } @@ -80,7 +78,7 @@ class ConcurrentPhase : public GCPhase { class PhasesStack { public: - // FIXME: Temporary set to 5 (used to be 4), since Reference processing needs it. + // Set to 5, since Reference processing needs it. static const int PHASE_LEVELS = 5; private: @@ -99,8 +97,7 @@ class PhasesStack { class TimePartitions { static const int INITIAL_CAPACITY = 10; - // Currently we only support pause phases. - GrowableArray* _phases; + GrowableArray* _phases; PhasesStack _active_phases; Tickspan _sum_of_pauses; @@ -111,8 +108,8 @@ class TimePartitions { ~TimePartitions(); void clear(); - void report_gc_phase_start(const char* name, const Ticks& time); - void report_gc_phase_end(const Ticks& time); + void report_gc_phase_start(const char* name, const Ticks& time, GCPhase::PhaseType type=GCPhase::PausePhaseType); + void report_gc_phase_end(const Ticks& time, GCPhase::PhaseType type=GCPhase::PausePhaseType); int num_phases() const; GCPhase* phase_at(int index) const; @@ -121,6 +118,7 @@ class TimePartitions { const Tickspan longest_pause() const { return _longest_pause; } bool has_active_phases(); + private: void update_statistics(GCPhase* phase); }; @@ -162,9 +160,18 @@ class STWGCTimer : public GCTimer { }; class ConcurrentGCTimer : public GCTimer { + // ConcurrentGCTimer can't be used if there is an overlap between a pause phase and a concurrent phase. + // _is_concurrent_phase_active is used to find above case. + bool _is_concurrent_phase_active; + public: + ConcurrentGCTimer(): GCTimer(), _is_concurrent_phase_active(false) {}; + void register_gc_pause_start(const char* name); void register_gc_pause_end(); + + void register_gc_concurrent_start(const char* name, const Ticks& time = Ticks::now()); + void register_gc_concurrent_end(const Ticks& time = Ticks::now()); }; class TimePartitionPhasesIterator { diff --git a/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp b/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp index 07c8f32e5dd..921193ae81c 100644 --- a/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp +++ b/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp @@ -418,30 +418,46 @@ void GCTracer::send_meta_space_summary_event(GCWhen::Type when, const MetaspaceS } class PhaseSender : public PhaseVisitor { + void visit_pause(GCPhase* phase) { + assert(phase->level() < PhasesStack::PHASE_LEVELS, "Need more event types for PausePhase"); + + switch (phase->level()) { + case 0: send_phase(phase); break; + case 1: send_phase(phase); break; + case 2: send_phase(phase); break; + case 3: send_phase(phase); break; + default: /* Ignore sending this phase */ break; + } + } + + void visit_concurrent(GCPhase* phase) { + assert(phase->level() < 1, "There is only one level for ConcurrentPhase"); + + switch (phase->level()) { + case 0: send_phase(phase); break; + default: /* Ignore sending this phase */ break; + } + } + public: template - void send_phase(PausePhase* pause) { + void send_phase(GCPhase* phase) { T event(UNTIMED); if (event.should_commit()) { event.set_gcId(GCId::current()); - event.set_name(pause->name()); - event.set_starttime(pause->start()); - event.set_endtime(pause->end()); + event.set_name(phase->name()); + event.set_starttime(phase->start()); + event.set_endtime(phase->end()); event.commit(); } } - void visit(GCPhase* pause) { ShouldNotReachHere(); } - void visit(ConcurrentPhase* pause) { Unimplemented(); } - void visit(PausePhase* pause) { - assert(PhasesStack::PHASE_LEVELS == 5, "Need more event types"); - - switch (pause->level()) { - case 0: send_phase(pause); break; - case 1: send_phase(pause); break; - case 2: send_phase(pause); break; - case 3: send_phase(pause); break; - default: /* Ignore sending this phase */ break; + void visit(GCPhase* phase) { + if (phase->type() == GCPhase::PausePhaseType) { + visit_pause(phase); + } else { + assert(phase->type() == GCPhase::ConcurrentPhaseType, "Should be ConcurrentPhaseType"); + visit_concurrent(phase); } } }; diff --git a/hotspot/src/share/vm/trace/trace.xml b/hotspot/src/share/vm/trace/trace.xml index d2c5625c015..798814b9ac8 100644 --- a/hotspot/src/share/vm/trace/trace.xml +++ b/hotspot/src/share/vm/trace/trace.xml @@ -460,6 +460,11 @@ Declares a structure type that can be used in other events. + + + + + Date: Sat, 19 Dec 2015 19:06:02 +0100 Subject: [PATCH 152/228] 8145566: PrintNMethods compile command broken since b89 Decremented Symbol twice Reviewed-by: thartmann, kvn --- hotspot/src/share/vm/compiler/compilerOracle.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compilerOracle.cpp b/hotspot/src/share/vm/compiler/compilerOracle.cpp index 15d5d3a091c..4e5b240c6bc 100644 --- a/hotspot/src/share/vm/compiler/compilerOracle.cpp +++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp @@ -247,15 +247,6 @@ TypedMethodOptionMatcher::~TypedMethodOptionMatcher() { if (_option != NULL) { os::free((void*)_option); } - if (_class_name != NULL) { - _class_name->decrement_refcount(); - } - if (_method_name != NULL) { - _method_name->decrement_refcount(); - } - if (_signature != NULL) { - _signature->decrement_refcount(); - } } TypedMethodOptionMatcher* TypedMethodOptionMatcher::parse_method_pattern(char*& line, const char*& error_msg) { From 60da2fdb6fca92e8e39fd5cf5f6824a64a9e4a82 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Mon, 21 Dec 2015 10:14:26 +0100 Subject: [PATCH 153/228] 8145754: PhaseIdealLoop::is_scaled_iv_plus_offset() does not match AddI Is_scaled_iv_plus_offset() should handle AddI nodes with scaled iv as second input. Reviewed-by: kvn --- hotspot/src/share/vm/opto/loopTransform.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index 41ebaffc838..d1bfb801b67 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -1911,6 +1911,12 @@ bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, int* p_scale, } return true; } + if (is_scaled_iv(exp->in(2), iv, p_scale)) { + if (p_offset != NULL) { + *p_offset = exp->in(1); + } + return true; + } if (exp->in(2)->is_Con()) { Node* offset2 = NULL; if (depth < 2 && From 0f67aad7af9eebec2fe278477aa84f0c8712eaa3 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Mon, 21 Dec 2015 11:34:58 +0100 Subject: [PATCH 154/228] 8144487: PhaseIdealLoop::build_and_optimize() must restore major_progress flag if skip_loop_opts is true Restore the major_progress flag before calling igvn.optimize(). Reviewed-by: kvn --- hotspot/src/share/vm/opto/loopnode.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp index ac82a605303..3faa0c2d319 100644 --- a/hotspot/src/share/vm/opto/loopnode.cpp +++ b/hotspot/src/share/vm/opto/loopnode.cpp @@ -2335,6 +2335,11 @@ void PhaseIdealLoop::build_and_optimize(bool do_split_ifs, bool skip_loop_opts) #endif if (skip_loop_opts) { + // restore major progress flag + for (int i = 0; i < old_progress; i++) { + C->set_major_progress(); + } + // Cleanup any modified bits _igvn.optimize(); From cd1d8e43041848170999260aa1699d9a29762996 Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Mon, 21 Dec 2015 22:17:23 +0100 Subject: [PATCH 155/228] 8145328: SEGV in DirectivesStack::getMatchingDirective Loop until enabled directive is found Reviewed-by: kvn, twisti --- hotspot/src/share/vm/compiler/compilerDirectives.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.cpp b/hotspot/src/share/vm/compiler/compilerDirectives.cpp index 6ffeaa5a6c4..ba35617fc27 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.cpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.cpp @@ -561,10 +561,11 @@ DirectiveSet* DirectivesStack::getMatchingDirective(methodHandle method, Abstrac match = dir->_c1_store; break; } - } - if (match->EnableOption) { - // The directiveSet for this compile is also enabled -> success - break; + } else { + if (match->EnableOption) { + // The directiveSet for this compile is also enabled -> success + break; + } } } dir = dir->next(); From 066e504bbad7c40009c1c6d800db75a1d3334ce5 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Wed, 23 Dec 2015 07:27:42 -1000 Subject: [PATCH 156/228] 8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread Reviewed-by: never, dnsimon, dholmes, coleenp --- hotspot/src/share/vm/ci/ciReplay.cpp | 8 +--- .../src/share/vm/classfile/javaClasses.cpp | 43 ++++++++----------- .../src/share/vm/classfile/javaClasses.hpp | 3 +- hotspot/src/share/vm/jvmci/jvmciCompiler.cpp | 39 +++++++++++++++-- hotspot/src/share/vm/jvmci/jvmciCompiler.hpp | 2 + hotspot/src/share/vm/jvmci/jvmciRuntime.cpp | 33 ++------------ hotspot/src/share/vm/jvmci/jvmciRuntime.hpp | 30 +------------ hotspot/src/share/vm/runtime/java.cpp | 16 ++++--- 8 files changed, 73 insertions(+), 101 deletions(-) diff --git a/hotspot/src/share/vm/ci/ciReplay.cpp b/hotspot/src/share/vm/ci/ciReplay.cpp index 27a5c1c8c16..aee1baf56e8 100644 --- a/hotspot/src/share/vm/ci/ciReplay.cpp +++ b/hotspot/src/share/vm/ci/ciReplay.cpp @@ -1040,10 +1040,8 @@ void* ciReplay::load_inline_data(ciMethod* method, int entry_bci, int comp_level } void* data = rp.process_inline(method, method->get_Method(), entry_bci, comp_level, THREAD); if (HAS_PENDING_EXCEPTION) { - oop throwable = PENDING_EXCEPTION; + Handle throwable(THREAD, PENDING_EXCEPTION); CLEAR_PENDING_EXCEPTION; - java_lang_Throwable::print(throwable, tty); - tty->cr(); java_lang_Throwable::print_stack_trace(throwable, tty); tty->cr(); return NULL; @@ -1085,10 +1083,8 @@ int ciReplay::replay_impl(TRAPS) { } if (HAS_PENDING_EXCEPTION) { - oop throwable = PENDING_EXCEPTION; + Handle throwable(THREAD, PENDING_EXCEPTION); CLEAR_PENDING_EXCEPTION; - java_lang_Throwable::print(throwable, tty); - tty->cr(); java_lang_Throwable::print_stack_trace(throwable, tty); tty->cr(); exit_code = 2; diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index 1d9179aa9ef..b80899d324a 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -1493,18 +1493,6 @@ void java_lang_Throwable::clear_stacktrace(oop throwable) { } -void java_lang_Throwable::print(oop throwable, outputStream* st) { - ResourceMark rm; - Klass* k = throwable->klass(); - assert(k != NULL, "just checking"); - st->print("%s", k->external_name()); - oop msg = message(throwable); - if (msg != NULL) { - st->print(": %s", java_lang_String::as_utf8_string(msg)); - } -} - - void java_lang_Throwable::print(Handle throwable, outputStream* st) { ResourceMark rm; Klass* k = throwable->klass(); @@ -1732,20 +1720,25 @@ const char* java_lang_Throwable::no_stack_trace_message() { return "\t<>"; } +/** + * Print the throwable message and its stack trace plus all causes by walking the + * cause chain. The output looks the same as of Throwable.printStackTrace(). + */ +void java_lang_Throwable::print_stack_trace(Handle throwable, outputStream* st) { + // First, print the message. + print(throwable, st); + st->cr(); -// Currently used only for exceptions occurring during startup -void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) { - Thread *THREAD = Thread::current(); - Handle h_throwable(THREAD, throwable); - while (h_throwable.not_null()) { - objArrayHandle result (THREAD, objArrayOop(backtrace(h_throwable()))); + // Now print the stack trace. + Thread* THREAD = Thread::current(); + while (throwable.not_null()) { + objArrayHandle result (THREAD, objArrayOop(backtrace(throwable()))); if (result.is_null()) { st->print_raw_cr(no_stack_trace_message()); return; } while (result.not_null()) { - // Get method id, bci, version and mirror from chunk typeArrayHandle methods (THREAD, BacktraceBuilder::get_methods(result)); typeArrayHandle bcis (THREAD, BacktraceBuilder::get_bcis(result)); @@ -1770,20 +1763,20 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) { EXCEPTION_MARK; JavaValue cause(T_OBJECT); JavaCalls::call_virtual(&cause, - h_throwable, - KlassHandle(THREAD, h_throwable->klass()), + throwable, + KlassHandle(THREAD, throwable->klass()), vmSymbols::getCause_name(), vmSymbols::void_throwable_signature(), THREAD); // Ignore any exceptions. we are in the middle of exception handling. Same as classic VM. if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; - h_throwable = Handle(); + throwable = Handle(); } else { - h_throwable = Handle(THREAD, (oop) cause.get_jobject()); - if (h_throwable.not_null()) { + throwable = Handle(THREAD, (oop) cause.get_jobject()); + if (throwable.not_null()) { st->print("Caused by: "); - print(h_throwable, st); + print(throwable, st); st->cr(); } } diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index 1aa88b399db..3ac5b4191ea 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -552,9 +552,8 @@ class java_lang_Throwable: AllStatic { static oop get_stack_trace_element(oop throwable, int index, TRAPS); static int get_stack_trace_depth(oop throwable, TRAPS); // Printing - static void print(oop throwable, outputStream* st); static void print(Handle throwable, outputStream* st); - static void print_stack_trace(oop throwable, outputStream* st); + static void print_stack_trace(Handle throwable, outputStream* st); // Debugging friend class JavaClasses; }; diff --git a/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp b/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp index c07f9b4c250..8e5a2ff86f7 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp @@ -112,6 +112,15 @@ void JVMCICompiler::bootstrap() { _bootstrapping = false; } +#define CHECK_ABORT THREAD); \ +if (HAS_PENDING_EXCEPTION) { \ + char buf[256]; \ + jio_snprintf(buf, 256, "Uncaught exception at %s:%d", __FILE__, __LINE__); \ + JVMCICompiler::abort_on_pending_exception(PENDING_EXCEPTION, buf); \ + return; \ +} \ +(void)(0 + void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JVMCIEnv* env) { JVMCI_EXCEPTION_CONTEXT @@ -150,12 +159,12 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV // should be handled by the Java code in some useful way but if they leak // through to here report them instead of dying or silently ignoring them. if (HAS_PENDING_EXCEPTION) { - Handle throwable = PENDING_EXCEPTION; + Handle exception(THREAD, PENDING_EXCEPTION); CLEAR_PENDING_EXCEPTION; - JVMCIRuntime::call_printStackTrace(throwable, THREAD); - if (HAS_PENDING_EXCEPTION) { - CLEAR_PENDING_EXCEPTION; + { + ttyLocker ttyl; + java_lang_Throwable::print_stack_trace(exception, tty); } // Something went wrong so disable compilation at this level @@ -165,6 +174,28 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV } } +/** + * Aborts the VM due to an unexpected exception. + */ +void JVMCICompiler::abort_on_pending_exception(Handle exception, const char* message, bool dump_core) { + Thread* THREAD = Thread::current(); + CLEAR_PENDING_EXCEPTION; + + { + ttyLocker ttyl; + tty->print_raw_cr(message); + java_lang_Throwable::print_stack_trace(exception, tty); + } + + // Give other aborting threads to also print their stack traces. + // This can be very useful when debugging class initialization + // failures. + assert(THREAD->is_Java_thread(), "compiler threads should be Java threads"); + const bool interruptible = true; + os::sleep(THREAD, 200, interruptible); + + vm_abort(dump_core); +} // Compilation entry point for methods void JVMCICompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci, DirectiveSet* directive) { diff --git a/hotspot/src/share/vm/jvmci/jvmciCompiler.hpp b/hotspot/src/share/vm/jvmci/jvmciCompiler.hpp index f1f5c079433..fabee997500 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompiler.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompiler.hpp @@ -42,6 +42,8 @@ private: static elapsedTimer _codeInstallTimer; + static void abort_on_pending_exception(Handle exception, const char* message, bool dump_core = false); + public: JVMCICompiler(); diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp index 3d2463eee64..54b2e75697a 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp @@ -935,16 +935,15 @@ void JVMCIRuntime::save_options(SystemProperty* props) { } } -void JVMCIRuntime::shutdown() { +void JVMCIRuntime::shutdown(TRAPS) { if (_HotSpotJVMCIRuntime_instance != NULL) { _shutdown_called = true; - JavaThread* THREAD = JavaThread::current(); HandleMark hm(THREAD); - Handle receiver = get_HotSpotJVMCIRuntime(CHECK_ABORT); + Handle receiver = get_HotSpotJVMCIRuntime(CHECK); JavaValue result(T_VOID); JavaCallArguments args; args.push_oop(receiver); - JavaCalls::call_special(&result, receiver->klass(), vmSymbols::shutdown_method_name(), vmSymbols::void_method_signature(), &args, CHECK_ABORT); + JavaCalls::call_special(&result, receiver->klass(), vmSymbols::shutdown_method_name(), vmSymbols::void_method_signature(), &args, CHECK); } } @@ -962,32 +961,6 @@ bool JVMCIRuntime::treat_as_trivial(Method* method) { return false; } -void JVMCIRuntime::call_printStackTrace(Handle exception, Thread* thread) { - assert(exception->is_a(SystemDictionary::Throwable_klass()), "Throwable instance expected"); - JavaValue result(T_VOID); - JavaCalls::call_virtual(&result, - exception, - KlassHandle(thread, - SystemDictionary::Throwable_klass()), - vmSymbols::printStackTrace_name(), - vmSymbols::void_method_signature(), - thread); -} - -void JVMCIRuntime::abort_on_pending_exception(Handle exception, const char* message, bool dump_core) { - Thread* THREAD = Thread::current(); - CLEAR_PENDING_EXCEPTION; - tty->print_raw_cr(message); - call_printStackTrace(exception, THREAD); - - // Give other aborting threads to also print their stack traces. - // This can be very useful when debugging class initialization - // failures. - os::sleep(THREAD, 200, false); - - vm_abort(dump_core); -} - void JVMCIRuntime::parse_lines(char* path, ParseClosure* closure, bool warnStatFailure) { struct stat st; if (::stat(path, &st) == 0 && (st.st_mode & S_IFREG) == S_IFREG) { // exists & is regular file diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp index 9e69965f19d..43ee0ad72a8 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp @@ -145,7 +145,7 @@ class JVMCIRuntime: public AllStatic { static void metadata_do(void f(Metadata*)); - static void shutdown(); + static void shutdown(TRAPS); static bool shutdown_called() { return _shutdown_called; @@ -154,34 +154,6 @@ class JVMCIRuntime: public AllStatic { static bool treat_as_trivial(Method* method); static void parse_lines(char* path, ParseClosure* closure, bool warnStatFailure); - /** - * Aborts the VM due to an unexpected exception. - */ - static void abort_on_pending_exception(Handle exception, const char* message, bool dump_core = false); - - /** - * Calls Throwable.printStackTrace() on a given exception. - */ - static void call_printStackTrace(Handle exception, Thread* thread); - -#define CHECK_ABORT THREAD); \ - if (HAS_PENDING_EXCEPTION) { \ - char buf[256]; \ - jio_snprintf(buf, 256, "Uncaught exception at %s:%d", __FILE__, __LINE__); \ - JVMCIRuntime::abort_on_pending_exception(PENDING_EXCEPTION, buf); \ - return; \ - } \ - (void)(0 - -#define CHECK_ABORT_(result) THREAD); \ - if (HAS_PENDING_EXCEPTION) { \ - char buf[256]; \ - jio_snprintf(buf, 256, "Uncaught exception at %s:%d", __FILE__, __LINE__); \ - JVMCIRuntime::abort_on_pending_exception(PENDING_EXCEPTION, buf); \ - return result; \ - } \ - (void)(0 - static BasicType kindToBasicType(Handle kind, TRAPS); // The following routines are all called from compiled JVMCI code diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index b65c2c2e1aa..aa57bbc4601 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -398,7 +398,7 @@ void print_statistics() { // Note: before_exit() can be executed only once, if more than one threads // are trying to shutdown the VM at the same time, only one thread // can run before_exit() and all other threads must wait. -void before_exit(JavaThread * thread) { +void before_exit(JavaThread* thread) { #define BEFORE_EXIT_NOT_RUN 0 #define BEFORE_EXIT_RUNNING 1 #define BEFORE_EXIT_DONE 2 @@ -426,7 +426,15 @@ void before_exit(JavaThread * thread) { } #if INCLUDE_JVMCI - JVMCIRuntime::shutdown(); + // We are not using CATCH here because we want the exit to continue normally. + Thread* THREAD = thread; + JVMCIRuntime::shutdown(THREAD); + if (HAS_PENDING_EXCEPTION) { + Handle exception(THREAD, PENDING_EXCEPTION); + CLEAR_PENDING_EXCEPTION; + ttyLocker ttyl; + java_lang_Throwable::print_stack_trace(exception, tty); + } #endif // Hang forever on exit if we're reporting an error. @@ -612,9 +620,7 @@ void vm_exit_during_initialization(Handle exception) { if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; } - java_lang_Throwable::print(exception, tty); - tty->cr(); - java_lang_Throwable::print_stack_trace(exception(), tty); + java_lang_Throwable::print_stack_trace(exception, tty); tty->cr(); vm_notify_during_shutdown(NULL, NULL); From 2c62b9355d9445d40cc8da640c60797d1070d184 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Wed, 23 Dec 2015 23:08:16 +0300 Subject: [PATCH 157/228] 8146129: quarantine compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java Reviewed-by: twisti --- .../compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java index 4d655dee023..638321ae9d4 100644 --- a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java +++ b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java @@ -31,6 +31,7 @@ import jdk.test.lib.ProcessTools; * /compiler/testlibrary /compiler/codegen/7184394 * @modules java.base/sun.misc * java.management + * @ignore 8146128 * @build TestAESIntrinsicsOnSupportedConfig TestAESMain * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission From ffa21cb2b20e3b89e4cc8797122a77146976ec5f Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Wed, 23 Dec 2015 11:36:46 -1000 Subject: [PATCH 158/228] 8146100: compiler/jvmci/code/SimpleCodeInstallationTest.java JUnit Failure: expected:<12> but was:<109710641> Reviewed-by: kvn --- .../test/compiler/jvmci/code/amd64/AMD64TestAssembler.java | 6 ++++-- .../test/compiler/jvmci/code/sparc/SPARCTestAssembler.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java b/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java index b44d4af8c48..efd001c18d4 100644 --- a/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java @@ -34,8 +34,10 @@ import jdk.vm.ci.code.DebugInfo; import jdk.vm.ci.code.InfopointReason; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; +import jdk.vm.ci.code.CallingConvention.Type; import jdk.vm.ci.hotspot.HotSpotConstant; import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.VMConstant; @@ -61,11 +63,11 @@ public class AMD64TestAssembler extends TestAssembler { } public Register emitIntArg0() { - return AMD64.rsi; + return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCall, JavaKind.Int)[0]; } public Register emitIntArg1() { - return AMD64.rdx; + return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCall, JavaKind.Int)[1]; } private void emitREX(boolean w, int r, int x, int b) { diff --git a/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java b/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java index 8430ab0e659..b37ed57c77a 100644 --- a/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java @@ -32,8 +32,10 @@ import jdk.vm.ci.code.DebugInfo; import jdk.vm.ci.code.InfopointReason; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; +import jdk.vm.ci.code.CallingConvention.Type; import jdk.vm.ci.hotspot.HotSpotConstant; import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.VMConstant; import jdk.vm.ci.sparc.SPARC; @@ -80,11 +82,11 @@ public class SPARCTestAssembler extends TestAssembler { } public Register emitIntArg0() { - return SPARC.i0; + return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCallee, JavaKind.Int)[0]; } public Register emitIntArg1() { - return SPARC.i1; + return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCallee, JavaKind.Int)[1]; } public Register emitLoadInt(int c) { From bc04deac1559f4a6a16b0853bb06b100b0ec8488 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Wed, 23 Dec 2015 16:24:19 -0800 Subject: [PATCH 159/228] 8146043: run JVMCI tests in JPRT Reviewed-by: iklam, ctornqvi, collins --- hotspot/test/TEST.groups | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index 0ab5b18b6e1..c0b6324416a 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -279,6 +279,7 @@ hotspot_compiler_2 = \ compiler/inlining/ \ compiler/integerArithmetic/ \ compiler/interpreter/ \ + compiler/jvmci/ \ -compiler/codegen/7184394 \ -compiler/codecache/stress From 453650389fe24a0487de2e56428f7f4c245a59fc Mon Sep 17 00:00:00 2001 From: Vivek R Deshpande Date: Wed, 23 Dec 2015 21:09:50 -0800 Subject: [PATCH 160/228] 8145688: Update for x86 pow in the math lib Optimizes Math.pow() for 64 and 32 bit X86 architecture using Intel LIBM implementation. Reviewed-by: kvn --- hotspot/src/cpu/x86/vm/assembler_x86.cpp | 13 + hotspot/src/cpu/x86/vm/assembler_x86.hpp | 1 + .../src/cpu/x86/vm/c1_LIRAssembler_x86.cpp | 3 - .../src/cpu/x86/vm/c1_LIRGenerator_x86.cpp | 38 +- hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp | 47 - hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp | 13 +- hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp | 9 +- hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 232 -- hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp | 13 +- .../cpu/x86/vm/macroAssembler_x86_libm.cpp | 3581 ++++++++++++++++- .../src/cpu/x86/vm/stubGenerator_x86_32.cpp | 34 +- .../src/cpu/x86/vm/stubGenerator_x86_64.cpp | 58 +- hotspot/src/cpu/x86/vm/x86_32.ad | 33 - hotspot/src/cpu/x86/vm/x86_64.ad | 18 - hotspot/src/share/vm/adlc/formssel.cpp | 1 - hotspot/src/share/vm/c1/c1_LIR.cpp | 26 - hotspot/src/share/vm/c1/c1_LIR.hpp | 2 - hotspot/src/share/vm/c1/c1_LIRAssembler.cpp | 1 - hotspot/src/share/vm/c1/c1_LinearScan.cpp | 1 - hotspot/src/share/vm/c1/c1_Runtime1.cpp | 1 + hotspot/src/share/vm/opto/classes.hpp | 1 - hotspot/src/share/vm/opto/library_call.cpp | 245 +- hotspot/src/share/vm/opto/subnode.cpp | 14 - hotspot/src/share/vm/opto/subnode.hpp | 14 - hotspot/src/share/vm/runtime/stubRoutines.cpp | 2 +- hotspot/src/share/vm/runtime/stubRoutines.hpp | 2 + hotspot/src/share/vm/runtime/vmStructs.cpp | 2 +- 27 files changed, 3714 insertions(+), 691 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index e55fd56e78d..65451309b28 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -772,6 +772,7 @@ address Assembler::locate_operand(address inst, WhichOperand which) { case 0x55: // andnps case 0x56: // orps case 0x57: // xorps + case 0x58: // addpd case 0x59: // mulpd case 0x6E: // movd case 0x7E: // movd @@ -3363,6 +3364,7 @@ void Assembler::pextrq(Register dst, XMMRegister src, int imm8) { emit_int8(imm8); } +// The encoding for pextrw is SSE2 to support the LIBM implementation. void Assembler::pextrw(Register dst, XMMRegister src, int imm8) { assert(VM_Version::supports_sse2(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); @@ -4361,6 +4363,17 @@ void Assembler::addpd(XMMRegister dst, XMMRegister src) { emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::addpd(XMMRegister dst, Address src) { + NOT_LP64(assert(VM_Version::supports_sse2(), "")); + InstructionMark im(this); + InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); + simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8(0x58); + emit_operand(dst, src); +} + + void Assembler::addps(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp index 4b6dcf4a028..380447b5d24 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp @@ -1791,6 +1791,7 @@ private: // Add Packed Floating-Point Values void addpd(XMMRegister dst, XMMRegister src); + void addpd(XMMRegister dst, Address src); void addps(XMMRegister dst, XMMRegister src); void vaddpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void vaddps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index bfe8b8c86e9..963c1b77df1 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -2381,9 +2381,6 @@ void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr unused, L // Should consider not saving rbx, if not necessary __ trigfunc('t', op->as_Op2()->fpu_stack_size()); break; - case lir_pow : - __ pow_with_fallback(op->as_Op2()->fpu_stack_size()); - break; default : ShouldNotReachHere(); } } else { diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index e7ba64b69e6..63073ac4648 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -810,7 +810,8 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) { void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { assert(x->number_of_arguments() == 1 || (x->number_of_arguments() == 2 && x->id() == vmIntrinsics::_dpow), "wrong type"); - if (x->id() == vmIntrinsics::_dexp || x->id() == vmIntrinsics::_dlog) { + if (x->id() == vmIntrinsics::_dexp || x->id() == vmIntrinsics::_dlog || + x->id() == vmIntrinsics::_dpow) { do_LibmIntrinsic(x); return; } @@ -824,7 +825,6 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: case vmIntrinsics::_dlog10: - case vmIntrinsics::_dpow: use_fpu = true; } } else { @@ -874,7 +874,6 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { case vmIntrinsics::_dcos: __ cos (calc_input, calc_result, tmp1, tmp2); break; case vmIntrinsics::_dtan: __ tan (calc_input, calc_result, tmp1, tmp2); break; case vmIntrinsics::_dlog10: __ log10(calc_input, calc_result, tmp1); break; - case vmIntrinsics::_dpow: __ pow (calc_input, calc_input2, calc_result, tmp1, tmp2, FrameMap::rax_opr, FrameMap::rcx_opr, FrameMap::rdx_opr); break; default: ShouldNotReachHere(); } @@ -890,11 +889,25 @@ void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) { LIR_Opr calc_result = rlock_result(x); LIR_Opr result_reg = result_register_for(x->type()); - BasicTypeList signature(1); - signature.append(T_DOUBLE); - CallingConvention* cc = frame_map()->c_calling_convention(&signature); + CallingConvention* cc = NULL; - value.load_item_force(cc->at(0)); + if (x->id() == vmIntrinsics::_dpow) { + LIRItem value1(x->argument_at(1), this); + + value1.set_destroys_register(); + + BasicTypeList signature(2); + signature.append(T_DOUBLE); + signature.append(T_DOUBLE); + cc = frame_map()->c_calling_convention(&signature); + value.load_item_force(cc->at(0)); + value1.load_item_force(cc->at(1)); + } else { + BasicTypeList signature(1); + signature.append(T_DOUBLE); + cc = frame_map()->c_calling_convention(&signature); + value.load_item_force(cc->at(0)); + } #ifndef _LP64 LIR_Opr tmp = FrameMap::fpu0_double_opr; @@ -915,6 +928,14 @@ void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) { __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dlog), getThreadTemp(), result_reg, cc->args()); } break; + case vmIntrinsics::_dpow: + if (VM_Version::supports_sse2()) { + __ call_runtime_leaf(StubRoutines::dpow(), getThreadTemp(), result_reg, cc->args()); + } + else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dpow), getThreadTemp(), result_reg, cc->args()); + } + break; default: ShouldNotReachHere(); } #else @@ -925,6 +946,9 @@ void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) { case vmIntrinsics::_dlog: __ call_runtime_leaf(StubRoutines::dlog(), getThreadTemp(), result_reg, cc->args()); break; + case vmIntrinsics::_dpow: + __ call_runtime_leaf(StubRoutines::dpow(), getThreadTemp(), result_reg, cc->args()); + break; } #endif __ move(result_reg, calc_result); diff --git a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp index 462aa855c5f..52924b6e8dc 100644 --- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp @@ -840,53 +840,6 @@ void FpuStackAllocator::handle_op2(LIR_Op2* op2) { break; } - case lir_pow: { - // pow needs two temporary fpu stack slots, so there are two temporary - // registers (stored in tmp1 and tmp2 of the operation). - // the stack allocator must guarantee that the stack slots are really free, - // otherwise there might be a stack overflow. - assert(left->is_fpu_register(), "must be"); - assert(right->is_fpu_register(), "must be"); - assert(res->is_fpu_register(), "must be"); - - assert(op2->tmp1_opr()->is_fpu_register(), "tmp1 is the first temporary register"); - assert(op2->tmp2_opr()->is_fpu_register(), "tmp2 is the second temporary register"); - assert(fpu_num(left) != fpu_num(right) && fpu_num(left) != fpu_num(op2->tmp1_opr()) && fpu_num(left) != fpu_num(op2->tmp2_opr()) && fpu_num(left) != fpu_num(res), "need distinct temp registers"); - assert(fpu_num(right) != fpu_num(op2->tmp1_opr()) && fpu_num(right) != fpu_num(op2->tmp2_opr()) && fpu_num(right) != fpu_num(res), "need distinct temp registers"); - assert(fpu_num(op2->tmp1_opr()) != fpu_num(op2->tmp2_opr()) && fpu_num(op2->tmp1_opr()) != fpu_num(res), "need distinct temp registers"); - assert(fpu_num(op2->tmp2_opr()) != fpu_num(res), "need distinct temp registers"); - - insert_free_if_dead(op2->tmp1_opr()); - insert_free_if_dead(op2->tmp2_opr()); - - // Must bring both operands to top of stack with following operand ordering: - // * fpu stack before pow: ... right left - // * fpu stack after pow: ... left - - insert_free_if_dead(res, right); - - if (tos_offset(right) != 1) { - insert_exchange(right); - insert_exchange(1); - } - insert_exchange(left); - assert(tos_offset(right) == 1, "check"); - assert(tos_offset(left) == 0, "check"); - - new_left = to_fpu_stack_top(left); - new_right = to_fpu_stack(right); - - op2->set_fpu_stack_size(sim()->stack_size()); - assert(sim()->stack_size() <= 6, "at least two stack slots must be free"); - - sim()->pop(); - - do_rename(right, res); - - new_res = to_fpu_stack_top(res); - break; - } - default: { assert(false, "missed a fpu-operation"); } diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp index a0e3f0685b6..6fee997e7a6 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp @@ -149,10 +149,15 @@ address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKin break; case Interpreter::java_lang_math_pow: __ fld_d(Address(rsp, 3*wordSize)); // second argument - __ pow_with_fallback(0); - // Store to stack to convert 80bit precision back to 64bits - __ push_fTOS(); - __ pop_fTOS(); + __ subptr(rsp, 4 * wordSize); + __ fstp_d(Address(rsp, 0)); + __ fstp_d(Address(rsp, 2 * wordSize)); + if (VM_Version::supports_sse2()) { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow()))); + } else { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dpow))); + } + __ addptr(rsp, 4 * wordSize); break; case Interpreter::java_lang_math_exp: __ subptr(rsp, 2*wordSize); diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp index 42d7fecb8b1..fc783f1182b 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp @@ -255,6 +255,10 @@ address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKin } else if (kind == Interpreter::java_lang_math_log) { __ movdbl(xmm0, Address(rsp, wordSize)); __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); + } else if (kind == Interpreter::java_lang_math_pow) { + __ movdbl(xmm1, Address(rsp, wordSize)); + __ movdbl(xmm0, Address(rsp, 3 * wordSize)); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow()))); } else { __ fld_d(Address(rsp, wordSize)); switch (kind) { @@ -273,11 +277,6 @@ address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKin case Interpreter::java_lang_math_log10: __ flog10(); break; - case Interpreter::java_lang_math_pow: - __ fld_d(Address(rsp, 3*wordSize)); // second argument (one - // empty stack slot) - __ pow_with_fallback(0); - break; default : ShouldNotReachHere(); } diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index af31a1ec3c2..0f869d6bdf6 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -3060,50 +3060,6 @@ void MacroAssembler::mulpd(XMMRegister dst, AddressLiteral src) { } } -void MacroAssembler::pow_exp_core_encoding() { - // kills rax, rcx, rdx - subptr(rsp,sizeof(jdouble)); - // computes 2^X. Stack: X ... - // f2xm1 computes 2^X-1 but only operates on -1<=X<=1. Get int(X) and - // keep it on the thread's stack to compute 2^int(X) later - // then compute 2^(X-int(X)) as (2^(X-int(X)-1+1) - // final result is obtained with: 2^X = 2^int(X) * 2^(X-int(X)) - fld_s(0); // Stack: X X ... - frndint(); // Stack: int(X) X ... - fsuba(1); // Stack: int(X) X-int(X) ... - fistp_s(Address(rsp,0)); // move int(X) as integer to thread's stack. Stack: X-int(X) ... - f2xm1(); // Stack: 2^(X-int(X))-1 ... - fld1(); // Stack: 1 2^(X-int(X))-1 ... - faddp(1); // Stack: 2^(X-int(X)) - // computes 2^(int(X)): add exponent bias (1023) to int(X), then - // shift int(X)+1023 to exponent position. - // Exponent is limited to 11 bits if int(X)+1023 does not fit in 11 - // bits, set result to NaN. 0x000 and 0x7FF are reserved exponent - // values so detect them and set result to NaN. - movl(rax,Address(rsp,0)); - movl(rcx, -2048); // 11 bit mask and valid NaN binary encoding - addl(rax, 1023); - movl(rdx,rax); - shll(rax,20); - // Check that 0 < int(X)+1023 < 2047. Otherwise set rax to NaN. - addl(rdx,1); - // Check that 1 < int(X)+1023+1 < 2048 - // in 3 steps: - // 1- (int(X)+1023+1)&-2048 == 0 => 0 <= int(X)+1023+1 < 2048 - // 2- (int(X)+1023+1)&-2048 != 0 - // 3- (int(X)+1023+1)&-2048 != 1 - // Do 2- first because addl just updated the flags. - cmov32(Assembler::equal,rax,rcx); - cmpl(rdx,1); - cmov32(Assembler::equal,rax,rcx); - testl(rdx,rcx); - cmov32(Assembler::notEqual,rax,rcx); - movl(Address(rsp,4),rax); - movl(Address(rsp,0),0); - fmul_d(Address(rsp,0)); // Stack: 2^X ... - addptr(rsp,sizeof(jdouble)); -} - void MacroAssembler::increase_precision() { subptr(rsp, BytesPerWord); fnstcw(Address(rsp, 0)); @@ -3119,194 +3075,6 @@ void MacroAssembler::restore_precision() { addptr(rsp, BytesPerWord); } -void MacroAssembler::fast_pow() { - // computes X^Y = 2^(Y * log2(X)) - // if fast computation is not possible, result is NaN. Requires - // fallback from user of this macro. - // increase precision for intermediate steps of the computation - BLOCK_COMMENT("fast_pow {"); - increase_precision(); - fyl2x(); // Stack: (Y*log2(X)) ... - pow_exp_core_encoding(); // Stack: exp(X) ... - restore_precision(); - BLOCK_COMMENT("} fast_pow"); -} - -void MacroAssembler::pow_or_exp(int num_fpu_regs_in_use) { - // kills rax, rcx, rdx - // pow and exp needs 2 extra registers on the fpu stack. - Label slow_case, done; - Register tmp = noreg; - if (!VM_Version::supports_cmov()) { - // fcmp needs a temporary so preserve rdx, - tmp = rdx; - } - Register tmp2 = rax; - Register tmp3 = rcx; - - // Stack: X Y - Label x_negative, y_not_2; - - static double two = 2.0; - ExternalAddress two_addr((address)&two); - - // constant maybe too far on 64 bit - lea(tmp2, two_addr); - fld_d(Address(tmp2, 0)); // Stack: 2 X Y - fcmp(tmp, 2, true, false); // Stack: X Y - jcc(Assembler::parity, y_not_2); - jcc(Assembler::notEqual, y_not_2); - - fxch(); fpop(); // Stack: X - fmul(0); // Stack: X*X - - jmp(done); - - bind(y_not_2); - - fldz(); // Stack: 0 X Y - fcmp(tmp, 1, true, false); // Stack: X Y - jcc(Assembler::above, x_negative); - - // X >= 0 - - fld_s(1); // duplicate arguments for runtime call. Stack: Y X Y - fld_s(1); // Stack: X Y X Y - fast_pow(); // Stack: X^Y X Y - fcmp(tmp, 0, false, false); // Stack: X^Y X Y - // X^Y not equal to itself: X^Y is NaN go to slow case. - jcc(Assembler::parity, slow_case); - // get rid of duplicate arguments. Stack: X^Y - if (num_fpu_regs_in_use > 0) { - fxch(); fpop(); - fxch(); fpop(); - } else { - ffree(2); - ffree(1); - } - jmp(done); - - // X <= 0 - bind(x_negative); - - fld_s(1); // Stack: Y X Y - frndint(); // Stack: int(Y) X Y - fcmp(tmp, 2, false, false); // Stack: int(Y) X Y - jcc(Assembler::notEqual, slow_case); - - subptr(rsp, 8); - - // For X^Y, when X < 0, Y has to be an integer and the final - // result depends on whether it's odd or even. We just checked - // that int(Y) == Y. We move int(Y) to gp registers as a 64 bit - // integer to test its parity. If int(Y) is huge and doesn't fit - // in the 64 bit integer range, the integer indefinite value will - // end up in the gp registers. Huge numbers are all even, the - // integer indefinite number is even so it's fine. - -#ifdef ASSERT - // Let's check we don't end up with an integer indefinite number - // when not expected. First test for huge numbers: check whether - // int(Y)+1 == int(Y) which is true for very large numbers and - // those are all even. A 64 bit integer is guaranteed to not - // overflow for numbers where y+1 != y (when precision is set to - // double precision). - Label y_not_huge; - - fld1(); // Stack: 1 int(Y) X Y - fadd(1); // Stack: 1+int(Y) int(Y) X Y - -#ifdef _LP64 - // trip to memory to force the precision down from double extended - // precision - fstp_d(Address(rsp, 0)); - fld_d(Address(rsp, 0)); -#endif - - fcmp(tmp, 1, true, false); // Stack: int(Y) X Y -#endif - - // move int(Y) as 64 bit integer to thread's stack - fistp_d(Address(rsp,0)); // Stack: X Y - -#ifdef ASSERT - jcc(Assembler::notEqual, y_not_huge); - - // Y is huge so we know it's even. It may not fit in a 64 bit - // integer and we don't want the debug code below to see the - // integer indefinite value so overwrite int(Y) on the thread's - // stack with 0. - movl(Address(rsp, 0), 0); - movl(Address(rsp, 4), 0); - - bind(y_not_huge); -#endif - - fld_s(1); // duplicate arguments for runtime call. Stack: Y X Y - fld_s(1); // Stack: X Y X Y - fabs(); // Stack: abs(X) Y X Y - fast_pow(); // Stack: abs(X)^Y X Y - fcmp(tmp, 0, false, false); // Stack: abs(X)^Y X Y - // abs(X)^Y not equal to itself: abs(X)^Y is NaN go to slow case. - - pop(tmp2); - NOT_LP64(pop(tmp3)); - jcc(Assembler::parity, slow_case); - -#ifdef ASSERT - // Check that int(Y) is not integer indefinite value (int - // overflow). Shouldn't happen because for values that would - // overflow, 1+int(Y)==Y which was tested earlier. -#ifndef _LP64 - { - Label integer; - testl(tmp2, tmp2); - jcc(Assembler::notZero, integer); - cmpl(tmp3, 0x80000000); - jcc(Assembler::notZero, integer); - STOP("integer indefinite value shouldn't be seen here"); - bind(integer); - } -#else - { - Label integer; - mov(tmp3, tmp2); // preserve tmp2 for parity check below - shlq(tmp3, 1); - jcc(Assembler::carryClear, integer); - jcc(Assembler::notZero, integer); - STOP("integer indefinite value shouldn't be seen here"); - bind(integer); - } -#endif -#endif - - // get rid of duplicate arguments. Stack: X^Y - if (num_fpu_regs_in_use > 0) { - fxch(); fpop(); - fxch(); fpop(); - } else { - ffree(2); - ffree(1); - } - - testl(tmp2, 1); - jcc(Assembler::zero, done); // X <= 0, Y even: X^Y = abs(X)^Y - // X <= 0, Y even: X^Y = -abs(X)^Y - - fchs(); // Stack: -abs(X)^Y Y - jmp(done); - - // slow case: runtime call - bind(slow_case); - - fpop(); // pop incorrect result or int(Y) - - fp_runtime_fallback(CAST_FROM_FN_PTR(address, SharedRuntime::dpow), 2, num_fpu_regs_in_use); - - // Come here with result in F-TOS - bind(done); -} - void MacroAssembler::fpop() { ffree(); fincstp(); diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index f9037c993f1..0b7fc6d90c0 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -918,24 +918,19 @@ class MacroAssembler: public Assembler { void fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register rax, Register rcx, Register rdx, Register tmp1 LP64_ONLY(COMMA Register tmp2)); + void fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, + XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register rax, Register rcx, + Register rdx NOT_LP64(COMMA Register tmp) LP64_ONLY(COMMA Register tmp1) + LP64_ONLY(COMMA Register tmp2) LP64_ONLY(COMMA Register tmp3) LP64_ONLY(COMMA Register tmp4)); void increase_precision(); void restore_precision(); - // computes pow(x,y). Fallback to runtime call included. - void pow_with_fallback(int num_fpu_regs_in_use) { pow_or_exp(num_fpu_regs_in_use); } - private: // call runtime as a fallback for trig functions and pow/exp. void fp_runtime_fallback(address runtime_entry, int nb_args, int num_fpu_regs_in_use); - // computes 2^(Ylog2X); Ylog2X in ST(0) - void pow_exp_core_encoding(); - - // computes pow(x,y) or exp(x). Fallback to runtime call included. - void pow_or_exp(int num_fpu_regs_in_use); - // these are private because users should be doing movflt/movdbl void movss(Address dst, XMMRegister src) { Assembler::movss(dst, src); } diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp index 860f2bcd26d..e94f1d7136f 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp @@ -35,6 +35,8 @@ #define ALIGNED_(x) __attribute__ ((aligned(x))) #endif +// The 32 bit and 64 bit code is at most SSE2 compliant + /******************************************************************************/ // ALGORITHM DESCRIPTION - EXP() // --------------------- @@ -409,7 +411,7 @@ void MacroAssembler::fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm addq(rsp, 24); } -#endif +#endif // _LP64 #ifndef _LP64 @@ -674,7 +676,7 @@ void MacroAssembler::fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm movl(tmp, Address(rsp, 64)); } -#endif +#endif // !_LP64 /******************************************************************************/ // ALGORITHM DESCRIPTION - LOG() @@ -889,13 +891,23 @@ void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm addsd(xmm1, xmm5); movdqu(xmm2, ExternalAddress(32 + coeff)); // 0x9999999aUL, 0x3fc99999UL, 0x00000000UL, 0xbfe00000UL mulsd(xmm6, xmm7); - movddup(xmm5, xmm1); + if (VM_Version::supports_sse3()) { + movddup(xmm5, xmm1); + } else { + movdqu(xmm5, xmm1); + movlhps(xmm5, xmm5); + } mulsd(xmm7, ExternalAddress(8 + log2)); // 0x93c76730UL, 0x3ceef357UL mulsd(xmm3, xmm1); addsd(xmm0, xmm6); mulpd(xmm4, xmm5); mulpd(xmm5, xmm5); - movddup(xmm6, xmm0); + if (VM_Version::supports_sse3()) { + movddup(xmm6, xmm0); + } else { + movdqu(xmm6, xmm0); + movlhps(xmm6, xmm6); + } addsd(xmm0, xmm1); addpd(xmm4, xmm2); mulpd(xmm3, xmm5); @@ -995,7 +1007,7 @@ void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm addq(rsp, 24); } -#endif +#endif // _LP64 #ifndef _LP64 @@ -1285,4 +1297,3561 @@ void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm movl(tmp, Address(rsp, 40)); } -#endif +#endif // !_LP64 + +/******************************************************************************/ +// ALGORITHM DESCRIPTION - POW() +// --------------------- +// +// Let x=2^k * mx, mx in [1,2) +// +// log2(x) calculation: +// +// Get B~1/mx based on the output of rcpps instruction (B0) +// B = int((B0*LH*2^9+0.5))/2^9 +// LH is a short approximation for log2(e) +// +// Reduced argument, scaled by LH: +// r=B*mx-LH (computed accurately in high and low parts) +// +// log2(x) result: k - log2(B) + p(r) +// p(r) is a degree 8 polynomial +// -log2(B) read from data table (high, low parts) +// log2(x) is formed from high and low parts +// For |x| in [1-1/32, 1+1/16), a slower but more accurate computation +// based om the same table design is performed. +// +// Main path is taken if | floor(log2(|log2(|x|)|) + floor(log2|y|) | < 8, +// to filter out all potential OF/UF cases. +// exp2(y*log2(x)) is computed using an 8-bit index table and a degree 5 +// polynomial +// +// Special cases: +// pow(-0,y) = -INF and raises the divide-by-zero exception for y an odd +// integer < 0. +// pow(-0,y) = +INF and raises the divide-by-zero exception for y < 0 and +// not an odd integer. +// pow(-0,y) = -0 for y an odd integer > 0. +// pow(-0,y) = +0 for y > 0 and not an odd integer. +// pow(-1,-INF) = NaN. +// pow(+1,y) = NaN for any y, even a NaN. +// pow(x,-0) = 1 for any x, even a NaN. +// pow(x,y) = a NaN and raises the invalid exception for finite x < 0 and +// finite non-integer y. +// pow(x,-INF) = +INF for |x|<1. +// pow(x,-INF) = +0 for |x|>1. +// pow(x,+INF) = +0 for |x|<1. +// pow(x,+INF) = +INF for |x|>1. +// pow(-INF,y) = -0 for y an odd integer < 0. +// pow(-INF,y) = +0 for y < 0 and not an odd integer. +// pow(-INF,y) = -INF for y an odd integer > 0. +// pow(-INF,y) = +INF for y > 0 and not an odd integer. +// pow(+INF,y) = +0 for y <0. +// pow(+INF,y) = +INF for y >0. +// +/******************************************************************************/ + +#ifdef _LP64 +ALIGNED_(16) juint _HIGHSIGMASK[] = +{ + 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL +}; + +ALIGNED_(16) juint _LOG2_E[] = +{ + 0x00000000UL, 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL +}; + +ALIGNED_(16) juint _HIGHMASK_Y[] = +{ + 0x00000000UL, 0xfffffff8UL, 0x00000000UL, 0xffffffffUL +}; + +ALIGNED_(16) juint _T_exp[] = +{ + 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x3b700000UL, 0xfa5abcbfUL, + 0x3ff00b1aUL, 0xa7609f71UL, 0xbc84f6b2UL, 0xa9fb3335UL, 0x3ff0163dUL, + 0x9ab8cdb7UL, 0x3c9b6129UL, 0x143b0281UL, 0x3ff02168UL, 0x0fc54eb6UL, + 0xbc82bf31UL, 0x3e778061UL, 0x3ff02c9aUL, 0x535b085dUL, 0xbc719083UL, + 0x2e11bbccUL, 0x3ff037d4UL, 0xeeade11aUL, 0x3c656811UL, 0xe86e7f85UL, + 0x3ff04315UL, 0x1977c96eUL, 0xbc90a31cUL, 0x72f654b1UL, 0x3ff04e5fUL, + 0x3aa0d08cUL, 0x3c84c379UL, 0xd3158574UL, 0x3ff059b0UL, 0xa475b465UL, + 0x3c8d73e2UL, 0x0e3c1f89UL, 0x3ff0650aUL, 0x5799c397UL, 0xbc95cb7bUL, + 0x29ddf6deUL, 0x3ff0706bUL, 0xe2b13c27UL, 0xbc8c91dfUL, 0x2b72a836UL, + 0x3ff07bd4UL, 0x54458700UL, 0x3c832334UL, 0x18759bc8UL, 0x3ff08745UL, + 0x4bb284ffUL, 0x3c6186beUL, 0xf66607e0UL, 0x3ff092bdUL, 0x800a3fd1UL, + 0xbc968063UL, 0xcac6f383UL, 0x3ff09e3eUL, 0x18316136UL, 0x3c914878UL, + 0x9b1f3919UL, 0x3ff0a9c7UL, 0x873d1d38UL, 0x3c85d16cUL, 0x6cf9890fUL, + 0x3ff0b558UL, 0x4adc610bUL, 0x3c98a62eUL, 0x45e46c85UL, 0x3ff0c0f1UL, + 0x06d21cefUL, 0x3c94f989UL, 0x2b7247f7UL, 0x3ff0cc92UL, 0x16e24f71UL, + 0x3c901edcUL, 0x23395decUL, 0x3ff0d83bUL, 0xe43f316aUL, 0xbc9bc14dUL, + 0x32d3d1a2UL, 0x3ff0e3ecUL, 0x27c57b52UL, 0x3c403a17UL, 0x5fdfa9c5UL, + 0x3ff0efa5UL, 0xbc54021bUL, 0xbc949db9UL, 0xaffed31bUL, 0x3ff0fb66UL, + 0xc44ebd7bUL, 0xbc6b9bedUL, 0x28d7233eUL, 0x3ff10730UL, 0x1692fdd5UL, + 0x3c8d46ebUL, 0xd0125b51UL, 0x3ff11301UL, 0x39449b3aUL, 0xbc96c510UL, + 0xab5e2ab6UL, 0x3ff11edbUL, 0xf703fb72UL, 0xbc9ca454UL, 0xc06c31ccUL, + 0x3ff12abdUL, 0xb36ca5c7UL, 0xbc51b514UL, 0x14f204abUL, 0x3ff136a8UL, + 0xba48dcf0UL, 0xbc67108fUL, 0xaea92de0UL, 0x3ff1429aUL, 0x9af1369eUL, + 0xbc932fbfUL, 0x934f312eUL, 0x3ff14e95UL, 0x39bf44abUL, 0xbc8b91e8UL, + 0xc8a58e51UL, 0x3ff15a98UL, 0xb9eeab0aUL, 0x3c82406aUL, 0x5471c3c2UL, + 0x3ff166a4UL, 0x82ea1a32UL, 0x3c58f23bUL, 0x3c7d517bUL, 0x3ff172b8UL, + 0xb9d78a76UL, 0xbc819041UL, 0x8695bbc0UL, 0x3ff17ed4UL, 0xe2ac5a64UL, + 0x3c709e3fUL, 0x388c8deaUL, 0x3ff18af9UL, 0xd1970f6cUL, 0xbc911023UL, + 0x58375d2fUL, 0x3ff19726UL, 0x85f17e08UL, 0x3c94aaddUL, 0xeb6fcb75UL, + 0x3ff1a35bUL, 0x7b4968e4UL, 0x3c8e5b4cUL, 0xf8138a1cUL, 0x3ff1af99UL, + 0xa4b69280UL, 0x3c97bf85UL, 0x84045cd4UL, 0x3ff1bbe0UL, 0x352ef607UL, + 0xbc995386UL, 0x95281c6bUL, 0x3ff1c82fUL, 0x8010f8c9UL, 0x3c900977UL, + 0x3168b9aaUL, 0x3ff1d487UL, 0x00a2643cUL, 0x3c9e016eUL, 0x5eb44027UL, + 0x3ff1e0e7UL, 0x088cb6deUL, 0xbc96fdd8UL, 0x22fcd91dUL, 0x3ff1ed50UL, + 0x027bb78cUL, 0xbc91df98UL, 0x8438ce4dUL, 0x3ff1f9c1UL, 0xa097af5cUL, + 0xbc9bf524UL, 0x88628cd6UL, 0x3ff2063bUL, 0x814a8495UL, 0x3c8dc775UL, + 0x3578a819UL, 0x3ff212beUL, 0x2cfcaac9UL, 0x3c93592dUL, 0x917ddc96UL, + 0x3ff21f49UL, 0x9494a5eeUL, 0x3c82a97eUL, 0xa27912d1UL, 0x3ff22bddUL, + 0x5577d69fUL, 0x3c8d34fbUL, 0x6e756238UL, 0x3ff2387aUL, 0xb6c70573UL, + 0x3c99b07eUL, 0xfb82140aUL, 0x3ff2451fUL, 0x911ca996UL, 0x3c8acfccUL, + 0x4fb2a63fUL, 0x3ff251ceUL, 0xbef4f4a4UL, 0x3c8ac155UL, 0x711ece75UL, + 0x3ff25e85UL, 0x4ac31b2cUL, 0x3c93e1a2UL, 0x65e27cddUL, 0x3ff26b45UL, + 0x9940e9d9UL, 0x3c82bd33UL, 0x341ddf29UL, 0x3ff2780eUL, 0x05f9e76cUL, + 0x3c9e067cUL, 0xe1f56381UL, 0x3ff284dfUL, 0x8c3f0d7eUL, 0xbc9a4c3aUL, + 0x7591bb70UL, 0x3ff291baUL, 0x28401cbdUL, 0xbc82cc72UL, 0xf51fdee1UL, + 0x3ff29e9dUL, 0xafad1255UL, 0x3c8612e8UL, 0x66d10f13UL, 0x3ff2ab8aUL, + 0x191690a7UL, 0xbc995743UL, 0xd0dad990UL, 0x3ff2b87fUL, 0xd6381aa4UL, + 0xbc410adcUL, 0x39771b2fUL, 0x3ff2c57eUL, 0xa6eb5124UL, 0xbc950145UL, + 0xa6e4030bUL, 0x3ff2d285UL, 0x54db41d5UL, 0x3c900247UL, 0x1f641589UL, + 0x3ff2df96UL, 0xfbbce198UL, 0x3c9d16cfUL, 0xa93e2f56UL, 0x3ff2ecafUL, + 0x45d52383UL, 0x3c71ca0fUL, 0x4abd886bUL, 0x3ff2f9d2UL, 0x532bda93UL, + 0xbc653c55UL, 0x0a31b715UL, 0x3ff306feUL, 0xd23182e4UL, 0x3c86f46aUL, + 0xedeeb2fdUL, 0x3ff31432UL, 0xf3f3fcd1UL, 0x3c8959a3UL, 0xfc4cd831UL, + 0x3ff32170UL, 0x8e18047cUL, 0x3c8a9ce7UL, 0x3ba8ea32UL, 0x3ff32eb8UL, + 0x3cb4f318UL, 0xbc9c45e8UL, 0xb26416ffUL, 0x3ff33c08UL, 0x843659a6UL, + 0x3c932721UL, 0x66e3fa2dUL, 0x3ff34962UL, 0x930881a4UL, 0xbc835a75UL, + 0x5f929ff1UL, 0x3ff356c5UL, 0x5c4e4628UL, 0xbc8b5ceeUL, 0xa2de883bUL, + 0x3ff36431UL, 0xa06cb85eUL, 0xbc8c3144UL, 0x373aa9cbUL, 0x3ff371a7UL, + 0xbf42eae2UL, 0xbc963aeaUL, 0x231e754aUL, 0x3ff37f26UL, 0x9eceb23cUL, + 0xbc99f5caUL, 0x6d05d866UL, 0x3ff38caeUL, 0x3c9904bdUL, 0xbc9e958dUL, + 0x1b7140efUL, 0x3ff39a40UL, 0xfc8e2934UL, 0xbc99a9a5UL, 0x34e59ff7UL, + 0x3ff3a7dbUL, 0xd661f5e3UL, 0xbc75e436UL, 0xbfec6cf4UL, 0x3ff3b57fUL, + 0xe26fff18UL, 0x3c954c66UL, 0xc313a8e5UL, 0x3ff3c32dUL, 0x375d29c3UL, + 0xbc9efff8UL, 0x44ede173UL, 0x3ff3d0e5UL, 0x8c284c71UL, 0x3c7fe8d0UL, + 0x4c123422UL, 0x3ff3dea6UL, 0x11f09ebcUL, 0x3c8ada09UL, 0xdf1c5175UL, + 0x3ff3ec70UL, 0x7b8c9bcaUL, 0xbc8af663UL, 0x04ac801cUL, 0x3ff3fa45UL, + 0xf956f9f3UL, 0xbc97d023UL, 0xc367a024UL, 0x3ff40822UL, 0xb6f4d048UL, + 0x3c8bddf8UL, 0x21f72e2aUL, 0x3ff4160aUL, 0x1c309278UL, 0xbc5ef369UL, + 0x2709468aUL, 0x3ff423fbUL, 0xc0b314ddUL, 0xbc98462dUL, 0xd950a897UL, + 0x3ff431f5UL, 0xe35f7999UL, 0xbc81c7ddUL, 0x3f84b9d4UL, 0x3ff43ffaUL, + 0x9704c003UL, 0x3c8880beUL, 0x6061892dUL, 0x3ff44e08UL, 0x04ef80d0UL, + 0x3c489b7aUL, 0x42a7d232UL, 0x3ff45c20UL, 0x82fb1f8eUL, 0xbc686419UL, + 0xed1d0057UL, 0x3ff46a41UL, 0xd1648a76UL, 0x3c9c944bUL, 0x668b3237UL, + 0x3ff4786dUL, 0xed445733UL, 0xbc9c20f0UL, 0xb5c13cd0UL, 0x3ff486a2UL, + 0xb69062f0UL, 0x3c73c1a3UL, 0xe192aed2UL, 0x3ff494e1UL, 0x5e499ea0UL, + 0xbc83b289UL, 0xf0d7d3deUL, 0x3ff4a32aUL, 0xf3d1be56UL, 0x3c99cb62UL, + 0xea6db7d7UL, 0x3ff4b17dUL, 0x7f2897f0UL, 0xbc8125b8UL, 0xd5362a27UL, + 0x3ff4bfdaUL, 0xafec42e2UL, 0x3c7d4397UL, 0xb817c114UL, 0x3ff4ce41UL, + 0x690abd5dUL, 0x3c905e29UL, 0x99fddd0dUL, 0x3ff4dcb2UL, 0xbc6a7833UL, + 0x3c98ecdbUL, 0x81d8abffUL, 0x3ff4eb2dUL, 0x2e5d7a52UL, 0xbc95257dUL, + 0x769d2ca7UL, 0x3ff4f9b2UL, 0xd25957e3UL, 0xbc94b309UL, 0x7f4531eeUL, + 0x3ff50841UL, 0x49b7465fUL, 0x3c7a249bUL, 0xa2cf6642UL, 0x3ff516daUL, + 0x69bd93efUL, 0xbc8f7685UL, 0xe83f4eefUL, 0x3ff5257dUL, 0x43efef71UL, + 0xbc7c998dUL, 0x569d4f82UL, 0x3ff5342bUL, 0x1db13cadUL, 0xbc807abeUL, + 0xf4f6ad27UL, 0x3ff542e2UL, 0x192d5f7eUL, 0x3c87926dUL, 0xca5d920fUL, + 0x3ff551a4UL, 0xefede59bUL, 0xbc8d689cUL, 0xdde910d2UL, 0x3ff56070UL, + 0x168eebf0UL, 0xbc90fb6eUL, 0x36b527daUL, 0x3ff56f47UL, 0x011d93adUL, + 0x3c99bb2cUL, 0xdbe2c4cfUL, 0x3ff57e27UL, 0x8a57b9c4UL, 0xbc90b98cUL, + 0xd497c7fdUL, 0x3ff58d12UL, 0x5b9a1de8UL, 0x3c8295e1UL, 0x27ff07ccUL, + 0x3ff59c08UL, 0xe467e60fUL, 0xbc97e2ceUL, 0xdd485429UL, 0x3ff5ab07UL, + 0x054647adUL, 0x3c96324cUL, 0xfba87a03UL, 0x3ff5ba11UL, 0x4c233e1aUL, + 0xbc9b77a1UL, 0x8a5946b7UL, 0x3ff5c926UL, 0x816986a2UL, 0x3c3c4b1bUL, + 0x90998b93UL, 0x3ff5d845UL, 0xa8b45643UL, 0xbc9cd6a7UL, 0x15ad2148UL, + 0x3ff5e76fUL, 0x3080e65eUL, 0x3c9ba6f9UL, 0x20dceb71UL, 0x3ff5f6a3UL, + 0xe3cdcf92UL, 0xbc89eaddUL, 0xb976dc09UL, 0x3ff605e1UL, 0x9b56de47UL, + 0xbc93e242UL, 0xe6cdf6f4UL, 0x3ff6152aUL, 0x4ab84c27UL, 0x3c9e4b3eUL, + 0xb03a5585UL, 0x3ff6247eUL, 0x7e40b497UL, 0xbc9383c1UL, 0x1d1929fdUL, + 0x3ff633ddUL, 0xbeb964e5UL, 0x3c984710UL, 0x34ccc320UL, 0x3ff64346UL, + 0x759d8933UL, 0xbc8c483cUL, 0xfebc8fb7UL, 0x3ff652b9UL, 0xc9a73e09UL, + 0xbc9ae3d5UL, 0x82552225UL, 0x3ff66238UL, 0x87591c34UL, 0xbc9bb609UL, + 0xc70833f6UL, 0x3ff671c1UL, 0x586c6134UL, 0xbc8e8732UL, 0xd44ca973UL, + 0x3ff68155UL, 0x44f73e65UL, 0x3c6038aeUL, 0xb19e9538UL, 0x3ff690f4UL, + 0x9aeb445dUL, 0x3c8804bdUL, 0x667f3bcdUL, 0x3ff6a09eUL, 0x13b26456UL, + 0xbc9bdd34UL, 0xfa75173eUL, 0x3ff6b052UL, 0x2c9a9d0eUL, 0x3c7a38f5UL, + 0x750bdabfUL, 0x3ff6c012UL, 0x67ff0b0dUL, 0xbc728956UL, 0xddd47645UL, + 0x3ff6cfdcUL, 0xb6f17309UL, 0x3c9c7aa9UL, 0x3c651a2fUL, 0x3ff6dfb2UL, + 0x683c88abUL, 0xbc6bbe3aUL, 0x98593ae5UL, 0x3ff6ef92UL, 0x9e1ac8b2UL, + 0xbc90b974UL, 0xf9519484UL, 0x3ff6ff7dUL, 0x25860ef6UL, 0xbc883c0fUL, + 0x66f42e87UL, 0x3ff70f74UL, 0xd45aa65fUL, 0x3c59d644UL, 0xe8ec5f74UL, + 0x3ff71f75UL, 0x86887a99UL, 0xbc816e47UL, 0x86ead08aUL, 0x3ff72f82UL, + 0x2cd62c72UL, 0xbc920aa0UL, 0x48a58174UL, 0x3ff73f9aUL, 0x6c65d53cUL, + 0xbc90a8d9UL, 0x35d7cbfdUL, 0x3ff74fbdUL, 0x618a6e1cUL, 0x3c9047fdUL, + 0x564267c9UL, 0x3ff75febUL, 0x57316dd3UL, 0xbc902459UL, 0xb1ab6e09UL, + 0x3ff77024UL, 0x169147f8UL, 0x3c9b7877UL, 0x4fde5d3fUL, 0x3ff78069UL, + 0x0a02162dUL, 0x3c9866b8UL, 0x38ac1cf6UL, 0x3ff790b9UL, 0x62aadd3eUL, + 0x3c9349a8UL, 0x73eb0187UL, 0x3ff7a114UL, 0xee04992fUL, 0xbc841577UL, + 0x0976cfdbUL, 0x3ff7b17bUL, 0x8468dc88UL, 0xbc9bebb5UL, 0x0130c132UL, + 0x3ff7c1edUL, 0xd1164dd6UL, 0x3c9f124cUL, 0x62ff86f0UL, 0x3ff7d26aUL, + 0xfb72b8b4UL, 0x3c91bddbUL, 0x36cf4e62UL, 0x3ff7e2f3UL, 0xba15797eUL, + 0x3c705d02UL, 0x8491c491UL, 0x3ff7f387UL, 0xcf9311aeUL, 0xbc807f11UL, + 0x543e1a12UL, 0x3ff80427UL, 0x626d972bUL, 0xbc927c86UL, 0xadd106d9UL, + 0x3ff814d2UL, 0x0d151d4dUL, 0x3c946437UL, 0x994cce13UL, 0x3ff82589UL, + 0xd41532d8UL, 0xbc9d4c1dUL, 0x1eb941f7UL, 0x3ff8364cUL, 0x31df2bd5UL, + 0x3c999b9aUL, 0x4623c7adUL, 0x3ff8471aUL, 0xa341cdfbUL, 0xbc88d684UL, + 0x179f5b21UL, 0x3ff857f4UL, 0xf8b216d0UL, 0xbc5ba748UL, 0x9b4492edUL, + 0x3ff868d9UL, 0x9bd4f6baUL, 0xbc9fc6f8UL, 0xd931a436UL, 0x3ff879caUL, + 0xd2db47bdUL, 0x3c85d2d7UL, 0xd98a6699UL, 0x3ff88ac7UL, 0xf37cb53aUL, + 0x3c9994c2UL, 0xa478580fUL, 0x3ff89bd0UL, 0x4475202aUL, 0x3c9d5395UL, + 0x422aa0dbUL, 0x3ff8ace5UL, 0x56864b27UL, 0x3c96e9f1UL, 0xbad61778UL, + 0x3ff8be05UL, 0xfc43446eUL, 0x3c9ecb5eUL, 0x16b5448cUL, 0x3ff8cf32UL, + 0x32e9e3aaUL, 0xbc70d55eUL, 0x5e0866d9UL, 0x3ff8e06aUL, 0x6fc9b2e6UL, + 0xbc97114aUL, 0x99157736UL, 0x3ff8f1aeUL, 0xa2e3976cUL, 0x3c85cc13UL, + 0xd0282c8aUL, 0x3ff902feUL, 0x85fe3fd2UL, 0x3c9592caUL, 0x0b91ffc6UL, + 0x3ff9145bUL, 0x2e582524UL, 0xbc9dd679UL, 0x53aa2fe2UL, 0x3ff925c3UL, + 0xa639db7fUL, 0xbc83455fUL, 0xb0cdc5e5UL, 0x3ff93737UL, 0x81b57ebcUL, + 0xbc675fc7UL, 0x2b5f98e5UL, 0x3ff948b8UL, 0x797d2d99UL, 0xbc8dc3d6UL, + 0xcbc8520fUL, 0x3ff95a44UL, 0x96a5f039UL, 0xbc764b7cUL, 0x9a7670b3UL, + 0x3ff96bddUL, 0x7f19c896UL, 0xbc5ba596UL, 0x9fde4e50UL, 0x3ff97d82UL, + 0x7c1b85d1UL, 0xbc9d185bUL, 0xe47a22a2UL, 0x3ff98f33UL, 0xa24c78ecUL, + 0x3c7cabdaUL, 0x70ca07baUL, 0x3ff9a0f1UL, 0x91cee632UL, 0xbc9173bdUL, + 0x4d53fe0dUL, 0x3ff9b2bbUL, 0x4df6d518UL, 0xbc9dd84eUL, 0x82a3f090UL, + 0x3ff9c491UL, 0xb071f2beUL, 0x3c7c7c46UL, 0x194bb8d5UL, 0x3ff9d674UL, + 0xa3dd8233UL, 0xbc9516beUL, 0x19e32323UL, 0x3ff9e863UL, 0x78e64c6eUL, + 0x3c7824caUL, 0x8d07f29eUL, 0x3ff9fa5eUL, 0xaaf1faceUL, 0xbc84a9ceUL, + 0x7b5de565UL, 0x3ffa0c66UL, 0x5d1cd533UL, 0xbc935949UL, 0xed8eb8bbUL, + 0x3ffa1e7aUL, 0xee8be70eUL, 0x3c9c6618UL, 0xec4a2d33UL, 0x3ffa309bUL, + 0x7ddc36abUL, 0x3c96305cUL, 0x80460ad8UL, 0x3ffa42c9UL, 0x589fb120UL, + 0xbc9aa780UL, 0xb23e255dUL, 0x3ffa5503UL, 0xdb8d41e1UL, 0xbc9d2f6eUL, + 0x8af46052UL, 0x3ffa674aUL, 0x30670366UL, 0x3c650f56UL, 0x1330b358UL, + 0x3ffa799eUL, 0xcac563c7UL, 0x3c9bcb7eUL, 0x53c12e59UL, 0x3ffa8bfeUL, + 0xb2ba15a9UL, 0xbc94f867UL, 0x5579fdbfUL, 0x3ffa9e6bUL, 0x0ef7fd31UL, + 0x3c90fac9UL, 0x21356ebaUL, 0x3ffab0e5UL, 0xdae94545UL, 0x3c889c31UL, + 0xbfd3f37aUL, 0x3ffac36bUL, 0xcae76cd0UL, 0xbc8f9234UL, 0x3a3c2774UL, + 0x3ffad5ffUL, 0xb6b1b8e5UL, 0x3c97ef3bUL, 0x995ad3adUL, 0x3ffae89fUL, + 0x345dcc81UL, 0x3c97a1cdUL, 0xe622f2ffUL, 0x3ffafb4cUL, 0x0f315ecdUL, + 0xbc94b2fcUL, 0x298db666UL, 0x3ffb0e07UL, 0x4c80e425UL, 0xbc9bdef5UL, + 0x6c9a8952UL, 0x3ffb20ceUL, 0x4a0756ccUL, 0x3c94dd02UL, 0xb84f15fbUL, + 0x3ffb33a2UL, 0x3084d708UL, 0xbc62805eUL, 0x15b749b1UL, 0x3ffb4684UL, + 0xe9df7c90UL, 0xbc7f763dUL, 0x8de5593aUL, 0x3ffb5972UL, 0xbbba6de3UL, + 0xbc9c71dfUL, 0x29f1c52aUL, 0x3ffb6c6eUL, 0x52883f6eUL, 0x3c92a8f3UL, + 0xf2fb5e47UL, 0x3ffb7f76UL, 0x7e54ac3bUL, 0xbc75584fUL, 0xf22749e4UL, + 0x3ffb928cUL, 0x54cb65c6UL, 0xbc9b7216UL, 0x30a1064aUL, 0x3ffba5b0UL, + 0x0e54292eUL, 0xbc9efcd3UL, 0xb79a6f1fUL, 0x3ffbb8e0UL, 0xc9696205UL, + 0xbc3f52d1UL, 0x904bc1d2UL, 0x3ffbcc1eUL, 0x7a2d9e84UL, 0x3c823dd0UL, + 0xc3f3a207UL, 0x3ffbdf69UL, 0x60ea5b53UL, 0xbc3c2623UL, 0x5bd71e09UL, + 0x3ffbf2c2UL, 0x3f6b9c73UL, 0xbc9efdcaUL, 0x6141b33dUL, 0x3ffc0628UL, + 0xa1fbca34UL, 0xbc8d8a5aUL, 0xdd85529cUL, 0x3ffc199bUL, 0x895048ddUL, + 0x3c811065UL, 0xd9fa652cUL, 0x3ffc2d1cUL, 0x17c8a5d7UL, 0xbc96e516UL, + 0x5fffd07aUL, 0x3ffc40abUL, 0xe083c60aUL, 0x3c9b4537UL, 0x78fafb22UL, + 0x3ffc5447UL, 0x2493b5afUL, 0x3c912f07UL, 0x2e57d14bUL, 0x3ffc67f1UL, + 0xff483cadUL, 0x3c92884dUL, 0x8988c933UL, 0x3ffc7ba8UL, 0xbe255559UL, + 0xbc8e76bbUL, 0x9406e7b5UL, 0x3ffc8f6dUL, 0x48805c44UL, 0x3c71acbcUL, + 0x5751c4dbUL, 0x3ffca340UL, 0xd10d08f5UL, 0xbc87f2beUL, 0xdcef9069UL, + 0x3ffcb720UL, 0xd1e949dbUL, 0x3c7503cbUL, 0x2e6d1675UL, 0x3ffccb0fUL, + 0x86009092UL, 0xbc7d220fUL, 0x555dc3faUL, 0x3ffcdf0bUL, 0x53829d72UL, + 0xbc8dd83bUL, 0x5b5bab74UL, 0x3ffcf315UL, 0xb86dff57UL, 0xbc9a08e9UL, + 0x4a07897cUL, 0x3ffd072dUL, 0x43797a9cUL, 0xbc9cbc37UL, 0x2b08c968UL, + 0x3ffd1b53UL, 0x219a36eeUL, 0x3c955636UL, 0x080d89f2UL, 0x3ffd2f87UL, + 0x719d8578UL, 0xbc9d487bUL, 0xeacaa1d6UL, 0x3ffd43c8UL, 0xbf5a1614UL, + 0x3c93db53UL, 0xdcfba487UL, 0x3ffd5818UL, 0xd75b3707UL, 0x3c82ed02UL, + 0xe862e6d3UL, 0x3ffd6c76UL, 0x4a8165a0UL, 0x3c5fe87aUL, 0x16c98398UL, + 0x3ffd80e3UL, 0x8beddfe8UL, 0xbc911ec1UL, 0x71ff6075UL, 0x3ffd955dUL, + 0xbb9af6beUL, 0x3c9a052dUL, 0x03db3285UL, 0x3ffda9e6UL, 0x696db532UL, + 0x3c9c2300UL, 0xd63a8315UL, 0x3ffdbe7cUL, 0x926b8be4UL, 0xbc9b76f1UL, + 0xf301b460UL, 0x3ffdd321UL, 0x78f018c3UL, 0x3c92da57UL, 0x641c0658UL, + 0x3ffde7d5UL, 0x8e79ba8fUL, 0xbc9ca552UL, 0x337b9b5fUL, 0x3ffdfc97UL, + 0x4f184b5cUL, 0xbc91a5cdUL, 0x6b197d17UL, 0x3ffe1167UL, 0xbd5c7f44UL, + 0xbc72b529UL, 0x14f5a129UL, 0x3ffe2646UL, 0x817a1496UL, 0xbc97b627UL, + 0x3b16ee12UL, 0x3ffe3b33UL, 0x31fdc68bUL, 0xbc99f4a4UL, 0xe78b3ff6UL, + 0x3ffe502eUL, 0x80a9cc8fUL, 0x3c839e89UL, 0x24676d76UL, 0x3ffe6539UL, + 0x7522b735UL, 0xbc863ff8UL, 0xfbc74c83UL, 0x3ffe7a51UL, 0xca0c8de2UL, + 0x3c92d522UL, 0x77cdb740UL, 0x3ffe8f79UL, 0x80b054b1UL, 0xbc910894UL, + 0xa2a490daUL, 0x3ffea4afUL, 0x179c2893UL, 0xbc9e9c23UL, 0x867cca6eUL, + 0x3ffeb9f4UL, 0x2293e4f2UL, 0x3c94832fUL, 0x2d8e67f1UL, 0x3ffecf48UL, + 0xb411ad8cUL, 0xbc9c93f3UL, 0xa2188510UL, 0x3ffee4aaUL, 0xa487568dUL, + 0x3c91c68dUL, 0xee615a27UL, 0x3ffefa1bUL, 0x86a4b6b0UL, 0x3c9dc7f4UL, + 0x1cb6412aUL, 0x3fff0f9cUL, 0x65181d45UL, 0xbc932200UL, 0x376bba97UL, + 0x3fff252bUL, 0xbf0d8e43UL, 0x3c93a1a5UL, 0x48dd7274UL, 0x3fff3ac9UL, + 0x3ed837deUL, 0xbc795a5aUL, 0x5b6e4540UL, 0x3fff5076UL, 0x2dd8a18bUL, + 0x3c99d3e1UL, 0x798844f8UL, 0x3fff6632UL, 0x3539343eUL, 0x3c9fa37bUL, + 0xad9cbe14UL, 0x3fff7bfdUL, 0xd006350aUL, 0xbc9dbb12UL, 0x02243c89UL, + 0x3fff91d8UL, 0xa779f689UL, 0xbc612ea8UL, 0x819e90d8UL, 0x3fffa7c1UL, + 0xf3a5931eUL, 0x3c874853UL, 0x3692d514UL, 0x3fffbdbaUL, 0x15098eb6UL, + 0xbc796773UL, 0x2b8f71f1UL, 0x3fffd3c2UL, 0x966579e7UL, 0x3c62eb74UL, + 0x6b2a23d9UL, 0x3fffe9d9UL, 0x7442fde3UL, 0x3c74a603UL +}; + +ALIGNED_(16) juint _e_coeff[] = +{ + 0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL, 0x6fba4e77UL, + 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL, 0xfefa39efUL, 0x3fe62e42UL, + 0x00000000UL, 0x00000000UL +}; + +ALIGNED_(16) juint _coeff_h[] = +{ + 0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL +}; + +ALIGNED_(16) juint _HIGHMASK_LOG_X[] = +{ + 0xf8000000UL, 0xffffffffUL, 0x00000000UL, 0xfffff800UL +}; + +ALIGNED_(8) juint _HALFMASK[] = +{ + 0xf8000000UL, 0xffffffffUL, 0xf8000000UL, 0xffffffffUL +}; + +ALIGNED_(16) juint _coeff_pow[] = +{ + 0x6dc96112UL, 0xbf836578UL, 0xee241472UL, 0xbf9b0301UL, 0x9f95985aUL, + 0xbfb528dbUL, 0xb3841d2aUL, 0xbfd619b6UL, 0x518775e3UL, 0x3f9004f2UL, + 0xac8349bbUL, 0x3fa76c9bUL, 0x486ececcUL, 0x3fc4635eUL, 0x161bb241UL, + 0xbf5dabe1UL, 0x9f95985aUL, 0xbfb528dbUL, 0xf8b5787dUL, 0x3ef2531eUL, + 0x486ececbUL, 0x3fc4635eUL, 0x412055ccUL, 0xbdd61bb2UL +}; + +ALIGNED_(16) juint _L_tbl_pow[] = +{ + 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x00000000UL, 0x20000000UL, + 0x3feff00aUL, 0x96621f95UL, 0x3e5b1856UL, 0xe0000000UL, 0x3fefe019UL, + 0xe5916f9eUL, 0xbe325278UL, 0x00000000UL, 0x3fefd02fUL, 0x859a1062UL, + 0x3e595fb7UL, 0xc0000000UL, 0x3fefc049UL, 0xb245f18fUL, 0xbe529c38UL, + 0xe0000000UL, 0x3fefb069UL, 0xad2880a7UL, 0xbe501230UL, 0x60000000UL, + 0x3fefa08fUL, 0xc8e72420UL, 0x3e597bd1UL, 0x80000000UL, 0x3fef90baUL, + 0xc30c4500UL, 0xbe5d6c75UL, 0xe0000000UL, 0x3fef80eaUL, 0x02c63f43UL, + 0x3e2e1318UL, 0xc0000000UL, 0x3fef7120UL, 0xb3d4ccccUL, 0xbe44c52aUL, + 0x00000000UL, 0x3fef615cUL, 0xdbd91397UL, 0xbe4e7d6cUL, 0xa0000000UL, + 0x3fef519cUL, 0x65c5cd68UL, 0xbe522dc8UL, 0xa0000000UL, 0x3fef41e2UL, + 0x46d1306cUL, 0xbe5a840eUL, 0xe0000000UL, 0x3fef322dUL, 0xd2980e94UL, + 0x3e5071afUL, 0xa0000000UL, 0x3fef227eUL, 0x773abadeUL, 0xbe5891e5UL, + 0xa0000000UL, 0x3fef12d4UL, 0xdc6bf46bUL, 0xbe5cccbeUL, 0xe0000000UL, + 0x3fef032fUL, 0xbc7247faUL, 0xbe2bab83UL, 0x80000000UL, 0x3feef390UL, + 0xbcaa1e46UL, 0xbe53bb3bUL, 0x60000000UL, 0x3feee3f6UL, 0x5f6c682dUL, + 0xbe54c619UL, 0x80000000UL, 0x3feed461UL, 0x5141e368UL, 0xbe4b6d86UL, + 0xe0000000UL, 0x3feec4d1UL, 0xec678f76UL, 0xbe369af6UL, 0x80000000UL, + 0x3feeb547UL, 0x41301f55UL, 0xbe2d4312UL, 0x60000000UL, 0x3feea5c2UL, + 0x676da6bdUL, 0xbe4d8dd0UL, 0x60000000UL, 0x3fee9642UL, 0x57a891c4UL, + 0x3e51f991UL, 0xa0000000UL, 0x3fee86c7UL, 0xe4eb491eUL, 0x3e579bf9UL, + 0x20000000UL, 0x3fee7752UL, 0xfddc4a2cUL, 0xbe3356e6UL, 0xc0000000UL, + 0x3fee67e1UL, 0xd75b5bf1UL, 0xbe449531UL, 0x80000000UL, 0x3fee5876UL, + 0xbd423b8eUL, 0x3df54fe4UL, 0x60000000UL, 0x3fee4910UL, 0x330e51b9UL, + 0x3e54289cUL, 0x80000000UL, 0x3fee39afUL, 0x8651a95fUL, 0xbe55aad6UL, + 0xa0000000UL, 0x3fee2a53UL, 0x5e98c708UL, 0xbe2fc4a9UL, 0xe0000000UL, + 0x3fee1afcUL, 0x0989328dUL, 0x3e23958cUL, 0x40000000UL, 0x3fee0babUL, + 0xee642abdUL, 0xbe425dd8UL, 0xa0000000UL, 0x3fedfc5eUL, 0xc394d236UL, + 0x3e526362UL, 0x20000000UL, 0x3feded17UL, 0xe104aa8eUL, 0x3e4ce247UL, + 0xc0000000UL, 0x3fedddd4UL, 0x265a9be4UL, 0xbe5bb77aUL, 0x40000000UL, + 0x3fedce97UL, 0x0ecac52fUL, 0x3e4a7cb1UL, 0xe0000000UL, 0x3fedbf5eUL, + 0x124cb3b8UL, 0x3e257024UL, 0x80000000UL, 0x3fedb02bUL, 0xe6d4febeUL, + 0xbe2033eeUL, 0x20000000UL, 0x3feda0fdUL, 0x39cca00eUL, 0xbe3ddabcUL, + 0xc0000000UL, 0x3fed91d3UL, 0xef8a552aUL, 0xbe543390UL, 0x40000000UL, + 0x3fed82afUL, 0xb8e85204UL, 0x3e513850UL, 0xe0000000UL, 0x3fed738fUL, + 0x3d59fe08UL, 0xbe5db728UL, 0x40000000UL, 0x3fed6475UL, 0x3aa7ead1UL, + 0x3e58804bUL, 0xc0000000UL, 0x3fed555fUL, 0xf8a35ba9UL, 0xbe5298b0UL, + 0x00000000UL, 0x3fed464fUL, 0x9a88dd15UL, 0x3e5a8cdbUL, 0x40000000UL, + 0x3fed3743UL, 0xb0b0a190UL, 0x3e598635UL, 0x80000000UL, 0x3fed283cUL, + 0xe2113295UL, 0xbe5c1119UL, 0x80000000UL, 0x3fed193aUL, 0xafbf1728UL, + 0xbe492e9cUL, 0x60000000UL, 0x3fed0a3dUL, 0xe4a4ccf3UL, 0x3e19b90eUL, + 0x20000000UL, 0x3fecfb45UL, 0xba3cbeb8UL, 0x3e406b50UL, 0xc0000000UL, + 0x3fecec51UL, 0x110f7dddUL, 0x3e0d6806UL, 0x40000000UL, 0x3fecdd63UL, + 0x7dd7d508UL, 0xbe5a8943UL, 0x80000000UL, 0x3fecce79UL, 0x9b60f271UL, + 0xbe50676aUL, 0x80000000UL, 0x3fecbf94UL, 0x0b9ad660UL, 0x3e59174fUL, + 0x60000000UL, 0x3fecb0b4UL, 0x00823d9cUL, 0x3e5bbf72UL, 0x20000000UL, + 0x3feca1d9UL, 0x38a6ec89UL, 0xbe4d38f9UL, 0x80000000UL, 0x3fec9302UL, + 0x3a0b7d8eUL, 0x3e53dbfdUL, 0xc0000000UL, 0x3fec8430UL, 0xc6826b34UL, + 0xbe27c5c9UL, 0xc0000000UL, 0x3fec7563UL, 0x0c706381UL, 0xbe593653UL, + 0x60000000UL, 0x3fec669bUL, 0x7df34ec7UL, 0x3e461ab5UL, 0xe0000000UL, + 0x3fec57d7UL, 0x40e5e7e8UL, 0xbe5c3daeUL, 0x00000000UL, 0x3fec4919UL, + 0x5602770fUL, 0xbe55219dUL, 0xc0000000UL, 0x3fec3a5eUL, 0xec7911ebUL, + 0x3e5a5d25UL, 0x60000000UL, 0x3fec2ba9UL, 0xb39ea225UL, 0xbe53c00bUL, + 0x80000000UL, 0x3fec1cf8UL, 0x967a212eUL, 0x3e5a8ddfUL, 0x60000000UL, + 0x3fec0e4cUL, 0x580798bdUL, 0x3e5f53abUL, 0x00000000UL, 0x3febffa5UL, + 0xb8282df6UL, 0xbe46b874UL, 0x20000000UL, 0x3febf102UL, 0xe33a6729UL, + 0x3e54963fUL, 0x00000000UL, 0x3febe264UL, 0x3b53e88aUL, 0xbe3adce1UL, + 0x60000000UL, 0x3febd3caUL, 0xc2585084UL, 0x3e5cde9fUL, 0x80000000UL, + 0x3febc535UL, 0xa335c5eeUL, 0xbe39fd9cUL, 0x20000000UL, 0x3febb6a5UL, + 0x7325b04dUL, 0x3e42ba15UL, 0x60000000UL, 0x3feba819UL, 0x1564540fUL, + 0x3e3a9f35UL, 0x40000000UL, 0x3feb9992UL, 0x83fff592UL, 0xbe5465ceUL, + 0xa0000000UL, 0x3feb8b0fUL, 0xb9da63d3UL, 0xbe4b1a0aUL, 0x80000000UL, + 0x3feb7c91UL, 0x6d6f1ea4UL, 0x3e557657UL, 0x00000000UL, 0x3feb6e18UL, + 0x5e80a1bfUL, 0x3e4ddbb6UL, 0x00000000UL, 0x3feb5fa3UL, 0x1c9eacb5UL, + 0x3e592877UL, 0xa0000000UL, 0x3feb5132UL, 0x6d40beb3UL, 0xbe51858cUL, + 0xa0000000UL, 0x3feb42c6UL, 0xd740c67bUL, 0x3e427ad2UL, 0x40000000UL, + 0x3feb345fUL, 0xa3e0cceeUL, 0xbe5c2fc4UL, 0x40000000UL, 0x3feb25fcUL, + 0x8e752b50UL, 0xbe3da3c2UL, 0xc0000000UL, 0x3feb179dUL, 0xa892e7deUL, + 0x3e1fb481UL, 0xc0000000UL, 0x3feb0943UL, 0x21ed71e9UL, 0xbe365206UL, + 0x20000000UL, 0x3feafaeeUL, 0x0e1380a3UL, 0x3e5c5b7bUL, 0x20000000UL, + 0x3feaec9dUL, 0x3c3d640eUL, 0xbe5dbbd0UL, 0x60000000UL, 0x3feade50UL, + 0x8f97a715UL, 0x3e3a8ec5UL, 0x20000000UL, 0x3fead008UL, 0x23ab2839UL, + 0x3e2fe98aUL, 0x40000000UL, 0x3feac1c4UL, 0xf4bbd50fUL, 0x3e54d8f6UL, + 0xe0000000UL, 0x3feab384UL, 0x14757c4dUL, 0xbe48774cUL, 0xc0000000UL, + 0x3feaa549UL, 0x7c7b0eeaUL, 0x3e5b51bbUL, 0x20000000UL, 0x3fea9713UL, + 0xf56f7013UL, 0x3e386200UL, 0xe0000000UL, 0x3fea88e0UL, 0xbe428ebeUL, + 0xbe514af5UL, 0xe0000000UL, 0x3fea7ab2UL, 0x8d0e4496UL, 0x3e4f9165UL, + 0x60000000UL, 0x3fea6c89UL, 0xdbacc5d5UL, 0xbe5c063bUL, 0x20000000UL, + 0x3fea5e64UL, 0x3f19d970UL, 0xbe5a0c8cUL, 0x20000000UL, 0x3fea5043UL, + 0x09ea3e6bUL, 0x3e5065dcUL, 0x80000000UL, 0x3fea4226UL, 0x78df246cUL, + 0x3e5e05f6UL, 0x40000000UL, 0x3fea340eUL, 0x4057d4a0UL, 0x3e431b2bUL, + 0x40000000UL, 0x3fea25faUL, 0x82867bb5UL, 0x3e4b76beUL, 0xa0000000UL, + 0x3fea17eaUL, 0x9436f40aUL, 0xbe5aad39UL, 0x20000000UL, 0x3fea09dfUL, + 0x4b5253b3UL, 0x3e46380bUL, 0x00000000UL, 0x3fe9fbd8UL, 0x8fc52466UL, + 0xbe386f9bUL, 0x20000000UL, 0x3fe9edd5UL, 0x22d3f344UL, 0xbe538347UL, + 0x60000000UL, 0x3fe9dfd6UL, 0x1ac33522UL, 0x3e5dbc53UL, 0x00000000UL, + 0x3fe9d1dcUL, 0xeabdff1dUL, 0x3e40fc0cUL, 0xe0000000UL, 0x3fe9c3e5UL, + 0xafd30e73UL, 0xbe585e63UL, 0xe0000000UL, 0x3fe9b5f3UL, 0xa52f226aUL, + 0xbe43e8f9UL, 0x20000000UL, 0x3fe9a806UL, 0xecb8698dUL, 0xbe515b36UL, + 0x80000000UL, 0x3fe99a1cUL, 0xf2b4e89dUL, 0x3e48b62bUL, 0x20000000UL, + 0x3fe98c37UL, 0x7c9a88fbUL, 0x3e44414cUL, 0x00000000UL, 0x3fe97e56UL, + 0xda015741UL, 0xbe5d13baUL, 0xe0000000UL, 0x3fe97078UL, 0x5fdace06UL, + 0x3e51b947UL, 0x00000000UL, 0x3fe962a0UL, 0x956ca094UL, 0x3e518785UL, + 0x40000000UL, 0x3fe954cbUL, 0x01164c1dUL, 0x3e5d5b57UL, 0xc0000000UL, + 0x3fe946faUL, 0xe63b3767UL, 0xbe4f84e7UL, 0x40000000UL, 0x3fe9392eUL, + 0xe57cc2a9UL, 0x3e34eda3UL, 0xe0000000UL, 0x3fe92b65UL, 0x8c75b544UL, + 0x3e5766a0UL, 0xc0000000UL, 0x3fe91da1UL, 0x37d1d087UL, 0xbe5e2ab1UL, + 0x80000000UL, 0x3fe90fe1UL, 0xa953dc20UL, 0x3e5fa1f3UL, 0x80000000UL, + 0x3fe90225UL, 0xdbd3f369UL, 0x3e47d6dbUL, 0xa0000000UL, 0x3fe8f46dUL, + 0x1c9be989UL, 0xbe5e2b0aUL, 0xa0000000UL, 0x3fe8e6b9UL, 0x3c93d76aUL, + 0x3e5c8618UL, 0xe0000000UL, 0x3fe8d909UL, 0x2182fc9aUL, 0xbe41aa9eUL, + 0x20000000UL, 0x3fe8cb5eUL, 0xe6b3539dUL, 0xbe530d19UL, 0x60000000UL, + 0x3fe8bdb6UL, 0x49e58cc3UL, 0xbe3bb374UL, 0xa0000000UL, 0x3fe8b012UL, + 0xa7cfeb8fUL, 0x3e56c412UL, 0x00000000UL, 0x3fe8a273UL, 0x8d52bc19UL, + 0x3e1429b8UL, 0x60000000UL, 0x3fe894d7UL, 0x4dc32c6cUL, 0xbe48604cUL, + 0xc0000000UL, 0x3fe8873fUL, 0x0c868e56UL, 0xbe564ee5UL, 0x00000000UL, + 0x3fe879acUL, 0x56aee828UL, 0x3e5e2fd8UL, 0x60000000UL, 0x3fe86c1cUL, + 0x7ceab8ecUL, 0x3e493365UL, 0xc0000000UL, 0x3fe85e90UL, 0x78d4dadcUL, + 0xbe4f7f25UL, 0x00000000UL, 0x3fe85109UL, 0x0ccd8280UL, 0x3e31e7a2UL, + 0x40000000UL, 0x3fe84385UL, 0x34ba4e15UL, 0x3e328077UL, 0x80000000UL, + 0x3fe83605UL, 0xa670975aUL, 0xbe53eee5UL, 0xa0000000UL, 0x3fe82889UL, + 0xf61b77b2UL, 0xbe43a20aUL, 0xa0000000UL, 0x3fe81b11UL, 0x13e6643bUL, + 0x3e5e5fe5UL, 0xc0000000UL, 0x3fe80d9dUL, 0x82cc94e8UL, 0xbe5ff1f9UL, + 0xa0000000UL, 0x3fe8002dUL, 0x8a0c9c5dUL, 0xbe42b0e7UL, 0x60000000UL, + 0x3fe7f2c1UL, 0x22a16f01UL, 0x3e5d9ea0UL, 0x20000000UL, 0x3fe7e559UL, + 0xc38cd451UL, 0x3e506963UL, 0xc0000000UL, 0x3fe7d7f4UL, 0x9902bc71UL, + 0x3e4503d7UL, 0x40000000UL, 0x3fe7ca94UL, 0xdef2a3c0UL, 0x3e3d98edUL, + 0xa0000000UL, 0x3fe7bd37UL, 0xed49abb0UL, 0x3e24c1ffUL, 0xe0000000UL, + 0x3fe7afdeUL, 0xe3b0be70UL, 0xbe40c467UL, 0x00000000UL, 0x3fe7a28aUL, + 0xaf9f193cUL, 0xbe5dff6cUL, 0xe0000000UL, 0x3fe79538UL, 0xb74cf6b6UL, + 0xbe258ed0UL, 0xa0000000UL, 0x3fe787ebUL, 0x1d9127c7UL, 0x3e345fb0UL, + 0x40000000UL, 0x3fe77aa2UL, 0x1028c21dUL, 0xbe4619bdUL, 0xa0000000UL, + 0x3fe76d5cUL, 0x7cb0b5e4UL, 0x3e40f1a2UL, 0xe0000000UL, 0x3fe7601aUL, + 0x2b1bc4adUL, 0xbe32e8bbUL, 0xe0000000UL, 0x3fe752dcUL, 0x6839f64eUL, + 0x3e41f57bUL, 0xc0000000UL, 0x3fe745a2UL, 0xc4121f7eUL, 0xbe52c40aUL, + 0x60000000UL, 0x3fe7386cUL, 0xd6852d72UL, 0xbe5c4e6bUL, 0xc0000000UL, + 0x3fe72b39UL, 0x91d690f7UL, 0xbe57f88fUL, 0xe0000000UL, 0x3fe71e0aUL, + 0x627a2159UL, 0xbe4425d5UL, 0xc0000000UL, 0x3fe710dfUL, 0x50a54033UL, + 0x3e422b7eUL, 0x60000000UL, 0x3fe703b8UL, 0x3b0b5f91UL, 0x3e5d3857UL, + 0xe0000000UL, 0x3fe6f694UL, 0x84d628a2UL, 0xbe51f090UL, 0x00000000UL, + 0x3fe6e975UL, 0x306d8894UL, 0xbe414d83UL, 0xe0000000UL, 0x3fe6dc58UL, + 0x30bf24aaUL, 0xbe4650caUL, 0x80000000UL, 0x3fe6cf40UL, 0xd4628d69UL, + 0xbe5db007UL, 0xc0000000UL, 0x3fe6c22bUL, 0xa2aae57bUL, 0xbe31d279UL, + 0xc0000000UL, 0x3fe6b51aUL, 0x860edf7eUL, 0xbe2d4c4aUL, 0x80000000UL, + 0x3fe6a80dUL, 0xf3559341UL, 0xbe5f7e98UL, 0xe0000000UL, 0x3fe69b03UL, + 0xa885899eUL, 0xbe5c2011UL, 0xe0000000UL, 0x3fe68dfdUL, 0x2bdc6d37UL, + 0x3e224a82UL, 0xa0000000UL, 0x3fe680fbUL, 0xc12ad1b9UL, 0xbe40cf56UL, + 0x00000000UL, 0x3fe673fdUL, 0x1bcdf659UL, 0xbdf52f2dUL, 0x00000000UL, + 0x3fe66702UL, 0x5df10408UL, 0x3e5663e0UL, 0xc0000000UL, 0x3fe65a0aUL, + 0xa4070568UL, 0xbe40b12fUL, 0x00000000UL, 0x3fe64d17UL, 0x71c54c47UL, + 0x3e5f5e8bUL, 0x00000000UL, 0x3fe64027UL, 0xbd4b7e83UL, 0x3e42ead6UL, + 0xa0000000UL, 0x3fe6333aUL, 0x61598bd2UL, 0xbe4c48d4UL, 0xc0000000UL, + 0x3fe62651UL, 0x6f538d61UL, 0x3e548401UL, 0xa0000000UL, 0x3fe6196cUL, + 0x14344120UL, 0xbe529af6UL, 0x00000000UL, 0x3fe60c8bUL, 0x5982c587UL, + 0xbe3e1e4fUL, 0x00000000UL, 0x3fe5ffadUL, 0xfe51d4eaUL, 0xbe4c897aUL, + 0x80000000UL, 0x3fe5f2d2UL, 0xfd46ebe1UL, 0x3e552e00UL, 0xa0000000UL, + 0x3fe5e5fbUL, 0xa4695699UL, 0x3e5ed471UL, 0x60000000UL, 0x3fe5d928UL, + 0x80d118aeUL, 0x3e456b61UL, 0xa0000000UL, 0x3fe5cc58UL, 0x304c330bUL, + 0x3e54dc29UL, 0x80000000UL, 0x3fe5bf8cUL, 0x0af2dedfUL, 0xbe3aa9bdUL, + 0xe0000000UL, 0x3fe5b2c3UL, 0x15fc9258UL, 0xbe479a37UL, 0xc0000000UL, + 0x3fe5a5feUL, 0x9292c7eaUL, 0x3e188650UL, 0x20000000UL, 0x3fe5993dUL, + 0x33b4d380UL, 0x3e5d6d93UL, 0x20000000UL, 0x3fe58c7fUL, 0x02fd16c7UL, + 0x3e2fe961UL, 0xa0000000UL, 0x3fe57fc4UL, 0x4a05edb6UL, 0xbe4d55b4UL, + 0xa0000000UL, 0x3fe5730dUL, 0x3d443abbUL, 0xbe5e6954UL, 0x00000000UL, + 0x3fe5665aUL, 0x024acfeaUL, 0x3e50e61bUL, 0x00000000UL, 0x3fe559aaUL, + 0xcc9edd09UL, 0xbe325403UL, 0x60000000UL, 0x3fe54cfdUL, 0x1fe26950UL, + 0x3e5d500eUL, 0x60000000UL, 0x3fe54054UL, 0x6c5ae164UL, 0xbe4a79b4UL, + 0xc0000000UL, 0x3fe533aeUL, 0x154b0287UL, 0xbe401571UL, 0xa0000000UL, + 0x3fe5270cUL, 0x0673f401UL, 0xbe56e56bUL, 0xe0000000UL, 0x3fe51a6dUL, + 0x751b639cUL, 0x3e235269UL, 0xa0000000UL, 0x3fe50dd2UL, 0x7c7b2bedUL, + 0x3ddec887UL, 0xc0000000UL, 0x3fe5013aUL, 0xafab4e17UL, 0x3e5e7575UL, + 0x60000000UL, 0x3fe4f4a6UL, 0x2e308668UL, 0x3e59aed6UL, 0x80000000UL, + 0x3fe4e815UL, 0xf33e2a76UL, 0xbe51f184UL, 0xe0000000UL, 0x3fe4db87UL, + 0x839f3e3eUL, 0x3e57db01UL, 0xc0000000UL, 0x3fe4cefdUL, 0xa9eda7bbUL, + 0x3e535e0fUL, 0x00000000UL, 0x3fe4c277UL, 0x2a8f66a5UL, 0x3e5ce451UL, + 0xc0000000UL, 0x3fe4b5f3UL, 0x05192456UL, 0xbe4e8518UL, 0xc0000000UL, + 0x3fe4a973UL, 0x4aa7cd1dUL, 0x3e46784aUL, 0x40000000UL, 0x3fe49cf7UL, + 0x8e23025eUL, 0xbe5749f2UL, 0x00000000UL, 0x3fe4907eUL, 0x18d30215UL, + 0x3e360f39UL, 0x20000000UL, 0x3fe48408UL, 0x63dcf2f3UL, 0x3e5e00feUL, + 0xc0000000UL, 0x3fe47795UL, 0x46182d09UL, 0xbe5173d9UL, 0xa0000000UL, + 0x3fe46b26UL, 0x8f0e62aaUL, 0xbe48f281UL, 0xe0000000UL, 0x3fe45ebaUL, + 0x5775c40cUL, 0xbe56aad4UL, 0x60000000UL, 0x3fe45252UL, 0x0fe25f69UL, + 0x3e48bd71UL, 0x40000000UL, 0x3fe445edUL, 0xe9989ec5UL, 0x3e590d97UL, + 0x80000000UL, 0x3fe4398bUL, 0xb3d9ffe3UL, 0x3e479dbcUL, 0x20000000UL, + 0x3fe42d2dUL, 0x388e4d2eUL, 0xbe5eed80UL, 0xe0000000UL, 0x3fe420d1UL, + 0x6f797c18UL, 0x3e554b4cUL, 0x20000000UL, 0x3fe4147aUL, 0x31048bb4UL, + 0xbe5b1112UL, 0x80000000UL, 0x3fe40825UL, 0x2efba4f9UL, 0x3e48ebc7UL, + 0x40000000UL, 0x3fe3fbd4UL, 0x50201119UL, 0x3e40b701UL, 0x40000000UL, + 0x3fe3ef86UL, 0x0a4db32cUL, 0x3e551de8UL, 0xa0000000UL, 0x3fe3e33bUL, + 0x0c9c148bUL, 0xbe50c1f6UL, 0x20000000UL, 0x3fe3d6f4UL, 0xc9129447UL, + 0x3e533fa0UL, 0x00000000UL, 0x3fe3cab0UL, 0xaae5b5a0UL, 0xbe22b68eUL, + 0x20000000UL, 0x3fe3be6fUL, 0x02305e8aUL, 0xbe54fc08UL, 0x60000000UL, + 0x3fe3b231UL, 0x7f908258UL, 0x3e57dc05UL, 0x00000000UL, 0x3fe3a5f7UL, + 0x1a09af78UL, 0x3e08038bUL, 0xe0000000UL, 0x3fe399bfUL, 0x490643c1UL, + 0xbe5dbe42UL, 0xe0000000UL, 0x3fe38d8bUL, 0x5e8ad724UL, 0xbe3c2b72UL, + 0x20000000UL, 0x3fe3815bUL, 0xc67196b6UL, 0x3e1713cfUL, 0xa0000000UL, + 0x3fe3752dUL, 0x6182e429UL, 0xbe3ec14cUL, 0x40000000UL, 0x3fe36903UL, + 0xab6eb1aeUL, 0x3e5a2cc5UL, 0x40000000UL, 0x3fe35cdcUL, 0xfe5dc064UL, + 0xbe5c5878UL, 0x40000000UL, 0x3fe350b8UL, 0x0ba6b9e4UL, 0x3e51619bUL, + 0x80000000UL, 0x3fe34497UL, 0x857761aaUL, 0x3e5fff53UL, 0x00000000UL, + 0x3fe3387aUL, 0xf872d68cUL, 0x3e484f4dUL, 0xa0000000UL, 0x3fe32c5fUL, + 0x087e97c2UL, 0x3e52842eUL, 0x80000000UL, 0x3fe32048UL, 0x73d6d0c0UL, + 0xbe503edfUL, 0x80000000UL, 0x3fe31434UL, 0x0c1456a1UL, 0xbe5f72adUL, + 0xa0000000UL, 0x3fe30823UL, 0x83a1a4d5UL, 0xbe5e65ccUL, 0xe0000000UL, + 0x3fe2fc15UL, 0x855a7390UL, 0xbe506438UL, 0x40000000UL, 0x3fe2f00bUL, + 0xa2898287UL, 0x3e3d22a2UL, 0xe0000000UL, 0x3fe2e403UL, 0x8b56f66fUL, + 0xbe5aa5fdUL, 0x80000000UL, 0x3fe2d7ffUL, 0x52db119aUL, 0x3e3a2e3dUL, + 0x60000000UL, 0x3fe2cbfeUL, 0xe2ddd4c0UL, 0xbe586469UL, 0x40000000UL, + 0x3fe2c000UL, 0x6b01bf10UL, 0x3e352b9dUL, 0x40000000UL, 0x3fe2b405UL, + 0xb07a1cdfUL, 0x3e5c5cdaUL, 0x80000000UL, 0x3fe2a80dUL, 0xc7b5f868UL, + 0xbe5668b3UL, 0xc0000000UL, 0x3fe29c18UL, 0x185edf62UL, 0xbe563d66UL, + 0x00000000UL, 0x3fe29027UL, 0xf729e1ccUL, 0x3e59a9a0UL, 0x80000000UL, + 0x3fe28438UL, 0x6433c727UL, 0xbe43cc89UL, 0x00000000UL, 0x3fe2784dUL, + 0x41782631UL, 0xbe30750cUL, 0xa0000000UL, 0x3fe26c64UL, 0x914911b7UL, + 0xbe58290eUL, 0x40000000UL, 0x3fe2607fUL, 0x3dcc73e1UL, 0xbe4269cdUL, + 0x00000000UL, 0x3fe2549dUL, 0x2751bf70UL, 0xbe5a6998UL, 0xc0000000UL, + 0x3fe248bdUL, 0x4248b9fbUL, 0xbe4ddb00UL, 0x80000000UL, 0x3fe23ce1UL, + 0xf35cf82fUL, 0x3e561b71UL, 0x60000000UL, 0x3fe23108UL, 0x8e481a2dUL, + 0x3e518fb9UL, 0x60000000UL, 0x3fe22532UL, 0x5ab96edcUL, 0xbe5fafc5UL, + 0x40000000UL, 0x3fe2195fUL, 0x80943911UL, 0xbe07f819UL, 0x40000000UL, + 0x3fe20d8fUL, 0x386f2d6cUL, 0xbe54ba8bUL, 0x40000000UL, 0x3fe201c2UL, + 0xf29664acUL, 0xbe5eb815UL, 0x20000000UL, 0x3fe1f5f8UL, 0x64f03390UL, + 0x3e5e320cUL, 0x20000000UL, 0x3fe1ea31UL, 0x747ff696UL, 0x3e5ef0a5UL, + 0x40000000UL, 0x3fe1de6dUL, 0x3e9ceb51UL, 0xbe5f8d27UL, 0x20000000UL, + 0x3fe1d2acUL, 0x4ae0b55eUL, 0x3e5faa21UL, 0x20000000UL, 0x3fe1c6eeUL, + 0x28569a5eUL, 0x3e598a4fUL, 0x20000000UL, 0x3fe1bb33UL, 0x54b33e07UL, + 0x3e46130aUL, 0x20000000UL, 0x3fe1af7bUL, 0x024f1078UL, 0xbe4dbf93UL, + 0x00000000UL, 0x3fe1a3c6UL, 0xb0783bfaUL, 0x3e419248UL, 0xe0000000UL, + 0x3fe19813UL, 0x2f02b836UL, 0x3e4e02b7UL, 0xc0000000UL, 0x3fe18c64UL, + 0x28dec9d4UL, 0x3e09064fUL, 0x80000000UL, 0x3fe180b8UL, 0x45cbf406UL, + 0x3e5b1f46UL, 0x40000000UL, 0x3fe1750fUL, 0x03d9964cUL, 0x3e5b0a79UL, + 0x00000000UL, 0x3fe16969UL, 0x8b5b882bUL, 0xbe238086UL, 0xa0000000UL, + 0x3fe15dc5UL, 0x73bad6f8UL, 0xbdf1fca4UL, 0x20000000UL, 0x3fe15225UL, + 0x5385769cUL, 0x3e5e8d76UL, 0xa0000000UL, 0x3fe14687UL, 0x1676dc6bUL, + 0x3e571d08UL, 0x20000000UL, 0x3fe13aedUL, 0xa8c41c7fUL, 0xbe598a25UL, + 0x60000000UL, 0x3fe12f55UL, 0xc4e1aaf0UL, 0x3e435277UL, 0xa0000000UL, + 0x3fe123c0UL, 0x403638e1UL, 0xbe21aa7cUL, 0xc0000000UL, 0x3fe1182eUL, + 0x557a092bUL, 0xbdd0116bUL, 0xc0000000UL, 0x3fe10c9fUL, 0x7d779f66UL, + 0x3e4a61baUL, 0xc0000000UL, 0x3fe10113UL, 0x2b09c645UL, 0xbe5d586eUL, + 0x20000000UL, 0x3fe0ea04UL, 0xea2cad46UL, 0x3e5aa97cUL, 0x20000000UL, + 0x3fe0d300UL, 0x23190e54UL, 0x3e50f1a7UL, 0xa0000000UL, 0x3fe0bc07UL, + 0x1379a5a6UL, 0xbe51619dUL, 0x60000000UL, 0x3fe0a51aUL, 0x926a3d4aUL, + 0x3e5cf019UL, 0xa0000000UL, 0x3fe08e38UL, 0xa8c24358UL, 0x3e35241eUL, + 0x20000000UL, 0x3fe07762UL, 0x24317e7aUL, 0x3e512cfaUL, 0x00000000UL, + 0x3fe06097UL, 0xfd9cf274UL, 0xbe55bef3UL, 0x00000000UL, 0x3fe049d7UL, + 0x3689b49dUL, 0xbe36d26dUL, 0x40000000UL, 0x3fe03322UL, 0xf72ef6c4UL, + 0xbe54cd08UL, 0xa0000000UL, 0x3fe01c78UL, 0x23702d2dUL, 0xbe5900bfUL, + 0x00000000UL, 0x3fe005daUL, 0x3f59c14cUL, 0x3e57d80bUL, 0x40000000UL, + 0x3fdfde8dUL, 0xad67766dUL, 0xbe57fad4UL, 0x40000000UL, 0x3fdfb17cUL, + 0x644f4ae7UL, 0x3e1ee43bUL, 0x40000000UL, 0x3fdf8481UL, 0x903234d2UL, + 0x3e501a86UL, 0x40000000UL, 0x3fdf579cUL, 0xafe9e509UL, 0xbe267c3eUL, + 0x00000000UL, 0x3fdf2acdUL, 0xb7dfda0bUL, 0xbe48149bUL, 0x40000000UL, + 0x3fdefe13UL, 0x3b94305eUL, 0x3e5f4ea7UL, 0x80000000UL, 0x3fded16fUL, + 0x5d95da61UL, 0xbe55c198UL, 0x00000000UL, 0x3fdea4e1UL, 0x406960c9UL, + 0xbdd99a19UL, 0x00000000UL, 0x3fde7868UL, 0xd22f3539UL, 0x3e470c78UL, + 0x80000000UL, 0x3fde4c04UL, 0x83eec535UL, 0xbe3e1232UL, 0x40000000UL, + 0x3fde1fb6UL, 0x3dfbffcbUL, 0xbe4b7d71UL, 0x40000000UL, 0x3fddf37dUL, + 0x7e1be4e0UL, 0xbe5b8f8fUL, 0x40000000UL, 0x3fddc759UL, 0x46dae887UL, + 0xbe350458UL, 0x80000000UL, 0x3fdd9b4aUL, 0xed6ecc49UL, 0xbe5f0045UL, + 0x80000000UL, 0x3fdd6f50UL, 0x2e9e883cUL, 0x3e2915daUL, 0x80000000UL, + 0x3fdd436bUL, 0xf0bccb32UL, 0x3e4a68c9UL, 0x80000000UL, 0x3fdd179bUL, + 0x9bbfc779UL, 0xbe54a26aUL, 0x00000000UL, 0x3fdcebe0UL, 0x7cea33abUL, + 0x3e43c6b7UL, 0x40000000UL, 0x3fdcc039UL, 0xe740fd06UL, 0x3e5526c2UL, + 0x40000000UL, 0x3fdc94a7UL, 0x9eadeb1aUL, 0xbe396d8dUL, 0xc0000000UL, + 0x3fdc6929UL, 0xf0a8f95aUL, 0xbe5c0ab2UL, 0x80000000UL, 0x3fdc3dc0UL, + 0x6ee2693bUL, 0x3e0992e6UL, 0xc0000000UL, 0x3fdc126bUL, 0x5ac6b581UL, + 0xbe2834b6UL, 0x40000000UL, 0x3fdbe72bUL, 0x8cc226ffUL, 0x3e3596a6UL, + 0x00000000UL, 0x3fdbbbffUL, 0xf92a74bbUL, 0x3e3c5813UL, 0x00000000UL, + 0x3fdb90e7UL, 0x479664c0UL, 0xbe50d644UL, 0x00000000UL, 0x3fdb65e3UL, + 0x5004975bUL, 0xbe55258fUL, 0x00000000UL, 0x3fdb3af3UL, 0xe4b23194UL, + 0xbe588407UL, 0xc0000000UL, 0x3fdb1016UL, 0xe65d4d0aUL, 0x3e527c26UL, + 0x80000000UL, 0x3fdae54eUL, 0x814fddd6UL, 0x3e5962a2UL, 0x40000000UL, + 0x3fdaba9aUL, 0xe19d0913UL, 0xbe562f4eUL, 0x80000000UL, 0x3fda8ff9UL, + 0x43cfd006UL, 0xbe4cfdebUL, 0x40000000UL, 0x3fda656cUL, 0x686f0a4eUL, + 0x3e5e47a8UL, 0xc0000000UL, 0x3fda3af2UL, 0x7200d410UL, 0x3e5e1199UL, + 0xc0000000UL, 0x3fda108cUL, 0xabd2266eUL, 0x3e5ee4d1UL, 0x40000000UL, + 0x3fd9e63aUL, 0x396f8f2cUL, 0x3e4dbffbUL, 0x00000000UL, 0x3fd9bbfbUL, + 0xe32b25ddUL, 0x3e5c3a54UL, 0x40000000UL, 0x3fd991cfUL, 0x431e4035UL, + 0xbe457925UL, 0x80000000UL, 0x3fd967b6UL, 0x7bed3dd3UL, 0x3e40c61dUL, + 0x00000000UL, 0x3fd93db1UL, 0xd7449365UL, 0x3e306419UL, 0x80000000UL, + 0x3fd913beUL, 0x1746e791UL, 0x3e56fcfcUL, 0x40000000UL, 0x3fd8e9dfUL, + 0xf3a9028bUL, 0xbe5041b9UL, 0xc0000000UL, 0x3fd8c012UL, 0x56840c50UL, + 0xbe26e20aUL, 0x40000000UL, 0x3fd89659UL, 0x19763102UL, 0xbe51f466UL, + 0x80000000UL, 0x3fd86cb2UL, 0x7032de7cUL, 0xbe4d298aUL, 0x80000000UL, + 0x3fd8431eUL, 0xdeb39fabUL, 0xbe4361ebUL, 0x40000000UL, 0x3fd8199dUL, + 0x5d01cbe0UL, 0xbe5425b3UL, 0x80000000UL, 0x3fd7f02eUL, 0x3ce99aa9UL, + 0x3e146fa8UL, 0x80000000UL, 0x3fd7c6d2UL, 0xd1a262b9UL, 0xbe5a1a69UL, + 0xc0000000UL, 0x3fd79d88UL, 0x8606c236UL, 0x3e423a08UL, 0x80000000UL, + 0x3fd77451UL, 0x8fd1e1b7UL, 0x3e5a6a63UL, 0xc0000000UL, 0x3fd74b2cUL, + 0xe491456aUL, 0x3e42c1caUL, 0x40000000UL, 0x3fd7221aUL, 0x4499a6d7UL, + 0x3e36a69aUL, 0x00000000UL, 0x3fd6f91aUL, 0x5237df94UL, 0xbe0f8f02UL, + 0x00000000UL, 0x3fd6d02cUL, 0xb6482c6eUL, 0xbe5abcf7UL, 0x00000000UL, + 0x3fd6a750UL, 0x1919fd61UL, 0xbe57ade2UL, 0x00000000UL, 0x3fd67e86UL, + 0xaa7a994dUL, 0xbe3f3fbdUL, 0x00000000UL, 0x3fd655ceUL, 0x67db014cUL, + 0x3e33c550UL, 0x00000000UL, 0x3fd62d28UL, 0xa82856b7UL, 0xbe1409d1UL, + 0xc0000000UL, 0x3fd60493UL, 0x1e6a300dUL, 0x3e55d899UL, 0x80000000UL, + 0x3fd5dc11UL, 0x1222bd5cUL, 0xbe35bfc0UL, 0xc0000000UL, 0x3fd5b3a0UL, + 0x6e8dc2d3UL, 0x3e5d4d79UL, 0x00000000UL, 0x3fd58b42UL, 0xe0e4ace6UL, + 0xbe517303UL, 0x80000000UL, 0x3fd562f4UL, 0xb306e0a8UL, 0x3e5edf0fUL, + 0xc0000000UL, 0x3fd53ab8UL, 0x6574bc54UL, 0x3e5ee859UL, 0x80000000UL, + 0x3fd5128eUL, 0xea902207UL, 0x3e5f6188UL, 0xc0000000UL, 0x3fd4ea75UL, + 0x9f911d79UL, 0x3e511735UL, 0x80000000UL, 0x3fd4c26eUL, 0xf9c77397UL, + 0xbe5b1643UL, 0x40000000UL, 0x3fd49a78UL, 0x15fc9258UL, 0x3e479a37UL, + 0x80000000UL, 0x3fd47293UL, 0xd5a04dd9UL, 0xbe426e56UL, 0xc0000000UL, + 0x3fd44abfUL, 0xe04042f5UL, 0x3e56f7c6UL, 0x40000000UL, 0x3fd422fdUL, + 0x1d8bf2c8UL, 0x3e5d8810UL, 0x00000000UL, 0x3fd3fb4cUL, 0x88a8ddeeUL, + 0xbe311454UL, 0xc0000000UL, 0x3fd3d3abUL, 0x3e3b5e47UL, 0xbe5d1b72UL, + 0x40000000UL, 0x3fd3ac1cUL, 0xc2ab5d59UL, 0x3e31b02bUL, 0xc0000000UL, + 0x3fd3849dUL, 0xd4e34b9eUL, 0x3e51cb2fUL, 0x40000000UL, 0x3fd35d30UL, + 0x177204fbUL, 0xbe2b8cd7UL, 0x80000000UL, 0x3fd335d3UL, 0xfcd38c82UL, + 0xbe4356e1UL, 0x80000000UL, 0x3fd30e87UL, 0x64f54accUL, 0xbe4e6224UL, + 0x00000000UL, 0x3fd2e74cUL, 0xaa7975d9UL, 0x3e5dc0feUL, 0x80000000UL, + 0x3fd2c021UL, 0x516dab3fUL, 0xbe50ffa3UL, 0x40000000UL, 0x3fd29907UL, + 0x2bfb7313UL, 0x3e5674a2UL, 0xc0000000UL, 0x3fd271fdUL, 0x0549fc99UL, + 0x3e385d29UL, 0xc0000000UL, 0x3fd24b04UL, 0x55b63073UL, 0xbe500c6dUL, + 0x00000000UL, 0x3fd2241cUL, 0x3f91953aUL, 0x3e389977UL, 0xc0000000UL, + 0x3fd1fd43UL, 0xa1543f71UL, 0xbe3487abUL, 0xc0000000UL, 0x3fd1d67bUL, + 0x4ec8867cUL, 0x3df6a2dcUL, 0x00000000UL, 0x3fd1afc4UL, 0x4328e3bbUL, + 0x3e41d9c0UL, 0x80000000UL, 0x3fd1891cUL, 0x2e1cda84UL, 0x3e3bdd87UL, + 0x40000000UL, 0x3fd16285UL, 0x4b5331aeUL, 0xbe53128eUL, 0x00000000UL, + 0x3fd13bfeUL, 0xb9aec164UL, 0xbe52ac98UL, 0xc0000000UL, 0x3fd11586UL, + 0xd91e1316UL, 0xbe350630UL, 0x80000000UL, 0x3fd0ef1fUL, 0x7cacc12cUL, + 0x3e3f5219UL, 0x40000000UL, 0x3fd0c8c8UL, 0xbce277b7UL, 0x3e3d30c0UL, + 0x00000000UL, 0x3fd0a281UL, 0x2a63447dUL, 0xbe541377UL, 0x80000000UL, + 0x3fd07c49UL, 0xfac483b5UL, 0xbe5772ecUL, 0xc0000000UL, 0x3fd05621UL, + 0x36b8a570UL, 0xbe4fd4bdUL, 0xc0000000UL, 0x3fd03009UL, 0xbae505f7UL, + 0xbe450388UL, 0x80000000UL, 0x3fd00a01UL, 0x3e35aeadUL, 0xbe5430fcUL, + 0x80000000UL, 0x3fcfc811UL, 0x707475acUL, 0x3e38806eUL, 0x80000000UL, + 0x3fcf7c3fUL, 0xc91817fcUL, 0xbe40cceaUL, 0x80000000UL, 0x3fcf308cUL, + 0xae05d5e9UL, 0xbe4919b8UL, 0x80000000UL, 0x3fcee4f8UL, 0xae6cc9e6UL, + 0xbe530b94UL, 0x00000000UL, 0x3fce9983UL, 0x1efe3e8eUL, 0x3e57747eUL, + 0x00000000UL, 0x3fce4e2dUL, 0xda78d9bfUL, 0xbe59a608UL, 0x00000000UL, + 0x3fce02f5UL, 0x8abe2c2eUL, 0x3e4a35adUL, 0x00000000UL, 0x3fcdb7dcUL, + 0x1495450dUL, 0xbe0872ccUL, 0x80000000UL, 0x3fcd6ce1UL, 0x86ee0ba0UL, + 0xbe4f59a0UL, 0x00000000UL, 0x3fcd2205UL, 0xe81ca888UL, 0x3e5402c3UL, + 0x00000000UL, 0x3fccd747UL, 0x3b4424b9UL, 0x3e5dfdc3UL, 0x80000000UL, + 0x3fcc8ca7UL, 0xd305b56cUL, 0x3e202da6UL, 0x00000000UL, 0x3fcc4226UL, + 0x399a6910UL, 0xbe482a1cUL, 0x80000000UL, 0x3fcbf7c2UL, 0x747f7938UL, + 0xbe587372UL, 0x80000000UL, 0x3fcbad7cUL, 0x6fc246a0UL, 0x3e50d83dUL, + 0x00000000UL, 0x3fcb6355UL, 0xee9e9be5UL, 0xbe5c35bdUL, 0x80000000UL, + 0x3fcb194aUL, 0x8416c0bcUL, 0x3e546d4fUL, 0x00000000UL, 0x3fcacf5eUL, + 0x49f7f08fUL, 0x3e56da76UL, 0x00000000UL, 0x3fca858fUL, 0x5dc30de2UL, + 0x3e5f390cUL, 0x00000000UL, 0x3fca3bdeUL, 0x950583b6UL, 0xbe5e4169UL, + 0x80000000UL, 0x3fc9f249UL, 0x33631553UL, 0x3e52aeb1UL, 0x00000000UL, + 0x3fc9a8d3UL, 0xde8795a6UL, 0xbe59a504UL, 0x00000000UL, 0x3fc95f79UL, + 0x076bf41eUL, 0x3e5122feUL, 0x80000000UL, 0x3fc9163cUL, 0x2914c8e7UL, + 0x3e3dd064UL, 0x00000000UL, 0x3fc8cd1dUL, 0x3a30eca3UL, 0xbe21b4aaUL, + 0x80000000UL, 0x3fc8841aUL, 0xb2a96650UL, 0xbe575444UL, 0x80000000UL, + 0x3fc83b34UL, 0x2376c0cbUL, 0xbe2a74c7UL, 0x80000000UL, 0x3fc7f26bUL, + 0xd8a0b653UL, 0xbe5181b6UL, 0x00000000UL, 0x3fc7a9bfUL, 0x32257882UL, + 0xbe4a78b4UL, 0x00000000UL, 0x3fc7612fUL, 0x1eee8bd9UL, 0xbe1bfe9dUL, + 0x80000000UL, 0x3fc718bbUL, 0x0c603cc4UL, 0x3e36fdc9UL, 0x80000000UL, + 0x3fc6d064UL, 0x3728b8cfUL, 0xbe1e542eUL, 0x80000000UL, 0x3fc68829UL, + 0xc79a4067UL, 0x3e5c380fUL, 0x00000000UL, 0x3fc6400bUL, 0xf69eac69UL, + 0x3e550a84UL, 0x80000000UL, 0x3fc5f808UL, 0xb7a780a4UL, 0x3e5d9224UL, + 0x80000000UL, 0x3fc5b022UL, 0xad9dfb1eUL, 0xbe55242fUL, 0x00000000UL, + 0x3fc56858UL, 0x659b18beUL, 0xbe4bfda3UL, 0x80000000UL, 0x3fc520a9UL, + 0x66ee3631UL, 0xbe57d769UL, 0x80000000UL, 0x3fc4d916UL, 0x1ec62819UL, + 0x3e2427f7UL, 0x80000000UL, 0x3fc4919fUL, 0xdec25369UL, 0xbe435431UL, + 0x00000000UL, 0x3fc44a44UL, 0xa8acfc4bUL, 0xbe3c62e8UL, 0x00000000UL, + 0x3fc40304UL, 0xcf1d3eabUL, 0xbdfba29fUL, 0x80000000UL, 0x3fc3bbdfUL, + 0x79aba3eaUL, 0xbdf1b7c8UL, 0x80000000UL, 0x3fc374d6UL, 0xb8d186daUL, + 0xbe5130cfUL, 0x80000000UL, 0x3fc32de8UL, 0x9d74f152UL, 0x3e2285b6UL, + 0x00000000UL, 0x3fc2e716UL, 0x50ae7ca9UL, 0xbe503920UL, 0x80000000UL, + 0x3fc2a05eUL, 0x6caed92eUL, 0xbe533924UL, 0x00000000UL, 0x3fc259c2UL, + 0x9cb5034eUL, 0xbe510e31UL, 0x80000000UL, 0x3fc21340UL, 0x12c4d378UL, + 0xbe540b43UL, 0x80000000UL, 0x3fc1ccd9UL, 0xcc418706UL, 0x3e59887aUL, + 0x00000000UL, 0x3fc1868eUL, 0x921f4106UL, 0xbe528e67UL, 0x80000000UL, + 0x3fc1405cUL, 0x3969441eUL, 0x3e5d8051UL, 0x00000000UL, 0x3fc0fa46UL, + 0xd941ef5bUL, 0x3e5f9079UL, 0x80000000UL, 0x3fc0b44aUL, 0x5a3e81b2UL, + 0xbe567691UL, 0x00000000UL, 0x3fc06e69UL, 0x9d66afe7UL, 0xbe4d43fbUL, + 0x00000000UL, 0x3fc028a2UL, 0x0a92a162UL, 0xbe52f394UL, 0x00000000UL, + 0x3fbfc5eaUL, 0x209897e5UL, 0x3e529e37UL, 0x00000000UL, 0x3fbf3ac5UL, + 0x8458bd7bUL, 0x3e582831UL, 0x00000000UL, 0x3fbeafd5UL, 0xb8d8b4b8UL, + 0xbe486b4aUL, 0x00000000UL, 0x3fbe2518UL, 0xe0a3b7b6UL, 0x3e5bafd2UL, + 0x00000000UL, 0x3fbd9a90UL, 0x2bf2710eUL, 0x3e383b2bUL, 0x00000000UL, + 0x3fbd103cUL, 0x73eb6ab7UL, 0xbe56d78dUL, 0x00000000UL, 0x3fbc861bUL, + 0x32ceaff5UL, 0xbe32dc5aUL, 0x00000000UL, 0x3fbbfc2eUL, 0xbee04cb7UL, + 0xbe4a71a4UL, 0x00000000UL, 0x3fbb7274UL, 0x35ae9577UL, 0x3e38142fUL, + 0x00000000UL, 0x3fbae8eeUL, 0xcbaddab4UL, 0xbe5490f0UL, 0x00000000UL, + 0x3fba5f9aUL, 0x95ce1114UL, 0x3e597c71UL, 0x00000000UL, 0x3fb9d67aUL, + 0x6d7c0f78UL, 0x3e3abc2dUL, 0x00000000UL, 0x3fb94d8dUL, 0x2841a782UL, + 0xbe566cbcUL, 0x00000000UL, 0x3fb8c4d2UL, 0x6ed429c6UL, 0xbe3cfff9UL, + 0x00000000UL, 0x3fb83c4aUL, 0xe4a49fbbUL, 0xbe552964UL, 0x00000000UL, + 0x3fb7b3f4UL, 0x2193d81eUL, 0xbe42fa72UL, 0x00000000UL, 0x3fb72bd0UL, + 0xdd70c122UL, 0x3e527a8cUL, 0x00000000UL, 0x3fb6a3dfUL, 0x03108a54UL, + 0xbe450393UL, 0x00000000UL, 0x3fb61c1fUL, 0x30ff7954UL, 0x3e565840UL, + 0x00000000UL, 0x3fb59492UL, 0xdedd460cUL, 0xbe5422b5UL, 0x00000000UL, + 0x3fb50d36UL, 0x950f9f45UL, 0xbe5313f6UL, 0x00000000UL, 0x3fb4860bUL, + 0x582cdcb1UL, 0x3e506d39UL, 0x00000000UL, 0x3fb3ff12UL, 0x7216d3a6UL, + 0x3e4aa719UL, 0x00000000UL, 0x3fb3784aUL, 0x57a423fdUL, 0x3e5a9b9fUL, + 0x00000000UL, 0x3fb2f1b4UL, 0x7a138b41UL, 0xbe50b418UL, 0x00000000UL, + 0x3fb26b4eUL, 0x2fbfd7eaUL, 0x3e23a53eUL, 0x00000000UL, 0x3fb1e519UL, + 0x18913ccbUL, 0x3e465fc1UL, 0x00000000UL, 0x3fb15f15UL, 0x7ea24e21UL, + 0x3e042843UL, 0x00000000UL, 0x3fb0d941UL, 0x7c6d9c77UL, 0x3e59f61eUL, + 0x00000000UL, 0x3fb0539eUL, 0x114efd44UL, 0x3e4ccab7UL, 0x00000000UL, + 0x3faf9c56UL, 0x1777f657UL, 0x3e552f65UL, 0x00000000UL, 0x3fae91d2UL, + 0xc317b86aUL, 0xbe5a61e0UL, 0x00000000UL, 0x3fad87acUL, 0xb7664efbUL, + 0xbe41f64eUL, 0x00000000UL, 0x3fac7de6UL, 0x5d3d03a9UL, 0x3e0807a0UL, + 0x00000000UL, 0x3fab7480UL, 0x743c38ebUL, 0xbe3726e1UL, 0x00000000UL, + 0x3faa6b78UL, 0x06a253f1UL, 0x3e5ad636UL, 0x00000000UL, 0x3fa962d0UL, + 0xa35f541bUL, 0x3e5a187aUL, 0x00000000UL, 0x3fa85a88UL, 0x4b86e446UL, + 0xbe508150UL, 0x00000000UL, 0x3fa7529cUL, 0x2589cacfUL, 0x3e52938aUL, + 0x00000000UL, 0x3fa64b10UL, 0xaf6b11f2UL, 0xbe3454cdUL, 0x00000000UL, + 0x3fa543e2UL, 0x97506fefUL, 0xbe5fdec5UL, 0x00000000UL, 0x3fa43d10UL, + 0xe75f7dd9UL, 0xbe388dd3UL, 0x00000000UL, 0x3fa3369cUL, 0xa4139632UL, + 0xbdea5177UL, 0x00000000UL, 0x3fa23086UL, 0x352d6f1eUL, 0xbe565ad6UL, + 0x00000000UL, 0x3fa12accUL, 0x77449eb7UL, 0xbe50d5c7UL, 0x00000000UL, + 0x3fa0256eUL, 0x7478da78UL, 0x3e404724UL, 0x00000000UL, 0x3f9e40dcUL, + 0xf59cef7fUL, 0xbe539d0aUL, 0x00000000UL, 0x3f9c3790UL, 0x1511d43cUL, + 0x3e53c2c8UL, 0x00000000UL, 0x3f9a2f00UL, 0x9b8bff3cUL, 0xbe43b3e1UL, + 0x00000000UL, 0x3f982724UL, 0xad1e22a5UL, 0x3e46f0bdUL, 0x00000000UL, + 0x3f962000UL, 0x130d9356UL, 0x3e475ba0UL, 0x00000000UL, 0x3f941994UL, + 0x8f86f883UL, 0xbe513d0bUL, 0x00000000UL, 0x3f9213dcUL, 0x914d0dc8UL, + 0xbe534335UL, 0x00000000UL, 0x3f900ed8UL, 0x2d73e5e7UL, 0xbe22ba75UL, + 0x00000000UL, 0x3f8c1510UL, 0xc5b7d70eUL, 0x3e599c5dUL, 0x00000000UL, + 0x3f880de0UL, 0x8a27857eUL, 0xbe3d28c8UL, 0x00000000UL, 0x3f840810UL, + 0xda767328UL, 0x3e531b3dUL, 0x00000000UL, 0x3f8003b0UL, 0x77bacaf3UL, + 0xbe5f04e3UL, 0x00000000UL, 0x3f780150UL, 0xdf4b0720UL, 0x3e5a8bffUL, + 0x00000000UL, 0x3f6ffc40UL, 0x34c48e71UL, 0xbe3fcd99UL, 0x00000000UL, + 0x3f5ff6c0UL, 0x1ad218afUL, 0xbe4c78a7UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x80000000UL +}; + +ALIGNED_(8) juint _log2_pow[] = +{ + 0xfefa39efUL, 0x3fe62e42UL, 0xfefa39efUL, 0xbfe62e42UL +}; + +//registers, +// input: xmm0, xmm1 +// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 +// rax, rdx, rcx, r8, r11 + +// Code generated by Intel C compiler for LIBM library + +void MacroAssembler::fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp1, Register tmp2, Register tmp3, Register tmp4) { + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; + Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; + Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, L_2TAG_PACKET_14_0_2, L_2TAG_PACKET_15_0_2; + Label L_2TAG_PACKET_16_0_2, L_2TAG_PACKET_17_0_2, L_2TAG_PACKET_18_0_2, L_2TAG_PACKET_19_0_2; + Label L_2TAG_PACKET_20_0_2, L_2TAG_PACKET_21_0_2, L_2TAG_PACKET_22_0_2, L_2TAG_PACKET_23_0_2; + Label L_2TAG_PACKET_24_0_2, L_2TAG_PACKET_25_0_2, L_2TAG_PACKET_26_0_2, L_2TAG_PACKET_27_0_2; + Label L_2TAG_PACKET_28_0_2, L_2TAG_PACKET_29_0_2, L_2TAG_PACKET_30_0_2, L_2TAG_PACKET_31_0_2; + Label L_2TAG_PACKET_32_0_2, L_2TAG_PACKET_33_0_2, L_2TAG_PACKET_34_0_2, L_2TAG_PACKET_35_0_2; + Label L_2TAG_PACKET_36_0_2, L_2TAG_PACKET_37_0_2, L_2TAG_PACKET_38_0_2, L_2TAG_PACKET_39_0_2; + Label L_2TAG_PACKET_40_0_2, L_2TAG_PACKET_41_0_2, L_2TAG_PACKET_42_0_2, L_2TAG_PACKET_43_0_2; + Label L_2TAG_PACKET_44_0_2, L_2TAG_PACKET_45_0_2, L_2TAG_PACKET_46_0_2, L_2TAG_PACKET_47_0_2; + Label L_2TAG_PACKET_48_0_2, L_2TAG_PACKET_49_0_2, L_2TAG_PACKET_50_0_2, L_2TAG_PACKET_51_0_2; + Label L_2TAG_PACKET_52_0_2, L_2TAG_PACKET_53_0_2, L_2TAG_PACKET_54_0_2, L_2TAG_PACKET_55_0_2; + Label L_2TAG_PACKET_56_0_2; + Label B1_2, B1_3, B1_5, start; + + assert_different_registers(tmp1, tmp2, eax, ecx, edx); + jmp(start); + address HIGHSIGMASK = (address)_HIGHSIGMASK; + address LOG2_E = (address)_LOG2_E; + address coeff = (address)_coeff_pow; + address L_tbl = (address)_L_tbl_pow; + address HIGHMASK_Y = (address)_HIGHMASK_Y; + address T_exp = (address)_T_exp; + address e_coeff = (address)_e_coeff; + address coeff_h = (address)_coeff_h; + address HIGHMASK_LOG_X = (address)_HIGHMASK_LOG_X; + address HALFMASK = (address)_HALFMASK; + address log2 = (address)_log2_pow; + + + bind(start); + subq(rsp, 40); + movsd(Address(rsp, 8), xmm0); + movsd(Address(rsp, 16), xmm1); + + bind(B1_2); + pextrw(eax, xmm0, 3); + xorpd(xmm2, xmm2); + mov64(tmp2, 0x3ff0000000000000); + movdq(xmm2, tmp2); + movl(tmp1, 1069088768); + movdq(xmm7, tmp1); + xorpd(xmm1, xmm1); + mov64(tmp3, 0x77f0000000000000); + movdq(xmm1, tmp3); + movdqu(xmm3, xmm0); + movl(edx, 32752); + andl(edx, eax); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + por(xmm0, xmm2); + movdqu(xmm6, ExternalAddress(HIGHSIGMASK)); //0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL + psrlq(xmm0, 27); + movq(xmm2, ExternalAddress(LOG2_E)); //0x00000000UL, 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL + psrld(xmm0, 2); + addl(ecx, 16); + bsrl(ecx, ecx); + rcpps(xmm0, xmm0); + psllq(xmm3, 12); + movl(tmp4, 8192); + movdq(xmm4, tmp4); + psrlq(xmm3, 12); + subl(eax, 16); + cmpl(eax, 32736); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); + movl(tmp1, 0); + + bind(L_2TAG_PACKET_1_0_2); + mulss(xmm0, xmm7); + movl(edx, -1); + subl(ecx, 4); + shll(edx); + shlq(edx, 32); + movdq(xmm5, edx); + por(xmm3, xmm1); + subl(eax, 16351); + cmpl(eax, 1); + jcc(Assembler::belowEqual, L_2TAG_PACKET_2_0_2); + paddd(xmm0, xmm4); + pand(xmm5, xmm3); + movdl(edx, xmm0); + psllq(xmm0, 29); + + bind(L_2TAG_PACKET_3_0_2); + subsd(xmm3, xmm5); + pand(xmm0, xmm6); + subl(eax, 1); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + + bind(L_2TAG_PACKET_4_0_2); + mulsd(xmm3, xmm0); + movdqu(xmm1, ExternalAddress(coeff)); //0x6dc96112UL, 0xbf836578UL, 0xee241472UL, 0xbf9b0301UL + lea(tmp4, ExternalAddress(L_tbl)); + subsd(xmm5, xmm2); + movdqu(xmm4, ExternalAddress(16 + coeff)); //0x9f95985aUL, 0xbfb528dbUL, 0xb3841d2aUL, 0xbfd619b6UL + movl(ecx, eax); + sarl(eax, 31); + addl(ecx, eax); + xorl(eax, ecx); + addl(eax, 1); + bsrl(eax, eax); + unpcklpd(xmm5, xmm3); + movdqu(xmm6, ExternalAddress(32 + coeff)); //0x518775e3UL, 0x3f9004f2UL, 0xac8349bbUL, 0x3fa76c9bUL + addsd(xmm3, xmm5); + andl(edx, 16760832); + shrl(edx, 10); + addpd(xmm5, Address(tmp4, edx, Address::times_1, -3648)); + movdqu(xmm0, ExternalAddress(48 + coeff)); //0x486ececcUL, 0x3fc4635eUL, 0x161bb241UL, 0xbf5dabe1UL + pshufd(xmm2, xmm3, 68); + mulsd(xmm3, xmm3); + mulpd(xmm1, xmm2); + mulpd(xmm4, xmm2); + addsd(xmm5, xmm7); + mulsd(xmm2, xmm3); + addpd(xmm6, xmm1); + mulsd(xmm3, xmm3); + addpd(xmm0, xmm4); + movq(xmm1, Address(rsp, 16)); + movw(ecx, Address(rsp, 22)); + pshufd(xmm7, xmm5, 238); + movq(xmm4, ExternalAddress(HIGHMASK_Y)); //0x00000000UL, 0xfffffff8UL, 0x00000000UL, 0xffffffffUL + mulpd(xmm6, xmm2); + pshufd(xmm3, xmm3, 68); + mulpd(xmm0, xmm2); + shll(eax, 4); + subl(eax, 15872); + andl(ecx, 32752); + addl(eax, ecx); + mulpd(xmm3, xmm6); + cmpl(eax, 624); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_5_0_2); + xorpd(xmm6, xmm6); + movl(edx, 17080); + pinsrw(xmm6, edx, 3); + movdqu(xmm2, xmm1); + pand(xmm4, xmm1); + subsd(xmm1, xmm4); + mulsd(xmm4, xmm5); + addsd(xmm0, xmm7); + mulsd(xmm1, xmm5); + movdqu(xmm7, xmm6); + addsd(xmm6, xmm4); + lea(tmp4, ExternalAddress(T_exp)); + addpd(xmm3, xmm0); + movdl(edx, xmm6); + subsd(xmm6, xmm7); + pshufd(xmm0, xmm3, 238); + subsd(xmm4, xmm6); + addsd(xmm0, xmm3); + movl(ecx, edx); + andl(edx, 255); + addl(edx, edx); + movdqu(xmm5, Address(tmp4, edx, Address::times_8, 0)); + addsd(xmm4, xmm1); + mulsd(xmm2, xmm0); + movdqu(xmm7, ExternalAddress(e_coeff)); //0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL + movdqu(xmm3, ExternalAddress(16 + e_coeff)); //0x6fba4e77UL, 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL + shll(ecx, 12); + xorl(ecx, tmp1); + andl(rcx, -1048576); + movdq(xmm6, rcx); + addsd(xmm2, xmm4); + mov64(tmp2, 0x3fe62e42fefa39ef); + movdq(xmm1, tmp2); + pshufd(xmm0, xmm2, 68); + pshufd(xmm4, xmm2, 68); + mulsd(xmm1, xmm2); + pshufd(xmm6, xmm6, 17); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm4); + paddd(xmm5, xmm6); + mulsd(xmm1, xmm5); + pshufd(xmm6, xmm5, 238); + mulsd(xmm0, xmm0); + addpd(xmm3, xmm7); + addsd(xmm1, xmm6); + mulpd(xmm0, xmm3); + pshufd(xmm3, xmm0, 238); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + addsd(xmm0, xmm1); + addsd(xmm0, xmm3); + addsd(xmm0, xmm5); + jmp(B1_5); + + bind(L_2TAG_PACKET_0_0_2); + addl(eax, 16); + movl(edx, 32752); + andl(edx, eax); + cmpl(edx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_6_0_2); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_7_0_2); + + bind(L_2TAG_PACKET_8_0_2); + movq(xmm0, Address(rsp, 8)); + movq(xmm3, Address(rsp, 8)); + movdl(edx, xmm3); + psrlq(xmm3, 32); + movdl(ecx, xmm3); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_9_0_2); + xorpd(xmm3, xmm3); + movl(eax, 18416); + pinsrw(xmm3, eax, 3); + mulsd(xmm0, xmm3); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movdqu(xmm3, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + movl(ecx, 18416); + psrlq(xmm0, 27); + movq(xmm2, ExternalAddress(LOG2_E)); //0x00000000UL, 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL + psrld(xmm0, 2); + rcpps(xmm0, xmm0); + psllq(xmm3, 12); + movdqu(xmm6, ExternalAddress(HIGHSIGMASK)); //0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL + psrlq(xmm3, 12); + mulss(xmm0, xmm7); + movl(edx, -1024); + movdl(xmm5, edx); + por(xmm3, xmm1); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + movl(tmp1, 0); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + andl(eax, 32752); + subl(eax, 18416); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_10_0_2); + movq(xmm0, Address(rsp, 8)); + movq(xmm3, Address(rsp, 8)); + movdl(edx, xmm3); + psrlq(xmm3, 32); + movdl(ecx, xmm3); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_9_0_2); + xorpd(xmm3, xmm3); + movl(eax, 18416); + pinsrw(xmm3, eax, 3); + mulsd(xmm0, xmm3); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movdqu(xmm3, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + movl(ecx, 18416); + psrlq(xmm0, 27); + movq(xmm2, ExternalAddress(LOG2_E)); //0x00000000UL, 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL + psrld(xmm0, 2); + rcpps(xmm0, xmm0); + psllq(xmm3, 12); + movdqu(xmm6, ExternalAddress(HIGHSIGMASK)); //0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL + psrlq(xmm3, 12); + mulss(xmm0, xmm7); + movl(edx, -1024); + movdl(xmm5, edx); + por(xmm3, xmm1); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + movl(tmp1, INT_MIN); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + andl(eax, 32752); + subl(eax, 18416); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_5_0_2); + cmpl(eax, 0); + jcc(Assembler::less, L_2TAG_PACKET_11_0_2); + cmpl(eax, 752); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_12_0_2); + addsd(xmm0, xmm7); + movq(xmm2, ExternalAddress(HALFMASK)); //0xf8000000UL, 0xffffffffUL, 0xf8000000UL, 0xffffffffUL + addpd(xmm3, xmm0); + xorpd(xmm6, xmm6); + movl(eax, 17080); + pinsrw(xmm6, eax, 3); + pshufd(xmm0, xmm3, 238); + addsd(xmm0, xmm3); + movdqu(xmm3, xmm5); + addsd(xmm5, xmm0); + movdqu(xmm4, xmm2); + subsd(xmm3, xmm5); + movdqu(xmm7, xmm5); + pand(xmm5, xmm2); + movdqu(xmm2, xmm1); + pand(xmm4, xmm1); + subsd(xmm7, xmm5); + addsd(xmm0, xmm3); + subsd(xmm1, xmm4); + mulsd(xmm4, xmm5); + addsd(xmm0, xmm7); + mulsd(xmm2, xmm0); + movdqu(xmm7, xmm6); + mulsd(xmm1, xmm5); + addsd(xmm6, xmm4); + movdl(eax, xmm6); + subsd(xmm6, xmm7); + lea(tmp4, ExternalAddress(T_exp)); + addsd(xmm2, xmm1); + movdqu(xmm7, ExternalAddress(e_coeff)); //0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL + movdqu(xmm3, ExternalAddress(16 + e_coeff)); //0x6fba4e77UL, 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL + subsd(xmm4, xmm6); + pextrw(edx, xmm6, 3); + movl(ecx, eax); + andl(eax, 255); + addl(eax, eax); + movdqu(xmm5, Address(tmp4, rax, Address::times_8, 0)); + addsd(xmm2, xmm4); + sarl(ecx, 8); + movl(eax, ecx); + sarl(ecx, 1); + subl(eax, ecx); + shll(ecx, 20); + xorl(ecx, tmp1); + movdl(xmm6, ecx); + movq(xmm1, ExternalAddress(32 + e_coeff)); //0xfefa39efUL, 0x3fe62e42UL, 0x00000000UL, 0x00000000UL + andl(edx, 32767); + cmpl(edx, 16529); + jcc(Assembler::above, L_2TAG_PACKET_12_0_2); + pshufd(xmm0, xmm2, 68); + pshufd(xmm4, xmm2, 68); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm4); + pshufd(xmm6, xmm6, 17); + mulsd(xmm1, xmm2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm1, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm1, xmm6); + pshufd(xmm3, xmm0, 238); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + shll(eax, 4); + xorpd(xmm4, xmm4); + addl(eax, 16368); + pinsrw(xmm4, eax, 3); + addsd(xmm0, xmm1); + addsd(xmm0, xmm3); + movdqu(xmm1, xmm0); + addsd(xmm0, xmm5); + mulsd(xmm0, xmm4); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_13_0_2); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_14_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_6_0_2); + movq(xmm1, Address(rsp, 16)); + movq(xmm0, Address(rsp, 8)); + movdqu(xmm2, xmm0); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_15_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); + addsd(xmm0, xmm0); + jmp(B1_5); + + bind(L_2TAG_PACKET_16_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + movl(Address(rsp, 0), 29); + jmp(L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_18_0_2); + movq(xmm0, Address(rsp, 16)); + addpd(xmm0, xmm0); + jmp(B1_5); + + bind(L_2TAG_PACKET_15_0_2); + movdl(eax, xmm1); + movdqu(xmm2, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_19_0_2); + pextrw(eax, xmm2, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_20_0_2); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_20_0_2); + pextrw(eax, xmm0, 3); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_21_0_2); + testl(ecx, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_23_0_2); + movq(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_24_0_2); + testl(eax, 2); + jcc(Assembler::notEqual, L_2TAG_PACKET_25_0_2); + jmp(L_2TAG_PACKET_24_0_2); + + bind(L_2TAG_PACKET_21_0_2); + shrl(ecx, 20); + andl(ecx, 2047); + cmpl(ecx, 1075); + jcc(Assembler::above, L_2TAG_PACKET_24_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_26_0_2); + cmpl(ecx, 1074); + jcc(Assembler::above, L_2TAG_PACKET_23_0_2); + cmpl(ecx, 1023); + jcc(Assembler::below, L_2TAG_PACKET_24_0_2); + movq(xmm1, Address(rsp, 16)); + movl(eax, 17208); + xorpd(xmm3, xmm3); + pinsrw(xmm3, eax, 3); + movdqu(xmm4, xmm3); + addsd(xmm3, xmm1); + subsd(xmm4, xmm3); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_24_0_2); + movdl(eax, xmm3); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_24_0_2); + + bind(L_2TAG_PACKET_25_0_2); + movq(xmm1, Address(rsp, 16)); + pextrw(eax, xmm1, 3); + andl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_27_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_27_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32768); + pinsrw(xmm0, eax, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_24_0_2); + movq(xmm1, Address(rsp, 16)); + pextrw(eax, xmm1, 3); + andl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32752); + pinsrw(xmm0, eax, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_26_0_2); + movq(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_24_0_2); + jmp(L_2TAG_PACKET_25_0_2); + + bind(L_2TAG_PACKET_28_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 20); + movdl(edx, xmm1); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_29_0_2); + movq(xmm0, Address(rsp, 16)); + addsd(xmm0, xmm0); + jmp(B1_5); + + bind(L_2TAG_PACKET_29_0_2); + movq(xmm0, Address(rsp, 8)); + pextrw(eax, xmm0, 3); + cmpl(eax, 49136); + jcc(Assembler::notEqual, L_2TAG_PACKET_30_0_2); + movdl(ecx, xmm0); + psrlq(xmm0, 20); + movdl(edx, xmm0); + orl(ecx, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_30_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32760); + pinsrw(xmm0, eax, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_30_0_2); + movq(xmm1, Address(rsp, 16)); + andl(eax, 32752); + subl(eax, 16368); + pextrw(edx, xmm1, 3); + xorpd(xmm0, xmm0); + xorl(eax, edx); + andl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_31_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_31_0_2); + movl(ecx, 32752); + pinsrw(xmm0, ecx, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_32_0_2); + movdl(eax, xmm1); + cmpl(edx, 17184); + jcc(Assembler::above, L_2TAG_PACKET_33_0_2); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); + testl(eax, 2); + jcc(Assembler::equal, L_2TAG_PACKET_35_0_2); + jmp(L_2TAG_PACKET_36_0_2); + + bind(L_2TAG_PACKET_33_0_2); + testl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_35_0_2); + jmp(L_2TAG_PACKET_36_0_2); + + bind(L_2TAG_PACKET_7_0_2); + movq(xmm2, Address(rsp, 8)); + movdl(eax, xmm2); + psrlq(xmm2, 31); + movdl(ecx, xmm2); + orl(eax, ecx); + jcc(Assembler::equal, L_2TAG_PACKET_9_0_2); + movq(xmm1, Address(rsp, 16)); + pextrw(edx, xmm1, 3); + movdl(eax, xmm1); + movdqu(xmm2, xmm1); + psrlq(xmm2, 32); + movdl(ecx, xmm2); + addl(ecx, ecx); + orl(ecx, eax); + jcc(Assembler::equal, L_2TAG_PACKET_37_0_2); + andl(edx, 32752); + cmpl(edx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); + cmpl(edx, 17200); + jcc(Assembler::above, L_2TAG_PACKET_35_0_2); + cmpl(edx, 17184); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_32_0_2); + cmpl(edx, 16368); + jcc(Assembler::below, L_2TAG_PACKET_34_0_2); + movl(eax, 17208); + xorpd(xmm2, xmm2); + pinsrw(xmm2, eax, 3); + movdqu(xmm4, xmm2); + addsd(xmm2, xmm1); + subsd(xmm4, xmm2); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32767); + jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); + movdl(eax, xmm2); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_35_0_2); + + bind(L_2TAG_PACKET_36_0_2); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movq(xmm2, ExternalAddress(LOG2_E)); //0x00000000UL, 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL + movq(xmm4, Address(rsp, 8)); + pextrw(eax, xmm4, 3); + movl(edx, 8192); + movdl(xmm4, edx); + andl(eax, 32767); + subl(eax, 16); + jcc(Assembler::less, L_2TAG_PACKET_10_0_2); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + addl(ecx, 16); + bsrl(ecx, ecx); + movl(tmp1, INT_MIN); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_34_0_2); + xorpd(xmm1, xmm1); + movl(eax, 32752); + pinsrw(xmm1, eax, 3); + xorpd(xmm0, xmm0); + mulsd(xmm0, xmm1); + movl(Address(rsp, 0), 28); + jmp(L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_35_0_2); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movq(xmm2, ExternalAddress(LOG2_E)); //0x00000000UL, 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL + movq(xmm4, Address(rsp, 8)); + pextrw(eax, xmm4, 3); + movl(edx, 8192); + movdl(xmm4, edx); + andl(eax, 32767); + subl(eax, 16); + jcc(Assembler::less, L_2TAG_PACKET_8_0_2); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + addl(ecx, 16); + bsrl(ecx, ecx); + movl(tmp1, 0); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_19_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_22_0_2); + xorpd(xmm0, xmm0); + jmp(B1_5); + + bind(L_2TAG_PACKET_11_0_2); + addl(eax, 384); + cmpl(eax, 0); + jcc(Assembler::less, L_2TAG_PACKET_38_0_2); + mulsd(xmm5, xmm1); + addsd(xmm0, xmm7); + shrl(tmp1, 31); + addpd(xmm3, xmm0); + pshufd(xmm0, xmm3, 238); + addsd(xmm3, xmm0); + lea(tmp4, ExternalAddress(log2)); //0xfefa39efUL, 0x3fe62e42UL, 0xfefa39efUL, 0xbfe62e42UL + movq(xmm4, Address(tmp4, tmp1, Address::times_8, 0)); + mulsd(xmm1, xmm3); + xorpd(xmm0, xmm0); + movl(eax, 16368); + shll(tmp1, 15); + orl(eax, tmp1); + pinsrw(xmm0, eax, 3); + addsd(xmm5, xmm1); + mulsd(xmm5, xmm4); + addsd(xmm0, xmm5); + jmp(B1_5); + + bind(L_2TAG_PACKET_38_0_2); + + bind(L_2TAG_PACKET_37_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_39_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + movl(Address(rsp, 0), 26); + jmp(L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_9_0_2); + movq(xmm1, Address(rsp, 16)); + movdqu(xmm2, xmm1); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_40_0_2); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_40_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_39_0_2); + shrl(edx, 21); + cmpl(edx, 1075); + jcc(Assembler::above, L_2TAG_PACKET_41_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_42_0_2); + cmpl(edx, 1023); + jcc(Assembler::below, L_2TAG_PACKET_41_0_2); + movq(xmm1, Address(rsp, 16)); + movl(eax, 17208); + xorpd(xmm3, xmm3); + pinsrw(xmm3, eax, 3); + movdqu(xmm4, xmm3); + addsd(xmm3, xmm1); + subsd(xmm4, xmm3); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_41_0_2); + movdl(eax, xmm3); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_41_0_2); + + bind(L_2TAG_PACKET_43_0_2); + movq(xmm0, Address(rsp, 8)); + testl(ecx, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_44_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_42_0_2); + movq(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_43_0_2); + + bind(L_2TAG_PACKET_41_0_2); + testl(ecx, INT_MIN); + jcc(Assembler::equal, L_2TAG_PACKET_22_0_2); + xorpd(xmm0, xmm0); + + bind(L_2TAG_PACKET_44_0_2); + movl(eax, 16368); + xorpd(xmm1, xmm1); + pinsrw(xmm1, eax, 3); + divsd(xmm1, xmm0); + movdqu(xmm0, xmm1); + movl(Address(rsp, 0), 27); + jmp(L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_12_0_2); + movq(xmm2, Address(rsp, 8)); + movq(xmm6, Address(rsp, 16)); + pextrw(eax, xmm2, 3); + pextrw(edx, xmm6, 3); + movl(ecx, 32752); + andl(ecx, edx); + cmpl(ecx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_45_0_2); + andl(eax, 32752); + subl(eax, 16368); + xorl(edx, eax); + testl(edx, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_46_0_2); + + bind(L_2TAG_PACKET_47_0_2); + movl(eax, 32736); + pinsrw(xmm0, eax, 3); + shrl(tmp1, 16); + orl(eax, tmp1); + pinsrw(xmm1, eax, 3); + mulsd(xmm0, xmm1); + + bind(L_2TAG_PACKET_14_0_2); + movl(Address(rsp, 0), 24); + jmp(L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_46_0_2); + movl(eax, 16); + pinsrw(xmm0, eax, 3); + mulsd(xmm0, xmm0); + testl(tmp1, INT_MIN); + jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); + mov64(tmp2, 0x8000000000000000); + movdq(xmm2, tmp2); + xorpd(xmm0, xmm2); + + bind(L_2TAG_PACKET_48_0_2); + movl(Address(rsp, 0), 25); + jmp(L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_13_0_2); + pextrw(ecx, xmm5, 3); + pextrw(edx, xmm4, 3); + movl(eax, -1); + andl(ecx, 32752); + subl(ecx, 16368); + andl(edx, 32752); + addl(edx, ecx); + movl(ecx, -31); + sarl(edx, 4); + subl(ecx, edx); + jcc(Assembler::lessEqual, L_2TAG_PACKET_49_0_2); + cmpl(ecx, 20); + jcc(Assembler::above, L_2TAG_PACKET_50_0_2); + shll(eax); + + bind(L_2TAG_PACKET_49_0_2); + movdl(xmm0, eax); + psllq(xmm0, 32); + pand(xmm0, xmm5); + subsd(xmm5, xmm0); + addsd(xmm5, xmm1); + mulsd(xmm0, xmm4); + mulsd(xmm5, xmm4); + addsd(xmm0, xmm5); + + bind(L_2TAG_PACKET_50_0_2); + jmp(L_2TAG_PACKET_48_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movw(ecx, Address(rsp, 22)); + movl(edx, INT_MIN); + movdl(xmm1, rdx); + xorpd(xmm7, xmm7); + paddd(xmm0, xmm4); + movdl(edx, xmm0); + psllq(xmm0, 29); + paddq(xmm1, xmm3); + pand(xmm5, xmm1); + andl(ecx, 32752); + cmpl(ecx, 16560); + jcc(Assembler::less, L_2TAG_PACKET_3_0_2); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + addl(eax, 16351); + shrl(eax, 4); + subl(eax, 1022); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + lea(r11, ExternalAddress(L_tbl)); + movq(xmm4, ExternalAddress(coeff_h)); //0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL + mulsd(xmm3, xmm0); + movq(xmm6, ExternalAddress(coeff_h)); //0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL + subsd(xmm5, xmm2); + movq(xmm1, ExternalAddress(8 + coeff_h)); //0x00000000UL, 0xbf5dabe1UL + pshufd(xmm2, xmm3, 68); + unpcklpd(xmm5, xmm3); + addsd(xmm3, xmm5); + movq(xmm0, ExternalAddress(8 + coeff_h)); //0x00000000UL, 0xbf5dabe1UL + andl(edx, 16760832); + shrl(edx, 10); + addpd(xmm7, Address(tmp4, edx, Address::times_1, -3648)); + mulsd(xmm4, xmm5); + mulsd(xmm0, xmm5); + mulsd(xmm6, xmm2); + mulsd(xmm1, xmm2); + movdqu(xmm2, xmm5); + mulsd(xmm4, xmm5); + addsd(xmm5, xmm0); + movdqu(xmm0, xmm7); + addsd(xmm2, xmm3); + addsd(xmm7, xmm5); + mulsd(xmm6, xmm2); + subsd(xmm0, xmm7); + movdqu(xmm2, xmm7); + addsd(xmm7, xmm4); + addsd(xmm0, xmm5); + subsd(xmm2, xmm7); + addsd(xmm4, xmm2); + pshufd(xmm2, xmm5, 238); + movdqu(xmm5, xmm7); + addsd(xmm7, xmm2); + addsd(xmm4, xmm0); + movdqu(xmm0, ExternalAddress(coeff)); //0x6dc96112UL, 0xbf836578UL, 0xee241472UL, 0xbf9b0301UL + subsd(xmm5, xmm7); + addsd(xmm6, xmm4); + movdqu(xmm4, xmm7); + addsd(xmm5, xmm2); + addsd(xmm7, xmm1); + movdqu(xmm2, ExternalAddress(64 + coeff)); //0x486ececcUL, 0x3fc4635eUL, 0x161bb241UL, 0xbf5dabe1UL + subsd(xmm4, xmm7); + addsd(xmm6, xmm5); + addsd(xmm4, xmm1); + pshufd(xmm5, xmm7, 238); + movapd(xmm1, xmm7); + addsd(xmm7, xmm5); + subsd(xmm1, xmm7); + addsd(xmm1, xmm5); + movdqu(xmm5, ExternalAddress(80 + coeff)); //0x9f95985aUL, 0xbfb528dbUL, 0xf8b5787dUL, 0x3ef2531eUL + pshufd(xmm3, xmm3, 68); + addsd(xmm6, xmm4); + addsd(xmm6, xmm1); + movdqu(xmm1, ExternalAddress(32 + coeff)); //0x9f95985aUL, 0xbfb528dbUL, 0xb3841d2aUL, 0xbfd619b6UL + mulpd(xmm0, xmm3); + mulpd(xmm2, xmm3); + pshufd(xmm4, xmm3, 68); + mulpd(xmm3, xmm3); + addpd(xmm0, xmm1); + addpd(xmm5, xmm2); + mulsd(xmm4, xmm3); + movq(xmm2, ExternalAddress(HIGHMASK_LOG_X)); //0xf8000000UL, 0xffffffffUL, 0x00000000UL, 0xfffff800UL + mulpd(xmm3, xmm3); + movq(xmm1, Address(rsp, 16)); + movw(ecx, Address(rsp, 22)); + mulpd(xmm0, xmm4); + pextrw(eax, xmm7, 3); + mulpd(xmm5, xmm4); + mulpd(xmm0, xmm3); + movq(xmm4, ExternalAddress(8 + HIGHMASK_Y)); //0x00000000UL, 0xffffffffUL + pand(xmm2, xmm7); + addsd(xmm5, xmm6); + subsd(xmm7, xmm2); + addpd(xmm5, xmm0); + andl(eax, 32752); + subl(eax, 16368); + andl(ecx, 32752); + cmpl(ecx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_45_0_2); + addl(ecx, eax); + cmpl(ecx, 16576); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_51_0_2); + pshufd(xmm0, xmm5, 238); + pand(xmm4, xmm1); + movdqu(xmm3, xmm1); + addsd(xmm5, xmm0); + subsd(xmm1, xmm4); + xorpd(xmm6, xmm6); + movl(edx, 17080); + pinsrw(xmm6, edx, 3); + addsd(xmm7, xmm5); + mulsd(xmm4, xmm2); + mulsd(xmm1, xmm2); + movdqu(xmm5, xmm6); + mulsd(xmm3, xmm7); + addsd(xmm6, xmm4); + addsd(xmm1, xmm3); + movdqu(xmm7, ExternalAddress(e_coeff)); //0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL + movdl(edx, xmm6); + subsd(xmm6, xmm5); + lea(tmp4, ExternalAddress(T_exp)); + movdqu(xmm3, ExternalAddress(16 + e_coeff)); //0x6fba4e77UL, 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL + movq(xmm2, ExternalAddress(32 + e_coeff)); //0xfefa39efUL, 0x3fe62e42UL, 0x00000000UL, 0x00000000UL + subsd(xmm4, xmm6); + movl(ecx, edx); + andl(edx, 255); + addl(edx, edx); + movdqu(xmm5, Address(tmp4, edx, Address::times_8, 0)); + addsd(xmm4, xmm1); + pextrw(edx, xmm6, 3); + shrl(ecx, 8); + movl(eax, ecx); + shrl(ecx, 1); + subl(eax, ecx); + shll(ecx, 20); + movdl(xmm6, ecx); + pshufd(xmm0, xmm4, 68); + pshufd(xmm1, xmm4, 68); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm1); + pshufd(xmm6, xmm6, 17); + mulsd(xmm2, xmm4); + andl(edx, 32767); + cmpl(edx, 16529); + jcc(Assembler::above, L_2TAG_PACKET_12_0_2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm2, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm2, xmm6); + pshufd(xmm3, xmm0, 238); + addl(eax, 1023); + shll(eax, 20); + orl(eax, tmp1); + movdl(xmm4, eax); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + addsd(xmm0, xmm2); + psllq(xmm4, 32); + addsd(xmm0, xmm3); + movdqu(xmm1, xmm0); + addsd(xmm0, xmm5); + mulsd(xmm0, xmm4); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_13_0_2); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_14_0_2); + + bind(L_2TAG_PACKET_52_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_45_0_2); + movq(xmm0, Address(rsp, 8)); + xorpd(xmm2, xmm2); + movl(eax, 49136); + pinsrw(xmm2, eax, 3); + addsd(xmm2, xmm0); + pextrw(eax, xmm2, 3); + cmpl(eax, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_53_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32760); + pinsrw(xmm0, eax, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_53_0_2); + movq(xmm1, Address(rsp, 16)); + movdl(edx, xmm1); + movdqu(xmm3, xmm1); + psrlq(xmm3, 20); + movdl(ecx, xmm3); + orl(ecx, edx); + jcc(Assembler::equal, L_2TAG_PACKET_54_0_2); + addsd(xmm1, xmm1); + movdqu(xmm0, xmm1); + jmp(B1_5); + + bind(L_2TAG_PACKET_51_0_2); + pextrw(eax, xmm1, 3); + pextrw(ecx, xmm2, 3); + xorl(eax, ecx); + testl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_47_0_2); + jmp(L_2TAG_PACKET_46_0_2); + + bind(L_2TAG_PACKET_54_0_2); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + pextrw(edx, xmm1, 3); + xorpd(xmm0, xmm0); + subl(eax, 16368); + xorl(eax, edx); + testl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_55_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_55_0_2); + movl(edx, 32752); + pinsrw(xmm0, edx, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_17_0_2); + movq(Address(rsp, 24), xmm0); + + bind(B1_3); + movq(xmm0, Address(rsp, 24)); + + bind(L_2TAG_PACKET_56_0_2); + + bind(B1_5); + addq(rsp, 40); +} +#endif // _LP64 + +#ifndef _LP64 + +ALIGNED_(16) juint _static_const_table_pow[] = +{ + 0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL, 0xf8000000UL, + 0xffffffffUL, 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0x3ff00000UL, + 0x00000000UL, 0x00000000UL, 0x20000000UL, 0x3feff00aUL, 0x96621f95UL, + 0x3e5b1856UL, 0xe0000000UL, 0x3fefe019UL, 0xe5916f9eUL, 0xbe325278UL, + 0x00000000UL, 0x3fefd02fUL, 0x859a1062UL, 0x3e595fb7UL, 0xc0000000UL, + 0x3fefc049UL, 0xb245f18fUL, 0xbe529c38UL, 0xe0000000UL, 0x3fefb069UL, + 0xad2880a7UL, 0xbe501230UL, 0x60000000UL, 0x3fefa08fUL, 0xc8e72420UL, + 0x3e597bd1UL, 0x80000000UL, 0x3fef90baUL, 0xc30c4500UL, 0xbe5d6c75UL, + 0xe0000000UL, 0x3fef80eaUL, 0x02c63f43UL, 0x3e2e1318UL, 0xc0000000UL, + 0x3fef7120UL, 0xb3d4ccccUL, 0xbe44c52aUL, 0x00000000UL, 0x3fef615cUL, + 0xdbd91397UL, 0xbe4e7d6cUL, 0xa0000000UL, 0x3fef519cUL, 0x65c5cd68UL, + 0xbe522dc8UL, 0xa0000000UL, 0x3fef41e2UL, 0x46d1306cUL, 0xbe5a840eUL, + 0xe0000000UL, 0x3fef322dUL, 0xd2980e94UL, 0x3e5071afUL, 0xa0000000UL, + 0x3fef227eUL, 0x773abadeUL, 0xbe5891e5UL, 0xa0000000UL, 0x3fef12d4UL, + 0xdc6bf46bUL, 0xbe5cccbeUL, 0xe0000000UL, 0x3fef032fUL, 0xbc7247faUL, + 0xbe2bab83UL, 0x80000000UL, 0x3feef390UL, 0xbcaa1e46UL, 0xbe53bb3bUL, + 0x60000000UL, 0x3feee3f6UL, 0x5f6c682dUL, 0xbe54c619UL, 0x80000000UL, + 0x3feed461UL, 0x5141e368UL, 0xbe4b6d86UL, 0xe0000000UL, 0x3feec4d1UL, + 0xec678f76UL, 0xbe369af6UL, 0x80000000UL, 0x3feeb547UL, 0x41301f55UL, + 0xbe2d4312UL, 0x60000000UL, 0x3feea5c2UL, 0x676da6bdUL, 0xbe4d8dd0UL, + 0x60000000UL, 0x3fee9642UL, 0x57a891c4UL, 0x3e51f991UL, 0xa0000000UL, + 0x3fee86c7UL, 0xe4eb491eUL, 0x3e579bf9UL, 0x20000000UL, 0x3fee7752UL, + 0xfddc4a2cUL, 0xbe3356e6UL, 0xc0000000UL, 0x3fee67e1UL, 0xd75b5bf1UL, + 0xbe449531UL, 0x80000000UL, 0x3fee5876UL, 0xbd423b8eUL, 0x3df54fe4UL, + 0x60000000UL, 0x3fee4910UL, 0x330e51b9UL, 0x3e54289cUL, 0x80000000UL, + 0x3fee39afUL, 0x8651a95fUL, 0xbe55aad6UL, 0xa0000000UL, 0x3fee2a53UL, + 0x5e98c708UL, 0xbe2fc4a9UL, 0xe0000000UL, 0x3fee1afcUL, 0x0989328dUL, + 0x3e23958cUL, 0x40000000UL, 0x3fee0babUL, 0xee642abdUL, 0xbe425dd8UL, + 0xa0000000UL, 0x3fedfc5eUL, 0xc394d236UL, 0x3e526362UL, 0x20000000UL, + 0x3feded17UL, 0xe104aa8eUL, 0x3e4ce247UL, 0xc0000000UL, 0x3fedddd4UL, + 0x265a9be4UL, 0xbe5bb77aUL, 0x40000000UL, 0x3fedce97UL, 0x0ecac52fUL, + 0x3e4a7cb1UL, 0xe0000000UL, 0x3fedbf5eUL, 0x124cb3b8UL, 0x3e257024UL, + 0x80000000UL, 0x3fedb02bUL, 0xe6d4febeUL, 0xbe2033eeUL, 0x20000000UL, + 0x3feda0fdUL, 0x39cca00eUL, 0xbe3ddabcUL, 0xc0000000UL, 0x3fed91d3UL, + 0xef8a552aUL, 0xbe543390UL, 0x40000000UL, 0x3fed82afUL, 0xb8e85204UL, + 0x3e513850UL, 0xe0000000UL, 0x3fed738fUL, 0x3d59fe08UL, 0xbe5db728UL, + 0x40000000UL, 0x3fed6475UL, 0x3aa7ead1UL, 0x3e58804bUL, 0xc0000000UL, + 0x3fed555fUL, 0xf8a35ba9UL, 0xbe5298b0UL, 0x00000000UL, 0x3fed464fUL, + 0x9a88dd15UL, 0x3e5a8cdbUL, 0x40000000UL, 0x3fed3743UL, 0xb0b0a190UL, + 0x3e598635UL, 0x80000000UL, 0x3fed283cUL, 0xe2113295UL, 0xbe5c1119UL, + 0x80000000UL, 0x3fed193aUL, 0xafbf1728UL, 0xbe492e9cUL, 0x60000000UL, + 0x3fed0a3dUL, 0xe4a4ccf3UL, 0x3e19b90eUL, 0x20000000UL, 0x3fecfb45UL, + 0xba3cbeb8UL, 0x3e406b50UL, 0xc0000000UL, 0x3fecec51UL, 0x110f7dddUL, + 0x3e0d6806UL, 0x40000000UL, 0x3fecdd63UL, 0x7dd7d508UL, 0xbe5a8943UL, + 0x80000000UL, 0x3fecce79UL, 0x9b60f271UL, 0xbe50676aUL, 0x80000000UL, + 0x3fecbf94UL, 0x0b9ad660UL, 0x3e59174fUL, 0x60000000UL, 0x3fecb0b4UL, + 0x00823d9cUL, 0x3e5bbf72UL, 0x20000000UL, 0x3feca1d9UL, 0x38a6ec89UL, + 0xbe4d38f9UL, 0x80000000UL, 0x3fec9302UL, 0x3a0b7d8eUL, 0x3e53dbfdUL, + 0xc0000000UL, 0x3fec8430UL, 0xc6826b34UL, 0xbe27c5c9UL, 0xc0000000UL, + 0x3fec7563UL, 0x0c706381UL, 0xbe593653UL, 0x60000000UL, 0x3fec669bUL, + 0x7df34ec7UL, 0x3e461ab5UL, 0xe0000000UL, 0x3fec57d7UL, 0x40e5e7e8UL, + 0xbe5c3daeUL, 0x00000000UL, 0x3fec4919UL, 0x5602770fUL, 0xbe55219dUL, + 0xc0000000UL, 0x3fec3a5eUL, 0xec7911ebUL, 0x3e5a5d25UL, 0x60000000UL, + 0x3fec2ba9UL, 0xb39ea225UL, 0xbe53c00bUL, 0x80000000UL, 0x3fec1cf8UL, + 0x967a212eUL, 0x3e5a8ddfUL, 0x60000000UL, 0x3fec0e4cUL, 0x580798bdUL, + 0x3e5f53abUL, 0x00000000UL, 0x3febffa5UL, 0xb8282df6UL, 0xbe46b874UL, + 0x20000000UL, 0x3febf102UL, 0xe33a6729UL, 0x3e54963fUL, 0x00000000UL, + 0x3febe264UL, 0x3b53e88aUL, 0xbe3adce1UL, 0x60000000UL, 0x3febd3caUL, + 0xc2585084UL, 0x3e5cde9fUL, 0x80000000UL, 0x3febc535UL, 0xa335c5eeUL, + 0xbe39fd9cUL, 0x20000000UL, 0x3febb6a5UL, 0x7325b04dUL, 0x3e42ba15UL, + 0x60000000UL, 0x3feba819UL, 0x1564540fUL, 0x3e3a9f35UL, 0x40000000UL, + 0x3feb9992UL, 0x83fff592UL, 0xbe5465ceUL, 0xa0000000UL, 0x3feb8b0fUL, + 0xb9da63d3UL, 0xbe4b1a0aUL, 0x80000000UL, 0x3feb7c91UL, 0x6d6f1ea4UL, + 0x3e557657UL, 0x00000000UL, 0x3feb6e18UL, 0x5e80a1bfUL, 0x3e4ddbb6UL, + 0x00000000UL, 0x3feb5fa3UL, 0x1c9eacb5UL, 0x3e592877UL, 0xa0000000UL, + 0x3feb5132UL, 0x6d40beb3UL, 0xbe51858cUL, 0xa0000000UL, 0x3feb42c6UL, + 0xd740c67bUL, 0x3e427ad2UL, 0x40000000UL, 0x3feb345fUL, 0xa3e0cceeUL, + 0xbe5c2fc4UL, 0x40000000UL, 0x3feb25fcUL, 0x8e752b50UL, 0xbe3da3c2UL, + 0xc0000000UL, 0x3feb179dUL, 0xa892e7deUL, 0x3e1fb481UL, 0xc0000000UL, + 0x3feb0943UL, 0x21ed71e9UL, 0xbe365206UL, 0x20000000UL, 0x3feafaeeUL, + 0x0e1380a3UL, 0x3e5c5b7bUL, 0x20000000UL, 0x3feaec9dUL, 0x3c3d640eUL, + 0xbe5dbbd0UL, 0x60000000UL, 0x3feade50UL, 0x8f97a715UL, 0x3e3a8ec5UL, + 0x20000000UL, 0x3fead008UL, 0x23ab2839UL, 0x3e2fe98aUL, 0x40000000UL, + 0x3feac1c4UL, 0xf4bbd50fUL, 0x3e54d8f6UL, 0xe0000000UL, 0x3feab384UL, + 0x14757c4dUL, 0xbe48774cUL, 0xc0000000UL, 0x3feaa549UL, 0x7c7b0eeaUL, + 0x3e5b51bbUL, 0x20000000UL, 0x3fea9713UL, 0xf56f7013UL, 0x3e386200UL, + 0xe0000000UL, 0x3fea88e0UL, 0xbe428ebeUL, 0xbe514af5UL, 0xe0000000UL, + 0x3fea7ab2UL, 0x8d0e4496UL, 0x3e4f9165UL, 0x60000000UL, 0x3fea6c89UL, + 0xdbacc5d5UL, 0xbe5c063bUL, 0x20000000UL, 0x3fea5e64UL, 0x3f19d970UL, + 0xbe5a0c8cUL, 0x20000000UL, 0x3fea5043UL, 0x09ea3e6bUL, 0x3e5065dcUL, + 0x80000000UL, 0x3fea4226UL, 0x78df246cUL, 0x3e5e05f6UL, 0x40000000UL, + 0x3fea340eUL, 0x4057d4a0UL, 0x3e431b2bUL, 0x40000000UL, 0x3fea25faUL, + 0x82867bb5UL, 0x3e4b76beUL, 0xa0000000UL, 0x3fea17eaUL, 0x9436f40aUL, + 0xbe5aad39UL, 0x20000000UL, 0x3fea09dfUL, 0x4b5253b3UL, 0x3e46380bUL, + 0x00000000UL, 0x3fe9fbd8UL, 0x8fc52466UL, 0xbe386f9bUL, 0x20000000UL, + 0x3fe9edd5UL, 0x22d3f344UL, 0xbe538347UL, 0x60000000UL, 0x3fe9dfd6UL, + 0x1ac33522UL, 0x3e5dbc53UL, 0x00000000UL, 0x3fe9d1dcUL, 0xeabdff1dUL, + 0x3e40fc0cUL, 0xe0000000UL, 0x3fe9c3e5UL, 0xafd30e73UL, 0xbe585e63UL, + 0xe0000000UL, 0x3fe9b5f3UL, 0xa52f226aUL, 0xbe43e8f9UL, 0x20000000UL, + 0x3fe9a806UL, 0xecb8698dUL, 0xbe515b36UL, 0x80000000UL, 0x3fe99a1cUL, + 0xf2b4e89dUL, 0x3e48b62bUL, 0x20000000UL, 0x3fe98c37UL, 0x7c9a88fbUL, + 0x3e44414cUL, 0x00000000UL, 0x3fe97e56UL, 0xda015741UL, 0xbe5d13baUL, + 0xe0000000UL, 0x3fe97078UL, 0x5fdace06UL, 0x3e51b947UL, 0x00000000UL, + 0x3fe962a0UL, 0x956ca094UL, 0x3e518785UL, 0x40000000UL, 0x3fe954cbUL, + 0x01164c1dUL, 0x3e5d5b57UL, 0xc0000000UL, 0x3fe946faUL, 0xe63b3767UL, + 0xbe4f84e7UL, 0x40000000UL, 0x3fe9392eUL, 0xe57cc2a9UL, 0x3e34eda3UL, + 0xe0000000UL, 0x3fe92b65UL, 0x8c75b544UL, 0x3e5766a0UL, 0xc0000000UL, + 0x3fe91da1UL, 0x37d1d087UL, 0xbe5e2ab1UL, 0x80000000UL, 0x3fe90fe1UL, + 0xa953dc20UL, 0x3e5fa1f3UL, 0x80000000UL, 0x3fe90225UL, 0xdbd3f369UL, + 0x3e47d6dbUL, 0xa0000000UL, 0x3fe8f46dUL, 0x1c9be989UL, 0xbe5e2b0aUL, + 0xa0000000UL, 0x3fe8e6b9UL, 0x3c93d76aUL, 0x3e5c8618UL, 0xe0000000UL, + 0x3fe8d909UL, 0x2182fc9aUL, 0xbe41aa9eUL, 0x20000000UL, 0x3fe8cb5eUL, + 0xe6b3539dUL, 0xbe530d19UL, 0x60000000UL, 0x3fe8bdb6UL, 0x49e58cc3UL, + 0xbe3bb374UL, 0xa0000000UL, 0x3fe8b012UL, 0xa7cfeb8fUL, 0x3e56c412UL, + 0x00000000UL, 0x3fe8a273UL, 0x8d52bc19UL, 0x3e1429b8UL, 0x60000000UL, + 0x3fe894d7UL, 0x4dc32c6cUL, 0xbe48604cUL, 0xc0000000UL, 0x3fe8873fUL, + 0x0c868e56UL, 0xbe564ee5UL, 0x00000000UL, 0x3fe879acUL, 0x56aee828UL, + 0x3e5e2fd8UL, 0x60000000UL, 0x3fe86c1cUL, 0x7ceab8ecUL, 0x3e493365UL, + 0xc0000000UL, 0x3fe85e90UL, 0x78d4dadcUL, 0xbe4f7f25UL, 0x00000000UL, + 0x3fe85109UL, 0x0ccd8280UL, 0x3e31e7a2UL, 0x40000000UL, 0x3fe84385UL, + 0x34ba4e15UL, 0x3e328077UL, 0x80000000UL, 0x3fe83605UL, 0xa670975aUL, + 0xbe53eee5UL, 0xa0000000UL, 0x3fe82889UL, 0xf61b77b2UL, 0xbe43a20aUL, + 0xa0000000UL, 0x3fe81b11UL, 0x13e6643bUL, 0x3e5e5fe5UL, 0xc0000000UL, + 0x3fe80d9dUL, 0x82cc94e8UL, 0xbe5ff1f9UL, 0xa0000000UL, 0x3fe8002dUL, + 0x8a0c9c5dUL, 0xbe42b0e7UL, 0x60000000UL, 0x3fe7f2c1UL, 0x22a16f01UL, + 0x3e5d9ea0UL, 0x20000000UL, 0x3fe7e559UL, 0xc38cd451UL, 0x3e506963UL, + 0xc0000000UL, 0x3fe7d7f4UL, 0x9902bc71UL, 0x3e4503d7UL, 0x40000000UL, + 0x3fe7ca94UL, 0xdef2a3c0UL, 0x3e3d98edUL, 0xa0000000UL, 0x3fe7bd37UL, + 0xed49abb0UL, 0x3e24c1ffUL, 0xe0000000UL, 0x3fe7afdeUL, 0xe3b0be70UL, + 0xbe40c467UL, 0x00000000UL, 0x3fe7a28aUL, 0xaf9f193cUL, 0xbe5dff6cUL, + 0xe0000000UL, 0x3fe79538UL, 0xb74cf6b6UL, 0xbe258ed0UL, 0xa0000000UL, + 0x3fe787ebUL, 0x1d9127c7UL, 0x3e345fb0UL, 0x40000000UL, 0x3fe77aa2UL, + 0x1028c21dUL, 0xbe4619bdUL, 0xa0000000UL, 0x3fe76d5cUL, 0x7cb0b5e4UL, + 0x3e40f1a2UL, 0xe0000000UL, 0x3fe7601aUL, 0x2b1bc4adUL, 0xbe32e8bbUL, + 0xe0000000UL, 0x3fe752dcUL, 0x6839f64eUL, 0x3e41f57bUL, 0xc0000000UL, + 0x3fe745a2UL, 0xc4121f7eUL, 0xbe52c40aUL, 0x60000000UL, 0x3fe7386cUL, + 0xd6852d72UL, 0xbe5c4e6bUL, 0xc0000000UL, 0x3fe72b39UL, 0x91d690f7UL, + 0xbe57f88fUL, 0xe0000000UL, 0x3fe71e0aUL, 0x627a2159UL, 0xbe4425d5UL, + 0xc0000000UL, 0x3fe710dfUL, 0x50a54033UL, 0x3e422b7eUL, 0x60000000UL, + 0x3fe703b8UL, 0x3b0b5f91UL, 0x3e5d3857UL, 0xe0000000UL, 0x3fe6f694UL, + 0x84d628a2UL, 0xbe51f090UL, 0x00000000UL, 0x3fe6e975UL, 0x306d8894UL, + 0xbe414d83UL, 0xe0000000UL, 0x3fe6dc58UL, 0x30bf24aaUL, 0xbe4650caUL, + 0x80000000UL, 0x3fe6cf40UL, 0xd4628d69UL, 0xbe5db007UL, 0xc0000000UL, + 0x3fe6c22bUL, 0xa2aae57bUL, 0xbe31d279UL, 0xc0000000UL, 0x3fe6b51aUL, + 0x860edf7eUL, 0xbe2d4c4aUL, 0x80000000UL, 0x3fe6a80dUL, 0xf3559341UL, + 0xbe5f7e98UL, 0xe0000000UL, 0x3fe69b03UL, 0xa885899eUL, 0xbe5c2011UL, + 0xe0000000UL, 0x3fe68dfdUL, 0x2bdc6d37UL, 0x3e224a82UL, 0xa0000000UL, + 0x3fe680fbUL, 0xc12ad1b9UL, 0xbe40cf56UL, 0x00000000UL, 0x3fe673fdUL, + 0x1bcdf659UL, 0xbdf52f2dUL, 0x00000000UL, 0x3fe66702UL, 0x5df10408UL, + 0x3e5663e0UL, 0xc0000000UL, 0x3fe65a0aUL, 0xa4070568UL, 0xbe40b12fUL, + 0x00000000UL, 0x3fe64d17UL, 0x71c54c47UL, 0x3e5f5e8bUL, 0x00000000UL, + 0x3fe64027UL, 0xbd4b7e83UL, 0x3e42ead6UL, 0xa0000000UL, 0x3fe6333aUL, + 0x61598bd2UL, 0xbe4c48d4UL, 0xc0000000UL, 0x3fe62651UL, 0x6f538d61UL, + 0x3e548401UL, 0xa0000000UL, 0x3fe6196cUL, 0x14344120UL, 0xbe529af6UL, + 0x00000000UL, 0x3fe60c8bUL, 0x5982c587UL, 0xbe3e1e4fUL, 0x00000000UL, + 0x3fe5ffadUL, 0xfe51d4eaUL, 0xbe4c897aUL, 0x80000000UL, 0x3fe5f2d2UL, + 0xfd46ebe1UL, 0x3e552e00UL, 0xa0000000UL, 0x3fe5e5fbUL, 0xa4695699UL, + 0x3e5ed471UL, 0x60000000UL, 0x3fe5d928UL, 0x80d118aeUL, 0x3e456b61UL, + 0xa0000000UL, 0x3fe5cc58UL, 0x304c330bUL, 0x3e54dc29UL, 0x80000000UL, + 0x3fe5bf8cUL, 0x0af2dedfUL, 0xbe3aa9bdUL, 0xe0000000UL, 0x3fe5b2c3UL, + 0x15fc9258UL, 0xbe479a37UL, 0xc0000000UL, 0x3fe5a5feUL, 0x9292c7eaUL, + 0x3e188650UL, 0x20000000UL, 0x3fe5993dUL, 0x33b4d380UL, 0x3e5d6d93UL, + 0x20000000UL, 0x3fe58c7fUL, 0x02fd16c7UL, 0x3e2fe961UL, 0xa0000000UL, + 0x3fe57fc4UL, 0x4a05edb6UL, 0xbe4d55b4UL, 0xa0000000UL, 0x3fe5730dUL, + 0x3d443abbUL, 0xbe5e6954UL, 0x00000000UL, 0x3fe5665aUL, 0x024acfeaUL, + 0x3e50e61bUL, 0x00000000UL, 0x3fe559aaUL, 0xcc9edd09UL, 0xbe325403UL, + 0x60000000UL, 0x3fe54cfdUL, 0x1fe26950UL, 0x3e5d500eUL, 0x60000000UL, + 0x3fe54054UL, 0x6c5ae164UL, 0xbe4a79b4UL, 0xc0000000UL, 0x3fe533aeUL, + 0x154b0287UL, 0xbe401571UL, 0xa0000000UL, 0x3fe5270cUL, 0x0673f401UL, + 0xbe56e56bUL, 0xe0000000UL, 0x3fe51a6dUL, 0x751b639cUL, 0x3e235269UL, + 0xa0000000UL, 0x3fe50dd2UL, 0x7c7b2bedUL, 0x3ddec887UL, 0xc0000000UL, + 0x3fe5013aUL, 0xafab4e17UL, 0x3e5e7575UL, 0x60000000UL, 0x3fe4f4a6UL, + 0x2e308668UL, 0x3e59aed6UL, 0x80000000UL, 0x3fe4e815UL, 0xf33e2a76UL, + 0xbe51f184UL, 0xe0000000UL, 0x3fe4db87UL, 0x839f3e3eUL, 0x3e57db01UL, + 0xc0000000UL, 0x3fe4cefdUL, 0xa9eda7bbUL, 0x3e535e0fUL, 0x00000000UL, + 0x3fe4c277UL, 0x2a8f66a5UL, 0x3e5ce451UL, 0xc0000000UL, 0x3fe4b5f3UL, + 0x05192456UL, 0xbe4e8518UL, 0xc0000000UL, 0x3fe4a973UL, 0x4aa7cd1dUL, + 0x3e46784aUL, 0x40000000UL, 0x3fe49cf7UL, 0x8e23025eUL, 0xbe5749f2UL, + 0x00000000UL, 0x3fe4907eUL, 0x18d30215UL, 0x3e360f39UL, 0x20000000UL, + 0x3fe48408UL, 0x63dcf2f3UL, 0x3e5e00feUL, 0xc0000000UL, 0x3fe47795UL, + 0x46182d09UL, 0xbe5173d9UL, 0xa0000000UL, 0x3fe46b26UL, 0x8f0e62aaUL, + 0xbe48f281UL, 0xe0000000UL, 0x3fe45ebaUL, 0x5775c40cUL, 0xbe56aad4UL, + 0x60000000UL, 0x3fe45252UL, 0x0fe25f69UL, 0x3e48bd71UL, 0x40000000UL, + 0x3fe445edUL, 0xe9989ec5UL, 0x3e590d97UL, 0x80000000UL, 0x3fe4398bUL, + 0xb3d9ffe3UL, 0x3e479dbcUL, 0x20000000UL, 0x3fe42d2dUL, 0x388e4d2eUL, + 0xbe5eed80UL, 0xe0000000UL, 0x3fe420d1UL, 0x6f797c18UL, 0x3e554b4cUL, + 0x20000000UL, 0x3fe4147aUL, 0x31048bb4UL, 0xbe5b1112UL, 0x80000000UL, + 0x3fe40825UL, 0x2efba4f9UL, 0x3e48ebc7UL, 0x40000000UL, 0x3fe3fbd4UL, + 0x50201119UL, 0x3e40b701UL, 0x40000000UL, 0x3fe3ef86UL, 0x0a4db32cUL, + 0x3e551de8UL, 0xa0000000UL, 0x3fe3e33bUL, 0x0c9c148bUL, 0xbe50c1f6UL, + 0x20000000UL, 0x3fe3d6f4UL, 0xc9129447UL, 0x3e533fa0UL, 0x00000000UL, + 0x3fe3cab0UL, 0xaae5b5a0UL, 0xbe22b68eUL, 0x20000000UL, 0x3fe3be6fUL, + 0x02305e8aUL, 0xbe54fc08UL, 0x60000000UL, 0x3fe3b231UL, 0x7f908258UL, + 0x3e57dc05UL, 0x00000000UL, 0x3fe3a5f7UL, 0x1a09af78UL, 0x3e08038bUL, + 0xe0000000UL, 0x3fe399bfUL, 0x490643c1UL, 0xbe5dbe42UL, 0xe0000000UL, + 0x3fe38d8bUL, 0x5e8ad724UL, 0xbe3c2b72UL, 0x20000000UL, 0x3fe3815bUL, + 0xc67196b6UL, 0x3e1713cfUL, 0xa0000000UL, 0x3fe3752dUL, 0x6182e429UL, + 0xbe3ec14cUL, 0x40000000UL, 0x3fe36903UL, 0xab6eb1aeUL, 0x3e5a2cc5UL, + 0x40000000UL, 0x3fe35cdcUL, 0xfe5dc064UL, 0xbe5c5878UL, 0x40000000UL, + 0x3fe350b8UL, 0x0ba6b9e4UL, 0x3e51619bUL, 0x80000000UL, 0x3fe34497UL, + 0x857761aaUL, 0x3e5fff53UL, 0x00000000UL, 0x3fe3387aUL, 0xf872d68cUL, + 0x3e484f4dUL, 0xa0000000UL, 0x3fe32c5fUL, 0x087e97c2UL, 0x3e52842eUL, + 0x80000000UL, 0x3fe32048UL, 0x73d6d0c0UL, 0xbe503edfUL, 0x80000000UL, + 0x3fe31434UL, 0x0c1456a1UL, 0xbe5f72adUL, 0xa0000000UL, 0x3fe30823UL, + 0x83a1a4d5UL, 0xbe5e65ccUL, 0xe0000000UL, 0x3fe2fc15UL, 0x855a7390UL, + 0xbe506438UL, 0x40000000UL, 0x3fe2f00bUL, 0xa2898287UL, 0x3e3d22a2UL, + 0xe0000000UL, 0x3fe2e403UL, 0x8b56f66fUL, 0xbe5aa5fdUL, 0x80000000UL, + 0x3fe2d7ffUL, 0x52db119aUL, 0x3e3a2e3dUL, 0x60000000UL, 0x3fe2cbfeUL, + 0xe2ddd4c0UL, 0xbe586469UL, 0x40000000UL, 0x3fe2c000UL, 0x6b01bf10UL, + 0x3e352b9dUL, 0x40000000UL, 0x3fe2b405UL, 0xb07a1cdfUL, 0x3e5c5cdaUL, + 0x80000000UL, 0x3fe2a80dUL, 0xc7b5f868UL, 0xbe5668b3UL, 0xc0000000UL, + 0x3fe29c18UL, 0x185edf62UL, 0xbe563d66UL, 0x00000000UL, 0x3fe29027UL, + 0xf729e1ccUL, 0x3e59a9a0UL, 0x80000000UL, 0x3fe28438UL, 0x6433c727UL, + 0xbe43cc89UL, 0x00000000UL, 0x3fe2784dUL, 0x41782631UL, 0xbe30750cUL, + 0xa0000000UL, 0x3fe26c64UL, 0x914911b7UL, 0xbe58290eUL, 0x40000000UL, + 0x3fe2607fUL, 0x3dcc73e1UL, 0xbe4269cdUL, 0x00000000UL, 0x3fe2549dUL, + 0x2751bf70UL, 0xbe5a6998UL, 0xc0000000UL, 0x3fe248bdUL, 0x4248b9fbUL, + 0xbe4ddb00UL, 0x80000000UL, 0x3fe23ce1UL, 0xf35cf82fUL, 0x3e561b71UL, + 0x60000000UL, 0x3fe23108UL, 0x8e481a2dUL, 0x3e518fb9UL, 0x60000000UL, + 0x3fe22532UL, 0x5ab96edcUL, 0xbe5fafc5UL, 0x40000000UL, 0x3fe2195fUL, + 0x80943911UL, 0xbe07f819UL, 0x40000000UL, 0x3fe20d8fUL, 0x386f2d6cUL, + 0xbe54ba8bUL, 0x40000000UL, 0x3fe201c2UL, 0xf29664acUL, 0xbe5eb815UL, + 0x20000000UL, 0x3fe1f5f8UL, 0x64f03390UL, 0x3e5e320cUL, 0x20000000UL, + 0x3fe1ea31UL, 0x747ff696UL, 0x3e5ef0a5UL, 0x40000000UL, 0x3fe1de6dUL, + 0x3e9ceb51UL, 0xbe5f8d27UL, 0x20000000UL, 0x3fe1d2acUL, 0x4ae0b55eUL, + 0x3e5faa21UL, 0x20000000UL, 0x3fe1c6eeUL, 0x28569a5eUL, 0x3e598a4fUL, + 0x20000000UL, 0x3fe1bb33UL, 0x54b33e07UL, 0x3e46130aUL, 0x20000000UL, + 0x3fe1af7bUL, 0x024f1078UL, 0xbe4dbf93UL, 0x00000000UL, 0x3fe1a3c6UL, + 0xb0783bfaUL, 0x3e419248UL, 0xe0000000UL, 0x3fe19813UL, 0x2f02b836UL, + 0x3e4e02b7UL, 0xc0000000UL, 0x3fe18c64UL, 0x28dec9d4UL, 0x3e09064fUL, + 0x80000000UL, 0x3fe180b8UL, 0x45cbf406UL, 0x3e5b1f46UL, 0x40000000UL, + 0x3fe1750fUL, 0x03d9964cUL, 0x3e5b0a79UL, 0x00000000UL, 0x3fe16969UL, + 0x8b5b882bUL, 0xbe238086UL, 0xa0000000UL, 0x3fe15dc5UL, 0x73bad6f8UL, + 0xbdf1fca4UL, 0x20000000UL, 0x3fe15225UL, 0x5385769cUL, 0x3e5e8d76UL, + 0xa0000000UL, 0x3fe14687UL, 0x1676dc6bUL, 0x3e571d08UL, 0x20000000UL, + 0x3fe13aedUL, 0xa8c41c7fUL, 0xbe598a25UL, 0x60000000UL, 0x3fe12f55UL, + 0xc4e1aaf0UL, 0x3e435277UL, 0xa0000000UL, 0x3fe123c0UL, 0x403638e1UL, + 0xbe21aa7cUL, 0xc0000000UL, 0x3fe1182eUL, 0x557a092bUL, 0xbdd0116bUL, + 0xc0000000UL, 0x3fe10c9fUL, 0x7d779f66UL, 0x3e4a61baUL, 0xc0000000UL, + 0x3fe10113UL, 0x2b09c645UL, 0xbe5d586eUL, 0x20000000UL, 0x3fe0ea04UL, + 0xea2cad46UL, 0x3e5aa97cUL, 0x20000000UL, 0x3fe0d300UL, 0x23190e54UL, + 0x3e50f1a7UL, 0xa0000000UL, 0x3fe0bc07UL, 0x1379a5a6UL, 0xbe51619dUL, + 0x60000000UL, 0x3fe0a51aUL, 0x926a3d4aUL, 0x3e5cf019UL, 0xa0000000UL, + 0x3fe08e38UL, 0xa8c24358UL, 0x3e35241eUL, 0x20000000UL, 0x3fe07762UL, + 0x24317e7aUL, 0x3e512cfaUL, 0x00000000UL, 0x3fe06097UL, 0xfd9cf274UL, + 0xbe55bef3UL, 0x00000000UL, 0x3fe049d7UL, 0x3689b49dUL, 0xbe36d26dUL, + 0x40000000UL, 0x3fe03322UL, 0xf72ef6c4UL, 0xbe54cd08UL, 0xa0000000UL, + 0x3fe01c78UL, 0x23702d2dUL, 0xbe5900bfUL, 0x00000000UL, 0x3fe005daUL, + 0x3f59c14cUL, 0x3e57d80bUL, 0x40000000UL, 0x3fdfde8dUL, 0xad67766dUL, + 0xbe57fad4UL, 0x40000000UL, 0x3fdfb17cUL, 0x644f4ae7UL, 0x3e1ee43bUL, + 0x40000000UL, 0x3fdf8481UL, 0x903234d2UL, 0x3e501a86UL, 0x40000000UL, + 0x3fdf579cUL, 0xafe9e509UL, 0xbe267c3eUL, 0x00000000UL, 0x3fdf2acdUL, + 0xb7dfda0bUL, 0xbe48149bUL, 0x40000000UL, 0x3fdefe13UL, 0x3b94305eUL, + 0x3e5f4ea7UL, 0x80000000UL, 0x3fded16fUL, 0x5d95da61UL, 0xbe55c198UL, + 0x00000000UL, 0x3fdea4e1UL, 0x406960c9UL, 0xbdd99a19UL, 0x00000000UL, + 0x3fde7868UL, 0xd22f3539UL, 0x3e470c78UL, 0x80000000UL, 0x3fde4c04UL, + 0x83eec535UL, 0xbe3e1232UL, 0x40000000UL, 0x3fde1fb6UL, 0x3dfbffcbUL, + 0xbe4b7d71UL, 0x40000000UL, 0x3fddf37dUL, 0x7e1be4e0UL, 0xbe5b8f8fUL, + 0x40000000UL, 0x3fddc759UL, 0x46dae887UL, 0xbe350458UL, 0x80000000UL, + 0x3fdd9b4aUL, 0xed6ecc49UL, 0xbe5f0045UL, 0x80000000UL, 0x3fdd6f50UL, + 0x2e9e883cUL, 0x3e2915daUL, 0x80000000UL, 0x3fdd436bUL, 0xf0bccb32UL, + 0x3e4a68c9UL, 0x80000000UL, 0x3fdd179bUL, 0x9bbfc779UL, 0xbe54a26aUL, + 0x00000000UL, 0x3fdcebe0UL, 0x7cea33abUL, 0x3e43c6b7UL, 0x40000000UL, + 0x3fdcc039UL, 0xe740fd06UL, 0x3e5526c2UL, 0x40000000UL, 0x3fdc94a7UL, + 0x9eadeb1aUL, 0xbe396d8dUL, 0xc0000000UL, 0x3fdc6929UL, 0xf0a8f95aUL, + 0xbe5c0ab2UL, 0x80000000UL, 0x3fdc3dc0UL, 0x6ee2693bUL, 0x3e0992e6UL, + 0xc0000000UL, 0x3fdc126bUL, 0x5ac6b581UL, 0xbe2834b6UL, 0x40000000UL, + 0x3fdbe72bUL, 0x8cc226ffUL, 0x3e3596a6UL, 0x00000000UL, 0x3fdbbbffUL, + 0xf92a74bbUL, 0x3e3c5813UL, 0x00000000UL, 0x3fdb90e7UL, 0x479664c0UL, + 0xbe50d644UL, 0x00000000UL, 0x3fdb65e3UL, 0x5004975bUL, 0xbe55258fUL, + 0x00000000UL, 0x3fdb3af3UL, 0xe4b23194UL, 0xbe588407UL, 0xc0000000UL, + 0x3fdb1016UL, 0xe65d4d0aUL, 0x3e527c26UL, 0x80000000UL, 0x3fdae54eUL, + 0x814fddd6UL, 0x3e5962a2UL, 0x40000000UL, 0x3fdaba9aUL, 0xe19d0913UL, + 0xbe562f4eUL, 0x80000000UL, 0x3fda8ff9UL, 0x43cfd006UL, 0xbe4cfdebUL, + 0x40000000UL, 0x3fda656cUL, 0x686f0a4eUL, 0x3e5e47a8UL, 0xc0000000UL, + 0x3fda3af2UL, 0x7200d410UL, 0x3e5e1199UL, 0xc0000000UL, 0x3fda108cUL, + 0xabd2266eUL, 0x3e5ee4d1UL, 0x40000000UL, 0x3fd9e63aUL, 0x396f8f2cUL, + 0x3e4dbffbUL, 0x00000000UL, 0x3fd9bbfbUL, 0xe32b25ddUL, 0x3e5c3a54UL, + 0x40000000UL, 0x3fd991cfUL, 0x431e4035UL, 0xbe457925UL, 0x80000000UL, + 0x3fd967b6UL, 0x7bed3dd3UL, 0x3e40c61dUL, 0x00000000UL, 0x3fd93db1UL, + 0xd7449365UL, 0x3e306419UL, 0x80000000UL, 0x3fd913beUL, 0x1746e791UL, + 0x3e56fcfcUL, 0x40000000UL, 0x3fd8e9dfUL, 0xf3a9028bUL, 0xbe5041b9UL, + 0xc0000000UL, 0x3fd8c012UL, 0x56840c50UL, 0xbe26e20aUL, 0x40000000UL, + 0x3fd89659UL, 0x19763102UL, 0xbe51f466UL, 0x80000000UL, 0x3fd86cb2UL, + 0x7032de7cUL, 0xbe4d298aUL, 0x80000000UL, 0x3fd8431eUL, 0xdeb39fabUL, + 0xbe4361ebUL, 0x40000000UL, 0x3fd8199dUL, 0x5d01cbe0UL, 0xbe5425b3UL, + 0x80000000UL, 0x3fd7f02eUL, 0x3ce99aa9UL, 0x3e146fa8UL, 0x80000000UL, + 0x3fd7c6d2UL, 0xd1a262b9UL, 0xbe5a1a69UL, 0xc0000000UL, 0x3fd79d88UL, + 0x8606c236UL, 0x3e423a08UL, 0x80000000UL, 0x3fd77451UL, 0x8fd1e1b7UL, + 0x3e5a6a63UL, 0xc0000000UL, 0x3fd74b2cUL, 0xe491456aUL, 0x3e42c1caUL, + 0x40000000UL, 0x3fd7221aUL, 0x4499a6d7UL, 0x3e36a69aUL, 0x00000000UL, + 0x3fd6f91aUL, 0x5237df94UL, 0xbe0f8f02UL, 0x00000000UL, 0x3fd6d02cUL, + 0xb6482c6eUL, 0xbe5abcf7UL, 0x00000000UL, 0x3fd6a750UL, 0x1919fd61UL, + 0xbe57ade2UL, 0x00000000UL, 0x3fd67e86UL, 0xaa7a994dUL, 0xbe3f3fbdUL, + 0x00000000UL, 0x3fd655ceUL, 0x67db014cUL, 0x3e33c550UL, 0x00000000UL, + 0x3fd62d28UL, 0xa82856b7UL, 0xbe1409d1UL, 0xc0000000UL, 0x3fd60493UL, + 0x1e6a300dUL, 0x3e55d899UL, 0x80000000UL, 0x3fd5dc11UL, 0x1222bd5cUL, + 0xbe35bfc0UL, 0xc0000000UL, 0x3fd5b3a0UL, 0x6e8dc2d3UL, 0x3e5d4d79UL, + 0x00000000UL, 0x3fd58b42UL, 0xe0e4ace6UL, 0xbe517303UL, 0x80000000UL, + 0x3fd562f4UL, 0xb306e0a8UL, 0x3e5edf0fUL, 0xc0000000UL, 0x3fd53ab8UL, + 0x6574bc54UL, 0x3e5ee859UL, 0x80000000UL, 0x3fd5128eUL, 0xea902207UL, + 0x3e5f6188UL, 0xc0000000UL, 0x3fd4ea75UL, 0x9f911d79UL, 0x3e511735UL, + 0x80000000UL, 0x3fd4c26eUL, 0xf9c77397UL, 0xbe5b1643UL, 0x40000000UL, + 0x3fd49a78UL, 0x15fc9258UL, 0x3e479a37UL, 0x80000000UL, 0x3fd47293UL, + 0xd5a04dd9UL, 0xbe426e56UL, 0xc0000000UL, 0x3fd44abfUL, 0xe04042f5UL, + 0x3e56f7c6UL, 0x40000000UL, 0x3fd422fdUL, 0x1d8bf2c8UL, 0x3e5d8810UL, + 0x00000000UL, 0x3fd3fb4cUL, 0x88a8ddeeUL, 0xbe311454UL, 0xc0000000UL, + 0x3fd3d3abUL, 0x3e3b5e47UL, 0xbe5d1b72UL, 0x40000000UL, 0x3fd3ac1cUL, + 0xc2ab5d59UL, 0x3e31b02bUL, 0xc0000000UL, 0x3fd3849dUL, 0xd4e34b9eUL, + 0x3e51cb2fUL, 0x40000000UL, 0x3fd35d30UL, 0x177204fbUL, 0xbe2b8cd7UL, + 0x80000000UL, 0x3fd335d3UL, 0xfcd38c82UL, 0xbe4356e1UL, 0x80000000UL, + 0x3fd30e87UL, 0x64f54accUL, 0xbe4e6224UL, 0x00000000UL, 0x3fd2e74cUL, + 0xaa7975d9UL, 0x3e5dc0feUL, 0x80000000UL, 0x3fd2c021UL, 0x516dab3fUL, + 0xbe50ffa3UL, 0x40000000UL, 0x3fd29907UL, 0x2bfb7313UL, 0x3e5674a2UL, + 0xc0000000UL, 0x3fd271fdUL, 0x0549fc99UL, 0x3e385d29UL, 0xc0000000UL, + 0x3fd24b04UL, 0x55b63073UL, 0xbe500c6dUL, 0x00000000UL, 0x3fd2241cUL, + 0x3f91953aUL, 0x3e389977UL, 0xc0000000UL, 0x3fd1fd43UL, 0xa1543f71UL, + 0xbe3487abUL, 0xc0000000UL, 0x3fd1d67bUL, 0x4ec8867cUL, 0x3df6a2dcUL, + 0x00000000UL, 0x3fd1afc4UL, 0x4328e3bbUL, 0x3e41d9c0UL, 0x80000000UL, + 0x3fd1891cUL, 0x2e1cda84UL, 0x3e3bdd87UL, 0x40000000UL, 0x3fd16285UL, + 0x4b5331aeUL, 0xbe53128eUL, 0x00000000UL, 0x3fd13bfeUL, 0xb9aec164UL, + 0xbe52ac98UL, 0xc0000000UL, 0x3fd11586UL, 0xd91e1316UL, 0xbe350630UL, + 0x80000000UL, 0x3fd0ef1fUL, 0x7cacc12cUL, 0x3e3f5219UL, 0x40000000UL, + 0x3fd0c8c8UL, 0xbce277b7UL, 0x3e3d30c0UL, 0x00000000UL, 0x3fd0a281UL, + 0x2a63447dUL, 0xbe541377UL, 0x80000000UL, 0x3fd07c49UL, 0xfac483b5UL, + 0xbe5772ecUL, 0xc0000000UL, 0x3fd05621UL, 0x36b8a570UL, 0xbe4fd4bdUL, + 0xc0000000UL, 0x3fd03009UL, 0xbae505f7UL, 0xbe450388UL, 0x80000000UL, + 0x3fd00a01UL, 0x3e35aeadUL, 0xbe5430fcUL, 0x80000000UL, 0x3fcfc811UL, + 0x707475acUL, 0x3e38806eUL, 0x80000000UL, 0x3fcf7c3fUL, 0xc91817fcUL, + 0xbe40cceaUL, 0x80000000UL, 0x3fcf308cUL, 0xae05d5e9UL, 0xbe4919b8UL, + 0x80000000UL, 0x3fcee4f8UL, 0xae6cc9e6UL, 0xbe530b94UL, 0x00000000UL, + 0x3fce9983UL, 0x1efe3e8eUL, 0x3e57747eUL, 0x00000000UL, 0x3fce4e2dUL, + 0xda78d9bfUL, 0xbe59a608UL, 0x00000000UL, 0x3fce02f5UL, 0x8abe2c2eUL, + 0x3e4a35adUL, 0x00000000UL, 0x3fcdb7dcUL, 0x1495450dUL, 0xbe0872ccUL, + 0x80000000UL, 0x3fcd6ce1UL, 0x86ee0ba0UL, 0xbe4f59a0UL, 0x00000000UL, + 0x3fcd2205UL, 0xe81ca888UL, 0x3e5402c3UL, 0x00000000UL, 0x3fccd747UL, + 0x3b4424b9UL, 0x3e5dfdc3UL, 0x80000000UL, 0x3fcc8ca7UL, 0xd305b56cUL, + 0x3e202da6UL, 0x00000000UL, 0x3fcc4226UL, 0x399a6910UL, 0xbe482a1cUL, + 0x80000000UL, 0x3fcbf7c2UL, 0x747f7938UL, 0xbe587372UL, 0x80000000UL, + 0x3fcbad7cUL, 0x6fc246a0UL, 0x3e50d83dUL, 0x00000000UL, 0x3fcb6355UL, + 0xee9e9be5UL, 0xbe5c35bdUL, 0x80000000UL, 0x3fcb194aUL, 0x8416c0bcUL, + 0x3e546d4fUL, 0x00000000UL, 0x3fcacf5eUL, 0x49f7f08fUL, 0x3e56da76UL, + 0x00000000UL, 0x3fca858fUL, 0x5dc30de2UL, 0x3e5f390cUL, 0x00000000UL, + 0x3fca3bdeUL, 0x950583b6UL, 0xbe5e4169UL, 0x80000000UL, 0x3fc9f249UL, + 0x33631553UL, 0x3e52aeb1UL, 0x00000000UL, 0x3fc9a8d3UL, 0xde8795a6UL, + 0xbe59a504UL, 0x00000000UL, 0x3fc95f79UL, 0x076bf41eUL, 0x3e5122feUL, + 0x80000000UL, 0x3fc9163cUL, 0x2914c8e7UL, 0x3e3dd064UL, 0x00000000UL, + 0x3fc8cd1dUL, 0x3a30eca3UL, 0xbe21b4aaUL, 0x80000000UL, 0x3fc8841aUL, + 0xb2a96650UL, 0xbe575444UL, 0x80000000UL, 0x3fc83b34UL, 0x2376c0cbUL, + 0xbe2a74c7UL, 0x80000000UL, 0x3fc7f26bUL, 0xd8a0b653UL, 0xbe5181b6UL, + 0x00000000UL, 0x3fc7a9bfUL, 0x32257882UL, 0xbe4a78b4UL, 0x00000000UL, + 0x3fc7612fUL, 0x1eee8bd9UL, 0xbe1bfe9dUL, 0x80000000UL, 0x3fc718bbUL, + 0x0c603cc4UL, 0x3e36fdc9UL, 0x80000000UL, 0x3fc6d064UL, 0x3728b8cfUL, + 0xbe1e542eUL, 0x80000000UL, 0x3fc68829UL, 0xc79a4067UL, 0x3e5c380fUL, + 0x00000000UL, 0x3fc6400bUL, 0xf69eac69UL, 0x3e550a84UL, 0x80000000UL, + 0x3fc5f808UL, 0xb7a780a4UL, 0x3e5d9224UL, 0x80000000UL, 0x3fc5b022UL, + 0xad9dfb1eUL, 0xbe55242fUL, 0x00000000UL, 0x3fc56858UL, 0x659b18beUL, + 0xbe4bfda3UL, 0x80000000UL, 0x3fc520a9UL, 0x66ee3631UL, 0xbe57d769UL, + 0x80000000UL, 0x3fc4d916UL, 0x1ec62819UL, 0x3e2427f7UL, 0x80000000UL, + 0x3fc4919fUL, 0xdec25369UL, 0xbe435431UL, 0x00000000UL, 0x3fc44a44UL, + 0xa8acfc4bUL, 0xbe3c62e8UL, 0x00000000UL, 0x3fc40304UL, 0xcf1d3eabUL, + 0xbdfba29fUL, 0x80000000UL, 0x3fc3bbdfUL, 0x79aba3eaUL, 0xbdf1b7c8UL, + 0x80000000UL, 0x3fc374d6UL, 0xb8d186daUL, 0xbe5130cfUL, 0x80000000UL, + 0x3fc32de8UL, 0x9d74f152UL, 0x3e2285b6UL, 0x00000000UL, 0x3fc2e716UL, + 0x50ae7ca9UL, 0xbe503920UL, 0x80000000UL, 0x3fc2a05eUL, 0x6caed92eUL, + 0xbe533924UL, 0x00000000UL, 0x3fc259c2UL, 0x9cb5034eUL, 0xbe510e31UL, + 0x80000000UL, 0x3fc21340UL, 0x12c4d378UL, 0xbe540b43UL, 0x80000000UL, + 0x3fc1ccd9UL, 0xcc418706UL, 0x3e59887aUL, 0x00000000UL, 0x3fc1868eUL, + 0x921f4106UL, 0xbe528e67UL, 0x80000000UL, 0x3fc1405cUL, 0x3969441eUL, + 0x3e5d8051UL, 0x00000000UL, 0x3fc0fa46UL, 0xd941ef5bUL, 0x3e5f9079UL, + 0x80000000UL, 0x3fc0b44aUL, 0x5a3e81b2UL, 0xbe567691UL, 0x00000000UL, + 0x3fc06e69UL, 0x9d66afe7UL, 0xbe4d43fbUL, 0x00000000UL, 0x3fc028a2UL, + 0x0a92a162UL, 0xbe52f394UL, 0x00000000UL, 0x3fbfc5eaUL, 0x209897e5UL, + 0x3e529e37UL, 0x00000000UL, 0x3fbf3ac5UL, 0x8458bd7bUL, 0x3e582831UL, + 0x00000000UL, 0x3fbeafd5UL, 0xb8d8b4b8UL, 0xbe486b4aUL, 0x00000000UL, + 0x3fbe2518UL, 0xe0a3b7b6UL, 0x3e5bafd2UL, 0x00000000UL, 0x3fbd9a90UL, + 0x2bf2710eUL, 0x3e383b2bUL, 0x00000000UL, 0x3fbd103cUL, 0x73eb6ab7UL, + 0xbe56d78dUL, 0x00000000UL, 0x3fbc861bUL, 0x32ceaff5UL, 0xbe32dc5aUL, + 0x00000000UL, 0x3fbbfc2eUL, 0xbee04cb7UL, 0xbe4a71a4UL, 0x00000000UL, + 0x3fbb7274UL, 0x35ae9577UL, 0x3e38142fUL, 0x00000000UL, 0x3fbae8eeUL, + 0xcbaddab4UL, 0xbe5490f0UL, 0x00000000UL, 0x3fba5f9aUL, 0x95ce1114UL, + 0x3e597c71UL, 0x00000000UL, 0x3fb9d67aUL, 0x6d7c0f78UL, 0x3e3abc2dUL, + 0x00000000UL, 0x3fb94d8dUL, 0x2841a782UL, 0xbe566cbcUL, 0x00000000UL, + 0x3fb8c4d2UL, 0x6ed429c6UL, 0xbe3cfff9UL, 0x00000000UL, 0x3fb83c4aUL, + 0xe4a49fbbUL, 0xbe552964UL, 0x00000000UL, 0x3fb7b3f4UL, 0x2193d81eUL, + 0xbe42fa72UL, 0x00000000UL, 0x3fb72bd0UL, 0xdd70c122UL, 0x3e527a8cUL, + 0x00000000UL, 0x3fb6a3dfUL, 0x03108a54UL, 0xbe450393UL, 0x00000000UL, + 0x3fb61c1fUL, 0x30ff7954UL, 0x3e565840UL, 0x00000000UL, 0x3fb59492UL, + 0xdedd460cUL, 0xbe5422b5UL, 0x00000000UL, 0x3fb50d36UL, 0x950f9f45UL, + 0xbe5313f6UL, 0x00000000UL, 0x3fb4860bUL, 0x582cdcb1UL, 0x3e506d39UL, + 0x00000000UL, 0x3fb3ff12UL, 0x7216d3a6UL, 0x3e4aa719UL, 0x00000000UL, + 0x3fb3784aUL, 0x57a423fdUL, 0x3e5a9b9fUL, 0x00000000UL, 0x3fb2f1b4UL, + 0x7a138b41UL, 0xbe50b418UL, 0x00000000UL, 0x3fb26b4eUL, 0x2fbfd7eaUL, + 0x3e23a53eUL, 0x00000000UL, 0x3fb1e519UL, 0x18913ccbUL, 0x3e465fc1UL, + 0x00000000UL, 0x3fb15f15UL, 0x7ea24e21UL, 0x3e042843UL, 0x00000000UL, + 0x3fb0d941UL, 0x7c6d9c77UL, 0x3e59f61eUL, 0x00000000UL, 0x3fb0539eUL, + 0x114efd44UL, 0x3e4ccab7UL, 0x00000000UL, 0x3faf9c56UL, 0x1777f657UL, + 0x3e552f65UL, 0x00000000UL, 0x3fae91d2UL, 0xc317b86aUL, 0xbe5a61e0UL, + 0x00000000UL, 0x3fad87acUL, 0xb7664efbUL, 0xbe41f64eUL, 0x00000000UL, + 0x3fac7de6UL, 0x5d3d03a9UL, 0x3e0807a0UL, 0x00000000UL, 0x3fab7480UL, + 0x743c38ebUL, 0xbe3726e1UL, 0x00000000UL, 0x3faa6b78UL, 0x06a253f1UL, + 0x3e5ad636UL, 0x00000000UL, 0x3fa962d0UL, 0xa35f541bUL, 0x3e5a187aUL, + 0x00000000UL, 0x3fa85a88UL, 0x4b86e446UL, 0xbe508150UL, 0x00000000UL, + 0x3fa7529cUL, 0x2589cacfUL, 0x3e52938aUL, 0x00000000UL, 0x3fa64b10UL, + 0xaf6b11f2UL, 0xbe3454cdUL, 0x00000000UL, 0x3fa543e2UL, 0x97506fefUL, + 0xbe5fdec5UL, 0x00000000UL, 0x3fa43d10UL, 0xe75f7dd9UL, 0xbe388dd3UL, + 0x00000000UL, 0x3fa3369cUL, 0xa4139632UL, 0xbdea5177UL, 0x00000000UL, + 0x3fa23086UL, 0x352d6f1eUL, 0xbe565ad6UL, 0x00000000UL, 0x3fa12accUL, + 0x77449eb7UL, 0xbe50d5c7UL, 0x00000000UL, 0x3fa0256eUL, 0x7478da78UL, + 0x3e404724UL, 0x00000000UL, 0x3f9e40dcUL, 0xf59cef7fUL, 0xbe539d0aUL, + 0x00000000UL, 0x3f9c3790UL, 0x1511d43cUL, 0x3e53c2c8UL, 0x00000000UL, + 0x3f9a2f00UL, 0x9b8bff3cUL, 0xbe43b3e1UL, 0x00000000UL, 0x3f982724UL, + 0xad1e22a5UL, 0x3e46f0bdUL, 0x00000000UL, 0x3f962000UL, 0x130d9356UL, + 0x3e475ba0UL, 0x00000000UL, 0x3f941994UL, 0x8f86f883UL, 0xbe513d0bUL, + 0x00000000UL, 0x3f9213dcUL, 0x914d0dc8UL, 0xbe534335UL, 0x00000000UL, + 0x3f900ed8UL, 0x2d73e5e7UL, 0xbe22ba75UL, 0x00000000UL, 0x3f8c1510UL, + 0xc5b7d70eUL, 0x3e599c5dUL, 0x00000000UL, 0x3f880de0UL, 0x8a27857eUL, + 0xbe3d28c8UL, 0x00000000UL, 0x3f840810UL, 0xda767328UL, 0x3e531b3dUL, + 0x00000000UL, 0x3f8003b0UL, 0x77bacaf3UL, 0xbe5f04e3UL, 0x00000000UL, + 0x3f780150UL, 0xdf4b0720UL, 0x3e5a8bffUL, 0x00000000UL, 0x3f6ffc40UL, + 0x34c48e71UL, 0xbe3fcd99UL, 0x00000000UL, 0x3f5ff6c0UL, 0x1ad218afUL, + 0xbe4c78a7UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x80000000UL, + 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL, 0x00000000UL, + 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL, 0x6dc96112UL, 0xbf836578UL, + 0xee241472UL, 0xbf9b0301UL, 0x9f95985aUL, 0xbfb528dbUL, 0xb3841d2aUL, + 0xbfd619b6UL, 0x518775e3UL, 0x3f9004f2UL, 0xac8349bbUL, 0x3fa76c9bUL, + 0x486ececcUL, 0x3fc4635eUL, 0x161bb241UL, 0xbf5dabe1UL, 0x9f95985aUL, + 0xbfb528dbUL, 0xf8b5787dUL, 0x3ef2531eUL, 0x486ececbUL, 0x3fc4635eUL, + 0x412055ccUL, 0xbdd61bb2UL, 0x00000000UL, 0xfffffff8UL, 0x00000000UL, + 0xffffffffUL, 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x3b700000UL, + 0xfa5abcbfUL, 0x3ff00b1aUL, 0xa7609f71UL, 0xbc84f6b2UL, 0xa9fb3335UL, + 0x3ff0163dUL, 0x9ab8cdb7UL, 0x3c9b6129UL, 0x143b0281UL, 0x3ff02168UL, + 0x0fc54eb6UL, 0xbc82bf31UL, 0x3e778061UL, 0x3ff02c9aUL, 0x535b085dUL, + 0xbc719083UL, 0x2e11bbccUL, 0x3ff037d4UL, 0xeeade11aUL, 0x3c656811UL, + 0xe86e7f85UL, 0x3ff04315UL, 0x1977c96eUL, 0xbc90a31cUL, 0x72f654b1UL, + 0x3ff04e5fUL, 0x3aa0d08cUL, 0x3c84c379UL, 0xd3158574UL, 0x3ff059b0UL, + 0xa475b465UL, 0x3c8d73e2UL, 0x0e3c1f89UL, 0x3ff0650aUL, 0x5799c397UL, + 0xbc95cb7bUL, 0x29ddf6deUL, 0x3ff0706bUL, 0xe2b13c27UL, 0xbc8c91dfUL, + 0x2b72a836UL, 0x3ff07bd4UL, 0x54458700UL, 0x3c832334UL, 0x18759bc8UL, + 0x3ff08745UL, 0x4bb284ffUL, 0x3c6186beUL, 0xf66607e0UL, 0x3ff092bdUL, + 0x800a3fd1UL, 0xbc968063UL, 0xcac6f383UL, 0x3ff09e3eUL, 0x18316136UL, + 0x3c914878UL, 0x9b1f3919UL, 0x3ff0a9c7UL, 0x873d1d38UL, 0x3c85d16cUL, + 0x6cf9890fUL, 0x3ff0b558UL, 0x4adc610bUL, 0x3c98a62eUL, 0x45e46c85UL, + 0x3ff0c0f1UL, 0x06d21cefUL, 0x3c94f989UL, 0x2b7247f7UL, 0x3ff0cc92UL, + 0x16e24f71UL, 0x3c901edcUL, 0x23395decUL, 0x3ff0d83bUL, 0xe43f316aUL, + 0xbc9bc14dUL, 0x32d3d1a2UL, 0x3ff0e3ecUL, 0x27c57b52UL, 0x3c403a17UL, + 0x5fdfa9c5UL, 0x3ff0efa5UL, 0xbc54021bUL, 0xbc949db9UL, 0xaffed31bUL, + 0x3ff0fb66UL, 0xc44ebd7bUL, 0xbc6b9bedUL, 0x28d7233eUL, 0x3ff10730UL, + 0x1692fdd5UL, 0x3c8d46ebUL, 0xd0125b51UL, 0x3ff11301UL, 0x39449b3aUL, + 0xbc96c510UL, 0xab5e2ab6UL, 0x3ff11edbUL, 0xf703fb72UL, 0xbc9ca454UL, + 0xc06c31ccUL, 0x3ff12abdUL, 0xb36ca5c7UL, 0xbc51b514UL, 0x14f204abUL, + 0x3ff136a8UL, 0xba48dcf0UL, 0xbc67108fUL, 0xaea92de0UL, 0x3ff1429aUL, + 0x9af1369eUL, 0xbc932fbfUL, 0x934f312eUL, 0x3ff14e95UL, 0x39bf44abUL, + 0xbc8b91e8UL, 0xc8a58e51UL, 0x3ff15a98UL, 0xb9eeab0aUL, 0x3c82406aUL, + 0x5471c3c2UL, 0x3ff166a4UL, 0x82ea1a32UL, 0x3c58f23bUL, 0x3c7d517bUL, + 0x3ff172b8UL, 0xb9d78a76UL, 0xbc819041UL, 0x8695bbc0UL, 0x3ff17ed4UL, + 0xe2ac5a64UL, 0x3c709e3fUL, 0x388c8deaUL, 0x3ff18af9UL, 0xd1970f6cUL, + 0xbc911023UL, 0x58375d2fUL, 0x3ff19726UL, 0x85f17e08UL, 0x3c94aaddUL, + 0xeb6fcb75UL, 0x3ff1a35bUL, 0x7b4968e4UL, 0x3c8e5b4cUL, 0xf8138a1cUL, + 0x3ff1af99UL, 0xa4b69280UL, 0x3c97bf85UL, 0x84045cd4UL, 0x3ff1bbe0UL, + 0x352ef607UL, 0xbc995386UL, 0x95281c6bUL, 0x3ff1c82fUL, 0x8010f8c9UL, + 0x3c900977UL, 0x3168b9aaUL, 0x3ff1d487UL, 0x00a2643cUL, 0x3c9e016eUL, + 0x5eb44027UL, 0x3ff1e0e7UL, 0x088cb6deUL, 0xbc96fdd8UL, 0x22fcd91dUL, + 0x3ff1ed50UL, 0x027bb78cUL, 0xbc91df98UL, 0x8438ce4dUL, 0x3ff1f9c1UL, + 0xa097af5cUL, 0xbc9bf524UL, 0x88628cd6UL, 0x3ff2063bUL, 0x814a8495UL, + 0x3c8dc775UL, 0x3578a819UL, 0x3ff212beUL, 0x2cfcaac9UL, 0x3c93592dUL, + 0x917ddc96UL, 0x3ff21f49UL, 0x9494a5eeUL, 0x3c82a97eUL, 0xa27912d1UL, + 0x3ff22bddUL, 0x5577d69fUL, 0x3c8d34fbUL, 0x6e756238UL, 0x3ff2387aUL, + 0xb6c70573UL, 0x3c99b07eUL, 0xfb82140aUL, 0x3ff2451fUL, 0x911ca996UL, + 0x3c8acfccUL, 0x4fb2a63fUL, 0x3ff251ceUL, 0xbef4f4a4UL, 0x3c8ac155UL, + 0x711ece75UL, 0x3ff25e85UL, 0x4ac31b2cUL, 0x3c93e1a2UL, 0x65e27cddUL, + 0x3ff26b45UL, 0x9940e9d9UL, 0x3c82bd33UL, 0x341ddf29UL, 0x3ff2780eUL, + 0x05f9e76cUL, 0x3c9e067cUL, 0xe1f56381UL, 0x3ff284dfUL, 0x8c3f0d7eUL, + 0xbc9a4c3aUL, 0x7591bb70UL, 0x3ff291baUL, 0x28401cbdUL, 0xbc82cc72UL, + 0xf51fdee1UL, 0x3ff29e9dUL, 0xafad1255UL, 0x3c8612e8UL, 0x66d10f13UL, + 0x3ff2ab8aUL, 0x191690a7UL, 0xbc995743UL, 0xd0dad990UL, 0x3ff2b87fUL, + 0xd6381aa4UL, 0xbc410adcUL, 0x39771b2fUL, 0x3ff2c57eUL, 0xa6eb5124UL, + 0xbc950145UL, 0xa6e4030bUL, 0x3ff2d285UL, 0x54db41d5UL, 0x3c900247UL, + 0x1f641589UL, 0x3ff2df96UL, 0xfbbce198UL, 0x3c9d16cfUL, 0xa93e2f56UL, + 0x3ff2ecafUL, 0x45d52383UL, 0x3c71ca0fUL, 0x4abd886bUL, 0x3ff2f9d2UL, + 0x532bda93UL, 0xbc653c55UL, 0x0a31b715UL, 0x3ff306feUL, 0xd23182e4UL, + 0x3c86f46aUL, 0xedeeb2fdUL, 0x3ff31432UL, 0xf3f3fcd1UL, 0x3c8959a3UL, + 0xfc4cd831UL, 0x3ff32170UL, 0x8e18047cUL, 0x3c8a9ce7UL, 0x3ba8ea32UL, + 0x3ff32eb8UL, 0x3cb4f318UL, 0xbc9c45e8UL, 0xb26416ffUL, 0x3ff33c08UL, + 0x843659a6UL, 0x3c932721UL, 0x66e3fa2dUL, 0x3ff34962UL, 0x930881a4UL, + 0xbc835a75UL, 0x5f929ff1UL, 0x3ff356c5UL, 0x5c4e4628UL, 0xbc8b5ceeUL, + 0xa2de883bUL, 0x3ff36431UL, 0xa06cb85eUL, 0xbc8c3144UL, 0x373aa9cbUL, + 0x3ff371a7UL, 0xbf42eae2UL, 0xbc963aeaUL, 0x231e754aUL, 0x3ff37f26UL, + 0x9eceb23cUL, 0xbc99f5caUL, 0x6d05d866UL, 0x3ff38caeUL, 0x3c9904bdUL, + 0xbc9e958dUL, 0x1b7140efUL, 0x3ff39a40UL, 0xfc8e2934UL, 0xbc99a9a5UL, + 0x34e59ff7UL, 0x3ff3a7dbUL, 0xd661f5e3UL, 0xbc75e436UL, 0xbfec6cf4UL, + 0x3ff3b57fUL, 0xe26fff18UL, 0x3c954c66UL, 0xc313a8e5UL, 0x3ff3c32dUL, + 0x375d29c3UL, 0xbc9efff8UL, 0x44ede173UL, 0x3ff3d0e5UL, 0x8c284c71UL, + 0x3c7fe8d0UL, 0x4c123422UL, 0x3ff3dea6UL, 0x11f09ebcUL, 0x3c8ada09UL, + 0xdf1c5175UL, 0x3ff3ec70UL, 0x7b8c9bcaUL, 0xbc8af663UL, 0x04ac801cUL, + 0x3ff3fa45UL, 0xf956f9f3UL, 0xbc97d023UL, 0xc367a024UL, 0x3ff40822UL, + 0xb6f4d048UL, 0x3c8bddf8UL, 0x21f72e2aUL, 0x3ff4160aUL, 0x1c309278UL, + 0xbc5ef369UL, 0x2709468aUL, 0x3ff423fbUL, 0xc0b314ddUL, 0xbc98462dUL, + 0xd950a897UL, 0x3ff431f5UL, 0xe35f7999UL, 0xbc81c7ddUL, 0x3f84b9d4UL, + 0x3ff43ffaUL, 0x9704c003UL, 0x3c8880beUL, 0x6061892dUL, 0x3ff44e08UL, + 0x04ef80d0UL, 0x3c489b7aUL, 0x42a7d232UL, 0x3ff45c20UL, 0x82fb1f8eUL, + 0xbc686419UL, 0xed1d0057UL, 0x3ff46a41UL, 0xd1648a76UL, 0x3c9c944bUL, + 0x668b3237UL, 0x3ff4786dUL, 0xed445733UL, 0xbc9c20f0UL, 0xb5c13cd0UL, + 0x3ff486a2UL, 0xb69062f0UL, 0x3c73c1a3UL, 0xe192aed2UL, 0x3ff494e1UL, + 0x5e499ea0UL, 0xbc83b289UL, 0xf0d7d3deUL, 0x3ff4a32aUL, 0xf3d1be56UL, + 0x3c99cb62UL, 0xea6db7d7UL, 0x3ff4b17dUL, 0x7f2897f0UL, 0xbc8125b8UL, + 0xd5362a27UL, 0x3ff4bfdaUL, 0xafec42e2UL, 0x3c7d4397UL, 0xb817c114UL, + 0x3ff4ce41UL, 0x690abd5dUL, 0x3c905e29UL, 0x99fddd0dUL, 0x3ff4dcb2UL, + 0xbc6a7833UL, 0x3c98ecdbUL, 0x81d8abffUL, 0x3ff4eb2dUL, 0x2e5d7a52UL, + 0xbc95257dUL, 0x769d2ca7UL, 0x3ff4f9b2UL, 0xd25957e3UL, 0xbc94b309UL, + 0x7f4531eeUL, 0x3ff50841UL, 0x49b7465fUL, 0x3c7a249bUL, 0xa2cf6642UL, + 0x3ff516daUL, 0x69bd93efUL, 0xbc8f7685UL, 0xe83f4eefUL, 0x3ff5257dUL, + 0x43efef71UL, 0xbc7c998dUL, 0x569d4f82UL, 0x3ff5342bUL, 0x1db13cadUL, + 0xbc807abeUL, 0xf4f6ad27UL, 0x3ff542e2UL, 0x192d5f7eUL, 0x3c87926dUL, + 0xca5d920fUL, 0x3ff551a4UL, 0xefede59bUL, 0xbc8d689cUL, 0xdde910d2UL, + 0x3ff56070UL, 0x168eebf0UL, 0xbc90fb6eUL, 0x36b527daUL, 0x3ff56f47UL, + 0x011d93adUL, 0x3c99bb2cUL, 0xdbe2c4cfUL, 0x3ff57e27UL, 0x8a57b9c4UL, + 0xbc90b98cUL, 0xd497c7fdUL, 0x3ff58d12UL, 0x5b9a1de8UL, 0x3c8295e1UL, + 0x27ff07ccUL, 0x3ff59c08UL, 0xe467e60fUL, 0xbc97e2ceUL, 0xdd485429UL, + 0x3ff5ab07UL, 0x054647adUL, 0x3c96324cUL, 0xfba87a03UL, 0x3ff5ba11UL, + 0x4c233e1aUL, 0xbc9b77a1UL, 0x8a5946b7UL, 0x3ff5c926UL, 0x816986a2UL, + 0x3c3c4b1bUL, 0x90998b93UL, 0x3ff5d845UL, 0xa8b45643UL, 0xbc9cd6a7UL, + 0x15ad2148UL, 0x3ff5e76fUL, 0x3080e65eUL, 0x3c9ba6f9UL, 0x20dceb71UL, + 0x3ff5f6a3UL, 0xe3cdcf92UL, 0xbc89eaddUL, 0xb976dc09UL, 0x3ff605e1UL, + 0x9b56de47UL, 0xbc93e242UL, 0xe6cdf6f4UL, 0x3ff6152aUL, 0x4ab84c27UL, + 0x3c9e4b3eUL, 0xb03a5585UL, 0x3ff6247eUL, 0x7e40b497UL, 0xbc9383c1UL, + 0x1d1929fdUL, 0x3ff633ddUL, 0xbeb964e5UL, 0x3c984710UL, 0x34ccc320UL, + 0x3ff64346UL, 0x759d8933UL, 0xbc8c483cUL, 0xfebc8fb7UL, 0x3ff652b9UL, + 0xc9a73e09UL, 0xbc9ae3d5UL, 0x82552225UL, 0x3ff66238UL, 0x87591c34UL, + 0xbc9bb609UL, 0xc70833f6UL, 0x3ff671c1UL, 0x586c6134UL, 0xbc8e8732UL, + 0xd44ca973UL, 0x3ff68155UL, 0x44f73e65UL, 0x3c6038aeUL, 0xb19e9538UL, + 0x3ff690f4UL, 0x9aeb445dUL, 0x3c8804bdUL, 0x667f3bcdUL, 0x3ff6a09eUL, + 0x13b26456UL, 0xbc9bdd34UL, 0xfa75173eUL, 0x3ff6b052UL, 0x2c9a9d0eUL, + 0x3c7a38f5UL, 0x750bdabfUL, 0x3ff6c012UL, 0x67ff0b0dUL, 0xbc728956UL, + 0xddd47645UL, 0x3ff6cfdcUL, 0xb6f17309UL, 0x3c9c7aa9UL, 0x3c651a2fUL, + 0x3ff6dfb2UL, 0x683c88abUL, 0xbc6bbe3aUL, 0x98593ae5UL, 0x3ff6ef92UL, + 0x9e1ac8b2UL, 0xbc90b974UL, 0xf9519484UL, 0x3ff6ff7dUL, 0x25860ef6UL, + 0xbc883c0fUL, 0x66f42e87UL, 0x3ff70f74UL, 0xd45aa65fUL, 0x3c59d644UL, + 0xe8ec5f74UL, 0x3ff71f75UL, 0x86887a99UL, 0xbc816e47UL, 0x86ead08aUL, + 0x3ff72f82UL, 0x2cd62c72UL, 0xbc920aa0UL, 0x48a58174UL, 0x3ff73f9aUL, + 0x6c65d53cUL, 0xbc90a8d9UL, 0x35d7cbfdUL, 0x3ff74fbdUL, 0x618a6e1cUL, + 0x3c9047fdUL, 0x564267c9UL, 0x3ff75febUL, 0x57316dd3UL, 0xbc902459UL, + 0xb1ab6e09UL, 0x3ff77024UL, 0x169147f8UL, 0x3c9b7877UL, 0x4fde5d3fUL, + 0x3ff78069UL, 0x0a02162dUL, 0x3c9866b8UL, 0x38ac1cf6UL, 0x3ff790b9UL, + 0x62aadd3eUL, 0x3c9349a8UL, 0x73eb0187UL, 0x3ff7a114UL, 0xee04992fUL, + 0xbc841577UL, 0x0976cfdbUL, 0x3ff7b17bUL, 0x8468dc88UL, 0xbc9bebb5UL, + 0x0130c132UL, 0x3ff7c1edUL, 0xd1164dd6UL, 0x3c9f124cUL, 0x62ff86f0UL, + 0x3ff7d26aUL, 0xfb72b8b4UL, 0x3c91bddbUL, 0x36cf4e62UL, 0x3ff7e2f3UL, + 0xba15797eUL, 0x3c705d02UL, 0x8491c491UL, 0x3ff7f387UL, 0xcf9311aeUL, + 0xbc807f11UL, 0x543e1a12UL, 0x3ff80427UL, 0x626d972bUL, 0xbc927c86UL, + 0xadd106d9UL, 0x3ff814d2UL, 0x0d151d4dUL, 0x3c946437UL, 0x994cce13UL, + 0x3ff82589UL, 0xd41532d8UL, 0xbc9d4c1dUL, 0x1eb941f7UL, 0x3ff8364cUL, + 0x31df2bd5UL, 0x3c999b9aUL, 0x4623c7adUL, 0x3ff8471aUL, 0xa341cdfbUL, + 0xbc88d684UL, 0x179f5b21UL, 0x3ff857f4UL, 0xf8b216d0UL, 0xbc5ba748UL, + 0x9b4492edUL, 0x3ff868d9UL, 0x9bd4f6baUL, 0xbc9fc6f8UL, 0xd931a436UL, + 0x3ff879caUL, 0xd2db47bdUL, 0x3c85d2d7UL, 0xd98a6699UL, 0x3ff88ac7UL, + 0xf37cb53aUL, 0x3c9994c2UL, 0xa478580fUL, 0x3ff89bd0UL, 0x4475202aUL, + 0x3c9d5395UL, 0x422aa0dbUL, 0x3ff8ace5UL, 0x56864b27UL, 0x3c96e9f1UL, + 0xbad61778UL, 0x3ff8be05UL, 0xfc43446eUL, 0x3c9ecb5eUL, 0x16b5448cUL, + 0x3ff8cf32UL, 0x32e9e3aaUL, 0xbc70d55eUL, 0x5e0866d9UL, 0x3ff8e06aUL, + 0x6fc9b2e6UL, 0xbc97114aUL, 0x99157736UL, 0x3ff8f1aeUL, 0xa2e3976cUL, + 0x3c85cc13UL, 0xd0282c8aUL, 0x3ff902feUL, 0x85fe3fd2UL, 0x3c9592caUL, + 0x0b91ffc6UL, 0x3ff9145bUL, 0x2e582524UL, 0xbc9dd679UL, 0x53aa2fe2UL, + 0x3ff925c3UL, 0xa639db7fUL, 0xbc83455fUL, 0xb0cdc5e5UL, 0x3ff93737UL, + 0x81b57ebcUL, 0xbc675fc7UL, 0x2b5f98e5UL, 0x3ff948b8UL, 0x797d2d99UL, + 0xbc8dc3d6UL, 0xcbc8520fUL, 0x3ff95a44UL, 0x96a5f039UL, 0xbc764b7cUL, + 0x9a7670b3UL, 0x3ff96bddUL, 0x7f19c896UL, 0xbc5ba596UL, 0x9fde4e50UL, + 0x3ff97d82UL, 0x7c1b85d1UL, 0xbc9d185bUL, 0xe47a22a2UL, 0x3ff98f33UL, + 0xa24c78ecUL, 0x3c7cabdaUL, 0x70ca07baUL, 0x3ff9a0f1UL, 0x91cee632UL, + 0xbc9173bdUL, 0x4d53fe0dUL, 0x3ff9b2bbUL, 0x4df6d518UL, 0xbc9dd84eUL, + 0x82a3f090UL, 0x3ff9c491UL, 0xb071f2beUL, 0x3c7c7c46UL, 0x194bb8d5UL, + 0x3ff9d674UL, 0xa3dd8233UL, 0xbc9516beUL, 0x19e32323UL, 0x3ff9e863UL, + 0x78e64c6eUL, 0x3c7824caUL, 0x8d07f29eUL, 0x3ff9fa5eUL, 0xaaf1faceUL, + 0xbc84a9ceUL, 0x7b5de565UL, 0x3ffa0c66UL, 0x5d1cd533UL, 0xbc935949UL, + 0xed8eb8bbUL, 0x3ffa1e7aUL, 0xee8be70eUL, 0x3c9c6618UL, 0xec4a2d33UL, + 0x3ffa309bUL, 0x7ddc36abUL, 0x3c96305cUL, 0x80460ad8UL, 0x3ffa42c9UL, + 0x589fb120UL, 0xbc9aa780UL, 0xb23e255dUL, 0x3ffa5503UL, 0xdb8d41e1UL, + 0xbc9d2f6eUL, 0x8af46052UL, 0x3ffa674aUL, 0x30670366UL, 0x3c650f56UL, + 0x1330b358UL, 0x3ffa799eUL, 0xcac563c7UL, 0x3c9bcb7eUL, 0x53c12e59UL, + 0x3ffa8bfeUL, 0xb2ba15a9UL, 0xbc94f867UL, 0x5579fdbfUL, 0x3ffa9e6bUL, + 0x0ef7fd31UL, 0x3c90fac9UL, 0x21356ebaUL, 0x3ffab0e5UL, 0xdae94545UL, + 0x3c889c31UL, 0xbfd3f37aUL, 0x3ffac36bUL, 0xcae76cd0UL, 0xbc8f9234UL, + 0x3a3c2774UL, 0x3ffad5ffUL, 0xb6b1b8e5UL, 0x3c97ef3bUL, 0x995ad3adUL, + 0x3ffae89fUL, 0x345dcc81UL, 0x3c97a1cdUL, 0xe622f2ffUL, 0x3ffafb4cUL, + 0x0f315ecdUL, 0xbc94b2fcUL, 0x298db666UL, 0x3ffb0e07UL, 0x4c80e425UL, + 0xbc9bdef5UL, 0x6c9a8952UL, 0x3ffb20ceUL, 0x4a0756ccUL, 0x3c94dd02UL, + 0xb84f15fbUL, 0x3ffb33a2UL, 0x3084d708UL, 0xbc62805eUL, 0x15b749b1UL, + 0x3ffb4684UL, 0xe9df7c90UL, 0xbc7f763dUL, 0x8de5593aUL, 0x3ffb5972UL, + 0xbbba6de3UL, 0xbc9c71dfUL, 0x29f1c52aUL, 0x3ffb6c6eUL, 0x52883f6eUL, + 0x3c92a8f3UL, 0xf2fb5e47UL, 0x3ffb7f76UL, 0x7e54ac3bUL, 0xbc75584fUL, + 0xf22749e4UL, 0x3ffb928cUL, 0x54cb65c6UL, 0xbc9b7216UL, 0x30a1064aUL, + 0x3ffba5b0UL, 0x0e54292eUL, 0xbc9efcd3UL, 0xb79a6f1fUL, 0x3ffbb8e0UL, + 0xc9696205UL, 0xbc3f52d1UL, 0x904bc1d2UL, 0x3ffbcc1eUL, 0x7a2d9e84UL, + 0x3c823dd0UL, 0xc3f3a207UL, 0x3ffbdf69UL, 0x60ea5b53UL, 0xbc3c2623UL, + 0x5bd71e09UL, 0x3ffbf2c2UL, 0x3f6b9c73UL, 0xbc9efdcaUL, 0x6141b33dUL, + 0x3ffc0628UL, 0xa1fbca34UL, 0xbc8d8a5aUL, 0xdd85529cUL, 0x3ffc199bUL, + 0x895048ddUL, 0x3c811065UL, 0xd9fa652cUL, 0x3ffc2d1cUL, 0x17c8a5d7UL, + 0xbc96e516UL, 0x5fffd07aUL, 0x3ffc40abUL, 0xe083c60aUL, 0x3c9b4537UL, + 0x78fafb22UL, 0x3ffc5447UL, 0x2493b5afUL, 0x3c912f07UL, 0x2e57d14bUL, + 0x3ffc67f1UL, 0xff483cadUL, 0x3c92884dUL, 0x8988c933UL, 0x3ffc7ba8UL, + 0xbe255559UL, 0xbc8e76bbUL, 0x9406e7b5UL, 0x3ffc8f6dUL, 0x48805c44UL, + 0x3c71acbcUL, 0x5751c4dbUL, 0x3ffca340UL, 0xd10d08f5UL, 0xbc87f2beUL, + 0xdcef9069UL, 0x3ffcb720UL, 0xd1e949dbUL, 0x3c7503cbUL, 0x2e6d1675UL, + 0x3ffccb0fUL, 0x86009092UL, 0xbc7d220fUL, 0x555dc3faUL, 0x3ffcdf0bUL, + 0x53829d72UL, 0xbc8dd83bUL, 0x5b5bab74UL, 0x3ffcf315UL, 0xb86dff57UL, + 0xbc9a08e9UL, 0x4a07897cUL, 0x3ffd072dUL, 0x43797a9cUL, 0xbc9cbc37UL, + 0x2b08c968UL, 0x3ffd1b53UL, 0x219a36eeUL, 0x3c955636UL, 0x080d89f2UL, + 0x3ffd2f87UL, 0x719d8578UL, 0xbc9d487bUL, 0xeacaa1d6UL, 0x3ffd43c8UL, + 0xbf5a1614UL, 0x3c93db53UL, 0xdcfba487UL, 0x3ffd5818UL, 0xd75b3707UL, + 0x3c82ed02UL, 0xe862e6d3UL, 0x3ffd6c76UL, 0x4a8165a0UL, 0x3c5fe87aUL, + 0x16c98398UL, 0x3ffd80e3UL, 0x8beddfe8UL, 0xbc911ec1UL, 0x71ff6075UL, + 0x3ffd955dUL, 0xbb9af6beUL, 0x3c9a052dUL, 0x03db3285UL, 0x3ffda9e6UL, + 0x696db532UL, 0x3c9c2300UL, 0xd63a8315UL, 0x3ffdbe7cUL, 0x926b8be4UL, + 0xbc9b76f1UL, 0xf301b460UL, 0x3ffdd321UL, 0x78f018c3UL, 0x3c92da57UL, + 0x641c0658UL, 0x3ffde7d5UL, 0x8e79ba8fUL, 0xbc9ca552UL, 0x337b9b5fUL, + 0x3ffdfc97UL, 0x4f184b5cUL, 0xbc91a5cdUL, 0x6b197d17UL, 0x3ffe1167UL, + 0xbd5c7f44UL, 0xbc72b529UL, 0x14f5a129UL, 0x3ffe2646UL, 0x817a1496UL, + 0xbc97b627UL, 0x3b16ee12UL, 0x3ffe3b33UL, 0x31fdc68bUL, 0xbc99f4a4UL, + 0xe78b3ff6UL, 0x3ffe502eUL, 0x80a9cc8fUL, 0x3c839e89UL, 0x24676d76UL, + 0x3ffe6539UL, 0x7522b735UL, 0xbc863ff8UL, 0xfbc74c83UL, 0x3ffe7a51UL, + 0xca0c8de2UL, 0x3c92d522UL, 0x77cdb740UL, 0x3ffe8f79UL, 0x80b054b1UL, + 0xbc910894UL, 0xa2a490daUL, 0x3ffea4afUL, 0x179c2893UL, 0xbc9e9c23UL, + 0x867cca6eUL, 0x3ffeb9f4UL, 0x2293e4f2UL, 0x3c94832fUL, 0x2d8e67f1UL, + 0x3ffecf48UL, 0xb411ad8cUL, 0xbc9c93f3UL, 0xa2188510UL, 0x3ffee4aaUL, + 0xa487568dUL, 0x3c91c68dUL, 0xee615a27UL, 0x3ffefa1bUL, 0x86a4b6b0UL, + 0x3c9dc7f4UL, 0x1cb6412aUL, 0x3fff0f9cUL, 0x65181d45UL, 0xbc932200UL, + 0x376bba97UL, 0x3fff252bUL, 0xbf0d8e43UL, 0x3c93a1a5UL, 0x48dd7274UL, + 0x3fff3ac9UL, 0x3ed837deUL, 0xbc795a5aUL, 0x5b6e4540UL, 0x3fff5076UL, + 0x2dd8a18bUL, 0x3c99d3e1UL, 0x798844f8UL, 0x3fff6632UL, 0x3539343eUL, + 0x3c9fa37bUL, 0xad9cbe14UL, 0x3fff7bfdUL, 0xd006350aUL, 0xbc9dbb12UL, + 0x02243c89UL, 0x3fff91d8UL, 0xa779f689UL, 0xbc612ea8UL, 0x819e90d8UL, + 0x3fffa7c1UL, 0xf3a5931eUL, 0x3c874853UL, 0x3692d514UL, 0x3fffbdbaUL, + 0x15098eb6UL, 0xbc796773UL, 0x2b8f71f1UL, 0x3fffd3c2UL, 0x966579e7UL, + 0x3c62eb74UL, 0x6b2a23d9UL, 0x3fffe9d9UL, 0x7442fde3UL, 0x3c74a603UL, + 0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL, 0x6fba4e77UL, + 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL, 0xfefa39efUL, 0x3fe62e42UL, + 0x00000000UL, 0x00000000UL, 0xfefa39efUL, 0x3fe62e42UL, 0xfefa39efUL, + 0xbfe62e42UL, 0xf8000000UL, 0xffffffffUL, 0xf8000000UL, 0xffffffffUL, + 0x00000000UL, 0x80000000UL, 0x00000000UL, 0x00000000UL + +}; + +//registers, +// input: xmm0, xmm1 +// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 +// eax, edx, ecx, ebx + +// Code generated by Intel C compiler for LIBM library + +void MacroAssembler::fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; + Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; + Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, L_2TAG_PACKET_14_0_2, L_2TAG_PACKET_15_0_2; + Label L_2TAG_PACKET_16_0_2, L_2TAG_PACKET_17_0_2, L_2TAG_PACKET_18_0_2, L_2TAG_PACKET_19_0_2; + Label L_2TAG_PACKET_20_0_2, L_2TAG_PACKET_21_0_2, L_2TAG_PACKET_22_0_2, L_2TAG_PACKET_23_0_2; + Label L_2TAG_PACKET_24_0_2, L_2TAG_PACKET_25_0_2, L_2TAG_PACKET_26_0_2, L_2TAG_PACKET_27_0_2; + Label L_2TAG_PACKET_28_0_2, L_2TAG_PACKET_29_0_2, L_2TAG_PACKET_30_0_2, L_2TAG_PACKET_31_0_2; + Label L_2TAG_PACKET_32_0_2, L_2TAG_PACKET_33_0_2, L_2TAG_PACKET_34_0_2, L_2TAG_PACKET_35_0_2; + Label L_2TAG_PACKET_36_0_2, L_2TAG_PACKET_37_0_2, L_2TAG_PACKET_38_0_2, L_2TAG_PACKET_39_0_2; + Label L_2TAG_PACKET_40_0_2, L_2TAG_PACKET_41_0_2, L_2TAG_PACKET_42_0_2, L_2TAG_PACKET_43_0_2; + Label L_2TAG_PACKET_44_0_2, L_2TAG_PACKET_45_0_2, L_2TAG_PACKET_46_0_2, L_2TAG_PACKET_47_0_2; + Label L_2TAG_PACKET_48_0_2, L_2TAG_PACKET_49_0_2, L_2TAG_PACKET_50_0_2, L_2TAG_PACKET_51_0_2; + Label L_2TAG_PACKET_52_0_2, L_2TAG_PACKET_53_0_2, L_2TAG_PACKET_54_0_2, L_2TAG_PACKET_55_0_2; + Label L_2TAG_PACKET_56_0_2, L_2TAG_PACKET_57_0_2, L_2TAG_PACKET_58_0_2, start; + + assert_different_registers(tmp, eax, ecx, edx); + + address static_const_table_pow = (address)_static_const_table_pow; + + bind(start); + subl(rsp, 120); + movl(Address(rsp, 64), tmp); + lea(tmp, ExternalAddress(static_const_table_pow)); + movsd(xmm0, Address(rsp, 128)); + movsd(xmm1, Address(rsp, 136)); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movl(ecx, 1069088768); + movdl(xmm7, ecx); + movsd(Address(rsp, 16), xmm1); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movsd(Address(rsp, 8), xmm0); + movdqu(xmm3, xmm0); + movl(edx, 8192); + movdl(xmm4, edx); + movdqu(xmm6, Address(tmp, 8240)); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + psllq(xmm0, 5); + movsd(xmm2, Address(tmp, 8256)); + psrlq(xmm0, 34); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + rcpss(xmm0, xmm0); + psllq(xmm3, 12); + addl(ecx, 16); + bsrl(ecx, ecx); + psrlq(xmm3, 12); + movl(Address(rsp, 24), rsi); + subl(eax, 16); + cmpl(eax, 32736); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); + movl(rsi, 0); + + bind(L_2TAG_PACKET_1_0_2); + mulss(xmm0, xmm7); + movl(edx, -1); + subl(ecx, 4); + shll(edx); + movdl(xmm5, edx); + por(xmm3, xmm1); + subl(eax, 16351); + cmpl(eax, 1); + jcc(Assembler::belowEqual, L_2TAG_PACKET_2_0_2); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + + bind(L_2TAG_PACKET_3_0_2); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + subl(eax, 1); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + + bind(L_2TAG_PACKET_4_0_2); + mulsd(xmm3, xmm0); + movdqu(xmm1, Address(tmp, 8272)); + subsd(xmm5, xmm2); + movdqu(xmm4, Address(tmp, 8288)); + movl(ecx, eax); + sarl(eax, 31); + addl(ecx, eax); + xorl(eax, ecx); + addl(eax, 1); + bsrl(eax, eax); + unpcklpd(xmm5, xmm3); + movdqu(xmm6, Address(tmp, 8304)); + addsd(xmm3, xmm5); + andl(edx, 16760832); + shrl(edx, 10); + addpd(xmm5, Address(tmp, edx, Address::times_1, -3616)); + movdqu(xmm0, Address(tmp, 8320)); + pshufd(xmm2, xmm3, 68); + mulsd(xmm3, xmm3); + mulpd(xmm1, xmm2); + mulpd(xmm4, xmm2); + addsd(xmm5, xmm7); + mulsd(xmm2, xmm3); + addpd(xmm6, xmm1); + mulsd(xmm3, xmm3); + addpd(xmm0, xmm4); + movsd(xmm1, Address(rsp, 16)); + movzwl(ecx, Address(rsp, 22)); + pshufd(xmm7, xmm5, 238); + movsd(xmm4, Address(tmp, 8368)); + mulpd(xmm6, xmm2); + pshufd(xmm3, xmm3, 68); + mulpd(xmm0, xmm2); + shll(eax, 4); + subl(eax, 15872); + andl(ecx, 32752); + addl(eax, ecx); + mulpd(xmm3, xmm6); + cmpl(eax, 624); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_5_0_2); + xorpd(xmm6, xmm6); + movl(edx, 17080); + pinsrw(xmm6, edx, 3); + movdqu(xmm2, xmm1); + pand(xmm4, xmm1); + subsd(xmm1, xmm4); + mulsd(xmm4, xmm5); + addsd(xmm0, xmm7); + mulsd(xmm1, xmm5); + movdqu(xmm7, xmm6); + addsd(xmm6, xmm4); + addpd(xmm3, xmm0); + movdl(edx, xmm6); + subsd(xmm6, xmm7); + pshufd(xmm0, xmm3, 238); + subsd(xmm4, xmm6); + addsd(xmm0, xmm3); + movl(ecx, edx); + andl(edx, 255); + addl(edx, edx); + movdqu(xmm5, Address(tmp, edx, Address::times_8, 8384)); + addsd(xmm4, xmm1); + mulsd(xmm2, xmm0); + movdqu(xmm7, Address(tmp, 12480)); + movdqu(xmm3, Address(tmp, 12496)); + shll(ecx, 12); + xorl(ecx, rsi); + andl(ecx, -1048576); + movdl(xmm6, ecx); + addsd(xmm2, xmm4); + movsd(xmm1, Address(tmp, 12512)); + pshufd(xmm0, xmm2, 68); + pshufd(xmm4, xmm2, 68); + mulpd(xmm0, xmm0); + movl(rsi, Address(rsp, 24)); + mulpd(xmm7, xmm4); + pshufd(xmm6, xmm6, 17); + mulsd(xmm1, xmm2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm1, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm1, xmm6); + pshufd(xmm3, xmm0, 238); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + addsd(xmm0, xmm1); + addsd(xmm0, xmm3); + addsd(xmm0, xmm5); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 128)); + movsd(xmm1, Address(rsp, 136)); + mulsd(xmm0, xmm1); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_0_0_2); + addl(eax, 16); + movl(edx, 32752); + andl(edx, eax); + cmpl(edx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_9_0_2); + + bind(L_2TAG_PACKET_10_0_2); + movl(ecx, Address(rsp, 16)); + xorl(edx, edx); + testl(ecx, ecx); + movl(ecx, 1); + cmovl(Assembler::notEqual, edx, ecx); + orl(edx, Address(rsp, 20)); + cmpl(edx, 1072693248); + jcc(Assembler::equal, L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 8)); + movsd(xmm3, Address(rsp, 8)); + movdl(edx, xmm3); + psrlq(xmm3, 32); + movdl(ecx, xmm3); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); + xorpd(xmm3, xmm3); + movl(eax, 18416); + pinsrw(xmm3, eax, 3); + mulsd(xmm0, xmm3); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movdqu(xmm3, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + movl(ecx, 18416); + psllq(xmm0, 5); + movsd(xmm2, Address(tmp, 8256)); + psrlq(xmm0, 34); + rcpss(xmm0, xmm0); + psllq(xmm3, 12); + movdqu(xmm6, Address(tmp, 8240)); + psrlq(xmm3, 12); + mulss(xmm0, xmm7); + movl(edx, -1024); + movdl(xmm5, edx); + por(xmm3, xmm1); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + movl(rsi, 0); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + andl(eax, 32752); + subl(eax, 18416); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_12_0_2); + movl(ecx, Address(rsp, 16)); + xorl(edx, edx); + testl(ecx, ecx); + movl(ecx, 1); + cmovl(Assembler::notEqual, edx, ecx); + orl(edx, Address(rsp, 20)); + cmpl(edx, 1072693248); + jcc(Assembler::equal, L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 8)); + movsd(xmm3, Address(rsp, 8)); + movdl(edx, xmm3); + psrlq(xmm3, 32); + movdl(ecx, xmm3); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); + xorpd(xmm3, xmm3); + movl(eax, 18416); + pinsrw(xmm3, eax, 3); + mulsd(xmm0, xmm3); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movdqu(xmm3, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + movl(ecx, 18416); + psllq(xmm0, 5); + movsd(xmm2, Address(tmp, 8256)); + psrlq(xmm0, 34); + rcpss(xmm0, xmm0); + psllq(xmm3, 12); + movdqu(xmm6, Address(tmp, 8240)); + psrlq(xmm3, 12); + mulss(xmm0, xmm7); + movl(edx, -1024); + movdl(xmm5, edx); + por(xmm3, xmm1); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + movl(rsi, INT_MIN); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + andl(eax, 32752); + subl(eax, 18416); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_5_0_2); + cmpl(eax, 0); + jcc(Assembler::less, L_2TAG_PACKET_13_0_2); + cmpl(eax, 752); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_14_0_2); + + bind(L_2TAG_PACKET_15_0_2); + addsd(xmm0, xmm7); + movsd(xmm2, Address(tmp, 12544)); + addpd(xmm3, xmm0); + xorpd(xmm6, xmm6); + movl(eax, 17080); + pinsrw(xmm6, eax, 3); + pshufd(xmm0, xmm3, 238); + addsd(xmm0, xmm3); + movdqu(xmm3, xmm5); + addsd(xmm5, xmm0); + movdqu(xmm4, xmm2); + subsd(xmm3, xmm5); + movdqu(xmm7, xmm5); + pand(xmm5, xmm2); + movdqu(xmm2, xmm1); + pand(xmm4, xmm1); + subsd(xmm7, xmm5); + addsd(xmm0, xmm3); + subsd(xmm1, xmm4); + mulsd(xmm4, xmm5); + addsd(xmm0, xmm7); + mulsd(xmm2, xmm0); + movdqu(xmm7, xmm6); + mulsd(xmm1, xmm5); + addsd(xmm6, xmm4); + movdl(eax, xmm6); + subsd(xmm6, xmm7); + addsd(xmm2, xmm1); + movdqu(xmm7, Address(tmp, 12480)); + movdqu(xmm3, Address(tmp, 12496)); + subsd(xmm4, xmm6); + pextrw(edx, xmm6, 3); + movl(ecx, eax); + andl(eax, 255); + addl(eax, eax); + movdqu(xmm5, Address(tmp, eax, Address::times_8, 8384)); + addsd(xmm2, xmm4); + sarl(ecx, 8); + movl(eax, ecx); + sarl(ecx, 1); + subl(eax, ecx); + shll(ecx, 20); + xorl(ecx, rsi); + movdl(xmm6, ecx); + movsd(xmm1, Address(tmp, 12512)); + andl(edx, 32767); + cmpl(edx, 16529); + jcc(Assembler::above, L_2TAG_PACKET_14_0_2); + pshufd(xmm0, xmm2, 68); + pshufd(xmm4, xmm2, 68); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm4); + pshufd(xmm6, xmm6, 17); + mulsd(xmm1, xmm2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm1, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm1, xmm6); + pshufd(xmm3, xmm0, 238); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + shll(eax, 4); + xorpd(xmm4, xmm4); + addl(eax, 16368); + pinsrw(xmm4, eax, 3); + addsd(xmm0, xmm1); + movl(rsi, Address(rsp, 24)); + addsd(xmm0, xmm3); + movdqu(xmm1, xmm0); + addsd(xmm0, xmm5); + mulsd(xmm0, xmm4); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_18_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_8_0_2); + movsd(xmm1, Address(rsp, 16)); + movsd(xmm0, Address(rsp, 8)); + movdqu(xmm2, xmm0); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_19_0_2); + addsd(xmm0, xmm0); + movdl(eax, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_20_0_2); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_20_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + movl(edx, 29); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_22_0_2); + movsd(xmm0, Address(rsp, 16)); + addpd(xmm0, xmm0); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_19_0_2); + movdl(eax, xmm1); + movdqu(xmm2, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_23_0_2); + pextrw(eax, xmm2, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_24_0_2); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); + + bind(L_2TAG_PACKET_24_0_2); + pextrw(eax, xmm0, 3); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_25_0_2); + testl(ecx, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_26_0_2); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_27_0_2); + movsd(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_28_0_2); + testl(eax, 2); + jcc(Assembler::notEqual, L_2TAG_PACKET_29_0_2); + jmp(L_2TAG_PACKET_28_0_2); + + bind(L_2TAG_PACKET_25_0_2); + shrl(ecx, 20); + andl(ecx, 2047); + cmpl(ecx, 1075); + jcc(Assembler::above, L_2TAG_PACKET_28_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_30_0_2); + cmpl(ecx, 1074); + jcc(Assembler::above, L_2TAG_PACKET_27_0_2); + cmpl(ecx, 1023); + jcc(Assembler::below, L_2TAG_PACKET_28_0_2); + movsd(xmm1, Address(rsp, 16)); + movl(eax, 17208); + xorpd(xmm3, xmm3); + pinsrw(xmm3, eax, 3); + movdqu(xmm4, xmm3); + addsd(xmm3, xmm1); + subsd(xmm4, xmm3); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_28_0_2); + movdl(eax, xmm3); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); + + bind(L_2TAG_PACKET_29_0_2); + movsd(xmm1, Address(rsp, 16)); + pextrw(eax, xmm1, 3); + andl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_18_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32768); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_28_0_2); + movsd(xmm1, Address(rsp, 16)); + pextrw(eax, xmm1, 3); + andl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_26_0_2); + + bind(L_2TAG_PACKET_31_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32752); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_30_0_2); + movsd(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); + jmp(L_2TAG_PACKET_29_0_2); + + bind(L_2TAG_PACKET_32_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 20); + movdl(edx, xmm1); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_33_0_2); + movsd(xmm0, Address(rsp, 16)); + addsd(xmm0, xmm0); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_33_0_2); + movsd(xmm0, Address(rsp, 8)); + pextrw(eax, xmm0, 3); + cmpl(eax, 49136); + jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); + movdl(ecx, xmm0); + psrlq(xmm0, 20); + movdl(edx, xmm0); + orl(ecx, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32760); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_34_0_2); + movsd(xmm1, Address(rsp, 16)); + andl(eax, 32752); + subl(eax, 16368); + pextrw(edx, xmm1, 3); + xorpd(xmm0, xmm0); + xorl(eax, edx); + andl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); + movl(ecx, 32752); + pinsrw(xmm0, ecx, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_35_0_2); + movdl(eax, xmm1); + cmpl(edx, 17184); + jcc(Assembler::above, L_2TAG_PACKET_36_0_2); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_37_0_2); + testl(eax, 2); + jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); + jmp(L_2TAG_PACKET_39_0_2); + + bind(L_2TAG_PACKET_36_0_2); + testl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); + jmp(L_2TAG_PACKET_39_0_2); + + bind(L_2TAG_PACKET_9_0_2); + movsd(xmm2, Address(rsp, 8)); + movdl(eax, xmm2); + psrlq(xmm2, 31); + movdl(ecx, xmm2); + orl(eax, ecx); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); + movsd(xmm1, Address(rsp, 16)); + pextrw(edx, xmm1, 3); + movdl(eax, xmm1); + movdqu(xmm2, xmm1); + psrlq(xmm2, 32); + movdl(ecx, xmm2); + addl(ecx, ecx); + orl(ecx, eax); + jcc(Assembler::equal, L_2TAG_PACKET_40_0_2); + andl(edx, 32752); + cmpl(edx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_32_0_2); + cmpl(edx, 17200); + jcc(Assembler::above, L_2TAG_PACKET_38_0_2); + cmpl(edx, 17184); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_35_0_2); + cmpl(edx, 16368); + jcc(Assembler::below, L_2TAG_PACKET_37_0_2); + movl(eax, 17208); + xorpd(xmm2, xmm2); + pinsrw(xmm2, eax, 3); + movdqu(xmm4, xmm2); + addsd(xmm2, xmm1); + subsd(xmm4, xmm2); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32767); + jcc(Assembler::notEqual, L_2TAG_PACKET_37_0_2); + movdl(eax, xmm2); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); + + bind(L_2TAG_PACKET_39_0_2); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movsd(xmm2, Address(tmp, 8256)); + movsd(xmm4, Address(rsp, 8)); + pextrw(eax, xmm4, 3); + movl(edx, 8192); + movdl(xmm4, edx); + andl(eax, 32767); + subl(eax, 16); + jcc(Assembler::less, L_2TAG_PACKET_12_0_2); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + addl(ecx, 16); + bsrl(ecx, ecx); + movl(rsi, INT_MIN); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_37_0_2); + xorpd(xmm1, xmm1); + movl(eax, 32752); + pinsrw(xmm1, eax, 3); + xorpd(xmm0, xmm0); + mulsd(xmm0, xmm1); + movl(edx, 28); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_38_0_2); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movsd(xmm2, Address(tmp, 8256)); + movsd(xmm4, Address(rsp, 8)); + pextrw(eax, xmm4, 3); + movl(edx, 8192); + movdl(xmm4, edx); + andl(eax, 32767); + subl(eax, 16); + jcc(Assembler::less, L_2TAG_PACKET_10_0_2); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + addl(ecx, 16); + bsrl(ecx, ecx); + movl(rsi, 0); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_23_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_26_0_2); + xorpd(xmm0, xmm0); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_13_0_2); + addl(eax, 384); + cmpl(eax, 0); + jcc(Assembler::less, L_2TAG_PACKET_41_0_2); + mulsd(xmm5, xmm1); + addsd(xmm0, xmm7); + shrl(rsi, 31); + addpd(xmm3, xmm0); + pshufd(xmm0, xmm3, 238); + addsd(xmm3, xmm0); + movsd(xmm4, Address(tmp, rsi, Address::times_8, 12528)); + mulsd(xmm1, xmm3); + xorpd(xmm0, xmm0); + movl(eax, 16368); + shll(rsi, 15); + orl(eax, rsi); + pinsrw(xmm0, eax, 3); + addsd(xmm5, xmm1); + movl(rsi, Address(rsp, 24)); + mulsd(xmm5, xmm4); + addsd(xmm0, xmm5); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_41_0_2); + movl(rsi, Address(rsp, 24)); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_40_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_42_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + movl(edx, 26); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_11_0_2); + movsd(xmm1, Address(rsp, 16)); + movdqu(xmm2, xmm1); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_43_0_2); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); + + bind(L_2TAG_PACKET_43_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_42_0_2); + shrl(edx, 21); + cmpl(edx, 1075); + jcc(Assembler::above, L_2TAG_PACKET_44_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_45_0_2); + cmpl(edx, 1023); + jcc(Assembler::below, L_2TAG_PACKET_44_0_2); + movsd(xmm1, Address(rsp, 16)); + movl(eax, 17208); + xorpd(xmm3, xmm3); + pinsrw(xmm3, eax, 3); + movdqu(xmm4, xmm3); + addsd(xmm3, xmm1); + subsd(xmm4, xmm3); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_44_0_2); + movdl(eax, xmm3); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_44_0_2); + + bind(L_2TAG_PACKET_46_0_2); + movsd(xmm0, Address(rsp, 8)); + testl(ecx, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_47_0_2); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_45_0_2); + movsd(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_46_0_2); + + bind(L_2TAG_PACKET_44_0_2); + testl(ecx, INT_MIN); + jcc(Assembler::equal, L_2TAG_PACKET_26_0_2); + xorpd(xmm0, xmm0); + + bind(L_2TAG_PACKET_47_0_2); + movl(eax, 16368); + xorpd(xmm1, xmm1); + pinsrw(xmm1, eax, 3); + divsd(xmm1, xmm0); + movdqu(xmm0, xmm1); + movl(edx, 27); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_14_0_2); + movsd(xmm2, Address(rsp, 8)); + movsd(xmm6, Address(rsp, 16)); + pextrw(eax, xmm2, 3); + pextrw(edx, xmm6, 3); + movl(ecx, 32752); + andl(ecx, edx); + cmpl(ecx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); + andl(eax, 32752); + subl(eax, 16368); + xorl(edx, eax); + testl(edx, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_49_0_2); + + bind(L_2TAG_PACKET_50_0_2); + movl(eax, 32736); + pinsrw(xmm0, eax, 3); + shrl(rsi, 16); + orl(eax, rsi); + pinsrw(xmm1, eax, 3); + movl(rsi, Address(rsp, 24)); + mulsd(xmm0, xmm1); + + bind(L_2TAG_PACKET_17_0_2); + movl(edx, 24); + + bind(L_2TAG_PACKET_21_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_49_0_2); + movl(eax, 16); + pinsrw(xmm0, eax, 3); + mulsd(xmm0, xmm0); + testl(rsi, INT_MIN); + jcc(Assembler::equal, L_2TAG_PACKET_51_0_2); + movsd(xmm2, Address(tmp, 12560)); + xorpd(xmm0, xmm2); + + bind(L_2TAG_PACKET_51_0_2); + movl(rsi, Address(rsp, 24)); + movl(edx, 25); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_16_0_2); + pextrw(ecx, xmm5, 3); + pextrw(edx, xmm4, 3); + movl(eax, -1); + andl(ecx, 32752); + subl(ecx, 16368); + andl(edx, 32752); + addl(edx, ecx); + movl(ecx, -31); + sarl(edx, 4); + subl(ecx, edx); + jcc(Assembler::lessEqual, L_2TAG_PACKET_52_0_2); + cmpl(ecx, 20); + jcc(Assembler::above, L_2TAG_PACKET_53_0_2); + shll(eax); + + bind(L_2TAG_PACKET_52_0_2); + movdl(xmm0, eax); + psllq(xmm0, 32); + pand(xmm0, xmm5); + subsd(xmm5, xmm0); + addsd(xmm5, xmm1); + mulsd(xmm0, xmm4); + mulsd(xmm5, xmm4); + addsd(xmm0, xmm5); + + bind(L_2TAG_PACKET_53_0_2); + movl(edx, 25); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movzwl(ecx, Address(rsp, 22)); + movl(edx, INT_MIN); + movdl(xmm1, edx); + xorpd(xmm7, xmm7); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + paddq(xmm1, xmm3); + pand(xmm5, xmm1); + andl(ecx, 32752); + cmpl(ecx, 16560); + jcc(Assembler::below, L_2TAG_PACKET_3_0_2); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + addl(eax, 16351); + shrl(eax, 4); + subl(eax, 1022); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + movsd(xmm4, Address(tmp, 0)); + mulsd(xmm3, xmm0); + movsd(xmm6, Address(tmp, 0)); + subsd(xmm5, xmm2); + movsd(xmm1, Address(tmp, 8)); + pshufd(xmm2, xmm3, 68); + unpcklpd(xmm5, xmm3); + addsd(xmm3, xmm5); + movsd(xmm0, Address(tmp, 8)); + andl(edx, 16760832); + shrl(edx, 10); + addpd(xmm7, Address(tmp, edx, Address::times_1, -3616)); + mulsd(xmm4, xmm5); + mulsd(xmm0, xmm5); + mulsd(xmm6, xmm2); + mulsd(xmm1, xmm2); + movdqu(xmm2, xmm5); + mulsd(xmm4, xmm5); + addsd(xmm5, xmm0); + movdqu(xmm0, xmm7); + addsd(xmm2, xmm3); + addsd(xmm7, xmm5); + mulsd(xmm6, xmm2); + subsd(xmm0, xmm7); + movdqu(xmm2, xmm7); + addsd(xmm7, xmm4); + addsd(xmm0, xmm5); + subsd(xmm2, xmm7); + addsd(xmm4, xmm2); + pshufd(xmm2, xmm5, 238); + movdqu(xmm5, xmm7); + addsd(xmm7, xmm2); + addsd(xmm4, xmm0); + movdqu(xmm0, Address(tmp, 8272)); + subsd(xmm5, xmm7); + addsd(xmm6, xmm4); + movdqu(xmm4, xmm7); + addsd(xmm5, xmm2); + addsd(xmm7, xmm1); + movdqu(xmm2, Address(tmp, 8336)); + subsd(xmm4, xmm7); + addsd(xmm6, xmm5); + addsd(xmm4, xmm1); + pshufd(xmm5, xmm7, 238); + movdqu(xmm1, xmm7); + addsd(xmm7, xmm5); + subsd(xmm1, xmm7); + addsd(xmm1, xmm5); + movdqu(xmm5, Address(tmp, 8352)); + pshufd(xmm3, xmm3, 68); + addsd(xmm6, xmm4); + addsd(xmm6, xmm1); + movdqu(xmm1, Address(tmp, 8304)); + mulpd(xmm0, xmm3); + mulpd(xmm2, xmm3); + pshufd(xmm4, xmm3, 68); + mulpd(xmm3, xmm3); + addpd(xmm0, xmm1); + addpd(xmm5, xmm2); + mulsd(xmm4, xmm3); + movsd(xmm2, Address(tmp, 16)); + mulpd(xmm3, xmm3); + movsd(xmm1, Address(rsp, 16)); + movzwl(ecx, Address(rsp, 22)); + mulpd(xmm0, xmm4); + pextrw(eax, xmm7, 3); + mulpd(xmm5, xmm4); + mulpd(xmm0, xmm3); + movsd(xmm4, Address(tmp, 8376)); + pand(xmm2, xmm7); + addsd(xmm5, xmm6); + subsd(xmm7, xmm2); + addpd(xmm5, xmm0); + andl(eax, 32752); + subl(eax, 16368); + andl(ecx, 32752); + cmpl(ecx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); + addl(ecx, eax); + cmpl(ecx, 16576); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_54_0_2); + pshufd(xmm0, xmm5, 238); + pand(xmm4, xmm1); + movdqu(xmm3, xmm1); + addsd(xmm5, xmm0); + subsd(xmm1, xmm4); + xorpd(xmm6, xmm6); + movl(edx, 17080); + pinsrw(xmm6, edx, 3); + addsd(xmm7, xmm5); + mulsd(xmm4, xmm2); + mulsd(xmm1, xmm2); + movdqu(xmm5, xmm6); + mulsd(xmm3, xmm7); + addsd(xmm6, xmm4); + addsd(xmm1, xmm3); + movdqu(xmm7, Address(tmp, 12480)); + movdl(edx, xmm6); + subsd(xmm6, xmm5); + movdqu(xmm3, Address(tmp, 12496)); + movsd(xmm2, Address(tmp, 12512)); + subsd(xmm4, xmm6); + movl(ecx, edx); + andl(edx, 255); + addl(edx, edx); + movdqu(xmm5, Address(tmp, edx, Address::times_8, 8384)); + addsd(xmm4, xmm1); + pextrw(edx, xmm6, 3); + shrl(ecx, 8); + movl(eax, ecx); + shrl(ecx, 1); + subl(eax, ecx); + shll(ecx, 20); + movdl(xmm6, ecx); + pshufd(xmm0, xmm4, 68); + pshufd(xmm1, xmm4, 68); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm1); + pshufd(xmm6, xmm6, 17); + mulsd(xmm2, xmm4); + andl(edx, 32767); + cmpl(edx, 16529); + jcc(Assembler::above, L_2TAG_PACKET_14_0_2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm2, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm2, xmm6); + pshufd(xmm3, xmm0, 238); + addl(eax, 1023); + shll(eax, 20); + orl(eax, rsi); + movdl(xmm4, eax); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + addsd(xmm0, xmm2); + psllq(xmm4, 32); + addsd(xmm0, xmm3); + movdqu(xmm1, xmm0); + addsd(xmm0, xmm5); + movl(rsi, Address(rsp, 24)); + mulsd(xmm0, xmm4); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_55_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_48_0_2); + movl(rsi, Address(rsp, 24)); + + bind(L_2TAG_PACKET_56_0_2); + movsd(xmm0, Address(rsp, 8)); + movsd(xmm1, Address(rsp, 16)); + addsd(xmm1, xmm1); + xorpd(xmm2, xmm2); + movl(eax, 49136); + pinsrw(xmm2, eax, 3); + addsd(xmm2, xmm0); + pextrw(eax, xmm2, 3); + cmpl(eax, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_57_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32760); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_57_0_2); + movdl(edx, xmm1); + movdqu(xmm3, xmm1); + psrlq(xmm3, 20); + movdl(ecx, xmm3); + orl(ecx, edx); + jcc(Assembler::equal, L_2TAG_PACKET_58_0_2); + addsd(xmm1, xmm1); + movdqu(xmm0, xmm1); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_58_0_2); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + pextrw(edx, xmm1, 3); + xorpd(xmm0, xmm0); + subl(eax, 16368); + xorl(eax, edx); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); + movl(edx, 32752); + pinsrw(xmm0, edx, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_54_0_2); + pextrw(eax, xmm1, 3); + pextrw(ecx, xmm2, 3); + xorl(eax, ecx); + testl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_50_0_2); + jmp(L_2TAG_PACKET_49_0_2); + + bind(L_2TAG_PACKET_6_0_2); + movl(tmp, Address(rsp, 64)); + +} + +#endif // !_LP64 diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 5f90a2fa803..57db8eeede0 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -2126,15 +2126,6 @@ class StubGenerator: public StubCodeGenerator { __ trigfunc('t'); __ ret(0); } - { - StubCodeMark mark(this, "StubRoutines", "pow"); - StubRoutines::_intrinsic_pow = (double (*)(double,double)) __ pc(); - - __ fld_d(Address(rsp, 12)); - __ fld_d(Address(rsp, 4)); - __ pow_with_fallback(0); - __ ret(0); - } } // AES intrinsic stubs @@ -3082,6 +3073,30 @@ class StubGenerator: public StubCodeGenerator { } + address generate_libmPow() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + const XMMRegister x2 = xmm2; + const XMMRegister x3 = xmm3; + + const XMMRegister x4 = xmm4; + const XMMRegister x5 = xmm5; + const XMMRegister x6 = xmm6; + const XMMRegister x7 = xmm7; + + const Register tmp = rbx; + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + __ fast_pow(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp); + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + + } // Safefetch stubs. @@ -3310,6 +3325,7 @@ class StubGenerator: public StubCodeGenerator { if (VM_Version::supports_sse2()) { StubRoutines::_dexp = generate_libmExp(); StubRoutines::_dlog = generate_libmLog(); + StubRoutines::_dpow = generate_libmPow(); } } diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index 5af262ad4cc..72babc6f146 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -3025,21 +3025,6 @@ class StubGenerator: public StubCodeGenerator { __ addq(rsp, 8); __ ret(0); } - { - StubCodeMark mark(this, "StubRoutines", "pow"); - StubRoutines::_intrinsic_pow = (double (*)(double,double)) __ pc(); - - __ subq(rsp, 8); - __ movdbl(Address(rsp, 0), xmm1); - __ fld_d(Address(rsp, 0)); - __ movdbl(Address(rsp, 0), xmm0); - __ fld_d(Address(rsp, 0)); - __ pow_with_fallback(0); - __ fstp_d(Address(rsp, 0)); - __ movdbl(xmm0, Address(rsp, 0)); - __ addq(rsp, 8); - __ ret(0); - } } // AES intrinsic stubs @@ -4283,6 +4268,48 @@ class StubGenerator: public StubCodeGenerator { } + address generate_libmPow() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + const XMMRegister x2 = xmm2; + const XMMRegister x3 = xmm3; + + const XMMRegister x4 = xmm4; + const XMMRegister x5 = xmm5; + const XMMRegister x6 = xmm6; + const XMMRegister x7 = xmm7; + + const Register tmp1 = r8; + const Register tmp2 = r9; + const Register tmp3 = r10; + const Register tmp4 = r11; + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + +#ifdef _WIN64 + // save the xmm registers which must be preserved 6-7 + __ subptr(rsp, 4 * wordSize); + __ movdqu(Address(rsp, 0), xmm6); + __ movdqu(Address(rsp, 2 * wordSize), xmm7); +#endif + __ fast_pow(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2, tmp3, tmp4); + +#ifdef _WIN64 + // restore xmm regs belonging to calling function + __ movdqu(xmm6, Address(rsp, 0)); + __ movdqu(xmm7, Address(rsp, 2 * wordSize)); + __ addptr(rsp, 4 * wordSize); +#endif + + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + + } #undef __ #define __ masm-> @@ -4478,6 +4505,7 @@ class StubGenerator: public StubCodeGenerator { if (VM_Version::supports_sse2()) { StubRoutines::_dexp = generate_libmExp(); StubRoutines::_dlog = generate_libmLog(); + StubRoutines::_dpow = generate_libmPow(); } } diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index b783c6cd206..cebd468acb6 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -9885,39 +9885,6 @@ instruct sqrtDPR_reg(regDPR dst, regDPR src) %{ ins_pipe( pipe_slow ); %} -instruct powDPR_reg(regDPR X, regDPR1 Y, eAXRegI rax, eDXRegI rdx, eCXRegI rcx, eFlagsReg cr) %{ - predicate (UseSSE<=1); - match(Set Y (PowD X Y)); // Raise X to the Yth power - effect(KILL rax, KILL rdx, KILL rcx, KILL cr); - format %{ "fast_pow $X $Y -> $Y // KILL $rax, $rcx, $rdx" %} - ins_encode %{ - __ subptr(rsp, 8); - __ fld_s($X$$reg - 1); - __ fast_pow(); - __ addptr(rsp, 8); - %} - ins_pipe( pipe_slow ); -%} - -instruct powD_reg(regD dst, regD src0, regD src1, eAXRegI rax, eDXRegI rdx, eCXRegI rcx, eFlagsReg cr) %{ - predicate (UseSSE>=2); - match(Set dst (PowD src0 src1)); // Raise src0 to the src1'th power - effect(KILL rax, KILL rdx, KILL rcx, KILL cr); - format %{ "fast_pow $src0 $src1 -> $dst // KILL $rax, $rcx, $rdx" %} - ins_encode %{ - __ subptr(rsp, 8); - __ movdbl(Address(rsp, 0), $src1$$XMMRegister); - __ fld_d(Address(rsp, 0)); - __ movdbl(Address(rsp, 0), $src0$$XMMRegister); - __ fld_d(Address(rsp, 0)); - __ fast_pow(); - __ fstp_d(Address(rsp, 0)); - __ movdbl($dst$$XMMRegister, Address(rsp, 0)); - __ addptr(rsp, 8); - %} - ins_pipe( pipe_slow ); -%} - instruct log10DPR_reg(regDPR1 dst, regDPR1 src) %{ predicate (UseSSE<=1); // The source Double operand on FPU stack diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index 0310acc22b6..9def843e07e 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -9864,24 +9864,6 @@ instruct log10D_reg(regD dst) %{ ins_pipe( pipe_slow ); %} -instruct powD_reg(regD dst, regD src0, regD src1, rax_RegI rax, rdx_RegI rdx, rcx_RegI rcx, rFlagsReg cr) %{ - match(Set dst (PowD src0 src1)); // Raise src0 to the src1'th power - effect(KILL rax, KILL rdx, KILL rcx, KILL cr); - format %{ "fast_pow $src0 $src1 -> $dst // KILL $rax, $rcx, $rdx" %} - ins_encode %{ - __ subptr(rsp, 8); - __ movdbl(Address(rsp, 0), $src1$$XMMRegister); - __ fld_d(Address(rsp, 0)); - __ movdbl(Address(rsp, 0), $src0$$XMMRegister); - __ fld_d(Address(rsp, 0)); - __ fast_pow(); - __ fstp_d(Address(rsp, 0)); - __ movdbl($dst$$XMMRegister, Address(rsp, 0)); - __ addptr(rsp, 8); - %} - ins_pipe( pipe_slow ); -%} - //----------Arithmetic Conversion Instructions--------------------------------- instruct roundFloat_nop(regF dst) diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index 90c965bfa88..4e5fe365e52 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -4018,7 +4018,6 @@ int MatchRule::is_expensive() const { strcmp(opType,"ModD")==0 || strcmp(opType,"ModF")==0 || strcmp(opType,"ModI")==0 || - strcmp(opType,"PowD")==0 || strcmp(opType,"SinD")==0 || strcmp(opType,"SqrtD")==0 || strcmp(opType,"TanD")==0 || diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp index 44f7364ec5f..8397df6a048 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.cpp +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp @@ -754,31 +754,6 @@ void LIR_OpVisitState::visit(LIR_Op* op) { break; } - case lir_pow: { - assert(op->as_Op2() != NULL, "must be"); - LIR_Op2* op2 = (LIR_Op2*)op; - - // On x86 pow needs two temporary fpu stack slots: tmp1 and - // tmp2. Register input operands as temps to guarantee that it - // doesn't overlap with the temporary slots. - assert(op2->_info == NULL, "not used"); - assert(op2->_opr1->is_valid() && op2->_opr2->is_valid(), "used"); - assert(op2->_tmp1->is_valid() && op2->_tmp2->is_valid() && op2->_tmp3->is_valid() - && op2->_tmp4->is_valid() && op2->_tmp5->is_valid(), "used"); - assert(op2->_result->is_valid(), "used"); - - do_input(op2->_opr1); do_temp(op2->_opr1); - do_input(op2->_opr2); do_temp(op2->_opr2); - do_temp(op2->_tmp1); - do_temp(op2->_tmp2); - do_temp(op2->_tmp3); - do_temp(op2->_tmp4); - do_temp(op2->_tmp5); - do_output(op2->_result); - - break; - } - // LIR_Op3 case lir_idiv: case lir_irem: { @@ -1769,7 +1744,6 @@ const char * LIR_Op::name() const { case lir_cos: s = "cos"; break; case lir_tan: s = "tan"; break; case lir_log10: s = "log10"; break; - case lir_pow: s = "pow"; break; case lir_logic_and: s = "logic_and"; break; case lir_logic_or: s = "logic_or"; break; case lir_logic_xor: s = "logic_xor"; break; diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp index 14651e14078..ade1fbd31cc 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.hpp +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp @@ -962,7 +962,6 @@ enum LIR_Code { , lir_cos , lir_tan , lir_log10 - , lir_pow , lir_logic_and , lir_logic_or , lir_logic_xor @@ -2198,7 +2197,6 @@ class LIR_List: public CompilationResourceObj { void sin (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_sin , from, tmp1, to, tmp2)); } void cos (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_cos , from, tmp1, to, tmp2)); } void tan (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_tan , from, tmp1, to, tmp2)); } - void pow (LIR_Opr arg1, LIR_Opr arg2, LIR_Opr res, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, LIR_Opr tmp4, LIR_Opr tmp5) { append(new LIR_Op2(lir_pow, arg1, arg2, res, tmp1, tmp2, tmp3, tmp4, tmp5)); } void add (LIR_Opr left, LIR_Opr right, LIR_Opr res) { append(new LIR_Op2(lir_add, left, right, res)); } void sub (LIR_Opr left, LIR_Opr right, LIR_Opr res, CodeEmitInfo* info = NULL) { append(new LIR_Op2(lir_sub, left, right, res, info)); } diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp index d6b687dc01c..4d016513ee7 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp @@ -740,7 +740,6 @@ void LIR_Assembler::emit_op2(LIR_Op2* op) { case lir_tan: case lir_cos: case lir_log10: - case lir_pow: intrinsic_op(op->code(), op->in_opr1(), op->in_opr2(), op->result_opr(), op); break; diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index d87862707cb..f474b00d20b 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -6603,7 +6603,6 @@ void LinearScanStatistic::collect(LinearScan* allocator) { case lir_cos: case lir_abs: case lir_log10: - case lir_pow: case lir_logic_and: case lir_logic_or: case lir_logic_xor: diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index bfd902c9a0b..1810017fdc8 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -319,6 +319,7 @@ const char* Runtime1::name_for_address(address entry) { FUNCTION_CASE(entry, StubRoutines::updateBytesCRC32()); FUNCTION_CASE(entry, StubRoutines::dexp()); FUNCTION_CASE(entry, StubRoutines::dlog()); + FUNCTION_CASE(entry, StubRoutines::dpow()); #undef FUNCTION_CASE diff --git a/hotspot/src/share/vm/opto/classes.hpp b/hotspot/src/share/vm/opto/classes.hpp index 0779c3b96a8..16ccc5817b6 100644 --- a/hotspot/src/share/vm/opto/classes.hpp +++ b/hotspot/src/share/vm/opto/classes.hpp @@ -216,7 +216,6 @@ macro(PartialSubtypeCheck) macro(Phi) macro(PopCountI) macro(PopCountL) -macro(PowD) macro(PrefetchAllocation) macro(Proj) macro(RShiftI) diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 6620e57be72..8e3b18e76d8 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -230,8 +230,6 @@ class LibraryCallKit : public GraphKit { bool inline_math_negateExactL(); bool inline_math_subtractExactI(bool is_decrement); bool inline_math_subtractExactL(bool is_decrement); - bool inline_pow(); - Node* finish_pow_exp(Node* result, Node* x, Node* y, const TypeFunc* call_type, address funcAddr, const char* funcName); bool inline_min_max(vmIntrinsics::ID id); bool inline_notify(vmIntrinsics::ID id); Node* generate_min_max(vmIntrinsics::ID id, Node* x, Node* y); @@ -1718,243 +1716,6 @@ bool LibraryCallKit::inline_trig(vmIntrinsics::ID id) { return true; } -Node* LibraryCallKit::finish_pow_exp(Node* result, Node* x, Node* y, const TypeFunc* call_type, address funcAddr, const char* funcName) { - //------------------- - //result=(result.isNaN())? funcAddr():result; - // Check: If isNaN() by checking result!=result? then either trap - // or go to runtime - Node* cmpisnan = _gvn.transform(new CmpDNode(result, result)); - // Build the boolean node - Node* bolisnum = _gvn.transform(new BoolNode(cmpisnan, BoolTest::eq)); - - if (!too_many_traps(Deoptimization::Reason_intrinsic)) { - { BuildCutout unless(this, bolisnum, PROB_STATIC_FREQUENT); - // The pow or exp intrinsic returned a NaN, which requires a call - // to the runtime. Recompile with the runtime call. - uncommon_trap(Deoptimization::Reason_intrinsic, - Deoptimization::Action_make_not_entrant); - } - return result; - } else { - // If this inlining ever returned NaN in the past, we compile a call - // to the runtime to properly handle corner cases - - IfNode* iff = create_and_xform_if(control(), bolisnum, PROB_STATIC_FREQUENT, COUNT_UNKNOWN); - Node* if_slow = _gvn.transform(new IfFalseNode(iff)); - Node* if_fast = _gvn.transform(new IfTrueNode(iff)); - - if (!if_slow->is_top()) { - RegionNode* result_region = new RegionNode(3); - PhiNode* result_val = new PhiNode(result_region, Type::DOUBLE); - - result_region->init_req(1, if_fast); - result_val->init_req(1, result); - - set_control(if_slow); - - const TypePtr* no_memory_effects = NULL; - Node* rt = make_runtime_call(RC_LEAF, call_type, funcAddr, funcName, - no_memory_effects, - x, top(), y, y ? top() : NULL); - Node* value = _gvn.transform(new ProjNode(rt, TypeFunc::Parms+0)); -#ifdef ASSERT - Node* value_top = _gvn.transform(new ProjNode(rt, TypeFunc::Parms+1)); - assert(value_top == top(), "second value must be top"); -#endif - - result_region->init_req(2, control()); - result_val->init_req(2, value); - set_control(_gvn.transform(result_region)); - return _gvn.transform(result_val); - } else { - return result; - } - } -} - -//------------------------------inline_pow------------------------------------- -// Inline power instructions, if possible. -bool LibraryCallKit::inline_pow() { - // Pseudocode for pow - // if (y == 2) { - // return x * x; - // } else { - // if (x <= 0.0) { - // long longy = (long)y; - // if ((double)longy == y) { // if y is long - // if (y + 1 == y) longy = 0; // huge number: even - // result = ((1&longy) == 0)?-DPow(abs(x), y):DPow(abs(x), y); - // } else { - // result = NaN; - // } - // } else { - // result = DPow(x,y); - // } - // if (result != result)? { - // result = uncommon_trap() or runtime_call(); - // } - // return result; - // } - - Node* x = round_double_node(argument(0)); - Node* y = round_double_node(argument(2)); - - Node* result = NULL; - - Node* const_two_node = makecon(TypeD::make(2.0)); - Node* cmp_node = _gvn.transform(new CmpDNode(y, const_two_node)); - Node* bool_node = _gvn.transform(new BoolNode(cmp_node, BoolTest::eq)); - IfNode* if_node = create_and_xform_if(control(), bool_node, PROB_STATIC_INFREQUENT, COUNT_UNKNOWN); - Node* if_true = _gvn.transform(new IfTrueNode(if_node)); - Node* if_false = _gvn.transform(new IfFalseNode(if_node)); - - RegionNode* region_node = new RegionNode(3); - region_node->init_req(1, if_true); - - Node* phi_node = new PhiNode(region_node, Type::DOUBLE); - // special case for x^y where y == 2, we can convert it to x * x - phi_node->init_req(1, _gvn.transform(new MulDNode(x, x))); - - // set control to if_false since we will now process the false branch - set_control(if_false); - - if (!too_many_traps(Deoptimization::Reason_intrinsic)) { - // Short form: skip the fancy tests and just check for NaN result. - result = _gvn.transform(new PowDNode(C, control(), x, y)); - } else { - // If this inlining ever returned NaN in the past, include all - // checks + call to the runtime. - - // Set the merge point for If node with condition of (x <= 0.0) - // There are four possible paths to region node and phi node - RegionNode *r = new RegionNode(4); - Node *phi = new PhiNode(r, Type::DOUBLE); - - // Build the first if node: if (x <= 0.0) - // Node for 0 constant - Node *zeronode = makecon(TypeD::ZERO); - // Check x:0 - Node *cmp = _gvn.transform(new CmpDNode(x, zeronode)); - // Check: If (x<=0) then go complex path - Node *bol1 = _gvn.transform(new BoolNode( cmp, BoolTest::le )); - // Branch either way - IfNode *if1 = create_and_xform_if(control(),bol1, PROB_STATIC_INFREQUENT, COUNT_UNKNOWN); - // Fast path taken; set region slot 3 - Node *fast_taken = _gvn.transform(new IfFalseNode(if1)); - r->init_req(3,fast_taken); // Capture fast-control - - // Fast path not-taken, i.e. slow path - Node *complex_path = _gvn.transform(new IfTrueNode(if1)); - - // Set fast path result - Node *fast_result = _gvn.transform(new PowDNode(C, control(), x, y)); - phi->init_req(3, fast_result); - - // Complex path - // Build the second if node (if y is long) - // Node for (long)y - Node *longy = _gvn.transform(new ConvD2LNode(y)); - // Node for (double)((long) y) - Node *doublelongy= _gvn.transform(new ConvL2DNode(longy)); - // Check (double)((long) y) : y - Node *cmplongy= _gvn.transform(new CmpDNode(doublelongy, y)); - // Check if (y isn't long) then go to slow path - - Node *bol2 = _gvn.transform(new BoolNode( cmplongy, BoolTest::ne )); - // Branch either way - IfNode *if2 = create_and_xform_if(complex_path,bol2, PROB_STATIC_INFREQUENT, COUNT_UNKNOWN); - Node* ylong_path = _gvn.transform(new IfFalseNode(if2)); - - Node *slow_path = _gvn.transform(new IfTrueNode(if2)); - - // Calculate DPow(abs(x), y)*(1 & (long)y) - // Node for constant 1 - Node *conone = longcon(1); - // 1& (long)y - Node *signnode= _gvn.transform(new AndLNode(conone, longy)); - - // A huge number is always even. Detect a huge number by checking - // if y + 1 == y and set integer to be tested for parity to 0. - // Required for corner case: - // (long)9.223372036854776E18 = max_jlong - // (double)(long)9.223372036854776E18 = 9.223372036854776E18 - // max_jlong is odd but 9.223372036854776E18 is even - Node* yplus1 = _gvn.transform(new AddDNode(y, makecon(TypeD::make(1)))); - Node *cmpyplus1= _gvn.transform(new CmpDNode(yplus1, y)); - Node *bolyplus1 = _gvn.transform(new BoolNode( cmpyplus1, BoolTest::eq )); - Node* correctedsign = NULL; - if (ConditionalMoveLimit != 0) { - correctedsign = _gvn.transform(CMoveNode::make(NULL, bolyplus1, signnode, longcon(0), TypeLong::LONG)); - } else { - IfNode *ifyplus1 = create_and_xform_if(ylong_path,bolyplus1, PROB_FAIR, COUNT_UNKNOWN); - RegionNode *r = new RegionNode(3); - Node *phi = new PhiNode(r, TypeLong::LONG); - r->init_req(1, _gvn.transform(new IfFalseNode(ifyplus1))); - r->init_req(2, _gvn.transform(new IfTrueNode(ifyplus1))); - phi->init_req(1, signnode); - phi->init_req(2, longcon(0)); - correctedsign = _gvn.transform(phi); - ylong_path = _gvn.transform(r); - record_for_igvn(r); - } - - // zero node - Node *conzero = longcon(0); - // Check (1&(long)y)==0? - Node *cmpeq1 = _gvn.transform(new CmpLNode(correctedsign, conzero)); - // Check if (1&(long)y)!=0?, if so the result is negative - Node *bol3 = _gvn.transform(new BoolNode( cmpeq1, BoolTest::ne )); - // abs(x) - Node *absx=_gvn.transform(new AbsDNode(x)); - // abs(x)^y - Node *absxpowy = _gvn.transform(new PowDNode(C, control(), absx, y)); - // -abs(x)^y - Node *negabsxpowy = _gvn.transform(new NegDNode (absxpowy)); - // (1&(long)y)==1?-DPow(abs(x), y):DPow(abs(x), y) - Node *signresult = NULL; - if (ConditionalMoveLimit != 0) { - signresult = _gvn.transform(CMoveNode::make(NULL, bol3, absxpowy, negabsxpowy, Type::DOUBLE)); - } else { - IfNode *ifyeven = create_and_xform_if(ylong_path,bol3, PROB_FAIR, COUNT_UNKNOWN); - RegionNode *r = new RegionNode(3); - Node *phi = new PhiNode(r, Type::DOUBLE); - r->init_req(1, _gvn.transform(new IfFalseNode(ifyeven))); - r->init_req(2, _gvn.transform(new IfTrueNode(ifyeven))); - phi->init_req(1, absxpowy); - phi->init_req(2, negabsxpowy); - signresult = _gvn.transform(phi); - ylong_path = _gvn.transform(r); - record_for_igvn(r); - } - // Set complex path fast result - r->init_req(2, ylong_path); - phi->init_req(2, signresult); - - static const jlong nan_bits = CONST64(0x7ff8000000000000); - Node *slow_result = makecon(TypeD::make(*(double*)&nan_bits)); // return NaN - r->init_req(1,slow_path); - phi->init_req(1,slow_result); - - // Post merge - set_control(_gvn.transform(r)); - record_for_igvn(r); - result = _gvn.transform(phi); - } - - result = finish_pow_exp(result, x, y, OptoRuntime::Math_DD_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dpow), "POW"); - - // control from finish_pow_exp is now input to the region node - region_node->set_req(2, control()); - // the result from finish_pow_exp is now input to the phi node - phi_node->init_req(2, result); - set_control(_gvn.transform(region_node)); - record_for_igvn(region_node); - set_result(_gvn.transform(phi_node)); - - C->set_has_split_ifs(true); // Has chance for split-if optimization - return true; -} - //------------------------------runtime_math----------------------------- bool LibraryCallKit::runtime_math(const TypeFunc* call_type, address funcAddr, const char* funcName) { assert(call_type == OptoRuntime::Math_DD_D_Type() || call_type == OptoRuntime::Math_D_D_Type(), @@ -2005,8 +1766,10 @@ bool LibraryCallKit::inline_math_native(vmIntrinsics::ID id) { return StubRoutines::dexp() != NULL ? runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dexp(), "dexp") : runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dexp), "EXP"); - case vmIntrinsics::_dpow: return Matcher::has_match_rule(Op_PowD) ? inline_pow() : - runtime_math(OptoRuntime::Math_DD_D_Type(), FN_PTR(SharedRuntime::dpow), "POW"); + case vmIntrinsics::_dpow: + return StubRoutines::dpow() != NULL ? + runtime_math(OptoRuntime::Math_DD_D_Type(), StubRoutines::dpow(), "dpow") : + runtime_math(OptoRuntime::Math_DD_D_Type(), FN_PTR(SharedRuntime::dpow), "POW"); #undef FN_PTR // These intrinsics are not yet correctly implemented diff --git a/hotspot/src/share/vm/opto/subnode.cpp b/hotspot/src/share/vm/opto/subnode.cpp index 4eb9dc9e2af..5429d5d4274 100644 --- a/hotspot/src/share/vm/opto/subnode.cpp +++ b/hotspot/src/share/vm/opto/subnode.cpp @@ -1519,17 +1519,3 @@ const Type *Log10DNode::Value( PhaseTransform *phase ) const { return TypeD::make( StubRoutines::intrinsic_log10( d ) ); } -//============================================================================= -//------------------------------Value------------------------------------------ -// Compute pow -const Type *PowDNode::Value( PhaseTransform *phase ) const { - const Type *t1 = phase->type( in(1) ); - if( t1 == Type::TOP ) return Type::TOP; - if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; - const Type *t2 = phase->type( in(2) ); - if( t2 == Type::TOP ) return Type::TOP; - if( t2->base() != Type::DoubleCon ) return Type::DOUBLE; - double d1 = t1->getd(); - double d2 = t2->getd(); - return TypeD::make( StubRoutines::intrinsic_pow( d1, d2 ) ); -} diff --git a/hotspot/src/share/vm/opto/subnode.hpp b/hotspot/src/share/vm/opto/subnode.hpp index caeaae93a42..3ee7b4763b1 100644 --- a/hotspot/src/share/vm/opto/subnode.hpp +++ b/hotspot/src/share/vm/opto/subnode.hpp @@ -491,20 +491,6 @@ public: virtual const Type *Value( PhaseTransform *phase ) const; }; -//------------------------------PowDNode--------------------------------------- -// Raise a double to a double power -class PowDNode : public Node { -public: - PowDNode(Compile* C, Node *c, Node *in1, Node *in2 ) : Node(c, in1, in2) { - init_flags(Flag_is_expensive); - C->add_expensive_node(this); - } - virtual int Opcode() const; - const Type *bottom_type() const { return Type::DOUBLE; } - virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type *Value( PhaseTransform *phase ) const; -}; - //-------------------------------ReverseBytesINode-------------------------------- // reverse bytes of an integer class ReverseBytesINode : public Node { diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp index 11b304f3410..21fe0c6054f 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.cpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp @@ -153,9 +153,9 @@ address StubRoutines::_vectorizedMismatch = NULL; address StubRoutines::_dexp = NULL; address StubRoutines::_dlog = NULL; +address StubRoutines::_dpow = NULL; double (* StubRoutines::_intrinsic_log10 )(double) = NULL; -double (* StubRoutines::_intrinsic_pow )(double, double) = NULL; double (* StubRoutines::_intrinsic_sin )(double) = NULL; double (* StubRoutines::_intrinsic_cos )(double) = NULL; double (* StubRoutines::_intrinsic_tan )(double) = NULL; diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index c224cd3a994..aff8ad0a0cf 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -212,6 +212,7 @@ class StubRoutines: AllStatic { static address _dexp; static address _dlog; + static address _dpow; // These are versions of the java.lang.Math methods which perform // the same operations as the intrinsic version. They are used for @@ -384,6 +385,7 @@ class StubRoutines: AllStatic { static address dexp() { return _dexp; } static address dlog() { return _dlog; } + static address dpow() { return _dpow; } static address select_fill_function(BasicType t, bool aligned, const char* &name); diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 44f459fdafd..dafa827c6c6 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -860,6 +860,7 @@ typedef CompactHashtable SymbolCompactHashTable; static_field(StubRoutines, _mulAdd, address) \ static_field(StubRoutines, _dexp, address) \ static_field(StubRoutines, _dlog, address) \ + static_field(StubRoutines, _dpow, address) \ static_field(StubRoutines, _vectorizedMismatch, address) \ static_field(StubRoutines, _jbyte_arraycopy, address) \ static_field(StubRoutines, _jshort_arraycopy, address) \ @@ -2058,7 +2059,6 @@ typedef CompactHashtable SymbolCompactHashTable; declare_c2_type(AtanDNode, Node) \ declare_c2_type(SqrtDNode, Node) \ declare_c2_type(Log10DNode, Node) \ - declare_c2_type(PowDNode, Node) \ declare_c2_type(ReverseBytesINode, Node) \ declare_c2_type(ReverseBytesLNode, Node) \ declare_c2_type(ReductionNode, Node) \ From cee2a179e6a3c656707a045fe540da7f724b7405 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Wed, 23 Dec 2015 20:19:42 -1000 Subject: [PATCH 161/228] 8143072: [JVMCI] Port JVMCI to AArch64 Reviewed-by: gdub, rschatz, twisti, kvn --- hotspot/.mx.jvmci/suite.py | 28 ++ hotspot/make/excludeSrc.make | 4 +- hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk | 1 + hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp | 4 +- .../src/cpu/aarch64/vm/globals_aarch64.hpp | 9 +- .../cpu/aarch64/vm/interp_masm_aarch64.cpp | 99 ++++-- .../cpu/aarch64/vm/interp_masm_aarch64.hpp | 6 + .../cpu/aarch64/vm/macroAssembler_aarch64.hpp | 2 +- .../src/cpu/aarch64/vm/nativeInst_aarch64.hpp | 14 +- .../cpu/aarch64/vm/sharedRuntime_aarch64.cpp | 94 +++++- .../templateInterpreterGenerator_aarch64.cpp | 13 + .../src/cpu/aarch64/vm/vmStructs_aarch64.hpp | 14 +- .../src/cpu/aarch64/vm/vm_version_aarch64.cpp | 14 +- .../src/cpu/aarch64/vm/vm_version_aarch64.hpp | 17 +- hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp | 8 +- hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp | 5 +- hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp | 17 +- hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp | 11 +- hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp | 6 +- hotspot/src/cpu/x86/vm/vmStructs_x86.hpp | 15 +- hotspot/src/cpu/x86/vm/vm_version_x86.cpp | 44 ++- hotspot/src/cpu/x86/vm/vm_version_x86.hpp | 90 +++--- hotspot/src/cpu/zero/vm/vm_version_zero.hpp | 3 - .../src/jdk/vm/ci/aarch64/AArch64.java | 237 ++++++++++++++ .../src/jdk/vm/ci/aarch64/AArch64Kind.java | 171 ++++++++++ .../AArch64HotSpotJVMCIBackendFactory.java | 131 ++++++++ .../aarch64/AArch64HotSpotRegisterConfig.java | 298 ++++++++++++++++++ .../AMD64HotSpotJVMCIBackendFactory.java | 48 +-- .../SPARCHotSpotJVMCIBackendFactory.java | 46 +-- .../jdk/vm/ci/hotspot/HotSpotVMConfig.java | 118 +++---- hotspot/src/os/aix/vm/os_aix.cpp | 2 +- .../src/share/vm/jvmci/vmStructs_jvmci.cpp | 14 +- hotspot/src/share/vm/prims/whitebox.cpp | 4 +- hotspot/src/share/vm/runtime/os.cpp | 2 +- hotspot/src/share/vm/runtime/vmStructs.cpp | 2 + hotspot/src/share/vm/runtime/vm_version.cpp | 4 + hotspot/src/share/vm/runtime/vm_version.hpp | 17 +- .../jvmci/JVM_GetJVMCIRuntimeTest.java | 2 +- .../jvmci/SecurityRestrictionsTest.java | 2 +- .../compilerToVM/AllocateCompileIdTest.java | 2 +- .../compilerToVM/CanInlineMethodTest.java | 2 +- .../compilerToVM/CollectCountersTest.java | 2 +- .../jvmci/compilerToVM/DebugOutputTest.java | 2 +- .../compilerToVM/DisassembleCodeBlobTest.java | 2 +- .../DoNotInlineOrCompileTest.java | 2 +- .../ExecuteInstalledCodeTest.java | 2 +- .../FindUniqueConcreteMethodTest.java | 2 +- .../jvmci/compilerToVM/GetBytecodeTest.java | 2 +- .../compilerToVM/GetClassInitializerTest.java | 2 +- .../compilerToVM/GetConstantPoolTest.java | 2 +- .../compilerToVM/GetExceptionTableTest.java | 2 +- .../compilerToVM/GetImplementorTest.java | 2 +- .../compilerToVM/GetLineNumberTableTest.java | 2 +- .../GetLocalVariableTableTest.java | 2 +- .../GetMaxCallTargetOffsetTest.java | 2 +- .../compilerToVM/GetNextStackFrameTest.java | 2 +- .../GetResolvedJavaMethodAtSlotTest.java | 2 +- .../GetResolvedJavaMethodTest.java | 2 +- .../compilerToVM/GetResolvedJavaTypeTest.java | 2 +- .../GetStackTraceElementTest.java | 2 +- .../jvmci/compilerToVM/GetSymbolTest.java | 2 +- .../GetVtableIndexForInterfaceTest.java | 2 +- .../HasCompiledCodeForOSRTest.java | 2 +- .../HasFinalizableSubclassTest.java | 2 +- .../InitializeConfigurationTest.java | 2 +- .../InvalidateInstalledCodeTest.java | 2 +- .../jvmci/compilerToVM/IsMatureTest.java | 2 +- .../JVM_RegisterJVMCINatives.java | 2 +- .../compilerToVM/LookupKlassInPoolTest.java | 2 +- .../jvmci/compilerToVM/LookupTypeTest.java | 2 +- .../MaterializeVirtualObjectTest.java | 2 +- ...ethodIsIgnoredBySecurityStackWalkTest.java | 2 +- .../compilerToVM/ReadUncompressedOopTest.java | 2 +- .../jvmci/compilerToVM/ReprofileTest.java | 2 +- .../ResolveConstantInPoolTest.java | 2 +- .../jvmci/compilerToVM/ResolveMethodTest.java | 2 +- .../compilerToVM/ResolveTypeInPoolTest.java | 2 +- .../ShouldDebugNonSafepointsTest.java | 2 +- .../compilerToVM/ShouldInlineMethodTest.java | 2 +- .../errors/TestInvalidCompilationResult.java | 2 +- .../jvmci/errors/TestInvalidDebugInfo.java | 2 +- .../jvmci/errors/TestInvalidOopMap.java | 2 +- .../JvmciCreateMetaAccessContextTest.java | 2 +- .../events/JvmciNotifyInstallEventTest.java | 2 +- .../jvmci/events/JvmciShutdownEventTest.java | 2 +- .../test/NestedBooleanOptionValueTest.java | 2 +- .../vm/ci/options/test/TestOptionValue.java | 2 +- .../jdk/vm/ci/runtime/test/ConstantTest.java | 2 +- .../vm/ci/runtime/test/RedefineClassTest.java | 2 +- ...lvedJavaTypeResolveConcreteMethodTest.java | 2 +- .../ResolvedJavaTypeResolveMethodTest.java | 2 +- .../test/TestConstantReflectionProvider.java | 2 +- .../jdk/vm/ci/runtime/test/TestJavaField.java | 2 +- .../vm/ci/runtime/test/TestJavaMethod.java | 2 +- .../jdk/vm/ci/runtime/test/TestJavaType.java | 2 +- .../runtime/test/TestMetaAccessProvider.java | 2 +- .../runtime/test/TestResolvedJavaField.java | 2 +- .../runtime/test/TestResolvedJavaMethod.java | 2 +- .../ci/runtime/test/TestResolvedJavaType.java | 2 +- 99 files changed, 1350 insertions(+), 386 deletions(-) create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java diff --git a/hotspot/.mx.jvmci/suite.py b/hotspot/.mx.jvmci/suite.py index 3fd3a3cddc1..cd6eac41bd1 100644 --- a/hotspot/.mx.jvmci/suite.py +++ b/hotspot/.mx.jvmci/suite.py @@ -169,6 +169,15 @@ suite = { # ------------- JVMCI:HotSpot ------------- + "jdk.vm.ci.aarch64" : { + "subDir" : "src/jdk.vm.ci/share/classes", + "sourceDirs" : ["src"], + "dependencies" : ["jdk.vm.ci.code"], + "checkstyle" : "jdk.vm.ci.service", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,AArch64", + }, + "jdk.vm.ci.amd64" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], @@ -213,6 +222,21 @@ suite = { "workingSets" : "JVMCI,HotSpot", }, + "jdk.vm.ci.hotspot.aarch64" : { + "subDir" : "src/jdk.vm.ci/share/classes", + "sourceDirs" : ["src"], + "dependencies" : [ + "jdk.vm.ci.aarch64", + "jdk.vm.ci.hotspot", + ], + "checkstyle" : "jdk.vm.ci.service", + "annotationProcessors" : [ + "JVMCI_SERVICE_PROCESSOR", + ], + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,HotSpot,AArch64", + }, + "jdk.vm.ci.hotspot.amd64" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], @@ -269,6 +293,7 @@ suite = { "jdk.vm.ci.inittimer", "jdk.vm.ci.runtime", "jdk.vm.ci.common", + "jdk.vm.ci.aarch64", "jdk.vm.ci.amd64", "jdk.vm.ci.sparc", ], @@ -288,6 +313,7 @@ suite = { "JVMCI_HOTSPOT" : { "subDir" : "src/jdk.vm.ci/share/classes", "dependencies" : [ + "jdk.vm.ci.hotspot.aarch64", "jdk.vm.ci.hotspot.amd64", "jdk.vm.ci.hotspot.sparc", ], @@ -345,9 +371,11 @@ suite = { "jdk.vm.ci.inittimer", "jdk.vm.ci.runtime", "jdk.vm.ci.common", + "jdk.vm.ci.aarch64", "jdk.vm.ci.amd64", "jdk.vm.ci.sparc", "jdk.vm.ci.hotspotvmconfig", + "jdk.vm.ci.hotspot.aarch64", "jdk.vm.ci.hotspot.amd64", "jdk.vm.ci.hotspot.sparc", "jdk.vm.ci.options.processor", diff --git a/hotspot/make/excludeSrc.make b/hotspot/make/excludeSrc.make index 9feb96861ee..cab00edf842 100644 --- a/hotspot/make/excludeSrc.make +++ b/hotspot/make/excludeSrc.make @@ -107,8 +107,8 @@ ifeq ($(INCLUDE_NMT), false) memTracker.cpp nmtDCmd.cpp mallocSiteTable.cpp endif -ifneq (,$(findstring $(Platform_arch_model), x86_64, sparc)) - # JVMCI is supported only on x86_64 and SPARC. +ifneq (,$(findstring $(Platform_arch_model), aarch64, arm_64, sparc, x86_64)) + # JVMCI is supported else INCLUDE_JVMCI := false endif diff --git a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk index 654a7f8fd32..1d9fd149467 100644 --- a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk +++ b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk @@ -57,6 +57,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JVMCI_SERVICE, \ PROC_SRC_SUBDIRS := \ jdk.vm.ci.hotspot \ + jdk.vm.ci.hotspot.aarch64 \ jdk.vm.ci.hotspot.amd64 \ jdk.vm.ci.hotspot.sparc \ jdk.vm.ci.runtime \ diff --git a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp index 52a0bb25c47..fc96c347d00 100644 --- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp @@ -454,11 +454,11 @@ frame frame::sender_for_interpreter_frame(RegisterMap* map) const { // This is the sp before any possible extension (adapter/locals). intptr_t* unextended_sp = interpreter_frame_sender_sp(); -#ifdef COMPILER2 +#if defined(COMPILER2) || INCLUDE_JVMCI if (map->update_map()) { update_map_with_saved_link(map, (intptr_t**) addr_at(link_offset)); } -#endif // COMPILER2 +#endif // COMPILER2 || INCLUDE_JVMCI return frame(sender_sp, unextended_sp, link(), sender_pc()); } diff --git a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp index 8e5ed8c43f0..b6a58d9a371 100644 --- a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp @@ -40,14 +40,7 @@ define_pd_global(bool, ImplicitNullChecks, true); // Generate code for im define_pd_global(bool, TrapBasedNullChecks, false); define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NULLs past to check cast -// See 4827828 for this change. There is no globals_core_i486.hpp. I can't -// assign a different value for C2 without touching a number of files. Use -// #ifdef to minimize the change as it's late in Mantis. -- FIXME. -// c1 doesn't have this problem because the fix to 4858033 assures us -// the the vep is aligned at CodeEntryAlignment whereas c2 only aligns -// the uep and the vep doesn't get real alignment but just slops on by -// only assured that the entry instruction meets the 5 byte size requirement. -#ifdef COMPILER2 +#if defined(COMPILER2) || INCLUDE_JVMCI define_pd_global(intx, CodeEntryAlignment, 64); #else define_pd_global(intx, CodeEntryAlignment, 16); diff --git a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp index 73f35a6bb44..b65a76aaf99 100644 --- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp @@ -1060,13 +1060,39 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver, bind(skip_receiver_profile); // The method data pointer needs to be updated to reflect the new target. +#if INCLUDE_JVMCI + if (MethodProfileWidth == 0) { + update_mdp_by_constant(mdp, in_bytes(VirtualCallData::virtual_call_data_size())); + } +#else // INCLUDE_JVMCI update_mdp_by_constant(mdp, in_bytes(VirtualCallData:: virtual_call_data_size())); +#endif // INCLUDE_JVMCI bind(profile_continue); } } +#if INCLUDE_JVMCI +void InterpreterMacroAssembler::profile_called_method(Register method, Register mdp, Register reg2) { + assert_different_registers(method, mdp, reg2); + if (ProfileInterpreter && MethodProfileWidth > 0) { + Label profile_continue; + + // If no method data exists, go to profile_continue. + test_method_data_pointer(mdp, profile_continue); + + Label done; + record_item_in_profile_helper(method, mdp, reg2, 0, done, MethodProfileWidth, + &VirtualCallData::method_offset, &VirtualCallData::method_count_offset, in_bytes(VirtualCallData::nonprofiled_receiver_count_offset())); + bind(done); + + update_mdp_by_constant(mdp, in_bytes(VirtualCallData::virtual_call_data_size())); + bind(profile_continue); + } +} +#endif // INCLUDE_JVMCI + // This routine creates a state machine for updating the multi-row // type profile at a virtual call site (or other type-sensitive bytecode). // The machine visits each row (of receiver/count) until the receiver type @@ -1086,14 +1112,36 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( if (is_virtual_call) { increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); } - return; - } +#if INCLUDE_JVMCI + else if (EnableJVMCI) { + increment_mdp_data_at(mdp, in_bytes(ReceiverTypeData::nonprofiled_receiver_count_offset())); + } +#endif // INCLUDE_JVMCI + } else { + int non_profiled_offset = -1; + if (is_virtual_call) { + non_profiled_offset = in_bytes(CounterData::count_offset()); + } +#if INCLUDE_JVMCI + else if (EnableJVMCI) { + non_profiled_offset = in_bytes(ReceiverTypeData::nonprofiled_receiver_count_offset()); + } +#endif // INCLUDE_JVMCI - int last_row = VirtualCallData::row_limit() - 1; + record_item_in_profile_helper(receiver, mdp, reg2, 0, done, TypeProfileWidth, + &VirtualCallData::receiver_offset, &VirtualCallData::receiver_count_offset, non_profiled_offset); + } +} + +void InterpreterMacroAssembler::record_item_in_profile_helper(Register item, Register mdp, + Register reg2, int start_row, Label& done, int total_rows, + OffsetFunction item_offset_fn, OffsetFunction item_count_offset_fn, + int non_profiled_offset) { + int last_row = total_rows - 1; assert(start_row <= last_row, "must be work left to do"); - // Test this row for both the receiver and for null. + // Test this row for both the item and for null. // Take any of three different outcomes: - // 1. found receiver => increment count and goto done + // 1. found item => increment count and goto done // 2. found null => keep looking for case 1, maybe allocate this cell // 3. found something else => keep looking for cases 1 and 2 // Case 3 is handled by a recursive call. @@ -1101,55 +1149,56 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( Label next_test; bool test_for_null_also = (row == start_row); - // See if the receiver is receiver[n]. - int recvr_offset = in_bytes(VirtualCallData::receiver_offset(row)); - test_mdp_data_at(mdp, recvr_offset, receiver, + // See if the item is item[n]. + int item_offset = in_bytes(item_offset_fn(row)); + test_mdp_data_at(mdp, item_offset, item, (test_for_null_also ? reg2 : noreg), next_test); - // (Reg2 now contains the receiver from the CallData.) + // (Reg2 now contains the item from the CallData.) - // The receiver is receiver[n]. Increment count[n]. - int count_offset = in_bytes(VirtualCallData::receiver_count_offset(row)); + // The item is item[n]. Increment count[n]. + int count_offset = in_bytes(item_count_offset_fn(row)); increment_mdp_data_at(mdp, count_offset); b(done); bind(next_test); if (test_for_null_also) { Label found_null; - // Failed the equality check on receiver[n]... Test for null. + // Failed the equality check on item[n]... Test for null. if (start_row == last_row) { // The only thing left to do is handle the null case. - if (is_virtual_call) { + if (non_profiled_offset >= 0) { cbz(reg2, found_null); - // Receiver did not match any saved receiver and there is no empty row for it. + // Item did not match any saved item and there is no empty row for it. // Increment total counter to indicate polymorphic case. - increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); + increment_mdp_data_at(mdp, non_profiled_offset); b(done); bind(found_null); } else { - cbz(reg2, done); + cbnz(reg2, done); } break; } // Since null is rare, make it be the branch-taken case. - cbz(reg2,found_null); + cbz(reg2, found_null); // Put all the "Case 3" tests here. - record_klass_in_profile_helper(receiver, mdp, reg2, start_row + 1, done, is_virtual_call); + record_item_in_profile_helper(item, mdp, reg2, start_row + 1, done, total_rows, + item_offset_fn, item_count_offset_fn, non_profiled_offset); - // Found a null. Keep searching for a matching receiver, + // Found a null. Keep searching for a matching item, // but remember that this is an empty (unused) slot. bind(found_null); } } - // In the fall-through case, we found no matching receiver, but we - // observed the receiver[start_row] is NULL. + // In the fall-through case, we found no matching item, but we + // observed the item[start_row] is NULL. - // Fill in the receiver field and increment the count. - int recvr_offset = in_bytes(VirtualCallData::receiver_offset(start_row)); - set_mdp_data_at(mdp, recvr_offset, receiver); - int count_offset = in_bytes(VirtualCallData::receiver_count_offset(start_row)); + // Fill in the item field and increment the count. + int item_offset = in_bytes(item_offset_fn(start_row)); + set_mdp_data_at(mdp, item_offset, item); + int count_offset = in_bytes(item_count_offset_fn(start_row)); mov(reg2, DataLayout::counter_increment); set_mdp_data_at(mdp, count_offset, reg2); if (start_row > 0) { diff --git a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp index 5cdfdecf2d3..2dbe364dfa1 100644 --- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp @@ -33,6 +33,7 @@ // This file specializes the assember with interpreter-specific macros +typedef ByteSize (*OffsetFunction)(uint); class InterpreterMacroAssembler: public MacroAssembler { #ifndef CC_INTERP @@ -248,6 +249,10 @@ class InterpreterMacroAssembler: public MacroAssembler { void record_klass_in_profile_helper(Register receiver, Register mdp, Register reg2, int start_row, Label& done, bool is_virtual_call); + void record_item_in_profile_helper(Register item, Register mdp, + Register reg2, int start_row, Label& done, int total_rows, + OffsetFunction item_offset_fn, OffsetFunction item_count_offset_fn, + int non_profiled_offset); void update_mdp_by_offset(Register mdp_in, int offset_of_offset); void update_mdp_by_offset(Register mdp_in, Register reg, int offset_of_disp); @@ -261,6 +266,7 @@ class InterpreterMacroAssembler: public MacroAssembler { void profile_virtual_call(Register receiver, Register mdp, Register scratch2, bool receiver_can_be_null = false); + void profile_called_method(Register method, Register mdp, Register reg2) NOT_JVMCI_RETURN; void profile_ret(Register return_bci, Register mdp); void profile_null_seen(Register mdp); void profile_typecheck(Register mdp, Register klass, Register scratch); diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp index ade0ba0eb97..b9274510563 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp @@ -417,7 +417,7 @@ class MacroAssembler: public Assembler { #define WRAP(INSN) \ void INSN(Register Rd, Register Rn, Register Rm, Register Ra) { \ - if ((VM_Version::cpu_cpuFeatures() & VM_Version::CPU_A53MAC) && Ra != zr) \ + if ((VM_Version::features() & VM_Version::CPU_A53MAC) && Ra != zr) \ nop(); \ Assembler::INSN(Rd, Rn, Rm, Ra); \ } diff --git a/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.hpp index 60e26e08270..d6b0cb84298 100644 --- a/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.hpp @@ -62,7 +62,6 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC { inline bool is_jump_or_nop(); inline bool is_cond_jump(); bool is_safepoint_poll(); - inline bool is_mov_literal64(); bool is_movz(); bool is_movk(); bool is_sigill_zombie_not_entrant(); @@ -98,6 +97,14 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC { static bool is_ldr_literal_at(address instr); static bool is_ldrw_to_zr(address instr); + static bool is_call_at(address instr) { + const uint32_t insn = (*(uint32_t*)instr); + return (insn >> 26) == 0b100101; + } + bool is_call() { + return is_call_at(addr_at(0)); + } + static bool maybe_cpool_ref(address instr) { return is_adrp_at(instr) || is_ldr_literal_at(instr); } @@ -157,11 +164,6 @@ class NativeCall: public NativeInstruction { inline friend NativeCall* nativeCall_at(address address); inline friend NativeCall* nativeCall_before(address return_address); - static bool is_call_at(address instr) { - const uint32_t insn = (*(uint32_t*)instr); - return (insn >> 26) == 0b100101; - } - static bool is_call_before(address return_address) { return is_call_at(return_address - NativeCall::return_address_offset); } diff --git a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp index 1533c8d024e..629eb6e560d 100644 --- a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp @@ -39,10 +39,13 @@ #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif -#ifdef COMPILER2 +#if defined(COMPILER2) || INCLUDE_JVMCI #include "adfiles/ad_aarch64.hpp" #include "opto/runtime.hpp" #endif +#if INCLUDE_JVMCI +#include "jvmci/jvmciJavaClasses.hpp" +#endif #ifdef BUILTIN_SIM #include "../../../../../../simulator/simulator.hpp" @@ -109,14 +112,14 @@ class RegisterSaver { }; OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words, bool save_vectors) { -#ifdef COMPILER2 +#if defined(COMPILER2) || INCLUDE_JVMCI if (save_vectors) { // Save upper half of vector registers int vect_words = 32 * 8 / wordSize; additional_frame_words += vect_words; } #else - assert(!save_vectors, "vectors are generated only by C2"); + assert(!save_vectors, "vectors are generated only by C2 and JVMCI"); #endif int frame_size_in_bytes = round_to(additional_frame_words*wordSize + @@ -166,7 +169,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_ void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_vectors) { #ifndef COMPILER2 - assert(!restore_vectors, "vectors are generated only by C2"); + assert(!restore_vectors, "vectors are generated only by C2 and JVMCI"); #endif __ pop_CPU_state(restore_vectors); __ leave(); @@ -547,6 +550,18 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm, // Pre-load the register-jump target early, to schedule it better. __ ldr(rscratch1, Address(rmethod, in_bytes(Method::from_compiled_offset()))); +#if INCLUDE_JVMCI + if (EnableJVMCI) { + // check if this call should be routed towards a specific entry point + __ ldr(rscratch2, Address(rthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset()))); + Label no_alternative_target; + __ cbz(rscratch2, no_alternative_target); + __ mov(rscratch1, rscratch2); + __ str(zr, Address(rthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset()))); + __ bind(no_alternative_target); + } +#endif // INCLUDE_JVMCI + // Now generate the shuffle code. for (int i = 0; i < total_args_passed; i++) { if (sig_bt[i] == T_VOID) { @@ -2237,7 +2252,13 @@ void SharedRuntime::generate_deopt_blob() { // Allocate space for the code ResourceMark rm; // Setup code generation tools - CodeBuffer buffer("deopt_blob", 2048, 1024); + int pad = 0; +#if INCLUDE_JVMCI + if (EnableJVMCI) { + pad += 512; // Increase the buffer size when compiling for JVMCI + } +#endif + CodeBuffer buffer("deopt_blob", 2048+pad, 1024); MacroAssembler* masm = new MacroAssembler(&buffer); int frame_size_in_words; OopMap* map = NULL; @@ -2294,6 +2315,12 @@ void SharedRuntime::generate_deopt_blob() { __ b(cont); int reexecute_offset = __ pc() - start; +#if defined(INCLUDE_JVMCI) && !defined(COMPILER1) + if (EnableJVMCI && UseJVMCICompiler) { + // JVMCI does not use this kind of deoptimization + __ should_not_reach_here(); + } +#endif // Reexecute case // return address is the pc describes what bci to do re-execute at @@ -2304,6 +2331,44 @@ void SharedRuntime::generate_deopt_blob() { __ movw(rcpool, Deoptimization::Unpack_reexecute); // callee-saved __ b(cont); +#if INCLUDE_JVMCI + Label after_fetch_unroll_info_call; + int implicit_exception_uncommon_trap_offset = 0; + int uncommon_trap_offset = 0; + + if (EnableJVMCI) { + implicit_exception_uncommon_trap_offset = __ pc() - start; + + __ ldr(lr, Address(rthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset()))); + __ str(zr, Address(rthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset()))); + + uncommon_trap_offset = __ pc() - start; + + // Save everything in sight. + RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words); + // fetch_unroll_info needs to call last_java_frame() + Label retaddr; + __ set_last_Java_frame(sp, noreg, retaddr, rscratch1); + + __ ldrw(c_rarg1, Address(rthread, in_bytes(JavaThread::pending_deoptimization_offset()))); + __ movw(rscratch1, -1); + __ strw(rscratch1, Address(rthread, in_bytes(JavaThread::pending_deoptimization_offset()))); + + __ movw(rcpool, (int32_t)Deoptimization::Unpack_reexecute); + __ mov(c_rarg0, rthread); + __ lea(rscratch1, + RuntimeAddress(CAST_FROM_FN_PTR(address, + Deoptimization::uncommon_trap))); + __ blrt(rscratch1, 2, 0, MacroAssembler::ret_type_integral); + __ bind(retaddr); + oop_maps->add_gc_map( __ pc()-start, map->deep_copy()); + + __ reset_last_Java_frame(false, false); + + __ b(after_fetch_unroll_info_call); + } // EnableJVMCI +#endif // INCLUDE_JVMCI + int exception_offset = __ pc() - start; // Prolog for exception case @@ -2395,7 +2460,13 @@ void SharedRuntime::generate_deopt_blob() { __ reset_last_Java_frame(false, true); - // Load UnrollBlock* into rdi +#if INCLUDE_JVMCI + if (EnableJVMCI) { + __ bind(after_fetch_unroll_info_call); + } +#endif + + // Load UnrollBlock* into r5 __ mov(r5, r0); __ ldrw(rcpool, Address(r5, Deoptimization::UnrollBlock::unpack_kind_offset_in_bytes())); @@ -2547,7 +2618,12 @@ void SharedRuntime::generate_deopt_blob() { _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_in_words); _deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset); - +#if INCLUDE_JVMCI + if (EnableJVMCI) { + _deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset); + _deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset); + } +#endif #ifdef BUILTIN_SIM if (NotifySimulator) { unsigned char *base = _deopt_blob->code_begin(); @@ -2560,7 +2636,7 @@ uint SharedRuntime::out_preserve_stack_slots() { return 0; } -#ifdef COMPILER2 +#if defined(COMPILER2) || INCLUDE_JVMCI //------------------------------generate_uncommon_trap_blob-------------------- void SharedRuntime::generate_uncommon_trap_blob() { // Allocate space for the code @@ -2943,7 +3019,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha } -#ifdef COMPILER2 +#if defined(COMPILER2) || INCLUDE_JVMCI // This is here instead of runtime_x86_64.cpp because it uses SimpleRuntimeFrame // //------------------------------generate_exception_blob--------------------------- diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp index fc1ddda99b0..5d5ccb3bc3c 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp @@ -225,6 +225,19 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, __ restore_constant_pool_cache(); __ get_method(rmethod); +#if INCLUDE_JVMCI + // Check if we need to take lock at entry of synchronized method. + if (UseJVMCICompiler) { + Label L; + __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset())); + __ cbz(rscratch1, L); + // Clear flag. + __ strb(zr, Address(rthread, JavaThread::pending_monitorenter_offset())); + // Take lock. + lock_method(); + __ bind(L); + } +#endif // handle exceptions { Label L; diff --git a/hotspot/src/cpu/aarch64/vm/vmStructs_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/vmStructs_aarch64.hpp index f7acc1cc7ec..66da9564512 100644 --- a/hotspot/src/cpu/aarch64/vm/vmStructs_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/vmStructs_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -30,16 +30,8 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ - \ - /******************************/ \ - /* JavaCallWrapper */ \ - /******************************/ \ - /******************************/ \ - /* JavaFrameAnchor */ \ - /******************************/ \ - volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) - +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ + volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) #define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp index 72cd0375f52..ddd41c3243b 100644 --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp @@ -67,8 +67,6 @@ int VM_Version::_model2; int VM_Version::_variant; int VM_Version::_revision; int VM_Version::_stepping; -int VM_Version::_cpuFeatures; -const char* VM_Version::_features_str = ""; static BufferBlob* stub_blob; static const int stub_size = 550; @@ -129,7 +127,7 @@ void VM_Version::get_processor_features() { char buf[512]; - _cpuFeatures = auxv; + _features = auxv; int cpu_lines = 0; if (FILE *f = fopen("/proc/cpuinfo", "r")) { @@ -154,12 +152,12 @@ void VM_Version::get_processor_features() { } // Enable vendor specific features - if (_cpu == CPU_CAVIUM && _variant == 0) _cpuFeatures |= CPU_DMB_ATOMICS; - if (_cpu == CPU_ARM && (_model == 0xd03 || _model2 == 0xd03)) _cpuFeatures |= CPU_A53MAC; + if (_cpu == CPU_CAVIUM && _variant == 0) _features |= CPU_DMB_ATOMICS; + if (_cpu == CPU_ARM && (_model == 0xd03 || _model2 == 0xd03)) _features |= CPU_A53MAC; // If an olde style /proc/cpuinfo (cpu_lines == 1) then if _model is an A57 (0xd07) // we assume the worst and assume we could be on a big little system and have // undisclosed A53 cores which we could be swapped to at any stage - if (_cpu == CPU_ARM && cpu_lines == 1 && _model == 0xd07) _cpuFeatures |= CPU_A53MAC; + if (_cpu == CPU_ARM && cpu_lines == 1 && _model == 0xd07) _features |= CPU_A53MAC; sprintf(buf, "0x%02x:0x%x:0x%03x:%d", _cpu, _variant, _model, _revision); if (_model2) sprintf(buf+strlen(buf), "(0x%03x)", _model2); @@ -169,7 +167,7 @@ void VM_Version::get_processor_features() { if (auxv & HWCAP_SHA1) strcat(buf, ", sha1"); if (auxv & HWCAP_SHA2) strcat(buf, ", sha256"); - _features_str = os::strdup(buf); + _features_string = os::strdup(buf); if (FLAG_IS_DEFAULT(UseCRC32)) { UseCRC32 = (auxv & HWCAP_CRC32) != 0; @@ -272,7 +270,7 @@ void VM_Version::get_processor_features() { } if (FLAG_IS_DEFAULT(UseBarriersForVolatile)) { - UseBarriersForVolatile = (_cpuFeatures & CPU_DMB_ATOMICS) != 0; + UseBarriersForVolatile = (_features & CPU_DMB_ATOMICS) != 0; } if (FLAG_IS_DEFAULT(UsePopCountInstruction)) { diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp index f5dc414b694..7cb6fd7ce1a 100644 --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp @@ -30,7 +30,8 @@ #include "runtime/vm_version.hpp" class VM_Version : public Abstract_VM_Version { -public: + friend class JVMCIVMStructs; + protected: static int _cpu; static int _model; @@ -38,9 +39,6 @@ protected: static int _variant; static int _revision; static int _stepping; - static int _cpuFeatures; // features returned by the "cpuid" instruction - // 0 if this instruction is not available - static const char* _features_str; static void get_processor_features(); @@ -52,7 +50,7 @@ public: static void assert_is_initialized() { } - enum { + enum Family { CPU_ARM = 'A', CPU_BROADCOM = 'B', CPU_CAVIUM = 'C', @@ -64,9 +62,9 @@ public: CPU_QUALCOM = 'Q', CPU_MARVELL = 'V', CPU_INTEL = 'i', - } cpuFamily; + }; - enum { + enum Feature_Flag { CPU_FP = (1<<0), CPU_ASIMD = (1<<1), CPU_EVTSTRM = (1<<2), @@ -77,16 +75,13 @@ public: CPU_CRC32 = (1<<7), CPU_A53MAC = (1 << 30), CPU_DMB_ATOMICS = (1 << 31), - } cpuFeatureFlags; + }; - static const char* cpu_features() { return _features_str; } static int cpu_family() { return _cpu; } static int cpu_model() { return _model; } static int cpu_model2() { return _model2; } static int cpu_variant() { return _variant; } static int cpu_revision() { return _revision; } - static int cpu_cpuFeatures() { return _cpuFeatures; } - }; #endif // CPU_AARCH64_VM_VM_VERSION_AARCH64_HPP diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index 0aa52d81dcd..16c4db8a042 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -37,8 +37,6 @@ # include -int VM_Version::_features = VM_Version::unknown_m; -const char* VM_Version::_features_str = ""; bool VM_Version::_is_determine_features_test_running = false; @@ -130,7 +128,7 @@ void VM_Version::initialize() { (has_tcheck() ? " tcheck" : "") // Make sure number of %s matches num_features! ); - _features_str = os::strdup(buf); + _features_string = os::strdup(buf); if (Verbose) { print_features(); } @@ -323,7 +321,7 @@ bool VM_Version::use_biased_locking() { } void VM_Version::print_features() { - tty->print_cr("Version: %s L1_data_cache_line_size=%d", cpu_features(), L1_data_cache_line_size()); + tty->print_cr("Version: %s L1_data_cache_line_size=%d", features_string(), L1_data_cache_line_size()); } #ifdef COMPILER2 @@ -722,7 +720,7 @@ void VM_Version::config_dscr() { } } -static int saved_features = 0; +static uint64_t saved_features = 0; void VM_Version::allow_all() { saved_features = _features; diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp index d5f6dc6cc81..741618c33c8 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp @@ -64,8 +64,7 @@ protected: tcheck_m = (1 << tcheck ), all_features_m = -1 }; - static int _features; - static const char* _features_str; + static bool _is_determine_features_test_running; static void print_features(); @@ -96,8 +95,6 @@ public: static bool has_vpmsumb() { return (_features & vpmsumb_m) != 0; } static bool has_tcheck() { return (_features & tcheck_m) != 0; } - static const char* cpu_features() { return _features_str; } - // Assembler testing static void allow_all(); static void revert(); diff --git a/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp b/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp index 24b008b4243..c8a8daf2844 100644 --- a/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, 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 @@ -29,21 +29,12 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ - \ - /******************************/ \ - /* JavaCallWrapper */ \ - /******************************/ \ - /******************************/ \ - /* JavaFrameAnchor */ \ - /******************************/ \ - volatile_nonstatic_field(JavaFrameAnchor, _flags, int) \ - static_field(VM_Version, _features, int) +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ + volatile_nonstatic_field(JavaFrameAnchor, _flags, int) #define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ - declare_toplevel_type(VM_Version) -#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ +#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ /******************************/ \ /* Register numbers (C2 only) */ \ /******************************/ \ diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp index 9fbc5df7e74..462ddb2ba06 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp @@ -30,13 +30,10 @@ #include "runtime/stubCodeGenerator.hpp" #include "vm_version_sparc.hpp" -int VM_Version::_features = VM_Version::unknown_m; -const char* VM_Version::_features_str = ""; unsigned int VM_Version::_L2_data_cache_line_size = 0; void VM_Version::initialize() { - - assert(_features != VM_Version::unknown_m, "System pre-initialization is not complete."); + assert(_features != 0, "System pre-initialization is not complete."); guarantee(VM_Version::has_v9(), "only SPARC v9 is supported"); PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes(); @@ -214,7 +211,7 @@ void VM_Version::initialize() { (!has_hardware_fsmuld() ? ", no-fsmuld" : "")); // buf is started with ", " or is empty - _features_str = os::strdup(strlen(buf) > 2 ? buf + 2 : buf); + _features_string = os::strdup(strlen(buf) > 2 ? buf + 2 : buf); // UseVIS is set to the smallest of what hardware supports and what // the command line requires. I.e., you cannot set UseVIS to 3 on @@ -408,7 +405,7 @@ void VM_Version::initialize() { } void VM_Version::print_features() { - tty->print_cr("Version:%s", cpu_features()); + tty->print_cr("Version:%s", _features); } int VM_Version::determine_features() { @@ -444,7 +441,7 @@ int VM_Version::determine_features() { return features; } -static int saved_features = 0; +static uint64_t saved_features = 0; void VM_Version::allow_all() { saved_features = _features; diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp index cc730abf68b..0609fa8b9a0 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp @@ -31,6 +31,7 @@ class VM_Version: public Abstract_VM_Version { friend class VMStructs; friend class JVMCIVMStructs; + protected: enum Feature_Flag { v8_instructions = 0, @@ -97,9 +98,6 @@ protected: niagara1_m = generic_v9_m | niagara1_unique_m }; - static int _features; - static const char* _features_str; - static unsigned int _L2_data_cache_line_size; static unsigned int L2_data_cache_line_size() { return _L2_data_cache_line_size; } @@ -175,8 +173,6 @@ public: // On T4 and newer Sparc BIS to the beginning of cache line always zeros it. static bool has_block_zeroing() { return has_blk_init() && is_T4(); } - static const char* cpu_features() { return _features_str; } - // default prefetch block size on sparc static intx prefetch_data_size() { return L2_data_cache_line_size(); } diff --git a/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp b/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp index a337ab14590..40e6e431882 100644 --- a/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, 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 @@ -30,20 +30,9 @@ // referenced by vmStructs.cpp. #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ - \ - /******************************/ \ - /* JavaCallWrapper */ \ - /******************************/ \ - /******************************/ \ - /* JavaFrameAnchor */ \ - /******************************/ \ - volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ - static_field(VM_Version, _cpuFeatures, uint64_t) - - + volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) #define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ - declare_toplevel_type(VM_Version) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ LP64_ONLY(declare_constant(frame::arg_reg_save_area_bytes)) \ diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index 63e1527f1df..b3b05547f02 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -35,9 +35,7 @@ int VM_Version::_cpu; int VM_Version::_model; int VM_Version::_stepping; -uint64_t VM_Version::_cpuFeatures; -const char* VM_Version::_features_str = ""; -VM_Version::CpuidInfo VM_Version::_cpuid_info = { 0, }; +VM_Version::CpuidInfo VM_Version::_cpuid_info = { 0, }; // Address of instruction which causes SEGV address VM_Version::_cpuinfo_segv_addr = 0; @@ -468,7 +466,7 @@ void VM_Version::get_processor_features() { _cpu = 4; // 486 by default _model = 0; _stepping = 0; - _cpuFeatures = 0; + _features = 0; _logical_processors_per_package = 1; // i486 internal cache is both I&D and has a 16-byte line size _L1_data_cache_line_size = 16; @@ -483,7 +481,7 @@ void VM_Version::get_processor_features() { _stepping = cpu_stepping(); if (cpu_family() > 4) { // it supports CPUID - _cpuFeatures = feature_flags(); + _features = feature_flags(); // Logical processors are only available on P4s and above, // and only if hyperthreading is available. _logical_processors_per_package = logical_processor_count(); @@ -522,24 +520,24 @@ void VM_Version::get_processor_features() { // If the OS doesn't support SSE, we can't use this feature even if the HW does if (!os::supports_sse()) - _cpuFeatures &= ~(CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE4A|CPU_SSE4_1|CPU_SSE4_2); + _features &= ~(CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE4A|CPU_SSE4_1|CPU_SSE4_2); if (UseSSE < 4) { - _cpuFeatures &= ~CPU_SSE4_1; - _cpuFeatures &= ~CPU_SSE4_2; + _features &= ~CPU_SSE4_1; + _features &= ~CPU_SSE4_2; } if (UseSSE < 3) { - _cpuFeatures &= ~CPU_SSE3; - _cpuFeatures &= ~CPU_SSSE3; - _cpuFeatures &= ~CPU_SSE4A; + _features &= ~CPU_SSE3; + _features &= ~CPU_SSSE3; + _features &= ~CPU_SSE4A; } if (UseSSE < 2) - _cpuFeatures &= ~CPU_SSE2; + _features &= ~CPU_SSE2; if (UseSSE < 1) - _cpuFeatures &= ~CPU_SSE; + _features &= ~CPU_SSE; // first try initial setting and detect what we can support if (UseAVX > 0) { @@ -557,25 +555,25 @@ void VM_Version::get_processor_features() { } if (UseAVX < 3) { - _cpuFeatures &= ~CPU_AVX512F; - _cpuFeatures &= ~CPU_AVX512DQ; - _cpuFeatures &= ~CPU_AVX512CD; - _cpuFeatures &= ~CPU_AVX512BW; - _cpuFeatures &= ~CPU_AVX512VL; + _features &= ~CPU_AVX512F; + _features &= ~CPU_AVX512DQ; + _features &= ~CPU_AVX512CD; + _features &= ~CPU_AVX512BW; + _features &= ~CPU_AVX512VL; } if (UseAVX < 2) - _cpuFeatures &= ~CPU_AVX2; + _features &= ~CPU_AVX2; if (UseAVX < 1) - _cpuFeatures &= ~CPU_AVX; + _features &= ~CPU_AVX; if (!UseAES && !FLAG_IS_DEFAULT(UseAES)) - _cpuFeatures &= ~CPU_AES; + _features &= ~CPU_AES; if (logical_processors_per_package() == 1) { // HT processor could be installed on a system which doesn't support HT. - _cpuFeatures &= ~CPU_HT; + _features &= ~CPU_HT; } char buf[256]; @@ -611,7 +609,7 @@ void VM_Version::get_processor_features() { (supports_bmi2() ? ", bmi2" : ""), (supports_adx() ? ", adx" : ""), (supports_evex() ? ", evex" : "")); - _features_str = os::strdup(buf); + _features_string = os::strdup(buf); // UseSSE is set to the smaller of what hardware supports and what // the command line requires. I.e., you cannot set UseSSE to 2 on diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp index 624f138d5be..77550a96a4c 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp @@ -31,7 +31,8 @@ class VM_Version : public Abstract_VM_Version { friend class VMStructs; friend class JVMCIVMStructs; -public: + + public: // cpuid result register layouts. These are all unions of a uint32_t // (in case anyone wants access to the register as a whole) and a bitfield. @@ -245,14 +246,11 @@ protected: static int _cpu; static int _model; static int _stepping; - static uint64_t _cpuFeatures; // features returned by the "cpuid" instruction - // 0 if this instruction is not available - static const char* _features_str; static address _cpuinfo_segv_addr; // address of instruction which causes SEGV static address _cpuinfo_cont_addr; // address of instruction after the one which causes SEGV - enum { + enum Feature_Flag { CPU_CX8 = (1 << 0), // next bits are from cpuid 1 (EDX) CPU_CMOV = (1 << 1), CPU_FXSR = (1 << 2), @@ -286,11 +284,11 @@ protected: CPU_AVX512ER = (1 << 29), CPU_AVX512CD = (1 << 30), CPU_AVX512BW = (1 << 31) - } cpuFeatureFlags; + }; #define CPU_AVX512VL UCONST64(0x100000000) // EVEX instructions with smaller vector length : enums are limited to 32bit - enum { + enum Extended_Family { // AMD CPU_FAMILY_AMD_11H = 0x11, // Intel @@ -308,7 +306,7 @@ protected: CPU_MODEL_HASWELL_E7 = 0x3f, CPU_MODEL_BROADWELL = 0x3d, CPU_MODEL_SKYLAKE = CPU_MODEL_HASWELL_E3 - } cpuExtendedFamily; + }; // cpuid information block. All info derived from executing cpuid with // various function numbers is stored here. Intel and AMD info is @@ -598,9 +596,9 @@ public: static void set_cpuinfo_cont_addr(address pc) { _cpuinfo_cont_addr = pc; } static address cpuinfo_cont_addr() { return _cpuinfo_cont_addr; } - static void clean_cpuFeatures() { _cpuFeatures = 0; } - static void set_avx_cpuFeatures() { _cpuFeatures = (CPU_SSE | CPU_SSE2 | CPU_AVX); } - static void set_evex_cpuFeatures() { _cpuFeatures = (CPU_AVX512F | CPU_SSE | CPU_SSE2 ); } + static void clean_cpuFeatures() { _features = 0; } + static void set_avx_cpuFeatures() { _features = (CPU_SSE | CPU_SSE2 | CPU_AVX); } + static void set_evex_cpuFeatures() { _features = (CPU_AVX512F | CPU_SSE | CPU_SSE2 ); } // Initialization @@ -688,36 +686,36 @@ public: // // Feature identification // - static bool supports_cpuid() { return _cpuFeatures != 0; } - static bool supports_cmpxchg8() { return (_cpuFeatures & CPU_CX8) != 0; } - static bool supports_cmov() { return (_cpuFeatures & CPU_CMOV) != 0; } - static bool supports_fxsr() { return (_cpuFeatures & CPU_FXSR) != 0; } - static bool supports_ht() { return (_cpuFeatures & CPU_HT) != 0; } - static bool supports_mmx() { return (_cpuFeatures & CPU_MMX) != 0; } - static bool supports_sse() { return (_cpuFeatures & CPU_SSE) != 0; } - static bool supports_sse2() { return (_cpuFeatures & CPU_SSE2) != 0; } - static bool supports_sse3() { return (_cpuFeatures & CPU_SSE3) != 0; } - static bool supports_ssse3() { return (_cpuFeatures & CPU_SSSE3)!= 0; } - static bool supports_sse4_1() { return (_cpuFeatures & CPU_SSE4_1) != 0; } - static bool supports_sse4_2() { return (_cpuFeatures & CPU_SSE4_2) != 0; } - static bool supports_popcnt() { return (_cpuFeatures & CPU_POPCNT) != 0; } - static bool supports_avx() { return (_cpuFeatures & CPU_AVX) != 0; } - static bool supports_avx2() { return (_cpuFeatures & CPU_AVX2) != 0; } - static bool supports_tsc() { return (_cpuFeatures & CPU_TSC) != 0; } - static bool supports_aes() { return (_cpuFeatures & CPU_AES) != 0; } - static bool supports_erms() { return (_cpuFeatures & CPU_ERMS) != 0; } - static bool supports_clmul() { return (_cpuFeatures & CPU_CLMUL) != 0; } - static bool supports_rtm() { return (_cpuFeatures & CPU_RTM) != 0; } - static bool supports_bmi1() { return (_cpuFeatures & CPU_BMI1) != 0; } - static bool supports_bmi2() { return (_cpuFeatures & CPU_BMI2) != 0; } - static bool supports_adx() { return (_cpuFeatures & CPU_ADX) != 0; } - static bool supports_evex() { return (_cpuFeatures & CPU_AVX512F) != 0; } - static bool supports_avx512dq() { return (_cpuFeatures & CPU_AVX512DQ) != 0; } - static bool supports_avx512pf() { return (_cpuFeatures & CPU_AVX512PF) != 0; } - static bool supports_avx512er() { return (_cpuFeatures & CPU_AVX512ER) != 0; } - static bool supports_avx512cd() { return (_cpuFeatures & CPU_AVX512CD) != 0; } - static bool supports_avx512bw() { return (_cpuFeatures & CPU_AVX512BW) != 0; } - static bool supports_avx512vl() { return (_cpuFeatures & CPU_AVX512VL) != 0; } + static bool supports_cpuid() { return _features != 0; } + static bool supports_cmpxchg8() { return (_features & CPU_CX8) != 0; } + static bool supports_cmov() { return (_features & CPU_CMOV) != 0; } + static bool supports_fxsr() { return (_features & CPU_FXSR) != 0; } + static bool supports_ht() { return (_features & CPU_HT) != 0; } + static bool supports_mmx() { return (_features & CPU_MMX) != 0; } + static bool supports_sse() { return (_features & CPU_SSE) != 0; } + static bool supports_sse2() { return (_features & CPU_SSE2) != 0; } + static bool supports_sse3() { return (_features & CPU_SSE3) != 0; } + static bool supports_ssse3() { return (_features & CPU_SSSE3)!= 0; } + static bool supports_sse4_1() { return (_features & CPU_SSE4_1) != 0; } + static bool supports_sse4_2() { return (_features & CPU_SSE4_2) != 0; } + static bool supports_popcnt() { return (_features & CPU_POPCNT) != 0; } + static bool supports_avx() { return (_features & CPU_AVX) != 0; } + static bool supports_avx2() { return (_features & CPU_AVX2) != 0; } + static bool supports_tsc() { return (_features & CPU_TSC) != 0; } + static bool supports_aes() { return (_features & CPU_AES) != 0; } + static bool supports_erms() { return (_features & CPU_ERMS) != 0; } + static bool supports_clmul() { return (_features & CPU_CLMUL) != 0; } + static bool supports_rtm() { return (_features & CPU_RTM) != 0; } + static bool supports_bmi1() { return (_features & CPU_BMI1) != 0; } + static bool supports_bmi2() { return (_features & CPU_BMI2) != 0; } + static bool supports_adx() { return (_features & CPU_ADX) != 0; } + static bool supports_evex() { return (_features & CPU_AVX512F) != 0; } + static bool supports_avx512dq() { return (_features & CPU_AVX512DQ) != 0; } + static bool supports_avx512pf() { return (_features & CPU_AVX512PF) != 0; } + static bool supports_avx512er() { return (_features & CPU_AVX512ER) != 0; } + static bool supports_avx512cd() { return (_features & CPU_AVX512CD) != 0; } + static bool supports_avx512bw() { return (_features & CPU_AVX512BW) != 0; } + static bool supports_avx512vl() { return (_features & CPU_AVX512VL) != 0; } static bool supports_avx512vlbw() { return (supports_avx512bw() && supports_avx512vl()); } static bool supports_avx512novl() { return (supports_evex() && !supports_avx512vl()); } static bool supports_avx512nobw() { return (supports_evex() && !supports_avx512bw()); } @@ -746,17 +744,17 @@ public: } // AMD features - static bool supports_3dnow_prefetch() { return (_cpuFeatures & CPU_3DNOW_PREFETCH) != 0; } + static bool supports_3dnow_prefetch() { return (_features & CPU_3DNOW_PREFETCH) != 0; } static bool supports_mmx_ext() { return is_amd() && _cpuid_info.ext_cpuid1_edx.bits.mmx_amd != 0; } - static bool supports_lzcnt() { return (_cpuFeatures & CPU_LZCNT) != 0; } - static bool supports_sse4a() { return (_cpuFeatures & CPU_SSE4A) != 0; } + static bool supports_lzcnt() { return (_features & CPU_LZCNT) != 0; } + static bool supports_sse4a() { return (_features & CPU_SSE4A) != 0; } static bool is_amd_Barcelona() { return is_amd() && extended_cpu_family() == CPU_FAMILY_AMD_11H; } // Intel and AMD newer cores support fast timestamps well static bool supports_tscinv_bit() { - return (_cpuFeatures & CPU_TSCINV) != 0; + return (_features & CPU_TSCINV) != 0; } static bool supports_tscinv() { return supports_tscinv_bit() && @@ -770,8 +768,6 @@ public: static bool supports_compare_and_exchange() { return true; } - static const char* cpu_features() { return _features_str; } - static intx allocate_prefetch_distance() { // This method should be called before allocate_prefetch_style(). // diff --git a/hotspot/src/cpu/zero/vm/vm_version_zero.hpp b/hotspot/src/cpu/zero/vm/vm_version_zero.hpp index 68a29df3a60..51b9c5b3035 100644 --- a/hotspot/src/cpu/zero/vm/vm_version_zero.hpp +++ b/hotspot/src/cpu/zero/vm/vm_version_zero.hpp @@ -31,9 +31,6 @@ class VM_Version : public Abstract_VM_Version { public: - static const char* cpu_features() { - return ""; - } static void initialize(); }; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java new file mode 100644 index 00000000000..af6f7e892af --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java @@ -0,0 +1,237 @@ +/* + * 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. + */ +package jdk.vm.ci.aarch64; + +import java.nio.ByteOrder; +import java.util.EnumSet; + +import jdk.vm.ci.code.Architecture; +import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.Register.RegisterCategory; +import jdk.vm.ci.meta.JavaKind; +import jdk.vm.ci.meta.PlatformKind; + +/** + * Represents the AArch64 architecture. + */ +public class AArch64 extends Architecture { + + public static final RegisterCategory CPU = new RegisterCategory("CPU"); + + // General purpose CPU registers + public static final Register r0 = new Register(0, 0, "r0", CPU); + public static final Register r1 = new Register(1, 1, "r1", CPU); + public static final Register r2 = new Register(2, 2, "r2", CPU); + public static final Register r3 = new Register(3, 3, "r3", CPU); + public static final Register r4 = new Register(4, 4, "r4", CPU); + public static final Register r5 = new Register(5, 5, "r5", CPU); + public static final Register r6 = new Register(6, 6, "r6", CPU); + public static final Register r7 = new Register(7, 7, "r7", CPU); + public static final Register r8 = new Register(8, 8, "r8", CPU); + public static final Register r9 = new Register(9, 9, "r9", CPU); + public static final Register r10 = new Register(10, 10, "r10", CPU); + public static final Register r11 = new Register(11, 11, "r11", CPU); + public static final Register r12 = new Register(12, 12, "r12", CPU); + public static final Register r13 = new Register(13, 13, "r13", CPU); + public static final Register r14 = new Register(14, 14, "r14", CPU); + public static final Register r15 = new Register(15, 15, "r15", CPU); + public static final Register r16 = new Register(16, 16, "r16", CPU); + public static final Register r17 = new Register(17, 17, "r17", CPU); + public static final Register r18 = new Register(18, 18, "r18", CPU); + public static final Register r19 = new Register(19, 19, "r19", CPU); + public static final Register r20 = new Register(20, 20, "r20", CPU); + public static final Register r21 = new Register(21, 21, "r21", CPU); + public static final Register r22 = new Register(22, 22, "r22", CPU); + public static final Register r23 = new Register(23, 23, "r23", CPU); + public static final Register r24 = new Register(24, 24, "r24", CPU); + public static final Register r25 = new Register(25, 25, "r25", CPU); + public static final Register r26 = new Register(26, 26, "r26", CPU); + public static final Register r27 = new Register(27, 27, "r27", CPU); + public static final Register r28 = new Register(28, 28, "r28", CPU); + public static final Register r29 = new Register(29, 29, "r29", CPU); + public static final Register r30 = new Register(30, 30, "r30", CPU); + public static final Register r31 = new Register(31, 31, "r31", CPU); + + public static final Register lr = r30; + public static final Register zr = r31; + public static final Register sp = r31; + + public static final Register[] cpuRegisters = { + // @formatter:off + r0, r1, r2, r3, r4, r5, r6, r7, + r8, r9, r10, r11, r12, r13, r14, r15, + r16, r17, r18, r19, r20, r21, r22, r23, + r24, r25, r26, r27, r28, r29, r30, r31 + // @formatter:on + }; + + public static final RegisterCategory SIMD = new RegisterCategory("SIMD"); + + // Simd registers + public static final Register v0 = new Register(32, 0, "v0", SIMD); + public static final Register v1 = new Register(33, 1, "v1", SIMD); + public static final Register v2 = new Register(34, 2, "v2", SIMD); + public static final Register v3 = new Register(35, 3, "v3", SIMD); + public static final Register v4 = new Register(36, 4, "v4", SIMD); + public static final Register v5 = new Register(37, 5, "v5", SIMD); + public static final Register v6 = new Register(38, 6, "v6", SIMD); + public static final Register v7 = new Register(39, 7, "v7", SIMD); + public static final Register v8 = new Register(40, 8, "v8", SIMD); + public static final Register v9 = new Register(41, 9, "v9", SIMD); + public static final Register v10 = new Register(42, 10, "v10", SIMD); + public static final Register v11 = new Register(43, 11, "v11", SIMD); + public static final Register v12 = new Register(44, 12, "v12", SIMD); + public static final Register v13 = new Register(45, 13, "v13", SIMD); + public static final Register v14 = new Register(46, 14, "v14", SIMD); + public static final Register v15 = new Register(47, 15, "v15", SIMD); + public static final Register v16 = new Register(48, 16, "v16", SIMD); + public static final Register v17 = new Register(49, 17, "v17", SIMD); + public static final Register v18 = new Register(50, 18, "v18", SIMD); + public static final Register v19 = new Register(51, 19, "v19", SIMD); + public static final Register v20 = new Register(52, 20, "v20", SIMD); + public static final Register v21 = new Register(53, 21, "v21", SIMD); + public static final Register v22 = new Register(54, 22, "v22", SIMD); + public static final Register v23 = new Register(55, 23, "v23", SIMD); + public static final Register v24 = new Register(56, 24, "v24", SIMD); + public static final Register v25 = new Register(57, 25, "v25", SIMD); + public static final Register v26 = new Register(58, 26, "v26", SIMD); + public static final Register v27 = new Register(59, 27, "v27", SIMD); + public static final Register v28 = new Register(60, 28, "v28", SIMD); + public static final Register v29 = new Register(61, 29, "v29", SIMD); + public static final Register v30 = new Register(62, 30, "v30", SIMD); + public static final Register v31 = new Register(63, 31, "v31", SIMD); + + public static final Register[] simdRegisters = { + // @formatter:off + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10, v11, v12, v13, v14, v15, + v16, v17, v18, v19, v20, v21, v22, v23, + v24, v25, v26, v27, v28, v29, v30, v31 + // @formatter:on + }; + + public static final Register[] allRegisters = { + // @formatter:off + r0, r1, r2, r3, r4, r5, r6, r7, + r8, r9, r10, r11, r12, r13, r14, r15, + r16, r17, r18, r19, r20, r21, r22, r23, + r24, r25, r26, r27, r28, r29, r30, r31, + + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10, v11, v12, v13, v14, v15, + v16, v17, v18, v19, v20, v21, v22, v23, + v24, v25, v26, v27, v28, v29, v30, v31 + // @formatter:on + }; + + /** + * Basic set of CPU features mirroring what is returned from the cpuid instruction. See: + * {@code VM_Version::cpuFeatureFlags}. + */ + public static enum CPUFeature { + FP, + ASIMD, + EVTSTRM, + AES, + PMULL, + SHA1, + SHA2, + CRC32, + A53MAC, + DMB_ATOMICS + } + + private final EnumSet features; + + /** + * Set of flags to control code emission. + */ + public static enum Flag { + UseBarriersForVolatile, + UseCRC32, + UseNeon + } + + private final EnumSet flags; + + public AArch64(EnumSet features, EnumSet flags) { + super("aarch64", AArch64Kind.QWORD, ByteOrder.LITTLE_ENDIAN, /* unalignedMemoryAccess */true, allRegisters, /* implicitMemoryBarriers */0, /* nativeCallDisplacementOffset */0, + /* returnAddressSize */0); + this.features = features; + this.flags = flags; + assert features.contains(CPUFeature.FP) : "minimum config for aarch64"; + } + + public EnumSet getFeatures() { + return features; + } + + public EnumSet getFlags() { + return flags; + } + + @Override + public PlatformKind getPlatformKind(JavaKind javaKind) { + switch (javaKind) { + case Boolean: + case Byte: + return AArch64Kind.BYTE; + case Short: + case Char: + return AArch64Kind.WORD; + case Int: + return AArch64Kind.DWORD; + case Long: + case Object: + return AArch64Kind.QWORD; + case Float: + return AArch64Kind.SINGLE; + case Double: + return AArch64Kind.DOUBLE; + default: + return null; + } + } + + @Override + public boolean canStoreValue(RegisterCategory category, PlatformKind platformKind) { + AArch64Kind kind = (AArch64Kind) platformKind; + if (kind.isInteger()) { + return category.equals(CPU); + } else if (kind.isSIMD()) { + return category.equals(SIMD); + } + return false; + } + + @Override + public AArch64Kind getLargestStorableKind(RegisterCategory category) { + if (category.equals(CPU)) { + return AArch64Kind.QWORD; + } else if (category.equals(SIMD)) { + return AArch64Kind.V128_QWORD; + } else { + return null; + } + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java new file mode 100644 index 00000000000..1802ef7eab2 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java @@ -0,0 +1,171 @@ +/* + * 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. + */ +package jdk.vm.ci.aarch64; + +import jdk.vm.ci.meta.PlatformKind; + +public enum AArch64Kind implements PlatformKind { + + // scalar + BYTE(1), + WORD(2), + DWORD(4), + QWORD(8), + SINGLE(4), + DOUBLE(8), + + // SIMD + V32_BYTE(4, BYTE), + V32_WORD(4, WORD), + V64_BYTE(8, BYTE), + V64_WORD(8, WORD), + V64_DWORD(8, DWORD), + V128_BYTE(16, BYTE), + V128_WORD(16, WORD), + V128_DWORD(16, DWORD), + V128_QWORD(16, QWORD), + V128_SINGLE(16, SINGLE), + V128_DOUBLE(16, DOUBLE), + + MASK8(1), + MASK16(2), + MASK32(4), + MASK64(8); + + private final int size; + private final int vectorLength; + + private final AArch64Kind scalar; + private final EnumKey key = new EnumKey<>(this); + + private AArch64Kind(int size) { + this.size = size; + this.scalar = this; + this.vectorLength = 1; + } + + private AArch64Kind(int size, AArch64Kind scalar) { + this.size = size; + this.scalar = scalar; + + assert size % scalar.size == 0; + this.vectorLength = size / scalar.size; + } + + public AArch64Kind getScalar() { + return scalar; + } + + public int getSizeInBytes() { + return size; + } + + public int getVectorLength() { + return vectorLength; + } + + public Key getKey() { + return key; + } + + public boolean isInteger() { + switch (this) { + case BYTE: + case WORD: + case DWORD: + case QWORD: + return true; + default: + return false; + } + } + + public boolean isSIMD() { + switch (this) { + case SINGLE: + case DOUBLE: + case V32_BYTE: + case V32_WORD: + case V64_BYTE: + case V64_WORD: + case V64_DWORD: + case V128_BYTE: + case V128_WORD: + case V128_DWORD: + case V128_QWORD: + case V128_SINGLE: + case V128_DOUBLE: + return true; + default: + return false; + } + } + + public boolean isMask() { + switch (this) { + case MASK8: + case MASK16: + case MASK32: + case MASK64: + return true; + default: + return false; + } + } + + public char getTypeChar() { + switch (this) { + case BYTE: + return 'b'; + case WORD: + return 'w'; + case DWORD: + return 'd'; + case QWORD: + return 'q'; + case SINGLE: + return 'S'; + case DOUBLE: + return 'D'; + case V32_BYTE: + case V32_WORD: + case V64_BYTE: + case V64_WORD: + case V64_DWORD: + case V128_BYTE: + case V128_WORD: + case V128_DWORD: + case V128_QWORD: + case V128_SINGLE: + case V128_DOUBLE: + return 'v'; + case MASK8: + case MASK16: + case MASK32: + case MASK64: + return 'k'; + default: + return '-'; + } + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java new file mode 100644 index 00000000000..6981820018b --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java @@ -0,0 +1,131 @@ +/* + * 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. + */ +package jdk.vm.ci.hotspot.aarch64; + +import static jdk.vm.ci.inittimer.InitTimer.timer; + +import java.util.EnumSet; + +import jdk.vm.ci.aarch64.AArch64; +import jdk.vm.ci.code.Architecture; +import jdk.vm.ci.code.RegisterConfig; +import jdk.vm.ci.code.TargetDescription; +import jdk.vm.ci.code.stack.StackIntrospection; +import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; +import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider; +import jdk.vm.ci.hotspot.HotSpotStackIntrospection; +import jdk.vm.ci.hotspot.HotSpotVMConfig; +import jdk.vm.ci.inittimer.InitTimer; +import jdk.vm.ci.meta.ConstantReflectionProvider; +import jdk.vm.ci.runtime.JVMCIBackend; +import jdk.vm.ci.service.ServiceProvider; + +@ServiceProvider(HotSpotJVMCIBackendFactory.class) +public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { + + protected EnumSet computeFeatures(@SuppressWarnings("unused") HotSpotVMConfig config) { + // Configure the feature set using the HotSpot flag settings. + EnumSet features = EnumSet.noneOf(AArch64.CPUFeature.class); + return features; + } + + protected EnumSet computeFlags(@SuppressWarnings("unused") HotSpotVMConfig config) { + EnumSet flags = EnumSet.noneOf(AArch64.Flag.class); + return flags; + } + + protected TargetDescription createTarget(HotSpotVMConfig config) { + final int stackFrameAlignment = 16; + final int implicitNullCheckLimit = 4096; + final boolean inlineObjects = true; + Architecture arch = new AArch64(computeFeatures(config), computeFlags(config)); + return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); + } + + protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntimeProvider runtime) { + return new HotSpotConstantReflectionProvider(runtime); + } + + protected RegisterConfig createRegisterConfig(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target) { + return new AArch64HotSpotRegisterConfig(target.arch, runtime.getConfig()); + } + + protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { + return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); + } + + protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntimeProvider runtime) { + return new HotSpotMetaAccessProvider(runtime); + } + + @Override + public String getArchitecture() { + return "aarch64"; + } + + @Override + public String toString() { + return "JVMCIBackend:" + getArchitecture(); + } + + @SuppressWarnings("try") + public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { + + assert host == null; + TargetDescription target = createTarget(runtime.getConfig()); + + RegisterConfig regConfig; + HotSpotCodeCacheProvider codeCache; + ConstantReflectionProvider constantReflection; + HotSpotMetaAccessProvider metaAccess; + StackIntrospection stackIntrospection; + try (InitTimer t = timer("create providers")) { + try (InitTimer rt = timer("create MetaAccess provider")) { + metaAccess = createMetaAccess(runtime); + } + try (InitTimer rt = timer("create RegisterConfig")) { + regConfig = createRegisterConfig(runtime, target); + } + try (InitTimer rt = timer("create CodeCache provider")) { + codeCache = createCodeCache(runtime, target, regConfig); + } + try (InitTimer rt = timer("create ConstantReflection provider")) { + constantReflection = createConstantReflection(runtime); + } + try (InitTimer rt = timer("create StackIntrospection provider")) { + stackIntrospection = new HotSpotStackIntrospection(runtime); + } + } + try (InitTimer rt = timer("instantiate backend")) { + return createBackend(metaAccess, codeCache, constantReflection, stackIntrospection); + } + } + + protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, + StackIntrospection stackIntrospection) { + return new JVMCIBackend(metaAccess, codeCache, constantReflection, stackIntrospection); + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java new file mode 100644 index 00000000000..9590d2fcda4 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java @@ -0,0 +1,298 @@ +/* + * 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. + */ +package jdk.vm.ci.hotspot.aarch64; + +import static jdk.vm.ci.aarch64.AArch64.lr; +import static jdk.vm.ci.aarch64.AArch64.r0; +import static jdk.vm.ci.aarch64.AArch64.r1; +import static jdk.vm.ci.aarch64.AArch64.r12; +import static jdk.vm.ci.aarch64.AArch64.r2; +import static jdk.vm.ci.aarch64.AArch64.r27; +import static jdk.vm.ci.aarch64.AArch64.r28; +import static jdk.vm.ci.aarch64.AArch64.r29; +import static jdk.vm.ci.aarch64.AArch64.r3; +import static jdk.vm.ci.aarch64.AArch64.r4; +import static jdk.vm.ci.aarch64.AArch64.r5; +import static jdk.vm.ci.aarch64.AArch64.r6; +import static jdk.vm.ci.aarch64.AArch64.r7; +import static jdk.vm.ci.aarch64.AArch64.r9; +import static jdk.vm.ci.aarch64.AArch64.sp; +import static jdk.vm.ci.aarch64.AArch64.v0; +import static jdk.vm.ci.aarch64.AArch64.v1; +import static jdk.vm.ci.aarch64.AArch64.v2; +import static jdk.vm.ci.aarch64.AArch64.v3; +import static jdk.vm.ci.aarch64.AArch64.v4; +import static jdk.vm.ci.aarch64.AArch64.v5; +import static jdk.vm.ci.aarch64.AArch64.v6; +import static jdk.vm.ci.aarch64.AArch64.v7; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +import jdk.vm.ci.aarch64.AArch64; +import jdk.vm.ci.code.Architecture; +import jdk.vm.ci.code.CallingConvention; +import jdk.vm.ci.code.CallingConvention.Type; +import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.RegisterAttributes; +import jdk.vm.ci.code.RegisterConfig; +import jdk.vm.ci.code.StackSlot; +import jdk.vm.ci.code.TargetDescription; +import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotVMConfig; +import jdk.vm.ci.meta.AllocatableValue; +import jdk.vm.ci.meta.JavaKind; +import jdk.vm.ci.meta.JavaType; +import jdk.vm.ci.meta.LIRKind; +import jdk.vm.ci.meta.PlatformKind; +import jdk.vm.ci.meta.Value; + +public class AArch64HotSpotRegisterConfig implements RegisterConfig { + + private final Architecture architecture; + + private final Register[] allocatable; + + private final int maxFrameSize; + + /** + * The caller saved registers always include all parameter registers. + */ + private final Register[] callerSaved; + + private final boolean allAllocatableAreCallerSaved; + + private final RegisterAttributes[] attributesMap; + + public int getMaximumFrameSize() { + return maxFrameSize; + } + + @Override + public Register[] getAllocatableRegisters() { + return allocatable.clone(); + } + + public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { + ArrayList list = new ArrayList<>(); + for (Register reg : registers) { + if (architecture.canStoreValue(reg.getRegisterCategory(), kind)) { + list.add(reg); + } + } + + Register[] ret = list.toArray(new Register[list.size()]); + return ret; + } + + @Override + public RegisterAttributes[] getAttributesMap() { + return attributesMap.clone(); + } + + private final Register[] javaGeneralParameterRegisters = {r1, r2, r3, r4, r5, r6, r7, r0}; + private final Register[] nativeGeneralParameterRegisters = {r0, r1, r2, r3, r4, r5, r6, r7}; + private final Register[] simdParameterRegisters = {v0, v1, v2, v3, v4, v5, v6, v7}; + + public static final Register inlineCacheRegister = r9; + + /** + * Vtable stubs expect the metaspace Method in r12. + */ + public static final Register metaspaceMethodRegister = r12; + + public static final Register heapBaseRegister = r27; + public static final Register threadRegister = r28; + public static final Register fp = r29; + + private static Register[] initAllocatable(Architecture arch, boolean reserveForHeapBase) { + Register[] allRegisters = arch.getAvailableValueRegisters(); + Register[] registers = new Register[allRegisters.length - (reserveForHeapBase ? 5 : 4)]; + + int idx = 0; + for (Register reg : allRegisters) { + if (reg.equals(threadRegister) || reg.equals(fp) || reg.equals(lr) || reg.equals(sp)) { + // skip thread register, frame pointer, link register and stack pointer + continue; + } + if (reserveForHeapBase && reg.equals(heapBaseRegister)) { + // skip heap base register + continue; + } + + registers[idx++] = reg; + } + + assert idx == registers.length; + return registers; + } + + public AArch64HotSpotRegisterConfig(Architecture architecture, HotSpotVMConfig config) { + this(architecture, config, initAllocatable(architecture, config.useCompressedOops)); + assert callerSaved.length >= allocatable.length; + } + + public AArch64HotSpotRegisterConfig(Architecture architecture, HotSpotVMConfig config, Register[] allocatable) { + this.architecture = architecture; + this.maxFrameSize = config.maxFrameSize; + + this.allocatable = allocatable.clone(); + Set callerSaveSet = new HashSet<>(); + Collections.addAll(callerSaveSet, allocatable); + Collections.addAll(callerSaveSet, simdParameterRegisters); + Collections.addAll(callerSaveSet, javaGeneralParameterRegisters); + Collections.addAll(callerSaveSet, nativeGeneralParameterRegisters); + callerSaved = callerSaveSet.toArray(new Register[callerSaveSet.size()]); + + allAllocatableAreCallerSaved = true; + attributesMap = RegisterAttributes.createMap(this, AArch64.allRegisters); + } + + @Override + public Register[] getCallerSaveRegisters() { + return callerSaved; + } + + public Register[] getCalleeSaveRegisters() { + return null; + } + + @Override + public boolean areAllAllocatableRegistersCallerSaved() { + return allAllocatableAreCallerSaved; + } + + @Override + public Register getRegisterForRole(int index) { + throw new UnsupportedOperationException(); + } + + @Override + public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { + if (type == Type.NativeCall) { + return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + } + // On x64, parameter locations are the same whether viewed + // from the caller or callee perspective + return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + } + + public Register[] getCallingConventionRegisters(Type type, JavaKind kind) { + switch (kind) { + case Boolean: + case Byte: + case Short: + case Char: + case Int: + case Long: + case Object: + return type == Type.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; + case Float: + case Double: + return simdParameterRegisters; + default: + throw JVMCIError.shouldNotReachHere(); + } + } + + private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) { + AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; + + int currentGeneral = 0; + int currentSIMD = 0; + int currentStackOffset = 0; + + for (int i = 0; i < parameterTypes.length; i++) { + final JavaKind kind = parameterTypes[i].getJavaKind().getStackKind(); + + switch (kind) { + case Byte: + case Boolean: + case Short: + case Char: + case Int: + case Long: + case Object: + if (!stackOnly && currentGeneral < generalParameterRegisters.length) { + Register register = generalParameterRegisters[currentGeneral++]; + locations[i] = register.asValue(target.getLIRKind(kind)); + } + break; + case Float: + case Double: + if (!stackOnly && currentSIMD < simdParameterRegisters.length) { + Register register = simdParameterRegisters[currentSIMD++]; + locations[i] = register.asValue(target.getLIRKind(kind)); + } + break; + default: + throw JVMCIError.shouldNotReachHere(); + } + + if (locations[i] == null) { + LIRKind lirKind = target.getLIRKind(kind); + locations[i] = StackSlot.get(lirKind, currentStackOffset, !type.out); + currentStackOffset += Math.max(lirKind.getPlatformKind().getSizeInBytes(), target.wordSize); + } + } + + JavaKind returnKind = returnType == null ? JavaKind.Void : returnType.getJavaKind(); + AllocatableValue returnLocation = returnKind == JavaKind.Void ? Value.ILLEGAL : getReturnRegister(returnKind).asValue(target.getLIRKind(returnKind.getStackKind())); + return new CallingConvention(currentStackOffset, returnLocation, locations); + } + + @Override + public Register getReturnRegister(JavaKind kind) { + switch (kind) { + case Boolean: + case Byte: + case Char: + case Short: + case Int: + case Long: + case Object: + return r0; + case Float: + case Double: + return v0; + case Void: + case Illegal: + return null; + default: + throw new UnsupportedOperationException("no return register for type " + kind); + } + } + + @Override + public Register getFrameRegister() { + return sp; + } + + @Override + public String toString() { + return String.format("Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" + "CallerSave: " + Arrays.toString(getCallerSaveRegisters()) + "%n"); + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java index d5d31ea86e5..fb6eba20f92 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java @@ -49,79 +49,79 @@ public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFacto protected EnumSet computeFeatures(HotSpotVMConfig config) { // Configure the feature set using the HotSpot flag settings. EnumSet features = EnumSet.noneOf(AMD64.CPUFeature.class); - if ((config.x86CPUFeatures & config.cpu3DNOWPREFETCH) != 0) { + if ((config.vmVersionFeatures & config.amd643DNOWPREFETCH) != 0) { features.add(AMD64.CPUFeature.AMD_3DNOW_PREFETCH); } assert config.useSSE >= 2 : "minimum config for x64"; features.add(AMD64.CPUFeature.SSE); features.add(AMD64.CPUFeature.SSE2); - if ((config.x86CPUFeatures & config.cpuSSE3) != 0) { + if ((config.vmVersionFeatures & config.amd64SSE3) != 0) { features.add(AMD64.CPUFeature.SSE3); } - if ((config.x86CPUFeatures & config.cpuSSSE3) != 0) { + if ((config.vmVersionFeatures & config.amd64SSSE3) != 0) { features.add(AMD64.CPUFeature.SSSE3); } - if ((config.x86CPUFeatures & config.cpuSSE4A) != 0) { + if ((config.vmVersionFeatures & config.amd64SSE4A) != 0) { features.add(AMD64.CPUFeature.SSE4A); } - if ((config.x86CPUFeatures & config.cpuSSE41) != 0) { + if ((config.vmVersionFeatures & config.amd64SSE41) != 0) { features.add(AMD64.CPUFeature.SSE4_1); } - if ((config.x86CPUFeatures & config.cpuSSE42) != 0) { + if ((config.vmVersionFeatures & config.amd64SSE42) != 0) { features.add(AMD64.CPUFeature.SSE4_2); } - if ((config.x86CPUFeatures & config.cpuPOPCNT) != 0) { + if ((config.vmVersionFeatures & config.amd64POPCNT) != 0) { features.add(AMD64.CPUFeature.POPCNT); } - if ((config.x86CPUFeatures & config.cpuLZCNT) != 0) { + if ((config.vmVersionFeatures & config.amd64LZCNT) != 0) { features.add(AMD64.CPUFeature.LZCNT); } - if ((config.x86CPUFeatures & config.cpuERMS) != 0) { + if ((config.vmVersionFeatures & config.amd64ERMS) != 0) { features.add(AMD64.CPUFeature.ERMS); } - if ((config.x86CPUFeatures & config.cpuAVX) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX) != 0) { features.add(AMD64.CPUFeature.AVX); } - if ((config.x86CPUFeatures & config.cpuAVX2) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX2) != 0) { features.add(AMD64.CPUFeature.AVX2); } - if ((config.x86CPUFeatures & config.cpuAES) != 0) { + if ((config.vmVersionFeatures & config.amd64AES) != 0) { features.add(AMD64.CPUFeature.AES); } - if ((config.x86CPUFeatures & config.cpu3DNOWPREFETCH) != 0) { + if ((config.vmVersionFeatures & config.amd643DNOWPREFETCH) != 0) { features.add(AMD64.CPUFeature.AMD_3DNOW_PREFETCH); } - if ((config.x86CPUFeatures & config.cpuBMI1) != 0) { + if ((config.vmVersionFeatures & config.amd64BMI1) != 0) { features.add(AMD64.CPUFeature.BMI1); } - if ((config.x86CPUFeatures & config.cpuBMI2) != 0) { + if ((config.vmVersionFeatures & config.amd64BMI2) != 0) { features.add(AMD64.CPUFeature.BMI2); } - if ((config.x86CPUFeatures & config.cpuRTM) != 0) { + if ((config.vmVersionFeatures & config.amd64RTM) != 0) { features.add(AMD64.CPUFeature.RTM); } - if ((config.x86CPUFeatures & config.cpuADX) != 0) { + if ((config.vmVersionFeatures & config.amd64ADX) != 0) { features.add(AMD64.CPUFeature.ADX); } - if ((config.x86CPUFeatures & config.cpuAVX512F) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512F) != 0) { features.add(AMD64.CPUFeature.AVX512F); } - if ((config.x86CPUFeatures & config.cpuAVX512DQ) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512DQ) != 0) { features.add(AMD64.CPUFeature.AVX512DQ); } - if ((config.x86CPUFeatures & config.cpuAVX512PF) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512PF) != 0) { features.add(AMD64.CPUFeature.AVX512PF); } - if ((config.x86CPUFeatures & config.cpuAVX512ER) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512ER) != 0) { features.add(AMD64.CPUFeature.AVX512ER); } - if ((config.x86CPUFeatures & config.cpuAVX512CD) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512CD) != 0) { features.add(AMD64.CPUFeature.AVX512CD); } - if ((config.x86CPUFeatures & config.cpuAVX512BW) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512BW) != 0) { features.add(AMD64.CPUFeature.AVX512BW); } - if ((config.x86CPUFeatures & config.cpuAVX512VL) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512VL) != 0) { features.add(AMD64.CPUFeature.AVX512VL); } return features; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java index d9339c2fa7e..f0f0b05190e 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java @@ -60,73 +60,73 @@ public class SPARCHotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFacto protected EnumSet computeFeatures(HotSpotVMConfig config) { EnumSet features = EnumSet.noneOf(CPUFeature.class); - if ((config.sparcFeatures & config.vis1Instructions) != 0) { + if ((config.vmVersionFeatures & config.sparcVis1Instructions) != 0) { features.add(CPUFeature.VIS1); } - if ((config.sparcFeatures & config.vis2Instructions) != 0) { + if ((config.vmVersionFeatures & config.sparcVis2Instructions) != 0) { features.add(CPUFeature.VIS2); } - if ((config.sparcFeatures & config.vis3Instructions) != 0) { + if ((config.vmVersionFeatures & config.sparcVis3Instructions) != 0) { features.add(CPUFeature.VIS3); } - if ((config.sparcFeatures & config.cbcondInstructions) != 0) { + if ((config.vmVersionFeatures & config.sparcCbcondInstructions) != 0) { features.add(CPUFeature.CBCOND); } - if ((config.sparcFeatures & config.v8Instructions) != 0) { + if ((config.vmVersionFeatures & config.sparcV8Instructions) != 0) { features.add(CPUFeature.V8); } - if ((config.sparcFeatures & config.hardwareMul32) != 0) { + if ((config.vmVersionFeatures & config.sparcHardwareMul32) != 0) { features.add(CPUFeature.HARDWARE_MUL32); } - if ((config.sparcFeatures & config.hardwareDiv32) != 0) { + if ((config.vmVersionFeatures & config.sparcHardwareDiv32) != 0) { features.add(CPUFeature.HARDWARE_DIV32); } - if ((config.sparcFeatures & config.hardwareFsmuld) != 0) { + if ((config.vmVersionFeatures & config.sparcHardwareFsmuld) != 0) { features.add(CPUFeature.HARDWARE_FSMULD); } - if ((config.sparcFeatures & config.hardwarePopc) != 0) { + if ((config.vmVersionFeatures & config.sparcHardwarePopc) != 0) { features.add(CPUFeature.HARDWARE_POPC); } - if ((config.sparcFeatures & config.v9Instructions) != 0) { + if ((config.vmVersionFeatures & config.sparcV9Instructions) != 0) { features.add(CPUFeature.V9); } - if ((config.sparcFeatures & config.sun4v) != 0) { + if ((config.vmVersionFeatures & config.sparcSun4v) != 0) { features.add(CPUFeature.SUN4V); } - if ((config.sparcFeatures & config.blkInitInstructions) != 0) { + if ((config.vmVersionFeatures & config.sparcBlkInitInstructions) != 0) { features.add(CPUFeature.BLK_INIT_INSTRUCTIONS); } - if ((config.sparcFeatures & config.fmafInstructions) != 0) { + if ((config.vmVersionFeatures & config.sparcFmafInstructions) != 0) { features.add(CPUFeature.FMAF); } - if ((config.sparcFeatures & config.fmauInstructions) != 0) { + if ((config.vmVersionFeatures & config.sparcFmauInstructions) != 0) { features.add(CPUFeature.FMAU); } - if ((config.sparcFeatures & config.sparc64Family) != 0) { + if ((config.vmVersionFeatures & config.sparcSparc64Family) != 0) { features.add(CPUFeature.SPARC64_FAMILY); } - if ((config.sparcFeatures & config.mFamily) != 0) { + if ((config.vmVersionFeatures & config.sparcMFamily) != 0) { features.add(CPUFeature.M_FAMILY); } - if ((config.sparcFeatures & config.tFamily) != 0) { + if ((config.vmVersionFeatures & config.sparcTFamily) != 0) { features.add(CPUFeature.T_FAMILY); } - if ((config.sparcFeatures & config.t1Model) != 0) { + if ((config.vmVersionFeatures & config.sparcT1Model) != 0) { features.add(CPUFeature.T1_MODEL); } - if ((config.sparcFeatures & config.sparc5Instructions) != 0) { + if ((config.vmVersionFeatures & config.sparcSparc5Instructions) != 0) { features.add(CPUFeature.SPARC5); } - if ((config.sparcFeatures & config.aesInstructions) != 0) { + if ((config.vmVersionFeatures & config.sparcAesInstructions) != 0) { features.add(CPUFeature.SPARC64_FAMILY); } - if ((config.sparcFeatures & config.sha1Instruction) != 0) { + if ((config.vmVersionFeatures & config.sparcSha1Instruction) != 0) { features.add(CPUFeature.SHA1); } - if ((config.sparcFeatures & config.sha256Instruction) != 0) { + if ((config.vmVersionFeatures & config.sparcSha256Instruction) != 0) { features.add(CPUFeature.SHA256); } - if ((config.sparcFeatures & config.sha512Instruction) != 0) { + if ((config.vmVersionFeatures & config.sparcSha512Instruction) != 0) { features.add(CPUFeature.SHA512); } return features; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java index 84e666ca3ad..c8113446681 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @@ -907,67 +907,67 @@ public class HotSpotVMConfig { @HotSpotVMFlag(name = "UseSSE") @Stable public int useSSE; @HotSpotVMFlag(name = "UseAVX", archs = {"amd64"}) @Stable public int useAVX; - // X86 specific values - @HotSpotVMField(name = "VM_Version::_cpuFeatures", type = "uint64_t", get = HotSpotVMField.Type.VALUE, archs = {"amd64"}) @Stable public long x86CPUFeatures; - @HotSpotVMConstant(name = "VM_Version::CPU_CX8", archs = {"amd64"}) @Stable public long cpuCX8; - @HotSpotVMConstant(name = "VM_Version::CPU_CMOV", archs = {"amd64"}) @Stable public long cpuCMOV; - @HotSpotVMConstant(name = "VM_Version::CPU_FXSR", archs = {"amd64"}) @Stable public long cpuFXSR; - @HotSpotVMConstant(name = "VM_Version::CPU_HT", archs = {"amd64"}) @Stable public long cpuHT; - @HotSpotVMConstant(name = "VM_Version::CPU_MMX", archs = {"amd64"}) @Stable public long cpuMMX; - @HotSpotVMConstant(name = "VM_Version::CPU_3DNOW_PREFETCH", archs = {"amd64"}) @Stable public long cpu3DNOWPREFETCH; - @HotSpotVMConstant(name = "VM_Version::CPU_SSE", archs = {"amd64"}) @Stable public long cpuSSE; - @HotSpotVMConstant(name = "VM_Version::CPU_SSE2", archs = {"amd64"}) @Stable public long cpuSSE2; - @HotSpotVMConstant(name = "VM_Version::CPU_SSE3", archs = {"amd64"}) @Stable public long cpuSSE3; - @HotSpotVMConstant(name = "VM_Version::CPU_SSSE3", archs = {"amd64"}) @Stable public long cpuSSSE3; - @HotSpotVMConstant(name = "VM_Version::CPU_SSE4A", archs = {"amd64"}) @Stable public long cpuSSE4A; - @HotSpotVMConstant(name = "VM_Version::CPU_SSE4_1", archs = {"amd64"}) @Stable public long cpuSSE41; - @HotSpotVMConstant(name = "VM_Version::CPU_SSE4_2", archs = {"amd64"}) @Stable public long cpuSSE42; - @HotSpotVMConstant(name = "VM_Version::CPU_POPCNT", archs = {"amd64"}) @Stable public long cpuPOPCNT; - @HotSpotVMConstant(name = "VM_Version::CPU_LZCNT", archs = {"amd64"}) @Stable public long cpuLZCNT; - @HotSpotVMConstant(name = "VM_Version::CPU_TSC", archs = {"amd64"}) @Stable public long cpuTSC; - @HotSpotVMConstant(name = "VM_Version::CPU_TSCINV", archs = {"amd64"}) @Stable public long cpuTSCINV; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX", archs = {"amd64"}) @Stable public long cpuAVX; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX2", archs = {"amd64"}) @Stable public long cpuAVX2; - @HotSpotVMConstant(name = "VM_Version::CPU_AES", archs = {"amd64"}) @Stable public long cpuAES; - @HotSpotVMConstant(name = "VM_Version::CPU_ERMS", archs = {"amd64"}) @Stable public long cpuERMS; - @HotSpotVMConstant(name = "VM_Version::CPU_CLMUL", archs = {"amd64"}) @Stable public long cpuCLMUL; - @HotSpotVMConstant(name = "VM_Version::CPU_BMI1", archs = {"amd64"}) @Stable public long cpuBMI1; - @HotSpotVMConstant(name = "VM_Version::CPU_BMI2", archs = {"amd64"}) @Stable public long cpuBMI2; - @HotSpotVMConstant(name = "VM_Version::CPU_RTM", archs = {"amd64"}) @Stable public long cpuRTM; - @HotSpotVMConstant(name = "VM_Version::CPU_ADX", archs = {"amd64"}) @Stable public long cpuADX; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512F", archs = {"amd64"}) @Stable public long cpuAVX512F; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512DQ", archs = {"amd64"}) @Stable public long cpuAVX512DQ; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512PF", archs = {"amd64"}) @Stable public long cpuAVX512PF; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512ER", archs = {"amd64"}) @Stable public long cpuAVX512ER; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512CD", archs = {"amd64"}) @Stable public long cpuAVX512CD; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512BW", archs = {"amd64"}) @Stable public long cpuAVX512BW; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512VL", archs = {"amd64"}) @Stable public long cpuAVX512VL; + @HotSpotVMField(name = "Abstract_VM_Version::_features", type = "uint64_t", get = HotSpotVMField.Type.VALUE) @Stable public long vmVersionFeatures; + + // AMD64 specific values + @HotSpotVMConstant(name = "VM_Version::CPU_CX8", archs = {"amd64"}) @Stable public long amd64CX8; + @HotSpotVMConstant(name = "VM_Version::CPU_CMOV", archs = {"amd64"}) @Stable public long amd64CMOV; + @HotSpotVMConstant(name = "VM_Version::CPU_FXSR", archs = {"amd64"}) @Stable public long amd64FXSR; + @HotSpotVMConstant(name = "VM_Version::CPU_HT", archs = {"amd64"}) @Stable public long amd64HT; + @HotSpotVMConstant(name = "VM_Version::CPU_MMX", archs = {"amd64"}) @Stable public long amd64MMX; + @HotSpotVMConstant(name = "VM_Version::CPU_3DNOW_PREFETCH", archs = {"amd64"}) @Stable public long amd643DNOWPREFETCH; + @HotSpotVMConstant(name = "VM_Version::CPU_SSE", archs = {"amd64"}) @Stable public long amd64SSE; + @HotSpotVMConstant(name = "VM_Version::CPU_SSE2", archs = {"amd64"}) @Stable public long amd64SSE2; + @HotSpotVMConstant(name = "VM_Version::CPU_SSE3", archs = {"amd64"}) @Stable public long amd64SSE3; + @HotSpotVMConstant(name = "VM_Version::CPU_SSSE3", archs = {"amd64"}) @Stable public long amd64SSSE3; + @HotSpotVMConstant(name = "VM_Version::CPU_SSE4A", archs = {"amd64"}) @Stable public long amd64SSE4A; + @HotSpotVMConstant(name = "VM_Version::CPU_SSE4_1", archs = {"amd64"}) @Stable public long amd64SSE41; + @HotSpotVMConstant(name = "VM_Version::CPU_SSE4_2", archs = {"amd64"}) @Stable public long amd64SSE42; + @HotSpotVMConstant(name = "VM_Version::CPU_POPCNT", archs = {"amd64"}) @Stable public long amd64POPCNT; + @HotSpotVMConstant(name = "VM_Version::CPU_LZCNT", archs = {"amd64"}) @Stable public long amd64LZCNT; + @HotSpotVMConstant(name = "VM_Version::CPU_TSC", archs = {"amd64"}) @Stable public long amd64TSC; + @HotSpotVMConstant(name = "VM_Version::CPU_TSCINV", archs = {"amd64"}) @Stable public long amd64TSCINV; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX", archs = {"amd64"}) @Stable public long amd64AVX; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX2", archs = {"amd64"}) @Stable public long amd64AVX2; + @HotSpotVMConstant(name = "VM_Version::CPU_AES", archs = {"amd64"}) @Stable public long amd64AES; + @HotSpotVMConstant(name = "VM_Version::CPU_ERMS", archs = {"amd64"}) @Stable public long amd64ERMS; + @HotSpotVMConstant(name = "VM_Version::CPU_CLMUL", archs = {"amd64"}) @Stable public long amd64CLMUL; + @HotSpotVMConstant(name = "VM_Version::CPU_BMI1", archs = {"amd64"}) @Stable public long amd64BMI1; + @HotSpotVMConstant(name = "VM_Version::CPU_BMI2", archs = {"amd64"}) @Stable public long amd64BMI2; + @HotSpotVMConstant(name = "VM_Version::CPU_RTM", archs = {"amd64"}) @Stable public long amd64RTM; + @HotSpotVMConstant(name = "VM_Version::CPU_ADX", archs = {"amd64"}) @Stable public long amd64ADX; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512F", archs = {"amd64"}) @Stable public long amd64AVX512F; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512DQ", archs = {"amd64"}) @Stable public long amd64AVX512DQ; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512PF", archs = {"amd64"}) @Stable public long amd64AVX512PF; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512ER", archs = {"amd64"}) @Stable public long amd64AVX512ER; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512CD", archs = {"amd64"}) @Stable public long amd64AVX512CD; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512BW", archs = {"amd64"}) @Stable public long amd64AVX512BW; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512VL", archs = {"amd64"}) @Stable public long amd64AVX512VL; // SPARC specific values - @HotSpotVMField(name = "VM_Version::_features", type = "int", get = HotSpotVMField.Type.VALUE, archs = {"sparc"}) @Stable public int sparcFeatures; - @HotSpotVMConstant(name = "VM_Version::vis3_instructions_m", archs = {"sparc"}) @Stable public int vis3Instructions; - @HotSpotVMConstant(name = "VM_Version::vis2_instructions_m", archs = {"sparc"}) @Stable public int vis2Instructions; - @HotSpotVMConstant(name = "VM_Version::vis1_instructions_m", archs = {"sparc"}) @Stable public int vis1Instructions; - @HotSpotVMConstant(name = "VM_Version::cbcond_instructions_m", archs = {"sparc"}) @Stable public int cbcondInstructions; - @HotSpotVMConstant(name = "VM_Version::v8_instructions_m", archs = {"sparc"}) @Stable public int v8Instructions; - @HotSpotVMConstant(name = "VM_Version::hardware_mul32_m", archs = {"sparc"}) @Stable public int hardwareMul32; - @HotSpotVMConstant(name = "VM_Version::hardware_div32_m", archs = {"sparc"}) @Stable public int hardwareDiv32; - @HotSpotVMConstant(name = "VM_Version::hardware_fsmuld_m", archs = {"sparc"}) @Stable public int hardwareFsmuld; - @HotSpotVMConstant(name = "VM_Version::hardware_popc_m", archs = {"sparc"}) @Stable public int hardwarePopc; - @HotSpotVMConstant(name = "VM_Version::v9_instructions_m", archs = {"sparc"}) @Stable public int v9Instructions; - @HotSpotVMConstant(name = "VM_Version::sun4v_m", archs = {"sparc"}) @Stable public int sun4v; - @HotSpotVMConstant(name = "VM_Version::blk_init_instructions_m", archs = {"sparc"}) @Stable public int blkInitInstructions; - @HotSpotVMConstant(name = "VM_Version::fmaf_instructions_m", archs = {"sparc"}) @Stable public int fmafInstructions; - @HotSpotVMConstant(name = "VM_Version::fmau_instructions_m", archs = {"sparc"}) @Stable public int fmauInstructions; - @HotSpotVMConstant(name = "VM_Version::sparc64_family_m", archs = {"sparc"}) @Stable public int sparc64Family; - @HotSpotVMConstant(name = "VM_Version::M_family_m", archs = {"sparc"}) @Stable public int mFamily; - @HotSpotVMConstant(name = "VM_Version::T_family_m", archs = {"sparc"}) @Stable public int tFamily; - @HotSpotVMConstant(name = "VM_Version::T1_model_m", archs = {"sparc"}) @Stable public int t1Model; - @HotSpotVMConstant(name = "VM_Version::sparc5_instructions_m", archs = {"sparc"}) @Stable public int sparc5Instructions; - @HotSpotVMConstant(name = "VM_Version::aes_instructions_m", archs = {"sparc"}) @Stable public int aesInstructions; - @HotSpotVMConstant(name = "VM_Version::sha1_instruction_m", archs = {"sparc"}) @Stable public int sha1Instruction; - @HotSpotVMConstant(name = "VM_Version::sha256_instruction_m", archs = {"sparc"}) @Stable public int sha256Instruction; - @HotSpotVMConstant(name = "VM_Version::sha512_instruction_m", archs = {"sparc"}) @Stable public int sha512Instruction; + @HotSpotVMConstant(name = "VM_Version::vis3_instructions_m", archs = {"sparc"}) @Stable public int sparcVis3Instructions; + @HotSpotVMConstant(name = "VM_Version::vis2_instructions_m", archs = {"sparc"}) @Stable public int sparcVis2Instructions; + @HotSpotVMConstant(name = "VM_Version::vis1_instructions_m", archs = {"sparc"}) @Stable public int sparcVis1Instructions; + @HotSpotVMConstant(name = "VM_Version::cbcond_instructions_m", archs = {"sparc"}) @Stable public int sparcCbcondInstructions; + @HotSpotVMConstant(name = "VM_Version::v8_instructions_m", archs = {"sparc"}) @Stable public int sparcV8Instructions; + @HotSpotVMConstant(name = "VM_Version::hardware_mul32_m", archs = {"sparc"}) @Stable public int sparcHardwareMul32; + @HotSpotVMConstant(name = "VM_Version::hardware_div32_m", archs = {"sparc"}) @Stable public int sparcHardwareDiv32; + @HotSpotVMConstant(name = "VM_Version::hardware_fsmuld_m", archs = {"sparc"}) @Stable public int sparcHardwareFsmuld; + @HotSpotVMConstant(name = "VM_Version::hardware_popc_m", archs = {"sparc"}) @Stable public int sparcHardwarePopc; + @HotSpotVMConstant(name = "VM_Version::v9_instructions_m", archs = {"sparc"}) @Stable public int sparcV9Instructions; + @HotSpotVMConstant(name = "VM_Version::sun4v_m", archs = {"sparc"}) @Stable public int sparcSun4v; + @HotSpotVMConstant(name = "VM_Version::blk_init_instructions_m", archs = {"sparc"}) @Stable public int sparcBlkInitInstructions; + @HotSpotVMConstant(name = "VM_Version::fmaf_instructions_m", archs = {"sparc"}) @Stable public int sparcFmafInstructions; + @HotSpotVMConstant(name = "VM_Version::fmau_instructions_m", archs = {"sparc"}) @Stable public int sparcFmauInstructions; + @HotSpotVMConstant(name = "VM_Version::sparc64_family_m", archs = {"sparc"}) @Stable public int sparcSparc64Family; + @HotSpotVMConstant(name = "VM_Version::M_family_m", archs = {"sparc"}) @Stable public int sparcMFamily; + @HotSpotVMConstant(name = "VM_Version::T_family_m", archs = {"sparc"}) @Stable public int sparcTFamily; + @HotSpotVMConstant(name = "VM_Version::T1_model_m", archs = {"sparc"}) @Stable public int sparcT1Model; + @HotSpotVMConstant(name = "VM_Version::sparc5_instructions_m", archs = {"sparc"}) @Stable public int sparcSparc5Instructions; + @HotSpotVMConstant(name = "VM_Version::aes_instructions_m", archs = {"sparc"}) @Stable public int sparcAesInstructions; + @HotSpotVMConstant(name = "VM_Version::sha1_instruction_m", archs = {"sparc"}) @Stable public int sparcSha1Instruction; + @HotSpotVMConstant(name = "VM_Version::sha256_instruction_m", archs = {"sparc"}) @Stable public int sparcSha256Instruction; + @HotSpotVMConstant(name = "VM_Version::sha512_instruction_m", archs = {"sparc"}) @Stable public int sparcSha512Instruction; @HotSpotVMFlag(name = "UseBlockZeroing", archs = {"sparc"}) @Stable public boolean useBlockZeroing; @HotSpotVMFlag(name = "BlockZeroingLowLimit", archs = {"sparc"}) @Stable public int blockZeroingLowLimit; diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index 560fe57ea54..102ab14840f 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -1643,7 +1643,7 @@ void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) { st->print("total %d", os::processor_count()); // It's not safe to query number of active processors after crash. // st->print("(active %d)", os::active_processor_count()); - st->print(" %s", VM_Version::cpu_features()); + st->print(" %s", VM_Version::features()); st->cr(); } diff --git a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp index abd02c5c46c..84f7dca06ef 100644 --- a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp +++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp @@ -74,6 +74,8 @@ static_field(CompilerToVM::Data, cardtable_start_address, jbyte*) \ static_field(CompilerToVM::Data, cardtable_shift, int) \ \ + static_field(Abstract_VM_Version, _features, uint64_t) \ + \ nonstatic_field(Array, _length, int) \ unchecked_nonstatic_field(Array, _data, sizeof(u1)) \ unchecked_nonstatic_field(Array, _data, sizeof(u2)) \ @@ -586,11 +588,7 @@ #ifdef TARGET_ARCH_x86 #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ - volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ - static_field(VM_Version, _cpuFeatures, uint64_t) - -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ - declare_toplevel_type(VM_Version) + volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ LP64_ONLY(declare_constant(frame::arg_reg_save_area_bytes)) \ @@ -638,11 +636,7 @@ #ifdef TARGET_ARCH_sparc #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ - volatile_nonstatic_field(JavaFrameAnchor, _flags, int) \ - static_field(VM_Version, _features, int) - -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ - declare_toplevel_type(VM_Version) + volatile_nonstatic_field(JavaFrameAnchor, _flags, int) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ declare_constant(VM_Version::vis1_instructions_m) \ diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 557e93e36c6..db1e84dc0d7 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -1005,9 +1005,9 @@ WB_ENTRY(void, WB_ReadReservedMemory(JNIEnv* env, jobject o)) WB_END WB_ENTRY(jstring, WB_GetCPUFeatures(JNIEnv* env, jobject o)) - const char* cpu_features = VM_Version::cpu_features(); + const char* features = VM_Version::features_string(); ThreadToNativeFromVM ttn(thread); - jstring features_string = env->NewStringUTF(cpu_features); + jstring features_string = env->NewStringUTF(features); CHECK_JNI_EXCEPTION_(env, NULL); diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index e1c71bf1406..ee9fd1d9c38 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -819,7 +819,7 @@ void os::print_cpu_info(outputStream* st, char* buf, size_t buflen) { st->print("total %d", os::processor_count()); // It's not safe to query number of active processors after crash // st->print("(active %d)", os::active_processor_count()); - st->print(" %s", VM_Version::cpu_features()); + st->print(" %s", VM_Version::features_string()); st->cr(); pd_print_cpu_info(st, buf, buflen); } diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index dafa827c6c6..f279a37bc76 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -1310,6 +1310,8 @@ typedef CompactHashtable SymbolCompactHashTable; \ static_field(Abstract_VM_Version, _s_vm_release, const char*) \ static_field(Abstract_VM_Version, _s_internal_vm_info_string, const char*) \ + static_field(Abstract_VM_Version, _features, uint64_t) \ + static_field(Abstract_VM_Version, _features_string, const char*) \ static_field(Abstract_VM_Version, _vm_major_version, int) \ static_field(Abstract_VM_Version, _vm_minor_version, int) \ static_field(Abstract_VM_Version, _vm_security_version, int) \ diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp index fc20ee49665..1005e832cf0 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -31,6 +31,10 @@ const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release(); const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string(); + +uint64_t Abstract_VM_Version::_features = 0; +const char* Abstract_VM_Version::_features_string = ""; + bool Abstract_VM_Version::_supports_cx8 = false; bool Abstract_VM_Version::_supports_atomic_getset4 = false; bool Abstract_VM_Version::_supports_atomic_getset8 = false; diff --git a/hotspot/src/share/vm/runtime/vm_version.hpp b/hotspot/src/share/vm/runtime/vm_version.hpp index 4e12c00bba5..ee4b4ec0d64 100644 --- a/hotspot/src/share/vm/runtime/vm_version.hpp +++ b/hotspot/src/share/vm/runtime/vm_version.hpp @@ -31,10 +31,17 @@ // VM_Version provides information about the VM. class Abstract_VM_Version: AllStatic { - protected: friend class VMStructs; + friend class JVMCIVMStructs; + + protected: static const char* _s_vm_release; static const char* _s_internal_vm_info_string; + + // CPU feature flags. + static uint64_t _features; + static const char* _features_string; + // These are set by machine-dependent initializations static bool _supports_cx8; static bool _supports_atomic_getset4; @@ -100,6 +107,14 @@ class Abstract_VM_Version: AllStatic { static const char* jre_release_version(); static const char* jdk_debug_level(); + static uint64_t features() { + return _features; + } + + static const char* features_string() { + return _features_string; + } + // does HW support an 8-byte compare-exchange operation? static bool supports_cx8() { #ifdef SUPPORTS_NATIVE_CX8 diff --git a/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java b/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java index d31b62cf505..0d7960ee55a 100644 --- a/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java +++ b/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary / * @run main/othervm -XX:+UnlockExperimentalVMOptions * -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=true diff --git a/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java b/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java index 2e2618b5c44..e74fc43ca01 100644 --- a/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java +++ b/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ./common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java b/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java index 5e28832df8b..63c009c3df3 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java @@ -24,7 +24,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java index 8bfd63b9193..64dca91cfb5 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java b/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java index e77e06c80ab..be1d594bbd4 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib/ * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java index 2f0bc449986..d6c22fc5ee1 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java index 0d4ad698738..60a734d68a5 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @ignore 8139700 * @compile ../common/CompilerToVMHelper.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java index de8d74aa001..a87cab4a386 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java index 10f387db30c..dccd325b1df 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java @@ -21,7 +21,7 @@ import java.util.Map; /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java index 6405289a2a9..2b39757975c 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.FindUniqueConcreteMethodTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java index 1765f1ec367..586160f58fc 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java index d0a6097c035..6c731a4540f 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.GetClassInitializerTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java index ae541842b6a..4c347964800 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java ../common/PublicMetaspaceWrapperObject.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java index 2793286ae17..e8630c10d0f 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java index 8055d470330..fd88f772cba 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib/ * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.GetImplementorTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java index 9755b2a4564..8ca2f535bbc 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java index d83f87b56c0..d967e60a7d1 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @clean compiler.jvmci.compilerToVM.* * @compile -g DummyInterface.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java index 74c2481e6bd..b803f550600 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib/ * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.GetMaxCallTargetOffsetTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java index 063653b1d25..830ff7b066a 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java index a235e683440..3f578e9883d 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java index e5db902cecf..5a98e880f9c 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * ../common/PublicMetaspaceWrapperObject.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java index 82561463eb4..50b1a60acb8 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * ../common/PublicMetaspaceWrapperObject.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java index 9888931402a..5554bc3914b 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java index 201faa364c7..e550282d5b0 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.GetSymbolTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java index ae68ebe2286..f97a44750a6 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.GetVtableIndexForInterfaceTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java b/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java index e772a912406..cf839d71059 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java b/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java index 806a19e5c9c..ce6f1a830f9 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.HasFinalizableSubclassTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java b/hotspot/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java index 35fe8d18980..2a2268ab38c 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.InitializeConfigurationTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java index c76f62f28c1..a8eac1de6cd 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @ignore 8139700 * @compile ../common/CompilerToVMHelper.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java index 77f51447628..a8004268fd2 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox IsMatureTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java b/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java index 00378a00ed7..5a18a6ad29a 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary / * @run main/othervm -XX:+UnlockExperimentalVMOptions * -Dcompiler.jvmci.compilerToVM.JVM_RegisterJVMCINatives.positive=true diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java index 0451c71baa4..b3fb21028af 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @summary Testing compiler.jvmci.CompilerToVM.lookupKlassInPool method * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java index 571bf159660..2f6efe1795f 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.LookupTypeTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java b/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java index fce33de6d6b..326f24e92fb 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @ignore 8139703 * @compile ../common/CompilerToVMHelper.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java b/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java index 4d228cd967f..3d00dae0cd7 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ReadUncompressedOopTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ReadUncompressedOopTest.java index 7b752228962..5ff5913d6fe 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ReadUncompressedOopTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ReadUncompressedOopTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib/ * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.ReadUncompressedOopTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java index 2a81af5bfc4..bc3e781086d 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java index 0735ccb154d..e72240e0316 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.ResolveConstantInPoolTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java index e9e69f470f5..ba43e6b08ff 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.ResolveMethodTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java index a92800bb8dd..9b205e347ad 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @summary Testing compiler.jvmci.CompilerToVM.resolveTypeInPool method * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java index d7a4c84caad..86f9cef8ec0 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib/ * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.ShouldDebugNonSafepointsTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java index e2e35719ba9..a034166604a 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java index 98ad40ed2ad..f40dea820eb 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile CodeInstallerTest.java * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidCompilationResult */ diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java b/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java index cc387ed195f..ede956c1b82 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile CodeInstallerTest.java * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidDebugInfo */ diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java b/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java index 6291c06a7c2..df0b60adb0f 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile CodeInstallerTest.java * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidOopMap */ diff --git a/hotspot/test/compiler/jvmci/events/JvmciCreateMetaAccessContextTest.java b/hotspot/test/compiler/jvmci/events/JvmciCreateMetaAccessContextTest.java index e259f24fa15..810404bf8ef 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciCreateMetaAccessContextTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciCreateMetaAccessContextTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary * @compile ./MetaAccessWrapper.java * @build compiler.jvmci.common.JVMCIHelpers diff --git a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java index cea5bafbd9b..a1dfa84924c 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.common.JVMCIHelpers diff --git a/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java index 5b034a1a549..7dae44ee86c 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary / * @build compiler.jvmci.common.JVMCIHelpers * compiler.jvmci.events.JvmciShutdownEventListener diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java index 552a9937574..2da9725c0ae 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @run junit jdk.vm.ci.options.test.NestedBooleanOptionValueTest */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java index b9872d76fdd..0f9d23d5a50 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @run junit jdk.vm.ci.options.test.TestOptionValue */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java index ab214fd66ad..5be56d0c33a 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile ConstantTest.java FieldUniverse.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ConstantTest */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java index f7422fbce78..11392414300 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile RedefineClassTest.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.RedefineClassTest */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java index f6d38b44bbd..37b54a14796 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveConcreteMethodTest */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java index 2b5d05c60d5..043aba3d9bb 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveMethodTest */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java index bdb258038b8..dbde990b71c 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestConstantReflectionProvider.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestConstantReflectionProvider */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java index 1dea56cc20a..d4c3a58db5d 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestJavaField.java FieldUniverse.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaField */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java index f5e5b368e3e..50e7b2ed3ee 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestJavaMethod.java MethodUniverse.java TypeUniverse.java TestMetaAccessProvider.java NameAndSignature.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaMethod */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java index e17427bf432..311c96ac5af 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestJavaType.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaType */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java index c0420f4f5e4..9c1974035cf 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestMetaAccessProvider.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestMetaAccessProvider */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java index 4b0c4df2c74..fb960c00af7 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestResolvedJavaField.java FieldUniverse.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaField */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java index 39ef621f924..bb3da636e2c 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestResolvedJavaMethod.java MethodUniverse.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaMethod */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java index 2ddf7797fcc..37b430ff908 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestResolvedJavaType.java TypeUniverse.java TestMetaAccessProvider.java NameAndSignature.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaType */ From e227bbc9daf6a806a7b3a51af68b5ead927773cd Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Fri, 25 Dec 2015 03:27:06 +0300 Subject: [PATCH 162/228] 8146205: quarantine compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java Reviewed-by: kvn --- .../compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java index dccd325b1df..839b509af15 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java @@ -23,6 +23,7 @@ import java.util.Map; * @bug 8136421 * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / + * @ignore 8139383 * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox * compiler.jvmci.compilerToVM.ExecuteInstalledCodeTest From 28154b095e346e57d3430bfae511a2bcd3898752 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Mon, 28 Dec 2015 10:32:20 +0100 Subject: [PATCH 163/228] 8146231: ppc64/gcc 4.1.2: fix build after "8143072: [JVMCI] Port JVMCI to AArch64" Reviewed-by: goetz --- hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp index 741618c33c8..63b9ba09793 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp @@ -62,7 +62,7 @@ protected: vcipher_m = (1 << vcipher), vpmsumb_m = (1 << vpmsumb), tcheck_m = (1 << tcheck ), - all_features_m = -1 + all_features_m = (unsigned long)-1 }; static bool _is_determine_features_test_running; From ae88612f52a798e6af2bb23c758827af407d4a23 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Sat, 26 Dec 2015 16:59:26 +0100 Subject: [PATCH 164/228] 8146157: JVMCI must not fold accesses to @Stable fields if -XX:-FoldStableValues Reviewed-by: twisti --- .../hotspot/HotSpotConstantReflectionProvider.java | 8 +++++--- .../jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java | 13 +++++-------- .../src/jdk/vm/ci/hotspot/HotSpotVMConfig.java | 2 ++ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java index a5d165feb61..ef2261de039 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java @@ -242,7 +242,7 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv * {@link #readConstantFieldValue(JavaField, JavaConstant)}. */ protected boolean isStaticFieldConstant(HotSpotResolvedJavaField staticField) { - if (staticField.isFinal() || staticField.isStable()) { + if (staticField.isFinal() || (staticField.isStable() && runtime.getConfig().foldStableValues)) { ResolvedJavaType holder = staticField.getDeclaringClass(); if (holder.isInitialized() && !holder.getName().equals(SystemClassName)) { return true; @@ -312,7 +312,7 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv return value; } } - } else if (hotspotField.isStable()) { + } else if (hotspotField.isStable() && runtime.getConfig().foldStableValues) { if (hotspotField.isInObject(object)) { JavaConstant value = readFieldValue(field, receiver); if (isStableInstanceFieldValueConstant(value, object.getClass())) { @@ -337,8 +337,10 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv HotSpotResolvedJavaField hotspotField = (HotSpotResolvedJavaField) field; if (!hotspotField.isStable()) { return readNonStableFieldValue(field, receiver); - } else { + } else if (runtime.getConfig().foldStableValues) { return readStableFieldValue(field, receiver, hotspotField.isDefaultStable()); + } else { + return null; } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java index 00b0c0de8c9..1fd7e48924f 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -40,17 +40,14 @@ public interface HotSpotResolvedJavaField extends ResolvedJavaField { int offset(); /** - * Checks if this field has the {@link Stable} annotation. - * - * @return true if field has {@link Stable} annotation, false otherwise + * Determines if this field should be treated as a constant. */ boolean isStable(); /** - * If this field is stable, checks if default values (0, null, etc.) should be considered stable - * as well. - * - * @return true if default values should be considered stable, false otherwise + * Determines if this field should be considered constant if it has the default value for its + * type (e.g, 0, null, etc.). The result of this method is undefined if this field is not + * {@linkplain #isStable() stable}. */ boolean isDefaultStable(); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java index c8113446681..d237006dfcb 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @@ -853,6 +853,7 @@ public class HotSpotVMConfig { @HotSpotVMFlag(name = "JVMCIUseFastLocking") @Stable public boolean useFastLocking; @HotSpotVMFlag(name = "ForceUnreachable") @Stable public boolean forceUnreachable; @HotSpotVMFlag(name = "CodeCacheSegmentSize") @Stable public int codeSegmentSize; + @HotSpotVMFlag(name = "FoldStableValues") @Stable public boolean foldStableValues; @HotSpotVMFlag(name = "UseTLAB") @Stable public boolean useTLAB; @HotSpotVMFlag(name = "UseBiasedLocking") @Stable public boolean useBiasedLocking; @@ -1683,6 +1684,7 @@ public class HotSpotVMConfig { @HotSpotVMConstant(name = "ArrayData::array_len_off_set") @Stable public int arrayDataArrayLenOffset; @HotSpotVMConstant(name = "ArrayData::array_start_off_set") @Stable public int arrayDataArrayStartOffset; @HotSpotVMConstant(name = "MultiBranchData::per_case_cell_count") @Stable public int multiBranchDataPerCaseCellCount; + // Checkstyle: resume private boolean check() { From fb318fc787a3bf941bfe4182c1f1af6a41971d05 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Mon, 28 Dec 2015 10:10:37 -1000 Subject: [PATCH 165/228] 8146245: compiler/jvmci/ tests fail: java.lang.AssertionError: minimum config for aarch64 Reviewed-by: kvn --- .../jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java index af6f7e892af..0038c161b1b 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java @@ -175,11 +175,9 @@ public class AArch64 extends Architecture { private final EnumSet flags; public AArch64(EnumSet features, EnumSet flags) { - super("aarch64", AArch64Kind.QWORD, ByteOrder.LITTLE_ENDIAN, /* unalignedMemoryAccess */true, allRegisters, /* implicitMemoryBarriers */0, /* nativeCallDisplacementOffset */0, - /* returnAddressSize */0); + super("aarch64", AArch64Kind.QWORD, ByteOrder.LITTLE_ENDIAN, true, allRegisters, 0, 0, 0); this.features = features; this.flags = flags; - assert features.contains(CPUFeature.FP) : "minimum config for aarch64"; } public EnumSet getFeatures() { From 790f5bded45619ff7aea5b1506e5daceac4740bf Mon Sep 17 00:00:00 2001 From: Kishor Kharbas Date: Mon, 28 Dec 2015 23:11:01 -0800 Subject: [PATCH 166/228] 8143925: Enhancing CounterMode.crypt() for AES Add intrinsic for CounterMode.crypt() to leverage the parallel nature of AES in Counter(CTR) Mode. Reviewed-by: kvn, ascarpino --- .../src/cpu/aarch64/vm/vm_version_aarch64.cpp | 5 + hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp | 5 + hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp | 5 + hotspot/src/cpu/x86/vm/assembler_x86.cpp | 91 ++++- hotspot/src/cpu/x86/vm/assembler_x86.hpp | 10 + .../src/cpu/x86/vm/stubGenerator_x86_32.cpp | 352 ++++++++++++++++++ .../src/cpu/x86/vm/stubGenerator_x86_64.cpp | 348 ++++++++++++++++- hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp | 1 + hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp | 6 +- .../src/cpu/x86/vm/stubRoutines_x86_32.hpp | 2 +- .../src/cpu/x86/vm/stubRoutines_x86_64.hpp | 2 +- hotspot/src/cpu/x86/vm/vm_version_x86.cpp | 36 ++ hotspot/src/share/vm/classfile/vmSymbols.cpp | 4 + hotspot/src/share/vm/classfile/vmSymbols.hpp | 4 + hotspot/src/share/vm/opto/c2compiler.cpp | 1 + hotspot/src/share/vm/opto/escape.cpp | 1 + hotspot/src/share/vm/opto/library_call.cpp | 167 +++++++++ hotspot/src/share/vm/opto/runtime.cpp | 29 ++ hotspot/src/share/vm/opto/runtime.hpp | 1 + hotspot/src/share/vm/runtime/globals.hpp | 3 + hotspot/src/share/vm/runtime/stubRoutines.cpp | 1 + hotspot/src/share/vm/runtime/stubRoutines.hpp | 2 + hotspot/src/share/vm/runtime/vmStructs.cpp | 1 + .../compiler/codegen/7184394/TestAESBase.java | 4 +- .../compiler/codegen/7184394/TestAESMain.java | 7 + 25 files changed, 1079 insertions(+), 9 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp index ddd41c3243b..d48f4ee3a25 100644 --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp @@ -202,6 +202,11 @@ void VM_Version::get_processor_features() { } } + if (UseAESCTRIntrinsics) { + warning("AES/CTR intrinsics are not available on this CPU"); + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } + if (FLAG_IS_DEFAULT(UseCRC32Intrinsics)) { UseCRC32Intrinsics = true; } diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index 16c4db8a042..3acbec86ad1 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -196,6 +196,11 @@ void VM_Version::initialize() { FLAG_SET_DEFAULT(UseAESIntrinsics, false); } + if (UseAESCTRIntrinsics) { + warning("AES/CTR intrinsics are not available on this CPU"); + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } + if (UseGHASHIntrinsics) { warning("GHASH intrinsics are not available on this CPU"); FLAG_SET_DEFAULT(UseGHASHIntrinsics, false); diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp index 462ddb2ba06..fe7ce4f315e 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp @@ -260,6 +260,11 @@ void VM_Version::initialize() { } } + if (UseAESCTRIntrinsics) { + warning("AES/CTR intrinsics are not available on this CPU"); + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } + // GHASH/GCM intrinsics if (has_vis3() && (UseVIS > 2)) { if (FLAG_IS_DEFAULT(UseGHASHIntrinsics)) { diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index 65451309b28..9a7fd0069cf 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -3349,22 +3349,41 @@ void Assembler::vpmovmskb(Register dst, XMMRegister src) { void Assembler::pextrd(Register dst, XMMRegister src, int imm8) { assert(VM_Version::supports_sse4_1(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + int encode = simd_prefix_and_encode(src, xnoreg, as_XMMRegister(dst->encoding()), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); emit_int8(0x16); emit_int8((unsigned char)(0xC0 | encode)); emit_int8(imm8); } +void Assembler::pextrd(Address dst, XMMRegister src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); + simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8(0x16); + emit_operand(src, dst); + emit_int8(imm8); +} + void Assembler::pextrq(Register dst, XMMRegister src, int imm8) { assert(VM_Version::supports_sse4_1(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + int encode = simd_prefix_and_encode(src, xnoreg, as_XMMRegister(dst->encoding()), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); emit_int8(0x16); emit_int8((unsigned char)(0xC0 | encode)); emit_int8(imm8); } -// The encoding for pextrw is SSE2 to support the LIBM implementation. +void Assembler::pextrq(Address dst, XMMRegister src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); + simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8(0x16); + emit_operand(src, dst); + emit_int8(imm8); +} + void Assembler::pextrw(Register dst, XMMRegister src, int imm8) { assert(VM_Version::supports_sse2(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); @@ -3374,6 +3393,26 @@ void Assembler::pextrw(Register dst, XMMRegister src, int imm8) { emit_int8(imm8); } +void Assembler::pextrw(Address dst, XMMRegister src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_16bit); + simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8((unsigned char)0x15); + emit_operand(src, dst); + emit_int8(imm8); +} + +void Assembler::pextrb(Address dst, XMMRegister src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_8bit); + simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8(0x14); + emit_operand(src, dst); + emit_int8(imm8); +} + void Assembler::pinsrd(XMMRegister dst, Register src, int imm8) { assert(VM_Version::supports_sse4_1(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); @@ -3383,6 +3422,16 @@ void Assembler::pinsrd(XMMRegister dst, Register src, int imm8) { emit_int8(imm8); } +void Assembler::pinsrd(XMMRegister dst, Address src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); + simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8(0x22); + emit_operand(dst,src); + emit_int8(imm8); +} + void Assembler::pinsrq(XMMRegister dst, Register src, int imm8) { assert(VM_Version::supports_sse4_1(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); @@ -3392,6 +3441,16 @@ void Assembler::pinsrq(XMMRegister dst, Register src, int imm8) { emit_int8(imm8); } +void Assembler::pinsrq(XMMRegister dst, Address src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); + simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8(0x22); + emit_operand(dst, src); + emit_int8(imm8); +} + void Assembler::pinsrw(XMMRegister dst, Register src, int imm8) { assert(VM_Version::supports_sse2(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); @@ -3401,6 +3460,26 @@ void Assembler::pinsrw(XMMRegister dst, Register src, int imm8) { emit_int8(imm8); } +void Assembler::pinsrw(XMMRegister dst, Address src, int imm8) { + assert(VM_Version::supports_sse2(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_16bit); + simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xC4); + emit_operand(dst, src); + emit_int8(imm8); +} + +void Assembler::pinsrb(XMMRegister dst, Address src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_8bit); + simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8(0x20); + emit_operand(dst, src); + emit_int8(imm8); +} + void Assembler::pmovzxbw(XMMRegister dst, Address src) { assert(VM_Version::supports_sse4_1(), ""); InstructionMark im(this); @@ -4188,6 +4267,12 @@ void Assembler::xorl(Register dst, Register src) { emit_arith(0x33, 0xC0, dst, src); } +void Assembler::xorb(Register dst, Address src) { + InstructionMark im(this); + prefix(src, dst); + emit_int8(0x32); + emit_operand(dst, src); +} // AVX 3-operands scalar float-point arithmetic instructions diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp index 380447b5d24..45ecc01f24a 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp @@ -1543,14 +1543,22 @@ private: // SSE 4.1 extract void pextrd(Register dst, XMMRegister src, int imm8); void pextrq(Register dst, XMMRegister src, int imm8); + void pextrd(Address dst, XMMRegister src, int imm8); + void pextrq(Address dst, XMMRegister src, int imm8); + void pextrb(Address dst, XMMRegister src, int imm8); // SSE 2 extract void pextrw(Register dst, XMMRegister src, int imm8); + void pextrw(Address dst, XMMRegister src, int imm8); // SSE 4.1 insert void pinsrd(XMMRegister dst, Register src, int imm8); void pinsrq(XMMRegister dst, Register src, int imm8); + void pinsrd(XMMRegister dst, Address src, int imm8); + void pinsrq(XMMRegister dst, Address src, int imm8); + void pinsrb(XMMRegister dst, Address src, int imm8); // SSE 2 insert void pinsrw(XMMRegister dst, Register src, int imm8); + void pinsrw(XMMRegister dst, Address src, int imm8); // SSE4.1 packed move void pmovzxbw(XMMRegister dst, XMMRegister src); @@ -1762,6 +1770,8 @@ private: void xorl(Register dst, Address src); void xorl(Register dst, Register src); + void xorb(Register dst, Address src); + void xorq(Register dst, Address src); void xorq(Register dst, Register src); diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 57db8eeede0..5ac5593f1c9 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -2142,6 +2142,17 @@ class StubGenerator: public StubCodeGenerator { return start; } + address generate_counter_shuffle_mask() { + __ align(16); + StubCodeMark mark(this, "StubRoutines", "counter_shuffle_mask"); + address start = __ pc(); + __ emit_data(0x0c0d0e0f, relocInfo::none, 0); + __ emit_data(0x08090a0b, relocInfo::none, 0); + __ emit_data(0x04050607, relocInfo::none, 0); + __ emit_data(0x00010203, relocInfo::none, 0); + return start; + } + // Utility routine for loading a 128-bit key word in little endian format // can optionally specify that the shuffle mask is already in an xmmregister void load_key(XMMRegister xmmdst, Register key, int offset, XMMRegister xmm_shuf_mask=NULL) { @@ -2167,6 +2178,31 @@ class StubGenerator: public StubCodeGenerator { __ aesdec(xmmdst, xmmtmp); } + // Utility routine for increase 128bit counter (iv in CTR mode) + // XMM_128bit, D3, D2, D1, D0 + void inc_counter(Register reg, XMMRegister xmmdst, int inc_delta, Label& next_block) { + __ pextrd(reg, xmmdst, 0x0); + __ addl(reg, inc_delta); + __ pinsrd(xmmdst, reg, 0x0); + __ jcc(Assembler::carryClear, next_block); // jump if no carry + + __ pextrd(reg, xmmdst, 0x01); // Carry-> D1 + __ addl(reg, 0x01); + __ pinsrd(xmmdst, reg, 0x01); + __ jcc(Assembler::carryClear, next_block); // jump if no carry + + __ pextrd(reg, xmmdst, 0x02); // Carry-> D2 + __ addl(reg, 0x01); + __ pinsrd(xmmdst, reg, 0x02); + __ jcc(Assembler::carryClear, next_block); // jump if no carry + + __ pextrd(reg, xmmdst, 0x03); // Carry -> D3 + __ addl(reg, 0x01); + __ pinsrd(xmmdst, reg, 0x03); + + __ BIND(next_block); // next instruction + } + // Arguments: // @@ -2742,6 +2778,317 @@ class StubGenerator: public StubCodeGenerator { return start; } + + // CTR AES crypt. + // In 32-bit stub, parallelize 4 blocks at a time + // Arguments: + // + // Inputs: + // c_rarg0 - source byte array address + // c_rarg1 - destination byte array address + // c_rarg2 - K (key) in little endian int array + // c_rarg3 - counter vector byte array address + // c_rarg4 - input length + // + // Output: + // rax - input length + // + address generate_counterMode_AESCrypt_Parallel() { + assert(UseAES, "need AES instructions and misaligned SSE support"); + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "counterMode_AESCrypt"); + address start = __ pc(); + const Register from = rsi; // source array address + const Register to = rdx; // destination array address + const Register key = rcx; // key array address + const Register counter = rdi; // counter byte array initialized from initvector array address + + // and left with the results of the last encryption block + const Register len_reg = rbx; + const Register pos = rax; + + __ enter(); // required for proper stackwalking of RuntimeStub frame + handleSOERegisters(true /*saving*/); // save rbx, rsi, rdi + + // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge + // context for the registers used, where all instructions below are using 128-bit mode + // On EVEX without VL and BW, these instructions will all be AVX. + if (VM_Version::supports_avx512vlbw()) { + __ movl(rdx, 0xffff); + __ kmovdl(k1, rdx); + } + + // load registers from incoming parameters + const Address from_param(rbp, 8+0); + const Address to_param (rbp, 8+4); + const Address key_param (rbp, 8+8); + const Address rvec_param (rbp, 8+12); + const Address len_param (rbp, 8+16); + const Address saved_counter_param(rbp, 8 + 20); + const Address used_addr_param(rbp, 8 + 24); + + __ movptr(from , from_param); + __ movptr(to , to_param); + //__ movptr(key, key_param); + //__ movptr(counter, rvec_param); + __ movptr(len_reg , len_param); + //__ movptr(pos, 0); + + // Use the partially used encrpyted counter from last invocation + Label L_exit_preLoop, L_preLoop_start; + + // Use the registers 'counter' and 'key' here in this preloop + // to hold of last 2 params 'used' and 'saved_encCounter_start' + Register used = counter; + Register saved_encCounter_start = key; + Register used_addr = saved_encCounter_start; + + __ movptr(used_addr, used_addr_param); + __ movptr(used, Address(used_addr, 0)); + __ movptr(saved_encCounter_start, saved_counter_param); + + __ BIND(L_preLoop_start); + __ cmpptr(used, 16); + __ jcc(Assembler::aboveEqual, L_exit_preLoop); + __ cmpptr(len_reg, 0); + __ jcc(Assembler::lessEqual, L_exit_preLoop); + __ movb(rax, Address(saved_encCounter_start, used)); + __ xorb(rax, Address(from, 0)); + __ movb(Address(to, 0), rax); + __ addptr(from, 1); + __ addptr(to, 1); + __ addptr(used, 1); + __ subptr(len_reg, 1); + + __ jmp(L_preLoop_start); + + __ BIND(L_exit_preLoop); + __ movptr(used_addr, used_addr_param); + __ movptr(used_addr, used_addr_param); + __ movl(Address(used_addr, 0), used); + + // load the parameters 'key' and 'counter' + __ movptr(key, key_param); + __ movptr(counter, rvec_param); + + // xmm register assignments for the loops below + const XMMRegister xmm_curr_counter = xmm0; + const XMMRegister xmm_counter_shuf_mask = xmm1; // need to be reloaded + const XMMRegister xmm_key_shuf_mask = xmm2; // need to be reloaded + const XMMRegister xmm_key = xmm3; + const XMMRegister xmm_result0 = xmm4; + const XMMRegister xmm_result1 = xmm5; + const XMMRegister xmm_result2 = xmm6; + const XMMRegister xmm_result3 = xmm7; + const XMMRegister xmm_from0 = xmm1; //reuse XMM register + const XMMRegister xmm_from1 = xmm2; + const XMMRegister xmm_from2 = xmm3; + const XMMRegister xmm_from3 = xmm4; + + //for key_128, key_192, key_256 + const int rounds[3] = {10, 12, 14}; + Label L_singleBlockLoopTop[3]; + Label L_multiBlock_loopTop[3]; + Label L_key192_top, L_key256_top; + Label L_incCounter[3][4]; // 3: different key length, 4: 4 blocks at a time + Label L_incCounter_single[3]; //for single block, key128, key192, key256 + Label L_processTail_insr[3], L_processTail_4_insr[3], L_processTail_2_insr[3], L_processTail_1_insr[3], L_processTail_exit_insr[3]; + Label L_processTail_extr[3], L_processTail_4_extr[3], L_processTail_2_extr[3], L_processTail_1_extr[3], L_processTail_exit_extr[3]; + + Label L_exit; + const int PARALLEL_FACTOR = 4; //because of the limited register number + + // initialize counter with initial counter + __ movdqu(xmm_curr_counter, Address(counter, 0x00)); + __ movdqu(xmm_counter_shuf_mask, ExternalAddress(StubRoutines::x86::counter_shuffle_mask_addr())); + __ pshufb(xmm_curr_counter, xmm_counter_shuf_mask); //counter is shuffled for increase + + // key length could be only {11, 13, 15} * 4 = {44, 52, 60} + __ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr())); + __ movl(rax, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT))); + __ cmpl(rax, 52); + __ jcc(Assembler::equal, L_key192_top); + __ cmpl(rax, 60); + __ jcc(Assembler::equal, L_key256_top); + + //key128 begins here + __ movptr(pos, 0); // init pos before L_multiBlock_loopTop + +#define CTR_DoFour(opc, src_reg) \ + __ opc(xmm_result0, src_reg); \ + __ opc(xmm_result1, src_reg); \ + __ opc(xmm_result2, src_reg); \ + __ opc(xmm_result3, src_reg); + + // k == 0 : generate code for key_128 + // k == 1 : generate code for key_192 + // k == 2 : generate code for key_256 + for (int k = 0; k < 3; ++k) { + //multi blocks starts here + __ align(OptoLoopAlignment); + __ BIND(L_multiBlock_loopTop[k]); + __ cmpptr(len_reg, PARALLEL_FACTOR * AESBlockSize); // see if at least PARALLEL_FACTOR blocks left + __ jcc(Assembler::less, L_singleBlockLoopTop[k]); + + __ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr())); + __ movdqu(xmm_counter_shuf_mask, ExternalAddress(StubRoutines::x86::counter_shuffle_mask_addr())); + + //load, then increase counters + CTR_DoFour(movdqa, xmm_curr_counter); + __ push(rbx); + inc_counter(rbx, xmm_result1, 0x01, L_incCounter[k][0]); + inc_counter(rbx, xmm_result2, 0x02, L_incCounter[k][1]); + inc_counter(rbx, xmm_result3, 0x03, L_incCounter[k][2]); + inc_counter(rbx, xmm_curr_counter, 0x04, L_incCounter[k][3]); + __ pop (rbx); + + load_key(xmm_key, key, 0x00, xmm_key_shuf_mask); // load Round 0 key. interleaving for better performance + + CTR_DoFour(pshufb, xmm_counter_shuf_mask); // after increased, shuffled counters back for PXOR + CTR_DoFour(pxor, xmm_key); //PXOR with Round 0 key + + for (int i = 1; i < rounds[k]; ++i) { + load_key(xmm_key, key, (0x10 * i), xmm_key_shuf_mask); + CTR_DoFour(aesenc, xmm_key); + } + load_key(xmm_key, key, (0x10 * rounds[k]), xmm_key_shuf_mask); + CTR_DoFour(aesenclast, xmm_key); + + // get next PARALLEL_FACTOR blocks into xmm_from registers + __ movdqu(xmm_from0, Address(from, pos, Address::times_1, 0 * AESBlockSize)); + __ movdqu(xmm_from1, Address(from, pos, Address::times_1, 1 * AESBlockSize)); + __ movdqu(xmm_from2, Address(from, pos, Address::times_1, 2 * AESBlockSize)); + + // PXOR with input text + __ pxor(xmm_result0, xmm_from0); //result0 is xmm4 + __ pxor(xmm_result1, xmm_from1); + __ pxor(xmm_result2, xmm_from2); + + // store PARALLEL_FACTOR results into the next 64 bytes of output + __ movdqu(Address(to, pos, Address::times_1, 0 * AESBlockSize), xmm_result0); + __ movdqu(Address(to, pos, Address::times_1, 1 * AESBlockSize), xmm_result1); + __ movdqu(Address(to, pos, Address::times_1, 2 * AESBlockSize), xmm_result2); + + // do it here after xmm_result0 is saved, because xmm_from3 reuse the same register of xmm_result0. + __ movdqu(xmm_from3, Address(from, pos, Address::times_1, 3 * AESBlockSize)); + __ pxor(xmm_result3, xmm_from3); + __ movdqu(Address(to, pos, Address::times_1, 3 * AESBlockSize), xmm_result3); + + __ addptr(pos, PARALLEL_FACTOR * AESBlockSize); // increase the length of crypt text + __ subptr(len_reg, PARALLEL_FACTOR * AESBlockSize); // decrease the remaining length + __ jmp(L_multiBlock_loopTop[k]); + + // singleBlock starts here + __ align(OptoLoopAlignment); + __ BIND(L_singleBlockLoopTop[k]); + __ cmpptr(len_reg, 0); + __ jcc(Assembler::equal, L_exit); + __ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr())); + __ movdqu(xmm_counter_shuf_mask, ExternalAddress(StubRoutines::x86::counter_shuffle_mask_addr())); + __ movdqa(xmm_result0, xmm_curr_counter); + load_key(xmm_key, key, 0x00, xmm_key_shuf_mask); + __ push(rbx);//rbx is used for increasing counter + inc_counter(rbx, xmm_curr_counter, 0x01, L_incCounter_single[k]); + __ pop (rbx); + __ pshufb(xmm_result0, xmm_counter_shuf_mask); + __ pxor(xmm_result0, xmm_key); + for (int i = 1; i < rounds[k]; i++) { + load_key(xmm_key, key, (0x10 * i), xmm_key_shuf_mask); + __ aesenc(xmm_result0, xmm_key); + } + load_key(xmm_key, key, (0x10 * rounds[k]), xmm_key_shuf_mask); + __ aesenclast(xmm_result0, xmm_key); + __ cmpptr(len_reg, AESBlockSize); + __ jcc(Assembler::less, L_processTail_insr[k]); + __ movdqu(xmm_from0, Address(from, pos, Address::times_1, 0 * AESBlockSize)); + __ pxor(xmm_result0, xmm_from0); + __ movdqu(Address(to, pos, Address::times_1, 0 * AESBlockSize), xmm_result0); + __ addptr(pos, AESBlockSize); + __ subptr(len_reg, AESBlockSize); + __ jmp(L_singleBlockLoopTop[k]); + + __ BIND(L_processTail_insr[k]); + __ addptr(pos, len_reg); + __ testptr(len_reg, 8); + __ jcc(Assembler::zero, L_processTail_4_insr[k]); + __ subptr(pos,8); + __ pinsrd(xmm_from0, Address(from, pos), 0); + __ pinsrd(xmm_from0, Address(from, pos, Address::times_1, 4), 1); + __ BIND(L_processTail_4_insr[k]); + __ testptr(len_reg, 4); + __ jcc(Assembler::zero, L_processTail_2_insr[k]); + __ subptr(pos,4); + __ pslldq(xmm_from0, 4); + __ pinsrd(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_2_insr[k]); + __ testptr(len_reg, 2); + __ jcc(Assembler::zero, L_processTail_1_insr[k]); + __ subptr(pos, 2); + __ pslldq(xmm_from0, 2); + __ pinsrw(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_1_insr[k]); + __ testptr(len_reg, 1); + __ jcc(Assembler::zero, L_processTail_exit_insr[k]); + __ subptr(pos, 1); + __ pslldq(xmm_from0, 1); + __ pinsrb(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_exit_insr[k]); + + __ movptr(saved_encCounter_start, saved_counter_param); + __ movdqu(Address(saved_encCounter_start, 0), xmm_result0); + __ pxor(xmm_result0, xmm_from0); + + __ testptr(len_reg, 8); + __ jcc(Assembler::zero, L_processTail_4_extr[k]); + __ pextrd(Address(to, pos), xmm_result0, 0); + __ pextrd(Address(to, pos, Address::times_1, 4), xmm_result0, 1); + __ psrldq(xmm_result0, 8); + __ addptr(pos, 8); + __ BIND(L_processTail_4_extr[k]); + __ testptr(len_reg, 4); + __ jcc(Assembler::zero, L_processTail_2_extr[k]); + __ pextrd(Address(to, pos), xmm_result0, 0); + __ psrldq(xmm_result0, 4); + __ addptr(pos, 4); + __ BIND(L_processTail_2_extr[k]); + __ testptr(len_reg, 2); + __ jcc(Assembler::zero, L_processTail_1_extr[k]); + __ pextrb(Address(to, pos), xmm_result0, 0); + __ pextrb(Address(to, pos, Address::times_1, 1), xmm_result0, 1); + __ psrldq(xmm_result0, 2); + __ addptr(pos, 2); + __ BIND(L_processTail_1_extr[k]); + __ testptr(len_reg, 1); + __ jcc(Assembler::zero, L_processTail_exit_extr[k]); + __ pextrb(Address(to, pos), xmm_result0, 0); + + __ BIND(L_processTail_exit_extr[k]); + __ movptr(used_addr, used_addr_param); + __ movl(Address(used_addr, 0), len_reg); + __ jmp(L_exit); + } + + __ BIND(L_exit); + __ movdqu(xmm_counter_shuf_mask, ExternalAddress(StubRoutines::x86::counter_shuffle_mask_addr())); + __ pshufb(xmm_curr_counter, xmm_counter_shuf_mask); //counter is shuffled back. + __ movdqu(Address(counter, 0), xmm_curr_counter); //save counter back + handleSOERegisters(false /*restoring*/); + __ movptr(rax, len_param); // return length + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + __ BIND (L_key192_top); + __ movptr(pos, 0); // init pos before L_multiBlock_loopTop + __ jmp(L_multiBlock_loopTop[1]); //key192 + + __ BIND (L_key256_top); + __ movptr(pos, 0); // init pos before L_multiBlock_loopTop + __ jmp(L_multiBlock_loopTop[2]); //key192 + + return start; + } + + // byte swap x86 long address generate_ghash_long_swap_mask() { __ align(CodeEntryAlignment); @@ -3360,6 +3707,11 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt(); } + if (UseAESCTRIntrinsics) { + StubRoutines::x86::_counter_shuffle_mask_addr = generate_counter_shuffle_mask(); + StubRoutines::_counterMode_AESCrypt = generate_counterMode_AESCrypt_Parallel(); + } + // Generate GHASH intrinsics code if (UseGHASHIntrinsics) { StubRoutines::x86::_ghash_long_swap_mask_addr = generate_ghash_long_swap_mask(); diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index 72babc6f146..b3eb330ac9b 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -3039,6 +3039,15 @@ class StubGenerator: public StubCodeGenerator { return start; } + address generate_counter_shuffle_mask() { + __ align(16); + StubCodeMark mark(this, "StubRoutines", "counter_shuffle_mask"); + address start = __ pc(); + __ emit_data64(0x08090a0b0c0d0e0f, relocInfo::none); + __ emit_data64(0x0001020304050607, relocInfo::none); + return start; + } + // Utility routine for loading a 128-bit key word in little endian format // can optionally specify that the shuffle mask is already in an xmmregister void load_key(XMMRegister xmmdst, Register key, int offset, XMMRegister xmm_shuf_mask=NULL) { @@ -3050,6 +3059,18 @@ class StubGenerator: public StubCodeGenerator { } } + // Utility routine for increase 128bit counter (iv in CTR mode) + void inc_counter(Register reg, XMMRegister xmmdst, int inc_delta, Label& next_block) { + __ pextrq(reg, xmmdst, 0x0); + __ addq(reg, inc_delta); + __ pinsrq(xmmdst, reg, 0x0); + __ jcc(Assembler::carryClear, next_block); // jump if no carry + __ pextrq(reg, xmmdst, 0x01); // Carry + __ addq(reg, 0x01); + __ pinsrq(xmmdst, reg, 0x01); //Carry end + __ BIND(next_block); // next instruction + } + // Arguments: // // Inputs: @@ -3700,6 +3721,328 @@ class StubGenerator: public StubCodeGenerator { return start; } + // This is a version of CTR/AES crypt which does 6 blocks in a loop at a time + // to hide instruction latency + // + // Arguments: + // + // Inputs: + // c_rarg0 - source byte array address + // c_rarg1 - destination byte array address + // c_rarg2 - K (key) in little endian int array + // c_rarg3 - counter vector byte array address + // Linux + // c_rarg4 - input length + // c_rarg5 - saved encryptedCounter start + // rbp + 6 * wordSize - saved used length + // Windows + // rbp + 6 * wordSize - input length + // rbp + 7 * wordSize - saved encryptedCounter start + // rbp + 8 * wordSize - saved used length + // + // Output: + // rax - input length + // + address generate_counterMode_AESCrypt_Parallel() { + assert(UseAES, "need AES instructions and misaligned SSE support"); + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "counterMode_AESCrypt"); + address start = __ pc(); + const Register from = c_rarg0; // source array address + const Register to = c_rarg1; // destination array address + const Register key = c_rarg2; // key array address + const Register counter = c_rarg3; // counter byte array initialized from counter array address + // and left with the results of the last encryption block +#ifndef _WIN64 + const Register len_reg = c_rarg4; + const Register saved_encCounter_start = c_rarg5; + const Register used_addr = r10; + const Address used_mem(rbp, 2 * wordSize); + const Register used = r11; +#else + const Address len_mem(rbp, 6 * wordSize); // length is on stack on Win64 + const Address saved_encCounter_mem(rbp, 7 * wordSize); // length is on stack on Win64 + const Address used_mem(rbp, 8 * wordSize); // length is on stack on Win64 + const Register len_reg = r10; // pick the first volatile windows register + const Register saved_encCounter_start = r11; + const Register used_addr = r13; + const Register used = r14; +#endif + const Register pos = rax; + + const int PARALLEL_FACTOR = 6; + const XMMRegister xmm_counter_shuf_mask = xmm0; + const XMMRegister xmm_key_shuf_mask = xmm1; // used temporarily to swap key bytes up front + const XMMRegister xmm_curr_counter = xmm2; + + const XMMRegister xmm_key_tmp0 = xmm3; + const XMMRegister xmm_key_tmp1 = xmm4; + + // registers holding the four results in the parallelized loop + const XMMRegister xmm_result0 = xmm5; + const XMMRegister xmm_result1 = xmm6; + const XMMRegister xmm_result2 = xmm7; + const XMMRegister xmm_result3 = xmm8; + const XMMRegister xmm_result4 = xmm9; + const XMMRegister xmm_result5 = xmm10; + + const XMMRegister xmm_from0 = xmm11; + const XMMRegister xmm_from1 = xmm12; + const XMMRegister xmm_from2 = xmm13; + const XMMRegister xmm_from3 = xmm14; //the last one is xmm14. we have to preserve it on WIN64. + const XMMRegister xmm_from4 = xmm3; //reuse xmm3~4. Because xmm_key_tmp0~1 are useless when loading input text + const XMMRegister xmm_from5 = xmm4; + + //for key_128, key_192, key_256 + const int rounds[3] = {10, 12, 14}; + Label L_exit_preLoop, L_preLoop_start; + Label L_multiBlock_loopTop[3]; + Label L_singleBlockLoopTop[3]; + Label L__incCounter[3][6]; //for 6 blocks + Label L__incCounter_single[3]; //for single block, key128, key192, key256 + Label L_processTail_insr[3], L_processTail_4_insr[3], L_processTail_2_insr[3], L_processTail_1_insr[3], L_processTail_exit_insr[3]; + Label L_processTail_extr[3], L_processTail_4_extr[3], L_processTail_2_extr[3], L_processTail_1_extr[3], L_processTail_exit_extr[3]; + + Label L_exit; + + __ enter(); // required for proper stackwalking of RuntimeStub frame + + // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge + // context for the registers used, where all instructions below are using 128-bit mode + // On EVEX without VL and BW, these instructions will all be AVX. + if (VM_Version::supports_avx512vlbw()) { + __ movl(rax, 0xffff); + __ kmovql(k1, rax); + } + +#ifdef _WIN64 + // save the xmm registers which must be preserved 6-14 + const int XMM_REG_NUM_KEY_LAST = 14; + __ subptr(rsp, -rsp_after_call_off * wordSize); + for (int i = 6; i <= XMM_REG_NUM_KEY_LAST; i++) { + __ movdqu(xmm_save(i), as_XMMRegister(i)); + } + + const Address r13_save(rbp, rdi_off * wordSize); + const Address r14_save(rbp, rsi_off * wordSize); + + __ movptr(r13_save, r13); + __ movptr(r14_save, r14); + + // on win64, fill len_reg from stack position + __ movl(len_reg, len_mem); + __ movptr(saved_encCounter_start, saved_encCounter_mem); + __ movptr(used_addr, used_mem); + __ movl(used, Address(used_addr, 0)); +#else + __ push(len_reg); // Save + __ movptr(used_addr, used_mem); + __ movl(used, Address(used_addr, 0)); +#endif + + __ push(rbx); // Save RBX + __ movdqu(xmm_curr_counter, Address(counter, 0x00)); // initialize counter with initial counter + __ movdqu(xmm_counter_shuf_mask, ExternalAddress(StubRoutines::x86::counter_shuffle_mask_addr())); + __ pshufb(xmm_curr_counter, xmm_counter_shuf_mask); //counter is shuffled + __ movptr(pos, 0); + + // Use the partially used encrpyted counter from last invocation + __ BIND(L_preLoop_start); + __ cmpptr(used, 16); + __ jcc(Assembler::aboveEqual, L_exit_preLoop); + __ cmpptr(len_reg, 0); + __ jcc(Assembler::lessEqual, L_exit_preLoop); + __ movb(rbx, Address(saved_encCounter_start, used)); + __ xorb(rbx, Address(from, pos)); + __ movb(Address(to, pos), rbx); + __ addptr(pos, 1); + __ addptr(used, 1); + __ subptr(len_reg, 1); + + __ jmp(L_preLoop_start); + + __ BIND(L_exit_preLoop); + __ movl(Address(used_addr, 0), used); + + // key length could be only {11, 13, 15} * 4 = {44, 52, 60} + __ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr())); + __ movl(rbx, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT))); + __ cmpl(rbx, 52); + __ jcc(Assembler::equal, L_multiBlock_loopTop[1]); + __ cmpl(rbx, 60); + __ jcc(Assembler::equal, L_multiBlock_loopTop[2]); + +#define CTR_DoSix(opc, src_reg) \ + __ opc(xmm_result0, src_reg); \ + __ opc(xmm_result1, src_reg); \ + __ opc(xmm_result2, src_reg); \ + __ opc(xmm_result3, src_reg); \ + __ opc(xmm_result4, src_reg); \ + __ opc(xmm_result5, src_reg); + + // k == 0 : generate code for key_128 + // k == 1 : generate code for key_192 + // k == 2 : generate code for key_256 + for (int k = 0; k < 3; ++k) { + //multi blocks starts here + __ align(OptoLoopAlignment); + __ BIND(L_multiBlock_loopTop[k]); + __ cmpptr(len_reg, PARALLEL_FACTOR * AESBlockSize); // see if at least PARALLEL_FACTOR blocks left + __ jcc(Assembler::less, L_singleBlockLoopTop[k]); + load_key(xmm_key_tmp0, key, 0x00, xmm_key_shuf_mask); + + //load, then increase counters + CTR_DoSix(movdqa, xmm_curr_counter); + inc_counter(rbx, xmm_result1, 0x01, L__incCounter[k][0]); + inc_counter(rbx, xmm_result2, 0x02, L__incCounter[k][1]); + inc_counter(rbx, xmm_result3, 0x03, L__incCounter[k][2]); + inc_counter(rbx, xmm_result4, 0x04, L__incCounter[k][3]); + inc_counter(rbx, xmm_result5, 0x05, L__incCounter[k][4]); + inc_counter(rbx, xmm_curr_counter, 0x06, L__incCounter[k][5]); + CTR_DoSix(pshufb, xmm_counter_shuf_mask); // after increased, shuffled counters back for PXOR + CTR_DoSix(pxor, xmm_key_tmp0); //PXOR with Round 0 key + + //load two ROUND_KEYs at a time + for (int i = 1; i < rounds[k]; ) { + load_key(xmm_key_tmp1, key, (0x10 * i), xmm_key_shuf_mask); + load_key(xmm_key_tmp0, key, (0x10 * (i+1)), xmm_key_shuf_mask); + CTR_DoSix(aesenc, xmm_key_tmp1); + i++; + if (i != rounds[k]) { + CTR_DoSix(aesenc, xmm_key_tmp0); + } else { + CTR_DoSix(aesenclast, xmm_key_tmp0); + } + i++; + } + + // get next PARALLEL_FACTOR blocks into xmm_result registers + __ movdqu(xmm_from0, Address(from, pos, Address::times_1, 0 * AESBlockSize)); + __ movdqu(xmm_from1, Address(from, pos, Address::times_1, 1 * AESBlockSize)); + __ movdqu(xmm_from2, Address(from, pos, Address::times_1, 2 * AESBlockSize)); + __ movdqu(xmm_from3, Address(from, pos, Address::times_1, 3 * AESBlockSize)); + __ movdqu(xmm_from4, Address(from, pos, Address::times_1, 4 * AESBlockSize)); + __ movdqu(xmm_from5, Address(from, pos, Address::times_1, 5 * AESBlockSize)); + + __ pxor(xmm_result0, xmm_from0); + __ pxor(xmm_result1, xmm_from1); + __ pxor(xmm_result2, xmm_from2); + __ pxor(xmm_result3, xmm_from3); + __ pxor(xmm_result4, xmm_from4); + __ pxor(xmm_result5, xmm_from5); + + // store 6 results into the next 64 bytes of output + __ movdqu(Address(to, pos, Address::times_1, 0 * AESBlockSize), xmm_result0); + __ movdqu(Address(to, pos, Address::times_1, 1 * AESBlockSize), xmm_result1); + __ movdqu(Address(to, pos, Address::times_1, 2 * AESBlockSize), xmm_result2); + __ movdqu(Address(to, pos, Address::times_1, 3 * AESBlockSize), xmm_result3); + __ movdqu(Address(to, pos, Address::times_1, 4 * AESBlockSize), xmm_result4); + __ movdqu(Address(to, pos, Address::times_1, 5 * AESBlockSize), xmm_result5); + + __ addptr(pos, PARALLEL_FACTOR * AESBlockSize); // increase the length of crypt text + __ subptr(len_reg, PARALLEL_FACTOR * AESBlockSize); // decrease the remaining length + __ jmp(L_multiBlock_loopTop[k]); + + // singleBlock starts here + __ align(OptoLoopAlignment); + __ BIND(L_singleBlockLoopTop[k]); + __ cmpptr(len_reg, 0); + __ jcc(Assembler::lessEqual, L_exit); + load_key(xmm_key_tmp0, key, 0x00, xmm_key_shuf_mask); + __ movdqa(xmm_result0, xmm_curr_counter); + inc_counter(rbx, xmm_curr_counter, 0x01, L__incCounter_single[k]); + __ pshufb(xmm_result0, xmm_counter_shuf_mask); + __ pxor(xmm_result0, xmm_key_tmp0); + for (int i = 1; i < rounds[k]; i++) { + load_key(xmm_key_tmp0, key, (0x10 * i), xmm_key_shuf_mask); + __ aesenc(xmm_result0, xmm_key_tmp0); + } + load_key(xmm_key_tmp0, key, (rounds[k] * 0x10), xmm_key_shuf_mask); + __ aesenclast(xmm_result0, xmm_key_tmp0); + __ cmpptr(len_reg, AESBlockSize); + __ jcc(Assembler::less, L_processTail_insr[k]); + __ movdqu(xmm_from0, Address(from, pos, Address::times_1, 0 * AESBlockSize)); + __ pxor(xmm_result0, xmm_from0); + __ movdqu(Address(to, pos, Address::times_1, 0 * AESBlockSize), xmm_result0); + __ addptr(pos, AESBlockSize); + __ subptr(len_reg, AESBlockSize); + __ jmp(L_singleBlockLoopTop[k]); + __ BIND(L_processTail_insr[k]); + __ addptr(pos, len_reg); + __ testptr(len_reg, 8); + __ jcc(Assembler::zero, L_processTail_4_insr[k]); + __ subptr(pos,8); + __ pinsrq(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_4_insr[k]); + __ testptr(len_reg, 4); + __ jcc(Assembler::zero, L_processTail_2_insr[k]); + __ subptr(pos,4); + __ pslldq(xmm_from0, 4); + __ pinsrd(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_2_insr[k]); + __ testptr(len_reg, 2); + __ jcc(Assembler::zero, L_processTail_1_insr[k]); + __ subptr(pos, 2); + __ pslldq(xmm_from0, 2); + __ pinsrw(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_1_insr[k]); + __ testptr(len_reg, 1); + __ jcc(Assembler::zero, L_processTail_exit_insr[k]); + __ subptr(pos, 1); + __ pslldq(xmm_from0, 1); + __ pinsrb(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_exit_insr[k]); + + __ movdqu(Address(saved_encCounter_start, 0), xmm_result0); + __ pxor(xmm_result0, xmm_from0); + + __ testptr(len_reg, 8); + __ jcc(Assembler::zero, L_processTail_4_extr[k]); + __ pextrq(Address(to, pos), xmm_result0, 0); + __ psrldq(xmm_result0, 8); + __ addptr(pos, 8); + __ BIND(L_processTail_4_extr[k]); + __ testptr(len_reg, 4); + __ jcc(Assembler::zero, L_processTail_2_extr[k]); + __ pextrd(Address(to, pos), xmm_result0, 0); + __ psrldq(xmm_result0, 4); + __ addptr(pos, 4); + __ BIND(L_processTail_2_extr[k]); + __ testptr(len_reg, 2); + __ jcc(Assembler::zero, L_processTail_1_extr[k]); + __ pextrw(Address(to, pos), xmm_result0, 0); + __ psrldq(xmm_result0, 2); + __ addptr(pos, 2); + __ BIND(L_processTail_1_extr[k]); + __ testptr(len_reg, 1); + __ jcc(Assembler::zero, L_processTail_exit_extr[k]); + __ pextrb(Address(to, pos), xmm_result0, 0); + + __ BIND(L_processTail_exit_extr[k]); + __ movl(Address(used_addr, 0), len_reg); + __ jmp(L_exit); + + } + + __ BIND(L_exit); + __ pshufb(xmm_curr_counter, xmm_counter_shuf_mask); //counter is shuffled back. + __ movdqu(Address(counter, 0), xmm_curr_counter); //save counter back + __ pop(rbx); // pop the saved RBX. +#ifdef _WIN64 + // restore regs belonging to calling function + for (int i = 6; i <= XMM_REG_NUM_KEY_LAST; i++) { + __ movdqu(as_XMMRegister(i), xmm_save(i)); + } + __ movl(rax, len_mem); + __ movptr(r13, r13_save); + __ movptr(r14, r14_save); +#else + __ pop(rax); // return 'len' +#endif + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + return start; + } // byte swap x86 long address generate_ghash_long_swap_mask() { @@ -4555,12 +4898,15 @@ class StubGenerator: public StubCodeGenerator { // don't bother generating these AES intrinsic stubs unless global flag is set if (UseAESIntrinsics) { StubRoutines::x86::_key_shuffle_mask_addr = generate_key_shuffle_mask(); // needed by the others - StubRoutines::_aescrypt_encryptBlock = generate_aescrypt_encryptBlock(); StubRoutines::_aescrypt_decryptBlock = generate_aescrypt_decryptBlock(); StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_encryptAESCrypt(); StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt_Parallel(); } + if (UseAESCTRIntrinsics){ + StubRoutines::x86::_counter_shuffle_mask_addr = generate_counter_shuffle_mask(); + StubRoutines::_counterMode_AESCrypt = generate_counterMode_AESCrypt_Parallel(); + } // Generate GHASH intrinsics code if (UseGHASHIntrinsics) { diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp index d7d2ced2cf0..3bc199b1db5 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp @@ -34,6 +34,7 @@ address StubRoutines::x86::_verify_mxcsr_entry = NULL; address StubRoutines::x86::_key_shuffle_mask_addr = NULL; +address StubRoutines::x86::_counter_shuffle_mask_addr = NULL; address StubRoutines::x86::_ghash_long_swap_mask_addr = NULL; address StubRoutines::x86::_ghash_byte_swap_mask_addr = NULL; diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp index 7e236967fb8..5b2bf4bdf91 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp @@ -33,6 +33,10 @@ static address _verify_mxcsr_entry; // shuffle mask for fixing up 128-bit words consisting of big-endian 32-bit integers static address _key_shuffle_mask_addr; + + //shuffle mask for big-endian 128-bit integers + static address _counter_shuffle_mask_addr; + // masks and table for CRC32 static uint64_t _crc_by128_masks[]; static juint _crc_table[]; @@ -45,9 +49,9 @@ public: static address verify_mxcsr_entry() { return _verify_mxcsr_entry; } static address key_shuffle_mask_addr() { return _key_shuffle_mask_addr; } + static address counter_shuffle_mask_addr() { return _counter_shuffle_mask_addr; } static address crc_by128_masks_addr() { return (address)_crc_by128_masks; } static address ghash_long_swap_mask_addr() { return _ghash_long_swap_mask_addr; } static address ghash_byte_swap_mask_addr() { return _ghash_byte_swap_mask_addr; } static void generate_CRC32C_table(bool is_pclmulqdq_supported); - #endif // CPU_X86_VM_STUBROUTINES_X86_32_HPP diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp index 1599939ebcf..c1ea0223389 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp @@ -31,7 +31,7 @@ enum platform_dependent_constants { code_size1 = 9000, // simply increase if too small (assembler will crash if too small) - code_size2 = 30000 // simply increase if too small (assembler will crash if too small) + code_size2 = 33800 // simply increase if too small (assembler will crash if too small) }; class x86 { diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp index d8c50c82b23..6f39276dc05 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp @@ -33,7 +33,7 @@ static bool returns_to_call_stub(address return_pc) { return return_pc == _ enum platform_dependent_constants { code_size1 = 19000, // simply increase if too small (assembler will crash if too small) - code_size2 = 32000 // simply increase if too small (assembler will crash if too small) + code_size2 = 35000 // simply increase if too small (assembler will crash if too small) }; class x86 { diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index b3b05547f02..d31b0e5acd2 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -648,6 +648,28 @@ void VM_Version::get_processor_features() { } FLAG_SET_DEFAULT(UseAESIntrinsics, false); } + + // --AES-CTR begins-- + if (!UseAESIntrinsics) { + if (UseAESCTRIntrinsics && !FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { + warning("AES-CTR intrinsics require UseAESIntrinsics flag to be enabled. Intrinsics will be disabled."); + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } + } else { + if(supports_sse4_1() && UseSSE >= 4) { + if (FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, true); + } + } else { + // The AES-CTR intrinsic stubs require AES instruction support (of course) + // but also require sse4.1 mode or higher for instructions it use. + if (UseAESCTRIntrinsics && !FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { + warning("X86 AES-CTR intrinsics require SSE4.1 instructions or higher. Intrinsics will be disabled."); + } + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } + } + // --AES-CTR ends-- } } else if (UseAES || UseAESIntrinsics) { if (UseAES && !FLAG_IS_DEFAULT(UseAES)) { @@ -658,6 +680,10 @@ void VM_Version::get_processor_features() { warning("AES intrinsics are not available on this CPU"); FLAG_SET_DEFAULT(UseAESIntrinsics, false); } + if (UseAESCTRIntrinsics && !FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { + warning("AES-CTR intrinsics are not available on this CPU"); + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } } // Use CLMUL instructions if available. @@ -681,6 +707,16 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(UseCRC32Intrinsics, false); } + if (UseAESIntrinsics) { + if (FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { + UseAESCTRIntrinsics = true; + } + } else if (UseAESCTRIntrinsics) { + if (!FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) + warning("AES/CTR intrinsics are not available on this CPU"); + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } + if (supports_sse4_2()) { if (FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) { UseCRC32CIntrinsics = true; diff --git a/hotspot/src/share/vm/classfile/vmSymbols.cpp b/hotspot/src/share/vm/classfile/vmSymbols.cpp index c22979f13b6..81dda6e4fd0 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.cpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp @@ -409,6 +409,7 @@ int vmIntrinsics::predicates_needed(vmIntrinsics::ID id) { switch (id) { case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt: case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt: + case vmIntrinsics::_counterMode_AESCrypt: return 1; case vmIntrinsics::_digestBase_implCompressMB: return 3; @@ -597,6 +598,9 @@ bool vmIntrinsics::is_disabled_by_flags(const methodHandle& method) { case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt: if (!UseAESIntrinsics) return true; break; + case vmIntrinsics::_counterMode_AESCrypt: + if (!UseAESCTRIntrinsics) return true; + break; case vmIntrinsics::_sha_implCompress: if (!UseSHA1Intrinsics) return true; break; diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index d59fa05f434..eb27ceb9498 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -981,6 +981,10 @@ do_name( decrypt_name, "implDecrypt") \ do_signature(byteArray_int_int_byteArray_int_signature, "([BII[BI)I") \ \ + do_class(com_sun_crypto_provider_counterMode, "com/sun/crypto/provider/CounterMode") \ + do_intrinsic(_counterMode_AESCrypt, com_sun_crypto_provider_counterMode, crypt_name, byteArray_int_int_byteArray_int_signature, F_R) \ + do_name( crypt_name, "implCrypt") \ + \ /* support for sun.security.provider.SHA */ \ do_class(sun_security_provider_sha, "sun/security/provider/SHA") \ do_intrinsic(_sha_implCompress, sun_security_provider_sha, implCompress_name, implCompress_signature, F_R) \ diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp index 689147d9f97..7068b5cfb1a 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -432,6 +432,7 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt case vmIntrinsics::_aescrypt_decryptBlock: case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt: case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt: + case vmIntrinsics::_counterMode_AESCrypt: case vmIntrinsics::_sha_implCompress: case vmIntrinsics::_sha2_implCompress: case vmIntrinsics::_sha5_implCompress: diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp index 169cfc0113f..98bade2457e 100644 --- a/hotspot/src/share/vm/opto/escape.cpp +++ b/hotspot/src/share/vm/opto/escape.cpp @@ -976,6 +976,7 @@ void ConnectionGraph::process_call_arguments(CallNode *call) { strcmp(call->as_CallLeaf()->_name, "aescrypt_decryptBlock") == 0 || strcmp(call->as_CallLeaf()->_name, "cipherBlockChaining_encryptAESCrypt") == 0 || strcmp(call->as_CallLeaf()->_name, "cipherBlockChaining_decryptAESCrypt") == 0 || + strcmp(call->as_CallLeaf()->_name, "counterMode_AESCrypt") == 0 || strcmp(call->as_CallLeaf()->_name, "ghash_processBlocks") == 0 || strcmp(call->as_CallLeaf()->_name, "sha1_implCompress") == 0 || strcmp(call->as_CallLeaf()->_name, "sha1_implCompressMB") == 0 || diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 8e3b18e76d8..5bcd0b06623 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -201,6 +201,7 @@ class LibraryCallKit : public GraphKit { return generate_method_call(method_id, true, false); } Node * load_field_from_object(Node * fromObj, const char * fieldName, const char * fieldTypeString, bool is_exact, bool is_static, ciInstanceKlass * fromKls); + Node * field_address_from_object(Node * fromObj, const char * fieldName, const char * fieldTypeString, bool is_exact, bool is_static, ciInstanceKlass * fromKls); Node* make_string_method_node(int opcode, Node* str1_start, Node* cnt1, Node* str2_start, Node* cnt2, StrIntrinsicNode::ArgEnc ae); bool inline_string_compareTo(StrIntrinsicNode::ArgEnc ae); @@ -283,7 +284,9 @@ class LibraryCallKit : public GraphKit { bool inline_Class_cast(); bool inline_aescrypt_Block(vmIntrinsics::ID id); bool inline_cipherBlockChaining_AESCrypt(vmIntrinsics::ID id); + bool inline_counterMode_AESCrypt(vmIntrinsics::ID id); Node* inline_cipherBlockChaining_AESCrypt_predicate(bool decrypting); + Node* inline_counterMode_AESCrypt_predicate(); Node* get_key_start_from_aescrypt_object(Node* aescrypt_object); Node* get_original_key_start_from_aescrypt_object(Node* aescrypt_object); bool inline_ghash_processBlocks(); @@ -697,6 +700,9 @@ bool LibraryCallKit::try_to_inline(int predicate) { case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt: return inline_cipherBlockChaining_AESCrypt(intrinsic_id()); + case vmIntrinsics::_counterMode_AESCrypt: + return inline_counterMode_AESCrypt(intrinsic_id()); + case vmIntrinsics::_sha_implCompress: case vmIntrinsics::_sha2_implCompress: case vmIntrinsics::_sha5_implCompress: @@ -784,6 +790,8 @@ Node* LibraryCallKit::try_to_predicate(int predicate) { return inline_cipherBlockChaining_AESCrypt_predicate(false); case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt: return inline_cipherBlockChaining_AESCrypt_predicate(true); + case vmIntrinsics::_counterMode_AESCrypt: + return inline_counterMode_AESCrypt_predicate(); case vmIntrinsics::_digestBase_implCompressMB: return inline_digestBase_implCompressMB_predicate(predicate); @@ -5778,6 +5786,39 @@ Node * LibraryCallKit::load_field_from_object(Node * fromObj, const char * field return loadedField; } +Node * LibraryCallKit::field_address_from_object(Node * fromObj, const char * fieldName, const char * fieldTypeString, + bool is_exact = true, bool is_static = false, + ciInstanceKlass * fromKls = NULL) { + if (fromKls == NULL) { + const TypeInstPtr* tinst = _gvn.type(fromObj)->isa_instptr(); + assert(tinst != NULL, "obj is null"); + assert(tinst->klass()->is_loaded(), "obj is not loaded"); + assert(!is_exact || tinst->klass_is_exact(), "klass not exact"); + fromKls = tinst->klass()->as_instance_klass(); + } + else { + assert(is_static, "only for static field access"); + } + ciField* field = fromKls->get_field_by_name(ciSymbol::make(fieldName), + ciSymbol::make(fieldTypeString), + is_static); + + assert(field != NULL, "undefined field"); + assert(!field->is_volatile(), "not defined for volatile fields"); + + if (is_static) { + const TypeInstPtr* tip = TypeInstPtr::make(fromKls->java_mirror()); + fromObj = makecon(tip); + } + + // Next code copied from Parse::do_get_xxx(): + + // Compute address and memory type. + int offset = field->offset_in_bytes(); + Node *adr = basic_plus_adr(fromObj, fromObj, offset); + + return adr; +} //------------------------------inline_aescrypt_Block----------------------- bool LibraryCallKit::inline_aescrypt_Block(vmIntrinsics::ID id) { @@ -5944,6 +5985,90 @@ bool LibraryCallKit::inline_cipherBlockChaining_AESCrypt(vmIntrinsics::ID id) { return true; } +//------------------------------inline_counterMode_AESCrypt----------------------- +bool LibraryCallKit::inline_counterMode_AESCrypt(vmIntrinsics::ID id) { + assert(UseAES, "need AES instruction support"); + if (!UseAESCTRIntrinsics) return false; + + address stubAddr = NULL; + const char *stubName = NULL; + if (id == vmIntrinsics::_counterMode_AESCrypt) { + stubAddr = StubRoutines::counterMode_AESCrypt(); + stubName = "counterMode_AESCrypt"; + } + if (stubAddr == NULL) return false; + + Node* counterMode_object = argument(0); + Node* src = argument(1); + Node* src_offset = argument(2); + Node* len = argument(3); + Node* dest = argument(4); + Node* dest_offset = argument(5); + + // (1) src and dest are arrays. + const Type* src_type = src->Value(&_gvn); + const Type* dest_type = dest->Value(&_gvn); + const TypeAryPtr* top_src = src_type->isa_aryptr(); + const TypeAryPtr* top_dest = dest_type->isa_aryptr(); + assert(top_src != NULL && top_src->klass() != NULL && + top_dest != NULL && top_dest->klass() != NULL, "args are strange"); + + // checks are the responsibility of the caller + Node* src_start = src; + Node* dest_start = dest; + if (src_offset != NULL || dest_offset != NULL) { + assert(src_offset != NULL && dest_offset != NULL, ""); + src_start = array_element_address(src, src_offset, T_BYTE); + dest_start = array_element_address(dest, dest_offset, T_BYTE); + } + + // if we are in this set of code, we "know" the embeddedCipher is an AESCrypt object + // (because of the predicated logic executed earlier). + // so we cast it here safely. + // this requires a newer class file that has this array as littleEndian ints, otherwise we revert to java + Node* embeddedCipherObj = load_field_from_object(counterMode_object, "embeddedCipher", "Lcom/sun/crypto/provider/SymmetricCipher;", /*is_exact*/ false); + if (embeddedCipherObj == NULL) return false; + // cast it to what we know it will be at runtime + const TypeInstPtr* tinst = _gvn.type(counterMode_object)->isa_instptr(); + assert(tinst != NULL, "CTR obj is null"); + assert(tinst->klass()->is_loaded(), "CTR obj is not loaded"); + ciKlass* klass_AESCrypt = tinst->klass()->as_instance_klass()->find_klass(ciSymbol::make("com/sun/crypto/provider/AESCrypt")); + assert(klass_AESCrypt->is_loaded(), "predicate checks that this class is loaded"); + ciInstanceKlass* instklass_AESCrypt = klass_AESCrypt->as_instance_klass(); + const TypeKlassPtr* aklass = TypeKlassPtr::make(instklass_AESCrypt); + const TypeOopPtr* xtype = aklass->as_instance_type(); + Node* aescrypt_object = new CheckCastPPNode(control(), embeddedCipherObj, xtype); + aescrypt_object = _gvn.transform(aescrypt_object); + // we need to get the start of the aescrypt_object's expanded key array + Node* k_start = get_key_start_from_aescrypt_object(aescrypt_object); + if (k_start == NULL) return false; + // similarly, get the start address of the r vector + Node* obj_counter = load_field_from_object(counterMode_object, "counter", "[B", /*is_exact*/ false); + if (obj_counter == NULL) return false; + Node* cnt_start = array_element_address(obj_counter, intcon(0), T_BYTE); + + Node* saved_encCounter = load_field_from_object(counterMode_object, "encryptedCounter", "[B", /*is_exact*/ false); + if (saved_encCounter == NULL) return false; + Node* saved_encCounter_start = array_element_address(saved_encCounter, intcon(0), T_BYTE); + Node* used = field_address_from_object(counterMode_object, "used", "I", /*is_exact*/ false); + + Node* ctrCrypt; + if (Matcher::pass_original_key_for_aes()) { + // no SPARC version for AES/CTR intrinsics now. + return false; + } + // Call the stub, passing src_start, dest_start, k_start, r_start and src_len + ctrCrypt = make_runtime_call(RC_LEAF|RC_NO_FP, + OptoRuntime::counterMode_aescrypt_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + src_start, dest_start, k_start, cnt_start, len, saved_encCounter_start, used); + + // return cipher length (int) + Node* retvalue = _gvn.transform(new ProjNode(ctrCrypt, TypeFunc::Parms)); + set_result(retvalue); + return true; +} + //------------------------------get_key_start_from_aescrypt_object----------------------- Node * LibraryCallKit::get_key_start_from_aescrypt_object(Node *aescrypt_object) { Node* objAESCryptKey = load_field_from_object(aescrypt_object, "K", "[I", /*is_exact*/ false); @@ -6025,6 +6150,48 @@ Node* LibraryCallKit::inline_cipherBlockChaining_AESCrypt_predicate(bool decrypt return _gvn.transform(region); } +//----------------------------inline_counterMode_AESCrypt_predicate---------------------------- +// Return node representing slow path of predicate check. +// the pseudo code we want to emulate with this predicate is: +// for encryption: +// if (embeddedCipherObj instanceof AESCrypt) do_intrinsic, else do_javapath +// for decryption: +// if ((embeddedCipherObj instanceof AESCrypt) && (cipher!=plain)) do_intrinsic, else do_javapath +// note cipher==plain is more conservative than the original java code but that's OK +// + +Node* LibraryCallKit::inline_counterMode_AESCrypt_predicate() { + // The receiver was checked for NULL already. + Node* objCTR = argument(0); + + // Load embeddedCipher field of CipherBlockChaining object. + Node* embeddedCipherObj = load_field_from_object(objCTR, "embeddedCipher", "Lcom/sun/crypto/provider/SymmetricCipher;", /*is_exact*/ false); + + // get AESCrypt klass for instanceOf check + // AESCrypt might not be loaded yet if some other SymmetricCipher got us to this compile point + // will have same classloader as CipherBlockChaining object + const TypeInstPtr* tinst = _gvn.type(objCTR)->isa_instptr(); + assert(tinst != NULL, "CTRobj is null"); + assert(tinst->klass()->is_loaded(), "CTRobj is not loaded"); + + // we want to do an instanceof comparison against the AESCrypt class + ciKlass* klass_AESCrypt = tinst->klass()->as_instance_klass()->find_klass(ciSymbol::make("com/sun/crypto/provider/AESCrypt")); + if (!klass_AESCrypt->is_loaded()) { + // if AESCrypt is not even loaded, we never take the intrinsic fast path + Node* ctrl = control(); + set_control(top()); // no regular fast path + return ctrl; + } + + ciInstanceKlass* instklass_AESCrypt = klass_AESCrypt->as_instance_klass(); + Node* instof = gen_instanceof(embeddedCipherObj, makecon(TypeKlassPtr::make(instklass_AESCrypt))); + Node* cmp_instof = _gvn.transform(new CmpINode(instof, intcon(1))); + Node* bool_instof = _gvn.transform(new BoolNode(cmp_instof, BoolTest::ne)); + Node* instof_false = generate_guard(bool_instof, NULL, PROB_MIN); + + return instof_false; // even if it is NULL +} + //------------------------------inline_ghash_processBlocks bool LibraryCallKit::inline_ghash_processBlocks() { address stubAddr; diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index a42c750d465..9065c931d23 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -948,6 +948,35 @@ const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() { return TypeFunc::make(domain, range); } +//for counterMode calls of aescrypt encrypt/decrypt, four pointers and a length, returning int +const TypeFunc* OptoRuntime::counterMode_aescrypt_Type() { + // create input type (domain) + int num_args = 7; + if (Matcher::pass_original_key_for_aes()) { + num_args = 8; + } + int argcnt = num_args; + const Type** fields = TypeTuple::fields(argcnt); + int argp = TypeFunc::Parms; + fields[argp++] = TypePtr::NOTNULL; // src + fields[argp++] = TypePtr::NOTNULL; // dest + fields[argp++] = TypePtr::NOTNULL; // k array + fields[argp++] = TypePtr::NOTNULL; // counter array + fields[argp++] = TypeInt::INT; // src len + fields[argp++] = TypePtr::NOTNULL; // saved_encCounter + fields[argp++] = TypePtr::NOTNULL; // saved used addr + if (Matcher::pass_original_key_for_aes()) { + fields[argp++] = TypePtr::NOTNULL; // original k array + } + assert(argp == TypeFunc::Parms + argcnt, "correct decoding"); + const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms + argcnt, fields); + // returning cipher len (int) + fields = TypeTuple::fields(1); + fields[TypeFunc::Parms + 0] = TypeInt::INT; + const TypeTuple* range = TypeTuple::make(TypeFunc::Parms + 1, fields); + return TypeFunc::make(domain, range); +} + /* * void implCompress(byte[] buf, int ofs) */ diff --git a/hotspot/src/share/vm/opto/runtime.hpp b/hotspot/src/share/vm/opto/runtime.hpp index 69e78aa8ff7..91c72b2d38d 100644 --- a/hotspot/src/share/vm/opto/runtime.hpp +++ b/hotspot/src/share/vm/opto/runtime.hpp @@ -287,6 +287,7 @@ private: static const TypeFunc* aescrypt_block_Type(); static const TypeFunc* cipherBlockChaining_aescrypt_Type(); + static const TypeFunc* counterMode_aescrypt_Type(); static const TypeFunc* sha_implCompress_Type(); static const TypeFunc* digestBase_implCompressMB_Type(); diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index cbfde3e0322..eabd24512b6 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -836,6 +836,9 @@ public: product(bool, UseAESIntrinsics, false, \ "Use intrinsics for AES versions of crypto") \ \ + product(bool, UseAESCTRIntrinsics, false, \ + "Use intrinsics for the paralleled version of AES/CTR crypto") \ + \ product(bool, UseSHA1Intrinsics, false, \ "Use intrinsics for SHA-1 crypto hash function. " \ "Requires that UseSHA is enabled.") \ diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp index 21fe0c6054f..2682be50945 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.cpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp @@ -127,6 +127,7 @@ address StubRoutines::_aescrypt_encryptBlock = NULL; address StubRoutines::_aescrypt_decryptBlock = NULL; address StubRoutines::_cipherBlockChaining_encryptAESCrypt = NULL; address StubRoutines::_cipherBlockChaining_decryptAESCrypt = NULL; +address StubRoutines::_counterMode_AESCrypt = NULL; address StubRoutines::_ghash_processBlocks = NULL; address StubRoutines::_sha1_implCompress = NULL; diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index aff8ad0a0cf..a3f905aed11 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -186,6 +186,7 @@ class StubRoutines: AllStatic { static address _aescrypt_decryptBlock; static address _cipherBlockChaining_encryptAESCrypt; static address _cipherBlockChaining_decryptAESCrypt; + static address _counterMode_AESCrypt; static address _ghash_processBlocks; static address _sha1_implCompress; @@ -359,6 +360,7 @@ class StubRoutines: AllStatic { static address aescrypt_decryptBlock() { return _aescrypt_decryptBlock; } static address cipherBlockChaining_encryptAESCrypt() { return _cipherBlockChaining_encryptAESCrypt; } static address cipherBlockChaining_decryptAESCrypt() { return _cipherBlockChaining_decryptAESCrypt; } + static address counterMode_AESCrypt() { return _counterMode_AESCrypt; } static address ghash_processBlocks() { return _ghash_processBlocks; } static address sha1_implCompress() { return _sha1_implCompress; } diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index f279a37bc76..e20dbbbb00a 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -850,6 +850,7 @@ typedef CompactHashtable SymbolCompactHashTable; static_field(StubRoutines, _aescrypt_decryptBlock, address) \ static_field(StubRoutines, _cipherBlockChaining_encryptAESCrypt, address) \ static_field(StubRoutines, _cipherBlockChaining_decryptAESCrypt, address) \ + static_field(StubRoutines, _counterMode_AESCrypt, address) \ static_field(StubRoutines, _ghash_processBlocks, address) \ static_field(StubRoutines, _updateBytesCRC32, address) \ static_field(StubRoutines, _crc_table_adr, address) \ diff --git a/hotspot/test/compiler/codegen/7184394/TestAESBase.java b/hotspot/test/compiler/codegen/7184394/TestAESBase.java index 04edf19636f..6fa53c04a1a 100644 --- a/hotspot/test/compiler/codegen/7184394/TestAESBase.java +++ b/hotspot/test/compiler/codegen/7184394/TestAESBase.java @@ -104,8 +104,8 @@ abstract public class TestAESBase { cipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE"); dCipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE"); - // CBC init - if (mode.equals("CBC")) { + // CBC or CTR init + if (mode.equals("CBC") || mode.equals("CTR")) { IvParameterSpec initVector = new IvParameterSpec(iv); cipher.init(Cipher.ENCRYPT_MODE, key, initVector); algParams = cipher.getParameters(); diff --git a/hotspot/test/compiler/codegen/7184394/TestAESMain.java b/hotspot/test/compiler/codegen/7184394/TestAESMain.java index 6b5e072ea35..a4ed27f3bc2 100644 --- a/hotspot/test/compiler/codegen/7184394/TestAESMain.java +++ b/hotspot/test/compiler/codegen/7184394/TestAESMain.java @@ -51,6 +51,13 @@ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1 -DencOutputOffset=1 TestAESMain * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 TestAESMain * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640 TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencOutputOffset=1 TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DdecOutputOffset=1 TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 -DencOutputOffset=1 TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640 TestAESMain * * @author Tom Deneau */ From c4a81b327d3ae3103508e838d99f69187c4720e1 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Mon, 21 Dec 2015 16:58:29 +0000 Subject: [PATCH 167/228] 8145096: Undefined behaviour in HotSpot Fix some integer overflows Reviewed-by: jrose, kvn, kbarrett, adinn, iklam --- hotspot/src/os/posix/vm/os_posix.cpp | 6 ++++- hotspot/src/share/vm/opto/addnode.cpp | 8 +++--- hotspot/src/share/vm/opto/loopTransform.cpp | 4 +-- hotspot/src/share/vm/opto/mulnode.cpp | 23 ++++++++-------- hotspot/src/share/vm/opto/subnode.cpp | 8 +++--- hotspot/src/share/vm/opto/type.cpp | 20 +++++++------- .../vm/runtime/advancedThresholdPolicy.cpp | 3 ++- .../share/vm/utilities/globalDefinitions.hpp | 26 +++++++++++++++++++ 8 files changed, 64 insertions(+), 34 deletions(-) diff --git a/hotspot/src/os/posix/vm/os_posix.cpp b/hotspot/src/os/posix/vm/os_posix.cpp index 8e442f3dfcd..a0bb78939c0 100644 --- a/hotspot/src/os/posix/vm/os_posix.cpp +++ b/hotspot/src/os/posix/vm/os_posix.cpp @@ -792,7 +792,11 @@ const char* os::Posix::describe_sa_flags(int flags, char* buffer, size_t size) { strncpy(buffer, "none", size); const struct { - int i; + // NB: i is an unsigned int here because SA_RESETHAND is on some + // systems 0x80000000, which is implicitly unsigned. Assignining + // it to an int field would be an overflow in unsigned-to-signed + // conversion. + unsigned int i; const char* s; } flaginfo [] = { { SA_NOCLDSTOP, "SA_NOCLDSTOP" }, diff --git a/hotspot/src/share/vm/opto/addnode.cpp b/hotspot/src/share/vm/opto/addnode.cpp index a88ee2e1d22..de7356db4b9 100644 --- a/hotspot/src/share/vm/opto/addnode.cpp +++ b/hotspot/src/share/vm/opto/addnode.cpp @@ -344,8 +344,8 @@ Node *AddINode::Identity( PhaseTransform *phase ) { const Type *AddINode::add_ring( const Type *t0, const Type *t1 ) const { const TypeInt *r0 = t0->is_int(); // Handy access const TypeInt *r1 = t1->is_int(); - int lo = r0->_lo + r1->_lo; - int hi = r0->_hi + r1->_hi; + int lo = java_add(r0->_lo, r1->_lo); + int hi = java_add(r0->_hi, r1->_hi); if( !(r0->is_con() && r1->is_con()) ) { // Not both constants, compute approximate result if( (r0->_lo & r1->_lo) < 0 && lo >= 0 ) { @@ -461,8 +461,8 @@ Node *AddLNode::Identity( PhaseTransform *phase ) { const Type *AddLNode::add_ring( const Type *t0, const Type *t1 ) const { const TypeLong *r0 = t0->is_long(); // Handy access const TypeLong *r1 = t1->is_long(); - jlong lo = r0->_lo + r1->_lo; - jlong hi = r0->_hi + r1->_hi; + jlong lo = java_add(r0->_lo, r1->_lo); + jlong hi = java_add(r0->_hi, r1->_hi); if( !(r0->is_con() && r1->is_con()) ) { // Not both constants, compute approximate result if( (r0->_lo & r1->_lo) < 0 && lo >= 0 ) { diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index d1bfb801b67..cbff6c2b879 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -1399,8 +1399,8 @@ void PhaseIdealLoop::do_unroll( IdealLoopTree *loop, Node_List &old_new, bool ad limit = new Opaque2Node( C, limit ); register_new_node( limit, opaq_ctrl ); } - if (stride_con > 0 && ((limit_type->_lo - stride_con) < limit_type->_lo) || - stride_con < 0 && ((limit_type->_hi - stride_con) > limit_type->_hi)) { + if (stride_con > 0 && (java_subtract(limit_type->_lo, stride_con) < limit_type->_lo) || + stride_con < 0 && (java_subtract(limit_type->_hi, stride_con) > limit_type->_hi)) { // No underflow. new_limit = new SubINode(limit, stride); } else { diff --git a/hotspot/src/share/vm/opto/mulnode.cpp b/hotspot/src/share/vm/opto/mulnode.cpp index d4730e978e9..4e796ce72d3 100644 --- a/hotspot/src/share/vm/opto/mulnode.cpp +++ b/hotspot/src/share/vm/opto/mulnode.cpp @@ -245,13 +245,13 @@ const Type *MulINode::mul_ring(const Type *t0, const Type *t1) const { double d = (double)hi1; // Compute all endpoints & check for overflow - int32_t A = lo0*lo1; + int32_t A = java_multiply(lo0, lo1); if( (double)A != a*c ) return TypeInt::INT; // Overflow? - int32_t B = lo0*hi1; + int32_t B = java_multiply(lo0, hi1); if( (double)B != a*d ) return TypeInt::INT; // Overflow? - int32_t C = hi0*lo1; + int32_t C = java_multiply(hi0, lo1); if( (double)C != b*c ) return TypeInt::INT; // Overflow? - int32_t D = hi0*hi1; + int32_t D = java_multiply(hi0, hi1); if( (double)D != b*d ) return TypeInt::INT; // Overflow? if( A < B ) { lo0 = A; hi0 = B; } // Sort range endpoints @@ -341,13 +341,13 @@ const Type *MulLNode::mul_ring(const Type *t0, const Type *t1) const { double d = (double)hi1; // Compute all endpoints & check for overflow - jlong A = lo0*lo1; + jlong A = java_multiply(lo0, lo1); if( (double)A != a*c ) return TypeLong::LONG; // Overflow? - jlong B = lo0*hi1; + jlong B = java_multiply(lo0, hi1); if( (double)B != a*d ) return TypeLong::LONG; // Overflow? - jlong C = hi0*lo1; + jlong C = java_multiply(hi0, lo1); if( (double)C != b*c ) return TypeLong::LONG; // Overflow? - jlong D = hi0*hi1; + jlong D = java_multiply(hi0, hi1); if( (double)D != b*d ) return TypeLong::LONG; // Overflow? if( A < B ) { lo0 = A; hi0 = B; } // Sort range endpoints @@ -574,7 +574,8 @@ Node *AndLNode::Identity( PhaseTransform *phase ) { // Masking off high bits which are always zero is useless. const TypeLong* t1 = phase->type( in(1) )->isa_long(); if (t1 != NULL && t1->_lo >= 0) { - jlong t1_support = ((jlong)1 << (1 + log2_long(t1->_hi))) - 1; + int bit_count = log2_long(t1->_hi) + 1; + jlong t1_support = jlong(max_julong >> (BitsPerJavaLong - bit_count)); if ((t1_support & con) == t1_support) return usr; } @@ -802,7 +803,7 @@ Node *LShiftLNode::Ideal(PhaseGVN *phase, bool can_reshape) { // Check for ((x & ((CONST64(1)<<(64-c0))-1)) << c0) which ANDs off high bits // before shifting them away. - const jlong bits_mask = ((jlong)CONST64(1) << (jlong)(BitsPerJavaLong - con)) - CONST64(1); + const jlong bits_mask = jlong(max_julong >> con); if( add1_op == Op_AndL && phase->type(add1->in(2)) == TypeLong::make( bits_mask ) ) return new LShiftLNode( add1->in(1), in(2) ); @@ -1254,7 +1255,7 @@ Node *URShiftLNode::Ideal(PhaseGVN *phase, bool can_reshape) { if ( con == 0 ) return NULL; // let Identity() handle a 0 shift count // note: mask computation below does not work for 0 shift count // We'll be wanting the right-shift amount as a mask of that many bits - const jlong mask = (((jlong)CONST64(1) << (jlong)(BitsPerJavaLong - con)) -1); + const jlong mask = jlong(max_julong >> con); // Check for ((x << z) + Y) >>> z. Replace with x + con>>>z // The idiom for rounding to a power of 2 is "(Q+(2^z-1)) >>> z". diff --git a/hotspot/src/share/vm/opto/subnode.cpp b/hotspot/src/share/vm/opto/subnode.cpp index 5429d5d4274..6e27f53c0a4 100644 --- a/hotspot/src/share/vm/opto/subnode.cpp +++ b/hotspot/src/share/vm/opto/subnode.cpp @@ -252,8 +252,8 @@ Node *SubINode::Ideal(PhaseGVN *phase, bool can_reshape){ const Type *SubINode::sub( const Type *t1, const Type *t2 ) const { const TypeInt *r0 = t1->is_int(); // Handy access const TypeInt *r1 = t2->is_int(); - int32_t lo = r0->_lo - r1->_hi; - int32_t hi = r0->_hi - r1->_lo; + int32_t lo = java_subtract(r0->_lo, r1->_hi); + int32_t hi = java_subtract(r0->_hi, r1->_lo); // We next check for 32-bit overflow. // If that happens, we just assume all integers are possible. @@ -361,8 +361,8 @@ Node *SubLNode::Ideal(PhaseGVN *phase, bool can_reshape) { const Type *SubLNode::sub( const Type *t1, const Type *t2 ) const { const TypeLong *r0 = t1->is_long(); // Handy access const TypeLong *r1 = t2->is_long(); - jlong lo = r0->_lo - r1->_hi; - jlong hi = r0->_hi - r1->_lo; + jlong lo = java_subtract(r0->_lo, r1->_hi); + jlong hi = java_subtract(r0->_hi, r1->_lo); // We next check for 32-bit overflow. // If that happens, we just assume all integers are possible. diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp index ec4c898afb2..42b290bd29e 100644 --- a/hotspot/src/share/vm/opto/type.cpp +++ b/hotspot/src/share/vm/opto/type.cpp @@ -1370,8 +1370,8 @@ const Type *TypeInt::narrow( const Type *old ) const { // The new type narrows the old type, so look for a "death march". // See comments on PhaseTransform::saturate. - juint nrange = _hi - _lo; - juint orange = ohi - olo; + juint nrange = (juint)_hi - _lo; + juint orange = (juint)ohi - olo; if (nrange < max_juint - 1 && nrange > (orange >> 1) + (SMALLINT*2)) { // Use the new type only if the range shrinks a lot. // We do not want the optimizer computing 2^31 point by point. @@ -1404,7 +1404,7 @@ bool TypeInt::eq( const Type *t ) const { //------------------------------hash------------------------------------------- // Type-specific hashing function. int TypeInt::hash(void) const { - return _lo+_hi+_widen+(int)Type::Int; + return java_add(java_add(_lo, _hi), java_add(_widen, (int)Type::Int)); } //------------------------------is_finite-------------------------------------- @@ -1585,7 +1585,7 @@ const Type *TypeLong::widen( const Type *old, const Type* limit ) const { // If neither endpoint is extremal yet, push out the endpoint // which is closer to its respective limit. if (_lo >= 0 || // easy common case - (julong)(_lo - min) >= (julong)(max - _hi)) { + ((julong)_lo - min) >= ((julong)max - _hi)) { // Try to widen to an unsigned range type of 32/63 bits: if (max >= max_juint && _hi < max_juint) return make(_lo, max_juint, WidenMax); @@ -2404,7 +2404,7 @@ bool TypePtr::eq( const Type *t ) const { //------------------------------hash------------------------------------------- // Type-specific hashing function. int TypePtr::hash(void) const { - return _ptr + _offset + hash_speculative() + _inline_depth; + return java_add(java_add(_ptr, _offset), java_add( hash_speculative(), _inline_depth)); ; } @@ -3214,10 +3214,8 @@ bool TypeOopPtr::eq( const Type *t ) const { // Type-specific hashing function. int TypeOopPtr::hash(void) const { return - (const_oop() ? const_oop()->hash() : 0) + - _klass_is_exact + - _instance_id + - TypePtr::hash(); + java_add(java_add(const_oop() ? const_oop()->hash() : 0, _klass_is_exact), + java_add(_instance_id, TypePtr::hash())); } //------------------------------dump2------------------------------------------ @@ -3824,7 +3822,7 @@ bool TypeInstPtr::eq( const Type *t ) const { //------------------------------hash------------------------------------------- // Type-specific hashing function. int TypeInstPtr::hash(void) const { - int hash = klass()->hash() + TypeOopPtr::hash(); + int hash = java_add(klass()->hash(), TypeOopPtr::hash()); return hash; } @@ -4742,7 +4740,7 @@ bool TypeKlassPtr::eq( const Type *t ) const { //------------------------------hash------------------------------------------- // Type-specific hashing function. int TypeKlassPtr::hash(void) const { - return klass()->hash() + TypePtr::hash(); + return java_add(klass()->hash(), TypePtr::hash()); } //------------------------------singleton-------------------------------------- diff --git a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp index cd73fa78559..5d9a3096787 100644 --- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp +++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp @@ -133,7 +133,8 @@ bool AdvancedThresholdPolicy::is_old(Method* method) { } double AdvancedThresholdPolicy::weight(Method* method) { - return (method->rate() + 1) * ((method->invocation_count() + 1) * (method->backedge_count() + 1)); + return (double)(method->rate() + 1) * + (method->invocation_count() + 1) * (method->backedge_count() + 1); } // Apply heuristics and return true if x should be compiled before y diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index 103edfa0ca4..53431e8a6b3 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -1418,6 +1418,32 @@ template static void swap(T& a, T& b) { #define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0])) +//---------------------------------------------------------------------------------------------------- +// Sum and product which can never overflow: they wrap, just like the +// Java operations. Note that we don't intend these to be used for +// general-purpose arithmetic: their purpose is to emulate Java +// operations. + +// The goal of this code to avoid undefined or implementation-defined +// behaviour. The use of an lvalue to reference cast is explicitly +// permitted by Lvalues and rvalues [basic.lval]. [Section 3.10 Para +// 15 in C++03] +#define JAVA_INTEGER_OP(OP, NAME, TYPE, UNSIGNED_TYPE) \ +inline TYPE NAME (TYPE in1, TYPE in2) { \ + UNSIGNED_TYPE ures = static_cast(in1); \ + ures OP ## = static_cast(in2); \ + return reinterpret_cast(ures); \ +} + +JAVA_INTEGER_OP(+, java_add, jint, juint) +JAVA_INTEGER_OP(-, java_subtract, jint, juint) +JAVA_INTEGER_OP(*, java_multiply, jint, juint) +JAVA_INTEGER_OP(+, java_add, jlong, julong) +JAVA_INTEGER_OP(-, java_subtract, jlong, julong) +JAVA_INTEGER_OP(*, java_multiply, jlong, julong) + +#undef JAVA_INTEGER_OP + // Dereference vptr // All C++ compilers that we know of have the vtbl pointer in the first // word. If there are exceptions, this function needs to be made compiler From bf1b5cea33cea0c18140cf2b8aa4ba2293877d68 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Mon, 21 Dec 2015 13:58:56 -0800 Subject: [PATCH 168/228] 8145271: stand-alone hotspot build is broken Reviewed-by: ihse --- hotspot/make/defs.make | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hotspot/make/defs.make b/hotspot/make/defs.make index b971c338e8e..e02d660f349 100644 --- a/hotspot/make/defs.make +++ b/hotspot/make/defs.make @@ -124,30 +124,30 @@ include $(GAMMADIR)/make/jdk_version # JDK_PREVIOUS_VERSION is only needed to facilitate standalone builds ifeq ($(JDK_PREVIOUS_VERSION),) - JDK_PREVIOUS_VERSION=$(STANDALONE_JDK_PREVIOUS_VERSION) + export JDK_PREVIOUS_VERSION=$(STANDALONE_JDK_PREVIOUS_VERSION) endif # Java versions needed ifeq ($(VERSION_MAJOR),) - VERSION_MAJOR=$(STANDALONE_JDK_MAJOR_VER) + export VERSION_MAJOR=$(STANDALONE_JDK_MAJOR_VER) endif ifeq ($(VERSION_MINOR),) - VERSION_MINOR=$(STANDALONE_JDK_MINOR_VER) + export VERSION_MINOR=$(STANDALONE_JDK_MINOR_VER) endif ifeq ($(VERSION_SECURITY),) - VERSION_SECURITY=$(STANDALONE_JDK_SECURITY_VER) + export VERSION_SECURITY=$(STANDALONE_JDK_SECURITY_VER) endif ifeq ($(VERSION_PATCH),) - VERSION_PATCH=$(STANDALONE_JDK_PATCH_VER) + export VERSION_PATCH=$(STANDALONE_JDK_PATCH_VER) endif ifeq ($(VERSION_BUILD),) - VERSION_BUILD=0 + export VERSION_BUILD=0 endif ifeq ($(VERSION_SHORT),) - VERSION_SHORT=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_SECURITY) + export VERSION_SHORT=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_SECURITY) endif ifeq ($(VERSION_STRING),) # Note that this is an extremely rough and incorrect approximation of a correct version string. - VERSION_STRING=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_SECURITY)-internal + export VERSION_STRING=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_SECURITY)-internal endif ifneq ($(HOTSPOT_RELEASE_VERSION),) From 6435c91346aaebf2166daf726f7d1affbd2bb48b Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Tue, 22 Dec 2015 09:50:09 +0300 Subject: [PATCH 169/228] 8145551: Test failed with Crash for Improved font lookups Reviewed-by: prr, vadim --- .../share/native/libfontmanager/layout/Features.cpp | 7 ++++--- .../share/native/libfontmanager/layout/Lookups.cpp | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/Features.cpp b/jdk/src/java.desktop/share/native/libfontmanager/layout/Features.cpp index 0621888504d..730ad52a0bf 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/Features.cpp +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/Features.cpp @@ -43,9 +43,10 @@ LEReferenceTo FeatureListTable::getFeatureTable(const LETableRefer LEReferenceToArrayOf featureRecordArrayRef(base, success, featureRecordArray, SWAPW(featureCount)); - if (featureIndex >= SWAPW(featureCount) || LE_FAILURE(success)) { - return LEReferenceTo(); - } + if (featureIndex >= SWAPW(featureCount) || LE_FAILURE(success)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + return LEReferenceTo(); + } Offset featureTableOffset = featureRecordArray[featureIndex].featureTableOffset; diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/Lookups.cpp b/jdk/src/java.desktop/share/native/libfontmanager/layout/Lookups.cpp index f914f2d7ee0..ed2f6673311 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/Lookups.cpp +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/Lookups.cpp @@ -42,6 +42,7 @@ const LEReferenceTo LookupListTable::getLookupTable(const LEReferen LEReferenceToArrayOf lookupTableOffsetArrayRef(base, success, (const Offset*)&lookupTableOffsetArray, SWAPW(lookupCount)); if(LE_FAILURE(success) || lookupTableIndex>lookupTableOffsetArrayRef.getCount()) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; return LEReferenceTo(); } else { return LEReferenceTo(base, success, SWAPW(lookupTableOffsetArrayRef.getObject(lookupTableIndex, success))); @@ -53,6 +54,7 @@ const LEReferenceTo LookupTable::getLookupSubtable(const LERefer LEReferenceToArrayOf subTableOffsetArrayRef(base, success, (const Offset*)&subTableOffsetArray, SWAPW(subTableCount)); if(LE_FAILURE(success) || subtableIndex>subTableOffsetArrayRef.getCount()) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; return LEReferenceTo(); } else { return LEReferenceTo(base, success, SWAPW(subTableOffsetArrayRef.getObject(subtableIndex, success))); From 056fb6bfd3a0d3c11f0d034ac1f843a34fa3ff50 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Tue, 22 Dec 2015 11:02:04 +0100 Subject: [PATCH 170/228] 8145672: Remove dependency of G1FromCardCache to HeapRegionRemSet Move HeapRegionRemSet::num_par_rem_sets() to G1RemSet, and document it. Reviewed-by: mgerdin, jmasa --- hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp | 9 ++------- hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp | 18 ++++++++++-------- hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp | 2 +- hotspot/src/share/vm/gc/g1/g1RemSet.cpp | 10 ++++++++++ hotspot/src/share/vm/gc/g1/g1RemSet.hpp | 10 ++++++++++ hotspot/src/share/vm/gc/g1/heapRegion.cpp | 1 - .../src/share/vm/gc/g1/heapRegionRemSet.cpp | 7 ------- .../src/share/vm/gc/g1/heapRegionRemSet.hpp | 7 ------- 8 files changed, 33 insertions(+), 31 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index 2da2ca3fb21..21e68b4b70a 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -1789,9 +1789,6 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) : uint n_queues = ParallelGCThreads; _task_queues = new RefToScanQueueSet(n_queues); - uint n_rem_sets = HeapRegionRemSet::num_par_rem_sets(); - assert(n_rem_sets > 0, "Invariant."); - _worker_cset_start_region = NEW_C_HEAP_ARRAY(HeapRegion*, n_queues, mtGC); _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(uint, n_queues, mtGC); _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC); @@ -1891,7 +1888,6 @@ jint G1CollectedHeap::initialize() { _g1_rem_set = new G1RemSet(this, g1_barrier_set()); // Carve out the G1 part of the heap. - ReservedSpace g1_rs = heap_rs.first_part(max_byte_size); size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size(); G1RegionToSpaceMapper* heap_storage = @@ -1940,6 +1936,8 @@ jint G1CollectedHeap::initialize() { const uint max_region_idx = (1U << (sizeof(RegionIdx_t)*BitsPerByte-1)) - 1; guarantee((max_regions() - 1) <= max_region_idx, "too many regions"); + G1RemSet::initialize(max_regions()); + size_t max_cards_per_region = ((size_t)1 << (sizeof(CardIdx_t)*BitsPerByte-1)) - 1; guarantee(HeapRegion::CardsPerRegion > 0, "make sure it's initialized"); guarantee(HeapRegion::CardsPerRegion < max_cards_per_region, @@ -1967,9 +1965,6 @@ jint G1CollectedHeap::initialize() { } _cmThread = _cm->cmThread(); - // Initialize the from_card cache structure of HeapRegionRemSet. - HeapRegionRemSet::init_heap(max_regions()); - // Now expand into the initial heap size. if (!expand(init_byte_size)) { vm_shutdown_during_initialization("Failed to allocate initial heap."); diff --git a/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp b/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp index 21367225411..41b129c2111 100644 --- a/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp +++ b/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp @@ -24,7 +24,7 @@ #include "precompiled.hpp" #include "gc/g1/g1FromCardCache.hpp" -#include "gc/g1/heapRegionRemSet.hpp" +#include "gc/g1/g1RemSet.hpp" #include "memory/padded.inline.hpp" #include "utilities/debug.hpp" @@ -32,11 +32,12 @@ int** G1FromCardCache::_cache = NULL; uint G1FromCardCache::_max_regions = 0; size_t G1FromCardCache::_static_mem_size = 0; -void G1FromCardCache::initialize(uint n_par_rs, uint max_num_regions) { +void G1FromCardCache::initialize(uint num_par_rem_sets, uint max_num_regions) { + guarantee(max_num_regions > 0, "Heap size must be valid"); guarantee(_cache == NULL, "Should not call this multiple times"); _max_regions = max_num_regions; - _cache = Padded2DArray::create_unfreeable(n_par_rs, + _cache = Padded2DArray::create_unfreeable(num_par_rem_sets, _max_regions, &_static_mem_size); @@ -47,9 +48,10 @@ void G1FromCardCache::invalidate(uint start_idx, size_t new_num_regions) { guarantee((size_t)start_idx + new_num_regions <= max_uintx, "Trying to invalidate beyond maximum region, from %u size " SIZE_FORMAT, start_idx, new_num_regions); - for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) { - uint end_idx = (start_idx + (uint)new_num_regions); - assert(end_idx <= _max_regions, "Must be within max."); + uint end_idx = (start_idx + (uint)new_num_regions); + assert(end_idx <= _max_regions, "Must be within max."); + + for (uint i = 0; i < G1RemSet::num_par_rem_sets(); i++) { for (uint j = start_idx; j < end_idx; j++) { set(i, j, InvalidCard); } @@ -58,7 +60,7 @@ void G1FromCardCache::invalidate(uint start_idx, size_t new_num_regions) { #ifndef PRODUCT void G1FromCardCache::print(outputStream* out) { - for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) { + for (uint i = 0; i < G1RemSet::num_par_rem_sets(); i++) { for (uint j = 0; j < _max_regions; j++) { out->print_cr("_from_card_cache[%u][%u] = %d.", i, j, at(i, j)); @@ -68,7 +70,7 @@ void G1FromCardCache::print(outputStream* out) { #endif void G1FromCardCache::clear(uint region_idx) { - uint num_par_remsets = HeapRegionRemSet::num_par_rem_sets(); + uint num_par_remsets = G1RemSet::num_par_rem_sets(); for (uint i = 0; i < num_par_remsets; i++) { set(i, region_idx, InvalidCard); } diff --git a/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp b/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp index 5515d73638e..67c8ec65a52 100644 --- a/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp +++ b/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp @@ -65,7 +65,7 @@ class G1FromCardCache : public AllStatic { _cache[worker_id][region_idx] = val; } - static void initialize(uint n_par_rs, uint max_num_regions); + static void initialize(uint num_par_rem_sets, uint max_num_regions); static void invalidate(uint start_idx, size_t num_regions); diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp index 01493ef58e2..699388513a8 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp @@ -25,9 +25,11 @@ #include "precompiled.hpp" #include "gc/g1/concurrentG1Refine.hpp" #include "gc/g1/concurrentG1RefineThread.hpp" +#include "gc/g1/dirtyCardQueue.hpp" #include "gc/g1/g1BlockOffsetTable.inline.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" +#include "gc/g1/g1FromCardCache.hpp" #include "gc/g1/g1GCPhaseTimes.hpp" #include "gc/g1/g1HotCardCache.hpp" #include "gc/g1/g1OopClosures.inline.hpp" @@ -76,6 +78,14 @@ G1RemSet::~G1RemSet() { FREE_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, _cset_rs_update_cl); } +uint G1RemSet::num_par_rem_sets() { + return MAX2(DirtyCardQueueSet::num_par_ids() + ConcurrentG1Refine::thread_num(), ParallelGCThreads); +} + +void G1RemSet::initialize(uint max_regions) { + G1FromCardCache::initialize(num_par_rem_sets(), max_regions); +} + ScanRSClosure::ScanRSClosure(G1ParPushHeapRSClosure* oc, CodeBlobClosure* code_root_cl, uint worker_i) : diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp index c0453a1db38..6c987945a18 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp @@ -75,6 +75,16 @@ protected: G1ParPushHeapRSClosure** _cset_rs_update_cl; public: + // Gives an approximation on how many threads can be expected to add records to + // a remembered set in parallel. This can be used for sizing data structures to + // decrease performance losses due to data structure sharing. + // Examples for quantities that influence this value are the maximum number of + // mutator threads, maximum number of concurrent refinement or GC threads. + static uint num_par_rem_sets(); + + // Initialize data that depends on the heap size being known. + static void initialize(uint max_regions); + // This is called to reset dual hash tables after the gc pause // is finished and the initial hash table is no longer being // scanned. diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.cpp b/hotspot/src/share/vm/gc/g1/heapRegion.cpp index a393f22be9e..5ba5df6446d 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp @@ -258,7 +258,6 @@ HeapRegion::HeapRegion(uint hrm_index, _predicted_bytes_to_copy(0) { _rem_set = new HeapRegionRemSet(sharedOffsetArray, this); - assert(HeapRegionRemSet::num_par_rem_sets() > 0, "Invariant."); initialize(mr); } diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp index 270225a7e1f..0514663b918 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp @@ -687,13 +687,6 @@ OtherRegionsTable::do_cleanup_work(HRRSCleanupTask* hrrs_cleanup_task) { _sparse_table.do_cleanup_work(hrrs_cleanup_task); } -// Determines how many threads can add records to an rset in parallel. -// This can be done by either mutator threads together with the -// concurrent refinement threads or GC threads. -uint HeapRegionRemSet::num_par_rem_sets() { - return MAX2(DirtyCardQueueSet::num_par_ids() + ConcurrentG1Refine::thread_num(), ParallelGCThreads); -} - HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr) : _bosa(bosa), diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp index 3906620f7a3..369d2aaaeed 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp @@ -191,7 +191,6 @@ private: public: HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr); - static uint num_par_rem_sets(); static void setup_remset_size(); bool is_empty() const { @@ -321,12 +320,6 @@ public: // Called during a stop-world phase to perform any deferred cleanups. static void cleanup(); - // Declare the heap size (in # of regions) to the HeapRegionRemSet(s). - // (Uses it to initialize from_card_cache). - static void init_heap(uint max_regions) { - G1FromCardCache::initialize(num_par_rem_sets(), max_regions); - } - static void invalidate_from_card_cache(uint start_idx, size_t num_regions) { G1FromCardCache::invalidate(start_idx, num_regions); } From d6e95be627adc7581699426ef0697e13880cd71c Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Tue, 22 Dec 2015 11:03:37 +0100 Subject: [PATCH 171/228] 8145774: Move scrubbing setup code away out of ConcurrentMark Remove dependency of ConcurrentMark to G1RemSet. Reviewed-by: jmasa, mgerdin --- hotspot/src/share/vm/gc/g1/concurrentMark.cpp | 28 ++----------------- .../src/share/vm/gc/g1/g1CollectedHeap.cpp | 27 ++++++++++++++++++ .../src/share/vm/gc/g1/g1CollectedHeap.hpp | 2 ++ 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp index 8024a3a2b09..7c805879930 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp @@ -32,10 +32,8 @@ #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/g1/g1CollectorState.hpp" #include "gc/g1/g1OopClosures.inline.hpp" -#include "gc/g1/g1RemSet.hpp" #include "gc/g1/g1StringDedup.hpp" #include "gc/g1/heapRegion.inline.hpp" -#include "gc/g1/heapRegionManager.inline.hpp" #include "gc/g1/heapRegionRemSet.hpp" #include "gc/g1/heapRegionSet.inline.hpp" #include "gc/g1/suspendibleThreadSet.hpp" @@ -1595,24 +1593,6 @@ public: } }; -class G1ParScrubRemSetTask: public AbstractGangTask { -protected: - G1RemSet* _g1rs; - BitMap* _region_bm; - BitMap* _card_bm; - HeapRegionClaimer _hrclaimer; - -public: - G1ParScrubRemSetTask(G1CollectedHeap* g1h, BitMap* region_bm, BitMap* card_bm, uint n_workers) : - AbstractGangTask("G1 ScrubRS"), _g1rs(g1h->g1_rem_set()), _region_bm(region_bm), _card_bm(card_bm), _hrclaimer(n_workers) { - } - - void work(uint worker_id) { - _g1rs->scrub(_region_bm, _card_bm, worker_id, &_hrclaimer); - } - -}; - void ConcurrentMark::cleanup() { // world is stopped at this checkpoint assert(SafepointSynchronize::is_at_safepoint(), @@ -1700,12 +1680,8 @@ void ConcurrentMark::cleanup() { // regions. if (G1ScrubRemSets) { double rs_scrub_start = os::elapsedTime(); - G1ParScrubRemSetTask g1_par_scrub_rs_task(g1h, &_region_bm, &_card_bm, n_workers); - g1h->workers()->run_task(&g1_par_scrub_rs_task); - - double rs_scrub_end = os::elapsedTime(); - double this_rs_scrub_time = (rs_scrub_end - rs_scrub_start); - _total_rs_scrub_time += this_rs_scrub_time; + g1h->scrub_rem_set(&_region_bm, &_card_bm); + _total_rs_scrub_time += (os::elapsedTime() - rs_scrub_start); } // this will also free any regions totally full of garbage objects, diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index 21e68b4b70a..f8705d626bf 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -5411,6 +5411,33 @@ bool G1CollectedHeap::check_cset_fast_test() { } #endif // PRODUCT +class G1ParScrubRemSetTask: public AbstractGangTask { +protected: + G1RemSet* _g1rs; + BitMap* _region_bm; + BitMap* _card_bm; + HeapRegionClaimer _hrclaimer; + +public: + G1ParScrubRemSetTask(G1RemSet* g1_rs, BitMap* region_bm, BitMap* card_bm, uint num_workers) : + AbstractGangTask("G1 ScrubRS"), + _g1rs(g1_rs), + _region_bm(region_bm), + _card_bm(card_bm), + _hrclaimer(num_workers) { + } + + void work(uint worker_id) { + _g1rs->scrub(_region_bm, _card_bm, worker_id, &_hrclaimer); + } +}; + +void G1CollectedHeap::scrub_rem_set(BitMap* region_bm, BitMap* card_bm) { + uint num_workers = workers()->active_workers(); + G1ParScrubRemSetTask g1_par_scrub_rs_task(g1_rem_set(), region_bm, card_bm, num_workers); + workers()->run_task(&g1_par_scrub_rs_task); +} + void G1CollectedHeap::cleanUpCardTable() { G1SATBCardTableModRefBS* ct_bs = g1_barrier_set(); double start = os::elapsedTime(); diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp index b6d0dd3e762..2ba6704bf8d 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp @@ -984,6 +984,8 @@ public: // The rem set and barrier set. G1RemSet* g1_rem_set() const { return _g1_rem_set; } + void scrub_rem_set(BitMap* region_bm, BitMap* card_bm); + unsigned get_gc_time_stamp() { return _gc_time_stamp; } From 357e0e5ff9bd05db2b2b502657f0b28b2f9398d5 Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Tue, 22 Dec 2015 05:26:55 -0800 Subject: [PATCH 172/228] 8048521: Remove obsolete code from os_windows.cpp/hpp Reviewed-by: coleenp, rdurbin --- .../os/windows/vm/attachListener_windows.cpp | 3 +- hotspot/src/os/windows/vm/jvm_windows.h | 12 - hotspot/src/os/windows/vm/os_windows.cpp | 602 +++++------------- hotspot/src/os/windows/vm/os_windows.hpp | 77 --- .../src/os/windows/vm/os_windows.inline.hpp | 5 +- .../src/os/windows/vm/perfMemory_windows.cpp | 30 +- 6 files changed, 158 insertions(+), 571 deletions(-) diff --git a/hotspot/src/os/windows/vm/attachListener_windows.cpp b/hotspot/src/os/windows/vm/attachListener_windows.cpp index 4550cd1eb1c..eaa46b0f776 100644 --- a/hotspot/src/os/windows/vm/attachListener_windows.cpp +++ b/hotspot/src/os/windows/vm/attachListener_windows.cpp @@ -378,9 +378,8 @@ int AttachListener::pd_init() { return Win32AttachListener::init(); } -// always startup on Windows NT/2000/XP bool AttachListener::init_at_startup() { - return os::win32::is_nt(); + return true; } // no trigger mechanism on Windows to start Attach Listener lazily diff --git a/hotspot/src/os/windows/vm/jvm_windows.h b/hotspot/src/os/windows/vm/jvm_windows.h index 183bf94ce80..e5ec82dca90 100644 --- a/hotspot/src/os/windows/vm/jvm_windows.h +++ b/hotspot/src/os/windows/vm/jvm_windows.h @@ -44,19 +44,7 @@ #include -#if _MSC_VER <= 1200 -// Psapi.h doesn't come with Visual Studio 6; it can be downloaded as Platform -// SDK from Microsoft. Here are the definitions copied from Psapi.h -typedef struct _MODULEINFO { - LPVOID lpBaseOfDll; - DWORD SizeOfImage; - LPVOID EntryPoint; -} MODULEINFO, *LPMODULEINFO; - -#else #include -#endif - #include typedef int socklen_t; diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index d384aa48df0..5229d1478bc 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -320,8 +320,7 @@ int os::get_native_stack(address* stack, int frames, int toSkip) { #ifdef _NMT_NOINLINE_ toSkip++; #endif - int captured = Kernel32Dll::RtlCaptureStackBackTrace(toSkip + 1, frames, - (PVOID*)stack, NULL); + int captured = RtlCaptureStackBackTrace(toSkip + 1, frames, (PVOID*)stack, NULL); for (int index = captured; index < frames; index ++) { stack[index] = NULL; } @@ -597,10 +596,6 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, // document because JVM uses C runtime library. The good news is that the // flag appears to work with _beginthredex() as well. -#ifndef STACK_SIZE_PARAM_IS_A_RESERVATION - #define STACK_SIZE_PARAM_IS_A_RESERVATION (0x10000) -#endif - HANDLE thread_handle = (HANDLE)_beginthreadex(NULL, (unsigned)stack_size, @@ -608,17 +603,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, thread, CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION, &thread_id); - if (thread_handle == NULL) { - // perhaps STACK_SIZE_PARAM_IS_A_RESERVATION is not supported, try again - // without the flag. - thread_handle = - (HANDLE)_beginthreadex(NULL, - (unsigned)stack_size, - (unsigned (__stdcall *)(void*)) java_start, - thread, - CREATE_SUSPENDED, - &thread_id); - } + if (thread_handle == NULL) { // Need to clean up stuff we've allocated so far CloseHandle(osthread->interrupt_event()); @@ -664,24 +649,13 @@ jlong as_long(LARGE_INTEGER x) { jlong os::elapsed_counter() { LARGE_INTEGER count; - if (win32::_has_performance_count) { - QueryPerformanceCounter(&count); - return as_long(count) - initial_performance_count; - } else { - FILETIME wt; - GetSystemTimeAsFileTime(&wt); - return (jlong_from(wt.dwHighDateTime, wt.dwLowDateTime) - first_filetime); - } + QueryPerformanceCounter(&count); + return as_long(count) - initial_performance_count; } jlong os::elapsed_frequency() { - if (win32::_has_performance_count) { - return performance_frequency; - } else { - // the FILETIME time is the number of 100-nanosecond intervals since January 1,1601. - return 10000000; - } + return performance_frequency; } @@ -717,11 +691,6 @@ bool os::has_allocatable_memory_limit(julong* limit) { #endif } -// VC6 lacks DWORD_PTR -#if _MSC_VER < 1300 -typedef UINT_PTR DWORD_PTR; -#endif - int os::active_processor_count() { DWORD_PTR lpProcessAffinityMask = 0; DWORD_PTR lpSystemAffinityMask = 0; @@ -778,17 +747,10 @@ bool os::bind_to_processor(uint processor_id) { void os::win32::initialize_performance_counter() { LARGE_INTEGER count; - if (QueryPerformanceFrequency(&count)) { - win32::_has_performance_count = 1; - performance_frequency = as_long(count); - QueryPerformanceCounter(&count); - initial_performance_count = as_long(count); - } else { - win32::_has_performance_count = 0; - FILETIME wt; - GetSystemTimeAsFileTime(&wt); - first_filetime = jlong_from(wt.dwHighDateTime, wt.dwLowDateTime); - } + QueryPerformanceFrequency(&count); + performance_frequency = as_long(count); + QueryPerformanceCounter(&count); + initial_performance_count = as_long(count); } @@ -894,48 +856,35 @@ void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) { } jlong os::javaTimeNanos() { - if (!win32::_has_performance_count) { - return javaTimeMillis() * NANOSECS_PER_MILLISEC; // the best we can do. - } else { LARGE_INTEGER current_count; QueryPerformanceCounter(¤t_count); double current = as_long(current_count); double freq = performance_frequency; jlong time = (jlong)((current/freq) * NANOSECS_PER_SEC); return time; - } } void os::javaTimeNanos_info(jvmtiTimerInfo *info_ptr) { - if (!win32::_has_performance_count) { - // javaTimeMillis() doesn't have much percision, - // but it is not going to wrap -- so all 64 bits + jlong freq = performance_frequency; + if (freq < NANOSECS_PER_SEC) { + // the performance counter is 64 bits and we will + // be multiplying it -- so no wrap in 64 bits info_ptr->max_value = ALL_64_BITS; - - // this is a wall clock timer, so may skip - info_ptr->may_skip_backward = true; - info_ptr->may_skip_forward = true; + } else if (freq > NANOSECS_PER_SEC) { + // use the max value the counter can reach to + // determine the max value which could be returned + julong max_counter = (julong)ALL_64_BITS; + info_ptr->max_value = (jlong)(max_counter / (freq / NANOSECS_PER_SEC)); } else { - jlong freq = performance_frequency; - if (freq < NANOSECS_PER_SEC) { - // the performance counter is 64 bits and we will - // be multiplying it -- so no wrap in 64 bits - info_ptr->max_value = ALL_64_BITS; - } else if (freq > NANOSECS_PER_SEC) { - // use the max value the counter can reach to - // determine the max value which could be returned - julong max_counter = (julong)ALL_64_BITS; - info_ptr->max_value = (jlong)(max_counter / (freq / NANOSECS_PER_SEC)); - } else { - // the performance counter is 64 bits and we will - // be using it directly -- so no wrap in 64 bits - info_ptr->max_value = ALL_64_BITS; - } - - // using a counter, so no skipping - info_ptr->may_skip_backward = false; - info_ptr->may_skip_forward = false; + // the performance counter is 64 bits and we will + // be using it directly -- so no wrap in 64 bits + info_ptr->max_value = ALL_64_BITS; } + + // using a counter, so no skipping + info_ptr->may_skip_backward = false; + info_ptr->may_skip_forward = false; + info_ptr->kind = JVMTI_TIMER_ELAPSED; // elapsed not CPU time } @@ -1068,14 +1017,8 @@ void os::abort(bool dump_core, void* siginfo, const void* context) { win32::exit_process_or_thread(win32::EPT_PROCESS, 1); } - dumpType = (MINIDUMP_TYPE)(MiniDumpWithFullMemory | MiniDumpWithHandleData); - - // Older versions of dbghelp.h do not contain all the dumptypes we want, dbghelp.h with - // API_VERSION_NUMBER 11 or higher contains the ones we want though -#if API_VERSION_NUMBER >= 11 - dumpType = (MINIDUMP_TYPE)(dumpType | MiniDumpWithFullMemoryInfo | MiniDumpWithThreadInfo | - MiniDumpWithUnloadedModules); -#endif + dumpType = (MINIDUMP_TYPE)(MiniDumpWithFullMemory | MiniDumpWithHandleData | + MiniDumpWithFullMemoryInfo | MiniDumpWithThreadInfo | MiniDumpWithUnloadedModules); if (siginfo != NULL && context != NULL) { ep.ContextRecord = (PCONTEXT) context; @@ -1308,7 +1251,7 @@ static bool _addr_in_ntdll(address addr) { hmod = GetModuleHandle("NTDLL.DLL"); if (hmod == NULL) return false; - if (!os::PSApiDll::GetModuleInformation(GetCurrentProcess(), hmod, + if (!GetModuleInformation(GetCurrentProcess(), hmod, &minfo, sizeof(MODULEINFO))) { return false; } @@ -1552,18 +1495,13 @@ int os::get_loaded_modules_info(os::LoadedModulesCallbackFunc callback, void *pa static char filename[MAX_PATH]; int result = 0; - if (!os::PSApiDll::PSApiAvailable()) { - return 0; - } - int pid = os::current_process_id(); hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid); if (hProcess == NULL) return 0; DWORD size_needed; - if (!os::PSApiDll::EnumProcessModules(hProcess, modules, - sizeof(modules), &size_needed)) { + if (!EnumProcessModules(hProcess, modules, sizeof(modules), &size_needed)) { CloseHandle(hProcess); return 0; } @@ -1573,14 +1511,12 @@ int os::get_loaded_modules_info(os::LoadedModulesCallbackFunc callback, void *pa for (int i = 0; i < MIN2(num_modules, MAX_NUM_MODULES); i++) { // Get Full pathname: - if (!os::PSApiDll::GetModuleFileNameEx(hProcess, modules[i], - filename, sizeof(filename))) { + if (!GetModuleFileNameEx(hProcess, modules[i], filename, sizeof(filename))) { filename[0] = '\0'; } MODULEINFO modinfo; - if (!os::PSApiDll::GetModuleInformation(hProcess, modules[i], - &modinfo, sizeof(modinfo))) { + if (!GetModuleInformation(hProcess, modules[i], &modinfo, sizeof(modinfo))) { modinfo.lpBaseOfDll = NULL; modinfo.SizeOfImage = 0; } @@ -1749,7 +1685,7 @@ void os::win32::print_windows_version(outputStream* st) { // find out whether we are running on 64 bit processor or not SYSTEM_INFO si; ZeroMemory(&si, sizeof(SYSTEM_INFO)); - os::Kernel32Dll::GetNativeSystemInfo(&si); + GetNativeSystemInfo(&si); if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) { st->print(" , 64 bit"); } @@ -2536,80 +2472,68 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { // Handle potential stack overflows up front. if (exception_code == EXCEPTION_STACK_OVERFLOW) { - if (os::uses_stack_guard_pages()) { #ifdef _M_IA64 - // Use guard page for register stack. - PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; - address addr = (address) exceptionRecord->ExceptionInformation[1]; - // Check for a register stack overflow on Itanium - if (thread->addr_inside_register_stack_red_zone(addr)) { - // Fatal red zone violation happens if the Java program - // catches a StackOverflow error and does so much processing - // that it runs beyond the unprotected yellow guard zone. As - // a result, we are out of here. - fatal("ERROR: Unrecoverable stack overflow happened. JVM will exit."); - } else if(thread->addr_inside_register_stack(addr)) { - // Disable the yellow zone which sets the state that - // we've got a stack overflow problem. - if (thread->stack_yellow_reserved_zone_enabled()) { - thread->disable_stack_yellow_reserved_zone(); - } - // Give us some room to process the exception. - thread->disable_register_stack_guard(); - // Tracing with +Verbose. - if (Verbose) { - tty->print_cr("SOF Compiled Register Stack overflow at " INTPTR_FORMAT " (SIGSEGV)", pc); - tty->print_cr("Register Stack access at " INTPTR_FORMAT, addr); - tty->print_cr("Register Stack base " INTPTR_FORMAT, thread->register_stack_base()); - tty->print_cr("Register Stack [" INTPTR_FORMAT "," INTPTR_FORMAT "]", - thread->register_stack_base(), - thread->register_stack_base() + thread->stack_size()); - } - - // Reguard the permanent register stack red zone just to be sure. - // We saw Windows silently disabling this without telling us. - thread->enable_register_stack_red_zone(); - - return Handle_Exception(exceptionInfo, - SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW)); - } -#endif - if (thread->stack_guards_enabled()) { - if (_thread_in_Java) { - frame fr; - PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; - address addr = (address) exceptionRecord->ExceptionInformation[1]; - if (os::win32::get_frame_at_stack_banging_point(thread, exceptionInfo, pc, &fr)) { - assert(fr.is_java_frame(), "Must be a Java frame"); - SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); - } - } - // Yellow zone violation. The o/s has unprotected the first yellow - // zone page for us. Note: must call disable_stack_yellow_zone to - // update the enabled status, even if the zone contains only one page. + // Use guard page for register stack. + PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; + address addr = (address) exceptionRecord->ExceptionInformation[1]; + // Check for a register stack overflow on Itanium + if (thread->addr_inside_register_stack_red_zone(addr)) { + // Fatal red zone violation happens if the Java program + // catches a StackOverflow error and does so much processing + // that it runs beyond the unprotected yellow guard zone. As + // a result, we are out of here. + fatal("ERROR: Unrecoverable stack overflow happened. JVM will exit."); + } else if(thread->addr_inside_register_stack(addr)) { + // Disable the yellow zone which sets the state that + // we've got a stack overflow problem. + if (thread->stack_yellow_reserved_zone_enabled()) { thread->disable_stack_yellow_reserved_zone(); - // If not in java code, return and hope for the best. - return in_java - ? Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW)) - : EXCEPTION_CONTINUE_EXECUTION; - } else { - // Fatal red zone violation. - thread->disable_stack_red_zone(); - tty->print_raw_cr("An unrecoverable stack overflow has occurred."); - report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord, - exceptionInfo->ContextRecord); - return EXCEPTION_CONTINUE_SEARCH; } - } else if (in_java) { - // JVM-managed guard pages cannot be used on win95/98. The o/s provides - // a one-time-only guard page, which it has released to us. The next - // stack overflow on this thread will result in an ACCESS_VIOLATION. + // Give us some room to process the exception. + thread->disable_register_stack_guard(); + // Tracing with +Verbose. + if (Verbose) { + tty->print_cr("SOF Compiled Register Stack overflow at " INTPTR_FORMAT " (SIGSEGV)", pc); + tty->print_cr("Register Stack access at " INTPTR_FORMAT, addr); + tty->print_cr("Register Stack base " INTPTR_FORMAT, thread->register_stack_base()); + tty->print_cr("Register Stack [" INTPTR_FORMAT "," INTPTR_FORMAT "]", + thread->register_stack_base(), + thread->register_stack_base() + thread->stack_size()); + } + + // Reguard the permanent register stack red zone just to be sure. + // We saw Windows silently disabling this without telling us. + thread->enable_register_stack_red_zone(); + return Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW)); + } +#endif + if (thread->stack_guards_enabled()) { + if (_thread_in_Java) { + frame fr; + PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; + address addr = (address) exceptionRecord->ExceptionInformation[1]; + if (os::win32::get_frame_at_stack_banging_point(thread, exceptionInfo, pc, &fr)) { + assert(fr.is_java_frame(), "Must be a Java frame"); + SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + } + } + // Yellow zone violation. The o/s has unprotected the first yellow + // zone page for us. Note: must call disable_stack_yellow_zone to + // update the enabled status, even if the zone contains only one page. + thread->disable_stack_yellow_reserved_zone(); + // If not in java code, return and hope for the best. + return in_java + ? Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW)) + : EXCEPTION_CONTINUE_EXECUTION; } else { - // Can only return and hope for the best. Further stack growth will - // result in an ACCESS_VIOLATION. - return EXCEPTION_CONTINUE_EXECUTION; + // Fatal red zone violation. + thread->disable_stack_red_zone(); + tty->print_raw_cr("An unrecoverable stack overflow has occurred."); + report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord, + exceptionInfo->ContextRecord); + return EXCEPTION_CONTINUE_SEARCH; } } else if (exception_code == EXCEPTION_ACCESS_VIOLATION) { // Either stack overflow or null pointer exception. @@ -2679,9 +2603,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { #else // !IA64 - // Windows 98 reports faulting addresses incorrectly - if (!MacroAssembler::needs_explicit_null_check((intptr_t)addr) || - !os::win32::is_nt()) { + if (!MacroAssembler::needs_explicit_null_check((intptr_t)addr)) { address stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); if (stub != NULL) return Handle_Exception(exceptionInfo, stub); } @@ -2870,12 +2792,12 @@ class NUMANodeListHolder { DWORD_PTR sys_aff_mask; if (!GetProcessAffinityMask(GetCurrentProcess(), &proc_aff_mask, &sys_aff_mask)) return false; ULONG highest_node_number; - if (!os::Kernel32Dll::GetNumaHighestNodeNumber(&highest_node_number)) return false; + if (!GetNumaHighestNodeNumber(&highest_node_number)) return false; free_node_list(); _numa_used_node_list = NEW_C_HEAP_ARRAY(int, highest_node_number + 1, mtInternal); for (unsigned int i = 0; i <= highest_node_number; i++) { ULONGLONG proc_mask_numa_node; - if (!os::Kernel32Dll::GetNumaNodeProcessorMask(i, &proc_mask_numa_node)) return false; + if (!GetNumaNodeProcessorMask(i, &proc_mask_numa_node)) return false; if ((proc_aff_mask & proc_mask_numa_node)!=0) { _numa_used_node_list[_numa_used_node_count++] = i; } @@ -2895,19 +2817,14 @@ class NUMANodeListHolder { static size_t _large_page_size = 0; -static bool resolve_functions_for_large_page_init() { - return os::Kernel32Dll::GetLargePageMinimumAvailable() && - os::Advapi32Dll::AdvapiAvailable(); -} - static bool request_lock_memory_privilege() { _hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, os::current_process_id()); LUID luid; if (_hProcess != NULL && - os::Advapi32Dll::OpenProcessToken(_hProcess, TOKEN_ADJUST_PRIVILEGES, &_hToken) && - os::Advapi32Dll::LookupPrivilegeValue(NULL, "SeLockMemoryPrivilege", &luid)) { + OpenProcessToken(_hProcess, TOKEN_ADJUST_PRIVILEGES, &_hToken) && + LookupPrivilegeValue(NULL, "SeLockMemoryPrivilege", &luid)) { TOKEN_PRIVILEGES tp; tp.PrivilegeCount = 1; @@ -2916,7 +2833,7 @@ static bool request_lock_memory_privilege() { // AdjustTokenPrivileges() may return TRUE even when it couldn't change the // privilege. Check GetLastError() too. See MSDN document. - if (os::Advapi32Dll::AdjustTokenPrivileges(_hToken, false, &tp, sizeof(tp), NULL, NULL) && + if (AdjustTokenPrivileges(_hToken, false, &tp, sizeof(tp), NULL, NULL) && (GetLastError() == ERROR_SUCCESS)) { return true; } @@ -2944,21 +2861,17 @@ static bool numa_interleaving_init() { size_t min_interleave_granularity = UseLargePages ? _large_page_size : os::vm_allocation_granularity(); NUMAInterleaveGranularity = align_size_up(NUMAInterleaveGranularity, min_interleave_granularity); - if (os::Kernel32Dll::NumaCallsAvailable()) { - if (numa_node_list_holder.build()) { - if (PrintMiscellaneous && Verbose) { - tty->print("NUMA UsedNodeCount=%d, namely ", numa_node_list_holder.get_count()); - for (int i = 0; i < numa_node_list_holder.get_count(); i++) { - tty->print("%d ", numa_node_list_holder.get_node_list_entry(i)); - } - tty->print("\n"); + if (numa_node_list_holder.build()) { + if (PrintMiscellaneous && Verbose) { + tty->print("NUMA UsedNodeCount=%d, namely ", numa_node_list_holder.get_count()); + for (int i = 0; i < numa_node_list_holder.get_count(); i++) { + tty->print("%d ", numa_node_list_holder.get_node_list_entry(i)); } - success = true; - } else { - WARN("Process does not cover multiple NUMA nodes."); + tty->print("\n"); } + success = true; } else { - WARN("NUMA Interleaving is not supported by the operating system."); + WARN("Process does not cover multiple NUMA nodes."); } if (!success) { if (use_numa_interleaving_specified) WARN("...Ignoring UseNUMAInterleaving flag."); @@ -3045,12 +2958,7 @@ static char* allocate_pages_individually(size_t bytes, char* addr, DWORD flags, // get the next node to use from the used_node_list assert(numa_node_list_holder.get_count() > 0, "Multiple NUMA nodes expected"); DWORD node = numa_node_list_holder.get_node_list_entry(count % numa_node_list_holder.get_count()); - p_new = (char *)os::Kernel32Dll::VirtualAllocExNuma(hProc, - next_alloc_addr, - bytes_to_rq, - flags, - prot, - node); + p_new = (char *)VirtualAllocExNuma(hProc, next_alloc_addr, bytes_to_rq, flags, prot, node); } } @@ -3103,32 +3011,28 @@ void os::large_page_init() { bool success = false; #define WARN(msg) if (warn_on_failure) { warning(msg); } - if (resolve_functions_for_large_page_init()) { - if (request_lock_memory_privilege()) { - size_t s = os::Kernel32Dll::GetLargePageMinimum(); - if (s) { + if (request_lock_memory_privilege()) { + size_t s = GetLargePageMinimum(); + if (s) { #if defined(IA32) || defined(AMD64) - if (s > 4*M || LargePageSizeInBytes > 4*M) { - WARN("JVM cannot use large pages bigger than 4mb."); - } else { -#endif - if (LargePageSizeInBytes && LargePageSizeInBytes % s == 0) { - _large_page_size = LargePageSizeInBytes; - } else { - _large_page_size = s; - } - success = true; -#if defined(IA32) || defined(AMD64) - } -#endif + if (s > 4*M || LargePageSizeInBytes > 4*M) { + WARN("JVM cannot use large pages bigger than 4mb."); } else { - WARN("Large page is not supported by the processor."); +#endif + if (LargePageSizeInBytes && LargePageSizeInBytes % s == 0) { + _large_page_size = LargePageSizeInBytes; + } else { + _large_page_size = s; + } + success = true; +#if defined(IA32) || defined(AMD64) } +#endif } else { - WARN("JVM cannot use large page memory because it does not have enough privilege to lock pages in memory."); + WARN("Large page is not supported by the processor."); } } else { - WARN("Large page is not supported by the operating system."); + WARN("JVM cannot use large page memory because it does not have enough privilege to lock pages in memory."); } #undef WARN @@ -3605,13 +3509,8 @@ void os::infinite_sleep() { typedef BOOL (WINAPI * STTSignature)(void); void os::naked_yield() { - // Use either SwitchToThread() or Sleep(0) // Consider passing back the return value from SwitchToThread(). - if (os::Kernel32Dll::SwitchToThreadAvailable()) { - SwitchToThread(); - } else { - Sleep(0); - } + SwitchToThread(); } // Win32 only gives you access to seven real priorities at a time, @@ -3773,15 +3672,12 @@ size_t os::win32::_default_stack_size = 0; intx os::win32::_os_thread_limit = 0; volatile intx os::win32::_os_thread_count = 0; -bool os::win32::_is_nt = false; -bool os::win32::_is_windows_2003 = false; bool os::win32::_is_windows_server = false; // 6573254 // Currently, the bug is observed across all the supported Windows releases, // including the latest one (as of this writing - Windows Server 2012 R2) bool os::win32::_has_exit_bug = true; -bool os::win32::_has_performance_count = 0; void os::win32::initialize_system_info() { SYSTEM_INFO si; @@ -3804,14 +3700,9 @@ void os::win32::initialize_system_info() { oi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); GetVersionEx((OSVERSIONINFO*)&oi); switch (oi.dwPlatformId) { - case VER_PLATFORM_WIN32_WINDOWS: _is_nt = false; break; case VER_PLATFORM_WIN32_NT: - _is_nt = true; { int os_vers = oi.dwMajorVersion * 1000 + oi.dwMinorVersion; - if (os_vers == 5002) { - _is_windows_2003 = true; - } if (oi.wProductType == VER_NT_DOMAIN_CONTROLLER || oi.wProductType == VER_NT_SERVER) { _is_windows_server = true; @@ -4091,8 +3982,7 @@ void os::init(void) { init_page_sizes((size_t) win32::vm_page_size()); // This may be overridden later when argument processing is done. - FLAG_SET_ERGO(bool, UseLargePagesIndividualAllocation, - os::win32::is_windows_2003()); + FLAG_SET_ERGO(bool, UseLargePagesIndividualAllocation, false); // Initialize main_process and main_thread main_process = GetCurrentProcess(); // Remember main_process is a pseudo handle @@ -4341,22 +4231,18 @@ jlong os::current_thread_cpu_time(bool user_sys_cpu_time) { jlong os::thread_cpu_time(Thread* thread, bool user_sys_cpu_time) { // This code is copy from clasic VM -> hpi::sysThreadCPUTime // If this function changes, os::is_thread_cpu_time_supported() should too - if (os::win32::is_nt()) { - FILETIME CreationTime; - FILETIME ExitTime; - FILETIME KernelTime; - FILETIME UserTime; + FILETIME CreationTime; + FILETIME ExitTime; + FILETIME KernelTime; + FILETIME UserTime; - if (GetThreadTimes(thread->osthread()->thread_handle(), &CreationTime, - &ExitTime, &KernelTime, &UserTime) == 0) { - return -1; - } else if (user_sys_cpu_time) { - return (FT2INT64(UserTime) + FT2INT64(KernelTime)) * 100; - } else { - return FT2INT64(UserTime) * 100; - } + if (GetThreadTimes(thread->osthread()->thread_handle(), &CreationTime, + &ExitTime, &KernelTime, &UserTime) == 0) { + return -1; + } else if (user_sys_cpu_time) { + return (FT2INT64(UserTime) + FT2INT64(KernelTime)) * 100; } else { - return (jlong) timeGetTime() * 1000000; + return FT2INT64(UserTime) * 100; } } @@ -4376,20 +4262,16 @@ void os::thread_cpu_time_info(jvmtiTimerInfo *info_ptr) { bool os::is_thread_cpu_time_supported() { // see os::thread_cpu_time - if (os::win32::is_nt()) { - FILETIME CreationTime; - FILETIME ExitTime; - FILETIME KernelTime; - FILETIME UserTime; + FILETIME CreationTime; + FILETIME ExitTime; + FILETIME KernelTime; + FILETIME UserTime; - if (GetThreadTimes(GetCurrentThread(), &CreationTime, &ExitTime, - &KernelTime, &UserTime) == 0) { - return false; - } else { - return true; - } - } else { + if (GetThreadTimes(GetCurrentThread(), &CreationTime, &ExitTime, + &KernelTime, &UserTime) == 0) { return false; + } else { + return true; } } @@ -5341,13 +5223,7 @@ bool os::is_headless_jre() { return false; } static jint initSock() { WSADATA wsadata; - if (!os::WinSock2Dll::WinSock2Available()) { - jio_fprintf(stderr, "Could not load Winsock (error: %d)\n", - ::GetLastError()); - return JNI_ERR; - } - - if (os::WinSock2Dll::WSAStartup(MAKEWORD(2,2), &wsadata) != 0) { + if (WSAStartup(MAKEWORD(2,2), &wsadata) != 0) { jio_fprintf(stderr, "Could not initialize Winsock (error: %d)\n", ::GetLastError()); return JNI_ERR; @@ -5356,7 +5232,7 @@ static jint initSock() { } struct hostent* os::get_host_by_name(char* name) { - return (struct hostent*)os::WinSock2Dll::gethostbyname(name); + return (struct hostent*)gethostbyname(name); } int os::socket_close(int fd) { @@ -5448,95 +5324,6 @@ void os::SuspendedThreadTask::internal_do_task() { CloseHandle(h); } - -// Kernel32 API -typedef SIZE_T (WINAPI* GetLargePageMinimum_Fn)(void); -typedef LPVOID (WINAPI *VirtualAllocExNuma_Fn)(HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD); -typedef BOOL (WINAPI *GetNumaHighestNodeNumber_Fn)(PULONG); -typedef BOOL (WINAPI *GetNumaNodeProcessorMask_Fn)(UCHAR, PULONGLONG); -typedef USHORT (WINAPI* RtlCaptureStackBackTrace_Fn)(ULONG, ULONG, PVOID*, PULONG); - -GetLargePageMinimum_Fn os::Kernel32Dll::_GetLargePageMinimum = NULL; -VirtualAllocExNuma_Fn os::Kernel32Dll::_VirtualAllocExNuma = NULL; -GetNumaHighestNodeNumber_Fn os::Kernel32Dll::_GetNumaHighestNodeNumber = NULL; -GetNumaNodeProcessorMask_Fn os::Kernel32Dll::_GetNumaNodeProcessorMask = NULL; -RtlCaptureStackBackTrace_Fn os::Kernel32Dll::_RtlCaptureStackBackTrace = NULL; - - -BOOL os::Kernel32Dll::initialized = FALSE; -SIZE_T os::Kernel32Dll::GetLargePageMinimum() { - assert(initialized && _GetLargePageMinimum != NULL, - "GetLargePageMinimumAvailable() not yet called"); - return _GetLargePageMinimum(); -} - -BOOL os::Kernel32Dll::GetLargePageMinimumAvailable() { - if (!initialized) { - initialize(); - } - return _GetLargePageMinimum != NULL; -} - -BOOL os::Kernel32Dll::NumaCallsAvailable() { - if (!initialized) { - initialize(); - } - return _VirtualAllocExNuma != NULL; -} - -LPVOID os::Kernel32Dll::VirtualAllocExNuma(HANDLE hProc, LPVOID addr, - SIZE_T bytes, DWORD flags, - DWORD prot, DWORD node) { - assert(initialized && _VirtualAllocExNuma != NULL, - "NUMACallsAvailable() not yet called"); - - return _VirtualAllocExNuma(hProc, addr, bytes, flags, prot, node); -} - -BOOL os::Kernel32Dll::GetNumaHighestNodeNumber(PULONG ptr_highest_node_number) { - assert(initialized && _GetNumaHighestNodeNumber != NULL, - "NUMACallsAvailable() not yet called"); - - return _GetNumaHighestNodeNumber(ptr_highest_node_number); -} - -BOOL os::Kernel32Dll::GetNumaNodeProcessorMask(UCHAR node, - PULONGLONG proc_mask) { - assert(initialized && _GetNumaNodeProcessorMask != NULL, - "NUMACallsAvailable() not yet called"); - - return _GetNumaNodeProcessorMask(node, proc_mask); -} - -USHORT os::Kernel32Dll::RtlCaptureStackBackTrace(ULONG FrameToSkip, - ULONG FrameToCapture, - PVOID* BackTrace, - PULONG BackTraceHash) { - if (!initialized) { - initialize(); - } - - if (_RtlCaptureStackBackTrace != NULL) { - return _RtlCaptureStackBackTrace(FrameToSkip, FrameToCapture, - BackTrace, BackTraceHash); - } else { - return 0; - } -} - -void os::Kernel32Dll::initializeCommon() { - if (!initialized) { - HMODULE handle = ::GetModuleHandle("Kernel32.dll"); - assert(handle != NULL, "Just check"); - _GetLargePageMinimum = (GetLargePageMinimum_Fn)::GetProcAddress(handle, "GetLargePageMinimum"); - _VirtualAllocExNuma = (VirtualAllocExNuma_Fn)::GetProcAddress(handle, "VirtualAllocExNuma"); - _GetNumaHighestNodeNumber = (GetNumaHighestNodeNumber_Fn)::GetProcAddress(handle, "GetNumaHighestNodeNumber"); - _GetNumaNodeProcessorMask = (GetNumaNodeProcessorMask_Fn)::GetProcAddress(handle, "GetNumaNodeProcessorMask"); - _RtlCaptureStackBackTrace = (RtlCaptureStackBackTrace_Fn)::GetProcAddress(handle, "RtlCaptureStackBackTrace"); - initialized = TRUE; - } -} - bool os::start_debugging(char *buf, int buflen) { int len = (int)strlen(buf); char *p = &buf[len]; @@ -5563,111 +5350,6 @@ bool os::start_debugging(char *buf, int buflen) { return yes; } -void os::Kernel32Dll::initialize() { - initializeCommon(); -} - - -// Kernel32 API -inline BOOL os::Kernel32Dll::SwitchToThread() { - return ::SwitchToThread(); -} - -inline BOOL os::Kernel32Dll::SwitchToThreadAvailable() { - return true; -} - -// Help tools -inline BOOL os::Kernel32Dll::HelpToolsAvailable() { - return true; -} - -inline HANDLE os::Kernel32Dll::CreateToolhelp32Snapshot(DWORD dwFlags, - DWORD th32ProcessId) { - return ::CreateToolhelp32Snapshot(dwFlags, th32ProcessId); -} - -inline BOOL os::Kernel32Dll::Module32First(HANDLE hSnapshot, - LPMODULEENTRY32 lpme) { - return ::Module32First(hSnapshot, lpme); -} - -inline BOOL os::Kernel32Dll::Module32Next(HANDLE hSnapshot, - LPMODULEENTRY32 lpme) { - return ::Module32Next(hSnapshot, lpme); -} - -inline void os::Kernel32Dll::GetNativeSystemInfo(LPSYSTEM_INFO lpSystemInfo) { - ::GetNativeSystemInfo(lpSystemInfo); -} - -// PSAPI API -inline BOOL os::PSApiDll::EnumProcessModules(HANDLE hProcess, - HMODULE *lpModule, DWORD cb, - LPDWORD lpcbNeeded) { - return ::EnumProcessModules(hProcess, lpModule, cb, lpcbNeeded); -} - -inline DWORD os::PSApiDll::GetModuleFileNameEx(HANDLE hProcess, - HMODULE hModule, - LPTSTR lpFilename, - DWORD nSize) { - return ::GetModuleFileNameEx(hProcess, hModule, lpFilename, nSize); -} - -inline BOOL os::PSApiDll::GetModuleInformation(HANDLE hProcess, - HMODULE hModule, - LPMODULEINFO lpmodinfo, - DWORD cb) { - return ::GetModuleInformation(hProcess, hModule, lpmodinfo, cb); -} - -inline BOOL os::PSApiDll::PSApiAvailable() { - return true; -} - - -// WinSock2 API -inline BOOL os::WinSock2Dll::WSAStartup(WORD wVersionRequested, - LPWSADATA lpWSAData) { - return ::WSAStartup(wVersionRequested, lpWSAData); -} - -inline struct hostent* os::WinSock2Dll::gethostbyname(const char *name) { - return ::gethostbyname(name); -} - -inline BOOL os::WinSock2Dll::WinSock2Available() { - return true; -} - -// Advapi API -inline BOOL os::Advapi32Dll::AdjustTokenPrivileges(HANDLE TokenHandle, - BOOL DisableAllPrivileges, - PTOKEN_PRIVILEGES NewState, - DWORD BufferLength, - PTOKEN_PRIVILEGES PreviousState, - PDWORD ReturnLength) { - return ::AdjustTokenPrivileges(TokenHandle, DisableAllPrivileges, NewState, - BufferLength, PreviousState, ReturnLength); -} - -inline BOOL os::Advapi32Dll::OpenProcessToken(HANDLE ProcessHandle, - DWORD DesiredAccess, - PHANDLE TokenHandle) { - return ::OpenProcessToken(ProcessHandle, DesiredAccess, TokenHandle); -} - -inline BOOL os::Advapi32Dll::LookupPrivilegeValue(LPCTSTR lpSystemName, - LPCTSTR lpName, - PLUID lpLuid) { - return ::LookupPrivilegeValue(lpSystemName, lpName, lpLuid); -} - -inline BOOL os::Advapi32Dll::AdvapiAvailable() { - return true; -} - void* os::get_default_process_handle() { return (void*)GetModuleHandle(NULL); } diff --git a/hotspot/src/os/windows/vm/os_windows.hpp b/hotspot/src/os/windows/vm/os_windows.hpp index 58abc3510fd..5bef412f904 100644 --- a/hotspot/src/os/windows/vm/os_windows.hpp +++ b/hotspot/src/os/windows/vm/os_windows.hpp @@ -45,11 +45,8 @@ class win32 { static int _processor_level; static julong _physical_memory; static size_t _default_stack_size; - static bool _is_nt; - static bool _is_windows_2003; static bool _is_windows_server; static bool _has_exit_bug; - static bool _has_performance_count; static void print_windows_version(outputStream* st); @@ -60,9 +57,7 @@ class win32 { // Processor info as provided by NT static int processor_type() { return _processor_type; } - // Processor level may not be accurate on non-NT systems static int processor_level() { - assert(is_nt(), "use vm_version instead"); return _processor_level; } static julong available_memory(); @@ -85,15 +80,9 @@ class win32 { static intx _os_thread_limit; static volatile intx _os_thread_count; - // Tells whether the platform is NT or Windown95 - static bool is_nt() { return _is_nt; } - // Tells whether this is a server version of Windows static bool is_windows_server() { return _is_windows_server; } - // Tells whether the platform is Windows 2003 - static bool is_windows_2003() { return _is_windows_2003; } - // Tells whether there can be the race bug during process exit on this platform static bool has_exit_bug() { return _has_exit_bug; } @@ -187,70 +176,4 @@ class PlatformParker : public CHeapObj { } ; -class WinSock2Dll: AllStatic { -public: - static BOOL WSAStartup(WORD, LPWSADATA); - static struct hostent* gethostbyname(const char *name); - static BOOL WinSock2Available(); -}; - -class Kernel32Dll: AllStatic { -public: - static BOOL SwitchToThread(); - static SIZE_T GetLargePageMinimum(); - - static BOOL SwitchToThreadAvailable(); - static BOOL GetLargePageMinimumAvailable(); - - // Help tools - static BOOL HelpToolsAvailable(); - static HANDLE CreateToolhelp32Snapshot(DWORD,DWORD); - static BOOL Module32First(HANDLE,LPMODULEENTRY32); - static BOOL Module32Next(HANDLE,LPMODULEENTRY32); - - static void GetNativeSystemInfo(LPSYSTEM_INFO); - - // NUMA calls - static BOOL NumaCallsAvailable(); - static LPVOID VirtualAllocExNuma(HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD); - static BOOL GetNumaHighestNodeNumber(PULONG); - static BOOL GetNumaNodeProcessorMask(UCHAR, PULONGLONG); - - // Stack walking - static USHORT RtlCaptureStackBackTrace(ULONG, ULONG, PVOID*, PULONG); - -private: - // GetLargePageMinimum available on Windows Vista/Windows Server 2003 - // and later - // NUMA calls available Windows Vista/WS2008 and later - - static SIZE_T (WINAPI *_GetLargePageMinimum)(void); - static LPVOID (WINAPI *_VirtualAllocExNuma) (HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD); - static BOOL (WINAPI *_GetNumaHighestNodeNumber) (PULONG); - static BOOL (WINAPI *_GetNumaNodeProcessorMask) (UCHAR, PULONGLONG); - static USHORT (WINAPI *_RtlCaptureStackBackTrace)(ULONG, ULONG, PVOID*, PULONG); - static BOOL initialized; - - static void initialize(); - static void initializeCommon(); -}; - -class Advapi32Dll: AllStatic { -public: - static BOOL AdjustTokenPrivileges(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD); - static BOOL OpenProcessToken(HANDLE, DWORD, PHANDLE); - static BOOL LookupPrivilegeValue(LPCTSTR, LPCTSTR, PLUID); - - static BOOL AdvapiAvailable(); -}; - -class PSApiDll: AllStatic { -public: - static BOOL EnumProcessModules(HANDLE, HMODULE *, DWORD, LPDWORD); - static DWORD GetModuleFileNameEx(HANDLE, HMODULE, LPTSTR, DWORD); - static BOOL GetModuleInformation(HANDLE, HMODULE, LPMODULEINFO, DWORD); - - static BOOL PSApiAvailable(); -}; - #endif // OS_WINDOWS_VM_OS_WINDOWS_HPP diff --git a/hotspot/src/os/windows/vm/os_windows.inline.hpp b/hotspot/src/os/windows/vm/os_windows.inline.hpp index be0b9e94a9b..09590cf9ca4 100644 --- a/hotspot/src/os/windows/vm/os_windows.inline.hpp +++ b/hotspot/src/os/windows/vm/os_windows.inline.hpp @@ -50,11 +50,10 @@ inline bool os::obsolete_option(const JavaVMOption *option) { } inline bool os::uses_stack_guard_pages() { - return os::win32::is_nt(); + return true; } inline bool os::allocate_stack_guard_pages() { - assert(uses_stack_guard_pages(), "sanity check"); return true; } @@ -98,7 +97,7 @@ inline int os::close(int fd) { } inline bool os::supports_monotonic_clock() { - return win32::_has_performance_count; + return true; } inline void os::exit(int num) { diff --git a/hotspot/src/os/windows/vm/perfMemory_windows.cpp b/hotspot/src/os/windows/vm/perfMemory_windows.cpp index 74ebe7d6f8a..8987ef1fb5b 100644 --- a/hotspot/src/os/windows/vm/perfMemory_windows.cpp +++ b/hotspot/src/os/windows/vm/perfMemory_windows.cpp @@ -1308,25 +1308,21 @@ static HANDLE create_sharedmem_resources(const char* dirname, const char* filena // the file. This is important as the apis do not allow a terminating // JVM being monitored by another process to remove the file name. // - // the FILE_SHARE_DELETE share mode is valid only in winnt - // fh = CreateFile( - filename, /* LPCTSTR file name */ + filename, /* LPCTSTR file name */ - GENERIC_READ|GENERIC_WRITE, /* DWORD desired access */ + GENERIC_READ|GENERIC_WRITE, /* DWORD desired access */ + FILE_SHARE_DELETE|FILE_SHARE_READ, /* DWORD share mode, future READONLY + * open operations allowed + */ + lpFileSA, /* LPSECURITY security attributes */ + CREATE_ALWAYS, /* DWORD creation disposition + * create file, if it already + * exists, overwrite it. + */ + FILE_FLAG_DELETE_ON_CLOSE, /* DWORD flags and attributes */ - (os::win32::is_nt() ? FILE_SHARE_DELETE : 0)| - FILE_SHARE_READ, /* DWORD share mode, future READONLY - * open operations allowed - */ - lpFileSA, /* LPSECURITY security attributes */ - CREATE_ALWAYS, /* DWORD creation disposition - * create file, if it already - * exists, overwrite it. - */ - FILE_FLAG_DELETE_ON_CLOSE, /* DWORD flags and attributes */ - - NULL); /* HANDLE template file access */ + NULL); /* HANDLE template file access */ free_security_attr(lpFileSA); @@ -1734,7 +1730,7 @@ void delete_shared_memory(char* addr, size_t size) { // void PerfMemory::create_memory_region(size_t size) { - if (PerfDisableSharedMem || !os::win32::is_nt()) { + if (PerfDisableSharedMem) { // do not share the memory for the performance data. PerfDisableSharedMem = true; _start = create_standard_memory(size); From ac0d55c188f314d1ccedefe1324c595ce17d103e Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Tue, 22 Dec 2015 11:11:29 -0500 Subject: [PATCH 173/228] 8074457: Remove the non-Zero CPP Interpreter Remove cppInterpreter assembly files and reorganize InterpreterGenerator includes Reviewed-by: goetz, bdelsart --- .../vm/bytecodeInterpreter_aarch64.cpp | 48 - .../vm/bytecodeInterpreter_aarch64.hpp | 116 - .../vm/bytecodeInterpreter_aarch64.inline.hpp | 286 -- .../src/cpu/aarch64/vm/c2_globals_aarch64.hpp | 6 +- .../vm/cppInterpreterGenerator_aarch64.hpp | 35 - hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp | 36 - hotspot/src/cpu/aarch64/vm/frame_aarch64.hpp | 48 - .../cpu/aarch64/vm/frame_aarch64.inline.hpp | 55 - .../cpu/aarch64/vm/interp_masm_aarch64.cpp | 18 +- .../cpu/aarch64/vm/interp_masm_aarch64.hpp | 18 +- .../vm/interpreterGenerator_aarch64.hpp | 56 - .../cpu/aarch64/vm/interpreter_aarch64.cpp | 8 +- .../cpu/aarch64/vm/interpreter_aarch64.hpp | 43 - .../cpu/aarch64/vm/macroAssembler_aarch64.hpp | 17 +- .../templateInterpreterGenerator_aarch64.cpp | 45 +- .../templateInterpreterGenerator_aarch64.hpp | 35 - .../vm/templateInterpreter_aarch64.cpp | 8 +- .../vm/templateInterpreter_aarch64.hpp | 39 - .../cpu/aarch64/vm/templateTable_aarch64.cpp | 3 - .../src/cpu/ppc/vm/globalDefinitions_ppc.hpp | 2 +- .../cpu/ppc/vm/interpreterGenerator_ppc.hpp | 42 - hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp | 6 +- hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp | 48 - .../vm/templateInterpreterGenerator_ppc.cpp | 21 +- .../vm/templateInterpreterGenerator_ppc.hpp | 43 - .../cpu/ppc/vm/templateInterpreter_ppc.cpp | 8 +- .../cpu/ppc/vm/templateInterpreter_ppc.hpp | 44 - .../sparc/vm/bytecodeInterpreter_sparc.cpp | 45 - .../sparc/vm/bytecodeInterpreter_sparc.hpp | 104 - .../vm/bytecodeInterpreter_sparc.inline.hpp | 338 --- hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp | 4 - .../vm/cppInterpreterGenerator_sparc.hpp | 40 - .../src/cpu/sparc/vm/cppInterpreter_sparc.cpp | 2201 ---------------- .../src/cpu/sparc/vm/cppInterpreter_sparc.hpp | 44 - hotspot/src/cpu/sparc/vm/frame_sparc.cpp | 18 - hotspot/src/cpu/sparc/vm/frame_sparc.hpp | 30 +- .../src/cpu/sparc/vm/frame_sparc.inline.hpp | 70 - .../src/cpu/sparc/vm/interp_masm_sparc.cpp | 44 - .../src/cpu/sparc/vm/interp_masm_sparc.hpp | 13 - .../sparc/vm/interpreterGenerator_sparc.hpp | 51 - .../src/cpu/sparc/vm/interpreter_sparc.cpp | 8 +- .../src/cpu/sparc/vm/interpreter_sparc.hpp | 41 - .../src/cpu/sparc/vm/macroAssembler_sparc.cpp | 12 - .../src/cpu/sparc/vm/macroAssembler_sparc.hpp | 43 +- .../sparc/vm/register_definitions_sparc.cpp | 15 +- .../vm/templateInterpreterGenerator_sparc.cpp | 39 +- .../vm/templateInterpreterGenerator_sparc.hpp | 34 - .../sparc/vm/templateInterpreter_sparc.cpp | 15 +- .../sparc/vm/templateInterpreter_sparc.hpp | 45 - .../src/cpu/sparc/vm/templateTable_sparc.cpp | 2 - .../cpu/x86/vm/bytecodeInterpreter_x86.cpp | 49 - .../cpu/x86/vm/bytecodeInterpreter_x86.hpp | 115 - .../x86/vm/bytecodeInterpreter_x86.inline.hpp | 285 -- hotspot/src/cpu/x86/vm/c2_globals_x86.hpp | 4 - .../x86/vm/cppInterpreterGenerator_x86.hpp | 39 - hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp | 2314 ----------------- hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp | 38 - hotspot/src/cpu/x86/vm/frame_x86.cpp | 38 - hotspot/src/cpu/x86/vm/frame_x86.hpp | 10 - hotspot/src/cpu/x86/vm/frame_x86.inline.hpp | 55 - hotspot/src/cpu/x86/vm/interp_masm_x86.cpp | 25 +- hotspot/src/cpu/x86/vm/interp_masm_x86.hpp | 18 - .../cpu/x86/vm/interpreterGenerator_x86.cpp | 8 +- .../cpu/x86/vm/interpreterGenerator_x86.hpp | 56 - hotspot/src/cpu/x86/vm/interpreter_x86.hpp | 45 - hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp | 4 +- hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp | 4 +- hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 2 - hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp | 15 +- .../src/cpu/x86/vm/sharedRuntime_x86_32.cpp | 32 - .../src/cpu/x86/vm/sharedRuntime_x86_64.cpp | 22 - .../vm/templateInterpreterGenerator_x86.cpp | 39 +- .../vm/templateInterpreterGenerator_x86.hpp | 34 - .../templateInterpreterGenerator_x86_32.cpp | 20 +- .../templateInterpreterGenerator_x86_64.cpp | 12 +- .../cpu/x86/vm/templateInterpreter_x86.cpp | 15 +- .../cpu/x86/vm/templateInterpreter_x86.hpp | 42 - hotspot/src/cpu/x86/vm/templateTable_x86.cpp | 4 - .../zero/vm/cppInterpreterGenerator_zero.hpp | 47 - .../src/cpu/zero/vm/cppInterpreter_zero.cpp | 44 +- hotspot/src/cpu/zero/vm/frame_zero.inline.hpp | 7 +- .../cpu/zero/vm/interpreterGenerator_zero.hpp | 46 - hotspot/src/cpu/zero/vm/interpreter_zero.cpp | 6 +- hotspot/src/cpu/zero/vm/interpreter_zero.hpp | 54 - .../src/cpu/zero/vm/methodHandles_zero.cpp | 12 +- .../vm/templateInterpreterGenerator_zero.hpp | 31 - .../cpu/zero/vm/templateInterpreter_zero.cpp | 49 - .../cpu/zero/vm/templateInterpreter_zero.hpp | 31 - .../src/cpu/zero/vm/templateTable_zero.cpp | 39 - .../src/cpu/zero/vm/templateTable_zero.hpp | 31 - .../vm/interpreter/abstractInterpreter.hpp | 35 +- .../vm/interpreter/bytecodeHistogram.hpp | 4 +- .../vm/interpreter/bytecodeInterpreter.hpp | 21 +- .../bytecodeInterpreter.inline.hpp | 20 +- .../share/vm/interpreter/cppInterpreter.cpp | 116 +- .../share/vm/interpreter/cppInterpreter.hpp | 57 +- .../interpreter/cppInterpreterGenerator.hpp | 58 +- .../src/share/vm/interpreter/interpreter.cpp | 87 +- .../src/share/vm/interpreter/interpreter.hpp | 32 +- .../vm/interpreter/interpreterGenerator.hpp | 69 - .../vm/interpreter/interpreterRuntime.hpp | 2 +- .../vm/interpreter/templateInterpreter.cpp | 92 +- .../vm/interpreter/templateInterpreter.hpp | 32 +- .../templateInterpreterGenerator.hpp | 66 +- .../share/vm/interpreter/templateTable.hpp | 2 - hotspot/src/share/vm/prims/methodHandles.hpp | 6 + hotspot/src/share/vm/runtime/arguments.cpp | 2 +- hotspot/src/share/vm/runtime/frame.inline.hpp | 9 +- .../src/share/vm/runtime/javaFrameAnchor.hpp | 3 +- 109 files changed, 480 insertions(+), 8364 deletions(-) delete mode 100644 hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.cpp delete mode 100644 hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.hpp delete mode 100644 hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.inline.hpp delete mode 100644 hotspot/src/cpu/aarch64/vm/cppInterpreterGenerator_aarch64.hpp delete mode 100644 hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp delete mode 100644 hotspot/src/cpu/aarch64/vm/interpreter_aarch64.hpp delete mode 100644 hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.hpp delete mode 100644 hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.hpp delete mode 100644 hotspot/src/cpu/ppc/vm/interpreterGenerator_ppc.hpp delete mode 100644 hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp delete mode 100644 hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.hpp delete mode 100644 hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp delete mode 100644 hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp delete mode 100644 hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp delete mode 100644 hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp delete mode 100644 hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp delete mode 100644 hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp delete mode 100644 hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp delete mode 100644 hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp delete mode 100644 hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp delete mode 100644 hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp delete mode 100644 hotspot/src/cpu/x86/vm/interpreter_x86.hpp delete mode 100644 hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp delete mode 100644 hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp delete mode 100644 hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp delete mode 100644 hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp delete mode 100644 hotspot/src/cpu/zero/vm/interpreter_zero.hpp delete mode 100644 hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp delete mode 100644 hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp delete mode 100644 hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp delete mode 100644 hotspot/src/cpu/zero/vm/templateTable_zero.cpp delete mode 100644 hotspot/src/cpu/zero/vm/templateTable_zero.hpp delete mode 100644 hotspot/src/share/vm/interpreter/interpreterGenerator.hpp diff --git a/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.cpp deleted file mode 100644 index fd74244b0ba..00000000000 --- a/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. 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. - * - */ - -#include "precompiled.hpp" -#include "asm/assembler.hpp" -#include "interpreter/bytecodeInterpreter.hpp" -#include "interpreter/bytecodeInterpreter.inline.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/deoptimization.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#include "interp_masm_aarch64.hpp" - -#ifdef CC_INTERP - -#endif // CC_INTERP (all) diff --git a/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.hpp deleted file mode 100644 index 5b4405b7ecd..00000000000 --- a/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.hpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. 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. - * - */ - -#ifndef CPU_AARCH64_VM_BYTECODEINTERPRETER_AARCH64_HPP -#define CPU_AARCH64_VM_BYTECODEINTERPRETER_AARCH64_HPP - -// Platform specific for C++ based Interpreter - -private: - - interpreterState _self_link; /* Previous interpreter state */ /* sometimes points to self??? */ - address _result_handler; /* temp for saving native result handler */ - intptr_t* _sender_sp; /* sender's sp before stack (locals) extension */ - - address _extra_junk1; /* temp to save on recompiles */ - address _extra_junk2; /* temp to save on recompiles */ - address _extra_junk3; /* temp to save on recompiles */ - // address dummy_for_native2; /* a native frame result handler would be here... */ - // address dummy_for_native1; /* native result type stored here in a interpreter native frame */ - address _extra_junk4; /* temp to save on recompiles */ - address _extra_junk5; /* temp to save on recompiles */ - address _extra_junk6; /* temp to save on recompiles */ -public: - // we have an interpreter frame... -inline intptr_t* sender_sp() { - return _sender_sp; -} - -// The interpreter always has the frame anchor fully setup so we don't -// have to do anything going to vm from the interpreter. On return -// we do have to clear the flags in case they we're modified to -// maintain the stack walking invariants. -// -#define SET_LAST_JAVA_FRAME() - -#define RESET_LAST_JAVA_FRAME() - -/* - * Macros for accessing the stack. - */ -#undef STACK_INT -#undef STACK_FLOAT -#undef STACK_ADDR -#undef STACK_OBJECT -#undef STACK_DOUBLE -#undef STACK_LONG - -// JavaStack Implementation - -#define GET_STACK_SLOT(offset) (*((intptr_t*) &topOfStack[-(offset)])) -#define STACK_SLOT(offset) ((address) &topOfStack[-(offset)]) -#define STACK_ADDR(offset) (*((address *) &topOfStack[-(offset)])) -#define STACK_INT(offset) (*((jint*) &topOfStack[-(offset)])) -#define STACK_FLOAT(offset) (*((jfloat *) &topOfStack[-(offset)])) -#define STACK_OBJECT(offset) (*((oop *) &topOfStack [-(offset)])) -#define STACK_DOUBLE(offset) (((VMJavaVal64*) &topOfStack[-(offset)])->d) -#define STACK_LONG(offset) (((VMJavaVal64 *) &topOfStack[-(offset)])->l) - -#define SET_STACK_SLOT(value, offset) (*(intptr_t*)&topOfStack[-(offset)] = *(intptr_t*)(value)) -#define SET_STACK_ADDR(value, offset) (*((address *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_INT(value, offset) (*((jint *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_FLOAT(value, offset) (*((jfloat *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_OBJECT(value, offset) (*((oop *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_DOUBLE(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = (value)) -#define SET_STACK_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = \ - ((VMJavaVal64*)(addr))->d) -#define SET_STACK_LONG(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = (value)) -#define SET_STACK_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = \ - ((VMJavaVal64*)(addr))->l) -// JavaLocals implementation - -#define LOCALS_SLOT(offset) ((intptr_t*)&locals[-(offset)]) -#define LOCALS_ADDR(offset) ((address)locals[-(offset)]) -#define LOCALS_INT(offset) ((jint)(locals[-(offset)])) -#define LOCALS_FLOAT(offset) (*((jfloat*)&locals[-(offset)])) -#define LOCALS_OBJECT(offset) ((oop)locals[-(offset)]) -#define LOCALS_DOUBLE(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->d) -#define LOCALS_LONG(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->l) -#define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)])) -#define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)])) - -#define SET_LOCALS_SLOT(value, offset) (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value)) -#define SET_LOCALS_ADDR(value, offset) (*((address *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_INT(value, offset) (*((jint *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_FLOAT(value, offset) (*((jfloat *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_OBJECT(value, offset) (*((oop *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_DOUBLE(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value)) -#define SET_LOCALS_LONG(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value)) -#define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \ - ((VMJavaVal64*)(addr))->d) -#define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \ - ((VMJavaVal64*)(addr))->l) - -#endif // CPU_AARCH64_VM_BYTECODEINTERPRETER_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.inline.hpp b/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.inline.hpp deleted file mode 100644 index 7ffed4b95a5..00000000000 --- a/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.inline.hpp +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. 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. - * - */ - -#ifndef CPU_AARCH64_VM_BYTECODEINTERPRETER_AARCH64_INLINE_HPP -#define CPU_AARCH64_VM_BYTECODEINTERPRETER_AARCH64_INLINE_HPP - -// Inline interpreter functions for IA32 - -inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { return op1 + op2; } -inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) { return op1 - op2; } -inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) { return op1 * op2; } -inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) { return op1 / op2; } -inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) { return fmod(op1, op2); } - -inline jfloat BytecodeInterpreter::VMfloatNeg(jfloat op) { return -op; } - -inline int32_t BytecodeInterpreter::VMfloatCompare(jfloat op1, jfloat op2, int32_t direction) { - return ( op1 < op2 ? -1 : - op1 > op2 ? 1 : - op1 == op2 ? 0 : - (direction == -1 || direction == 1) ? direction : 0); - -} - -inline void BytecodeInterpreter::VMmemCopy64(uint32_t to[2], const uint32_t from[2]) { - // x86 can do unaligned copies but not 64bits at a time - to[0] = from[0]; to[1] = from[1]; -} - -// The long operations depend on compiler support for "long long" on x86 - -inline jlong BytecodeInterpreter::VMlongAdd(jlong op1, jlong op2) { - return op1 + op2; -} - -inline jlong BytecodeInterpreter::VMlongAnd(jlong op1, jlong op2) { - return op1 & op2; -} - -inline jlong BytecodeInterpreter::VMlongDiv(jlong op1, jlong op2) { - // QQQ what about check and throw... - return op1 / op2; -} - -inline jlong BytecodeInterpreter::VMlongMul(jlong op1, jlong op2) { - return op1 * op2; -} - -inline jlong BytecodeInterpreter::VMlongOr(jlong op1, jlong op2) { - return op1 | op2; -} - -inline jlong BytecodeInterpreter::VMlongSub(jlong op1, jlong op2) { - return op1 - op2; -} - -inline jlong BytecodeInterpreter::VMlongXor(jlong op1, jlong op2) { - return op1 ^ op2; -} - -inline jlong BytecodeInterpreter::VMlongRem(jlong op1, jlong op2) { - return op1 % op2; -} - -inline jlong BytecodeInterpreter::VMlongUshr(jlong op1, jint op2) { - // CVM did this 0x3f mask, is the really needed??? QQQ - return ((unsigned long long) op1) >> (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongShr(jlong op1, jint op2) { - return op1 >> (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongShl(jlong op1, jint op2) { - return op1 << (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongNeg(jlong op) { - return -op; -} - -inline jlong BytecodeInterpreter::VMlongNot(jlong op) { - return ~op; -} - -inline int32_t BytecodeInterpreter::VMlongLtz(jlong op) { - return (op <= 0); -} - -inline int32_t BytecodeInterpreter::VMlongGez(jlong op) { - return (op >= 0); -} - -inline int32_t BytecodeInterpreter::VMlongEqz(jlong op) { - return (op == 0); -} - -inline int32_t BytecodeInterpreter::VMlongEq(jlong op1, jlong op2) { - return (op1 == op2); -} - -inline int32_t BytecodeInterpreter::VMlongNe(jlong op1, jlong op2) { - return (op1 != op2); -} - -inline int32_t BytecodeInterpreter::VMlongGe(jlong op1, jlong op2) { - return (op1 >= op2); -} - -inline int32_t BytecodeInterpreter::VMlongLe(jlong op1, jlong op2) { - return (op1 <= op2); -} - -inline int32_t BytecodeInterpreter::VMlongLt(jlong op1, jlong op2) { - return (op1 < op2); -} - -inline int32_t BytecodeInterpreter::VMlongGt(jlong op1, jlong op2) { - return (op1 > op2); -} - -inline int32_t BytecodeInterpreter::VMlongCompare(jlong op1, jlong op2) { - return (VMlongLt(op1, op2) ? -1 : VMlongGt(op1, op2) ? 1 : 0); -} - -// Long conversions - -inline jdouble BytecodeInterpreter::VMlong2Double(jlong val) { - return (jdouble) val; -} - -inline jfloat BytecodeInterpreter::VMlong2Float(jlong val) { - return (jfloat) val; -} - -inline jint BytecodeInterpreter::VMlong2Int(jlong val) { - return (jint) val; -} - -// Double Arithmetic - -inline jdouble BytecodeInterpreter::VMdoubleAdd(jdouble op1, jdouble op2) { - return op1 + op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleDiv(jdouble op1, jdouble op2) { - // Divide by zero... QQQ - return op1 / op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleMul(jdouble op1, jdouble op2) { - return op1 * op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleNeg(jdouble op) { - return -op; -} - -inline jdouble BytecodeInterpreter::VMdoubleRem(jdouble op1, jdouble op2) { - return fmod(op1, op2); -} - -inline jdouble BytecodeInterpreter::VMdoubleSub(jdouble op1, jdouble op2) { - return op1 - op2; -} - -inline int32_t BytecodeInterpreter::VMdoubleCompare(jdouble op1, jdouble op2, int32_t direction) { - return ( op1 < op2 ? -1 : - op1 > op2 ? 1 : - op1 == op2 ? 0 : - (direction == -1 || direction == 1) ? direction : 0); -} - -// Double Conversions - -inline jfloat BytecodeInterpreter::VMdouble2Float(jdouble val) { - return (jfloat) val; -} - -// Float Conversions - -inline jdouble BytecodeInterpreter::VMfloat2Double(jfloat op) { - return (jdouble) op; -} - -// Integer Arithmetic - -inline jint BytecodeInterpreter::VMintAdd(jint op1, jint op2) { - return op1 + op2; -} - -inline jint BytecodeInterpreter::VMintAnd(jint op1, jint op2) { - return op1 & op2; -} - -inline jint BytecodeInterpreter::VMintDiv(jint op1, jint op2) { - /* it's possible we could catch this special case implicitly */ - if ((juint)op1 == 0x80000000 && op2 == -1) return op1; - else return op1 / op2; -} - -inline jint BytecodeInterpreter::VMintMul(jint op1, jint op2) { - return op1 * op2; -} - -inline jint BytecodeInterpreter::VMintNeg(jint op) { - return -op; -} - -inline jint BytecodeInterpreter::VMintOr(jint op1, jint op2) { - return op1 | op2; -} - -inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) { - /* it's possible we could catch this special case implicitly */ - if ((juint)op1 == 0x80000000 && op2 == -1) return 0; - else return op1 % op2; -} - -inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) { - return op1 << op2; -} - -inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) { - return op1 >> (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) { - return op1 - op2; -} - -inline jint BytecodeInterpreter::VMintUshr(jint op1, jint op2) { - return ((juint) op1) >> (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) { - return op1 ^ op2; -} - -inline jdouble BytecodeInterpreter::VMint2Double(jint val) { - return (jdouble) val; -} - -inline jfloat BytecodeInterpreter::VMint2Float(jint val) { - return (jfloat) val; -} - -inline jlong BytecodeInterpreter::VMint2Long(jint val) { - return (jlong) val; -} - -inline jchar BytecodeInterpreter::VMint2Char(jint val) { - return (jchar) val; -} - -inline jshort BytecodeInterpreter::VMint2Short(jint val) { - return (jshort) val; -} - -inline jbyte BytecodeInterpreter::VMint2Byte(jint val) { - return (jbyte) val; -} - -#endif // CPU_AARCH64_VM_BYTECODEINTERPRETER_AARCH64_INLINE_HPP diff --git a/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp index 342f07bdb04..28d198225b4 100644 --- a/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -40,11 +40,7 @@ define_pd_global(bool, InlineIntrinsics, true); define_pd_global(bool, PreferInterpreterNativeStubs, false); define_pd_global(bool, ProfileTraps, true); define_pd_global(bool, UseOnStackReplacement, true); -#ifdef CC_INTERP -define_pd_global(bool, ProfileInterpreter, false); -#else define_pd_global(bool, ProfileInterpreter, true); -#endif // CC_INTERP define_pd_global(bool, TieredCompilation, trueInTiered); define_pd_global(intx, CompileThreshold, 10000); define_pd_global(intx, BackEdgeThreshold, 100000); diff --git a/hotspot/src/cpu/aarch64/vm/cppInterpreterGenerator_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/cppInterpreterGenerator_aarch64.hpp deleted file mode 100644 index 662d2849efc..00000000000 --- a/hotspot/src/cpu/aarch64/vm/cppInterpreterGenerator_aarch64.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. 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. - * - */ - -#ifndef CPU_AARCH64_VM_CPPINTERPRETERGENERATOR_AARCH64_HPP -#define CPU_AARCH64_VM_CPPINTERPRETERGENERATOR_AARCH64_HPP - - protected: - - void generate_more_monitors(); - void generate_deopt_handling(); - void lock_method(void); - -#endif // CPU_AARCH64_VM_CPPINTERPRETERGENERATOR_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp index 141d9a8fa93..77664cba6b2 100644 --- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp @@ -314,27 +314,6 @@ intptr_t* frame::entry_frame_argument_at(int offset) const { } // sender_sp -#ifdef CC_INTERP -intptr_t* frame::interpreter_frame_sender_sp() const { - assert(is_interpreted_frame(), "interpreted frame expected"); - // QQQ why does this specialize method exist if frame::sender_sp() does same thing? - // seems odd and if we always know interpreted vs. non then sender_sp() is really - // doing too much work. - return get_interpreterState()->sender_sp(); -} - -// monitor elements - -BasicObjectLock* frame::interpreter_frame_monitor_begin() const { - return get_interpreterState()->monitor_base(); -} - -BasicObjectLock* frame::interpreter_frame_monitor_end() const { - return (BasicObjectLock*) get_interpreterState()->stack_base(); -} - -#else // CC_INTERP - intptr_t* frame::interpreter_frame_sender_sp() const { assert(is_interpreted_frame(), "interpreted frame expected"); return (intptr_t*) at(interpreter_frame_sender_sp_offset); @@ -368,7 +347,6 @@ void frame::interpreter_frame_set_monitor_end(BasicObjectLock* value) { void frame::interpreter_frame_set_last_sp(intptr_t* sp) { *((intptr_t**)addr_at(interpreter_frame_last_sp_offset)) = sp; } -#endif // CC_INTERP frame frame::sender_for_entry_frame(RegisterMap* map) const { assert(map != NULL, "map must be set"); @@ -528,9 +506,6 @@ frame frame::sender(RegisterMap* map) const { } bool frame::is_interpreted_frame_valid(JavaThread* thread) const { -// QQQ -#ifdef CC_INTERP -#else assert(is_interpreted_frame(), "Not an interpreted frame"); // These are reasonable sanity checks if (fp() == 0 || (intptr_t(fp()) & (wordSize-1)) != 0) { @@ -584,17 +559,10 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { if (locals > thread->stack_base() || locals < (address) fp()) return false; // We'd have to be pretty unlucky to be mislead at this point - -#endif // CC_INTERP return true; } BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) { -#ifdef CC_INTERP - // Needed for JVMTI. The result should always be in the - // interpreterState object - interpreterState istate = get_interpreterState(); -#endif // CC_INTERP assert(is_interpreted_frame(), "interpreted frame expected"); Method* method = interpreter_frame_method(); BasicType type = method->result_type(); @@ -620,11 +588,7 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) case T_ARRAY : { oop obj; if (method->is_native()) { -#ifdef CC_INTERP - obj = istate->_oop_temp; -#else obj = cast_to_oop(at(interpreter_frame_oop_temp_offset)); -#endif // CC_INTERP } else { oop* obj_p = (oop*)tos_addr; obj = (obj_p == NULL) ? (oop)NULL : *obj_p; diff --git a/hotspot/src/cpu/aarch64/vm/frame_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/frame_aarch64.hpp index 496bb0ed7af..d267036974e 100644 --- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.hpp @@ -63,44 +63,6 @@ // <- sender sp // ------------------------------ Asm interpreter ---------------------------------------- -// ------------------------------ C++ interpreter ---------------------------------------- -// -// Layout of C++ interpreter frame: (While executing in BytecodeInterpreter::run) -// -// <- SP (current esp/rsp) -// [local variables ] BytecodeInterpreter::run local variables -// ... BytecodeInterpreter::run local variables -// [local variables ] BytecodeInterpreter::run local variables -// [old frame pointer ] fp [ BytecodeInterpreter::run's ebp/rbp ] -// [return pc ] (return to frame manager) -// [interpreter_state* ] (arg to BytecodeInterpreter::run) -------------- -// [expression stack ] <- last_Java_sp | -// [... ] * <- interpreter_state.stack | -// [expression stack ] * <- interpreter_state.stack_base | -// [monitors ] \ | -// ... | monitor block size | -// [monitors ] / <- interpreter_state.monitor_base | -// [struct interpretState ] <-----------------------------------------| -// [return pc ] (return to callee of frame manager [1] -// [locals and parameters ] -// <- sender sp - -// [1] When the c++ interpreter calls a new method it returns to the frame -// manager which allocates a new frame on the stack. In that case there -// is no real callee of this newly allocated frame. The frame manager is -// aware of the additional frame(s) and will pop them as nested calls -// complete. Howevers tTo make it look good in the debugger the frame -// manager actually installs a dummy pc pointing to RecursiveInterpreterActivation -// with a fake interpreter_state* parameter to make it easy to debug -// nested calls. - -// Note that contrary to the layout for the assembly interpreter the -// expression stack allocated for the C++ interpreter is full sized. -// However this is not as bad as it seems as the interpreter frame_manager -// will truncate the unused space on succesive method calls. -// -// ------------------------------ C++ interpreter ---------------------------------------- - public: enum { pc_return_offset = 0, @@ -109,8 +71,6 @@ return_addr_offset = 1, sender_sp_offset = 2, -#ifndef CC_INTERP - // Interpreter frames interpreter_frame_oop_temp_offset = 3, // for native calls only @@ -127,8 +87,6 @@ interpreter_frame_monitor_block_top_offset = interpreter_frame_initial_sp_offset, interpreter_frame_monitor_block_bottom_offset = interpreter_frame_initial_sp_offset, -#endif // CC_INTERP - // Entry frames // n.b. these values are determined by the layout defined in // stubGenerator for the Java call stub @@ -193,13 +151,7 @@ // helper to update a map with callee-saved RBP static void update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr); -#ifndef CC_INTERP // deoptimization support void interpreter_frame_set_last_sp(intptr_t* sp); -#endif // CC_INTERP - -#ifdef CC_INTERP - inline interpreterState get_interpreterState() const; -#endif // CC_INTERP #endif // CPU_AARCH64_VM_FRAME_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/frame_aarch64.inline.hpp b/hotspot/src/cpu/aarch64/vm/frame_aarch64.inline.hpp index 3288eef3dac..7fce68be5b9 100644 --- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.inline.hpp +++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.inline.hpp @@ -157,59 +157,6 @@ inline intptr_t* frame::unextended_sp() const { return _unextended_sp; } inline address* frame::sender_pc_addr() const { return (address*) addr_at( return_addr_offset); } inline address frame::sender_pc() const { return *sender_pc_addr(); } -#ifdef CC_INTERP - -inline interpreterState frame::get_interpreterState() const { - return ((interpreterState)addr_at( -((int)sizeof(BytecodeInterpreter))/wordSize )); -} - -inline intptr_t* frame::sender_sp() const { - // Hmm this seems awfully expensive QQQ, is this really called with interpreted frames? - if (is_interpreted_frame()) { - assert(false, "should never happen"); - return get_interpreterState()->sender_sp(); - } else { - return addr_at(sender_sp_offset); - } -} - -inline intptr_t** frame::interpreter_frame_locals_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return &(get_interpreterState()->_locals); -} - -inline intptr_t* frame::interpreter_frame_bcx_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return (intptr_t*) &(get_interpreterState()->_bcp); -} - - -// Constant pool cache - -inline constantPoolCacheOop* frame::interpreter_frame_cache_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return &(get_interpreterState()->_constants); -} - -// Method - -inline methodOop* frame::interpreter_frame_method_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return &(get_interpreterState()->_method); -} - -inline intptr_t* frame::interpreter_frame_mdx_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return (intptr_t*) &(get_interpreterState()->_mdx); -} - -// top of expression stack -inline intptr_t* frame::interpreter_frame_tos_address() const { - assert(is_interpreted_frame(), "wrong frame type"); - return get_interpreterState()->_stack + 1; -} - -#else /* asm interpreter */ inline intptr_t* frame::sender_sp() const { return addr_at( sender_sp_offset); } inline intptr_t** frame::interpreter_frame_locals_addr() const { @@ -259,8 +206,6 @@ inline oop* frame::interpreter_frame_temp_oop_addr() const { return (oop *)(fp() + interpreter_frame_oop_temp_offset); } -#endif /* CC_INTERP */ - inline int frame::pd_oop_map_offset_adjustment() const { return 0; } diff --git a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp index d463f059978..e70b4cce54a 100644 --- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp @@ -47,8 +47,6 @@ void InterpreterMacroAssembler::jump_to_entry(address entry) { b(entry); } -#ifndef CC_INTERP - void InterpreterMacroAssembler::check_and_handle_popframe(Register java_thread) { if (JvmtiExport::can_pop_frame()) { Label L; @@ -595,8 +593,6 @@ void InterpreterMacroAssembler::remove_activation( andr(sp, esp, -16); } -#endif // C_INTERP - // Lock object // // Args: @@ -758,8 +754,6 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) } } -#ifndef CC_INTERP - void InterpreterMacroAssembler::test_method_data_pointer(Register mdp, Label& zero_continue) { assert(ProfileInterpreter, "must be profiling interpreter"); @@ -1345,7 +1339,6 @@ void InterpreterMacroAssembler::verify_oop(Register reg, TosState state) { } void InterpreterMacroAssembler::verify_FPU(int stack_depth, TosState state) { ; } -#endif // !CC_INTERP void InterpreterMacroAssembler::notify_method_entry() { @@ -1392,24 +1385,23 @@ void InterpreterMacroAssembler::notify_method_exit( // is changed then the interpreter_frame_result implementation will // need to be updated too. - // For c++ interpreter the result is always stored at a known location in the frame - // template interpreter will leave it on the top of the stack. - NOT_CC_INTERP(push(state);) + // template interpreter will leave the result on the top of the stack. + push(state); ldrw(r3, Address(rthread, JavaThread::interp_only_mode_offset())); cbz(r3, L); call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit)); bind(L); - NOT_CC_INTERP(pop(state)); + pop(state); } { SkipIfEqual skip(this, &DTraceMethodProbes, false); - NOT_CC_INTERP(push(state)); + push(state); get_method(c_rarg1); call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), rthread, c_rarg1); - NOT_CC_INTERP(pop(state)); + pop(state); } } diff --git a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp index 5cdfdecf2d3..81bf0f7bd09 100644 --- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -35,7 +35,6 @@ class InterpreterMacroAssembler: public MacroAssembler { -#ifndef CC_INTERP protected: protected: @@ -59,7 +58,6 @@ class InterpreterMacroAssembler: public MacroAssembler { // base routine for all dispatches void dispatch_base(TosState state, address* table, bool verifyoop = true); -#endif // CC_INTERP public: InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {} @@ -68,15 +66,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void jump_to_entry(address entry); -#ifdef CC_INTERP - void save_bcp() { /* not needed in c++ interpreter and harmless */ } - void restore_bcp() { /* not needed in c++ interpreter and harmless */ } - - // Helpers for runtime call arguments/results - void get_method(Register reg); - -#else - // Interpreter-specific registers void save_bcp() { str(rbcp, Address(rfp, frame::interpreter_frame_bcp_offset * wordSize)); @@ -202,7 +191,6 @@ class InterpreterMacroAssembler: public MacroAssembler { bool throw_monitor_exception = true, bool install_monitor_exception = true, bool notify_jvmdi = true); -#endif // CC_INTERP // FIXME: Give us a valid frame at a null check. virtual void null_check(Register reg, int offset = -1) { @@ -220,8 +208,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void lock_object (Register lock_reg); void unlock_object(Register lock_reg); -#ifndef CC_INTERP - // Interpreter profiling operations void set_method_data_pointer_for_bcp(); void test_method_data_pointer(Register mdp, Label& zero_continue); @@ -280,8 +266,6 @@ class InterpreterMacroAssembler: public MacroAssembler { // only if +VerifyFPU && (state == ftos || state == dtos) void verify_FPU(int stack_depth, TosState state = ftos); -#endif // !CC_INTERP - typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode; // support for jvmti/dtrace diff --git a/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp deleted file mode 100644 index 3d886570a5a..00000000000 --- a/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. 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. - * - */ - -#ifndef CPU_AARCH64_VM_INTERPRETERGENERATOR_AARCH64_HPP -#define CPU_AARCH64_VM_INTERPRETERGENERATOR_AARCH64_HPP - - -// Generation of Interpreter -// - friend class AbstractInterpreterGenerator; - -protected: - - void bang_stack_shadow_pages(bool native_call); - -private: - - address generate_normal_entry(bool synchronized); - address generate_native_entry(bool synchronized); - address generate_abstract_entry(void); - address generate_math_entry(AbstractInterpreter::MethodKind kind); - address generate_accessor_entry(void) { return NULL; } - address generate_empty_entry(void) { return NULL; } - void generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs); - address generate_Reference_get_entry(); - address generate_CRC32_update_entry(); - address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind); - address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { return NULL; } - void generate_stack_overflow_check(void); - - void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); - void generate_counter_overflow(Label* do_continue); - -#endif // CPU_AARCH64_VM_INTERPRETERGENERATOR_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp index a9cd044a1d8..cdb6d5eecc4 100644 --- a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp @@ -27,9 +27,9 @@ #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -123,7 +123,7 @@ address AbstractInterpreterGenerator::generate_slow_signature_handler() { // Various method entries // -address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { // rmethod: Method* // r13: sender sp // esp: args @@ -202,7 +202,7 @@ address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKin // static jdouble dexp(jdouble x); // static jdouble dpow(jdouble x, jdouble y); -void InterpreterGenerator::generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs) { +void TemplateInterpreterGenerator::generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs) { address fn; switch (kind) { case Interpreter::java_lang_math_sin : @@ -237,7 +237,7 @@ void InterpreterGenerator::generate_transcendental_entry(AbstractInterpreter::Me // Abstract method entry // Attempt to execute abstract method. Throw exception -address InterpreterGenerator::generate_abstract_entry(void) { +address TemplateInterpreterGenerator::generate_abstract_entry(void) { // rmethod: Method* // r13: sender SP diff --git a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.hpp deleted file mode 100644 index 7300a002e27..00000000000 --- a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. 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. - * - */ - -#ifndef CPU_AARCH64_VM_INTERPRETER_AARCH64_HPP -#define CPU_AARCH64_VM_INTERPRETER_AARCH64_HPP - - public: - - // Offset from rsp (which points to the last stack element) - static int expr_offset_in_bytes(int i) { return stackElementSize * i; } - - // Stack index relative to tos (which points at value) - static int expr_index_at(int i) { return stackElementWords * i; } - - // Already negated by c++ interpreter - static int local_index_at(int i) { - assert(i <= 0, "local direction already negated"); - return stackElementWords * i; - } - -#endif // CPU_AARCH64_VM_INTERPRETER_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp index 4c4e79b8629..de6365c681b 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -47,20 +47,13 @@ class MacroAssembler: public Assembler { // This is the base routine called by the different versions of call_VM_leaf. The interpreter // may customize this version by overriding it for its purposes (e.g., to save/restore // additional registers when doing a VM call). -#ifdef CC_INTERP - // c++ interpreter never wants to use interp_masm version of call_VM - #define VIRTUAL -#else - #define VIRTUAL virtual -#endif - - VIRTUAL void call_VM_leaf_base( + virtual void call_VM_leaf_base( address entry_point, // the entry point int number_of_arguments, // the number of arguments to pop after the call Label *retaddr = NULL ); - VIRTUAL void call_VM_leaf_base( + virtual void call_VM_leaf_base( address entry_point, // the entry point int number_of_arguments, // the number of arguments to pop after the call Label &retaddr) { @@ -75,7 +68,7 @@ class MacroAssembler: public Assembler { // returns the register which contains the thread upon return. If a thread register has been // specified, the return value will correspond to that register. If no last_java_sp is specified // (noreg) than rsp will be used instead. - VIRTUAL void call_VM_base( // returns the register containing the thread upon return + virtual void call_VM_base( // returns the register containing the thread upon return Register oop_result, // where an oop-result ends up if any; use noreg otherwise Register java_thread, // the thread if computed before ; use noreg otherwise Register last_java_sp, // to set up last_Java_frame in stubs; use noreg otherwise @@ -1004,8 +997,6 @@ public: Register table0, Register table1, Register table2, Register table3, Register tmp, Register tmp2, Register tmp3); -#undef VIRTUAL - // Stack push and pop individual 64 bit registers void push(Register src); void pop(Register dst); diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp index 1ae3d7f77ae..1edb46adf16 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp @@ -27,9 +27,9 @@ #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "interpreter/bytecodeTracer.hpp" #include "oops/arrayOop.hpp" @@ -59,8 +59,6 @@ #define __ _masm-> -#ifndef CC_INTERP - //----------------------------------------------------------------------------- extern "C" void entry(CodeBuffer*); @@ -304,7 +302,7 @@ address TemplateInterpreterGenerator::generate_safept_entry_for( // // rmethod: method // -void InterpreterGenerator::generate_counter_incr( +void TemplateInterpreterGenerator::generate_counter_incr( Label* overflow, Label* profile_method, Label* profile_method_continue) { @@ -382,7 +380,7 @@ void InterpreterGenerator::generate_counter_incr( } } -void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { +void TemplateInterpreterGenerator::generate_counter_overflow(Label& do_continue) { // Asm interpreter on entry // On return (i.e. jump to entry_point) [ back to invocation of interpreter ] @@ -401,7 +399,7 @@ void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { InterpreterRuntime::frequency_counter_overflow), c_rarg1); - __ b(*do_continue); + __ b(do_continue); } // See if we've got enough room on the stack for locals plus overhead. @@ -418,7 +416,7 @@ void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { // // Kills: // r0 -void InterpreterGenerator::generate_stack_overflow_check(void) { +void TemplateInterpreterGenerator::generate_stack_overflow_check(void) { // monitor entry size: see picture of stack set // (generate_method_entry) and frame_amd64.hpp @@ -634,7 +632,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) { // // Method entry for java.lang.ref.Reference.get. -address InterpreterGenerator::generate_Reference_get_entry(void) { +address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { #if INCLUDE_ALL_GCS // Code: _aload_0, _getfield, _areturn // parameter size = 1 @@ -712,7 +710,7 @@ address InterpreterGenerator::generate_Reference_get_entry(void) { * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) */ -address InterpreterGenerator::generate_CRC32_update_entry() { +address TemplateInterpreterGenerator::generate_CRC32_update_entry() { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -766,7 +764,7 @@ address InterpreterGenerator::generate_CRC32_update_entry() { * int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len) * int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len) */ -address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -821,7 +819,12 @@ address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpret return NULL; } -void InterpreterGenerator::bang_stack_shadow_pages(bool native_call) { +// Not supported +address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { + return NULL; +} + +void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) { // Bang each page in the shadow zone. We can't assume it's been done for // an interpreter frame with greater than a page of locals, so each page // needs to be checked. Only true for non-native. @@ -840,7 +843,7 @@ void InterpreterGenerator::bang_stack_shadow_pages(bool native_call) { // Interpreter stub for calling a native method. (asm interpreter) // This sets up a somewhat different looking stack for calling the // native method than the typical interpreter frame setup. -address InterpreterGenerator::generate_native_entry(bool synchronized) { +address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // determine code generation flags bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods; @@ -1269,7 +1272,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { if (inc_counter) { // Handle overflow of counter and compile method __ bind(invocation_counter_overflow); - generate_counter_overflow(&continue_after_compile); + generate_counter_overflow(continue_after_compile); } return entry_point; @@ -1278,7 +1281,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { // // Generic interpreted method entry to (asm) interpreter // -address InterpreterGenerator::generate_normal_entry(bool synchronized) { +address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { // determine code generation flags bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods; @@ -1440,7 +1443,7 @@ address InterpreterGenerator::generate_normal_entry(bool synchronized) { } // Handle overflow of counter and compile method __ bind(invocation_counter_overflow); - generate_counter_overflow(&continue_after_compile); + generate_counter_overflow(continue_after_compile); } return entry_point; @@ -1725,17 +1728,6 @@ void TemplateInterpreterGenerator::set_vtos_entry_points(Template* t, generate_and_dispatch(t); } -//----------------------------------------------------------------------------- -// Generation of individual instructions - -// helpers for generate_and_dispatch - - -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : TemplateInterpreterGenerator(code) { - generate_all(); // down here so it can be "virtual" -} - //----------------------------------------------------------------------------- // Non-product code @@ -1923,4 +1915,3 @@ extern "C" { #endif // BUILTIN_SIM #endif // !PRODUCT -#endif // ! CC_INTERP diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.hpp deleted file mode 100644 index 25da0ee30e6..00000000000 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. 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. - * - */ - -#ifndef CPU_AARCH64_VM_TEMPLATEINTERPRETERGENERATOR_AARCH64_HPP -#define CPU_AARCH64_VM_TEMPLATEINTERPRETERGENERATOR_AARCH64_HPP - - protected: - -void generate_fixed_frame(bool native_call); - - // address generate_asm_interpreter_entry(bool synchronized); - -#endif // CPU_AARCH64_VM_TEMPLATEINTERPRETERGENERATOR_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp index 314af0b87ab..b067af82d44 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp @@ -31,6 +31,12 @@ #include "utilities/debug.hpp" #include "utilities/macros.hpp" +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +int TemplateInterpreter::InterpreterCodeSize = 200 * 1024; int AbstractInterpreter::BasicType_as_index(BasicType type) { int i = 0; @@ -97,7 +103,7 @@ int AbstractInterpreter::size_activation(int max_stack, int callee_locals, bool is_top_frame) { // Note: This calculation must exactly parallel the frame setup - // in InterpreterGenerator::generate_method_entry. + // in TemplateInterpreterGenerator::generate_method_entry. // fixed size of an interpreter frame: int overhead = frame::sender_sp_offset - diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.hpp deleted file mode 100644 index b77a5e9fcd0..00000000000 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. 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. - * - */ - -#ifndef CPU_AARCH64_VM_TEMPLATEINTERPRETER_AARCH64_HPP -#define CPU_AARCH64_VM_TEMPLATEINTERPRETER_AARCH64_HPP - - - protected: - - // Size of interpreter code. Increase if too small. Interpreter will - // fail with a guarantee ("not enough space for interpreter generation"); - // if too small. - // Run with +PrintInterpreter to get the VM to print out the size. - // Max size with JVMTI - const static int InterpreterCodeSize = 200 * 1024; - -#endif // CPU_AARCH64_VM_TEMPLATEINTERPRETER_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp index 1ee5823f7f6..6c8c5ac8bac 100644 --- a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp @@ -39,8 +39,6 @@ #include "runtime/stubRoutines.hpp" #include "runtime/synchronizer.hpp" -#ifndef CC_INTERP - #define __ _masm-> // Platform-dependent initialization @@ -3795,4 +3793,3 @@ void TemplateTable::multianewarray() { __ load_unsigned_byte(r1, at_bcp(3)); __ lea(esp, Address(esp, r1, Address::uxtw(3))); } -#endif // !CC_INTERP diff --git a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp index c7d33304bd1..fabffc8c3cf 100644 --- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp @@ -27,7 +27,7 @@ #define CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP #ifdef CC_INTERP -#error "CC_INTERP no more supported. Removed in change 8145117." +#error "CC_INTERP is no longer supported. Removed in change 8145117." #endif // Size of PPC Instructions diff --git a/hotspot/src/cpu/ppc/vm/interpreterGenerator_ppc.hpp b/hotspot/src/cpu/ppc/vm/interpreterGenerator_ppc.hpp deleted file mode 100644 index 02a6931b662..00000000000 --- a/hotspot/src/cpu/ppc/vm/interpreterGenerator_ppc.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. 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. - * - */ - -#ifndef CPU_PPC_VM_INTERPRETERGENERATOR_PPC_HPP -#define CPU_PPC_VM_INTERPRETERGENERATOR_PPC_HPP - - friend class AbstractInterpreterGenerator; - - private: - - address generate_abstract_entry(void); - address generate_accessor_entry(void) { return NULL; } - address generate_empty_entry(void) { return NULL; } - address generate_Reference_get_entry(void); - - address generate_CRC32_update_entry(); - address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind); - address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { return NULL; } - -#endif // CPU_PPC_VM_INTERPRETERGENERATOR_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp index b887d17828d..bd3488f9873 100644 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp @@ -27,9 +27,9 @@ #include "asm/macroAssembler.inline.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -416,7 +416,7 @@ address AbstractInterpreterGenerator::generate_result_handler_for(BasicType type // Abstract method entry. // -address InterpreterGenerator::generate_abstract_entry(void) { +address TemplateInterpreterGenerator::generate_abstract_entry(void) { address entry = __ pc(); // @@ -474,7 +474,7 @@ address InterpreterGenerator::generate_abstract_entry(void) { // It contains a GC barrier which puts the reference into the satb buffer // to indicate that someone holds a strong reference to the object the // weak ref points to! -address InterpreterGenerator::generate_Reference_get_entry(void) { +address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { // Code: _aload_0, _getfield, _areturn // parameter size = 1 // diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp deleted file mode 100644 index 50dc2a2c567..00000000000 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. 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. - * - */ - -#ifndef CPU_PPC_VM_INTERPRETER_PPC_HPP -#define CPU_PPC_VM_INTERPRETER_PPC_HPP - - public: - - // Stack index relative to tos (which points at value). - static int expr_index_at(int i) { - return stackElementWords * i; - } - - // Already negated by c++ interpreter. - static int local_index_at(int i) { - assert(i <= 0, "local direction already negated"); - return stackElementWords * i; - } - - // The offset in bytes to access a expression stack slot - // relative to the esp pointer. - static int expr_offset_in_bytes(int slot) { - return stackElementSize * slot + wordSize; - } - -#endif // CPU_PPC_VM_INTERPRETER_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp index 321a9c0e86d..1972e21f743 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp @@ -27,9 +27,9 @@ #include "asm/macroAssembler.inline.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -1245,7 +1245,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) */ -address InterpreterGenerator::generate_CRC32_update_entry() { +address TemplateInterpreterGenerator::generate_CRC32_update_entry() { if (UseCRC32Intrinsics) { address start = __ pc(); // Remember stub start address (is rtn value). Label slow_path; @@ -1305,7 +1305,7 @@ address InterpreterGenerator::generate_CRC32_update_entry() { * int java.util.zip.CRC32.updateBytes( int crc, byte[] b, int off, int len) * int java.util.zip.CRC32.updateByteBuffer(int crc, long* buf, int off, int len) */ -address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32Intrinsics) { address start = __ pc(); // Remember stub start address (is rtn value). Label slow_path; @@ -1391,6 +1391,11 @@ address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpret return NULL; } +// Not supported +address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { + return NULL; +} + // ============================================================================= // Exceptions @@ -1642,16 +1647,6 @@ void TemplateInterpreterGenerator::set_vtos_entry_points(Template* t, generate_and_dispatch(t); } -//----------------------------------------------------------------------------- -// Generation of individual instructions - -// helpers for generate_and_dispatch - -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : TemplateInterpreterGenerator(code) { - generate_all(); // Down here so it can be "virtual". -} - //----------------------------------------------------------------------------- // Non-product code diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.hpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.hpp deleted file mode 100644 index ea12f04124c..00000000000 --- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013, 2014 SAP AG. 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. - * - */ - -#ifndef CPU_PPC_VM_TEMPLATEINTERPRETERGENERATOR_PPC_HPP -#define CPU_PPC_VM_TEMPLATEINTERPRETERGENERATOR_PPC_HPP - - protected: - address generate_normal_entry(bool synchronized); - address generate_native_entry(bool synchronized); - address generate_math_entry(AbstractInterpreter::MethodKind kind); - - void lock_method(Register Rflags, Register Rscratch1, Register Rscratch2, bool flags_preloaded=false); - void unlock_method(bool check_exceptions = true); - - void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); - void generate_counter_overflow(Label& continue_entry); - - void generate_fixed_frame(bool native_call, Register Rsize_of_parameters, Register Rsize_of_locals); - void generate_stack_overflow_check(Register Rframe_size, Register Rscratch1); - -#endif // CPU_PPC_VM_TEMPLATEINTERPRETERGENERATOR_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp index 5179d817853..8cd02dca4b3 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp @@ -31,6 +31,12 @@ #include "utilities/debug.hpp" #include "utilities/macros.hpp" +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +int TemplateInterpreter::InterpreterCodeSize = 230*K; int AbstractInterpreter::BasicType_as_index(BasicType type) { int i = 0; @@ -79,7 +85,7 @@ int AbstractInterpreter::size_activation(int max_stack, int callee_locals, bool is_top_frame) { // Note: This calculation must exactly parallel the frame setup - // in InterpreterGenerator::generate_fixed_frame. + // in TemplateInterpreterGenerator::generate_fixed_frame. assert(Interpreter::stackElementWords == 1, "sanity"); const int max_alignment_space = StackAlignmentInBytes / Interpreter::stackElementSize; const int abi_scratch = is_top_frame ? (frame::abi_reg_args_size / Interpreter::stackElementSize) : diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp deleted file mode 100644 index b9003dd3c4b..00000000000 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2015 SAP AG. 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. - * - */ - -#ifndef CPU_PPC_VM_TEMPLATEINTERPRETER_PPC_HPP -#define CPU_PPC_VM_TEMPLATEINTERPRETER_PPC_HPP - - protected: - - // Size of interpreter code. Increase if too small. Interpreter will - // fail with a guarantee ("not enough space for interpreter generation"); - // if too small. - // Run with +PrintInterpreter to get the VM to print out the size. - // Max size with JVMTI - const static int InterpreterCodeSize = 230*K; - - public: - // Support abs and sqrt like in compiler. - // For others we can use a normal (native) entry. - static bool math_entry_available(AbstractInterpreter::MethodKind kind); -#endif // CPU_PPC_VM_TEMPLATEINTERPRETER_PPC_HPP - - diff --git a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp deleted file mode 100644 index 3d2087659d6..00000000000 --- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2007, 2012, 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. - * - */ - -#include "precompiled.hpp" -#include "asm/assembler.hpp" -#include "interp_masm_sparc.hpp" -#include "interpreter/bytecodeInterpreter.hpp" -#include "interpreter/bytecodeInterpreter.inline.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/deoptimization.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" - -// KILL THIS FILE diff --git a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp deleted file mode 100644 index dd417a30eb5..00000000000 --- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP -#define CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP - -// Platform specific for C++ based Interpreter -#define LOTS_OF_REGS /* Lets interpreter use plenty of registers */ - -private: - - // save the bottom of the stack after frame manager setup. For ease of restoration after return - // from recursive interpreter call - intptr_t* _frame_bottom; /* saved bottom of frame manager frame */ - intptr_t* _last_Java_pc; /* pc to return to in frame manager */ - interpreterState _self_link; /* Previous interpreter state */ /* sometimes points to self??? */ - double _native_fresult; /* save result of native calls that might return floats */ - intptr_t _native_lresult; /* save result of native calls that might return handle/longs */ -public: - - static void pd_layout_interpreterState(interpreterState istate, address last_Java_pc, intptr_t* last_Java_fp); - - -#define SET_LAST_JAVA_FRAME() - -#define RESET_LAST_JAVA_FRAME() THREAD->frame_anchor()->set_flags(0); - -/* - * Macros for accessing the stack. - */ -#undef STACK_INT -#undef STACK_FLOAT -#undef STACK_ADDR -#undef STACK_OBJECT -#undef STACK_DOUBLE -#undef STACK_LONG -// JavaStack Implementation - - -#define GET_STACK_SLOT(offset) (*((intptr_t*) &topOfStack[-(offset)])) -#define STACK_SLOT(offset) ((address) &topOfStack[-(offset)]) -#define STACK_ADDR(offset) (*((address *) &topOfStack[-(offset)])) -#define STACK_INT(offset) (*((jint*) &topOfStack[-(offset)])) -#define STACK_FLOAT(offset) (*((jfloat *) &topOfStack[-(offset)])) -#define STACK_OBJECT(offset) (*((oop *) &topOfStack [-(offset)])) -#define STACK_DOUBLE(offset) (((VMJavaVal64*) &topOfStack[-(offset)])->d) -#define STACK_LONG(offset) (((VMJavaVal64 *) &topOfStack[-(offset)])->l) - -#define SET_STACK_SLOT(value, offset) (*(intptr_t*)&topOfStack[-(offset)] = *(intptr_t*)(value)) -#define SET_STACK_ADDR(value, offset) (*((address *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_INT(value, offset) (*((jint *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_FLOAT(value, offset) (*((jfloat *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_OBJECT(value, offset) (*((oop *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_DOUBLE(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = (value)) -#define SET_STACK_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = \ - ((VMJavaVal64*)(addr))->d) -#define SET_STACK_LONG(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = (value)) -#define SET_STACK_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = \ - ((VMJavaVal64*)(addr))->l) - -#define LOCALS_SLOT(offset) ((intptr_t*)&locals[-(offset)]) -#define LOCALS_ADDR(offset) ((address)locals[-(offset)]) -#define LOCALS_INT(offset) (*((jint*)&locals[-(offset)])) -#define LOCALS_FLOAT(offset) (*((jfloat*)&locals[-(offset)])) -#define LOCALS_OBJECT(offset) (cast_to_oop(locals[-(offset)])) -#define LOCALS_DOUBLE(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->d) -#define LOCALS_LONG(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->l) -#define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)])) -#define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)])) - -#define SET_LOCALS_SLOT(value, offset) (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value)) -#define SET_LOCALS_ADDR(value, offset) (*((address *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_INT(value, offset) (*((jint *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_FLOAT(value, offset) (*((jfloat *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_OBJECT(value, offset) (*((oop *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_DOUBLE(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value)) -#define SET_LOCALS_LONG(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value)) -#define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \ - ((VMJavaVal64*)(addr))->d) -#define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \ - ((VMJavaVal64*)(addr))->l) - -#endif // CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp deleted file mode 100644 index d9c8e66de6a..00000000000 --- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP -#define CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP - -// Inline interpreter functions for sparc - -inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { return op1 + op2; } -inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) { return op1 - op2; } -inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) { return op1 * op2; } -inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) { return op1 / op2; } -inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) { return fmod(op1, op2); } - -inline jfloat BytecodeInterpreter::VMfloatNeg(jfloat op) { return -op; } - -inline int32_t BytecodeInterpreter::VMfloatCompare(jfloat op1, jfloat op2, int32_t direction) { - return ( op1 < op2 ? -1 : - op1 > op2 ? 1 : - op1 == op2 ? 0 : - (direction == -1 || direction == 1) ? direction : 0); - -} - -inline void BytecodeInterpreter::VMmemCopy64(uint32_t to[2], const uint32_t from[2]) { - // x86 can do unaligned copies but not 64bits at a time - to[0] = from[0]; to[1] = from[1]; -} - -// The long operations depend on compiler support for "long long" on x86 - -inline jlong BytecodeInterpreter::VMlongAdd(jlong op1, jlong op2) { - return op1 + op2; -} - -inline jlong BytecodeInterpreter::VMlongAnd(jlong op1, jlong op2) { - return op1 & op2; -} - -inline jlong BytecodeInterpreter::VMlongDiv(jlong op1, jlong op2) { - // QQQ what about check and throw... - return op1 / op2; -} - -inline jlong BytecodeInterpreter::VMlongMul(jlong op1, jlong op2) { - return op1 * op2; -} - -inline jlong BytecodeInterpreter::VMlongOr(jlong op1, jlong op2) { - return op1 | op2; -} - -inline jlong BytecodeInterpreter::VMlongSub(jlong op1, jlong op2) { - return op1 - op2; -} - -inline jlong BytecodeInterpreter::VMlongXor(jlong op1, jlong op2) { - return op1 ^ op2; -} - -inline jlong BytecodeInterpreter::VMlongRem(jlong op1, jlong op2) { - return op1 % op2; -} - -inline jlong BytecodeInterpreter::VMlongUshr(jlong op1, jint op2) { - // CVM did this 0x3f mask, is the really needed??? QQQ - return ((unsigned long long) op1) >> (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongShr(jlong op1, jint op2) { - return op1 >> (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongShl(jlong op1, jint op2) { - return op1 << (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongNeg(jlong op) { - return -op; -} - -inline jlong BytecodeInterpreter::VMlongNot(jlong op) { - return ~op; -} - -inline int32_t BytecodeInterpreter::VMlongLtz(jlong op) { - return (op <= 0); -} - -inline int32_t BytecodeInterpreter::VMlongGez(jlong op) { - return (op >= 0); -} - -inline int32_t BytecodeInterpreter::VMlongEqz(jlong op) { - return (op == 0); -} - -inline int32_t BytecodeInterpreter::VMlongEq(jlong op1, jlong op2) { - return (op1 == op2); -} - -inline int32_t BytecodeInterpreter::VMlongNe(jlong op1, jlong op2) { - return (op1 != op2); -} - -inline int32_t BytecodeInterpreter::VMlongGe(jlong op1, jlong op2) { - return (op1 >= op2); -} - -inline int32_t BytecodeInterpreter::VMlongLe(jlong op1, jlong op2) { - return (op1 <= op2); -} - -inline int32_t BytecodeInterpreter::VMlongLt(jlong op1, jlong op2) { - return (op1 < op2); -} - -inline int32_t BytecodeInterpreter::VMlongGt(jlong op1, jlong op2) { - return (op1 > op2); -} - -inline int32_t BytecodeInterpreter::VMlongCompare(jlong op1, jlong op2) { - return (VMlongLt(op1, op2) ? -1 : VMlongGt(op1, op2) ? 1 : 0); -} - -// Long conversions - -inline jdouble BytecodeInterpreter::VMlong2Double(jlong val) { - return (jdouble) val; -} - -inline jfloat BytecodeInterpreter::VMlong2Float(jlong val) { - return (jfloat) val; -} - -inline jint BytecodeInterpreter::VMlong2Int(jlong val) { - return (jint) val; -} - -// Double Arithmetic - -inline jdouble BytecodeInterpreter::VMdoubleAdd(jdouble op1, jdouble op2) { - return op1 + op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleDiv(jdouble op1, jdouble op2) { - // Divide by zero... QQQ - return op1 / op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleMul(jdouble op1, jdouble op2) { - return op1 * op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleNeg(jdouble op) { - return -op; -} - -inline jdouble BytecodeInterpreter::VMdoubleRem(jdouble op1, jdouble op2) { - return fmod(op1, op2); -} - -inline jdouble BytecodeInterpreter::VMdoubleSub(jdouble op1, jdouble op2) { - return op1 - op2; -} - -inline int32_t BytecodeInterpreter::VMdoubleCompare(jdouble op1, jdouble op2, int32_t direction) { - return ( op1 < op2 ? -1 : - op1 > op2 ? 1 : - op1 == op2 ? 0 : - (direction == -1 || direction == 1) ? direction : 0); -} - -// Double Conversions - -inline jfloat BytecodeInterpreter::VMdouble2Float(jdouble val) { - return (jfloat) val; -} - -// Float Conversions - -inline jdouble BytecodeInterpreter::VMfloat2Double(jfloat op) { - return (jdouble) op; -} - -// Integer Arithmetic - -inline jint BytecodeInterpreter::VMintAdd(jint op1, jint op2) { - return op1 + op2; -} - -inline jint BytecodeInterpreter::VMintAnd(jint op1, jint op2) { - return op1 & op2; -} - -inline jint BytecodeInterpreter::VMintDiv(jint op1, jint op2) { - /* it's possible we could catch this special case implicitly */ - if (op1 == 0x80000000 && op2 == -1) return op1; - else return op1 / op2; -} - -inline jint BytecodeInterpreter::VMintMul(jint op1, jint op2) { - return op1 * op2; -} - -inline jint BytecodeInterpreter::VMintNeg(jint op) { - return -op; -} - -inline jint BytecodeInterpreter::VMintOr(jint op1, jint op2) { - return op1 | op2; -} - -inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) { - /* it's possible we could catch this special case implicitly */ - if (op1 == 0x80000000 && op2 == -1) return 0; - else return op1 % op2; -} - -inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) { - return op1 << (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) { - return op1 >> (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) { - return op1 - op2; -} - -inline juint BytecodeInterpreter::VMintUshr(jint op1, jint op2) { - return ((juint) op1) >> (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) { - return op1 ^ op2; -} - -inline jdouble BytecodeInterpreter::VMint2Double(jint val) { - return (jdouble) val; -} - -inline jfloat BytecodeInterpreter::VMint2Float(jint val) { - return (jfloat) val; -} - -inline jlong BytecodeInterpreter::VMint2Long(jint val) { - return (jlong) val; -} - -inline jchar BytecodeInterpreter::VMint2Char(jint val) { - return (jchar) val; -} - -inline jshort BytecodeInterpreter::VMint2Short(jint val) { - return (jshort) val; -} - -inline jbyte BytecodeInterpreter::VMint2Byte(jint val) { - return (jbyte) val; -} - -// The implementations are platform dependent. We have to worry about alignment -// issues on some machines which can change on the same platform depending on -// whether it is an LP64 machine also. - -// We know that on LP32 mode that longs/doubles are the only thing that gives -// us alignment headaches. We also know that the worst we have is 32bit alignment -// so thing are not really too bad. -// (Also sparcworks compiler does the right thing for free if we don't use -arch.. -// switches. Only gcc gives us a hard time. In LP64 mode I think we have no issue -// with alignment. - -#ifdef _GNU_SOURCE - #define ALIGN_CONVERTER /* Needs alignment converter */ -#else - #undef ALIGN_CONVERTER /* No alignment converter */ -#endif /* _GNU_SOURCE */ - -#ifdef ALIGN_CONVERTER -class u8_converter { - - private: - - public: - static jdouble get_jdouble(address p) { - VMJavaVal64 tmp; - tmp.v[0] = ((uint32_t*)p)[0]; - tmp.v[1] = ((uint32_t*)p)[1]; - return tmp.d; - } - - static void put_jdouble(address p, jdouble d) { - VMJavaVal64 tmp; - tmp.d = d; - ((uint32_t*)p)[0] = tmp.v[0]; - ((uint32_t*)p)[1] = tmp.v[1]; - } - - static jlong get_jlong(address p) { - VMJavaVal64 tmp; - tmp.v[0] = ((uint32_t*)p)[0]; - tmp.v[1] = ((uint32_t*)p)[1]; - return tmp.l; - } - - static void put_jlong(address p, jlong l) { - VMJavaVal64 tmp; - tmp.l = l; - ((uint32_t*)p)[0] = tmp.v[0]; - ((uint32_t*)p)[1] = tmp.v[1]; - } -}; -#endif /* ALIGN_CONVERTER */ - -#endif // CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP diff --git a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp index 152529b9beb..4787b4fa835 100644 --- a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp @@ -37,11 +37,7 @@ define_pd_global(bool, InlineIntrinsics, false); define_pd_global(bool, PreferInterpreterNativeStubs, false); define_pd_global(bool, ProfileTraps, true); define_pd_global(bool, UseOnStackReplacement, true); -#ifdef CC_INTERP -define_pd_global(bool, ProfileInterpreter, false); -#else define_pd_global(bool, ProfileInterpreter, true); -#endif // CC_INTERP define_pd_global(bool, TieredCompilation, trueInTiered); define_pd_global(intx, CompileThreshold, 10000); diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp b/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp deleted file mode 100644 index 70d7000b3c8..00000000000 --- a/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP -#define CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP - - static address frame_manager_return; - static address frame_manager_sync_return; - - - void generate_more_monitors(); - void generate_deopt_handling(); - void lock_method(void); - void adjust_callers_stack(Register args); - void generate_compute_interpreter_state(const Register state, - const Register prev_state, - bool native); - -#endif // CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp deleted file mode 100644 index 8fd601277c7..00000000000 --- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp +++ /dev/null @@ -1,2201 +0,0 @@ -/* - * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/assembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/cppInterpreter.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/arguments.hpp" -#include "runtime/deoptimization.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/interfaceSupport.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#include "utilities/macros.hpp" -#ifdef SHARK -#include "shark/shark_globals.hpp" -#endif - -#ifdef CC_INTERP - -// Routine exists to make tracebacks look decent in debugger -// while "shadow" interpreter frames are on stack. It is also -// used to distinguish interpreter frames. - -extern "C" void RecursiveInterpreterActivation(interpreterState istate) { - ShouldNotReachHere(); -} - -bool CppInterpreter::contains(address pc) { - return ( _code->contains(pc) || - ( pc == (CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation) + frame::pc_return_offset))); -} - -#define STATE(field_name) Lstate, in_bytes(byte_offset_of(BytecodeInterpreter, field_name)) -#define __ _masm-> - -Label frame_manager_entry; // c++ interpreter entry point this holds that entry point label. - -static address unctrap_frame_manager_entry = NULL; - -static address interpreter_return_address = NULL; -static address deopt_frame_manager_return_atos = NULL; -static address deopt_frame_manager_return_btos = NULL; -static address deopt_frame_manager_return_itos = NULL; -static address deopt_frame_manager_return_ltos = NULL; -static address deopt_frame_manager_return_ftos = NULL; -static address deopt_frame_manager_return_dtos = NULL; -static address deopt_frame_manager_return_vtos = NULL; - -const Register prevState = G1_scratch; - -void InterpreterGenerator::save_native_result(void) { - // result potentially in O0/O1: save it across calls - __ stf(FloatRegisterImpl::D, F0, STATE(_native_fresult)); -#ifdef _LP64 - __ stx(O0, STATE(_native_lresult)); -#else - __ std(O0, STATE(_native_lresult)); -#endif -} - -void InterpreterGenerator::restore_native_result(void) { - - // Restore any method result value - __ ldf(FloatRegisterImpl::D, STATE(_native_fresult), F0); -#ifdef _LP64 - __ ldx(STATE(_native_lresult), O0); -#else - __ ldd(STATE(_native_lresult), O0); -#endif -} - -// A result handler converts/unboxes a native call result into -// a java interpreter/compiler result. The current frame is an -// interpreter frame. The activation frame unwind code must be -// consistent with that of TemplateTable::_return(...). In the -// case of native methods, the caller's SP was not modified. -address CppInterpreterGenerator::generate_result_handler_for(BasicType type) { - address entry = __ pc(); - Register Itos_i = Otos_i ->after_save(); - Register Itos_l = Otos_l ->after_save(); - Register Itos_l1 = Otos_l1->after_save(); - Register Itos_l2 = Otos_l2->after_save(); - switch (type) { - case T_BOOLEAN: __ subcc(G0, O0, G0); __ addc(G0, 0, Itos_i); break; // !0 => true; 0 => false - case T_CHAR : __ sll(O0, 16, O0); __ srl(O0, 16, Itos_i); break; // cannot use and3, 0xFFFF too big as immediate value! - case T_BYTE : __ sll(O0, 24, O0); __ sra(O0, 24, Itos_i); break; - case T_SHORT : __ sll(O0, 16, O0); __ sra(O0, 16, Itos_i); break; - case T_LONG : -#ifndef _LP64 - __ mov(O1, Itos_l2); // move other half of long -#endif // ifdef or no ifdef, fall through to the T_INT case - case T_INT : __ mov(O0, Itos_i); break; - case T_VOID : /* nothing to do */ break; - case T_FLOAT : assert(F0 == Ftos_f, "fix this code" ); break; - case T_DOUBLE : assert(F0 == Ftos_d, "fix this code" ); break; - case T_OBJECT : - __ ld_ptr(STATE(_oop_temp), Itos_i); - __ verify_oop(Itos_i); - break; - default : ShouldNotReachHere(); - } - __ ret(); // return from interpreter activation - __ delayed()->restore(I5_savedSP, G0, SP); // remove interpreter frame - NOT_PRODUCT(__ emit_int32(0);) // marker for disassembly - return entry; -} - -// tosca based result to c++ interpreter stack based result. -// Result goes to address in L1_scratch - -address CppInterpreterGenerator::generate_tosca_to_stack_converter(BasicType type) { - // A result is in the native abi result register from a native method call. - // We need to return this result to the interpreter by pushing the result on the interpreter's - // stack. This is relatively simple the destination is in L1_scratch - // i.e. L1_scratch is the first free element on the stack. If we "push" a return value we must - // adjust L1_scratch - address entry = __ pc(); - switch (type) { - case T_BOOLEAN: - // !0 => true; 0 => false - __ subcc(G0, O0, G0); - __ addc(G0, 0, O0); - __ st(O0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - - // cannot use and3, 0xFFFF too big as immediate value! - case T_CHAR : - __ sll(O0, 16, O0); - __ srl(O0, 16, O0); - __ st(O0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - - case T_BYTE : - __ sll(O0, 24, O0); - __ sra(O0, 24, O0); - __ st(O0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - - case T_SHORT : - __ sll(O0, 16, O0); - __ sra(O0, 16, O0); - __ st(O0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - case T_LONG : -#ifndef _LP64 -#if defined(COMPILER2) - // All return values are where we want them, except for Longs. C2 returns - // longs in G1 in the 32-bit build whereas the interpreter wants them in O0/O1. - // Since the interpreter will return longs in G1 and O0/O1 in the 32bit - // build even if we are returning from interpreted we just do a little - // stupid shuffing. - // Note: I tried to make c2 return longs in O0/O1 and G1 so we wouldn't have to - // do this here. Unfortunately if we did a rethrow we'd see an machepilog node - // first which would move g1 -> O0/O1 and destroy the exception we were throwing. - __ stx(G1, L1_scratch, -wordSize); -#else - // native result is in O0, O1 - __ st(O1, L1_scratch, 0); // Low order - __ st(O0, L1_scratch, -wordSize); // High order -#endif /* COMPILER2 */ -#else - __ stx(O0, L1_scratch, -wordSize); -#endif - __ sub(L1_scratch, 2*wordSize, L1_scratch); - break; - - case T_INT : - __ st(O0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - - case T_VOID : /* nothing to do */ - break; - - case T_FLOAT : - __ stf(FloatRegisterImpl::S, F0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - - case T_DOUBLE : - // Every stack slot is aligned on 64 bit, However is this - // the correct stack slot on 64bit?? QQQ - __ stf(FloatRegisterImpl::D, F0, L1_scratch, -wordSize); - __ sub(L1_scratch, 2*wordSize, L1_scratch); - break; - case T_OBJECT : - __ verify_oop(O0); - __ st_ptr(O0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - default : ShouldNotReachHere(); - } - __ retl(); // return from interpreter activation - __ delayed()->nop(); // schedule this better - NOT_PRODUCT(__ emit_int32(0);) // marker for disassembly - return entry; -} - -address CppInterpreterGenerator::generate_stack_to_stack_converter(BasicType type) { - // A result is in the java expression stack of the interpreted method that has just - // returned. Place this result on the java expression stack of the caller. - // - // The current interpreter activation in Lstate is for the method just returning its - // result. So we know that the result of this method is on the top of the current - // execution stack (which is pre-pushed) and will be return to the top of the caller - // stack. The top of the callers stack is the bottom of the locals of the current - // activation. - // Because of the way activation are managed by the frame manager the value of esp is - // below both the stack top of the current activation and naturally the stack top - // of the calling activation. This enable this routine to leave the return address - // to the frame manager on the stack and do a vanilla return. - // - // On entry: O0 - points to source (callee stack top) - // O1 - points to destination (caller stack top [i.e. free location]) - // destroys O2, O3 - // - - address entry = __ pc(); - switch (type) { - case T_VOID: break; - break; - case T_FLOAT : - case T_BOOLEAN: - case T_CHAR : - case T_BYTE : - case T_SHORT : - case T_INT : - // 1 word result - __ ld(O0, 0, O2); - __ st(O2, O1, 0); - __ sub(O1, wordSize, O1); - break; - case T_DOUBLE : - case T_LONG : - // return top two words on current expression stack to caller's expression stack - // The caller's expression stack is adjacent to the current frame manager's intepretState - // except we allocated one extra word for this intepretState so we won't overwrite it - // when we return a two word result. -#ifdef _LP64 - __ ld_ptr(O0, 0, O2); - __ st_ptr(O2, O1, -wordSize); -#else - __ ld(O0, 0, O2); - __ ld(O0, wordSize, O3); - __ st(O3, O1, 0); - __ st(O2, O1, -wordSize); -#endif - __ sub(O1, 2*wordSize, O1); - break; - case T_OBJECT : - __ ld_ptr(O0, 0, O2); - __ verify_oop(O2); // verify it - __ st_ptr(O2, O1, 0); - __ sub(O1, wordSize, O1); - break; - default : ShouldNotReachHere(); - } - __ retl(); - __ delayed()->nop(); // QQ schedule this better - return entry; -} - -address CppInterpreterGenerator::generate_stack_to_native_abi_converter(BasicType type) { - // A result is in the java expression stack of the interpreted method that has just - // returned. Place this result in the native abi that the caller expects. - // We are in a new frame registers we set must be in caller (i.e. callstub) frame. - // - // Similar to generate_stack_to_stack_converter above. Called at a similar time from the - // frame manager execept in this situation the caller is native code (c1/c2/call_stub) - // and so rather than return result onto caller's java expression stack we return the - // result in the expected location based on the native abi. - // On entry: O0 - source (stack top) - // On exit result in expected output register - // QQQ schedule this better - - address entry = __ pc(); - switch (type) { - case T_VOID: break; - break; - case T_FLOAT : - __ ldf(FloatRegisterImpl::S, O0, 0, F0); - break; - case T_BOOLEAN: - case T_CHAR : - case T_BYTE : - case T_SHORT : - case T_INT : - // 1 word result - __ ld(O0, 0, O0->after_save()); - break; - case T_DOUBLE : - __ ldf(FloatRegisterImpl::D, O0, 0, F0); - break; - case T_LONG : - // return top two words on current expression stack to caller's expression stack - // The caller's expression stack is adjacent to the current frame manager's interpretState - // except we allocated one extra word for this intepretState so we won't overwrite it - // when we return a two word result. -#ifdef _LP64 - __ ld_ptr(O0, 0, O0->after_save()); -#else - __ ld(O0, wordSize, O1->after_save()); - __ ld(O0, 0, O0->after_save()); -#endif -#if defined(COMPILER2) && !defined(_LP64) - // C2 expects long results in G1 we can't tell if we're returning to interpreted - // or compiled so just be safe use G1 and O0/O1 - - // Shift bits into high (msb) of G1 - __ sllx(Otos_l1->after_save(), 32, G1); - // Zero extend low bits - __ srl (Otos_l2->after_save(), 0, Otos_l2->after_save()); - __ or3 (Otos_l2->after_save(), G1, G1); -#endif /* COMPILER2 */ - break; - case T_OBJECT : - __ ld_ptr(O0, 0, O0->after_save()); - __ verify_oop(O0->after_save()); // verify it - break; - default : ShouldNotReachHere(); - } - __ retl(); - __ delayed()->nop(); - return entry; -} - -address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { - // make it look good in the debugger - return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation) + frame::pc_return_offset; -} - -address CppInterpreter::deopt_entry(TosState state, int length) { - address ret = NULL; - if (length != 0) { - switch (state) { - case atos: ret = deopt_frame_manager_return_atos; break; - case btos: ret = deopt_frame_manager_return_btos; break; - case ctos: - case stos: - case itos: ret = deopt_frame_manager_return_itos; break; - case ltos: ret = deopt_frame_manager_return_ltos; break; - case ftos: ret = deopt_frame_manager_return_ftos; break; - case dtos: ret = deopt_frame_manager_return_dtos; break; - case vtos: ret = deopt_frame_manager_return_vtos; break; - } - } else { - ret = unctrap_frame_manager_entry; // re-execute the bytecode ( e.g. uncommon trap) - } - assert(ret != NULL, "Not initialized"); - return ret; -} - -// -// Helpers for commoning out cases in the various type of method entries. -// - -// increment invocation count & check for overflow -// -// Note: checking for negative value instead of overflow -// so we have a 'sticky' overflow test -// -// Lmethod: method -// ??: invocation counter -// -void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) { - Label done; - const Register Rcounters = G3_scratch; - - __ ld_ptr(STATE(_method), G5_method); - __ get_method_counters(G5_method, Rcounters, done); - - // Update standard invocation counters - __ increment_invocation_counter(Rcounters, O0, G4_scratch); - if (ProfileInterpreter) { - Address interpreter_invocation_counter(Rcounters, - in_bytes(MethodCounters::interpreter_invocation_counter_offset())); - __ ld(interpreter_invocation_counter, G4_scratch); - __ inc(G4_scratch); - __ st(G4_scratch, interpreter_invocation_counter); - } - - AddressLiteral invocation_limit((address)&InvocationCounter::InterpreterInvocationLimit); - __ load_contents(invocation_limit, G3_scratch); - __ cmp(O0, G3_scratch); - __ br(Assembler::greaterEqualUnsigned, false, Assembler::pn, *overflow); - __ delayed()->nop(); - __ bind(done); -} - -address InterpreterGenerator::generate_empty_entry(void) { - - // A method that does nothing but return... - - address entry = __ pc(); - Label slow_path; - - // do nothing for empty methods (do not even increment invocation counter) - if ( UseFastEmptyMethods) { - // If we need a safepoint check, generate full interpreter entry. - AddressLiteral sync_state(SafepointSynchronize::address_of_state()); - __ load_contents(sync_state, G3_scratch); - __ cmp(G3_scratch, SafepointSynchronize::_not_synchronized); - __ br(Assembler::notEqual, false, Assembler::pn, frame_manager_entry); - __ delayed()->nop(); - - // Code: _return - __ retl(); - __ delayed()->mov(O5_savedSP, SP); - return entry; - } - return NULL; -} - -address InterpreterGenerator::generate_Reference_get_entry(void) { -#if INCLUDE_ALL_GCS - if (UseG1GC) { - // We need to generate have a routine that generates code to: - // * load the value in the referent field - // * passes that value to the pre-barrier. - // - // In the case of G1 this will record the value of the - // referent in an SATB buffer if marking is active. - // This will cause concurrent marking to mark the referent - // field as live. - Unimplemented(); - } -#endif // INCLUDE_ALL_GCS - - // If G1 is not enabled then attempt to go through the accessor entry point - // Reference.get is an accessor - return NULL; -} - -// -// Interpreter stub for calling a native method. (C++ interpreter) -// This sets up a somewhat different looking stack for calling the native method -// than the typical interpreter frame setup. -// - -address InterpreterGenerator::generate_native_entry(bool synchronized) { - address entry = __ pc(); - - // the following temporary registers are used during frame creation - const Register Gtmp1 = G3_scratch ; - const Register Gtmp2 = G1_scratch; - const Register RconstMethod = Gtmp1; - const Address constMethod(G5_method, in_bytes(Method::const_offset())); - const Address size_of_parameters(RconstMethod, in_bytes(ConstMethod::size_of_parameters_offset())); - - bool inc_counter = UseCompiler || CountCompiledCalls; - - // make sure registers are different! - assert_different_registers(G2_thread, G5_method, Gargs, Gtmp1, Gtmp2); - - const Address access_flags (G5_method, in_bytes(Method::access_flags_offset())); - - Label Lentry; - __ bind(Lentry); - - const Register Glocals_size = G3; - assert_different_registers(Glocals_size, G4_scratch, Gframe_size); - - // make sure method is native & not abstract - // rethink these assertions - they can be simplified and shared (gri 2/25/2000) -#ifdef ASSERT - __ ld(access_flags, Gtmp1); - { - Label L; - __ btst(JVM_ACC_NATIVE, Gtmp1); - __ br(Assembler::notZero, false, Assembler::pt, L); - __ delayed()->nop(); - __ stop("tried to execute non-native method as native"); - __ bind(L); - } - { Label L; - __ btst(JVM_ACC_ABSTRACT, Gtmp1); - __ br(Assembler::zero, false, Assembler::pt, L); - __ delayed()->nop(); - __ stop("tried to execute abstract method as non-abstract"); - __ bind(L); - } -#endif // ASSERT - - __ ld_ptr(constMethod, RconstMethod); - __ lduh(size_of_parameters, Gtmp1); - __ sll(Gtmp1, LogBytesPerWord, Gtmp2); // parameter size in bytes - __ add(Gargs, Gtmp2, Gargs); // points to first local + BytesPerWord - // NEW - __ add(Gargs, -wordSize, Gargs); // points to first local[0] - // generate the code to allocate the interpreter stack frame - // NEW FRAME ALLOCATED HERE - // save callers original sp - // __ mov(SP, I5_savedSP->after_restore()); - - generate_compute_interpreter_state(Lstate, G0, true); - - // At this point Lstate points to new interpreter state - // - - const Address do_not_unlock_if_synchronized(G2_thread, - in_bytes(JavaThread::do_not_unlock_if_synchronized_offset())); - // Since at this point in the method invocation the exception handler - // would try to exit the monitor of synchronized methods which hasn't - // been entered yet, we set the thread local variable - // _do_not_unlock_if_synchronized to true. If any exception was thrown by - // runtime, exception handling i.e. unlock_if_synchronized_method will - // check this thread local flag. - // This flag has two effects, one is to force an unwind in the topmost - // interpreter frame and not perform an unlock while doing so. - - __ movbool(true, G3_scratch); - __ stbool(G3_scratch, do_not_unlock_if_synchronized); - - - // increment invocation counter and check for overflow - // - // Note: checking for negative value instead of overflow - // so we have a 'sticky' overflow test (may be of - // importance as soon as we have true MT/MP) - Label invocation_counter_overflow; - if (inc_counter) { - generate_counter_incr(&invocation_counter_overflow, NULL, NULL); - } - Label Lcontinue; - __ bind(Lcontinue); - - bang_stack_shadow_pages(true); - // reset the _do_not_unlock_if_synchronized flag - __ stbool(G0, do_not_unlock_if_synchronized); - - // check for synchronized methods - // Must happen AFTER invocation_counter check, so method is not locked - // if counter overflows. - - if (synchronized) { - lock_method(); - // Don't see how G2_thread is preserved here... - // __ verify_thread(); QQQ destroys L0,L1 can't use - } else { -#ifdef ASSERT - { Label ok; - __ ld_ptr(STATE(_method), G5_method); - __ ld(access_flags, O0); - __ btst(JVM_ACC_SYNCHRONIZED, O0); - __ br( Assembler::zero, false, Assembler::pt, ok); - __ delayed()->nop(); - __ stop("method needs synchronization"); - __ bind(ok); - } -#endif // ASSERT - } - - // start execution - -// __ verify_thread(); kills L1,L2 can't use at the moment - - // jvmti/jvmpi support - __ notify_method_entry(); - - // native call - - // (note that O0 is never an oop--at most it is a handle) - // It is important not to smash any handles created by this call, - // until any oop handle in O0 is dereferenced. - - // (note that the space for outgoing params is preallocated) - - // get signature handler - - Label pending_exception_present; - - { Label L; - __ ld_ptr(STATE(_method), G5_method); - __ ld_ptr(Address(G5_method, in_bytes(Method::signature_handler_offset())), G3_scratch); - __ tst(G3_scratch); - __ brx(Assembler::notZero, false, Assembler::pt, L); - __ delayed()->nop(); - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), G5_method, false); - __ ld_ptr(STATE(_method), G5_method); - - Address exception_addr(G2_thread, in_bytes(Thread::pending_exception_offset())); - __ ld_ptr(exception_addr, G3_scratch); - __ br_notnull_short(G3_scratch, Assembler::pn, pending_exception_present); - __ ld_ptr(Address(G5_method, in_bytes(Method::signature_handler_offset())), G3_scratch); - __ bind(L); - } - - // Push a new frame so that the args will really be stored in - // Copy a few locals across so the new frame has the variables - // we need but these values will be dead at the jni call and - // therefore not gc volatile like the values in the current - // frame (Lstate in particular) - - // Flush the state pointer to the register save area - // Which is the only register we need for a stack walk. - __ st_ptr(Lstate, SP, (Lstate->sp_offset_in_saved_window() * wordSize) + STACK_BIAS); - - __ mov(Lstate, O1); // Need to pass the state pointer across the frame - - // Calculate current frame size - __ sub(SP, FP, O3); // Calculate negative of current frame size - __ save(SP, O3, SP); // Allocate an identical sized frame - - __ mov(I1, Lstate); // In the "natural" register. - - // Note I7 has leftover trash. Slow signature handler will fill it in - // should we get there. Normal jni call will set reasonable last_Java_pc - // below (and fix I7 so the stack trace doesn't have a meaningless frame - // in it). - - - // call signature handler - __ ld_ptr(STATE(_method), Lmethod); - __ ld_ptr(STATE(_locals), Llocals); - - __ callr(G3_scratch, 0); - __ delayed()->nop(); - __ ld_ptr(STATE(_thread), G2_thread); // restore thread (shouldn't be needed) - - { Label not_static; - - __ ld_ptr(STATE(_method), G5_method); - __ ld(access_flags, O0); - __ btst(JVM_ACC_STATIC, O0); - __ br( Assembler::zero, false, Assembler::pt, not_static); - __ delayed()-> - // get native function entry point(O0 is a good temp until the very end) - ld_ptr(Address(G5_method, in_bytes(Method::native_function_offset())), O0); - // for static methods insert the mirror argument - const int mirror_offset = in_bytes(Klass::java_mirror_offset()); - - __ ld_ptr(Address(G5_method, in_bytes(Method:: const_offset())), O1); - __ ld_ptr(Address(O1, in_bytes(ConstMethod::constants_offset())), O1); - __ ld_ptr(Address(O1, ConstantPool::pool_holder_offset_in_bytes()), O1); - __ ld_ptr(O1, mirror_offset, O1); - // where the mirror handle body is allocated: -#ifdef ASSERT - if (!PrintSignatureHandlers) // do not dirty the output with this - { Label L; - __ tst(O1); - __ brx(Assembler::notZero, false, Assembler::pt, L); - __ delayed()->nop(); - __ stop("mirror is missing"); - __ bind(L); - } -#endif // ASSERT - __ st_ptr(O1, STATE(_oop_temp)); - __ add(STATE(_oop_temp), O1); // this is really an LEA not an add - __ bind(not_static); - } - - // At this point, arguments have been copied off of stack into - // their JNI positions, which are O1..O5 and SP[68..]. - // Oops are boxed in-place on the stack, with handles copied to arguments. - // The result handler is in Lscratch. O0 will shortly hold the JNIEnv*. - -#ifdef ASSERT - { Label L; - __ tst(O0); - __ brx(Assembler::notZero, false, Assembler::pt, L); - __ delayed()->nop(); - __ stop("native entry point is missing"); - __ bind(L); - } -#endif // ASSERT - - // - // setup the java frame anchor - // - // The scavenge function only needs to know that the PC of this frame is - // in the interpreter method entry code, it doesn't need to know the exact - // PC and hence we can use O7 which points to the return address from the - // previous call in the code stream (signature handler function) - // - // The other trick is we set last_Java_sp to FP instead of the usual SP because - // we have pushed the extra frame in order to protect the volatile register(s) - // in that frame when we return from the jni call - // - - - __ set_last_Java_frame(FP, O7); - __ mov(O7, I7); // make dummy interpreter frame look like one above, - // not meaningless information that'll confuse me. - - // flush the windows now. We don't care about the current (protection) frame - // only the outer frames - - __ flushw(); - - // mark windows as flushed - Address flags(G2_thread, - in_bytes(JavaThread::frame_anchor_offset()) + in_bytes(JavaFrameAnchor::flags_offset())); - __ set(JavaFrameAnchor::flushed, G3_scratch); - __ st(G3_scratch, flags); - - // Transition from _thread_in_Java to _thread_in_native. We are already safepoint ready. - - Address thread_state(G2_thread, in_bytes(JavaThread::thread_state_offset())); -#ifdef ASSERT - { Label L; - __ ld(thread_state, G3_scratch); - __ cmp(G3_scratch, _thread_in_Java); - __ br(Assembler::equal, false, Assembler::pt, L); - __ delayed()->nop(); - __ stop("Wrong thread state in native stub"); - __ bind(L); - } -#endif // ASSERT - __ set(_thread_in_native, G3_scratch); - __ st(G3_scratch, thread_state); - - // Call the jni method, using the delay slot to set the JNIEnv* argument. - __ callr(O0, 0); - __ delayed()-> - add(G2_thread, in_bytes(JavaThread::jni_environment_offset()), O0); - __ ld_ptr(STATE(_thread), G2_thread); // restore thread - - // must we block? - - // Block, if necessary, before resuming in _thread_in_Java state. - // In order for GC to work, don't clear the last_Java_sp until after blocking. - { Label no_block; - AddressLiteral sync_state(SafepointSynchronize::address_of_state()); - - // Switch thread to "native transition" state before reading the synchronization state. - // This additional state is necessary because reading and testing the synchronization - // state is not atomic w.r.t. GC, as this scenario demonstrates: - // Java thread A, in _thread_in_native state, loads _not_synchronized and is preempted. - // VM thread changes sync state to synchronizing and suspends threads for GC. - // Thread A is resumed to finish this native method, but doesn't block here since it - // didn't see any synchronization is progress, and escapes. - __ set(_thread_in_native_trans, G3_scratch); - __ st(G3_scratch, thread_state); - if(os::is_MP()) { - // Write serialization page so VM thread can do a pseudo remote membar. - // We use the current thread pointer to calculate a thread specific - // offset to write to within the page. This minimizes bus traffic - // due to cache line collision. - __ serialize_memory(G2_thread, G1_scratch, G3_scratch); - } - __ load_contents(sync_state, G3_scratch); - __ cmp(G3_scratch, SafepointSynchronize::_not_synchronized); - - - Label L; - Address suspend_state(G2_thread, in_bytes(JavaThread::suspend_flags_offset())); - __ br(Assembler::notEqual, false, Assembler::pn, L); - __ delayed()-> - ld(suspend_state, G3_scratch); - __ cmp(G3_scratch, 0); - __ br(Assembler::equal, false, Assembler::pt, no_block); - __ delayed()->nop(); - __ bind(L); - - // Block. Save any potential method result value before the operation and - // use a leaf call to leave the last_Java_frame setup undisturbed. - save_native_result(); - __ call_VM_leaf(noreg, - CAST_FROM_FN_PTR(address, JavaThread::check_safepoint_and_suspend_for_native_trans), - G2_thread); - __ ld_ptr(STATE(_thread), G2_thread); // restore thread - // Restore any method result value - restore_native_result(); - __ bind(no_block); - } - - // Clear the frame anchor now - - __ reset_last_Java_frame(); - - // Move the result handler address - __ mov(Lscratch, G3_scratch); - // return possible result to the outer frame -#ifndef __LP64 - __ mov(O0, I0); - __ restore(O1, G0, O1); -#else - __ restore(O0, G0, O0); -#endif /* __LP64 */ - - // Move result handler to expected register - __ mov(G3_scratch, Lscratch); - - - // thread state is thread_in_native_trans. Any safepoint blocking has - // happened in the trampoline we are ready to switch to thread_in_Java. - - __ set(_thread_in_Java, G3_scratch); - __ st(G3_scratch, thread_state); - - // If we have an oop result store it where it will be safe for any further gc - // until we return now that we've released the handle it might be protected by - - { - Label no_oop, store_result; - - __ set((intptr_t)AbstractInterpreter::result_handler(T_OBJECT), G3_scratch); - __ cmp(G3_scratch, Lscratch); - __ brx(Assembler::notEqual, false, Assembler::pt, no_oop); - __ delayed()->nop(); - __ addcc(G0, O0, O0); - __ brx(Assembler::notZero, true, Assembler::pt, store_result); // if result is not NULL: - __ delayed()->ld_ptr(O0, 0, O0); // unbox it - __ mov(G0, O0); - - __ bind(store_result); - // Store it where gc will look for it and result handler expects it. - __ st_ptr(O0, STATE(_oop_temp)); - - __ bind(no_oop); - - } - - // reset handle block - __ ld_ptr(G2_thread, in_bytes(JavaThread::active_handles_offset()), G3_scratch); - __ st(G0, G3_scratch, JNIHandleBlock::top_offset_in_bytes()); - - - // handle exceptions (exception handling will handle unlocking!) - { Label L; - Address exception_addr (G2_thread, in_bytes(Thread::pending_exception_offset())); - - __ ld_ptr(exception_addr, Gtemp); - __ tst(Gtemp); - __ brx(Assembler::equal, false, Assembler::pt, L); - __ delayed()->nop(); - __ bind(pending_exception_present); - // With c++ interpreter we just leave it pending caller will do the correct thing. However... - // Like x86 we ignore the result of the native call and leave the method locked. This - // seems wrong to leave things locked. - - __ br(Assembler::always, false, Assembler::pt, StubRoutines::forward_exception_entry(), relocInfo::runtime_call_type); - __ delayed()->restore(I5_savedSP, G0, SP); // remove interpreter frame - - __ bind(L); - } - - // jvmdi/jvmpi support (preserves thread register) - __ notify_method_exit(true, ilgl, InterpreterMacroAssembler::NotifyJVMTI); - - if (synchronized) { - // save and restore any potential method result value around the unlocking operation - save_native_result(); - - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - // Get the initial monitor we allocated - __ sub(Lstate, entry_size, O1); // initial monitor - __ unlock_object(O1); - restore_native_result(); - } - -#if defined(COMPILER2) && !defined(_LP64) - - // C2 expects long results in G1 we can't tell if we're returning to interpreted - // or compiled so just be safe. - - __ sllx(O0, 32, G1); // Shift bits into high G1 - __ srl (O1, 0, O1); // Zero extend O1 - __ or3 (O1, G1, G1); // OR 64 bits into G1 - -#endif /* COMPILER2 && !_LP64 */ - -#ifdef ASSERT - { - Label ok; - __ cmp(I5_savedSP, FP); - __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, ok); - __ delayed()->nop(); - __ stop("bad I5_savedSP value"); - __ should_not_reach_here(); - __ bind(ok); - } -#endif - // Calls result handler which POPS FRAME - if (TraceJumps) { - // Move target to register that is recordable - __ mov(Lscratch, G3_scratch); - __ JMP(G3_scratch, 0); - } else { - __ jmp(Lscratch, 0); - } - __ delayed()->nop(); - - if (inc_counter) { - // handle invocation counter overflow - __ bind(invocation_counter_overflow); - generate_counter_overflow(Lcontinue); - } - - - return entry; -} - -void CppInterpreterGenerator::generate_compute_interpreter_state(const Register state, - const Register prev_state, - bool native) { - - // On entry - // G5_method - caller's method - // Gargs - points to initial parameters (i.e. locals[0]) - // G2_thread - valid? (C1 only??) - // "prev_state" - contains any previous frame manager state which we must save a link - // - // On return - // "state" is a pointer to the newly allocated state object. We must allocate and initialize - // a new interpretState object and the method expression stack. - - assert_different_registers(state, prev_state); - assert_different_registers(prev_state, G3_scratch); - const Register Gtmp = G3_scratch; - const Address constMethod (G5_method, in_bytes(Method::const_offset())); - const Address access_flags (G5_method, in_bytes(Method::access_flags_offset())); - - // slop factor is two extra slots on the expression stack so that - // we always have room to store a result when returning from a call without parameters - // that returns a result. - - const int slop_factor = 2*wordSize; - - const int fixed_size = ((sizeof(BytecodeInterpreter) + slop_factor) >> LogBytesPerWord) + // what is the slop factor? - Method::extra_stack_entries() + // extra stack for jsr 292 - frame::memory_parameter_word_sp_offset + // register save area + param window - (native ? frame::interpreter_frame_extra_outgoing_argument_words : 0); // JNI, class - - // XXX G5_method valid - - // Now compute new frame size - - if (native) { - const Register RconstMethod = Gtmp; - const Address size_of_parameters(RconstMethod, in_bytes(ConstMethod::size_of_parameters_offset())); - __ ld_ptr(constMethod, RconstMethod); - __ lduh( size_of_parameters, Gtmp ); - __ calc_mem_param_words(Gtmp, Gtmp); // space for native call parameters passed on the stack in words - } else { - // Full size expression stack - __ ld_ptr(constMethod, Gtmp); - __ lduh(Gtmp, in_bytes(ConstMethod::max_stack_offset()), Gtmp); - } - __ add(Gtmp, fixed_size, Gtmp); // plus the fixed portion - - __ neg(Gtmp); // negative space for stack/parameters in words - __ and3(Gtmp, -WordsPerLong, Gtmp); // make multiple of 2 (SP must be 2-word aligned) - __ sll(Gtmp, LogBytesPerWord, Gtmp); // negative space for frame in bytes - - // Need to do stack size check here before we fault on large frames - - Label stack_ok; - - const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages) ? StackShadowPages : - (StackRedPages+StackYellowPages); - - - __ ld_ptr(G2_thread, in_bytes(Thread::stack_base_offset()), O0); - __ ld_ptr(G2_thread, in_bytes(Thread::stack_size_offset()), O1); - // compute stack bottom - __ sub(O0, O1, O0); - - // Avoid touching the guard pages - // Also a fudge for frame size of BytecodeInterpreter::run - // It varies from 1k->4k depending on build type - const int fudge = 6 * K; - - __ set(fudge + (max_pages * os::vm_page_size()), O1); - - __ add(O0, O1, O0); - __ sub(O0, Gtmp, O0); - __ cmp(SP, O0); - __ brx(Assembler::greaterUnsigned, false, Assembler::pt, stack_ok); - __ delayed()->nop(); - - // throw exception return address becomes throwing pc - - __ call_VM(Oexception, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_StackOverflowError)); - __ stop("never reached"); - - __ bind(stack_ok); - - __ save(SP, Gtmp, SP); // setup new frame and register window - - // New window I7 call_stub or previous activation - // O6 - register save area, BytecodeInterpreter just below it, args/locals just above that - // - __ sub(FP, sizeof(BytecodeInterpreter), state); // Point to new Interpreter state - __ add(state, STACK_BIAS, state ); // Account for 64bit bias - -#define XXX_STATE(field_name) state, in_bytes(byte_offset_of(BytecodeInterpreter, field_name)) - - // Initialize a new Interpreter state - // orig_sp - caller's original sp - // G2_thread - thread - // Gargs - &locals[0] (unbiased?) - // G5_method - method - // SP (biased) - accounts for full size java stack, BytecodeInterpreter object, register save area, and register parameter save window - - - __ set(0xdead0004, O1); - - - __ st_ptr(Gargs, XXX_STATE(_locals)); - __ st_ptr(G0, XXX_STATE(_oop_temp)); - - __ st_ptr(state, XXX_STATE(_self_link)); // point to self - __ st_ptr(prev_state->after_save(), XXX_STATE(_prev_link)); // Chain interpreter states - __ st_ptr(G2_thread, XXX_STATE(_thread)); // Store javathread - - if (native) { - __ st_ptr(G0, XXX_STATE(_bcp)); - } else { - __ ld_ptr(G5_method, in_bytes(Method::const_offset()), O2); // get ConstMethod* - __ add(O2, in_bytes(ConstMethod::codes_offset()), O2); // get bcp - __ st_ptr(O2, XXX_STATE(_bcp)); - } - - __ st_ptr(G0, XXX_STATE(_mdx)); - __ st_ptr(G5_method, XXX_STATE(_method)); - - __ set((int) BytecodeInterpreter::method_entry, O1); - __ st(O1, XXX_STATE(_msg)); - - __ ld_ptr(constMethod, O3); - __ ld_ptr(O3, in_bytes(ConstMethod::constants_offset()), O3); - __ ld_ptr(O3, ConstantPool::cache_offset_in_bytes(), O2); - __ st_ptr(O2, XXX_STATE(_constants)); - - __ st_ptr(G0, XXX_STATE(_result._to_call._callee)); - - // Monitor base is just start of BytecodeInterpreter object; - __ mov(state, O2); - __ st_ptr(O2, XXX_STATE(_monitor_base)); - - // Do we need a monitor for synchonized method? - { - __ ld(access_flags, O1); - Label done; - Label got_obj; - __ btst(JVM_ACC_SYNCHRONIZED, O1); - __ br( Assembler::zero, false, Assembler::pt, done); - - const int mirror_offset = in_bytes(Klass::java_mirror_offset()); - __ delayed()->btst(JVM_ACC_STATIC, O1); - __ ld_ptr(XXX_STATE(_locals), O1); - __ br( Assembler::zero, true, Assembler::pt, got_obj); - __ delayed()->ld_ptr(O1, 0, O1); // get receiver for not-static case - __ ld_ptr(constMethod, O1); - __ ld_ptr( O1, in_bytes(ConstMethod::constants_offset()), O1); - __ ld_ptr( O1, ConstantPool::pool_holder_offset_in_bytes(), O1); - // lock the mirror, not the Klass* - __ ld_ptr( O1, mirror_offset, O1); - - __ bind(got_obj); - - #ifdef ASSERT - __ tst(O1); - __ breakpoint_trap(Assembler::zero, Assembler::ptr_cc); - #endif // ASSERT - - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - __ sub(SP, entry_size, SP); // account for initial monitor - __ sub(O2, entry_size, O2); // initial monitor - __ st_ptr(O1, O2, BasicObjectLock::obj_offset_in_bytes()); // and allocate it for interpreter use - __ bind(done); - } - - // Remember initial frame bottom - - __ st_ptr(SP, XXX_STATE(_frame_bottom)); - - __ st_ptr(O2, XXX_STATE(_stack_base)); - - __ sub(O2, wordSize, O2); // prepush - __ st_ptr(O2, XXX_STATE(_stack)); // PREPUSH - - // Full size expression stack - __ ld_ptr(constMethod, O3); - __ lduh(O3, in_bytes(ConstMethod::max_stack_offset()), O3); - __ inc(O3, Method::extra_stack_entries()); - __ sll(O3, LogBytesPerWord, O3); - __ sub(O2, O3, O3); -// __ sub(O3, wordSize, O3); // so prepush doesn't look out of bounds - __ st_ptr(O3, XXX_STATE(_stack_limit)); - - if (!native) { - // - // Code to initialize locals - // - Register init_value = noreg; // will be G0 if we must clear locals - // Now zero locals - if (true /* zerolocals */ || ClearInterpreterLocals) { - // explicitly initialize locals - init_value = G0; - } else { - #ifdef ASSERT - // initialize locals to a garbage pattern for better debugging - init_value = O3; - __ set( 0x0F0F0F0F, init_value ); - #endif // ASSERT - } - if (init_value != noreg) { - Label clear_loop; - const Register RconstMethod = O1; - const Address size_of_parameters(RconstMethod, in_bytes(ConstMethod::size_of_parameters_offset())); - const Address size_of_locals (RconstMethod, in_bytes(ConstMethod::size_of_locals_offset())); - - // NOTE: If you change the frame layout, this code will need to - // be updated! - __ ld_ptr( constMethod, RconstMethod ); - __ lduh( size_of_locals, O2 ); - __ lduh( size_of_parameters, O1 ); - __ sll( O2, LogBytesPerWord, O2); - __ sll( O1, LogBytesPerWord, O1 ); - __ ld_ptr(XXX_STATE(_locals), L2_scratch); - __ sub( L2_scratch, O2, O2 ); - __ sub( L2_scratch, O1, O1 ); - - __ bind( clear_loop ); - __ inc( O2, wordSize ); - - __ cmp( O2, O1 ); - __ br( Assembler::lessEqualUnsigned, true, Assembler::pt, clear_loop ); - __ delayed()->st_ptr( init_value, O2, 0 ); - } - } -} -// Find preallocated monitor and lock method (C++ interpreter) -// -void CppInterpreterGenerator::lock_method() { -// Lock the current method. -// Destroys registers L2_scratch, L3_scratch, O0 -// -// Find everything relative to Lstate - -#ifdef ASSERT - __ ld_ptr(STATE(_method), L2_scratch); - __ ld(L2_scratch, in_bytes(Method::access_flags_offset()), O0); - - { Label ok; - __ btst(JVM_ACC_SYNCHRONIZED, O0); - __ br( Assembler::notZero, false, Assembler::pt, ok); - __ delayed()->nop(); - __ stop("method doesn't need synchronization"); - __ bind(ok); - } -#endif // ASSERT - - // monitor is already allocated at stack base - // and the lockee is already present - __ ld_ptr(STATE(_stack_base), L2_scratch); - __ ld_ptr(L2_scratch, BasicObjectLock::obj_offset_in_bytes(), O0); // get object - __ lock_object(L2_scratch, O0); - -} - -// Generate code for handling resuming a deopted method -void CppInterpreterGenerator::generate_deopt_handling() { - - Label return_from_deopt_common; - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_atos = __ pc(); - - // O0/O1 live - __ ba(return_from_deopt_common); - __ delayed()->set(AbstractInterpreter::BasicType_as_index(T_OBJECT), L3_scratch); // Result stub address array index - - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_btos = __ pc(); - - // O0/O1 live - __ ba(return_from_deopt_common); - __ delayed()->set(AbstractInterpreter::BasicType_as_index(T_BOOLEAN), L3_scratch); // Result stub address array index - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_itos = __ pc(); - - // O0/O1 live - __ ba(return_from_deopt_common); - __ delayed()->set(AbstractInterpreter::BasicType_as_index(T_INT), L3_scratch); // Result stub address array index - - // deopt needs to jump to here to enter the interpreter (return a result) - - deopt_frame_manager_return_ltos = __ pc(); -#if !defined(_LP64) && defined(COMPILER2) - // All return values are where we want them, except for Longs. C2 returns - // longs in G1 in the 32-bit build whereas the interpreter wants them in O0/O1. - // Since the interpreter will return longs in G1 and O0/O1 in the 32bit - // build even if we are returning from interpreted we just do a little - // stupid shuffing. - // Note: I tried to make c2 return longs in O0/O1 and G1 so we wouldn't have to - // do this here. Unfortunately if we did a rethrow we'd see an machepilog node - // first which would move g1 -> O0/O1 and destroy the exception we were throwing. - - __ srl (G1, 0,O1); - __ srlx(G1,32,O0); -#endif /* !_LP64 && COMPILER2 */ - // O0/O1 live - __ ba(return_from_deopt_common); - __ delayed()->set(AbstractInterpreter::BasicType_as_index(T_LONG), L3_scratch); // Result stub address array index - - // deopt needs to jump to here to enter the interpreter (return a result) - - deopt_frame_manager_return_ftos = __ pc(); - // O0/O1 live - __ ba(return_from_deopt_common); - __ delayed()->set(AbstractInterpreter::BasicType_as_index(T_FLOAT), L3_scratch); // Result stub address array index - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_dtos = __ pc(); - - // O0/O1 live - __ ba(return_from_deopt_common); - __ delayed()->set(AbstractInterpreter::BasicType_as_index(T_DOUBLE), L3_scratch); // Result stub address array index - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_vtos = __ pc(); - - // O0/O1 live - __ set(AbstractInterpreter::BasicType_as_index(T_VOID), L3_scratch); - - // Deopt return common - // an index is present that lets us move any possible result being - // return to the interpreter's stack - // - __ bind(return_from_deopt_common); - - // Result if any is in native abi result (O0..O1/F0..F1). The java expression - // stack is in the state that the calling convention left it. - // Copy the result from native abi result and place it on java expression stack. - - // Current interpreter state is present in Lstate - - // Get current pre-pushed top of interpreter stack - // Any result (if any) is in native abi - // result type index is in L3_scratch - - __ ld_ptr(STATE(_stack), L1_scratch); // get top of java expr stack - - __ set((intptr_t)CppInterpreter::_tosca_to_stack, L4_scratch); - __ sll(L3_scratch, LogBytesPerWord, L3_scratch); - __ ld_ptr(L4_scratch, L3_scratch, Lscratch); // get typed result converter address - __ jmpl(Lscratch, G0, O7); // and convert it - __ delayed()->nop(); - - // L1_scratch points to top of stack (prepushed) - __ st_ptr(L1_scratch, STATE(_stack)); -} - -// Generate the code to handle a more_monitors message from the c++ interpreter -void CppInterpreterGenerator::generate_more_monitors() { - - Label entry, loop; - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - // 1. compute new pointers // esp: old expression stack top - __ delayed()->ld_ptr(STATE(_stack_base), L4_scratch); // current expression stack bottom - __ sub(L4_scratch, entry_size, L4_scratch); - __ st_ptr(L4_scratch, STATE(_stack_base)); - - __ sub(SP, entry_size, SP); // Grow stack - __ st_ptr(SP, STATE(_frame_bottom)); - - __ ld_ptr(STATE(_stack_limit), L2_scratch); - __ sub(L2_scratch, entry_size, L2_scratch); - __ st_ptr(L2_scratch, STATE(_stack_limit)); - - __ ld_ptr(STATE(_stack), L1_scratch); // Get current stack top - __ sub(L1_scratch, entry_size, L1_scratch); - __ st_ptr(L1_scratch, STATE(_stack)); - __ ba(entry); - __ delayed()->add(L1_scratch, wordSize, L1_scratch); // first real entry (undo prepush) - - // 2. move expression stack - - __ bind(loop); - __ st_ptr(L3_scratch, Address(L1_scratch, 0)); - __ add(L1_scratch, wordSize, L1_scratch); - __ bind(entry); - __ cmp(L1_scratch, L4_scratch); - __ br(Assembler::notEqual, false, Assembler::pt, loop); - __ delayed()->ld_ptr(L1_scratch, entry_size, L3_scratch); - - // now zero the slot so we can find it. - __ st_ptr(G0, L4_scratch, BasicObjectLock::obj_offset_in_bytes()); - -} - -// Initial entry to C++ interpreter from the call_stub. -// This entry point is called the frame manager since it handles the generation -// of interpreter activation frames via requests directly from the vm (via call_stub) -// and via requests from the interpreter. The requests from the call_stub happen -// directly thru the entry point. Requests from the interpreter happen via returning -// from the interpreter and examining the message the interpreter has returned to -// the frame manager. The frame manager can take the following requests: - -// NO_REQUEST - error, should never happen. -// MORE_MONITORS - need a new monitor. Shuffle the expression stack on down and -// allocate a new monitor. -// CALL_METHOD - setup a new activation to call a new method. Very similar to what -// happens during entry during the entry via the call stub. -// RETURN_FROM_METHOD - remove an activation. Return to interpreter or call stub. -// -// Arguments: -// -// ebx: Method* -// ecx: receiver - unused (retrieved from stack as needed) -// esi: previous frame manager state (NULL from the call_stub/c1/c2) -// -// -// Stack layout at entry -// -// [ return address ] <--- esp -// [ parameter n ] -// ... -// [ parameter 1 ] -// [ expression stack ] -// -// -// We are free to blow any registers we like because the call_stub which brought us here -// initially has preserved the callee save registers already. -// -// - -static address interpreter_frame_manager = NULL; - -#ifdef ASSERT - #define VALIDATE_STATE(scratch, marker) \ - { \ - Label skip; \ - __ ld_ptr(STATE(_self_link), scratch); \ - __ cmp(Lstate, scratch); \ - __ brx(Assembler::equal, false, Assembler::pt, skip); \ - __ delayed()->nop(); \ - __ breakpoint_trap(); \ - __ emit_int32(marker); \ - __ bind(skip); \ - } -#else - #define VALIDATE_STATE(scratch, marker) -#endif /* ASSERT */ - -void CppInterpreterGenerator::adjust_callers_stack(Register args) { -// -// Adjust caller's stack so that all the locals can be contiguous with -// the parameters. -// Worries about stack overflow make this a pain. -// -// Destroys args, G3_scratch, G3_scratch -// In/Out O5_savedSP (sender's original SP) -// -// assert_different_registers(state, prev_state); - const Register Gtmp = G3_scratch; - const Register RconstMethod = G3_scratch; - const Register tmp = O2; - const Address constMethod(G5_method, in_bytes(Method::const_offset())); - const Address size_of_parameters(RconstMethod, in_bytes(ConstMethod::size_of_parameters_offset())); - const Address size_of_locals (RconstMethod, in_bytes(ConstMethod::size_of_locals_offset())); - - __ ld_ptr(constMethod, RconstMethod); - __ lduh(size_of_parameters, tmp); - __ sll(tmp, LogBytesPerWord, Gargs); // parameter size in bytes - __ add(args, Gargs, Gargs); // points to first local + BytesPerWord - // NEW - __ add(Gargs, -wordSize, Gargs); // points to first local[0] - // determine extra space for non-argument locals & adjust caller's SP - // Gtmp1: parameter size in words - __ lduh(size_of_locals, Gtmp); - __ compute_extra_locals_size_in_bytes(tmp, Gtmp, Gtmp); - -#if 1 - // c2i adapters place the final interpreter argument in the register save area for O0/I0 - // the call_stub will place the final interpreter argument at - // frame::memory_parameter_word_sp_offset. This is mostly not noticable for either asm - // or c++ interpreter. However with the c++ interpreter when we do a recursive call - // and try to make it look good in the debugger we will store the argument to - // RecursiveInterpreterActivation in the register argument save area. Without allocating - // extra space for the compiler this will overwrite locals in the local array of the - // interpreter. - // QQQ still needed with frameless adapters??? - - const int c2i_adjust_words = frame::memory_parameter_word_sp_offset - frame::callee_register_argument_save_area_sp_offset; - - __ add(Gtmp, c2i_adjust_words*wordSize, Gtmp); -#endif // 1 - - - __ sub(SP, Gtmp, SP); // just caller's frame for the additional space we need. -} - -address InterpreterGenerator::generate_normal_entry(bool synchronized) { - - // G5_method: Method* - // G2_thread: thread (unused) - // Gargs: bottom of args (sender_sp) - // O5: sender's sp - - // A single frame manager is plenty as we don't specialize for synchronized. We could and - // the code is pretty much ready. Would need to change the test below and for good measure - // modify generate_interpreter_state to only do the (pre) sync stuff stuff for synchronized - // routines. Not clear this is worth it yet. - - if (interpreter_frame_manager) { - return interpreter_frame_manager; - } - - __ bind(frame_manager_entry); - - // the following temporary registers are used during frame creation - const Register Gtmp1 = G3_scratch; - // const Register Lmirror = L1; // native mirror (native calls only) - - const Address constMethod (G5_method, in_bytes(Method::const_offset())); - const Address access_flags (G5_method, in_bytes(Method::access_flags_offset())); - - address entry_point = __ pc(); - __ mov(G0, prevState); // no current activation - - - Label re_dispatch; - - __ bind(re_dispatch); - - // Interpreter needs to have locals completely contiguous. In order to do that - // We must adjust the caller's stack pointer for any locals beyond just the - // parameters - adjust_callers_stack(Gargs); - - // O5_savedSP still contains sender's sp - - // NEW FRAME - - generate_compute_interpreter_state(Lstate, prevState, false); - - // At this point a new interpreter frame and state object are created and initialized - // Lstate has the pointer to the new activation - // Any stack banging or limit check should already be done. - - Label call_interpreter; - - __ bind(call_interpreter); - - -#if 1 - __ set(0xdead002, Lmirror); - __ set(0xdead002, L2_scratch); - __ set(0xdead003, L3_scratch); - __ set(0xdead004, L4_scratch); - __ set(0xdead005, Lscratch); - __ set(0xdead006, Lscratch2); - __ set(0xdead007, L7_scratch); - - __ set(0xdeaf002, O2); - __ set(0xdeaf003, O3); - __ set(0xdeaf004, O4); - __ set(0xdeaf005, O5); -#endif - - // Call interpreter (stack bang complete) enter here if message is - // set and we know stack size is valid - - Label call_interpreter_2; - - __ bind(call_interpreter_2); - -#ifdef ASSERT - { - Label skip; - __ ld_ptr(STATE(_frame_bottom), G3_scratch); - __ cmp(G3_scratch, SP); - __ brx(Assembler::equal, false, Assembler::pt, skip); - __ delayed()->nop(); - __ stop("SP not restored to frame bottom"); - __ bind(skip); - } -#endif - - VALIDATE_STATE(G3_scratch, 4); - __ set_last_Java_frame(SP, noreg); - __ mov(Lstate, O0); // (arg) pointer to current state - - __ call(CAST_FROM_FN_PTR(address, - JvmtiExport::can_post_interpreter_events() ? - BytecodeInterpreter::runWithChecks - : BytecodeInterpreter::run), - relocInfo::runtime_call_type); - - __ delayed()->nop(); - - __ ld_ptr(STATE(_thread), G2_thread); - __ reset_last_Java_frame(); - - // examine msg from interpreter to determine next action - __ ld_ptr(STATE(_thread), G2_thread); // restore G2_thread - - __ ld(STATE(_msg), L1_scratch); // Get new message - - Label call_method; - Label return_from_interpreted_method; - Label throw_exception; - Label do_OSR; - Label bad_msg; - Label resume_interpreter; - - __ cmp(L1_scratch, (int)BytecodeInterpreter::call_method); - __ br(Assembler::equal, false, Assembler::pt, call_method); - __ delayed()->cmp(L1_scratch, (int)BytecodeInterpreter::return_from_method); - __ br(Assembler::equal, false, Assembler::pt, return_from_interpreted_method); - __ delayed()->cmp(L1_scratch, (int)BytecodeInterpreter::throwing_exception); - __ br(Assembler::equal, false, Assembler::pt, throw_exception); - __ delayed()->cmp(L1_scratch, (int)BytecodeInterpreter::do_osr); - __ br(Assembler::equal, false, Assembler::pt, do_OSR); - __ delayed()->cmp(L1_scratch, (int)BytecodeInterpreter::more_monitors); - __ br(Assembler::notEqual, false, Assembler::pt, bad_msg); - - // Allocate more monitor space, shuffle expression stack.... - - generate_more_monitors(); - - // new monitor slot allocated, resume the interpreter. - - __ set((int)BytecodeInterpreter::got_monitors, L1_scratch); - VALIDATE_STATE(G3_scratch, 5); - __ ba(call_interpreter); - __ delayed()->st(L1_scratch, STATE(_msg)); - - // uncommon trap needs to jump to here to enter the interpreter (re-execute current bytecode) - unctrap_frame_manager_entry = __ pc(); - - // QQQ what message do we send - - __ ba(call_interpreter); - __ delayed()->ld_ptr(STATE(_frame_bottom), SP); // restore to full stack frame - - //============================================================================= - // Returning from a compiled method into a deopted method. The bytecode at the - // bcp has completed. The result of the bytecode is in the native abi (the tosca - // for the template based interpreter). Any stack space that was used by the - // bytecode that has completed has been removed (e.g. parameters for an invoke) - // so all that we have to do is place any pending result on the expression stack - // and resume execution on the next bytecode. - - generate_deopt_handling(); - - // ready to resume the interpreter - - __ set((int)BytecodeInterpreter::deopt_resume, L1_scratch); - __ ba(call_interpreter); - __ delayed()->st(L1_scratch, STATE(_msg)); - - // Current frame has caught an exception we need to dispatch to the - // handler. We can get here because a native interpreter frame caught - // an exception in which case there is no handler and we must rethrow - // If it is a vanilla interpreted frame the we simply drop into the - // interpreter and let it do the lookup. - - Interpreter::_rethrow_exception_entry = __ pc(); - - Label return_with_exception; - Label unwind_and_forward; - - // O0: exception - // O7: throwing pc - - // We want exception in the thread no matter what we ultimately decide about frame type. - - Address exception_addr (G2_thread, in_bytes(Thread::pending_exception_offset())); - __ verify_thread(); - __ st_ptr(O0, exception_addr); - - // get the Method* - __ ld_ptr(STATE(_method), G5_method); - - // if this current frame vanilla or native? - - __ ld(access_flags, Gtmp1); - __ btst(JVM_ACC_NATIVE, Gtmp1); - __ br(Assembler::zero, false, Assembler::pt, return_with_exception); // vanilla interpreted frame handle directly - __ delayed()->nop(); - - // We drop thru to unwind a native interpreted frame with a pending exception - // We jump here for the initial interpreter frame with exception pending - // We unwind the current acivation and forward it to our caller. - - __ bind(unwind_and_forward); - - // Unwind frame and jump to forward exception. unwinding will place throwing pc in O7 - // as expected by forward_exception. - - __ restore(FP, G0, SP); // unwind interpreter state frame - __ br(Assembler::always, false, Assembler::pt, StubRoutines::forward_exception_entry(), relocInfo::runtime_call_type); - __ delayed()->mov(I5_savedSP->after_restore(), SP); - - // Return point from a call which returns a result in the native abi - // (c1/c2/jni-native). This result must be processed onto the java - // expression stack. - // - // A pending exception may be present in which case there is no result present - - address return_from_native_method = __ pc(); - - VALIDATE_STATE(G3_scratch, 6); - - // Result if any is in native abi result (O0..O1/F0..F1). The java expression - // stack is in the state that the calling convention left it. - // Copy the result from native abi result and place it on java expression stack. - - // Current interpreter state is present in Lstate - - // Exception pending? - - __ ld_ptr(STATE(_frame_bottom), SP); // restore to full stack frame - __ ld_ptr(exception_addr, Lscratch); // get any pending exception - __ tst(Lscratch); // exception pending? - __ brx(Assembler::notZero, false, Assembler::pt, return_with_exception); - __ delayed()->nop(); - - // Process the native abi result to java expression stack - - __ ld_ptr(STATE(_result._to_call._callee), L4_scratch); // called method - __ ld_ptr(STATE(_stack), L1_scratch); // get top of java expr stack - // get parameter size - __ ld_ptr(L4_scratch, in_bytes(Method::const_offset()), L2_scratch); - __ lduh(L2_scratch, in_bytes(ConstMethod::size_of_parameters_offset()), L2_scratch); - __ sll(L2_scratch, LogBytesPerWord, L2_scratch ); // parameter size in bytes - __ add(L1_scratch, L2_scratch, L1_scratch); // stack destination for result - __ ld(L4_scratch, in_bytes(Method::result_index_offset()), L3_scratch); // called method result type index - - // tosca is really just native abi - __ set((intptr_t)CppInterpreter::_tosca_to_stack, L4_scratch); - __ sll(L3_scratch, LogBytesPerWord, L3_scratch); - __ ld_ptr(L4_scratch, L3_scratch, Lscratch); // get typed result converter address - __ jmpl(Lscratch, G0, O7); // and convert it - __ delayed()->nop(); - - // L1_scratch points to top of stack (prepushed) - - __ ba(resume_interpreter); - __ delayed()->mov(L1_scratch, O1); - - // An exception is being caught on return to a vanilla interpreter frame. - // Empty the stack and resume interpreter - - __ bind(return_with_exception); - - __ ld_ptr(STATE(_frame_bottom), SP); // restore to full stack frame - __ ld_ptr(STATE(_stack_base), O1); // empty java expression stack - __ ba(resume_interpreter); - __ delayed()->sub(O1, wordSize, O1); // account for prepush - - // Return from interpreted method we return result appropriate to the caller (i.e. "recursive" - // interpreter call, or native) and unwind this interpreter activation. - // All monitors should be unlocked. - - __ bind(return_from_interpreted_method); - - VALIDATE_STATE(G3_scratch, 7); - - Label return_to_initial_caller; - - // Interpreted result is on the top of the completed activation expression stack. - // We must return it to the top of the callers stack if caller was interpreted - // otherwise we convert to native abi result and return to call_stub/c1/c2 - // The caller's expression stack was truncated by the call however the current activation - // has enough stuff on the stack that we have usable space there no matter what. The - // other thing that makes it easy is that the top of the caller's stack is stored in STATE(_locals) - // for the current activation - - __ ld_ptr(STATE(_prev_link), L1_scratch); - __ ld_ptr(STATE(_method), L2_scratch); // get method just executed - __ ld(L2_scratch, in_bytes(Method::result_index_offset()), L2_scratch); - __ tst(L1_scratch); - __ brx(Assembler::zero, false, Assembler::pt, return_to_initial_caller); - __ delayed()->sll(L2_scratch, LogBytesPerWord, L2_scratch); - - // Copy result to callers java stack - - __ set((intptr_t)CppInterpreter::_stack_to_stack, L4_scratch); - __ ld_ptr(L4_scratch, L2_scratch, Lscratch); // get typed result converter address - __ ld_ptr(STATE(_stack), O0); // current top (prepushed) - __ ld_ptr(STATE(_locals), O1); // stack destination - - // O0 - will be source, O1 - will be destination (preserved) - __ jmpl(Lscratch, G0, O7); // and convert it - __ delayed()->add(O0, wordSize, O0); // get source (top of current expr stack) - - // O1 == &locals[0] - - // Result is now on caller's stack. Just unwind current activation and resume - - Label unwind_recursive_activation; - - - __ bind(unwind_recursive_activation); - - // O1 == &locals[0] (really callers stacktop) for activation now returning - // returning to interpreter method from "recursive" interpreter call - // result converter left O1 pointing to top of the( prepushed) java stack for method we are returning - // to. Now all we must do is unwind the state from the completed call - - // Must restore stack - VALIDATE_STATE(G3_scratch, 8); - - // Return to interpreter method after a method call (interpreted/native/c1/c2) has completed. - // Result if any is already on the caller's stack. All we must do now is remove the now dead - // frame and tell interpreter to resume. - - - __ mov(O1, I1); // pass back new stack top across activation - // POP FRAME HERE ================================== - __ restore(FP, G0, SP); // unwind interpreter state frame - __ ld_ptr(STATE(_frame_bottom), SP); // restore to full stack frame - - - // Resume the interpreter. The current frame contains the current interpreter - // state object. - // - // O1 == new java stack pointer - - __ bind(resume_interpreter); - VALIDATE_STATE(G3_scratch, 10); - - // A frame we have already used before so no need to bang stack so use call_interpreter_2 entry - - __ set((int)BytecodeInterpreter::method_resume, L1_scratch); - __ st(L1_scratch, STATE(_msg)); - __ ba(call_interpreter_2); - __ delayed()->st_ptr(O1, STATE(_stack)); - - // interpreter returning to native code (call_stub/c1/c2) - // convert result and unwind initial activation - // L2_scratch - scaled result type index - - __ bind(return_to_initial_caller); - - __ set((intptr_t)CppInterpreter::_stack_to_native_abi, L4_scratch); - __ ld_ptr(L4_scratch, L2_scratch, Lscratch); // get typed result converter address - __ ld_ptr(STATE(_stack), O0); // current top (prepushed) - __ jmpl(Lscratch, G0, O7); // and convert it - __ delayed()->add(O0, wordSize, O0); // get source (top of current expr stack) - - Label unwind_initial_activation; - __ bind(unwind_initial_activation); - - // RETURN TO CALL_STUB/C1/C2 code (result if any in I0..I1/(F0/..F1) - // we can return here with an exception that wasn't handled by interpreted code - // how does c1/c2 see it on return? - - // compute resulting sp before/after args popped depending upon calling convention - // __ ld_ptr(STATE(_saved_sp), Gtmp1); - // - // POP FRAME HERE ================================== - __ restore(FP, G0, SP); - __ retl(); - __ delayed()->mov(I5_savedSP->after_restore(), SP); - - // OSR request, unwind the current frame and transfer to the OSR entry - // and enter OSR nmethod - - __ bind(do_OSR); - Label remove_initial_frame; - __ ld_ptr(STATE(_prev_link), L1_scratch); - __ ld_ptr(STATE(_result._osr._osr_buf), G1_scratch); - - // We are going to pop this frame. Is there another interpreter frame underneath - // it or is it callstub/compiled? - - __ tst(L1_scratch); - __ brx(Assembler::zero, false, Assembler::pt, remove_initial_frame); - __ delayed()->ld_ptr(STATE(_result._osr._osr_entry), G3_scratch); - - // Frame underneath is an interpreter frame simply unwind - // POP FRAME HERE ================================== - __ restore(FP, G0, SP); // unwind interpreter state frame - __ mov(I5_savedSP->after_restore(), SP); - - // Since we are now calling native need to change our "return address" from the - // dummy RecursiveInterpreterActivation to a return from native - - __ set((intptr_t)return_from_native_method - 8, O7); - - __ jmpl(G3_scratch, G0, G0); - __ delayed()->mov(G1_scratch, O0); - - __ bind(remove_initial_frame); - - // POP FRAME HERE ================================== - __ restore(FP, G0, SP); - __ mov(I5_savedSP->after_restore(), SP); - __ jmpl(G3_scratch, G0, G0); - __ delayed()->mov(G1_scratch, O0); - - // Call a new method. All we do is (temporarily) trim the expression stack - // push a return address to bring us back to here and leap to the new entry. - // At this point we have a topmost frame that was allocated by the frame manager - // which contains the current method interpreted state. We trim this frame - // of excess java expression stack entries and then recurse. - - __ bind(call_method); - - // stack points to next free location and not top element on expression stack - // method expects sp to be pointing to topmost element - - __ ld_ptr(STATE(_thread), G2_thread); - __ ld_ptr(STATE(_result._to_call._callee), G5_method); - - - // SP already takes in to account the 2 extra words we use for slop - // when we call a "static long no_params()" method. So if - // we trim back sp by the amount of unused java expression stack - // there will be automagically the 2 extra words we need. - // We also have to worry about keeping SP aligned. - - __ ld_ptr(STATE(_stack), Gargs); - __ ld_ptr(STATE(_stack_limit), L1_scratch); - - // compute the unused java stack size - __ sub(Gargs, L1_scratch, L2_scratch); // compute unused space - - // Round down the unused space to that stack is always 16-byte aligned - // by making the unused space a multiple of the size of two longs. - - __ and3(L2_scratch, -2*BytesPerLong, L2_scratch); - - // Now trim the stack - __ add(SP, L2_scratch, SP); - - - // Now point to the final argument (account for prepush) - __ add(Gargs, wordSize, Gargs); -#ifdef ASSERT - // Make sure we have space for the window - __ sub(Gargs, SP, L1_scratch); - __ cmp(L1_scratch, 16*wordSize); - { - Label skip; - __ brx(Assembler::greaterEqual, false, Assembler::pt, skip); - __ delayed()->nop(); - __ stop("killed stack"); - __ bind(skip); - } -#endif // ASSERT - - // Create a new frame where we can store values that make it look like the interpreter - // really recursed. - - // prepare to recurse or call specialized entry - - // First link the registers we need - - // make the pc look good in debugger - __ set(CAST_FROM_FN_PTR(intptr_t, RecursiveInterpreterActivation), O7); - // argument too - __ mov(Lstate, I0); - - // Record our sending SP - __ mov(SP, O5_savedSP); - - __ ld_ptr(STATE(_result._to_call._callee_entry_point), L2_scratch); - __ set((intptr_t) entry_point, L1_scratch); - __ cmp(L1_scratch, L2_scratch); - __ brx(Assembler::equal, false, Assembler::pt, re_dispatch); - __ delayed()->mov(Lstate, prevState); // link activations - - // method uses specialized entry, push a return so we look like call stub setup - // this path will handle fact that result is returned in registers and not - // on the java stack. - - __ set((intptr_t)return_from_native_method - 8, O7); - __ jmpl(L2_scratch, G0, G0); // Do specialized entry - __ delayed()->nop(); - - // - // Bad Message from interpreter - // - __ bind(bad_msg); - __ stop("Bad message from interpreter"); - - // Interpreted method "returned" with an exception pass it on... - // Pass result, unwind activation and continue/return to interpreter/call_stub - // We handle result (if any) differently based on return to interpreter or call_stub - - __ bind(throw_exception); - __ ld_ptr(STATE(_prev_link), L1_scratch); - __ tst(L1_scratch); - __ brx(Assembler::zero, false, Assembler::pt, unwind_and_forward); - __ delayed()->nop(); - - __ ld_ptr(STATE(_locals), O1); // get result of popping callee's args - __ ba(unwind_recursive_activation); - __ delayed()->nop(); - - interpreter_frame_manager = entry_point; - return entry_point; -} - -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : CppInterpreterGenerator(code) { - generate_all(); // down here so it can be "virtual" -} - - -static int size_activation_helper(int callee_extra_locals, int max_stack, int monitor_size) { - - // Figure out the size of an interpreter frame (in words) given that we have a fully allocated - // expression stack, the callee will have callee_extra_locals (so we can account for - // frame extension) and monitor_size for monitors. Basically we need to calculate - // this exactly like generate_fixed_frame/generate_compute_interpreter_state. - // - // - // The big complicating thing here is that we must ensure that the stack stays properly - // aligned. This would be even uglier if monitor size wasn't modulo what the stack - // needs to be aligned for). We are given that the sp (fp) is already aligned by - // the caller so we must ensure that it is properly aligned for our callee. - // - // Ths c++ interpreter always makes sure that we have a enough extra space on the - // stack at all times to deal with the "stack long no_params()" method issue. This - // is "slop_factor" here. - const int slop_factor = 2; - - const int fixed_size = sizeof(BytecodeInterpreter)/wordSize + // interpreter state object - frame::memory_parameter_word_sp_offset; // register save area + param window - return (round_to(max_stack + - slop_factor + - fixed_size + - monitor_size + - (callee_extra_locals * Interpreter::stackElementWords), WordsPerLong)); - -} - -int AbstractInterpreter::size_top_interpreter_activation(Method* method) { - - // See call_stub code - int call_stub_size = round_to(7 + frame::memory_parameter_word_sp_offset, - WordsPerLong); // 7 + register save area - - // Save space for one monitor to get into the interpreted method in case - // the method is synchronized - int monitor_size = method->is_synchronized() ? - 1*frame::interpreter_frame_monitor_size() : 0; - return size_activation_helper(method->max_locals(), method->max_stack(), - monitor_size) + call_stub_size; -} - -void BytecodeInterpreter::layout_interpreterState(interpreterState to_fill, - frame* caller, - frame* current, - Method* method, - intptr_t* locals, - intptr_t* stack, - intptr_t* stack_base, - intptr_t* monitor_base, - intptr_t* frame_bottom, - bool is_top_frame - ) -{ - // What about any vtable? - // - to_fill->_thread = JavaThread::current(); - // This gets filled in later but make it something recognizable for now - to_fill->_bcp = method->code_base(); - to_fill->_locals = locals; - to_fill->_constants = method->constants()->cache(); - to_fill->_method = method; - to_fill->_mdx = NULL; - to_fill->_stack = stack; - if (is_top_frame && JavaThread::current()->popframe_forcing_deopt_reexecution() ) { - to_fill->_msg = deopt_resume2; - } else { - to_fill->_msg = method_resume; - } - to_fill->_result._to_call._bcp_advance = 0; - to_fill->_result._to_call._callee_entry_point = NULL; // doesn't matter to anyone - to_fill->_result._to_call._callee = NULL; // doesn't matter to anyone - to_fill->_prev_link = NULL; - - // Fill in the registers for the frame - - // Need to install _sender_sp. Actually not too hard in C++! - // When the skeletal frames are layed out we fill in a value - // for _sender_sp. That value is only correct for the oldest - // skeletal frame constructed (because there is only a single - // entry for "caller_adjustment". While the skeletal frames - // exist that is good enough. We correct that calculation - // here and get all the frames correct. - - // to_fill->_sender_sp = locals - (method->size_of_parameters() - 1); - - *current->register_addr(Lstate) = (intptr_t) to_fill; - // skeletal already places a useful value here and this doesn't account - // for alignment so don't bother. - // *current->register_addr(I5_savedSP) = (intptr_t) locals - (method->size_of_parameters() - 1); - - if (caller->is_interpreted_frame()) { - interpreterState prev = caller->get_interpreterState(); - to_fill->_prev_link = prev; - // Make the prev callee look proper - prev->_result._to_call._callee = method; - if (*prev->_bcp == Bytecodes::_invokeinterface) { - prev->_result._to_call._bcp_advance = 5; - } else { - prev->_result._to_call._bcp_advance = 3; - } - } - to_fill->_oop_temp = NULL; - to_fill->_stack_base = stack_base; - // Need +1 here because stack_base points to the word just above the first expr stack entry - // and stack_limit is supposed to point to the word just below the last expr stack entry. - // See generate_compute_interpreter_state. - to_fill->_stack_limit = stack_base - (method->max_stack() + 1); - to_fill->_monitor_base = (BasicObjectLock*) monitor_base; - - // sparc specific - to_fill->_frame_bottom = frame_bottom; - to_fill->_self_link = to_fill; -#ifdef ASSERT - to_fill->_native_fresult = 123456.789; - to_fill->_native_lresult = CONST64(0xdeadcafedeafcafe); -#endif -} - -void BytecodeInterpreter::pd_layout_interpreterState(interpreterState istate, address last_Java_pc, intptr_t* last_Java_fp) { - istate->_last_Java_pc = (intptr_t*) last_Java_pc; -} - -static int frame_size_helper(int max_stack, - int moncount, - int callee_param_size, - int callee_locals_size, - bool is_top_frame, - int& monitor_size, - int& full_frame_words) { - int extra_locals_size = callee_locals_size - callee_param_size; - monitor_size = (sizeof(BasicObjectLock) * moncount) / wordSize; - full_frame_words = size_activation_helper(extra_locals_size, max_stack, monitor_size); - int short_frame_words = size_activation_helper(extra_locals_size, max_stack, monitor_size); - int frame_words = is_top_frame ? full_frame_words : short_frame_words; - - return frame_words; -} - -int AbstractInterpreter::size_activation(int max_stack, - int tempcount, - int extra_args, - int moncount, - int callee_param_size, - int callee_locals_size, - bool is_top_frame) { - assert(extra_args == 0, "NEED TO FIX"); - // NOTE: return size is in words not bytes - // Calculate the amount our frame will be adjust by the callee. For top frame - // this is zero. - - // NOTE: ia64 seems to do this wrong (or at least backwards) in that it - // calculates the extra locals based on itself. Not what the callee does - // to it. So it ignores last_frame_adjust value. Seems suspicious as far - // as getting sender_sp correct. - - int unused_monitor_size = 0; - int unused_full_frame_words = 0; - return frame_size_helper(max_stack, moncount, callee_param_size, callee_locals_size, is_top_frame, - unused_monitor_size, unused_full_frame_words); -} -void AbstractInterpreter::layout_activation(Method* method, - int tempcount, // Number of slots on java expression stack in use - int popframe_extra_args, - int moncount, // Number of active monitors - int caller_actual_parameters, - int callee_param_size, - int callee_locals_size, - frame* caller, - frame* interpreter_frame, - bool is_top_frame, - bool is_bottom_frame) { - assert(popframe_extra_args == 0, "NEED TO FIX"); - // NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state() - // does as far as allocating an interpreter frame. - // Set up the method, locals, and monitors. - // The frame interpreter_frame is guaranteed to be the right size, - // as determined by a previous call to the size_activation() method. - // It is also guaranteed to be walkable even though it is in a skeletal state - // NOTE: tempcount is the current size of the java expression stack. For top most - // frames we will allocate a full sized expression stack and not the curback - // version that non-top frames have. - - int monitor_size = 0; - int full_frame_words = 0; - int frame_words = frame_size_helper(method->max_stack(), moncount, callee_param_size, callee_locals_size, - is_top_frame, monitor_size, full_frame_words); - - /* - We must now fill in all the pieces of the frame. This means both - the interpreterState and the registers. - */ - - // MUCHO HACK - - intptr_t* frame_bottom = interpreter_frame->sp() - (full_frame_words - frame_words); - // 'interpreter_frame->sp()' is unbiased while 'frame_bottom' must be a biased value in 64bit mode. - assert(((intptr_t)frame_bottom & 0xf) == 0, "SP biased in layout_activation"); - frame_bottom = (intptr_t*)((intptr_t)frame_bottom - STACK_BIAS); - - /* Now fillin the interpreterState object */ - - interpreterState cur_state = (interpreterState) ((intptr_t)interpreter_frame->fp() - sizeof(BytecodeInterpreter)); - - - intptr_t* locals; - - // Calculate the postion of locals[0]. This is painful because of - // stack alignment (same as ia64). The problem is that we can - // not compute the location of locals from fp(). fp() will account - // for the extra locals but it also accounts for aligning the stack - // and we can't determine if the locals[0] was misaligned but max_locals - // was enough to have the - // calculate postion of locals. fp already accounts for extra locals. - // +2 for the static long no_params() issue. - - if (caller->is_interpreted_frame()) { - // locals must agree with the caller because it will be used to set the - // caller's tos when we return. - interpreterState prev = caller->get_interpreterState(); - // stack() is prepushed. - locals = prev->stack() + method->size_of_parameters(); - } else { - // Lay out locals block in the caller adjacent to the register window save area. - // - // Compiled frames do not allocate a varargs area which is why this if - // statement is needed. - // - intptr_t* fp = interpreter_frame->fp(); - int local_words = method->max_locals() * Interpreter::stackElementWords; - - if (caller->is_compiled_frame()) { - locals = fp + frame::register_save_words + local_words - 1; - } else { - locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1; - } - - } - // END MUCHO HACK - - intptr_t* monitor_base = (intptr_t*) cur_state; - intptr_t* stack_base = monitor_base - monitor_size; - /* +1 because stack is always prepushed */ - intptr_t* stack = stack_base - (tempcount + 1); - - - BytecodeInterpreter::layout_interpreterState(cur_state, - caller, - interpreter_frame, - method, - locals, - stack, - stack_base, - monitor_base, - frame_bottom, - is_top_frame); - - BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address, interpreter_frame->fp()); -} - -#endif // CC_INTERP diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp deleted file mode 100644 index 3d613f36a02..00000000000 --- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP -#define CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP - - // Size of interpreter code. Increase if too small. Interpreter will - // fail with a guarantee ("not enough space for interpreter generation"); - // if too small. - // Run with +PrintInterpreter to get the VM to print out the size. - // Max size with JVMTI - - // QQQ this is proably way too large for c++ interpreter - -#ifdef _LP64 - // The sethi() instruction generates lots more instructions when shell - // stack limit is unlimited, so that's why this is much bigger. - const static int InterpreterCodeSize = 210 * K; -#else - const static int InterpreterCodeSize = 180 * K; -#endif - -#endif // CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp index 6ee253c4d0b..a9ac2a97a76 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp @@ -441,12 +441,10 @@ intptr_t* frame::interpreter_frame_sender_sp() const { return fp(); } -#ifndef CC_INTERP void frame::set_interpreter_frame_sender_sp(intptr_t* sender_sp) { assert(is_interpreted_frame(), "interpreted frame expected"); Unimplemented(); } -#endif // CC_INTERP frame frame::sender_for_entry_frame(RegisterMap *map) const { assert(map != NULL, "map must be set"); @@ -600,9 +598,6 @@ bool frame::is_valid_stack_pointer(intptr_t* valid_sp, intptr_t* sp) { } bool frame::is_interpreted_frame_valid(JavaThread* thread) const { -#ifdef CC_INTERP - // Is there anything to do? -#else assert(is_interpreted_frame(), "Not an interpreted frame"); // These are reasonable sanity checks if (fp() == 0 || (intptr_t(fp()) & (2*wordSize-1)) != 0) { @@ -654,7 +649,6 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { if (locals > thread->stack_base() || locals < (address) fp()) return false; // We'd have to be pretty unlucky to be mislead at this point -#endif /* CC_INTERP */ return true; } @@ -712,14 +706,8 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) // Prior to notifying the runtime of the method_exit the possible result // value is saved to l_scratch and d_scratch. -#ifdef CC_INTERP - interpreterState istate = get_interpreterState(); - intptr_t* l_scratch = (intptr_t*) &istate->_native_lresult; - intptr_t* d_scratch = (intptr_t*) &istate->_native_fresult; -#else /* CC_INTERP */ intptr_t* l_scratch = fp() + interpreter_frame_l_scratch_fp_offset; intptr_t* d_scratch = fp() + interpreter_frame_d_scratch_fp_offset; -#endif /* CC_INTERP */ address l_addr = (address)l_scratch; #ifdef _LP64 @@ -731,13 +719,9 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) switch (type) { case T_OBJECT: case T_ARRAY: { -#ifdef CC_INTERP - *oop_result = istate->_oop_temp; -#else oop obj = cast_to_oop(at(interpreter_frame_oop_temp_offset)); assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check"); *oop_result = obj; -#endif // CC_INTERP break; } @@ -797,7 +781,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) { } if (is_interpreted_frame()) { -#ifndef CC_INTERP DESCRIBE_FP_OFFSET(interpreter_frame_d_scratch_fp); DESCRIBE_FP_OFFSET(interpreter_frame_l_scratch_fp); DESCRIBE_FP_OFFSET(interpreter_frame_padding); @@ -808,7 +791,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) { if ((esp >= sp()) && (esp < fp())) { values.describe(-1, esp, "*Lesp"); } -#endif } if (!is_compiled_frame()) { diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp index 4cc5c429fa0..5de8ad4bf1d 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp @@ -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 @@ -90,11 +90,6 @@ // G5_method is set to method to call, G5_inline_cache_klass may be set, // parameters are put in O registers, and also extra parameters // must be cleverly copied from the top of stack to the outgoing param area in the frame, -// ------------------------------ C++ interpreter ---------------------------------------- -// Layout of C++ interpreter frame: -// - - // All frames: @@ -211,7 +206,6 @@ public: // Asm interpreter -#ifndef CC_INTERP enum interpreter_frame_vm_locals { // 2 words, also used to save float regs across calls to C interpreter_frame_d_scratch_fp_offset = -2, @@ -228,18 +222,6 @@ interpreter_frame_extra_outgoing_argument_words = 2 }; -#else - enum interpreter_frame_vm_locals { - // 2 words, also used to save float regs across calls to C - interpreter_state_ptr_offset = 0, // Is in L0 (Lstate) in save area - interpreter_frame_mirror_offset = 1, // Is in L1 (Lmirror) in save area (for native calls only) - - // interpreter frame set-up needs to save 2 extra words in outgoing param area - // for class and jnienv arguments for native stubs (see nativeStubGen_sparc.cpp_ - - interpreter_frame_extra_outgoing_argument_words = 2 - }; -#endif /* CC_INTERP */ enum compiler_frame_fixed_locals { compiler_frame_vm_locals_fp_offset = -2 @@ -248,8 +230,6 @@ private: ConstantPoolCache** interpreter_frame_cpoolcache_addr() const; -#ifndef CC_INTERP - // where Lmonitors is saved: inline BasicObjectLock** interpreter_frame_monitors_addr() const; inline intptr_t** interpreter_frame_esp_addr() const; @@ -262,14 +242,6 @@ private: BasicObjectLock* interpreter_frame_monitors() const; void interpreter_frame_set_monitors(BasicObjectLock* monitors); -#else - public: - inline interpreterState get_interpreterState() const { - return ((interpreterState)sp_at(interpreter_state_ptr_offset)); - } - -#endif /* CC_INTERP */ - public: #endif // CPU_SPARC_VM_FRAME_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp index 2649b6da872..01e24727863 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp @@ -91,75 +91,6 @@ inline int frame::pd_oop_map_offset_adjustment() const { return _sp_adjustment_by_callee * VMRegImpl::slots_per_word; } -#ifdef CC_INTERP -inline intptr_t** frame::interpreter_frame_locals_addr() const { - interpreterState istate = get_interpreterState(); - return (intptr_t**) &istate->_locals; -} - -inline intptr_t* frame::interpreter_frame_bcp_addr() const { - interpreterState istate = get_interpreterState(); - return (intptr_t*) &istate->_bcp; -} - -inline intptr_t* frame::interpreter_frame_mdp_addr() const { - interpreterState istate = get_interpreterState(); - return (intptr_t*) &istate->_mdx; -} - -inline jint frame::interpreter_frame_expression_stack_direction() { return -1; } - -// bottom(base) of the expression stack (highest address) -inline intptr_t* frame::interpreter_frame_expression_stack() const { - return (intptr_t*)interpreter_frame_monitor_end() - 1; -} - -// top of expression stack (lowest address) -inline intptr_t* frame::interpreter_frame_tos_address() const { - interpreterState istate = get_interpreterState(); - return istate->_stack + 1; // Is this off by one? QQQ -} - -// monitor elements - -// in keeping with Intel side: end is lower in memory than begin; -// and beginning element is oldest element -// Also begin is one past last monitor. - -inline BasicObjectLock* frame::interpreter_frame_monitor_begin() const { - return get_interpreterState()->monitor_base(); -} - -inline BasicObjectLock* frame::interpreter_frame_monitor_end() const { - return (BasicObjectLock*) get_interpreterState()->stack_base(); -} - - -inline int frame::interpreter_frame_monitor_size() { - return round_to(BasicObjectLock::size(), WordsPerLong); -} - -inline Method** frame::interpreter_frame_method_addr() const { - interpreterState istate = get_interpreterState(); - return &istate->_method; -} - - -// Constant pool cache - -// where LcpoolCache is saved: -inline ConstantPoolCache** frame::interpreter_frame_cpoolcache_addr() const { - interpreterState istate = get_interpreterState(); - return &istate->_constants; // should really use accessor - } - -inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const { - interpreterState istate = get_interpreterState(); - return &istate->_constants; -} - -#else // !CC_INTERP - inline intptr_t** frame::interpreter_frame_locals_addr() const { return (intptr_t**) sp_addr_at( Llocals->sp_offset_in_saved_window()); } @@ -246,7 +177,6 @@ inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const { inline oop* frame::interpreter_frame_temp_oop_addr() const { return (oop *)(fp() + interpreter_frame_oop_temp_offset); } -#endif // CC_INTERP inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const { diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp index 1e8d36fbb88..4e0b6d504f6 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp @@ -39,7 +39,6 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/thread.inline.hpp" -#ifndef CC_INTERP #ifndef FAST_DISPATCH #define FAST_DISPATCH 1 #endif @@ -52,13 +51,6 @@ const Address InterpreterMacroAssembler::l_tmp(FP, (frame::interpreter_frame_l_scratch_fp_offset * wordSize) + STACK_BIAS); const Address InterpreterMacroAssembler::d_tmp(FP, (frame::interpreter_frame_d_scratch_fp_offset * wordSize) + STACK_BIAS); -#else // CC_INTERP -#ifndef STATE -#define STATE(field_name) Lstate, in_bytes(byte_offset_of(BytecodeInterpreter, field_name)) -#endif // STATE - -#endif // CC_INTERP - void InterpreterMacroAssembler::jump_to_entry(address entry) { assert(entry, "Entry must have been generated by now"); AddressLiteral al(entry); @@ -82,8 +74,6 @@ void InterpreterMacroAssembler::compute_extra_locals_size_in_bytes(Register args sll(delta, LogBytesPerWord, delta); // extra space for locals in bytes } -#ifndef CC_INTERP - // Dispatch code executed in the prolog of a bytecode which does not do it's // own dispatch. The dispatch address is computed and placed in IdispatchAddress void InterpreterMacroAssembler::dispatch_prolog(TosState state, int bcp_incr) { @@ -265,10 +255,6 @@ void InterpreterMacroAssembler::super_call_VM_leaf(Register thread_cache, addres mov(arg_2, O1); MacroAssembler::call_VM_leaf_base(thread_cache, entry_point, 2); } -#endif /* CC_INTERP */ - - -#ifndef CC_INTERP void InterpreterMacroAssembler::dispatch_base(TosState state, address* table) { assert_not_delayed(); @@ -1189,8 +1175,6 @@ void InterpreterMacroAssembler::remove_activation(TosState state, #endif /* COMPILER2 */ } -#endif /* CC_INTERP */ - // Lock object // @@ -1323,8 +1307,6 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) { } } -#ifndef CC_INTERP - // Get the method data pointer from the Method* and set the // specified register to its value. @@ -2366,8 +2348,6 @@ void InterpreterMacroAssembler::compute_stack_base( Register Rdest ) { add( Lesp, wordSize, Rdest ); } -#endif /* CC_INTERP */ - void InterpreterMacroAssembler::get_method_counters(Register method, Register Rcounters, Label& skip) { @@ -2443,7 +2423,6 @@ void InterpreterMacroAssembler::increment_backedge_counter( Register Rcounters, // Note that this macro must leave backedge_count + invocation_count in Rtmp! } -#ifndef CC_INTERP void InterpreterMacroAssembler::test_backedge_count_for_osr( Register backedge_count, Register method_counters, Register branch_bcp, @@ -2581,7 +2560,6 @@ void InterpreterMacroAssembler::increment_mask_and_jump(Address counter_addr, br(cond, false, Assembler::pn, *where); delayed()->st(scratch1, counter_addr); } -#endif /* CC_INTERP */ // Inline assembly for: // @@ -2597,8 +2575,6 @@ void InterpreterMacroAssembler::increment_mask_and_jump(Address counter_addr, void InterpreterMacroAssembler::notify_method_entry() { - // C++ interpreter only uses this for native methods. - // Whenever JVMTI puts a thread in interp_only_mode, method // entry/exit events are sent for that thread to track stack // depth. If it is possible to enter interp_only_mode we add @@ -2647,7 +2623,6 @@ void InterpreterMacroAssembler::notify_method_entry() { void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, TosState state, NotifyMethodExitMode mode) { - // C++ interpreter only uses this for native methods. // Whenever JVMTI puts a thread in interp_only_mode, method // entry/exit events are sent for that thread to track stack @@ -2687,15 +2662,6 @@ void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, } void InterpreterMacroAssembler::save_return_value(TosState state, bool is_native_call) { -#ifdef CC_INTERP - // result potentially in O0/O1: save it across calls - stf(FloatRegisterImpl::D, F0, STATE(_native_fresult)); -#ifdef _LP64 - stx(O0, STATE(_native_lresult)); -#else - std(O0, STATE(_native_lresult)); -#endif -#else // CC_INTERP if (is_native_call) { stf(FloatRegisterImpl::D, F0, d_tmp); #ifdef _LP64 @@ -2706,18 +2672,9 @@ void InterpreterMacroAssembler::save_return_value(TosState state, bool is_native } else { push(state); } -#endif // CC_INTERP } void InterpreterMacroAssembler::restore_return_value( TosState state, bool is_native_call) { -#ifdef CC_INTERP - ldf(FloatRegisterImpl::D, STATE(_native_fresult), F0); -#ifdef _LP64 - ldx(STATE(_native_lresult), O0); -#else - ldd(STATE(_native_lresult), O0); -#endif -#else // CC_INTERP if (is_native_call) { ldf(FloatRegisterImpl::D, d_tmp, F0); #ifdef _LP64 @@ -2728,5 +2685,4 @@ void InterpreterMacroAssembler::restore_return_value( TosState state, bool is_na } else { pop(state); } -#endif // CC_INTERP } diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp index b944bf089c3..4fa3b09b3a9 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp @@ -54,7 +54,6 @@ REGISTER_DECLARATION(FloatRegister, Ftos_d2, F1); // for 2nd part of double class InterpreterMacroAssembler: public MacroAssembler { protected: -#ifndef CC_INTERP // Interpreter specific version of call_VM_base virtual void call_VM_leaf_base( Register java_thread, @@ -76,7 +75,6 @@ class InterpreterMacroAssembler: public MacroAssembler { // base routine for all dispatches void dispatch_base(TosState state, address* table); -#endif /* CC_INTERP */ public: InterpreterMacroAssembler(CodeBuffer* c) @@ -84,12 +82,10 @@ class InterpreterMacroAssembler: public MacroAssembler { void jump_to_entry(address entry); -#ifndef CC_INTERP virtual void load_earlyret_value(TosState state); static const Address l_tmp ; static const Address d_tmp ; -#endif /* CC_INTERP */ // helper routine for frame allocation/deallocation // compute the delta by which the caller's SP has to @@ -97,8 +93,6 @@ class InterpreterMacroAssembler: public MacroAssembler { // locals void compute_extra_locals_size_in_bytes(Register args_size, Register locals_size, Register delta); -#ifndef CC_INTERP - // dispatch routines void dispatch_prolog(TosState state, int step = 0); void dispatch_epilog(TosState state, int step = 0); @@ -118,7 +112,6 @@ class InterpreterMacroAssembler: public MacroAssembler { protected: void dispatch_Lbyte_code(TosState state, address* table, int bcp_incr = 0, bool verify = true); -#endif /* CC_INTERP */ public: // Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls @@ -130,7 +123,6 @@ class InterpreterMacroAssembler: public MacroAssembler { Register arg_2, bool check_exception = true); -#ifndef CC_INTERP void super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1, Register arg_2); // Generate a subtype check: branch to ok_is_subtype if sub_klass is @@ -265,19 +257,15 @@ class InterpreterMacroAssembler: public MacroAssembler { Address top_most_monitor(); void compute_stack_base( Register Rdest ); -#endif /* CC_INTERP */ void get_method_counters(Register method, Register Rcounters, Label& skip); void increment_invocation_counter( Register Rcounters, Register Rtmp, Register Rtmp2 ); void increment_backedge_counter( Register Rcounters, Register Rtmp, Register Rtmp2 ); -#ifndef CC_INTERP void test_backedge_count_for_osr(Register backedge_count, Register method_counters, Register branch_bcp, Register Rtmp ); -#endif /* CC_INTERP */ // Object locking void lock_object (Register lock_reg, Register obj_reg); void unlock_object(Register lock_reg); -#ifndef CC_INTERP // Interpreter profiling operations void set_method_data_pointer(); void set_method_data_pointer_for_bcp(); @@ -341,7 +329,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void verify_oop_or_return_address(Register reg, Register rtmp); // for astore void verify_FPU(int stack_depth, TosState state = ftos); // only if +VerifyFPU && (state == ftos || state == dtos) -#endif /* CC_INTERP */ // support for JVMTI/Dtrace typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode; void notify_method_entry(); diff --git a/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp b/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp deleted file mode 100644 index f0513d4035b..00000000000 --- a/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 - * 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. - * - */ - -#ifndef CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP -#define CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP - - friend class AbstractInterpreterGenerator; - - private: - - address generate_normal_entry(bool synchronized); - address generate_native_entry(bool synchronized); - address generate_abstract_entry(void); - // there are no math intrinsics on sparc - address generate_math_entry(AbstractInterpreter::MethodKind kind) { return NULL; } - address generate_accessor_entry(void) { return NULL; } - address generate_empty_entry(void) { return NULL; } - address generate_Reference_get_entry(void); - void save_native_result(void); - void restore_native_result(void); - - void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); - void generate_counter_overflow(Label& Lcontinue); - - address generate_CRC32_update_entry(); - address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind); - - // Not supported - address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { return NULL; } -#endif // CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp index 4e9199fa9d8..cf22a6c6f2e 100644 --- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp @@ -26,9 +26,9 @@ #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -53,7 +53,7 @@ // Generation of Interpreter // -// The InterpreterGenerator generates the interpreter into Interpreter::_code. +// The TemplateInterpreterGenerator generates the interpreter into Interpreter::_code. #define __ _masm-> @@ -194,7 +194,7 @@ address AbstractInterpreterGenerator::generate_slow_signature_handler() { } #endif -void InterpreterGenerator::generate_counter_overflow(Label& Lcontinue) { +void TemplateInterpreterGenerator::generate_counter_overflow(Label& Lcontinue) { // Generate code to initiate compilation on the counter overflow. @@ -219,7 +219,7 @@ void InterpreterGenerator::generate_counter_overflow(Label& Lcontinue) { // Abstract method entry // Attempt to execute abstract method. Throw exception // -address InterpreterGenerator::generate_abstract_entry(void) { +address TemplateInterpreterGenerator::generate_abstract_entry(void) { address entry = __ pc(); // abstract method entry // throw exception diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp deleted file mode 100644 index bc38d6e882f..00000000000 --- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_INTERPRETER_SPARC_HPP -#define CPU_SPARC_VM_INTERPRETER_SPARC_HPP - - public: - - static int expr_offset_in_bytes(int i) { return stackElementSize * i + wordSize; } - - // Stack index relative to tos (which points at value) - static int expr_index_at(int i) { return stackElementWords * i; } - - // Already negated by c++ interpreter - static int local_index_at(int i) { - assert(i <= 0, "local direction already negated"); - return stackElementWords * i; - } - -#endif // CPU_SPARC_VM_INTERPRETER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index 15e2e791114..0920bc90e08 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -401,9 +401,6 @@ static Thread* verify_thread_subroutine(Thread* gthread_value) { void MacroAssembler::verify_thread() { if (VerifyThread) { // NOTE: this chops off the heads of the 64-bit O registers. -#ifdef CC_INTERP - save_frame(0); -#else // make sure G2_thread contains the right value save_frame_and_mov(0, Lmethod, Lmethod); // to avoid clobbering O0 (and propagate Lmethod for -Xprof) mov(G1, L1); // avoid clobbering G1 @@ -411,7 +408,6 @@ void MacroAssembler::verify_thread() { mov(G3, L3); // avoid clobbering G3 mov(G4, L4); // avoid clobbering G4 mov(G5_method, L5); // avoid clobbering G5_method -#endif /* CC_INTERP */ #if defined(COMPILER2) && !defined(_LP64) // Save & restore possible 64-bit Long arguments in G-regs srlx(G1,32,L0); @@ -530,11 +526,7 @@ void MacroAssembler::reset_last_Java_frame(void) { #ifdef ASSERT // check that it WAS previously set -#ifdef CC_INTERP - save_frame(0); -#else save_frame_and_mov(0, Lmethod, Lmethod); // Propagate Lmethod to helper frame for -Xprof -#endif /* CC_INTERP */ ld_ptr(sp_addr, L0); tst(L0); breakpoint_trap(Assembler::zero, Assembler::ptr_cc); @@ -754,11 +746,7 @@ void MacroAssembler::set_vm_result(Register oop_result) { # ifdef ASSERT // Check that we are not overwriting any other oop. -#ifdef CC_INTERP - save_frame(0); -#else save_frame_and_mov(0, Lmethod, Lmethod); // Propagate Lmethod for -Xprof -#endif /* CC_INTERP */ ld_ptr(vm_result_addr, L0); tst(L0); restore(); diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp index a7703fa0262..f2757fbe4f5 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp @@ -136,25 +136,6 @@ REGISTER_DECLARATION(Register, Lentry_args , L0); // pointer to args passed // Interpreter frames -#ifdef CC_INTERP -REGISTER_DECLARATION(Register, Lstate , L0); // interpreter state object pointer -REGISTER_DECLARATION(Register, L1_scratch , L1); // scratch -REGISTER_DECLARATION(Register, Lmirror , L1); // mirror (for native methods only) -REGISTER_DECLARATION(Register, L2_scratch , L2); -REGISTER_DECLARATION(Register, L3_scratch , L3); -REGISTER_DECLARATION(Register, L4_scratch , L4); -REGISTER_DECLARATION(Register, Lscratch , L5); // C1 uses -REGISTER_DECLARATION(Register, Lscratch2 , L6); // C1 uses -REGISTER_DECLARATION(Register, L7_scratch , L7); // constant pool cache -REGISTER_DECLARATION(Register, O5_savedSP , O5); -REGISTER_DECLARATION(Register, I5_savedSP , I5); // Saved SP before bumping for locals. This is simply - // a copy SP, so in 64-bit it's a biased value. The bias - // is added and removed as needed in the frame code. -// Interface to signature handler -REGISTER_DECLARATION(Register, Llocals , L7); // pointer to locals for signature handler -REGISTER_DECLARATION(Register, Lmethod , L6); // Method* when calling signature handler - -#else REGISTER_DECLARATION(Register, Lesp , L0); // expression stack pointer REGISTER_DECLARATION(Register, Lbcp , L1); // pointer to next bytecode REGISTER_DECLARATION(Register, Lmethod , L2); @@ -178,7 +159,6 @@ REGISTER_DECLARATION(Register, I5_savedSP , I5); // Saved SP before bumpin REGISTER_DECLARATION(Register, IdispatchTables , I4); // Base address of the bytecode dispatch tables REGISTER_DECLARATION(Register, IdispatchAddress , I3); // Register which saves the dispatch address for each bytecode REGISTER_DECLARATION(Register, ImethodDataPtr , I2); // Pointer to the current method data -#endif /* CC_INTERP */ // NOTE: Lscratch2 and LcpoolCache point to the same registers in // the interpreter code. If Lscratch2 needs to be used for some @@ -233,19 +213,6 @@ REGISTER_DECLARATION(Register, Oissuing_pc , O1); // where the exception is comi #define Gframe_size AS_REGISTER(Register, Gframe_size) #define Gtemp AS_REGISTER(Register, Gtemp) -#ifdef CC_INTERP -#define Lstate AS_REGISTER(Register, Lstate) -#define Lesp AS_REGISTER(Register, Lesp) -#define L1_scratch AS_REGISTER(Register, L1_scratch) -#define Lmirror AS_REGISTER(Register, Lmirror) -#define L2_scratch AS_REGISTER(Register, L2_scratch) -#define L3_scratch AS_REGISTER(Register, L3_scratch) -#define L4_scratch AS_REGISTER(Register, L4_scratch) -#define Lscratch AS_REGISTER(Register, Lscratch) -#define Lscratch2 AS_REGISTER(Register, Lscratch2) -#define L7_scratch AS_REGISTER(Register, L7_scratch) -#define Ostate AS_REGISTER(Register, Ostate) -#else #define Lesp AS_REGISTER(Register, Lesp) #define Lbcp AS_REGISTER(Register, Lbcp) #define Lmethod AS_REGISTER(Register, Lmethod) @@ -255,7 +222,6 @@ REGISTER_DECLARATION(Register, Oissuing_pc , O1); // where the exception is comi #define Lscratch AS_REGISTER(Register, Lscratch) #define Lscratch2 AS_REGISTER(Register, Lscratch2) #define LcpoolCache AS_REGISTER(Register, LcpoolCache) -#endif /* ! CC_INTERP */ #define Lentry_args AS_REGISTER(Register, Lentry_args) #define I5_savedSP AS_REGISTER(Register, I5_savedSP) @@ -610,13 +576,7 @@ class MacroAssembler : public Assembler { // This is the base routine called by the different versions of call_VM_leaf. The interpreter // may customize this version by overriding it for its purposes (e.g., to save/restore // additional registers when doing a VM call). -#ifdef CC_INTERP - #define VIRTUAL -#else - #define VIRTUAL virtual -#endif - - VIRTUAL void call_VM_leaf_base(Register thread_cache, address entry_point, int number_of_arguments); + virtual void call_VM_leaf_base(Register thread_cache, address entry_point, int number_of_arguments); // // It is imperative that all calls into the VM are handled via the call_VM macros. @@ -1483,7 +1443,6 @@ public: void fold_8bit_crc32(Register xcrc, Register table, Register xtmp, Register tmp); void fold_8bit_crc32(Register crc, Register table, Register tmp); -#undef VIRTUAL }; /** diff --git a/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp b/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp index 03d08ddfa35..a27dc432aed 100644 --- a/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, 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 @@ -152,18 +152,6 @@ REGISTER_DEFINITION(Register, G5_method_type); REGISTER_DEFINITION(Register, G3_method_handle); REGISTER_DEFINITION(Register, L7_mh_SP_save); -#ifdef CC_INTERP -REGISTER_DEFINITION(Register, Lstate); -REGISTER_DEFINITION(Register, L1_scratch); -REGISTER_DEFINITION(Register, Lmirror); -REGISTER_DEFINITION(Register, L2_scratch); -REGISTER_DEFINITION(Register, L3_scratch); -REGISTER_DEFINITION(Register, L4_scratch); -REGISTER_DEFINITION(Register, Lscratch); -REGISTER_DEFINITION(Register, Lscratch2); -REGISTER_DEFINITION(Register, L7_scratch); -REGISTER_DEFINITION(Register, I5_savedSP); -#else // CC_INTERP REGISTER_DEFINITION(Register, Lesp); REGISTER_DEFINITION(Register, Lbcp); REGISTER_DEFINITION(Register, Lmonitors); @@ -177,7 +165,6 @@ REGISTER_DEFINITION(Register, O5_savedSP); REGISTER_DEFINITION(Register, IdispatchAddress); REGISTER_DEFINITION(Register, ImethodDataPtr); REGISTER_DEFINITION(Register, IdispatchTables); -#endif // CC_INTERP REGISTER_DEFINITION(Register, Lmethod); REGISTER_DEFINITION(Register, Llocals); REGISTER_DEFINITION(Register, Oexception); diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp index fc1a8f3124c..b8ac98b61cf 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp @@ -26,9 +26,9 @@ #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -47,7 +47,6 @@ #include "utilities/debug.hpp" #include "utilities/macros.hpp" -#ifndef CC_INTERP #ifndef FAST_DISPATCH #define FAST_DISPATCH 1 #endif @@ -56,7 +55,7 @@ // Generation of Interpreter // -// The InterpreterGenerator generates the interpreter into Interpreter::_code. +// The TemplateInterpreterGenerator generates the interpreter into Interpreter::_code. #define __ _masm-> @@ -65,7 +64,7 @@ //---------------------------------------------------------------------------------------------------- -void InterpreterGenerator::save_native_result(void) { +void TemplateInterpreterGenerator::save_native_result(void) { // result potentially in O0/O1: save it across calls const Address& l_tmp = InterpreterMacroAssembler::l_tmp; @@ -81,7 +80,7 @@ void InterpreterGenerator::save_native_result(void) { #endif } -void InterpreterGenerator::restore_native_result(void) { +void TemplateInterpreterGenerator::restore_native_result(void) { const Address& l_tmp = InterpreterMacroAssembler::l_tmp; const Address& d_tmp = InterpreterMacroAssembler::d_tmp; @@ -293,7 +292,7 @@ address TemplateInterpreterGenerator::generate_continuation_for(TosState state) // Lmethod: method // ??: invocation counter // -void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) { +void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) { // Note: In tiered we increment either counters in MethodCounters* or in // MDO depending if we're profiling or not. const Register G3_method_counters = G3_scratch; @@ -724,7 +723,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) { } // Method entry for java.lang.ref.Reference.get. -address InterpreterGenerator::generate_Reference_get_entry(void) { +address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { #if INCLUDE_ALL_GCS // Code: _aload_0, _getfield, _areturn // parameter size = 1 @@ -807,7 +806,7 @@ address InterpreterGenerator::generate_Reference_get_entry(void) { * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) */ -address InterpreterGenerator::generate_CRC32_update_entry() { +address TemplateInterpreterGenerator::generate_CRC32_update_entry() { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -851,7 +850,7 @@ address InterpreterGenerator::generate_CRC32_update_entry() { * int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len) * int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len) */ -address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -903,13 +902,22 @@ address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpret return NULL; } +// Not supported +address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { + return NULL; +} + +// Not supported +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { + return NULL; +} // // Interpreter stub for calling a native method. (asm interpreter) // This sets up a somewhat different looking stack for calling the native method // than the typical interpreter frame setup. // -address InterpreterGenerator::generate_native_entry(bool synchronized) { +address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { address entry = __ pc(); // the following temporary registers are used during frame creation @@ -1336,7 +1344,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { // Generic method entry to (asm) interpreter -address InterpreterGenerator::generate_normal_entry(bool synchronized) { +address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { address entry = __ pc(); bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods; @@ -1743,14 +1751,6 @@ void TemplateInterpreterGenerator::set_vtos_entry_points(Template* t, address& b // -------------------------------------------------------------------------------- - -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : TemplateInterpreterGenerator(code) { - generate_all(); // down here so it can be "virtual" -} - -// -------------------------------------------------------------------------------- - // Non-product code #ifndef PRODUCT address TemplateInterpreterGenerator::generate_trace_code(TosState state) { @@ -1829,4 +1829,3 @@ void TemplateInterpreterGenerator::stop_interpreter_at() { __ breakpoint_trap(Assembler::equal, Assembler::icc); } #endif // not PRODUCT -#endif // !CC_INTERP diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp deleted file mode 100644 index 73b0f1478b5..00000000000 --- a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP -#define CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP - - protected: - - void generate_fixed_frame(bool native_call); // template interpreter only - void generate_stack_overflow_check(Register Rframe_size, Register Rscratch, - Register Rscratch2); - -#endif // CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp index 04d15c42693..b1bc7fc6136 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp @@ -24,7 +24,6 @@ #include "precompiled.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "oops/constMethod.hpp" #include "oops/method.hpp" #include "runtime/arguments.hpp" @@ -32,6 +31,18 @@ #include "runtime/synchronizer.hpp" #include "utilities/macros.hpp" +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +#ifdef _LP64 + // The sethi() instruction generates lots more instructions when shell + // stack limit is unlimited, so that's why this is much bigger. +int TemplateInterpreter::InterpreterCodeSize = 260 * K; +#else +int TemplateInterpreter::InterpreterCodeSize = 230 * K; +#endif int AbstractInterpreter::BasicType_as_index(BasicType type) { int i = 0; @@ -107,7 +118,7 @@ int AbstractInterpreter::size_activation(int max_stack, int callee_locals, bool is_top_frame) { // Note: This calculation must exactly parallel the frame setup - // in InterpreterGenerator::generate_fixed_frame. + // in TemplateInterpreterGenerator::generate_fixed_frame. int monitor_size = monitors * frame::interpreter_frame_monitor_size(); diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp deleted file mode 100644 index 43d7cef64f4..00000000000 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP -#define CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP - - - protected: - - // Size of interpreter code. Increase if too small. Interpreter will - // fail with a guarantee ("not enough space for interpreter generation"); - // if too small. - // Run with +PrintInterpreter to get the VM to print out the size. - // Max size with JVMTI - -#ifdef _LP64 - // The sethi() instruction generates lots more instructions when shell - // stack limit is unlimited, so that's why this is much bigger. - const static int InterpreterCodeSize = 260 * K; -#else - const static int InterpreterCodeSize = 230 * K; -#endif - -#endif // CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index 48da68c0cba..158bb544d9e 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -37,7 +37,6 @@ #include "runtime/synchronizer.hpp" #include "utilities/macros.hpp" -#ifndef CC_INTERP #define __ _masm-> // Misc helpers @@ -3777,4 +3776,3 @@ void TemplateTable::multianewarray() { call_VM(Otos_i, CAST_FROM_FN_PTR(address, InterpreterRuntime::multianewarray), O1); __ add( Lesp, Lscratch, Lesp); // pop all dimensions off the stack } -#endif /* !CC_INTERP */ diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp deleted file mode 100644 index 3088400c801..00000000000 --- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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. - * - */ - -#include "precompiled.hpp" -#include "asm/assembler.hpp" -#include "interpreter/bytecodeInterpreter.hpp" -#include "interpreter/bytecodeInterpreter.inline.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/deoptimization.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef TARGET_ARCH_x86 -# include "interp_masm_x86.hpp" -#endif - -#ifdef CC_INTERP - -#endif // CC_INTERP (all) diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp deleted file mode 100644 index 2538b4ef451..00000000000 --- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP -#define CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP - -// Platform specific for C++ based Interpreter - -private: - - interpreterState _self_link; /* Previous interpreter state */ /* sometimes points to self??? */ - address _result_handler; /* temp for saving native result handler */ - intptr_t* _sender_sp; /* sender's sp before stack (locals) extension */ - - address _extra_junk1; /* temp to save on recompiles */ - address _extra_junk2; /* temp to save on recompiles */ - address _extra_junk3; /* temp to save on recompiles */ - // address dummy_for_native2; /* a native frame result handler would be here... */ - // address dummy_for_native1; /* native result type stored here in a interpreter native frame */ - address _extra_junk4; /* temp to save on recompiles */ - address _extra_junk5; /* temp to save on recompiles */ - address _extra_junk6; /* temp to save on recompiles */ -public: - // we have an interpreter frame... -inline intptr_t* sender_sp() { - return _sender_sp; -} - -// The interpreter always has the frame anchor fully setup so we don't -// have to do anything going to vm from the interpreter. On return -// we do have to clear the flags in case they we're modified to -// maintain the stack walking invariants. -// -#define SET_LAST_JAVA_FRAME() - -#define RESET_LAST_JAVA_FRAME() - -/* - * Macros for accessing the stack. - */ -#undef STACK_INT -#undef STACK_FLOAT -#undef STACK_ADDR -#undef STACK_OBJECT -#undef STACK_DOUBLE -#undef STACK_LONG - -// JavaStack Implementation - -#define GET_STACK_SLOT(offset) (*((intptr_t*) &topOfStack[-(offset)])) -#define STACK_SLOT(offset) ((address) &topOfStack[-(offset)]) -#define STACK_ADDR(offset) (*((address *) &topOfStack[-(offset)])) -#define STACK_INT(offset) (*((jint*) &topOfStack[-(offset)])) -#define STACK_FLOAT(offset) (*((jfloat *) &topOfStack[-(offset)])) -#define STACK_OBJECT(offset) (*((oop *) &topOfStack [-(offset)])) -#define STACK_DOUBLE(offset) (((VMJavaVal64*) &topOfStack[-(offset)])->d) -#define STACK_LONG(offset) (((VMJavaVal64 *) &topOfStack[-(offset)])->l) - -#define SET_STACK_SLOT(value, offset) (*(intptr_t*)&topOfStack[-(offset)] = *(intptr_t*)(value)) -#define SET_STACK_ADDR(value, offset) (*((address *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_INT(value, offset) (*((jint *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_FLOAT(value, offset) (*((jfloat *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_OBJECT(value, offset) (*((oop *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_DOUBLE(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = (value)) -#define SET_STACK_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = \ - ((VMJavaVal64*)(addr))->d) -#define SET_STACK_LONG(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = (value)) -#define SET_STACK_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = \ - ((VMJavaVal64*)(addr))->l) -// JavaLocals implementation - -#define LOCALS_SLOT(offset) ((intptr_t*)&locals[-(offset)]) -#define LOCALS_ADDR(offset) ((address)locals[-(offset)]) -#define LOCALS_INT(offset) ((jint)(locals[-(offset)])) -#define LOCALS_FLOAT(offset) (*((jfloat*)&locals[-(offset)])) -#define LOCALS_OBJECT(offset) (cast_to_oop(locals[-(offset)])) -#define LOCALS_DOUBLE(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->d) -#define LOCALS_LONG(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->l) -#define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)])) -#define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)])) - -#define SET_LOCALS_SLOT(value, offset) (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value)) -#define SET_LOCALS_ADDR(value, offset) (*((address *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_INT(value, offset) (*((jint *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_FLOAT(value, offset) (*((jfloat *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_OBJECT(value, offset) (*((oop *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_DOUBLE(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value)) -#define SET_LOCALS_LONG(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value)) -#define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \ - ((VMJavaVal64*)(addr))->d) -#define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \ - ((VMJavaVal64*)(addr))->l) - -#endif // CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp deleted file mode 100644 index d205f1db79a..00000000000 --- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP -#define CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP - -// Inline interpreter functions for IA32 - -inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { return op1 + op2; } -inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) { return op1 - op2; } -inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) { return op1 * op2; } -inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) { return op1 / op2; } -inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) { return fmod(op1, op2); } - -inline jfloat BytecodeInterpreter::VMfloatNeg(jfloat op) { return -op; } - -inline int32_t BytecodeInterpreter::VMfloatCompare(jfloat op1, jfloat op2, int32_t direction) { - return ( op1 < op2 ? -1 : - op1 > op2 ? 1 : - op1 == op2 ? 0 : - (direction == -1 || direction == 1) ? direction : 0); - -} - -inline void BytecodeInterpreter::VMmemCopy64(uint32_t to[2], const uint32_t from[2]) { - // x86 can do unaligned copies but not 64bits at a time - to[0] = from[0]; to[1] = from[1]; -} - -// The long operations depend on compiler support for "long long" on x86 - -inline jlong BytecodeInterpreter::VMlongAdd(jlong op1, jlong op2) { - return op1 + op2; -} - -inline jlong BytecodeInterpreter::VMlongAnd(jlong op1, jlong op2) { - return op1 & op2; -} - -inline jlong BytecodeInterpreter::VMlongDiv(jlong op1, jlong op2) { - // QQQ what about check and throw... - return op1 / op2; -} - -inline jlong BytecodeInterpreter::VMlongMul(jlong op1, jlong op2) { - return op1 * op2; -} - -inline jlong BytecodeInterpreter::VMlongOr(jlong op1, jlong op2) { - return op1 | op2; -} - -inline jlong BytecodeInterpreter::VMlongSub(jlong op1, jlong op2) { - return op1 - op2; -} - -inline jlong BytecodeInterpreter::VMlongXor(jlong op1, jlong op2) { - return op1 ^ op2; -} - -inline jlong BytecodeInterpreter::VMlongRem(jlong op1, jlong op2) { - return op1 % op2; -} - -inline jlong BytecodeInterpreter::VMlongUshr(jlong op1, jint op2) { - // CVM did this 0x3f mask, is the really needed??? QQQ - return ((unsigned long long) op1) >> (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongShr(jlong op1, jint op2) { - return op1 >> (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongShl(jlong op1, jint op2) { - return op1 << (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongNeg(jlong op) { - return -op; -} - -inline jlong BytecodeInterpreter::VMlongNot(jlong op) { - return ~op; -} - -inline int32_t BytecodeInterpreter::VMlongLtz(jlong op) { - return (op <= 0); -} - -inline int32_t BytecodeInterpreter::VMlongGez(jlong op) { - return (op >= 0); -} - -inline int32_t BytecodeInterpreter::VMlongEqz(jlong op) { - return (op == 0); -} - -inline int32_t BytecodeInterpreter::VMlongEq(jlong op1, jlong op2) { - return (op1 == op2); -} - -inline int32_t BytecodeInterpreter::VMlongNe(jlong op1, jlong op2) { - return (op1 != op2); -} - -inline int32_t BytecodeInterpreter::VMlongGe(jlong op1, jlong op2) { - return (op1 >= op2); -} - -inline int32_t BytecodeInterpreter::VMlongLe(jlong op1, jlong op2) { - return (op1 <= op2); -} - -inline int32_t BytecodeInterpreter::VMlongLt(jlong op1, jlong op2) { - return (op1 < op2); -} - -inline int32_t BytecodeInterpreter::VMlongGt(jlong op1, jlong op2) { - return (op1 > op2); -} - -inline int32_t BytecodeInterpreter::VMlongCompare(jlong op1, jlong op2) { - return (VMlongLt(op1, op2) ? -1 : VMlongGt(op1, op2) ? 1 : 0); -} - -// Long conversions - -inline jdouble BytecodeInterpreter::VMlong2Double(jlong val) { - return (jdouble) val; -} - -inline jfloat BytecodeInterpreter::VMlong2Float(jlong val) { - return (jfloat) val; -} - -inline jint BytecodeInterpreter::VMlong2Int(jlong val) { - return (jint) val; -} - -// Double Arithmetic - -inline jdouble BytecodeInterpreter::VMdoubleAdd(jdouble op1, jdouble op2) { - return op1 + op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleDiv(jdouble op1, jdouble op2) { - // Divide by zero... QQQ - return op1 / op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleMul(jdouble op1, jdouble op2) { - return op1 * op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleNeg(jdouble op) { - return -op; -} - -inline jdouble BytecodeInterpreter::VMdoubleRem(jdouble op1, jdouble op2) { - return fmod(op1, op2); -} - -inline jdouble BytecodeInterpreter::VMdoubleSub(jdouble op1, jdouble op2) { - return op1 - op2; -} - -inline int32_t BytecodeInterpreter::VMdoubleCompare(jdouble op1, jdouble op2, int32_t direction) { - return ( op1 < op2 ? -1 : - op1 > op2 ? 1 : - op1 == op2 ? 0 : - (direction == -1 || direction == 1) ? direction : 0); -} - -// Double Conversions - -inline jfloat BytecodeInterpreter::VMdouble2Float(jdouble val) { - return (jfloat) val; -} - -// Float Conversions - -inline jdouble BytecodeInterpreter::VMfloat2Double(jfloat op) { - return (jdouble) op; -} - -// Integer Arithmetic - -inline jint BytecodeInterpreter::VMintAdd(jint op1, jint op2) { - return op1 + op2; -} - -inline jint BytecodeInterpreter::VMintAnd(jint op1, jint op2) { - return op1 & op2; -} - -inline jint BytecodeInterpreter::VMintDiv(jint op1, jint op2) { - /* it's possible we could catch this special case implicitly */ - if ((juint)op1 == 0x80000000 && op2 == -1) return op1; - else return op1 / op2; -} - -inline jint BytecodeInterpreter::VMintMul(jint op1, jint op2) { - return op1 * op2; -} - -inline jint BytecodeInterpreter::VMintNeg(jint op) { - return -op; -} - -inline jint BytecodeInterpreter::VMintOr(jint op1, jint op2) { - return op1 | op2; -} - -inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) { - /* it's possible we could catch this special case implicitly */ - if ((juint)op1 == 0x80000000 && op2 == -1) return 0; - else return op1 % op2; -} - -inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) { - return op1 << op2; -} - -inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) { - return op1 >> (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) { - return op1 - op2; -} - -inline juint BytecodeInterpreter::VMintUshr(jint op1, jint op2) { - return ((juint) op1) >> (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) { - return op1 ^ op2; -} - -inline jdouble BytecodeInterpreter::VMint2Double(jint val) { - return (jdouble) val; -} - -inline jfloat BytecodeInterpreter::VMint2Float(jint val) { - return (jfloat) val; -} - -inline jlong BytecodeInterpreter::VMint2Long(jint val) { - return (jlong) val; -} - -inline jchar BytecodeInterpreter::VMint2Char(jint val) { - return (jchar) val; -} - -inline jshort BytecodeInterpreter::VMint2Short(jint val) { - return (jshort) val; -} - -inline jbyte BytecodeInterpreter::VMint2Byte(jint val) { - return (jbyte) val; -} - -#endif // CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP diff --git a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp index ec0b81cc541..ffd7e277c96 100644 --- a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp @@ -38,11 +38,7 @@ define_pd_global(bool, InlineIntrinsics, true); define_pd_global(bool, PreferInterpreterNativeStubs, false); define_pd_global(bool, ProfileTraps, true); define_pd_global(bool, UseOnStackReplacement, true); -#ifdef CC_INTERP -define_pd_global(bool, ProfileInterpreter, false); -#else define_pd_global(bool, ProfileInterpreter, true); -#endif // CC_INTERP define_pd_global(bool, TieredCompilation, trueInTiered); define_pd_global(intx, CompileThreshold, 10000); diff --git a/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp deleted file mode 100644 index bf47c3430ef..00000000000 --- a/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP -#define CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP - - protected: - - void generate_more_monitors(); - void generate_deopt_handling(); - void lock_method(void); - address generate_interpreter_frame_manager(bool synchronized); // C++ interpreter only - void generate_compute_interpreter_state(const Register state, - const Register prev_state, - const Register sender_sp, - bool native); // C++ interpreter only - -#endif // CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp deleted file mode 100644 index b3ed77e68c6..00000000000 --- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp +++ /dev/null @@ -1,2314 +0,0 @@ -/* - * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/macroAssembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/cppInterpreter.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/arguments.hpp" -#include "runtime/deoptimization.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/interfaceSupport.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#include "utilities/macros.hpp" -#ifdef SHARK -#include "shark/shark_globals.hpp" -#endif - -#ifdef CC_INTERP - -// Routine exists to make tracebacks look decent in debugger -// while we are recursed in the frame manager/c++ interpreter. -// We could use an address in the frame manager but having -// frames look natural in the debugger is a plus. -extern "C" void RecursiveInterpreterActivation(interpreterState istate ) -{ - // - ShouldNotReachHere(); -} - - -#define __ _masm-> -#define STATE(field_name) (Address(state, byte_offset_of(BytecodeInterpreter, field_name))) - -// default registers for state and sender_sp -// state and sender_sp are the same on 32bit because we have no choice. -// state could be rsi on 64bit but it is an arg reg and not callee save -// so r13 is better choice. - -const Register state = NOT_LP64(rsi) LP64_ONLY(r13); -const Register sender_sp_on_entry = NOT_LP64(rsi) LP64_ONLY(r13); - -// NEEDED for JVMTI? -// address AbstractInterpreter::_remove_activation_preserving_args_entry; - -static address unctrap_frame_manager_entry = NULL; - -static address deopt_frame_manager_return_atos = NULL; -static address deopt_frame_manager_return_btos = NULL; -static address deopt_frame_manager_return_itos = NULL; -static address deopt_frame_manager_return_ltos = NULL; -static address deopt_frame_manager_return_ftos = NULL; -static address deopt_frame_manager_return_dtos = NULL; -static address deopt_frame_manager_return_vtos = NULL; - -int AbstractInterpreter::BasicType_as_index(BasicType type) { - int i = 0; - switch (type) { - case T_BOOLEAN: i = 0; break; - case T_CHAR : i = 1; break; - case T_BYTE : i = 2; break; - case T_SHORT : i = 3; break; - case T_INT : i = 4; break; - case T_VOID : i = 5; break; - case T_FLOAT : i = 8; break; - case T_LONG : i = 9; break; - case T_DOUBLE : i = 6; break; - case T_OBJECT : // fall through - case T_ARRAY : i = 7; break; - default : ShouldNotReachHere(); - } - assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds"); - return i; -} - -// Is this pc anywhere within code owned by the interpreter? -// This only works for pc that might possibly be exposed to frame -// walkers. It clearly misses all of the actual c++ interpreter -// implementation -bool CppInterpreter::contains(address pc) { - return (_code->contains(pc) || - pc == CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation)); -} - - -address CppInterpreterGenerator::generate_result_handler_for(BasicType type) { - address entry = __ pc(); - switch (type) { - case T_BOOLEAN: __ c2bool(rax); break; - case T_CHAR : __ andl(rax, 0xFFFF); break; - case T_BYTE : __ sign_extend_byte (rax); break; - case T_SHORT : __ sign_extend_short(rax); break; - case T_VOID : // fall thru - case T_LONG : // fall thru - case T_INT : /* nothing to do */ break; - - case T_DOUBLE : - case T_FLOAT : - { - const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp(); - __ pop(t); // remove return address first - // Must return a result for interpreter or compiler. In SSE - // mode, results are returned in xmm0 and the FPU stack must - // be empty. - if (type == T_FLOAT && UseSSE >= 1) { -#ifndef _LP64 - // Load ST0 - __ fld_d(Address(rsp, 0)); - // Store as float and empty fpu stack - __ fstp_s(Address(rsp, 0)); -#endif // !_LP64 - // and reload - __ movflt(xmm0, Address(rsp, 0)); - } else if (type == T_DOUBLE && UseSSE >= 2 ) { - __ movdbl(xmm0, Address(rsp, 0)); - } else { - // restore ST0 - __ fld_d(Address(rsp, 0)); - } - // and pop the temp - __ addptr(rsp, 2 * wordSize); - __ push(t); // restore return address - } - break; - case T_OBJECT : - // retrieve result from frame - __ movptr(rax, STATE(_oop_temp)); - // and verify it - __ verify_oop(rax); - break; - default : ShouldNotReachHere(); - } - __ ret(0); // return from result handler - return entry; -} - -// tosca based result to c++ interpreter stack based result. -// Result goes to top of native stack. - -#undef EXTEND // SHOULD NOT BE NEEDED -address CppInterpreterGenerator::generate_tosca_to_stack_converter(BasicType type) { - // A result is in the tosca (abi result) from either a native method call or compiled - // code. Place this result on the java expression stack so C++ interpreter can use it. - address entry = __ pc(); - - const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp(); - __ pop(t); // remove return address first - switch (type) { - case T_VOID: - break; - case T_BOOLEAN: -#ifdef EXTEND - __ c2bool(rax); -#endif - __ push(rax); - break; - case T_CHAR : -#ifdef EXTEND - __ andl(rax, 0xFFFF); -#endif - __ push(rax); - break; - case T_BYTE : -#ifdef EXTEND - __ sign_extend_byte (rax); -#endif - __ push(rax); - break; - case T_SHORT : -#ifdef EXTEND - __ sign_extend_short(rax); -#endif - __ push(rax); - break; - case T_LONG : - __ push(rdx); // pushes useless junk on 64bit - __ push(rax); - break; - case T_INT : - __ push(rax); - break; - case T_FLOAT : - // Result is in ST(0)/xmm0 - __ subptr(rsp, wordSize); - if ( UseSSE < 1) { - __ fstp_s(Address(rsp, 0)); - } else { - __ movflt(Address(rsp, 0), xmm0); - } - break; - case T_DOUBLE : - __ subptr(rsp, 2*wordSize); - if ( UseSSE < 2 ) { - __ fstp_d(Address(rsp, 0)); - } else { - __ movdbl(Address(rsp, 0), xmm0); - } - break; - case T_OBJECT : - __ verify_oop(rax); // verify it - __ push(rax); - break; - default : ShouldNotReachHere(); - } - __ jmp(t); // return from result handler - return entry; -} - -address CppInterpreterGenerator::generate_stack_to_stack_converter(BasicType type) { - // A result is in the java expression stack of the interpreted method that has just - // returned. Place this result on the java expression stack of the caller. - // - // The current interpreter activation in rsi/r13 is for the method just returning its - // result. So we know that the result of this method is on the top of the current - // execution stack (which is pre-pushed) and will be return to the top of the caller - // stack. The top of the callers stack is the bottom of the locals of the current - // activation. - // Because of the way activation are managed by the frame manager the value of rsp is - // below both the stack top of the current activation and naturally the stack top - // of the calling activation. This enable this routine to leave the return address - // to the frame manager on the stack and do a vanilla return. - // - // On entry: rsi/r13 - interpreter state of activation returning a (potential) result - // On Return: rsi/r13 - unchanged - // rax - new stack top for caller activation (i.e. activation in _prev_link) - // - // Can destroy rdx, rcx. - // - - address entry = __ pc(); - const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp(); - switch (type) { - case T_VOID: - __ movptr(rax, STATE(_locals)); // pop parameters get new stack value - __ addptr(rax, wordSize); // account for prepush before we return - break; - case T_FLOAT : - case T_BOOLEAN: - case T_CHAR : - case T_BYTE : - case T_SHORT : - case T_INT : - // 1 word result - __ movptr(rdx, STATE(_stack)); - __ movptr(rax, STATE(_locals)); // address for result - __ movl(rdx, Address(rdx, wordSize)); // get result - __ movptr(Address(rax, 0), rdx); // and store it - break; - case T_LONG : - case T_DOUBLE : - // return top two words on current expression stack to caller's expression stack - // The caller's expression stack is adjacent to the current frame manager's intepretState - // except we allocated one extra word for this intepretState so we won't overwrite it - // when we return a two word result. - - __ movptr(rax, STATE(_locals)); // address for result - __ movptr(rcx, STATE(_stack)); - __ subptr(rax, wordSize); // need addition word besides locals[0] - __ movptr(rdx, Address(rcx, 2*wordSize)); // get result word (junk in 64bit) - __ movptr(Address(rax, wordSize), rdx); // and store it - __ movptr(rdx, Address(rcx, wordSize)); // get result word - __ movptr(Address(rax, 0), rdx); // and store it - break; - case T_OBJECT : - __ movptr(rdx, STATE(_stack)); - __ movptr(rax, STATE(_locals)); // address for result - __ movptr(rdx, Address(rdx, wordSize)); // get result - __ verify_oop(rdx); // verify it - __ movptr(Address(rax, 0), rdx); // and store it - break; - default : ShouldNotReachHere(); - } - __ ret(0); - return entry; -} - -address CppInterpreterGenerator::generate_stack_to_native_abi_converter(BasicType type) { - // A result is in the java expression stack of the interpreted method that has just - // returned. Place this result in the native abi that the caller expects. - // - // Similar to generate_stack_to_stack_converter above. Called at a similar time from the - // frame manager execept in this situation the caller is native code (c1/c2/call_stub) - // and so rather than return result onto caller's java expression stack we return the - // result in the expected location based on the native abi. - // On entry: rsi/r13 - interpreter state of activation returning a (potential) result - // On Return: rsi/r13 - unchanged - // Other registers changed [rax/rdx/ST(0) as needed for the result returned] - - address entry = __ pc(); - switch (type) { - case T_VOID: - break; - case T_BOOLEAN: - case T_CHAR : - case T_BYTE : - case T_SHORT : - case T_INT : - __ movptr(rdx, STATE(_stack)); // get top of stack - __ movl(rax, Address(rdx, wordSize)); // get result word 1 - break; - case T_LONG : - __ movptr(rdx, STATE(_stack)); // get top of stack - __ movptr(rax, Address(rdx, wordSize)); // get result low word - NOT_LP64(__ movl(rdx, Address(rdx, 2*wordSize));) // get result high word - break; - case T_FLOAT : - __ movptr(rdx, STATE(_stack)); // get top of stack - if ( UseSSE >= 1) { - __ movflt(xmm0, Address(rdx, wordSize)); - } else { - __ fld_s(Address(rdx, wordSize)); // pushd float result - } - break; - case T_DOUBLE : - __ movptr(rdx, STATE(_stack)); // get top of stack - if ( UseSSE > 1) { - __ movdbl(xmm0, Address(rdx, wordSize)); - } else { - __ fld_d(Address(rdx, wordSize)); // push double result - } - break; - case T_OBJECT : - __ movptr(rdx, STATE(_stack)); // get top of stack - __ movptr(rax, Address(rdx, wordSize)); // get result word 1 - __ verify_oop(rax); // verify it - break; - default : ShouldNotReachHere(); - } - __ ret(0); - return entry; -} - -address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { - // make it look good in the debugger - return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation); -} - -address CppInterpreter::deopt_entry(TosState state, int length) { - address ret = NULL; - if (length != 0) { - switch (state) { - case atos: ret = deopt_frame_manager_return_atos; break; - case btos: ret = deopt_frame_manager_return_btos; break; - case ctos: - case stos: - case itos: ret = deopt_frame_manager_return_itos; break; - case ltos: ret = deopt_frame_manager_return_ltos; break; - case ftos: ret = deopt_frame_manager_return_ftos; break; - case dtos: ret = deopt_frame_manager_return_dtos; break; - case vtos: ret = deopt_frame_manager_return_vtos; break; - } - } else { - ret = unctrap_frame_manager_entry; // re-execute the bytecode ( e.g. uncommon trap) - } - assert(ret != NULL, "Not initialized"); - return ret; -} - -// C++ Interpreter -void CppInterpreterGenerator::generate_compute_interpreter_state(const Register state, - const Register locals, - const Register sender_sp, - bool native) { - - // On entry the "locals" argument points to locals[0] (or where it would be in case no locals in - // a static method). "state" contains any previous frame manager state which we must save a link - // to in the newly generated state object. On return "state" is a pointer to the newly allocated - // state object. We must allocate and initialize a new interpretState object and the method - // expression stack. Because the returned result (if any) of the method will be placed on the caller's - // expression stack and this will overlap with locals[0] (and locals[1] if double/long) we must - // be sure to leave space on the caller's stack so that this result will not overwrite values when - // locals[0] and locals[1] do not exist (and in fact are return address and saved rbp). So when - // we are non-native we in essence ensure that locals[0-1] exist. We play an extra trick in - // non-product builds and initialize this last local with the previous interpreterState as - // this makes things look real nice in the debugger. - - // State on entry - // Assumes locals == &locals[0] - // Assumes state == any previous frame manager state (assuming call path from c++ interpreter) - // Assumes rax = return address - // rcx == senders_sp - // rbx == method - // Modifies rcx, rdx, rax - // Returns: - // state == address of new interpreterState - // rsp == bottom of method's expression stack. - - const Address const_offset (rbx, Method::const_offset()); - - - // On entry sp is the sender's sp. This includes the space for the arguments - // that the sender pushed. If the sender pushed no args (a static) and the - // caller returns a long then we need two words on the sender's stack which - // are not present (although when we return a restore full size stack the - // space will be present). If we didn't allocate two words here then when - // we "push" the result of the caller's stack we would overwrite the return - // address and the saved rbp. Not good. So simply allocate 2 words now - // just to be safe. This is the "static long no_params() method" issue. - // See Lo.java for a testcase. - // We don't need this for native calls because they return result in - // register and the stack is expanded in the caller before we store - // the results on the stack. - - if (!native) { -#ifdef PRODUCT - __ subptr(rsp, 2*wordSize); -#else /* PRODUCT */ - __ push((int32_t)NULL_WORD); - __ push(state); // make it look like a real argument -#endif /* PRODUCT */ - } - - // Now that we are assure of space for stack result, setup typical linkage - - __ push(rax); - __ enter(); - - __ mov(rax, state); // save current state - - __ lea(rsp, Address(rsp, -(int)sizeof(BytecodeInterpreter))); - __ mov(state, rsp); - - // rsi/r13 == state/locals rax == prevstate - - // initialize the "shadow" frame so that use since C++ interpreter not directly - // recursive. Simpler to recurse but we can't trim expression stack as we call - // new methods. - __ movptr(STATE(_locals), locals); // state->_locals = locals() - __ movptr(STATE(_self_link), state); // point to self - __ movptr(STATE(_prev_link), rax); // state->_link = state on entry (NULL or previous state) - __ movptr(STATE(_sender_sp), sender_sp); // state->_sender_sp = sender_sp -#ifdef _LP64 - __ movptr(STATE(_thread), r15_thread); // state->_bcp = codes() -#else - __ get_thread(rax); // get vm's javathread* - __ movptr(STATE(_thread), rax); // state->_bcp = codes() -#endif // _LP64 - __ movptr(rdx, Address(rbx, Method::const_offset())); // get constantMethodOop - __ lea(rdx, Address(rdx, ConstMethod::codes_offset())); // get code base - if (native) { - __ movptr(STATE(_bcp), (int32_t)NULL_WORD); // state->_bcp = NULL - } else { - __ movptr(STATE(_bcp), rdx); // state->_bcp = codes() - } - __ xorptr(rdx, rdx); - __ movptr(STATE(_oop_temp), rdx); // state->_oop_temp = NULL (only really needed for native) - __ movptr(STATE(_mdx), rdx); // state->_mdx = NULL - __ movptr(rdx, Address(rbx, Method::const_offset())); - __ movptr(rdx, Address(rdx, ConstMethod::constants_offset())); - __ movptr(rdx, Address(rdx, ConstantPool::cache_offset_in_bytes())); - __ movptr(STATE(_constants), rdx); // state->_constants = constants() - - __ movptr(STATE(_method), rbx); // state->_method = method() - __ movl(STATE(_msg), (int32_t) BytecodeInterpreter::method_entry); // state->_msg = initial method entry - __ movptr(STATE(_result._to_call._callee), (int32_t) NULL_WORD); // state->_result._to_call._callee_callee = NULL - - - __ movptr(STATE(_monitor_base), rsp); // set monitor block bottom (grows down) this would point to entry [0] - // entries run from -1..x where &monitor[x] == - - { - // Must not attempt to lock method until we enter interpreter as gc won't be able to find the - // initial frame. However we allocate a free monitor so we don't have to shuffle the expression stack - // immediately. - - // synchronize method - const Address access_flags (rbx, Method::access_flags_offset()); - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - Label not_synced; - - __ movl(rax, access_flags); - __ testl(rax, JVM_ACC_SYNCHRONIZED); - __ jcc(Assembler::zero, not_synced); - - // Allocate initial monitor and pre initialize it - // get synchronization object - - Label done; - const int mirror_offset = in_bytes(Klass::java_mirror_offset()); - __ movl(rax, access_flags); - __ testl(rax, JVM_ACC_STATIC); - __ movptr(rax, Address(locals, 0)); // get receiver (assume this is frequent case) - __ jcc(Assembler::zero, done); - __ movptr(rax, Address(rbx, Method::const_offset())); - __ movptr(rax, Address(rax, ConstMethod::constants_offset())); - __ movptr(rax, Address(rax, ConstantPool::pool_holder_offset_in_bytes())); - __ movptr(rax, Address(rax, mirror_offset)); - __ bind(done); - // add space for monitor & lock - __ subptr(rsp, entry_size); // add space for a monitor entry - __ movptr(Address(rsp, BasicObjectLock::obj_offset_in_bytes()), rax); // store object - __ bind(not_synced); - } - - __ movptr(STATE(_stack_base), rsp); // set expression stack base ( == &monitors[-count]) - if (native) { - __ movptr(STATE(_stack), rsp); // set current expression stack tos - __ movptr(STATE(_stack_limit), rsp); - } else { - __ subptr(rsp, wordSize); // pre-push stack - __ movptr(STATE(_stack), rsp); // set current expression stack tos - - // compute full expression stack limit - - __ movptr(rdx, Address(rbx, Method::const_offset())); - __ load_unsigned_short(rdx, Address(rdx, ConstMethod::max_stack_offset())); // get size of expression stack in words - __ negptr(rdx); // so we can subtract in next step - // Allocate expression stack - __ lea(rsp, Address(rsp, rdx, Address::times_ptr, -Method::extra_stack_words())); - __ movptr(STATE(_stack_limit), rsp); - } - -#ifdef _LP64 - // Make sure stack is properly aligned and sized for the abi - __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows - __ andptr(rsp, -16); // must be 16 byte boundary (see amd64 ABI) -#endif // _LP64 - - - -} - -// Helpers for commoning out cases in the various type of method entries. -// - -// increment invocation count & check for overflow -// -// Note: checking for negative value instead of overflow -// so we have a 'sticky' overflow test -// -// rbx,: method -// rcx: invocation counter -// -void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) { - Label done; - const Address invocation_counter(rax, - MethodCounters::invocation_counter_offset() + - InvocationCounter::counter_offset()); - const Address backedge_counter (rax, - MethodCounters::backedge_counter_offset() + - InvocationCounter::counter_offset()); - - __ get_method_counters(rbx, rax, done); - - if (ProfileInterpreter) { - __ incrementl(Address(rax, - MethodCounters::interpreter_invocation_counter_offset())); - } - // Update standard invocation counters - __ movl(rcx, invocation_counter); - __ increment(rcx, InvocationCounter::count_increment); - __ movl(invocation_counter, rcx); // save invocation count - - __ movl(rax, backedge_counter); // load backedge counter - __ andl(rax, InvocationCounter::count_mask_value); // mask out the status bits - - __ addl(rcx, rax); // add both counters - - // profile_method is non-null only for interpreted method so - // profile_method != NULL == !native_call - // BytecodeInterpreter only calls for native so code is elided. - - __ cmp32(rcx, - ExternalAddress((address)&InvocationCounter::InterpreterInvocationLimit)); - __ jcc(Assembler::aboveEqual, *overflow); - __ bind(done); -} - -void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { - - // C++ interpreter on entry - // rsi/r13 - new interpreter state pointer - // rbp - interpreter frame pointer - // rbx - method - - // On return (i.e. jump to entry_point) [ back to invocation of interpreter ] - // rbx, - method - // rcx - rcvr (assuming there is one) - // top of stack return address of interpreter caller - // rsp - sender_sp - - // C++ interpreter only - // rsi/r13 - previous interpreter state pointer - - // InterpreterRuntime::frequency_counter_overflow takes one argument - // indicating if the counter overflow occurs at a backwards branch (non-NULL bcp). - // The call returns the address of the verified entry point for the method or NULL - // if the compilation did not complete (either went background or bailed out). - __ movptr(rax, (int32_t)false); - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), rax); - - // for c++ interpreter can rsi really be munged? - __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); // restore state - __ movptr(rbx, Address(state, byte_offset_of(BytecodeInterpreter, _method))); // restore method - __ movptr(rdi, Address(state, byte_offset_of(BytecodeInterpreter, _locals))); // get locals pointer - - __ jmp(*do_continue, relocInfo::none); - -} - -void InterpreterGenerator::generate_stack_overflow_check(void) { - // see if we've got enough room on the stack for locals plus overhead. - // the expression stack grows down incrementally, so the normal guard - // page mechanism will work for that. - // - // Registers live on entry: - // - // Asm interpreter - // rdx: number of additional locals this frame needs (what we must check) - // rbx,: Method* - - // C++ Interpreter - // rsi/r13: previous interpreter frame state object - // rdi: &locals[0] - // rcx: # of locals - // rdx: number of additional locals this frame needs (what we must check) - // rbx: Method* - - // destroyed on exit - // rax, - - // NOTE: since the additional locals are also always pushed (wasn't obvious in - // generate_method_entry) so the guard should work for them too. - // - - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - - // total overhead size: entry_size + (saved rbp, thru expr stack bottom). - // be sure to change this if you add/subtract anything to/from the overhead area - const int overhead_size = (int)sizeof(BytecodeInterpreter); - - const int page_size = os::vm_page_size(); - - Label after_frame_check; - - // compute rsp as if this were going to be the last frame on - // the stack before the red zone - - Label after_frame_check_pop; - - // save rsi == caller's bytecode ptr (c++ previous interp. state) - // QQQ problem here?? rsi overload???? - __ push(state); - - const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rsi); - - NOT_LP64(__ get_thread(thread)); - - const Address stack_base(thread, Thread::stack_base_offset()); - const Address stack_size(thread, Thread::stack_size_offset()); - - // locals + overhead, in bytes - // Always give one monitor to allow us to start interp if sync method. - // Any additional monitors need a check when moving the expression stack - const int one_monitor = frame::interpreter_frame_monitor_size() * wordSize; - __ movptr(rax, Address(rbx, Method::const_offset())); - __ load_unsigned_short(rax, Address(rax, ConstMethod::max_stack_offset())); // get size of expression stack in words - __ lea(rax, Address(noreg, rax, Interpreter::stackElementScale(), one_monitor+Method::extra_stack_words())); - __ lea(rax, Address(rax, rdx, Interpreter::stackElementScale(), overhead_size)); - -#ifdef ASSERT - Label stack_base_okay, stack_size_okay; - // verify that thread stack base is non-zero - __ cmpptr(stack_base, (int32_t)0); - __ jcc(Assembler::notEqual, stack_base_okay); - __ stop("stack base is zero"); - __ bind(stack_base_okay); - // verify that thread stack size is non-zero - __ cmpptr(stack_size, (int32_t)0); - __ jcc(Assembler::notEqual, stack_size_okay); - __ stop("stack size is zero"); - __ bind(stack_size_okay); -#endif - - // Add stack base to locals and subtract stack size - __ addptr(rax, stack_base); - __ subptr(rax, stack_size); - - // We should have a magic number here for the size of the c++ interpreter frame. - // We can't actually tell this ahead of time. The debug version size is around 3k - // product is 1k and fastdebug is 4k - const int slop = 6 * K; - - // Use the maximum number of pages we might bang. - const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages) ? StackShadowPages : - (StackRedPages+StackYellowPages); - // Only need this if we are stack banging which is temporary while - // we're debugging. - __ addptr(rax, slop + 2*max_pages * page_size); - - // check against the current stack bottom - __ cmpptr(rsp, rax); - __ jcc(Assembler::above, after_frame_check_pop); - - __ pop(state); // get c++ prev state. - - // throw exception return address becomes throwing pc - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_StackOverflowError)); - - // all done with frame size check - __ bind(after_frame_check_pop); - __ pop(state); - - __ bind(after_frame_check); -} - -// Find preallocated monitor and lock method (C++ interpreter) -// rbx - Method* -// -void CppInterpreterGenerator::lock_method() { - // assumes state == rsi/r13 == pointer to current interpreterState - // minimally destroys rax, rdx|c_rarg1, rdi - // - // synchronize method - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - const Address access_flags (rbx, Method::access_flags_offset()); - - const Register monitor = NOT_LP64(rdx) LP64_ONLY(c_rarg1); - - // find initial monitor i.e. monitors[-1] - __ movptr(monitor, STATE(_monitor_base)); // get monitor bottom limit - __ subptr(monitor, entry_size); // point to initial monitor - -#ifdef ASSERT - { Label L; - __ movl(rax, access_flags); - __ testl(rax, JVM_ACC_SYNCHRONIZED); - __ jcc(Assembler::notZero, L); - __ stop("method doesn't need synchronization"); - __ bind(L); - } -#endif // ASSERT - // get synchronization object - { Label done; - const int mirror_offset = in_bytes(Klass::java_mirror_offset()); - __ movl(rax, access_flags); - __ movptr(rdi, STATE(_locals)); // prepare to get receiver (assume common case) - __ testl(rax, JVM_ACC_STATIC); - __ movptr(rax, Address(rdi, 0)); // get receiver (assume this is frequent case) - __ jcc(Assembler::zero, done); - __ movptr(rax, Address(rbx, Method::const_offset())); - __ movptr(rax, Address(rax, ConstMethod::constants_offset())); - __ movptr(rax, Address(rax, ConstantPool::pool_holder_offset_in_bytes())); - __ movptr(rax, Address(rax, mirror_offset)); - __ bind(done); - } -#ifdef ASSERT - { Label L; - __ cmpptr(rax, Address(monitor, BasicObjectLock::obj_offset_in_bytes())); // correct object? - __ jcc(Assembler::equal, L); - __ stop("wrong synchronization lobject"); - __ bind(L); - } -#endif // ASSERT - // can destroy rax, rdx|c_rarg1, rcx, and (via call_VM) rdi! - __ lock_object(monitor); -} - -address InterpreterGenerator::generate_Reference_get_entry(void) { -#if INCLUDE_ALL_GCS - if (UseG1GC) { - // We need to generate have a routine that generates code to: - // * load the value in the referent field - // * passes that value to the pre-barrier. - // - // In the case of G1 this will record the value of the - // referent in an SATB buffer if marking is active. - // This will cause concurrent marking to mark the referent - // field as live. - Unimplemented(); - } -#endif // INCLUDE_ALL_GCS - - // If G1 is not enabled then attempt to go through the accessor entry point - // Reference.get is an accessor - return NULL; -} - -// -// C++ Interpreter stub for calling a native method. -// This sets up a somewhat different looking stack for calling the native method -// than the typical interpreter frame setup but still has the pointer to -// an interpreter state. -// - -address InterpreterGenerator::generate_native_entry(bool synchronized) { - // determine code generation flags - bool inc_counter = UseCompiler || CountCompiledCalls; - - // rbx: Method* - // rcx: receiver (unused) - // rsi/r13: previous interpreter state (if called from C++ interpreter) must preserve - // in any case. If called via c1/c2/call_stub rsi/r13 is junk (to use) but harmless - // to save/restore. - address entry_point = __ pc(); - - const Address access_flags (rbx, Method::access_flags_offset()); - - // rsi/r13 == state/locals rdi == prevstate - const Register locals = rdi; - - // get parameter size (always needed) - { - const Address constMethod (rbx, Method::const_offset()); - const Address size_of_parameters(rcx, ConstMethod::size_of_parameters_offset()); - __ movptr(rcx, constMethod); - __ load_unsigned_short(rcx, size_of_parameters); - } - - // rbx: Method* - // rcx: size of parameters - __ pop(rax); // get return address - // for natives the size of locals is zero - - // compute beginning of parameters /locals - - __ lea(locals, Address(rsp, rcx, Address::times_ptr, -wordSize)); - - // initialize fixed part of activation frame - - // Assumes rax = return address - - // allocate and initialize new interpreterState and method expression stack - // IN(locals) -> locals - // IN(state) -> previous frame manager state (NULL from stub/c1/c2) - // destroys rax, rcx, rdx - // OUT (state) -> new interpreterState - // OUT(rsp) -> bottom of methods expression stack - - // save sender_sp - __ mov(rcx, sender_sp_on_entry); - // start with NULL previous state - __ movptr(state, (int32_t)NULL_WORD); - generate_compute_interpreter_state(state, locals, rcx, true); - -#ifdef ASSERT - { Label L; - __ movptr(rax, STATE(_stack_base)); -#ifdef _LP64 - // duplicate the alignment rsp got after setting stack_base - __ subptr(rax, frame::arg_reg_save_area_bytes); // windows - __ andptr(rax, -16); // must be 16 byte boundary (see amd64 ABI) -#endif // _LP64 - __ cmpptr(rax, rsp); - __ jcc(Assembler::equal, L); - __ stop("broken stack frame setup in interpreter"); - __ bind(L); - } -#endif - - const Register unlock_thread = LP64_ONLY(r15_thread) NOT_LP64(rax); - NOT_LP64(__ movptr(unlock_thread, STATE(_thread));) // get thread - // Since at this point in the method invocation the exception handler - // would try to exit the monitor of synchronized methods which hasn't - // been entered yet, we set the thread local variable - // _do_not_unlock_if_synchronized to true. The remove_activation will - // check this flag. - - const Address do_not_unlock_if_synchronized(unlock_thread, - in_bytes(JavaThread::do_not_unlock_if_synchronized_offset())); - __ movbool(do_not_unlock_if_synchronized, true); - - // make sure method is native & not abstract -#ifdef ASSERT - __ movl(rax, access_flags); - { - Label L; - __ testl(rax, JVM_ACC_NATIVE); - __ jcc(Assembler::notZero, L); - __ stop("tried to execute non-native method as native"); - __ bind(L); - } - { Label L; - __ testl(rax, JVM_ACC_ABSTRACT); - __ jcc(Assembler::zero, L); - __ stop("tried to execute abstract method in interpreter"); - __ bind(L); - } -#endif - - - // increment invocation count & check for overflow - Label invocation_counter_overflow; - if (inc_counter) { - generate_counter_incr(&invocation_counter_overflow, NULL, NULL); - } - - Label continue_after_compile; - - __ bind(continue_after_compile); - - bang_stack_shadow_pages(true); - - // reset the _do_not_unlock_if_synchronized flag - NOT_LP64(__ movl(rax, STATE(_thread));) // get thread - __ movbool(do_not_unlock_if_synchronized, false); - - - // check for synchronized native methods - // - // Note: This must happen *after* invocation counter check, since - // when overflow happens, the method should not be locked. - if (synchronized) { - // potentially kills rax, rcx, rdx, rdi - lock_method(); - } else { - // no synchronization necessary -#ifdef ASSERT - { Label L; - __ movl(rax, access_flags); - __ testl(rax, JVM_ACC_SYNCHRONIZED); - __ jcc(Assembler::zero, L); - __ stop("method needs synchronization"); - __ bind(L); - } -#endif - } - - // start execution - - // jvmti support - __ notify_method_entry(); - - // work registers - const Register method = rbx; - const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rdi); - const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp(); // rcx|rscratch1 - - // allocate space for parameters - __ movptr(method, STATE(_method)); - __ verify_method_ptr(method); - { - const Address constMethod (method, Method::const_offset()); - const Address size_of_parameters(t, ConstMethod::size_of_parameters_offset()); - __ movptr(t, constMethod); - __ load_unsigned_short(t, size_of_parameters); - } - __ shll(t, 2); -#ifdef _LP64 - __ subptr(rsp, t); - __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows - __ andptr(rsp, -16); // must be 16 byte boundary (see amd64 ABI) -#else - __ addptr(t, 2*wordSize); // allocate two more slots for JNIEnv and possible mirror - __ subptr(rsp, t); - __ andptr(rsp, -(StackAlignmentInBytes)); // gcc needs 16 byte aligned stacks to do XMM intrinsics -#endif // _LP64 - - // get signature handler - Label pending_exception_present; - - { Label L; - __ movptr(t, Address(method, Method::signature_handler_offset())); - __ testptr(t, t); - __ jcc(Assembler::notZero, L); - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), method, false); - __ movptr(method, STATE(_method)); - __ cmpptr(Address(thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); - __ jcc(Assembler::notEqual, pending_exception_present); - __ verify_method_ptr(method); - __ movptr(t, Address(method, Method::signature_handler_offset())); - __ bind(L); - } -#ifdef ASSERT - { - Label L; - __ push(t); - __ get_thread(t); // get vm's javathread* - __ cmpptr(t, STATE(_thread)); - __ jcc(Assembler::equal, L); - __ int3(); - __ bind(L); - __ pop(t); - } -#endif // - - const Register from_ptr = InterpreterRuntime::SignatureHandlerGenerator::from(); - // call signature handler - assert(InterpreterRuntime::SignatureHandlerGenerator::to () == rsp, "adjust this code"); - - // The generated handlers do not touch RBX (the method oop). - // However, large signatures cannot be cached and are generated - // each time here. The slow-path generator will blow RBX - // sometime, so we must reload it after the call. - __ movptr(from_ptr, STATE(_locals)); // get the from pointer - __ call(t); - __ movptr(method, STATE(_method)); - __ verify_method_ptr(method); - - // result handler is in rax - // set result handler - __ movptr(STATE(_result_handler), rax); - - - // get native function entry point - { Label L; - __ movptr(rax, Address(method, Method::native_function_offset())); - __ testptr(rax, rax); - __ jcc(Assembler::notZero, L); - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), method); - __ movptr(method, STATE(_method)); - __ verify_method_ptr(method); - __ movptr(rax, Address(method, Method::native_function_offset())); - __ bind(L); - } - - // pass mirror handle if static call - { Label L; - const int mirror_offset = in_bytes(Klass::java_mirror_offset()); - __ movl(t, Address(method, Method::access_flags_offset())); - __ testl(t, JVM_ACC_STATIC); - __ jcc(Assembler::zero, L); - // get mirror - __ movptr(t, Address(method, Method:: const_offset())); - __ movptr(t, Address(t, ConstMethod::constants_offset())); - __ movptr(t, Address(t, ConstantPool::pool_holder_offset_in_bytes())); - __ movptr(t, Address(t, mirror_offset)); - // copy mirror into activation object - __ movptr(STATE(_oop_temp), t); - // pass handle to mirror -#ifdef _LP64 - __ lea(c_rarg1, STATE(_oop_temp)); -#else - __ lea(t, STATE(_oop_temp)); - __ movptr(Address(rsp, wordSize), t); -#endif // _LP64 - __ bind(L); - } -#ifdef ASSERT - { - Label L; - __ push(t); - __ get_thread(t); // get vm's javathread* - __ cmpptr(t, STATE(_thread)); - __ jcc(Assembler::equal, L); - __ int3(); - __ bind(L); - __ pop(t); - } -#endif // - - // pass JNIEnv -#ifdef _LP64 - __ lea(c_rarg0, Address(thread, JavaThread::jni_environment_offset())); -#else - __ movptr(thread, STATE(_thread)); // get thread - __ lea(t, Address(thread, JavaThread::jni_environment_offset())); - - __ movptr(Address(rsp, 0), t); -#endif // _LP64 - -#ifdef ASSERT - { - Label L; - __ push(t); - __ get_thread(t); // get vm's javathread* - __ cmpptr(t, STATE(_thread)); - __ jcc(Assembler::equal, L); - __ int3(); - __ bind(L); - __ pop(t); - } -#endif // - -#ifdef ASSERT - { Label L; - __ movl(t, Address(thread, JavaThread::thread_state_offset())); - __ cmpl(t, _thread_in_Java); - __ jcc(Assembler::equal, L); - __ stop("Wrong thread state in native stub"); - __ bind(L); - } -#endif - - // Change state to native (we save the return address in the thread, since it might not - // be pushed on the stack when we do a a stack traversal). It is enough that the pc() - // points into the right code segment. It does not have to be the correct return pc. - - __ set_last_Java_frame(thread, noreg, rbp, __ pc()); - - __ movl(Address(thread, JavaThread::thread_state_offset()), _thread_in_native); - - __ call(rax); - - // result potentially in rdx:rax or ST0 - __ movptr(method, STATE(_method)); - NOT_LP64(__ movptr(thread, STATE(_thread));) // get thread - - // The potential result is in ST(0) & rdx:rax - // With C++ interpreter we leave any possible result in ST(0) until we are in result handler and then - // we do the appropriate stuff for returning the result. rdx:rax must always be saved because just about - // anything we do here will destroy it, st(0) is only saved if we re-enter the vm where it would - // be destroyed. - // It is safe to do these pushes because state is _thread_in_native and return address will be found - // via _last_native_pc and not via _last_jave_sp - - // Must save the value of ST(0)/xmm0 since it could be destroyed before we get to result handler - { Label Lpush, Lskip; - ExternalAddress float_handler(AbstractInterpreter::result_handler(T_FLOAT)); - ExternalAddress double_handler(AbstractInterpreter::result_handler(T_DOUBLE)); - __ cmpptr(STATE(_result_handler), float_handler.addr()); - __ jcc(Assembler::equal, Lpush); - __ cmpptr(STATE(_result_handler), double_handler.addr()); - __ jcc(Assembler::notEqual, Lskip); - __ bind(Lpush); - __ subptr(rsp, 2*wordSize); - if ( UseSSE < 2 ) { - __ fstp_d(Address(rsp, 0)); - } else { - __ movdbl(Address(rsp, 0), xmm0); - } - __ bind(Lskip); - } - - // save rax:rdx for potential use by result handler. - __ push(rax); -#ifndef _LP64 - __ push(rdx); -#endif // _LP64 - - // Verify or restore cpu control state after JNI call - __ restore_cpu_control_state_after_jni(); - - // change thread state - __ movl(Address(thread, JavaThread::thread_state_offset()), _thread_in_native_trans); - if(os::is_MP()) { - // Write serialization page so VM thread can do a pseudo remote membar. - // We use the current thread pointer to calculate a thread specific - // offset to write to within the page. This minimizes bus traffic - // due to cache line collision. - __ serialize_memory(thread, rcx); - } - - // check for safepoint operation in progress and/or pending suspend requests - { Label Continue; - - __ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()), - SafepointSynchronize::_not_synchronized); - - // threads running native code and they are expected to self-suspend - // when leaving the _thread_in_native state. We need to check for - // pending suspend requests here. - Label L; - __ jcc(Assembler::notEqual, L); - __ cmpl(Address(thread, JavaThread::suspend_flags_offset()), 0); - __ jcc(Assembler::equal, Continue); - __ bind(L); - - // Don't use call_VM as it will see a possible pending exception and forward it - // and never return here preventing us from clearing _last_native_pc down below. - // Also can't use call_VM_leaf either as it will check to see if rsi & rdi are - // preserved and correspond to the bcp/locals pointers. - // - - ((MacroAssembler*)_masm)->call_VM_leaf(CAST_FROM_FN_PTR(address, JavaThread::check_special_condition_for_native_trans), - thread); - __ increment(rsp, wordSize); - - __ movptr(method, STATE(_method)); - __ verify_method_ptr(method); - __ movptr(thread, STATE(_thread)); // get thread - - __ bind(Continue); - } - - // change thread state - __ movl(Address(thread, JavaThread::thread_state_offset()), _thread_in_Java); - - __ reset_last_Java_frame(thread, true, true); - - // reset handle block - __ movptr(t, Address(thread, JavaThread::active_handles_offset())); - __ movl(Address(t, JNIHandleBlock::top_offset_in_bytes()), (int32_t)NULL_WORD); - - // If result was an oop then unbox and save it in the frame - { Label L; - Label no_oop, store_result; - ExternalAddress oop_handler(AbstractInterpreter::result_handler(T_OBJECT)); - __ cmpptr(STATE(_result_handler), oop_handler.addr()); - __ jcc(Assembler::notEqual, no_oop); -#ifndef _LP64 - __ pop(rdx); -#endif // _LP64 - __ pop(rax); - __ testptr(rax, rax); - __ jcc(Assembler::zero, store_result); - // unbox - __ movptr(rax, Address(rax, 0)); - __ bind(store_result); - __ movptr(STATE(_oop_temp), rax); - // keep stack depth as expected by pushing oop which will eventually be discarded - __ push(rax); -#ifndef _LP64 - __ push(rdx); -#endif // _LP64 - __ bind(no_oop); - } - - { - Label no_reguard; - __ cmpl(Address(thread, JavaThread::stack_guard_state_offset()), JavaThread::stack_guard_yellow_disabled); - __ jcc(Assembler::notEqual, no_reguard); - - __ pusha(); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::reguard_yellow_pages))); - __ popa(); - - __ bind(no_reguard); - } - - - // QQQ Seems like for native methods we simply return and the caller will see the pending - // exception and do the right thing. Certainly the interpreter will, don't know about - // compiled methods. - // Seems that the answer to above is no this is wrong. The old code would see the exception - // and forward it before doing the unlocking and notifying jvmdi that method has exited. - // This seems wrong need to investigate the spec. - - // handle exceptions (exception handling will handle unlocking!) - { Label L; - __ cmpptr(Address(thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); - __ jcc(Assembler::zero, L); - __ bind(pending_exception_present); - - // There are potential results on the stack (rax/rdx, ST(0)) we ignore these and simply - // return and let caller deal with exception. This skips the unlocking here which - // seems wrong but seems to be what asm interpreter did. Can't find this in the spec. - // Note: must preverve method in rbx - // - - // remove activation - - __ movptr(t, STATE(_sender_sp)); - __ leave(); // remove frame anchor - __ pop(rdi); // get return address - __ movptr(state, STATE(_prev_link)); // get previous state for return - __ mov(rsp, t); // set sp to sender sp - __ push(rdi); // push throwing pc - // The skips unlocking!! This seems to be what asm interpreter does but seems - // very wrong. Not clear if this violates the spec. - __ jump(RuntimeAddress(StubRoutines::forward_exception_entry())); - __ bind(L); - } - - // do unlocking if necessary - { Label L; - __ movl(t, Address(method, Method::access_flags_offset())); - __ testl(t, JVM_ACC_SYNCHRONIZED); - __ jcc(Assembler::zero, L); - // the code below should be shared with interpreter macro assembler implementation - { Label unlock; - const Register monitor = NOT_LP64(rdx) LP64_ONLY(c_rarg1); - // BasicObjectLock will be first in list, since this is a synchronized method. However, need - // to check that the object has not been unlocked by an explicit monitorexit bytecode. - __ movptr(monitor, STATE(_monitor_base)); - __ subptr(monitor, frame::interpreter_frame_monitor_size() * wordSize); // address of initial monitor - - __ movptr(t, Address(monitor, BasicObjectLock::obj_offset_in_bytes())); - __ testptr(t, t); - __ jcc(Assembler::notZero, unlock); - - // Entry already unlocked, need to throw exception - __ MacroAssembler::call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_illegal_monitor_state_exception)); - __ should_not_reach_here(); - - __ bind(unlock); - __ unlock_object(monitor); - // unlock can blow rbx so restore it for path that needs it below - __ movptr(method, STATE(_method)); - } - __ bind(L); - } - - // jvmti support - // Note: This must happen _after_ handling/throwing any exceptions since - // the exception handler code notifies the runtime of method exits - // too. If this happens before, method entry/exit notifications are - // not properly paired (was bug - gri 11/22/99). - __ notify_method_exit(vtos, InterpreterMacroAssembler::NotifyJVMTI); - - // restore potential result in rdx:rax, call result handler to restore potential result in ST0 & handle result -#ifndef _LP64 - __ pop(rdx); -#endif // _LP64 - __ pop(rax); - __ movptr(t, STATE(_result_handler)); // get result handler - __ call(t); // call result handler to convert to tosca form - - // remove activation - - __ movptr(t, STATE(_sender_sp)); - - __ leave(); // remove frame anchor - __ pop(rdi); // get return address - __ movptr(state, STATE(_prev_link)); // get previous state for return (if c++ interpreter was caller) - __ mov(rsp, t); // set sp to sender sp - __ jmp(rdi); - - // invocation counter overflow - if (inc_counter) { - // Handle overflow of counter and compile method - __ bind(invocation_counter_overflow); - generate_counter_overflow(&continue_after_compile); - } - - return entry_point; -} - -// Generate entries that will put a result type index into rcx -void CppInterpreterGenerator::generate_deopt_handling() { - - Label return_from_deopt_common; - - // Generate entries that will put a result type index into rcx - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_atos = __ pc(); - - // rax is live here - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_OBJECT)); // Result stub address array index - __ jmp(return_from_deopt_common); - - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_btos = __ pc(); - - // rax is live here - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_BOOLEAN)); // Result stub address array index - __ jmp(return_from_deopt_common); - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_itos = __ pc(); - - // rax is live here - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_INT)); // Result stub address array index - __ jmp(return_from_deopt_common); - - // deopt needs to jump to here to enter the interpreter (return a result) - - deopt_frame_manager_return_ltos = __ pc(); - // rax,rdx are live here - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_LONG)); // Result stub address array index - __ jmp(return_from_deopt_common); - - // deopt needs to jump to here to enter the interpreter (return a result) - - deopt_frame_manager_return_ftos = __ pc(); - // st(0) is live here - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_FLOAT)); // Result stub address array index - __ jmp(return_from_deopt_common); - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_dtos = __ pc(); - - // st(0) is live here - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_DOUBLE)); // Result stub address array index - __ jmp(return_from_deopt_common); - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_vtos = __ pc(); - - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_VOID)); - - // Deopt return common - // an index is present in rcx that lets us move any possible result being - // return to the interpreter's stack - // - // Because we have a full sized interpreter frame on the youngest - // activation the stack is pushed too deep to share the tosca to - // stack converters directly. We shrink the stack to the desired - // amount and then push result and then re-extend the stack. - // We could have the code in size_activation layout a short - // frame for the top activation but that would look different - // than say sparc (which needs a full size activation because - // the windows are in the way. Really it could be short? QQQ - // - __ bind(return_from_deopt_common); - - __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); - - // setup rsp so we can push the "result" as needed. - __ movptr(rsp, STATE(_stack)); // trim stack (is prepushed) - __ addptr(rsp, wordSize); // undo prepush - - ExternalAddress tosca_to_stack((address)CppInterpreter::_tosca_to_stack); - // Address index(noreg, rcx, Address::times_ptr); - __ movptr(rcx, ArrayAddress(tosca_to_stack, Address(noreg, rcx, Address::times_ptr))); - // __ movl(rcx, Address(noreg, rcx, Address::times_ptr, int(AbstractInterpreter::_tosca_to_stack))); - __ call(rcx); // call result converter - - __ movl(STATE(_msg), (int)BytecodeInterpreter::deopt_resume); - __ lea(rsp, Address(rsp, -wordSize)); // prepush stack (result if any already present) - __ movptr(STATE(_stack), rsp); // inform interpreter of new stack depth (parameters removed, - // result if any on stack already ) - __ movptr(rsp, STATE(_stack_limit)); // restore expression stack to full depth -} - -// Generate the code to handle a more_monitors message from the c++ interpreter -void CppInterpreterGenerator::generate_more_monitors() { - - - Label entry, loop; - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - // 1. compute new pointers // rsp: old expression stack top - __ movptr(rdx, STATE(_stack_base)); // rdx: old expression stack bottom - __ subptr(rsp, entry_size); // move expression stack top limit - __ subptr(STATE(_stack), entry_size); // update interpreter stack top - __ subptr(STATE(_stack_limit), entry_size); // inform interpreter - __ subptr(rdx, entry_size); // move expression stack bottom - __ movptr(STATE(_stack_base), rdx); // inform interpreter - __ movptr(rcx, STATE(_stack)); // set start value for copy loop - __ jmp(entry); - // 2. move expression stack contents - __ bind(loop); - __ movptr(rbx, Address(rcx, entry_size)); // load expression stack word from old location - __ movptr(Address(rcx, 0), rbx); // and store it at new location - __ addptr(rcx, wordSize); // advance to next word - __ bind(entry); - __ cmpptr(rcx, rdx); // check if bottom reached - __ jcc(Assembler::notEqual, loop); // if not at bottom then copy next word - // now zero the slot so we can find it. - __ movptr(Address(rdx, BasicObjectLock::obj_offset_in_bytes()), (int32_t) NULL_WORD); - __ movl(STATE(_msg), (int)BytecodeInterpreter::got_monitors); -} - - -// Initial entry to C++ interpreter from the call_stub. -// This entry point is called the frame manager since it handles the generation -// of interpreter activation frames via requests directly from the vm (via call_stub) -// and via requests from the interpreter. The requests from the call_stub happen -// directly thru the entry point. Requests from the interpreter happen via returning -// from the interpreter and examining the message the interpreter has returned to -// the frame manager. The frame manager can take the following requests: - -// NO_REQUEST - error, should never happen. -// MORE_MONITORS - need a new monitor. Shuffle the expression stack on down and -// allocate a new monitor. -// CALL_METHOD - setup a new activation to call a new method. Very similar to what -// happens during entry during the entry via the call stub. -// RETURN_FROM_METHOD - remove an activation. Return to interpreter or call stub. -// -// Arguments: -// -// rbx: Method* -// rcx: receiver - unused (retrieved from stack as needed) -// rsi/r13: previous frame manager state (NULL from the call_stub/c1/c2) -// -// -// Stack layout at entry -// -// [ return address ] <--- rsp -// [ parameter n ] -// ... -// [ parameter 1 ] -// [ expression stack ] -// -// -// We are free to blow any registers we like because the call_stub which brought us here -// initially has preserved the callee save registers already. -// -// - -static address interpreter_frame_manager = NULL; - -address InterpreterGenerator::generate_normal_entry(bool synchronized) { - - // rbx: Method* - // rsi/r13: sender sp - - // Because we redispatch "recursive" interpreter entries thru this same entry point - // the "input" register usage is a little strange and not what you expect coming - // from the call_stub. From the call stub rsi/rdi (current/previous) interpreter - // state are NULL but on "recursive" dispatches they are what you'd expect. - // rsi: current interpreter state (C++ interpreter) must preserve (null from call_stub/c1/c2) - - - // A single frame manager is plenty as we don't specialize for synchronized. We could and - // the code is pretty much ready. Would need to change the test below and for good measure - // modify generate_interpreter_state to only do the (pre) sync stuff stuff for synchronized - // routines. Not clear this is worth it yet. - - if (interpreter_frame_manager) return interpreter_frame_manager; - - address entry_point = __ pc(); - - Label dispatch_entry_2; - __ movptr(rcx, sender_sp_on_entry); - __ movptr(state, (int32_t)NULL_WORD); // no current activation - - __ jmp(dispatch_entry_2); - - const Register locals = rdi; - - Label re_dispatch; - - __ bind(re_dispatch); - - // save sender sp (doesn't include return address - __ lea(rcx, Address(rsp, wordSize)); - - __ bind(dispatch_entry_2); - - // save sender sp - __ push(rcx); - - const Address constMethod (rbx, Method::const_offset()); - const Address access_flags (rbx, Method::access_flags_offset()); - const Address size_of_parameters(rdx, ConstMethod::size_of_parameters_offset()); - const Address size_of_locals (rdx, ConstMethod::size_of_locals_offset()); - - // const Address monitor_block_top (rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize); - // const Address monitor_block_bot (rbp, frame::interpreter_frame_initial_sp_offset * wordSize); - // const Address monitor(rbp, frame::interpreter_frame_initial_sp_offset * wordSize - (int)sizeof(BasicObjectLock)); - - // get parameter size (always needed) - __ movptr(rdx, constMethod); - __ load_unsigned_short(rcx, size_of_parameters); - - // rbx: Method* - // rcx: size of parameters - __ load_unsigned_short(rdx, size_of_locals); // get size of locals in words - - __ subptr(rdx, rcx); // rdx = no. of additional locals - - // see if we've got enough room on the stack for locals plus overhead. - generate_stack_overflow_check(); // C++ - - // c++ interpreter does not use stack banging or any implicit exceptions - // leave for now to verify that check is proper. - bang_stack_shadow_pages(false); - - - - // compute beginning of parameters (rdi) - __ lea(locals, Address(rsp, rcx, Address::times_ptr, wordSize)); - - // save sender's sp - // __ movl(rcx, rsp); - - // get sender's sp - __ pop(rcx); - - // get return address - __ pop(rax); - - // rdx - # of additional locals - // allocate space for locals - // explicitly initialize locals - { - Label exit, loop; - __ testl(rdx, rdx); // (32bit ok) - __ jcc(Assembler::lessEqual, exit); // do nothing if rdx <= 0 - __ bind(loop); - __ push((int32_t)NULL_WORD); // initialize local variables - __ decrement(rdx); // until everything initialized - __ jcc(Assembler::greater, loop); - __ bind(exit); - } - - - // Assumes rax = return address - - // allocate and initialize new interpreterState and method expression stack - // IN(locals) -> locals - // IN(state) -> any current interpreter activation - // destroys rax, rcx, rdx, rdi - // OUT (state) -> new interpreterState - // OUT(rsp) -> bottom of methods expression stack - - generate_compute_interpreter_state(state, locals, rcx, false); - - // Call interpreter - - Label call_interpreter; - __ bind(call_interpreter); - - // c++ interpreter does not use stack banging or any implicit exceptions - // leave for now to verify that check is proper. - bang_stack_shadow_pages(false); - - - // Call interpreter enter here if message is - // set and we know stack size is valid - - Label call_interpreter_2; - - __ bind(call_interpreter_2); - - { - const Register thread = NOT_LP64(rcx) LP64_ONLY(r15_thread); - -#ifdef _LP64 - __ mov(c_rarg0, state); -#else - __ push(state); // push arg to interpreter - __ movptr(thread, STATE(_thread)); -#endif // _LP64 - - // We can setup the frame anchor with everything we want at this point - // as we are thread_in_Java and no safepoints can occur until we go to - // vm mode. We do have to clear flags on return from vm but that is it - // - __ movptr(Address(thread, JavaThread::last_Java_fp_offset()), rbp); - __ movptr(Address(thread, JavaThread::last_Java_sp_offset()), rsp); - - // Call the interpreter - - RuntimeAddress normal(CAST_FROM_FN_PTR(address, BytecodeInterpreter::run)); - RuntimeAddress checking(CAST_FROM_FN_PTR(address, BytecodeInterpreter::runWithChecks)); - - __ call(JvmtiExport::can_post_interpreter_events() ? checking : normal); - NOT_LP64(__ pop(rax);) // discard parameter to run - // - // state is preserved since it is callee saved - // - - // reset_last_Java_frame - - NOT_LP64(__ movl(thread, STATE(_thread));) - __ reset_last_Java_frame(thread, true, true); - } - - // examine msg from interpreter to determine next action - - __ movl(rdx, STATE(_msg)); // Get new message - - Label call_method; - Label return_from_interpreted_method; - Label throw_exception; - Label bad_msg; - Label do_OSR; - - __ cmpl(rdx, (int32_t)BytecodeInterpreter::call_method); - __ jcc(Assembler::equal, call_method); - __ cmpl(rdx, (int32_t)BytecodeInterpreter::return_from_method); - __ jcc(Assembler::equal, return_from_interpreted_method); - __ cmpl(rdx, (int32_t)BytecodeInterpreter::do_osr); - __ jcc(Assembler::equal, do_OSR); - __ cmpl(rdx, (int32_t)BytecodeInterpreter::throwing_exception); - __ jcc(Assembler::equal, throw_exception); - __ cmpl(rdx, (int32_t)BytecodeInterpreter::more_monitors); - __ jcc(Assembler::notEqual, bad_msg); - - // Allocate more monitor space, shuffle expression stack.... - - generate_more_monitors(); - - __ jmp(call_interpreter); - - // uncommon trap needs to jump to here to enter the interpreter (re-execute current bytecode) - unctrap_frame_manager_entry = __ pc(); - // - // Load the registers we need. - __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); - __ movptr(rsp, STATE(_stack_limit)); // restore expression stack to full depth - __ jmp(call_interpreter_2); - - - - //============================================================================= - // Returning from a compiled method into a deopted method. The bytecode at the - // bcp has completed. The result of the bytecode is in the native abi (the tosca - // for the template based interpreter). Any stack space that was used by the - // bytecode that has completed has been removed (e.g. parameters for an invoke) - // so all that we have to do is place any pending result on the expression stack - // and resume execution on the next bytecode. - - - generate_deopt_handling(); - __ jmp(call_interpreter); - - - // Current frame has caught an exception we need to dispatch to the - // handler. We can get here because a native interpreter frame caught - // an exception in which case there is no handler and we must rethrow - // If it is a vanilla interpreted frame the we simply drop into the - // interpreter and let it do the lookup. - - Interpreter::_rethrow_exception_entry = __ pc(); - // rax: exception - // rdx: return address/pc that threw exception - - Label return_with_exception; - Label unwind_and_forward; - - // restore state pointer. - __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); - - __ movptr(rbx, STATE(_method)); // get method -#ifdef _LP64 - __ movptr(Address(r15_thread, Thread::pending_exception_offset()), rax); -#else - __ movl(rcx, STATE(_thread)); // get thread - - // Store exception with interpreter will expect it - __ movptr(Address(rcx, Thread::pending_exception_offset()), rax); -#endif // _LP64 - - // is current frame vanilla or native? - - __ movl(rdx, access_flags); - __ testl(rdx, JVM_ACC_NATIVE); - __ jcc(Assembler::zero, return_with_exception); // vanilla interpreted frame, handle directly - - // We drop thru to unwind a native interpreted frame with a pending exception - // We jump here for the initial interpreter frame with exception pending - // We unwind the current acivation and forward it to our caller. - - __ bind(unwind_and_forward); - - // unwind rbp, return stack to unextended value and re-push return address - - __ movptr(rcx, STATE(_sender_sp)); - __ leave(); - __ pop(rdx); - __ mov(rsp, rcx); - __ push(rdx); - __ jump(RuntimeAddress(StubRoutines::forward_exception_entry())); - - // Return point from a call which returns a result in the native abi - // (c1/c2/jni-native). This result must be processed onto the java - // expression stack. - // - // A pending exception may be present in which case there is no result present - - Label resume_interpreter; - Label do_float; - Label do_double; - Label done_conv; - - // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases - if (UseSSE < 2) { - __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); - __ movptr(rbx, STATE(_result._to_call._callee)); // get method just executed - __ movl(rcx, Address(rbx, Method::result_index_offset())); - __ cmpl(rcx, AbstractInterpreter::BasicType_as_index(T_FLOAT)); // Result stub address array index - __ jcc(Assembler::equal, do_float); - __ cmpl(rcx, AbstractInterpreter::BasicType_as_index(T_DOUBLE)); // Result stub address array index - __ jcc(Assembler::equal, do_double); -#if !defined(_LP64) || defined(COMPILER1) || !defined(COMPILER2) - __ empty_FPU_stack(); -#endif // COMPILER2 - __ jmp(done_conv); - - __ bind(do_float); -#ifdef COMPILER2 - for (int i = 1; i < 8; i++) { - __ ffree(i); - } -#endif // COMPILER2 - __ jmp(done_conv); - __ bind(do_double); -#ifdef COMPILER2 - for (int i = 1; i < 8; i++) { - __ ffree(i); - } -#endif // COMPILER2 - __ jmp(done_conv); - } else { - __ MacroAssembler::verify_FPU(0, "generate_return_entry_for compiled"); - __ jmp(done_conv); - } - - // Return point to interpreter from compiled/native method - InternalAddress return_from_native_method(__ pc()); - - __ bind(done_conv); - - - // Result if any is in tosca. The java expression stack is in the state that the - // calling convention left it (i.e. params may or may not be present) - // Copy the result from tosca and place it on java expression stack. - - // Restore rsi/r13 as compiled code may not preserve it - - __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); - - // restore stack to what we had when we left (in case i2c extended it) - - __ movptr(rsp, STATE(_stack)); - __ lea(rsp, Address(rsp, wordSize)); - - // If there is a pending exception then we don't really have a result to process - -#ifdef _LP64 - __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); -#else - __ movptr(rcx, STATE(_thread)); // get thread - __ cmpptr(Address(rcx, Thread::pending_exception_offset()), (int32_t)NULL_WORD); -#endif // _LP64 - __ jcc(Assembler::notZero, return_with_exception); - - // get method just executed - __ movptr(rbx, STATE(_result._to_call._callee)); - - // callee left args on top of expression stack, remove them - __ movptr(rcx, constMethod); - __ load_unsigned_short(rcx, Address(rcx, ConstMethod::size_of_parameters_offset())); - - __ lea(rsp, Address(rsp, rcx, Address::times_ptr)); - - __ movl(rcx, Address(rbx, Method::result_index_offset())); - ExternalAddress tosca_to_stack((address)CppInterpreter::_tosca_to_stack); - // Address index(noreg, rax, Address::times_ptr); - __ movptr(rcx, ArrayAddress(tosca_to_stack, Address(noreg, rcx, Address::times_ptr))); - // __ movl(rcx, Address(noreg, rcx, Address::times_ptr, int(AbstractInterpreter::_tosca_to_stack))); - __ call(rcx); // call result converter - __ jmp(resume_interpreter); - - // An exception is being caught on return to a vanilla interpreter frame. - // Empty the stack and resume interpreter - - __ bind(return_with_exception); - - // Exception present, empty stack - __ movptr(rsp, STATE(_stack_base)); - __ jmp(resume_interpreter); - - // Return from interpreted method we return result appropriate to the caller (i.e. "recursive" - // interpreter call, or native) and unwind this interpreter activation. - // All monitors should be unlocked. - - __ bind(return_from_interpreted_method); - - Label return_to_initial_caller; - - __ movptr(rbx, STATE(_method)); // get method just executed - __ cmpptr(STATE(_prev_link), (int32_t)NULL_WORD); // returning from "recursive" interpreter call? - __ movl(rax, Address(rbx, Method::result_index_offset())); // get result type index - __ jcc(Assembler::equal, return_to_initial_caller); // back to native code (call_stub/c1/c2) - - // Copy result to callers java stack - ExternalAddress stack_to_stack((address)CppInterpreter::_stack_to_stack); - // Address index(noreg, rax, Address::times_ptr); - - __ movptr(rax, ArrayAddress(stack_to_stack, Address(noreg, rax, Address::times_ptr))); - // __ movl(rax, Address(noreg, rax, Address::times_ptr, int(AbstractInterpreter::_stack_to_stack))); - __ call(rax); // call result converter - - Label unwind_recursive_activation; - __ bind(unwind_recursive_activation); - - // returning to interpreter method from "recursive" interpreter call - // result converter left rax pointing to top of the java stack for method we are returning - // to. Now all we must do is unwind the state from the completed call - - __ movptr(state, STATE(_prev_link)); // unwind state - __ leave(); // pop the frame - __ mov(rsp, rax); // unwind stack to remove args - - // Resume the interpreter. The current frame contains the current interpreter - // state object. - // - - __ bind(resume_interpreter); - - // state == interpreterState object for method we are resuming - - __ movl(STATE(_msg), (int)BytecodeInterpreter::method_resume); - __ lea(rsp, Address(rsp, -wordSize)); // prepush stack (result if any already present) - __ movptr(STATE(_stack), rsp); // inform interpreter of new stack depth (parameters removed, - // result if any on stack already ) - __ movptr(rsp, STATE(_stack_limit)); // restore expression stack to full depth - __ jmp(call_interpreter_2); // No need to bang - - // interpreter returning to native code (call_stub/c1/c2) - // convert result and unwind initial activation - // rax - result index - - __ bind(return_to_initial_caller); - ExternalAddress stack_to_native((address)CppInterpreter::_stack_to_native_abi); - // Address index(noreg, rax, Address::times_ptr); - - __ movptr(rax, ArrayAddress(stack_to_native, Address(noreg, rax, Address::times_ptr))); - __ call(rax); // call result converter - - Label unwind_initial_activation; - __ bind(unwind_initial_activation); - - // RETURN TO CALL_STUB/C1/C2 code (result if any in rax/rdx ST(0)) - - /* Current stack picture - - [ incoming parameters ] - [ extra locals ] - [ return address to CALL_STUB/C1/C2] - fp -> [ CALL_STUB/C1/C2 fp ] - BytecodeInterpreter object - expression stack - sp -> - - */ - - // return restoring the stack to the original sender_sp value - - __ movptr(rcx, STATE(_sender_sp)); - __ leave(); - __ pop(rdi); // get return address - // set stack to sender's sp - __ mov(rsp, rcx); - __ jmp(rdi); // return to call_stub - - // OSR request, adjust return address to make current frame into adapter frame - // and enter OSR nmethod - - __ bind(do_OSR); - - Label remove_initial_frame; - - // We are going to pop this frame. Is there another interpreter frame underneath - // it or is it callstub/compiled? - - // Move buffer to the expected parameter location - __ movptr(rcx, STATE(_result._osr._osr_buf)); - - __ movptr(rax, STATE(_result._osr._osr_entry)); - - __ cmpptr(STATE(_prev_link), (int32_t)NULL_WORD); // returning from "recursive" interpreter call? - __ jcc(Assembler::equal, remove_initial_frame); // back to native code (call_stub/c1/c2) - - __ movptr(sender_sp_on_entry, STATE(_sender_sp)); // get sender's sp in expected register - __ leave(); // pop the frame - __ mov(rsp, sender_sp_on_entry); // trim any stack expansion - - - // We know we are calling compiled so push specialized return - // method uses specialized entry, push a return so we look like call stub setup - // this path will handle fact that result is returned in registers and not - // on the java stack. - - __ pushptr(return_from_native_method.addr()); - - __ jmp(rax); - - __ bind(remove_initial_frame); - - __ movptr(rdx, STATE(_sender_sp)); - __ leave(); - // get real return - __ pop(rsi); - // set stack to sender's sp - __ mov(rsp, rdx); - // repush real return - __ push(rsi); - // Enter OSR nmethod - __ jmp(rax); - - - - - // Call a new method. All we do is (temporarily) trim the expression stack - // push a return address to bring us back to here and leap to the new entry. - - __ bind(call_method); - - // stack points to next free location and not top element on expression stack - // method expects sp to be pointing to topmost element - - __ movptr(rsp, STATE(_stack)); // pop args to c++ interpreter, set sp to java stack top - __ lea(rsp, Address(rsp, wordSize)); - - __ movptr(rbx, STATE(_result._to_call._callee)); // get method to execute - - // don't need a return address if reinvoking interpreter - - // Make it look like call_stub calling conventions - - // Get (potential) receiver - // get size of parameters in words - __ movptr(rcx, constMethod); - __ load_unsigned_short(rcx, Address(rcx, ConstMethod::size_of_parameters_offset())); - - ExternalAddress recursive(CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation)); - __ pushptr(recursive.addr()); // make it look good in the debugger - - InternalAddress entry(entry_point); - __ cmpptr(STATE(_result._to_call._callee_entry_point), entry.addr()); // returning to interpreter? - __ jcc(Assembler::equal, re_dispatch); // yes - - __ pop(rax); // pop dummy address - - - // get specialized entry - __ movptr(rax, STATE(_result._to_call._callee_entry_point)); - // set sender SP - __ mov(sender_sp_on_entry, rsp); - - // method uses specialized entry, push a return so we look like call stub setup - // this path will handle fact that result is returned in registers and not - // on the java stack. - - __ pushptr(return_from_native_method.addr()); - - __ jmp(rax); - - __ bind(bad_msg); - __ stop("Bad message from interpreter"); - - // Interpreted method "returned" with an exception pass it on... - // Pass result, unwind activation and continue/return to interpreter/call_stub - // We handle result (if any) differently based on return to interpreter or call_stub - - Label unwind_initial_with_pending_exception; - - __ bind(throw_exception); - __ cmpptr(STATE(_prev_link), (int32_t)NULL_WORD); // returning from recursive interpreter call? - __ jcc(Assembler::equal, unwind_initial_with_pending_exception); // no, back to native code (call_stub/c1/c2) - __ movptr(rax, STATE(_locals)); // pop parameters get new stack value - __ addptr(rax, wordSize); // account for prepush before we return - __ jmp(unwind_recursive_activation); - - __ bind(unwind_initial_with_pending_exception); - - // We will unwind the current (initial) interpreter frame and forward - // the exception to the caller. We must put the exception in the - // expected register and clear pending exception and then forward. - - __ jmp(unwind_and_forward); - - interpreter_frame_manager = entry_point; - return entry_point; -} - - -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : CppInterpreterGenerator(code) { - generate_all(); // down here so it can be "virtual" -} - -// Deoptimization helpers for C++ interpreter - -// How much stack a method activation needs in words. -int AbstractInterpreter::size_top_interpreter_activation(Method* method) { - - const int stub_code = 4; // see generate_call_stub - // Save space for one monitor to get into the interpreted method in case - // the method is synchronized - int monitor_size = method->is_synchronized() ? - 1*frame::interpreter_frame_monitor_size() : 0; - - // total static overhead size. Account for interpreter state object, return - // address, saved rbp and 2 words for a "static long no_params() method" issue. - - const int overhead_size = sizeof(BytecodeInterpreter)/wordSize + - ( frame::sender_sp_offset - frame::link_offset) + 2; - - const int method_stack = (method->max_locals() + method->max_stack()) * - Interpreter::stackElementWords; - return overhead_size + method_stack + stub_code; -} - -// returns the activation size. -static int size_activation_helper(int extra_locals_size, int monitor_size) { - return (extra_locals_size + // the addition space for locals - 2*BytesPerWord + // return address and saved rbp - 2*BytesPerWord + // "static long no_params() method" issue - sizeof(BytecodeInterpreter) + // interpreterState - monitor_size); // monitors -} - -void BytecodeInterpreter::layout_interpreterState(interpreterState to_fill, - frame* caller, - frame* current, - Method* method, - intptr_t* locals, - intptr_t* stack, - intptr_t* stack_base, - intptr_t* monitor_base, - intptr_t* frame_bottom, - bool is_top_frame - ) -{ - // What about any vtable? - // - to_fill->_thread = JavaThread::current(); - // This gets filled in later but make it something recognizable for now - to_fill->_bcp = method->code_base(); - to_fill->_locals = locals; - to_fill->_constants = method->constants()->cache(); - to_fill->_method = method; - to_fill->_mdx = NULL; - to_fill->_stack = stack; - if (is_top_frame && JavaThread::current()->popframe_forcing_deopt_reexecution() ) { - to_fill->_msg = deopt_resume2; - } else { - to_fill->_msg = method_resume; - } - to_fill->_result._to_call._bcp_advance = 0; - to_fill->_result._to_call._callee_entry_point = NULL; // doesn't matter to anyone - to_fill->_result._to_call._callee = NULL; // doesn't matter to anyone - to_fill->_prev_link = NULL; - - to_fill->_sender_sp = caller->unextended_sp(); - - if (caller->is_interpreted_frame()) { - interpreterState prev = caller->get_interpreterState(); - to_fill->_prev_link = prev; - // *current->register_addr(GR_Iprev_state) = (intptr_t) prev; - // Make the prev callee look proper - prev->_result._to_call._callee = method; - if (*prev->_bcp == Bytecodes::_invokeinterface) { - prev->_result._to_call._bcp_advance = 5; - } else { - prev->_result._to_call._bcp_advance = 3; - } - } - to_fill->_oop_temp = NULL; - to_fill->_stack_base = stack_base; - // Need +1 here because stack_base points to the word just above the first expr stack entry - // and stack_limit is supposed to point to the word just below the last expr stack entry. - // See generate_compute_interpreter_state. - to_fill->_stack_limit = stack_base - (method->max_stack() + 1); - to_fill->_monitor_base = (BasicObjectLock*) monitor_base; - - to_fill->_self_link = to_fill; - assert(stack >= to_fill->_stack_limit && stack < to_fill->_stack_base, - "Stack top out of range"); -} - - -static int frame_size_helper(int max_stack, - int tempcount, - int moncount, - int callee_param_count, - int callee_locals, - bool is_top_frame, - int& monitor_size, - int& full_frame_size) { - int extra_locals_size = (callee_locals - callee_param_count) * BytesPerWord; - monitor_size = sizeof(BasicObjectLock) * moncount; - - // First calculate the frame size without any java expression stack - int short_frame_size = size_activation_helper(extra_locals_size, - monitor_size); - - // Now with full size expression stack - full_frame_size = short_frame_size + max_stack * BytesPerWord; - - // and now with only live portion of the expression stack - short_frame_size = short_frame_size + tempcount * BytesPerWord; - - // the size the activation is right now. Only top frame is full size - int frame_size = (is_top_frame ? full_frame_size : short_frame_size); - return frame_size; -} - -int AbstractInterpreter::size_activation(int max_stack, - int tempcount, - int extra_args, - int moncount, - int callee_param_count, - int callee_locals, - bool is_top_frame) { - assert(extra_args == 0, "FIX ME"); - // NOTE: return size is in words not bytes - - // Calculate the amount our frame will be adjust by the callee. For top frame - // this is zero. - - // NOTE: ia64 seems to do this wrong (or at least backwards) in that it - // calculates the extra locals based on itself. Not what the callee does - // to it. So it ignores last_frame_adjust value. Seems suspicious as far - // as getting sender_sp correct. - - int unused_monitor_size = 0; - int unused_full_frame_size = 0; - return frame_size_helper(max_stack, tempcount, moncount, callee_param_count, callee_locals, - is_top_frame, unused_monitor_size, unused_full_frame_size)/BytesPerWord; -} - -void AbstractInterpreter::layout_activation(Method* method, - int tempcount, // - int popframe_extra_args, - int moncount, - int caller_actual_parameters, - int callee_param_count, - int callee_locals, - frame* caller, - frame* interpreter_frame, - bool is_top_frame, - bool is_bottom_frame) { - - assert(popframe_extra_args == 0, "FIX ME"); - // NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state() - // does as far as allocating an interpreter frame. - // Set up the method, locals, and monitors. - // The frame interpreter_frame is guaranteed to be the right size, - // as determined by a previous call to the size_activation() method. - // It is also guaranteed to be walkable even though it is in a skeletal state - // NOTE: tempcount is the current size of the java expression stack. For top most - // frames we will allocate a full sized expression stack and not the curback - // version that non-top frames have. - - int monitor_size = 0; - int full_frame_size = 0; - int frame_size = frame_size_helper(method->max_stack(), tempcount, moncount, callee_param_count, callee_locals, - is_top_frame, monitor_size, full_frame_size); - -#ifdef ASSERT - assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable"); -#endif - - // MUCHO HACK - - intptr_t* frame_bottom = (intptr_t*) ((intptr_t)interpreter_frame->sp() - (full_frame_size - frame_size)); - - /* Now fillin the interpreterState object */ - - // The state object is the first thing on the frame and easily located - - interpreterState cur_state = (interpreterState) ((intptr_t)interpreter_frame->fp() - sizeof(BytecodeInterpreter)); - - - // Find the locals pointer. This is rather simple on x86 because there is no - // confusing rounding at the callee to account for. We can trivially locate - // our locals based on the current fp(). - // Note: the + 2 is for handling the "static long no_params() method" issue. - // (too bad I don't really remember that issue well...) - - intptr_t* locals; - // If the caller is interpreted we need to make sure that locals points to the first - // argument that the caller passed and not in an area where the stack might have been extended. - // because the stack to stack to converter needs a proper locals value in order to remove the - // arguments from the caller and place the result in the proper location. Hmm maybe it'd be - // simpler if we simply stored the result in the BytecodeInterpreter object and let the c++ code - // adjust the stack?? HMMM QQQ - // - if (caller->is_interpreted_frame()) { - // locals must agree with the caller because it will be used to set the - // caller's tos when we return. - interpreterState prev = caller->get_interpreterState(); - // stack() is prepushed. - locals = prev->stack() + method->size_of_parameters(); - // locals = caller->unextended_sp() + (method->size_of_parameters() - 1); - if (locals != interpreter_frame->fp() + frame::sender_sp_offset + (method->max_locals() - 1) + 2) { - // os::breakpoint(); - } - } else { - // this is where a c2i would have placed locals (except for the +2) - locals = interpreter_frame->fp() + frame::sender_sp_offset + (method->max_locals() - 1) + 2; - } - - intptr_t* monitor_base = (intptr_t*) cur_state; - intptr_t* stack_base = (intptr_t*) ((intptr_t) monitor_base - monitor_size); - /* +1 because stack is always prepushed */ - intptr_t* stack = (intptr_t*) ((intptr_t) stack_base - (tempcount + 1) * BytesPerWord); - - - BytecodeInterpreter::layout_interpreterState(cur_state, - caller, - interpreter_frame, - method, - locals, - stack, - stack_base, - monitor_base, - frame_bottom, - is_top_frame); - - // BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address, interpreter_frame->fp()); -} - -bool AbstractInterpreter::can_be_compiled(methodHandle m) { - switch (method_kind(m)) { - case Interpreter::java_lang_math_sin : // fall thru - case Interpreter::java_lang_math_cos : // fall thru - case Interpreter::java_lang_math_tan : // fall thru - case Interpreter::java_lang_math_abs : // fall thru - case Interpreter::java_lang_math_log : // fall thru - case Interpreter::java_lang_math_log10 : // fall thru - case Interpreter::java_lang_math_sqrt : // fall thru - case Interpreter::java_lang_math_pow : // fall thru - case Interpreter::java_lang_math_exp : - return false; - default: - return true; - } -} - - -#endif // CC_INTERP (all) diff --git a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp deleted file mode 100644 index 797fcebe385..00000000000 --- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_CPPINTERPRETER_X86_HPP -#define CPU_X86_VM_CPPINTERPRETER_X86_HPP - - - protected: - - // Size of interpreter code. Increase if too small. Interpreter will - // fail with a guarantee ("not enough space for interpreter generation"); - // if too small. - // Run with +PrintInterpreter to get the VM to print out the size. - // Max size with JVMTI - const static int InterpreterCodeSize = 168 * 1024; - -#endif // CPU_X86_VM_CPPINTERPRETER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index 9d77b092d4b..d61ae16729c 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -314,26 +314,6 @@ intptr_t* frame::entry_frame_argument_at(int offset) const { } // sender_sp -#ifdef CC_INTERP -intptr_t* frame::interpreter_frame_sender_sp() const { - assert(is_interpreted_frame(), "interpreted frame expected"); - // QQQ why does this specialize method exist if frame::sender_sp() does same thing? - // seems odd and if we always know interpreted vs. non then sender_sp() is really - // doing too much work. - return get_interpreterState()->sender_sp(); -} - -// monitor elements - -BasicObjectLock* frame::interpreter_frame_monitor_begin() const { - return get_interpreterState()->monitor_base(); -} - -BasicObjectLock* frame::interpreter_frame_monitor_end() const { - return (BasicObjectLock*) get_interpreterState()->stack_base(); -} - -#else // CC_INTERP intptr_t* frame::interpreter_frame_sender_sp() const { assert(is_interpreted_frame(), "interpreted frame expected"); @@ -368,7 +348,6 @@ void frame::interpreter_frame_set_monitor_end(BasicObjectLock* value) { void frame::interpreter_frame_set_last_sp(intptr_t* sp) { *((intptr_t**)addr_at(interpreter_frame_last_sp_offset)) = sp; } -#endif // CC_INTERP frame frame::sender_for_entry_frame(RegisterMap* map) const { assert(map != NULL, "map must be set"); @@ -524,9 +503,6 @@ frame frame::sender(RegisterMap* map) const { } bool frame::is_interpreted_frame_valid(JavaThread* thread) const { -// QQQ -#ifdef CC_INTERP -#else assert(is_interpreted_frame(), "Not an interpreted frame"); // These are reasonable sanity checks if (fp() == 0 || (intptr_t(fp()) & (wordSize-1)) != 0) { @@ -545,7 +521,6 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { } // do some validation of frame elements - // first the method Method* m = *interpreter_frame_method_addr(); @@ -580,17 +555,10 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { if (locals > thread->stack_base() || locals < (address) fp()) return false; // We'd have to be pretty unlucky to be mislead at this point - -#endif // CC_INTERP return true; } BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) { -#ifdef CC_INTERP - // Needed for JVMTI. The result should always be in the - // interpreterState object - interpreterState istate = get_interpreterState(); -#endif // CC_INTERP assert(is_interpreted_frame(), "interpreted frame expected"); Method* method = interpreter_frame_method(); BasicType type = method->result_type(); @@ -620,11 +588,7 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) case T_ARRAY : { oop obj; if (method->is_native()) { -#ifdef CC_INTERP - obj = istate->_oop_temp; -#else obj = cast_to_oop(at(interpreter_frame_oop_temp_offset)); -#endif // CC_INTERP } else { oop* obj_p = (oop*)tos_addr; obj = (obj_p == NULL) ? (oop)NULL : *obj_p; @@ -673,7 +637,6 @@ intptr_t* frame::interpreter_frame_tos_at(jint offset) const { void frame::describe_pd(FrameValues& values, int frame_no) { if (is_interpreted_frame()) { -#ifndef CC_INTERP DESCRIBE_FP_OFFSET(interpreter_frame_sender_sp); DESCRIBE_FP_OFFSET(interpreter_frame_last_sp); DESCRIBE_FP_OFFSET(interpreter_frame_method); @@ -692,7 +655,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) { } #endif // AMD64 } -#endif } #endif // !PRODUCT diff --git a/hotspot/src/cpu/x86/vm/frame_x86.hpp b/hotspot/src/cpu/x86/vm/frame_x86.hpp index 3d32d2bd2c5..f5df3c9b1e3 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.hpp @@ -101,8 +101,6 @@ // non-interpreter frames sender_sp_offset = 2, -#ifndef CC_INTERP - // Interpreter frames interpreter_frame_result_handler_offset = 3, // for native calls only interpreter_frame_oop_temp_offset = 2, // for native calls only @@ -120,8 +118,6 @@ interpreter_frame_monitor_block_top_offset = interpreter_frame_initial_sp_offset, interpreter_frame_monitor_block_bottom_offset = interpreter_frame_initial_sp_offset, -#endif // CC_INTERP - // Entry frames #ifdef AMD64 #ifdef _WIN64 @@ -193,13 +189,7 @@ // helper to update a map with callee-saved RBP static void update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr); -#ifndef CC_INTERP // deoptimization support void interpreter_frame_set_last_sp(intptr_t* sp); -#endif // CC_INTERP - -#ifdef CC_INTERP - inline interpreterState get_interpreterState() const; -#endif // CC_INTERP #endif // CPU_X86_VM_FRAME_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp index 3b5cd411ea3..374d83ca5cd 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp @@ -151,59 +151,6 @@ inline intptr_t* frame::unextended_sp() const { return _unextended_sp; } inline address* frame::sender_pc_addr() const { return (address*) addr_at( return_addr_offset); } inline address frame::sender_pc() const { return *sender_pc_addr(); } -#ifdef CC_INTERP - -inline interpreterState frame::get_interpreterState() const { - return ((interpreterState)addr_at( -((int)sizeof(BytecodeInterpreter))/wordSize )); -} - -inline intptr_t* frame::sender_sp() const { - // Hmm this seems awfully expensive QQQ, is this really called with interpreted frames? - if (is_interpreted_frame()) { - assert(false, "should never happen"); - return get_interpreterState()->sender_sp(); - } else { - return addr_at(sender_sp_offset); - } -} - -inline intptr_t** frame::interpreter_frame_locals_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return &(get_interpreterState()->_locals); -} - -inline intptr_t* frame::interpreter_frame_bcp_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return (intptr_t*) &(get_interpreterState()->_bcp); -} - - -// Constant pool cache - -inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return &(get_interpreterState()->_constants); -} - -// Method - -inline Method** frame::interpreter_frame_method_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return &(get_interpreterState()->_method); -} - -inline intptr_t* frame::interpreter_frame_mdp_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return (intptr_t*) &(get_interpreterState()->_mdx); -} - -// top of expression stack -inline intptr_t* frame::interpreter_frame_tos_address() const { - assert(is_interpreted_frame(), "wrong frame type"); - return get_interpreterState()->_stack + 1; -} - -#else /* asm interpreter */ inline intptr_t* frame::sender_sp() const { return addr_at( sender_sp_offset); } inline intptr_t** frame::interpreter_frame_locals_addr() const { @@ -255,8 +202,6 @@ inline oop* frame::interpreter_frame_temp_oop_addr() const { return (oop *)(fp() + interpreter_frame_oop_temp_offset); } -#endif /* CC_INTERP */ - inline int frame::pd_oop_map_offset_adjustment() const { return 0; } diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp index 2ac94e22e17..8cc7b46be13 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp @@ -45,7 +45,6 @@ void InterpreterMacroAssembler::jump_to_entry(address entry) { jump(RuntimeAddress(entry)); } -#ifndef CC_INTERP void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) { Label update, next, none; @@ -246,16 +245,7 @@ void InterpreterMacroAssembler::profile_parameters_type(Register mdp, Register t bind(profile_continue); } } -#endif -#ifdef CC_INTERP -void InterpreterMacroAssembler::get_method(Register reg) { - movptr(reg, Address(rbp, -(sizeof(BytecodeInterpreter) + 2 * wordSize))); - movptr(reg, Address(reg, byte_offset_of(BytecodeInterpreter, _method))); -} -#endif // CC_INTERP - -#ifndef CC_INTERP void InterpreterMacroAssembler::call_VM_leaf_base(address entry_point, int number_of_arguments) { // interpreter specific @@ -1046,7 +1036,6 @@ void InterpreterMacroAssembler::remove_activation( pop(ret_addr); // get return address mov(rsp, rbx); // set sp to sender sp } -#endif // !CC_INTERP void InterpreterMacroAssembler::get_method_counters(Register method, Register mcs, Label& skip) { @@ -1227,7 +1216,7 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) { restore_bcp(); } } -#ifndef CC_INTERP + void InterpreterMacroAssembler::test_method_data_pointer(Register mdp, Label& zero_continue) { assert(ProfileInterpreter, "must be profiling interpreter"); @@ -1886,7 +1875,6 @@ void InterpreterMacroAssembler::increment_mask_and_jump(Address counter_addr, andl(scratch, mask); jcc(cond, *where); } -#endif // CC_INTERP void InterpreterMacroAssembler::notify_method_entry() { // Whenever JVMTI is interp_only_mode, method entry/exit events are sent to @@ -1938,9 +1926,8 @@ void InterpreterMacroAssembler::notify_method_exit( // is changed then the interpreter_frame_result implementation will // need to be updated too. - // For c++ interpreter the result is always stored at a known location in the frame - // template interpreter will leave it on the top of the stack. - NOT_CC_INTERP(push(state);) + // template interpreter will leave the result on the top of the stack. + push(state); NOT_LP64(get_thread(rthread);) movl(rdx, Address(rthread, JavaThread::interp_only_mode_offset())); testl(rdx, rdx); @@ -1948,16 +1935,16 @@ void InterpreterMacroAssembler::notify_method_exit( call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit)); bind(L); - NOT_CC_INTERP(pop(state)); + pop(state); } { SkipIfEqual skip(this, &DTraceMethodProbes, false); - NOT_CC_INTERP(push(state)); + push(state); NOT_LP64(get_thread(rthread);) get_method(rarg); call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), rthread, rarg); - NOT_CC_INTERP(pop(state)); + pop(state); } } diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86.hpp index de467071b1b..470ac6e6399 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.hpp @@ -36,7 +36,6 @@ typedef ByteSize (*OffsetFunction)(uint); class InterpreterMacroAssembler: public MacroAssembler { -#ifndef CC_INTERP protected: // Interpreter specific version of call_VM_base virtual void call_VM_leaf_base(address entry_point, @@ -54,7 +53,6 @@ class InterpreterMacroAssembler: public MacroAssembler { // base routine for all dispatches void dispatch_base(TosState state, address* table, bool verifyoop = true); -#endif // CC_INTERP public: InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code), @@ -65,15 +63,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void load_earlyret_value(TosState state); -#ifdef CC_INTERP - void save_bcp() { /* not needed in c++ interpreter and harmless */ } - void restore_bcp() { /* not needed in c++ interpreter and harmless */ } - - // Helpers for runtime call arguments/results - void get_method(Register reg); - -#else - // Interpreter-specific registers void save_bcp() { movptr(Address(rbp, frame::interpreter_frame_bcp_offset * wordSize), _bcp_register); @@ -219,15 +208,12 @@ class InterpreterMacroAssembler: public MacroAssembler { bool throw_monitor_exception = true, bool install_monitor_exception = true, bool notify_jvmdi = true); -#endif // CC_INTERP void get_method_counters(Register method, Register mcs, Label& skip); // Object locking void lock_object (Register lock_reg); void unlock_object(Register lock_reg); -#ifndef CC_INTERP - // Interpreter profiling operations void set_method_data_pointer_for_bcp(); void test_method_data_pointer(Register mdp, Label& zero_continue); @@ -285,8 +271,6 @@ class InterpreterMacroAssembler: public MacroAssembler { // only if +VerifyFPU && (state == ftos || state == dtos) void verify_FPU(int stack_depth, TosState state = ftos); -#endif // !CC_INTERP - typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode; // support for jvmti/dtrace @@ -299,12 +283,10 @@ class InterpreterMacroAssembler: public MacroAssembler { Register _bcp_register; // register that contains the bcp public: -#ifndef CC_INTERP void profile_obj_type(Register obj, const Address& mdo_addr); void profile_arguments_type(Register mdp, Register callee, Register tmp, bool is_virtual); void profile_return_type(Register mdp, Register ret, Register tmp); void profile_parameters_type(Register mdp, Register tmp1, Register tmp2); -#endif /* !CC_INTERP */ }; diff --git a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp index e22e3d366a0..c91580ae124 100644 --- a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp @@ -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 @@ -25,26 +25,24 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #define __ _masm-> // Abstract method entry // Attempt to execute abstract method. Throw exception -address InterpreterGenerator::generate_abstract_entry(void) { +address TemplateInterpreterGenerator::generate_abstract_entry(void) { address entry_point = __ pc(); // abstract method entry -#ifndef CC_INTERP // pop return address, reset last_sp to NULL __ empty_expression_stack(); __ restore_bcp(); // rsi must be correct for exception handler (was destroyed) __ restore_locals(); // make sure locals pointer is correct as well (was destroyed) -#endif // throw exception __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); diff --git a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp deleted file mode 100644 index ad9ca0fba3d..00000000000 --- a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP -#define CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP - - -// Generation of Interpreter -// - friend class AbstractInterpreterGenerator; - - private: - - address generate_normal_entry(bool synchronized); - address generate_native_entry(bool synchronized); - address generate_abstract_entry(void); - address generate_math_entry(AbstractInterpreter::MethodKind kind); - address generate_accessor_entry(void) { return NULL; } - address generate_empty_entry(void) { return NULL; } - address generate_Reference_get_entry(); - address generate_CRC32_update_entry(); - address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind); - address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind); -#ifndef _LP64 - address generate_Float_intBitsToFloat_entry(); - address generate_Float_floatToRawIntBits_entry(); - address generate_Double_longBitsToDouble_entry(); - address generate_Double_doubleToRawLongBits_entry(); -#endif - void generate_stack_overflow_check(void); - - void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); - void generate_counter_overflow(Label* do_continue); - -#endif // CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86.hpp b/hotspot/src/cpu/x86/vm/interpreter_x86.hpp deleted file mode 100644 index 8a6169c0ca4..00000000000 --- a/hotspot/src/cpu/x86/vm/interpreter_x86.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 1997, 2011, 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. - * - */ - -#ifndef CPU_X86_VM_INTERPRETER_X86_HPP -#define CPU_X86_VM_INTERPRETER_X86_HPP - - public: - static Address::ScaleFactor stackElementScale() { - return NOT_LP64(Address::times_4) LP64_ONLY(Address::times_8); - } - - // Offset from rsp (which points to the last stack element) - static int expr_offset_in_bytes(int i) { return stackElementSize * i; } - - // Stack index relative to tos (which points at value) - static int expr_index_at(int i) { return stackElementWords * i; } - - // Already negated by c++ interpreter - static int local_index_at(int i) { - assert(i <= 0, "local direction already negated"); - return stackElementWords * i; - } - -#endif // CPU_X86_VM_INTERPRETER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp index a0e3f0685b6..efc8525c333 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp @@ -26,9 +26,9 @@ #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -66,7 +66,7 @@ address AbstractInterpreterGenerator::generate_slow_signature_handler() { } -address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { // rbx,: Method* // rcx: scratrch diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp index 42d7fecb8b1..9e597042095 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp @@ -26,9 +26,9 @@ #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -199,7 +199,7 @@ address AbstractInterpreterGenerator::generate_slow_signature_handler() { // Various method entries // -address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { // rbx,: Method* // rcx: scratrch diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 4cd0855dc3f..0bde2c6a516 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -2525,11 +2525,9 @@ void MacroAssembler::call_VM_base(Register oop_result, // Only interpreter should have to clear fp reset_last_Java_frame(java_thread, true, false); -#ifndef CC_INTERP // C++ interp handles this in the interpreter check_and_handle_popframe(java_thread); check_and_handle_earlyret(java_thread); -#endif /* CC_INTERP */ if (check_exceptions) { // check for pending exceptions (java_thread is set upon return) diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index e185330f231..1617abd3171 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -48,16 +48,9 @@ class MacroAssembler: public Assembler { // This is the base routine called by the different versions of call_VM_leaf. The interpreter // may customize this version by overriding it for its purposes (e.g., to save/restore // additional registers when doing a VM call). -#ifdef CC_INTERP - // c++ interpreter never wants to use interp_masm version of call_VM - #define VIRTUAL -#else - #define VIRTUAL virtual -#endif - #define COMMA , - VIRTUAL void call_VM_leaf_base( + virtual void call_VM_leaf_base( address entry_point, // the entry point int number_of_arguments // the number of arguments to pop after the call ); @@ -70,7 +63,7 @@ class MacroAssembler: public Assembler { // returns the register which contains the thread upon return. If a thread register has been // specified, the return value will correspond to that register. If no last_java_sp is specified // (noreg) than rsp will be used instead. - VIRTUAL void call_VM_base( // returns the register containing the thread upon return + virtual void call_VM_base( // returns the register containing the thread upon return Register oop_result, // where an oop-result ends up if any; use noreg otherwise Register java_thread, // the thread if computed before ; use noreg otherwise Register last_java_sp, // to set up last_Java_frame in stubs; use noreg otherwise @@ -1422,8 +1415,6 @@ public: void byte_array_inflate(Register src, Register dst, Register len, XMMRegister tmp1, Register tmp2); -#undef VIRTUAL - }; /** diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index 6da8628bd49..2125d7aa9fb 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp @@ -2652,30 +2652,14 @@ void SharedRuntime::generate_deopt_blob() { Label loop; __ bind(loop); __ movptr(rbx, Address(rsi, 0)); // Load frame size -#ifdef CC_INTERP - __ subptr(rbx, 4*wordSize); // we'll push pc and ebp by hand and -#ifdef ASSERT - __ push(0xDEADDEAD); // Make a recognizable pattern - __ push(0xDEADDEAD); -#else /* ASSERT */ - __ subptr(rsp, 2*wordSize); // skip the "static long no_param" -#endif /* ASSERT */ -#else /* CC_INTERP */ __ subptr(rbx, 2*wordSize); // we'll push pc and rbp, by hand -#endif /* CC_INTERP */ __ pushptr(Address(rcx, 0)); // save return address __ enter(); // save old & set new rbp, __ subptr(rsp, rbx); // Prolog! __ movptr(rbx, sp_temp); // sender's sp -#ifdef CC_INTERP - __ movptr(Address(rbp, - -(sizeof(BytecodeInterpreter)) + in_bytes(byte_offset_of(BytecodeInterpreter, _sender_sp))), - rbx); // Make it walkable -#else /* CC_INTERP */ // This value is corrected by layout_activation_impl __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD); __ movptr(Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize), rbx); // Make it walkable -#endif /* CC_INTERP */ __ movptr(sp_temp, rsp); // pass to next frame __ addptr(rsi, wordSize); // Bump array pointer (sizes) __ addptr(rcx, wordSize); // Bump array pointer (pcs) @@ -2894,30 +2878,14 @@ void SharedRuntime::generate_uncommon_trap_blob() { Label loop; __ bind(loop); __ movptr(rbx, Address(rsi, 0)); // Load frame size -#ifdef CC_INTERP - __ subptr(rbx, 4*wordSize); // we'll push pc and ebp by hand and -#ifdef ASSERT - __ push(0xDEADDEAD); // Make a recognizable pattern - __ push(0xDEADDEAD); // (parm to RecursiveInterpreter...) -#else /* ASSERT */ - __ subptr(rsp, 2*wordSize); // skip the "static long no_param" -#endif /* ASSERT */ -#else /* CC_INTERP */ __ subptr(rbx, 2*wordSize); // we'll push pc and rbp, by hand -#endif /* CC_INTERP */ __ pushptr(Address(rcx, 0)); // save return address __ enter(); // save old & set new rbp, __ subptr(rsp, rbx); // Prolog! __ movptr(rbx, sp_temp); // sender's sp -#ifdef CC_INTERP - __ movptr(Address(rbp, - -(sizeof(BytecodeInterpreter)) + in_bytes(byte_offset_of(BytecodeInterpreter, _sender_sp))), - rbx); // Make it walkable -#else /* CC_INTERP */ // This value is corrected by layout_activation_impl __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD ); __ movptr(Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize), rbx); // Make it walkable -#endif /* CC_INTERP */ __ movptr(sp_temp, rsp); // pass to next frame __ addptr(rsi, wordSize); // Bump array pointer (sizes) __ addptr(rcx, wordSize); // Bump array pointer (pcs) diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index 2af5ee60a1c..c2892ed2a88 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -3021,29 +3021,13 @@ void SharedRuntime::generate_deopt_blob() { Label loop; __ bind(loop); __ movptr(rbx, Address(rsi, 0)); // Load frame size -#ifdef CC_INTERP - __ subptr(rbx, 4*wordSize); // we'll push pc and ebp by hand and -#ifdef ASSERT - __ push(0xDEADDEAD); // Make a recognizable pattern - __ push(0xDEADDEAD); -#else /* ASSERT */ - __ subptr(rsp, 2*wordSize); // skip the "static long no_param" -#endif /* ASSERT */ -#else __ subptr(rbx, 2*wordSize); // We'll push pc and ebp by hand -#endif // CC_INTERP __ pushptr(Address(rcx, 0)); // Save return address __ enter(); // Save old & set new ebp __ subptr(rsp, rbx); // Prolog -#ifdef CC_INTERP - __ movptr(Address(rbp, - -(sizeof(BytecodeInterpreter)) + in_bytes(byte_offset_of(BytecodeInterpreter, _sender_sp))), - sender_sp); // Make it walkable -#else /* CC_INTERP */ // This value is corrected by layout_activation_impl __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD ); __ movptr(Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize), sender_sp); // Make it walkable -#endif /* CC_INTERP */ __ mov(sender_sp, rsp); // Pass sender_sp to next frame __ addptr(rsi, wordSize); // Bump array pointer (sizes) __ addptr(rcx, wordSize); // Bump array pointer (pcs) @@ -3242,16 +3226,10 @@ void SharedRuntime::generate_uncommon_trap_blob() { __ pushptr(Address(rcx, 0)); // Save return address __ enter(); // Save old & set new rbp __ subptr(rsp, rbx); // Prolog -#ifdef CC_INTERP - __ movptr(Address(rbp, - -(sizeof(BytecodeInterpreter)) + in_bytes(byte_offset_of(BytecodeInterpreter, _sender_sp))), - sender_sp); // Make it walkable -#else // CC_INTERP __ movptr(Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize), sender_sp); // Make it walkable // This value is corrected by layout_activation_impl __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD ); -#endif // CC_INTERP __ mov(sender_sp, rsp); // Pass sender_sp to next frame __ addptr(rsi, wordSize); // Bump array pointer (sizes) __ addptr(rcx, wordSize); // Bump array pointer (pcs) diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp index fc242b183c4..db047dfd0d4 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp @@ -25,10 +25,10 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" -#include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -49,8 +49,6 @@ #define __ _masm-> -#ifndef CC_INTERP - // Global Register Names static const Register rbcp = LP64_ONLY(r13) NOT_LP64(rsi); static const Register rlocals = LP64_ONLY(r14) NOT_LP64(rdi); @@ -361,7 +359,7 @@ address TemplateInterpreterGenerator::generate_safept_entry_for( // rbx: method // rcx: invocation counter // -void InterpreterGenerator::generate_counter_incr( +void TemplateInterpreterGenerator::generate_counter_incr( Label* overflow, Label* profile_method, Label* profile_method_continue) { @@ -436,7 +434,7 @@ void InterpreterGenerator::generate_counter_incr( } } -void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { +void TemplateInterpreterGenerator::generate_counter_overflow(Label& do_continue) { // Asm interpreter on entry // r14/rdi - locals @@ -466,7 +464,7 @@ void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { __ movptr(rbx, Address(rbp, method_offset)); // restore Method* // Preserve invariant that r13/r14 contain bcp/locals of sender frame // and jump to the interpreted entry. - __ jmp(*do_continue, relocInfo::none); + __ jmp(do_continue, relocInfo::none); } // See if we've got enough room on the stack for locals plus overhead. @@ -483,7 +481,7 @@ void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { // // Kills: // rax -void InterpreterGenerator::generate_stack_overflow_check(void) { +void TemplateInterpreterGenerator::generate_stack_overflow_check(void) { // monitor entry size: see picture of stack in frame_x86.hpp const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; @@ -687,7 +685,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) { // End of helpers // Method entry for java.lang.ref.Reference.get. -address InterpreterGenerator::generate_Reference_get_entry(void) { +address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { #if INCLUDE_ALL_GCS // Code: _aload_0, _getfield, _areturn // parameter size = 1 @@ -783,7 +781,7 @@ address InterpreterGenerator::generate_Reference_get_entry(void) { // Interpreter stub for calling a native method. (asm interpreter) // This sets up a somewhat different looking stack for calling the // native method than the typical interpreter frame setup. -address InterpreterGenerator::generate_native_entry(bool synchronized) { +address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // determine code generation flags bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods; @@ -1300,7 +1298,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { if (inc_counter) { // Handle overflow of counter and compile method __ bind(invocation_counter_overflow); - generate_counter_overflow(&continue_after_compile); + generate_counter_overflow(continue_after_compile); } return entry_point; @@ -1309,7 +1307,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { // // Generic interpreted method entry to (asm) interpreter // -address InterpreterGenerator::generate_normal_entry(bool synchronized) { +address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { // determine code generation flags bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods; @@ -1471,7 +1469,7 @@ address InterpreterGenerator::generate_normal_entry(bool synchronized) { } // Handle overflow of counter and compile method __ bind(invocation_counter_overflow); - generate_counter_overflow(&continue_after_compile); + generate_counter_overflow(continue_after_compile); } return entry_point; @@ -1767,18 +1765,6 @@ void TemplateInterpreterGenerator::set_vtos_entry_points(Template* t, generate_and_dispatch(t); } - -//----------------------------------------------------------------------------- -// Generation of individual instructions - -// helpers for generate_and_dispatch - - -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : TemplateInterpreterGenerator(code) { - generate_all(); // down here so it can be "virtual" -} - //----------------------------------------------------------------------------- // Non-product code @@ -1871,4 +1857,3 @@ void TemplateInterpreterGenerator::stop_interpreter_at() { __ bind(L); } #endif // !PRODUCT -#endif // ! CC_INTERP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp deleted file mode 100644 index 60e95057cef..00000000000 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_TEMPLATEINTERPRETERGENERATOR_X86_HPP -#define CPU_X86_VM_TEMPLATEINTERPRETERGENERATOR_X86_HPP - - protected: - - void generate_fixed_frame(bool native_call); - - // address generate_asm_interpreter_entry(bool synchronized); - -#endif // CPU_X86_VM_TEMPLATEINTERPRETERGENERATOR_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp index d43d2606829..c3496b3f4ce 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp @@ -24,20 +24,19 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "runtime/arguments.hpp" #define __ _masm-> -#ifndef CC_INTERP - /** * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) */ -address InterpreterGenerator::generate_CRC32_update_entry() { +address TemplateInterpreterGenerator::generate_CRC32_update_entry() { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -89,7 +88,7 @@ address InterpreterGenerator::generate_CRC32_update_entry() { * int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len) * int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len) */ -address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -155,7 +154,7 @@ address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpret * int java.util.zip.CRC32C.updateBytes(int crc, byte[] b, int off, int end) * int java.util.zip.CRC32C.updateByteBuffer(int crc, long address, int off, int end) */ -address InterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32CIntrinsics) { address entry = __ pc(); // Load parameters @@ -201,7 +200,7 @@ address InterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpre * Method entry for static native method: * java.lang.Float.intBitsToFloat(int bits) */ -address InterpreterGenerator::generate_Float_intBitsToFloat_entry() { +address TemplateInterpreterGenerator::generate_Float_intBitsToFloat_entry() { if (UseSSE >= 1) { address entry = __ pc(); @@ -227,7 +226,7 @@ address InterpreterGenerator::generate_Float_intBitsToFloat_entry() { * Method entry for static native method: * java.lang.Float.floatToRawIntBits(float value) */ -address InterpreterGenerator::generate_Float_floatToRawIntBits_entry() { +address TemplateInterpreterGenerator::generate_Float_floatToRawIntBits_entry() { if (UseSSE >= 1) { address entry = __ pc(); @@ -254,7 +253,7 @@ address InterpreterGenerator::generate_Float_floatToRawIntBits_entry() { * Method entry for static native method: * java.lang.Double.longBitsToDouble(long bits) */ -address InterpreterGenerator::generate_Double_longBitsToDouble_entry() { +address TemplateInterpreterGenerator::generate_Double_longBitsToDouble_entry() { if (UseSSE >= 2) { address entry = __ pc(); @@ -280,7 +279,7 @@ address InterpreterGenerator::generate_Double_longBitsToDouble_entry() { * Method entry for static native method: * java.lang.Double.doubleToRawLongBits(double value) */ -address InterpreterGenerator::generate_Double_doubleToRawLongBits_entry() { +address TemplateInterpreterGenerator::generate_Double_doubleToRawLongBits_entry() { if (UseSSE >= 2) { address entry = __ pc(); @@ -302,4 +301,3 @@ address InterpreterGenerator::generate_Double_doubleToRawLongBits_entry() { return NULL; } -#endif // CC_INTERP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp index b77270b02ca..e645a9ffe7e 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp @@ -24,19 +24,18 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "runtime/arguments.hpp" #define __ _masm-> -#ifndef CC_INTERP - /** * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) */ -address InterpreterGenerator::generate_CRC32_update_entry() { +address TemplateInterpreterGenerator::generate_CRC32_update_entry() { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -88,7 +87,7 @@ address InterpreterGenerator::generate_CRC32_update_entry() { * int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len) * int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len) */ -address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -149,7 +148,7 @@ address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpret * int java.util.zip.CRC32C.updateBytes(int crc, byte[] b, int off, int end) * int java.util.zip.CRC32C.updateByteBuffer(int crc, long address, int off, int end) */ -address InterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32CIntrinsics) { address entry = __ pc(); // Load parameters @@ -194,4 +193,3 @@ address InterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpre return NULL; } -#endif // ! CC_INTERP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp index 9b84f71bc3c..0e3cd9927c1 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp @@ -27,7 +27,16 @@ #include "interpreter/interpreter.hpp" #include "runtime/frame.inline.hpp" -#ifndef CC_INTERP +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +#ifdef AMD64 +int TemplateInterpreter::InterpreterCodeSize = 256 * 1024; +#else +int TemplateInterpreter::InterpreterCodeSize = 224 * 1024; +#endif // AMD64 // asm based interpreter deoptimization helpers int AbstractInterpreter::size_activation(int max_stack, @@ -38,7 +47,7 @@ int AbstractInterpreter::size_activation(int max_stack, int callee_locals, bool is_top_frame) { // Note: This calculation must exactly parallel the frame setup - // in InterpreterGenerator::generate_fixed_frame. + // in TemplateInterpreterGenerator::generate_fixed_frame. // fixed size of an interpreter frame: int overhead = frame::sender_sp_offset - @@ -198,5 +207,3 @@ int AbstractInterpreter::size_top_interpreter_activation(Method* method) { Interpreter::stackElementWords; return (overhead_size + method_stack + stub_code); } - -#endif // CC_INTERP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp deleted file mode 100644 index 071defbab0d..00000000000 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * 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. - * - */ - -#ifndef CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP -#define CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP - - - protected: - - // Size of interpreter code. Increase if too small. Interpreter will - // fail with a guarantee ("not enough space for interpreter generation"); - // if too small. - // Run with +PrintInterpreter to get the VM to print out the size. - // Max size with JVMTI -#ifdef AMD64 - const static int InterpreterCodeSize = 256 * 1024; -#else - const static int InterpreterCodeSize = 224 * 1024; -#endif // AMD64 - -#endif // CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp index b589e0100ce..42520c7e418 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp @@ -38,8 +38,6 @@ #include "runtime/synchronizer.hpp" #include "utilities/macros.hpp" -#ifndef CC_INTERP - #define __ _masm-> // Global Register Names @@ -4341,5 +4339,3 @@ void TemplateTable::multianewarray() { __ load_unsigned_byte(rbx, at_bcp(3)); __ lea(rsp, Address(rsp, rbx, Interpreter::stackElementScale())); // get rid of counts } -#endif /* !CC_INTERP */ - diff --git a/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp b/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp deleted file mode 100644 index 6b2cacf5ae2..00000000000 --- a/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2008, 2009 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 - * 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. - * - */ - -#ifndef CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP -#define CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP - - protected: - MacroAssembler* assembler() const { - return _masm; - } - - public: - static address generate_entry_impl(MacroAssembler* masm, address entry_point) { - ZeroEntry *entry = (ZeroEntry *) masm->pc(); - masm->advance(sizeof(ZeroEntry)); - entry->set_entry_point(entry_point); - return (address) entry; - } - - protected: - address generate_entry(address entry_point) { - return generate_entry_impl(assembler(), entry_point); - } - -#endif // CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp index 02497845c28..1bb7809ea43 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -27,8 +27,8 @@ #include "asm/assembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/cppInterpreter.hpp" +#include "interpreter/cppInterpreterGenerator.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -788,21 +788,21 @@ BasicType CppInterpreter::result_type_of(Method* method) { return t; } -address InterpreterGenerator::generate_empty_entry() { +address CppInterpreterGenerator::generate_empty_entry() { if (!UseFastEmptyMethods) return NULL; return generate_entry((address) CppInterpreter::empty_entry); } -address InterpreterGenerator::generate_accessor_entry() { +address CppInterpreterGenerator::generate_accessor_entry() { if (!UseFastAccessorMethods) return NULL; return generate_entry((address) CppInterpreter::accessor_entry); } -address InterpreterGenerator::generate_Reference_get_entry(void) { +address CppInterpreterGenerator::generate_Reference_get_entry(void) { #if INCLUDE_ALL_GCS if (UseG1GC) { // We need to generate have a routine that generates code to: @@ -822,20 +822,15 @@ address InterpreterGenerator::generate_Reference_get_entry(void) { return NULL; } -address InterpreterGenerator::generate_native_entry(bool synchronized) { +address CppInterpreterGenerator::generate_native_entry(bool synchronized) { return generate_entry((address) CppInterpreter::native_entry); } -address InterpreterGenerator::generate_normal_entry(bool synchronized) { +address CppInterpreterGenerator::generate_normal_entry(bool synchronized) { return generate_entry((address) CppInterpreter::normal_entry); } -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : CppInterpreterGenerator(code) { - generate_all(); -} - // Deoptimization helpers InterpreterFrame *InterpreterFrame::build(int size, TRAPS) { @@ -980,31 +975,4 @@ int AbstractInterpreter::size_top_interpreter_activation(Method* method) { bool CppInterpreter::contains(address pc) { return false; // make frame::print_value_on work } - -// Result handlers and convertors - -address CppInterpreterGenerator::generate_result_handler_for( - BasicType type) { - assembler()->advance(1); - return ShouldNotCallThisStub(); -} - -address CppInterpreterGenerator::generate_tosca_to_stack_converter( - BasicType type) { - assembler()->advance(1); - return ShouldNotCallThisStub(); -} - -address CppInterpreterGenerator::generate_stack_to_stack_converter( - BasicType type) { - assembler()->advance(1); - return ShouldNotCallThisStub(); -} - -address CppInterpreterGenerator::generate_stack_to_native_abi_converter( - BasicType type) { - assembler()->advance(1); - return ShouldNotCallThisStub(); -} - #endif // CC_INTERP diff --git a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp index 0ea5bbc4f77..f8011a25161 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -122,6 +122,11 @@ inline intptr_t* frame::interpreter_frame_mdp_addr() const { inline intptr_t* frame::interpreter_frame_tos_address() const { return get_interpreterState()->_stack + 1; } + +inline oop* frame::interpreter_frame_temp_oop_addr() const { + interpreterState istate = get_interpreterState(); + return (oop *)&istate->_oop_temp; +} #endif // CC_INTERP inline int frame::interpreter_frame_monitor_size() { diff --git a/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp b/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp deleted file mode 100644 index 8f54ae265a9..00000000000 --- a/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007 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 - * 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. - * - */ - -#ifndef CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP -#define CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP - - // Generation of Interpreter - // - friend class AbstractInterpreterGenerator; - - private: - address generate_normal_entry(bool synchronized); - address generate_native_entry(bool synchronized); - address generate_abstract_entry(); - address generate_math_entry(AbstractInterpreter::MethodKind kind); - address generate_empty_entry(); - address generate_accessor_entry(); - address generate_Reference_get_entry(); - - // Not supported - address generate_CRC32_update_entry() { return NULL; } - address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { return NULL; } - address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { return NULL; } -#endif // CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp index c99e9391b62..4675ecb4db1 100644 --- a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp @@ -26,8 +26,8 @@ #include "precompiled.hpp" #include "asm/assembler.hpp" #include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/cppInterpreterGenerator.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" @@ -57,7 +57,7 @@ address AbstractInterpreterGenerator::generate_slow_signature_handler() { return (address) InterpreterRuntime::slow_signature_handler; } -address InterpreterGenerator::generate_math_entry( +address CppInterpreterGenerator::generate_math_entry( AbstractInterpreter::MethodKind kind) { if (!InlineIntrinsics) return NULL; @@ -66,7 +66,7 @@ address InterpreterGenerator::generate_math_entry( return NULL; } -address InterpreterGenerator::generate_abstract_entry() { +address CppInterpreterGenerator::generate_abstract_entry() { return generate_entry((address) ShouldNotCallThisEntry()); } diff --git a/hotspot/src/cpu/zero/vm/interpreter_zero.hpp b/hotspot/src/cpu/zero/vm/interpreter_zero.hpp deleted file mode 100644 index 59900fe254f..00000000000 --- a/hotspot/src/cpu/zero/vm/interpreter_zero.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007, 2008 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 - * 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. - * - */ - -#ifndef CPU_ZERO_VM_INTERPRETER_ZERO_HPP -#define CPU_ZERO_VM_INTERPRETER_ZERO_HPP - - public: - static void invoke_method(Method* method, address entry_point, TRAPS) { - ((ZeroEntry *) entry_point)->invoke(method, THREAD); - } - static void invoke_osr(Method* method, - address entry_point, - address osr_buf, - TRAPS) { - ((ZeroEntry *) entry_point)->invoke_osr(method, osr_buf, THREAD); - } - - public: - static int expr_index_at(int i) { - return stackElementWords * i; - } - - static int expr_offset_in_bytes(int i) { - return stackElementSize * i; - } - - static int local_index_at(int i) { - assert(i <= 0, "local direction already negated"); - return stackElementWords * i; - } - -#endif // CPU_ZERO_VM_INTERPRETER_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp b/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp index a9c651c81f8..0fce3b50b07 100644 --- a/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp +++ b/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp @@ -24,7 +24,7 @@ */ #include "precompiled.hpp" -#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/cppInterpreterGenerator.hpp" #include "interpreter/interpreter.hpp" #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" @@ -167,16 +167,16 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* // Perhaps surprisingly, the symbolic references visible to Java are not directly used. // They are linked to Java-generated adapters via MethodHandleNatives.linkMethod. // They all allow an appendix argument. - return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invalid); + return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invalid); case vmIntrinsics::_invokeBasic: - return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invokeBasic); + return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invokeBasic); case vmIntrinsics::_linkToStatic: case vmIntrinsics::_linkToSpecial: - return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToStaticOrSpecial); + return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToStaticOrSpecial); case vmIntrinsics::_linkToInterface: - return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToInterface); + return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToInterface); case vmIntrinsics::_linkToVirtual: - return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToVirtual); + return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToVirtual); default: ShouldNotReachHere(); return NULL; diff --git a/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp b/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp deleted file mode 100644 index 1747bc6ea26..00000000000 --- a/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 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 - * 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. - * - */ - -#ifndef CPU_ZERO_VM_TEMPLATEINTERPRETERGENERATOR_ZERO_HPP -#define CPU_ZERO_VM_TEMPLATEINTERPRETERGENERATOR_ZERO_HPP - -// This file is intentionally empty - -#endif // CPU_ZERO_VM_TEMPLATEINTERPRETERGENERATOR_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp deleted file mode 100644 index abc58143bdf..00000000000 --- a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 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 - * 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. - * - */ - -#include "precompiled.hpp" -#include "asm/assembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/arguments.hpp" -#include "runtime/deoptimization.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" - -// This file is intentionally empty diff --git a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp b/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp deleted file mode 100644 index fb0e266a3a9..00000000000 --- a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 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 - * 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. - * - */ - -#ifndef CPU_ZERO_VM_TEMPLATEINTERPRETER_ZERO_HPP -#define CPU_ZERO_VM_TEMPLATEINTERPRETER_ZERO_HPP - -// This file is intentionally empty - -#endif // CPU_ZERO_VM_TEMPLATEINTERPRETER_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/templateTable_zero.cpp b/hotspot/src/cpu/zero/vm/templateTable_zero.cpp deleted file mode 100644 index 13016b2d58f..00000000000 --- a/hotspot/src/cpu/zero/vm/templateTable_zero.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 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 - * 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. - * - */ - -#include "precompiled.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/templateTable.hpp" -#include "memory/universe.inline.hpp" -#include "oops/methodData.hpp" -#include "oops/objArrayKlass.hpp" -#include "oops/oop.inline.hpp" -#include "prims/methodHandles.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" - -// This file is intentionally empty diff --git a/hotspot/src/cpu/zero/vm/templateTable_zero.hpp b/hotspot/src/cpu/zero/vm/templateTable_zero.hpp deleted file mode 100644 index 6fc38560522..00000000000 --- a/hotspot/src/cpu/zero/vm/templateTable_zero.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 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 - * 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. - * - */ - -#ifndef CPU_ZERO_VM_TEMPLATETABLE_ZERO_HPP -#define CPU_ZERO_VM_TEMPLATETABLE_ZERO_HPP - -// This file is intentionally empty - -#endif // CPU_ZERO_VM_TEMPLATETABLE_ZERO_HPP diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index e43d42d2d6d..62d1947e227 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -48,22 +48,13 @@ // Also code for populating interpreter // frames created during deoptimization. // -// For both template and c++ interpreter. There are common files for aspects of the interpreter -// that are generic to both interpreters. This is the layout: -// -// abstractInterpreter.hpp: generic description of the interpreter. -// interpreter*: generic frame creation and handling. -// - -//------------------------------------------------------------------------------------------------------------------------ -// The C++ interface to the bytecode interpreter(s). class InterpreterMacroAssembler; class AbstractInterpreter: AllStatic { friend class VMStructs; - friend class Interpreter; friend class CppInterpreterGenerator; + friend class TemplateInterpreterGenerator; public: enum MethodKind { zerolocals, // method needs locals initialization @@ -128,7 +119,6 @@ class AbstractInterpreter: AllStatic { static address _rethrow_exception_entry; // rethrows an activation in previous frame friend class AbstractInterpreterGenerator; - friend class InterpreterGenerator; friend class InterpreterMacroAssembler; public: @@ -213,6 +203,29 @@ class AbstractInterpreter: AllStatic { const static int stackElementSize = stackElementWords * wordSize; const static int logStackElementSize = LogBytesPerWord; + static int expr_index_at(int i) { + return stackElementWords * i; + } + + static int expr_offset_in_bytes(int i) { +#if !defined(ZERO) && (defined(PPC) || defined(SPARC)) + return stackElementSize * i + wordSize; // both point to one word past TOS +#else + return stackElementSize * i; +#endif + } + + static int local_index_at(int i) { + assert(i <= 0, "local direction already negated"); + return stackElementWords * i; + } + +#if !defined(ZERO) && (defined(IA32) || defined(AMD64)) + static Address::ScaleFactor stackElementScale() { + return NOT_LP64(Address::times_4) LP64_ONLY(Address::times_8); + } +#endif + // Local values relative to locals[n] static int local_offset_in_bytes(int n) { return ((frame::interpreter_frame_expression_stack_direction() * n) * stackElementSize); diff --git a/hotspot/src/share/vm/interpreter/bytecodeHistogram.hpp b/hotspot/src/share/vm/interpreter/bytecodeHistogram.hpp index 51798d1f078..8658f519f21 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeHistogram.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeHistogram.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, 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 @@ -59,7 +59,6 @@ class BytecodeHistogram: AllStatic { NOT_PRODUCT(static int _counters[Bytecodes::number_of_codes];) // a counter for each bytecode friend class TemplateInterpreterGenerator; - friend class InterpreterGenerator; friend class BytecodeInterpreter; public: @@ -87,7 +86,6 @@ class BytecodePairHistogram: AllStatic { NOT_PRODUCT(static int _counters[number_of_pairs];) // a counter for each pair friend class TemplateInterpreterGenerator; - friend class InterpreterGenerator; public: // Initialization diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp index 45e008408de..f7121d0309b 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp @@ -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 @@ -79,7 +79,6 @@ class BytecodeInterpreter : StackObj { friend class SharedRuntime; friend class AbstractInterpreterGenerator; friend class CppInterpreterGenerator; -friend class InterpreterGenerator; friend class InterpreterMacroAssembler; friend class frame; friend class VMStructs; @@ -572,24 +571,10 @@ static const char* C_msg(BytecodeInterpreter::messages msg); void print(); #endif // PRODUCT - // Platform fields/methods -#ifdef TARGET_ARCH_x86 -# include "bytecodeInterpreter_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytecodeInterpreter_sparc.hpp" -#endif #ifdef TARGET_ARCH_zero # include "bytecodeInterpreter_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytecodeInterpreter_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytecodeInterpreter_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "bytecodeInterpreter_aarch64.hpp" +#else +#error "Only Zero Bytecode Interpreter is supported" #endif diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp index 2f1bf00d9af..fcc8f5e976f 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, 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 @@ -42,24 +42,10 @@ #define VERIFY_OOP(o) #endif -// Platform dependent data manipulation -#ifdef TARGET_ARCH_x86 -# include "bytecodeInterpreter_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytecodeInterpreter_sparc.inline.hpp" -#endif #ifdef TARGET_ARCH_zero # include "bytecodeInterpreter_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytecodeInterpreter_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytecodeInterpreter_ppc.inline.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "bytecodeInterpreter_aarch64.inline.hpp" +#else +#error "Only Zero Bytecode Interpreter is supported" #endif #endif // CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.cpp b/hotspot/src/share/vm/interpreter/cppInterpreter.cpp index c154a746f4d..318dbd9a74a 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.cpp @@ -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 @@ -24,12 +24,17 @@ #include "precompiled.hpp" #include "interpreter/bytecodeInterpreter.hpp" +#include "interpreter/cppInterpreterGenerator.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #ifdef CC_INTERP -# define __ _masm-> + +#ifdef ZERO +# include "entry_zero.hpp" +#else +#error "Only Zero CppInterpreter is supported" +#endif void CppInterpreter::initialize() { if (_code != NULL) return; @@ -42,7 +47,7 @@ void CppInterpreter::initialize() { NOT_PRODUCT(code_size *= 4;) // debug uses extra interpreter code space _code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL, "Interpreter"); - InterpreterGenerator g(_code); + CppInterpreterGenerator g(_code); if (PrintInterpreter) print(); } @@ -56,11 +61,20 @@ void CppInterpreter::initialize() { } -address CppInterpreter::_tosca_to_stack [AbstractInterpreter::number_of_result_handlers]; -address CppInterpreter::_stack_to_stack [AbstractInterpreter::number_of_result_handlers]; -address CppInterpreter::_stack_to_native_abi [AbstractInterpreter::number_of_result_handlers]; +void CppInterpreter::invoke_method(Method* method, address entry_point, TRAPS) { + ((ZeroEntry *) entry_point)->invoke(method, THREAD); +} + +void CppInterpreter::invoke_osr(Method* method, + address entry_point, + address osr_buf, + TRAPS) { + ((ZeroEntry *) entry_point)->invoke_osr(method, osr_buf, THREAD); +} + CppInterpreterGenerator::CppInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { + generate_all(); } static const BasicType types[Interpreter::number_of_result_handlers] = { @@ -79,36 +93,8 @@ static const BasicType types[Interpreter::number_of_result_handlers] = { void CppInterpreterGenerator::generate_all() { AbstractInterpreterGenerator::generate_all(); - { CodeletMark cm(_masm, "result handlers for native calls"); - // The various result converter stublets. - int is_generated[Interpreter::number_of_result_handlers]; - memset(is_generated, 0, sizeof(is_generated)); - int _tosca_to_stack_is_generated[Interpreter::number_of_result_handlers]; - int _stack_to_stack_is_generated[Interpreter::number_of_result_handlers]; - int _stack_to_native_abi_is_generated[Interpreter::number_of_result_handlers]; - memset(_tosca_to_stack_is_generated, 0, sizeof(_tosca_to_stack_is_generated)); - memset(_stack_to_stack_is_generated, 0, sizeof(_stack_to_stack_is_generated)); - memset(_stack_to_native_abi_is_generated, 0, sizeof(_stack_to_native_abi_is_generated)); - for (int i = 0; i < Interpreter::number_of_result_handlers; i++) { - BasicType type = types[i]; - if (!is_generated[Interpreter::BasicType_as_index(type)]++) { - Interpreter::_native_abi_to_tosca[Interpreter::BasicType_as_index(type)] = generate_result_handler_for(type); - } - if (!_tosca_to_stack_is_generated[Interpreter::BasicType_as_index(type)]++) { - Interpreter::_tosca_to_stack[Interpreter::BasicType_as_index(type)] = generate_tosca_to_stack_converter(type); - } - if (!_stack_to_stack_is_generated[Interpreter::BasicType_as_index(type)]++) { - Interpreter::_stack_to_stack[Interpreter::BasicType_as_index(type)] = generate_stack_to_stack_converter(type); - } - if (!_stack_to_native_abi_is_generated[Interpreter::BasicType_as_index(type)]++) { - Interpreter::_stack_to_native_abi[Interpreter::BasicType_as_index(type)] = generate_stack_to_native_abi_converter(type); - } - } - } - - -#define method_entry(kind) Interpreter::_entry_table[Interpreter::kind] = ((InterpreterGenerator*)this)->generate_method_entry(Interpreter::kind) +#define method_entry(kind) Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind) { CodeletMark cm(_masm, "(kind = frame_manager)"); // all non-native method kinds @@ -138,7 +124,63 @@ void CppInterpreterGenerator::generate_all() { #undef method_entry - } +InterpreterCodelet* CppInterpreter::codelet_containing(address pc) { + // FIXME: I'm pretty sure _code is null and this is never called, which is why it's copied. + return (InterpreterCodelet*)_code->stub_containing(pc); +} + +// Generate method entries +address CppInterpreterGenerator::generate_method_entry( + AbstractInterpreter::MethodKind kind) { + // determine code generation flags + bool native = false; + bool synchronized = false; + address entry_point = NULL; + + switch (kind) { + case Interpreter::zerolocals : break; + case Interpreter::zerolocals_synchronized: synchronized = true; break; + case Interpreter::native : native = true; break; + case Interpreter::native_synchronized : native = true; synchronized = true; break; + case Interpreter::empty : entry_point = generate_empty_entry(); break; + case Interpreter::accessor : entry_point = generate_accessor_entry(); break; + case Interpreter::abstract : entry_point = generate_abstract_entry(); break; + + case Interpreter::java_lang_math_sin : // fall thru + case Interpreter::java_lang_math_cos : // fall thru + case Interpreter::java_lang_math_tan : // fall thru + case Interpreter::java_lang_math_abs : // fall thru + case Interpreter::java_lang_math_log : // fall thru + case Interpreter::java_lang_math_log10 : // fall thru + case Interpreter::java_lang_math_sqrt : // fall thru + case Interpreter::java_lang_math_pow : // fall thru + case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; + case Interpreter::java_lang_ref_reference_get + : entry_point = generate_Reference_get_entry(); break; + default: + fatal("unexpected method kind: %d", kind); + break; + } + + if (entry_point) { + return entry_point; + } + + // We expect the normal and native entry points to be generated first so we can reuse them. + if (native) { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); + if (entry_point == NULL) { + entry_point = generate_native_entry(synchronized); + } + } else { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); + if (entry_point == NULL) { + entry_point = generate_normal_entry(synchronized); + } + } + + return entry_point; +} #endif // CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp index 3a3913348d7..3d90155bd9c 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, 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 @@ -26,40 +26,24 @@ #define SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP #include "interpreter/abstractInterpreter.hpp" - #ifdef CC_INTERP +class InterpreterCodelet; + // This file contains the platform-independent parts // of the c++ interpreter class CppInterpreter: public AbstractInterpreter { friend class VMStructs; - friend class Interpreter; // contains() - friend class InterpreterGenerator; // result handlers - friend class CppInterpreterGenerator; // result handlers - public: - - - protected: - - // tosca result -> stack result - static address _tosca_to_stack[number_of_result_handlers]; // converts tosca to C++ interpreter stack result - // stack result -> stack result - static address _stack_to_stack[number_of_result_handlers]; // pass result between C++ interpreter calls - // stack result -> native abi result - static address _stack_to_native_abi[number_of_result_handlers]; // converts C++ interpreter results to native abi - - // this is to allow frame and only frame to use contains(). - friend class frame; - public: // Initialization/debugging static void initialize(); // this only returns whether a pc is within generated code for the interpreter. - // This is a moderately dubious interface for the c++ interpreter. Only + // These are moderately dubious interfaces for the c++ interpreter. Only // frame code and debug.cpp should be using it. static bool contains(address pc); + static InterpreterCodelet* codelet_containing(address pc); public: @@ -68,38 +52,17 @@ class CppInterpreter: public AbstractInterpreter { static void notice_safepoints() {} static void ignore_safepoints() {} - static address native_result_to_tosca() { return (address)_native_abi_to_tosca; } // aka result handler - static address tosca_result_to_stack() { return (address)_tosca_to_stack; } - static address stack_result_to_stack() { return (address)_stack_to_stack; } - static address stack_result_to_native() { return (address)_stack_to_native_abi; } - - static address native_result_to_tosca(int index) { return _native_abi_to_tosca[index]; } // aka result handler - static address tosca_result_to_stack(int index) { return _tosca_to_stack[index]; } - static address stack_result_to_stack(int index) { return _stack_to_stack[index]; } - static address stack_result_to_native(int index) { return _stack_to_native_abi[index]; } - static address return_entry (TosState state, int length, Bytecodes::Code code); static address deopt_entry (TosState state, int length); -#ifdef TARGET_ARCH_x86 -# include "cppInterpreter_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "cppInterpreter_sparc.hpp" -#endif + static void invoke_method(Method* method, address entry_point, TRAPS); + static void invoke_osr(Method* method, + address entry_point, + address osr_buf, + TRAPS); #ifdef TARGET_ARCH_zero # include "cppInterpreter_zero.hpp" #endif -#ifdef TARGET_ARCH_arm -# include "cppInterpreter_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "cppInterpreter_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "cppInterpreter_aarch64.hpp" -#endif - }; diff --git a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp index 92db9351b0c..69072c7f50c 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, 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 @@ -29,46 +29,48 @@ // of the template interpreter generator. #ifdef CC_INTERP -#ifdef TARGET_ARCH_zero +#ifdef ZERO # include "entry_zero.hpp" # include "interpreter/interp_masm.hpp" #endif class CppInterpreterGenerator: public AbstractInterpreterGenerator { - protected: - // shared code sequences - // Converter for native abi result to tosca result - address generate_result_handler_for(BasicType type); - address generate_tosca_to_stack_converter(BasicType type); - address generate_stack_to_stack_converter(BasicType type); - address generate_stack_to_native_abi_converter(BasicType type); + private: void generate_all(); + address generate_method_entry(AbstractInterpreter::MethodKind kind); + address generate_normal_entry(bool synchronized); + address generate_native_entry(bool synchronized); + address generate_abstract_entry(); + address generate_math_entry(AbstractInterpreter::MethodKind kind); + address generate_empty_entry(); + address generate_accessor_entry(); + address generate_Reference_get_entry(); + public: CppInterpreterGenerator(StubQueue* _code); -#ifdef TARGET_ARCH_x86 -# include "cppInterpreterGenerator_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "cppInterpreterGenerator_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "cppInterpreterGenerator_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "cppInterpreterGenerator_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "cppInterpreterGenerator_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "cppInterpreterGenerator_aarch64.hpp" -#endif +#ifdef ZERO + protected: + MacroAssembler* assembler() const { + return _masm; + } + public: + static address generate_entry_impl(MacroAssembler* masm, address entry_point) { + ZeroEntry *entry = (ZeroEntry *) masm->pc(); + masm->advance(sizeof(ZeroEntry)); + entry->set_entry_point(entry_point); + return (address) entry; + } + + protected: + address generate_entry(address entry_point) { + return generate_entry_impl(assembler(), entry_point); + } +#endif // ZERO }; #endif // CC_INTERP - #endif // SHARE_VM_INTERPRETER_CPPINTERPRETERGENERATOR_HPP diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index a8a71c4c9a5..3101d3628f6 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -29,7 +29,6 @@ #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/bytecodeInterpreter.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" @@ -282,7 +281,7 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) // Special intrinsic method? // Note: This test must come _after_ the test for native methods, // otherwise we will run into problems with JDK 1.2, see also - // InterpreterGenerator::generate_method_entry() for + // TemplateInterpreterGenerator::generate_method_entry() for // for details. switch (m->intrinsic_id()) { case vmIntrinsics::_dsin : return java_lang_math_sin ; @@ -548,87 +547,3 @@ void AbstractInterpreterGenerator::initialize_method_handle_entries() { Interpreter::_entry_table[kind] = Interpreter::_entry_table[Interpreter::abstract]; } } - -// Generate method entries -address InterpreterGenerator::generate_method_entry( - AbstractInterpreter::MethodKind kind) { - // determine code generation flags - bool native = false; - bool synchronized = false; - address entry_point = NULL; - - switch (kind) { - case Interpreter::zerolocals : break; - case Interpreter::zerolocals_synchronized: synchronized = true; break; - case Interpreter::native : native = true; break; - case Interpreter::native_synchronized : native = true; synchronized = true; break; - case Interpreter::empty : entry_point = generate_empty_entry(); break; - case Interpreter::accessor : entry_point = generate_accessor_entry(); break; - case Interpreter::abstract : entry_point = generate_abstract_entry(); break; - - case Interpreter::java_lang_math_sin : // fall thru - case Interpreter::java_lang_math_cos : // fall thru - case Interpreter::java_lang_math_tan : // fall thru - case Interpreter::java_lang_math_abs : // fall thru - case Interpreter::java_lang_math_log : // fall thru - case Interpreter::java_lang_math_log10 : // fall thru - case Interpreter::java_lang_math_sqrt : // fall thru - case Interpreter::java_lang_math_pow : // fall thru - case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; - case Interpreter::java_lang_ref_reference_get - : entry_point = generate_Reference_get_entry(); break; -#ifndef CC_INTERP - case Interpreter::java_util_zip_CRC32_update - : native = true; entry_point = generate_CRC32_update_entry(); break; - case Interpreter::java_util_zip_CRC32_updateBytes - : // fall thru - case Interpreter::java_util_zip_CRC32_updateByteBuffer - : native = true; entry_point = generate_CRC32_updateBytes_entry(kind); break; - case Interpreter::java_util_zip_CRC32C_updateBytes - : // fall thru - case Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer - : entry_point = generate_CRC32C_updateBytes_entry(kind); break; -#if defined(TARGET_ARCH_x86) && !defined(_LP64) - // On x86_32 platforms, a special entry is generated for the following four methods. - // On other platforms the normal entry is used to enter these methods. - case Interpreter::java_lang_Float_intBitsToFloat - : native = true; entry_point = generate_Float_intBitsToFloat_entry(); break; - case Interpreter::java_lang_Float_floatToRawIntBits - : native = true; entry_point = generate_Float_floatToRawIntBits_entry(); break; - case Interpreter::java_lang_Double_longBitsToDouble - : native = true; entry_point = generate_Double_longBitsToDouble_entry(); break; - case Interpreter::java_lang_Double_doubleToRawLongBits - : native = true; entry_point = generate_Double_doubleToRawLongBits_entry(); break; -#else - case Interpreter::java_lang_Float_intBitsToFloat: - case Interpreter::java_lang_Float_floatToRawIntBits: - case Interpreter::java_lang_Double_longBitsToDouble: - case Interpreter::java_lang_Double_doubleToRawLongBits: - native = true; - break; -#endif // defined(TARGET_ARCH_x86) && !defined(_LP64) -#endif // CC_INTERP - default: - fatal("unexpected method kind: %d", kind); - break; - } - - if (entry_point) { - return entry_point; - } - - // We expect the normal and native entry points to be generated first so we can reuse them. - if (native) { - entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); - if (entry_point == NULL) { - entry_point = generate_native_entry(synchronized); - } - } else { - entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); - if (entry_point == NULL) { - entry_point = generate_normal_entry(synchronized); - } - } - - return entry_point; -} diff --git a/hotspot/src/share/vm/interpreter/interpreter.hpp b/hotspot/src/share/vm/interpreter/interpreter.hpp index c83294a6cdc..d61166b745d 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.hpp +++ b/hotspot/src/share/vm/interpreter/interpreter.hpp @@ -29,9 +29,6 @@ #include "interpreter/cppInterpreter.hpp" #include "interpreter/templateInterpreter.hpp" #include "memory/resourceArea.hpp" -#ifdef TARGET_ARCH_zero -# include "entry_zero.hpp" -#endif // This file contains the platform-independent parts // of the interpreter and the interpreter generator. @@ -116,34 +113,9 @@ class CodeletMark: ResourceMark { ~CodeletMark(); }; -// Wrapper classes to produce Interpreter/InterpreterGenerator from either +// Wrapper typedef to use the name Interpreter to mean either // the c++ interpreter or the template interpreter. -class Interpreter: public CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateInterpreter) { - - public: - // Debugging/printing - static InterpreterCodelet* codelet_containing(address pc) { return (InterpreterCodelet*)_code->stub_containing(pc); } - -#ifdef TARGET_ARCH_x86 -# include "interpreter_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "interpreter_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "interpreter_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "interpreter_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "interpreter_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "interpreter_aarch64.hpp" -#endif - -}; +typedef CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateInterpreter) Interpreter; #endif // SHARE_VM_INTERPRETER_INTERPRETER_HPP diff --git a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp deleted file mode 100644 index fab133108bd..00000000000 --- a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_VM_INTERPRETER_INTERPRETERGENERATOR_HPP -#define SHARE_VM_INTERPRETER_INTERPRETERGENERATOR_HPP - -#include "interpreter/cppInterpreter.hpp" -#include "interpreter/cppInterpreterGenerator.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreter.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" - -// This file contains the platform-independent parts -// of the interpreter generator. - - -class InterpreterGenerator: public CC_INTERP_ONLY(CppInterpreterGenerator) - NOT_CC_INTERP(TemplateInterpreterGenerator) { - - public: - - InterpreterGenerator(StubQueue* _code); - // entry point generator - address generate_method_entry(AbstractInterpreter::MethodKind kind); - -#ifdef TARGET_ARCH_x86 -# include "interpreterGenerator_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "interpreterGenerator_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "interpreterGenerator_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "interpreterGenerator_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "interpreterGenerator_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "interpreterGenerator_aarch64.hpp" -#endif - - -}; - -#endif // SHARE_VM_INTERPRETER_INTERPRETERGENERATOR_HPP diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp index 8bf2722442a..8212ccc1f59 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp @@ -115,7 +115,7 @@ class InterpreterRuntime: AllStatic { static void note_rangeCheck_trap(JavaThread* thread, Method *method, int trap_bci); static void note_classCheck_trap(JavaThread* thread, Method *method, int trap_bci); static void note_arrayCheck_trap(JavaThread* thread, Method *method, int trap_bci); - // A dummy for makros that shall not profile traps. + // A dummy for macros that shall not profile traps. static void note_no_trap(JavaThread* thread, Method *method, int trap_bci) {} #endif // CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp index 73beefc6766..96e8faeafa8 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp @@ -25,10 +25,10 @@ #include "precompiled.hpp" #include "code/codeCacheExtensions.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" #include "interpreter/templateInterpreter.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #ifndef CC_INTERP @@ -59,7 +59,7 @@ void TemplateInterpreter::initialize() { #endif _code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL, "Interpreter"); - InterpreterGenerator g(_code); + TemplateInterpreterGenerator g(_code); } if (PrintInterpreter) { if (CodeCacheExtensions::saving_generated_interpreter() && @@ -222,6 +222,7 @@ address TemplateInterpreter::_wentry_point[DispatchTable::length]; TemplateInterpreterGenerator::TemplateInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { _unimplemented_bytecode = NULL; _illegal_bytecode_sequence = NULL; + generate_all(); } static const BasicType types[Interpreter::number_of_result_handlers] = { @@ -392,7 +393,7 @@ void TemplateInterpreterGenerator::generate_all() { #define method_entry(kind) \ { CodeletMark cm(_masm, "method entry point (kind = " #kind ")"); \ - Interpreter::_entry_table[Interpreter::kind] = ((InterpreterGenerator*)this)->generate_method_entry(Interpreter::kind); \ + Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind); \ } // all non-native method kinds @@ -719,4 +720,89 @@ bool TemplateInterpreter::bytecode_should_reexecute(Bytecodes::Code code) { } } +InterpreterCodelet* TemplateInterpreter::codelet_containing(address pc) { + return (InterpreterCodelet*)_code->stub_containing(pc); +} + +// Generate method entries +address TemplateInterpreterGenerator::generate_method_entry( + AbstractInterpreter::MethodKind kind) { + // determine code generation flags + bool native = false; + bool synchronized = false; + address entry_point = NULL; + + switch (kind) { + case Interpreter::zerolocals : break; + case Interpreter::zerolocals_synchronized: synchronized = true; break; + case Interpreter::native : native = true; break; + case Interpreter::native_synchronized : native = true; synchronized = true; break; + case Interpreter::empty : break; + case Interpreter::accessor : break; + case Interpreter::abstract : entry_point = generate_abstract_entry(); break; + + case Interpreter::java_lang_math_sin : // fall thru + case Interpreter::java_lang_math_cos : // fall thru + case Interpreter::java_lang_math_tan : // fall thru + case Interpreter::java_lang_math_abs : // fall thru + case Interpreter::java_lang_math_log : // fall thru + case Interpreter::java_lang_math_log10 : // fall thru + case Interpreter::java_lang_math_sqrt : // fall thru + case Interpreter::java_lang_math_pow : // fall thru + case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; + case Interpreter::java_lang_ref_reference_get + : entry_point = generate_Reference_get_entry(); break; + case Interpreter::java_util_zip_CRC32_update + : native = true; entry_point = generate_CRC32_update_entry(); break; + case Interpreter::java_util_zip_CRC32_updateBytes + : // fall thru + case Interpreter::java_util_zip_CRC32_updateByteBuffer + : native = true; entry_point = generate_CRC32_updateBytes_entry(kind); break; + case Interpreter::java_util_zip_CRC32C_updateBytes + : // fall thru + case Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer + : entry_point = generate_CRC32C_updateBytes_entry(kind); break; +#ifdef IA32 + // On x86_32 platforms, a special entry is generated for the following four methods. + // On other platforms the normal entry is used to enter these methods. + case Interpreter::java_lang_Float_intBitsToFloat + : native = true; entry_point = generate_Float_intBitsToFloat_entry(); break; + case Interpreter::java_lang_Float_floatToRawIntBits + : native = true; entry_point = generate_Float_floatToRawIntBits_entry(); break; + case Interpreter::java_lang_Double_longBitsToDouble + : native = true; entry_point = generate_Double_longBitsToDouble_entry(); break; + case Interpreter::java_lang_Double_doubleToRawLongBits + : native = true; entry_point = generate_Double_doubleToRawLongBits_entry(); break; +#else + case Interpreter::java_lang_Float_intBitsToFloat: + case Interpreter::java_lang_Float_floatToRawIntBits: + case Interpreter::java_lang_Double_longBitsToDouble: + case Interpreter::java_lang_Double_doubleToRawLongBits: + native = true; + break; +#endif // defined(TARGET_ARCH_x86) && !defined(_LP64) + default: + fatal("unexpected method kind: %d", kind); + break; + } + + if (entry_point) { + return entry_point; + } + + // We expect the normal and native entry points to be generated first so we can reuse them. + if (native) { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); + if (entry_point == NULL) { + entry_point = generate_native_entry(synchronized); + } + } else { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); + if (entry_point == NULL) { + entry_point = generate_normal_entry(synchronized); + } + } + + return entry_point; +} #endif // !CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp index 5c9f60d1414..8a5f4910283 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -34,6 +34,7 @@ #ifndef CC_INTERP class InterpreterMacroAssembler; +class InterpreterCodelet; //------------------------------------------------------------------------------------------------------------------------ // A little wrapper class to group tosca-specific entry points into a unit. @@ -85,7 +86,6 @@ class TemplateInterpreter: public AbstractInterpreter { friend class VMStructs; friend class InterpreterMacroAssembler; friend class TemplateInterpreterGenerator; - friend class InterpreterGenerator; friend class TemplateTable; friend class CodeCacheExtensions; // friend class Interpreter; @@ -137,6 +137,9 @@ class TemplateInterpreter: public AbstractInterpreter { static void initialize(); // this only returns whether a pc is within generated code for the interpreter. static bool contains(address pc) { return _code != NULL && _code->contains(pc); } + // Debugging/printing + static InterpreterCodelet* codelet_containing(address pc); + public: @@ -188,26 +191,15 @@ class TemplateInterpreter: public AbstractInterpreter { // Compute the address for reexecution static address deopt_reexecute_entry(Method* method, address bcp); -#ifdef TARGET_ARCH_x86 -# include "templateInterpreter_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "templateInterpreter_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "templateInterpreter_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "templateInterpreter_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "templateInterpreter_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "templateInterpreter_aarch64.hpp" -#endif - + // Size of interpreter code. Max size with JVMTI + static int InterpreterCodeSize; +#ifdef PPC + public: + // PPC-only: Support abs and sqrt like in compiler. + // For others we can use a normal (native) entry. + static bool math_entry_available(AbstractInterpreter::MethodKind kind); +#endif }; #endif // !CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp index e229485ce96..e53e6ac0211 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp @@ -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 @@ -82,29 +82,51 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { void generate_all(); + // entry point generator + address generate_method_entry(AbstractInterpreter::MethodKind kind); + + address generate_normal_entry(bool synchronized); + address generate_native_entry(bool synchronized); + address generate_abstract_entry(void); + address generate_math_entry(AbstractInterpreter::MethodKind kind); + address generate_Reference_get_entry(); + address generate_CRC32_update_entry(); + address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind); + address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind); +#ifdef IA32 + address generate_Float_intBitsToFloat_entry(); + address generate_Float_floatToRawIntBits_entry(); + address generate_Double_longBitsToDouble_entry(); + address generate_Double_doubleToRawLongBits_entry(); +#endif // IA32 + void generate_stack_overflow_check(void); + + void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); + void generate_counter_overflow(Label& continue_entry); + + void generate_fixed_frame(bool native_call); +#ifdef SPARC + void generate_stack_overflow_check(Register Rframe_size, Register Rscratch, + Register Rscratch2); + void save_native_result(void); + void restore_native_result(void); +#endif // SPARC + +#ifdef AARCH64 + void bang_stack_shadow_pages(bool native_call); + void generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs); +#endif // AARCH64 + +#ifdef PPC + void lock_method(Register Rflags, Register Rscratch1, Register Rscratch2, bool flags_preloaded=false); + void unlock_method(bool check_exceptions = true); + + void generate_fixed_frame(bool native_call, Register Rsize_of_parameters, Register Rsize_of_locals); + void generate_stack_overflow_check(Register Rframe_size, Register Rscratch1); +#endif // PPC + public: TemplateInterpreterGenerator(StubQueue* _code); - -#ifdef TARGET_ARCH_x86 -# include "templateInterpreterGenerator_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "templateInterpreterGenerator_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "templateInterpreterGenerator_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "templateInterpreterGenerator_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "templateInterpreterGenerator_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "templateInterpreterGenerator_aarch64.hpp" -#endif - - }; #endif // !CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp index bd4a76493d9..e32b37afe6c 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.hpp +++ b/hotspot/src/share/vm/interpreter/templateTable.hpp @@ -355,8 +355,6 @@ class TemplateTable: AllStatic { # include "templateTable_x86.hpp" #elif defined TARGET_ARCH_MODEL_sparc # include "templateTable_sparc.hpp" -#elif defined TARGET_ARCH_MODEL_zero -# include "templateTable_zero.hpp" #elif defined TARGET_ARCH_MODEL_ppc_64 # include "templateTable_ppc_64.hpp" #elif defined TARGET_ARCH_MODEL_aarch64 diff --git a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp index ab41c31b4a3..ad3a6aefcc8 100644 --- a/hotspot/src/share/vm/prims/methodHandles.hpp +++ b/hotspot/src/share/vm/prims/methodHandles.hpp @@ -31,6 +31,12 @@ #include "runtime/globals.hpp" #include "runtime/interfaceSupport.hpp" +#ifdef TARGET_ARCH_zero +# include "entry_zero.hpp" +#endif + + + class MacroAssembler; class Label; diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index fe8dbf1b183..915e4c2b6ad 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -4197,7 +4197,7 @@ jint Arguments::apply_ergo() { UseBiasedLocking = false; } -#ifdef ZERO +#ifdef CC_INTERP // Clear flags not supported on zero. FLAG_SET_DEFAULT(ProfileInterpreter, false); FLAG_SET_DEFAULT(UseBiasedLocking, false); diff --git a/hotspot/src/share/vm/runtime/frame.inline.hpp b/hotspot/src/share/vm/runtime/frame.inline.hpp index eee2833341a..79ba0f98850 100644 --- a/hotspot/src/share/vm/runtime/frame.inline.hpp +++ b/hotspot/src/share/vm/runtime/frame.inline.hpp @@ -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 @@ -50,13 +50,6 @@ inline bool frame::is_first_frame() const { return is_entry_frame() && entry_frame_is_first(); } -#ifdef CC_INTERP -inline oop* frame::interpreter_frame_temp_oop_addr() const { - interpreterState istate = get_interpreterState(); - return (oop *)&istate->_oop_temp; -} -#endif // CC_INTERP - // here are the platform-dependent bodies: #ifdef TARGET_ARCH_x86 diff --git a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp index fa3c279e001..72c1fec5135 100644 --- a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp +++ b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, 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 @@ -41,7 +41,6 @@ friend class Runtime1; friend class StubAssembler; friend class CallRuntimeDirectNode; friend class MacroAssembler; -friend class InterpreterGenerator; friend class LIR_Assembler; friend class GraphKit; friend class StubGenerator; From 7973ef05b350b979a6768324c43e7ebc806a877b Mon Sep 17 00:00:00 2001 From: Rachel Protacio Date: Tue, 22 Dec 2015 16:29:48 -0500 Subject: [PATCH 174/228] 8141211: Convert TraceExceptions to Unified Logging The -XX:+TraceExceptions flag has been updated to the unified logging framework, i.e. -Xlog:exceptions. The old flag, because it is product-level, has been aliased to the UL option. Reviewed-by: dholmes, coleenp, mockner --- hotspot/src/share/vm/c1/c1_Runtime1.cpp | 20 ++-- .../vm/interpreter/bytecodeInterpreter.cpp | 31 +++--- .../vm/interpreter/interpreterRuntime.cpp | 23 +++-- hotspot/src/share/vm/jvmci/jvmciRuntime.cpp | 21 ++-- hotspot/src/share/vm/logging/logTag.hpp | 1 + hotspot/src/share/vm/opto/runtime.cpp | 38 ++++--- hotspot/src/share/vm/runtime/arguments.cpp | 2 + hotspot/src/share/vm/runtime/globals.hpp | 3 - hotspot/src/share/vm/runtime/thread.cpp | 28 +++--- hotspot/src/share/vm/utilities/exceptions.cpp | 14 ++- .../CommandLine/TraceExceptionsTest.java | 2 +- .../test/runtime/logging/ExceptionsTest.java | 98 +++++++++++++++++++ 12 files changed, 195 insertions(+), 86 deletions(-) create mode 100644 hotspot/test/runtime/logging/ExceptionsTest.java diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index bfd902c9a0b..73cbdc53a50 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -43,6 +43,7 @@ #include "gc/shared/collectedHeap.hpp" #include "interpreter/bytecode.hpp" #include "interpreter/interpreter.hpp" +#include "logging/log.hpp" #include "memory/allocation.inline.hpp" #include "memory/oopFactory.hpp" #include "memory/resourceArea.hpp" @@ -548,11 +549,14 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // debugging support // tracing - if (TraceExceptions) { - ttyLocker ttyl; + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print_cr("Exception <%s> (" INTPTR_FORMAT ") thrown in compiled method <%s> at PC " INTPTR_FORMAT " for thread " INTPTR_FORMAT "", - exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread)); + log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT + ") thrown in compiled method <%s> at PC " INTPTR_FORMAT + " for thread " INTPTR_FORMAT, + exception->print_value_string(), + p2i((address)exception()), + nm->method()->print_value_string(), p2i(pc), p2i(thread)); } // for AbortVMOnException flag Exceptions::debug_check_abort(exception); @@ -583,11 +587,11 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // Set flag if return address is a method handle call site. thread->set_is_method_handle_return(nm->is_method_handle_return(pc)); - if (TraceExceptions) { - ttyLocker ttyl; + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print_cr("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT " for exception thrown at PC " PTR_FORMAT, - p2i(thread), p2i(continuation), p2i(pc)); + log_info(exceptions)("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT + " for exception thrown at PC " PTR_FORMAT, + p2i(thread), p2i(continuation), p2i(pc)); } return continuation; diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index 841d3012690..09e3d579ea0 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -31,6 +31,7 @@ #include "interpreter/bytecodeInterpreterProfiling.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "oops/methodCounters.hpp" #include "oops/objArrayKlass.hpp" @@ -2778,14 +2779,15 @@ run: SET_STACK_OBJECT(except_oop(), 0); MORE_STACK(1); pc = METHOD->code_base() + continuation_bci; - if (TraceExceptions) { - ttyLocker ttyl; + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), p2i(except_oop())); - tty->print_cr(" thrown in interpreter method <%s>", METHOD->print_value_string()); - tty->print_cr(" at bci %d, continuing at %d for thread " INTPTR_FORMAT, - (int)(istate->bcp() - METHOD->code_base()), - (int)continuation_bci, p2i(THREAD)); + log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ")\n" + " thrown in interpreter method <%s>\n" + " at bci %d, continuing at %d for thread " INTPTR_FORMAT, + except_oop->print_value_string(), p2i(except_oop()), + METHOD->print_value_string(), + (int)(istate->bcp() - METHOD->code_base()), + (int)continuation_bci, p2i(THREAD)); } // for AbortVMOnException flag Exceptions::debug_check_abort(except_oop); @@ -2794,14 +2796,15 @@ run: BI_PROFILE_ALIGN_TO_CURRENT_BCI(); goto run; } - if (TraceExceptions) { - ttyLocker ttyl; + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), p2i(except_oop())); - tty->print_cr(" thrown in interpreter method <%s>", METHOD->print_value_string()); - tty->print_cr(" at bci %d, unwinding for thread " INTPTR_FORMAT, - (int)(istate->bcp() - METHOD->code_base()), - p2i(THREAD)); + log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ")\n" + " thrown in interpreter method <%s>\n" + " at bci %d, unwinding for thread " INTPTR_FORMAT, + except_oop->print_value_string(), p2i(except_oop()), + METHOD->print_value_string(), + (int)(istate->bcp() - METHOD->code_base()), + p2i(THREAD)); } // for AbortVMOnException flag Exceptions::debug_check_abort(except_oop); diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index 077732802f5..d348e8d2cac 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -35,6 +35,7 @@ #include "interpreter/interpreterRuntime.hpp" #include "interpreter/linkResolver.hpp" #include "interpreter/templateTable.hpp" +#include "logging/log.hpp" #include "memory/oopFactory.hpp" #include "memory/universe.inline.hpp" #include "oops/constantPool.hpp" @@ -456,21 +457,23 @@ IRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea #endif // tracing - if (TraceExceptions) { + if (log_is_enabled(Info, exceptions)) { ResourceMark rm(thread); Symbol* message = java_lang_Throwable::detail_message(h_exception()); - ttyLocker ttyl; // Lock after getting the detail message + stringStream tempst; if (message != NULL) { - tty->print_cr("Exception <%s: %s> (" INTPTR_FORMAT ")", - h_exception->print_value_string(), message->as_C_string(), - p2i(h_exception())); + tempst.print("Exception <%s: %s> (" INTPTR_FORMAT ")\n", + h_exception->print_value_string(), message->as_C_string(), + p2i(h_exception())); } else { - tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", - h_exception->print_value_string(), - p2i(h_exception())); + tempst.print("Exception <%s> (" INTPTR_FORMAT ")\n", + h_exception->print_value_string(), + p2i(h_exception())); } - tty->print_cr(" thrown in interpreter method <%s>", h_method->print_value_string()); - tty->print_cr(" at bci %d for thread " INTPTR_FORMAT, current_bci, p2i(thread)); + tempst.print(" thrown in interpreter method <%s>\n" + " at bci %d for thread " INTPTR_FORMAT, + h_method->print_value_string(), current_bci, p2i(thread)); + LogHandle(exceptions)::info_stream()->print_raw_cr(tempst.as_string()); } // Don't go paging in something which won't be used. // else if (extable->length() == 0) { diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp index c401c698fde..b9691e4eb66 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp @@ -31,6 +31,7 @@ #include "jvmci/jvmciCompiler.hpp" #include "jvmci/jvmciJavaClasses.hpp" #include "jvmci/jvmciEnv.hpp" +#include "logging/log.hpp" #include "memory/oopFactory.hpp" #include "oops/oop.inline.hpp" #include "oops/objArrayOop.inline.hpp" @@ -294,11 +295,15 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // debugging support // tracing - if (TraceExceptions) { - ttyLocker ttyl; + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print_cr("Exception <%s> (" INTPTR_FORMAT ") thrown in compiled method <%s> at PC " INTPTR_FORMAT " for thread " INTPTR_FORMAT "", - exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread)); + log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ") thrown in" + " compiled method <%s> at PC " INTPTR_FORMAT + " for thread " INTPTR_FORMAT, + exception->print_value_string(), + p2i((address)exception()), + nm->method()->print_value_string(), p2i(pc), + p2i(thread)); } // for AbortVMOnException flag NOT_PRODUCT(Exceptions::debug_check_abort(exception)); @@ -323,11 +328,11 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // Set flag if return address is a method handle call site. thread->set_is_method_handle_return(nm->is_method_handle_return(pc)); - if (TraceExceptions) { - ttyLocker ttyl; + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print_cr("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT " for exception thrown at PC " PTR_FORMAT, - p2i(thread), p2i(continuation), p2i(pc)); + log_info(exceptions)("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT + " for exception thrown at PC " PTR_FORMAT, + p2i(thread), p2i(continuation), p2i(pc)); } return continuation; diff --git a/hotspot/src/share/vm/logging/logTag.hpp b/hotspot/src/share/vm/logging/logTag.hpp index 7927c7f2a6c..02304afe98b 100644 --- a/hotspot/src/share/vm/logging/logTag.hpp +++ b/hotspot/src/share/vm/logging/logTag.hpp @@ -44,6 +44,7 @@ LOG_TAG(cset) \ LOG_TAG(defaultmethods) \ LOG_TAG(ergo) \ + LOG_TAG(exceptions) \ LOG_TAG(exit) \ LOG_TAG(freelist) \ LOG_TAG(gc) \ diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index 1ae727c105a..7e249dd5b30 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -42,6 +42,7 @@ #include "interpreter/bytecode.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/linkResolver.hpp" +#include "logging/log.hpp" #include "memory/oopFactory.hpp" #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" @@ -1211,7 +1212,7 @@ bool OptoRuntime::is_callee_saved_register(MachRegisterNumbers reg) { // Exceptions // -static void trace_exception(oop exception_oop, address exception_pc, const char* msg) PRODUCT_RETURN; +static void trace_exception(outputStream* st, oop exception_oop, address exception_pc, const char* msg); // The method is an entry that is always called by a C++ method not // directly from compiled code. Compiled code will call the C++ method following. @@ -1234,8 +1235,9 @@ JRT_ENTRY_NO_ASYNC(address, OptoRuntime::handle_exception_C_helper(JavaThread* t // normal bytecode execution. thread->clear_exception_oop_and_pc(); - if (TraceExceptions) { - trace_exception(exception(), pc, ""); + if (log_is_enabled(Info, exceptions)) { + ResourceMark rm; + trace_exception(LogHandle(exceptions)::info_stream(), exception(), pc, ""); } // for AbortVMOnException flag @@ -1600,29 +1602,25 @@ NamedCounter* OptoRuntime::new_named_counter(JVMState* youngest_jvms, NamedCount return c; } -//----------------------------------------------------------------------------- -// Non-product code -#ifndef PRODUCT - int trace_exception_counter = 0; -static void trace_exception(oop exception_oop, address exception_pc, const char* msg) { - ttyLocker ttyl; +static void trace_exception(outputStream* st, oop exception_oop, address exception_pc, const char* msg) { trace_exception_counter++; - tty->print("%d [Exception (%s): ", trace_exception_counter, msg); - exception_oop->print_value(); - tty->print(" in "); + stringStream tempst; + + tempst.print("%d [Exception (%s): ", trace_exception_counter, msg); + exception_oop->print_value_on(&tempst); + tempst.print(" in "); CodeBlob* blob = CodeCache::find_blob(exception_pc); if (blob->is_nmethod()) { nmethod* nm = blob->as_nmethod_or_null(); - nm->method()->print_value(); + nm->method()->print_value_on(&tempst); } else if (blob->is_runtime_stub()) { - tty->print(""); + tempst.print(""); } else { - tty->print(""); + tempst.print(""); } - tty->print(" at " INTPTR_FORMAT, p2i(exception_pc)); - tty->print_cr("]"); + tempst.print(" at " INTPTR_FORMAT, p2i(exception_pc)); + tempst.print("]"); + + st->print_raw_cr(tempst.as_string()); } - -#endif // PRODUCT - diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 915e4c2b6ad..334f6eadb33 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -400,6 +400,8 @@ static AliasedFlag const aliased_jvm_flags[] = { }; static AliasedFlag const aliased_jvm_logging_flags[] = { + { "-XX:+TraceExceptions", "-Xlog:exceptions=info" }, + { "-XX:-TraceExceptions", "-Xlog:exceptions=off" }, { "-XX:+TraceMonitorInflation", "-Xlog:monitorinflation=debug" }, { "-XX:-TraceMonitorInflation", "-Xlog:monitorinflation=off" }, { NULL, NULL } diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index e35df070d70..25d94b07eb8 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1448,9 +1448,6 @@ public: develop(bool, TraceBytecodes, false, \ "Trace bytecode execution") \ \ - product(bool, TraceExceptions, false, \ - "Trace exceptions") \ - \ develop(bool, TraceICs, false, \ "Trace inline cache changes") \ \ diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index e750a234ce5..160f61226c1 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -38,6 +38,7 @@ #include "interpreter/linkResolver.hpp" #include "interpreter/oopMapCache.hpp" #include "jvmtifiles/jvmtiEnv.hpp" +#include "logging/log.hpp" #include "logging/logConfiguration.hpp" #include "memory/metaspaceShared.hpp" #include "memory/oopFactory.hpp" @@ -2062,10 +2063,7 @@ void JavaThread::check_and_handle_async_exceptions(bool check_unsafe_error) { frame caller_fr = last_frame().sender(&map); assert(caller_fr.is_compiled_frame(), "what?"); if (caller_fr.is_deoptimized_frame()) { - if (TraceExceptions) { - ResourceMark rm; - tty->print_cr("deferred async exception at compiled safepoint"); - } + log_info(exceptions)("deferred async exception at compiled safepoint"); return; } } @@ -2091,14 +2089,15 @@ void JavaThread::check_and_handle_async_exceptions(bool check_unsafe_error) { // We cannot call Exceptions::_throw(...) here because we cannot block set_pending_exception(_pending_async_exception, __FILE__, __LINE__); - if (TraceExceptions) { + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print("Async. exception installed at runtime exit (" INTPTR_FORMAT ")", p2i(this)); - if (has_last_Java_frame()) { - frame f = last_frame(); - tty->print(" (pc: " INTPTR_FORMAT " sp: " INTPTR_FORMAT " )", p2i(f.pc()), p2i(f.sp())); - } - tty->print_cr(" of type: %s", _pending_async_exception->klass()->external_name()); + outputStream* logstream = LogHandle(exceptions)::info_stream(); + logstream->print("Async. exception installed at runtime exit (" INTPTR_FORMAT ")", p2i(this)); + if (has_last_Java_frame()) { + frame f = last_frame(); + logstream->print(" (pc: " INTPTR_FORMAT " sp: " INTPTR_FORMAT " )", p2i(f.pc()), p2i(f.sp())); + } + logstream->print_cr(" of type: %s", _pending_async_exception->klass()->external_name()); } _pending_async_exception = NULL; clear_has_async_exception(); @@ -2214,9 +2213,10 @@ void JavaThread::send_thread_stop(oop java_throwable) { // Set async. pending exception in thread. set_pending_async_exception(java_throwable); - if (TraceExceptions) { - ResourceMark rm; - tty->print_cr("Pending Async. exception installed of type: %s", _pending_async_exception->klass()->external_name()); + if (log_is_enabled(Info, exceptions)) { + ResourceMark rm; + log_info(exceptions)("Pending Async. exception installed of type: %s", + InstanceKlass::cast(_pending_async_exception->klass())->external_name()); } // for AbortVMOnException flag Exceptions::debug_check_abort(_pending_async_exception->klass()->external_name()); diff --git a/hotspot/src/share/vm/utilities/exceptions.cpp b/hotspot/src/share/vm/utilities/exceptions.cpp index ef14a9ff121..d0847c4c021 100644 --- a/hotspot/src/share/vm/utilities/exceptions.cpp +++ b/hotspot/src/share/vm/utilities/exceptions.cpp @@ -26,6 +26,7 @@ #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "compiler/compileBroker.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/init.hpp" #include "runtime/java.hpp" @@ -136,14 +137,11 @@ void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exc assert(h_exception() != NULL, "exception should not be NULL"); // tracing (do this up front - so it works during boot strapping) - if (TraceExceptions) { - ttyLocker ttyl; - tty->print_cr("Exception <%s%s%s> (" INTPTR_FORMAT ") \n" - "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT, - h_exception->print_value_string(), - message ? ": " : "", message ? message : "", - p2i(h_exception()), file, line, p2i(thread)); - } + log_info(exceptions)("Exception <%s%s%s> (" INTPTR_FORMAT ") \n" + "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT, + h_exception->print_value_string(), + message ? ": " : "", message ? message : "", + p2i(h_exception()), file, line, p2i(thread)); // for AbortVMOnException flag Exceptions::debug_check_abort(h_exception, message); diff --git a/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java b/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java index 220d7df064b..cbfc33f30e3 100644 --- a/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java +++ b/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java @@ -36,7 +36,7 @@ public class TraceExceptionsTest { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+TraceExceptions", "NoClassFound"); + "-Xlog:exceptions=info", "NoClassFound"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(""); output.shouldNotContain(""); diff --git a/hotspot/test/runtime/logging/ExceptionsTest.java b/hotspot/test/runtime/logging/ExceptionsTest.java new file mode 100644 index 00000000000..0fefed85e9d --- /dev/null +++ b/hotspot/test/runtime/logging/ExceptionsTest.java @@ -0,0 +1,98 @@ +/* + * 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 8141211 + * @summary exceptions=info output should have an exception message for both interpreter and compiled methods + * @library /testlibrary + * @modules java.base/sun.misc + * java.management + * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools + * @run driver ExceptionsTest + */ + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + +public class ExceptionsTest { + static void analyzeOutputOn(ProcessBuilder pb) throws Exception { + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain(""); + output.shouldContain(" thrown in interpreter method "); + output.shouldContain(") thrown in compiled method "); + output.shouldContain("Exception 2 caught."); + output.shouldHaveExitValue(0); + } + + static void analyzeOutputOff(ProcessBuilder pb) throws Exception { + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldNotContain("[exceptions]"); + output.shouldHaveExitValue(0); + } + + public static void main(String[] args) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:exceptions=info", "-Xcomp", + "-XX:CompileCommand=compileonly,ExceptionsTest$InternalClass::compileMe", + InternalClass.class.getName()); + analyzeOutputOn(pb); + + pb = ProcessTools.createJavaProcessBuilder( + "-XX:+TraceExceptions", "-Xcomp", + "-XX:CompileCommand=compileonly,ExceptionsTest$InternalClass::compileMe", + InternalClass.class.getName()); + analyzeOutputOn(pb); + + pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:exceptions=off", "-Xcomp", + "-XX:CompileCommand=compileonly,ExceptionsTest$InternalClass::compileMe", + InternalClass.class.getName()); + analyzeOutputOff(pb); + + pb = ProcessTools.createJavaProcessBuilder( + "-XX:-TraceExceptions", "-Xcomp", + "-XX:CompileCommand=compileonly,ExceptionsTest$InternalClass::compileMe", + InternalClass.class.getName()); + analyzeOutputOff(pb); + } + + public static class InternalClass { + public static void compileMe() throws Exception { + try { + throw new RuntimeException("Test exception 2 for logging"); + } catch (Exception e) { + System.out.println("Exception 2 caught."); + } + } + + public static void main(String[] args) throws Exception { + try { + throw new RuntimeException("Test exception 1 for logging"); + } catch (Exception e) { + System.out.println("Exception 1 caught."); + } + compileMe(); + } + } +} From 76d0d92563036def1c1dbf1a978bcfebac89a040 Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Wed, 23 Dec 2015 13:12:15 +0300 Subject: [PATCH 175/228] 8067194: Restructure hotspot/agent/src to conform the modular source layout Move sources under jdk.hotspot.agent Reviewed-by: ihse, erikj, jbachorik --- hotspot/agent/make/Makefile | 331 ------------------ hotspot/agent/make/README.txt | 5 - hotspot/agent/make/build-filelist | 10 - hotspot/agent/make/build-pkglist | 11 - hotspot/agent/make/build.xml | 126 ------- hotspot/agent/make/clhsdbproc.sh | 30 -- hotspot/agent/make/clhsdbproc64.sh | 30 -- hotspot/agent/make/clhsdbwindbg.bat | 29 -- hotspot/agent/make/clhsdbwindbg64.bat | 29 -- hotspot/agent/make/dumpflagsproc.sh | 28 -- hotspot/agent/make/dumpflagsproc64.sh | 28 -- hotspot/agent/make/dumpflagswindbg.bat | 28 -- hotspot/agent/make/dumpflagswindbg64.bat | 28 -- hotspot/agent/make/dumpsyspropsproc.sh | 29 -- hotspot/agent/make/dumpsyspropsproc64.sh | 28 -- hotspot/agent/make/dumpsyspropswindbg.bat | 28 -- hotspot/agent/make/dumpsyspropswindbg64.bat | 28 -- hotspot/agent/make/finalizerinfoproc.sh | 28 -- hotspot/agent/make/finalizerinfoproc64.sh | 28 -- hotspot/agent/make/finalizerinfowindbg.bat | 28 -- hotspot/agent/make/finalizerinfowindbg64.bat | 28 -- hotspot/agent/make/grantAll.policy | 30 -- hotspot/agent/make/heapdumpproc.sh | 30 -- hotspot/agent/make/heapdumpproc64.sh | 31 -- hotspot/agent/make/heapdumpwindbg.bat | 29 -- hotspot/agent/make/heapdumpwindbg64.bat | 29 -- hotspot/agent/make/heapsumproc.sh | 28 -- hotspot/agent/make/heapsumproc64.sh | 28 -- hotspot/agent/make/heapsumwindbg.bat | 28 -- hotspot/agent/make/heapsumwindbg64.bat | 28 -- hotspot/agent/make/hsdb.bat | 25 -- hotspot/agent/make/hsdb.sh | 32 -- hotspot/agent/make/hsdbproc.sh | 28 -- hotspot/agent/make/hsdbproc64.sh | 28 -- hotspot/agent/make/hsdbwindbg.bat | 28 -- hotspot/agent/make/hsdbwindbg64.bat | 28 -- hotspot/agent/make/index.html | 262 -------------- hotspot/agent/make/jcoreproc.sh | 31 -- hotspot/agent/make/jcoreproc64.sh | 31 -- hotspot/agent/make/jcorewindbg.bat | 33 -- hotspot/agent/make/jcorewindbg64.bat | 33 -- hotspot/agent/make/jdbcore.sh | 45 --- hotspot/agent/make/jdbcore64.sh | 45 --- hotspot/agent/make/jdbproc.sh | 44 --- hotspot/agent/make/jdbproc64.sh | 44 --- hotspot/agent/make/jhistoproc.sh | 28 -- hotspot/agent/make/jhistoproc64.sh | 28 -- hotspot/agent/make/jhistowindbg.bat | 28 -- hotspot/agent/make/jhistowindbg64.bat | 28 -- hotspot/agent/make/jsdbproc.sh | 30 -- hotspot/agent/make/jsdbproc64.sh | 30 -- hotspot/agent/make/jsdbwindbg.bat | 29 -- hotspot/agent/make/jsdbwindbg64.bat | 29 -- hotspot/agent/make/jstackproc.sh | 28 -- hotspot/agent/make/jstackproc64.sh | 28 -- hotspot/agent/make/jstackwindbg.bat | 28 -- hotspot/agent/make/jstackwindbg64.bat | 28 -- hotspot/agent/make/marks_notes.html | 93 ----- hotspot/agent/make/mkinstall | 148 -------- hotspot/agent/make/permstatproc.sh | 28 -- hotspot/agent/make/permstatproc64.sh | 28 -- hotspot/agent/make/permstatwindbg.bat | 28 -- hotspot/agent/make/permstatwindbg64.bat | 28 -- hotspot/agent/make/pmapproc.sh | 28 -- hotspot/agent/make/pmapproc64.sh | 29 -- hotspot/agent/make/pmapwindbg.bat | 28 -- hotspot/agent/make/pmapwindbg64.bat | 28 -- hotspot/agent/make/pstackproc.sh | 34 -- hotspot/agent/make/pstackproc64.sh | 34 -- hotspot/agent/make/pstackwindbg.bat | 28 -- hotspot/agent/make/pstackwindbg64.bat | 28 -- hotspot/agent/make/saenv.bat | 54 --- hotspot/agent/make/saenv.sh | 84 ----- hotspot/agent/make/saenv64.bat | 60 ---- hotspot/agent/make/saenv64.sh | 83 ----- hotspot/agent/make/soqlproc.sh | 28 -- hotspot/agent/make/soqlproc64.sh | 28 -- hotspot/agent/make/soqlwindbg.bat | 28 -- hotspot/agent/make/soqlwindbg64.bat | 28 -- hotspot/agent/make/start-debug-server | 18 - hotspot/agent/make/start-debug-server-proc.sh | 35 -- .../agent/make/start-debug-server-proc64.sh | 34 -- .../agent/make/start-debug-server-windbg.bat | 39 --- .../make/start-debug-server-windbg64.bat | 39 --- hotspot/agent/make/start-rmiregistry.bat | 37 -- hotspot/agent/make/start-rmiregistry.sh | 34 -- hotspot/agent/src/os/bsd/Makefile | 102 ------ hotspot/agent/src/os/linux/Makefile | 90 ----- hotspot/agent/src/os/solaris/Makefile | 30 -- hotspot/agent/src/os/solaris/proc/Makefile | 70 ---- hotspot/agent/src/os/win32/windbg/Makefile | 91 ----- hotspot/make/lib/Lib-jdk.hotspot.agent.gmk | 19 +- .../mapfiles/libsaproc/mapfile-linux} | 0 .../mapfiles/libsaproc/mapfile-macosx} | 0 .../mapfiles/libsaproc/mapfile-solaris} | 0 .../doc/ReadMe-JavaScript.text | 0 .../jdk.hotspot.agent}/doc/cireplay.html | 0 .../jdk.hotspot.agent}/doc/clhsdb.html | 0 .../jdk.hotspot.agent}/doc/hsdb.html | 0 .../jdk.hotspot.agent}/doc/index.html | 0 .../jdk.hotspot.agent}/doc/jsdb.html | 0 .../doc/transported_core.html | 0 .../native/libsaproc}/LinuxDebuggerLocal.c | 0 .../linux/native/libsaproc}/elfmacros.h | 0 .../linux/native/libsaproc}/libproc.h | 0 .../linux/native/libsaproc}/libproc_impl.c | 0 .../linux/native/libsaproc}/libproc_impl.h | 0 .../linux/native/libsaproc}/proc_service.h | 0 .../linux/native/libsaproc}/ps_core.c | 0 .../linux/native/libsaproc}/ps_proc.c | 0 .../linux/native/libsaproc}/salibelf.c | 0 .../linux/native/libsaproc}/salibelf.h | 0 .../linux/native/libsaproc}/symtab.c | 0 .../linux/native/libsaproc}/symtab.h | 0 .../linux/native/libsaproc}/test.c | 0 .../native/libsaproc}/BsdDebuggerLocal.c | 0 .../native/libsaproc}/MacosxDebuggerLocal.m | 0 .../native/libsaproc}/StubDebuggerLocal.c | 0 .../macosx/native/libsaproc}/elfmacros.h | 0 .../macosx/native/libsaproc}/libproc.h | 0 .../macosx/native/libsaproc}/libproc_impl.c | 0 .../macosx/native/libsaproc}/libproc_impl.h | 0 .../macosx/native/libsaproc}/ps_core.c | 0 .../macosx/native/libsaproc}/ps_proc.c | 0 .../macosx/native/libsaproc}/salibelf.c | 0 .../macosx/native/libsaproc}/salibelf.h | 0 .../macosx/native/libsaproc}/symtab.c | 0 .../macosx/native/libsaproc}/symtab.h | 0 .../macosx/native/libsaproc}/test.c | 0 .../jdk.hotspot.agent}/scripts/README | 0 .../scripts/start-debug-server.bat | 0 .../scripts/start-debug-server.sh | 0 .../scripts/start-debug-server64.sh | 0 .../scripts/start-rmiregistry.bat | 0 .../scripts/start-rmiregistry.sh | 0 .../scripts/start-rmiregistry64.sh | 0 .../services/com.sun.jdi.connect.Connector | 0 .../sun/java/swing/action/AboutAction.java | 0 .../sun/java/swing/action/ActionManager.java | 0 .../java/swing/action/ActionUtilities.java | 0 .../java/swing/action/AlignCenterAction.java | 0 .../java/swing/action/AlignLeftAction.java | 0 .../java/swing/action/AlignRightAction.java | 0 .../sun/java/swing/action/ApplyAction.java | 0 .../com/sun/java/swing/action/BackAction.java | 0 .../sun/java/swing/action/CancelAction.java | 0 .../sun/java/swing/action/DelegateAction.java | 0 .../com/sun/java/swing/action/ExitAction.java | 0 .../com/sun/java/swing/action/FileMenu.java | 0 .../sun/java/swing/action/FinishAction.java | 0 .../com/sun/java/swing/action/HelpAction.java | 0 .../com/sun/java/swing/action/HelpMenu.java | 0 .../com/sun/java/swing/action/NewAction.java | 0 .../com/sun/java/swing/action/NextAction.java | 0 .../com/sun/java/swing/action/OkAction.java | 0 .../com/sun/java/swing/action/OpenAction.java | 0 .../com/sun/java/swing/action/SaveAction.java | 0 .../sun/java/swing/action/SaveAsAction.java | 0 .../java/swing/action/StateChangeAction.java | 0 .../com/sun/java/swing/action/ViewMenu.java | 0 .../com/sun/java/swing/ui/CommonMenuBar.java | 0 .../com/sun/java/swing/ui/CommonToolBar.java | 0 .../com/sun/java/swing/ui/CommonUI.java | 0 .../java/swing/ui/OkCancelButtonPanel.java | 0 .../com/sun/java/swing/ui/OkCancelDialog.java | 0 .../com/sun/java/swing/ui/SplashScreen.java | 0 .../com/sun/java/swing/ui/StatusBar.java | 0 .../com/sun/java/swing/ui/TabsDlg.java | 0 .../ToggleActionPropertyChangeListener.java | 0 .../com/sun/java/swing/ui/WizardDlg.java | 0 .../development/Server16.gif | Bin .../development/Server24.gif | Bin .../toolbarButtonGraphics/general/About16.gif | Bin .../toolbarButtonGraphics/general/About24.gif | Bin .../general/Delete16.gif | Bin .../general/Delete24.gif | Bin .../toolbarButtonGraphics/general/Find16.gif | Bin .../toolbarButtonGraphics/general/Help16.gif | Bin .../toolbarButtonGraphics/general/Help24.gif | Bin .../general/History16.gif | Bin .../general/History24.gif | Bin .../general/Information16.gif | Bin .../general/Information24.gif | Bin .../toolbarButtonGraphics/general/New16.gif | Bin .../toolbarButtonGraphics/general/New24.gif | Bin .../toolbarButtonGraphics/general/Open16.gif | Bin .../toolbarButtonGraphics/general/Open24.gif | Bin .../toolbarButtonGraphics/general/Save16.gif | Bin .../toolbarButtonGraphics/general/Save24.gif | Bin .../general/SaveAs16.gif | Bin .../general/SaveAs24.gif | Bin .../toolbarButtonGraphics/general/Zoom16.gif | Bin .../general/ZoomIn16.gif | Bin .../general/ZoomIn24.gif | Bin .../navigation/Down16.gif | Bin .../toolbarButtonGraphics/navigation/Up16.gif | Bin .../text/AlignCenter16.gif | Bin .../text/AlignCenter24.gif | Bin .../text/AlignLeft16.gif | Bin .../text/AlignLeft24.gif | Bin .../text/AlignRight16.gif | Bin .../text/AlignRight24.gif | Bin .../sun/jvm/hotspot/BsdVtblAccess.java | 0 .../share/classes/sun/jvm/hotspot/CLHSDB.java | 0 .../sun/jvm/hotspot/CommandProcessor.java | 0 .../classes/sun/jvm/hotspot/DebugServer.java | 0 .../share/classes/sun/jvm/hotspot/HSDB.java | 0 .../classes/sun/jvm/hotspot/HelloWorld.java | 0 .../classes/sun/jvm/hotspot/HotSpotAgent.java | 0 .../jvm/hotspot/HotSpotSolarisVtblAccess.java | 0 .../sun/jvm/hotspot/HotSpotTypeDataBase.java | 0 .../sun/jvm/hotspot/LinuxVtblAccess.java | 0 .../sun/jvm/hotspot/ObjectHistogram.java | 0 .../classes/sun/jvm/hotspot/RMIHelper.java | 0 .../classes/sun/jvm/hotspot/SAGetopt.java | 0 .../classes/sun/jvm/hotspot/SALauncher.java | 0 .../sun/jvm/hotspot/SALauncherLoader.java | 0 .../classes/sun/jvm/hotspot/StackTrace.java | 0 .../sun/jvm/hotspot/Win32VtblAccess.java | 0 .../sun/jvm/hotspot/asm/Disassembler.java | 0 .../jvm/hotspot/asm/DummySymbolFinder.java | 0 .../jvm/hotspot/asm/ImmediateOrRegister.java | 0 .../jvm/hotspot/asm/InstructionVisitor.java | 0 .../classes/sun/jvm/hotspot/asm/Operand.java | 0 .../classes/sun/jvm/hotspot/asm/Register.java | 0 .../sun/jvm/hotspot/asm/SymbolFinder.java | 0 .../jvm/hotspot/asm/sparc/SPARCArgument.java | 0 .../jvm/hotspot/asm/sparc/SPARCRegister.java | 0 .../hotspot/asm/sparc/SPARCRegisterType.java | 0 .../jvm/hotspot/asm/sparc/SPARCRegisters.java | 0 .../classes/sun/jvm/hotspot/c1/Runtime1.java | 0 .../sun/jvm/hotspot/ci/ciArrayKlass.java | 0 .../sun/jvm/hotspot/ci/ciBaseObject.java | 0 .../sun/jvm/hotspot/ci/ciConstant.java | 0 .../classes/sun/jvm/hotspot/ci/ciEnv.java | 0 .../classes/sun/jvm/hotspot/ci/ciField.java | 0 .../sun/jvm/hotspot/ci/ciInstance.java | 0 .../sun/jvm/hotspot/ci/ciInstanceKlass.java | 0 .../classes/sun/jvm/hotspot/ci/ciKlass.java | 0 .../sun/jvm/hotspot/ci/ciMetadata.java | 0 .../classes/sun/jvm/hotspot/ci/ciMethod.java | 0 .../sun/jvm/hotspot/ci/ciMethodData.java | 0 .../sun/jvm/hotspot/ci/ciObjArrayKlass.java | 0 .../classes/sun/jvm/hotspot/ci/ciObject.java | 0 .../sun/jvm/hotspot/ci/ciObjectFactory.java | 0 .../classes/sun/jvm/hotspot/ci/ciSymbol.java | 0 .../classes/sun/jvm/hotspot/ci/ciType.java | 0 .../sun/jvm/hotspot/ci/ciTypeArrayKlass.java | 0 .../hotspot/classfile/ClassLoaderData.java | 0 .../sun/jvm/hotspot/code/AdapterBlob.java | 0 .../sun/jvm/hotspot/code/BufferBlob.java | 0 .../sun/jvm/hotspot/code/CodeBlob.java | 0 .../sun/jvm/hotspot/code/CodeCache.java | 0 .../jvm/hotspot/code/CodeCacheVisitor.java | 0 .../hotspot/code/CompressedReadStream.java | 0 .../jvm/hotspot/code/CompressedStream.java | 0 .../hotspot/code/CompressedWriteStream.java | 0 .../jvm/hotspot/code/ConstantDoubleValue.java | 0 .../jvm/hotspot/code/ConstantIntValue.java | 0 .../jvm/hotspot/code/ConstantLongValue.java | 0 .../hotspot/code/ConstantOopReadValue.java | 0 .../jvm/hotspot/code/DebugInfoReadStream.java | 0 .../code/DebugInformationRecorder.java | 0 .../jvm/hotspot/code/DeoptimizationBlob.java | 0 .../sun/jvm/hotspot/code/ExceptionBlob.java | 0 .../sun/jvm/hotspot/code/Location.java | 0 .../sun/jvm/hotspot/code/LocationValue.java | 0 .../code/MethodHandlesAdapterBlob.java | 0 .../sun/jvm/hotspot/code/MonitorValue.java | 0 .../classes/sun/jvm/hotspot/code/NMethod.java | 0 .../sun/jvm/hotspot/code/ObjectValue.java | 0 .../classes/sun/jvm/hotspot/code/PCDesc.java | 0 .../sun/jvm/hotspot/code/RuntimeStub.java | 0 .../sun/jvm/hotspot/code/SafepointBlob.java | 0 .../sun/jvm/hotspot/code/ScopeDesc.java | 0 .../sun/jvm/hotspot/code/ScopeValue.java | 0 .../sun/jvm/hotspot/code/SingletonBlob.java | 0 .../classes/sun/jvm/hotspot/code/Stub.java | 0 .../sun/jvm/hotspot/code/StubQueue.java | 0 .../jvm/hotspot/code/UncommonTrapBlob.java | 0 .../sun/jvm/hotspot/code/VMRegImpl.java | 0 .../sun/jvm/hotspot/compiler/CompileTask.java | 0 .../jvm/hotspot/compiler/ImmutableOopMap.java | 0 .../hotspot/compiler/ImmutableOopMapPair.java | 0 .../hotspot/compiler/ImmutableOopMapSet.java | 0 .../jvm/hotspot/compiler/OopMapStream.java | 0 .../sun/jvm/hotspot/compiler/OopMapValue.java | 0 .../jvm/hotspot/compiler/OopMapVisitor.java | 0 .../sun/jvm/hotspot/debugger/Address.java | 0 .../hotspot/debugger/AddressException.java | 0 .../sun/jvm/hotspot/debugger/DataSource.java | 0 .../sun/jvm/hotspot/debugger/Debugger.java | 0 .../jvm/hotspot/debugger/DebuggerBase.java | 0 .../hotspot/debugger/DebuggerException.java | 0 .../hotspot/debugger/DebuggerUtilities.java | 0 .../sun/jvm/hotspot/debugger/InputLexer.java | 0 .../sun/jvm/hotspot/debugger/JVMDebugger.java | 0 .../sun/jvm/hotspot/debugger/LongHashMap.java | 0 .../hotspot/debugger/MachineDescription.java | 0 .../debugger/MachineDescriptionAArch64.java | 0 .../debugger/MachineDescriptionAMD64.java | 0 .../debugger/MachineDescriptionIA64.java | 0 .../debugger/MachineDescriptionIntelX86.java | 0 .../debugger/MachineDescriptionPPC64.java | 0 .../MachineDescriptionSPARC32Bit.java | 0 .../MachineDescriptionSPARC64Bit.java | 0 .../MachineDescriptionTwosComplement.java | 0 .../debugger/MappedByteBufferDataSource.java | 0 .../debugger/NoSuchSymbolException.java | 0 .../hotspot/debugger/NotInHeapException.java | 0 .../sun/jvm/hotspot/debugger/OopHandle.java | 0 .../sun/jvm/hotspot/debugger/Page.java | 0 .../sun/jvm/hotspot/debugger/PageCache.java | 0 .../sun/jvm/hotspot/debugger/PageFetcher.java | 0 .../sun/jvm/hotspot/debugger/ProcessInfo.java | 0 .../debugger/RandomAccessFileDataSource.java | 0 .../sun/jvm/hotspot/debugger/ReadResult.java | 0 .../jvm/hotspot/debugger/SymbolLookup.java | 0 .../jvm/hotspot/debugger/ThreadAccess.java | 0 .../jvm/hotspot/debugger/ThreadContext.java | 0 .../sun/jvm/hotspot/debugger/ThreadProxy.java | 0 .../debugger/UnalignedAddressException.java | 0 .../debugger/UnmappedAddressException.java | 0 .../aarch64/AARCH64ThreadContext.java | 0 .../debugger/amd64/AMD64ThreadContext.java | 0 .../jvm/hotspot/debugger/bsd/BsdAddress.java | 0 .../hotspot/debugger/bsd/BsdCDebugger.java | 0 .../jvm/hotspot/debugger/bsd/BsdDebugger.java | 0 .../debugger/bsd/BsdDebuggerLocal.java | 0 .../hotspot/debugger/bsd/BsdOopHandle.java | 0 .../jvm/hotspot/debugger/bsd/BsdThread.java | 0 .../debugger/bsd/BsdThreadContextFactory.java | 0 .../hotspot/debugger/bsd/SharedObject.java | 0 .../debugger/bsd/amd64/BsdAMD64CFrame.java | 0 .../bsd/amd64/BsdAMD64ThreadContext.java | 0 .../debugger/bsd/x86/BsdX86CFrame.java | 0 .../debugger/bsd/x86/BsdX86ThreadContext.java | 0 .../hotspot/debugger/cdbg/AccessControl.java | 0 .../jvm/hotspot/debugger/cdbg/ArrayType.java | 0 .../jvm/hotspot/debugger/cdbg/BaseClass.java | 0 .../jvm/hotspot/debugger/cdbg/BitType.java | 0 .../jvm/hotspot/debugger/cdbg/BlockSym.java | 0 .../debugger/cdbg/CDebugInfoDataBase.java | 0 .../jvm/hotspot/debugger/cdbg/CDebugger.java | 0 .../sun/jvm/hotspot/debugger/cdbg/CFrame.java | 0 .../hotspot/debugger/cdbg/CVAttributes.java | 0 .../hotspot/debugger/cdbg/ClosestSymbol.java | 0 .../hotspot/debugger/cdbg/CompoundType.java | 0 .../jvm/hotspot/debugger/cdbg/DebugEvent.java | 0 .../debugger/cdbg/DefaultObjectVisitor.java | 0 .../jvm/hotspot/debugger/cdbg/DoubleType.java | 0 .../jvm/hotspot/debugger/cdbg/EnumType.java | 0 .../sun/jvm/hotspot/debugger/cdbg/Field.java | 0 .../debugger/cdbg/FieldIdentifier.java | 0 .../jvm/hotspot/debugger/cdbg/FloatType.java | 0 .../hotspot/debugger/cdbg/FunctionSym.java | 0 .../hotspot/debugger/cdbg/FunctionType.java | 0 .../jvm/hotspot/debugger/cdbg/GlobalSym.java | 0 .../cdbg/IndexableFieldIdentifier.java | 0 .../jvm/hotspot/debugger/cdbg/IntType.java | 0 .../hotspot/debugger/cdbg/LineNumberInfo.java | 0 .../debugger/cdbg/LineNumberVisitor.java | 0 .../jvm/hotspot/debugger/cdbg/LoadObject.java | 0 .../debugger/cdbg/LoadObjectComparator.java | 0 .../jvm/hotspot/debugger/cdbg/LocalSym.java | 0 .../debugger/cdbg/MemberFunctionType.java | 0 .../debugger/cdbg/NamedFieldIdentifier.java | 0 .../hotspot/debugger/cdbg/ObjectVisitor.java | 0 .../hotspot/debugger/cdbg/PointerType.java | 0 .../hotspot/debugger/cdbg/ProcessControl.java | 0 .../jvm/hotspot/debugger/cdbg/RefType.java | 0 .../sun/jvm/hotspot/debugger/cdbg/Sym.java | 0 .../hotspot/debugger/cdbg/TemplateType.java | 0 .../sun/jvm/hotspot/debugger/cdbg/Type.java | 0 .../hotspot/debugger/cdbg/TypeVisitor.java | 0 .../jvm/hotspot/debugger/cdbg/VoidType.java | 0 .../debugger/cdbg/basic/BasicArrayType.java | 0 .../debugger/cdbg/basic/BasicBaseClass.java | 0 .../debugger/cdbg/basic/BasicBitType.java | 0 .../debugger/cdbg/basic/BasicBlockSym.java | 0 .../cdbg/basic/BasicCDebugInfoDataBase.java | 0 .../debugger/cdbg/basic/BasicCFrame.java | 0 .../cdbg/basic/BasicCompoundType.java | 0 .../debugger/cdbg/basic/BasicDebugEvent.java | 0 .../debugger/cdbg/basic/BasicDoubleType.java | 0 .../debugger/cdbg/basic/BasicEnumType.java | 0 .../debugger/cdbg/basic/BasicField.java | 0 .../debugger/cdbg/basic/BasicFloatType.java | 0 .../debugger/cdbg/basic/BasicFunctionSym.java | 0 .../cdbg/basic/BasicFunctionType.java | 0 .../debugger/cdbg/basic/BasicGlobalSym.java | 0 .../basic/BasicIndexableFieldIdentifier.java | 0 .../debugger/cdbg/basic/BasicIntType.java | 0 .../cdbg/basic/BasicLineNumberInfo.java | 0 .../cdbg/basic/BasicLineNumberMapping.java | 0 .../debugger/cdbg/basic/BasicLocalSym.java | 0 .../cdbg/basic/BasicMemberFunctionType.java | 0 .../cdbg/basic/BasicNamedFieldIdentifier.java | 0 .../debugger/cdbg/basic/BasicPointerType.java | 0 .../debugger/cdbg/basic/BasicRefType.java | 0 .../hotspot/debugger/cdbg/basic/BasicSym.java | 0 .../debugger/cdbg/basic/BasicType.java | 0 .../debugger/cdbg/basic/BasicVoidType.java | 0 .../debugger/cdbg/basic/CompoundTypeKind.java | 0 .../debugger/cdbg/basic/LazyBlockSym.java | 0 .../hotspot/debugger/cdbg/basic/LazyType.java | 0 .../debugger/cdbg/basic/ResolveListener.java | 0 .../hotspot/debugger/dummy/DummyAddress.java | 0 .../hotspot/debugger/dummy/DummyDebugger.java | 0 .../debugger/dummy/DummyOopHandle.java | 0 .../debugger/ia64/IA64ThreadContext.java | 0 .../hotspot/debugger/linux/LinuxAddress.java | 0 .../debugger/linux/LinuxCDebugger.java | 0 .../hotspot/debugger/linux/LinuxDebugger.java | 0 .../debugger/linux/LinuxDebuggerLocal.java | 0 .../debugger/linux/LinuxOopHandle.java | 0 .../hotspot/debugger/linux/LinuxThread.java | 0 .../linux/LinuxThreadContextFactory.java | 0 .../hotspot/debugger/linux/SharedObject.java | 0 .../linux/aarch64/LinuxAARCH64CFrame.java | 0 .../aarch64/LinuxAARCH64ThreadContext.java | 0 .../linux/amd64/LinuxAMD64CFrame.java | 0 .../linux/amd64/LinuxAMD64ThreadContext.java | 0 .../linux/ia64/LinuxIA64ThreadContext.java | 0 .../linux/ppc64/LinuxPPC64CFrame.java | 0 .../linux/ppc64/LinuxPPC64ThreadContext.java | 0 .../linux/sparc/LinuxSPARCCFrame.java | 0 .../linux/sparc/LinuxSPARCThreadContext.java | 0 .../debugger/linux/x86/LinuxX86CFrame.java | 0 .../linux/x86/LinuxX86ThreadContext.java | 0 .../debugger/posix/AddressDataSource.java | 0 .../sun/jvm/hotspot/debugger/posix/DSO.java | 0 .../debugger/posix/elf/ELFException.java | 0 .../hotspot/debugger/posix/elf/ELFFile.java | 0 .../debugger/posix/elf/ELFFileParser.java | 0 .../debugger/posix/elf/ELFHashTable.java | 0 .../hotspot/debugger/posix/elf/ELFHeader.java | 0 .../debugger/posix/elf/ELFProgramHeader.java | 0 .../debugger/posix/elf/ELFSectionHeader.java | 0 .../debugger/posix/elf/ELFStringTable.java | 0 .../hotspot/debugger/posix/elf/ELFSymbol.java | 0 .../debugger/ppc64/PPC64ThreadContext.java | 0 .../hotspot/debugger/proc/ProcAddress.java | 0 .../hotspot/debugger/proc/ProcCDebugger.java | 0 .../jvm/hotspot/debugger/proc/ProcCFrame.java | 0 .../hotspot/debugger/proc/ProcDebugger.java | 0 .../debugger/proc/ProcDebuggerLocal.java | 0 .../hotspot/debugger/proc/ProcOopHandle.java | 0 .../debugger/proc/ProcThreadFactory.java | 0 .../hotspot/debugger/proc/SharedObject.java | 0 .../proc/aarch64/ProcAARCH64Thread.java | 0 .../aarch64/ProcAARCH64ThreadContext.java | 0 .../aarch64/ProcAARCH64ThreadFactory.java | 0 .../debugger/proc/amd64/ProcAMD64Thread.java | 0 .../proc/amd64/ProcAMD64ThreadContext.java | 0 .../proc/amd64/ProcAMD64ThreadFactory.java | 0 .../debugger/proc/ppc64/ProcPPC64Thread.java | 0 .../proc/ppc64/ProcPPC64ThreadContext.java | 0 .../proc/ppc64/ProcPPC64ThreadFactory.java | 0 .../debugger/proc/sparc/ProcSPARCThread.java | 0 .../proc/sparc/ProcSPARCThreadContext.java | 0 .../proc/sparc/ProcSPARCThreadFactory.java | 0 .../debugger/proc/x86/ProcX86Thread.java | 0 .../proc/x86/ProcX86ThreadContext.java | 0 .../proc/x86/ProcX86ThreadFactory.java | 0 .../debugger/remote/RemoteAddress.java | 0 .../debugger/remote/RemoteDebugger.java | 0 .../debugger/remote/RemoteDebuggerClient.java | 0 .../debugger/remote/RemoteDebuggerServer.java | 0 .../debugger/remote/RemoteOopHandle.java | 0 .../hotspot/debugger/remote/RemoteThread.java | 0 .../debugger/remote/RemoteThreadFactory.java | 0 .../remote/aarch64/RemoteAARCH64Thread.java | 0 .../aarch64/RemoteAARCH64ThreadContext.java | 0 .../aarch64/RemoteAARCH64ThreadFactory.java | 0 .../remote/amd64/RemoteAMD64Thread.java | 0 .../amd64/RemoteAMD64ThreadContext.java | 0 .../amd64/RemoteAMD64ThreadFactory.java | 0 .../remote/ppc64/RemotePPC64Thread.java | 0 .../ppc64/RemotePPC64ThreadContext.java | 0 .../ppc64/RemotePPC64ThreadFactory.java | 0 .../remote/sparc/RemoteSPARCThread.java | 0 .../sparc/RemoteSPARCThreadContext.java | 0 .../sparc/RemoteSPARCThreadFactory.java | 0 .../debugger/remote/x86/RemoteX86Thread.java | 0 .../remote/x86/RemoteX86ThreadContext.java | 0 .../remote/x86/RemoteX86ThreadFactory.java | 0 .../debugger/sparc/SPARCThreadContext.java | 0 .../debugger/win32/coff/AuxBfEfRecord.java | 0 .../debugger/win32/coff/AuxFileRecord.java | 0 .../coff/AuxFunctionDefinitionRecord.java | 0 .../coff/AuxSectionDefinitionsRecord.java | 0 .../debugger/win32/coff/AuxSymbolRecord.java | 0 .../win32/coff/AuxWeakExternalRecord.java | 0 .../debugger/win32/coff/COFFException.java | 0 .../hotspot/debugger/win32/coff/COFFFile.java | 0 .../debugger/win32/coff/COFFFileParser.java | 0 .../debugger/win32/coff/COFFHeader.java | 0 .../debugger/win32/coff/COFFLineNumber.java | 0 .../debugger/win32/coff/COFFRelocation.java | 0 .../debugger/win32/coff/COFFSymbol.java | 0 .../win32/coff/COFFSymbolConstants.java | 0 .../win32/coff/COMDATSelectionTypes.java | 0 .../debugger/win32/coff/Characteristics.java | 0 .../win32/coff/DLLCharacteristics.java | 0 .../debugger/win32/coff/DataDirectory.java | 0 .../debugger/win32/coff/DebugDirectory.java | 0 .../win32/coff/DebugDirectoryEntry.java | 0 .../debugger/win32/coff/DebugTypes.java | 0 .../debugger/win32/coff/DebugVC50.java | 0 .../win32/coff/DebugVC50MemberAttributes.java | 0 .../win32/coff/DebugVC50ReservedTypes.java | 0 .../win32/coff/DebugVC50SSAlignSym.java | 0 .../win32/coff/DebugVC50SSFileIndex.java | 0 .../win32/coff/DebugVC50SSGlobalPub.java | 0 .../win32/coff/DebugVC50SSGlobalSym.java | 0 .../win32/coff/DebugVC50SSGlobalTypes.java | 0 .../win32/coff/DebugVC50SSLibraries.java | 0 .../debugger/win32/coff/DebugVC50SSMPC.java | 0 .../win32/coff/DebugVC50SSModule.java | 0 .../win32/coff/DebugVC50SSOffsetMap16.java | 0 .../win32/coff/DebugVC50SSOffsetMap32.java | 0 .../win32/coff/DebugVC50SSPreComp.java | 0 .../win32/coff/DebugVC50SSPublic.java | 0 .../win32/coff/DebugVC50SSPublicSym.java | 0 .../win32/coff/DebugVC50SSSegMap.java | 0 .../win32/coff/DebugVC50SSSegName.java | 0 .../win32/coff/DebugVC50SSSrcLnSeg.java | 0 .../win32/coff/DebugVC50SSSrcModule.java | 0 .../win32/coff/DebugVC50SSStaticSym.java | 0 .../win32/coff/DebugVC50SSSymbolBase.java | 0 .../win32/coff/DebugVC50SSSymbols.java | 0 .../debugger/win32/coff/DebugVC50SSTypes.java | 0 .../debugger/win32/coff/DebugVC50SegDesc.java | 0 .../win32/coff/DebugVC50SegDescEnums.java | 0 .../debugger/win32/coff/DebugVC50SegInfo.java | 0 .../win32/coff/DebugVC50SrcModFileDesc.java | 0 .../coff/DebugVC50SrcModLineNumberMap.java | 0 .../win32/coff/DebugVC50Subsection.java | 0 .../coff/DebugVC50SubsectionDirectory.java | 0 .../win32/coff/DebugVC50SubsectionTypes.java | 0 .../win32/coff/DebugVC50SymbolEnums.java | 0 .../win32/coff/DebugVC50SymbolIterator.java | 0 .../win32/coff/DebugVC50SymbolTypes.java | 0 .../win32/coff/DebugVC50TypeEnums.java | 0 .../win32/coff/DebugVC50TypeIterator.java | 0 .../win32/coff/DebugVC50TypeLeafIndices.java | 0 .../DebugVC50WrongNumericTypeException.java | 0 .../win32/coff/DebugVC50X86RegisterEnums.java | 0 .../debugger/win32/coff/DumpExports.java | 0 .../win32/coff/ExportDirectoryTable.java | 0 .../debugger/win32/coff/MachineTypes.java | 0 .../debugger/win32/coff/OptionalHeader.java | 0 .../coff/OptionalHeaderDataDirectories.java | 0 .../coff/OptionalHeaderStandardFields.java | 0 .../OptionalHeaderWindowsSpecificFields.java | 0 .../debugger/win32/coff/SectionFlags.java | 0 .../debugger/win32/coff/SectionHeader.java | 0 .../debugger/win32/coff/TestDebugInfo.java | 0 .../debugger/win32/coff/TestParser.java | 0 .../debugger/win32/coff/TypeIndicators.java | 0 .../win32/coff/WindowsNTSubsystem.java | 0 .../debugger/windbg/AddressDataSource.java | 0 .../sun/jvm/hotspot/debugger/windbg/DLL.java | 0 .../debugger/windbg/WindbgAddress.java | 0 .../windbg/WindbgCDebugInfoBuilder.java | 0 .../debugger/windbg/WindbgCDebugger.java | 0 .../debugger/windbg/WindbgDebugger.java | 0 .../debugger/windbg/WindbgDebuggerLocal.java | 0 .../debugger/windbg/WindbgOopHandle.java | 0 .../debugger/windbg/WindbgThreadFactory.java | 0 .../windbg/amd64/WindbgAMD64Thread.java | 0 .../amd64/WindbgAMD64ThreadContext.java | 0 .../amd64/WindbgAMD64ThreadFactory.java | 0 .../windbg/ia64/WindbgIA64Thread.java | 0 .../windbg/ia64/WindbgIA64ThreadContext.java | 0 .../windbg/ia64/WindbgIA64ThreadFactory.java | 0 .../debugger/windbg/x86/WindbgX86Thread.java | 0 .../windbg/x86/WindbgX86ThreadContext.java | 0 .../windbg/x86/WindbgX86ThreadFactory.java | 0 .../windows/amd64/WindowsAMD64CFrame.java | 0 .../windows/x86/WindowsX86CFrame.java | 0 .../debugger/x86/X86ThreadContext.java | 0 .../jvm/hotspot/gc/cms/AdaptiveFreeList.java | 0 .../sun/jvm/hotspot/gc/cms/CMSBitMap.java | 0 .../sun/jvm/hotspot/gc/cms/CMSCollector.java | 0 .../gc/cms/CompactibleFreeListSpace.java | 0 .../gc/cms/ConcurrentMarkSweepGeneration.java | 0 .../jvm/hotspot/gc/cms/LinearAllocBlock.java | 0 .../jvm/hotspot/gc/cms/ParNewGeneration.java | 0 .../jvm/hotspot/gc/g1/G1CollectedHeap.java | 0 .../jvm/hotspot/gc/g1/G1HeapRegionTable.java | 0 .../hotspot/gc/g1/G1MonitoringSupport.java | 0 .../sun/jvm/hotspot/gc/g1/HeapRegion.java | 0 .../jvm/hotspot/gc/g1/HeapRegionManager.java | 0 .../jvm/hotspot/gc/g1/HeapRegionSetBase.java | 0 .../hotspot/gc/parallel/ImmutableSpace.java | 0 .../jvm/hotspot/gc/parallel/MutableSpace.java | 0 .../sun/jvm/hotspot/gc/parallel/PSOldGen.java | 0 .../jvm/hotspot/gc/parallel/PSYoungGen.java | 0 .../gc/parallel/ParallelScavengeHeap.java | 0 .../hotspot/gc/serial/DefNewGeneration.java | 0 .../hotspot/gc/serial/TenuredGeneration.java | 0 .../jvm/hotspot/gc/shared/CardGeneration.java | 0 .../jvm/hotspot/gc/shared/CollectedHeap.java | 0 .../hotspot/gc/shared/CollectedHeapName.java | 0 .../hotspot/gc/shared/CompactibleSpace.java | 0 .../hotspot/gc/shared/ContiguousSpace.java | 0 .../sun/jvm/hotspot/gc/shared/G1YCType.java | 0 .../sun/jvm/hotspot/gc/shared/GCCause.java | 0 .../sun/jvm/hotspot/gc/shared/GCName.java | 0 .../sun/jvm/hotspot/gc/shared/GCWhen.java | 0 .../hotspot/gc/shared/GenCollectedHeap.java | 0 .../sun/jvm/hotspot/gc/shared/Generation.java | 0 .../hotspot/gc/shared/GenerationFactory.java | 0 .../gc/shared/GenerationIsInClosure.java | 0 .../jvm/hotspot/gc/shared/GenerationSpec.java | 0 .../gc/shared/OffsetTableContigSpace.java | 0 .../sun/jvm/hotspot/gc/shared/Space.java | 0 .../jvm/hotspot/gc/shared/SpaceClosure.java | 0 .../jvm/hotspot/gc/shared/TenuredSpace.java | 0 .../sun/jvm/hotspot/interpreter/Bytecode.java | 0 .../interpreter/BytecodeANewArray.java | 0 .../hotspot/interpreter/BytecodeBipush.java | 0 .../interpreter/BytecodeCheckCast.java | 0 .../interpreter/BytecodeDisassembler.java | 0 .../hotspot/interpreter/BytecodeGetField.java | 0 .../hotspot/interpreter/BytecodeGetPut.java | 0 .../interpreter/BytecodeGetStatic.java | 0 .../jvm/hotspot/interpreter/BytecodeGoto.java | 0 .../hotspot/interpreter/BytecodeGotoW.java | 0 .../jvm/hotspot/interpreter/BytecodeIf.java | 0 .../jvm/hotspot/interpreter/BytecodeIinc.java | 0 .../interpreter/BytecodeInstanceOf.java | 0 .../hotspot/interpreter/BytecodeInvoke.java | 0 .../jvm/hotspot/interpreter/BytecodeJmp.java | 0 .../jvm/hotspot/interpreter/BytecodeJsr.java | 0 .../jvm/hotspot/interpreter/BytecodeJsrW.java | 0 .../jvm/hotspot/interpreter/BytecodeLoad.java | 0 .../interpreter/BytecodeLoadConstant.java | 0 .../interpreter/BytecodeLoadStore.java | 0 .../interpreter/BytecodeLookupswitch.java | 0 .../interpreter/BytecodeMultiANewArray.java | 0 .../jvm/hotspot/interpreter/BytecodeNew.java | 0 .../hotspot/interpreter/BytecodeNewArray.java | 0 .../hotspot/interpreter/BytecodePutField.java | 0 .../interpreter/BytecodePutStatic.java | 0 .../jvm/hotspot/interpreter/BytecodeRet.java | 0 .../hotspot/interpreter/BytecodeSipush.java | 0 .../hotspot/interpreter/BytecodeStore.java | 0 .../hotspot/interpreter/BytecodeStream.java | 0 .../interpreter/BytecodeTableswitch.java | 0 .../hotspot/interpreter/BytecodeVisitor.java | 0 .../hotspot/interpreter/BytecodeWideable.java | 0 .../interpreter/BytecodeWithCPIndex.java | 0 .../interpreter/BytecodeWithKlass.java | 0 .../jvm/hotspot/interpreter/Bytecodes.java | 0 .../jvm/hotspot/interpreter/Interpreter.java | 0 .../interpreter/InterpreterCodelet.java | 0 .../hotspot/interpreter/LookupswitchPair.java | 0 .../interpreter/MaskFillerForNative.java | 0 .../hotspot/interpreter/OffsetClosure.java | 0 .../hotspot/interpreter/OopMapCacheEntry.java | 0 .../interpreter/OopMapForCacheEntry.java | 0 .../jvm/hotspot/jdi/ArrayReferenceImpl.java | 0 .../sun/jvm/hotspot/jdi/ArrayTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/BaseLineInfo.java | 0 .../sun/jvm/hotspot/jdi/BooleanTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/BooleanValueImpl.java | 0 .../sun/jvm/hotspot/jdi/ByteTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/ByteValueImpl.java | 0 .../sun/jvm/hotspot/jdi/CharTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/CharValueImpl.java | 0 .../hotspot/jdi/ClassLoaderReferenceImpl.java | 0 .../hotspot/jdi/ClassObjectReferenceImpl.java | 0 .../sun/jvm/hotspot/jdi/ClassTypeImpl.java | 0 .../jvm/hotspot/jdi/ConcreteMethodImpl.java | 0 .../sun/jvm/hotspot/jdi/ConnectorImpl.java | 0 .../sun/jvm/hotspot/jdi/DoubleTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/DoubleValueImpl.java | 0 .../sun/jvm/hotspot/jdi/FieldImpl.java | 0 .../sun/jvm/hotspot/jdi/FloatTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/FloatValueImpl.java | 0 .../sun/jvm/hotspot/jdi/IntegerTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/IntegerValueImpl.java | 0 .../jvm/hotspot/jdi/InterfaceTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/JNITypeParser.java | 0 .../sun/jvm/hotspot/jdi/JVMTIThreadState.java | 0 .../classes/sun/jvm/hotspot/jdi/LineInfo.java | 0 .../jvm/hotspot/jdi/LocalVariableImpl.java | 0 .../sun/jvm/hotspot/jdi/LocationImpl.java | 0 .../sun/jvm/hotspot/jdi/LongTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/LongValueImpl.java | 0 .../sun/jvm/hotspot/jdi/MethodImpl.java | 0 .../sun/jvm/hotspot/jdi/MirrorImpl.java | 0 .../sun/jvm/hotspot/jdi/MonitorInfoImpl.java | 0 .../hotspot/jdi/NonConcreteMethodImpl.java | 0 .../jvm/hotspot/jdi/ObjectReferenceImpl.java | 0 .../jvm/hotspot/jdi/PrimitiveTypeImpl.java | 0 .../jvm/hotspot/jdi/PrimitiveValueImpl.java | 0 .../jvm/hotspot/jdi/ReferenceTypeImpl.java | 0 .../hotspot/jdi/SACoreAttachingConnector.java | 0 .../sun/jvm/hotspot/jdi/SADebugServer.java | 0 .../jdi/SADebugServerAttachingConnector.java | 0 .../sun/jvm/hotspot/jdi/SAJDIClassLoader.java | 0 .../hotspot/jdi/SAPIDAttachingConnector.java | 0 .../classes/sun/jvm/hotspot/jdi/SDE.java | 0 .../sun/jvm/hotspot/jdi/ShortTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/ShortValueImpl.java | 0 .../sun/jvm/hotspot/jdi/StackFrameImpl.java | 0 .../sun/jvm/hotspot/jdi/StratumLineInfo.java | 0 .../jvm/hotspot/jdi/StringReferenceImpl.java | 0 .../hotspot/jdi/ThreadGroupReferenceImpl.java | 0 .../jvm/hotspot/jdi/ThreadReferenceImpl.java | 0 .../jvm/hotspot/jdi/TypeComponentImpl.java | 0 .../classes/sun/jvm/hotspot/jdi/TypeImpl.java | 0 .../sun/jvm/hotspot/jdi/VMModifiers.java | 0 .../sun/jvm/hotspot/jdi/ValueContainer.java | 0 .../sun/jvm/hotspot/jdi/ValueImpl.java | 0 .../jvm/hotspot/jdi/VirtualMachineImpl.java | 0 .../sun/jvm/hotspot/jdi/VoidTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/VoidValueImpl.java | 0 .../memory/AFLBinaryTreeDictionary.java | 0 .../sun/jvm/hotspot/memory/CodeHeap.java | 0 .../sun/jvm/hotspot/memory/Dictionary.java | 0 .../jvm/hotspot/memory/DictionaryEntry.java | 0 .../sun/jvm/hotspot/memory/FreeChunk.java | 0 .../sun/jvm/hotspot/memory/HeapBlock.java | 0 .../hotspot/memory/LoaderConstraintEntry.java | 0 .../hotspot/memory/LoaderConstraintTable.java | 0 .../sun/jvm/hotspot/memory/MemRegion.java | 0 .../jvm/hotspot/memory/PlaceholderEntry.java | 0 .../jvm/hotspot/memory/PlaceholderTable.java | 0 .../memory/ProtectionDomainCacheEntry.java | 0 .../hotspot/memory/ProtectionDomainEntry.java | 0 .../sun/jvm/hotspot/memory/ReferenceType.java | 0 .../sun/jvm/hotspot/memory/StringTable.java | 0 .../sun/jvm/hotspot/memory/SymbolTable.java | 0 .../jvm/hotspot/memory/SystemDictionary.java | 0 .../sun/jvm/hotspot/memory/Universe.java | 0 .../sun/jvm/hotspot/memory/VirtualSpace.java | 0 .../sun/jvm/hotspot/oops/AccessFlags.java | 0 .../sun/jvm/hotspot/oops/ArgInfoData.java | 0 .../classes/sun/jvm/hotspot/oops/Array.java | 0 .../sun/jvm/hotspot/oops/ArrayData.java | 0 .../sun/jvm/hotspot/oops/ArrayKlass.java | 0 .../classes/sun/jvm/hotspot/oops/BitData.java | 0 .../sun/jvm/hotspot/oops/BooleanField.java | 0 .../sun/jvm/hotspot/oops/BranchData.java | 0 .../sun/jvm/hotspot/oops/BreakpointInfo.java | 0 .../sun/jvm/hotspot/oops/ByteField.java | 0 .../sun/jvm/hotspot/oops/CIntField.java | 0 .../sun/jvm/hotspot/oops/CallTypeData.java | 0 .../hotspot/oops/CallTypeDataInterface.java | 0 .../sun/jvm/hotspot/oops/CellTypeState.java | 0 .../jvm/hotspot/oops/CellTypeStateList.java | 0 .../sun/jvm/hotspot/oops/CharField.java | 0 .../hotspot/oops/CheckedExceptionElement.java | 0 .../jvm/hotspot/oops/CompiledICHolder.java | 0 .../oops/CompressedLineNumberReadStream.java | 0 .../sun/jvm/hotspot/oops/ConstMethod.java | 0 .../sun/jvm/hotspot/oops/ConstantPool.java | 0 .../jvm/hotspot/oops/ConstantPoolCache.java | 0 .../hotspot/oops/ConstantPoolCacheEntry.java | 0 .../sun/jvm/hotspot/oops/CounterData.java | 0 .../sun/jvm/hotspot/oops/DataLayout.java | 0 .../jvm/hotspot/oops/DefaultHeapVisitor.java | 0 .../hotspot/oops/DefaultMetadataVisitor.java | 0 .../jvm/hotspot/oops/DefaultOopVisitor.java | 0 .../sun/jvm/hotspot/oops/DoubleField.java | 0 .../hotspot/oops/ExceptionTableElement.java | 0 .../classes/sun/jvm/hotspot/oops/Field.java | 0 .../sun/jvm/hotspot/oops/FieldIdentifier.java | 0 .../sun/jvm/hotspot/oops/FieldType.java | 0 .../sun/jvm/hotspot/oops/FieldVisitor.java | 0 .../sun/jvm/hotspot/oops/FloatField.java | 0 .../sun/jvm/hotspot/oops/GenerateOopMap.java | 0 .../sun/jvm/hotspot/oops/HeapPrinter.java | 0 .../sun/jvm/hotspot/oops/HeapVisitor.java | 0 .../oops/IndexableFieldIdentifier.java | 0 .../sun/jvm/hotspot/oops/Instance.java | 0 .../oops/InstanceClassLoaderKlass.java | 0 .../sun/jvm/hotspot/oops/InstanceKlass.java | 0 .../jvm/hotspot/oops/InstanceMirrorKlass.java | 0 .../jvm/hotspot/oops/InstanceRefKlass.java | 0 .../sun/jvm/hotspot/oops/IntField.java | 0 .../jvm/hotspot/oops/JVMDIClassStatus.java | 0 .../sun/jvm/hotspot/oops/JumpData.java | 0 .../classes/sun/jvm/hotspot/oops/Klass.java | 0 .../hotspot/oops/LineNumberTableElement.java | 0 .../oops/LocalVariableTableElement.java | 0 .../sun/jvm/hotspot/oops/LongField.java | 0 .../classes/sun/jvm/hotspot/oops/Mark.java | 0 .../sun/jvm/hotspot/oops/Metadata.java | 0 .../sun/jvm/hotspot/oops/MetadataField.java | 0 .../sun/jvm/hotspot/oops/MetadataVisitor.java | 0 .../classes/sun/jvm/hotspot/oops/Method.java | 0 .../sun/jvm/hotspot/oops/MethodCounters.java | 0 .../sun/jvm/hotspot/oops/MethodData.java | 0 .../jvm/hotspot/oops/MethodDataInterface.java | 0 .../sun/jvm/hotspot/oops/MultiBranchData.java | 0 .../jvm/hotspot/oops/MutationException.java | 0 .../hotspot/oops/NamedFieldIdentifier.java | 0 .../jvm/hotspot/oops/NarrowKlassField.java | 0 .../sun/jvm/hotspot/oops/NarrowOopField.java | 0 .../sun/jvm/hotspot/oops/ObjArray.java | 0 .../sun/jvm/hotspot/oops/ObjArrayKlass.java | 0 .../sun/jvm/hotspot/oops/ObjectHeap.java | 0 .../sun/jvm/hotspot/oops/ObjectHistogram.java | 0 .../hotspot/oops/ObjectHistogramElement.java | 0 .../classes/sun/jvm/hotspot/oops/Oop.java | 0 .../sun/jvm/hotspot/oops/OopField.java | 0 .../sun/jvm/hotspot/oops/OopPrinter.java | 0 .../sun/jvm/hotspot/oops/OopUtilities.java | 0 .../sun/jvm/hotspot/oops/OopVisitor.java | 0 .../jvm/hotspot/oops/ParametersTypeData.java | 0 .../sun/jvm/hotspot/oops/ProfileData.java | 0 .../sun/jvm/hotspot/oops/RawHeapVisitor.java | 0 .../jvm/hotspot/oops/ReceiverTypeData.java | 0 .../classes/sun/jvm/hotspot/oops/RetData.java | 0 .../sun/jvm/hotspot/oops/ReturnTypeEntry.java | 0 .../sun/jvm/hotspot/oops/ShortField.java | 0 .../jvm/hotspot/oops/SpeculativeTrapData.java | 0 .../classes/sun/jvm/hotspot/oops/Symbol.java | 0 .../sun/jvm/hotspot/oops/TypeArray.java | 0 .../sun/jvm/hotspot/oops/TypeArrayKlass.java | 0 .../sun/jvm/hotspot/oops/TypeEntries.java | 0 .../jvm/hotspot/oops/TypeEntriesAtCall.java | 0 .../hotspot/oops/TypeStackSlotEntries.java | 0 .../jvm/hotspot/oops/UnknownOopException.java | 0 .../sun/jvm/hotspot/oops/VirtualCallData.java | 0 .../jvm/hotspot/oops/VirtualCallTypeData.java | 0 .../sun/jvm/hotspot/oops/java_lang_Class.java | 0 .../classes/sun/jvm/hotspot/opto/Block.java | 0 .../sun/jvm/hotspot/opto/Block_Array.java | 0 .../sun/jvm/hotspot/opto/Block_List.java | 0 .../jvm/hotspot/opto/CallDynamicJavaNode.java | 0 .../sun/jvm/hotspot/opto/CallJavaNode.java | 0 .../sun/jvm/hotspot/opto/CallNode.java | 0 .../sun/jvm/hotspot/opto/CallRuntimeNode.java | 0 .../jvm/hotspot/opto/CallStaticJavaNode.java | 0 .../classes/sun/jvm/hotspot/opto/Compile.java | 0 .../jvm/hotspot/opto/CompilerPhaseType.java | 0 .../sun/jvm/hotspot/opto/HaltNode.java | 0 .../sun/jvm/hotspot/opto/InlineTree.java | 0 .../sun/jvm/hotspot/opto/JVMState.java | 0 .../sun/jvm/hotspot/opto/LoopNode.java | 0 .../jvm/hotspot/opto/MachCallJavaNode.java | 0 .../sun/jvm/hotspot/opto/MachCallNode.java | 0 .../jvm/hotspot/opto/MachCallRuntimeNode.java | 0 .../hotspot/opto/MachCallStaticJavaNode.java | 0 .../sun/jvm/hotspot/opto/MachIfNode.java | 0 .../sun/jvm/hotspot/opto/MachNode.java | 0 .../sun/jvm/hotspot/opto/MachReturnNode.java | 0 .../jvm/hotspot/opto/MachSafePointNode.java | 0 .../sun/jvm/hotspot/opto/MultiNode.java | 0 .../classes/sun/jvm/hotspot/opto/Node.java | 0 .../sun/jvm/hotspot/opto/Node_Array.java | 0 .../sun/jvm/hotspot/opto/Node_List.java | 0 .../classes/sun/jvm/hotspot/opto/Phase.java | 0 .../sun/jvm/hotspot/opto/PhaseCFG.java | 0 .../sun/jvm/hotspot/opto/PhaseRegAlloc.java | 0 .../classes/sun/jvm/hotspot/opto/PhiNode.java | 0 .../sun/jvm/hotspot/opto/ProjNode.java | 0 .../sun/jvm/hotspot/opto/RegionNode.java | 0 .../sun/jvm/hotspot/opto/RootNode.java | 0 .../sun/jvm/hotspot/opto/SafePointNode.java | 0 .../sun/jvm/hotspot/opto/TypeNode.java | 0 .../sun/jvm/hotspot/prims/JvmtiExport.java | 0 .../jvm/hotspot/runtime/AddressVisitor.java | 0 .../hotspot/runtime/ArgumentSizeComputer.java | 0 .../sun/jvm/hotspot/runtime/Arguments.java | 0 .../sun/jvm/hotspot/runtime/BasicLock.java | 0 .../jvm/hotspot/runtime/BasicObjectLock.java | 0 .../sun/jvm/hotspot/runtime/BasicType.java | 0 .../jvm/hotspot/runtime/BasicTypeSize.java | 0 .../sun/jvm/hotspot/runtime/Bytes.java | 0 .../jvm/hotspot/runtime/ClassConstants.java | 0 .../runtime/CodeCacheSweeperThread.java | 0 .../jvm/hotspot/runtime/CompiledVFrame.java | 0 .../jvm/hotspot/runtime/CompilerThread.java | 0 .../runtime/ConcurrentLocksPrinter.java | 0 .../runtime/ConstructionException.java | 0 .../jvm/hotspot/runtime/DeadlockDetector.java | 0 .../jvm/hotspot/runtime/ExternalVFrame.java | 0 .../sun/jvm/hotspot/runtime/Flags.java | 0 .../sun/jvm/hotspot/runtime/Frame.java | 0 .../hotspot/runtime/InstanceConstructor.java | 0 .../hotspot/runtime/InterpretedVFrame.java | 0 .../jvm/hotspot/runtime/JNIHandleBlock.java | 0 .../sun/jvm/hotspot/runtime/JNIHandles.java | 0 .../sun/jvm/hotspot/runtime/JNIid.java | 0 .../jvm/hotspot/runtime/JavaCallWrapper.java | 0 .../sun/jvm/hotspot/runtime/JavaThread.java | 0 .../hotspot/runtime/JavaThreadFactory.java | 0 .../hotspot/runtime/JavaThreadPDAccess.java | 0 .../jvm/hotspot/runtime/JavaThreadState.java | 0 .../sun/jvm/hotspot/runtime/JavaVFrame.java | 0 .../jvm/hotspot/runtime/JvmtiAgentThread.java | 0 .../sun/jvm/hotspot/runtime/MonitorInfo.java | 0 .../runtime/NativeSignatureIterator.java | 0 .../sun/jvm/hotspot/runtime/OSThread.java | 0 .../jvm/hotspot/runtime/ObjectMonitor.java | 0 .../hotspot/runtime/ObjectSynchronizer.java | 0 .../jvm/hotspot/runtime/PerfDataEntry.java | 0 .../jvm/hotspot/runtime/PerfDataPrologue.java | 0 .../sun/jvm/hotspot/runtime/PerfMemory.java | 0 .../sun/jvm/hotspot/runtime/RegisterMap.java | 0 .../jvm/hotspot/runtime/ResultTypeFinder.java | 0 .../jvm/hotspot/runtime/ServiceThread.java | 0 .../hotspot/runtime/SignatureConverter.java | 0 .../jvm/hotspot/runtime/SignatureInfo.java | 0 .../hotspot/runtime/SignatureIterator.java | 0 .../jvm/hotspot/runtime/StackFrameStream.java | 0 .../sun/jvm/hotspot/runtime/StackValue.java | 0 .../hotspot/runtime/StackValueCollection.java | 0 .../runtime/StaticBaseConstructor.java | 0 .../sun/jvm/hotspot/runtime/StubRoutines.java | 0 .../sun/jvm/hotspot/runtime/Thread.java | 0 .../runtime/ThreadLocalAllocBuffer.java | 0 .../sun/jvm/hotspot/runtime/Threads.java | 0 .../sun/jvm/hotspot/runtime/VFrame.java | 0 .../classes/sun/jvm/hotspot/runtime/VM.java | 0 .../sun/jvm/hotspot/runtime/VMObject.java | 0 .../jvm/hotspot/runtime/VMObjectFactory.java | 0 .../sun/jvm/hotspot/runtime/VMOps.java | 0 .../sun/jvm/hotspot/runtime/VMReg.java | 0 .../runtime/VMVersionMismatchException.java | 0 .../runtime/VirtualBaseConstructor.java | 0 .../hotspot/runtime/VirtualConstructor.java | 0 .../jvm/hotspot/runtime/WatcherThread.java | 0 .../aarch64/AARCH64CurrentFrameGuess.java | 0 .../hotspot/runtime/aarch64/AARCH64Frame.java | 0 .../aarch64/AARCH64JavaCallWrapper.java | 0 .../runtime/aarch64/AARCH64RegisterMap.java | 0 .../runtime/amd64/AMD64CurrentFrameGuess.java | 0 .../runtime/amd64/AMD64JavaCallWrapper.java | 0 .../jvm/hotspot/runtime/bsd/BsdSignals.java | 0 .../bsd_amd64/BsdAMD64JavaThreadPDAccess.java | 0 .../hotspot/runtime/bsd_x86/BsdSignals.java | 0 .../bsd_x86/BsdX86JavaThreadPDAccess.java | 0 .../hotspot/runtime/linux/LinuxSignals.java | 0 .../LinuxAARCH64JavaThreadPDAccess.java | 0 .../LinuxAMD64JavaThreadPDAccess.java | 0 .../LinuxPPC64JavaThreadPDAccess.java | 0 .../LinuxSPARCJavaThreadPDAccess.java | 0 .../runtime/linux_x86/LinuxSignals.java | 0 .../linux_x86/LinuxX86JavaThreadPDAccess.java | 0 .../hotspot/runtime/posix/POSIXSignals.java | 0 .../runtime/ppc64/PPC64CurrentFrameGuess.java | 0 .../jvm/hotspot/runtime/ppc64/PPC64Frame.java | 0 .../runtime/ppc64/PPC64JavaCallWrapper.java | 0 .../runtime/ppc64/PPC64RegisterMap.java | 0 .../SolarisAMD64JavaThreadPDAccess.java | 0 .../SolarisSPARCJavaThreadPDAccess.java | 0 .../SolarisX86JavaThreadPDAccess.java | 0 .../jvm/hotspot/runtime/sparc/SPARCFrame.java | 0 .../runtime/sparc/SPARCRegisterMap.java | 0 .../sun/jvm/hotspot/runtime/vmSymbols.java | 0 .../Win32AMD64JavaThreadPDAccess.java | 0 .../win32_x86/Win32X86JavaThreadPDAccess.java | 0 .../runtime/x86/X86CurrentFrameGuess.java | 0 .../sun/jvm/hotspot/runtime/x86/X86Frame.java | 0 .../runtime/x86/X86JavaCallWrapper.java | 0 .../hotspot/runtime/x86/X86RegisterMap.java | 0 .../jvm/hotspot/tools/ClassLoaderStats.java | 0 .../sun/jvm/hotspot/tools/FinalizerInfo.java | 0 .../sun/jvm/hotspot/tools/FlagDumper.java | 0 .../sun/jvm/hotspot/tools/HeapDumper.java | 0 .../sun/jvm/hotspot/tools/HeapSummary.java | 0 .../classes/sun/jvm/hotspot/tools/JInfo.java | 0 .../classes/sun/jvm/hotspot/tools/JMap.java | 0 .../classes/sun/jvm/hotspot/tools/JSnap.java | 0 .../classes/sun/jvm/hotspot/tools/JStack.java | 0 .../jvm/hotspot/tools/ObjectHistogram.java | 0 .../classes/sun/jvm/hotspot/tools/PMap.java | 0 .../classes/sun/jvm/hotspot/tools/PStack.java | 0 .../sun/jvm/hotspot/tools/StackTrace.java | 0 .../sun/jvm/hotspot/tools/SysPropsDumper.java | 0 .../classes/sun/jvm/hotspot/tools/Tool.java | 0 .../hotspot/tools/jcore/ByteCodeRewriter.java | 0 .../jvm/hotspot/tools/jcore/ClassDump.java | 0 .../jvm/hotspot/tools/jcore/ClassFilter.java | 0 .../jvm/hotspot/tools/jcore/ClassWriter.java | 0 .../jvm/hotspot/tools/jcore/NameFilter.java | 0 .../tools/jcore/PackageNameFilter.java | 0 .../sun/jvm/hotspot/tools/soql/JSDB.java | 0 .../sun/jvm/hotspot/tools/soql/SOQL.java | 0 .../sun/jvm/hotspot/types/AddressField.java | 0 .../sun/jvm/hotspot/types/CIntegerField.java | 0 .../sun/jvm/hotspot/types/CIntegerType.java | 0 .../classes/sun/jvm/hotspot/types/Field.java | 0 .../sun/jvm/hotspot/types/JBooleanField.java | 0 .../sun/jvm/hotspot/types/JByteField.java | 0 .../sun/jvm/hotspot/types/JCharField.java | 0 .../sun/jvm/hotspot/types/JDoubleField.java | 0 .../sun/jvm/hotspot/types/JFloatField.java | 0 .../sun/jvm/hotspot/types/JIntField.java | 0 .../sun/jvm/hotspot/types/JLongField.java | 0 .../sun/jvm/hotspot/types/JShortField.java | 0 .../sun/jvm/hotspot/types/NarrowOopField.java | 0 .../sun/jvm/hotspot/types/OopField.java | 0 .../sun/jvm/hotspot/types/PointerType.java | 0 .../classes/sun/jvm/hotspot/types/Type.java | 0 .../sun/jvm/hotspot/types/TypeDataBase.java | 0 .../jvm/hotspot/types/WrongTypeException.java | 0 .../types/basic/BasicAddressFieldWrapper.java | 0 .../types/basic/BasicCIntegerField.java | 0 .../types/basic/BasicCIntegerType.java | 0 .../jvm/hotspot/types/basic/BasicField.java | 0 .../types/basic/BasicFieldWrapper.java | 0 .../types/basic/BasicJBooleanField.java | 0 .../hotspot/types/basic/BasicJByteField.java | 0 .../hotspot/types/basic/BasicJCharField.java | 0 .../types/basic/BasicJDoubleField.java | 0 .../hotspot/types/basic/BasicJFloatField.java | 0 .../hotspot/types/basic/BasicJIntField.java | 0 .../hotspot/types/basic/BasicJLongField.java | 0 .../hotspot/types/basic/BasicJShortField.java | 0 .../types/basic/BasicNarrowOopField.java | 0 .../hotspot/types/basic/BasicOopField.java | 0 .../hotspot/types/basic/BasicPointerType.java | 0 .../jvm/hotspot/types/basic/BasicType.java | 0 .../types/basic/BasicTypeDataBase.java | 0 .../hotspot/types/basic/BasicVtblAccess.java | 0 .../jvm/hotspot/types/basic/VtblAccess.java | 0 .../jvm/hotspot/ui/AnnotatedMemoryPanel.java | 0 .../sun/jvm/hotspot/ui/Annotation.java | 0 .../jvm/hotspot/ui/CommandProcessorPanel.java | 0 .../hotspot/ui/DeadlockDetectionPanel.java | 0 .../jvm/hotspot/ui/DebuggerConsolePanel.java | 0 .../jvm/hotspot/ui/EditableAtEndDocument.java | 0 .../classes/sun/jvm/hotspot/ui/Editor.java | 0 .../sun/jvm/hotspot/ui/EditorCommands.java | 0 .../sun/jvm/hotspot/ui/EditorFactory.java | 0 .../sun/jvm/hotspot/ui/FindByQueryPanel.java | 0 .../jvm/hotspot/ui/FindInCodeCachePanel.java | 0 .../sun/jvm/hotspot/ui/FindInHeapPanel.java | 0 .../classes/sun/jvm/hotspot/ui/FindPanel.java | 0 .../sun/jvm/hotspot/ui/FrameWrapper.java | 0 .../sun/jvm/hotspot/ui/GraphicsUtilities.java | 0 .../jvm/hotspot/ui/HeapParametersPanel.java | 0 .../hotspot/ui/HighPrecisionJScrollBar.java | 0 .../sun/jvm/hotspot/ui/HistoryComboBox.java | 0 .../classes/sun/jvm/hotspot/ui/Inspector.java | 0 .../sun/jvm/hotspot/ui/JFrameWrapper.java | 0 .../jvm/hotspot/ui/JInternalFrameWrapper.java | 0 .../jvm/hotspot/ui/JavaStackTracePanel.java | 0 .../sun/jvm/hotspot/ui/JavaThreadsPanel.java | 0 .../sun/jvm/hotspot/ui/MemoryPanel.java | 0 .../sun/jvm/hotspot/ui/MemoryViewer.java | 0 .../jvm/hotspot/ui/MonitorCacheDumpPanel.java | 0 .../jvm/hotspot/ui/ObjectHistogramPanel.java | 0 .../sun/jvm/hotspot/ui/ObjectListPanel.java | 0 .../sun/jvm/hotspot/ui/ProcessListPanel.java | 0 .../sun/jvm/hotspot/ui/ProgressBarPanel.java | 0 .../sun/jvm/hotspot/ui/SAEditorPane.java | 0 .../sun/jvm/hotspot/ui/SAListener.java | 0 .../classes/sun/jvm/hotspot/ui/SAPanel.java | 0 .../sun/jvm/hotspot/ui/SourceCodePanel.java | 0 .../jvm/hotspot/ui/StringTransferable.java | 0 .../sun/jvm/hotspot/ui/SysPropsPanel.java | 0 .../sun/jvm/hotspot/ui/ThreadInfoPanel.java | 0 .../sun/jvm/hotspot/ui/VMFlagsPanel.java | 0 .../jvm/hotspot/ui/VMVersionInfoPanel.java | 0 .../sun/jvm/hotspot/ui/action/FindAction.java | 0 .../hotspot/ui/action/FindClassesAction.java | 0 .../hotspot/ui/action/FindCrashesAction.java | 0 .../hotspot/ui/action/HSDBActionManager.java | 0 .../jvm/hotspot/ui/action/InspectAction.java | 0 .../ui/action/JavaStackTraceAction.java | 0 .../jvm/hotspot/ui/action/MemoryAction.java | 0 .../sun/jvm/hotspot/ui/action/ShowAction.java | 0 .../hotspot/ui/action/ThreadInfoAction.java | 0 .../ui/classbrowser/ClassBrowserPanel.java | 0 .../ui/classbrowser/CodeViewerPanel.java | 0 .../ui/classbrowser/HTMLGenerator.java | 0 .../sun/jvm/hotspot/ui/resources/arrow.png | Bin .../jvm/hotspot/ui/resources/breakpoint.png | Bin .../sun/jvm/hotspot/ui/resources/triangle.png | Bin .../hotspot/ui/table/LongCellRenderer.java | 0 .../ui/table/SortHeaderCellRenderer.java | 0 .../ui/table/SortHeaderMouseAdapter.java | 0 .../hotspot/ui/table/SortableTableModel.java | 0 .../ui/table/TableModelComparator.java | 0 .../ui/tree/BadAddressTreeNodeAdapter.java | 0 .../ui/tree/BooleanTreeNodeAdapter.java | 0 .../ui/tree/CStringTreeNodeAdapter.java | 0 .../hotspot/ui/tree/CTypeTreeNodeAdapter.java | 0 .../hotspot/ui/tree/CharTreeNodeAdapter.java | 0 .../ui/tree/DoubleTreeNodeAdapter.java | 0 .../hotspot/ui/tree/FieldTreeNodeAdapter.java | 0 .../hotspot/ui/tree/FloatTreeNodeAdapter.java | 0 .../hotspot/ui/tree/LongTreeNodeAdapter.java | 0 .../ui/tree/MetadataTreeNodeAdapter.java | 0 .../hotspot/ui/tree/OopTreeNodeAdapter.java | 0 .../ui/tree/RevPtrsTreeNodeAdapter.java | 0 .../hotspot/ui/tree/RootTreeNodeAdapter.java | 0 .../hotspot/ui/tree/SimpleTreeGroupNode.java | 0 .../jvm/hotspot/ui/tree/SimpleTreeModel.java | 0 .../jvm/hotspot/ui/tree/SimpleTreeNode.java | 0 .../ui/treetable/AbstractTreeTableModel.java | 0 .../jvm/hotspot/ui/treetable/JTreeTable.java | 0 .../ui/treetable/SimpleTreeTableModel.java | 0 .../hotspot/ui/treetable/TreeTableModel.java | 0 .../ui/treetable/TreeTableModelAdapter.java | 0 .../utilities/AbstractHeapGraphWriter.java | 0 .../sun/jvm/hotspot/utilities/AddressOps.java | 0 .../hotspot/utilities/AltPlatformInfo.java | 0 .../sun/jvm/hotspot/utilities/Assert.java | 0 .../hotspot/utilities/AssertionFailure.java | 0 .../jvm/hotspot/utilities/BasicHashtable.java | 0 .../utilities/BasicHashtableEntry.java | 0 .../sun/jvm/hotspot/utilities/BitMap.java | 0 .../jvm/hotspot/utilities/BitMapClosure.java | 0 .../sun/jvm/hotspot/utilities/Bits.java | 0 .../jvm/hotspot/utilities/CPPExpressions.java | 0 .../hotspot/utilities/CStringUtilities.java | 0 .../hotspot/utilities/CompactHashTable.java | 0 .../jvm/hotspot/utilities/ConstIterator.java | 0 .../jvm/hotspot/utilities/ConstantTag.java | 0 .../hotspot/utilities/FindObjectByType.java | 0 .../jvm/hotspot/utilities/GenericArray.java | 0 .../utilities/GenericGrowableArray.java | 0 .../jvm/hotspot/utilities/GrowableArray.java | 0 .../sun/jvm/hotspot/utilities/Hashtable.java | 0 .../hotspot/utilities/HashtableBucket.java | 0 .../jvm/hotspot/utilities/HashtableEntry.java | 0 .../jvm/hotspot/utilities/HeapGXLWriter.java | 0 .../hotspot/utilities/HeapGraphWriter.java | 0 .../hotspot/utilities/HeapHprofBinWriter.java | 0 .../hotspot/utilities/HeapProgressThunk.java | 0 .../sun/jvm/hotspot/utilities/IntArray.java | 0 .../jvm/hotspot/utilities/IntegerEnum.java | 0 .../sun/jvm/hotspot/utilities/Interval.java | 0 .../jvm/hotspot/utilities/IntervalNode.java | 0 .../jvm/hotspot/utilities/IntervalTree.java | 0 .../sun/jvm/hotspot/utilities/KlassArray.java | 0 .../hotspot/utilities/LivenessAnalysis.java | 0 .../jvm/hotspot/utilities/LivenessPath.java | 0 .../utilities/LivenessPathElement.java | 0 .../hotspot/utilities/LivenessPathList.java | 0 .../sun/jvm/hotspot/utilities/MarkBits.java | 0 .../jvm/hotspot/utilities/MessageQueue.java | 0 .../utilities/MessageQueueBackend.java | 0 .../jvm/hotspot/utilities/MethodArray.java | 0 .../jvm/hotspot/utilities/ObjectReader.java | 0 .../jvm/hotspot/utilities/PlatformInfo.java | 0 .../jvm/hotspot/utilities/PointerFinder.java | 0 .../hotspot/utilities/PointerLocation.java | 0 .../utilities/ProcImageClassLoader.java | 0 .../utilities/ProgressiveHeapVisitor.java | 0 .../sun/jvm/hotspot/utilities/RBColor.java | 0 .../sun/jvm/hotspot/utilities/RBNode.java | 0 .../sun/jvm/hotspot/utilities/RBTree.java | 0 .../jvm/hotspot/utilities/ReversePtrs.java | 0 .../utilities/ReversePtrsAnalysis.java | 0 .../utilities/RobustOopDeterminator.java | 0 .../jvm/hotspot/utilities/StreamMonitor.java | 0 .../utilities/SystemDictionaryHelper.java | 0 .../hotspot/utilities/TwoOopHashtable.java | 0 .../sun/jvm/hotspot/utilities/U1Array.java | 0 .../sun/jvm/hotspot/utilities/U2Array.java | 0 .../UnsupportedPlatformException.java | 0 .../jvm/hotspot/utilities/WorkerThread.java | 0 .../utilities/memo/MemoizedBoolean.java | 0 .../hotspot/utilities/memo/MemoizedByte.java | 0 .../hotspot/utilities/memo/MemoizedChar.java | 0 .../utilities/memo/MemoizedDouble.java | 0 .../hotspot/utilities/memo/MemoizedFloat.java | 0 .../hotspot/utilities/memo/MemoizedInt.java | 0 .../hotspot/utilities/memo/MemoizedLong.java | 0 .../utilities/memo/MemoizedObject.java | 0 .../hotspot/utilities/memo/MemoizedShort.java | 0 .../jvm/hotspot/utilities/soql/Callable.java | 0 .../utilities/soql/DefaultScriptObject.java | 0 .../utilities/soql/InvocableCallable.java | 0 .../hotspot/utilities/soql/JSJavaArray.java | 0 .../utilities/soql/JSJavaArrayKlass.java | 0 .../hotspot/utilities/soql/JSJavaClass.java | 0 .../hotspot/utilities/soql/JSJavaFactory.java | 0 .../utilities/soql/JSJavaFactoryImpl.java | 0 .../hotspot/utilities/soql/JSJavaField.java | 0 .../hotspot/utilities/soql/JSJavaFrame.java | 0 .../hotspot/utilities/soql/JSJavaHeap.java | 0 .../utilities/soql/JSJavaInstance.java | 0 .../utilities/soql/JSJavaInstanceKlass.java | 0 .../hotspot/utilities/soql/JSJavaKlass.java | 0 .../hotspot/utilities/soql/JSJavaMethod.java | 0 .../utilities/soql/JSJavaObjArray.java | 0 .../utilities/soql/JSJavaObjArrayKlass.java | 0 .../hotspot/utilities/soql/JSJavaObject.java | 0 .../utilities/soql/JSJavaScriptEngine.java | 0 .../hotspot/utilities/soql/JSJavaString.java | 0 .../hotspot/utilities/soql/JSJavaThread.java | 0 .../utilities/soql/JSJavaTypeArray.java | 0 .../utilities/soql/JSJavaTypeArrayKlass.java | 0 .../jvm/hotspot/utilities/soql/JSJavaVM.java | 0 .../jvm/hotspot/utilities/soql/JSList.java | 0 .../sun/jvm/hotspot/utilities/soql/JSMap.java | 0 .../hotspot/utilities/soql/JSMetadata.java | 0 .../utilities/soql/MapScriptObject.java | 0 .../utilities/soql/MethodCallable.java | 0 .../hotspot/utilities/soql/ObjectVisitor.java | 0 .../hotspot/utilities/soql/SOQLEngine.java | 0 .../hotspot/utilities/soql/SOQLException.java | 0 .../jvm/hotspot/utilities/soql/SOQLQuery.java | 0 .../hotspot/utilities/soql/ScriptObject.java | 0 .../sun/jvm/hotspot/utilities/soql/sa.js | 0 .../share/native/libsaproc}/sadis.c | 0 .../solaris/native/libsaproc}/libproc.h | 0 .../solaris/native/libsaproc}/salibproc.h | 0 .../solaris/native/libsaproc}/saproc.cpp | 0 .../native/libsaproc}/saproc_audit.cpp | 0 .../jdk.hotspot.agent}/test/jdi/README.jjh | 0 .../test/jdi/SASanityChecker.java | 0 .../jdk.hotspot.agent}/test/jdi/TEST.ROOT | 0 .../test/jdi/TargetAdapter.java | 0 .../test/jdi/TargetListener.java | 0 .../test/jdi/TestScaffold.java | 0 .../test/jdi/VMConnection.java | 0 .../jdk.hotspot.agent}/test/jdi/jstack.sh | 0 .../jdk.hotspot.agent}/test/jdi/jstack64.sh | 0 .../jdk.hotspot.agent}/test/jdi/multivm.java | 0 .../jdk.hotspot.agent}/test/jdi/multivm.sh | 0 .../jdk.hotspot.agent}/test/jdi/runjdb.sh | 0 .../jdk.hotspot.agent}/test/jdi/runjpda.sh | 0 .../jdk.hotspot.agent}/test/jdi/runsa.sh | 0 .../test/jdi/sagclient.java | 0 .../jdk.hotspot.agent}/test/jdi/sagdoit.java | 0 .../jdk.hotspot.agent}/test/jdi/sagtarg.java | 0 .../jdk.hotspot.agent}/test/jdi/sagtest.java | 0 .../jdk.hotspot.agent}/test/jdi/sasanity.sh | 0 .../jdk.hotspot.agent}/test/jdi/serialvm.java | 0 .../jdk.hotspot.agent}/test/jdi/serialvm.sh | 0 .../test/libproc/LibprocClient.java | 0 .../test/libproc/LibprocTest.java | 0 .../jdk.hotspot.agent}/test/libproc/Makefile | 0 .../jdk.hotspot.agent}/test/libproc/README | 0 .../test/libproc/libproctest.sh | 0 .../test/libproc/libproctest64.sh | 0 .../windows/native/libsaproc}/sawindbg.cpp | 0 1242 files changed, 4 insertions(+), 3895 deletions(-) delete mode 100644 hotspot/agent/make/Makefile delete mode 100644 hotspot/agent/make/README.txt delete mode 100644 hotspot/agent/make/build-filelist delete mode 100644 hotspot/agent/make/build-pkglist delete mode 100644 hotspot/agent/make/build.xml delete mode 100644 hotspot/agent/make/clhsdbproc.sh delete mode 100644 hotspot/agent/make/clhsdbproc64.sh delete mode 100644 hotspot/agent/make/clhsdbwindbg.bat delete mode 100644 hotspot/agent/make/clhsdbwindbg64.bat delete mode 100644 hotspot/agent/make/dumpflagsproc.sh delete mode 100644 hotspot/agent/make/dumpflagsproc64.sh delete mode 100644 hotspot/agent/make/dumpflagswindbg.bat delete mode 100644 hotspot/agent/make/dumpflagswindbg64.bat delete mode 100644 hotspot/agent/make/dumpsyspropsproc.sh delete mode 100644 hotspot/agent/make/dumpsyspropsproc64.sh delete mode 100644 hotspot/agent/make/dumpsyspropswindbg.bat delete mode 100644 hotspot/agent/make/dumpsyspropswindbg64.bat delete mode 100644 hotspot/agent/make/finalizerinfoproc.sh delete mode 100644 hotspot/agent/make/finalizerinfoproc64.sh delete mode 100644 hotspot/agent/make/finalizerinfowindbg.bat delete mode 100644 hotspot/agent/make/finalizerinfowindbg64.bat delete mode 100644 hotspot/agent/make/grantAll.policy delete mode 100644 hotspot/agent/make/heapdumpproc.sh delete mode 100644 hotspot/agent/make/heapdumpproc64.sh delete mode 100644 hotspot/agent/make/heapdumpwindbg.bat delete mode 100644 hotspot/agent/make/heapdumpwindbg64.bat delete mode 100644 hotspot/agent/make/heapsumproc.sh delete mode 100644 hotspot/agent/make/heapsumproc64.sh delete mode 100644 hotspot/agent/make/heapsumwindbg.bat delete mode 100644 hotspot/agent/make/heapsumwindbg64.bat delete mode 100644 hotspot/agent/make/hsdb.bat delete mode 100644 hotspot/agent/make/hsdb.sh delete mode 100644 hotspot/agent/make/hsdbproc.sh delete mode 100644 hotspot/agent/make/hsdbproc64.sh delete mode 100644 hotspot/agent/make/hsdbwindbg.bat delete mode 100644 hotspot/agent/make/hsdbwindbg64.bat delete mode 100644 hotspot/agent/make/index.html delete mode 100644 hotspot/agent/make/jcoreproc.sh delete mode 100644 hotspot/agent/make/jcoreproc64.sh delete mode 100644 hotspot/agent/make/jcorewindbg.bat delete mode 100644 hotspot/agent/make/jcorewindbg64.bat delete mode 100644 hotspot/agent/make/jdbcore.sh delete mode 100644 hotspot/agent/make/jdbcore64.sh delete mode 100644 hotspot/agent/make/jdbproc.sh delete mode 100644 hotspot/agent/make/jdbproc64.sh delete mode 100644 hotspot/agent/make/jhistoproc.sh delete mode 100644 hotspot/agent/make/jhistoproc64.sh delete mode 100644 hotspot/agent/make/jhistowindbg.bat delete mode 100644 hotspot/agent/make/jhistowindbg64.bat delete mode 100644 hotspot/agent/make/jsdbproc.sh delete mode 100644 hotspot/agent/make/jsdbproc64.sh delete mode 100644 hotspot/agent/make/jsdbwindbg.bat delete mode 100644 hotspot/agent/make/jsdbwindbg64.bat delete mode 100644 hotspot/agent/make/jstackproc.sh delete mode 100644 hotspot/agent/make/jstackproc64.sh delete mode 100644 hotspot/agent/make/jstackwindbg.bat delete mode 100644 hotspot/agent/make/jstackwindbg64.bat delete mode 100644 hotspot/agent/make/marks_notes.html delete mode 100644 hotspot/agent/make/mkinstall delete mode 100644 hotspot/agent/make/permstatproc.sh delete mode 100644 hotspot/agent/make/permstatproc64.sh delete mode 100644 hotspot/agent/make/permstatwindbg.bat delete mode 100644 hotspot/agent/make/permstatwindbg64.bat delete mode 100644 hotspot/agent/make/pmapproc.sh delete mode 100644 hotspot/agent/make/pmapproc64.sh delete mode 100644 hotspot/agent/make/pmapwindbg.bat delete mode 100644 hotspot/agent/make/pmapwindbg64.bat delete mode 100644 hotspot/agent/make/pstackproc.sh delete mode 100644 hotspot/agent/make/pstackproc64.sh delete mode 100644 hotspot/agent/make/pstackwindbg.bat delete mode 100644 hotspot/agent/make/pstackwindbg64.bat delete mode 100644 hotspot/agent/make/saenv.bat delete mode 100644 hotspot/agent/make/saenv.sh delete mode 100644 hotspot/agent/make/saenv64.bat delete mode 100644 hotspot/agent/make/saenv64.sh delete mode 100644 hotspot/agent/make/soqlproc.sh delete mode 100644 hotspot/agent/make/soqlproc64.sh delete mode 100644 hotspot/agent/make/soqlwindbg.bat delete mode 100644 hotspot/agent/make/soqlwindbg64.bat delete mode 100644 hotspot/agent/make/start-debug-server delete mode 100644 hotspot/agent/make/start-debug-server-proc.sh delete mode 100644 hotspot/agent/make/start-debug-server-proc64.sh delete mode 100644 hotspot/agent/make/start-debug-server-windbg.bat delete mode 100644 hotspot/agent/make/start-debug-server-windbg64.bat delete mode 100644 hotspot/agent/make/start-rmiregistry.bat delete mode 100644 hotspot/agent/make/start-rmiregistry.sh delete mode 100644 hotspot/agent/src/os/bsd/Makefile delete mode 100644 hotspot/agent/src/os/linux/Makefile delete mode 100644 hotspot/agent/src/os/solaris/Makefile delete mode 100644 hotspot/agent/src/os/solaris/proc/Makefile delete mode 100644 hotspot/agent/src/os/win32/windbg/Makefile rename hotspot/{agent/src/os/linux/mapfile => make/mapfiles/libsaproc/mapfile-linux} (100%) rename hotspot/{agent/src/os/bsd/mapfile => make/mapfiles/libsaproc/mapfile-macosx} (100%) rename hotspot/{agent/src/os/solaris/proc/mapfile => make/mapfiles/libsaproc/mapfile-solaris} (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/ReadMe-JavaScript.text (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/cireplay.html (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/clhsdb.html (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/hsdb.html (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/index.html (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/jsdb.html (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/transported_core.html (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/LinuxDebuggerLocal.c (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/elfmacros.h (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/libproc.h (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/libproc_impl.c (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/libproc_impl.h (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/proc_service.h (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/ps_core.c (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/ps_proc.c (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/salibelf.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/linux/native/libsaproc}/salibelf.h (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/symtab.c (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/symtab.h (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/test.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/BsdDebuggerLocal.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/MacosxDebuggerLocal.m (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/StubDebuggerLocal.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/elfmacros.h (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/libproc.h (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/libproc_impl.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/libproc_impl.h (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/ps_core.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/ps_proc.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/salibelf.c (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/macosx/native/libsaproc}/salibelf.h (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/symtab.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/symtab.h (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/test.c (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/README (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/start-debug-server.bat (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/start-debug-server.sh (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/start-debug-server64.sh (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/start-rmiregistry.bat (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/start-rmiregistry.sh (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/start-rmiregistry64.sh (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/META-INF/services/com.sun.jdi.connect.Connector (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/AboutAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/ActionManager.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/ActionUtilities.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/AlignCenterAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/AlignLeftAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/AlignRightAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/ApplyAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/BackAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/CancelAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/DelegateAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/ExitAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/FileMenu.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/FinishAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/HelpAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/HelpMenu.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/NewAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/NextAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/OkAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/OpenAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/SaveAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/SaveAsAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/StateChangeAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/ViewMenu.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/CommonMenuBar.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/CommonToolBar.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/CommonUI.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/OkCancelButtonPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/OkCancelDialog.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/SplashScreen.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/StatusBar.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/TabsDlg.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/ToggleActionPropertyChangeListener.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/WizardDlg.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/development/Server16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/development/Server24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/About16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/About24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Delete16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Delete24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Find16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Help16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Help24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/History16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/History24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Information16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Information24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/New16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/New24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Open16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Open24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Save16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Save24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/SaveAs16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/SaveAs24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Zoom16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/ZoomIn16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/ZoomIn24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/navigation/Down16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/navigation/Up16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/text/AlignCenter16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/text/AlignCenter24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/text/AlignLeft16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/text/AlignLeft24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/text/AlignRight16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/text/AlignRight24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/BsdVtblAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/CLHSDB.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/CommandProcessor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/DebugServer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/HSDB.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/HelloWorld.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/HotSpotAgent.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/HotSpotSolarisVtblAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ObjectHistogram.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/RMIHelper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/SAGetopt.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/SALauncher.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/SALauncherLoader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/StackTrace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/Win32VtblAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/Disassembler.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/DummySymbolFinder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/ImmediateOrRegister.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/Operand.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/Register.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/SymbolFinder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/sparc/SPARCArgument.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegister.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisterType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisters.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/c1/Runtime1.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciBaseObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciConstant.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciEnv.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciInstance.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciMetadata.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciMethod.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciMethodData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciSymbol.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciTypeArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/AdapterBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/BufferBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/CodeBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/CodeCache.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/CodeCacheVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/CompressedReadStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/CompressedStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/CompressedWriteStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ConstantDoubleValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ConstantIntValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ConstantLongValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ConstantOopReadValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/DebugInformationRecorder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/Location.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/LocationValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/MonitorValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/NMethod.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ObjectValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/PCDesc.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/RuntimeStub.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/SafepointBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ScopeDesc.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ScopeValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/SingletonBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/Stub.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/StubQueue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/VMRegImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/CompileTask.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapPair.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapSet.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/OopMapStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/Address.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/AddressException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/DataSource.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/Debugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/DebuggerException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/DebuggerUtilities.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/InputLexer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/LongHashMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAArch64.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionPPC64.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionTwosComplement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MappedByteBufferDataSource.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/NoSuchSymbolException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/NotInHeapException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/OopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/Page.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/PageCache.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/PageFetcher.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ProcessInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/RandomAccessFileDataSource.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ReadResult.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/SymbolLookup.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ThreadAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ThreadProxy.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/UnalignedAddressException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/UnmappedAddressException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdOopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/SharedObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/AccessControl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/ArrayType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/BaseClass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/BitType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/BlockSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugInfoDataBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/CVAttributes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/ClosestSymbol.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/CompoundType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/DebugEvent.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/DefaultObjectVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/DoubleType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/EnumType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/Field.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/FieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/FloatType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/GlobalSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/IndexableFieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/IntType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObjectComparator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/LocalSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/MemberFunctionType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/NamedFieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/ObjectVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/PointerType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/ProcessControl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/RefType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/Sym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/TemplateType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/Type.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/TypeVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/VoidType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicArrayType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBaseClass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBitType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBlockSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCDebugInfoDataBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCompoundType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDebugEvent.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDoubleType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicEnumType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFloatType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicGlobalSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIndexableFieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIntType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberMapping.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLocalSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicMemberFunctionType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicNamedFieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicPointerType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicRefType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicVoidType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/CompoundTypeKind.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyBlockSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/ResolveListener.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/dummy/DummyOopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/SharedObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/ia64/LinuxIA64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/AddressDataSource.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/DSO.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFile.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFileParser.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHashTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFProgramHeader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSectionHeader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFStringTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSymbol.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ppc64/PPC64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcCDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcOopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/SharedObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteOopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxBfEfRecord.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFileRecord.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFunctionDefinitionRecord.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSectionDefinitionsRecord.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSymbolRecord.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxWeakExternalRecord.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFile.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFHeader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFLineNumber.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFRelocation.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbol.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbolConstants.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COMDATSelectionTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/Characteristics.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DLLCharacteristics.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DataDirectory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectoryEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50MemberAttributes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50ReservedTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSAlignSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSFileIndex.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalPub.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSLibraries.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSMPC.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSModule.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap16.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap32.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPreComp.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublic.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublicSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegName.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcLnSeg.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcModule.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSStaticSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbolBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbols.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDesc.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDescEnums.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModFileDesc.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModLineNumberMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50Subsection.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionDirectory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolEnums.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolIterator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeEnums.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeIterator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeLeafIndices.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50WrongNumericTypeException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50X86RegisterEnums.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/ExportDirectoryTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/MachineTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderDataDirectories.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderStandardFields.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderWindowsSpecificFields.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionFlags.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionHeader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestDebugInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/TypeIndicators.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/WindowsNTSubsystem.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/AddressDataSource.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/DLL.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgOopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/AdaptiveFreeList.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/CMSBitMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/CMSCollector.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/LinearAllocBlock.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/ParNewGeneration.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/g1/G1HeapRegionTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/g1/G1MonitoringSupport.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionManager.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/parallel/PSOldGen.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/parallel/PSYoungGen.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/CardGeneration.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/CompactibleSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/G1YCType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GCName.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GCWhen.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/Generation.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GenerationIsInClosure.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GenerationSpec.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/OffsetTableContigSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/Space.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/SpaceClosure.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/Bytecode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeANewArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeBipush.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeCheckCast.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetPut.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetStatic.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeGoto.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeGotoW.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeIf.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeIinc.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeInstanceOf.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeJmp.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsr.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsrW.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoad.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadStore.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeLookupswitch.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeMultiANewArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeNew.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeNewArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodePutField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodePutStatic.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeRet.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeSipush.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeStore.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeTableswitch.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeWideable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/Interpreter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/InterpreterCodelet.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/LookupswitchPair.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/MaskFillerForNative.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/OffsetClosure.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/OopMapForCacheEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ArrayReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/BaseLineInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/BooleanTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/BooleanValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ByteTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/CharTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ClassLoaderReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ClassObjectReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ConcreteMethodImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/DoubleTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/FloatTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/IntegerTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/JNITypeParser.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/LineInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/LongTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/MirrorImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/MonitorInfoImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/NonConcreteMethodImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/PrimitiveTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/SACoreAttachingConnector.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/SADebugServerAttachingConnector.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/SAPIDAttachingConnector.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/SDE.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ShortTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/StackFrameImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/StratumLineInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/StringReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ThreadGroupReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/TypeComponentImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/TypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/VMModifiers.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ValueContainer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/VoidTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/VoidValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/AFLBinaryTreeDictionary.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/CodeHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/Dictionary.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/FreeChunk.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/HeapBlock.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/LoaderConstraintEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/LoaderConstraintTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/MemRegion.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/PlaceholderEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/PlaceholderTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/ReferenceType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/StringTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/SymbolTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/Universe.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/VirtualSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/AccessFlags.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Array.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ArrayData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/BitData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/BooleanField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/BranchData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/BreakpointInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ByteField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CIntField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CallTypeData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CellTypeState.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CellTypeStateList.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CharField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CheckedExceptionElement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CompiledICHolder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CompressedLineNumberReadStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ConstMethod.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ConstantPool.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CounterData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/DataLayout.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/DefaultHeapVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/DefaultMetadataVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/DefaultOopVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/DoubleField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ExceptionTableElement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Field.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/FieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/FieldType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/FieldVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/FloatField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/HeapPrinter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/HeapVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/IndexableFieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Instance.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/InstanceClassLoaderKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/InstanceMirrorKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/InstanceRefKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/IntField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/JVMDIClassStatus.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/JumpData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Klass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/LineNumberTableElement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/LocalVariableTableElement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/LongField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Mark.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Metadata.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MetadataField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MetadataVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Method.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MethodCounters.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MethodData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MutationException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/NamedFieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/NarrowOopField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ObjArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Oop.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/OopField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/OopPrinter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/OopUtilities.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/OopVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ProfileData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/RawHeapVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/RetData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ShortField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Symbol.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/TypeArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/TypeEntries.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/UnknownOopException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Block.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Block_Array.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Block_List.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/CallDynamicJavaNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/CallNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/CallRuntimeNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/CallStaticJavaNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Compile.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/CompilerPhaseType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/HaltNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/InlineTree.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/JVMState.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/LoopNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachCallNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachCallRuntimeNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachCallStaticJavaNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachIfNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachReturnNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachSafePointNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MultiNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Node.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Node_Array.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Node_List.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Phase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/PhaseRegAlloc.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/PhiNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/ProjNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/RegionNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/RootNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/SafePointNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/TypeNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/prims/JvmtiExport.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ArgumentSizeComputer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/Arguments.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/BasicLock.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/BasicObjectLock.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/BasicType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/BasicTypeSize.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/Bytes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/CodeCacheSweeperThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/CompilerThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ConcurrentLocksPrinter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ConstructionException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ExternalVFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/Flags.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/Frame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/InstanceConstructor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JNIHandleBlock.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JNIHandles.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JNIid.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JavaCallWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JavaThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JavaThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JavaThreadState.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JavaVFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JvmtiAgentThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/NativeSignatureIterator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/OSThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ObjectMonitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/PerfDataPrologue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/PerfMemory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ResultTypeFinder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/SignatureConverter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/SignatureInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/SignatureIterator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/StackFrameStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/StackValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/StaticBaseConstructor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/Threads.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VM.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VMObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VMOps.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VMReg.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VMVersionMismatchException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VirtualBaseConstructor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/WatcherThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64CurrentFrameGuess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64JavaCallWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64RegisterMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64JavaCallWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdX86JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux/LinuxSignals.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux_aarch64/LinuxAARCH64JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux_ppc64/LinuxPPC64JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux_sparc/LinuxSPARCJavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxSignals.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxX86JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/posix/POSIXSignals.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64CurrentFrameGuess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64JavaCallWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64RegisterMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/solaris_amd64/SolarisAMD64JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/solaris_x86/SolarisX86JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCRegisterMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/vmSymbols.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/win32_x86/Win32X86JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/x86/X86CurrentFrameGuess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/x86/X86JavaCallWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/FlagDumper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/HeapDumper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/HeapSummary.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/JInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/JMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/JSnap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/JStack.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/PMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/PStack.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/StackTrace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/Tool.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/jcore/ClassFilter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/jcore/NameFilter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/jcore/PackageNameFilter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/AddressField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/CIntegerField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/CIntegerType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/Field.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JBooleanField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JByteField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JCharField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JDoubleField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JFloatField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JIntField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JLongField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JShortField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/NarrowOopField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/OopField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/PointerType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/Type.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/TypeDataBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/WrongTypeException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicAddressFieldWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJBooleanField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJByteField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJCharField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJDoubleField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJFloatField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJIntField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJLongField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJShortField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicNarrowOopField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicPointerType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicVtblAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/VtblAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/Annotation.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/DeadlockDetectionPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/EditableAtEndDocument.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/Editor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/EditorCommands.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/EditorFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/FindByQueryPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/FindInCodeCachePanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/FindPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/FrameWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/GraphicsUtilities.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/HeapParametersPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/HistoryComboBox.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/Inspector.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/JInternalFrameWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/JavaStackTracePanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/JavaThreadsPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/MemoryPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/MemoryViewer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/ObjectHistogramPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/ObjectListPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/ProcessListPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/ProgressBarPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/SAEditorPane.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/SAListener.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/SAPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/SourceCodePanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/StringTransferable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/SysPropsPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/ThreadInfoPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/VMFlagsPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/VMVersionInfoPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/FindAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/FindClassesAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/FindCrashesAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/InspectAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/JavaStackTraceAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/MemoryAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/ShowAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/ThreadInfoAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/classbrowser/ClassBrowserPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/classbrowser/CodeViewerPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/resources/arrow.png (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/resources/breakpoint.png (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/resources/triangle.png (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/table/LongCellRenderer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/table/SortHeaderCellRenderer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/table/SortHeaderMouseAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/table/SortableTableModel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/table/TableModelComparator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/BadAddressTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/BooleanTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/CStringTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/CTypeTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/CharTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/DoubleTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/FieldTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/FloatTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/LongTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/MetadataTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/RevPtrsTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/RootTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeGroupNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeModel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/treetable/AbstractTreeTableModel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/treetable/SimpleTreeTableModel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModelAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/AddressOps.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/AltPlatformInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/Assert.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/AssertionFailure.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/BitMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/BitMapClosure.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/Bits.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/CPPExpressions.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/CStringUtilities.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ConstIterator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/FindObjectByType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/GenericArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/GenericGrowableArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/GrowableArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/Hashtable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/HeapGraphWriter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/HeapProgressThunk.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/IntArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/IntegerEnum.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/Interval.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/IntervalNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/IntervalTree.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/KlassArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/LivenessAnalysis.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/LivenessPath.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/LivenessPathElement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/LivenessPathList.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/MarkBits.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/MessageQueue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/MessageQueueBackend.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/MethodArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ObjectReader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/PointerFinder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ProcImageClassLoader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/RBColor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/RBNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/RBTree.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ReversePtrs.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/StreamMonitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/SystemDictionaryHelper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/TwoOopHashtable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/U1Array.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/U2Array.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/UnsupportedPlatformException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedBoolean.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedByte.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedChar.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedDouble.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedFloat.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedInt.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedLong.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedShort.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/Callable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/DefaultScriptObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/InvocableCallable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaClass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactoryImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstance.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaMethod.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaScriptEngine.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaString.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaVM.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSList.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSMetadata.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/MapScriptObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/MethodCallable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/ObjectVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/SOQLEngine.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/SOQLException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/SOQLQuery.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/ScriptObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/sa.js (100%) rename hotspot/{agent/src/share/native => src/jdk.hotspot.agent/share/native/libsaproc}/sadis.c (100%) rename hotspot/{agent/src/os/solaris/proc => src/jdk.hotspot.agent/solaris/native/libsaproc}/libproc.h (100%) rename hotspot/{agent/src/os/solaris/proc => src/jdk.hotspot.agent/solaris/native/libsaproc}/salibproc.h (100%) rename hotspot/{agent/src/os/solaris/proc => src/jdk.hotspot.agent/solaris/native/libsaproc}/saproc.cpp (100%) rename hotspot/{agent/src/os/solaris/proc => src/jdk.hotspot.agent/solaris/native/libsaproc}/saproc_audit.cpp (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/README.jjh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/SASanityChecker.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/TEST.ROOT (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/TargetAdapter.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/TargetListener.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/TestScaffold.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/VMConnection.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/jstack.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/jstack64.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/multivm.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/multivm.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/runjdb.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/runjpda.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/runsa.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/sagclient.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/sagdoit.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/sagtarg.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/sagtest.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/sasanity.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/serialvm.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/serialvm.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/libproc/LibprocClient.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/libproc/LibprocTest.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/libproc/Makefile (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/libproc/README (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/libproc/libproctest.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/libproc/libproctest64.sh (100%) rename hotspot/{agent/src/os/win32/windbg => src/jdk.hotspot.agent/windows/native/libsaproc}/sawindbg.cpp (100%) diff --git a/hotspot/agent/make/Makefile b/hotspot/agent/make/Makefile deleted file mode 100644 index 9b5d03abc1e..00000000000 --- a/hotspot/agent/make/Makefile +++ /dev/null @@ -1,331 +0,0 @@ -# -# Copyright (c) 2000, 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. -# -# - -# This guards against adding broken .java files to the directory -# hierarchy, but may be a pain to keep in sync - -# Generated using the build-pkglist script -ifeq "x$(GAMMADIR)" "x" -include ../../make/defs.make -else -include $(GAMMADIR)/make/defs.make -endif - -ifeq "x$(HOTSPOT_BUILD_VERSION)" "x" -SA_BUILD_VERSION=$(HOTSPOT_RELEASE_VERSION) -else -SA_BUILD_VERSION=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION) -endif - -PKGLIST = \ -sun.jvm.hotspot \ -sun.jvm.hotspot.asm \ -sun.jvm.hotspot.asm.sparc \ -sun.jvm.hotspot.c1 \ -sun.jvm.hotspot.ci \ -sun.jvm.hotspot.code \ -sun.jvm.hotspot.compiler \ -sun.jvm.hotspot.debugger \ -sun.jvm.hotspot.debugger.amd64 \ -sun.jvm.hotspot.debugger.bsd \ -sun.jvm.hotspot.debugger.bsd.amd64 \ -sun.jvm.hotspot.debugger.bsd.x86 \ -sun.jvm.hotspot.debugger.cdbg \ -sun.jvm.hotspot.debugger.cdbg.basic \ -sun.jvm.hotspot.debugger.cdbg.basic.amd64 \ -sun.jvm.hotspot.debugger.cdbg.basic.x86 \ -sun.jvm.hotspot.debugger.dummy \ -sun.jvm.hotspot.debugger.linux \ -sun.jvm.hotspot.debugger.linux.amd64 \ -sun.jvm.hotspot.debugger.linux.aarch64 \ -sun.jvm.hotspot.debugger.linux.ppc64 \ -sun.jvm.hotspot.debugger.linux.x86 \ -sun.jvm.hotspot.debugger.posix \ -sun.jvm.hotspot.debugger.posix.elf \ -sun.jvm.hotspot.debugger.ppc64 \ -sun.jvm.hotspot.debugger.proc \ -sun.jvm.hotspot.debugger.proc.amd64 \ -sun.jvm.hotspot.debugger.proc.aarch64 \ -sun.jvm.hotspot.debugger.proc.ppc64 \ -sun.jvm.hotspot.debugger.proc.sparc \ -sun.jvm.hotspot.debugger.proc.x86 \ -sun.jvm.hotspot.debugger.remote \ -sun.jvm.hotspot.debugger.remote.amd64 \ -sun.jvm.hotspot.debugger.remote.ppc64 \ -sun.jvm.hotspot.debugger.remote.sparc \ -sun.jvm.hotspot.debugger.remote.x86 \ -sun.jvm.hotspot.debugger.sparc \ -sun.jvm.hotspot.debugger.win32.coff \ -sun.jvm.hotspot.debugger.windbg \ -sun.jvm.hotspot.debugger.windbg.amd64 \ -sun.jvm.hotspot.debugger.windbg.x86 \ -sun.jvm.hotspot.debugger.x86 \ -sun.jvm.hotspot.gc \ -sun.jvm.hotspot.gc.g1 \ -sun.jvm.hotspot.gc.parallel \ -sun.jvm.hotspot.gc.shared \ -sun.jvm.hotspot.interpreter \ -sun.jvm.hotspot.jdi \ -sun.jvm.hotspot.memory \ -sun.jvm.hotspot.opto \ -sun.jvm.hotspot.oops \ -sun.jvm.hotspot.prims \ -sun.jvm.hotspot.runtime \ -sun.jvm.hotspot.runtime.amd64 \ -sun.jvm.hotspot.runtime.aarch64 \ -sun.jvm.hotspot.runtime.bsd \ -sun.jvm.hotspot.runtime.bsd_amd64 \ -sun.jvm.hotspot.runtime.bsd_x86 \ -sun.jvm.hotspot.runtime.linux \ -sun.jvm.hotspot.runtime.linux_amd64 \ -sun.jvm.hotspot.runtime.linux_aarch64 \ -sun.jvm.hotspot.runtime.linux_ppc64 \ -sun.jvm.hotspot.runtime.linux_sparc \ -sun.jvm.hotspot.runtime.linux_x86 \ -sun.jvm.hotspot.runtime.posix \ -sun.jvm.hotspot.runtime.ppc64 \ -sun.jvm.hotspot.runtime.solaris_amd64 \ -sun.jvm.hotspot.runtime.solaris_sparc \ -sun.jvm.hotspot.runtime.solaris_x86 \ -sun.jvm.hotspot.runtime.sparc \ -sun.jvm.hotspot.runtime.win32_amd64 \ -sun.jvm.hotspot.runtime.win32_x86 \ -sun.jvm.hotspot.runtime.x86 \ -sun.jvm.hotspot.tools \ -sun.jvm.hotspot.tools.jcore \ -sun.jvm.hotspot.tools.soql \ -sun.jvm.hotspot.types \ -sun.jvm.hotspot.types.basic \ -sun.jvm.hotspot.ui \ -sun.jvm.hotspot.ui.action \ -sun.jvm.hotspot.ui.classbrowser \ -sun.jvm.hotspot.ui.resources \ -sun.jvm.hotspot.ui.table \ -sun.jvm.hotspot.ui.tree \ -sun.jvm.hotspot.ui.treetable \ -sun.jvm.hotspot.utilities \ -sun.jvm.hotspot.utilities.memo \ -sun.jvm.hotspot.utilities.soql \ -com.sun.java.swing.action \ -com.sun.java.swing.ui -#END PKGLIST - -# Generated using the build-filelist script -FILELIST = \ -sun/jvm/hotspot/*.java \ -sun/jvm/hotspot/asm/*.java \ -sun/jvm/hotspot/asm/sparc/*.java \ -sun/jvm/hotspot/c1/*.java \ -sun/jvm/hotspot/ci/*.java \ -sun/jvm/hotspot/code/*.java \ -sun/jvm/hotspot/compiler/*.java \ -sun/jvm/hotspot/debugger/*.java \ -sun/jvm/hotspot/debugger/amd64/*.java \ -sun/jvm/hotspot/debugger/bsd/*.java \ -sun/jvm/hotspot/debugger/bsd/amd64/*.java \ -sun/jvm/hotspot/debugger/bsd/x86/*.java \ -sun/jvm/hotspot/debugger/cdbg/*.java \ -sun/jvm/hotspot/debugger/cdbg/basic/*.java \ -sun/jvm/hotspot/debugger/cdbg/basic/amd64/*.java \ -sun/jvm/hotspot/debugger/cdbg/basic/x86/*.java \ -sun/jvm/hotspot/debugger/dummy/*.java \ -sun/jvm/hotspot/debugger/linux/*.java \ -sun/jvm/hotspot/debugger/linux/ppc64/*.java \ -sun/jvm/hotspot/debugger/linux/x86/*.java \ -sun/jvm/hotspot/debugger/linux/aarch64/*.java \ -sun/jvm/hotspot/debugger/posix/*.java \ -sun/jvm/hotspot/debugger/posix/elf/*.java \ -sun/jvm/hotspot/debugger/ppc64/*.java \ -sun/jvm/hotspot/debugger/proc/*.java \ -sun/jvm/hotspot/debugger/proc/amd64/*.java \ -sun/jvm/hotspot/debugger/proc/aarch64/*.java \ -sun/jvm/hotspot/debugger/proc/ppc64/*.java \ -sun/jvm/hotspot/debugger/proc/sparc/*.java \ -sun/jvm/hotspot/debugger/proc/x86/*.java \ -sun/jvm/hotspot/debugger/remote/*.java \ -sun/jvm/hotspot/debugger/remote/amd64/*.java \ -sun/jvm/hotspot/debugger/remote/aarch64/*.java \ -sun/jvm/hotspot/debugger/remote/ppc64/*.java \ -sun/jvm/hotspot/debugger/remote/sparc/*.java \ -sun/jvm/hotspot/debugger/remote/x86/*.java \ -sun/jvm/hotspot/debugger/sparc/*.java \ -sun/jvm/hotspot/debugger/win32/coff/*.java \ -sun/jvm/hotspot/debugger/windbg/*.java \ -sun/jvm/hotspot/debugger/windbg/x86/*.java \ -sun/jvm/hotspot/debugger/x86/*.java \ -sun/jvm/hotspot/gc/g1/*.java \ -sun/jvm/hotspot/gc/parallel/*.java \ -sun/jvm/hotspot/gc/shared/*.java \ -sun/jvm/hotspot/interpreter/*.java \ -sun/jvm/hotspot/jdi/*.java \ -sun/jvm/hotspot/memory/*.java \ -sun/jvm/hotspot/oops/*.java \ -sun/jvm/hotspot/opto/*.java \ -sun/jvm/hotspot/prims/*.java \ -sun/jvm/hotspot/runtime/*.java \ -sun/jvm/hotspot/runtime/amd64/*.java \ -sun/jvm/hotspot/runtime/aarch64/*.java \ -sun/jvm/hotspot/runtime/bsd/*.java \ -sun/jvm/hotspot/runtime/bsd_amd64/*.java \ -sun/jvm/hotspot/runtime/bsd_x86/*.java \ -sun/jvm/hotspot/runtime/linux/*.java \ -sun/jvm/hotspot/runtime/linux_amd64/*.java \ -sun/jvm/hotspot/runtime/linux_aarch64/*.java \ -sun/jvm/hotspot/runtime/linux_ppc64/*.java \ -sun/jvm/hotspot/runtime/linux_sparc/*.java \ -sun/jvm/hotspot/runtime/linux_x86/*.java \ -sun/jvm/hotspot/runtime/posix/*.java \ -sun/jvm/hotspot/runtime/ppc64/*.java \ -sun/jvm/hotspot/runtime/solaris_amd64/*.java \ -sun/jvm/hotspot/runtime/solaris_sparc/*.java \ -sun/jvm/hotspot/runtime/solaris_x86/*.java \ -sun/jvm/hotspot/runtime/sparc/*.java \ -sun/jvm/hotspot/runtime/win32_amd64/*.java \ -sun/jvm/hotspot/runtime/win32_x86/*.java \ -sun/jvm/hotspot/runtime/x86/*.java \ -sun/jvm/hotspot/tools/*.java \ -sun/jvm/hotspot/tools/jcore/*.java \ -sun/jvm/hotspot/tools/soql/*.java \ -sun/jvm/hotspot/types/*.java \ -sun/jvm/hotspot/types/basic/*.java \ -sun/jvm/hotspot/ui/*.java \ -sun/jvm/hotspot/ui/action/*.java \ -sun/jvm/hotspot/ui/classbrowser/*.java \ -sun/jvm/hotspot/ui/table/*.java \ -sun/jvm/hotspot/ui/tree/*.java \ -sun/jvm/hotspot/ui/treetable/*.java \ -sun/jvm/hotspot/utilities/*.java \ -sun/jvm/hotspot/utilities/memo/*.java \ -sun/jvm/hotspot/utilities/soql/*.java \ -com/sun/java/swing/action/*.java \ -com/sun/java/swing/ui/*.java -#END FILELIST - -ifneq "x$(ALT_BOOTDIR)" "x" - BOOTDIR := $(ALT_BOOTDIR) -endif - -ifeq "x$(BOOTDIR)" "x" - JDK_HOME := $(shell dirname $(shell which java))/.. -else - JDK_HOME := $(BOOTDIR) -endif - -isUnix := $(shell test -r c:/; echo $$?) - -ifeq "$(isUnix)" "1" - CPS := : -else - CPS := ";" -endif - -SRC_DIR = ../src/share/classes -BUILD_DIR = ../build -OUTPUT_DIR = $(BUILD_DIR)/classes -DOC_DIR = $(BUILD_DIR)/doc - -# gnumake 3.78.1 does not accept the *s, -# so use the shell to expand them -ALLFILES := $(patsubst %,$(SRC_DIR)/%,$(FILELIST)) -ALLFILES := $(shell /bin/ls $(ALLFILES)) - -# tools.jar is used by the sa-jdi binding -CLASSPATH = $(JDK_HOME)/lib/tools.jar - -CLASSPATH := $(subst \,/,$(CLASSPATH)) - -# FIXME: autogenerate call to rmic - -SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)" - -SA_PROPERTIES = $(OUTPUT_DIR)/sa.properties -JAVAC = $(JDK_HOME)/bin/javac -JAVA = $(JDK_HOME)/bin/java -JAVADOC = $(JDK_HOME)/bin/javadoc -RMIC = $(JDK_HOME)/bin/rmic - -# Tagging it on because there's no reason not to run it -all: filelist - @mkdir -p $(OUTPUT_DIR) - @echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) - $(JAVAC) -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist - $(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer - rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js - cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql - mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources - rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/* - cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/ - cp -r $(SRC_DIR)/images/* $(OUTPUT_DIR)/ - -allprof: filelist - @mkdir -p $(OUTPUT_DIR) - @echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) - $(JAVAC) -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist - $(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer - rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js - cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql - mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources - rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/* - cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/ - cp -r $(SRC_DIR)/images/* $(OUTPUT_DIR)/ - -.PHONY: filelist -filelist: $(ALLFILES) - @if [ ! -f $(JDK_HOME)/lib/tools.jar ] ; then \ - echo "Missing $(JDK_HOME)/lib/tools.jar file. Use 1.6.0 or later version jdk to build SA."; \ - echo ""; \ - exit 1; \ - fi - @rm -f $@ - @echo $(ALLFILES) > $@ - -.PHONY: natives -natives: - cd ../src/os/`$(JAVA) -classpath $(OUTPUT_DIR) sun.jvm.hotspot.utilities.PlatformInfo`; $(MAKE) all - -.PHONY: sa-jdi.jar -sa-jdi.jar: - echo "sa-jdi.jar is built by a hotspot build." - -docs: - @$(JAVADOC) -private -classpath $(CLASSPATH) -sourcepath $(SRC_DIR) -d $(DOC_DIR) $(PKGLIST) - -sizes: $(ALLFILES) - wc -l $(ALLFILES) - -cscope: $(ALLFILES) - rm -f java.files - echo $(ALLFILES) > java.files - cscope -b -i java.files -f java.out - rm -f java.files - -.PHONY: sa.jar -sa.jar: - rm -f $(BUILD_DIR)/sa.jar - cd $(OUTPUT_DIR) ; jar cvf ../sa.jar * - -clean:: - rm -rf filelist - cd ../src/os/`$(JAVA) -classpath $(OUTPUT_DIR) sun.jvm.hotspot.utilities.PlatformInfo`; $(MAKE) clean - rm -rf $(BUILD_DIR)/* diff --git a/hotspot/agent/make/README.txt b/hotspot/agent/make/README.txt deleted file mode 100644 index 1ceb26b9339..00000000000 --- a/hotspot/agent/make/README.txt +++ /dev/null @@ -1,5 +0,0 @@ -These are the Java-level sources for the Serviceability Agent (SA). - -To build, type "gnumake all". - -For usage documentation, please refer to ../doc/index.html. diff --git a/hotspot/agent/make/build-filelist b/hotspot/agent/make/build-filelist deleted file mode 100644 index 34bd51422c8..00000000000 --- a/hotspot/agent/make/build-filelist +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -f - -SH=`which sh` -MKS_HOME=`dirname $SH` - -CD=cd -FIND=$MKS_HOME/find -SORT=$MKS_HOME/sort - -$CD ../src/share/classes; $FIND sun \( -name SCCS -prune \) -o \( -name "*.java" \) -print | $SORT > ../../../make/filelist.txt diff --git a/hotspot/agent/make/build-pkglist b/hotspot/agent/make/build-pkglist deleted file mode 100644 index c7cac3dfc05..00000000000 --- a/hotspot/agent/make/build-pkglist +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -f - -SH=`which sh` -MKS_HOME=`dirname $SH` - -CD=cd -FIND=$MKS_HOME/find -SED=$MKS_HOME/sed -SORT=$MKS_HOME/sort - -$CD ../src/share/classes; $FIND sun/jvm/hotspot com/sun/java/swing -type d -print | $SED -e 's/\//./g' | $SORT > ../../../make/pkglist.txt diff --git a/hotspot/agent/make/build.xml b/hotspot/agent/make/build.xml deleted file mode 100644 index 71bfc5ba18b..00000000000 --- a/hotspot/agent/make/build.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/hotspot/agent/make/clhsdbproc.sh b/hotspot/agent/make/clhsdbproc.sh deleted file mode 100644 index d3f4db0621b..00000000000 --- a/hotspot/agent/make/clhsdbproc.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.CLHSDB $* diff --git a/hotspot/agent/make/clhsdbproc64.sh b/hotspot/agent/make/clhsdbproc64.sh deleted file mode 100644 index 66d8e26fa8a..00000000000 --- a/hotspot/agent/make/clhsdbproc64.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.CLHSDB $* diff --git a/hotspot/agent/make/clhsdbwindbg.bat b/hotspot/agent/make/clhsdbwindbg.bat deleted file mode 100644 index a1ba120a135..00000000000 --- a/hotspot/agent/make/clhsdbwindbg.bat +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -REM -REM Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.CLHSDB %1 %2 diff --git a/hotspot/agent/make/clhsdbwindbg64.bat b/hotspot/agent/make/clhsdbwindbg64.bat deleted file mode 100644 index 442a3ba89d1..00000000000 --- a/hotspot/agent/make/clhsdbwindbg64.bat +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -REM -REM Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.CLHSDB %1 %2 diff --git a/hotspot/agent/make/dumpflagsproc.sh b/hotspot/agent/make/dumpflagsproc.sh deleted file mode 100644 index 88b1072dd00..00000000000 --- a/hotspot/agent/make/dumpflagsproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, 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. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.FlagDumper $* diff --git a/hotspot/agent/make/dumpflagsproc64.sh b/hotspot/agent/make/dumpflagsproc64.sh deleted file mode 100644 index 31b1204f56a..00000000000 --- a/hotspot/agent/make/dumpflagsproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, 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. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.FlagDumper $* diff --git a/hotspot/agent/make/dumpflagswindbg.bat b/hotspot/agent/make/dumpflagswindbg.bat deleted file mode 100644 index 6ae97409c63..00000000000 --- a/hotspot/agent/make/dumpflagswindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.FlagDumper %1 %2 diff --git a/hotspot/agent/make/dumpflagswindbg64.bat b/hotspot/agent/make/dumpflagswindbg64.bat deleted file mode 100644 index c5c1a3bb97f..00000000000 --- a/hotspot/agent/make/dumpflagswindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.FlagDumper %1 %2 diff --git a/hotspot/agent/make/dumpsyspropsproc.sh b/hotspot/agent/make/dumpsyspropsproc.sh deleted file mode 100644 index 2f8d892ed16..00000000000 --- a/hotspot/agent/make/dumpsyspropsproc.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, 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. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.SysPropsDumper $* - diff --git a/hotspot/agent/make/dumpsyspropsproc64.sh b/hotspot/agent/make/dumpsyspropsproc64.sh deleted file mode 100644 index 3967bbed119..00000000000 --- a/hotspot/agent/make/dumpsyspropsproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, 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. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.SysPropsDumper $* diff --git a/hotspot/agent/make/dumpsyspropswindbg.bat b/hotspot/agent/make/dumpsyspropswindbg.bat deleted file mode 100644 index 4f6c1994118..00000000000 --- a/hotspot/agent/make/dumpsyspropswindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.SysPropsDumper %1 %2 diff --git a/hotspot/agent/make/dumpsyspropswindbg64.bat b/hotspot/agent/make/dumpsyspropswindbg64.bat deleted file mode 100644 index 91f90c54d79..00000000000 --- a/hotspot/agent/make/dumpsyspropswindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.SysPropsDumper %1 %2 diff --git a/hotspot/agent/make/finalizerinfoproc.sh b/hotspot/agent/make/finalizerinfoproc.sh deleted file mode 100644 index 94d064ebbef..00000000000 --- a/hotspot/agent/make/finalizerinfoproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2004, 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. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.FinalizerInfo $* diff --git a/hotspot/agent/make/finalizerinfoproc64.sh b/hotspot/agent/make/finalizerinfoproc64.sh deleted file mode 100644 index 58b4369fa4a..00000000000 --- a/hotspot/agent/make/finalizerinfoproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2004, 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. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.FinalizerInfo $* diff --git a/hotspot/agent/make/finalizerinfowindbg.bat b/hotspot/agent/make/finalizerinfowindbg.bat deleted file mode 100644 index 5d529885766..00000000000 --- a/hotspot/agent/make/finalizerinfowindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.FinalizerInfo %1 %2 diff --git a/hotspot/agent/make/finalizerinfowindbg64.bat b/hotspot/agent/make/finalizerinfowindbg64.bat deleted file mode 100644 index be306c65bea..00000000000 --- a/hotspot/agent/make/finalizerinfowindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.FinalizerInfo %1 %2 diff --git a/hotspot/agent/make/grantAll.policy b/hotspot/agent/make/grantAll.policy deleted file mode 100644 index ae67772f74e..00000000000 --- a/hotspot/agent/make/grantAll.policy +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright (c) 2000, 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. -// -// - -// Do NOT use this policy file in a production system! - -grant { - // Allow everything for now - permission java.security.AllPermission; -}; diff --git a/hotspot/agent/make/heapdumpproc.sh b/hotspot/agent/make/heapdumpproc.sh deleted file mode 100644 index 44c7f18b7a3..00000000000 --- a/hotspot/agent/make/heapdumpproc.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.HeapDumper $* diff --git a/hotspot/agent/make/heapdumpproc64.sh b/hotspot/agent/make/heapdumpproc64.sh deleted file mode 100644 index d68ad2e6a3d..00000000000 --- a/hotspot/agent/make/heapdumpproc64.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.HeapDumper $* - diff --git a/hotspot/agent/make/heapdumpwindbg.bat b/hotspot/agent/make/heapdumpwindbg.bat deleted file mode 100644 index a7b3b0d18ee..00000000000 --- a/hotspot/agent/make/heapdumpwindbg.bat +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -REM -REM Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.HeapDumper %1 %2 %3 %4 diff --git a/hotspot/agent/make/heapdumpwindbg64.bat b/hotspot/agent/make/heapdumpwindbg64.bat deleted file mode 100644 index f648a10b05d..00000000000 --- a/hotspot/agent/make/heapdumpwindbg64.bat +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -REM -REM Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.HeapDumper %1 %2 %3 %4 diff --git a/hotspot/agent/make/heapsumproc.sh b/hotspot/agent/make/heapsumproc.sh deleted file mode 100644 index 787e791ce2d..00000000000 --- a/hotspot/agent/make/heapsumproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.HeapSummary $* diff --git a/hotspot/agent/make/heapsumproc64.sh b/hotspot/agent/make/heapsumproc64.sh deleted file mode 100644 index 3915260a3b0..00000000000 --- a/hotspot/agent/make/heapsumproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.HeapSummary $* diff --git a/hotspot/agent/make/heapsumwindbg.bat b/hotspot/agent/make/heapsumwindbg.bat deleted file mode 100644 index ab468509e88..00000000000 --- a/hotspot/agent/make/heapsumwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.HeapSummary %1 %2 diff --git a/hotspot/agent/make/heapsumwindbg64.bat b/hotspot/agent/make/heapsumwindbg64.bat deleted file mode 100644 index e887cbb5064..00000000000 --- a/hotspot/agent/make/heapsumwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.HeapSummary %1 %2 diff --git a/hotspot/agent/make/hsdb.bat b/hotspot/agent/make/hsdb.bat deleted file mode 100644 index 92a2c1d683d..00000000000 --- a/hotspot/agent/make/hsdb.bat +++ /dev/null @@ -1,25 +0,0 @@ -REM -REM Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -java -showversion -cp ..\build\classes;..\src\share\lib\js.jar;.\sa.jar;lib\js.jar sun.jvm.hotspot.HSDB %1 %2 diff --git a/hotspot/agent/make/hsdb.sh b/hotspot/agent/make/hsdb.sh deleted file mode 100644 index ffb07fe246e..00000000000 --- a/hotspot/agent/make/hsdb.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2008, 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. -# -# - -STARTDIR=`dirname $0` - -if [ "x$SA_JAVA" = "x" ]; then - SA_JAVA=java -fi - -$SA_JAVA -showversion -cp $STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar:$STARTDIR/lib/js.jar sun.jvm.hotspot.HSDB $* diff --git a/hotspot/agent/make/hsdbproc.sh b/hotspot/agent/make/hsdbproc.sh deleted file mode 100644 index 29a0e220806..00000000000 --- a/hotspot/agent/make/hsdbproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, 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. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.HSDB $* diff --git a/hotspot/agent/make/hsdbproc64.sh b/hotspot/agent/make/hsdbproc64.sh deleted file mode 100644 index 5e79a967142..00000000000 --- a/hotspot/agent/make/hsdbproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, 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. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.HSDB $* diff --git a/hotspot/agent/make/hsdbwindbg.bat b/hotspot/agent/make/hsdbwindbg.bat deleted file mode 100644 index 4cb1f5e917a..00000000000 --- a/hotspot/agent/make/hsdbwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.HSDB %1 %2 diff --git a/hotspot/agent/make/hsdbwindbg64.bat b/hotspot/agent/make/hsdbwindbg64.bat deleted file mode 100644 index 0f6c01576c2..00000000000 --- a/hotspot/agent/make/hsdbwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.HSDB %1 %2 diff --git a/hotspot/agent/make/index.html b/hotspot/agent/make/index.html deleted file mode 100644 index 436daaa2b8c..00000000000 --- a/hotspot/agent/make/index.html +++ /dev/null @@ -1,262 +0,0 @@ - - - - - -Using The HotSpot Serviceability Agent - - - - -

    -Using The HotSpot Serviceability Agent -

    - -

    -

    -Contents -

    -

    - -
    - -

    - -Introduction - -

    - -

    -The HotSpot Serviceability Agent (SA) is a set of Java APIs which -mirror the internal APIs of the HotSpot VM and which can be used to -examine the state of a HotSpot VM. -

    - -

    -The system understands the layout of certain VM data structures and is -able to traverse these structures in an examination-only fashion; that -is, it does not rely on being able to run code in the target VM. For -this reason it transparently works with either a running VM or a core -file. -

    - -

    -The system can reconstruct information about Java frames on the stack -and objects in the heap. Many of the important data structures in the -VM like the CodeCache, Universe, StubQueue, Frames, and VFrames have -been exposed and have relatively complete (or at least useful) -implementations. -

    - -

    -A small graphical debugger called HSDB (the "HotSpot Debugger") has -been written using these APIs. It provides stack memory dumps -annotated with method invocations, compiled-code inlining (if -present), interpreted vs. compiled code, interpreter codelets (if -interpreted), and live oops from oop-map information. It also provides -a tree-based oop inspector. More information will be added as -necessary; please send -email with suggestions on what would be useful. -

    - -

    -The SA currently only works on Solaris. It uses dbx to connect to the -remote process or core file and communicates with a small piece of -code (an "import module") loaded into the debugger. -

    - -

    - -Organization of the sources - -

    - -

    -The Java-side source code, which is the bulk of the SA, is in -src/share/vm/agent. The organization of the sun.jvm.hotspot package -hierarchy mirrors the organization in the VM. This should allow -engineers familiar with the HotSpot sources to quickly understand how -the SA works and to make modifications if necessary. To build these -sources, cd to src/share/vm/agent and type "make". -

    - -

    - -The SA on Solaris works by communicating with a small piece of code -(an "import module") loaded into dbx. The source code for this import -module is in src/os/solaris/agent. To build this library, cd to -src/os/solaris/agent and type "make 32bit" or "make 64bit". The -distinction is necessary because the SPARC version of dbx ships with -two versions of its executable, and depending on which architecture -(v8 or v9) the debugger is running on selects the appropriate -executable. The SA tries the v8 version first, but if you are running -on a v9 machine you must provide both versions to the SA. -

    - -

    - -The system is currently hardwired to look on jano for its dbx -executable and import module. The relevant directory structure looks -like this: - -

      -
    • .../hotspot/sa/ -
        -
      • solaris/ -
          -
        • sparc/ -
            -
          • bin/ -
              -
            • dbx: symlink to (v8) dbx 7.0 executable -
            -
          -
            -
          • lib/ -
              -
            • libsvc_agent_dbx.so: 32-bit version of import module -
            -
          -
        • sparcv9/ -
            -
          • lib/ -
              -
            • libsvc_agent_dbx.so: 32-bit version of import module -
            -
          -
        -
      -
    -

    - -

    -The code which builds up path names to these executables is contained -in sun.jvm.hotspot.HotSpotAgent.java. There are hardcoded paths in -this file to jano, but the rest of the system is isolated from this. -

    - -

    -(It would be nice to have a panel in the debugger allowing -configuration of all of the known operating systems' options; right -now Solaris is the only supported OS, making that easier.) -

    - -

    - -Running HSDB - -

    - -

    -An installation of HSDB has been placed on jano. To access it, add the -following directory to your PATH: -

    - -

    -

    -    /net/jano/export/disk05/hotspot/sa/bin/common
    -
    -

    - -

    -To start the debugger, type "hsdb". -

    - -

    -Alternatively, you can start a local build of the debugger by building -the sources in src/share/vm/agent, cd'ing to that directory, and -typing "java sun.jvm.hotspot.HSDB". -

    - -

    -There are three modes for the debugger: attaching to a local process, -opening a core file, and attaching to a remote "debug server". The -remote case requires two programs to be running on the remote machine: -the rmiregistry (see the script "start-rmiregistry" in this directory; -run this in the background) and the debug server (see the script -"start-debug-server"), in that order. start-rmiregistry takes no -arguments; start-debug-server takes as argument the process ID or the -executable and core file names to allow remote debugging of. Make sure -you do NOT have a CLASSPATH environment variable set when you run -these scripts. (The classes put into the rmiregistry are in sun.*, and -there are permissions problems if they aren't placed on the boot -classpath.) -

    - -

    -NOTE that the SA currently only works against VMs on Solaris/SPARC. -Remote debugging of Solaris/SPARC VMs on arbitrary platforms is -possible using the debug server; select "Connect to debug server..." -in HSDB. -

    - -

    -Once the debugger has been launched, the threads list is displayed. -The current set of functionality allows: -

    - -
      -
    • Browsing of the annotated stack memory ("Stack Memory" button). It - is currently annotated with the following information: -
        -
      • Method names of the Java frames and their extents (supporting - inlined compiled methods) -
      • Locations and types of oops, found using the oop map information - from compiled methods (interpreter oop maps coming soon) -
      • If a Java frame was interrupted by a signal (e.g., because of a - crash), annotates the frame with the signal name and number -
      • Interpreter codelet descriptions for interpreted frames -
      -
    • Finding which thread or threads caused a crash (currently - identified by the presence of a signal handler frame) -
    • Browsing of oops using the Oop Inspector. -
    • Browsing of the java.lang.Thread object's oop. -
    • Object histogram and inspection of objects therein. -
    -

    - -

    -More functionality is planned. Please send email with suggestions on what -would be useful, with any questions or comments, or if the debugger -crashes. -

    - -

    - -Notes - -

    - -

    -HSDB does not suspend the system at a safepoint, but at an arbitrary -point. This means that many of the invariants in the VM's code are not -followed. -

    - -

    -As it happens, most of the places where the code ported over from the -VM has failed involve the topmost frame on the stack. Some -modifications have been made to allow the system to recognize -problematic situations. -

    - -

    -Certainly, not all of the failure modes of the debugger have been -found. Please send email if -HSDB throws an exception. The best debugging aid in these situations -is a core file since it is a static view of the VM to which we can -then adapt the debugger code, as opposed to having to try to suspend -the VM over and over to reproduce the failure. gcore (1) is a useful -tool. (NOTE: do not try gcore with any application using the DGA X -server extension (example: Java2Demo); the kernel will panic. See bug -4343237.) -

    - - - diff --git a/hotspot/agent/make/jcoreproc.sh b/hotspot/agent/make/jcoreproc.sh deleted file mode 100644 index 48e236681d0..00000000000 --- a/hotspot/agent/make/jcoreproc.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, 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. -# -# - -. `dirname $0`/saenv.sh - -# set the environment variable JCORE_PACKAGES to a comma separated list of -# packages whose classes have to be retrieved from the core file. - -$SA_JAVA_CMD -Dsun.jvm.hotspot.tools.jcore.filter=sun.jvm.hotspot.tools.jcore.PackageNameFilter -Dsun.jvm.hotspot.tools.jcore.PackageNameFilter.pkgList=$JCORE_PACKAGES sun.jvm.hotspot.tools.jcore.ClassDump $* diff --git a/hotspot/agent/make/jcoreproc64.sh b/hotspot/agent/make/jcoreproc64.sh deleted file mode 100644 index 54c46c7d6df..00000000000 --- a/hotspot/agent/make/jcoreproc64.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, 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. -# -# - -. `dirname $0`/saenv64.sh - -# set the environment variable JCORE_PACKAGES to a comma separated list of -# packages whose classes have to be retrieved from the core file. - -$SA_JAVA_CMD -Dsun.jvm.hotspot.tools.jcore.filter=sun.jvm.hotspot.tools.jcore.PackageNameFilter -Dsun.jvm.hotspot.tools.jcore.PackageNameFilter.pkgList=$JCORE_PACKAGES sun.jvm.hotspot.tools.jcore.ClassDump $* diff --git a/hotspot/agent/make/jcorewindbg.bat b/hotspot/agent/make/jcorewindbg.bat deleted file mode 100644 index b8ed4504b92..00000000000 --- a/hotspot/agent/make/jcorewindbg.bat +++ /dev/null @@ -1,33 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -REM set the environment variable JCORE_PACKAGES to comman separated list of -REM packages whose classes have to be retrieved from the core file. - -%SA_JAVA_CMD% -Dsun.jvm.hotspot.tools.jcore.filter=sun.jvm.hotspot.tools.jcore.PackageNameFilter -Dsun.jvm.hotspot.tools.jcore.PackageNameFilter.pkgList=%JCORE_PACKAGES% sun.jvm.hotspot.tools.jcore.ClassDump %1 %2 - - diff --git a/hotspot/agent/make/jcorewindbg64.bat b/hotspot/agent/make/jcorewindbg64.bat deleted file mode 100644 index 61913238814..00000000000 --- a/hotspot/agent/make/jcorewindbg64.bat +++ /dev/null @@ -1,33 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -REM set the environment variable JCORE_PACKAGES to comman separated list of -REM packages whose classes have to be retrieved from the core file. - -%SA_JAVA_CMD% -Dsun.jvm.hotspot.tools.jcore.filter=sun.jvm.hotspot.tools.jcore.PackageNameFilter -Dsun.jvm.hotspot.tools.jcore.PackageNameFilter.pkgList=%JCORE_PACKAGES% sun.jvm.hotspot.tools.jcore.ClassDump %1 %2 - - diff --git a/hotspot/agent/make/jdbcore.sh b/hotspot/agent/make/jdbcore.sh deleted file mode 100644 index 3d9b16567a0..00000000000 --- a/hotspot/agent/make/jdbcore.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -usage() -{ - echo "usage: $0 " - exit 1 -} -# -if [ $# -lt 2 ]; then - usage -else - EXEC_FILE="${1}" - CORE_FILE="${2}" - echo "$0 attaching to core=${CORE_FILE}" -fi -# - -. `dirname $0`/saenv.sh - -$JAVA_HOME/bin/jdb -J-Xbootclasspath/a:$SA_CLASSPATH:$JAVA_HOME/lib/tools.jar \ - -J-Dsun.boot.library.path=$JAVA_HOME/jre/lib/$CPU:$SA_LIBPATH \ - -connect sun.jvm.hotspot.jdi.SACoreAttachingConnector:core=${CORE_FILE},javaExecutable=${EXEC_FILE} diff --git a/hotspot/agent/make/jdbcore64.sh b/hotspot/agent/make/jdbcore64.sh deleted file mode 100644 index 0a3ac0909a8..00000000000 --- a/hotspot/agent/make/jdbcore64.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -usage() -{ - echo "usage: $0 " - exit 1 -} -# -if [ $# -lt 2 ]; then - usage -else - EXEC_FILE="${1}" - CORE_FILE="${2}" - echo "$0 attaching to core=${CORE_FILE}" -fi -# - -. `dirname $0`/saenv64.sh - -$JAVA_HOME/bin/jdb -J-d64 -J-Xbootclasspath/a:$SA_CLASSPATH:$JAVA_HOME/lib/tools.jar \ - -J-Dsun.boot.library.path=$JAVA_HOME/jre/lib/$CPU:$SA_LIBPATH \ - -connect sun.jvm.hotspot.jdi.SACoreAttachingConnector:core=${CORE_FILE},javaExecutable=${EXEC_FILE} diff --git a/hotspot/agent/make/jdbproc.sh b/hotspot/agent/make/jdbproc.sh deleted file mode 100644 index 86a1644a86f..00000000000 --- a/hotspot/agent/make/jdbproc.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -usage() -{ - echo "usage: $0 " - exit 1 -} -# -if [ $# -lt 1 ]; then - usage -else - PID="${1}" - echo "$0 attaching to PID=${PID}" -fi -# - -. `dirname $0`/saenv.sh - -$JAVA_HOME/bin/jdb -J-Xbootclasspath/a:$SA_CLASSPATH:$JAVA_HOME/lib/tools.jar \ - -J-Dsun.boot.library.path=$JAVA_HOME/jre/lib/$CPU:$SA_LIBPATH \ - -connect sun.jvm.hotspot.jdi.SAPIDAttachingConnector:pid=${PID} diff --git a/hotspot/agent/make/jdbproc64.sh b/hotspot/agent/make/jdbproc64.sh deleted file mode 100644 index 9d9592bc1e8..00000000000 --- a/hotspot/agent/make/jdbproc64.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -usage() -{ - echo "usage: $0 " - exit 1 -} -# -if [ $# -lt 1 ]; then - usage -else - PID="${1}" - echo "$0 attaching to PID=${PID}" -fi - -. `dirname $0`/saenv64.sh - -$JAVA_HOME/bin/jdb -J-d64 -J-Xbootclasspath/a:$SA_CLASSPATH:$JAVA_HOME/lib/tools.jar \ - -J-Dsun.boot.library.path=$JAVA_HOME/jre/lib/$CPU:$SA_LIBPATH \ - -connect sun.jvm.hotspot.jdi.SAPIDAttachingConnector:pid=${PID} - diff --git a/hotspot/agent/make/jhistoproc.sh b/hotspot/agent/make/jhistoproc.sh deleted file mode 100644 index 23e46dc1960..00000000000 --- a/hotspot/agent/make/jhistoproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.ObjectHistogram $* diff --git a/hotspot/agent/make/jhistoproc64.sh b/hotspot/agent/make/jhistoproc64.sh deleted file mode 100644 index 6c50624913c..00000000000 --- a/hotspot/agent/make/jhistoproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.ObjectHistogram $* diff --git a/hotspot/agent/make/jhistowindbg.bat b/hotspot/agent/make/jhistowindbg.bat deleted file mode 100644 index ad1975ca540..00000000000 --- a/hotspot/agent/make/jhistowindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.ObjectHistogram %1 %2 diff --git a/hotspot/agent/make/jhistowindbg64.bat b/hotspot/agent/make/jhistowindbg64.bat deleted file mode 100644 index 813afe88340..00000000000 --- a/hotspot/agent/make/jhistowindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.ObjectHistogram %1 %2 diff --git a/hotspot/agent/make/jsdbproc.sh b/hotspot/agent/make/jsdbproc.sh deleted file mode 100644 index 657d3993cd5..00000000000 --- a/hotspot/agent/make/jsdbproc.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2004, 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. -# -# - - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.soql.JSDB $* diff --git a/hotspot/agent/make/jsdbproc64.sh b/hotspot/agent/make/jsdbproc64.sh deleted file mode 100644 index ac7d9c3b6ba..00000000000 --- a/hotspot/agent/make/jsdbproc64.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# 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. -# -# - - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.soql.JSDB $* diff --git a/hotspot/agent/make/jsdbwindbg.bat b/hotspot/agent/make/jsdbwindbg.bat deleted file mode 100644 index 2c6e66bdb83..00000000000 --- a/hotspot/agent/make/jsdbwindbg.bat +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -REM -REM Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.soql.JSDB %1 %2 diff --git a/hotspot/agent/make/jsdbwindbg64.bat b/hotspot/agent/make/jsdbwindbg64.bat deleted file mode 100644 index 10582b524a3..00000000000 --- a/hotspot/agent/make/jsdbwindbg64.bat +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -REM -REM Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.soql.JSDB %1 %2 diff --git a/hotspot/agent/make/jstackproc.sh b/hotspot/agent/make/jstackproc.sh deleted file mode 100644 index cdffc725a02..00000000000 --- a/hotspot/agent/make/jstackproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.StackTrace $* diff --git a/hotspot/agent/make/jstackproc64.sh b/hotspot/agent/make/jstackproc64.sh deleted file mode 100644 index fb4cde33fc3..00000000000 --- a/hotspot/agent/make/jstackproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.StackTrace $* diff --git a/hotspot/agent/make/jstackwindbg.bat b/hotspot/agent/make/jstackwindbg.bat deleted file mode 100644 index edf82aa6ccc..00000000000 --- a/hotspot/agent/make/jstackwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.StackTrace %1 %2 diff --git a/hotspot/agent/make/jstackwindbg64.bat b/hotspot/agent/make/jstackwindbg64.bat deleted file mode 100644 index 387b41f4927..00000000000 --- a/hotspot/agent/make/jstackwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.StackTrace %1 %2 diff --git a/hotspot/agent/make/marks_notes.html b/hotspot/agent/make/marks_notes.html deleted file mode 100644 index 76fd46c8036..00000000000 --- a/hotspot/agent/make/marks_notes.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Hotspot SA User Interface Notes - - - -

    Hotspot SA User Interface Notes

    - -

    Workspace and Building

    - -

    - All the source code for the Serviceability Agent is in - src/share/vm/agent in the HotSport workspace - /net/jano.sfbay/export/disk05/hotspot/ws/1.4/sa_baseline -

    - You can build the project by typing gnumake in the - src/share/vm/agent directory. -

    - You can also use the default build target using the Ant build file (build.xml). You can download Ant from - http://jakarta.apache.org/ant. Documentation for Ant can be - found at http://jakarta.apache.org/ant/manual/index.html - - -

    Running the project

    - -
      -
    • java -cp classes sun.jvm.hotspot.HSDB -
    - -

    Feedback

    -

    - Refactoring of package hierarchy. All user interface components should be in - the ui package. Perhaps: sun.jvm.hotspot.ui.hsdb.Main for the HSDB. -

    - The src\share\vm\agent area seems like a workspace so it should be organized like - one. In particular, I'd like to suggest the following directory layout:
    - -

      -
    • src: All sources that are curently under the sun directory. -
    • classes: compiled class files. -
    • lib: Resources like images, icons and jar files. -
    • docs: Documentation -
    • deploy: distribution bundles for Java Web Start. -
    - -

    - Seems like there is a lot of redundant functionality. Perhaps - this can be consolidated with a javax.swing.Actions architecture. - -

    Tasklist

    - -

    - Stack memory pane: - It's one of the more useful JVM debugging tools in the SA. However, it - doesn't support any interaction with the text. -

    - Integrations with the NetBeans architecture (plug in). See the - Netbeans Open APIs homepage - - -

    - HSDB: Object Histogram. Column sizes should be sized according the the - contents. i.e, The size and count columns should be narrow enought to - handle the largest window. Since there is a lot of data, sorting - and searching should be implemented. -

    - -

    Log

    - - Last modified: Tue Feb 05 19:15:12 Pacific Standard Time 2002 -

    - sun.jvm.hotspot.oops.ObjectHistogram should be the underlying data - structure for the TableModels. It shouldnt bother with sorting the data - - the table model should do that. It should implement these methods: - -

    -      public int getSize()
    -      public ObjectHistogramElement getElementAt(int row);
    -    
    -

    - ObjectHistogramElement should return the String that represents - the third column - - -


    -
    Mark Davidson
    - - -Last modified: Tue Feb 05 20:05:13 Pacific Standard Time 2002 - - - diff --git a/hotspot/agent/make/mkinstall b/hotspot/agent/make/mkinstall deleted file mode 100644 index 4277e54f1f6..00000000000 --- a/hotspot/agent/make/mkinstall +++ /dev/null @@ -1,148 +0,0 @@ - -# make the directories - -SA_NAME=sa17 -SA_TEST=$SA_NAME/test - -mkdir $SA_NAME -mkdir $SA_NAME/solaris -mkdir $SA_NAME/solaris/amd64 -mkdir $SA_NAME/solaris/sparc -mkdir $SA_NAME/solaris/sparcv9 -mkdir $SA_NAME/solaris/i386 -mkdir $SA_NAME/linux -mkdir $SA_NAME/linux/i386 -mkdir $SA_NAME/linux/ia64 -mkdir $SA_NAME/linux/amd64 -mkdir $SA_NAME/win32 -mkdir $SA_NAME/win32/i386 -mkdir $SA_NAME/win32/ia64 -mkdir $SA_NAME/win32/amd64 -mkdir $SA_TEST - -# make sa.jar -jar -cvf $SA_NAME/sa.jar -C ../build/classes . - -# copy the native libraries - -cp ../src/os/solaris/proc/amd64/libsaproc.so $SA_NAME/solaris/amd64 -cp ../src/os/solaris/proc/sparc/libsaproc.so $SA_NAME/solaris/sparc -cp ../src/os/solaris/proc/sparc/libsaproc_audit.so $SA_NAME/solaris/sparc -cp ../src/os/solaris/proc/sparcv9/libsaproc.so $SA_NAME/solaris/sparcv9 -cp ../src/os/solaris/proc/sparcv9/libsaproc_audit.so $SA_NAME/solaris/sparcv9 -cp ../src/os/solaris/proc/i386/libsaproc.so $SA_NAME/solaris/i386 -cp ../src/os/linux/i386/libsaproc.so $SA_NAME/linux/i386 -cp ../src/os/linux/ia64/libsaproc.so $SA_NAME/linux/ia64 -cp ../src/os/linux/amd64/libsaproc.so $SA_NAME/linux/amd64 -cp ../src/os/win32/windbg/i386/sawindbg.dll $SA_NAME/win32/i386 -cp ../src/os/win32/windbg/ia64/sawindbg.dll $SA_NAME/win32/ia64 -cp ../src/os/win32/windbg/amd64/sawindbg.dll $SA_NAME/win32/amd64 - -# copy Unix (Solaris and Linux) shell scripts -cp saenv.sh $SA_NAME ; chmod 755 $SA_NAME/saenv.sh -cp saenv64.sh $SA_NAME ; chmod 755 $SA_NAME/saenv64.sh -cp clhsdbproc.sh $SA_NAME ; chmod 755 $SA_NAME/clhsdbproc.sh -cp clhsdbproc64.sh $SA_NAME ; chmod 755 $SA_NAME/clhsdbproc64.sh -cp dumpflagsproc.sh $SA_NAME ; chmod 755 $SA_NAME/dumpflagsproc.sh -cp dumpflagsproc64.sh $SA_NAME ; chmod 755 $SA_NAME/dumpflagsproc64.sh -cp dumpsyspropsproc.sh $SA_NAME ; chmod 755 $SA_NAME/dumpsyspropsproc.sh -cp dumpsyspropsproc64.sh $SA_NAME ; chmod 755 $SA_NAME/dumpsyspropsproc64.sh -cp finalizerinfoproc.sh $SA_NAME ; chmod 755 $SA_NAME/finalizerinfoproc.sh -cp finalizerinfoproc64.sh $SA_NAME ; chmod 755 $SA_NAME/finalizerinfoproc64.sh -cp heapdumpproc.sh $SA_NAME ; chmod 755 $SA_NAME/heapdumpproc.sh -cp heapdumpproc64.sh $SA_NAME ; chmod 755 $SA_NAME/heapdumpproc64.sh -cp heapsumproc.sh $SA_NAME ; chmod 755 $SA_NAME/heapsumproc.sh -cp heapsumproc64.sh $SA_NAME ; chmod 755 $SA_NAME/heapsumproc64.sh -cp hsdbproc.sh $SA_NAME ; chmod 755 $SA_NAME/hsdbproc.sh -cp hsdbproc64.sh $SA_NAME ; chmod 755 $SA_NAME/hsdbproc64.sh -cp jcoreproc.sh $SA_NAME ; chmod 755 $SA_NAME/jcoreproc.sh -cp jcoreproc64.sh $SA_NAME ; chmod 755 $SA_NAME/jcoreproc64.sh -cp jdbcore.sh $SA_NAME ; chmod 755 $SA_NAME/jdbcore.sh -cp jdbcore64.sh $SA_NAME ; chmod 755 $SA_NAME/jdbcore64.sh -cp jdbproc.sh $SA_NAME ; chmod 755 $SA_NAME/jdbproc.sh -cp jdbproc64.sh $SA_NAME ; chmod 755 $SA_NAME/jdbproc64.sh -cp jhistoproc.sh $SA_NAME ; chmod 755 $SA_NAME/jhistoproc.sh -cp jhistoproc64.sh $SA_NAME ; chmod 755 $SA_NAME/jhistoproc64.sh -cp jsdbproc.sh $SA_NAME ; chmod 755 $SA_NAME/jsdbproc.sh -cp jsdbproc64.sh $SA_NAME ; chmod 755 $SA_NAME/jsdbproc64.sh -cp jstackproc.sh $SA_NAME ; chmod 755 $SA_NAME/jstackproc.sh -cp jstackproc64.sh $SA_NAME ; chmod 755 $SA_NAME/jstackproc64.sh -cp permstatproc.sh $SA_NAME ; chmod 755 $SA_NAME/permstatproc.sh -cp permstatproc64.sh $SA_NAME ; chmod 755 $SA_NAME/permstatproc64.sh -cp pmapproc.sh $SA_NAME ; chmod 755 $SA_NAME/pmapproc.sh -cp pmapproc64.sh $SA_NAME ; chmod 755 $SA_NAME/pmapproc64.sh -cp pstackproc.sh $SA_NAME ; chmod 755 $SA_NAME/pstackproc.sh -cp pstackproc64.sh $SA_NAME ; chmod 755 $SA_NAME/pstackproc64.sh -cp soqlproc.sh $SA_NAME ; chmod 755 $SA_NAME/soqlproc.sh -cp soqlproc64.sh $SA_NAME ; chmod 755 $SA_NAME/soqlproc64.sh -cp start-debug-server $SA_NAME ; chmod 755 $SA_NAME/start-debug-server -cp start-debug-server-proc.sh $SA_NAME ; chmod 755 $SA_NAME/start-debug-server-proc.sh -cp start-debug-server-proc64.sh $SA_NAME ; chmod 755 $SA_NAME/start-debug-server-proc64.sh -cp start-rmiregistry.sh $SA_NAME ; chmod 755 $SA_NAME/start-rmiregistry.sh - -# copy Windows batch files -cp saenv.bat $SA_NAME ; chmod 755 $SA_NAME/saenv.bat -cp saenv64.bat $SA_NAME ; chmod 755 $SA_NAME/saenv64.bat -cp clhsdbwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/clhsdbwindbg.bat -cp clhsdbwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/clhsdbwindbg64.bat -cp dumpflagswindbg.bat $SA_NAME ; chmod 755 $SA_NAME/dumpflagswindbg.bat -cp dumpflagswindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/dumpflagswindbg64.bat -cp dumpsyspropswindbg.bat $SA_NAME ; chmod 755 $SA_NAME/dumpsyspropswindbg.bat -cp dumpsyspropswindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/dumpsyspropswindbg64.bat -cp finalizerinfowindbg.bat $SA_NAME ; chmod 755 $SA_NAME/finalizerinfowindbg.bat -cp finalizerinfowindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/finalizerinfowindbg64.bat -cp heapdumpwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/heapdumpwindbg.bat -cp heapdumpwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/heapdumpwindbg64.bat -cp heapsumwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/heapsumwindbg.bat -cp heapsumwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/heapsumwindbg64.bat -cp hsdbwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/hsdbwindbg.bat -cp hsdbwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/hsdbwindbg64.bat -cp jcorewindbg.bat $SA_NAME ; chmod 755 $SA_NAME/jcorewindbg.bat -cp jcorewindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/jcorewindbg64.bat -cp jhistowindbg.bat $SA_NAME ; chmod 755 $SA_NAME/jhistowindbg.bat -cp jhistowindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/jhistowindbg64.bat -cp jsdbwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/jsdbwindbg.bat -cp jsdbwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/jsdbwindbg64.bat -cp jstackwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/jstackwindbg.bat -cp jstackwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/jstackwindbg64.bat -cp permstatwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/permstatwindbg.bat -cp permstatwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/permstatwindbg64.bat -cp pmapwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/pmapwindbg.bat -cp pmapwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/pmapwindbg64.bat -cp pstackwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/pstackwindbg.bat -cp pstackwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/pstackwindbg64.bat -cp soqlwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/soqlwindbg.bat -cp soqlwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/soqlwindbg64.bat -cp start-debug-server-windbg.bat $SA_NAME ; chmod 755 $SA_NAME/start-debug-server-windbg.bat -cp start-debug-server-windbg64.bat $SA_NAME ; chmod 755 $SA_NAME/start-debug-server-windbg64.bat -cp start-rmiregistry.bat $SA_NAME ; chmod 755 $SA_NAME/start-rmiregistry.bat - - -# make the libproc test -cd ../test/libproc ; make; cd ../../make - -# copy libproc test suite - -cp ../test/libproc/README $SA_TEST/README-libproc -cp ../test/libproc/libproctest.sh $SA_TEST ; chmod 755 $SA_TEST/libproctest.sh -cp ../test/libproc/libproctest64.sh $SA_TEST ; chmod 755 $SA_TEST/libproctest64.sh -cp ../test/libproc/*.class $SA_TEST - -# copy RMI security policy file -cp grantAll.policy $SA_NAME - -# copy documentation -mkdir $SA_NAME/doc -cp ../doc/*.html $SA_NAME/doc -chmod 644 $SA_NAME/doc/*.html - -# make lib dir and copy other jar files -mkdir $SA_NAME/lib -cp ../src/share/lib/*.jar $SA_NAME/lib - -# tar and gzip -tar -cvf $SA_NAME.tar $SA_NAME -gzip $SA_NAME.tar - -# cleanup -\rm -rf $SA_NAME diff --git a/hotspot/agent/make/permstatproc.sh b/hotspot/agent/make/permstatproc.sh deleted file mode 100644 index 7aeff637fef..00000000000 --- a/hotspot/agent/make/permstatproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 2004, 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. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.PermStat $* diff --git a/hotspot/agent/make/permstatproc64.sh b/hotspot/agent/make/permstatproc64.sh deleted file mode 100644 index 04754abedd8..00000000000 --- a/hotspot/agent/make/permstatproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 2004, 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. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.PermStat $* diff --git a/hotspot/agent/make/permstatwindbg.bat b/hotspot/agent/make/permstatwindbg.bat deleted file mode 100644 index c296cd6580c..00000000000 --- a/hotspot/agent/make/permstatwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.PermStat %1 %2 diff --git a/hotspot/agent/make/permstatwindbg64.bat b/hotspot/agent/make/permstatwindbg64.bat deleted file mode 100644 index b1a2ad549b8..00000000000 --- a/hotspot/agent/make/permstatwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.PermStat %1 %2 diff --git a/hotspot/agent/make/pmapproc.sh b/hotspot/agent/make/pmapproc.sh deleted file mode 100644 index 193f039ea68..00000000000 --- a/hotspot/agent/make/pmapproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.PMap $* diff --git a/hotspot/agent/make/pmapproc64.sh b/hotspot/agent/make/pmapproc64.sh deleted file mode 100644 index c55acd7027b..00000000000 --- a/hotspot/agent/make/pmapproc64.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.PMap $* - diff --git a/hotspot/agent/make/pmapwindbg.bat b/hotspot/agent/make/pmapwindbg.bat deleted file mode 100644 index abc771a551b..00000000000 --- a/hotspot/agent/make/pmapwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.PMap %1 %2 diff --git a/hotspot/agent/make/pmapwindbg64.bat b/hotspot/agent/make/pmapwindbg64.bat deleted file mode 100644 index 6a8e3aa7483..00000000000 --- a/hotspot/agent/make/pmapwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.PMap %1 %2 diff --git a/hotspot/agent/make/pstackproc.sh b/hotspot/agent/make/pstackproc.sh deleted file mode 100644 index a78c1d48d1b..00000000000 --- a/hotspot/agent/make/pstackproc.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -. `dirname $0`/saenv.sh - -type c++filt 1>/dev/null 2>/dev/null -if [ $? -eq 0 ]; then - $SA_JAVA_CMD sun.jvm.hotspot.tools.PStack $* | c++filt -else - $SA_JAVA_CMD sun.jvm.hotspot.tools.PStack $* -fi - diff --git a/hotspot/agent/make/pstackproc64.sh b/hotspot/agent/make/pstackproc64.sh deleted file mode 100644 index c2a14ed0d90..00000000000 --- a/hotspot/agent/make/pstackproc64.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -. `dirname $0`/saenv64.sh - -type c++filt 1>/dev/null 2>/dev/null -if [ $? -eq 0 ]; then - $SA_JAVA_CMD sun.jvm.hotspot.tools.PStack $* | c++filt -else - $SA_JAVA_CMD sun.jvm.hotspot.tools.PStack $* -fi - diff --git a/hotspot/agent/make/pstackwindbg.bat b/hotspot/agent/make/pstackwindbg.bat deleted file mode 100644 index 5180424758d..00000000000 --- a/hotspot/agent/make/pstackwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.PStack %1 %2 diff --git a/hotspot/agent/make/pstackwindbg64.bat b/hotspot/agent/make/pstackwindbg64.bat deleted file mode 100644 index 659788c230a..00000000000 --- a/hotspot/agent/make/pstackwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.PStack %1 %2 diff --git a/hotspot/agent/make/saenv.bat b/hotspot/agent/make/saenv.bat deleted file mode 100644 index 65f09530f6d..00000000000 --- a/hotspot/agent/make/saenv.bat +++ /dev/null @@ -1,54 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -REM This is common environment settings for all SA -REM windows batch scripts - -REM set jre\bin and jre\bin\client (or server) in PATH -REM WINDBG_HOME must point to the Windows Debugging Tools -REM installation directory - -if "%SA_JAVA%" == "" goto no_sa_java - -goto sa_java_set - -:no_sa_java -set SA_JAVA=java - -:sa_java_set - -set SA_CLASSPATH=..\build\classes;..\src\share\lib\js.jar;sa.jar;lib\js.jar - -set SA_LIBPATH=..\src\os\win32\windbg\i386;.\win32\i386 - -set OPTIONS=-Dsun.jvm.hotspot.debugger.useWindbgDebugger -set OPTIONS=-Dsun.jvm.hotspot.debugger.windbg.imagePath="%PATH%" %OPTIONS% -set OPTIONS=-Dsun.jvm.hotspot.debugger.windbg.sdkHome="%WINDBG_HOME%" %OPTIONS% - -if "%SA_DISABLE_VERS_CHK%" == "" goto vers_chk -set OPTIONS="-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck %OPTIONS%" - -:vers_chk -set SA_JAVA_CMD=%SA_JAVA% -showversion -cp %SA_CLASSPATH% -Djava.library.path=%SA_LIBPATH% %OPTIONS% diff --git a/hotspot/agent/make/saenv.sh b/hotspot/agent/make/saenv.sh deleted file mode 100644 index 15fb0aca2b0..00000000000 --- a/hotspot/agent/make/saenv.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 2012, 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. -# -# - -# This file sets common environment variables for all SA scripts - -OS=`uname` -STARTDIR=`(cd \`dirname $0 \`; pwd)` -ARCH=`uname -m` - -if [ "x$SA_JAVA" = "x" ]; then - SA_JAVA=java -fi - -if [ "$OS" = "Linux" ]; then - if [ "$ARCH" = "ia64" ] ; then - SA_LIBPATH=$STARTDIR/../src/os/linux/ia64:$STARTDIR/linux/ia64 - OPTIONS="-Dsa.library.path=$SA_LIBPATH" - CPU=ia64 - elif [ "$ARCH" = "x86_64" ] ; then - SA_LIBPATH=$STARTDIR/../src/os/linux/amd64:$STARTDIR/linux/amd64 - OPTIONS="-Dsa.library.path=$SA_LIBPATH" - CPU=amd64 - else - SA_LIBPATH=$STARTDIR/../src/os/linux/i386:$STARTDIR/linux/i386 - OPTIONS="-Dsa.library.path=$SA_LIBPATH" - CPU=i386 - fi -else - # configure audit helper library for solaris - LD_AUDIT_32=$STARTDIR/../src/os/solaris/proc/`uname -p`/libsaproc_audit.so - if [ ! -f $LD_AUDIT_32 ]; then - LD_AUDIT_32=$STARTDIR/solaris/`uname -p`/libsaproc_audit.so - fi - if [ ! -f $LD_AUDIT_32 ]; then - echo "Can't find libsaproc_audit.so." - echo "Make sure to build it with 'make natives'." - exit 1 - fi - export LD_AUDIT_32 - SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/`uname -p`:$STARTDIR/solaris/`uname -p` - OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger" - CPU=sparc -fi - -if [ "x$SA_DISABLE_VERS_CHK" != "x" ]; then - OPTIONS="-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck ${OPTIONS}" -fi - - -SA_CLASSPATH=$STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar:$STARTDIR/lib/js.jar - -if [ ! -z "$SA_TYPEDB" ]; then - if [ ! -f $SA_TYPEDB ]; then - echo "$SA_TYPEDB is unreadable" - exit 1 - fi - OPTIONS="-Dsun.jvm.hotspot.typedb=$SA_TYPEDB ${OPTIONS}" -fi - -OPTIONS="-Djava.system.class.loader=sun.jvm.hotspot.SALauncherLoader ${OPTIONS}" - -SA_JAVA_CMD="$SA_PREFIX_CMD $SA_JAVA -showversion ${OPTIONS} -cp $SA_CLASSPATH $SA_OPTIONS" diff --git a/hotspot/agent/make/saenv64.bat b/hotspot/agent/make/saenv64.bat deleted file mode 100644 index 414a92496d7..00000000000 --- a/hotspot/agent/make/saenv64.bat +++ /dev/null @@ -1,60 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -REM FIXME: How do I detect processor on Windows so that -REM AMD-64/IA-64 could be detected? Should I assume -REM MKS/Cygwin here? - -REM This is common environment settings for all SA -REM windows batch scripts - -REM set jre\bin and jre\bin\client (or server) in PATH -REM WINDBG_HOME must point to the Windows Debugging Tools -REM installation directory. - -if "%SA_JAVA%" == "" goto no_sa_java - -goto sa_java_set - -:no_sa_java -set SA_JAVA=java - -:sa_java_set - -set SA_CLASSPATH=..\build\classes;..\src\share\lib\js.jar;sa.jar;lib\js.jar - -REM For now, only AMD-64, IA-64 stack walking is not working anyway -set SA_LIBPATH=.\src\os\win32\windbg\amd64;.\win32\amd64 - -set OPTIONS=-Dsun.jvm.hotspot.debugger.useWindbgDebugger -set OPTIONS=-Dsun.jvm.hotspot.debugger.windbg.imagePath="%PATH%" %OPTIONS% -set OPTIONS=-Dsun.jvm.hotspot.debugger.windbg.sdkHome="%WINDBG_HOME%" %OPTIONS% - -if "%SA_DISABLE_VERS_CHK%" == "" goto vers_chk -set OPTIONS="-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck %OPTIONS%" - -:vers_chk - -set SA_JAVA_CMD=%SA_JAVA% -showversion -cp %SA_CLASSPATH% -Djava.library.path=.%SA_LIBPATH% %OPTIONS% diff --git a/hotspot/agent/make/saenv64.sh b/hotspot/agent/make/saenv64.sh deleted file mode 100644 index a68d34c99a2..00000000000 --- a/hotspot/agent/make/saenv64.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 2009, 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. -# -# - -# This file sets common environment variables for all 64-bit Solaris [sparcv9, -# amd64] SA scripts. Please note that for 64-bit Linux use saenv.sh. - -OS=`uname` -STARTDIR=`dirname $0` - -CPU=`isainfo | grep sparcv9` - -if [ "x$CPU" != "x" ]; then - CPU=sparcv9 -else - CPU=`isainfo | grep amd64` - if [ "x$CPU" != "x" ]; then - CPU=amd64 - else - echo "unknown CPU, only sparcv9, amd64 are supported!" - exit 1 - fi -fi - -# configure audit helper library -LD_AUDIT_64=$STARTDIR/../src/os/solaris/proc/$CPU/libsaproc_audit.so -if [ ! -f $LD_AUDIT_64 ]; then - LD_AUDIT_64=$STARTDIR/solaris/$CPU/libsaproc_audit.so -fi - -if [ ! -f $LD_AUDIT_64 ]; then - echo "Can't find libsaproc_audit.so." - echo "Make sure to build it with 'make natives'." - exit 1 -fi - -export LD_AUDIT_64 -SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/$CPU:$STARTDIR/solaris/$CPU - -OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger" - -if [ "x$SA_JAVA" = "x" ]; then - SA_JAVA=java -fi - -if [ "x$SA_DISABLE_VERS_CHK" != "x" ]; then - OPTIONS="-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck ${OPTIONS}" -fi - -SA_CLASSPATH=$STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar::$STARTDIR/lib/js.jar - -if [ ! -z "$SA_TYPEDB" ]; then - if [ ! -f $SA_TYPEDB ]; then - echo "$SA_TYPEDB is unreadable" - exit 1 - fi - OPTIONS="-Dsun.jvm.hotspot.typedb=$SA_TYPEDB ${OPTIONS}" -fi - -OPTIONS="-Djava.system.class.loader=sun.jvm.hotspot.SALauncherLoader ${OPTIONS}" - -SA_JAVA_CMD="$SA_PREFIX_CMD $SA_JAVA -d64 -showversion ${OPTIONS} -cp $SA_CLASSPATH $SA_OPTIONS" diff --git a/hotspot/agent/make/soqlproc.sh b/hotspot/agent/make/soqlproc.sh deleted file mode 100644 index 9e9540549fd..00000000000 --- a/hotspot/agent/make/soqlproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.soql.SOQL $* diff --git a/hotspot/agent/make/soqlproc64.sh b/hotspot/agent/make/soqlproc64.sh deleted file mode 100644 index 1a2fa1756b0..00000000000 --- a/hotspot/agent/make/soqlproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 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. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.soql.SOQL $* diff --git a/hotspot/agent/make/soqlwindbg.bat b/hotspot/agent/make/soqlwindbg.bat deleted file mode 100644 index 1abc3ce9ce0..00000000000 --- a/hotspot/agent/make/soqlwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.soql.SOQL %1 %2 diff --git a/hotspot/agent/make/soqlwindbg64.bat b/hotspot/agent/make/soqlwindbg64.bat deleted file mode 100644 index 5f084335c9f..00000000000 --- a/hotspot/agent/make/soqlwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.soql.SOQL %1 %2 diff --git a/hotspot/agent/make/start-debug-server b/hotspot/agent/make/start-debug-server deleted file mode 100644 index dfaf5d91515..00000000000 --- a/hotspot/agent/make/start-debug-server +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -STARTDIR=`dirname $0` - -if [ "x$SA_JAVA" = "x" ]; then - SA_JAVA=java -fi - -if [ -f $STARTDIR/sa.jar ] ; then - CP=$STARTDIR/sa.jar -else - CP=$STARTDIR/../build/classes -fi - -# License file for development version of dbx -setenv LM_LICENSE_FILE 7588@extend.eng:/usr/dist/local/config/sparcworks/license.dat:7588@setlicense - -$SA_JAVA -Xbootclasspath/p:$CP -Djava.rmi.server.codebase=file:/$CP -Djava.security.policy=$STARTDIR\/grantAll.policy sun.jvm.hotspot.DebugServer $* diff --git a/hotspot/agent/make/start-debug-server-proc.sh b/hotspot/agent/make/start-debug-server-proc.sh deleted file mode 100644 index 73152e3404d..00000000000 --- a/hotspot/agent/make/start-debug-server-proc.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2012, 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. -# -# - -. `dirname $0`/saenv.sh - -if [ -f $STARTDIR/../lib/sa-jdi.jar ] ; then - CP=$STARTDIR/../lib/sa-jdi.jar -else - CP=$STARTDIR/../build/classes -fi - -$STARTDIR/java -classpath $CP ${OPTIONS} -Djava.rmi.server.codebase=file://$CP -Djava.security.policy=${STARTDIR}/grantAll.policy sun.jvm.hotspot.DebugServer $* - diff --git a/hotspot/agent/make/start-debug-server-proc64.sh b/hotspot/agent/make/start-debug-server-proc64.sh deleted file mode 100644 index 56c78d4be88..00000000000 --- a/hotspot/agent/make/start-debug-server-proc64.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, 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. -# -# - -. `dirname $0`/saenv64.sh - -if [ -f $STARTDIR/sa.jar ] ; then - CP=$STARTDIR/sa.jar -else - CP=$STARTDIR/../build/classes -fi - -$SA_JAVA -d64 -classpath $CP ${OPTIONS} -Djava.rmi.server.codebase=file:/$CP -Djava.security.policy=$STARTDIR\/grantAll.policy sun.jvm.hotspot.DebugServer $* diff --git a/hotspot/agent/make/start-debug-server-windbg.bat b/hotspot/agent/make/start-debug-server-windbg.bat deleted file mode 100644 index 17fcebca8e3..00000000000 --- a/hotspot/agent/make/start-debug-server-windbg.bat +++ /dev/null @@ -1,39 +0,0 @@ -@echo off -REM -REM Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -REM check for .\sa.jar, if it does not exist -REM assume that we are in build configuration. - -if not exist .\sa.jar goto IN_BUILD_CONF -set SA_CLASSPATH=.\sa.jar -goto EXEC_CMD - -:IN_BUILD_CONF -set SA_CLASSPATH=..\build\classes - -:EXEC_CMD -%SA_JAVA% -classpath %SA_CLASSPATH% -Djava.rmi.server.codebase=file:/%SA_CLASSPATH% -Djava.security.policy=grantAll.policy -Djava.library.path=%SA_LIBPATH% %OPTIONS% sun.jvm.hotspot.DebugServer %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/hotspot/agent/make/start-debug-server-windbg64.bat b/hotspot/agent/make/start-debug-server-windbg64.bat deleted file mode 100644 index d8b6690ebaf..00000000000 --- a/hotspot/agent/make/start-debug-server-windbg64.bat +++ /dev/null @@ -1,39 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -REM check for .\sa.jar, if it does not exist -REM assume that we are in build configuration. - -if not exist .\sa.jar goto IN_BUILD_CONF -set SA_CLASSPATH=.\sa.jar -goto EXEC_CMD - -:IN_BUILD_CONF -set SA_CLASSPATH=..\build\classes - -:EXEC_CMD -%SA_JAVA% -classpath %SA_CLASSPATH% -Djava.rmi.server.codebase=file:/%SA_CLASSPATH% -Djava.security.policy=grantAll.policy -Djava.library.path=%SA_LIBPATH% %OPTIONS% sun.jvm.hotspot.DebugServer %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/hotspot/agent/make/start-rmiregistry.bat b/hotspot/agent/make/start-rmiregistry.bat deleted file mode 100644 index eab92583e95..00000000000 --- a/hotspot/agent/make/start-rmiregistry.bat +++ /dev/null @@ -1,37 +0,0 @@ -@echo off -REM -REM Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -REM check for .\sa.jar, if it does not exist -REM assume that we are in build configuration. - -if not exist .\sa.jar goto IN_BUILD_CONF -set CLASSPATH=.\sa.jar -goto EXEC_CMD - -:IN_BUILD_CONF -set CLASSPATH=..\build\classes - -:EXEC_CMD -start rmiregistry -J-Xbootclasspath/p:%CLASSPATH% diff --git a/hotspot/agent/make/start-rmiregistry.sh b/hotspot/agent/make/start-rmiregistry.sh deleted file mode 100644 index a1d9080d5d7..00000000000 --- a/hotspot/agent/make/start-rmiregistry.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2000, 2003, 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. -# -# - -STARTDIR=`dirname $0` - -if [ -f $STARTDIR/sa.jar ] ; then - CP=$STARTDIR/sa.jar -else - CP=$STARTDIR/../build/classes -fi - -rmiregistry -J-Xbootclasspath/p:$CP diff --git a/hotspot/agent/src/os/bsd/Makefile b/hotspot/agent/src/os/bsd/Makefile deleted file mode 100644 index eabe1f7730d..00000000000 --- a/hotspot/agent/src/os/bsd/Makefile +++ /dev/null @@ -1,102 +0,0 @@ -# -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -ARCH := $(shell if ([ `uname -m` = "ia64" ]) ; then echo ia64 ; elif ([ `uname -m` = "amd64" ]) ; then echo amd64; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi ) - -OS := $(shell uname -s) - -GCC = gcc - -JAVAH = ${JAVA_HOME}/bin/javah - -ifneq ($(OS), Darwin) -SOURCES = salibelf.c \ - symtab.c \ - libproc_impl.c \ - ps_proc.c \ - ps_core.c \ - BsdDebuggerLocal.c -OBJS = $(SOURCES:.c=.o) -OBJSPLUS = $(OBJS) sadis.o -LIBSA = $(ARCH)/libsaproc.so - -LIBS = -lutil -lthread_db - -else - -SOURCES = symtab.c \ - libproc_impl.c \ - ps_core.c -OBJS = $(SOURCES:.c=.o) -OBJSPLUS = MacosxDebuggerLocal.o sadis.o $(OBJS) -EXTINCLUDE = -I. -EXTCFLAGS = -m64 -D__APPLE__ -framework JavaNativeFoundation -FOUNDATIONFLAGS = -framework Foundation -framework JavaNativeFoundation -framework Security -framework CoreFoundation -LIBSA = $(ARCH)/libsaproc.dylib -endif # Darwin - -INCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") $(EXTINCLUDE) - - - -CFLAGS = -c -fPIC -g -Wall -D_ALLBSD_SOURCE -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) $(EXTCFLAGS) - - - -all: $(LIBSA) - -MacosxDebuggerLocal.o: MacosxDebuggerLocal.m - echo "OS="$(OS) - $(JAVAH) -jni -classpath ../../../build/classes \ - sun.jvm.hotspot.debugger.x86.X86ThreadContext \ - sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext - $(GCC) $(CFLAGS) $(FOUNDATIONFLAGS) $< - -sadis.o: ../../share/native/sadis.c - $(JAVAH) -jni -classpath ../../../build/classes \ - sun.jvm.hotspot.asm.Disassembler - $(GCC) $(CFLAGS) $< - -.c.obj: - $(GCC) $(CFLAGS) - -ifndef LDNOMAP - LFLAGS_LIBSA = -Xlinker --version-script=mapfile -endif - -$(LIBSA): $(OBJSPLUS) mapfile - if [ ! -d $(ARCH) ] ; then mkdir $(ARCH) ; fi - $(GCC) -shared $(LFLAGS_LIBSA) -o $(LIBSA) $(FOUNDATIONFLAGS) $(OBJSPLUS) $(LIBS) $(SALIBS) - -test.o: $(LIBSA) test.c - $(GCC) -c -o test.o -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) test.c - -test: test.o - $(GCC) -o test test.o -L$(ARCH) -lsaproc $(LIBS) - -clean: - rm -f $(LIBSA) - rm -f *.o - rm -f test.o - -rmdir $(ARCH) diff --git a/hotspot/agent/src/os/linux/Makefile b/hotspot/agent/src/os/linux/Makefile deleted file mode 100644 index 9eeabe661e5..00000000000 --- a/hotspot/agent/src/os/linux/Makefile +++ /dev/null @@ -1,90 +0,0 @@ -# -# Copyright (c) 2002, 2012, 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. -# -# - -ARCH := $(shell if ([ `uname -m` = "ia64" ]) ; then echo ia64 ; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi ) -GCC = gcc - -JAVAH = ${JAVA_HOME}/bin/javah - -SOURCES = salibelf.c \ - symtab.c \ - libproc_impl.c \ - ps_proc.c \ - ps_core.c \ - LinuxDebuggerLocal.c - -INCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux - -OBJS = $(SOURCES:%.c=$(ARCH)/%.o) $(ARCH)/sadis.o - -LIBS = -lthread_db - -CFLAGS = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) -I$(ARCH) - -LIBSA = $(ARCH)/libsaproc.so - -all: $(LIBSA) - -$(ARCH): - mkdir $(ARCH) - -$(ARCH)/LinuxDebuggerLocal.o: LinuxDebuggerLocal.c - $(JAVAH) -jni -classpath ../../../build/classes -d $(ARCH) \ - sun.jvm.hotspot.debugger.x86.X86ThreadContext \ - sun.jvm.hotspot.debugger.sparc.SPARCThreadContext \ - sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext \ - sun.jvm.hotspot.debugger.aarch64.AARCH64ThreadContext - $(GCC) $(CFLAGS) $< -o $@ - -$(ARCH)/sadis.o: ../../share/native/sadis.c - $(JAVAH) -jni -classpath ../../../build/classes -d $(ARCH) \ - sun.jvm.hotspot.asm.Disassembler - $(GCC) $(CFLAGS) $< -o $@ - -$(ARCH)/%.o: %.c - $(GCC) $(CFLAGS) $< -o $@ - -ifndef LDNOMAP - LFLAGS_LIBSA = -Xlinker --version-script=mapfile -endif - -# If this is a --hash-style=gnu system, use --hash-style=both -# The gnu .hash section won't work on some Linux systems like SuSE 10. -_HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | grep -- '--hash-style=gnu') -ifneq ($(_HAS_HASH_STYLE_GNU),) - LDFLAGS_HASH_STYLE = -Wl,--hash-style=both -endif -LFLAGS_LIBSA += $(LDFLAGS_HASH_STYLE) - -$(LIBSA): $(ARCH) $(OBJS) mapfile - $(GCC) -shared $(LFLAGS_LIBSA) -o $(LIBSA) $(OBJS) $(LIBS) - -test.o: test.c - $(GCC) -c -o test.o -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) test.c - -test: test.o - $(GCC) -o test test.o -L$(ARCH) -lsaproc $(LIBS) - -clean: - rm -fr $(ARCH) diff --git a/hotspot/agent/src/os/solaris/Makefile b/hotspot/agent/src/os/solaris/Makefile deleted file mode 100644 index 0e964bf2c60..00000000000 --- a/hotspot/agent/src/os/solaris/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright (c) 2002, 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. -# -# - - -all: - cd proc; $(MAKE) all - -clean: - cd proc; $(MAKE) clean diff --git a/hotspot/agent/src/os/solaris/proc/Makefile b/hotspot/agent/src/os/solaris/proc/Makefile deleted file mode 100644 index 60ba88eb47b..00000000000 --- a/hotspot/agent/src/os/solaris/proc/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -# -# Copyright (c) 2002, 2012, 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. -# -# - -# Targets are: -# sparc: Build the 32 bit sparc version in ./sparc -# sparcv9: Build the 64 bit sparcv9 version in ./sparcv9 -# i386: Build the 32 bit i386 version in ./i386 - -.PHONY: sparc sparcv9 i386 amd64 - -ARCH_ORIG = $(shell uname -p) - -C++ := CC -RM := /usr/bin/rm -MKDIRS := /usr/bin/mkdir -p - -CLASSES_DIR = ../../../../build/classes -SAPROC_INCLUDES=-I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris -SADIS=../../../share/native/sadis.c - -ifeq "$(ARCH_ORIG)" "i386" - ALL_TARGET = i386 $(filter amd64,$(shell isalist)) -else - ALL_TARGET = sparc sparcv9 -endif - -CFLAGS/i386 = -CFLAGS/amd64 = -xarch=amd64 -CFLAGS/sparc = -xarch=v8 -CFLAGS/sparv9 = -xarch=v9 - -all:: $(ALL_TARGET) - -javahomecheck:: - @if [ "x$(JAVA_HOME)" = "x" ] ; then \ - echo You must set the environment variable JAVA_HOME before executing this Makefile ; \ - exit 1 ; \ - fi - -i386 amd64 sparc sparcv9:: javahomecheck - $(MKDIRS) $@ - @$(JAVA_HOME)/bin/javah -classpath $(CLASSES_DIR) -d $@ -jni sun.jvm.hotspot.asm.Disassembler sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal - CC $(CFLAGS/$@) -c -g -Kpic ${SAPROC_INCLUDES} -I$@ saproc.cpp -o $@/saproc.o - cc $(CFLAGS/$@) -c -g -Kpic ${SAPROC_INCLUDES} -I$@ $(SADIS) -o $@/sadis.o - CC $(CFLAGS/$@) -g -G -Kpic $@/saproc.o $@/sadis.o -M mapfile -o $@/libsaproc.so -ldemangle - CC $(CFLAGS/$@) -o $@/libsaproc_audit.so -G -Kpic -z defs saproc_audit.cpp -lmapmalloc -ldl -lc - -clean:: - $(RM) -rf sparc sparcv9 i386 amd64 diff --git a/hotspot/agent/src/os/win32/windbg/Makefile b/hotspot/agent/src/os/win32/windbg/Makefile deleted file mode 100644 index 877913a478d..00000000000 --- a/hotspot/agent/src/os/win32/windbg/Makefile +++ /dev/null @@ -1,91 +0,0 @@ -# -# Copyright (c) 2002, 2012, 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. -# -# - -# set WINDBG_HOME and JAVA_HOME environment variables before this make. - -SAWINDBGDLL = sawindbg.dll -CPP32=cl.exe -CPP64=cl.exe -LINK32=link.exe -LINK64=link.exe -JAVAH=$(JAVA_HOME)/bin/javah -WINDBG_INCLUDE=$(WINDBG_HOME)/sdk/inc -WINDBG_LIB32=$(WINDBG_HOME)/sdk/lib/i386 -WINDBG_LIB_IA64=$(WINDBG_HOME)/sdk/lib/ia64 -WINDBG_LIB_AMD64=$(WINDBG_HOME)/sdk/lib/amd64 - -SADIS=../../../share/native/sadis.c - -# These do not need to be optimized (don't run a lot of code) and it -# will be useful to have the assertion checks in place - -CFLAGS32=/nologo /MD /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c - -CFLAGS64=/nologo /MD /W3 /GX /Od /D "WIN32" /D "WIN64" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c - -LIBS32= $(WINDBG_LIB32)/dbgeng.lib \ - /nologo /subsystem:console /debug /machine:I386 - -LIBS_IA64= $(WINDBG_LIB_IA64)/dbgeng.lib \ - /nologo /subsystem:console /debug /machine:IA64 - -LIBS_AMD64= $(WINDBG_LIB_AMD64)/dbgeng.lib bufferoverflowU.lib \ - /nologo /subsystem:console /debug /machine:AMD64 - -default: i386/$(SAWINDBGDLL) - -ia64: ia64/$(SAWINDBGDLL) - -amd64: amd64/$(SAWINDBGDLL) - -i386/$(SAWINDBGDLL) : sawindbg.cpp $(SADIS) - @ mkdir -p i386 - @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal sun.jvm.hotspot.debugger.x86.X86ThreadContext - @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.asm.Disassembler - @ $(CPP32) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS32) /Fp"i386/sawindbg.pch" /Fo"i386/" /Fd"i386/" /c sawindbg.cpp - @ $(CPP32) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS32) /Fp"i386/sadis.pch" /Fo"i386/" /Fd"i386/" /c $(SADIS) - $(LINK32) /out:$@ /DLL i386/sawindbg.obj i386/sadis.obj $(LIBS32) - -ia64/$(SAWINDBGDLL) : sawindbg.cpp $(SADIS) - @ mkdir -p ia64 - @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal sun.jvm.hotspot.debugger.ia64.IA64ThreadContext - @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.asm.Disassembler - @ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"ia64/sawindbg.pch" /Fo"ia64/" /Fd"ia64/" /c sawindbg.cpp - @ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"ia64/sadis.pch" /Fo"ia64/" /Fd"ia64/" /c $(SADIS) - $(LINK64) /out:$@ /DLL ia64/sawindbg.obj ia64/sadis.obj $(LIBS_IA64) - -amd64/$(SAWINDBGDLL) : sawindbg.cpp $(SADIS) - @ mkdir -p amd64 - @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext - @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.asm.Disassembler - @ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"amd64/sawindbg.pch" /Fo"amd64/" /Fd"amd64/" /c sawindbg.cpp - @ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"amd64/sadis.pch" /Fo"amd64/" /Fd"amd64/" /c $(SADIS) - $(LINK64) /out:$@ /DLL amd64/sawindbg.obj amd64/sadis.obj $(LIBS_AMD64) - -clean: - rm *.h - rm -rf i386 - rm -rf ia64 - rm -rf amd64 - diff --git a/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk b/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk index a3febc1c302..8a2402c29d1 100644 --- a/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk +++ b/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk @@ -29,22 +29,13 @@ $(eval $(call IncludeCustomExtension, hotspot, lib/Lib-jdk.hotspot.agent.gmk)) ################################################################################ -SA_TOPDIR := $(HOTSPOT_TOPDIR)/agent - -# SA has a slightly different OS naming scheme -ifeq ($(OPENJDK_TARGET_OS), windows) - SA_TARGET_OS := win32 -else ifeq ($(OPENJDK_TARGET_OS), macosx) - SA_TARGET_OS := bsd -else - SA_TARGET_OS := $(OPENJDK_TARGET_OS) -endif +SA_TOPDIR := $(HOTSPOT_TOPDIR)/src/jdk.hotspot.agent # Defaults for most platforms SA_TOOLCHAIN := TOOLCHAIN_DEFAULT SA_NAME := saproc -SA_SRC += $(SA_TOPDIR)/src/share/native $(SA_TOPDIR)/src/os/$(SA_TARGET_OS) -SA_MAPFILE := $(SA_TOPDIR)/src/os/$(OPENJDK_TARGET_OS)/mapfile +SA_SRC += $(SA_TOPDIR)/share/native/libsaproc $(SA_TOPDIR)/$(OPENJDK_TARGET_OS)/native/libsaproc +SA_MAPFILE := $(HOTSPOT_TOPDIR)/make/mapfiles/libsaproc/mapfile-$(OPENJDK_TARGET_OS) SA_INCLUDES := \ $(addprefix -I, $(SA_SRC)) \ -I$(SUPPORT_OUTPUTDIR)/headers/jdk.hotspot.agent \ @@ -66,9 +57,7 @@ ifeq ($(OPENJDK_TARGET_OS), linux) else ifeq ($(OPENJDK_TARGET_OS), solaris) SA_TOOLCHAIN := TOOLCHAIN_LINK_CXX - SA_MAPFILE := $(SA_TOPDIR)/src/os/solaris/proc/mapfile - COMMON_CFLAGS := -I$(SA_TOPDIR)/src/os/$(OPENJDK_TARGET_OS)/proc \ - -DSOLARIS_11_B159_OR_LATER + COMMON_CFLAGS := -DSOLARIS_11_B159_OR_LATER SA_CFLAGS := $(CFLAGS_JDKLIB) $(COMMON_CFLAGS) SA_CXXFLAGS := $(CXXFLAGS_JDKLIB) $(COMMON_CFLAGS) SA_LDFLAGS := $(subst -z defs,, $(LDFLAGS_JDKLIB)) \ diff --git a/hotspot/agent/src/os/linux/mapfile b/hotspot/make/mapfiles/libsaproc/mapfile-linux similarity index 100% rename from hotspot/agent/src/os/linux/mapfile rename to hotspot/make/mapfiles/libsaproc/mapfile-linux diff --git a/hotspot/agent/src/os/bsd/mapfile b/hotspot/make/mapfiles/libsaproc/mapfile-macosx similarity index 100% rename from hotspot/agent/src/os/bsd/mapfile rename to hotspot/make/mapfiles/libsaproc/mapfile-macosx diff --git a/hotspot/agent/src/os/solaris/proc/mapfile b/hotspot/make/mapfiles/libsaproc/mapfile-solaris similarity index 100% rename from hotspot/agent/src/os/solaris/proc/mapfile rename to hotspot/make/mapfiles/libsaproc/mapfile-solaris diff --git a/hotspot/agent/doc/ReadMe-JavaScript.text b/hotspot/src/jdk.hotspot.agent/doc/ReadMe-JavaScript.text similarity index 100% rename from hotspot/agent/doc/ReadMe-JavaScript.text rename to hotspot/src/jdk.hotspot.agent/doc/ReadMe-JavaScript.text diff --git a/hotspot/agent/doc/cireplay.html b/hotspot/src/jdk.hotspot.agent/doc/cireplay.html similarity index 100% rename from hotspot/agent/doc/cireplay.html rename to hotspot/src/jdk.hotspot.agent/doc/cireplay.html diff --git a/hotspot/agent/doc/clhsdb.html b/hotspot/src/jdk.hotspot.agent/doc/clhsdb.html similarity index 100% rename from hotspot/agent/doc/clhsdb.html rename to hotspot/src/jdk.hotspot.agent/doc/clhsdb.html diff --git a/hotspot/agent/doc/hsdb.html b/hotspot/src/jdk.hotspot.agent/doc/hsdb.html similarity index 100% rename from hotspot/agent/doc/hsdb.html rename to hotspot/src/jdk.hotspot.agent/doc/hsdb.html diff --git a/hotspot/agent/doc/index.html b/hotspot/src/jdk.hotspot.agent/doc/index.html similarity index 100% rename from hotspot/agent/doc/index.html rename to hotspot/src/jdk.hotspot.agent/doc/index.html diff --git a/hotspot/agent/doc/jsdb.html b/hotspot/src/jdk.hotspot.agent/doc/jsdb.html similarity index 100% rename from hotspot/agent/doc/jsdb.html rename to hotspot/src/jdk.hotspot.agent/doc/jsdb.html diff --git a/hotspot/agent/doc/transported_core.html b/hotspot/src/jdk.hotspot.agent/doc/transported_core.html similarity index 100% rename from hotspot/agent/doc/transported_core.html rename to hotspot/src/jdk.hotspot.agent/doc/transported_core.html diff --git a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.c similarity index 100% rename from hotspot/agent/src/os/linux/LinuxDebuggerLocal.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.c diff --git a/hotspot/agent/src/os/linux/elfmacros.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/elfmacros.h similarity index 100% rename from hotspot/agent/src/os/linux/elfmacros.h rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/elfmacros.h diff --git a/hotspot/agent/src/os/linux/libproc.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc.h similarity index 100% rename from hotspot/agent/src/os/linux/libproc.h rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc.h diff --git a/hotspot/agent/src/os/linux/libproc_impl.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c similarity index 100% rename from hotspot/agent/src/os/linux/libproc_impl.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c diff --git a/hotspot/agent/src/os/linux/libproc_impl.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h similarity index 100% rename from hotspot/agent/src/os/linux/libproc_impl.h rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h diff --git a/hotspot/agent/src/os/linux/proc_service.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/proc_service.h similarity index 100% rename from hotspot/agent/src/os/linux/proc_service.h rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/proc_service.h diff --git a/hotspot/agent/src/os/linux/ps_core.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c similarity index 100% rename from hotspot/agent/src/os/linux/ps_core.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c diff --git a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c similarity index 100% rename from hotspot/agent/src/os/linux/ps_proc.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c diff --git a/hotspot/agent/src/os/linux/salibelf.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/salibelf.c similarity index 100% rename from hotspot/agent/src/os/linux/salibelf.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/salibelf.c diff --git a/hotspot/agent/src/os/bsd/salibelf.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/salibelf.h similarity index 100% rename from hotspot/agent/src/os/bsd/salibelf.h rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/salibelf.h diff --git a/hotspot/agent/src/os/linux/symtab.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c similarity index 100% rename from hotspot/agent/src/os/linux/symtab.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c diff --git a/hotspot/agent/src/os/linux/symtab.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.h similarity index 100% rename from hotspot/agent/src/os/linux/symtab.h rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.h diff --git a/hotspot/agent/src/os/linux/test.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/test.c similarity index 100% rename from hotspot/agent/src/os/linux/test.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/test.c diff --git a/hotspot/agent/src/os/bsd/BsdDebuggerLocal.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/BsdDebuggerLocal.c similarity index 100% rename from hotspot/agent/src/os/bsd/BsdDebuggerLocal.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/BsdDebuggerLocal.c diff --git a/hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m similarity index 100% rename from hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m diff --git a/hotspot/agent/src/os/bsd/StubDebuggerLocal.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/StubDebuggerLocal.c similarity index 100% rename from hotspot/agent/src/os/bsd/StubDebuggerLocal.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/StubDebuggerLocal.c diff --git a/hotspot/agent/src/os/bsd/elfmacros.h b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/elfmacros.h similarity index 100% rename from hotspot/agent/src/os/bsd/elfmacros.h rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/elfmacros.h diff --git a/hotspot/agent/src/os/bsd/libproc.h b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc.h similarity index 100% rename from hotspot/agent/src/os/bsd/libproc.h rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc.h diff --git a/hotspot/agent/src/os/bsd/libproc_impl.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c similarity index 100% rename from hotspot/agent/src/os/bsd/libproc_impl.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c diff --git a/hotspot/agent/src/os/bsd/libproc_impl.h b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.h similarity index 100% rename from hotspot/agent/src/os/bsd/libproc_impl.h rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.h diff --git a/hotspot/agent/src/os/bsd/ps_core.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/ps_core.c similarity index 100% rename from hotspot/agent/src/os/bsd/ps_core.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/ps_core.c diff --git a/hotspot/agent/src/os/bsd/ps_proc.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/ps_proc.c similarity index 100% rename from hotspot/agent/src/os/bsd/ps_proc.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/ps_proc.c diff --git a/hotspot/agent/src/os/bsd/salibelf.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/salibelf.c similarity index 100% rename from hotspot/agent/src/os/bsd/salibelf.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/salibelf.c diff --git a/hotspot/agent/src/os/linux/salibelf.h b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/salibelf.h similarity index 100% rename from hotspot/agent/src/os/linux/salibelf.h rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/salibelf.h diff --git a/hotspot/agent/src/os/bsd/symtab.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/symtab.c similarity index 100% rename from hotspot/agent/src/os/bsd/symtab.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/symtab.c diff --git a/hotspot/agent/src/os/bsd/symtab.h b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/symtab.h similarity index 100% rename from hotspot/agent/src/os/bsd/symtab.h rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/symtab.h diff --git a/hotspot/agent/src/os/bsd/test.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/test.c similarity index 100% rename from hotspot/agent/src/os/bsd/test.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/test.c diff --git a/hotspot/agent/src/scripts/README b/hotspot/src/jdk.hotspot.agent/scripts/README similarity index 100% rename from hotspot/agent/src/scripts/README rename to hotspot/src/jdk.hotspot.agent/scripts/README diff --git a/hotspot/agent/src/scripts/start-debug-server.bat b/hotspot/src/jdk.hotspot.agent/scripts/start-debug-server.bat similarity index 100% rename from hotspot/agent/src/scripts/start-debug-server.bat rename to hotspot/src/jdk.hotspot.agent/scripts/start-debug-server.bat diff --git a/hotspot/agent/src/scripts/start-debug-server.sh b/hotspot/src/jdk.hotspot.agent/scripts/start-debug-server.sh similarity index 100% rename from hotspot/agent/src/scripts/start-debug-server.sh rename to hotspot/src/jdk.hotspot.agent/scripts/start-debug-server.sh diff --git a/hotspot/agent/src/scripts/start-debug-server64.sh b/hotspot/src/jdk.hotspot.agent/scripts/start-debug-server64.sh similarity index 100% rename from hotspot/agent/src/scripts/start-debug-server64.sh rename to hotspot/src/jdk.hotspot.agent/scripts/start-debug-server64.sh diff --git a/hotspot/agent/src/scripts/start-rmiregistry.bat b/hotspot/src/jdk.hotspot.agent/scripts/start-rmiregistry.bat similarity index 100% rename from hotspot/agent/src/scripts/start-rmiregistry.bat rename to hotspot/src/jdk.hotspot.agent/scripts/start-rmiregistry.bat diff --git a/hotspot/agent/src/scripts/start-rmiregistry.sh b/hotspot/src/jdk.hotspot.agent/scripts/start-rmiregistry.sh similarity index 100% rename from hotspot/agent/src/scripts/start-rmiregistry.sh rename to hotspot/src/jdk.hotspot.agent/scripts/start-rmiregistry.sh diff --git a/hotspot/agent/src/scripts/start-rmiregistry64.sh b/hotspot/src/jdk.hotspot.agent/scripts/start-rmiregistry64.sh similarity index 100% rename from hotspot/agent/src/scripts/start-rmiregistry64.sh rename to hotspot/src/jdk.hotspot.agent/scripts/start-rmiregistry64.sh diff --git a/hotspot/agent/src/share/classes/META-INF/services/com.sun.jdi.connect.Connector b/hotspot/src/jdk.hotspot.agent/share/classes/META-INF/services/com.sun.jdi.connect.Connector similarity index 100% rename from hotspot/agent/src/share/classes/META-INF/services/com.sun.jdi.connect.Connector rename to hotspot/src/jdk.hotspot.agent/share/classes/META-INF/services/com.sun.jdi.connect.Connector diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/AboutAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AboutAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/AboutAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AboutAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionManager.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ActionManager.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionManager.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ActionManager.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionUtilities.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ActionUtilities.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionUtilities.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ActionUtilities.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/AlignCenterAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AlignCenterAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/AlignCenterAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AlignCenterAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/AlignLeftAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AlignLeftAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/AlignLeftAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AlignLeftAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/AlignRightAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AlignRightAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/AlignRightAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AlignRightAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/ApplyAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ApplyAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/ApplyAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ApplyAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/BackAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/BackAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/BackAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/BackAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/CancelAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/CancelAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/CancelAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/CancelAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/DelegateAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/DelegateAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/DelegateAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/DelegateAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/ExitAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ExitAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/ExitAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ExitAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/FileMenu.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/FileMenu.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/FileMenu.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/FileMenu.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/FinishAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/FinishAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/FinishAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/FinishAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/HelpAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/HelpAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/HelpAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/HelpAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/HelpMenu.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/HelpMenu.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/HelpMenu.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/HelpMenu.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/NewAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/NewAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/NewAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/NewAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/NextAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/NextAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/NextAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/NextAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/OkAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/OkAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/OkAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/OkAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/OpenAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/OpenAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/OpenAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/OpenAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/SaveAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/SaveAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/SaveAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/SaveAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/SaveAsAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/SaveAsAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/SaveAsAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/SaveAsAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/StateChangeAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/StateChangeAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/StateChangeAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/StateChangeAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/ViewMenu.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ViewMenu.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/ViewMenu.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ViewMenu.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonMenuBar.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/CommonMenuBar.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonMenuBar.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/CommonMenuBar.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/CommonToolBar.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/CommonToolBar.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/CommonUI.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/CommonUI.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/OkCancelButtonPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/OkCancelButtonPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/OkCancelButtonPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/OkCancelButtonPanel.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/OkCancelDialog.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/OkCancelDialog.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/OkCancelDialog.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/OkCancelDialog.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/SplashScreen.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/SplashScreen.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/SplashScreen.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/SplashScreen.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/StatusBar.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/StatusBar.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/StatusBar.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/StatusBar.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/TabsDlg.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/TabsDlg.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/TabsDlg.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/TabsDlg.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/ToggleActionPropertyChangeListener.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/ToggleActionPropertyChangeListener.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/ToggleActionPropertyChangeListener.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/ToggleActionPropertyChangeListener.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/WizardDlg.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/WizardDlg.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/WizardDlg.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/WizardDlg.java diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/development/Server16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/development/Server16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/development/Server16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/development/Server16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/development/Server24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/development/Server24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/development/Server24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/development/Server24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/About16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/About16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/About16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/About16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/About24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/About24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/About24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/About24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Delete16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Delete16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Delete16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Delete16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Delete24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Delete24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Delete24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Delete24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Find16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Find16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Find16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Find16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Help16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Help16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Help16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Help16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Help24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Help24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Help24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Help24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/History16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/History16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/History16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/History16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/History24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/History24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/History24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/History24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Information16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Information16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Information16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Information16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Information24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Information24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Information24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Information24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/New16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/New16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/New16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/New16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/New24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/New24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/New24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/New24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Open16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Open16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Open16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Open16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Open24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Open24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Open24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Open24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Save16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Save16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Save16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Save16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Save24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Save24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Save24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Save24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/SaveAs16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/SaveAs16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/SaveAs16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/SaveAs16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/SaveAs24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/SaveAs24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/SaveAs24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/SaveAs24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Zoom16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Zoom16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Zoom16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Zoom16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/ZoomIn16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/ZoomIn16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/ZoomIn16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/ZoomIn16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/ZoomIn24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/ZoomIn24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/ZoomIn24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/ZoomIn24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/navigation/Down16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/navigation/Down16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/navigation/Down16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/navigation/Down16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/navigation/Up16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/navigation/Up16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/navigation/Up16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/navigation/Up16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignCenter16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignCenter16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignCenter16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignCenter16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignCenter24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignCenter24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignCenter24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignCenter24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignLeft16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignLeft16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignLeft16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignLeft16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignLeft24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignLeft24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignLeft24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignLeft24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignRight16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignRight16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignRight16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignRight16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignRight24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignRight24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignRight24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignRight24.gif diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/BsdVtblAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/BsdVtblAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/BsdVtblAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/BsdVtblAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CLHSDB.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CLHSDB.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/DebugServer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/DebugServer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/DebugServer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/DebugServer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HelloWorld.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HelloWorld.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/HelloWorld.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HelloWorld.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotSolarisVtblAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotSolarisVtblAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotSolarisVtblAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotSolarisVtblAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ObjectHistogram.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ObjectHistogram.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ObjectHistogram.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ObjectHistogram.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/RMIHelper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/RMIHelper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/RMIHelper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/RMIHelper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SAGetopt.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SAGetopt.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncher.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncher.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncherLoader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncherLoader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/StackTrace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/StackTrace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/StackTrace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/StackTrace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/Win32VtblAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/Win32VtblAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/Win32VtblAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/Win32VtblAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/Disassembler.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/Disassembler.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/DummySymbolFinder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/DummySymbolFinder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/DummySymbolFinder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/DummySymbolFinder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ImmediateOrRegister.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/ImmediateOrRegister.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ImmediateOrRegister.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/ImmediateOrRegister.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Operand.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/Operand.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Operand.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/Operand.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Register.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/Register.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Register.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/Register.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/SymbolFinder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/SymbolFinder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/SymbolFinder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/SymbolFinder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCArgument.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCArgument.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCArgument.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCArgument.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegister.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegister.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegister.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegister.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisterType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisterType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisterType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisterType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisters.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisters.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisters.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisters.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/c1/Runtime1.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/c1/Runtime1.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/c1/Runtime1.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/c1/Runtime1.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciBaseObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciBaseObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciBaseObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciBaseObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciConstant.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciConstant.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciConstant.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciConstant.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciEnv.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciEnv.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciInstance.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciInstance.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciInstance.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciInstance.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMetadata.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciMetadata.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMetadata.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciMetadata.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciMethod.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciMethod.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciMethodData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciMethodData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciSymbol.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciSymbol.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciSymbol.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciSymbol.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciTypeArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciTypeArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciTypeArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciTypeArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/AdapterBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/AdapterBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/AdapterBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/AdapterBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/BufferBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/BufferBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/BufferBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/BufferBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeCache.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeCache.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCacheVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeCacheVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCacheVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeCacheVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CompressedReadStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CompressedReadStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CompressedReadStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CompressedReadStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CompressedStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CompressedStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CompressedStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CompressedStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CompressedWriteStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CompressedWriteStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CompressedWriteStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CompressedWriteStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantDoubleValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantDoubleValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantDoubleValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantDoubleValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantIntValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantIntValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantIntValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantIntValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantLongValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantLongValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantLongValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantLongValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantOopReadValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantOopReadValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantOopReadValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantOopReadValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInformationRecorder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DebugInformationRecorder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInformationRecorder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DebugInformationRecorder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/Location.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/Location.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/Location.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/Location.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/LocationValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/LocationValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/LocationValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/LocationValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MonitorValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/MonitorValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MonitorValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/MonitorValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/NMethod.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/NMethod.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ObjectValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ObjectValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ObjectValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ObjectValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/PCDesc.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/PCDesc.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/PCDesc.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/PCDesc.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/RuntimeStub.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/RuntimeStub.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/RuntimeStub.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/RuntimeStub.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/SafepointBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SafepointBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/SafepointBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SafepointBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ScopeDesc.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ScopeDesc.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ScopeValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ScopeValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/SingletonBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SingletonBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/SingletonBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SingletonBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/Stub.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/Stub.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/Stub.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/Stub.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/StubQueue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/StubQueue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/StubQueue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/StubQueue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/VMRegImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/VMRegImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/VMRegImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/VMRegImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/CompileTask.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/CompileTask.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapPair.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapPair.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapPair.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapPair.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapSet.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapSet.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapSet.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapSet.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/OopMapStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/OopMapStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Address.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Address.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/AddressException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/AddressException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/AddressException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/AddressException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DataSource.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DataSource.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DataSource.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DataSource.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Debugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Debugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerUtilities.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerUtilities.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerUtilities.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerUtilities.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/InputLexer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/InputLexer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/InputLexer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/InputLexer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/LongHashMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/LongHashMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/LongHashMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/LongHashMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAArch64.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAArch64.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAArch64.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAArch64.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionPPC64.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionPPC64.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionPPC64.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionPPC64.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionTwosComplement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionTwosComplement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionTwosComplement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionTwosComplement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MappedByteBufferDataSource.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MappedByteBufferDataSource.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MappedByteBufferDataSource.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MappedByteBufferDataSource.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/NoSuchSymbolException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/NoSuchSymbolException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/NoSuchSymbolException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/NoSuchSymbolException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/NotInHeapException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/NotInHeapException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/NotInHeapException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/NotInHeapException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/OopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/OopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/OopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/OopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Page.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Page.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Page.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Page.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/PageCache.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/PageCache.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/PageCache.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/PageCache.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/PageFetcher.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/PageFetcher.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/PageFetcher.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/PageFetcher.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ProcessInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ProcessInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ProcessInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ProcessInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/RandomAccessFileDataSource.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/RandomAccessFileDataSource.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/RandomAccessFileDataSource.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/RandomAccessFileDataSource.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ReadResult.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ReadResult.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ReadResult.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ReadResult.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/SymbolLookup.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/SymbolLookup.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/SymbolLookup.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/SymbolLookup.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ThreadAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ThreadAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadProxy.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ThreadProxy.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadProxy.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ThreadProxy.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/UnalignedAddressException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/UnalignedAddressException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/UnalignedAddressException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/UnalignedAddressException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/UnmappedAddressException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/UnmappedAddressException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/UnmappedAddressException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/UnmappedAddressException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdOopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdOopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdOopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdOopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/SharedObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/SharedObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/SharedObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/SharedObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/AccessControl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/AccessControl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/AccessControl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/AccessControl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ArrayType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ArrayType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ArrayType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ArrayType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/BaseClass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/BaseClass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/BaseClass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/BaseClass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/BitType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/BitType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/BitType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/BitType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/BlockSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/BlockSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/BlockSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/BlockSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugInfoDataBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugInfoDataBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugInfoDataBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugInfoDataBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CVAttributes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CVAttributes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CVAttributes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CVAttributes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ClosestSymbol.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ClosestSymbol.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ClosestSymbol.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ClosestSymbol.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CompoundType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CompoundType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CompoundType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CompoundType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/DebugEvent.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/DebugEvent.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/DebugEvent.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/DebugEvent.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/DefaultObjectVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/DefaultObjectVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/DefaultObjectVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/DefaultObjectVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/DoubleType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/DoubleType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/DoubleType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/DoubleType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/EnumType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/EnumType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/EnumType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/EnumType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/Field.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/Field.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/Field.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/Field.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FloatType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FloatType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FloatType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FloatType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/GlobalSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/GlobalSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/GlobalSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/GlobalSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/IndexableFieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/IndexableFieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/IndexableFieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/IndexableFieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/IntType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/IntType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/IntType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/IntType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObjectComparator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObjectComparator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObjectComparator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObjectComparator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LocalSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LocalSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LocalSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LocalSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/MemberFunctionType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/MemberFunctionType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/MemberFunctionType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/MemberFunctionType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/NamedFieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/NamedFieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/NamedFieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/NamedFieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ObjectVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ObjectVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ObjectVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ObjectVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/PointerType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/PointerType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/PointerType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/PointerType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ProcessControl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ProcessControl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ProcessControl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ProcessControl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/RefType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/RefType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/RefType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/RefType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/Sym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/Sym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/Sym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/Sym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/TemplateType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/TemplateType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/TemplateType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/TemplateType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/Type.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/Type.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/Type.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/Type.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/TypeVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/TypeVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/TypeVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/TypeVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/VoidType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/VoidType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/VoidType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/VoidType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicArrayType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicArrayType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicArrayType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicArrayType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBaseClass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBaseClass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBaseClass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBaseClass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBitType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBitType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBitType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBitType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBlockSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBlockSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBlockSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBlockSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCDebugInfoDataBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCDebugInfoDataBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCDebugInfoDataBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCDebugInfoDataBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCompoundType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCompoundType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCompoundType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCompoundType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDebugEvent.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDebugEvent.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDebugEvent.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDebugEvent.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDoubleType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDoubleType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDoubleType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDoubleType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicEnumType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicEnumType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicEnumType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicEnumType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFloatType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFloatType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFloatType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFloatType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicGlobalSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicGlobalSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicGlobalSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicGlobalSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIndexableFieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIndexableFieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIndexableFieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIndexableFieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIntType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIntType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIntType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIntType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberMapping.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberMapping.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberMapping.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberMapping.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLocalSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLocalSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLocalSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLocalSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicMemberFunctionType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicMemberFunctionType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicMemberFunctionType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicMemberFunctionType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicNamedFieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicNamedFieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicNamedFieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicNamedFieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicPointerType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicPointerType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicPointerType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicPointerType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicRefType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicRefType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicRefType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicRefType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicVoidType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicVoidType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicVoidType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicVoidType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/CompoundTypeKind.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/CompoundTypeKind.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/CompoundTypeKind.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/CompoundTypeKind.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyBlockSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyBlockSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyBlockSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyBlockSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/ResolveListener.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/ResolveListener.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/ResolveListener.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/ResolveListener.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyOopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyOopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyOopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyOopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/SharedObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/SharedObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/SharedObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/SharedObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ia64/LinuxIA64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ia64/LinuxIA64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ia64/LinuxIA64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ia64/LinuxIA64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/AddressDataSource.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/AddressDataSource.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/AddressDataSource.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/AddressDataSource.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/DSO.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/DSO.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/DSO.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/DSO.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFile.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFile.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFile.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFile.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFileParser.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFileParser.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFileParser.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFileParser.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHashTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHashTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHashTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHashTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFProgramHeader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFProgramHeader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFProgramHeader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFProgramHeader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSectionHeader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSectionHeader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSectionHeader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSectionHeader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFStringTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFStringTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFStringTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFStringTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSymbol.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSymbol.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSymbol.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSymbol.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ppc64/PPC64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ppc64/PPC64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ppc64/PPC64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ppc64/PPC64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcCDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcCDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcOopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcOopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcOopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcOopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/SharedObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/SharedObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/SharedObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/SharedObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteOopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteOopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteOopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteOopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxBfEfRecord.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxBfEfRecord.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxBfEfRecord.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxBfEfRecord.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFileRecord.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFileRecord.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFileRecord.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFileRecord.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFunctionDefinitionRecord.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFunctionDefinitionRecord.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFunctionDefinitionRecord.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFunctionDefinitionRecord.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSectionDefinitionsRecord.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSectionDefinitionsRecord.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSectionDefinitionsRecord.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSectionDefinitionsRecord.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSymbolRecord.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSymbolRecord.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSymbolRecord.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSymbolRecord.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxWeakExternalRecord.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxWeakExternalRecord.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxWeakExternalRecord.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxWeakExternalRecord.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFile.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFile.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFile.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFile.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFHeader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFHeader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFHeader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFHeader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFLineNumber.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFLineNumber.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFLineNumber.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFLineNumber.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFRelocation.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFRelocation.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFRelocation.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFRelocation.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbol.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbol.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbol.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbol.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbolConstants.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbolConstants.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbolConstants.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbolConstants.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COMDATSelectionTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COMDATSelectionTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COMDATSelectionTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COMDATSelectionTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/Characteristics.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/Characteristics.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/Characteristics.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/Characteristics.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DLLCharacteristics.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DLLCharacteristics.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DLLCharacteristics.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DLLCharacteristics.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DataDirectory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DataDirectory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DataDirectory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DataDirectory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectoryEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectoryEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectoryEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectoryEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50MemberAttributes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50MemberAttributes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50MemberAttributes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50MemberAttributes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50ReservedTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50ReservedTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50ReservedTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50ReservedTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSAlignSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSAlignSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSAlignSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSAlignSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSFileIndex.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSFileIndex.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSFileIndex.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSFileIndex.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalPub.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalPub.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalPub.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalPub.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSLibraries.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSLibraries.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSLibraries.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSLibraries.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSMPC.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSMPC.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSMPC.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSMPC.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSModule.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSModule.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSModule.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSModule.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap16.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap16.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap16.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap16.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap32.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap32.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap32.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap32.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPreComp.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPreComp.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPreComp.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPreComp.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublic.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublic.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublic.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublic.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublicSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublicSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublicSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublicSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegName.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegName.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegName.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegName.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcLnSeg.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcLnSeg.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcLnSeg.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcLnSeg.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcModule.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcModule.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcModule.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcModule.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSStaticSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSStaticSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSStaticSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSStaticSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbolBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbolBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbolBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbolBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbols.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbols.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbols.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbols.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDesc.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDesc.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDesc.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDesc.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDescEnums.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDescEnums.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDescEnums.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDescEnums.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModFileDesc.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModFileDesc.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModFileDesc.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModFileDesc.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModLineNumberMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModLineNumberMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModLineNumberMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModLineNumberMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50Subsection.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50Subsection.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50Subsection.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50Subsection.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionDirectory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionDirectory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionDirectory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionDirectory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolEnums.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolEnums.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolEnums.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolEnums.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolIterator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolIterator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolIterator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolIterator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeEnums.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeEnums.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeEnums.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeEnums.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeIterator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeIterator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeIterator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeIterator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeLeafIndices.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeLeafIndices.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeLeafIndices.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeLeafIndices.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50WrongNumericTypeException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50WrongNumericTypeException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50WrongNumericTypeException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50WrongNumericTypeException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50X86RegisterEnums.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50X86RegisterEnums.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50X86RegisterEnums.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50X86RegisterEnums.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/ExportDirectoryTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/ExportDirectoryTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/ExportDirectoryTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/ExportDirectoryTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/MachineTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/MachineTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/MachineTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/MachineTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderDataDirectories.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderDataDirectories.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderDataDirectories.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderDataDirectories.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderStandardFields.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderStandardFields.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderStandardFields.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderStandardFields.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderWindowsSpecificFields.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderWindowsSpecificFields.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderWindowsSpecificFields.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderWindowsSpecificFields.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionFlags.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionFlags.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionFlags.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionFlags.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionHeader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionHeader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionHeader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionHeader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestDebugInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestDebugInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestDebugInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestDebugInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TypeIndicators.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/TypeIndicators.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TypeIndicators.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/TypeIndicators.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/WindowsNTSubsystem.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/WindowsNTSubsystem.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/WindowsNTSubsystem.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/WindowsNTSubsystem.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/AddressDataSource.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/AddressDataSource.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/AddressDataSource.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/AddressDataSource.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/DLL.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/DLL.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/DLL.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/DLL.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgOopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgOopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgOopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgOopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/AdaptiveFreeList.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/AdaptiveFreeList.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/AdaptiveFreeList.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/AdaptiveFreeList.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/CMSBitMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CMSBitMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/CMSBitMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CMSBitMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/CMSCollector.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CMSCollector.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/CMSCollector.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CMSCollector.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/LinearAllocBlock.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/LinearAllocBlock.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/LinearAllocBlock.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/LinearAllocBlock.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/ParNewGeneration.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/ParNewGeneration.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/ParNewGeneration.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/ParNewGeneration.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1HeapRegionTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1HeapRegionTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1HeapRegionTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1HeapRegionTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1MonitoringSupport.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1MonitoringSupport.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1MonitoringSupport.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1MonitoringSupport.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionManager.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionManager.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionManager.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionManager.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/PSOldGen.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/PSOldGen.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/PSOldGen.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/PSOldGen.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/PSYoungGen.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/PSYoungGen.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/PSYoungGen.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/PSYoungGen.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CardGeneration.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CardGeneration.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CardGeneration.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CardGeneration.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CompactibleSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CompactibleSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CompactibleSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CompactibleSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/G1YCType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/G1YCType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/G1YCType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/G1YCType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GCName.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCName.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GCName.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCName.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GCWhen.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCWhen.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GCWhen.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCWhen.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/Generation.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Generation.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/Generation.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Generation.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenerationIsInClosure.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationIsInClosure.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenerationIsInClosure.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationIsInClosure.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenerationSpec.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationSpec.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenerationSpec.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationSpec.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/OffsetTableContigSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/OffsetTableContigSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/OffsetTableContigSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/OffsetTableContigSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/Space.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Space.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/Space.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Space.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/SpaceClosure.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/SpaceClosure.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/SpaceClosure.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/SpaceClosure.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/Bytecode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/Bytecode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeANewArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeANewArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeANewArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeANewArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeBipush.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeBipush.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeBipush.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeBipush.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeCheckCast.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeCheckCast.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeCheckCast.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeCheckCast.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetPut.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetPut.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetPut.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetPut.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetStatic.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetStatic.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetStatic.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetStatic.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGoto.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGoto.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGoto.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGoto.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGotoW.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGotoW.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGotoW.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGotoW.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeIf.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeIf.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeIf.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeIf.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeIinc.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeIinc.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeIinc.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeIinc.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInstanceOf.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeInstanceOf.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInstanceOf.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeInstanceOf.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeJmp.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeJmp.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeJmp.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeJmp.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsr.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsr.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsr.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsr.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsrW.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsrW.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsrW.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsrW.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoad.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoad.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoad.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoad.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadStore.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadStore.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadStore.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadStore.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLookupswitch.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLookupswitch.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLookupswitch.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLookupswitch.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeMultiANewArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeMultiANewArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeMultiANewArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeMultiANewArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeNew.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeNew.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeNew.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeNew.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeNewArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeNewArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeNewArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeNewArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodePutField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodePutField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodePutField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodePutField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodePutStatic.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodePutStatic.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodePutStatic.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodePutStatic.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeRet.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeRet.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeRet.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeRet.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeSipush.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeSipush.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeSipush.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeSipush.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeStore.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeStore.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeStore.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeStore.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeTableswitch.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeTableswitch.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeTableswitch.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeTableswitch.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWideable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeWideable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWideable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeWideable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Interpreter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/Interpreter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Interpreter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/Interpreter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/InterpreterCodelet.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/InterpreterCodelet.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/InterpreterCodelet.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/InterpreterCodelet.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/LookupswitchPair.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/LookupswitchPair.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/LookupswitchPair.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/LookupswitchPair.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/MaskFillerForNative.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/MaskFillerForNative.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/MaskFillerForNative.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/MaskFillerForNative.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/OffsetClosure.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OffsetClosure.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/OffsetClosure.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OffsetClosure.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/OopMapForCacheEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OopMapForCacheEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/OopMapForCacheEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OopMapForCacheEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ArrayReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ArrayReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/BaseLineInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BaseLineInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/BaseLineInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BaseLineInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/BooleanTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/BooleanTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/BooleanValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/BooleanValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ByteTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ByteTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/CharTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/CharTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassLoaderReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassLoaderReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassLoaderReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassLoaderReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassObjectReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassObjectReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassObjectReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassObjectReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ConcreteMethodImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConcreteMethodImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ConcreteMethodImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConcreteMethodImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/DoubleTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/DoubleTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FloatTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FloatTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/IntegerTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/IntegerTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JNITypeParser.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JNITypeParser.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JNITypeParser.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JNITypeParser.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LineInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LineInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LineInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LineInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LongTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LongTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MirrorImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MirrorImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MirrorImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MirrorImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MonitorInfoImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MonitorInfoImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MonitorInfoImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MonitorInfoImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/NonConcreteMethodImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/NonConcreteMethodImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/NonConcreteMethodImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/NonConcreteMethodImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/PrimitiveTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/PrimitiveTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SACoreAttachingConnector.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SACoreAttachingConnector.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SACoreAttachingConnector.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SACoreAttachingConnector.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SADebugServerAttachingConnector.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServerAttachingConnector.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SADebugServerAttachingConnector.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServerAttachingConnector.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAPIDAttachingConnector.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAPIDAttachingConnector.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAPIDAttachingConnector.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAPIDAttachingConnector.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SDE.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SDE.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SDE.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SDE.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ShortTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ShortTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/StackFrameImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StackFrameImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/StackFrameImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StackFrameImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/StratumLineInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StratumLineInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/StratumLineInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StratumLineInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/StringReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StringReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/StringReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StringReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadGroupReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadGroupReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadGroupReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadGroupReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/TypeComponentImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeComponentImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/TypeComponentImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeComponentImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/TypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/TypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VMModifiers.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VMModifiers.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VMModifiers.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VMModifiers.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ValueContainer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueContainer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ValueContainer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueContainer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VoidTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VoidTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VoidValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VoidValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/AFLBinaryTreeDictionary.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/AFLBinaryTreeDictionary.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/AFLBinaryTreeDictionary.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/AFLBinaryTreeDictionary.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CodeHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/CodeHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CodeHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/CodeHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Dictionary.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/Dictionary.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Dictionary.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/Dictionary.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/FreeChunk.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FreeChunk.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/FreeChunk.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FreeChunk.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/HeapBlock.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/HeapBlock.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/HeapBlock.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/HeapBlock.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/LoaderConstraintEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/LoaderConstraintEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/LoaderConstraintEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/LoaderConstraintEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/LoaderConstraintTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/LoaderConstraintTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/LoaderConstraintTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/LoaderConstraintTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/MemRegion.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/MemRegion.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/MemRegion.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/MemRegion.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/PlaceholderEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/PlaceholderEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/PlaceholderEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/PlaceholderEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/PlaceholderTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/PlaceholderTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/PlaceholderTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/PlaceholderTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ReferenceType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/ReferenceType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ReferenceType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/ReferenceType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/StringTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/StringTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/StringTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/StringTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SymbolTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SymbolTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/Universe.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/Universe.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/VirtualSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/VirtualSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/VirtualSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/VirtualSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/AccessFlags.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/AccessFlags.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/AccessFlags.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/AccessFlags.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Array.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Array.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Array.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Array.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BitData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BitData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BitData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BitData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BooleanField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BooleanField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BooleanField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BooleanField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BranchData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BranchData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BranchData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BranchData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BreakpointInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BreakpointInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BreakpointInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BreakpointInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ByteField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ByteField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ByteField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ByteField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CIntField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CIntField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CIntField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CIntField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CallTypeData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CallTypeData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CellTypeState.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CellTypeState.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CellTypeState.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CellTypeState.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CellTypeStateList.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CellTypeStateList.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CellTypeStateList.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CellTypeStateList.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CharField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CharField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CharField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CharField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CheckedExceptionElement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CheckedExceptionElement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CheckedExceptionElement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CheckedExceptionElement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CompiledICHolder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CompiledICHolder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CompiledICHolder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CompiledICHolder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CompressedLineNumberReadStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CompressedLineNumberReadStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CompressedLineNumberReadStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CompressedLineNumberReadStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstMethod.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstMethod.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CounterData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CounterData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CounterData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CounterData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DataLayout.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DataLayout.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DataLayout.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DataLayout.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultHeapVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DefaultHeapVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultHeapVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DefaultHeapVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultMetadataVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DefaultMetadataVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultMetadataVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DefaultMetadataVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultOopVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DefaultOopVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultOopVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DefaultOopVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DoubleField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DoubleField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DoubleField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DoubleField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ExceptionTableElement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ExceptionTableElement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ExceptionTableElement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ExceptionTableElement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Field.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Field.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Field.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Field.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FieldType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FieldType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FieldType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FieldType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FieldVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FieldVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FieldVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FieldVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FloatField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FloatField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FloatField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FloatField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/HeapPrinter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/HeapPrinter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/HeapPrinter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/HeapPrinter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/HeapVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/HeapVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/HeapVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/HeapVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/IndexableFieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/IndexableFieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/IndexableFieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/IndexableFieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Instance.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Instance.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Instance.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Instance.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceClassLoaderKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceClassLoaderKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceClassLoaderKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceClassLoaderKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceMirrorKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceMirrorKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceMirrorKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceMirrorKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceRefKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceRefKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceRefKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceRefKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/IntField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/IntField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/IntField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/IntField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JVMDIClassStatus.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/JVMDIClassStatus.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JVMDIClassStatus.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/JVMDIClassStatus.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JumpData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/JumpData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JumpData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/JumpData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Klass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Klass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/LineNumberTableElement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/LineNumberTableElement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/LineNumberTableElement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/LineNumberTableElement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/LocalVariableTableElement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/LocalVariableTableElement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/LocalVariableTableElement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/LocalVariableTableElement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/LongField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/LongField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/LongField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/LongField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Mark.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Mark.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Mark.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Mark.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MetadataField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MetadataField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MetadataVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MetadataVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Method.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Method.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodCounters.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodCounters.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodCounters.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodCounters.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MutationException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MutationException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MutationException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MutationException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NamedFieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/NamedFieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NamedFieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/NamedFieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NarrowOopField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/NarrowOopField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NarrowOopField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/NarrowOopField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Oop.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Oop.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopPrinter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopPrinter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopPrinter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopPrinter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopUtilities.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopUtilities.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ProfileData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ProfileData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ProfileData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ProfileData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/RawHeapVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/RawHeapVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/RawHeapVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/RawHeapVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/RetData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/RetData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/RetData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/RetData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ShortField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ShortField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ShortField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ShortField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Symbol.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Symbol.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Symbol.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Symbol.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeEntries.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntries.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeEntries.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntries.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/UnknownOopException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/UnknownOopException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/UnknownOopException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/UnknownOopException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Block.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Block.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block_Array.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Block_Array.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block_Array.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Block_Array.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block_List.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Block_List.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block_List.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Block_List.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallDynamicJavaNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallDynamicJavaNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallDynamicJavaNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallDynamicJavaNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallRuntimeNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallRuntimeNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallRuntimeNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallRuntimeNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallStaticJavaNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallStaticJavaNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallStaticJavaNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallStaticJavaNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Compile.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Compile.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Compile.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Compile.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CompilerPhaseType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CompilerPhaseType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CompilerPhaseType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CompilerPhaseType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/HaltNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/HaltNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/HaltNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/HaltNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/InlineTree.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/InlineTree.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/InlineTree.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/InlineTree.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/JVMState.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/JVMState.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/JVMState.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/JVMState.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/LoopNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/LoopNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/LoopNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/LoopNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallRuntimeNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallRuntimeNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallRuntimeNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallRuntimeNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallStaticJavaNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallStaticJavaNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallStaticJavaNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallStaticJavaNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachIfNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachIfNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachIfNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachIfNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachReturnNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachReturnNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachReturnNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachReturnNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachSafePointNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachSafePointNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachSafePointNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachSafePointNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MultiNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MultiNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MultiNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MultiNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Node.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Node.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node_Array.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Node_Array.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node_Array.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Node_Array.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node_List.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Node_List.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node_List.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Node_List.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Phase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Phase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Phase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Phase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseRegAlloc.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/PhaseRegAlloc.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseRegAlloc.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/PhaseRegAlloc.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhiNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/PhiNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhiNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/PhiNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/ProjNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/ProjNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/ProjNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/ProjNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/RegionNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/RegionNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/RegionNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/RegionNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/RootNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/RootNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/RootNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/RootNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/SafePointNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/SafePointNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/SafePointNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/SafePointNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/TypeNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/TypeNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/TypeNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/TypeNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/prims/JvmtiExport.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/prims/JvmtiExport.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/prims/JvmtiExport.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/prims/JvmtiExport.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ArgumentSizeComputer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ArgumentSizeComputer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ArgumentSizeComputer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ArgumentSizeComputer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Arguments.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Arguments.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Arguments.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Arguments.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicLock.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicLock.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicLock.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicLock.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicObjectLock.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicObjectLock.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicObjectLock.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicObjectLock.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicTypeSize.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicTypeSize.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicTypeSize.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicTypeSize.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Bytes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Bytes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CodeCacheSweeperThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/CodeCacheSweeperThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CodeCacheSweeperThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/CodeCacheSweeperThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompilerThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/CompilerThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompilerThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/CompilerThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ConcurrentLocksPrinter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ConcurrentLocksPrinter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ConcurrentLocksPrinter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ConcurrentLocksPrinter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ConstructionException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ConstructionException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ConstructionException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ConstructionException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ExternalVFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ExternalVFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ExternalVFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ExternalVFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Flags.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Flags.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Flags.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Flags.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Frame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Frame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InstanceConstructor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/InstanceConstructor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InstanceConstructor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/InstanceConstructor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIHandleBlock.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JNIHandleBlock.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIHandleBlock.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JNIHandleBlock.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIHandles.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JNIHandles.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIHandles.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JNIHandles.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIid.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JNIid.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIid.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JNIid.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaCallWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaCallWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaCallWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaCallWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThreadState.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThreadState.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThreadState.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThreadState.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaVFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaVFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaVFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaVFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JvmtiAgentThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JvmtiAgentThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JvmtiAgentThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JvmtiAgentThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/NativeSignatureIterator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/NativeSignatureIterator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/NativeSignatureIterator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/NativeSignatureIterator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/OSThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/OSThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ObjectMonitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectMonitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ObjectMonitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectMonitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/PerfDataPrologue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfDataPrologue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/PerfDataPrologue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfDataPrologue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/PerfMemory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfMemory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/PerfMemory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfMemory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ResultTypeFinder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ResultTypeFinder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ResultTypeFinder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ResultTypeFinder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/SignatureConverter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/SignatureConverter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/SignatureConverter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/SignatureConverter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/SignatureInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/SignatureInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/SignatureInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/SignatureInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/SignatureIterator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/SignatureIterator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/SignatureIterator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/SignatureIterator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackFrameStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackFrameStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackFrameStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackFrameStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StaticBaseConstructor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StaticBaseConstructor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StaticBaseConstructor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StaticBaseConstructor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Threads.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Threads.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMOps.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMOps.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMOps.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMOps.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMReg.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMReg.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMReg.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMReg.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMVersionMismatchException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMVersionMismatchException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMVersionMismatchException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMVersionMismatchException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualBaseConstructor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VirtualBaseConstructor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualBaseConstructor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VirtualBaseConstructor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/WatcherThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/WatcherThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/WatcherThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/WatcherThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64CurrentFrameGuess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64CurrentFrameGuess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64CurrentFrameGuess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64CurrentFrameGuess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64JavaCallWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64JavaCallWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64JavaCallWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64JavaCallWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64RegisterMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64RegisterMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64RegisterMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64RegisterMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64JavaCallWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64JavaCallWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64JavaCallWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64JavaCallWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdX86JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdX86JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdX86JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdX86JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux/LinuxSignals.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux/LinuxSignals.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux/LinuxSignals.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux/LinuxSignals.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_aarch64/LinuxAARCH64JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_aarch64/LinuxAARCH64JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_aarch64/LinuxAARCH64JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_aarch64/LinuxAARCH64JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_ppc64/LinuxPPC64JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_ppc64/LinuxPPC64JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_ppc64/LinuxPPC64JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_ppc64/LinuxPPC64JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_sparc/LinuxSPARCJavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_sparc/LinuxSPARCJavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_sparc/LinuxSPARCJavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_sparc/LinuxSPARCJavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxSignals.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxSignals.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxSignals.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxSignals.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxX86JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxX86JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxX86JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxX86JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/posix/POSIXSignals.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/posix/POSIXSignals.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/posix/POSIXSignals.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/posix/POSIXSignals.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64CurrentFrameGuess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64CurrentFrameGuess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64CurrentFrameGuess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64CurrentFrameGuess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64JavaCallWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64JavaCallWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64JavaCallWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64JavaCallWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64RegisterMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64RegisterMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64RegisterMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64RegisterMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_amd64/SolarisAMD64JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/solaris_amd64/SolarisAMD64JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_amd64/SolarisAMD64JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/solaris_amd64/SolarisAMD64JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_x86/SolarisX86JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/solaris_x86/SolarisX86JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_x86/SolarisX86JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/solaris_x86/SolarisX86JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCRegisterMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCRegisterMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCRegisterMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCRegisterMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/vmSymbols.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/vmSymbols.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/vmSymbols.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/vmSymbols.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/win32_x86/Win32X86JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_x86/Win32X86JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/win32_x86/Win32X86JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_x86/Win32X86JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86CurrentFrameGuess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86CurrentFrameGuess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86CurrentFrameGuess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86CurrentFrameGuess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86JavaCallWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86JavaCallWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86JavaCallWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86JavaCallWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/FlagDumper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/FlagDumper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapDumper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapDumper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JSnap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JSnap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JStack.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JStack.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/StackTrace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/StackTrace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/Tool.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/Tool.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassFilter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassFilter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassFilter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassFilter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/NameFilter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/NameFilter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/NameFilter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/NameFilter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/PackageNameFilter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/PackageNameFilter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/PackageNameFilter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/PackageNameFilter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/AddressField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/AddressField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/AddressField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/AddressField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/CIntegerField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/CIntegerField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/CIntegerField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/CIntegerField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/CIntegerType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/CIntegerType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/CIntegerType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/CIntegerType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Field.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/Field.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Field.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/Field.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JBooleanField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JBooleanField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JBooleanField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JBooleanField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JByteField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JByteField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JByteField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JByteField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JCharField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JCharField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JCharField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JCharField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JDoubleField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JDoubleField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JDoubleField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JDoubleField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JFloatField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JFloatField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JFloatField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JFloatField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JIntField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JIntField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JIntField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JIntField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JLongField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JLongField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JLongField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JLongField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JShortField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JShortField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JShortField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JShortField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/NarrowOopField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/NarrowOopField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/NarrowOopField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/NarrowOopField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/OopField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/OopField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/OopField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/OopField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/PointerType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/PointerType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/PointerType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/PointerType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Type.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/Type.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Type.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/Type.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/TypeDataBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/TypeDataBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/TypeDataBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/TypeDataBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/WrongTypeException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/WrongTypeException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/WrongTypeException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/WrongTypeException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicAddressFieldWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicAddressFieldWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicAddressFieldWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicAddressFieldWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJBooleanField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJBooleanField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJBooleanField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJBooleanField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJByteField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJByteField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJByteField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJByteField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJCharField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJCharField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJCharField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJCharField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJDoubleField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJDoubleField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJDoubleField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJDoubleField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJFloatField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJFloatField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJFloatField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJFloatField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJIntField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJIntField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJIntField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJIntField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJLongField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJLongField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJLongField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJLongField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJShortField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJShortField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJShortField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJShortField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicNarrowOopField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicNarrowOopField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicNarrowOopField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicNarrowOopField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicPointerType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicPointerType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicPointerType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicPointerType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicVtblAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicVtblAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicVtblAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicVtblAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/VtblAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/VtblAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/VtblAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/VtblAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/Annotation.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/Annotation.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/Annotation.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/Annotation.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DeadlockDetectionPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/DeadlockDetectionPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DeadlockDetectionPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/DeadlockDetectionPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/EditableAtEndDocument.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/EditableAtEndDocument.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/EditableAtEndDocument.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/EditableAtEndDocument.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/Editor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/Editor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/Editor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/Editor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/EditorCommands.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/EditorCommands.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/EditorCommands.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/EditorCommands.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/EditorFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/EditorFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/EditorFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/EditorFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindByQueryPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindByQueryPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindByQueryPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindByQueryPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindInCodeCachePanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindInCodeCachePanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindInCodeCachePanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindInCodeCachePanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FrameWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FrameWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FrameWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FrameWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/GraphicsUtilities.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/GraphicsUtilities.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/GraphicsUtilities.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/GraphicsUtilities.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HeapParametersPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/HeapParametersPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HeapParametersPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/HeapParametersPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HistoryComboBox.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/HistoryComboBox.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HistoryComboBox.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/HistoryComboBox.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/Inspector.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/Inspector.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/Inspector.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/Inspector.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JInternalFrameWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JInternalFrameWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JInternalFrameWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JInternalFrameWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JavaStackTracePanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JavaStackTracePanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JavaStackTracePanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JavaStackTracePanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JavaThreadsPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JavaThreadsPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JavaThreadsPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JavaThreadsPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/MemoryPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MemoryPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/MemoryPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MemoryPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/MemoryViewer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MemoryViewer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/MemoryViewer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MemoryViewer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ObjectHistogramPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ObjectHistogramPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ObjectHistogramPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ObjectHistogramPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ObjectListPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ObjectListPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ObjectListPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ObjectListPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ProcessListPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ProcessListPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ProcessListPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ProcessListPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ProgressBarPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ProgressBarPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ProgressBarPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ProgressBarPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAEditorPane.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SAEditorPane.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAEditorPane.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SAEditorPane.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAListener.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SAListener.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAListener.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SAListener.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SAPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SAPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SourceCodePanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SourceCodePanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SourceCodePanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SourceCodePanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/StringTransferable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/StringTransferable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/StringTransferable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/StringTransferable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SysPropsPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SysPropsPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SysPropsPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SysPropsPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ThreadInfoPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ThreadInfoPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ThreadInfoPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ThreadInfoPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/VMFlagsPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/VMFlagsPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/VMFlagsPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/VMFlagsPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/VMVersionInfoPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/VMVersionInfoPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/VMVersionInfoPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/VMVersionInfoPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/FindAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/FindAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/FindAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/FindAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/FindClassesAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/FindClassesAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/FindClassesAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/FindClassesAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/FindCrashesAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/FindCrashesAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/FindCrashesAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/FindCrashesAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/InspectAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/InspectAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/InspectAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/InspectAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/JavaStackTraceAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/JavaStackTraceAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/JavaStackTraceAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/JavaStackTraceAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/MemoryAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/MemoryAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/MemoryAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/MemoryAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/ShowAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/ShowAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/ShowAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/ShowAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/ThreadInfoAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/ThreadInfoAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/ThreadInfoAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/ThreadInfoAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/ClassBrowserPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/ClassBrowserPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/ClassBrowserPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/ClassBrowserPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/CodeViewerPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/CodeViewerPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/CodeViewerPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/CodeViewerPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/resources/arrow.png b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/resources/arrow.png similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/resources/arrow.png rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/resources/arrow.png diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/resources/breakpoint.png b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/resources/breakpoint.png similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/resources/breakpoint.png rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/resources/breakpoint.png diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/resources/triangle.png b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/resources/triangle.png similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/resources/triangle.png rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/resources/triangle.png diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/LongCellRenderer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/LongCellRenderer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/LongCellRenderer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/LongCellRenderer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/SortHeaderCellRenderer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/SortHeaderCellRenderer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/SortHeaderCellRenderer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/SortHeaderCellRenderer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/SortHeaderMouseAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/SortHeaderMouseAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/SortHeaderMouseAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/SortHeaderMouseAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/SortableTableModel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/SortableTableModel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/SortableTableModel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/SortableTableModel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/TableModelComparator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/TableModelComparator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/TableModelComparator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/TableModelComparator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/BadAddressTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/BadAddressTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/BadAddressTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/BadAddressTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/BooleanTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/BooleanTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/BooleanTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/BooleanTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CStringTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/CStringTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CStringTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/CStringTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CTypeTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/CTypeTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CTypeTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/CTypeTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CharTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/CharTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CharTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/CharTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/DoubleTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/DoubleTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/DoubleTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/DoubleTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/FieldTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/FieldTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/FieldTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/FieldTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/FloatTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/FloatTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/FloatTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/FloatTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/LongTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/LongTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/LongTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/LongTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/MetadataTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/MetadataTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/MetadataTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/MetadataTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/RevPtrsTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/RevPtrsTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/RevPtrsTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/RevPtrsTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/RootTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/RootTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/RootTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/RootTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeGroupNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeGroupNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeGroupNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeGroupNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeModel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeModel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeModel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeModel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/AbstractTreeTableModel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/AbstractTreeTableModel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/AbstractTreeTableModel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/AbstractTreeTableModel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/SimpleTreeTableModel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/SimpleTreeTableModel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/SimpleTreeTableModel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/SimpleTreeTableModel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModelAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModelAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModelAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModelAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AddressOps.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AddressOps.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AddressOps.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AddressOps.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AltPlatformInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AltPlatformInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AltPlatformInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AltPlatformInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Assert.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Assert.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Assert.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Assert.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AssertionFailure.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AssertionFailure.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AssertionFailure.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AssertionFailure.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BitMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BitMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BitMapClosure.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMapClosure.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BitMapClosure.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMapClosure.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Bits.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Bits.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Bits.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Bits.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CPPExpressions.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CPPExpressions.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CPPExpressions.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CPPExpressions.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CStringUtilities.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CStringUtilities.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CStringUtilities.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CStringUtilities.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstIterator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ConstIterator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstIterator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ConstIterator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/FindObjectByType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/FindObjectByType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/FindObjectByType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/FindObjectByType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GenericArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/GenericArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GenericArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/GenericArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GenericGrowableArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/GenericGrowableArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GenericGrowableArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/GenericGrowableArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GrowableArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/GrowableArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GrowableArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/GrowableArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Hashtable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Hashtable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGraphWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapGraphWriter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGraphWriter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapGraphWriter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapProgressThunk.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapProgressThunk.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapProgressThunk.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapProgressThunk.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntegerEnum.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntegerEnum.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntegerEnum.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntegerEnum.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Interval.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Interval.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Interval.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Interval.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntervalNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntervalNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntervalNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntervalNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntervalTree.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntervalTree.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntervalTree.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntervalTree.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/KlassArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/KlassArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/KlassArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/KlassArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessAnalysis.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessAnalysis.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessAnalysis.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessAnalysis.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessPath.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessPath.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessPath.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessPath.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessPathElement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessPathElement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessPathElement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessPathElement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessPathList.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessPathList.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessPathList.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessPathList.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MarkBits.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MarkBits.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MarkBits.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MarkBits.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MessageQueue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MessageQueue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MessageQueue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MessageQueue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MessageQueueBackend.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MessageQueueBackend.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MessageQueueBackend.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MessageQueueBackend.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MethodArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MethodArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MethodArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MethodArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ObjectReader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ObjectReader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ObjectReader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ObjectReader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PointerFinder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PointerFinder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PointerFinder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PointerFinder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ProcImageClassLoader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ProcImageClassLoader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ProcImageClassLoader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ProcImageClassLoader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RBColor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RBColor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RBColor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RBColor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RBNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RBNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RBNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RBNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RBTree.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RBTree.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RBTree.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RBTree.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrs.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ReversePtrs.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrs.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ReversePtrs.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/StreamMonitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/StreamMonitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/StreamMonitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/StreamMonitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/SystemDictionaryHelper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/SystemDictionaryHelper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/SystemDictionaryHelper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/SystemDictionaryHelper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/TwoOopHashtable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/TwoOopHashtable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/TwoOopHashtable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/TwoOopHashtable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/U1Array.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/U1Array.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/U1Array.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/U1Array.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/U2Array.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/U2Array.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/U2Array.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/U2Array.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/UnsupportedPlatformException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/UnsupportedPlatformException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/UnsupportedPlatformException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/UnsupportedPlatformException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedBoolean.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedBoolean.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedBoolean.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedBoolean.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedByte.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedByte.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedByte.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedByte.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedChar.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedChar.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedChar.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedChar.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedDouble.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedDouble.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedDouble.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedDouble.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedFloat.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedFloat.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedFloat.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedFloat.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedInt.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedInt.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedInt.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedInt.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedLong.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedLong.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedLong.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedLong.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedShort.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedShort.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedShort.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedShort.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/Callable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/Callable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/Callable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/Callable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/DefaultScriptObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/DefaultScriptObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/DefaultScriptObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/DefaultScriptObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/InvocableCallable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/InvocableCallable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/InvocableCallable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/InvocableCallable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaClass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaClass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaClass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaClass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactoryImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactoryImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactoryImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactoryImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstance.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstance.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstance.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstance.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaMethod.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaMethod.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaMethod.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaMethod.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaScriptEngine.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaScriptEngine.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaScriptEngine.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaScriptEngine.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaString.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaString.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaString.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaString.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaVM.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaVM.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaVM.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaVM.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSList.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSList.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSList.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSList.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSMetadata.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSMetadata.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSMetadata.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSMetadata.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/MapScriptObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/MapScriptObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/MapScriptObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/MapScriptObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/MethodCallable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/MethodCallable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/MethodCallable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/MethodCallable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/ObjectVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/ObjectVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/ObjectVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/ObjectVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/SOQLEngine.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/SOQLEngine.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/SOQLEngine.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/SOQLEngine.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/SOQLException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/SOQLException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/SOQLException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/SOQLException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/SOQLQuery.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/SOQLQuery.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/SOQLQuery.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/SOQLQuery.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/ScriptObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/ScriptObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/ScriptObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/ScriptObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/sa.js similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/sa.js diff --git a/hotspot/agent/src/share/native/sadis.c b/hotspot/src/jdk.hotspot.agent/share/native/libsaproc/sadis.c similarity index 100% rename from hotspot/agent/src/share/native/sadis.c rename to hotspot/src/jdk.hotspot.agent/share/native/libsaproc/sadis.c diff --git a/hotspot/agent/src/os/solaris/proc/libproc.h b/hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/libproc.h similarity index 100% rename from hotspot/agent/src/os/solaris/proc/libproc.h rename to hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/libproc.h diff --git a/hotspot/agent/src/os/solaris/proc/salibproc.h b/hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/salibproc.h similarity index 100% rename from hotspot/agent/src/os/solaris/proc/salibproc.h rename to hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/salibproc.h diff --git a/hotspot/agent/src/os/solaris/proc/saproc.cpp b/hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/saproc.cpp similarity index 100% rename from hotspot/agent/src/os/solaris/proc/saproc.cpp rename to hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/saproc.cpp diff --git a/hotspot/agent/src/os/solaris/proc/saproc_audit.cpp b/hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/saproc_audit.cpp similarity index 100% rename from hotspot/agent/src/os/solaris/proc/saproc_audit.cpp rename to hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/saproc_audit.cpp diff --git a/hotspot/agent/test/jdi/README.jjh b/hotspot/src/jdk.hotspot.agent/test/jdi/README.jjh similarity index 100% rename from hotspot/agent/test/jdi/README.jjh rename to hotspot/src/jdk.hotspot.agent/test/jdi/README.jjh diff --git a/hotspot/agent/test/jdi/SASanityChecker.java b/hotspot/src/jdk.hotspot.agent/test/jdi/SASanityChecker.java similarity index 100% rename from hotspot/agent/test/jdi/SASanityChecker.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/SASanityChecker.java diff --git a/hotspot/agent/test/jdi/TEST.ROOT b/hotspot/src/jdk.hotspot.agent/test/jdi/TEST.ROOT similarity index 100% rename from hotspot/agent/test/jdi/TEST.ROOT rename to hotspot/src/jdk.hotspot.agent/test/jdi/TEST.ROOT diff --git a/hotspot/agent/test/jdi/TargetAdapter.java b/hotspot/src/jdk.hotspot.agent/test/jdi/TargetAdapter.java similarity index 100% rename from hotspot/agent/test/jdi/TargetAdapter.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/TargetAdapter.java diff --git a/hotspot/agent/test/jdi/TargetListener.java b/hotspot/src/jdk.hotspot.agent/test/jdi/TargetListener.java similarity index 100% rename from hotspot/agent/test/jdi/TargetListener.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/TargetListener.java diff --git a/hotspot/agent/test/jdi/TestScaffold.java b/hotspot/src/jdk.hotspot.agent/test/jdi/TestScaffold.java similarity index 100% rename from hotspot/agent/test/jdi/TestScaffold.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/TestScaffold.java diff --git a/hotspot/agent/test/jdi/VMConnection.java b/hotspot/src/jdk.hotspot.agent/test/jdi/VMConnection.java similarity index 100% rename from hotspot/agent/test/jdi/VMConnection.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/VMConnection.java diff --git a/hotspot/agent/test/jdi/jstack.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/jstack.sh similarity index 100% rename from hotspot/agent/test/jdi/jstack.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/jstack.sh diff --git a/hotspot/agent/test/jdi/jstack64.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/jstack64.sh similarity index 100% rename from hotspot/agent/test/jdi/jstack64.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/jstack64.sh diff --git a/hotspot/agent/test/jdi/multivm.java b/hotspot/src/jdk.hotspot.agent/test/jdi/multivm.java similarity index 100% rename from hotspot/agent/test/jdi/multivm.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/multivm.java diff --git a/hotspot/agent/test/jdi/multivm.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/multivm.sh similarity index 100% rename from hotspot/agent/test/jdi/multivm.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/multivm.sh diff --git a/hotspot/agent/test/jdi/runjdb.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/runjdb.sh similarity index 100% rename from hotspot/agent/test/jdi/runjdb.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/runjdb.sh diff --git a/hotspot/agent/test/jdi/runjpda.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/runjpda.sh similarity index 100% rename from hotspot/agent/test/jdi/runjpda.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/runjpda.sh diff --git a/hotspot/agent/test/jdi/runsa.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/runsa.sh similarity index 100% rename from hotspot/agent/test/jdi/runsa.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/runsa.sh diff --git a/hotspot/agent/test/jdi/sagclient.java b/hotspot/src/jdk.hotspot.agent/test/jdi/sagclient.java similarity index 100% rename from hotspot/agent/test/jdi/sagclient.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/sagclient.java diff --git a/hotspot/agent/test/jdi/sagdoit.java b/hotspot/src/jdk.hotspot.agent/test/jdi/sagdoit.java similarity index 100% rename from hotspot/agent/test/jdi/sagdoit.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/sagdoit.java diff --git a/hotspot/agent/test/jdi/sagtarg.java b/hotspot/src/jdk.hotspot.agent/test/jdi/sagtarg.java similarity index 100% rename from hotspot/agent/test/jdi/sagtarg.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/sagtarg.java diff --git a/hotspot/agent/test/jdi/sagtest.java b/hotspot/src/jdk.hotspot.agent/test/jdi/sagtest.java similarity index 100% rename from hotspot/agent/test/jdi/sagtest.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/sagtest.java diff --git a/hotspot/agent/test/jdi/sasanity.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/sasanity.sh similarity index 100% rename from hotspot/agent/test/jdi/sasanity.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/sasanity.sh diff --git a/hotspot/agent/test/jdi/serialvm.java b/hotspot/src/jdk.hotspot.agent/test/jdi/serialvm.java similarity index 100% rename from hotspot/agent/test/jdi/serialvm.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/serialvm.java diff --git a/hotspot/agent/test/jdi/serialvm.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/serialvm.sh similarity index 100% rename from hotspot/agent/test/jdi/serialvm.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/serialvm.sh diff --git a/hotspot/agent/test/libproc/LibprocClient.java b/hotspot/src/jdk.hotspot.agent/test/libproc/LibprocClient.java similarity index 100% rename from hotspot/agent/test/libproc/LibprocClient.java rename to hotspot/src/jdk.hotspot.agent/test/libproc/LibprocClient.java diff --git a/hotspot/agent/test/libproc/LibprocTest.java b/hotspot/src/jdk.hotspot.agent/test/libproc/LibprocTest.java similarity index 100% rename from hotspot/agent/test/libproc/LibprocTest.java rename to hotspot/src/jdk.hotspot.agent/test/libproc/LibprocTest.java diff --git a/hotspot/agent/test/libproc/Makefile b/hotspot/src/jdk.hotspot.agent/test/libproc/Makefile similarity index 100% rename from hotspot/agent/test/libproc/Makefile rename to hotspot/src/jdk.hotspot.agent/test/libproc/Makefile diff --git a/hotspot/agent/test/libproc/README b/hotspot/src/jdk.hotspot.agent/test/libproc/README similarity index 100% rename from hotspot/agent/test/libproc/README rename to hotspot/src/jdk.hotspot.agent/test/libproc/README diff --git a/hotspot/agent/test/libproc/libproctest.sh b/hotspot/src/jdk.hotspot.agent/test/libproc/libproctest.sh similarity index 100% rename from hotspot/agent/test/libproc/libproctest.sh rename to hotspot/src/jdk.hotspot.agent/test/libproc/libproctest.sh diff --git a/hotspot/agent/test/libproc/libproctest64.sh b/hotspot/src/jdk.hotspot.agent/test/libproc/libproctest64.sh similarity index 100% rename from hotspot/agent/test/libproc/libproctest64.sh rename to hotspot/src/jdk.hotspot.agent/test/libproc/libproctest64.sh diff --git a/hotspot/agent/src/os/win32/windbg/sawindbg.cpp b/hotspot/src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp similarity index 100% rename from hotspot/agent/src/os/win32/windbg/sawindbg.cpp rename to hotspot/src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp From dfa133a79676cd0b4b6cba7cf91f8ae7f1a8dda9 Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Wed, 23 Dec 2015 13:12:46 +0300 Subject: [PATCH 176/228] 8067194: Restructure hotspot/agent/src to conform the modular source layout Move sources under jdk.hotspot.agent Reviewed-by: ihse, erikj, jbachorik --- jdk/make/gensrc/Gensrc-jdk.jdi.gmk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/make/gensrc/Gensrc-jdk.jdi.gmk b/jdk/make/gensrc/Gensrc-jdk.jdi.gmk index 9fd609f5fb0..036388395fc 100644 --- a/jdk/make/gensrc/Gensrc-jdk.jdi.gmk +++ b/jdk/make/gensrc/Gensrc-jdk.jdi.gmk @@ -70,7 +70,7 @@ endef # Filter com.sun.jdi.connect.Connector $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector: \ $(JDK_TOPDIR)/src/jdk.jdi/share/classes/META-INF/services/com.sun.jdi.connect.Connector \ - $(HOTSPOT_TOPDIR)/agent/src/share/classes/META-INF/services/com.sun.jdi.connect.Connector + $(HOTSPOT_TOPDIR)/src/jdk.hotspot.agent/share/classes/META-INF/services/com.sun.jdi.connect.Connector $(process-provider) # Copy the same service file into jdk.hotspot.agent so that they are kept the same. From f42b84bc7e27fe99d8e56b06d3bfb93f8242242a Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Wed, 23 Dec 2015 13:02:15 -0500 Subject: [PATCH 177/228] 8042660: vm/mlvm/anonloader/stress/byteMutation failed with: assert(index >=0 && index < _length) failed: symbol index overflow Detect zero length signatures and throw ClassFormatError before bad dereference occurs Reviewed-by: coleenp, lfoltan, acorn, gtriantafill --- .../share/vm/classfile/classFileParser.cpp | 16 ++- .../classFileParserBug/BadNameAndType.java | 57 ++++++++ .../classFileParserBug/emptyNameUtf8.jcod | 131 ++++++++++++++++++ .../classFileParserBug/emptySigUtf8.jcod | 131 ++++++++++++++++++ 4 files changed, 329 insertions(+), 6 deletions(-) create mode 100644 hotspot/test/runtime/classFileParserBug/BadNameAndType.java create mode 100644 hotspot/test/runtime/classFileParserBug/emptyNameUtf8.jcod create mode 100644 hotspot/test/runtime/classFileParserBug/emptySigUtf8.jcod diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index cd4518cf201..08bc677ad0c 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -567,6 +567,9 @@ void ClassFileParser::parse_constant_pool(const ClassFileStream* const stream, const int name_index = cp->name_ref_index_at(index); const Symbol* const name = cp->symbol_at(name_index); const Symbol* const sig = cp->symbol_at(sig_index); + guarantee_property(sig->utf8_length() != 0, + "Illegal zero length constant pool entry at %d in class %s", + sig_index, CHECK); if (sig->byte_at(0) == JVM_SIGNATURE_FUNC) { verify_legal_method_signature(name, sig, CHECK); } else { @@ -593,8 +596,9 @@ void ClassFileParser::parse_constant_pool(const ClassFileStream* const stream, verify_legal_field_name(name, CHECK); if (_need_verify && _major_version >= JAVA_7_VERSION) { // Signature is verified above, when iterating NameAndType_info. - // Need only to be sure it's the right type. - if (signature->byte_at(0) == JVM_SIGNATURE_FUNC) { + // Need only to be sure it's non-zero length and the right type. + if (signature->utf8_length() == 0 || + signature->byte_at(0) == JVM_SIGNATURE_FUNC) { throwIllegalSignature( "Field", name, signature, CHECK); } @@ -605,8 +609,9 @@ void ClassFileParser::parse_constant_pool(const ClassFileStream* const stream, verify_legal_method_name(name, CHECK); if (_need_verify && _major_version >= JAVA_7_VERSION) { // Signature is verified above, when iterating NameAndType_info. - // Need only to be sure it's the right type. - if (signature->byte_at(0) != JVM_SIGNATURE_FUNC) { + // Need only to be sure it's non-zero length and the right type. + if (signature->utf8_length() == 0 || + signature->byte_at(0) != JVM_SIGNATURE_FUNC) { throwIllegalSignature( "Method", name, signature, CHECK); } @@ -617,8 +622,7 @@ void ClassFileParser::parse_constant_pool(const ClassFileStream* const stream, // 4509014: If a class method name begins with '<', it must be "". assert(name != NULL, "method name in constant pool is null"); const unsigned int name_len = name->utf8_length(); - assert(name_len > 0, "bad method name"); // already verified as legal name - if (name->byte_at(0) == '<') { + if (name_len != 0 && name->byte_at(0) == '<') { if (name != vmSymbols::object_initializer_name()) { classfile_parse_error( "Bad method name at constant pool index %u in class file %s", diff --git a/hotspot/test/runtime/classFileParserBug/BadNameAndType.java b/hotspot/test/runtime/classFileParserBug/BadNameAndType.java new file mode 100644 index 00000000000..03efc1c7d38 --- /dev/null +++ b/hotspot/test/runtime/classFileParserBug/BadNameAndType.java @@ -0,0 +1,57 @@ +/* + * 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 8042660 + * @summary Constant pool NameAndType entries must point to non-zero length Utf8 strings + * @compile emptySigUtf8.jcod + * @compile emptyNameUtf8.jcod + * @run main/othervm -Xverify:all BadNameAndType + */ + +// Test that a constant pool NameAndType descriptor_index and/or name_index +// that points to a zero length Utf8 string causes a ClassFormatError. +public class BadNameAndType { + public static void main(String args[]) throws Throwable { + + System.out.println("Regression test for bug 8042660"); + + // Test descriptor_index pointing to zero-length string. + try { + Class newClass = Class.forName("emptySigUtf8"); + throw new RuntimeException("Expected ClassFormatError exception not thrown"); + } catch (java.lang.ClassFormatError e) { + System.out.println("Test BadNameAndType passed test case emptySigUtf8"); + } + + // Test name_index pointing to zero-length string. + try { + Class newClass = Class.forName("emptyNameUtf8"); + throw new RuntimeException("Expected ClassFormatError exception not thrown"); + } catch (java.lang.ClassFormatError e) { + System.out.println("Test BadNameAndType passed test case emptyNameUtf8"); + } + } +} diff --git a/hotspot/test/runtime/classFileParserBug/emptyNameUtf8.jcod b/hotspot/test/runtime/classFileParserBug/emptyNameUtf8.jcod new file mode 100644 index 00000000000..9d5664f8657 --- /dev/null +++ b/hotspot/test/runtime/classFileParserBug/emptyNameUtf8.jcod @@ -0,0 +1,131 @@ +/* + * 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. + * + */ + +// This class has an illegal NameAndType at constant pool #4. It's illegal because +// the Utf8 that it points to at #27 is a zero length string which is not a valid +// name. Loading this class should cause a ClassFormatError exception. +class emptyNameUtf8 { + 0xCAFEBABE; + 0; // minor version + 52; // version + [29] { // Constant Pool + ; // first element is empty + Method #6 #15; // #1 at 0x0A + Field #16 #17; // #2 at 0x0F + String #18; // #3 at 0x14 + NameAndType #27 #28; // #4 at 0x9F + class #21; // #5 at 0x1C + class #22; // #6 at 0x1F + Utf8 ""; // #7 at 0x22 + Utf8 "()V"; // #8 at 0x2B + Utf8 "Code"; // #9 at 0x2E + Utf8 "LineNumberTable"; // #10 at 0x35 + Utf8 "main"; // #11 at 0x47 + Utf8 "([Ljava/lang/String;)V"; // #12 at 0x4E + Utf8 "SourceFile"; // #13 at 0x67 + Utf8 "emptyNameUtf8.java"; // #14 at 0x74 + NameAndType #7 #8; // #15 at 0x81 + class #23; // #16 at 0x86 + NameAndType #24 #25; // #17 at 0x89 + Utf8 "Hello World"; // #18 at 0x8E + class #26; // #19 at 0x9C + Method #19 #4; // #20 at 0x17 + Utf8 "emptyNameUtf8"; // #21 at 0xA4 + Utf8 "java/lang/Object"; // #22 at 0xAC + Utf8 "java/lang/System"; // #23 at 0xBF + Utf8 "out"; // #24 at 0xD2 + Utf8 "Ljava/io/PrintStream;"; // #25 at 0xD8 + Utf8 "java/io/PrintStream"; // #26 at 0xF0 + Utf8 ""; // #27 at 0x0106 + Utf8 "()V"; // #28 at 0x0110 + } // Constant Pool + + 0x0021; // access + #5;// this_cpx + #6;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // fields + } // fields + + [2] { // methods + { // Member at 0x0134 + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [1] { // Attributes + Attr(#9, 29) { // Code at 0x013C + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0153 + [1] { // LineNumberTable + 0 2; // at 0x015F + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member at 0x015F + 0x0009; // access + #11; // name_cpx + #12; // sig_cpx + [1] { // Attributes + Attr(#9, 37) { // Code at 0x0167 + 2; // max_stack + 1; // max_locals + Bytes[9]{ + 0xB200021203B60004; + 0xB1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 10) { // LineNumberTable at 0x0182 + [2] { // LineNumberTable + 0 4; // at 0x018E + 8 5; // at 0x0192 + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [1] { // Attributes + Attr(#13, 2) { // SourceFile at 0x0194 + #14; + } // end SourceFile + } // Attributes +} // end class emptyNameUtf8 diff --git a/hotspot/test/runtime/classFileParserBug/emptySigUtf8.jcod b/hotspot/test/runtime/classFileParserBug/emptySigUtf8.jcod new file mode 100644 index 00000000000..cf5b040c6b7 --- /dev/null +++ b/hotspot/test/runtime/classFileParserBug/emptySigUtf8.jcod @@ -0,0 +1,131 @@ +/* + * 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. + * + */ + +// This class has an illegal NameAndType at constant pool #4. It's illegal because +// the type that it points to at #28 is a zero length Utf8 string which is not a +// valid signature. Loading this class should cause a ClassFormatError exception. +class emptySigUtf8 { + 0xCAFEBABE; + 0; // minor version + 52; // version + [29] { // Constant Pool + ; // first element is empty + Method #6 #15; // #1 at 0x0A + Field #16 #17; // #2 at 0x0F + String #18; // #3 at 0x14 + NameAndType #27 #28; // #4 at 0x9F + class #21; // #5 at 0x1C + class #22; // #6 at 0x1F + Utf8 ""; // #7 at 0x22 + Utf8 "()V"; // #8 at 0x2B + Utf8 "Code"; // #9 at 0x2E + Utf8 "LineNumberTable"; // #10 at 0x35 + Utf8 "main"; // #11 at 0x47 + Utf8 "([Ljava/lang/String;)V"; // #12 at 0x4E + Utf8 "SourceFile"; // #13 at 0x67 + Utf8 "emptySigUtf8.java"; // #14 at 0x74 + NameAndType #7 #8; // #15 at 0x81 + class #23; // #16 at 0x86 + NameAndType #24 #25; // #17 at 0x89 + Utf8 "Hello World"; // #18 at 0x8E + class #26; // #19 at 0x9C + Method #19 #4; // #20 at 0x17 + Utf8 "emptySigUtf8"; // #21 at 0xA4 + Utf8 "java/lang/Object"; // #22 at 0xAC + Utf8 "java/lang/System"; // #23 at 0xBF + Utf8 "out"; // #24 at 0xD2 + Utf8 "Ljava/io/PrintStream;"; // #25 at 0xD8 + Utf8 "java/io/PrintStream"; // #26 at 0xF0 + Utf8 "hi"; // #27 at 0x0106 + Utf8 ""; // #28 at 0x0110 + } // Constant Pool + + 0x0021; // access + #5;// this_cpx + #6;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // fields + } // fields + + [2] { // methods + { // Member at 0x0134 + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [1] { // Attributes + Attr(#9, 29) { // Code at 0x013C + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0153 + [1] { // LineNumberTable + 0 2; // at 0x015F + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member at 0x015F + 0x0009; // access + #11; // name_cpx + #12; // sig_cpx + [1] { // Attributes + Attr(#9, 37) { // Code at 0x0167 + 2; // max_stack + 1; // max_locals + Bytes[9]{ + 0xB200021203B60004; + 0xB1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 10) { // LineNumberTable at 0x0182 + [2] { // LineNumberTable + 0 4; // at 0x018E + 8 5; // at 0x0192 + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [1] { // Attributes + Attr(#13, 2) { // SourceFile at 0x0194 + #14; + } // end SourceFile + } // Attributes +} // end class emptySigUtf8 From de7d9e821cc1a3e470d4cee59cf9444fd969f06a Mon Sep 17 00:00:00 2001 From: Max Ockner Date: Wed, 23 Dec 2015 15:05:38 -0500 Subject: [PATCH 178/228] 8144874: Reimplement TraceClassResolution with Unified Logging TraceClassResolution reimplemented with classresolve tag. Reviewed-by: coleenp, dholmes, iklam, rprotacio --- hotspot/src/share/vm/classfile/classFileParser.cpp | 6 +++--- .../src/share/vm/classfile/verificationType.cpp | 4 ++-- hotspot/src/share/vm/classfile/verifier.cpp | 8 ++++---- hotspot/src/share/vm/classfile/verifier.hpp | 2 +- hotspot/src/share/vm/logging/logTag.hpp | 1 + hotspot/src/share/vm/oops/constantPool.cpp | 6 +++--- hotspot/src/share/vm/prims/jni.cpp | 6 +++--- hotspot/src/share/vm/prims/jvm.cpp | 14 +++++++------- hotspot/src/share/vm/runtime/arguments.cpp | 2 ++ hotspot/src/share/vm/runtime/globals.hpp | 3 --- hotspot/src/share/vm/runtime/reflection.cpp | 8 ++++---- hotspot/test/runtime/verifier/TraceClassRes.java | 2 +- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index cd4518cf201..011827dde7f 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -5369,12 +5369,12 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, TRAPS) { } } - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { ResourceMark rm; // print out the superclass. const char * from = ik->external_name(); if (ik->java_super() != NULL) { - tty->print("RESOLVE %s %s (super)\n", + log_info(classresolve)("%s %s (super)", from, ik->java_super()->external_name()); } @@ -5385,7 +5385,7 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, TRAPS) { for (int i = 0; i < length; i++) { const Klass* const k = local_interfaces->at(i); const char * to = k->external_name(); - tty->print("RESOLVE %s %s (interface)\n", from, to); + log_info(classresolve)("%s %s (interface)", from, to); } } } diff --git a/hotspot/src/share/vm/classfile/verificationType.cpp b/hotspot/src/share/vm/classfile/verificationType.cpp index 96f4970be08..2d26c47e2ba 100644 --- a/hotspot/src/share/vm/classfile/verificationType.cpp +++ b/hotspot/src/share/vm/classfile/verificationType.cpp @@ -61,7 +61,7 @@ bool VerificationType::is_reference_assignable_from( Klass* obj = SystemDictionary::resolve_or_fail( name(), Handle(THREAD, klass->class_loader()), Handle(THREAD, klass->protection_domain()), true, CHECK_false); - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { Verifier::trace_class_resolution(obj, klass()); } @@ -80,7 +80,7 @@ bool VerificationType::is_reference_assignable_from( Klass* from_class = SystemDictionary::resolve_or_fail( from.name(), Handle(THREAD, klass->class_loader()), Handle(THREAD, klass->protection_domain()), true, CHECK_false); - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { Verifier::trace_class_resolution(from_class, klass()); } return InstanceKlass::cast(from_class)->is_subclass_of(this_class()); diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index 5db828ce66e..6a49093918a 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -106,9 +106,9 @@ void Verifier::trace_class_resolution(Klass* resolve_class, InstanceKlass* verif const char* resolve = resolve_class->external_name(); // print in a single call to reduce interleaving between threads if (source_file != NULL) { - tty->print("RESOLVE %s %s %s (verification)\n", verify, resolve, source_file); + log_info(classresolve)("%s %s %s (verification)", verify, resolve, source_file); } else { - tty->print("RESOLVE %s %s (verification)\n", verify, resolve); + log_info(classresolve)("%s %s (verification)", verify, resolve); } } @@ -206,7 +206,7 @@ bool Verifier::verify(instanceKlassHandle klass, Verifier::Mode mode, bool shoul ResourceMark rm(THREAD); instanceKlassHandle kls = SystemDictionary::resolve_or_fail(exception_name, true, CHECK_false); - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { Verifier::trace_class_resolution(kls(), klass()); } @@ -1992,7 +1992,7 @@ Klass* ClassVerifier::load_class(Symbol* name, TRAPS) { name, Handle(THREAD, loader), Handle(THREAD, protection_domain), true, THREAD); - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { instanceKlassHandle cur_class = current_class(); Verifier::trace_class_resolution(kls, cur_class()); } diff --git a/hotspot/src/share/vm/classfile/verifier.hpp b/hotspot/src/share/vm/classfile/verifier.hpp index 8580cddbe41..531ef93f21a 100644 --- a/hotspot/src/share/vm/classfile/verifier.hpp +++ b/hotspot/src/share/vm/classfile/verifier.hpp @@ -61,7 +61,7 @@ class Verifier : AllStatic { // Relax certain verifier checks to enable some broken 1.1 apps to run on 1.2. static bool relax_verify_for(oop class_loader); - // Print output for -XX:+TraceClassResolution + // Print output for classresolve static void trace_class_resolution(Klass* resolve_class, InstanceKlass* verify_class); private: diff --git a/hotspot/src/share/vm/logging/logTag.hpp b/hotspot/src/share/vm/logging/logTag.hpp index 02304afe98b..f723b3548d7 100644 --- a/hotspot/src/share/vm/logging/logTag.hpp +++ b/hotspot/src/share/vm/logging/logTag.hpp @@ -37,6 +37,7 @@ LOG_TAG(bot) \ LOG_TAG(census) \ LOG_TAG(classhisto) \ + LOG_TAG(classresolve) \ LOG_TAG(classinit) \ LOG_TAG(comp) \ LOG_TAG(compaction) \ diff --git a/hotspot/src/share/vm/oops/constantPool.cpp b/hotspot/src/share/vm/oops/constantPool.cpp index ceb76f571f4..26b5e3abe07 100644 --- a/hotspot/src/share/vm/oops/constantPool.cpp +++ b/hotspot/src/share/vm/oops/constantPool.cpp @@ -204,11 +204,11 @@ void ConstantPool::trace_class_resolution(const constantPoolHandle& this_cp, Kla if (k() != this_cp->pool_holder()) { // only print something if the classes are different if (source_file != NULL) { - tty->print("RESOLVE %s %s %s:%d\n", + log_info(classresolve)("%s %s %s:%d", this_cp->pool_holder()->external_name(), k->external_name(), source_file, line_number); } else { - tty->print("RESOLVE %s %s\n", + log_info(classresolve)("%s %s", this_cp->pool_holder()->external_name(), k->external_name()); } @@ -277,7 +277,7 @@ Klass* ConstantPool::klass_at_impl(const constantPoolHandle& this_cp, int which, ClassLoaderData* this_key = this_cp->pool_holder()->class_loader_data(); this_key->record_dependency(k(), CHECK_NULL); // Can throw OOM - if (TraceClassResolution && !k->is_array_klass()) { + if (log_is_enabled(Info, classresolve) && !k->is_array_klass()) { // skip resolving the constant pool so that this code gets // called the next time some bytecodes refer to this class. trace_class_resolution(this_cp, k); diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index a0f5665d276..54d8248e718 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -345,7 +345,7 @@ JNI_ENTRY(jclass, jni_DefineClass(JNIEnv *env, const char *name, jobject loaderR &st, CHECK_NULL); - if (TraceClassResolution && k != NULL) { + if (log_is_enabled(Info, classresolve) && k != NULL) { trace_class_resolution(k); } @@ -415,7 +415,7 @@ JNI_ENTRY(jclass, jni_FindClass(JNIEnv *env, const char *name)) result = find_class_from_class_loader(env, sym, true, loader, protection_domain, true, thread); - if (TraceClassResolution && result != NULL) { + if (log_is_enabled(Info, classresolve) && result != NULL) { trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result))); } @@ -3277,7 +3277,7 @@ static jclass lookupOne(JNIEnv* env, const char* name, TRAPS) { TempNewSymbol sym = SymbolTable::new_symbol(name, CHECK_NULL); jclass result = find_class_from_class_loader(env, sym, true, loader, protection_domain, true, CHECK_NULL); - if (TraceClassResolution && result != NULL) { + if (log_is_enabled(Info, classresolve) && result != NULL) { trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result))); } return result; diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index c867df135c1..afbb1daee44 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -206,9 +206,9 @@ static void trace_class_resolution_impl(Klass* to_class, TRAPS) { const char * to = to_class->external_name(); // print in a single call to reduce interleaving between threads if (source_file != NULL) { - tty->print("RESOLVE %s %s %s:%d (%s)\n", from, to, source_file, line_number, trace); + log_info(classresolve)("%s %s %s:%d (%s)", from, to, source_file, line_number, trace); } else { - tty->print("RESOLVE %s %s (%s)\n", from, to, trace); + log_info(classresolve)("%s %s (%s)", from, to, trace); } } } @@ -835,7 +835,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromBootLoader(JNIEnv* env, return NULL; } - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { trace_class_resolution(k); } return (jclass) JNIHandles::make_local(env, k->java_mirror()); @@ -872,7 +872,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromCaller(JNIEnv* env, const char* name, jclass result = find_class_from_class_loader(env, h_name, init, h_loader, h_prot, false, THREAD); - if (TraceClassResolution && result != NULL) { + if (log_is_enabled(Info, classresolve) && result != NULL) { trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result))); } return result; @@ -902,7 +902,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromClass(JNIEnv *env, const char *name, jclass result = find_class_from_class_loader(env, h_name, init, h_loader, h_prot, true, thread); - if (TraceClassResolution && result != NULL) { + if (log_is_enabled(Info, classresolve) && result != NULL) { // this function is generally only used for class loading during verification. ResourceMark rm; oop from_mirror = JNIHandles::resolve_non_null(from); @@ -912,7 +912,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromClass(JNIEnv *env, const char *name, oop mirror = JNIHandles::resolve_non_null(result); Klass* to_class = java_lang_Class::as_Klass(mirror); const char * to = to_class->external_name(); - tty->print("RESOLVE %s %s (verification)\n", from_name, to); + log_info(classresolve)("%s %s (verification)", from_name, to); } return result; @@ -980,7 +980,7 @@ static jclass jvm_define_class_common(JNIEnv *env, const char *name, &st, CHECK_NULL); - if (TraceClassResolution && k != NULL) { + if (log_is_enabled(Info, classresolve) && k != NULL) { trace_class_resolution(k); } diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 334f6eadb33..7fc37d0865c 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -400,6 +400,8 @@ static AliasedFlag const aliased_jvm_flags[] = { }; static AliasedFlag const aliased_jvm_logging_flags[] = { + { "-XX:+TraceClassResolution", "-Xlog:classresolve=info"}, + { "-XX:-TraceClassResolution", "-Xlog:classresolve=off"}, { "-XX:+TraceExceptions", "-Xlog:exceptions=info" }, { "-XX:-TraceExceptions", "-Xlog:exceptions=off" }, { "-XX:+TraceMonitorInflation", "-Xlog:monitorinflation=debug" }, diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 25d94b07eb8..9a444cb7c1d 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1496,9 +1496,6 @@ public: develop(bool, TraceClearedExceptions, false, \ "Print when an exception is forcibly cleared") \ \ - product(bool, TraceClassResolution, false, \ - "Trace all constant pool resolutions (for debugging)") \ - \ product(bool, TraceBiasedLocking, false, \ "Trace biased locking in JVM") \ \ diff --git a/hotspot/src/share/vm/runtime/reflection.cpp b/hotspot/src/share/vm/runtime/reflection.cpp index dcd90d7980c..5c12e122566 100644 --- a/hotspot/src/share/vm/runtime/reflection.cpp +++ b/hotspot/src/share/vm/runtime/reflection.cpp @@ -74,9 +74,9 @@ static void trace_class_resolution(const Klass* to_class) { const char * to = to_class->external_name(); // print in a single call to reduce interleaving between threads if (source_file != NULL) { - tty->print("RESOLVE %s %s %s:%d (reflection)\n", from, to, source_file, line_number); + log_info(classresolve)("%s %s %s:%d (reflection)", from, to, source_file, line_number); } else { - tty->print("RESOLVE %s %s (reflection)\n", from, to); + log_info(classresolve)("%s %s (reflection)", from, to); } } } @@ -599,7 +599,7 @@ static oop get_mirror_from_signature(methodHandle method, Handle(THREAD, protection_domain), true, CHECK_NULL); - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { trace_class_resolution(k); } return k->java_mirror(); @@ -654,7 +654,7 @@ static Handle new_type(Symbol* signature, KlassHandle k, TRAPS) { Handle(THREAD, k->protection_domain()), true, CHECK_(Handle())); - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { trace_class_resolution(result); } diff --git a/hotspot/test/runtime/verifier/TraceClassRes.java b/hotspot/test/runtime/verifier/TraceClassRes.java index 153a0908bfc..ef18a5cfe4e 100644 --- a/hotspot/test/runtime/verifier/TraceClassRes.java +++ b/hotspot/test/runtime/verifier/TraceClassRes.java @@ -38,7 +38,7 @@ public class TraceClassRes { "-XX:+TraceClassResolution", "-verify", "-Xshare:off", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("RESOLVE java.lang.ClassLoader java.lang.Throwable ClassLoader.java (verification)"); + output.shouldContain("[classresolve] java.lang.ClassLoader java.lang.Throwable ClassLoader.java (verification)"); output.shouldHaveExitValue(0); } } From 384ecfad72e7675637547748cfcee144a30f550d Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Wed, 23 Dec 2015 20:07:39 +0000 Subject: [PATCH 179/228] 8146011: sun/management/jmxremote/bootstrap/CustomLauncherTest crash at assert(stack_size) We were setting stack_overflow_limit before initialization completed which may change the stack base for some solaris systems with unlimited stack Reviewed-by: goetz, hseigel, gthornbr --- hotspot/src/share/vm/runtime/thread.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 160f61226c1..94b363d774b 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -306,10 +306,6 @@ void Thread::clear_thread_current() { void Thread::record_stack_base_and_size() { set_stack_base(os::current_stack_base()); set_stack_size(os::current_stack_size()); - if (is_Java_thread()) { - ((JavaThread*) this)->set_stack_overflow_limit(); - ((JavaThread*) this)->set_reserved_stack_activation(stack_base()); - } // CR 7190089: on Solaris, primordial thread's stack is adjusted // in initialize_thread(). Without the adjustment, stack size is // incorrect if stack is set to unlimited (ulimit -s unlimited). @@ -318,6 +314,11 @@ void Thread::record_stack_base_and_size() { // set up any platform-specific state. os::initialize_thread(this); + // Set stack limits after thread is initialized. + if (is_Java_thread()) { + ((JavaThread*) this)->set_stack_overflow_limit(); + ((JavaThread*) this)->set_reserved_stack_activation(stack_base()); + } #if INCLUDE_NMT // record thread's native stack, stack grows downward MemTracker::record_thread_stack(stack_end(), stack_size()); From dbab9fe1f8c1cbe5264b6a0d98c7bb1834d83bb5 Mon Sep 17 00:00:00 2001 From: Rachel Protacio Date: Wed, 23 Dec 2015 17:12:04 -0500 Subject: [PATCH 180/228] 8145606: [TESTBUG] MonitorInflationTest.java should be rewritten to be more predictable Logging/MonitorInflationTest.java now forced an object inflation and looks for that object. It no longer tests for object deflation. Reviewed-by: gtriantafill, coleenp, iklam --- .../runtime/logging/MonitorInflationTest.java | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/hotspot/test/runtime/logging/MonitorInflationTest.java b/hotspot/test/runtime/logging/MonitorInflationTest.java index 07ff1c3b864..7399ea6dce9 100644 --- a/hotspot/test/runtime/logging/MonitorInflationTest.java +++ b/hotspot/test/runtime/logging/MonitorInflationTest.java @@ -26,7 +26,6 @@ * @bug 8133885 * @summary monitorinflation=debug should have logging from each of the statements in the code * @library /testlibrary - * @ignore 8145587 * @modules java.base/sun.misc * java.management * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools @@ -40,7 +39,8 @@ public class MonitorInflationTest { static void analyzeOutputOn(ProcessBuilder pb) throws Exception { OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Inflating object"); - output.shouldContain("Deflating object "); + output.shouldContain("type MonitorInflationTest$Waiter"); + output.shouldContain("I've been waiting."); output.shouldHaveExitValue(0); } @@ -52,19 +52,34 @@ public class MonitorInflationTest { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:monitorinflation=debug", "-version"); + "-Xlog:monitorinflation=debug", InnerClass.class.getName()); analyzeOutputOn(pb); pb = ProcessTools.createJavaProcessBuilder( - "-XX:+TraceMonitorInflation", "-version"); + "-XX:+TraceMonitorInflation", InnerClass.class.getName()); analyzeOutputOn(pb); pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:monitorinflation=off", "-version"); + "-Xlog:monitorinflation=off", InnerClass.class.getName()); analyzeOutputOff(pb); pb = ProcessTools.createJavaProcessBuilder( - "-XX:-TraceMonitorInflation", "-version"); + "-XX:-TraceMonitorInflation", InnerClass.class.getName()); analyzeOutputOff(pb); } + + public static class Waiter { + public static void foo() { + System.out.println("I've been waiting."); + } + } + public static class InnerClass { + public static void main(String[] args) throws Exception { + Waiter w = new Waiter(); + synchronized (w) { + w.wait(100); + w.foo(); + } + } + } } From 4d2c80f12e15f29d5cd4245a9f7b06f696dc122e Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Thu, 24 Dec 2015 07:35:18 -0800 Subject: [PATCH 181/228] 8146098: Visual Studio build fails after SA restructure Reviewed-by: goetz, hseigel, dsamersoff --- hotspot/make/windows/makefiles/projectcreator.make | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/make/windows/makefiles/projectcreator.make b/hotspot/make/windows/makefiles/projectcreator.make index e6a19e818d0..e48a07b14dc 100644 --- a/hotspot/make/windows/makefiles/projectcreator.make +++ b/hotspot/make/windows/makefiles/projectcreator.make @@ -104,6 +104,7 @@ ProjectCreatorIDEOptions=\ -define ALIGN_STACK_FRAMES \ -define VM_LITTLE_ENDIAN \ -prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) set JAVA_HOME=$(HOTSPOTJDKDIST) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LD_VER)" \ + -ignorePath src\jdk.hotspot.agent \ -ignoreFile jsig.c \ -ignoreFile jvmtiEnvRecommended.cpp \ -ignoreFile jvmtiEnvStub.cpp \ From 3767315e7505313e9be9943cd8e6b3e3ad91cc0a Mon Sep 17 00:00:00 2001 From: Hui Shi Date: Sun, 27 Dec 2015 05:15:14 -0800 Subject: [PATCH 182/228] 8144993: Elide redundant memory barrier after AllocationNode Elide memory barrier for AllocationNode when it doesn't escape in initializer and has an MemBarRelease node at exit of initializer method. Reviewed-by: aph, mdoerr, goetz, kvn, asiebenborn --- hotspot/src/share/vm/opto/callnode.cpp | 18 ++++++++++++++++++ hotspot/src/share/vm/opto/callnode.hpp | 9 +++++++++ hotspot/src/share/vm/opto/macro.cpp | 17 +++++++++++++---- hotspot/src/share/vm/opto/parse1.cpp | 8 ++++++++ 4 files changed, 48 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/opto/callnode.cpp b/hotspot/src/share/vm/opto/callnode.cpp index 581b6d3bd67..ffdf6a2d29b 100644 --- a/hotspot/src/share/vm/opto/callnode.cpp +++ b/hotspot/src/share/vm/opto/callnode.cpp @@ -1333,6 +1333,7 @@ AllocateNode::AllocateNode(Compile* C, const TypeFunc *atype, init_flags(Flag_is_macro); _is_scalar_replaceable = false; _is_non_escaping = false; + _is_allocation_MemBar_redundant = false; Node *topnode = C->top(); init_req( TypeFunc::Control , ctrl ); @@ -1347,6 +1348,23 @@ AllocateNode::AllocateNode(Compile* C, const TypeFunc *atype, C->add_macro_node(this); } +void AllocateNode::compute_MemBar_redundancy(ciMethod* initializer) +{ + assert(initializer != NULL && + initializer->is_initializer() && + !initializer->is_static(), + "unexpected initializer method"); + BCEscapeAnalyzer* analyzer = initializer->get_bcea(); + if (analyzer == NULL) { + return; + } + + // Allocation node is first parameter in its initializer + if (analyzer->is_arg_stack(0) || analyzer->is_arg_local(0)) { + _is_allocation_MemBar_redundant = true; + } +} + //============================================================================= Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) { if (remove_dead_region(phase, can_reshape)) return this; diff --git a/hotspot/src/share/vm/opto/callnode.hpp b/hotspot/src/share/vm/opto/callnode.hpp index 40f939a1160..cbe9d90e773 100644 --- a/hotspot/src/share/vm/opto/callnode.hpp +++ b/hotspot/src/share/vm/opto/callnode.hpp @@ -858,6 +858,8 @@ public: // Result of Escape Analysis bool _is_scalar_replaceable; bool _is_non_escaping; + // True when MemBar for new is redundant with MemBar at initialzer exit + bool _is_allocation_MemBar_redundant; virtual uint size_of() const; // Size is bigger AllocateNode(Compile* C, const TypeFunc *atype, Node *ctrl, Node *mem, Node *abio, @@ -923,6 +925,13 @@ public: InitializeNode* init = NULL; return _is_non_escaping || (((init = initialization()) != NULL) && init->does_not_escape()); } + + // If object doesn't escape in <.init> method and there is memory barrier + // inserted at exit of its <.init>, memory barrier for new is not necessary. + // Inovke this method when MemBar at exit of initializer and post-dominate + // allocation node. + void compute_MemBar_redundancy(ciMethod* initializer); + bool is_allocation_MemBar_redundant() { return _is_allocation_MemBar_redundant; } }; //------------------------------AllocateArray--------------------------------- diff --git a/hotspot/src/share/vm/opto/macro.cpp b/hotspot/src/share/vm/opto/macro.cpp index 4551560a6e4..93c93b58206 100644 --- a/hotspot/src/share/vm/opto/macro.cpp +++ b/hotspot/src/share/vm/opto/macro.cpp @@ -1522,11 +1522,20 @@ void PhaseMacroExpand::expand_allocate_common( // If initialization is performed by an array copy, any required // MemBarStoreStore was already added. If the object does not - // escape no need for a MemBarStoreStore. Otherwise we need a - // MemBarStoreStore so that stores that initialize this object - // can't be reordered with a subsequent store that makes this - // object accessible by other threads. + // escape no need for a MemBarStoreStore. If the object does not + // escape in its initializer and memory barrier (MemBarStoreStore or + // stronger) is already added at exit of initializer, also no need + // for a MemBarStoreStore. Otherwise we need a MemBarStoreStore + // so that stores that initialize this object can't be reordered + // with a subsequent store that makes this object accessible by + // other threads. + // Other threads include java threads and JVM internal threads + // (for example concurrent GC threads). Current concurrent GC + // implementation: CMS and G1 will not scan newly created object, + // so it's safe to skip storestore barrier when allocation does + // not escape. if (!alloc->does_not_escape_thread() && + !alloc->is_allocation_MemBar_redundant() && (init == NULL || !init->is_complete_with_arraycopy())) { if (init == NULL || init->req() < InitializeNode::RawStores) { // No InitializeNode or no stores captured by zeroing diff --git a/hotspot/src/share/vm/opto/parse1.cpp b/hotspot/src/share/vm/opto/parse1.cpp index 77154c5da07..e051b5e1e5c 100644 --- a/hotspot/src/share/vm/opto/parse1.cpp +++ b/hotspot/src/share/vm/opto/parse1.cpp @@ -962,6 +962,14 @@ void Parse::do_exits() { PPC64_ONLY(wrote_volatile() ||) (AlwaysSafeConstructors && wrote_fields()))) { _exits.insert_mem_bar(Op_MemBarRelease, alloc_with_final()); + + // If Memory barrier is created for final fields write + // and allocation node does not escape the initialize method, + // then barrier introduced by allocation node can be removed. + if (DoEscapeAnalysis && alloc_with_final()) { + AllocateNode *alloc = AllocateNode::Ideal_allocation(alloc_with_final(), &_gvn); + alloc->compute_MemBar_redundancy(method()); + } if (PrintOpto && (Verbose || WizardMode)) { method()->print_name(); tty->print_cr(" writes finals and needs a memory barrier"); From 1b5adfa94972145cfed63141e65605d1dca8a1be Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Mon, 28 Dec 2015 13:48:43 -0500 Subject: [PATCH 183/228] 8071507: (ref) Clear phantom reference as soft and weak references do GC clears phantom refs on notification; update spec accordingly. Reviewed-by: mchung, jmasa --- hotspot/src/share/vm/gc/shared/referenceProcessor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp index 1b71b4d3d29..58e73f237ed 100644 --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp @@ -235,7 +235,7 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( // Final references { - GCTraceTime(Debug, gc, ref) tt("FinalReference", gc_timer); + GCTraceTime(Debug, gc, ref) tt("FinalReference", gc_timer); process_discovered_reflist(_discoveredFinalRefs, NULL, false, is_alive, keep_alive, complete_gc, task_executor); } @@ -243,7 +243,7 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( // Phantom references { GCTraceTime(Debug, gc, ref) tt("PhantomReference", gc_timer); - process_discovered_reflist(_discoveredPhantomRefs, NULL, false, + process_discovered_reflist(_discoveredPhantomRefs, NULL, true, is_alive, keep_alive, complete_gc, task_executor); // Process cleaners, but include them in phantom timing. We expect From 08dadf30159430877399bab7724bab1b57e8b3f9 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Mon, 28 Dec 2015 14:03:39 -0500 Subject: [PATCH 184/228] 8071507: (ref) Clear phantom reference as soft and weak references do GC clears phantom refs on notification; update spec accordingly. Reviewed-by: mchung, jmasa --- .../java/lang/ref/PhantomReference.java | 25 ++--- .../classes/java/lang/ref/package-info.java | 21 +--- .../lang/ref/PhantomReferentClearing.java | 101 ++++++++++++++++++ 3 files changed, 117 insertions(+), 30 deletions(-) create mode 100644 jdk/test/java/lang/ref/PhantomReferentClearing.java diff --git a/jdk/src/java.base/share/classes/java/lang/ref/PhantomReference.java b/jdk/src/java.base/share/classes/java/lang/ref/PhantomReference.java index 88fe8fe9fa1..b79e3385a7f 100644 --- a/jdk/src/java.base/share/classes/java/lang/ref/PhantomReference.java +++ b/jdk/src/java.base/share/classes/java/lang/ref/PhantomReference.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, 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 @@ -29,23 +29,20 @@ package java.lang.ref; /** * Phantom reference objects, which are enqueued after the collector * determines that their referents may otherwise be reclaimed. Phantom - * references are most often used for scheduling pre-mortem cleanup actions in - * a more flexible way than is possible with the Java finalization mechanism. + * references are most often used to schedule post-mortem cleanup actions. * - *

    If the garbage collector determines at a certain point in time that the - * referent of a phantom reference is phantom reachable, then at that - * time or at some later time it will enqueue the reference. + *

    Suppose the garbage collector determines at a certain point in time + * that an object is + * phantom reachable. At that time it will atomically clear + * all phantom references to that object and all phantom references to + * any other phantom-reachable objects from which that object is reachable. + * At the same time or at some later time it will enqueue those newly-cleared + * phantom references that are registered with reference queues. * *

    In order to ensure that a reclaimable object remains so, the referent of * a phantom reference may not be retrieved: The {@code get} method of a * phantom reference always returns {@code null}. * - *

    Unlike soft and weak references, phantom references are not - * automatically cleared by the garbage collector as they are enqueued. An - * object that is reachable via phantom references will remain so until all - * such references are cleared or themselves become unreachable. - * * @author Mark Reinhold * @since 1.2 */ @@ -69,8 +66,8 @@ public class PhantomReference extends Reference { * *

    It is possible to create a phantom reference with a {@code null} * queue, but such a reference is completely useless: Its {@code get} - * method will always return null and, since it does not have a queue, it - * will never be enqueued. + * method will always return {@code null} and, since it does not have a queue, + * it will never be enqueued. * * @param referent the object the new phantom reference will refer to * @param q the queue with which the reference is to be registered, diff --git a/jdk/src/java.base/share/classes/java/lang/ref/package-info.java b/jdk/src/java.base/share/classes/java/lang/ref/package-info.java index a6273a92183..0922d3b11c8 100644 --- a/jdk/src/java.base/share/classes/java/lang/ref/package-info.java +++ b/jdk/src/java.base/share/classes/java/lang/ref/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -43,8 +43,7 @@ * implementing memory-sensitive caches, weak references are for * implementing canonicalizing mappings that do not prevent their keys * (or values) from being reclaimed, and phantom references are for - * scheduling pre-mortem cleanup actions in a more flexible way than - * is possible with the Java finalization mechanism. + * scheduling post-mortem cleanup actions. * *

    Each reference-object type is implemented by a subclass of the * abstract base {@link java.lang.ref.Reference} class. @@ -64,9 +63,9 @@ * object with a reference queue at the time the reference * object is created. Some time after the garbage collector * determines that the reachability of the referent has changed to the - * value corresponding to the type of the reference, it will add the - * reference to the associated queue. At this point, the reference is - * considered to be enqueued. The program may remove + * value corresponding to the type of the reference, it will clear the + * reference and add it to the associated queue. At this point, the + * reference is considered to be enqueued. The program may remove * references from a queue either by polling or by blocking until a * reference becomes available. Reference queues are implemented by * the {@link java.lang.ref.ReferenceQueue} class. @@ -92,16 +91,6 @@ * structure, this check will add little overhead to the hashtable * access methods. * - *

    Automatically-cleared references

    - * - * Soft and weak references are automatically cleared by the collector - * before being added to the queues with which they are registered, if - * any. Therefore soft and weak references need not be registered - * with a queue in order to be useful, while phantom references do. - * An object that is reachable via phantom references will remain so - * until all such references are cleared or themselves become - * unreachable. - * * *

    Reachability

    * diff --git a/jdk/test/java/lang/ref/PhantomReferentClearing.java b/jdk/test/java/lang/ref/PhantomReferentClearing.java new file mode 100644 index 00000000000..7d126c7b23d --- /dev/null +++ b/jdk/test/java/lang/ref/PhantomReferentClearing.java @@ -0,0 +1,101 @@ +/* + * 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 8071507 + * @summary Test that PhantomReferences are cleared when notified. + * @run main/othervm PhantomReferentClearing + */ + +import java.lang.ref.PhantomReference; +import java.lang.ref.ReferenceQueue; +import java.util.ArrayList; +import java.util.List; + +public class PhantomReferentClearing { + + private static final long ENQUEUE_TIMEOUT = 1000; // 1 sec, in millis + + // P1 & P2 are PhantomReference objects + // O1 & O2 are objects + // + // -> is a strong reference + // => is a referent reference + // + // root -> P1 + // root -> P2 + // root -> O1 + // root -> O2 + // O1 -> O2 + // P1 => O1 + // P2 => O2 + // + // (1) Remove root -> O1 and collect. P1 notified, P2 !notified. + // (2) Remove root -> O2 and collect. + // + // If phantom references are cleared when notified, as proposed by + // 8071507, then P2 should be notified, and the test passes. + // + // Otherwise, P2 does not get notified because it remains reachable + // from O1, which is being retained by P1. This fails the test. + + private static final ReferenceQueue Q1 = new ReferenceQueue<>(); + private static final ReferenceQueue Q2 = new ReferenceQueue<>(); + + private static volatile Object O2 = new Object(); + private static volatile List O1 = new ArrayList<>(); + static { + O1.add(O2); + } + + private static final PhantomReference P1 = new PhantomReference<>(O1, Q1); + private static final PhantomReference P2 = new PhantomReference<>(O2, Q2); + + public static void main(String[] args) throws InterruptedException { + + // Collect, and verify neither P1 or P2 notified. + System.gc(); + if (Q1.remove(ENQUEUE_TIMEOUT) != null) { + throw new RuntimeException("P1 already notified"); + } else if (Q2.poll() != null) { + throw new RuntimeException("P2 already notified"); + } + + // Delete root -> O1, collect, verify P1 notified, P2 not notified. + O1 = null; + System.gc(); + if (Q1.remove(ENQUEUE_TIMEOUT) == null) { + throw new RuntimeException("P1 not notified by O1 deletion"); + } else if (Q2.remove(ENQUEUE_TIMEOUT) != null) { + throw new RuntimeException("P2 notified by O1 deletion."); + } + + // Delete root -> O2, collect. P2 should be notified. + O2 = null; + System.gc(); + if (Q2.remove(ENQUEUE_TIMEOUT) == null) { + throw new RuntimeException("P2 not notified by O2 deletion"); + } + } +} From 7763f8d12ddcd440bf84d0e643dc4d9d303c4266 Mon Sep 17 00:00:00 2001 From: Kishor Kharbas Date: Mon, 28 Dec 2015 22:28:49 -0800 Subject: [PATCH 185/228] 8143925: Enhancing CounterMode.crypt() for AES Add intrinsic for CounterMode.crypt() to leverage the parallel nature of AES in Counter(CTR) Mode. Reviewed-by: kvn, ascarpino --- .../com/sun/crypto/provider/CounterMode.java | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java index af52bd74474..684be4f0d76 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java @@ -26,7 +26,9 @@ package com.sun.crypto.provider; import java.security.InvalidKeyException; +import java.util.Objects; +import jdk.internal.HotSpotIntrinsicCandidate; /** * This class represents ciphers in counter (CTR) mode. @@ -138,7 +140,7 @@ final class CounterMode extends FeedbackCipher { * cipherOffset. * * @param in the buffer with the input data to be encrypted - * @param inOffset the offset in plain + * @param inOff the offset in plain * @param len the length of the input data * @param out the buffer for the result * @param outOff the offset in cipher @@ -170,6 +172,15 @@ final class CounterMode extends FeedbackCipher { * are encrypted on demand. */ private int crypt(byte[] in, int inOff, int len, byte[] out, int outOff) { + + cryptBlockCheck(in, inOff, len); + cryptBlockCheck(out, outOff, len); + return implCrypt(in, inOff, len, out, outOff); + } + + // Implementation of crpyt() method. Possibly replaced with a compiler intrinsic. + @HotSpotIntrinsicCandidate + private int implCrypt(byte[] in, int inOff, int len, byte[] out, int outOff) { int result = len; while (len-- > 0) { if (used >= blockSize) { @@ -181,4 +192,23 @@ final class CounterMode extends FeedbackCipher { } return result; } + + // Used to perform all checks required by the Java semantics + // (i.e., null checks and bounds checks) on the input parameters to crypt(). + // Normally, the Java Runtime performs these checks, however, as crypt() is + // possibly replaced with compiler intrinsic, the JDK performs the + // required checks instead. + // Does not check accesses to class-internal (private) arrays. + private static void cryptBlockCheck(byte[] array, int offset, int len) { + Objects.requireNonNull(array); + + if (offset < 0 || len < 0 || offset >= array.length) { + throw new ArrayIndexOutOfBoundsException(offset); + } + + int largestIndex = offset + len - 1; + if (largestIndex < 0 || largestIndex >= array.length) { + throw new ArrayIndexOutOfBoundsException(largestIndex); + } + } } From 4e6b2ee594f59a385eabe738c5525ad009ee3a3c Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Tue, 29 Dec 2015 11:54:21 +0100 Subject: [PATCH 186/228] 8145913: PPC64: add Montgomery multiply intrinsic Reviewed-by: aph, goetz --- hotspot/src/cpu/ppc/vm/assembler_ppc.hpp | 2 + .../src/cpu/ppc/vm/assembler_ppc.inline.hpp | 2 + hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp | 6 + hotspot/src/cpu/ppc/vm/ppc.ad | 14 +- hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp | 244 ++++++++++++++++++ hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp | 9 + .../vm/templateInterpreterGenerator_ppc.cpp | 8 +- hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp | 7 + 8 files changed, 281 insertions(+), 11 deletions(-) diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp index 41cb7a16316..035bd4abf26 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp @@ -1224,6 +1224,8 @@ class Assembler : public AbstractAssembler { inline void mullw_( Register d, Register a, Register b); inline void mulhw( Register d, Register a, Register b); inline void mulhw_( Register d, Register a, Register b); + inline void mulhwu( Register d, Register a, Register b); + inline void mulhwu_(Register d, Register a, Register b); inline void mulhd( Register d, Register a, Register b); inline void mulhd_( Register d, Register a, Register b); inline void mulhdu( Register d, Register a, Register b); diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp index 2a4b03f760b..9248ae5cb6f 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp @@ -117,6 +117,8 @@ inline void Assembler::mullw( Register d, Register a, Register b) { emit_int32( inline void Assembler::mullw_( Register d, Register a, Register b) { emit_int32(MULLW_OPCODE | rt(d) | ra(a) | rb(b) | oe(0) | rc(1)); } inline void Assembler::mulhw( Register d, Register a, Register b) { emit_int32(MULHW_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); } inline void Assembler::mulhw_( Register d, Register a, Register b) { emit_int32(MULHW_OPCODE | rt(d) | ra(a) | rb(b) | rc(1)); } +inline void Assembler::mulhwu( Register d, Register a, Register b) { emit_int32(MULHWU_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); } +inline void Assembler::mulhwu_(Register d, Register a, Register b) { emit_int32(MULHWU_OPCODE | rt(d) | ra(a) | rb(b) | rc(1)); } inline void Assembler::mulhd( Register d, Register a, Register b) { emit_int32(MULHD_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); } inline void Assembler::mulhd_( Register d, Register a, Register b) { emit_int32(MULHD_OPCODE | rt(d) | ra(a) | rb(b) | rc(1)); } inline void Assembler::mulhdu( Register d, Register a, Register b) { emit_int32(MULHDU_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); } diff --git a/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp b/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp index 9bfe48dd887..a9fe522671c 100644 --- a/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp @@ -49,4 +49,10 @@ void Compile::pd_compiler2_init() { if (!VM_Version::has_isel() && FLAG_IS_DEFAULT(ConditionalMoveLimit)) { FLAG_SET_ERGO(intx, ConditionalMoveLimit, 0); } + + if (OptimizeFill) { + warning("OptimizeFill is not supported on this CPU."); + FLAG_SET_DEFAULT(OptimizeFill, false); + } + } diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 682474c05a3..870f7425de6 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -10897,16 +10897,16 @@ instruct partialSubtypeCheck(iRegPdst result, iRegP_N2P subklass, iRegP_N2P supe // inlined locking and unlocking -instruct cmpFastLock(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{ +instruct cmpFastLock(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2) %{ match(Set crx (FastLock oop box)); - effect(TEMP tmp1, TEMP tmp2, TEMP tmp3); + effect(TEMP tmp1, TEMP tmp2); predicate(!Compile::current()->use_rtm()); - format %{ "FASTLOCK $oop, $box, $tmp1, $tmp2, $tmp3" %} + format %{ "FASTLOCK $oop, $box, $tmp1, $tmp2" %} ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); __ compiler_fast_lock_object($crx$$CondRegister, $oop$$Register, $box$$Register, - $tmp3$$Register, $tmp1$$Register, $tmp2$$Register, + $tmp1$$Register, $tmp2$$Register, /*tmp3*/ R0, UseBiasedLocking && !UseOptoBiasInlining); // If locking was successfull, crx should indicate 'EQ'. // The compiler generates a branch to the runtime call to @@ -10925,7 +10925,7 @@ instruct cmpFastLock_tm(flagsReg crx, iRegPdst oop, rarg2RegP box, iRegPdst tmp1 ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); __ compiler_fast_lock_object($crx$$CondRegister, $oop$$Register, $box$$Register, - $tmp3$$Register, $tmp1$$Register, $tmp2$$Register, + $tmp1$$Register, $tmp2$$Register, $tmp3$$Register, /*Biased Locking*/ false, _rtm_counters, _stack_rtm_counters, ((Method*)(ra_->C->method()->constant_encoding()))->method_data(), @@ -10946,7 +10946,7 @@ instruct cmpFastUnlock(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); __ compiler_fast_unlock_object($crx$$CondRegister, $oop$$Register, $box$$Register, - $tmp3$$Register, $tmp1$$Register, $tmp2$$Register, + $tmp1$$Register, $tmp2$$Register, $tmp3$$Register, UseBiasedLocking && !UseOptoBiasInlining, false); // If unlocking was successfull, crx should indicate 'EQ'. @@ -10965,7 +10965,7 @@ instruct cmpFastUnlock_tm(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); __ compiler_fast_unlock_object($crx$$CondRegister, $oop$$Register, $box$$Register, - $tmp3$$Register, $tmp1$$Register, $tmp2$$Register, + $tmp1$$Register, $tmp2$$Register, $tmp3$$Register, /*Biased Locking*/ false, /*TM*/ true); // If unlocking was successfull, crx should indicate 'EQ'. // The compiler generates a branch to the runtime call to diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp index ec9f568516e..60d6bfc6202 100644 --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp @@ -44,6 +44,8 @@ #include "opto/runtime.hpp" #endif +#include + #define __ masm-> #ifdef PRODUCT @@ -3251,3 +3253,245 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha return RuntimeStub::new_runtime_stub(name, &buffer, frame_complete, frame_size_in_bytes/wordSize, oop_maps, true); } + + +//------------------------------Montgomery multiplication------------------------ +// + +// Subtract 0:b from carry:a. Return carry. +static unsigned long +sub(unsigned long a[], unsigned long b[], unsigned long carry, long len) { + long i = 0; + unsigned long tmp, tmp2; + __asm__ __volatile__ ( + "subfc %[tmp], %[tmp], %[tmp] \n" // pre-set CA + "mtctr %[len] \n" + "0: \n" + "ldx %[tmp], %[i], %[a] \n" + "ldx %[tmp2], %[i], %[b] \n" + "subfe %[tmp], %[tmp2], %[tmp] \n" // subtract extended + "stdx %[tmp], %[i], %[a] \n" + "addi %[i], %[i], 8 \n" + "bdnz 0b \n" + "addme %[tmp], %[carry] \n" // carry + CA - 1 + : [i]"+b"(i), [tmp]"=&r"(tmp), [tmp2]"=&r"(tmp2) + : [a]"r"(a), [b]"r"(b), [carry]"r"(carry), [len]"r"(len) + : "ctr", "xer", "memory" + ); + return tmp; +} + +// Multiply (unsigned) Long A by Long B, accumulating the double- +// length result into the accumulator formed of T0, T1, and T2. +inline void MACC(unsigned long A, unsigned long B, unsigned long &T0, unsigned long &T1, unsigned long &T2) { + unsigned long hi, lo; + __asm__ __volatile__ ( + "mulld %[lo], %[A], %[B] \n" + "mulhdu %[hi], %[A], %[B] \n" + "addc %[T0], %[T0], %[lo] \n" + "adde %[T1], %[T1], %[hi] \n" + "addze %[T2], %[T2] \n" + : [hi]"=&r"(hi), [lo]"=&r"(lo), [T0]"+r"(T0), [T1]"+r"(T1), [T2]"+r"(T2) + : [A]"r"(A), [B]"r"(B) + : "xer" + ); +} + +// As above, but add twice the double-length result into the +// accumulator. +inline void MACC2(unsigned long A, unsigned long B, unsigned long &T0, unsigned long &T1, unsigned long &T2) { + unsigned long hi, lo; + __asm__ __volatile__ ( + "mulld %[lo], %[A], %[B] \n" + "mulhdu %[hi], %[A], %[B] \n" + "addc %[T0], %[T0], %[lo] \n" + "adde %[T1], %[T1], %[hi] \n" + "addze %[T2], %[T2] \n" + "addc %[T0], %[T0], %[lo] \n" + "adde %[T1], %[T1], %[hi] \n" + "addze %[T2], %[T2] \n" + : [hi]"=&r"(hi), [lo]"=&r"(lo), [T0]"+r"(T0), [T1]"+r"(T1), [T2]"+r"(T2) + : [A]"r"(A), [B]"r"(B) + : "xer" + ); +} + +// Fast Montgomery multiplication. The derivation of the algorithm is +// in "A Cryptographic Library for the Motorola DSP56000, +// Dusse and Kaliski, Proc. EUROCRYPT 90, pp. 230-237". +static void +montgomery_multiply(unsigned long a[], unsigned long b[], unsigned long n[], + unsigned long m[], unsigned long inv, int len) { + unsigned long t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator + int i; + + assert(inv * n[0] == -1UL, "broken inverse in Montgomery multiply"); + + for (i = 0; i < len; i++) { + int j; + for (j = 0; j < i; j++) { + MACC(a[j], b[i-j], t0, t1, t2); + MACC(m[j], n[i-j], t0, t1, t2); + } + MACC(a[i], b[0], t0, t1, t2); + m[i] = t0 * inv; + MACC(m[i], n[0], t0, t1, t2); + + assert(t0 == 0, "broken Montgomery multiply"); + + t0 = t1; t1 = t2; t2 = 0; + } + + for (i = len; i < 2*len; i++) { + int j; + for (j = i-len+1; j < len; j++) { + MACC(a[j], b[i-j], t0, t1, t2); + MACC(m[j], n[i-j], t0, t1, t2); + } + m[i-len] = t0; + t0 = t1; t1 = t2; t2 = 0; + } + + while (t0) { + t0 = sub(m, n, t0, len); + } +} + +// Fast Montgomery squaring. This uses asymptotically 25% fewer +// multiplies so it should be up to 25% faster than Montgomery +// multiplication. However, its loop control is more complex and it +// may actually run slower on some machines. +static void +montgomery_square(unsigned long a[], unsigned long n[], + unsigned long m[], unsigned long inv, int len) { + unsigned long t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator + int i; + + assert(inv * n[0] == -1UL, "broken inverse in Montgomery multiply"); + + for (i = 0; i < len; i++) { + int j; + int end = (i+1)/2; + for (j = 0; j < end; j++) { + MACC2(a[j], a[i-j], t0, t1, t2); + MACC(m[j], n[i-j], t0, t1, t2); + } + if ((i & 1) == 0) { + MACC(a[j], a[j], t0, t1, t2); + } + for (; j < i; j++) { + MACC(m[j], n[i-j], t0, t1, t2); + } + m[i] = t0 * inv; + MACC(m[i], n[0], t0, t1, t2); + + assert(t0 == 0, "broken Montgomery square"); + + t0 = t1; t1 = t2; t2 = 0; + } + + for (i = len; i < 2*len; i++) { + int start = i-len+1; + int end = start + (len - start)/2; + int j; + for (j = start; j < end; j++) { + MACC2(a[j], a[i-j], t0, t1, t2); + MACC(m[j], n[i-j], t0, t1, t2); + } + if ((i & 1) == 0) { + MACC(a[j], a[j], t0, t1, t2); + } + for (; j < len; j++) { + MACC(m[j], n[i-j], t0, t1, t2); + } + m[i-len] = t0; + t0 = t1; t1 = t2; t2 = 0; + } + + while (t0) { + t0 = sub(m, n, t0, len); + } +} + +// The threshold at which squaring is advantageous was determined +// experimentally on an i7-3930K (Ivy Bridge) CPU @ 3.5GHz. +// Doesn't seem to be relevant for Power8 so we use the same value. +#define MONTGOMERY_SQUARING_THRESHOLD 64 + +// Copy len longwords from s to d, word-swapping as we go. The +// destination array is reversed. +static void reverse_words(unsigned long *s, unsigned long *d, int len) { + d += len; + while(len-- > 0) { + d--; + unsigned long s_val = *s; + // Swap words in a longword on little endian machines. +#ifdef VM_LITTLE_ENDIAN + s_val = (s_val << 32) | (s_val >> 32); +#endif + *d = s_val; + s++; + } +} + +void SharedRuntime::montgomery_multiply(jint *a_ints, jint *b_ints, jint *n_ints, + jint len, jlong inv, + jint *m_ints) { + assert(len % 2 == 0, "array length in montgomery_multiply must be even"); + int longwords = len/2; + assert(longwords > 0, "unsupported"); + + // Make very sure we don't use so much space that the stack might + // overflow. 512 jints corresponds to an 16384-bit integer and + // will use here a total of 8k bytes of stack space. + int total_allocation = longwords * sizeof (unsigned long) * 4; + guarantee(total_allocation <= 8192, "must be"); + unsigned long *scratch = (unsigned long *)alloca(total_allocation); + + // Local scratch arrays + unsigned long + *a = scratch + 0 * longwords, + *b = scratch + 1 * longwords, + *n = scratch + 2 * longwords, + *m = scratch + 3 * longwords; + + reverse_words((unsigned long *)a_ints, a, longwords); + reverse_words((unsigned long *)b_ints, b, longwords); + reverse_words((unsigned long *)n_ints, n, longwords); + + ::montgomery_multiply(a, b, n, m, (unsigned long)inv, longwords); + + reverse_words(m, (unsigned long *)m_ints, longwords); +} + +void SharedRuntime::montgomery_square(jint *a_ints, jint *n_ints, + jint len, jlong inv, + jint *m_ints) { + assert(len % 2 == 0, "array length in montgomery_square must be even"); + int longwords = len/2; + assert(longwords > 0, "unsupported"); + + // Make very sure we don't use so much space that the stack might + // overflow. 512 jints corresponds to an 16384-bit integer and + // will use here a total of 6k bytes of stack space. + int total_allocation = longwords * sizeof (unsigned long) * 3; + guarantee(total_allocation <= 8192, "must be"); + unsigned long *scratch = (unsigned long *)alloca(total_allocation); + + // Local scratch arrays + unsigned long + *a = scratch + 0 * longwords, + *n = scratch + 1 * longwords, + *m = scratch + 2 * longwords; + + reverse_words((unsigned long *)a_ints, a, longwords); + reverse_words((unsigned long *)n_ints, n, longwords); + + if (len >= MONTGOMERY_SQUARING_THRESHOLD) { + ::montgomery_square(a, n, m, (unsigned long)inv, longwords); + } else { + ::montgomery_multiply(a, a, n, m, (unsigned long)inv, longwords); + } + + reverse_words(m, (unsigned long *)m_ints, longwords); +} diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp index 28f2ca60425..19dd372f083 100644 --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp @@ -2681,6 +2681,15 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_multiplyToLen = generate_multiplyToLen(); } #endif + + if (UseMontgomeryMultiplyIntrinsic) { + StubRoutines::_montgomeryMultiply + = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_multiply); + } + if (UseMontgomerySquareIntrinsic) { + StubRoutines::_montgomerySquare + = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_square); + } } public: diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp index a6f09282c11..949c1b11b0c 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp @@ -263,7 +263,7 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label* __ cmpdi(CCR0, Rmdo, 0); __ beq(CCR0, no_mdo); - // Increment backedge counter in the MDO. + // 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); __ lwz(Rscratch1, in_bytes(MethodData::invoke_mask_offset()), Rmdo); @@ -275,13 +275,13 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label* } // Increment counter in MethodCounters*. - const int mo_bc_offs = in_bytes(MethodCounters::invocation_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); __ lwz(Rscratch1, in_bytes(MethodCounters::invoke_mask_offset()), R3_counters); __ addi(Rscratch2, Rscratch2, increment); - __ stw(Rscratch2, mo_bc_offs, R3_counters); + __ stw(Rscratch2, mo_ic_offs, R3_counters); __ and_(Rscratch1, Rscratch2, Rscratch1); __ beq(CCR0, *overflow); diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index 3acbec86ad1..fec10b9268e 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -225,12 +225,19 @@ void VM_Version::initialize() { if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) { UseMultiplyToLenIntrinsic = true; } + if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) { + UseMontgomeryMultiplyIntrinsic = true; + } + if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) { + UseMontgomerySquareIntrinsic = true; + } if (UseVectorizedMismatchIntrinsic) { warning("UseVectorizedMismatchIntrinsic specified, but not available on this CPU."); FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); } + // Adjust RTM (Restricted Transactional Memory) flags. if (UseRTMLocking) { // If CPU or OS are too old: From ea1091ca761a7a9e39b0c12ad0e22a048c7a30d7 Mon Sep 17 00:00:00 2001 From: Ed Nevill Date: Tue, 29 Dec 2015 16:47:34 +0000 Subject: [PATCH 187/228] 8146286: aarch64: guarantee failures with large code cache sizes on jtreg test java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java Patch trampoline calls with special case bl to itself which does not cause guarantee failure Reviewed-by: aph --- hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp | 2 +- hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp index 9510a3f3fed..703fed835c7 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp @@ -678,7 +678,7 @@ address MacroAssembler::trampoline_call(Address entry, CodeBuffer *cbuf) { if (cbuf) cbuf->set_insts_mark(); relocate(entry.rspec()); - if (Assembler::reachable_from_branch_at(pc(), entry.target())) { + if (!far_branches()) { bl(entry.target()); } else { bl(pc()); diff --git a/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp index 42d2977b1b5..40b53127487 100644 --- a/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp @@ -66,7 +66,13 @@ address Relocation::pd_call_destination(address orig_addr) { } } if (orig_addr != NULL) { - return MacroAssembler::pd_call_destination(orig_addr); + address new_addr = MacroAssembler::pd_call_destination(orig_addr); + // If call is branch to self, don't try to relocate it, just leave it + // as branch to self. This happens during code generation if the code + // buffer expands. It will be relocated to the trampoline above once + // code generation is complete. + new_addr = (new_addr == orig_addr) ? addr() : new_addr; + return new_addr; } return MacroAssembler::pd_call_destination(addr()); } From 27368685db4a2bfe7dc6e902a6778f769264f85a Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Mon, 4 Jan 2016 10:07:08 +0100 Subject: [PATCH 188/228] 8145982: JMXInterfaceBindingTest is failing intermittently Reviewed-by: chegar, sgehwolf, olagneau --- .../management/jmxremote/bootstrap/JMXInterfaceBindingTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java b/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java index 94ebb1e54d1..45370151d22 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java +++ b/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java @@ -174,7 +174,7 @@ public class JMXInterfaceBindingTest { InetAddress[] addrs = getAddressesForLocalHost(); if (addrs.length < 2) { System.out.println("Ignoring manual test since no more than one IPs are configured for 'localhost'"); - System.exit(0); + return; } JMXInterfaceBindingTest test = new JMXInterfaceBindingTest(); test.run(addrs); From 803c430cee36c720d31c016a9407bac8c0dbe66e Mon Sep 17 00:00:00 2001 From: Marcus Larsson Date: Mon, 4 Jan 2016 11:27:02 +0100 Subject: [PATCH 189/228] 8065331: Add trace events for failed allocations Reviewed-by: brutisso, ehelin --- .../src/share/vm/gc/shared/allocTracer.cpp | 9 ++++++++ .../src/share/vm/gc/shared/allocTracer.hpp | 1 + hotspot/src/share/vm/gc/shared/gcId.cpp | 4 ++++ hotspot/src/share/vm/gc/shared/gcId.hpp | 2 ++ .../src/share/vm/gc/shared/vmGCOperations.cpp | 22 +++++++++++++++++++ .../src/share/vm/gc/shared/vmGCOperations.hpp | 8 ++----- hotspot/src/share/vm/trace/trace.xml | 6 +++++ 7 files changed, 46 insertions(+), 6 deletions(-) diff --git a/hotspot/src/share/vm/gc/shared/allocTracer.cpp b/hotspot/src/share/vm/gc/shared/allocTracer.cpp index 4c6c30d75fd..af427a8289f 100644 --- a/hotspot/src/share/vm/gc/shared/allocTracer.cpp +++ b/hotspot/src/share/vm/gc/shared/allocTracer.cpp @@ -46,3 +46,12 @@ void AllocTracer::send_allocation_in_new_tlab_event(KlassHandle klass, size_t tl event.commit(); } } + +void AllocTracer::send_allocation_requiring_gc_event(size_t size, uint gcId) { + EventAllocationRequiringGC event; + if (event.should_commit()) { + event.set_gcId(gcId); + event.set_size(size); + event.commit(); + } +} diff --git a/hotspot/src/share/vm/gc/shared/allocTracer.hpp b/hotspot/src/share/vm/gc/shared/allocTracer.hpp index aba0a1ed579..bd34c9bfd64 100644 --- a/hotspot/src/share/vm/gc/shared/allocTracer.hpp +++ b/hotspot/src/share/vm/gc/shared/allocTracer.hpp @@ -32,6 +32,7 @@ class AllocTracer : AllStatic { public: static void send_allocation_outside_tlab_event(KlassHandle klass, size_t alloc_size); static void send_allocation_in_new_tlab_event(KlassHandle klass, size_t tlab_size, size_t alloc_size); + static void send_allocation_requiring_gc_event(size_t size, uint gcId); }; #endif // SHARE_VM_GC_SHARED_ALLOCTRACER_HPP diff --git a/hotspot/src/share/vm/gc/shared/gcId.cpp b/hotspot/src/share/vm/gc/shared/gcId.cpp index f6ef9bce386..1fd75130b80 100644 --- a/hotspot/src/share/vm/gc/shared/gcId.cpp +++ b/hotspot/src/share/vm/gc/shared/gcId.cpp @@ -39,6 +39,10 @@ const uint GCId::create() { return _next_id++; } +const uint GCId::peek() { + return _next_id; +} + const uint GCId::current() { assert(currentNamedthread()->gc_id() != undefined(), "Using undefined GC id."); return current_raw(); diff --git a/hotspot/src/share/vm/gc/shared/gcId.hpp b/hotspot/src/share/vm/gc/shared/gcId.hpp index 8fc525a31de..f8ac5b3db89 100644 --- a/hotspot/src/share/vm/gc/shared/gcId.hpp +++ b/hotspot/src/share/vm/gc/shared/gcId.hpp @@ -39,6 +39,8 @@ class GCId : public AllStatic { static const uint current(); // Same as current() but can return undefined() if no GC id is currently active static const uint current_raw(); + // Returns the next expected GCId. + static const uint peek(); static const uint undefined() { return UNDEFINED; } static size_t print_prefix(char* buf, size_t len); }; diff --git a/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp index 7b022a7e23e..57ffc4eb40a 100644 --- a/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp +++ b/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp @@ -25,6 +25,8 @@ #include "precompiled.hpp" #include "classfile/classLoader.hpp" #include "classfile/javaClasses.hpp" +#include "gc/shared/allocTracer.hpp" +#include "gc/shared/gcId.hpp" #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/vmGCOperations.hpp" @@ -188,6 +190,18 @@ void VM_GenCollectFull::doit() { gch->do_full_collection(gch->must_clear_all_soft_refs(), _max_generation); } +VM_CollectForMetadataAllocation::VM_CollectForMetadataAllocation(ClassLoaderData* loader_data, + size_t size, + Metaspace::MetadataType mdtype, + uint gc_count_before, + uint full_gc_count_before, + GCCause::Cause gc_cause) + : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true), + _loader_data(loader_data), _size(size), _mdtype(mdtype), _result(NULL) { + assert(_size != 0, "An allocation should always be requested with this operation."); + AllocTracer::send_allocation_requiring_gc_event(_size * HeapWordSize, GCId::peek()); +} + // Returns true iff concurrent GCs unloads metadata. bool VM_CollectForMetadataAllocation::initiate_concurrent_GC() { #if INCLUDE_ALL_GCS @@ -279,3 +293,11 @@ void VM_CollectForMetadataAllocation::doit() { set_gc_locked(); } } + +VM_CollectForAllocation::VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause) + : VM_GC_Operation(gc_count_before, cause), _result(NULL), _word_size(word_size) { + // Only report if operation was really caused by an allocation. + if (_word_size != 0) { + AllocTracer::send_allocation_requiring_gc_event(_word_size * HeapWordSize, GCId::peek()); + } +} diff --git a/hotspot/src/share/vm/gc/shared/vmGCOperations.hpp b/hotspot/src/share/vm/gc/shared/vmGCOperations.hpp index 76c75c24e77..e43a3889bac 100644 --- a/hotspot/src/share/vm/gc/shared/vmGCOperations.hpp +++ b/hotspot/src/share/vm/gc/shared/vmGCOperations.hpp @@ -166,8 +166,7 @@ class VM_CollectForAllocation : public VM_GC_Operation { HeapWord* _result; // Allocation result (NULL if allocation failed) public: - VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause) - : VM_GC_Operation(gc_count_before, cause), _result(NULL), _word_size(word_size) {} + VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause); HeapWord* result() const { return _result; @@ -220,10 +219,7 @@ class VM_CollectForMetadataAllocation: public VM_GC_Operation { Metaspace::MetadataType mdtype, uint gc_count_before, uint full_gc_count_before, - GCCause::Cause gc_cause) - : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true), - _loader_data(loader_data), _size(size), _mdtype(mdtype), _result(NULL) { - } + GCCause::Cause gc_cause); virtual VMOp_Type type() const { return VMOp_CollectForMetadataAllocation; } virtual void doit(); diff --git a/hotspot/src/share/vm/trace/trace.xml b/hotspot/src/share/vm/trace/trace.xml index 798814b9ac8..fdaaaa78b9b 100644 --- a/hotspot/src/share/vm/trace/trace.xml +++ b/hotspot/src/share/vm/trace/trace.xml @@ -465,6 +465,12 @@ Declares a structure type that can be used in other events. + + + + + Date: Mon, 4 Jan 2016 11:37:18 +0100 Subject: [PATCH 190/228] 8145083: Use semaphore instead of mutex for synchronization of Unified Logging configuration Reviewed-by: dholmes, kbarrett, mgronlun --- hotspot/src/share/vm/logging/log.cpp | 1 - .../src/share/vm/logging/logConfiguration.cpp | 69 ++++++++++++------- .../share/vm/logging/logDiagnosticCommand.cpp | 4 -- hotspot/src/share/vm/logging/logOutput.cpp | 9 --- hotspot/src/share/vm/logging/logOutput.hpp | 17 +++-- hotspot/src/share/vm/prims/jvmtiEnv.cpp | 19 ++--- hotspot/src/share/vm/runtime/mutexLocker.cpp | 2 - hotspot/src/share/vm/runtime/mutexLocker.hpp | 1 - .../src/share/vm/services/memoryService.cpp | 1 - 9 files changed, 59 insertions(+), 64 deletions(-) diff --git a/hotspot/src/share/vm/logging/log.cpp b/hotspot/src/share/vm/logging/log.cpp index eda1877c88c..71ca3a3e22f 100644 --- a/hotspot/src/share/vm/logging/log.cpp +++ b/hotspot/src/share/vm/logging/log.cpp @@ -36,7 +36,6 @@ void Test_log_length() { remove("loglengthoutput.txt"); // Write long message to output file - MutexLocker ml(LogConfiguration_lock); LogConfiguration::parse_log_arguments("loglengthoutput.txt", "logging=trace", NULL, NULL, NULL); ResourceMark rm; diff --git a/hotspot/src/share/vm/logging/logConfiguration.cpp b/hotspot/src/share/vm/logging/logConfiguration.cpp index d109a50ae7b..53cd891f9b6 100644 --- a/hotspot/src/share/vm/logging/logConfiguration.cpp +++ b/hotspot/src/share/vm/logging/logConfiguration.cpp @@ -33,23 +33,50 @@ #include "logging/logTagSet.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" -#include "runtime/mutexLocker.hpp" #include "runtime/os.inline.hpp" +#include "runtime/semaphore.hpp" #include "utilities/globalDefinitions.hpp" LogOutput** LogConfiguration::_outputs = NULL; size_t LogConfiguration::_n_outputs = 0; bool LogConfiguration::_post_initialized = false; +// Stack object to take the lock for configuring the logging. +// Should only be held during the critical parts of the configuration +// (when calling configure_output or reading/modifying the outputs array). +// Thread must never block when holding this lock. +class ConfigurationLock : public StackObj { + private: + // Semaphore used as lock + static Semaphore _semaphore; + debug_only(static intx _locking_thread_id;) + public: + ConfigurationLock() { + _semaphore.wait(); + debug_only(_locking_thread_id = os::current_thread_id()); + } + ~ConfigurationLock() { + debug_only(_locking_thread_id = -1); + _semaphore.signal(); + } + debug_only(static bool current_thread_has_lock();) +}; + +Semaphore ConfigurationLock::_semaphore(1); +#ifdef ASSERT +intx ConfigurationLock::_locking_thread_id = -1; +bool ConfigurationLock::current_thread_has_lock() { + return _locking_thread_id == os::current_thread_id(); +} +#endif + void LogConfiguration::post_initialize() { - assert(LogConfiguration_lock != NULL, "Lock must be initialized before post-initialization"); LogDiagnosticCommand::registerCommand(); LogHandle(logging) log; log.info("Log configuration fully initialized."); log_develop_info(logging)("Develop logging is available."); if (log.is_trace()) { ResourceMark rm; - MutexLocker ml(LogConfiguration_lock); describe(log.trace_stream()); } @@ -129,6 +156,7 @@ void LogConfiguration::delete_output(size_t idx) { } void LogConfiguration::configure_output(size_t idx, const LogTagLevelExpression& tag_level_expression, const LogDecorators& decorators) { + assert(ConfigurationLock::current_thread_has_lock(), "Must hold configuration lock to call this function."); assert(idx < _n_outputs, "Invalid index, idx = " SIZE_FORMAT " and _n_outputs = " SIZE_FORMAT, idx, _n_outputs); LogOutput* output = _outputs[idx]; @@ -208,17 +236,13 @@ void LogConfiguration::disable_output(size_t idx) { } void LogConfiguration::disable_logging() { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "LogConfiguration lock must be held when calling this function"); + ConfigurationLock cl; for (size_t i = 0; i < _n_outputs; i++) { disable_output(i); } } void LogConfiguration::configure_stdout(LogLevelType level, bool exact_match, ...) { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "LogConfiguration lock must be held when calling this function"); - size_t i; va_list ap; LogTagLevelExpression expr; @@ -242,6 +266,7 @@ void LogConfiguration::configure_stdout(LogLevelType level, bool exact_match, .. expr.new_combination(); // Apply configuration to stdout (output #0), with the same decorators as before. + ConfigurationLock cl; configure_output(0, expr, LogOutput::Stdout->decorators()); } @@ -289,12 +314,21 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr, const char* decoratorstr, const char* output_options, outputStream* errstream) { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "LogConfiguration lock must be held when calling this function"); if (outputstr == NULL || strlen(outputstr) == 0) { outputstr = "stdout"; } + LogTagLevelExpression expr; + if (!expr.parse(what, errstream)) { + return false; + } + + LogDecorators decorators; + if (!decorators.parse(decoratorstr, errstream)) { + return false; + } + + ConfigurationLock cl; size_t idx; if (outputstr[0] == '#') { int ret = sscanf(outputstr+1, SIZE_FORMAT, &idx); @@ -321,25 +355,11 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr, errstream->print_cr("Output options for existing outputs are ignored."); } } - - LogTagLevelExpression expr; - if (!expr.parse(what, errstream)) { - return false; - } - - LogDecorators decorators; - if (!decorators.parse(decoratorstr, errstream)) { - return false; - } - configure_output(idx, expr, decorators); return true; } void LogConfiguration::describe(outputStream* out) { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "LogConfiguration lock must be held when calling this function"); - out->print("Available log levels:"); for (size_t i = 0; i < LogLevel::Count; i++) { out->print("%s %s", (i == 0 ? "" : ","), LogLevel::name(static_cast(i))); @@ -359,6 +379,7 @@ void LogConfiguration::describe(outputStream* out) { } out->cr(); + ConfigurationLock cl; out->print_cr("Log output configuration:"); for (size_t i = 0; i < _n_outputs; i++) { out->print("#" SIZE_FORMAT ": %s %s ", i, _outputs[i]->name(), _outputs[i]->config_string()); diff --git a/hotspot/src/share/vm/logging/logDiagnosticCommand.cpp b/hotspot/src/share/vm/logging/logDiagnosticCommand.cpp index fe27defa826..84c1b80afcc 100644 --- a/hotspot/src/share/vm/logging/logDiagnosticCommand.cpp +++ b/hotspot/src/share/vm/logging/logDiagnosticCommand.cpp @@ -25,7 +25,6 @@ #include "logging/logConfiguration.hpp" #include "logging/logDiagnosticCommand.hpp" #include "memory/resourceArea.hpp" -#include "runtime/mutexLocker.hpp" #include "utilities/globalDefinitions.hpp" LogDiagnosticCommand::LogDiagnosticCommand(outputStream* output, bool heap_allocated) @@ -65,13 +64,11 @@ void LogDiagnosticCommand::registerCommand() { void LogDiagnosticCommand::execute(DCmdSource source, TRAPS) { bool any_command = false; if (_disable.has_value()) { - MutexLocker ml(LogConfiguration_lock); LogConfiguration::disable_logging(); any_command = true; } if (_output.has_value() || _what.has_value() || _decorators.has_value()) { - MutexLocker ml(LogConfiguration_lock); if (!LogConfiguration::parse_log_arguments(_output.value(), _what.value(), _decorators.value(), @@ -83,7 +80,6 @@ void LogDiagnosticCommand::execute(DCmdSource source, TRAPS) { } if (_list.has_value()) { - MutexLocker ml(LogConfiguration_lock); LogConfiguration::describe(output()); any_command = true; } diff --git a/hotspot/src/share/vm/logging/logOutput.cpp b/hotspot/src/share/vm/logging/logOutput.cpp index 0b9a3bf0db9..ba0ce383fa8 100644 --- a/hotspot/src/share/vm/logging/logOutput.cpp +++ b/hotspot/src/share/vm/logging/logOutput.cpp @@ -37,9 +37,6 @@ LogOutput::~LogOutput() { } void LogOutput::clear_config_string() { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "Must hold configuration lock to modify config string"); - os::free(_config_string); _config_string_buffer_size = InitialConfigBufferSize; _config_string = NEW_C_HEAP_ARRAY(char, _config_string_buffer_size, mtLogging); @@ -47,18 +44,12 @@ void LogOutput::clear_config_string() { } void LogOutput::set_config_string(const char* string) { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "Must hold configuration lock to modify config string"); - os::free(_config_string); _config_string = os::strdup(string, mtLogging); _config_string_buffer_size = strlen(_config_string) + 1; } void LogOutput::add_to_config_string(const LogTagSet* ts, LogLevelType level) { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "Must hold configuration lock to modify config string"); - if (_config_string_buffer_size < InitialConfigBufferSize) { _config_string_buffer_size = InitialConfigBufferSize; _config_string = REALLOC_C_HEAP_ARRAY(char, _config_string, _config_string_buffer_size, mtLogging); diff --git a/hotspot/src/share/vm/logging/logOutput.hpp b/hotspot/src/share/vm/logging/logOutput.hpp index 3cecaddc903..3850a62f939 100644 --- a/hotspot/src/share/vm/logging/logOutput.hpp +++ b/hotspot/src/share/vm/logging/logOutput.hpp @@ -36,6 +36,9 @@ class LogTagSet; // Keeps track of the latest configuration string, // and its selected decorators. class LogOutput : public CHeapObj { + // Make LogConfiguration a friend to allow it to modify the configuration string. + friend class LogConfiguration; + private: static const size_t InitialConfigBufferSize = 256; char* _config_string; @@ -44,6 +47,13 @@ class LogOutput : public CHeapObj { protected: LogDecorators _decorators; + // Clears any previous config description in preparation of reconfiguration. + void clear_config_string(); + // Adds the tagset on the given level to the config description (e.g. "tag1+tag2=level"). + void add_to_config_string(const LogTagSet* ts, LogLevelType level); + // Replaces the current config description with the given string. + void set_config_string(const char* string); + public: static LogOutput* const Stdout; static LogOutput* const Stderr; @@ -65,13 +75,6 @@ class LogOutput : public CHeapObj { virtual ~LogOutput(); - // Clears any previous config description in preparation of reconfiguration. - void clear_config_string(); - // Adds the tagset on the given level to the config description (e.g. "tag1+tag2=level"). - void add_to_config_string(const LogTagSet* ts, LogLevelType level); - // Replaces the current config description with the given string. - void set_config_string(const char* string); - virtual const char* name() const = 0; virtual bool initialize(const char* options) = 0; virtual int write(const LogDecorations &decorations, const char* msg) = 0; diff --git a/hotspot/src/share/vm/prims/jvmtiEnv.cpp b/hotspot/src/share/vm/prims/jvmtiEnv.cpp index ab6d8258358..bc3dd3ccfc4 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp @@ -629,21 +629,10 @@ JvmtiEnv::SetVerboseFlag(jvmtiVerboseFlag flag, jboolean value) { TraceClassUnloading = value != 0; break; case JVMTI_VERBOSE_GC: - { - // This is a temporary solution to work around initialization issues. - // JDK-8145083 will fix this. - Mutex* conf_mutex = LogConfiguration_lock; - if (Threads::number_of_threads() == 0) { - // We're too early in the initialization to use mutexes - LogConfiguration_lock = NULL; - } - MutexLockerEx ml(LogConfiguration_lock); - if (value == 0) { - LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL); - } else { - LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); - } - LogConfiguration_lock = conf_mutex; + if (value == 0) { + LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL); + } else { + LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); } break; case JVMTI_VERBOSE_JNI: diff --git a/hotspot/src/share/vm/runtime/mutexLocker.cpp b/hotspot/src/share/vm/runtime/mutexLocker.cpp index 71557ddd910..ae1d213b6e5 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.cpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp @@ -127,7 +127,6 @@ Monitor* GCTaskManager_lock = NULL; Mutex* Management_lock = NULL; Monitor* Service_lock = NULL; Monitor* PeriodicTask_lock = NULL; -Mutex* LogConfiguration_lock = NULL; #ifdef INCLUDE_TRACE Mutex* JfrStacktrace_lock = NULL; @@ -284,7 +283,6 @@ void mutex_init() { if (WhiteBoxAPI) { def(Compilation_lock , Monitor, leaf, false, Monitor::_safepoint_check_never); } - def(LogConfiguration_lock , Mutex, nonleaf, false, Monitor::_safepoint_check_always); #ifdef INCLUDE_TRACE def(JfrMsg_lock , Monitor, leaf, true, Monitor::_safepoint_check_always); diff --git a/hotspot/src/share/vm/runtime/mutexLocker.hpp b/hotspot/src/share/vm/runtime/mutexLocker.hpp index 5f90aff1bb1..bbf6f143312 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.hpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.hpp @@ -127,7 +127,6 @@ extern Mutex* MMUTracker_lock; // protects the MMU extern Mutex* Management_lock; // a lock used to serialize JVM management extern Monitor* Service_lock; // a lock used for service thread operation extern Monitor* PeriodicTask_lock; // protects the periodic task structure -extern Mutex* LogConfiguration_lock; // protects configuration of logging #ifdef INCLUDE_TRACE extern Mutex* JfrStacktrace_lock; // used to guard access to the JFR stacktrace table diff --git a/hotspot/src/share/vm/services/memoryService.cpp b/hotspot/src/share/vm/services/memoryService.cpp index ea2ae889563..11a4d569057 100644 --- a/hotspot/src/share/vm/services/memoryService.cpp +++ b/hotspot/src/share/vm/services/memoryService.cpp @@ -518,7 +518,6 @@ void MemoryService::oops_do(OopClosure* f) { bool MemoryService::set_verbose(bool verbose) { MutexLocker m(Management_lock); // verbose will be set to the previous value - MutexLocker ml(LogConfiguration_lock); if (verbose) { LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); } else { From 5e5def838e0d12b1c9453bcf689f9bf99e6d4bc4 Mon Sep 17 00:00:00 2001 From: Marcus Larsson Date: Mon, 4 Jan 2016 11:31:42 +0100 Subject: [PATCH 191/228] 8144220: UL does not support full path names for log files on windows Reviewed-by: sla, mgronlun --- .../src/share/vm/logging/logConfiguration.cpp | 75 +++++++----- .../src/share/vm/logging/logConfiguration.hpp | 2 +- .../logging/TestQuotedLogOutputs.java | 109 ++++++++++++++++++ 3 files changed, 158 insertions(+), 28 deletions(-) create mode 100644 hotspot/test/serviceability/logging/TestQuotedLogOutputs.java diff --git a/hotspot/src/share/vm/logging/logConfiguration.cpp b/hotspot/src/share/vm/logging/logConfiguration.cpp index 53cd891f9b6..dd0d0133ef5 100644 --- a/hotspot/src/share/vm/logging/logConfiguration.cpp +++ b/hotspot/src/share/vm/logging/logConfiguration.cpp @@ -110,7 +110,7 @@ size_t LogConfiguration::find_output(const char* name) { return SIZE_MAX; } -LogOutput* LogConfiguration::new_output(char* name, const char* options) { +LogOutput* LogConfiguration::new_output(char* name, const char* options, outputStream* errstream) { const char* type; char* equals_pos = strchr(name, '='); if (equals_pos == NULL) { @@ -121,16 +121,34 @@ LogOutput* LogConfiguration::new_output(char* name, const char* options) { name = equals_pos + 1; } + // Check if name is quoted, and if so, strip the quotes + char* quote = strchr(name, '"'); + if (quote != NULL) { + char* end_quote = strchr(name + 1, '"'); + if (end_quote == NULL) { + errstream->print_cr("Output name has opening quote but is missing a terminating quote."); + return NULL; + } else if (quote != name || end_quote[1] != '\0') { + errstream->print_cr("Output name can not be partially quoted." + " Either surround the whole name with quotation marks," + " or do not use quotation marks at all."); + return NULL; + } + name++; + *end_quote = '\0'; + } + LogOutput* output; if (strcmp(type, "file") == 0) { output = new LogFileOutput(name); } else { - // unsupported log output type + errstream->print_cr("Unsupported log output type."); return NULL; } bool success = output->initialize(options); if (!success) { + errstream->print_cr("Initialization of output '%s' using options '%s' failed.", name, options); delete output; return NULL; } @@ -274,32 +292,40 @@ bool LogConfiguration::parse_command_line_arguments(const char* opts) { char* copy = os::strdup_check_oom(opts, mtLogging); // Split the option string to its colon separated components. - char* what = NULL; - char* output_str = NULL; - char* decorators_str = NULL; - char* output_options = NULL; + char* str = copy; + char* substrings[4] = {0}; + for (int i = 0 ; i < 4; i++) { + substrings[i] = str; - what = copy; - char* colon = strchr(what, ':'); - if (colon != NULL) { - *colon = '\0'; - output_str = colon + 1; - colon = strchr(output_str, ':'); - if (colon != NULL) { - *colon = '\0'; - decorators_str = colon + 1; - colon = strchr(decorators_str, ':'); - if (colon != NULL) { - *colon = '\0'; - output_options = colon + 1; + // Find the next colon or quote + char* next = strpbrk(str, ":\""); + while (next != NULL && *next == '"') { + char* end_quote = strchr(next + 1, '"'); + if (end_quote == NULL) { + log_error(logging)("Missing terminating quote in -Xlog option '%s'", str); + os::free(copy); + return false; } + // Keep searching after the quoted substring + next = strpbrk(end_quote + 1, ":\""); + } + + if (next != NULL) { + *next = '\0'; + str = next + 1; + } else { + break; } } - // Parse each argument + // Parse and apply the separated configuration options + char* what = substrings[0]; + char* output = substrings[1]; + char* decorators = substrings[2]; + char* output_options = substrings[3]; char errbuf[512]; stringStream ss(errbuf, sizeof(errbuf)); - bool success = parse_log_arguments(output_str, what, decorators_str, output_options, &ss); + bool success = parse_log_arguments(output, what, decorators, output_options, &ss); if (!success) { errbuf[strlen(errbuf) - 1] = '\0'; // Strip trailing newline. log_error(logging)("%s", errbuf); @@ -340,14 +366,9 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr, idx = find_output(outputstr); if (idx == SIZE_MAX) { char* tmp = os::strdup_check_oom(outputstr, mtLogging); - LogOutput* output = new_output(tmp, output_options); + LogOutput* output = new_output(tmp, output_options, errstream); os::free(tmp); if (output == NULL) { - errstream->print("Unable to add output '%s'", outputstr); - if (output_options != NULL && strlen(output_options) > 0) { - errstream->print(" with options '%s'", output_options); - } - errstream->cr(); return false; } idx = add_output(output); diff --git a/hotspot/src/share/vm/logging/logConfiguration.hpp b/hotspot/src/share/vm/logging/logConfiguration.hpp index 1462d6530dc..0acd1faf8bb 100644 --- a/hotspot/src/share/vm/logging/logConfiguration.hpp +++ b/hotspot/src/share/vm/logging/logConfiguration.hpp @@ -43,7 +43,7 @@ class LogConfiguration : public AllStatic { static bool _post_initialized; // Create a new output. Returns NULL if failed. - static LogOutput* new_output(char* name, const char* options = NULL); + static LogOutput* new_output(char* name, const char* options, outputStream* errstream); // Add an output to the list of configured outputs. Returns the assigned index. static size_t add_output(LogOutput* out); diff --git a/hotspot/test/serviceability/logging/TestQuotedLogOutputs.java b/hotspot/test/serviceability/logging/TestQuotedLogOutputs.java new file mode 100644 index 00000000000..be2e76d9c51 --- /dev/null +++ b/hotspot/test/serviceability/logging/TestQuotedLogOutputs.java @@ -0,0 +1,109 @@ +/* + * 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 TestQuotedLogOutputs + * @summary Ensure proper parsing of quoted output names for -Xlog arguments. + * @library /testlibrary + */ + +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; + +import jdk.test.lib.Asserts; +import jdk.test.lib.ProcessTools; +import jdk.test.lib.OutputAnalyzer; + +public class TestQuotedLogOutputs { + + public static void main(String[] args) throws Exception { + // Ensure log files can be specified with full path. + // On windows, this means that the file name will contain + // a colon ('C:\log.txt' for example), which is used to + // separate -Xlog: options (-Xlog:tags:filename:decorators). + // Try to log to a file in our current directory, using its absolute path. + String baseName = "test file.log"; + Path filePath = Paths.get(baseName).toAbsolutePath(); + String fileName = filePath.toString(); + File file = filePath.toFile(); + + // In case the file already exists, attempt to delete it before running the test + file.delete(); + + // Depending on if we're on Windows or not the quotation marks must be escaped, + // otherwise they will be stripped from the command line arguments. + String quote; + if (System.getProperty("os.name").toLowerCase().contains("windows")) { + quote = "\\\""; // quote should be \" (escaped quote) + } else { + quote = "\""; // quote should be " (no escape needed) + } + + // Test a few variations with valid log output specifiers + String[] validOutputs = new String[] { + quote + fileName + quote, + "file=" + quote + fileName + quote, + quote + fileName + quote + ":", + quote + fileName + quote + "::" + }; + for (String logOutput : validOutputs) { + // Run with logging=trace on stdout so that we can verify the log configuration afterwards. + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:logging=trace", + "-Xlog:all=trace:" + logOutput, + "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + Asserts.assertTrue(file.exists()); + file.deleteOnExit(); // Clean up after test + output.shouldMatch("\\[logging *\\].*" + baseName); // Expect to see the log output listed + } + + // Test a bunch of invalid output specifications and ensure the VM fails with these + String[] invalidOutputs = new String[] { + quote, + quote + quote, // should fail because the VM will try to create a file without a name + quote + quote + quote, + quote + quote + quote + quote, + quote + quote + quote + quote + quote, + "prefix" + quote + quote + "suffix", + "prefix" + quote + quote, + quote + quote + "suffix", + quote + "A" + quote + quote + "B" + quote, + quote + "A" + quote + "B" + quote + "C" + quote, + "A" + quote + quote + "B" + }; + for (String logOutput : invalidOutputs) { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:logging=trace", + "-Xlog:all=trace:" + logOutput, + "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(1); + // Ensure error message was logged + output.shouldMatch("([Mm]issing terminating quote)" + + "|(Could not open log file '')" + + "|(Output name can not be partially quoted)"); + } + } +} + From cc9cd893acf7d5253e27cbb8439703a91a426cbf Mon Sep 17 00:00:00 2001 From: Marcus Larsson Date: Mon, 4 Jan 2016 11:38:42 +0100 Subject: [PATCH 192/228] 8145294: TestLogRotation.java triggers a race in the UL framework Reviewed-by: sla, mgronlun --- .../src/share/vm/logging/logConfiguration.cpp | 10 ++----- .../src/share/vm/logging/logConfiguration.hpp | 5 ---- .../src/share/vm/logging/logFileOutput.cpp | 30 +++++++++++++------ .../src/share/vm/logging/logFileOutput.hpp | 19 +++++------- hotspot/src/share/vm/logging/logOutput.hpp | 14 ++++----- 5 files changed, 38 insertions(+), 40 deletions(-) diff --git a/hotspot/src/share/vm/logging/logConfiguration.cpp b/hotspot/src/share/vm/logging/logConfiguration.cpp index dd0d0133ef5..2ff86004cce 100644 --- a/hotspot/src/share/vm/logging/logConfiguration.cpp +++ b/hotspot/src/share/vm/logging/logConfiguration.cpp @@ -39,7 +39,6 @@ LogOutput** LogConfiguration::_outputs = NULL; size_t LogConfiguration::_n_outputs = 0; -bool LogConfiguration::_post_initialized = false; // Stack object to take the lock for configuring the logging. // Should only be held during the critical parts of the configuration @@ -79,8 +78,6 @@ void LogConfiguration::post_initialize() { ResourceMark rm; describe(log.trace_stream()); } - - _post_initialized = true; } void LogConfiguration::initialize(jlong vm_start_time) { @@ -469,10 +466,9 @@ void LogConfiguration::print_command_line_help(FILE* out) { } void LogConfiguration::rotate_all_outputs() { - for (size_t idx = 0; idx < _n_outputs; idx++) { - if (_outputs[idx]->is_rotatable()) { - _outputs[idx]->rotate(true); - } + // Start from index 2 since neither stdout nor stderr can be rotated. + for (size_t idx = 2; idx < _n_outputs; idx++) { + _outputs[idx]->force_rotate(); } } diff --git a/hotspot/src/share/vm/logging/logConfiguration.hpp b/hotspot/src/share/vm/logging/logConfiguration.hpp index 0acd1faf8bb..409c8b05ef5 100644 --- a/hotspot/src/share/vm/logging/logConfiguration.hpp +++ b/hotspot/src/share/vm/logging/logConfiguration.hpp @@ -40,7 +40,6 @@ class LogConfiguration : public AllStatic { private: static LogOutput** _outputs; static size_t _n_outputs; - static bool _post_initialized; // Create a new output. Returns NULL if failed. static LogOutput* new_output(char* name, const char* options, outputStream* errstream); @@ -96,10 +95,6 @@ class LogConfiguration : public AllStatic { // Prints usage help for command line log configuration. static void print_command_line_help(FILE* out); - static bool is_post_initialized() { - return _post_initialized; - } - // Rotates all LogOutput static void rotate_all_outputs(); }; diff --git a/hotspot/src/share/vm/logging/logFileOutput.cpp b/hotspot/src/share/vm/logging/logFileOutput.cpp index b5a99c6f051..730a90190bd 100644 --- a/hotspot/src/share/vm/logging/logFileOutput.cpp +++ b/hotspot/src/share/vm/logging/logFileOutput.cpp @@ -26,7 +26,6 @@ #include "logging/logConfiguration.hpp" #include "logging/logFileOutput.hpp" #include "memory/allocation.inline.hpp" -#include "runtime/mutexLocker.hpp" #include "runtime/os.inline.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/defaultStream.hpp" @@ -43,8 +42,7 @@ char LogFileOutput::_vm_start_time_str[StartTimeBufferSize]; LogFileOutput::LogFileOutput(const char* name) : LogFileStreamOutput(NULL), _name(os::strdup_check_oom(name, mtLogging)), _file_name(NULL), _archive_name(NULL), _archive_name_len(0), _current_size(0), - _rotate_size(0), _current_file(1), _file_count(0), - _rotation_lock(Mutex::leaf, "LogFileOutput rotation lock", true, Mutex::_safepoint_check_sometimes) { + _rotate_size(0), _current_file(1), _file_count(0), _rotation_semaphore(1) { _file_name = make_file_name(name, _pid_str, _vm_start_time_str); } @@ -152,10 +150,15 @@ int LogFileOutput::write(const LogDecorations& decorations, const char* msg) { // An error has occurred with this output, avoid writing to it. return 0; } + + _rotation_semaphore.wait(); int written = LogFileStreamOutput::write(decorations, msg); _current_size += written; - rotate(false); + if (should_rotate()) { + rotate(); + } + _rotation_semaphore.signal(); return written; } @@ -177,19 +180,28 @@ void LogFileOutput::archive() { } } -void LogFileOutput::rotate(bool force) { - - if (!should_rotate(force)) { +void LogFileOutput::force_rotate() { + if (_file_count == 0) { + // Rotation not possible return; } + _rotation_semaphore.wait(); + rotate(); + _rotation_semaphore.signal(); +} - MutexLockerEx ml(&_rotation_lock, true /* no safepoint check */); +void LogFileOutput::rotate() { + + if (fclose(_stream)) { + jio_fprintf(defaultStream::error_stream(), "Error closing file '%s' during log rotation (%s).\n", + _file_name, strerror(errno)); + } // Archive the current log file archive(); // Open the active log file using the same stream as before - _stream = freopen(_file_name, FileOpenMode, _stream); + _stream = fopen(_file_name, FileOpenMode); if (_stream == NULL) { jio_fprintf(defaultStream::error_stream(), "Could not reopen file '%s' during log rotation (%s).\n", _file_name, strerror(errno)); diff --git a/hotspot/src/share/vm/logging/logFileOutput.hpp b/hotspot/src/share/vm/logging/logFileOutput.hpp index 4fe633eb971..935a176a5e3 100644 --- a/hotspot/src/share/vm/logging/logFileOutput.hpp +++ b/hotspot/src/share/vm/logging/logFileOutput.hpp @@ -25,7 +25,7 @@ #define SHARE_VM_LOGGING_LOGFILEOUTPUT_HPP #include "logging/logFileStreamOutput.hpp" -#include "runtime/mutex.hpp" +#include "runtime/semaphore.hpp" #include "utilities/globalDefinitions.hpp" class LogDecorations; @@ -44,7 +44,6 @@ class LogFileOutput : public LogFileStreamOutput { static char _pid_str[PidBufferSize]; static char _vm_start_time_str[StartTimeBufferSize]; - Mutex _rotation_lock; const char* _name; char* _file_name; char* _archive_name; @@ -57,14 +56,17 @@ class LogFileOutput : public LogFileStreamOutput { size_t _rotate_size; size_t _current_size; + // Semaphore used for synchronizing file rotations and writes + Semaphore _rotation_semaphore; + void archive(); + void rotate(); bool configure_rotation(const char* options); char *make_file_name(const char* file_name, const char* pid_string, const char* timestamp_string); static size_t parse_value(const char* value_str); - bool should_rotate(bool force) { - return is_rotatable() && - (force || (_rotate_size > 0 && _current_size >= _rotate_size)); + bool should_rotate() { + return _file_count > 0 && _rotate_size > 0 && _current_size >= _rotate_size; } public: @@ -72,12 +74,7 @@ class LogFileOutput : public LogFileStreamOutput { virtual ~LogFileOutput(); virtual bool initialize(const char* options); virtual int write(const LogDecorations& decorations, const char* msg); - - virtual bool is_rotatable() { - return LogConfiguration::is_post_initialized() && (_file_count > 0); - } - - virtual void rotate(bool force); + virtual void force_rotate(); virtual const char* name() const { return _name; diff --git a/hotspot/src/share/vm/logging/logOutput.hpp b/hotspot/src/share/vm/logging/logOutput.hpp index 3850a62f939..1ca598c357f 100644 --- a/hotspot/src/share/vm/logging/logOutput.hpp +++ b/hotspot/src/share/vm/logging/logOutput.hpp @@ -75,17 +75,15 @@ class LogOutput : public CHeapObj { virtual ~LogOutput(); + // If the output can be rotated, trigger a forced rotation, otherwise do nothing. + // Log outputs with rotation capabilities should override this. + virtual void force_rotate() { + // Do nothing by default. + } + virtual const char* name() const = 0; virtual bool initialize(const char* options) = 0; virtual int write(const LogDecorations &decorations, const char* msg) = 0; - - virtual bool is_rotatable() { - return false; - } - - virtual void rotate(bool force) { - // Do nothing by default. - } }; #endif // SHARE_VM_LOGGING_LOGOUTPUT_HPP From d47aca611add0537cfb52d725d72072990235f68 Mon Sep 17 00:00:00 2001 From: Harsha Wardhana B Date: Mon, 4 Jan 2016 13:45:39 +0100 Subject: [PATCH 193/228] 7065236: To interpret case-insensitive string locale independently Reviewed-by: jbachorik --- .../javax/management/loading/MLetParser.java | 5 +- .../modelmbean/DescriptorSupport.java | 5 +- .../management/remote/JMXServiceURL.java | 7 +- .../loading/MletParserLocaleTest.java | 109 ++++++++++++++++++ jdk/test/javax/management/loading/mlet4.html | 2 + .../DescriptorSupportXMLLocaleTest.java | 64 ++++++++++ .../connection/JMXServiceURLLocaleTest.java | 68 +++++++++++ 7 files changed, 253 insertions(+), 7 deletions(-) create mode 100644 jdk/test/javax/management/loading/MletParserLocaleTest.java create mode 100644 jdk/test/javax/management/loading/mlet4.html create mode 100644 jdk/test/javax/management/modelmbean/DescriptorSupportXMLLocaleTest.java create mode 100644 jdk/test/javax/management/remote/mandatory/connection/JMXServiceURLLocaleTest.java diff --git a/jdk/src/java.management/share/classes/javax/management/loading/MLetParser.java b/jdk/src/java.management/share/classes/javax/management/loading/MLetParser.java index 4291c5bcbf7..ff261f39235 100644 --- a/jdk/src/java.management/share/classes/javax/management/loading/MLetParser.java +++ b/jdk/src/java.management/share/classes/javax/management/loading/MLetParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -37,6 +37,7 @@ import java.net.URLConnection; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.logging.Level; @@ -142,7 +143,7 @@ class MLetParser { skipSpace(in); val = buf.toString(); } - atts.put(att.toLowerCase(), val); + atts.put(att.toLowerCase(Locale.ENGLISH), val); skipSpace(in); } return atts; diff --git a/jdk/src/java.management/share/classes/javax/management/modelmbean/DescriptorSupport.java b/jdk/src/java.management/share/classes/javax/management/modelmbean/DescriptorSupport.java index f2534a62269..8499be40cc8 100644 --- a/jdk/src/java.management/share/classes/javax/management/modelmbean/DescriptorSupport.java +++ b/jdk/src/java.management/share/classes/javax/management/modelmbean/DescriptorSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -45,6 +45,7 @@ import java.lang.reflect.Constructor; import java.security.AccessController; import java.util.HashMap; import java.util.Iterator; +import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.SortedMap; @@ -283,7 +284,7 @@ public class DescriptorSupport throw new RuntimeOperationsException(iae, msg); } - final String lowerInStr = inStr.toLowerCase(); + final String lowerInStr = inStr.toLowerCase(Locale.ENGLISH); if (!lowerInStr.startsWith("") || !lowerInStr.endsWith("")) { throw new XMLParseException("No , pair"); diff --git a/jdk/src/java.management/share/classes/javax/management/remote/JMXServiceURL.java b/jdk/src/java.management/share/classes/javax/management/remote/JMXServiceURL.java index 4f9c36e9509..bdac521bec3 100644 --- a/jdk/src/java.management/share/classes/javax/management/remote/JMXServiceURL.java +++ b/jdk/src/java.management/share/classes/javax/management/remote/JMXServiceURL.java @@ -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 @@ -38,6 +38,7 @@ import java.net.InetAddress; import java.net.MalformedURLException; import java.net.UnknownHostException; import java.util.BitSet; +import java.util.Locale; import java.util.StringTokenizer; /** @@ -168,7 +169,7 @@ public class JMXServiceURL implements Serializable { final int protoStart = requiredPrefixLength; final int protoEnd = indexOf(serviceURL, ':', protoStart); this.protocol = - serviceURL.substring(protoStart, protoEnd).toLowerCase(); + serviceURL.substring(protoStart, protoEnd).toLowerCase(Locale.ENGLISH); if (!serviceURL.regionMatches(protoEnd, "://", 0, 3)) { throw new MalformedURLException("Missing \"://\" after " + @@ -328,7 +329,7 @@ public class JMXServiceURL implements Serializable { throw new MalformedURLException("More than one [[...]]"); } - this.protocol = protocol.toLowerCase(); + this.protocol = protocol.toLowerCase(Locale.ENGLISH); this.host = host; this.port = port; diff --git a/jdk/test/javax/management/loading/MletParserLocaleTest.java b/jdk/test/javax/management/loading/MletParserLocaleTest.java new file mode 100644 index 00000000000..b541e57a149 --- /dev/null +++ b/jdk/test/javax/management/loading/MletParserLocaleTest.java @@ -0,0 +1,109 @@ +/* + * 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 7065236 + * @summary Checking MletParser for Locale insensitive strings + * @author Harsha Wardhana B + * @modules java.management + * @run clean MletParserLocaleTest + * @run build MletParserLocaleTest + * @run main/othervm/timeout=5 MletParserLocaleTest mlet4.html + */ + +import java.io.File; +import java.util.Locale; +import javax.management.MBeanServer; +import javax.management.MBeanServerFactory; +import javax.management.ObjectName; +import javax.management.loading.MLet; + +public class MletParserLocaleTest { + + public static void main(String[] args) throws Exception { + + boolean error = false; + + // Instantiate the MBean server + // + System.out.println("Create the MBean server"); + MBeanServer mbs = MBeanServerFactory.createMBeanServer(); + + // Get Default Locale + Locale loc = Locale.getDefault(); + + // Instantiate an MLet + // + System.out.println("Create the MLet"); + MLet mlet = new MLet(); + + // Register the MLet MBean with the MBeanServer + // + System.out.println("Register the MLet MBean"); + ObjectName mletObjectName = new ObjectName("Test:type=MLet"); + mbs.registerMBean(mlet, mletObjectName); + + // Call getMBeansFromURL + // + System.out.println("Call mlet.getMBeansFromURL()"); + String testSrc = System.getProperty("test.src"); + System.out.println("test.src = " + testSrc); + String urlCodebase; + if (testSrc.startsWith("/")) { + urlCodebase = + "file:" + testSrc.replace(File.separatorChar, '/') + "/"; + } else { + urlCodebase = + "file:/" + testSrc.replace(File.separatorChar, '/') + "/"; + } + String mletFile = urlCodebase + args[0]; + System.out.println("MLet File = " + mletFile); + try { + // Change default Locale to Turkish + Locale.setDefault(new Locale("tr", "TR")); + mlet.getMBeansFromURL(mletFile); + System.out.println("Test Passes"); + } catch (Exception e) { + error = true; + e.printStackTrace(System.out); + }finally { + Locale.setDefault(loc); + } + + // Unregister the MLet MBean + // + System.out.println("Unregister the MLet MBean"); + mbs.unregisterMBean(mletObjectName); + + // Release MBean server + // + System.out.println("Release the MBean server"); + MBeanServerFactory.releaseMBeanServer(mbs); + + // End Test + // + System.out.println("Bye! Bye!"); + if (error) System.exit(1); + } +} diff --git a/jdk/test/javax/management/loading/mlet4.html b/jdk/test/javax/management/loading/mlet4.html new file mode 100644 index 00000000000..522ab27252d --- /dev/null +++ b/jdk/test/javax/management/loading/mlet4.html @@ -0,0 +1,2 @@ + + diff --git a/jdk/test/javax/management/modelmbean/DescriptorSupportXMLLocaleTest.java b/jdk/test/javax/management/modelmbean/DescriptorSupportXMLLocaleTest.java new file mode 100644 index 00000000000..402bff7f6e0 --- /dev/null +++ b/jdk/test/javax/management/modelmbean/DescriptorSupportXMLLocaleTest.java @@ -0,0 +1,64 @@ +/* + * 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 7065236 + * @summary Test for locale insensitive strings in DescriptorSupport class + * @author Harsha Wardhana B + * @modules java.management + * @run clean DescriptorSupportXMLLocaleTest + * @run build DescriptorSupportXMLLocaleTest + * @run main DescriptorSupportXMLLocaleTest + */ +import java.util.Locale; +import javax.management.modelmbean.DescriptorSupport; + +public class DescriptorSupportXMLLocaleTest { + + public static void main(String[] args) throws Exception { + boolean failed = false; + String xmlDesc = "" + + "" + + "" + + ""; + Locale loc = Locale.getDefault(); + try { + Locale.setDefault(new Locale("tr", "TR")); + new DescriptorSupport(xmlDesc); + } catch (Exception e) { + e.printStackTrace(System.out); + failed = true; + }finally{ + Locale.setDefault(loc); + } + + if (!failed) { + System.out.println("OK: all tests passed"); + } else { + System.out.println("TEST FAILED"); + throw new IllegalArgumentException("Test Failed"); + } + } +} + diff --git a/jdk/test/javax/management/remote/mandatory/connection/JMXServiceURLLocaleTest.java b/jdk/test/javax/management/remote/mandatory/connection/JMXServiceURLLocaleTest.java new file mode 100644 index 00000000000..4ff6020ea41 --- /dev/null +++ b/jdk/test/javax/management/remote/mandatory/connection/JMXServiceURLLocaleTest.java @@ -0,0 +1,68 @@ +/* + * 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 7065236 + * @summary Test for locale insensitive strings in JMXServiceURL class + * @author Harsha Wardhana B + * @modules java.management + * @run clean JMXServiceURLLocaleTest + * @run build JMXServiceURLLocaleTest + * @run main JMXServiceURLLocaleTest +*/ + +import java.util.Locale; +import javax.management.remote.JMXServiceURL; + +public class JMXServiceURLLocaleTest { + public static void main(String[] args) throws Exception { + + boolean error = false; + Locale loc = Locale.getDefault(); + + try { + echo("Setting Turkish locale"); + // Set locale other than Locale.ENGLISH + Locale.setDefault(new Locale("tr", "TR")); + new JMXServiceURL("service:jmx:RMI://"); + } catch (Exception e) { + e.printStackTrace(System.out); + error = true; + } finally { + Locale.setDefault(loc); + echo("\n>>> Bye! Bye!"); + } + + if (error) { + echo("\nTest failed! "); + throw new IllegalArgumentException("Test failed"); + } else { + echo("\nTest passed!\n"); + } + } + + private static void echo(String msg) { + System.out.println(msg); + } +} From 91e7b0bd8ae86caa71b1012df40c62586749ce1e Mon Sep 17 00:00:00 2001 From: Harsha Wardhana B Date: Mon, 4 Jan 2016 13:49:11 +0100 Subject: [PATCH 194/228] 6744127: NullPointerException at com.sun.tools.jdi.EventRequestManagerImpl.request Reviewed-by: jbachorik, sspitsyn --- .../tools/jdi/EventRequestManagerImpl.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java index 93c10f0b00f..6f928785255 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -43,7 +43,7 @@ import java.util.*; class EventRequestManagerImpl extends MirrorImpl implements EventRequestManager { - List[] requestLists; + private final List[] requestLists; private static int methodExitEventCmd = 0; static int JDWPtoJDISuspendPolicy(byte jdwpPolicy) { @@ -83,7 +83,7 @@ class EventRequestManagerImpl extends MirrorImpl return System.identityHashCode(this); } - abstract class EventRequestImpl extends MirrorImpl implements EventRequest { + private abstract class EventRequestImpl extends MirrorImpl implements EventRequest { int id; /* @@ -734,7 +734,7 @@ class EventRequestManagerImpl extends MirrorImpl } requestLists = new List[highest+1]; for (int i=0; i <= highest; i++) { - requestLists[i] = new ArrayList<>(); + requestLists[i] = Collections.synchronizedList(new ArrayList<>()); } } @@ -933,22 +933,27 @@ class EventRequestManagerImpl extends MirrorImpl } List unmodifiableRequestList(int eventCmd) { - return Collections.unmodifiableList(requestList(eventCmd)); + // No need of explicit synchronization for requestList here. + // It is taken care internally by SynchronizedList class. + return Collections.unmodifiableList(new ArrayList<>(requestList(eventCmd))); } EventRequest request(int eventCmd, int requestId) { List rl = requestList(eventCmd); - for (int i = rl.size() - 1; i >= 0; i--) { - EventRequestImpl er = (EventRequestImpl)rl.get(i); - if (er.id == requestId) { - return er; + synchronized(rl) { // Refer Collections.synchronizedList javadoc. + Iterator itr = rl.iterator(); + while (itr.hasNext()){ + EventRequestImpl er = (EventRequestImpl)itr.next(); + if (er.id == requestId) + return er; } } return null; } - List requestList(int eventCmd) { + private List requestList(int eventCmd) { return requestLists[eventCmd]; } } + From 4e9dd68311456a5260292bc232c0dc80416ecf2f Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Mon, 4 Jan 2016 13:57:34 -0800 Subject: [PATCH 195/228] 8145593: Clean up metaspaceShared.cpp Reviewed-by: jiangli --- hotspot/src/share/vm/memory/filemap.hpp | 3 + hotspot/src/share/vm/memory/metaspace.cpp | 2 +- .../src/share/vm/memory/metaspaceShared.cpp | 165 ++++++++---------- .../src/share/vm/memory/metaspaceShared.hpp | 42 ++++- 4 files changed, 113 insertions(+), 99 deletions(-) diff --git a/hotspot/src/share/vm/memory/filemap.hpp b/hotspot/src/share/vm/memory/filemap.hpp index 8c725cdac02..9752e5ddf75 100644 --- a/hotspot/src/share/vm/memory/filemap.hpp +++ b/hotspot/src/share/vm/memory/filemap.hpp @@ -100,6 +100,7 @@ public: Universe::NARROW_OOP_MODE _narrow_oop_mode; // compressed oop encoding mode int _narrow_klass_shift; // save narrow klass base and shift address _narrow_klass_base; + char* _misc_data_patching_start; struct space_info { int _crc; // crc checksum of the current space @@ -185,6 +186,8 @@ public: int narrow_klass_shift() const { return _header->_narrow_klass_shift; } size_t space_capacity(int i) { return _header->_space[i]._capacity; } struct FileMapHeader* header() { return _header; } + char* misc_data_patching_start() { return _header->_misc_data_patching_start; } + void set_misc_data_patching_start(char* p) { _header->_misc_data_patching_start = p; } static FileMapInfo* current_info() { CDS_ONLY(return _current_info;) diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index a59bf063d51..f430b446c04 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -421,7 +421,7 @@ VirtualSpaceNode::VirtualSpaceNode(size_t bytes) : _top(NULL), _next(NULL), _rs( // Get a mmap region anywhere if the SharedBaseAddress fails. _rs = ReservedSpace(bytes, Metaspace::reserve_alignment(), large_pages); } - MetaspaceShared::set_shared_rs(&_rs); + MetaspaceShared::initialize_shared_rs(&_rs); } else #endif { diff --git a/hotspot/src/share/vm/memory/metaspaceShared.cpp b/hotspot/src/share/vm/memory/metaspaceShared.cpp index a703ad4e607..d71f9292511 100644 --- a/hotspot/src/share/vm/memory/metaspaceShared.cpp +++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp @@ -57,6 +57,48 @@ bool MetaspaceShared::_link_classes_made_progress; bool MetaspaceShared::_check_classes_made_progress; bool MetaspaceShared::_has_error_classes; bool MetaspaceShared::_archive_loading_failed = false; +SharedMiscRegion MetaspaceShared::_mc; +SharedMiscRegion MetaspaceShared::_md; + +void SharedMiscRegion::initialize(ReservedSpace rs, size_t committed_byte_size, SharedSpaceType space_type) { + _vs.initialize(rs, committed_byte_size); + _alloc_top = _vs.low(); + _space_type = space_type; +} + +// NOT thread-safe, but this is called during dump time in single-threaded mode. +char* SharedMiscRegion::alloc(size_t num_bytes) { + assert(DumpSharedSpaces, "dump time only"); + size_t alignment = sizeof(char*); + num_bytes = align_size_up(num_bytes, alignment); + _alloc_top = (char*)align_ptr_up(_alloc_top, alignment); + if (_alloc_top + num_bytes > _vs.high()) { + report_out_of_shared_space(_space_type); + } + + char* p = _alloc_top; + _alloc_top += num_bytes; + + memset(p, 0, num_bytes); + return p; +} + +void MetaspaceShared::initialize_shared_rs(ReservedSpace* rs) { + assert(DumpSharedSpaces, "dump time only"); + _shared_rs = rs; + + // Split up and initialize the misc code and data spaces + size_t metadata_size = SharedReadOnlySize + SharedReadWriteSize; + ReservedSpace shared_ro_rw = _shared_rs->first_part(metadata_size); + ReservedSpace misc_section = _shared_rs->last_part(metadata_size); + + // Now split into misc sections. + ReservedSpace md_rs = misc_section.first_part(SharedMiscDataSize); + ReservedSpace mc_rs = misc_section.last_part(SharedMiscDataSize); + _md.initialize(md_rs, SharedMiscDataSize, SharedMiscData); + _mc.initialize(mc_rs, SharedMiscCodeSize, SharedMiscData); +} + // Read/write a data stream for restoring/preserving metadata pointers and // miscellaneous data from/to the shared archive file. @@ -429,64 +471,17 @@ private: VirtualSpace _mc_vs; CompactHashtableWriter* _string_cht; GrowableArray *_string_regions; - char* _md_alloc_low; - char* _md_alloc_top; - char* _md_alloc_max; - static VM_PopulateDumpSharedSpace* _instance; public: VM_PopulateDumpSharedSpace(ClassLoaderData* loader_data, GrowableArray *class_promote_order) : _loader_data(loader_data) { - // Split up and initialize the misc code and data spaces - ReservedSpace* shared_rs = MetaspaceShared::shared_rs(); - size_t metadata_size = SharedReadOnlySize + SharedReadWriteSize; - ReservedSpace shared_ro_rw = shared_rs->first_part(metadata_size); - ReservedSpace misc_section = shared_rs->last_part(metadata_size); - - // Now split into misc sections. - ReservedSpace md_rs = misc_section.first_part(SharedMiscDataSize); - ReservedSpace mc_rs = misc_section.last_part(SharedMiscDataSize); - _md_vs.initialize(md_rs, SharedMiscDataSize); - _mc_vs.initialize(mc_rs, SharedMiscCodeSize); _class_promote_order = class_promote_order; - - _md_alloc_low = _md_vs.low(); - _md_alloc_top = _md_alloc_low + sizeof(char*); - _md_alloc_max = _md_vs.low() + SharedMiscDataSize; - - assert(_instance == NULL, "must be singleton"); - _instance = this; - } - - ~VM_PopulateDumpSharedSpace() { - assert(_instance == this, "must be singleton"); - _instance = NULL; - } - - static VM_PopulateDumpSharedSpace* instance() { - assert(_instance != NULL, "sanity"); - return _instance; } VMOp_Type type() const { return VMOp_PopulateDumpSharedSpace; } void doit(); // outline because gdb sucks - char* misc_data_space_alloc(size_t num_bytes) { - size_t alignment = sizeof(char*); - num_bytes = align_size_up(num_bytes, alignment); - _md_alloc_top = (char*)align_ptr_up(_md_alloc_top, alignment); - if (_md_alloc_top + num_bytes > _md_alloc_max) { - report_out_of_shared_space(SharedMiscData); - } - - char* p = _md_alloc_top; - _md_alloc_top += num_bytes; - - memset(p, 0, num_bytes); - return p; - } - private: void handle_misc_data_space_failure(bool success) { if (!success) { @@ -495,8 +490,6 @@ private: } }; // class VM_PopulateDumpSharedSpace -VM_PopulateDumpSharedSpace* VM_PopulateDumpSharedSpace::_instance; - void VM_PopulateDumpSharedSpace::doit() { Thread* THREAD = VMThread::vm_thread(); NOT_PRODUCT(SystemDictionary::verify();) @@ -555,17 +548,15 @@ void VM_PopulateDumpSharedSpace::doit() { tty->print_cr("done. "); // Set up the share data and shared code segments. + _md_vs = *MetaspaceShared::misc_data_region()->virtual_space(); + _mc_vs = *MetaspaceShared::misc_code_region()->virtual_space(); char* md_low = _md_vs.low(); - char* md_top = md_low; + char* md_top = MetaspaceShared::misc_data_region()->alloc_top(); char* md_end = _md_vs.high(); char* mc_low = _mc_vs.low(); - char* mc_top = mc_low; + char* mc_top = MetaspaceShared::misc_code_region()->alloc_top(); char* mc_end = _mc_vs.high(); - assert(_md_alloc_top != NULL, "sanity"); - *(char**)_md_alloc_low = _md_alloc_top; - md_top = _md_alloc_top; - // Reserve space for the list of Klass*s whose vtables are used // for patching others as needed. @@ -681,36 +672,32 @@ void VM_PopulateDumpSharedSpace::doit() { FileMapInfo* mapinfo = new FileMapInfo(); mapinfo->populate_header(MetaspaceShared::max_alignment()); + mapinfo->set_misc_data_patching_start((char*)vtbl_list); - // Pass 1 - update file offsets in header. - mapinfo->write_header(); - mapinfo->write_space(MetaspaceShared::ro, _loader_data->ro_metaspace(), true); - mapinfo->write_space(MetaspaceShared::rw, _loader_data->rw_metaspace(), false); - mapinfo->write_region(MetaspaceShared::md, _md_vs.low(), - pointer_delta(md_top, _md_vs.low(), sizeof(char)), - SharedMiscDataSize, - false, false); - mapinfo->write_region(MetaspaceShared::mc, _mc_vs.low(), - pointer_delta(mc_top, _mc_vs.low(), sizeof(char)), - SharedMiscCodeSize, - true, true); - mapinfo->write_string_regions(_string_regions); - - // Pass 2 - write data. - mapinfo->open_for_write(); - mapinfo->set_header_crc(mapinfo->compute_header_crc()); - mapinfo->write_header(); - mapinfo->write_space(MetaspaceShared::ro, _loader_data->ro_metaspace(), true); - mapinfo->write_space(MetaspaceShared::rw, _loader_data->rw_metaspace(), false); - mapinfo->write_region(MetaspaceShared::md, _md_vs.low(), - pointer_delta(md_top, _md_vs.low(), sizeof(char)), - SharedMiscDataSize, - false, false); - mapinfo->write_region(MetaspaceShared::mc, _mc_vs.low(), - pointer_delta(mc_top, _mc_vs.low(), sizeof(char)), - SharedMiscCodeSize, - true, true); - mapinfo->write_string_regions(_string_regions); + for (int pass=1; pass<=2; pass++) { + if (pass == 1) { + // The first pass doesn't actually write the data to disk. All it + // does is to update the fields in the mapinfo->_header. + } else { + // After the first pass, the contents of mapinfo->_header are finalized, + // so we can compute the header's CRC, and write the contents of the header + // and the regions into disk. + mapinfo->open_for_write(); + mapinfo->set_header_crc(mapinfo->compute_header_crc()); + } + mapinfo->write_header(); + mapinfo->write_space(MetaspaceShared::ro, _loader_data->ro_metaspace(), true); + mapinfo->write_space(MetaspaceShared::rw, _loader_data->rw_metaspace(), false); + mapinfo->write_region(MetaspaceShared::md, _md_vs.low(), + pointer_delta(md_top, _md_vs.low(), sizeof(char)), + SharedMiscDataSize, + false, false); + mapinfo->write_region(MetaspaceShared::mc, _mc_vs.low(), + pointer_delta(mc_top, _mc_vs.low(), sizeof(char)), + SharedMiscCodeSize, + true, true); + mapinfo->write_string_regions(_string_regions); + } mapinfo->close(); @@ -938,11 +925,6 @@ bool MetaspaceShared::try_link_class(InstanceKlass* ik, TRAPS) { } } -// Allocate misc data blocks during dumping. -char* MetaspaceShared::misc_data_space_alloc(size_t num_bytes) { - return VM_PopulateDumpSharedSpace::instance()->misc_data_space_alloc(num_bytes); -} - // Closure for serializing initialization data in from a data area // (ptr_array) read from the shared file. @@ -1065,10 +1047,7 @@ bool MetaspaceShared::map_shared_spaces(FileMapInfo* mapinfo) { void MetaspaceShared::initialize_shared_spaces() { FileMapInfo *mapinfo = FileMapInfo::current_info(); - - char* buffer = mapinfo->header()->region_addr(md); - - buffer = *((char**)buffer); // skip over the md_alloc'ed blocks + char* buffer = mapinfo->misc_data_patching_start(); // Skip over (reserve space for) a list of addresses of C++ vtables // for Klass objects. They get filled in later. diff --git a/hotspot/src/share/vm/memory/metaspaceShared.hpp b/hotspot/src/share/vm/memory/metaspaceShared.hpp index bfefce6396a..dac447c9e05 100644 --- a/hotspot/src/share/vm/memory/metaspaceShared.hpp +++ b/hotspot/src/share/vm/memory/metaspaceShared.hpp @@ -97,6 +97,26 @@ public: CompactHashtableStats string; }; +class SharedMiscRegion VALUE_OBJ_CLASS_SPEC { +private: + VirtualSpace _vs; + char* _alloc_top; + SharedSpaceType _space_type; + +public: + void initialize(ReservedSpace rs, size_t committed_byte_size, SharedSpaceType space_type); + VirtualSpace* virtual_space() { + return &_vs; + } + char* low() const { + return _vs.low(); + } + char* alloc_top() const { + return _alloc_top; + } + char* alloc(size_t num_bytes) NOT_CDS_RETURN_(NULL); +}; + // Class Data Sharing Support class MetaspaceShared : AllStatic { @@ -108,6 +128,10 @@ class MetaspaceShared : AllStatic { static bool _check_classes_made_progress; static bool _has_error_classes; static bool _archive_loading_failed; + + // Used only during dumping. + static SharedMiscRegion _md; + static SharedMiscRegion _mc; public: enum { vtbl_list_size = DEFAULT_VTBL_LIST_SIZE, @@ -149,9 +173,7 @@ class MetaspaceShared : AllStatic { NOT_CDS(return NULL); } - static void set_shared_rs(ReservedSpace* rs) { - CDS_ONLY(_shared_rs = rs;) - } + static void initialize_shared_rs(ReservedSpace* rs) NOT_CDS_RETURN; static void set_archive_loading_failed() { _archive_loading_failed = true; @@ -191,7 +213,17 @@ class MetaspaceShared : AllStatic { static int count_class(const char* classlist_file); static void estimate_regions_size() NOT_CDS_RETURN; - // Allocate a block of memory from the "md" region. - static char* misc_data_space_alloc(size_t num_bytes); + // Allocate a block of memory from the "mc" or "md" regions. + static char* misc_code_space_alloc(size_t num_bytes) { return _mc.alloc(num_bytes); } + static char* misc_data_space_alloc(size_t num_bytes) { return _md.alloc(num_bytes); } + + static SharedMiscRegion* misc_code_region() { + assert(DumpSharedSpaces, "used during dumping only"); + return &_mc; + } + static SharedMiscRegion* misc_data_region() { + assert(DumpSharedSpaces, "used during dumping only"); + return &_md; + } }; #endif // SHARE_VM_MEMORY_METASPACESHARED_HPP From 9ab99c633d8fca25edb11b65be746a4904645ec5 Mon Sep 17 00:00:00 2001 From: Rachel Protacio Date: Tue, 5 Jan 2016 18:23:14 +0000 Subject: [PATCH 196/228] 8146481: Disable runtime/logging/DefaultMethodsTest.java @ignore'd DefaultMethodsTest.java Reviewed-by: gtriantafill, coleenp, hseigel --- hotspot/test/runtime/logging/DefaultMethodsTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/test/runtime/logging/DefaultMethodsTest.java b/hotspot/test/runtime/logging/DefaultMethodsTest.java index 007da7bf8fb..4b422580895 100644 --- a/hotspot/test/runtime/logging/DefaultMethodsTest.java +++ b/hotspot/test/runtime/logging/DefaultMethodsTest.java @@ -26,6 +26,7 @@ * @bug 8139564 * @summary defaultmethods=debug should have logging from each of the statements in the code * @library /testlibrary + * @ignore 8146435 * @modules java.base/sun.misc * java.management * @run driver DefaultMethodsTest From c1d5c540ac473ca0c38d3c4dfd2e4e41a9cb9783 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Tue, 5 Jan 2016 10:57:15 -1000 Subject: [PATCH 197/228] 8146001: Remove support for command line options from JVMCI Reviewed-by: twisti --- hotspot/.mx.jvmci/mx_jvmci.py | 21 - hotspot/.mx.jvmci/suite.py | 56 +- hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk | 21 +- .../HotSpotConstantReflectionProvider.java | 44 +- .../vm/ci/hotspot/HotSpotJVMCIRuntime.java | 17 + .../hotspot/HotSpotResolvedJavaFieldImpl.java | 15 +- .../ci/hotspot/HotSpotResolvedJavaMethod.java | 10 - .../HotSpotResolvedJavaMethodImpl.java | 3 +- .../ci/meta/ConstantReflectionProvider.java | 18 +- .../javax.annotation.processing.Processor | 1 - .../ci/options/processor/OptionProcessor.java | 369 ------------- .../jdk/vm/ci/options/DerivedOptionValue.java | 59 --- .../ci/options/NestedBooleanOptionValue.java | 58 --- .../src/jdk/vm/ci/options/Option.java | 55 -- .../jdk/vm/ci/options/OptionDescriptor.java | 102 ---- .../jdk/vm/ci/options/OptionDescriptors.java | 34 -- .../src/jdk/vm/ci/options/OptionType.java | 44 -- .../src/jdk/vm/ci/options/OptionValue.java | 484 ------------------ .../src/jdk/vm/ci/options/OptionsLoader.java | 47 -- .../src/jdk/vm/ci/options/OptionsParser.java | 382 -------------- .../jdk/vm/ci/options/StableOptionValue.java | 75 --- hotspot/src/share/vm/jvmci/jvmciRuntime.cpp | 81 --- hotspot/src/share/vm/jvmci/jvmciRuntime.hpp | 16 - hotspot/src/share/vm/runtime/arguments.cpp | 6 - hotspot/src/share/vm/runtime/thread.cpp | 1 - .../test/NestedBooleanOptionValueTest.java | 143 ------ .../vm/ci/options/test/TestOptionValue.java | 141 ----- .../jdk/vm/ci/runtime/test/TypeUniverse.java | 4 +- 28 files changed, 49 insertions(+), 2258 deletions(-) delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/META-INF/services/javax.annotation.processing.Processor delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/jdk/vm/ci/options/processor/OptionProcessor.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/DerivedOptionValue.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/NestedBooleanOptionValue.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/Option.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptor.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptors.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionType.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionValue.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsLoader.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsParser.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/StableOptionValue.java delete mode 100644 hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java delete mode 100644 hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java diff --git a/hotspot/.mx.jvmci/mx_jvmci.py b/hotspot/.mx.jvmci/mx_jvmci.py index 0e3ac639bb3..d1069e6284c 100644 --- a/hotspot/.mx.jvmci/mx_jvmci.py +++ b/hotspot/.mx.jvmci/mx_jvmci.py @@ -677,12 +677,6 @@ class JVMCIArchiveParticipant: assert service self.services.setdefault(service, []).append(provider) return True - elif arcname.endswith('_OptionDescriptors.class'): - # Need to create service files for the providers of the - # jdk.vm.ci.options.Options service created by - # jdk.vm.ci.options.processor.OptionProcessor. - provider = arcname[:-len('.class'):].replace('/', '.') - self.services.setdefault('jdk.vm.ci.options.OptionDescriptors', []).append(provider) return False def __addsrc__(self, arcname, contents): @@ -761,21 +755,6 @@ class JVMCI9JDKConfig(mx.JDKConfig): if jacocoArgs: args = jacocoArgs + args - # Support for -G: options - def translateGOption(arg): - if arg.startswith('-G:+'): - if '=' in arg: - mx.abort('Mixing + and = in -G: option specification: ' + arg) - arg = '-Djvmci.option.' + arg[len('-G:+'):] + '=true' - elif arg.startswith('-G:-'): - if '=' in arg: - mx.abort('Mixing - and = in -G: option specification: ' + arg) - arg = '-Djvmci.option.' + arg[len('-G:+'):] + '=false' - elif arg.startswith('-G:'): - arg = '-Djvmci.option.' + arg[len('-G:'):] - return arg - args = map(translateGOption, args) - args = ['-Xbootclasspath/p:' + dep.classpath_repr() for dep in _jvmci_bootclasspath_prepends] + args jvmciModeArgs = _jvmciModes[_vm.jvmciMode] diff --git a/hotspot/.mx.jvmci/suite.py b/hotspot/.mx.jvmci/suite.py index cd6eac41bd1..05d0027a8bb 100644 --- a/hotspot/.mx.jvmci/suite.py +++ b/hotspot/.mx.jvmci/suite.py @@ -109,7 +109,6 @@ suite = { "jdk.vm.ci.code", ], "checkstyle" : "jdk.vm.ci.service", - "annotationProcessors" : ["JVMCI_OPTIONS_PROCESSOR"], "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, @@ -135,38 +134,6 @@ suite = { "workingSets" : "JVMCI", }, - "jdk.vm.ci.options" : { - "subDir" : "src/jdk.vm.ci/share/classes", - "sourceDirs" : ["src"], - "checkstyle" : "jdk.vm.ci.service", - "dependencies" : ["jdk.vm.ci.inittimer"], - "javaCompliance" : "1.8", - "workingSets" : "JVMCI", - }, - - "jdk.vm.ci.options.processor" : { - "subDir" : "src/jdk.vm.ci/share/classes", - "sourceDirs" : ["src"], - "dependencies" : [ - "jdk.vm.ci.options", - ], - "checkstyle" : "jdk.vm.ci.service", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,Codegen", - }, - - "jdk.vm.ci.options.test" : { - "subDir" : "test/compiler/jvmci", - "sourceDirs" : ["src"], - "dependencies" : [ - "jdk.vm.ci.options", - "mx:JUNIT", - ], - "checkstyle" : "jdk.vm.ci.service", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI", - }, - # ------------- JVMCI:HotSpot ------------- "jdk.vm.ci.aarch64" : { @@ -200,15 +167,12 @@ suite = { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : [ - "jdk.vm.ci.options", "jdk.vm.ci.hotspotvmconfig", "jdk.vm.ci.common", + "jdk.vm.ci.inittimer", "jdk.vm.ci.runtime", "jdk.vm.ci.service", ], - "annotationProcessors" : [ - "JVMCI_OPTIONS_PROCESSOR", - ], "checkstyle" : "jdk.vm.ci.service", "javaCompliance" : "1.8", "workingSets" : "JVMCI", @@ -282,11 +246,6 @@ suite = { "dependencies" : ["jdk.vm.ci.service"], }, - "JVMCI_OPTIONS" : { - "subDir" : "src/jdk.vm.ci/share/classes", - "dependencies" : ["jdk.vm.ci.options"], - }, - "JVMCI_API" : { "subDir" : "src/jdk.vm.ci/share/classes", "dependencies" : [ @@ -298,7 +257,6 @@ suite = { "jdk.vm.ci.sparc", ], "distDependencies" : [ - "JVMCI_OPTIONS", "JVMCI_SERVICE", ], }, @@ -327,7 +285,6 @@ suite = { "JVMCI_TEST" : { "subDir" : "test/compiler/jvmci", "dependencies" : [ - "jdk.vm.ci.options.test", "jdk.vm.ci.runtime.test", ], "distDependencies" : [ @@ -336,13 +293,6 @@ suite = { "exclude" : ["mx:JUNIT"], }, - "JVMCI_OPTIONS_PROCESSOR" : { - "subDir" : "src/jdk.vm.ci/share/classes", - "dependencies" : ["jdk.vm.ci.options.processor"], - "distDependencies" : [ - "JVMCI_OPTIONS", - ], - }, "JVMCI_SERVICE_PROCESSOR" : { "subDir" : "src/jdk.vm.ci/share/classes", @@ -358,15 +308,12 @@ suite = { "subDir" : "src/jdk.vm.ci/share/classes", "overlaps" : [ "JVMCI_API", - "JVMCI_OPTIONS", "JVMCI_SERVICE", "JVMCI_HOTSPOT", "JVMCI_HOTSPOTVMCONFIG", "JVMCI_SERVICE_PROCESSOR", - "JVMCI_OPTIONS_PROCESSOR" ], "dependencies" : [ - "jdk.vm.ci.options", "jdk.vm.ci.service", "jdk.vm.ci.inittimer", "jdk.vm.ci.runtime", @@ -378,7 +325,6 @@ suite = { "jdk.vm.ci.hotspot.aarch64", "jdk.vm.ci.hotspot.amd64", "jdk.vm.ci.hotspot.sparc", - "jdk.vm.ci.options.processor", "jdk.vm.ci.service.processor" ], }, diff --git a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk index 1d9fd149467..969330eec19 100644 --- a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk +++ b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk @@ -36,15 +36,6 @@ SRC_DIR := $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes ################################################################################ # Compile the annotation processor -$(eval $(call SetupJavaCompilation, BUILD_JVMCI_OPTIONS, \ - SETUP := GENERATE_OLDBYTECODE, \ - SRC := $(SRC_DIR)/jdk.vm.ci.options/src \ - $(SRC_DIR)/jdk.vm.ci.options.processor/src \ - $(SRC_DIR)/jdk.vm.ci.inittimer/src, \ - BIN := $(BUILDTOOLS_OUTPUTDIR)/jvmci_options, \ - JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.ci.options.jar, \ -)) - $(eval $(call SetupJavaCompilation, BUILD_JVMCI_SERVICE, \ SETUP := GENERATE_OLDBYTECODE, \ SRC := $(SRC_DIR)/jdk.vm.ci.service/src \ @@ -70,11 +61,10 @@ PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS))) ALL_SRC_DIRS := $(wildcard $(SRC_DIR)/*/src) SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS)) PROCESSOR_PATH := $(call PathList, \ - $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.ci.options.jar \ $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.ci.service.jar) $(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) \ - $(BUILD_JVMCI_OPTIONS) $(BUILD_JVMCI_SERVICE) + $(BUILD_JVMCI_SERVICE) $(MKDIR) -p $(@D) $(eval $(call ListPathsSafely,PROC_SRCS,$(@D)/_gensrc_proc_files)) $(JAVA_SMALL) $(NEW_JAVAC) \ @@ -92,15 +82,6 @@ TARGETS += $(GENSRC_DIR)/_gensrc_proc_done ################################################################################ -$(GENSRC_DIR)/META-INF/services/jdk.vm.ci.options.OptionDescriptors: \ - $(GENSRC_DIR)/_gensrc_proc_done - $(MKDIR) -p $(@D) - $(FIND) $(GENSRC_DIR) -name '*_OptionDescriptors.java' | $(SED) 's:.*/jdk\.vm\.ci/\(.*\)\.java:\1:' | $(TR) '/' '.' > $@ - -TARGETS += $(GENSRC_DIR)/META-INF/services/jdk.vm.ci.options.OptionDescriptors - -################################################################################ - $(GENSRC_DIR)/_providers_converted: $(GENSRC_DIR)/_gensrc_proc_done $(MKDIR) -p $(GENSRC_DIR)/META-INF/services ($(CD) $(GENSRC_DIR)/META-INF/jvmci.providers && \ diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java index ef2261de039..ffe53825947 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java @@ -30,28 +30,22 @@ import java.lang.reflect.Array; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.JavaField; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.MemoryAccessProvider; import jdk.vm.ci.meta.MethodHandleAccessProvider; +import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.meta.ResolvedJavaType; -import jdk.vm.ci.options.Option; -import jdk.vm.ci.options.OptionType; -import jdk.vm.ci.options.OptionValue; -import jdk.vm.ci.options.StableOptionValue; /** * HotSpot implementation of {@link ConstantReflectionProvider}. */ public class HotSpotConstantReflectionProvider implements ConstantReflectionProvider, HotSpotProxified { - static class Options { - //@formatter:off - @Option(help = "Constant fold final fields with default values.", type = OptionType.Debug) - public static final OptionValue TrustFinalDefaultFields = new OptionValue<>(true); - //@formatter:on - } + /** + * Determines whether to treat {@code final} fields with default values as constant. + */ + private static final boolean TrustFinalDefaultFields = HotSpotJVMCIRuntime.getBooleanProperty("TrustFinalDefaultFields", true); protected final HotSpotJVMCIRuntimeProvider runtime; protected final HotSpotMethodHandleAccessProvider methodHandleAccess; @@ -239,7 +233,7 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv /** * Determines if a static field is constant for the purpose of - * {@link #readConstantFieldValue(JavaField, JavaConstant)}. + * {@link #readConstantFieldValue(ResolvedJavaField, JavaConstant)}. */ protected boolean isStaticFieldConstant(HotSpotResolvedJavaField staticField) { if (staticField.isFinal() || (staticField.isStable() && runtime.getConfig().foldStableValues)) { @@ -255,14 +249,14 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv * Determines if a value read from a {@code final} instance field is considered constant. The * implementation in {@link HotSpotConstantReflectionProvider} returns true if {@code value} is * not the {@link JavaConstant#isDefaultForKind default value} for its kind or if - * {@link Options#TrustFinalDefaultFields} is true. + * {@link #TrustFinalDefaultFields} is true. * * @param value a value read from a {@code final} instance field * @param receiverClass the {@link Object#getClass() class} of object from which the * {@code value} was read */ protected boolean isFinalInstanceFieldValueConstant(JavaConstant value, Class receiverClass) { - return !value.isDefaultForKind() || Options.TrustFinalDefaultFields.getValue(); + return !value.isDefaultForKind() || TrustFinalDefaultFields; } /** @@ -278,13 +272,7 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv return !value.isDefaultForKind(); } - /** - * {@inheritDoc} - *

    - * The {@code value} field in {@link OptionValue} is considered constant if the type of - * {@code receiver} is (assignable to) {@link StableOptionValue}. - */ - public JavaConstant readConstantFieldValue(JavaField field, JavaConstant receiver) { + public JavaConstant readConstantFieldValue(ResolvedJavaField field, JavaConstant receiver) { HotSpotResolvedJavaField hotspotField = (HotSpotResolvedJavaField) field; if (hotspotField.isStatic()) { @@ -319,21 +307,13 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv return value; } } - } else { - Class clazz = object.getClass(); - if (StableOptionValue.class.isAssignableFrom(clazz)) { - if (hotspotField.isInObject(object) && hotspotField.getName().equals("value")) { - StableOptionValue option = (StableOptionValue) object; - return HotSpotObjectConstantImpl.forObject(option.getValue()); - } - } } } } return null; } - public JavaConstant readFieldValue(JavaField field, JavaConstant receiver) { + public JavaConstant readFieldValue(ResolvedJavaField field, JavaConstant receiver) { HotSpotResolvedJavaField hotspotField = (HotSpotResolvedJavaField) field; if (!hotspotField.isStable()) { return readNonStableFieldValue(field, receiver); @@ -344,7 +324,7 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv } } - private JavaConstant readNonStableFieldValue(JavaField field, JavaConstant receiver) { + private JavaConstant readNonStableFieldValue(ResolvedJavaField field, JavaConstant receiver) { HotSpotResolvedJavaField hotspotField = (HotSpotResolvedJavaField) field; if (hotspotField.isStatic()) { HotSpotResolvedJavaType holder = (HotSpotResolvedJavaType) hotspotField.getDeclaringClass(); @@ -359,7 +339,7 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv return null; } - public JavaConstant readStableFieldValue(JavaField field, JavaConstant receiver, boolean isDefaultStable) { + public JavaConstant readStableFieldValue(ResolvedJavaField field, JavaConstant receiver, boolean isDefaultStable) { JavaConstant fieldValue = readNonStableFieldValue(field, receiver); if (fieldValue.isNonNull()) { JavaType declaredType = field.getType(); diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java index 7ea4ebf407d..bf7f255d4db 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @@ -49,6 +49,7 @@ import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; import jdk.vm.ci.runtime.JVMCICompiler; import jdk.vm.ci.service.Services; +import sun.misc.VM; //JaCoCo Exclude @@ -83,6 +84,22 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider, H return DelayedInit.instance; } + /** + * Gets a boolean value based on a system property {@linkplain VM#getSavedProperty(String) + * saved} at system initialization time. The property name is prefixed with "{@code jvmci.}". + * + * @param name the name of the system property to derive a boolean value from using + * {@link Boolean#parseBoolean(String)} + * @param def the value to return if there is no system property corresponding to {@code name} + */ + public static boolean getBooleanProperty(String name, boolean def) { + String value = VM.getSavedProperty("jvmci." + name); + if (value == null) { + return def; + } + return Boolean.parseBoolean(value); + } + public static HotSpotJVMCIBackendFactory findFactory(String architecture) { for (HotSpotJVMCIBackendFactory factory : Services.load(HotSpotJVMCIBackendFactory.class)) { if (factory.getArchitecture().equalsIgnoreCase(architecture)) { diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java index d565dfe4d39..c6f4dabc0fb 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java @@ -35,21 +35,16 @@ import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ModifiersProvider; import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.meta.ResolvedJavaType; -import jdk.vm.ci.options.Option; -import jdk.vm.ci.options.OptionType; -import jdk.vm.ci.options.OptionValue; /** * Represents a field in a HotSpot type. */ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField, HotSpotProxified { - static class Options { - //@formatter:off - @Option(help = "Mark well-known stable fields as such.", type = OptionType.Debug) - public static final OptionValue ImplicitStableValues = new OptionValue<>(true); - //@formatter:on - } + /** + * Mark well-known stable fields as such. + */ + private static final boolean ImplicitStableValues = HotSpotJVMCIRuntime.getBooleanProperty("ImplicitStableValues", true); private final HotSpotResolvedObjectTypeImpl holder; private final String name; @@ -203,7 +198,7 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField, HotSpotP return true; } assert getAnnotation(Stable.class) == null; - if (Options.ImplicitStableValues.getValue() && isImplicitStableField()) { + if (ImplicitStableValues && isImplicitStableField()) { return true; } return false; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java index d1ecdac098d..80635caa7c7 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java @@ -27,22 +27,12 @@ import java.lang.reflect.Modifier; import jdk.vm.ci.meta.JavaMethod; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; -import jdk.vm.ci.options.Option; -import jdk.vm.ci.options.OptionType; -import jdk.vm.ci.options.OptionValue; /** * Implementation of {@link JavaMethod} for resolved HotSpot methods. */ public interface HotSpotResolvedJavaMethod extends ResolvedJavaMethod { - public static class Options { - // @formatter:off - @Option(help = "", type = OptionType.Debug) - public static final OptionValue UseProfilingInformation = new OptionValue<>(true); - // @formatter:on - } - /** * Returns true if this method has a {@code CallerSensitive} annotation. * diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java index 34647ae886c..5999d8c204f 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java @@ -24,7 +24,6 @@ package jdk.vm.ci.hotspot; import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; -import static jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod.Options.UseProfilingInformation; import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; @@ -424,7 +423,7 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp public ProfilingInfo getProfilingInfo(boolean includeNormal, boolean includeOSR) { ProfilingInfo info; - if (UseProfilingInformation.getValue() && methodData == null) { + if (methodData == null) { long metaspaceMethodData = UNSAFE.getAddress(metaspaceMethod + config().methodDataOffset); if (metaspaceMethodData != 0) { methodData = new HotSpotMethodData(metaspaceMethodData, this); diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java index 1db2b98c7ea..33cc2a27ebc 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java @@ -80,29 +80,31 @@ public interface ConstantReflectionProvider { * @return the constant value of this field or {@code null} if this field is not considered * constant by the runtime */ - JavaConstant readConstantFieldValue(JavaField field, JavaConstant receiver); + JavaConstant readConstantFieldValue(ResolvedJavaField field, JavaConstant receiver); /** * Gets the current value of this field for a given object, if available. * * There is no guarantee that the same value will be returned by this method for a field unless - * the field is considered to be {@linkplain #readConstantFieldValue(JavaField, JavaConstant) - * constant} by the runtime. + * the field is considered to be + * {@linkplain #readConstantFieldValue(ResolvedJavaField, JavaConstant) constant} by the + * runtime. * * @param receiver object from which this field's value is to be read. This value is ignored if * this field is static. * @return the value of this field or {@code null} if the value is not available (e.g., because * the field holder is not yet initialized). */ - JavaConstant readFieldValue(JavaField field, JavaConstant receiver); + JavaConstant readFieldValue(ResolvedJavaField field, JavaConstant receiver); /** * Gets the current value of this field for a given object, if available. Like - * {@link #readFieldValue(JavaField, JavaConstant)} but treats array fields as stable. + * {@link #readFieldValue(ResolvedJavaField, JavaConstant)} but treats array fields as stable. * * There is no guarantee that the same value will be returned by this method for a field unless - * the field is considered to be {@linkplain #readConstantFieldValue(JavaField, JavaConstant) - * constant} by the runtime. + * the field is considered to be + * {@linkplain #readConstantFieldValue(ResolvedJavaField, JavaConstant) constant} by the + * runtime. * * @param receiver object from which this field's value is to be read. This value is ignored if * this field is static. @@ -110,7 +112,7 @@ public interface ConstantReflectionProvider { * @return the value of this field or {@code null} if the value is not available (e.g., because * the field holder is not yet initialized). */ - JavaConstant readStableFieldValue(JavaField field, JavaConstant receiver, boolean isDefaultStable); + JavaConstant readStableFieldValue(ResolvedJavaField field, JavaConstant receiver, boolean isDefaultStable); /** * Converts the given {@link JavaKind#isPrimitive() primitive} constant to a boxed diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/META-INF/services/javax.annotation.processing.Processor deleted file mode 100644 index 3aab30fa3c7..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/META-INF/services/javax.annotation.processing.Processor +++ /dev/null @@ -1 +0,0 @@ -jdk.vm.ci.options.processor.OptionProcessor diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/jdk/vm/ci/options/processor/OptionProcessor.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/jdk/vm/ci/options/processor/OptionProcessor.java deleted file mode 100644 index 95422c24135..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/jdk/vm/ci/options/processor/OptionProcessor.java +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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 jdk.vm.ci.options.processor; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.processing.AbstractProcessor; -import javax.annotation.processing.Filer; -import javax.annotation.processing.RoundEnvironment; -import javax.annotation.processing.SupportedAnnotationTypes; -import javax.lang.model.SourceVersion; -import javax.lang.model.element.Element; -import javax.lang.model.element.ElementKind; -import javax.lang.model.element.Modifier; -import javax.lang.model.element.Name; -import javax.lang.model.element.PackageElement; -import javax.lang.model.element.TypeElement; -import javax.lang.model.element.VariableElement; -import javax.lang.model.type.DeclaredType; -import javax.lang.model.type.TypeKind; -import javax.lang.model.type.TypeMirror; -import javax.lang.model.util.Elements; -import javax.lang.model.util.Types; -import javax.tools.Diagnostic.Kind; -import javax.tools.JavaFileObject; - -import jdk.vm.ci.options.Option; -import jdk.vm.ci.options.OptionDescriptor; -import jdk.vm.ci.options.OptionDescriptors; -import jdk.vm.ci.options.OptionValue; - -/** - * Processes static fields annotated with {@link Option}. An {@link OptionDescriptors} - * implementation is generated for each top level class containing at least one such field. The name - * of the generated class for top level class {@code com.foo.Bar} is - * {@code com.foo.Bar_OptionDescriptors}. - */ -@SupportedAnnotationTypes({"jdk.vm.ci.options.Option"}) -public class OptionProcessor extends AbstractProcessor { - - @Override - public SourceVersion getSupportedSourceVersion() { - return SourceVersion.latest(); - } - - private final Set processed = new HashSet<>(); - - private void processElement(Element element, OptionsInfo info) { - - if (!element.getModifiers().contains(Modifier.STATIC)) { - processingEnv.getMessager().printMessage(Kind.ERROR, "Option field must be static", element); - return; - } - - Option annotation = element.getAnnotation(Option.class); - assert annotation != null; - assert element instanceof VariableElement; - assert element.getKind() == ElementKind.FIELD; - VariableElement field = (VariableElement) element; - String fieldName = field.getSimpleName().toString(); - - Elements elements = processingEnv.getElementUtils(); - Types types = processingEnv.getTypeUtils(); - - TypeMirror fieldType = field.asType(); - if (fieldType.getKind() != TypeKind.DECLARED) { - processingEnv.getMessager().printMessage(Kind.ERROR, "Option field must be of type " + OptionValue.class.getName(), element); - return; - } - DeclaredType declaredFieldType = (DeclaredType) fieldType; - - TypeMirror optionValueType = elements.getTypeElement(OptionValue.class.getName()).asType(); - if (!types.isSubtype(fieldType, types.erasure(optionValueType))) { - String msg = String.format("Option field type %s is not a subclass of %s", fieldType, optionValueType); - processingEnv.getMessager().printMessage(Kind.ERROR, msg, element); - return; - } - - if (!field.getModifiers().contains(Modifier.STATIC)) { - processingEnv.getMessager().printMessage(Kind.ERROR, "Option field must be static", element); - return; - } - - String help = annotation.help(); - if (help.length() != 0) { - char firstChar = help.charAt(0); - if (!Character.isUpperCase(firstChar)) { - processingEnv.getMessager().printMessage(Kind.ERROR, "Option help text must start with upper case letter", element); - return; - } - } - - String optionName = annotation.name(); - if (optionName.equals("")) { - optionName = fieldName; - } - - DeclaredType declaredOptionValueType = declaredFieldType; - while (!types.isSameType(types.erasure(declaredOptionValueType), types.erasure(optionValueType))) { - List directSupertypes = types.directSupertypes(declaredFieldType); - assert !directSupertypes.isEmpty(); - declaredOptionValueType = (DeclaredType) directSupertypes.get(0); - } - - assert !declaredOptionValueType.getTypeArguments().isEmpty(); - String optionType = declaredOptionValueType.getTypeArguments().get(0).toString(); - if (optionType.startsWith("java.lang.")) { - optionType = optionType.substring("java.lang.".length()); - } - - Element enclosing = element.getEnclosingElement(); - String declaringClass = ""; - String separator = ""; - Set originatingElementsList = info.originatingElements; - originatingElementsList.add(field); - while (enclosing != null) { - if (enclosing.getKind() == ElementKind.CLASS || enclosing.getKind() == ElementKind.INTERFACE) { - if (enclosing.getModifiers().contains(Modifier.PRIVATE)) { - String msg = String.format("Option field cannot be declared in a private %s %s", enclosing.getKind().name().toLowerCase(), enclosing); - processingEnv.getMessager().printMessage(Kind.ERROR, msg, element); - return; - } - originatingElementsList.add(enclosing); - declaringClass = enclosing.getSimpleName() + separator + declaringClass; - separator = "."; - } else { - assert enclosing.getKind() == ElementKind.PACKAGE; - } - enclosing = enclosing.getEnclosingElement(); - } - - info.options.add(new OptionInfo(optionName, help, optionType, declaringClass, field)); - } - - private void createFiles(OptionsInfo info) { - String pkg = ((PackageElement) info.topDeclaringType.getEnclosingElement()).getQualifiedName().toString(); - Name topDeclaringClass = info.topDeclaringType.getSimpleName(); - Element[] originatingElements = info.originatingElements.toArray(new Element[info.originatingElements.size()]); - - createOptionsDescriptorsFile(info, pkg, topDeclaringClass, originatingElements); - } - - private void createOptionsDescriptorsFile(OptionsInfo info, String pkg, Name topDeclaringClass, Element[] originatingElements) { - String optionsClassName = topDeclaringClass + "_" + OptionDescriptors.class.getSimpleName(); - - Filer filer = processingEnv.getFiler(); - try (PrintWriter out = createSourceFile(pkg, optionsClassName, filer, originatingElements)) { - - out.println("// CheckStyle: stop header check"); - out.println("// CheckStyle: stop line length check"); - out.println("// GENERATED CONTENT - DO NOT EDIT"); - out.println("// Source: " + topDeclaringClass + ".java"); - out.println("package " + pkg + ";"); - out.println(""); - out.println("import java.util.*;"); - out.println("import " + OptionDescriptors.class.getPackage().getName() + ".*;"); - out.println(""); - out.println("public class " + optionsClassName + " implements " + OptionDescriptors.class.getSimpleName() + " {"); - - String desc = OptionDescriptor.class.getSimpleName(); - - boolean needPrivateFieldAccessor = false; - int i = 0; - Collections.sort(info.options); - - out.println(" @Override"); - out.println(" public OptionDescriptor get(String value) {"); - out.println(" // CheckStyle: stop line length check"); - if (info.options.size() == 1) { - out.println(" if (value.equals(\"" + info.options.get(0).name + "\")) {"); - } else { - out.println(" switch (value) {"); - } - for (OptionInfo option : info.options) { - String name = option.name; - String optionValue; - if (option.field.getModifiers().contains(Modifier.PRIVATE)) { - needPrivateFieldAccessor = true; - optionValue = "field(" + option.declaringClass + ".class, \"" + option.field.getSimpleName() + "\")"; - } else { - optionValue = option.declaringClass + "." + option.field.getSimpleName(); - } - String type = option.type; - String help = option.help; - String declaringClass = option.declaringClass; - Name fieldName = option.field.getSimpleName(); - if (info.options.size() == 1) { - out.printf(" return %s.create(\"%s\", %s.class, \"%s\", %s.class, \"%s\", %s);\n", desc, name, type, help, declaringClass, fieldName, optionValue); - } else { - out.printf(" case \"" + name + "\": return %s.create(\"%s\", %s.class, \"%s\", %s.class, \"%s\", %s);\n", desc, name, type, help, declaringClass, fieldName, optionValue); - } - } - out.println(" }"); - out.println(" // CheckStyle: resume line length check"); - out.println(" return null;"); - out.println(" }"); - out.println(); - out.println(" @Override"); - out.println(" public Iterator<" + desc + "> iterator() {"); - out.println(" // CheckStyle: stop line length check"); - out.println(" List<" + desc + "> options = Arrays.asList("); - for (OptionInfo option : info.options) { - String optionValue; - if (option.field.getModifiers().contains(Modifier.PRIVATE)) { - needPrivateFieldAccessor = true; - optionValue = "field(" + option.declaringClass + ".class, \"" + option.field.getSimpleName() + "\")"; - } else { - optionValue = option.declaringClass + "." + option.field.getSimpleName(); - } - String name = option.name; - String type = option.type; - String help = option.help; - String declaringClass = option.declaringClass; - Name fieldName = option.field.getSimpleName(); - String comma = i == info.options.size() - 1 ? "" : ","; - out.printf(" %s.create(\"%s\", %s.class, \"%s\", %s.class, \"%s\", %s)%s\n", desc, name, type, help, declaringClass, fieldName, optionValue, comma); - i++; - } - out.println(" );"); - out.println(" // CheckStyle: resume line length check"); - out.println(" return options.iterator();"); - out.println(" }"); - if (needPrivateFieldAccessor) { - out.println(" private static " + OptionValue.class.getSimpleName() + " field(Class declaringClass, String fieldName) {"); - out.println(" try {"); - out.println(" java.lang.reflect.Field field = declaringClass.getDeclaredField(fieldName);"); - out.println(" field.setAccessible(true);"); - out.println(" return (" + OptionValue.class.getSimpleName() + ") field.get(null);"); - out.println(" } catch (Exception e) {"); - out.println(" throw (InternalError) new InternalError().initCause(e);"); - out.println(" }"); - out.println(" }"); - } - out.println("}"); - } - } - - protected PrintWriter createSourceFile(String pkg, String relativeName, Filer filer, Element... originatingElements) { - try { - // Ensure Unix line endings to comply with code style guide checked by Checkstyle - JavaFileObject sourceFile = filer.createSourceFile(pkg + "." + relativeName, originatingElements); - return new PrintWriter(sourceFile.openWriter()) { - - @Override - public void println() { - print("\n"); - } - }; - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - static class OptionInfo implements Comparable { - - final String name; - final String help; - final String type; - final String declaringClass; - final VariableElement field; - - public OptionInfo(String name, String help, String type, String declaringClass, VariableElement field) { - this.name = name; - this.help = help; - this.type = type; - this.declaringClass = declaringClass; - this.field = field; - } - - @Override - public int compareTo(OptionInfo other) { - return name.compareTo(other.name); - } - - @Override - public String toString() { - return declaringClass + "." + field; - } - } - - static class OptionsInfo { - - final Element topDeclaringType; - final List options = new ArrayList<>(); - final Set originatingElements = new HashSet<>(); - - public OptionsInfo(Element topDeclaringType) { - this.topDeclaringType = topDeclaringType; - } - } - - private static Element topDeclaringType(Element element) { - Element enclosing = element.getEnclosingElement(); - if (enclosing == null || enclosing.getKind() == ElementKind.PACKAGE) { - assert element.getKind() == ElementKind.CLASS || element.getKind() == ElementKind.INTERFACE; - return element; - } - return topDeclaringType(enclosing); - } - - @Override - public boolean process(Set annotations, RoundEnvironment roundEnv) { - if (roundEnv.processingOver()) { - return true; - } - - Map map = new HashMap<>(); - for (Element element : roundEnv.getElementsAnnotatedWith(Option.class)) { - if (!processed.contains(element)) { - processed.add(element); - Element topDeclaringType = topDeclaringType(element); - OptionsInfo options = map.get(topDeclaringType); - if (options == null) { - options = new OptionsInfo(topDeclaringType); - map.put(topDeclaringType, options); - } - processElement(element, options); - } - } - - boolean ok = true; - Map uniqueness = new HashMap<>(); - for (OptionsInfo info : map.values()) { - for (OptionInfo option : info.options) { - OptionInfo conflict = uniqueness.put(option.name, option); - if (conflict != null) { - processingEnv.getMessager().printMessage(Kind.ERROR, "Duplicate option names for " + option + " and " + conflict, option.field); - ok = false; - } - } - } - - if (ok) { - for (OptionsInfo info : map.values()) { - createFiles(info); - } - } - - return true; - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/DerivedOptionValue.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/DerivedOptionValue.java deleted file mode 100644 index e6149955c77..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/DerivedOptionValue.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -import java.io.Serializable; -import java.util.function.Supplier; - -import jdk.vm.ci.options.OptionValue.OverrideScope; - -/** - * A cached value that needs to be recomputed when an option changes. - */ -public class DerivedOptionValue { - - public interface OptionSupplier extends Supplier, Serializable { - } - - private final T initialValue; - private final OptionSupplier supplier; - - public DerivedOptionValue(OptionSupplier supplier) { - this.supplier = supplier; - assert OptionValue.getOverrideScope() == null : "derived option value should be initialized outside any override scope"; - this.initialValue = createValue(); - } - - public T getValue() { - OverrideScope overrideScope = OptionValue.getOverrideScope(); - if (overrideScope != null) { - return overrideScope.getDerived(this); - } else { - return initialValue; - } - } - - T createValue() { - return supplier.get(); - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/NestedBooleanOptionValue.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/NestedBooleanOptionValue.java deleted file mode 100644 index 804603814f1..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/NestedBooleanOptionValue.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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. - */ -package jdk.vm.ci.options; - -/** - * A nested Boolean {@link OptionValue} that can be overridden by a {@link #masterOption master - * option}. - *

    - *

  • If the option is present on the command line the specified value is used. - *
  • Otherwise {@link #getValue()} depends on the {@link #masterOption} and evaluates as follows: - *
      - *
    • If {@link #masterOption} is set, this value equals to {@link #initialValue}. - *
    • Otherwise, if {@link #masterOption} is {@code false}, this option is {@code false}. - */ -public class NestedBooleanOptionValue extends OptionValue { - private final OptionValue masterOption; - private final Boolean initialValue; - - public NestedBooleanOptionValue(OptionValue masterOption, Boolean initialValue) { - super(null); - this.masterOption = masterOption; - this.initialValue = initialValue; - } - - public OptionValue getMasterOption() { - return masterOption; - } - - @Override - public Boolean getValue() { - Boolean v = super.getValue(); - if (v == null) { - return initialValue && masterOption.getValue(); - } - return v; - } - -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/Option.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/Option.java deleted file mode 100644 index 3e0537335d3..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/Option.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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 jdk.vm.ci.options; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Describes the attributes of an option whose {@link OptionValue value} is in a static field - * annotated by this annotation type. - * - * @see OptionDescriptor - */ -@Retention(RetentionPolicy.CLASS) -@Target(ElementType.FIELD) -public @interface Option { - - /** - * Gets a help message for the option. New lines can be embedded in the message with - * {@code "%n"}. - */ - String help(); - - /** - * The name of the option. By default, the name of the annotated field should be used. - */ - String name() default ""; - - /** - * Specifies the type of the option. - */ - OptionType type() default OptionType.Debug; -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptor.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptor.java deleted file mode 100644 index b0bde8a71e0..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptor.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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 jdk.vm.ci.options; - -/** - * Describes the attributes of a static field {@linkplain Option option} and provides access to its - * {@linkplain OptionValue value}. - */ -public final class OptionDescriptor { - - protected final String name; - protected final Class type; - protected final String help; - protected final OptionValue option; - protected final Class declaringClass; - protected final String fieldName; - - public static OptionDescriptor create(String name, Class type, String help, Class declaringClass, String fieldName, OptionValue option) { - OptionDescriptor result = option.getDescriptor(); - if (result == null) { - result = new OptionDescriptor(name, type, help, declaringClass, fieldName, option); - option.setDescriptor(result); - } - assert result.name.equals(name) && result.type == type && result.declaringClass == declaringClass && result.fieldName.equals(fieldName) && result.option == option; - return result; - } - - private OptionDescriptor(String name, Class type, String help, Class declaringClass, String fieldName, OptionValue option) { - this.name = name; - this.type = type; - this.help = help; - this.option = option; - this.declaringClass = declaringClass; - this.fieldName = fieldName; - assert !type.isPrimitive() : "must used boxed type instead of " + type; - } - - /** - * Gets the type of values stored in the option. This will be the boxed type for a primitive - * option. - */ - public Class getType() { - return type; - } - - /** - * Gets a descriptive help message for the option. - */ - public String getHelp() { - return help; - } - - /** - * Gets the name of the option. It's up to the client of this object how to use the name to get - * a user specified value for the option from the environment. - */ - public String getName() { - return name; - } - - /** - * Gets the boxed option value. - */ - public OptionValue getOptionValue() { - return option; - } - - public Class getDeclaringClass() { - return declaringClass; - } - - public String getFieldName() { - return fieldName; - } - - /** - * Gets a description of the location where this option is stored. - */ - public String getLocation() { - return getDeclaringClass().getName() + "." + getFieldName(); - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptors.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptors.java deleted file mode 100644 index a2aef68e95e..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptors.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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 jdk.vm.ci.options; - -/** - * An interface to a set of {@link OptionDescriptor}s. - */ -public interface OptionDescriptors extends Iterable { - /** - * Gets the {@link OptionDescriptor} matching a given option name or {@code null} if this option - * descriptor set doesn't contain a matching option. - */ - OptionDescriptor get(String value); -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionType.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionType.java deleted file mode 100644 index d30ac8db430..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionType.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -/** - * Classifies JVMCI options in several categories depending on who this option is relevant for. - * - */ -public enum OptionType { - /** - * An option common for users to apply. - */ - User, - - /** - * An option only relevant in corner cases and for fine-tuning. - */ - Expert, - - /** - * An option only relevant when debugging the compiler. - */ - Debug -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionValue.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionValue.java deleted file mode 100644 index 6abcc91d936..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionValue.java +++ /dev/null @@ -1,484 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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 jdk.vm.ci.options; - -import java.io.PrintStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; - -/** - * An option value. - */ -public class OptionValue { - /** - * Temporarily changes the value for an option. The {@linkplain OptionValue#getValue() value} of - * {@code option} is set to {@code value} until {@link OverrideScope#close()} is called on the - * object returned by this method. - *

      - * Since the returned object is {@link AutoCloseable} the try-with-resource construct can be - * used: - * - *

      -     * try (OverrideScope s = OptionValue.override(myOption, myValue) {
      -     *     // code that depends on myOption == myValue
      -     * }
      -     * 
      - */ - public static OverrideScope override(OptionValue option, Object value) { - OverrideScope current = getOverrideScope(); - if (current == null) { - if (!value.equals(option.getValue())) { - return new SingleOverrideScope(option, value); - } - Map, Object> overrides = Collections.emptyMap(); - return new MultipleOverridesScope(current, overrides); - } - return new MultipleOverridesScope(current, option, value); - } - - /** - * Temporarily changes the values for a set of options. The {@linkplain OptionValue#getValue() - * value} of each {@code option} in {@code overrides} is set to the corresponding {@code value} - * in {@code overrides} until {@link OverrideScope#close()} is called on the object returned by - * this method. - *

      - * Since the returned object is {@link AutoCloseable} the try-with-resource construct can be - * used: - * - *

      -     * Map<OptionValue, Object> overrides = new HashMap<>();
      -     * overrides.put(myOption1, myValue1);
      -     * overrides.put(myOption2, myValue2);
      -     * try (OverrideScope s = OptionValue.override(overrides) {
      -     *     // code that depends on myOption == myValue
      -     * }
      -     * 
      - */ - public static OverrideScope override(Map, Object> overrides) { - OverrideScope current = getOverrideScope(); - if (current == null && overrides.size() == 1) { - Entry, Object> single = overrides.entrySet().iterator().next(); - OptionValue option = single.getKey(); - Object overrideValue = single.getValue(); - if (!overrideValue.equals(option.getValue())) { - return new SingleOverrideScope(option, overrideValue); - } - } - return new MultipleOverridesScope(current, overrides); - } - - /** - * Temporarily changes the values for a set of options. The {@linkplain OptionValue#getValue() - * value} of each {@code option} in {@code overrides} is set to the corresponding {@code value} - * in {@code overrides} until {@link OverrideScope#close()} is called on the object returned by - * this method. - *

      - * Since the returned object is {@link AutoCloseable} the try-with-resource construct can be - * used: - * - *

      -     * try (OverrideScope s = OptionValue.override(myOption1, myValue1, myOption2, myValue2) {
      -     *     // code that depends on myOption == myValue
      -     * }
      -     * 
      - * - * @param overrides overrides in the form {@code [option1, override1, option2, override2, ...]} - */ - public static OverrideScope override(Object... overrides) { - OverrideScope current = getOverrideScope(); - if (current == null && overrides.length == 2) { - OptionValue option = (OptionValue) overrides[0]; - Object overrideValue = overrides[1]; - if (!overrideValue.equals(option.getValue())) { - return new SingleOverrideScope(option, overrideValue); - } - } - Map, Object> map = Collections.emptyMap(); - for (int i = 0; i < overrides.length; i += 2) { - OptionValue option = (OptionValue) overrides[i]; - Object overrideValue = overrides[i + 1]; - if (!overrideValue.equals(option.getValue())) { - if (map.isEmpty()) { - map = new HashMap<>(); - } - map.put(option, overrideValue); - } - } - return new MultipleOverridesScope(current, map); - } - - private static final ThreadLocal overrideScopeTL = new ThreadLocal<>(); - - protected static OverrideScope getOverrideScope() { - return overrideScopeTL.get(); - } - - protected static void setOverrideScope(OverrideScope overrideScope) { - overrideScopeTL.set(overrideScope); - } - - private T defaultValue; - - /** - * The raw option value. - */ - protected T value; - - private OptionDescriptor descriptor; - - private long reads; - private OptionValue next; - private static OptionValue head; - - private static final boolean ShowReadsHistogram = Boolean.getBoolean("jvmci.showOptionValueReadsHistogram"); - - private static void addToHistogram(OptionValue option) { - if (ShowReadsHistogram) { - synchronized (OptionValue.class) { - option.next = head; - head = option; - } - } - } - - @SuppressWarnings("unchecked") - public OptionValue(T value) { - this.defaultValue = value; - this.value = (T) DEFAULT; - addToHistogram(this); - } - - private static final Object DEFAULT = "DEFAULT"; - private static final Object UNINITIALIZED = "UNINITIALIZED"; - - /** - * Creates an uninitialized option value for a subclass that initializes itself - * {@link #defaultValue() lazily}. - */ - @SuppressWarnings("unchecked") - protected OptionValue() { - this.defaultValue = (T) UNINITIALIZED; - this.value = (T) DEFAULT; - addToHistogram(this); - } - - /** - * Lazy initialization of default value. - */ - protected T defaultValue() { - throw new InternalError("Option without a default value value must override defaultValue()"); - } - - /** - * Sets the descriptor for this option. - */ - public void setDescriptor(OptionDescriptor descriptor) { - assert this.descriptor == null : "Overwriting existing descriptor"; - this.descriptor = descriptor; - } - - /** - * Returns the descriptor for this option, if it has been set by - * {@link #setDescriptor(OptionDescriptor)}. - */ - public OptionDescriptor getDescriptor() { - return descriptor; - } - - /** - * Gets the name of this option. The name for an option value with a null - * {@linkplain #setDescriptor(OptionDescriptor) descriptor} is the value of - * {@link Object#toString()}. - */ - public String getName() { - return descriptor == null ? super.toString() : (descriptor.getDeclaringClass().getName() + "." + descriptor.getName()); - } - - @Override - public String toString() { - return getName() + "=" + getValue(); - } - - /** - * The initial value specified in source code. The returned value is not affected by calls to - * {@link #setValue(Object)} or registering {@link OverrideScope}s. Therefore, it is also not - * affected by options set on the command line. - */ - public T getDefaultValue() { - if (defaultValue == UNINITIALIZED) { - defaultValue = defaultValue(); - } - return defaultValue; - } - - /** - * Returns true if the option has the same value that was set in the source code. - */ - public boolean hasDefaultValue() { - if (!(this instanceof StableOptionValue)) { - getValue(); // ensure initialized - } - return value == DEFAULT || Objects.equals(value, getDefaultValue()); - } - - /** - * Gets the value of this option. - */ - public T getValue() { - if (ShowReadsHistogram) { - reads++; - } - if (!(this instanceof StableOptionValue)) { - OverrideScope overrideScope = getOverrideScope(); - if (overrideScope != null) { - T override = overrideScope.getOverride(this); - if (override != null) { - return override; - } - } - } - if (value != DEFAULT) { - return value; - } else { - return getDefaultValue(); - } - } - - /** - * Gets the values of this option including overridden values. - * - * @param c the collection to which the values are added. If null, one is allocated. - * @return the collection to which the values were added in order from most overridden to - * current value - */ - @SuppressWarnings("unchecked") - public Collection getValues(Collection c) { - Collection values = c == null ? new ArrayList<>() : c; - if (!(this instanceof StableOptionValue)) { - OverrideScope overrideScope = getOverrideScope(); - if (overrideScope != null) { - overrideScope.getOverrides(this, (Collection) values); - } - } - if (value != DEFAULT) { - values.add(value); - } else { - values.add(getDefaultValue()); - } - return values; - } - - /** - * Sets the value of this option. - */ - @SuppressWarnings("unchecked") - public void setValue(Object v) { - this.value = (T) v; - } - - /** - * An object whose {@link #close()} method reverts the option value overriding initiated by - * {@link OptionValue#override(OptionValue, Object)} or {@link OptionValue#override(Map)}. - */ - public abstract static class OverrideScope implements AutoCloseable { - - private Map, Object> derivedCache = null; - - public T getDerived(DerivedOptionValue key) { - if (derivedCache == null) { - derivedCache = new HashMap<>(); - } - @SuppressWarnings("unchecked") - T ret = (T) derivedCache.get(key); - if (ret == null) { - ret = key.createValue(); - derivedCache.put(key, ret); - } - return ret; - } - - abstract void addToInherited(Map, Object> inherited); - - abstract T getOverride(OptionValue option); - - abstract void getOverrides(OptionValue option, Collection c); - - public abstract void close(); - } - - static class SingleOverrideScope extends OverrideScope { - - private final OptionValue option; - private final Object value; - - public SingleOverrideScope(OptionValue option, Object value) { - if (option instanceof StableOptionValue) { - throw new IllegalArgumentException("Cannot override stable option " + option); - } - this.option = option; - this.value = value; - setOverrideScope(this); - } - - @Override - void addToInherited(Map, Object> inherited) { - inherited.put(option, value); - } - - @SuppressWarnings("unchecked") - @Override - T getOverride(OptionValue key) { - if (key == this.option) { - return (T) value; - } - return null; - } - - @Override - void getOverrides(OptionValue key, Collection c) { - if (key == this.option) { - c.add(value); - } - } - - @Override - public void close() { - setOverrideScope(null); - } - } - - static class MultipleOverridesScope extends OverrideScope { - final OverrideScope parent; - final Map, Object> overrides; - - public MultipleOverridesScope(OverrideScope parent, OptionValue option, Object value) { - this.parent = parent; - this.overrides = new HashMap<>(); - if (parent != null) { - parent.addToInherited(overrides); - } - if (option instanceof StableOptionValue) { - throw new IllegalArgumentException("Cannot override stable option " + option); - } - if (!value.equals(option.getValue())) { - this.overrides.put(option, value); - } - if (!overrides.isEmpty()) { - setOverrideScope(this); - } - } - - MultipleOverridesScope(OverrideScope parent, Map, Object> overrides) { - this.parent = parent; - if (overrides.isEmpty() && parent == null) { - this.overrides = Collections.emptyMap(); - return; - } - this.overrides = new HashMap<>(); - if (parent != null) { - parent.addToInherited(this.overrides); - } - for (Map.Entry, Object> e : overrides.entrySet()) { - OptionValue option = e.getKey(); - if (option instanceof StableOptionValue) { - throw new IllegalArgumentException("Cannot override stable option " + option); - } - if (!e.getValue().equals(option.getValue())) { - this.overrides.put(option, e.getValue()); - } - } - if (!this.overrides.isEmpty()) { - setOverrideScope(this); - } - } - - @Override - void addToInherited(Map, Object> inherited) { - if (parent != null) { - parent.addToInherited(inherited); - } - inherited.putAll(overrides); - } - - @SuppressWarnings("unchecked") - @Override - T getOverride(OptionValue option) { - return (T) overrides.get(option); - } - - @Override - void getOverrides(OptionValue option, Collection c) { - Object v = overrides.get(option); - if (v != null) { - c.add(v); - } - if (parent != null) { - parent.getOverrides(option, c); - } - } - - @Override - public void close() { - if (!overrides.isEmpty()) { - setOverrideScope(parent); - } - } - } - - static { - if (ShowReadsHistogram) { - Runtime.getRuntime().addShutdownHook(new Thread() { - @Override - public void run() { - ArrayList> options = new ArrayList<>(); - for (OptionValue option = head; option != null; option = option.next) { - options.add(option); - } - Collections.sort(options, new Comparator>() { - - public int compare(OptionValue o1, OptionValue o2) { - if (o1.reads < o2.reads) { - return -1; - } else if (o1.reads > o2.reads) { - return 1; - } else { - return o1.getName().compareTo(o2.getName()); - } - } - }); - PrintStream out = System.out; - out.println("=== OptionValue reads histogram ==="); - for (OptionValue option : options) { - out.println(option.reads + "\t" + option); - } - } - }); - } - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsLoader.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsLoader.java deleted file mode 100644 index a01a05d040e..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsLoader.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -import java.util.ServiceLoader; -import java.util.SortedMap; -import java.util.TreeMap; - -/** - * Helper class used to load option descriptors. Only to be used in the slow-path. - */ -public class OptionsLoader { - public static final SortedMap options = new TreeMap<>(); - - /** - * Initializes {@link #options} from {@link Options} services. - */ - static { - for (OptionDescriptors opts : ServiceLoader.load(OptionDescriptors.class, OptionsLoader.class.getClassLoader())) { - for (OptionDescriptor desc : opts) { - String name = desc.getName(); - OptionDescriptor existing = options.put(name, desc); - assert existing == null : "Option named \"" + name + "\" has multiple definitions: " + existing.getLocation() + " and " + desc.getLocation(); - } - } - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsParser.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsParser.java deleted file mode 100644 index 0b8a6411181..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsParser.java +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -import static jdk.vm.ci.inittimer.InitTimer.timer; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.PrintStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Formatter; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.ServiceLoader; -import java.util.Set; -import java.util.SortedMap; - -import jdk.vm.ci.inittimer.InitTimer; - -/** - * This class contains methods for parsing JVMCI options and matching them against a set of - * {@link OptionDescriptors}. The {@link OptionDescriptors} are loaded via a {@link ServiceLoader}. - */ -public class OptionsParser { - - private static final OptionValue PrintFlags = new OptionValue<>(false); - private static final OptionValue ShowFlags = new OptionValue<>(false); - - /** - * A service for looking up {@link OptionDescriptor}s. - */ - public interface OptionDescriptorsProvider { - /** - * Gets the {@link OptionDescriptor} matching a given option {@linkplain Option#name() name} - * or null if no option of that name is provided by this object. - */ - OptionDescriptor get(String name); - } - - public interface OptionConsumer { - void set(OptionDescriptor desc, Object value); - } - - /** - * Parses the options in {@code /lib/jvmci.options} if {@code parseOptionsFile == true} and - * the file exists followed by the JVMCI options in {@code options} if {@code options != null}. - * - * Called from VM. This method has an object return type to allow it to be called with a VM - * utility function used to call other static initialization methods. - * - * @param options JVMCI options as serialized (name, value) pairs - * @param parseOptionsFile specifies whether to look for and parse - * {@code /lib/jvmci.options} - */ - @SuppressWarnings("try") - public static Boolean parseOptionsFromVM(String[] options, boolean parseOptionsFile) { - - try (InitTimer t = timer("ParseOptions")) { - - if (parseOptionsFile) { - File javaHome = new File(System.getProperty("java.home")); - File lib = new File(javaHome, "lib"); - File jvmciOptions = new File(lib, "jvmci.options"); - if (jvmciOptions.exists()) { - try (BufferedReader br = new BufferedReader(new FileReader(jvmciOptions))) { - String optionSetting = null; - int lineNo = 1; - List optionSettings = new ArrayList<>(); - while ((optionSetting = br.readLine()) != null) { - if (!optionSetting.isEmpty() && optionSetting.charAt(0) != '#') { - try { - parseOptionSettingTo(optionSetting, optionSettings); - } catch (Throwable e) { - throw new InternalError("Error parsing " + jvmciOptions + ", line " + lineNo, e); - } - } - lineNo++; - } - try { - parseOptions(optionSettings.toArray(new String[optionSettings.size()]), null, null, null); - } catch (Throwable e) { - throw new InternalError("Error parsing an option from " + jvmciOptions, e); - } - } catch (IOException e) { - throw new InternalError("Error reading " + jvmciOptions, e); - } - } - } - - parseOptions(options, null, null, null); - } - return Boolean.TRUE; - } - - /** - * Parses an ordered list of (name, value) pairs assigning values to JVMCI options. - * - * @param optionSettings JVMCI options as serialized (name, value) pairs - * @param setter the object to notify of the parsed option and value - * @param odp if non-null, the service to use for looking up {@link OptionDescriptor}s - * @param options the options database to use if {@code odp == null}. If - * {@code options == null && odp == null}, {@link OptionsLoader#options} is used. - * @throws IllegalArgumentException if there's a problem parsing {@code option} - */ - public static void parseOptions(String[] optionSettings, OptionConsumer setter, OptionDescriptorsProvider odp, SortedMap options) { - if (optionSettings != null && optionSettings.length != 0) { - assert optionSettings.length % 2 == 0; - - moveHelpFlagsToTail(optionSettings); - - for (int i = 0; i < optionSettings.length / 2; i++) { - String name = optionSettings[i * 2]; - String value = optionSettings[i * 2 + 1]; - parseOption(name, value, setter, odp, options); - } - if (PrintFlags.getValue() || ShowFlags.getValue()) { - Set explicitlyAssigned = new HashSet<>(optionSettings.length / 2); - for (int i = 0; i < optionSettings.length / 2; i++) { - String name = optionSettings[i * 2]; - explicitlyAssigned.add(name); - } - printFlags(resolveOptions(options), "JVMCI", System.out, explicitlyAssigned); - if (PrintFlags.getValue()) { - System.exit(0); - } - } - } - } - - /** - * Moves all {@code PrintFlags} and {@code ShowFlags} option settings to the back of - * {@code optionSettings}. This allows the help message to show which options had their value - * explicitly set (even if to their default value). - */ - private static void moveHelpFlagsToTail(String[] optionSettings) { - List tail = null; - int insert = 0; - for (int i = 0; i < optionSettings.length / 2; i++) { - String name = optionSettings[i * 2]; - String value = optionSettings[i * 2 + 1]; - if (name.equals("ShowFlags") || name.equals("PrintFlags")) { - if (tail == null) { - tail = new ArrayList<>(4); - insert = i * 2; - } - tail.add(name); - tail.add(value); - } else if (tail != null) { - optionSettings[insert++] = name; - optionSettings[insert++] = value; - } - } - if (tail != null) { - assert tail.size() + insert == optionSettings.length; - String[] tailArr = tail.toArray(new String[tail.size()]); - System.arraycopy(tailArr, 0, optionSettings, insert, tailArr.length); - } - } - - /** - * Parses a given option setting string to a list of (name, value) pairs. - * - * @param optionSetting a string matching the pattern {@code =} - */ - public static void parseOptionSettingTo(String optionSetting, List dst) { - int eqIndex = optionSetting.indexOf('='); - if (eqIndex == -1) { - throw new InternalError("Option setting has does not match the pattern =: " + optionSetting); - } - dst.add(optionSetting.substring(0, eqIndex)); - dst.add(optionSetting.substring(eqIndex + 1)); - } - - /** - * Resolves {@code options} to a non-null value. This ensures {@link OptionsLoader#options} is - * only loaded if necessary. - */ - private static SortedMap resolveOptions(SortedMap options) { - return options != null ? options : OptionsLoader.options; - } - - /** - * Parses a given option name and value. - * - * @param name the option name - * @param valueString the option value as a string - * @param setter the object to notify of the parsed option and value - * @param odp if non-null, the service to use for looking up {@link OptionDescriptor}s - * @param options the options database to use if {@code odp == null}. If - * {@code options == null && odp == null}, {@link OptionsLoader#options} is used. - * @throws IllegalArgumentException if there's a problem parsing {@code option} - */ - private static void parseOption(String name, String valueString, OptionConsumer setter, OptionDescriptorsProvider odp, SortedMap options) { - - OptionDescriptor desc = odp != null ? odp.get(name) : resolveOptions(options).get(name); - if (desc == null) { - if (name.equals("PrintFlags")) { - desc = OptionDescriptor.create("PrintFlags", Boolean.class, "Prints all JVMCI flags and exits", OptionsParser.class, "PrintFlags", PrintFlags); - } else if (name.equals("ShowFlags")) { - desc = OptionDescriptor.create("ShowFlags", Boolean.class, "Prints all JVMCI flags and continues", OptionsParser.class, "ShowFlags", ShowFlags); - } - } - if (desc == null) { - List matches = fuzzyMatch(resolveOptions(options), name); - Formatter msg = new Formatter(); - msg.format("Could not find option %s", name); - if (!matches.isEmpty()) { - msg.format("%nDid you mean one of the following?"); - for (OptionDescriptor match : matches) { - msg.format("%n %s=", match.getName()); - } - } - throw new IllegalArgumentException(msg.toString()); - } - - Class optionType = desc.getType(); - Object value; - if (optionType == Boolean.class) { - if ("true".equals(valueString)) { - value = Boolean.TRUE; - } else if ("false".equals(valueString)) { - value = Boolean.FALSE; - } else { - throw new IllegalArgumentException("Boolean option '" + name + "' must have value \"true\" or \"false\", not \"" + valueString + "\""); - } - } else if (optionType == Float.class) { - value = Float.parseFloat(valueString); - } else if (optionType == Double.class) { - value = Double.parseDouble(valueString); - } else if (optionType == Integer.class) { - value = Integer.valueOf((int) parseLong(valueString)); - } else if (optionType == Long.class) { - value = Long.valueOf(parseLong(valueString)); - } else if (optionType == String.class) { - value = valueString; - } else { - throw new IllegalArgumentException("Wrong value for option '" + name + "'"); - } - if (setter == null) { - desc.getOptionValue().setValue(value); - } else { - setter.set(desc, value); - } - } - - private static long parseLong(String v) { - String valueString = v.toLowerCase(); - long scale = 1; - if (valueString.endsWith("k")) { - scale = 1024L; - } else if (valueString.endsWith("m")) { - scale = 1024L * 1024L; - } else if (valueString.endsWith("g")) { - scale = 1024L * 1024L * 1024L; - } else if (valueString.endsWith("t")) { - scale = 1024L * 1024L * 1024L * 1024L; - } - - if (scale != 1) { - /* Remove trailing scale character. */ - valueString = valueString.substring(0, valueString.length() - 1); - } - - return Long.parseLong(valueString) * scale; - } - - /** - * Wraps some given text to one or more lines of a given maximum width. - * - * @param text text to wrap - * @param width maximum width of an output line, exception for words in {@code text} longer than - * this value - * @return {@code text} broken into lines - */ - private static List wrap(String text, int width) { - List lines = Collections.singletonList(text); - if (text.length() > width) { - String[] chunks = text.split("\\s+"); - lines = new ArrayList<>(); - StringBuilder line = new StringBuilder(); - for (String chunk : chunks) { - if (line.length() + chunk.length() > width) { - lines.add(line.toString()); - line.setLength(0); - } - if (line.length() != 0) { - line.append(' '); - } - String[] embeddedLines = chunk.split("%n", -2); - if (embeddedLines.length == 1) { - line.append(chunk); - } else { - for (int i = 0; i < embeddedLines.length; i++) { - line.append(embeddedLines[i]); - if (i < embeddedLines.length - 1) { - lines.add(line.toString()); - line.setLength(0); - } - } - } - } - if (line.length() != 0) { - lines.add(line.toString()); - } - } - return lines; - } - - private static void printFlags(SortedMap sortedOptions, String prefix, PrintStream out, Set explicitlyAssigned) { - out.println("[List of " + prefix + " options]"); - for (Map.Entry e : sortedOptions.entrySet()) { - e.getKey(); - OptionDescriptor desc = e.getValue(); - Object value = desc.getOptionValue().getValue(); - List helpLines = wrap(desc.getHelp(), 70); - String name = e.getKey(); - String assign = explicitlyAssigned.contains(name) ? ":=" : " ="; - out.printf("%9s %-40s %s %-14s %s%n", desc.getType().getSimpleName(), name, assign, value, helpLines.get(0)); - for (int i = 1; i < helpLines.size(); i++) { - out.printf("%67s %s%n", " ", helpLines.get(i)); - } - } - } - - /** - * Compute string similarity based on Dice's coefficient. - * - * Ported from str_similar() in globals.cpp. - */ - static float stringSimiliarity(String str1, String str2) { - int hit = 0; - for (int i = 0; i < str1.length() - 1; ++i) { - for (int j = 0; j < str2.length() - 1; ++j) { - if ((str1.charAt(i) == str2.charAt(j)) && (str1.charAt(i + 1) == str2.charAt(j + 1))) { - ++hit; - break; - } - } - } - return 2.0f * hit / (str1.length() + str2.length()); - } - - private static final float FUZZY_MATCH_THRESHOLD = 0.7F; - - /** - * Returns the set of options that fuzzy match a given option name. - */ - private static List fuzzyMatch(SortedMap options, String optionName) { - List matches = new ArrayList<>(); - for (Map.Entry e : options.entrySet()) { - float score = stringSimiliarity(e.getKey(), optionName); - if (score >= FUZZY_MATCH_THRESHOLD) { - matches.add(e.getValue()); - } - } - return matches; - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/StableOptionValue.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/StableOptionValue.java deleted file mode 100644 index 533e5002b47..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/StableOptionValue.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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 jdk.vm.ci.options; - -/** - * An option that always returns the same {@linkplain #getValue() value}. - */ -public class StableOptionValue extends OptionValue { - - /** - * Creates a stable option value. - */ - public StableOptionValue(T value) { - super(value); - } - - /** - * Used to assert the invariant for stability. Without using locks, this check is not safe - * against races and so it's only an assertion. - */ - private boolean getValueCalled; - - /** - * Creates an uninitialized stable option value for a subclass that initializes itself - * {@link #defaultValue() lazily}. - */ - public StableOptionValue() { - } - - /** - * Gets the value of this option. - */ - @Override - public final T getValue() { - T result = super.getValue(); - assert initGetValueCalled(); - return result; - } - - private boolean initGetValueCalled() { - getValueCalled = true; - return true; - } - - /** - * {@inheritDoc} - *

      - * This must only be called if {@link #getValue()} has never been called. - */ - @Override - public final void setValue(Object v) { - assert !getValueCalled; - super.setValue(v); - } -} diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp index 54b2e75697a..52e517324a0 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp @@ -50,15 +50,10 @@ jobject JVMCIRuntime::_HotSpotJVMCIRuntime_instance = NULL; bool JVMCIRuntime::_HotSpotJVMCIRuntime_initialized = false; bool JVMCIRuntime::_well_known_classes_initialized = false; const char* JVMCIRuntime::_compiler = NULL; -int JVMCIRuntime::_options_count = 0; -SystemProperty** JVMCIRuntime::_options = NULL; int JVMCIRuntime::_trivial_prefixes_count = 0; char** JVMCIRuntime::_trivial_prefixes = NULL; bool JVMCIRuntime::_shutdown_called = false; -static const char* OPTION_PREFIX = "jvmci.option."; -static const size_t OPTION_PREFIX_LEN = strlen(OPTION_PREFIX); - BasicType JVMCIRuntime::kindToBasicType(Handle kind, TRAPS) { if (kind.is_null()) { THROW_(vmSymbols::java_lang_NullPointerException(), T_ILLEGAL); @@ -631,16 +626,6 @@ Handle JVMCIRuntime::callStatic(const char* className, const char* methodName, c return Handle((oop)result.get_jobject()); } -static bool jvmci_options_file_exists() { - const char* home = Arguments::get_java_home(); - size_t path_len = strlen(home) + strlen("/lib/jvmci.options") + 1; - char path[JVM_MAXPATHLEN]; - char sep = os::file_separator()[0]; - jio_snprintf(path, JVM_MAXPATHLEN, "%s%clib%cjvmci.options", home, sep, sep); - struct stat st; - return os::stat(path, &st) == 0; -} - void JVMCIRuntime::initialize_HotSpotJVMCIRuntime(TRAPS) { if (JNIHandles::resolve(_HotSpotJVMCIRuntime_instance) == NULL) { #ifdef ASSERT @@ -652,30 +637,6 @@ void JVMCIRuntime::initialize_HotSpotJVMCIRuntime(TRAPS) { "HotSpotJVMCIRuntime initialization should only be triggered through JVMCI initialization"); #endif - bool parseOptionsFile = jvmci_options_file_exists(); - if (_options != NULL || parseOptionsFile) { - JavaCallArguments args; - objArrayOop options; - if (_options != NULL) { - options = oopFactory::new_objArray(SystemDictionary::String_klass(), _options_count * 2, CHECK); - for (int i = 0; i < _options_count; i++) { - SystemProperty* prop = _options[i]; - oop name = java_lang_String::create_oop_from_str(prop->key() + OPTION_PREFIX_LEN, CHECK); - const char* prop_value = prop->value() != NULL ? prop->value() : ""; - oop value = java_lang_String::create_oop_from_str(prop_value, CHECK); - options->obj_at_put(i * 2, name); - options->obj_at_put((i * 2) + 1, value); - } - } else { - options = NULL; - } - args.push_oop(options); - args.push_int(parseOptionsFile); - callStatic("jdk/vm/ci/options/OptionsParser", - "parseOptionsFromVM", - "([Ljava/lang/String;Z)Ljava/lang/Boolean;", &args, CHECK); - } - if (_compiler != NULL) { JavaCallArguments args; oop compiler = java_lang_String::create_oop_from_str(_compiler, CHECK); @@ -893,48 +854,6 @@ void JVMCIRuntime::save_compiler(const char* compiler) { _compiler = compiler; } -void JVMCIRuntime::maybe_print_flags(TRAPS) { - if (_options != NULL) { - for (int i = 0; i < _options_count; i++) { - SystemProperty* p = _options[i]; - const char* name = p->key() + OPTION_PREFIX_LEN; - if (strcmp(name, "PrintFlags") == 0 || strcmp(name, "ShowFlags") == 0) { - JVMCIRuntime::initialize_well_known_classes(CHECK); - HandleMark hm; - ResourceMark rm; - JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK); - return; - } - } - } -} - -void JVMCIRuntime::save_options(SystemProperty* props) { - int count = 0; - SystemProperty* first = NULL; - for (SystemProperty* p = props; p != NULL; p = p->next()) { - if (strncmp(p->key(), OPTION_PREFIX, OPTION_PREFIX_LEN) == 0) { - if (first == NULL) { - first = p; - } - count++; - } - } - if (count != 0) { - _options_count = count; - _options = NEW_C_HEAP_ARRAY(SystemProperty*, count, mtCompiler); - _options[0] = first; - SystemProperty** insert_pos = _options + 1; - for (SystemProperty* p = first->next(); p != NULL; p = p->next()) { - if (strncmp(p->key(), OPTION_PREFIX, OPTION_PREFIX_LEN) == 0) { - *insert_pos = p; - insert_pos++; - } - } - assert (insert_pos - _options == count, "must be"); - } -} - void JVMCIRuntime::shutdown(TRAPS) { if (_HotSpotJVMCIRuntime_instance != NULL) { _shutdown_called = true; diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp index 43ee0ad72a8..17476d65af9 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp @@ -71,8 +71,6 @@ class JVMCIRuntime: public AllStatic { static bool _HotSpotJVMCIRuntime_initialized; static bool _well_known_classes_initialized; static const char* _compiler; - static int _options_count; - static SystemProperty** _options; static int _trivial_prefixes_count; static char** _trivial_prefixes; @@ -99,20 +97,6 @@ class JVMCIRuntime: public AllStatic { */ static void save_compiler(const char* compiler); - /** - * Saves the value of the system properties starting with "jvmci.option." for processing - * when JVMCI is initialized. - * - * @param props the head of the system property list - */ - static void save_options(SystemProperty* props); - - /** - * If either the PrintFlags or ShowFlags JVMCI option is present, - * then JVMCI is initialized to show the help message. - */ - static void maybe_print_flags(TRAPS); - static bool is_HotSpotJVMCIRuntime_initialized() { return _HotSpotJVMCIRuntime_initialized; } /** diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 285e9e228e7..f6acf542974 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -3344,12 +3344,6 @@ jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_req const char* fileSep = os::file_separator(); sprintf(path, "%s%slib%sendorsed", Arguments::get_java_home(), fileSep, fileSep); -#if INCLUDE_JVMCI - if (EnableJVMCI) { - JVMCIRuntime::save_options(_system_properties); - } -#endif // INCLUDE_JVMCI - if (CheckEndorsedAndExtDirs) { int nonEmptyDirs = 0; // check endorsed directory diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 93d964c9bf0..77df406818a 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -3657,7 +3657,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { if (jvmciCompiler != NULL) { JVMCIRuntime::save_compiler(jvmciCompiler); } - JVMCIRuntime::maybe_print_flags(CHECK_JNI_ERR); } #endif // INCLUDE_JVMCI diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java deleted file mode 100644 index 2da9725c0ae..00000000000 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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 - * 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 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") - * @run junit jdk.vm.ci.options.test.NestedBooleanOptionValueTest - */ - -package jdk.vm.ci.options.test; - -import static jdk.vm.ci.options.test.NestedBooleanOptionValueTest.Options.Master0; -import static jdk.vm.ci.options.test.NestedBooleanOptionValueTest.Options.Master1; -import static jdk.vm.ci.options.test.NestedBooleanOptionValueTest.Options.Master2; -import static jdk.vm.ci.options.test.NestedBooleanOptionValueTest.Options.NestedOption0; -import static jdk.vm.ci.options.test.NestedBooleanOptionValueTest.Options.NestedOption1; -import static jdk.vm.ci.options.test.NestedBooleanOptionValueTest.Options.NestedOption2; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import jdk.vm.ci.options.NestedBooleanOptionValue; -import jdk.vm.ci.options.OptionDescriptor; -import jdk.vm.ci.options.OptionValue; -import jdk.vm.ci.options.OptionValue.OverrideScope; - -import org.junit.Test; - -public class NestedBooleanOptionValueTest { - - public static class Options { - public static final OptionValue Master0 = new OptionValue<>(true); - public static final OptionValue NestedOption0 = new NestedBooleanOptionValue(Master0, true); - public static final OptionValue Master1 = new OptionValue<>(true); - public static final OptionValue NestedOption1 = new NestedBooleanOptionValue(Master1, true); - public static final OptionValue Master2 = new OptionValue<>(true); - public static final OptionValue NestedOption2 = new NestedBooleanOptionValue(Master2, false); - } - - static final OptionDescriptor master0 = OptionDescriptor.create("Master0", Boolean.class, "", Options.class, "Master0", Master0); - static final OptionDescriptor nestedOption0 = OptionDescriptor.create("NestedOption0", Boolean.class, "", Options.class, "NestedOption0", NestedOption0); - static final OptionDescriptor master1 = OptionDescriptor.create("Master1", Boolean.class, "", Options.class, "Master1", Master1); - static final OptionDescriptor nestedOption1 = OptionDescriptor.create("NestedOption1", Boolean.class, "", Options.class, "NestedOption1", NestedOption1); - static final OptionDescriptor master2 = OptionDescriptor.create("Master2", Boolean.class, "", Options.class, "Master2", Master2); - static final OptionDescriptor nestedOption2 = OptionDescriptor.create("NestedOption2", Boolean.class, "", Options.class, "NestedOption2", NestedOption2); - - @SuppressWarnings("try") - @Test - public void runOverrides() { - assertTrue(Master0.getValue()); - assertTrue(NestedOption0.getValue()); - try (OverrideScope s1 = OptionValue.override(Master0, false)) { - assertFalse(Master0.getValue()); - assertFalse(NestedOption0.getValue()); - try (OverrideScope s2 = OptionValue.override(NestedOption0, false)) { - assertFalse(NestedOption0.getValue()); - } - try (OverrideScope s2 = OptionValue.override(NestedOption0, true)) { - assertTrue(NestedOption0.getValue()); - } - } - assertTrue(Master0.getValue()); - try (OverrideScope s1 = OptionValue.override(NestedOption0, false)) { - assertFalse(NestedOption0.getValue()); - } - try (OverrideScope s1 = OptionValue.override(NestedOption0, true)) { - assertTrue(NestedOption0.getValue()); - } - } - - @Test - public void runDefaultTrue() { - Master1.setValue(true); - assertTrue(Master1.getValue()); - assertTrue(NestedOption1.getValue()); - // nested value unset - Master1.setValue(false); - assertFalse(Master1.getValue()); - assertFalse(NestedOption1.getValue()); - // set false - Master1.setValue(false); - NestedOption1.setValue(false); - assertFalse(Master1.getValue()); - assertFalse(NestedOption1.getValue()); - Master1.setValue(true); - assertTrue(Master1.getValue()); - assertFalse(NestedOption1.getValue()); - // set true - Master1.setValue(false); - NestedOption1.setValue(true); - assertFalse(Master1.getValue()); - assertTrue(NestedOption1.getValue()); - Master1.setValue(true); - assertTrue(Master1.getValue()); - assertTrue(NestedOption1.getValue()); - } - - @Test - public void runDefaultFalse() { - Master2.setValue(true); - assertTrue(Master2.getValue()); - assertFalse(NestedOption2.getValue()); - // nested value unset - Master2.setValue(false); - assertFalse(Master2.getValue()); - assertFalse(NestedOption2.getValue()); - // set false - Master2.setValue(false); - NestedOption2.setValue(false); - assertFalse(Master2.getValue()); - assertFalse(NestedOption2.getValue()); - Master2.setValue(true); - assertTrue(Master2.getValue()); - assertFalse(NestedOption2.getValue()); - // set true - Master2.setValue(false); - NestedOption2.setValue(true); - assertFalse(Master2.getValue()); - assertTrue(NestedOption2.getValue()); - Master2.setValue(true); - assertTrue(Master2.getValue()); - assertTrue(NestedOption2.getValue()); - } - -} diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java deleted file mode 100644 index 0f9d23d5a50..00000000000 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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 - * 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 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") - * @run junit jdk.vm.ci.options.test.TestOptionValue - */ - -package jdk.vm.ci.options.test; - -import static jdk.vm.ci.options.test.TestOptionValue.Options.Mutable; -import static jdk.vm.ci.options.test.TestOptionValue.Options.SecondMutable; -import static jdk.vm.ci.options.test.TestOptionValue.Options.Stable; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.util.Arrays; - -import jdk.vm.ci.options.OptionDescriptor; -import jdk.vm.ci.options.OptionValue; -import jdk.vm.ci.options.OptionValue.OverrideScope; -import jdk.vm.ci.options.StableOptionValue; - -import org.junit.Test; - -@SuppressWarnings("try") -public class TestOptionValue { - - public static class Options { - public static final OptionValue Stable = new StableOptionValue<>(true); - public static final OptionValue Mutable = new OptionValue<>("original"); - public static final OptionValue SecondMutable = new OptionValue<>("second"); - } - - static final OptionDescriptor stable = OptionDescriptor.create("Stable", Boolean.class, "", Options.class, "Stable", Stable); - static final OptionDescriptor mutable = OptionDescriptor.create("Mutable", String.class, "", Options.class, "Mutable", Mutable); - static final OptionDescriptor secondMutable = OptionDescriptor.create("SecondMutable", String.class, "", Options.class, "SecondMutable", SecondMutable); - - @Test - public void testMutable() { - assertEquals("original", Mutable.getValue()); - try (OverrideScope s1 = OptionValue.override(Mutable, "override1")) { - assertEquals("override1", Mutable.getValue()); - try (OverrideScope s2 = OptionValue.override(Mutable, "override2")) { - assertEquals("override2", Mutable.getValue()); - } - assertEquals("override1", Mutable.getValue()); - try (OverrideScope s3 = OptionValue.override(Mutable, "override3")) { - assertEquals("override3", Mutable.getValue()); - } - assertEquals("override1", Mutable.getValue()); - } - assertEquals("original", Mutable.getValue()); - try (OverrideScope s1 = OptionValue.override(Mutable, "original")) { - assertEquals("original", Mutable.getValue()); - } - } - - @Test - public void testMultiple() { - assertEquals("original", Mutable.getValue()); - assertEquals("second", SecondMutable.getValue()); - try (OverrideScope s1 = OptionValue.override(Mutable, "override1", SecondMutable, "secondOverride1")) { - assertEquals("override1", Mutable.getValue()); - assertEquals("secondOverride1", SecondMutable.getValue()); - try (OverrideScope s2 = OptionValue.override(Mutable, "override2", SecondMutable, "secondOverride2")) { - assertEquals("override2", Mutable.getValue()); - assertEquals("secondOverride2", SecondMutable.getValue()); - } - assertEquals("override1", Mutable.getValue()); - assertEquals("secondOverride1", SecondMutable.getValue()); - try (OverrideScope s3 = OptionValue.override(Mutable, "override3", SecondMutable, "secondOverride3")) { - assertEquals("override3", Mutable.getValue()); - assertEquals("secondOverride3", SecondMutable.getValue()); - } - assertEquals("override1", Mutable.getValue()); - assertEquals("secondOverride1", SecondMutable.getValue()); - } - assertEquals("original", Mutable.getValue()); - assertEquals("second", SecondMutable.getValue()); - try (OverrideScope s1 = OptionValue.override(Mutable, "original", SecondMutable, "second")) { - assertEquals("original", Mutable.getValue()); - assertEquals("second", SecondMutable.getValue()); - } - } - - @Test - public void testStable() { - assertTrue(Stable.getValue()); - try (OverrideScope s = OptionValue.override(Stable, false)) { - fail("cannot override stable option"); - } catch (IllegalArgumentException e) { - // expected - } - } - - @Test - public void toStringTest() { - assertEquals("jdk.vm.ci.options.test.TestOptionValue$Options.Mutable=original", Mutable.toString()); - try (OverrideScope s1 = OptionValue.override(Mutable, "override1")) { - assertEquals("jdk.vm.ci.options.test.TestOptionValue$Options.Mutable=override1", Mutable.toString()); - try (OverrideScope s2 = OptionValue.override(Mutable, "override2")) { - assertEquals("jdk.vm.ci.options.test.TestOptionValue$Options.Mutable=override2", Mutable.toString()); - } - } - } - - @Test - public void getValuesTest() { - assertEquals(Arrays.asList("original"), Mutable.getValues(null)); - assertEquals(Arrays.asList(true), Stable.getValues(null)); - try (OverrideScope s1 = OptionValue.override(Mutable, "override1")) { - assertEquals(Arrays.asList("override1", "original"), Mutable.getValues(null)); - try (OverrideScope s2 = OptionValue.override(Mutable, "override2")) { - assertEquals(Arrays.asList("override2", "override1", "original"), Mutable.getValues(null)); - } - } - } -} diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java index f2a187effa8..c66068988da 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java @@ -49,8 +49,8 @@ import java.util.stream.Collectors; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.JavaField; import jdk.vm.ci.meta.MetaAccessProvider; +import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.TrustedInterface; import jdk.vm.ci.runtime.JVMCI; @@ -179,7 +179,7 @@ public class TypeUniverse { List res = new ArrayList<>(); for (Field field : fromClass.getDeclaredFields()) { if (isStatic(field.getModifiers()) && isFinal(field.getModifiers())) { - JavaField javaField = metaAccess.lookupJavaField(field); + ResolvedJavaField javaField = metaAccess.lookupJavaField(field); Object boxed = field.get(null); if (boxed instanceof JavaConstant) { res.add(new ConstantValue(javaField.format("%H.%n"), (JavaConstant) boxed, boxed)); From 92b9b68225142018922b7f0e1ee78c7f8a48bfbf Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Sat, 16 Jan 2016 00:18:33 +0000 Subject: [PATCH 198/228] 8146669: Test SessionTimeOutTests fails intermittently Reviewed-by: mullan --- .../ssl/SSLSession/SSLCtxAccessToSessCtx.java | 32 +++++++++++++------ .../ssl/SSLSession/SessionTimeOutTests.java | 9 +++--- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/jdk/test/javax/net/ssl/SSLSession/SSLCtxAccessToSessCtx.java b/jdk/test/javax/net/ssl/SSLSession/SSLCtxAccessToSessCtx.java index 14ed3eab716..95b9aae3512 100644 --- a/jdk/test/javax/net/ssl/SSLSession/SSLCtxAccessToSessCtx.java +++ b/jdk/test/javax/net/ssl/SSLSession/SSLCtxAccessToSessCtx.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -35,6 +35,7 @@ import java.io.*; import java.net.*; import javax.net.ssl.*; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.security.KeyStore; public class SSLCtxAccessToSessCtx { @@ -63,7 +64,7 @@ public class SSLCtxAccessToSessCtx { /* * Is the server ready to serve? */ - volatile static boolean serverReady = false; + AtomicInteger serverReady = new AtomicInteger(1); // only one port now /* * Turn on SSL debugging? @@ -89,12 +90,13 @@ public class SSLCtxAccessToSessCtx { SSLServerSocket sslServerSocket = (SSLServerSocket) sslssf.createServerSocket(serverPort); - serverPorts[createdPorts++] = sslServerSocket.getLocalPort(); + int slot = createdPorts.getAndIncrement(); + serverPorts[slot] = sslServerSocket.getLocalPort(); /* * Signal Client, we're ready for his connect. */ - serverReady = true; + serverReady.getAndDecrement(); int read = 0; SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); InputStream sslIS = sslSocket.getInputStream(); @@ -121,7 +123,7 @@ public class SSLCtxAccessToSessCtx { /* * Wait for server to get started. */ - while (!serverReady) { + while (serverReady.get() > 0) { Thread.sleep(50); } /* @@ -151,8 +153,8 @@ public class SSLCtxAccessToSessCtx { * The remainder is just support stuff */ - volatile int serverPorts[] = new int[]{0}; - volatile int createdPorts = 0; + int serverPorts[] = new int[]{0}; // only one port at present + AtomicInteger createdPorts = new AtomicInteger(0); static SSLServerSocketFactory sslssf; static SSLSocketFactory sslsf; static SSLContext sslctx; @@ -255,14 +257,20 @@ public class SSLCtxAccessToSessCtx { */ System.err.println("Server died..."); e.printStackTrace(); - serverReady = true; + serverReady.set(0); serverException = e; } } }; serverThread.start(); } else { - doServerSide(port); + try { + doServerSide(port); + } catch (Exception e) { + serverException = e; + } finally { + serverReady.set(0); + } } } @@ -284,7 +292,11 @@ public class SSLCtxAccessToSessCtx { }; clientThread.start(); } else { - doClientSide(); + try { + doClientSide(); + } catch (Exception e) { + clientException = e; + } } } } diff --git a/jdk/test/javax/net/ssl/SSLSession/SessionTimeOutTests.java b/jdk/test/javax/net/ssl/SSLSession/SessionTimeOutTests.java index 05aa61df609..ce592fece7f 100644 --- a/jdk/test/javax/net/ssl/SSLSession/SessionTimeOutTests.java +++ b/jdk/test/javax/net/ssl/SSLSession/SessionTimeOutTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -112,7 +112,8 @@ public class SessionTimeOutTests { SSLServerSocket sslServerSocket = (SSLServerSocket) sslssf.createServerSocket(serverPort); - serverPorts[createdPorts++] = sslServerSocket.getLocalPort(); + int slot = createdPorts.getAndIncrement(); + serverPorts[slot] = sslServerSocket.getLocalPort(); /* * Signal Client, we're ready for his connect. @@ -288,8 +289,8 @@ public class SessionTimeOutTests { * The remainder is just support stuff */ - volatile int serverPorts[] = new int[PORTS]; - volatile int createdPorts = 0; + int serverPorts[] = new int[PORTS]; + AtomicInteger createdPorts = new AtomicInteger(0); static SSLServerSocketFactory sslssf; static SSLSocketFactory sslsf; static SSLContext sslctx; From 264f84a2f96b8e8a5ea528122ea973c8a910ca85 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Sat, 16 Jan 2016 13:01:44 +0100 Subject: [PATCH 199/228] 8146403: Windows build can be faster Reviewed-by: ihse --- jdk/make/CompileDemos.gmk | 3 +- jdk/make/CompileTools.gmk | 83 +++++++++++++++++++++++ jdk/make/CopySamples.gmk | 45 ++++++------ jdk/make/Import.gmk | 2 +- jdk/make/Tools.gmk | 57 ++-------------- jdk/make/copy/Copy-java.base.gmk | 20 +++--- jdk/make/gendata/GendataBreakIterator.gmk | 8 +-- jdk/make/gendata/GendataHtml32dtd.gmk | 2 +- jdk/make/gendata/GendataPolicyJars.gmk | 5 +- jdk/make/gensrc/Gensrc-jdk.charsets.gmk | 15 ++-- jdk/make/gensrc/Gensrc-jdk.jdi.gmk | 11 ++- jdk/make/gensrc/GensrcBuffer.gmk | 8 +-- jdk/make/gensrc/GensrcCharacterData.gmk | 6 +- jdk/make/gensrc/GensrcCharsetMapping.gmk | 6 +- jdk/make/gensrc/GensrcExceptions.gmk | 19 ++---- jdk/make/gensrc/GensrcIcons.gmk | 7 +- jdk/make/gensrc/GensrcLocaleData.gmk | 27 +++++--- jdk/make/gensrc/GensrcMisc.gmk | 6 +- jdk/make/gensrc/GensrcProperties.gmk | 2 +- jdk/make/gensrc/GensrcSwing.gmk | 5 +- jdk/make/gensrc/GensrcX11Wrappers.gmk | 14 ++-- jdk/make/launcher/LauncherCommon.gmk | 8 +-- jdk/make/lib/Awt2dLibraries.gmk | 3 +- jdk/make/lib/Lib-java.base.gmk | 2 +- jdk/make/lib/Lib-jdk.jdwp.agent.gmk | 2 +- jdk/make/lib/LibCommon.gmk | 4 +- 26 files changed, 201 insertions(+), 169 deletions(-) create mode 100644 jdk/make/CompileTools.gmk diff --git a/jdk/make/CompileDemos.gmk b/jdk/make/CompileDemos.gmk index 73f3edff8a0..ac2ce41de82 100644 --- a/jdk/make/CompileDemos.gmk +++ b/jdk/make/CompileDemos.gmk @@ -38,7 +38,8 @@ include TextFileProcessing.gmk include ZipArchive.gmk # Prepare the find cache. -$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src)) +$(eval $(call FillCacheFind, $(wildcard $(JDK_TOPDIR)/src/demo \ + $(JDK_TOPDIR)/src/*/demo))) # Append demo goals to this variable. TARGETS = diff --git a/jdk/make/CompileTools.gmk b/jdk/make/CompileTools.gmk new file mode 100644 index 00000000000..27aaffaafdb --- /dev/null +++ b/jdk/make/CompileTools.gmk @@ -0,0 +1,83 @@ +# +# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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. +# + +default: all + +include $(SPEC) +include MakeBase.gmk +include JavaCompilation.gmk +include SetupJavaCompilers.gmk + +################################################################################ + +JIMAGE_PKGS := \ + jdk/internal/jimage \ + jdk/internal/jrtfs \ + # + +$(eval $(call SetupJavaCompilation,BUILD_INTERIM_JIMAGE, \ + SETUP := GENERATE_OLDBYTECODE, \ + SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \ + INCLUDES := $(JIMAGE_PKGS), \ + BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes)) + +TARGETS += $(BUILD_INTERIM_JIMAGE) + +# Because of the explicit INCLUDES in the compilation setup above, the service provider +# file will not be copied unless META-INF/services would also be added to the INCLUDES. +# Adding META-INF/services would include all files in that directory when only the one +# is needed, which is why this explicit copy is defined instead. +$(eval $(call SetupCopyFiles,COPY_JIMAGE_SERVICE_PROVIDER, \ + SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \ + DEST := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes, \ + FILES := META-INF/services/java.nio.file.spi.FileSystemProvider)) + +TARGETS += $(COPY_JIMAGE_SERVICE_PROVIDER) + +################################################################################ + +$(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \ + SETUP := GENERATE_OLDBYTECODE, \ + ADD_JAVAC_FLAGS := -Xbootclasspath/p:$(call PathList, \ + $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes \ + $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes), \ + SRC := $(JDK_TOPDIR)/make/src/classes $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes, \ + BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \ + COPY := boot.modules ext.modules)) + +$(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE) $(COPY_JIMAGE_SERVICE_PROVIDER) + +TARGETS += $(BUILD_TOOLS_JDK) + +$(eval $(call SetupCopyFiles,COPY_NIMBUS_TEMPLATES, \ + SRC := $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus, \ + DEST := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/generatenimbus/resources, \ + FILES := $(wildcard $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/*.template))) + +TARGETS += $(COPY_NIMBUS_TEMPLATES) + +################################################################################ + +all: $(TARGETS) diff --git a/jdk/make/CopySamples.gmk b/jdk/make/CopySamples.gmk index be20f92fd17..09d0bf7ba44 100644 --- a/jdk/make/CopySamples.gmk +++ b/jdk/make/CopySamples.gmk @@ -28,41 +28,38 @@ default: all include $(SPEC) include MakeBase.gmk +################################################################################ + SAMPLE_TARGET_DIR := $(SUPPORT_OUTPUTDIR)/sample/image SAMPLE_SOURCE_DIR := $(JDK_TOPDIR)/src/sample/share -SAMPLE_CLOSED_SOURCE_DIR := $(JDK_TOPDIR)/src/closed/sample/share SAMPLE_SOLARIS_SOURCE_DIR := $(JDK_TOPDIR)/src/sample/solaris # Exclude the vm directory -SAMPLE_FIND_FILTER := -name vm -prune -o +$(eval $(call SetupCopyFiles, COPY_SHARE_SAMPLES, \ + SRC := $(SAMPLE_SOURCE_DIR), \ + DEST := $(SAMPLE_TARGET_DIR), \ + FILES := $(filter-out $(SAMPLE_SOURCE_DIR)/vm/%, \ + $(call CacheFind, $(SAMPLE_SOURCE_DIR))), \ +)) -SAMPLE_SOURCE := $(shell $(FIND) $(SAMPLE_SOURCE_DIR) $(SAMPLE_FIND_FILTER) -type f -print) -SAMPLE_TARGET := $(subst $(SAMPLE_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_SOURCE)) - -ifndef OPENJDK -# Exclude Main.java in EbayClient dir - SAMPLE_CLOSED_SOURCE := $(shell $(FIND) $(SAMPLE_CLOSED_SOURCE_DIR) -type f -print | $(GREP) -v EbayClient/Main.java) - SAMPLE_CLOSED_TARGET := $(subst $(SAMPLE_CLOSED_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_CLOSED_SOURCE)) - SAMPLE_TARGET += $(SAMPLE_CLOSED_TARGET) -endif +TARGETS += $(COPY_SHARE_SAMPLES) ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris macosx)) - SAMPLE_SOLARIS_SOURCE := $(shell $(FIND) $(SAMPLE_SOLARIS_SOURCE_DIR) -type f -print) - SAMPLE_SOLARIS_TARGET := $(subst $(SAMPLE_SOLARIS_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_SOLARIS_SOURCE)) - SAMPLE_TARGET += $(SAMPLE_SOLARIS_TARGET) + $(eval $(call SetupCopyFiles, COPY_SOLARIS_SAMPLES, \ + SRC := $(SAMPLE_SOLARIS_SOURCE_DIR), \ + DEST := $(SAMPLE_TARGET_DIR), \ + FILES := $(call CacheFind, $(SAMPLE_SOLARIS_SOURCE_DIR)), \ + )) + + TARGETS += $(COPY_SOLARIS_SAMPLES) endif -$(SAMPLE_TARGET_DIR)/dtrace/%: $(SAMPLE_SOLARIS_SOURCE_DIR)/dtrace/% - $(call install-file) +################################################################################ -$(SAMPLE_TARGET_DIR)/webservices/%: $(SAMPLE_CLOSED_SOURCE_DIR)/webservices/% - $(call install-file) +$(eval $(call IncludeCustomExtension, jdk, CopySamples.gmk)) -$(SAMPLE_TARGET_DIR)/%: $(SAMPLE_SOURCE_DIR)/% - $(call install-file) +################################################################################ -COPY_FILES += $(SAMPLE_TARGET) +all: $(TARGETS) -all: $(COPY_FILES) - -.PHONY: all +.PHONY: all default diff --git a/jdk/make/Import.gmk b/jdk/make/Import.gmk index d4c5654aeac..42155494fb2 100644 --- a/jdk/make/Import.gmk +++ b/jdk/make/Import.gmk @@ -48,7 +48,7 @@ endif ifneq ($(STATIC_BUILD), true) JSIG_IMPORT = jsig.* else - JSIG_IMPORT = + JSIG_IMPORT = endif HOTSPOT_BASE_IMPORT_FILES := \ diff --git a/jdk/make/Tools.gmk b/jdk/make/Tools.gmk index 7668928ff65..cd8d7e867a1 100644 --- a/jdk/make/Tools.gmk +++ b/jdk/make/Tools.gmk @@ -26,31 +26,14 @@ ifndef _TOOLS_GMK _TOOLS_GMK := 1 -default: all - -include $(SPEC) -include MakeBase.gmk include JavaCompilation.gmk -include NativeCompilation.gmk -include SetupJavaCompilers.gmk ################################################################################ - -$(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \ - SETUP := GENERATE_OLDBYTECODE, \ - ADD_JAVAC_FLAGS := -Xbootclasspath/p:$(call PathList, \ - $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes \ - $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes), \ - SRC := $(JDK_TOPDIR)/make/src/classes $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes, \ - BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \ - COPY := boot.modules ext.modules)) - -$(eval $(call SetupCopyFiles,COPY_NIMBUS_TEMPLATES, \ - SRC := $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus, \ - DEST := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/generatenimbus/resources, \ - FILES := $(wildcard $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/*.template))) - -BUILD_TOOLS_JDK += $(COPY_NIMBUS_TEMPLATES) +# To avoid reevaluating the compilation setup for the tools each time this file +# is included, the actual compilation is handled by CompileTools.gmk. The +# following trick is used to be able to declare a dependency on the built tools. +BUILD_TOOLS_JDK := $(call SetupJavaCompilationCompileTarget, \ + BUILD_TOOLS_JDK, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes) ################################################################################ @@ -135,34 +118,4 @@ TOOL_IMAGEBUILDER = $(JAVA_SMALL) -Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/inte -cp $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes $(JDK_OUTPUTDIR)) \ build.tools.module.ImageBuilder -########################################################################################## - -JIMAGE_PKGS := \ - jdk/internal/jimage \ - jdk/internal/jrtfs \ - # - -$(eval $(call SetupJavaCompilation,BUILD_INTERIM_JIMAGE, \ - SETUP := GENERATE_OLDBYTECODE, \ - SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \ - INCLUDES := $(JIMAGE_PKGS), \ - BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes)) - -# Because of the explicit INCLUDES in the compilation setup above, the service provider -# file will not be copied unless META-INF/services would also be added to the INCLUDES. -# Adding META-INF/services would include all files in that directory when only the one -# is needed, which is why this explicit copy is defined instead. -$(eval $(call SetupCopyFiles,COPY_JIMAGE_SERVICE_PROVIDER, \ - SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \ - DEST := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes, \ - FILES := META-INF/services/java.nio.file.spi.FileSystemProvider)) - -########################################################################################## - -$(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE) $(COPY_JIMAGE_SERVICE_PROVIDER) - -java-tools: $(BUILD_TOOLS_JDK) - -all: java-tools - endif # _TOOLS_GMK diff --git a/jdk/make/copy/Copy-java.base.gmk b/jdk/make/copy/Copy-java.base.gmk index 46687333361..ed8e42ae272 100644 --- a/jdk/make/copy/Copy-java.base.gmk +++ b/jdk/make/copy/Copy-java.base.gmk @@ -187,27 +187,31 @@ TARGETS += $(POLICY_DST) ifeq ($(CACERTS_FILE), ) CACERTS_FILE := $(JDK_TOPDIR)/src/java.base/share/conf/security/cacerts endif + CACERTS_DST := $(LIB_DST_DIR)/security/cacerts $(CACERTS_DST): $(CACERTS_FILE) + $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%, %, $@)) $(call install-file) TARGETS += $(CACERTS_DST) ################################################################################ -$(CONF_DST_DIR)/net.properties: $(JDK_TOPDIR)/src/java.base/share/conf/net.properties - $(ECHO) $(LOG_INFO) Copying $(@F) - $(call install-file) +$(eval $(call SetupCopyFiles, COPY_NET_PROPERTIES, \ + FILES := $(JDK_TOPDIR)/src/java.base/share/conf/net.properties, \ + DEST := $(CONF_DST_DIR), \ +)) -TARGETS += $(CONF_DST_DIR)/net.properties +TARGETS += $(COPY_NET_PROPERTIES) ifeq ($(OPENJDK_TARGET_OS), solaris) - $(CONF_DST_DIR)/sdp/sdp.conf.template: $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/sdp/sdp.conf.template - $(ECHO) $(LOG_INFO) Copying $(@F) - $(call install-file) + $(eval $(call SetupCopyFiles, COPY_SDP_CONF, \ + FILES := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/sdp/sdp.conf.template, \ + DEST := $(CONF_DST_DIR)/sdp, \ + )) - TARGETS += $(CONF_DST_DIR)/sdp/sdp.conf.template + TARGETS += $(COPY_SDP_CONF) endif ################################################################################ diff --git a/jdk/make/gendata/GendataBreakIterator.gmk b/jdk/make/gendata/GendataBreakIterator.gmk index 38bf0e537bb..b2827da2f0f 100644 --- a/jdk/make/gendata/GendataBreakIterator.gmk +++ b/jdk/make/gendata/GendataBreakIterator.gmk @@ -68,8 +68,8 @@ BIFILES_TH := $(LD_DATA_PKG_DIR)/th/WordBreakIteratorData_th \ $(BIFILES): $(BASE_DATA_PKG_DIR)/_the.bifiles $(BASE_DATA_PKG_DIR)/_the.bifiles: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES) $(BASE_DATA_PKG_DIR)/_the.bifiles: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR) - $(ECHO) $(LOG_INFO) "Generating BreakIteratorData" - $(MKDIR) -p $(@D) + $(call LogInfo, Generating BreakIteratorData) + $(call MakeDir, $(@D)) $(RM) $(BIFILES) $(TOOL_GENERATEBREAKITERATORDATA) \ -o $(@D) \ @@ -79,8 +79,8 @@ $(BASE_DATA_PKG_DIR)/_the.bifiles: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKIT $(BIFILES_TH): $(LD_DATA_PKG_DIR)/_the.bifiles_th $(LD_DATA_PKG_DIR)/_the.bifiles_th: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES) $(LD_DATA_PKG_DIR)/_the.bifiles_th: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR) - $(ECHO) $(LOG_INFO) "Generating BreakIteratorData_th" - $(MKDIR) -p $(@D)/th + $(call LogInfo, Generating BreakIteratorData_th) + $(call MakeDir, $(@D)/th) $(RM) $(BIFILES_TH) $(TOOL_GENERATEBREAKITERATORDATA) \ -o $(@D) \ diff --git a/jdk/make/gendata/GendataHtml32dtd.gmk b/jdk/make/gendata/GendataHtml32dtd.gmk index 1adb85ad0aa..2bc0e708673 100644 --- a/jdk/make/gendata/GendataHtml32dtd.gmk +++ b/jdk/make/gendata/GendataHtml32dtd.gmk @@ -27,7 +27,7 @@ GENDATA_HTML32DTD := HTML32DTD = $(JDK_OUTPUTDIR)/modules/java.desktop/javax/swing/text/html/parser/html32.bdtd $(HTML32DTD): $(BUILD_TOOLS_JDK) - $(ECHO) "Generating HTML DTD file" + $(call LogInfo, Generating HTML DTD file) $(MKDIR) -p $(@D) $(RM) $@ ($(TOOL_DTDBUILDER) $(LOG_INFO) html32 > $@) || exit 1 diff --git a/jdk/make/gendata/GendataPolicyJars.gmk b/jdk/make/gendata/GendataPolicyJars.gmk index 82e2e424446..ffed629f011 100644 --- a/jdk/make/gendata/GendataPolicyJars.gmk +++ b/jdk/make/gendata/GendataPolicyJars.gmk @@ -87,8 +87,7 @@ $(eval $(call SetupJarArchive, BUILD_US_EXPORT_POLICY_JAR, \ $(US_EXPORT_POLICY_JAR_LIMITED): \ $(US_EXPORT_POLICY_JAR_UNLIMITED) - $(ECHO) $(LOG_INFO) \ - Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(call LogInfo, Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@)) $(install-file) TARGETS += $(US_EXPORT_POLICY_JAR_LIMITED) $(US_EXPORT_POLICY_JAR_UNLIMITED) @@ -99,7 +98,7 @@ ifeq ($(UNLIMITED_CRYPTO), true) else $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_LIMITED) $(install-file) -endif +endif ifndef OPENJDK ifneq ($(UNLIMITED_CRYPTO), true) diff --git a/jdk/make/gensrc/Gensrc-jdk.charsets.gmk b/jdk/make/gensrc/Gensrc-jdk.charsets.gmk index fc6c481f523..c5f79ce54c9 100644 --- a/jdk/make/gensrc/Gensrc-jdk.charsets.gmk +++ b/jdk/make/gensrc/Gensrc-jdk.charsets.gmk @@ -46,30 +46,34 @@ $(CHARSET_DONE_CS)-extcs: $(CHARSET_DATA_DIR)/charsets \ $(wildcard $(CHARSET_DATA_DIR)/$(CHARSET_STANDARD_OS)) \ $(CHARSET_TEMPLATES) $(CHARSET_EXTENDED_JAVA_TEMPLATES) \ $(BUILD_TOOLS_JDK) - $(MKDIR) -p $(@D) + $(call LogInfo, Generating jdk.charsets extcs) + $(call MakeDir, $(@D)) $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) \ extcs charsets $(CHARSET_STANDARD_OS) \ $(CHARSET_EXTENDED_JAVA_TEMPLATES) \ $(CHARSET_EXTENDED_JAVA_DIR) \ $(CHARSET_COPYRIGHT_HEADER) \ - $(LOG_INFO) + $(LOG_DEBUG) $(TOUCH) '$@' $(CHARSET_DONE_CS)-hkscs: $(CHARSET_COPYRIGHT_HEADER)/HKSCS.java \ $(BUILD_TOOLS_JDK) - $(MKDIR) -p $(@D) + $(call LogInfo, Generating jdk.charsets hkscs) + $(call MakeDir, $(@D)) $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) hkscs '$<' $(TOUCH) '$@' $(CHARSET_DONE_CS)-euctw: $(CHARSET_COPYRIGHT_HEADER)/EUC_TW.java \ $(BUILD_TOOLS_JDK) - $(MKDIR) -p $(@D) + $(call LogInfo, Generating jdk.charsets euctw) + $(call MakeDir, $(@D)) $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) euctw '$<' $(TOUCH) '$@' $(CHARSET_GENSRC_JAVA_DIR_CS)/sjis0213.dat: $(CHARSET_DATA_DIR)/sjis0213.map \ $(BUILD_TOOLS_JDK) - $(MKDIR) -p $(@D) + $(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%, %, $@)) + $(call MakeDir, $(@D)) $(TOOL_CHARSETMAPPING) '$<' '$@' sjis0213 GENSRC_JDK_CHARSETS += \ @@ -86,4 +90,3 @@ jdk.charsets: $(GENSRC_JDK_CHARSETS) all: jdk.charsets .PHONY: all jdk.charsets - diff --git a/jdk/make/gensrc/Gensrc-jdk.jdi.gmk b/jdk/make/gensrc/Gensrc-jdk.jdi.gmk index 9fd609f5fb0..3b99359175b 100644 --- a/jdk/make/gensrc/Gensrc-jdk.jdi.gmk +++ b/jdk/make/gensrc/Gensrc-jdk.jdi.gmk @@ -40,19 +40,18 @@ $(HEADER_FILE): $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK) # Touch the target of this rule at the end to avoid triggering false rebuilds $(JAVA_FILE): $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK) $(HEADER_FILE) - $(MKDIR) -p $(@D) - $(MKDIR) -p $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent + $(call LogInfo, Creating JDWP.java and JDWPCommands.h from jdwp.spec) + $(call MakeDir, $(@D) $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent) $(RM) $@ $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h - $(ECHO) $(LOG_INFO) Creating JDWP.java and JDWPCommands.h from jdwp.spec $(TOOL_JDWPGEN) $< -jdi $@ -include \ $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h $(TOUCH) $@ $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html: $(JDWP_SPEC_FILE) \ $(BUILD_TOOLS_JDK) - $(MKDIR) -p $(@D) + $(call LogInfo, Creating $(@F) from jdwp.spec) + $(call MakeDir, $(@D)) $(RM) $@ - $(ECHO) $(LOG_INFO) Creating $(@F) from jdwp.spec $(TOOL_JDWPGEN) $< -doc $@ GENSRC_JDWP := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java \ @@ -63,7 +62,7 @@ GENSRC_JDK_JDI += $(GENSRC_JDWP) ################################################################################ define process-provider - $(MKDIR) -p $(@D) + $(call MakeDir, $(@D)) $(CAT) $^ | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $@ endef diff --git a/jdk/make/gensrc/GensrcBuffer.gmk b/jdk/make/gensrc/GensrcBuffer.gmk index 2f5d789cd60..34c67125aea 100644 --- a/jdk/make/gensrc/GensrcBuffer.gmk +++ b/jdk/make/gensrc/GensrcBuffer.gmk @@ -23,7 +23,7 @@ # questions. # -GENSRC_BUFFER := +GENSRC_BUFFER := GENSRC_BUFFER_DST := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/nio @@ -31,9 +31,9 @@ GENSRC_BUFFER_SRC := $(JDK_TOPDIR)/src/java.base/share/classes/java/nio ### -$(GENSRC_BUFFER_DST)/_the.buffer.dir: - $(ECHO) "Generating buffer classes" - $(MKDIR) -p $(@D) +$(GENSRC_BUFFER_DST)/_the.buffer.dir: + $(call LogInfo, Generating buffer classes) + $(call MakeDir, $(@D)) $(TOUCH) $@ define fixRw diff --git a/jdk/make/gensrc/GensrcCharacterData.gmk b/jdk/make/gensrc/GensrcCharacterData.gmk index b0b5eddacde..3994902edb2 100644 --- a/jdk/make/gensrc/GensrcCharacterData.gmk +++ b/jdk/make/gensrc/GensrcCharacterData.gmk @@ -35,8 +35,8 @@ UNICODEDATA = $(JDK_TOPDIR)/make/data/unicodedata define SetupCharacterData $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/$1.java: \ $(CHARACTERDATA)/$1.java.template - $(MKDIR) -p $$(@D) - $(ECHO) $(LOG_INFO) Generating $1.java + $$(call LogInfo, Generating $1.java) + $$(call MakeDir, $$(@D)) $(TOOL_GENERATECHARACTER) $2 \ -template $(CHARACTERDATA)/$1.java.template \ -spec $(UNICODEDATA)/UnicodeData.txt \ @@ -56,7 +56,7 @@ $(eval $(call SetupCharacterData,CharacterData0E, -plane 14, 11 4 1)) # Copy two Java files that need no preprocessing. $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/%.java: $(CHARACTERDATA)/%.java.template - $(ECHO) $(LOG_INFO) Generating $(@F) + $(call LogInfo, Generating $(@F)) $(call install-file) GENSRC_CHARACTERDATA += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/CharacterDataUndefined.java \ diff --git a/jdk/make/gensrc/GensrcCharsetMapping.gmk b/jdk/make/gensrc/GensrcCharsetMapping.gmk index 0218d4a1039..c904c54de23 100644 --- a/jdk/make/gensrc/GensrcCharsetMapping.gmk +++ b/jdk/make/gensrc/GensrcCharsetMapping.gmk @@ -44,13 +44,13 @@ $(CHARSET_DONE_BASE)-stdcs: $(CHARSET_DATA_DIR)/charsets \ $(wildcard $(CHARSET_DATA_DIR)/$(CHARSET_STANDARD_OS)) \ $(CHARSET_TEMPLATES) $(CHARSET_STANDARD_JAVA_TEMPLATES) \ $(BUILD_TOOLS_JDK) - $(MKDIR) -p $(@D) + $(call LogInfo, Generating java.base charset mapping) + $(call MakeDir, $(@D)) $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_BASE) \ stdcs charsets $(CHARSET_STANDARD_OS) \ $(CHARSET_STANDARD_JAVA_TEMPLATES) $(CHARSET_EXTSRC_DIR) \ $(CHARSET_COPYRIGHT_HEADER) \ - $(LOG_INFO) + $(LOG_DEBUG) $(TOUCH) '$@' GENSRC_JAVA_BASE += $(CHARSET_DONE_BASE)-stdcs - diff --git a/jdk/make/gensrc/GensrcExceptions.gmk b/jdk/make/gensrc/GensrcExceptions.gmk index 398a8857963..947cd019eec 100644 --- a/jdk/make/gensrc/GensrcExceptions.gmk +++ b/jdk/make/gensrc/GensrcExceptions.gmk @@ -32,21 +32,12 @@ GENSRC_EXCEPTIONS_CMD := $(JDK_TOPDIR)/make/scripts/genExceptions.sh GENSRC_EXCEPTIONS_SRC_DIRS := . charset channels -### - -$(GENSRC_EXCEPTIONS_DST)/_the.exceptions.dir: - $(ECHO) "Generating exceptions classes" - $(MKDIR) -p $(@D) - $(TOUCH) $@ - - -### - $(GENSRC_EXCEPTIONS_DST)/_the.%.marker: $(GENSRC_EXCEPTIONS_SRC)/%/exceptions \ - $(GENSRC_EXCEPTIONS_CMD) \ - $(GENSRC_EXCEPTIONS_DST)/_the.exceptions.dir - $(MKDIR) -p $(@D)/$* - SCRIPTS="$(JDK_TOPDIR)/make/scripts" NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GENSRC_EXCEPTIONS_CMD) $< $(@D)/$* $(LOG_INFO) + $(GENSRC_EXCEPTIONS_CMD) + $(call LogInfo, Generating exceptions java.nio $*) + $(call MakeDir, $(@D)/$*) + SCRIPTS="$(JDK_TOPDIR)/make/scripts" NAWK="$(NAWK)" SH="$(SH)" $(SH) \ + $(GENSRC_EXCEPTIONS_CMD) $< $(@D)/$* $(LOG_DEBUG) $(TOUCH) $@ GENSRC_EXCEPTIONS += $(foreach D,$(GENSRC_EXCEPTIONS_SRC_DIRS),$(GENSRC_EXCEPTIONS_DST)/_the.$(D).marker) diff --git a/jdk/make/gensrc/GensrcIcons.gmk b/jdk/make/gensrc/GensrcIcons.gmk index 6e1b5df596f..32ab58a3137 100644 --- a/jdk/make/gensrc/GensrcIcons.gmk +++ b/jdk/make/gensrc/GensrcIcons.gmk @@ -65,8 +65,8 @@ GENSRC_AWT_ICONS_DST_NAME = AWTIcon$(2)_$(subst .,_,$(subst -,_,$(1))) ################################################################################ $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir: - $(ECHO) Generating icon classes - $(MKDIR) -p $(GENSRC_AWT_ICONS_DST) + $(call LogInfo, Generating icon classes) + $(call MakeDir, $(GENSRC_AWT_ICONS_DST)) $(TOUCH) $@ ################################################################################ @@ -121,8 +121,9 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) endif $(GENSRC_OSX_ICONS): $(GENSRC_OSX_ICONS_SRC) $(BUILD_TOOLS_JDK) + $(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%, %, $@)) + $(call MakeDir, $(@D)) $(RM) $@ $@.tmp - $(MKDIR) -p $(dir $@) $(ECHO) "static unsigned char sAWTIconData[] = { " >> $@.tmp $(CAT) $< | $(TOOL_OSX_TOBIN) >> $@.tmp $(ECHO) "};" >> $@.tmp diff --git a/jdk/make/gensrc/GensrcLocaleData.gmk b/jdk/make/gensrc/GensrcLocaleData.gmk index 71b091bac8a..602a4f4752f 100644 --- a/jdk/make/gensrc/GensrcLocaleData.gmk +++ b/jdk/make/gensrc/GensrcLocaleData.gmk @@ -28,8 +28,9 @@ # into LocaleDataMetaInfo.java # First go look for all locale files -LOCALE_FILES := $(shell $(FIND) $(JDK_TOPDIR)/src/java.base/share/classes \ - $(JDK_TOPDIR)/src/jdk.localedata/share/classes \ +LOCALE_FILES := $(shell $(FIND) \ + $(JDK_TOPDIR)/src/$(MODULE)/share/classes/sun/text/resources \ + $(JDK_TOPDIR)/src/$(MODULE)/share/classes/sun/util/resources \ -name "FormatData_*.java" -o -name "FormatData_*.properties" -o \ -name "CollationData_*.java" -o -name "CollationData_*.properties" -o \ -name "TimeZoneNames_*.java" -o -name "TimeZoneNames_*.properties" -o \ @@ -42,17 +43,21 @@ LOCALE_FILES := $(shell $(FIND) $(JDK_TOPDIR)/src/java.base/share/classes \ LOCALE_RESOURCES := $(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES))))) # Include the list of resources found during the previous compile. --include $(SUPPORT_OUTPUTDIR)/gensrc/_the.locale_resources +-include $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the.locale_resources MISSING_RESOURCES := $(filter-out $(LOCALE_RESOURCES), $(PREV_LOCALE_RESOURCES)) NEW_RESOURCES := $(filter-out $(PREV_LOCALE_RESOURCES), $(LOCALE_RESOURCES)) ifneq (, $(MISSING_RESOURCES)$(NEW_RESOURCES)) # There is a difference in the number of supported resources. Trigger a regeneration. - $(shell $(RM) $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/BaseLocaleDataMetaInfo.java \ - $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonBaseLocaleDataMetaInfo.java \ - $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/cldr/CLDRBaseLocaleDataMetaInfo.java \ - $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo_jdk_localedata.java) + ifeq ($(MODULE), java.base) + $(shell $(RM) $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/BaseLocaleDataMetaInfo.java \ + $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/cldr/CLDRBaseLocaleDataMetaInfo.java) + endif + ifeq ($(MODULE), jdk.localedata) + $(shell $(RM) $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonBaseLocaleDataMetaInfo.java \ + $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo_jdk_localedata.java) + endif endif # The base locales @@ -121,18 +126,18 @@ SED_NONBASEARGS += -e 's/$(HASH)AvailableLocales_Locales$(HASH)/$(sort $(ALL_NON $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/BaseLocaleDataMetaInfo.java: \ $(JDK_TOPDIR)/src/java.base/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template + $(call LogInfo, Creating sun/util/locale/provider/BaseLocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources) $(MKDIR) -p $(@D) - $(ECHO) Creating sun/util/locale/provider/BaseLocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources. $(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" \ - > $(SUPPORT_OUTPUTDIR)/gensrc/_the.locale_resources + > $(SUPPORT_OUTPUTDIR)/gensrc/java.base/_the.locale_resources $(SED) $(SED_BASEARGS) $< > $@ $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonBaseLocaleDataMetaInfo.java: \ $(JDK_TOPDIR)/src/java.base/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template + $(call LogInfo, Creating sun/util/resources/provider/NonBaseLocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources) $(MKDIR) -p $(@D) - $(ECHO) Creating sun/util/resources/provider/NonBaseLocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources. $(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" \ - > $(SUPPORT_OUTPUTDIR)/gensrc/_the.locale_resources + > $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/_the.locale_resources $(SED) $(SED_NONBASEARGS) $< > $@ GENSRC_BASELOCALEDATA := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/BaseLocaleDataMetaInfo.java diff --git a/jdk/make/gensrc/GensrcMisc.gmk b/jdk/make/gensrc/GensrcMisc.gmk index 6e3cc38950d..bc70e0e01f0 100644 --- a/jdk/make/gensrc/GensrcMisc.gmk +++ b/jdk/make/gensrc/GensrcMisc.gmk @@ -50,7 +50,7 @@ GENSRC_SOR_BIN := $(BUILDTOOLS_OUTPUTDIR)/native/genSocketOptionRegistry SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \ $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') -$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE, \ +$(eval $(call SetupNativeCompilation, BUILD_GENSRC_SOR_EXE, \ SRC := $(GENSRC_SOR_SRC), \ INCLUDE_FILES := $(GENSRC_SOR_SRC_FILE), \ TOOLCHAIN := TOOLCHAIN_BUILD, \ @@ -86,7 +86,7 @@ ifneq ($(OPENJDK_TARGET_OS), windows) UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \ $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') - $(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE, \ + $(eval $(call SetupNativeCompilation, BUILD_GENSRC_UC_EXE, \ SRC := $(GENSRC_UC_SRC), \ INCLUDE_FILES := $(GENSRC_UC_SRC_FILE), \ TOOLCHAIN := TOOLCHAIN_BUILD, \ @@ -124,7 +124,7 @@ ifeq ($(OPENJDK_TARGET_OS), solaris) SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \ $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') - $(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE, \ + $(eval $(call SetupNativeCompilation, BUILD_GENSRC_SOL_EXE, \ SRC := $(GENSRC_SOL_SRC), \ INCLUDE_FILES := $(GENSRC_SOL_SRC_FILE), \ TOOLCHAIN := TOOLCHAIN_BUILD, \ diff --git a/jdk/make/gensrc/GensrcProperties.gmk b/jdk/make/gensrc/GensrcProperties.gmk index 2cc6231175e..7293a19bbeb 100644 --- a/jdk/make/gensrc/GensrcProperties.gmk +++ b/jdk/make/gensrc/GensrcProperties.gmk @@ -75,7 +75,7 @@ define SetupCompilePropertiesBody # Convert .../src//share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties # to .../support/gensrc//com/sun/tools/javac/resources/javac_zh_CN.java - # Strip away prefix and suffix, leaving for example only: + # Strip away prefix and suffix, leaving for example only: # "/share/classes/com/sun/tools/javac/resources/javac_zh_CN" $1_JAVAS := $$(patsubst $$($1_MODULE_PATH_ROOT)/%, \ $(SUPPORT_OUTPUTDIR)/gensrc/%, \ diff --git a/jdk/make/gensrc/GensrcSwing.gmk b/jdk/make/gensrc/GensrcSwing.gmk index 2f643d4abc2..eee0c044f2f 100644 --- a/jdk/make/gensrc/GensrcSwing.gmk +++ b/jdk/make/gensrc/GensrcSwing.gmk @@ -31,12 +31,11 @@ NIMBUS_GENSRC_DIR = $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/javax/swing/plaf/ni NIMBUS_SKIN_FILE = $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/skin.laf $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated_nimbus: $(NIMBUS_SKIN_FILE) $(BUILD_TOOLS_JDK) + $(call LogInfo, Generating Nimbus source files) $(MKDIR) -p $(@D) - $(ECHO) "Generating Nimbus source files" - $(TOOL_GENERATENIMBUS) $(LOG_INFO) \ + $(TOOL_GENERATENIMBUS) $(LOG_DEBUG) \ -skinFile $(NIMBUS_SKIN_FILE) -buildDir $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop \ -packagePrefix $(NIMBUS_PACKAGE).nimbus -lafName Nimbus - $(ECHO) $(LOG_INFO) "Finished generating Nimbus source files" $(TOUCH) $@ GENSRC_SWING_NIMBUS := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated_nimbus diff --git a/jdk/make/gensrc/GensrcX11Wrappers.gmk b/jdk/make/gensrc/GensrcX11Wrappers.gmk index b9823c36be5..e4e3bba5745 100644 --- a/jdk/make/gensrc/GensrcX11Wrappers.gmk +++ b/jdk/make/gensrc/GensrcX11Wrappers.gmk @@ -63,14 +63,14 @@ GENSRC_X11_SIZES_USED := $(addprefix $(GENSRC_X11WRAPPERS_TMP)/sizes., $(GENSRC_ # Copy only the sizes.* files that are actually needed. WrapperGenerator picks up any it finds from the # file prefix it is given so those not needed need to be hidden. $(GENSRC_X11WRAPPERS_TMP)/sizes.%: $(GENSRC_SIZER_DIR)/sizes.% - $(MKDIR) -p $(@D) + $(call MakeDir, $(@D)) $(RM) '$@' $(SORT) $< > $@ # Run the tool on the offset files copied from the source repository to generate several Java classes # used in awt. $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated.x11: $(GENSRC_X11_SIZES_USED) $(BUILD_TOOLS_JDK) - $(MKDIR) -p $(GENSRC_X11WRAPPERS_DST) + $(call MakeDir, $(GENSRC_X11WRAPPERS_DST)) $(TOOL_WRAPPERGENERATOR) $(GENSRC_X11WRAPPERS_DST) $(GENSRC_SIZER_DIR)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizes $(TOUCH) $@ @@ -82,8 +82,8 @@ ifneq ($(COMPILE_TYPE), cross) # Generate the C code for the program that will output the offset file. $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c: $(GENSRC_SIZER_DIR)/xlibtypes.txt $(BUILD_TOOLS_JDK) - $(ECHO) "Generating X11 wrapper ($*-bit version)" - $(MKDIR) -p $(@D) + $(call LogInfo, Generating X11 wrapper ($*-bit version)) + $(call MakeDir, $(@D)) $(TOOL_WRAPPERGENERATOR) $(@D) $(GENSRC_SIZER_DIR)/xlibtypes.txt "sizer" $* # use -m32/-m64 only if the compiler supports it @@ -103,7 +103,7 @@ ifneq ($(COMPILE_TYPE), cross) # Compile the C code into an executable. $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c - $(MKDIR) -p $(@D) + $(call MakeDir, $(@D)) (cd $(@D) && $(CC) $(MEMORY_MODEL_FLAG) -o $@ $< \ $(X_CFLAGS) \ $(X_LIBS) \ @@ -114,9 +114,9 @@ ifneq ($(COMPILE_TYPE), cross) # Run the executable create the offset file and check that it is identical # to the offset file in the source code repository. $(GENSRC_X11WRAPPERS_TMP)/sizes.%.verification: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe - $(MKDIR) -p $(@D) + $(call LogInfo, Verifying X11 wrapper sizes) + $(call MakeDir, $(@D)) $(GENSRC_X11WRAPPERS_TMP)/sizer.$*.exe | $(SORT) > $@.tmp - $(ECHO) Verifying $(GENSRC_X11WRAPPERS_TMP)/sizes.$*.verification.tmp to $(GENSRC_X11WRAPPERS_TMP)/sizes.$* $(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizes.$*.verification.tmp $(GENSRC_X11WRAPPERS_TMP)/sizes.$* mv $@.tmp $@ diff --git a/jdk/make/launcher/LauncherCommon.gmk b/jdk/make/launcher/LauncherCommon.gmk index aeee54a2d0a..701b2a962e3 100644 --- a/jdk/make/launcher/LauncherCommon.gmk +++ b/jdk/make/launcher/LauncherCommon.gmk @@ -31,9 +31,6 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) ENABLE_DEBUG_SYMBOLS := false endif -# Prepare the find cache. -$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src/java.base/share/native/launcher)) - ifeq ($(OPENJDK_TARGET_OS), macosx) ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN) else @@ -124,7 +121,7 @@ define SetupBuildLauncherBody $1_LDFLAGS += -exported_symbols_list \ $(SUPPORT_OUTPUTDIR)/build-static/exported.symbols $1_LIBS += \ - $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs/java.base -name "*.a") \ + $$(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs/java.base -name "*.a") \ $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libdt_socket.a \ $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libjdwp.a \ $(SUPPORT_OUTPUTDIR)/native/java.base/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) \ @@ -174,8 +171,7 @@ define SetupBuildLauncherBody endif $$(eval $$(call SetupNativeCompilation, BUILD_LAUNCHER_$1, \ - SRC := $(LAUNCHER_SRC), \ - INCLUDE_FILES := main.c, \ + EXTRA_FILES := $(LAUNCHER_SRC)/main.c, \ OPTIMIZATION := $$($1_OPTIMIZATION), \ CFLAGS := $$($1_CFLAGS) \ $(LAUNCHER_CFLAGS) \ diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index 08cd4d774ab..395521c5da8 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -750,7 +750,8 @@ ifeq ($(OPENJDK_TARGET_OS), windows) $(BUILD_LIBJAWT): $(BUILD_LIBAWT) $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT) - $(ECHO) Copying $(@F) + $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%, %, $@)) + $(call MakeDir, $(@D)) $(CP) $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@ TARGETS += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) diff --git a/jdk/make/lib/Lib-java.base.gmk b/jdk/make/lib/Lib-java.base.gmk index 0699a42dd34..345fda65908 100644 --- a/jdk/make/lib/Lib-java.base.gmk +++ b/jdk/make/lib/Lib-java.base.gmk @@ -49,7 +49,7 @@ ifeq ($(STATIC_BUILD), true) JAVA_BASE_EXPORT_SYMBOL_FILE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/java.base.symbols $(JAVA_BASE_EXPORT_SYMBOL_FILE): $(JAVA_BASE_EXPORT_SYMBOLS_SRC) - $(ECHO) $(LOG_INFO) "Generating java.base.symbols file" + $(call LogInfo, Generating java.base.symbols file) $(CAT) $^ > $@ # The individual symbol files is generated when the respective lib is built diff --git a/jdk/make/lib/Lib-jdk.jdwp.agent.gmk b/jdk/make/lib/Lib-jdk.jdwp.agent.gmk index 14784d3796a..d64b395c163 100644 --- a/jdk/make/lib/Lib-jdk.jdwp.agent.gmk +++ b/jdk/make/lib/Lib-jdk.jdwp.agent.gmk @@ -111,7 +111,7 @@ ifeq ($(STATIC_BUILD), true) JDK_JDWP_AGENT_EXPORT_SYMBOL_FILE := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/jdk.jdwp.agent.symbols $(JDK_JDWP_AGENT_EXPORT_SYMBOL_FILE): $(JDK_JDWP_AGENT_EXPORT_SYMBOLS_SRC) - $(ECHO) $(LOG_INFO) "Generating jdk.jdwp.agent symbols file" + $(call LogInfo, Generating jdk.jdwp.agent symbols file) $(CAT) $^ > $@ # The individual symbol files is generated when the respective lib is built diff --git a/jdk/make/lib/LibCommon.gmk b/jdk/make/lib/LibCommon.gmk index 68bdcc0a414..7ca5228c8e9 100644 --- a/jdk/make/lib/LibCommon.gmk +++ b/jdk/make/lib/LibCommon.gmk @@ -23,8 +23,6 @@ # questions. # -include $(SPEC) -include MakeBase.gmk include NativeCompilation.gmk GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc @@ -87,3 +85,5 @@ ifeq ($(USE_EXTERNAL_LIBZ), true) else ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8 endif + +############################################################################### From 0d980c2b94a5f72bfba86abd50776cd176bf265e Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Sat, 16 Jan 2016 10:44:40 -0800 Subject: [PATCH 200/228] 8147508: Correct fix for JDK-8147480 Reviewed-by: martin --- jdk/test/TEST.groups | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups index 769e9ab7f7e..fbe25e8224f 100644 --- a/jdk/test/TEST.groups +++ b/jdk/test/TEST.groups @@ -31,8 +31,8 @@ tier1 = \ -java/util/zip/TestLocalTime.java \ :jdk_util \ -java/util/WeakHashMap/GCDuringIteration.java \ - -java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java - -java/util/concurrent/forkjoin/FJExceptionTableLeak.java + -java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java \ + -java/util/concurrent/forkjoin/FJExceptionTableLeak.java \ sun/nio/cs/ISO8859x.java \ java/nio/Buffer \ com/sun/crypto/provider/Cipher \ @@ -43,7 +43,7 @@ tier2 = \ java/util/zip/TestLocalTime.java \ java/util/WeakHashMap/GCDuringIteration.java \ java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java \ - java/util/concurrent/forkjoin/FJExceptionTableLeak.java + java/util/concurrent/forkjoin/FJExceptionTableLeak.java \ :jdk_io \ :jdk_nio \ -sun/nio/cs/ISO8859x.java \ From 9fdfd0fc8fe127ba133009ddd2b8ffcdb322b10d Mon Sep 17 00:00:00 2001 From: Huaming Li Date: Sun, 17 Jan 2016 08:43:49 +0000 Subject: [PATCH 201/228] 8146213: (so) Test java/nio/channels/ServerSocketChannel/AdaptServerSocket.java failed intermittently with Connection refused Reviewed-by: bpb, alanb --- .../AdaptServerSocket.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/jdk/test/java/nio/channels/ServerSocketChannel/AdaptServerSocket.java b/jdk/test/java/nio/channels/ServerSocketChannel/AdaptServerSocket.java index 13aeea1bba4..79391ecca99 100644 --- a/jdk/test/java/nio/channels/ServerSocketChannel/AdaptServerSocket.java +++ b/jdk/test/java/nio/channels/ServerSocketChannel/AdaptServerSocket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -22,8 +22,8 @@ */ /* @test + * @bug 4286936 8146213 * @summary Unit test for server-socket-channel adaptors - * @key intermittent */ import java.io.*; @@ -77,6 +77,9 @@ public class AdaptServerSocket { static void test(int clientDally, int timeout, boolean shouldTimeout) throws Exception { + boolean needClient = !shouldTimeout; + client = null; + clientException = null; clientStarted = false; out.println(); @@ -90,9 +93,11 @@ public class AdaptServerSocket { sso.bind(null); out.println("bound: " + ssc); out.println(" " + sso); - startClient(sso.getLocalPort(), clientDally); - while (!clientStarted) { - Thread.sleep(20); + if (needClient) { + startClient(sso.getLocalPort(), clientDally); + while (!clientStarted) { + Thread.sleep(20); + } } Socket so = null; try { @@ -115,10 +120,12 @@ public class AdaptServerSocket { out.println("server: read " + b); } } - client.interrupt(); - client.join(); - if (clientException != null) - throw clientException; + if (needClient) { + client.interrupt(); + client.join(); + if (clientException != null) + throw clientException; + } } public static void main(String[] args) throws Exception { From 6c65f7751704325742cf3dc64ace3025bcf1adca Mon Sep 17 00:00:00 2001 From: Miroslav Kos Date: Mon, 18 Jan 2016 15:21:34 +0100 Subject: [PATCH 202/228] 8146086: Publishing two webservices on same port fails with "java.net.BindException: Address already in use" Reviewed-by: chegar --- jdk/test/javax/xml/ws/publish/WSTest.java | 86 +++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 jdk/test/javax/xml/ws/publish/WSTest.java diff --git a/jdk/test/javax/xml/ws/publish/WSTest.java b/jdk/test/javax/xml/ws/publish/WSTest.java new file mode 100644 index 00000000000..539f2d4b53b --- /dev/null +++ b/jdk/test/javax/xml/ws/publish/WSTest.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2016, 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 8146086 + * @summary Publishing two webservices on same port fails with "java.net.BindException: Address already in use" + * @run main/othervm WSTest + */ +import javax.jws.WebMethod; +import javax.jws.WebService; +import javax.xml.ws.Endpoint; +import java.net.ServerSocket; + +public class WSTest { + + @WebService(targetNamespace = "test") + public static class Method1 { + @WebMethod + public String getMethod1Value() { + return "from Method1"; + } + } + + @WebService(targetNamespace = "test") + public static class Method2 { + @WebMethod + public String getMethod2Value() { + return "from Method2"; + } + } + + public static void main(String[] args) throws Exception { + + // find a free port + ServerSocket ss = new ServerSocket(0); + int port = ss.getLocalPort(); + ss.close(); + + Endpoint endPoint1 = null; + Endpoint endPoint2 = null; + try { + endPoint1 = Endpoint.publish("http://0.0.0.0:" + port + "/method1", + new Method1()); + endPoint2 = Endpoint.publish("http://0.0.0.0:" + port + "/method2", + new Method2()); + + System.out.println("Sleep 3 secs..."); + + Thread.sleep(3000); + } finally { + stop(endPoint2); + stop(endPoint1); + } + } + + private static void stop(Endpoint endPoint) { + if (endPoint == null) return; + + try { + endPoint.stop(); + } catch (Throwable ignored) { + } + } + +} From 6452a8d8e35770ff33cd2580e6e3f61b241f73db Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Tue, 19 Jan 2016 09:40:55 -0800 Subject: [PATCH 203/228] 8147629: quarantine tests failing in 2016.01.14 PIT snapshot Ignore test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java and test/tools/launcher/TooSmallStackSize.java Reviewed-by: rdurbin, amurillo --- .../com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java | 2 ++ jdk/test/tools/launcher/TooSmallStackSize.java | 1 + 2 files changed, 3 insertions(+) diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java index 9b8afea79e9..b94644d1fd1 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java @@ -24,6 +24,8 @@ /* * @test * @bug 8028994 + * @ignore 8147477 + * @ignore 8147494 * @author Staffan Larsen * @library /lib/testlibrary * @modules jdk.attach/sun.tools.attach diff --git a/jdk/test/tools/launcher/TooSmallStackSize.java b/jdk/test/tools/launcher/TooSmallStackSize.java index dac1c7f0325..9635eaee5bd 100644 --- a/jdk/test/tools/launcher/TooSmallStackSize.java +++ b/jdk/test/tools/launcher/TooSmallStackSize.java @@ -24,6 +24,7 @@ /* * @test * @bug 6762191 + * @ignore 8146751 * @summary Setting stack size to 16K causes segmentation fault * @compile TooSmallStackSize.java * @run main TooSmallStackSize From 559932b6fcb5bf07d02b2e841ef432e059914029 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Wed, 20 Jan 2016 09:54:13 +0100 Subject: [PATCH 204/228] 8145596: Enable debug symbols for all libraries Reviewed-by: erikj --- jdk/make/launcher/Launcher-java.base.gmk | 1 - .../launcher/Launcher-jdk.accessibility.gmk | 3 --- jdk/make/launcher/Launcher-jdk.pack200.gmk | 1 - jdk/make/launcher/LauncherCommon.gmk | 7 ----- jdk/make/lib/Awt2dLibraries.gmk | 26 +++++++++---------- jdk/make/lib/CoreLibraries.gmk | 21 +++++++-------- jdk/make/lib/Lib-java.instrument.gmk | 2 +- jdk/make/lib/Lib-java.management.gmk | 4 +-- jdk/make/lib/Lib-java.prefs.gmk | 2 +- jdk/make/lib/Lib-java.security.jgss.gmk | 4 +-- jdk/make/lib/Lib-java.smartcardio.gmk | 2 +- jdk/make/lib/Lib-jdk.accessibility.gmk | 6 ++--- jdk/make/lib/Lib-jdk.attach.gmk | 2 +- jdk/make/lib/Lib-jdk.crypto.ec.gmk | 2 +- jdk/make/lib/Lib-jdk.crypto.mscapi.gmk | 2 +- jdk/make/lib/Lib-jdk.crypto.pkcs11.gmk | 2 +- jdk/make/lib/Lib-jdk.crypto.ucrypto.gmk | 2 +- jdk/make/lib/Lib-jdk.deploy.osx.gmk | 2 +- jdk/make/lib/Lib-jdk.internal.le.gmk | 2 +- jdk/make/lib/Lib-jdk.jdi.gmk | 2 +- jdk/make/lib/Lib-jdk.jdwp.agent.gmk | 4 +-- jdk/make/lib/Lib-jdk.management.gmk | 4 +-- jdk/make/lib/Lib-jdk.pack200.gmk | 2 +- jdk/make/lib/Lib-jdk.sctp.gmk | 2 +- jdk/make/lib/Lib-jdk.security.auth.gmk | 2 +- jdk/make/lib/LibCommon.gmk | 19 -------------- jdk/make/lib/NetworkingLibraries.gmk | 2 +- jdk/make/lib/NioLibraries.gmk | 2 +- jdk/make/lib/PlatformLibraries.gmk | 2 +- jdk/make/lib/SecurityLibraries.gmk | 2 +- jdk/make/lib/SoundLibraries.gmk | 6 ++--- 31 files changed, 55 insertions(+), 87 deletions(-) diff --git a/jdk/make/launcher/Launcher-java.base.gmk b/jdk/make/launcher/Launcher-java.base.gmk index 4214de4ec22..77d241405c3 100644 --- a/jdk/make/launcher/Launcher-java.base.gmk +++ b/jdk/make/launcher/Launcher-java.base.gmk @@ -130,7 +130,6 @@ ifneq ($(BUILD_JEXEC_SRC), ) LDFLAGS := $(LDFLAGS_JDKEXE), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jexec_obj, \ OUTPUT_DIR := $(BUILD_JEXEC_DST_DIR), \ - DEBUG_SYMBOLS := true, \ PROGRAM := jexec)) TARGETS += $(BUILD_JEXEC) diff --git a/jdk/make/launcher/Launcher-jdk.accessibility.gmk b/jdk/make/launcher/Launcher-jdk.accessibility.gmk index e954e550f30..6815e6d378d 100644 --- a/jdk/make/launcher/Launcher-jdk.accessibility.gmk +++ b/jdk/make/launcher/Launcher-jdk.accessibility.gmk @@ -45,7 +45,6 @@ ifeq ($(OPENJDK_TARGET_OS), windows) OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jabswitch, \ OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \ PROGRAM := jabswitch, \ - DEBUG_SYMBOLS := true, \ VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRC)/AccessBridgeStatusWindow.RC, \ RC_FLAGS := $(RC_FLAGS) \ -D "JDK_FNAME=jabswitch.exe" \ @@ -79,7 +78,6 @@ ifeq ($(OPENJDK_TARGET_OS), windows) OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccessinspector$1, \ OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \ PROGRAM := jaccessinspector$1, \ - DEBUG_SYMBOLS := true, \ VERSIONINFO_RESOURCE := $(TOPDIR)/jaccessinspector/jaccessinspectorWindow.rc, \ RC_FLAGS := $$(RC_FLAGS) \ -D "JDK_FNAME=jaccessinspector$1.exe" \ @@ -107,7 +105,6 @@ ifeq ($(OPENJDK_TARGET_OS), windows) OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccesswalker$1, \ OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \ PROGRAM := jaccesswalker$1, \ - DEBUG_SYMBOLS := true, \ VERSIONINFO_RESOURCE := $(TOPDIR)/jaccesswalker/jaccesswalkerWindow.rc, \ RC_FLAGS := $$(RC_FLAGS) \ -D "JDK_FNAME=jaccesswalker$1.exe" \ diff --git a/jdk/make/launcher/Launcher-jdk.pack200.gmk b/jdk/make/launcher/Launcher-jdk.pack200.gmk index 55c03865f71..818828a2929 100644 --- a/jdk/make/launcher/Launcher-jdk.pack200.gmk +++ b/jdk/make/launcher/Launcher-jdk.pack200.gmk @@ -100,7 +100,6 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \ -D "JDK_FNAME=unpack200.exe" \ -D "JDK_INTERNAL_NAME=unpack200" \ -D "JDK_FTYPE=0x1L", \ - DEBUG_SYMBOLS := true, \ MANIFEST := $(JDK_TOPDIR)/src/jdk.pack200/windows/native/unpack200/unpack200_proto.exe.manifest, \ MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \ )) diff --git a/jdk/make/launcher/LauncherCommon.gmk b/jdk/make/launcher/LauncherCommon.gmk index 701b2a962e3..8e79d758693 100644 --- a/jdk/make/launcher/LauncherCommon.gmk +++ b/jdk/make/launcher/LauncherCommon.gmk @@ -25,12 +25,6 @@ include NativeCompilation.gmk -# SetupNativeCompilation now supports debug symbols on macosx for hotspot. -# Disable it here for the jdk binaries until we decide to enable them. -ifeq ($(OPENJDK_TARGET_OS), macosx) - ENABLE_DEBUG_SYMBOLS := false -endif - ifeq ($(OPENJDK_TARGET_OS), macosx) ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN) else @@ -200,7 +194,6 @@ define SetupBuildLauncherBody OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$1_objs, \ OUTPUT_DIR := $$($1_OUTPUT_DIR), \ PROGRAM := $1, \ - DEBUG_SYMBOLS := true, \ VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \ RC_FLAGS := $$(RC_FLAGS) \ -D "JDK_FNAME=$1$(EXE_SUFFIX)" \ diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index 395521c5da8..abd7edc0021 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -69,7 +69,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE, \ -D "JDK_INTERNAL_NAME=mlib_image" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmlib_image, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) $(BUILD_LIBMLIB_IMAGE): $(call FindLib, java.base, java) @@ -134,7 +134,7 @@ ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc) $(call SET_SHARED_LIBRARY_ORIGIN), \ LIBS := -ljava -ljvm -lc $(BUILD_LIBMLIB_LDLIBS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmlib_image_v, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) $(BUILD_LIBMLIB_IMAGE_V): $(call FindLib, java.base, java) @@ -279,7 +279,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \ -D "JDK_INTERNAL_NAME=awt" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) $(BUILD_LIBAWT): $(call FindLib, java.base, java) @@ -369,7 +369,7 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),) -D "JDK_INTERNAL_NAME=xawt" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_xawt, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) $(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java) @@ -433,7 +433,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \ -D "JDK_INTERNAL_NAME=lcms" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/liblcms, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) TARGETS += $(BUILD_LIBLCMS) @@ -509,7 +509,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \ -D "JDK_FTYPE=0x2L", \ REORDER := $(BUILD_LIBJAVAJPEG_REORDER), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjavajpeg, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) $(BUILD_LIBJAVAJPEG): $(call FindLib, java.base, java) @@ -578,7 +578,7 @@ ifeq ($(BUILD_HEADLESS), true) LIBS_linux := -lm $(LIBDL), \ LIBS_solaris := -lm $(LIBDL) $(LIBCXX) -lc, \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_headless, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT) @@ -700,7 +700,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ -D "JDK_INTERNAL_NAME=fontmanager" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfontmanager, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT) @@ -745,7 +745,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows) -D "JDK_INTERNAL_NAME=jawt" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) $(BUILD_LIBJAWT): $(BUILD_LIBAWT) @@ -805,7 +805,7 @@ else # OPENJDK_TARGET_OS not windows LIBS_solaris := $(X_LIBS) -lXrender, \ LIBS_macosx := -framework Cocoa, \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) ifndef BUILD_HEADLESS_ONLY $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT) @@ -927,7 +927,7 @@ ifndef BUILD_HEADLESS_ONLY -D "JDK_INTERNAL_NAME=splashscreen" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsplashscreen, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) TARGETS += $(BUILD_LIBSPLASHSCREEN) @@ -1003,7 +1003,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) -framework OpenGL \ -framework QuartzCore -ljava, \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_lwawt, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) TARGETS += $(BUILD_LIBAWT_LWAWT) @@ -1045,7 +1045,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) -framework JavaRuntimeSupport \ -ljava -ljvm, \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxui, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) TARGETS += $(BUILD_LIBOSXUI) diff --git a/jdk/make/lib/CoreLibraries.gmk b/jdk/make/lib/CoreLibraries.gmk index 926ebc7ce38..5cbeb4b03f7 100644 --- a/jdk/make/lib/CoreLibraries.gmk +++ b/jdk/make/lib/CoreLibraries.gmk @@ -55,7 +55,7 @@ ifneq ($(OPENJDK_TARGET_OS), macosx) DISABLED_WARNINGS_microsoft := 4146 4244 4018, \ ARFLAGS := $(ARFLAGS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) else @@ -68,7 +68,7 @@ else CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \ LDFLAGS := -nostdlib -r -arch x86_64, \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) BUILD_LIBFDLIBM := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) $(BUILD_LIBFDLIBM): $(BUILD_LIBFDLIBM_MAC) @@ -86,7 +86,7 @@ endif LIBVERIFY_OPTIMIZATION := HIGH ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), ) - ifeq ($(ENABLE_DEBUG_SYMBOLS), true) + ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true) LIBVERIFY_OPTIMIZATION := LOW endif endif @@ -110,7 +110,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \ -D "JDK_FTYPE=0x2L", \ REORDER := $(BUILD_LIBVERIFY_REORDER), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libverify, \ - DEBUG_SYMBOLS := true)) +)) TARGETS += $(BUILD_LIBVERIFY) @@ -178,7 +178,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \ -D "JDK_FTYPE=0x2L", \ REORDER := $(LIBJAVA_REORDER), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) TARGETS += $(BUILD_LIBJAVA) @@ -235,8 +235,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \ -D "JDK_INTERNAL_NAME=zip" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libzip, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) - +)) $(BUILD_LIBZIP): $(BUILD_LIBJAVA) @@ -280,7 +279,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \ -D "JDK_INTERNAL_NAME=jimage" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjimage, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) $(BUILD_LIBJIMAGE): $(BUILD_LIBJAVA) @@ -396,7 +395,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \ -D "JDK_INTERNAL_NAME=jli" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) TARGETS += $(BUILD_LIBJLI) @@ -414,7 +413,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows) CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \ ARFLAGS := $(ARFLAGS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) TARGETS += $(BUILD_LIBJLI_STATIC) @@ -433,7 +432,7 @@ else ifeq ($(OPENJDK_TARGET_OS), macosx) CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \ LDFLAGS := -nostdlib -r, \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) ifeq ($(STATIC_BUILD), true) TARGETS += $(BUILD_LIBJLI_STATIC) diff --git a/jdk/make/lib/Lib-java.instrument.gmk b/jdk/make/lib/Lib-java.instrument.gmk index 834cdc2850d..02df76073af 100644 --- a/jdk/make/lib/Lib-java.instrument.gmk +++ b/jdk/make/lib/Lib-java.instrument.gmk @@ -84,7 +84,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \ -D "JDK_INTERNAL_NAME=instrument" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libinstrument, \ - DEBUG_SYMBOLS := true)) +)) ifneq (, $(findstring $(OPENJDK_TARGET_OS), macosx windows aix)) $(BUILD_LIBINSTRUMENT): $(SUPPORT_OUTPUTDIR)/native/java.base/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX) diff --git a/jdk/make/lib/Lib-java.management.gmk b/jdk/make/lib/Lib-java.management.gmk index e2b30c8dae9..2533f786ec3 100644 --- a/jdk/make/lib/Lib-java.management.gmk +++ b/jdk/make/lib/Lib-java.management.gmk @@ -40,7 +40,7 @@ LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/java.management/share/native/include LIBMANAGEMENT_OPTIMIZATION := HIGH ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), ) - ifeq ($(ENABLE_DEBUG_SYMBOLS), true) + ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true) LIBMANAGEMENT_OPTIMIZATION := LOW endif endif @@ -64,7 +64,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \ -D "JDK_INTERNAL_NAME=management" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmanagement, \ - DEBUG_SYMBOLS := true)) +)) $(BUILD_LIBMANAGEMENT): $(call FindLib, java.base, java) diff --git a/jdk/make/lib/Lib-java.prefs.gmk b/jdk/make/lib/Lib-java.prefs.gmk index a34083510e6..4652415c0c5 100644 --- a/jdk/make/lib/Lib-java.prefs.gmk +++ b/jdk/make/lib/Lib-java.prefs.gmk @@ -55,7 +55,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBPREFS, \ -D "JDK_INTERNAL_NAME=prefs" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libprefs, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) $(BUILD_LIBPREFS): $(call FindLib, java.base, java) diff --git a/jdk/make/lib/Lib-java.security.jgss.gmk b/jdk/make/lib/Lib-java.security.jgss.gmk index 5d84a22a050..6f37b623288 100644 --- a/jdk/make/lib/Lib-java.security.jgss.gmk +++ b/jdk/make/lib/Lib-java.security.jgss.gmk @@ -46,7 +46,7 @@ ifneq ($(OPENJDK_TARGET_OS), windows) LIBS := $(LIBDL), \ LIBS_solaris := -lc, \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libj2gss, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) TARGETS += $(BUILD_LIBJ2GSS) endif @@ -92,7 +92,7 @@ ifneq ($(BUILD_CRYPTO), no) -D "JDK_INTERNAL_NAME=$(BUILD_LIBKRB5_NAME)" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libkrb5, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) TARGETS += $(BUILD_LIBKRB5) endif diff --git a/jdk/make/lib/Lib-java.smartcardio.gmk b/jdk/make/lib/Lib-java.smartcardio.gmk index a078e5f03e3..e013203d4e9 100644 --- a/jdk/make/lib/Lib-java.smartcardio.gmk +++ b/jdk/make/lib/Lib-java.smartcardio.gmk @@ -52,7 +52,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC, \ -D "JDK_INTERNAL_NAME=j2pcsc" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libj2pcsc, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) TARGETS += $(BUILD_LIBJ2PCSC) diff --git a/jdk/make/lib/Lib-jdk.accessibility.gmk b/jdk/make/lib/Lib-jdk.accessibility.gmk index 66cee50e40b..565b76a9e8a 100644 --- a/jdk/make/lib/Lib-jdk.accessibility.gmk +++ b/jdk/make/lib/Lib-jdk.accessibility.gmk @@ -61,7 +61,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows) -D "JDK_INTERNAL_NAME=javaaccessbridge$1" \ -D "JDK_FTYPE=0x02L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjavaaccessbridge$1, \ - DEBUG_SYMBOLS := true) + ) $$(BUILD_JAVAACCESSBRIDGE$1): $(SUPPORT_OUTPUTDIR)/native/java.desktop/libjawt/jawt.lib @@ -91,7 +91,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows) -D "JDK_INTERNAL_NAME=windowsaccessbridge$1" \ -D "JDK_FTYPE=0x02L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libwindowsaccessbridge$1, \ - DEBUG_SYMBOLS := true) + ) TARGETS += $$(BUILD_WINDOWSACCESSBRIDGE$1) @@ -113,7 +113,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows) -D "JDK_INTERNAL_NAME=jabsysinfo" \ -D "JDK_FTYPE=0x02L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/lib/libjabsysinfo, \ - DEBUG_SYMBOLS := true) + ) TARGETS += $$(BUILD_ACCESSBRIDGESYSINFO) diff --git a/jdk/make/lib/Lib-jdk.attach.gmk b/jdk/make/lib/Lib-jdk.attach.gmk index c227414646d..552b855594a 100644 --- a/jdk/make/lib/Lib-jdk.attach.gmk +++ b/jdk/make/lib/Lib-jdk.attach.gmk @@ -56,7 +56,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBATTACH, \ LIBS_solaris := -ldoor, \ LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib psapi.lib, \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libattach, \ - DEBUG_SYMBOLS := true)) +)) $(BUILD_LIBATTACH): $(call FindLib, java.base, java) diff --git a/jdk/make/lib/Lib-jdk.crypto.ec.gmk b/jdk/make/lib/Lib-jdk.crypto.ec.gmk index 6c62ba68011..fa0d1ff8893 100644 --- a/jdk/make/lib/Lib-jdk.crypto.ec.gmk +++ b/jdk/make/lib/Lib-jdk.crypto.ec.gmk @@ -68,7 +68,7 @@ ifeq ($(ENABLE_INTREE_EC), yes) -D "JDK_INTERNAL_NAME=sunec" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsunec, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) TARGETS += $(BUILD_LIBSUNEC) endif diff --git a/jdk/make/lib/Lib-jdk.crypto.mscapi.gmk b/jdk/make/lib/Lib-jdk.crypto.mscapi.gmk index 8a3bb4e9ccf..ea73c1c55e4 100644 --- a/jdk/make/lib/Lib-jdk.crypto.mscapi.gmk +++ b/jdk/make/lib/Lib-jdk.crypto.mscapi.gmk @@ -47,7 +47,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows) -D "JDK_INTERNAL_NAME=sunmscapi" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsunmscapi, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) TARGETS += $(BUILD_LIBSUNMSCAPI) endif diff --git a/jdk/make/lib/Lib-jdk.crypto.pkcs11.gmk b/jdk/make/lib/Lib-jdk.crypto.pkcs11.gmk index 21c19b9e5d4..c74f77960bb 100644 --- a/jdk/make/lib/Lib-jdk.crypto.pkcs11.gmk +++ b/jdk/make/lib/Lib-jdk.crypto.pkcs11.gmk @@ -51,7 +51,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \ -D "JDK_INTERNAL_NAME=j2pkcs11" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libj2pkcs11, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) TARGETS += $(BUILD_LIBJ2PKCS11) diff --git a/jdk/make/lib/Lib-jdk.crypto.ucrypto.gmk b/jdk/make/lib/Lib-jdk.crypto.ucrypto.gmk index c71634166b2..31c39f1bb69 100644 --- a/jdk/make/lib/Lib-jdk.crypto.ucrypto.gmk +++ b/jdk/make/lib/Lib-jdk.crypto.ucrypto.gmk @@ -44,7 +44,7 @@ ifeq ($(OPENJDK_TARGET_OS), solaris) LIBS := $(LIBDL), \ LIBS_solaris := -lc, \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libj2ucrypto, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) $(BUILD_LIBJ2UCRYPTO): $(BUILD_LIBJAVA) diff --git a/jdk/make/lib/Lib-jdk.deploy.osx.gmk b/jdk/make/lib/Lib-jdk.deploy.osx.gmk index 08125ce9d23..881a387e14d 100644 --- a/jdk/make/lib/Lib-jdk.deploy.osx.gmk +++ b/jdk/make/lib/Lib-jdk.deploy.osx.gmk @@ -57,7 +57,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) -framework SystemConfiguration \ $(JDKLIB_LIBS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosx, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) TARGETS += $(BUILD_LIBOSX) diff --git a/jdk/make/lib/Lib-jdk.internal.le.gmk b/jdk/make/lib/Lib-jdk.internal.le.gmk index 7aeeac3711d..cd9eaba1923 100644 --- a/jdk/make/lib/Lib-jdk.internal.le.gmk +++ b/jdk/make/lib/Lib-jdk.internal.le.gmk @@ -51,7 +51,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows) -D "JDK_INTERNAL_NAME=le" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/lible, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) TARGETS += $(BUILD_LIBLE) diff --git a/jdk/make/lib/Lib-jdk.jdi.gmk b/jdk/make/lib/Lib-jdk.jdi.gmk index 0c7de8144df..8bed1f9abd1 100644 --- a/jdk/make/lib/Lib-jdk.jdi.gmk +++ b/jdk/make/lib/Lib-jdk.jdi.gmk @@ -55,7 +55,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows) -D "JDK_INTERNAL_NAME=dt_shmem" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libdt_shmem, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) TARGETS += $(BUILD_LIBDT_SHMEM) diff --git a/jdk/make/lib/Lib-jdk.jdwp.agent.gmk b/jdk/make/lib/Lib-jdk.jdwp.agent.gmk index d64b395c163..198dc2c2433 100644 --- a/jdk/make/lib/Lib-jdk.jdwp.agent.gmk +++ b/jdk/make/lib/Lib-jdk.jdwp.agent.gmk @@ -56,7 +56,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SOCKET, \ -D "JDK_INTERNAL_NAME=dt_socket" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libdt_socket, \ - DEBUG_SYMBOLS := true)) +)) $(BUILD_LIBDT_SOCKET): $(call FindLib, java.base, java) @@ -95,7 +95,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJDWP, \ -D "JDK_INTERNAL_NAME=jdwp" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjdwp, \ - DEBUG_SYMBOLS := true)) +)) $(BUILD_LIBJDWP): $(call FindLib, java.base, java) diff --git a/jdk/make/lib/Lib-jdk.management.gmk b/jdk/make/lib/Lib-jdk.management.gmk index da9e15bd2be..7f38553c61e 100644 --- a/jdk/make/lib/Lib-jdk.management.gmk +++ b/jdk/make/lib/Lib-jdk.management.gmk @@ -48,7 +48,7 @@ endif LIBMANAGEMENT_EXT_OPTIMIZATION := HIGH ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), ) - ifeq ($(ENABLE_DEBUG_SYMBOLS), true) + ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true) LIBMANAGEMENT_EXT_OPTIMIZATION := LOW endif endif @@ -73,7 +73,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT_EXT, \ -D "JDK_INTERNAL_NAME=management_ext" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmanagement_ext, \ - DEBUG_SYMBOLS := true)) +)) $(BUILD_LIBMANAGEMENT_EXT): $(call FindLib, java.base, java) diff --git a/jdk/make/lib/Lib-jdk.pack200.gmk b/jdk/make/lib/Lib-jdk.pack200.gmk index 824fabdb343..7f942fcfb41 100644 --- a/jdk/make/lib/Lib-jdk.pack200.gmk +++ b/jdk/make/lib/Lib-jdk.pack200.gmk @@ -52,7 +52,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \ -D "JDK_FNAME=unpack.dll" \ -D "JDK_INTERNAL_NAME=unpack" \ -D "JDK_FTYPE=0x2L", \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) $(BUILD_LIBUNPACK): $(call FindLib, java.base, java) diff --git a/jdk/make/lib/Lib-jdk.sctp.gmk b/jdk/make/lib/Lib-jdk.sctp.gmk index 574bc0e9841..e527aa8d9c5 100644 --- a/jdk/make/lib/Lib-jdk.sctp.gmk +++ b/jdk/make/lib/Lib-jdk.sctp.gmk @@ -53,7 +53,7 @@ ifeq ($(OPENJDK_TARGET_OS_TYPE), unix) LIBS_linux := -lpthread $(LIBDL), \ LIBS_solaris := -lsocket -lc, \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsctp, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) TARGETS += $(BUILD_LIBSCTP) diff --git a/jdk/make/lib/Lib-jdk.security.auth.gmk b/jdk/make/lib/Lib-jdk.security.auth.gmk index 2b1b62b6702..e37e327266c 100644 --- a/jdk/make/lib/Lib-jdk.security.auth.gmk +++ b/jdk/make/lib/Lib-jdk.security.auth.gmk @@ -55,7 +55,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAAS, \ -D "JDK_INTERNAL_NAME=$(LIBJAAS_NAME)" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjaas, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) $(BUILD_LIBJAAS): $(call FindLib, java.base, java) diff --git a/jdk/make/lib/LibCommon.gmk b/jdk/make/lib/LibCommon.gmk index b341eac9326..ae47377c712 100644 --- a/jdk/make/lib/LibCommon.gmk +++ b/jdk/make/lib/LibCommon.gmk @@ -36,25 +36,6 @@ GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/commo # elegant solution to this. WIN_JAVA_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib -ifdef OPENJDK - # Build everything with debugging on OpenJDK - DEBUG_ALL_BINARIES := true -else - # Use this variable to set DEBUG_SYMBOLS true on windows for all libraries, but - # not on other platforms. - ifeq ($(OPENJDK_TARGET_OS), windows) - DEBUG_ALL_BINARIES := true - else - DEBUG_ALL_BINARIES := false - endif -endif - -# SetupNativeCompilation now supports debug symbols on macosx for hotspot. -# Disable it here for the jdk libraries until we decide to enable them. -ifeq ($(OPENJDK_TARGET_OS), macosx) - ENABLE_DEBUG_SYMBOLS := false -endif - ################################################################################ # Find the default set of src dirs for a native library. # Param 1 - module name diff --git a/jdk/make/lib/NetworkingLibraries.gmk b/jdk/make/lib/NetworkingLibraries.gmk index df04c8087c1..6b110f8d72e 100644 --- a/jdk/make/lib/NetworkingLibraries.gmk +++ b/jdk/make/lib/NetworkingLibraries.gmk @@ -52,7 +52,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBNET, \ -D "JDK_INTERNAL_NAME=net" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) $(BUILD_LIBNET): $(BUILD_LIBJAVA) diff --git a/jdk/make/lib/NioLibraries.gmk b/jdk/make/lib/NioLibraries.gmk index 6b7d305f914..de2cdea0727 100644 --- a/jdk/make/lib/NioLibraries.gmk +++ b/jdk/make/lib/NioLibraries.gmk @@ -91,7 +91,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \ -D "JDK_INTERNAL_NAME=nio" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnio, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) TARGETS += $(BUILD_LIBNIO) diff --git a/jdk/make/lib/PlatformLibraries.gmk b/jdk/make/lib/PlatformLibraries.gmk index c8850ac27c3..85038b91714 100644 --- a/jdk/make/lib/PlatformLibraries.gmk +++ b/jdk/make/lib/PlatformLibraries.gmk @@ -54,7 +54,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) -framework IOSurface \ -framework QuartzCore, \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxapp, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) TARGETS += $(BUILD_LIBOSXAPP) diff --git a/jdk/make/lib/SecurityLibraries.gmk b/jdk/make/lib/SecurityLibraries.gmk index 9c1c65211ca..be73c528c6b 100644 --- a/jdk/make/lib/SecurityLibraries.gmk +++ b/jdk/make/lib/SecurityLibraries.gmk @@ -54,7 +54,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) -framework Security \ $(JDKLIB_LIBS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxsecurity, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) $(BUILD_LIBOSXSECURITY): $(BUILD_LIBJAVA) diff --git a/jdk/make/lib/SoundLibraries.gmk b/jdk/make/lib/SoundLibraries.gmk index 9204afd36bf..f5877d3f876 100644 --- a/jdk/make/lib/SoundLibraries.gmk +++ b/jdk/make/lib/SoundLibraries.gmk @@ -138,7 +138,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \ -D "JDK_INTERNAL_NAME=jsound" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsound, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) +)) $(BUILD_LIBJSOUND): $(BUILD_LIBJAVA) @@ -173,7 +173,7 @@ ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)), ) $(call SET_SHARED_LIBRARY_ORIGIN), \ LIBS := $(ALSA_LIBS) -ljava -ljvm, \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsoundalsa, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) $(BUILD_LIBJSOUNDALSA): $(BUILD_LIBJAVA) @@ -204,7 +204,7 @@ ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)), ) -D "JDK_INTERNAL_NAME=jsoundds" \ -D "JDK_FTYPE=0x2L", \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsoundds, \ - DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + )) $(BUILD_LIBJSOUNDDS): $(BUILD_LIBJAVA) From 41131f7d8126b2a487ea8dece856f3a0c3436cc0 Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Wed, 20 Jan 2016 07:36:42 -0500 Subject: [PATCH 205/228] 8146803: Enhance and update Sharding API Reviewed-by: joehw --- .../classes/javax/sql/CommonDataSource.java | 20 ++- .../javax/sql/ConnectionPoolDataSource.java | 19 ++- .../share/classes/javax/sql/DataSource.java | 21 +--- .../javax/sql/PooledConnectionBuilder.java | 105 ++++++++++++++++ .../share/classes/javax/sql/XAConnection.java | 119 +----------------- .../javax/sql/XAConnectionBuilder.java | 6 +- .../share/classes/javax/sql/XADataSource.java | 20 +-- 7 files changed, 151 insertions(+), 159 deletions(-) create mode 100644 jdk/src/java.sql/share/classes/javax/sql/PooledConnectionBuilder.java diff --git a/jdk/src/java.sql/share/classes/javax/sql/CommonDataSource.java b/jdk/src/java.sql/share/classes/javax/sql/CommonDataSource.java index 9a63ddb0e1e..006560cbe38 100644 --- a/jdk/src/java.sql/share/classes/javax/sql/CommonDataSource.java +++ b/jdk/src/java.sql/share/classes/javax/sql/CommonDataSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, 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,8 +26,8 @@ package javax.sql; import java.sql.SQLException; -import java.io.PrintWriter; import java.sql.SQLFeatureNotSupportedException; +import java.sql.ShardingKeyBuilder; import java.util.logging.Logger; /** @@ -128,4 +128,20 @@ public interface CommonDataSource { * @since 1.7 */ public Logger getParentLogger() throws SQLFeatureNotSupportedException; + + //------------------------- JDBC 4.3 ----------------------------------- + + /** + * Creates a new {@code ShardingKeyBuilder} instance + * @implSpec + * The default implementation will throw a {@code SQLFeatureNotSupportedException}. + * @return The ShardingKeyBuilder instance that was created + * @throws SQLException if an error occurs creating the builder + * @throws SQLFeatureNotSupportedException if the driver does not support this method + * @since 9 + * @see ShardingKeyBuilder + */ + default ShardingKeyBuilder createShardingKeyBuilder() throws SQLException { + throw new SQLFeatureNotSupportedException("createShardingKeyBuilder not implemented"); + }; } diff --git a/jdk/src/java.sql/share/classes/javax/sql/ConnectionPoolDataSource.java b/jdk/src/java.sql/share/classes/javax/sql/ConnectionPoolDataSource.java index 6388735adc6..08ae5611a31 100644 --- a/jdk/src/java.sql/share/classes/javax/sql/ConnectionPoolDataSource.java +++ b/jdk/src/java.sql/share/classes/javax/sql/ConnectionPoolDataSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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,6 +26,7 @@ package javax.sql; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; /** @@ -70,4 +71,20 @@ public interface ConnectionPoolDataSource extends CommonDataSource { */ PooledConnection getPooledConnection(String user, String password) throws SQLException; + + //------------------------- JDBC 4.3 ----------------------------------- + + /** + * Creates a new {@code PooledConnectionBuilder} instance + * @implSpec + * The default implementation will throw a {@code SQLFeatureNotSupportedException}. + * @return The ConnectionBuilder instance that was created + * @throws SQLException if an error occurs creating the builder + * @throws SQLFeatureNotSupportedException if the driver does not support sharding + * @since 9 + * @see PooledConnectionBuilder + */ + default PooledConnectionBuilder createPooledConnectionBuilder() throws SQLException { + throw new SQLFeatureNotSupportedException("createPooledConnectionBuilder not implemented"); + }; } diff --git a/jdk/src/java.sql/share/classes/javax/sql/DataSource.java b/jdk/src/java.sql/share/classes/javax/sql/DataSource.java index f59da21c853..dbdfd4c07de 100644 --- a/jdk/src/java.sql/share/classes/javax/sql/DataSource.java +++ b/jdk/src/java.sql/share/classes/javax/sql/DataSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -29,7 +29,6 @@ import java.sql.Connection; import java.sql.ConnectionBuilder; import java.sql.SQLException; import java.sql.SQLFeatureNotSupportedException; -import java.sql.ShardingKeyBuilder; import java.sql.Wrapper; /** @@ -119,25 +118,11 @@ public interface DataSource extends CommonDataSource, Wrapper { * @return The ConnectionBuilder instance that was created * @throws SQLException if an error occurs creating the builder * @throws SQLFeatureNotSupportedException if the driver does not support sharding - * @since 1.9 - * @see createConnectionBuilder + * @since 9 + * @see ConnectionBuilder */ default ConnectionBuilder createConnectionBuilder() throws SQLException { throw new SQLFeatureNotSupportedException("createConnectionBuilder not implemented"); }; - /** - * Create a new {@code ShardingKeyBuilder} instance - * @implSpec - * The default implementation will throw a {@code SQLFeatureNotSupportedException} - * @return The ShardingKeyBuilder instance that was created - * @throws SQLException if an error occurs creating the builder - * @throws SQLFeatureNotSupportedException if the driver does not support this method - * @since 1.9 - * @see ShardingKeyBuilder - */ - default ShardingKeyBuilder createShardingKeyBuilder() - throws SQLException { - throw new SQLFeatureNotSupportedException("createShardingKeyBuilder not implemented"); - }; } diff --git a/jdk/src/java.sql/share/classes/javax/sql/PooledConnectionBuilder.java b/jdk/src/java.sql/share/classes/javax/sql/PooledConnectionBuilder.java new file mode 100644 index 00000000000..0ff0b04bce5 --- /dev/null +++ b/jdk/src/java.sql/share/classes/javax/sql/PooledConnectionBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2016, 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.sql; + +import java.sql.SQLException; +import java.sql.ShardingKey; + +/** + * A builder created from a {@code ConnectionPoolDataSource} object, + * used to establish a connection to the database that the + * {@code data source} object represents. The connection + * properties that were specified for the {@code data source} are used as the + * default values by the {@code PooledConnectionBuilder}. + *

      The following example illustrates the use of {@code PooledConnectionBuilder} + * to create a {@link XAConnection}: + * + *

      {@code
      + *     ConnectionPoolDataSource ds = new MyConnectionPoolDataSource();
      + *     ShardingKey superShardingKey = ds.createShardingKeyBuilder()
      + *                           .subkey("EASTERN_REGION", JDBCType.VARCHAR)
      + *                           .build();
      + *     ShardingKey shardingKey = ds.createShardingKeyBuilder()
      + *                           .subkey("PITTSBURGH_BRANCH", JDBCType.VARCHAR)
      + *                           .build();
      + *     PooledConnection con = ds.createPooledConnectionBuilder()
      + *                       .user("rafa")
      + *                       .password("tennis")
      + *                       .setShardingKey(shardingKey)
      + *                       .setSuperShardingKey(superShardingKey)
      + *                       .build();
      + * }
      + * + * @since 9 + * + */ +public interface PooledConnectionBuilder { + + /** + * Specifies the username to be used when creating a connection + * + * @param username the database user on whose behalf the connection is being + * made + * @return the same {@code PooledConnectionBuilder} instance + */ + PooledConnectionBuilder user(String username); + + /** + * Specifies the password to be used when creating a connection + * + * @param password the password to use for this connection. May be {@code null} + * @return the same {@code PooledConnectionBuilder} instance + */ + PooledConnectionBuilder password(String password); + + /** + * Specifies a {@code shardingKey} to be used when creating a connection + * + * @param shardingKey the ShardingKey. May be {@code null} + * @return the same {@code PooledConnectionBuilder} instance + * @see java.sql.ShardingKey + * @see java.sql.ShardingKeyBuilder + */ + PooledConnectionBuilder shardingKey(ShardingKey shardingKey); + + /** + * Specifies a {@code superShardingKey} to be used when creating a connection + * + * @param superShardingKey the SuperShardingKey. May be {@code null} + * @return the same {@code PooledConnectionBuilder} instance + * @see java.sql.ShardingKey + * @see java.sql.ShardingKeyBuilder + */ + PooledConnectionBuilder superShardingKey(ShardingKey superShardingKey); + + /** + * Returns an instance of the object defined by this builder. + * + * @return The built object + * @throws java.sql.SQLException If an error occurs building the object + */ + PooledConnection build() throws SQLException; + +} diff --git a/jdk/src/java.sql/share/classes/javax/sql/XAConnection.java b/jdk/src/java.sql/share/classes/javax/sql/XAConnection.java index a72eff76346..76c1894c219 100644 --- a/jdk/src/java.sql/share/classes/javax/sql/XAConnection.java +++ b/jdk/src/java.sql/share/classes/javax/sql/XAConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -52,121 +52,4 @@ public interface XAConnection extends PooledConnection { * @since 1.4 */ javax.transaction.xa.XAResource getXAResource() throws SQLException; - - // JDBC 4.3 - - /** - * Sets and validates the sharding keys for this connection. - * - * @implSpec The default implementation will throw a - * {@code SQLFeatureNotSupportedException}. - * - * @apiNote This method validates that the sharding keys are valid for the - * {@code Connection}. The timeout value indicates how long the driver - * should wait for the {@code Connection} to verify that the sharding key is - * valid before {@code setShardingKeyIfValid} returns false. - * @param shardingKey the sharding key to be validated against this - * connection - * @param superShardingKey the super sharding key to be validated against - * this connection. The super sharding key may be {@code null}. - * @param timeout time in seconds before which the validation process is - * expected to be completed, otherwise the validation process is aborted. A - * value of 0 indicates the validation process will not time out. - * @return true if the connection is valid and the sharding keys are valid - * and set on this connection; false if the sharding keys are not valid or - * the timeout period expires before the operation completes. - * @throws SQLException if an error occurs while performing this validation; - * the {@code shardingkey} is {@code null}; a {@code superSharedingKey} is specified - * without a {@code shardingKey}; this method is called on a closed - * {@code connection}; or the {@code timeout} value is less than 0. - * @throws SQLFeatureNotSupportedException if the driver does not support - * sharding - * @since 1.9 - * @see ShardingKey - * @see ShardingKeyBuilder - */ - default boolean setShardingKeyIfValid(ShardingKey shardingKey, - ShardingKey superShardingKey, int timeout) - throws SQLException { - throw new SQLFeatureNotSupportedException("setShardingKeyIfValid not implemented"); - } - - /** - * Sets and validates the sharding key for this connection. - * @implSpec - * The default implementation will throw a - * {@code SQLFeatureNotSupportedException}. - * @apiNote - * This method validates that the sharding key is valid for the - * {@code Connection}. The timeout value indicates how long the driver - * should wait for the {@code Connection} to verify that the sharding key - * is valid before {@code setShardingKeyIfValid} returns false. - * @param shardingKey the sharding key to be validated against this connection - * @param timeout time in seconds before which the validation process is expected to - * be completed,else the validation process is aborted. A value of 0 indicates - * the validation process will not time out. - * @return true if the connection is valid and the sharding key is valid to be - * set on this connection; false if the sharding key is not valid or - * the timeout period expires before the operation completes. - * @throws SQLException if there is an error while performing this validation; - * this method is called on a closed {@code connection}; the {@code shardingkey} - * is {@code null}; or the {@code timeout} value is less than 0. - * @throws SQLFeatureNotSupportedException if the driver does not support sharding - * @since 1.9 - * @see ShardingKey - * @see ShardingKeyBuilder - */ - default boolean setShardingKeyIfValid(ShardingKey shardingKey, int timeout) - throws SQLException { - throw new SQLFeatureNotSupportedException("setShardingKeyIfValid not implemented"); - } - - /** - * Specifies a shardingKey and superShardingKey to use with this Connection - * @implSpec - * The default implementation will throw a - * {@code SQLFeatureNotSupportedException}. - * @apiNote - * This method sets the specified sharding keys but does not require a - * round trip to the database to validate that the sharding keys are valid - * for the {@code Connection}. - * @param shardingKey the sharding key to set on this connection. - * @param superShardingKey the super sharding key to set on this connection. - * The super sharding key may be {@code null} - * @throws SQLException if an error occurs setting the sharding keys; - * this method is called on a closed {@code connection}; - * the {@code shardingkey} is {@code null}; or - * a {@code superSharedingKey} is specified without a {@code shardingKey} - * @throws SQLFeatureNotSupportedException if the driver does not support sharding - * @since 1.9 - * @see ShardingKey - * @see ShardingKeyBuilder - */ - default void setShardingKey(ShardingKey shardingKey, ShardingKey superShardingKey) - throws SQLException { - throw new SQLFeatureNotSupportedException("setShardingKey not implemented"); - } - - /** - * Specifies a shardingKey to use with this Connection - * @implSpec - * The default implementation will throw a - * {@code SQLFeatureNotSupportedException}. - * @apiNote - * This method sets the specified sharding key but does not require a - * round trip to the database to validate that the sharding key is valid - * for the {@code Connection}. - * @param shardingKey the sharding key to set on this connection. - * @throws SQLException if an error occurs setting the sharding key; - * this method is called on a closed {@code connection}; or the - * {@code shardkingKey} is {@code null} - * @throws SQLFeatureNotSupportedException if the driver does not support sharding - * @since 1.9 - * @see ShardingKey - * @see ShardingKeyBuilder - */ - default void setShardingKey(ShardingKey shardingKey) - throws SQLException { - throw new SQLFeatureNotSupportedException("setShardingKey not implemented"); - } } diff --git a/jdk/src/java.sql/share/classes/javax/sql/XAConnectionBuilder.java b/jdk/src/java.sql/share/classes/javax/sql/XAConnectionBuilder.java index 865172a15e5..2e3d91cbe53 100644 --- a/jdk/src/java.sql/share/classes/javax/sql/XAConnectionBuilder.java +++ b/jdk/src/java.sql/share/classes/javax/sql/XAConnectionBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -37,7 +37,7 @@ import java.sql.ShardingKey; * to create a {@link XAConnection}: * *
      {@code
      - *     DataSource ds = new MyDataSource();
      + *     XADataSource ds = new MyXADataSource();
        *     ShardingKey superShardingKey = ds.createShardingKeyBuilder()
        *                           .subkey("EASTERN_REGION", JDBCType.VARCHAR)
        *                           .build();
      @@ -52,7 +52,7 @@ import java.sql.ShardingKey;
        *                       .build();
        * }
      * - * @since 1.9 + * @since 9 * */ public interface XAConnectionBuilder { diff --git a/jdk/src/java.sql/share/classes/javax/sql/XADataSource.java b/jdk/src/java.sql/share/classes/javax/sql/XADataSource.java index 221dbe41339..83656b205c8 100644 --- a/jdk/src/java.sql/share/classes/javax/sql/XADataSource.java +++ b/jdk/src/java.sql/share/classes/javax/sql/XADataSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -87,28 +87,14 @@ public interface XADataSource extends CommonDataSource { * Creates a new {@code XAConnectionBuilder} instance * @implSpec * The default implementation will throw a {@code SQLFeatureNotSupportedException}. - * @return The ConnectionBuilder instance that was created + * @return The XAConnectionBuilder instance that was created * @throws SQLException if an error occurs creating the builder * @throws SQLFeatureNotSupportedException if the driver does not support sharding - * @since 1.9 + * @since 9 * @see XAConnectionBuilder */ default XAConnectionBuilder createXAConnectionBuilder() throws SQLException { throw new SQLFeatureNotSupportedException("createXAConnectionBuilder not implemented"); }; - /** - * Creates a new {@code ShardingKeyBuilder} instance - * @implSpec - * The default implementation will throw a {@code SQLFeatureNotSupportedException}. - * @return The ShardingKeyBuilder instance that was created - * @throws SQLException if an error occurs creating the builder - * @throws SQLFeatureNotSupportedException if the driver does not support this method - * @since 1.9 - * @see ShardingKeyBuilder - */ - default ShardingKeyBuilder createShardingKeyBuilder() - throws SQLException { - throw new SQLFeatureNotSupportedException("createShardingKeyBuilder not implemented"); - }; } From 0ec48f2c8b5a14bb0aaf3b48bc4c2e71379d45d6 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Wed, 20 Jan 2016 11:33:28 -0500 Subject: [PATCH 206/228] 8145459: Cleaner - use Reference.reachabilityFence Reviewed-by: psandoz, mchung, chegar --- .../share/classes/jdk/internal/ref/PhantomCleanable.java | 7 ++++--- .../share/classes/jdk/internal/ref/SoftCleanable.java | 7 ++++--- .../share/classes/jdk/internal/ref/WeakCleanable.java | 8 +++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/jdk/src/java.base/share/classes/jdk/internal/ref/PhantomCleanable.java b/jdk/src/java.base/share/classes/jdk/internal/ref/PhantomCleanable.java index 7e177b1e4f4..bbcf99483c1 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/ref/PhantomCleanable.java +++ b/jdk/src/java.base/share/classes/jdk/internal/ref/PhantomCleanable.java @@ -26,6 +26,7 @@ package jdk.internal.ref; import java.lang.ref.Cleaner; +import java.lang.ref.Reference; import java.lang.ref.PhantomReference; import java.util.Objects; @@ -66,9 +67,9 @@ public abstract class PhantomCleanable extends PhantomReference this.list = CleanerImpl.getCleanerImpl(cleaner).phantomCleanableList; insert(); - // TODO: Replace getClass() with ReachabilityFence when it is available - cleaner.getClass(); - referent.getClass(); + // Ensure referent and cleaner remain accessible + Reference.reachabilityFence(referent); + Reference.reachabilityFence(cleaner); } /** diff --git a/jdk/src/java.base/share/classes/jdk/internal/ref/SoftCleanable.java b/jdk/src/java.base/share/classes/jdk/internal/ref/SoftCleanable.java index 45ddf85863b..5463720d561 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/ref/SoftCleanable.java +++ b/jdk/src/java.base/share/classes/jdk/internal/ref/SoftCleanable.java @@ -26,6 +26,7 @@ package jdk.internal.ref; import java.lang.ref.Cleaner; +import java.lang.ref.Reference; import java.lang.ref.SoftReference; import java.util.Objects; @@ -66,9 +67,9 @@ public abstract class SoftCleanable extends SoftReference list = CleanerImpl.getCleanerImpl(cleaner).softCleanableList; insert(); - // TODO: Replace getClass() with ReachabilityFence when it is available - cleaner.getClass(); - referent.getClass(); + // Ensure referent and cleaner remain accessible + Reference.reachabilityFence(referent); + Reference.reachabilityFence(cleaner); } /** diff --git a/jdk/src/java.base/share/classes/jdk/internal/ref/WeakCleanable.java b/jdk/src/java.base/share/classes/jdk/internal/ref/WeakCleanable.java index 40dd22af25c..90c62cf3ce3 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/ref/WeakCleanable.java +++ b/jdk/src/java.base/share/classes/jdk/internal/ref/WeakCleanable.java @@ -26,6 +26,7 @@ package jdk.internal.ref; */ import java.lang.ref.Cleaner; +import java.lang.ref.Reference; import java.lang.ref.WeakReference; import java.util.Objects; @@ -66,9 +67,10 @@ public abstract class WeakCleanable extends WeakReference list = CleanerImpl.getCleanerImpl(cleaner).weakCleanableList; insert(); - // TODO: Replace getClass() with ReachabilityFence when it is available - cleaner.getClass(); - referent.getClass(); + // Ensure referent and cleaner remain accessible + Reference.reachabilityFence(referent); + Reference.reachabilityFence(cleaner); + } /** From 298315e8f8d4d5f219df4f7d22ce8c90c5f8a9de Mon Sep 17 00:00:00 2001 From: Bhanu Prakash Gopularam Date: Wed, 20 Jan 2016 09:21:57 -0800 Subject: [PATCH 207/228] 8133085: Avoid creating instances of security providers when possible Reviewed-by: mullan --- .../com/sun/crypto/provider/Cipher/DES/PerformanceTest.java | 5 +---- jdk/test/javax/net/ssl/TLS/TestJSSE.java | 6 +----- jdk/test/sun/security/pkcs11/fips/ImportKeyStore.java | 5 +++-- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/jdk/test/com/sun/crypto/provider/Cipher/DES/PerformanceTest.java b/jdk/test/com/sun/crypto/provider/Cipher/DES/PerformanceTest.java index 7e3d860d28a..03468133ff1 100644 --- a/jdk/test/com/sun/crypto/provider/Cipher/DES/PerformanceTest.java +++ b/jdk/test/com/sun/crypto/provider/Cipher/DES/PerformanceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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,7 +33,6 @@ import java.security.spec.*; import java.io.*; import javax.crypto.*; import javax.crypto.spec.*; -import com.sun.crypto.provider.*; public class PerformanceTest { @@ -81,8 +80,6 @@ public class PerformanceTest { byte[] in; - SunJCE jce = new SunJCE(); - Security.addProvider(jce); col = new StringBuffer(); printHeadings(); diff --git a/jdk/test/javax/net/ssl/TLS/TestJSSE.java b/jdk/test/javax/net/ssl/TLS/TestJSSE.java index b7a439f8820..d4c41480c0b 100644 --- a/jdk/test/javax/net/ssl/TLS/TestJSSE.java +++ b/jdk/test/javax/net/ssl/TLS/TestJSSE.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2016, 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 @@ -111,8 +111,6 @@ public class TestJSSE { out.println(" Testing - https://" + LOCAL_IP + ":" + testPort); out.println(" Testing - Protocol : " + testProtocols); out.println(" Testing - Cipher : " + testCipher); - Provider p = new sun.security.ec.SunEC(); - Security.insertProviderAt(p, 1); try { CipherTestUtils.main(new JSSEFactory(LOCAL_IP, testPort, testProtocols, @@ -132,8 +130,6 @@ public class TestJSSE { out.println(" Testing Protocol: " + testProtocol); out.println(" Testing Cipher: " + testCipher); out.println(" Testing Port: " + testPort); - Provider p = new sun.security.ec.SunEC(); - Security.insertProviderAt(p, 1); try { CipherTestUtils.main(new JSSEFactory(null, testPort, testProtocol, testCipher, "Server JSSE"), diff --git a/jdk/test/sun/security/pkcs11/fips/ImportKeyStore.java b/jdk/test/sun/security/pkcs11/fips/ImportKeyStore.java index 774db222eb9..302df9280e6 100644 --- a/jdk/test/sun/security/pkcs11/fips/ImportKeyStore.java +++ b/jdk/test/sun/security/pkcs11/fips/ImportKeyStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, 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 @@ -48,7 +48,8 @@ public class ImportKeyStore { public static void main(String[] args) throws Exception { String nssCfg = "--name=NSS\nnssSecmodDirectory=.\n "; // "attributes(*,CKO_PRIVATE_KEY,CKK_DSA) = { CKA_NETSCAPE_DB = 0h00 }"; - Provider p = new sun.security.pkcs11.SunPKCS11(nssCfg); + Provider p = Security.getProvider("SunPKCS11"); + p.configure(nssCfg); KeyStore ks = KeyStore.getInstance("PKCS11", p); ks.load(null, "test12".toCharArray()); From 9d07dc02e18f55ac6a1a4011e5c7f98e8470b6bf Mon Sep 17 00:00:00 2001 From: Iris Clark Date: Wed, 20 Jan 2016 11:02:36 -0800 Subject: [PATCH 208/228] 8136494: Update "@since 1.9" to "@since 9" to match java.version.specification Reviewed-by: alanb, chegar, lancea, prr --- .../tools/tzdb/TzdbZoneRulesProvider.java | 2 +- .../share/classes/java/io/InputStream.java | 6 +- .../java/lang/AbstractStringBuilder.java | 4 +- .../share/classes/java/lang/Character.java | 150 +++++++++--------- .../share/classes/java/lang/Integer.java | 4 +- .../share/classes/java/lang/Long.java | 4 +- .../share/classes/java/lang/Process.java | 14 +- .../classes/java/lang/ProcessHandle.java | 4 +- .../classes/java/lang/ProcessHandleImpl.java | 4 +- .../share/classes/java/lang/StackWalker.java | 6 +- .../share/classes/java/lang/String.java | 4 +- .../java/lang/reflect/AnnotatedArrayType.java | 2 +- .../reflect/AnnotatedParameterizedType.java | 2 +- .../java/lang/reflect/AnnotatedType.java | 2 +- .../lang/reflect/AnnotatedTypeVariable.java | 2 +- .../lang/reflect/AnnotatedWildcardType.java | 2 +- .../share/classes/java/math/BigInteger.java | 8 +- .../classes/java/math/MutableBigInteger.java | 2 +- .../classes/java/net/DatagramSocket.java | 6 +- .../classes/java/net/DatagramSocketImpl.java | 4 +- .../classes/java/net/NetworkInterface.java | 6 +- .../share/classes/java/net/ServerSocket.java | 6 +- .../share/classes/java/net/Socket.java | 6 +- .../share/classes/java/net/SocketImpl.java | 4 +- .../net/spi/URLStreamHandlerProvider.java | 2 +- .../classes/java/net/spi/package-info.java | 2 +- .../classes/java/nio/MappedByteBuffer.java | 14 +- .../classes/java/nio/X-Buffer.java.template | 14 +- .../share/classes/java/security/KeyStore.java | 6 +- .../java/security/PermissionCollection.java | 2 +- .../security/cert/URICertStoreParameters.java | 2 +- .../java/security/spec/EncodedKeySpec.java | 4 +- .../security/spec/PKCS8EncodedKeySpec.java | 2 +- .../security/spec/X509EncodedKeySpec.java | 2 +- .../share/classes/java/util/Enumeration.java | 2 +- .../share/classes/java/util/Scanner.java | 6 +- .../util/concurrent/CompletableFuture.java | 26 +-- .../classes/java/util/concurrent/Flow.java | 2 +- .../java/util/concurrent/ForkJoinTask.java | 2 +- .../util/concurrent/SubmissionPublisher.java | 2 +- .../classes/java/util/regex/Matcher.java | 10 +- .../java/util/stream/DoubleStream.java | 4 +- .../classes/java/util/stream/IntStream.java | 4 +- .../classes/java/util/stream/LongStream.java | 4 +- .../classes/java/util/stream/Stream.java | 6 +- .../classes/java/util/stream/WhileOps.java | 2 +- .../share/classes/java/util/zip/CRC32C.java | 2 +- .../share/classes/java/util/zip/Checksum.java | 4 +- .../share/classes/java/util/zip/ZipEntry.java | 4 +- .../internal/HotSpotIntrinsicCandidate.java | 2 +- .../jdk/internal/logger/package-info.java | 2 +- .../classes/jdk/internal/misc/Unsafe.java | 8 +- .../provider/certpath/ResponderId.java | 4 +- .../ssl/ClientKeyExchangeService.java | 2 +- .../sun/security/util/KeyStoreDelegator.java | 2 +- .../sun/datatransfer/DataFlavorUtil.java | 2 +- .../DesktopDatatransferService.java | 2 +- .../classes/java/awt/RenderingHints.java | 10 +- .../classes/java/awt/font/NumericShaper.java | 4 +- .../image/AbstractMultiResolutionImage.java | 4 +- .../awt/image/BaseMultiResolutionImage.java | 6 +- .../java/awt/image/MultiResolutionImage.java | 6 +- .../classes/java/beans/BeanProperty.java | 2 +- .../java/beans/IndexedPropertyDescriptor.java | 2 +- .../share/classes/java/beans/JavaBean.java | 2 +- .../java/beans/PropertyDescriptor.java | 2 +- .../accessibility/AccessibilityProvider.java | 2 +- .../metadata/doc-files/tiff_metadata.html | 2 +- .../plugins/tiff/BaselineTIFFTagSet.java | 2 +- .../imageio/plugins/tiff/ExifGPSTagSet.java | 2 +- .../tiff/ExifInteroperabilityTagSet.java | 2 +- .../plugins/tiff/ExifParentTIFFTagSet.java | 2 +- .../imageio/plugins/tiff/ExifTIFFTagSet.java | 2 +- .../imageio/plugins/tiff/FaxTIFFTagSet.java | 2 +- .../imageio/plugins/tiff/GeoTIFFTagSet.java | 2 +- .../imageio/plugins/tiff/TIFFDirectory.java | 2 +- .../javax/imageio/plugins/tiff/TIFFField.java | 2 +- .../plugins/tiff/TIFFImageReadParam.java | 2 +- .../javax/imageio/plugins/tiff/TIFFTag.java | 2 +- .../imageio/plugins/tiff/TIFFTagSet.java | 2 +- .../javax/imageio/plugins/tiff/package.html | 2 +- .../share/classes/javax/swing/JComponent.java | 2 +- .../classes/javax/swing/SwingContainer.java | 2 +- .../javax/swing/text/AbstractDocument.java | 4 +- .../DesktopDatatransferServiceImpl.java | 2 +- .../swing/text/UndoableEditLockSupport.java | 2 +- .../java/util/logging/FileHandler.java | 2 +- .../classes/java/util/logging/LogManager.java | 4 +- .../classes/java/util/logging/LogRecord.java | 10 +- .../classes/java/util/logging/Logger.java | 4 +- .../util/logging/internal/package-info.java | 2 +- .../java/lang/management/ThreadInfo.java | 4 +- .../management/ConstructorParameters.java | 2 +- .../provider/certpath/ldap/JdkLDAP.java | 2 +- .../certpath/ldap/LDAPCertStoreImpl.java | 2 +- .../security/auth/kerberos/EncryptionKey.java | 2 +- .../auth/kerberos/KerberosCredMessage.java | 2 +- .../internal/ssl/Krb5KeyExchangeService.java | 2 +- .../share/classes/java/sql/Connection.java | 12 +- .../classes/java/sql/ConnectionBuilder.java | 2 +- .../classes/java/sql/DatabaseMetaData.java | 2 +- .../share/classes/java/sql/DriverManager.java | 2 +- .../share/classes/java/sql/ShardingKey.java | 2 +- .../AttachOperationFailedException.java | 2 +- .../security/ucrypto/CipherContextRef.java | 2 +- .../com/oracle/security/ucrypto/Config.java | 2 +- .../security/ucrypto/GCMParameters.java | 2 +- .../oracle/security/ucrypto/NativeCipher.java | 2 +- .../ucrypto/NativeCipherWithJavaPadding.java | 2 +- .../oracle/security/ucrypto/NativeDigest.java | 2 +- .../security/ucrypto/NativeGCMCipher.java | 2 +- .../oracle/security/ucrypto/NativeKey.java | 2 +- .../security/ucrypto/NativeRSACipher.java | 2 +- .../security/ucrypto/NativeRSAKeyFactory.java | 2 +- .../security/ucrypto/NativeRSASignature.java | 2 +- .../security/ucrypto/UcryptoException.java | 2 +- .../oracle/security/ucrypto/UcryptoMech.java | 2 +- .../security/ucrypto/UcryptoProvider.java | 2 +- .../jarsigner/ContentSignerParameters.java | 2 +- .../jdk/security/jarsigner/JarSigner.java | 4 +- .../jarsigner/JarSignerException.java | 2 +- .../classes/com/sun/management/VMOption.java | 2 +- .../com/sun/security/jgss/InquireType.java | 6 +- jdk/test/lib/testlibrary/ExtendedRobot.java | 2 +- 124 files changed, 297 insertions(+), 297 deletions(-) diff --git a/jdk/make/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java b/jdk/make/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java index 4c92ee9a8af..488a1add46d 100644 --- a/jdk/make/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java +++ b/jdk/make/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java @@ -60,7 +60,7 @@ import java.time.zone.ZoneRulesException; * @author Stephen Colebourne * @author Michael Nascimento Santos * - * @since 1.9 + * @since 9 */ class TzdbZoneRulesProvider { diff --git a/jdk/src/java.base/share/classes/java/io/InputStream.java b/jdk/src/java.base/share/classes/java/io/InputStream.java index 67946b19b1a..c1e4a8e1d60 100644 --- a/jdk/src/java.base/share/classes/java/io/InputStream.java +++ b/jdk/src/java.base/share/classes/java/io/InputStream.java @@ -228,7 +228,7 @@ public abstract class InputStream implements Closeable { * allocated. For example, if an array larger than {@code 2GB} would * be required to store the bytes. * - * @since 1.9 + * @since 9 */ public byte[] readAllBytes() throws IOException { byte[] buf = new byte[DEFAULT_BUFFER_SIZE]; @@ -298,7 +298,7 @@ public abstract class InputStream implements Closeable { * @throws IndexOutOfBoundsException If {@code off} is negative, {@code len} * is negative, or {@code len} is greater than {@code b.length - off} * - * @since 1.9 + * @since 9 */ public int readNBytes(byte[] b, int off, int len) throws IOException { Objects.requireNonNull(b); @@ -514,7 +514,7 @@ public abstract class InputStream implements Closeable { * @throws IOException if an I/O error occurs when reading or writing * @throws NullPointerException if {@code out} is {@code null} * - * @since 1.9 + * @since 9 */ public long transferTo(OutputStream out) throws IOException { Objects.requireNonNull(out, "out"); diff --git a/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java b/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java index 619b7de278a..f1691969666 100644 --- a/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java +++ b/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java @@ -1526,7 +1526,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public IntStream chars() { @@ -1543,7 +1543,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public IntStream codePoints() { diff --git a/jdk/src/java.base/share/classes/java/lang/Character.java b/jdk/src/java.base/share/classes/java/lang/Character.java index ae3d1ef6bd8..42fc39dd183 100644 --- a/jdk/src/java.base/share/classes/java/lang/Character.java +++ b/jdk/src/java.base/share/classes/java/lang/Character.java @@ -493,25 +493,25 @@ class Character implements java.io.Serializable, Comparable { /** * Weak bidirectional character type "LRI" in the Unicode specification. - * @since 1.9 + * @since 9 */ public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_ISOLATE = 19; /** * Weak bidirectional character type "RLI" in the Unicode specification. - * @since 1.9 + * @since 9 */ public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ISOLATE = 20; /** * Weak bidirectional character type "FSI" in the Unicode specification. - * @since 1.9 + * @since 9 */ public static final byte DIRECTIONALITY_FIRST_STRONG_ISOLATE = 21; /** * Weak bidirectional character type "PDI" in the Unicode specification. - * @since 1.9 + * @since 9 */ public static final byte DIRECTIONALITY_POP_DIRECTIONAL_ISOLATE = 22; @@ -2590,7 +2590,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Combining Diacritical Marks Extended" Unicode * character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock COMBINING_DIACRITICAL_MARKS_EXTENDED = new UnicodeBlock("COMBINING_DIACRITICAL_MARKS_EXTENDED", @@ -2599,7 +2599,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Myanmar Extended-B" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock MYANMAR_EXTENDED_B = new UnicodeBlock("MYANMAR_EXTENDED_B", @@ -2608,7 +2608,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Latin Extended-E" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock LATIN_EXTENDED_E = new UnicodeBlock("LATIN_EXTENDED_E", @@ -2617,7 +2617,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Coptic Epact Numbers" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock COPTIC_EPACT_NUMBERS = new UnicodeBlock("COPTIC_EPACT_NUMBERS", @@ -2626,7 +2626,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Old Permic" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock OLD_PERMIC = new UnicodeBlock("OLD_PERMIC", @@ -2635,14 +2635,14 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Elbasan" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock ELBASAN = new UnicodeBlock("ELBASAN"); /** * Constant for the "Caucasian Albanian" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock CAUCASIAN_ALBANIAN = new UnicodeBlock("CAUCASIAN_ALBANIAN", @@ -2651,7 +2651,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Linear A" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock LINEAR_A = new UnicodeBlock("LINEAR_A", @@ -2660,21 +2660,21 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Palmyrene" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock PALMYRENE = new UnicodeBlock("PALMYRENE"); /** * Constant for the "Nabataean" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock NABATAEAN = new UnicodeBlock("NABATAEAN"); /** * Constant for the "Old North Arabian" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock OLD_NORTH_ARABIAN = new UnicodeBlock("OLD_NORTH_ARABIAN", @@ -2683,14 +2683,14 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Manichaean" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock MANICHAEAN = new UnicodeBlock("MANICHAEAN"); /** * Constant for the "Psalter Pahlavi" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock PSALTER_PAHLAVI = new UnicodeBlock("PSALTER_PAHLAVI", @@ -2699,14 +2699,14 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Mahajani" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock MAHAJANI = new UnicodeBlock("MAHAJANI"); /** * Constant for the "Sinhala Archaic Numbers" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock SINHALA_ARCHAIC_NUMBERS = new UnicodeBlock("SINHALA_ARCHAIC_NUMBERS", @@ -2715,49 +2715,49 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Khojki" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock KHOJKI = new UnicodeBlock("KHOJKI"); /** * Constant for the "Khudawadi" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock KHUDAWADI = new UnicodeBlock("KHUDAWADI"); /** * Constant for the "Grantha" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock GRANTHA = new UnicodeBlock("GRANTHA"); /** * Constant for the "Tirhuta" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock TIRHUTA = new UnicodeBlock("TIRHUTA"); /** * Constant for the "Siddham" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock SIDDHAM = new UnicodeBlock("SIDDHAM"); /** * Constant for the "Modi" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock MODI = new UnicodeBlock("MODI"); /** * Constant for the "Warang Citi" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock WARANG_CITI = new UnicodeBlock("WARANG_CITI", @@ -2766,7 +2766,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Pau Cin Hau" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock PAU_CIN_HAU = new UnicodeBlock("PAU_CIN_HAU", @@ -2775,14 +2775,14 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Mro" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock MRO = new UnicodeBlock("MRO"); /** * Constant for the "Bassa Vah" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock BASSA_VAH = new UnicodeBlock("BASSA_VAH", @@ -2791,7 +2791,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Pahawh Hmong" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock PAHAWH_HMONG = new UnicodeBlock("PAHAWH_HMONG", @@ -2800,14 +2800,14 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Duployan" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock DUPLOYAN = new UnicodeBlock("DUPLOYAN"); /** * Constant for the "Shorthand Format Controls" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock SHORTHAND_FORMAT_CONTROLS = new UnicodeBlock("SHORTHAND_FORMAT_CONTROLS", @@ -2816,7 +2816,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Mende Kikakui" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock MENDE_KIKAKUI = new UnicodeBlock("MENDE_KIKAKUI", @@ -2825,7 +2825,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Ornamental Dingbats" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock ORNAMENTAL_DINGBATS = new UnicodeBlock("ORNAMENTAL_DINGBATS", @@ -2834,7 +2834,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Geometric Shapes Extended" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock GEOMETRIC_SHAPES_EXTENDED = new UnicodeBlock("GEOMETRIC_SHAPES_EXTENDED", @@ -2843,7 +2843,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Supplemental Arrows-C" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock SUPPLEMENTAL_ARROWS_C = new UnicodeBlock("SUPPLEMENTAL_ARROWS_C", @@ -2852,7 +2852,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Cherokee Supplement" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock CHEROKEE_SUPPLEMENT = new UnicodeBlock("CHEROKEE_SUPPLEMENT", @@ -2861,14 +2861,14 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Hatran" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock HATRAN = new UnicodeBlock("HATRAN"); /** * Constant for the "Old Hungarian" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock OLD_HUNGARIAN = new UnicodeBlock("OLD_HUNGARIAN", @@ -2877,21 +2877,21 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Multani" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock MULTANI = new UnicodeBlock("MULTANI"); /** * Constant for the "Ahom" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock AHOM = new UnicodeBlock("AHOM"); /** * Constant for the "Early Dynastic Cuneiform" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock EARLY_DYNASTIC_CUNEIFORM = new UnicodeBlock("EARLY_DYNASTIC_CUNEIFORM", @@ -2900,7 +2900,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Anatolian Hieroglyphs" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock ANATOLIAN_HIEROGLYPHS = new UnicodeBlock("ANATOLIAN_HIEROGLYPHS", @@ -2909,7 +2909,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Sutton SignWriting" Unicode character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock SUTTON_SIGNWRITING = new UnicodeBlock("SUTTON_SIGNWRITING", @@ -2919,7 +2919,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "Supplemental Symbols and Pictographs" Unicode * character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS = new UnicodeBlock("SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS", @@ -2929,7 +2929,7 @@ class Character implements java.io.Serializable, Comparable { /** * Constant for the "CJK Unified Ideographs Extension E" Unicode * character block. - * @since 1.9 + * @since 9 */ public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E = new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E", @@ -4189,175 +4189,175 @@ class Character implements java.io.Serializable, Comparable { /** * Unicode script "Caucasian Albanian". - * @since 1.9 + * @since 9 */ CAUCASIAN_ALBANIAN, /** * Unicode script "Bassa Vah". - * @since 1.9 + * @since 9 */ BASSA_VAH, /** * Unicode script "Duployan". - * @since 1.9 + * @since 9 */ DUPLOYAN, /** * Unicode script "Elbasan". - * @since 1.9 + * @since 9 */ ELBASAN, /** * Unicode script "Grantha". - * @since 1.9 + * @since 9 */ GRANTHA, /** * Unicode script "Pahawh Hmong". - * @since 1.9 + * @since 9 */ PAHAWH_HMONG, /** * Unicode script "Khojki". - * @since 1.9 + * @since 9 */ KHOJKI, /** * Unicode script "Linear A". - * @since 1.9 + * @since 9 */ LINEAR_A, /** * Unicode script "Mahajani". - * @since 1.9 + * @since 9 */ MAHAJANI, /** * Unicode script "Manichaean". - * @since 1.9 + * @since 9 */ MANICHAEAN, /** * Unicode script "Mende Kikakui". - * @since 1.9 + * @since 9 */ MENDE_KIKAKUI, /** * Unicode script "Modi". - * @since 1.9 + * @since 9 */ MODI, /** * Unicode script "Mro". - * @since 1.9 + * @since 9 */ MRO, /** * Unicode script "Old North Arabian". - * @since 1.9 + * @since 9 */ OLD_NORTH_ARABIAN, /** * Unicode script "Nabataean". - * @since 1.9 + * @since 9 */ NABATAEAN, /** * Unicode script "Palmyrene". - * @since 1.9 + * @since 9 */ PALMYRENE, /** * Unicode script "Pau Cin Hau". - * @since 1.9 + * @since 9 */ PAU_CIN_HAU, /** * Unicode script "Old Permic". - * @since 1.9 + * @since 9 */ OLD_PERMIC, /** * Unicode script "Psalter Pahlavi". - * @since 1.9 + * @since 9 */ PSALTER_PAHLAVI, /** * Unicode script "Siddham". - * @since 1.9 + * @since 9 */ SIDDHAM, /** * Unicode script "Khudawadi". - * @since 1.9 + * @since 9 */ KHUDAWADI, /** * Unicode script "Tirhuta". - * @since 1.9 + * @since 9 */ TIRHUTA, /** * Unicode script "Warang Citi". - * @since 1.9 + * @since 9 */ WARANG_CITI, /** * Unicode script "Ahom". - * @since 1.9 + * @since 9 */ AHOM, /** * Unicode script "Anatolian Hieroglyphs". - * @since 1.9 + * @since 9 */ ANATOLIAN_HIEROGLYPHS, /** * Unicode script "Hatran". - * @since 1.9 + * @since 9 */ HATRAN, /** * Unicode script "Multani". - * @since 1.9 + * @since 9 */ MULTANI, /** * Unicode script "Old Hungarian". - * @since 1.9 + * @since 9 */ OLD_HUNGARIAN, /** * Unicode script "SignWriting". - * @since 1.9 + * @since 9 */ SIGNWRITING, diff --git a/jdk/src/java.base/share/classes/java/lang/Integer.java b/jdk/src/java.base/share/classes/java/lang/Integer.java index 11afbef0d47..5302091fb39 100644 --- a/jdk/src/java.base/share/classes/java/lang/Integer.java +++ b/jdk/src/java.base/share/classes/java/lang/Integer.java @@ -716,7 +716,7 @@ public final class Integer extends Number implements Comparable { * {@code radix}, or if {@code radix} is either smaller than * {@link java.lang.Character#MIN_RADIX} or larger than * {@link java.lang.Character#MAX_RADIX}. - * @since 1.9 + * @since 9 */ public static int parseInt(CharSequence s, int beginIndex, int endIndex, int radix) throws NumberFormatException { @@ -899,7 +899,7 @@ public final class Integer extends Number implements Comparable { * {@code radix}, or if {@code radix} is either smaller than * {@link java.lang.Character#MIN_RADIX} or larger than * {@link java.lang.Character#MAX_RADIX}. - * @since 1.9 + * @since 9 */ public static int parseUnsignedInt(CharSequence s, int beginIndex, int endIndex, int radix) throws NumberFormatException { diff --git a/jdk/src/java.base/share/classes/java/lang/Long.java b/jdk/src/java.base/share/classes/java/lang/Long.java index d7d232f23b0..191ae2071d4 100644 --- a/jdk/src/java.base/share/classes/java/lang/Long.java +++ b/jdk/src/java.base/share/classes/java/lang/Long.java @@ -747,7 +747,7 @@ public final class Long extends Number implements Comparable { * {@code radix}, or if {@code radix} is either smaller than * {@link java.lang.Character#MIN_RADIX} or larger than * {@link java.lang.Character#MAX_RADIX}. - * @since 1.9 + * @since 9 */ public static long parseLong(CharSequence s, int beginIndex, int endIndex, int radix) throws NumberFormatException { @@ -993,7 +993,7 @@ public final class Long extends Number implements Comparable { * {@code radix}, or if {@code radix} is either smaller than * {@link java.lang.Character#MIN_RADIX} or larger than * {@link java.lang.Character#MAX_RADIX}. - * @since 1.9 + * @since 9 */ public static long parseUnsignedLong(CharSequence s, int beginIndex, int endIndex, int radix) throws NumberFormatException { diff --git a/jdk/src/java.base/share/classes/java/lang/Process.java b/jdk/src/java.base/share/classes/java/lang/Process.java index b537bb416d3..3f0ec640a6b 100644 --- a/jdk/src/java.base/share/classes/java/lang/Process.java +++ b/jdk/src/java.base/share/classes/java/lang/Process.java @@ -304,7 +304,7 @@ public abstract class Process { * otherwise, {@link #destroy} forcibly terminates the process * @throws UnsupportedOperationException if the Process implementation * does not support this operation - * @since 1.9 + * @since 9 */ public boolean supportsNormalTermination() { throw new UnsupportedOperationException(this.getClass() @@ -340,7 +340,7 @@ public abstract class Process { * @return the native process id of the process * @throws UnsupportedOperationException if the Process implementation * does not support this operation - * @since 1.9 + * @since 9 */ public long getPid() { return toHandle().getPid(); @@ -409,7 +409,7 @@ public abstract class Process { * * @return a new {@code CompletableFuture} for the Process * - * @since 1.9 + * @since 9 */ public CompletableFuture onExit() { return CompletableFuture.supplyAsync(this::waitForInternal); @@ -471,7 +471,7 @@ public abstract class Process { * does not support this operation * @throws SecurityException if a security manager has been installed and * it denies RuntimePermission("manageProcess") - * @since 1.9 + * @since 9 */ public ProcessHandle toHandle() { throw new UnsupportedOperationException(this.getClass() @@ -491,7 +491,7 @@ public abstract class Process { * @return a snapshot of information about the process, always non-null * @throws UnsupportedOperationException if the Process implementation * does not support this operation - * @since 1.9 + * @since 9 */ public ProcessHandle.Info info() { return toHandle().info(); @@ -516,7 +516,7 @@ public abstract class Process { * does not support this operation * @throws SecurityException if a security manager has been installed and * it denies RuntimePermission("manageProcess") - * @since 1.9 + * @since 9 */ public Stream children() { return toHandle().children(); @@ -542,7 +542,7 @@ public abstract class Process { * does not support this operation * @throws SecurityException if a security manager has been installed and * it denies RuntimePermission("manageProcess") - * @since 1.9 + * @since 9 */ public Stream descendants() { return toHandle().descendants(); diff --git a/jdk/src/java.base/share/classes/java/lang/ProcessHandle.java b/jdk/src/java.base/share/classes/java/lang/ProcessHandle.java index a7e650fee04..fbf5cfba252 100644 --- a/jdk/src/java.base/share/classes/java/lang/ProcessHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/ProcessHandle.java @@ -89,7 +89,7 @@ import java.util.stream.Stream; * {@link #compareTo(ProcessHandle) compareTo} methods to compare ProcessHandles. * * @see Process - * @since 1.9 + * @since 9 */ public interface ProcessHandle extends Comparable { @@ -215,7 +215,7 @@ public interface ProcessHandle extends Comparable { * by the operating system privileges of the process making the request. * The return types are {@code Optional} allowing explicit tests * and actions if the value is available. - * @since 1.9 + * @since 9 */ public interface Info { /** diff --git a/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java b/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java index 0019b5724cf..d31a80d740c 100644 --- a/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java +++ b/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java @@ -50,7 +50,7 @@ import static java.security.AccessController.doPrivileged; * ProcessHandleImpl is the implementation of ProcessHandle. * * @see Process - * @since 1.9 + * @since 9 */ final class ProcessHandleImpl implements ProcessHandle { /** @@ -338,7 +338,7 @@ final class ProcessHandleImpl implements ProcessHandle { * * @return {@code true} if the process represented by this * {@code ProcessHandle} object has not yet terminated. - * @since 1.9 + * @since 9 */ @Override public boolean isAlive() { diff --git a/jdk/src/java.base/share/classes/java/lang/StackWalker.java b/jdk/src/java.base/share/classes/java/lang/StackWalker.java index 2950ca23252..f628459dfb3 100644 --- a/jdk/src/java.base/share/classes/java/lang/StackWalker.java +++ b/jdk/src/java.base/share/classes/java/lang/StackWalker.java @@ -81,7 +81,7 @@ import java.util.stream.Stream; * will cause a {@link NullPointerException NullPointerException} * to be thrown. * - * @since 1.9 + * @since 9 */ public final class StackWalker { /** @@ -92,7 +92,7 @@ public final class StackWalker { * by the {@linkplain Option stack walking options} of a {@linkplain * StackWalker stack walker}. * - * @since 1.9 + * @since 9 * @jvms 2.6 */ public static interface StackFrame { @@ -185,7 +185,7 @@ public final class StackWalker { * Stack walker option to configure the {@linkplain StackFrame stack frame} * information obtained by a {@code StackWalker}. * - * @since 1.9 + * @since 9 */ public enum Option { /** diff --git a/jdk/src/java.base/share/classes/java/lang/String.java b/jdk/src/java.base/share/classes/java/lang/String.java index 63946f2e301..86ec043d5b1 100644 --- a/jdk/src/java.base/share/classes/java/lang/String.java +++ b/jdk/src/java.base/share/classes/java/lang/String.java @@ -2674,7 +2674,7 @@ public final class String * point is passed through uninterpreted. * * @return an IntStream of char values from this sequence - * @since 1.9 + * @since 9 */ @Override public IntStream chars() { @@ -2694,7 +2694,7 @@ public final class String * {@code int} values which are then passed to the stream. * * @return an IntStream of Unicode code points from this sequence - * @since 1.9 + * @since 9 */ @Override public IntStream codePoints() { diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedArrayType.java b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedArrayType.java index 747769e33b2..d9b8223c758 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedArrayType.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedArrayType.java @@ -53,7 +53,7 @@ public interface AnnotatedArrayType extends AnnotatedType { * * @return {@code null} * - * @since 1.9 + * @since 9 */ @Override AnnotatedType getAnnotatedOwnerType(); diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedParameterizedType.java b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedParameterizedType.java index bb96e6347ed..b42530ef82e 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedParameterizedType.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedParameterizedType.java @@ -59,7 +59,7 @@ public interface AnnotatedParameterizedType extends AnnotatedType { * refers to a parameterized type that cannot be instantiated * for any reason * - * @since 1.9 + * @since 9 */ @Override AnnotatedType getAnnotatedOwnerType(); diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedType.java b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedType.java index 8ef6130834e..79a8cd15fdd 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedType.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedType.java @@ -60,7 +60,7 @@ public interface AnnotatedType extends AnnotatedElement { * refers to a parameterized type that cannot be instantiated * for any reason * - * @since 1.9 + * @since 9 */ default AnnotatedType getAnnotatedOwnerType() { return null; diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedTypeVariable.java b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedTypeVariable.java index c1d8e37482f..cab83f361c3 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedTypeVariable.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedTypeVariable.java @@ -54,7 +54,7 @@ public interface AnnotatedTypeVariable extends AnnotatedType { * * @return {@code null} * - * @since 1.9 + * @since 9 */ @Override AnnotatedType getAnnotatedOwnerType(); diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedWildcardType.java b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedWildcardType.java index 84e44f52e41..d46d269d343 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedWildcardType.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedWildcardType.java @@ -65,7 +65,7 @@ public interface AnnotatedWildcardType extends AnnotatedType { * * @return {@code null} * - * @since 1.9 + * @since 9 */ @Override AnnotatedType getAnnotatedOwnerType(); diff --git a/jdk/src/java.base/share/classes/java/math/BigInteger.java b/jdk/src/java.base/share/classes/java/math/BigInteger.java index c77731b2418..6ef44a5f6f8 100644 --- a/jdk/src/java.base/share/classes/java/math/BigInteger.java +++ b/jdk/src/java.base/share/classes/java/math/BigInteger.java @@ -297,7 +297,7 @@ public class BigInteger extends Number implements Comparable { * @throws IndexOutOfBoundsException if the provided array offset and * length would cause an index into the byte array to be * negative or greater than or equal to the array length. - * @since 1.9 + * @since 9 */ public BigInteger(byte[] val, int off, int len) { if (val.length == 0) { @@ -385,7 +385,7 @@ public class BigInteger extends Number implements Comparable { * @throws IndexOutOfBoundsException if the provided array offset and * length would cause an index into the byte array to be * negative or greater than or equal to the array length. - * @since 1.9 + * @since 9 */ public BigInteger(int signum, byte[] magnitude, int off, int len) { if (signum < -1 || signum > 1) { @@ -2424,7 +2424,7 @@ public class BigInteger extends Number implements Comparable { * {@code (i * sqrt(-val))} where i is the * imaginary unit and is equal to * {@code sqrt(-1)}.) - * @since 1.9 + * @since 9 */ public BigInteger sqrt() { if (this.signum < 0) { @@ -2447,7 +2447,7 @@ public class BigInteger extends Number implements Comparable { * imaginary unit and is equal to * {@code sqrt(-1)}.) * @see #sqrt() - * @since 1.9 + * @since 9 */ public BigInteger[] sqrtAndRemainder() { BigInteger s = sqrt(); diff --git a/jdk/src/java.base/share/classes/java/math/MutableBigInteger.java b/jdk/src/java.base/share/classes/java/math/MutableBigInteger.java index 65eca1e743d..2d7ababd042 100644 --- a/jdk/src/java.base/share/classes/java/math/MutableBigInteger.java +++ b/jdk/src/java.base/share/classes/java/math/MutableBigInteger.java @@ -1878,7 +1878,7 @@ class MutableBigInteger { * @throws ArithmeticException if the value returned by {@code bitLength()} * overflows the range of {@code int}. * @return the integer square root of {@code this} - * @since 1.9 + * @since 9 */ MutableBigInteger sqrt() { // Special cases. diff --git a/jdk/src/java.base/share/classes/java/net/DatagramSocket.java b/jdk/src/java.base/share/classes/java/net/DatagramSocket.java index 3c0e5c66a9b..7a447cb0acd 100644 --- a/jdk/src/java.base/share/classes/java/net/DatagramSocket.java +++ b/jdk/src/java.base/share/classes/java/net/DatagramSocket.java @@ -1338,7 +1338,7 @@ class DatagramSocket implements java.io.Closeable { * * @throws NullPointerException if name is {@code null} * - * @since 1.9 + * @since 9 */ public DatagramSocket setOption(SocketOption name, T value) throws IOException @@ -1368,7 +1368,7 @@ class DatagramSocket implements java.io.Closeable { * {@link java.net.StandardSocketOptions StandardSocketOptions} * do not require any security permission. * - * @since 1.9 + * @since 9 */ public T getOption(SocketOption name) throws IOException { return getImpl().getOption(name); @@ -1386,7 +1386,7 @@ class DatagramSocket implements java.io.Closeable { * @return A set of the socket options supported by this socket. This set * may be empty if the socket's DatagramSocketImpl cannot be created. * - * @since 1.9 + * @since 9 */ public Set> supportedOptions() { synchronized(DatagramSocket.class) { diff --git a/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java b/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java index 0726dc4cce7..97526bc3712 100644 --- a/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java +++ b/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java @@ -278,7 +278,7 @@ public abstract class DatagramSocketImpl implements SocketOptions { * * @throws NullPointerException if name is {@code null} * @throws IOException if an I/O problem occurs while attempting to set the option - * @since 1.9 + * @since 9 */ protected void setOption(SocketOption name, T value) throws IOException { if (name == StandardSocketOptions.SO_SNDBUF) { @@ -319,7 +319,7 @@ public abstract class DatagramSocketImpl implements SocketOptions { * @throws NullPointerException if name is {@code null} * @throws IOException if an I/O problem occurs while attempting to set the option * - * @since 1.9 + * @since 9 */ @SuppressWarnings("unchecked") protected T getOption(SocketOption name) throws IOException { diff --git a/jdk/src/java.base/share/classes/java/net/NetworkInterface.java b/jdk/src/java.base/share/classes/java/net/NetworkInterface.java index 8e5ec293646..f505bc48a82 100644 --- a/jdk/src/java.base/share/classes/java/net/NetworkInterface.java +++ b/jdk/src/java.base/share/classes/java/net/NetworkInterface.java @@ -130,7 +130,7 @@ public final class NetworkInterface { * * @return a Stream object with all or a subset of the InetAddresses * bound to this network interface - * @since 1.9 + * @since 9 */ public Stream inetAddresses() { return streamFromArray(getCheckedInetAddresses()); @@ -208,7 +208,7 @@ public final class NetworkInterface { * * @return a Stream object with all of the subinterfaces * of this network interface - * @since 1.9 + * @since 9 */ public Stream subInterfaces() { return streamFromArray(childs); @@ -362,7 +362,7 @@ public final class NetworkInterface { * * @return a Stream of NetworkInterfaces found on this machine * @exception SocketException if an I/O error occurs. - * @since 1.9 + * @since 9 */ public static Stream networkInterfaces() throws SocketException { diff --git a/jdk/src/java.base/share/classes/java/net/ServerSocket.java b/jdk/src/java.base/share/classes/java/net/ServerSocket.java index af0c5152d9a..a86fca6af3c 100644 --- a/jdk/src/java.base/share/classes/java/net/ServerSocket.java +++ b/jdk/src/java.base/share/classes/java/net/ServerSocket.java @@ -946,7 +946,7 @@ class ServerSocket implements java.io.Closeable { * {@link java.net.StandardSocketOptions StandardSocketOptions} * do not require any security permission. * - * @since 1.9 + * @since 9 */ public ServerSocket setOption(SocketOption name, T value) throws IOException @@ -976,7 +976,7 @@ class ServerSocket implements java.io.Closeable { * {@link java.net.StandardSocketOptions StandardSocketOptions} * do not require any security permission. * - * @since 1.9 + * @since 9 */ public T getOption(SocketOption name) throws IOException { return getImpl().getOption(name); @@ -994,7 +994,7 @@ class ServerSocket implements java.io.Closeable { * @return A set of the socket options supported by this socket. This set * may be empty if the socket's SocketImpl cannot be created. * - * @since 1.9 + * @since 9 */ public Set> supportedOptions() { synchronized (ServerSocket.class) { diff --git a/jdk/src/java.base/share/classes/java/net/Socket.java b/jdk/src/java.base/share/classes/java/net/Socket.java index 43e1c5db6bd..47971df5fbb 100644 --- a/jdk/src/java.base/share/classes/java/net/Socket.java +++ b/jdk/src/java.base/share/classes/java/net/Socket.java @@ -1756,7 +1756,7 @@ class Socket implements java.io.Closeable { * {@link java.net.StandardSocketOptions StandardSocketOptions} * do not require any security permission. * - * @since 1.9 + * @since 9 */ public Socket setOption(SocketOption name, T value) throws IOException { getImpl().setOption(name, value); @@ -1784,7 +1784,7 @@ class Socket implements java.io.Closeable { * {@link java.net.StandardSocketOptions StandardSocketOptions} * do not require any security permission. * - * @since 1.9 + * @since 9 */ @SuppressWarnings("unchecked") public T getOption(SocketOption name) throws IOException { @@ -1803,7 +1803,7 @@ class Socket implements java.io.Closeable { * @return A set of the socket options supported by this socket. This set * may be empty if the socket's SocketImpl cannot be created. * - * @since 1.9 + * @since 9 */ public Set> supportedOptions() { synchronized (Socket.class) { diff --git a/jdk/src/java.base/share/classes/java/net/SocketImpl.java b/jdk/src/java.base/share/classes/java/net/SocketImpl.java index b4b9c1900c7..eef92f30b6e 100644 --- a/jdk/src/java.base/share/classes/java/net/SocketImpl.java +++ b/jdk/src/java.base/share/classes/java/net/SocketImpl.java @@ -373,7 +373,7 @@ public abstract class SocketImpl implements SocketOptions { * * @throws IOException if an I/O error occurs, or if the socket is closed. * - * @since 1.9 + * @since 9 */ protected void setOption(SocketOption name, T value) throws IOException { if (name == StandardSocketOptions.SO_KEEPALIVE && @@ -412,7 +412,7 @@ public abstract class SocketImpl implements SocketOptions { * * @throws IOException if an I/O error occurs, or if the socket is closed. * - * @since 1.9 + * @since 9 */ @SuppressWarnings("unchecked") protected T getOption(SocketOption name) throws IOException { diff --git a/jdk/src/java.base/share/classes/java/net/spi/URLStreamHandlerProvider.java b/jdk/src/java.base/share/classes/java/net/spi/URLStreamHandlerProvider.java index 0d6b424205e..b8f2c09bb89 100644 --- a/jdk/src/java.base/share/classes/java/net/spi/URLStreamHandlerProvider.java +++ b/jdk/src/java.base/share/classes/java/net/spi/URLStreamHandlerProvider.java @@ -44,7 +44,7 @@ import java.net.URLStreamHandlerFactory; *

      URL stream handler providers are located at runtime, as specified in the * {@linkplain java.net.URL#URL(String,String,int,String) URL constructor}. * - * @since 1.9 + * @since 9 */ public abstract class URLStreamHandlerProvider implements URLStreamHandlerFactory diff --git a/jdk/src/java.base/share/classes/java/net/spi/package-info.java b/jdk/src/java.base/share/classes/java/net/spi/package-info.java index 06ddeccb00d..5a1b2e555af 100644 --- a/jdk/src/java.base/share/classes/java/net/spi/package-info.java +++ b/jdk/src/java.base/share/classes/java/net/spi/package-info.java @@ -29,7 +29,7 @@ *

      Only developers who are defining new URL stream handler providers * should need to make direct use of this package. * - * @since 1.9 + * @since 9 */ package java.net.spi; diff --git a/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java b/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java index a9c6005d28c..838cc40a09a 100644 --- a/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java +++ b/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java @@ -213,7 +213,7 @@ public abstract class MappedByteBuffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public final MappedByteBuffer position(int newPosition) { @@ -223,7 +223,7 @@ public abstract class MappedByteBuffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public final MappedByteBuffer limit(int newLimit) { @@ -233,7 +233,7 @@ public abstract class MappedByteBuffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public final MappedByteBuffer mark() { @@ -243,7 +243,7 @@ public abstract class MappedByteBuffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public final MappedByteBuffer reset() { @@ -253,7 +253,7 @@ public abstract class MappedByteBuffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public final MappedByteBuffer clear() { @@ -263,7 +263,7 @@ public abstract class MappedByteBuffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public final MappedByteBuffer flip() { @@ -273,7 +273,7 @@ public abstract class MappedByteBuffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public final MappedByteBuffer rewind() { diff --git a/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template b/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template index d34f975526c..72efc279778 100644 --- a/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template +++ b/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template @@ -1064,7 +1064,7 @@ public abstract class $Type$Buffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public @@ -1078,7 +1078,7 @@ public abstract class $Type$Buffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public @@ -1092,7 +1092,7 @@ public abstract class $Type$Buffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public @@ -1106,7 +1106,7 @@ public abstract class $Type$Buffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public @@ -1120,7 +1120,7 @@ public abstract class $Type$Buffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public @@ -1134,7 +1134,7 @@ public abstract class $Type$Buffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public @@ -1148,7 +1148,7 @@ public abstract class $Type$Buffer /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public diff --git a/jdk/src/java.base/share/classes/java/security/KeyStore.java b/jdk/src/java.base/share/classes/java/security/KeyStore.java index 40df29cdd6c..39721622fc2 100644 --- a/jdk/src/java.base/share/classes/java/security/KeyStore.java +++ b/jdk/src/java.base/share/classes/java/security/KeyStore.java @@ -1666,7 +1666,7 @@ public class KeyStore { * * @see Provider * - * @since 1.9 + * @since 9 */ public static final KeyStore getInstance(File file, char[] password) throws KeyStoreException, IOException, NoSuchAlgorithmException, @@ -1722,7 +1722,7 @@ public class KeyStore { * * @see Provider * - * @since 1.9 + * @since 9 */ public static final KeyStore getInstance(File file, LoadStoreParameter param) throws KeyStoreException, IOException, @@ -2006,7 +2006,7 @@ public class KeyStore { * of either PasswordProtection or CallbackHandlerProtection; or * if file does not exist or does not refer to a normal file * - * @since 1.9 + * @since 9 */ public static Builder newInstance(File file, ProtectionParameter protection) { diff --git a/jdk/src/java.base/share/classes/java/security/PermissionCollection.java b/jdk/src/java.base/share/classes/java/security/PermissionCollection.java index 0aa6ce74bc4..1aa41cab022 100644 --- a/jdk/src/java.base/share/classes/java/security/PermissionCollection.java +++ b/jdk/src/java.base/share/classes/java/security/PermissionCollection.java @@ -144,7 +144,7 @@ public abstract class PermissionCollection implements java.io.Serializable { * the enumeration returned from a call to {@link #elements()}. * * @return a stream of all the Permissions. - * @since 1.9 + * @since 9 */ public Stream elementsAsStream() { int characteristics = isReadOnly() diff --git a/jdk/src/java.base/share/classes/java/security/cert/URICertStoreParameters.java b/jdk/src/java.base/share/classes/java/security/cert/URICertStoreParameters.java index 3b6418e4dc2..d8b05485d2d 100644 --- a/jdk/src/java.base/share/classes/java/security/cert/URICertStoreParameters.java +++ b/jdk/src/java.base/share/classes/java/security/cert/URICertStoreParameters.java @@ -43,7 +43,7 @@ import java.net.URI; * provide the necessary locking. Multiple threads each manipulating * separate objects need not synchronize. * - * @since 1.9 + * @since 9 * @see CertStore * @see java.net.URI */ diff --git a/jdk/src/java.base/share/classes/java/security/spec/EncodedKeySpec.java b/jdk/src/java.base/share/classes/java/security/spec/EncodedKeySpec.java index b43887b4cb0..5aca225d2b2 100644 --- a/jdk/src/java.base/share/classes/java/security/spec/EncodedKeySpec.java +++ b/jdk/src/java.base/share/classes/java/security/spec/EncodedKeySpec.java @@ -74,7 +74,7 @@ public abstract class EncodedKeySpec implements KeySpec { * or {@code algorithm} is null. * @throws IllegalArgumentException if {@code algorithm} is * the empty string {@code ""} - * @since 1.9 + * @since 9 */ protected EncodedKeySpec(byte[] encodedKey, String algorithm) { if (algorithm == null) { @@ -93,7 +93,7 @@ public abstract class EncodedKeySpec implements KeySpec { * Returns the name of the algorithm of the encoded key. * * @return the name of the algorithm, or null if not specified - * @since 1.9 + * @since 9 */ public String getAlgorithm() { return algorithmName; diff --git a/jdk/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java b/jdk/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java index 89bf11d94ae..198ca604b8c 100644 --- a/jdk/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java +++ b/jdk/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java @@ -92,7 +92,7 @@ public class PKCS8EncodedKeySpec extends EncodedKeySpec { * or {@code algorithm} is null. * @throws IllegalArgumentException if {@code algorithm} is * the empty string {@code ""} - * @since 1.9 + * @since 9 */ public PKCS8EncodedKeySpec(byte[] encodedKey, String algorithm) { super(encodedKey, algorithm); diff --git a/jdk/src/java.base/share/classes/java/security/spec/X509EncodedKeySpec.java b/jdk/src/java.base/share/classes/java/security/spec/X509EncodedKeySpec.java index 0ddb97f3ac4..2d23570fe3d 100644 --- a/jdk/src/java.base/share/classes/java/security/spec/X509EncodedKeySpec.java +++ b/jdk/src/java.base/share/classes/java/security/spec/X509EncodedKeySpec.java @@ -82,7 +82,7 @@ public class X509EncodedKeySpec extends EncodedKeySpec { * or {@code algorithm} is null. * @throws IllegalArgumentException if {@code algorithm} is * the empty string {@code ""} - * @since 1.9 + * @since 9 */ public X509EncodedKeySpec(byte[] encodedKey, String algorithm) { super(encodedKey, algorithm); diff --git a/jdk/src/java.base/share/classes/java/util/Enumeration.java b/jdk/src/java.base/share/classes/java/util/Enumeration.java index 2cf2a2708ce..96aa3a90076 100644 --- a/jdk/src/java.base/share/classes/java/util/Enumeration.java +++ b/jdk/src/java.base/share/classes/java/util/Enumeration.java @@ -112,7 +112,7 @@ public interface Enumeration { * * @return an Iterator representing the remaining elements of this Enumeration * - * @since 1.9 + * @since 9 */ default Iterator asIterator() { return new Iterator<>() { diff --git a/jdk/src/java.base/share/classes/java/util/Scanner.java b/jdk/src/java.base/share/classes/java/util/Scanner.java index 1fb17bc65bf..b2f41aecb54 100644 --- a/jdk/src/java.base/share/classes/java/util/Scanner.java +++ b/jdk/src/java.base/share/classes/java/util/Scanner.java @@ -2684,7 +2684,7 @@ public final class Scanner implements Iterator, Closeable { * * @return a sequential stream of token strings * @throws IllegalStateException if this scanner is closed - * @since 1.9 + * @since 9 */ public Stream tokens() { ensureOpen(); @@ -2770,7 +2770,7 @@ public final class Scanner implements Iterator, Closeable { * @return a sequential stream of match results * @throws NullPointerException if pattern is null * @throws IllegalStateException if this scanner is closed - * @since 1.9 + * @since 9 */ public Stream findAll(Pattern pattern) { Objects.requireNonNull(pattern); @@ -2792,7 +2792,7 @@ public final class Scanner implements Iterator, Closeable { * @throws NullPointerException if patString is null * @throws IllegalStateException if this scanner is closed * @throws PatternSyntaxException if the regular expression's syntax is invalid - * @since 1.9 + * @since 9 * @see java.util.regex.Pattern */ public Stream findAll(String patString) { diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java b/jdk/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java index 45389ac9109..dd24b82f2cc 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java @@ -2429,7 +2429,7 @@ public class CompletableFuture implements Future, CompletionStage { * * @param the type of the value * @return a new CompletableFuture - * @since 1.9 + * @since 9 */ public CompletableFuture newIncompleteFuture() { return new CompletableFuture(); @@ -2444,7 +2444,7 @@ public class CompletableFuture implements Future, CompletionStage { * an Executor that provides at least one independent thread. * * @return the executor - * @since 1.9 + * @since 9 */ public Executor defaultExecutor() { return ASYNC_POOL; @@ -2462,7 +2462,7 @@ public class CompletableFuture implements Future, CompletionStage { * arrange dependent actions. * * @return the new CompletableFuture - * @since 1.9 + * @since 9 */ public CompletableFuture copy() { return uniCopyStage(); @@ -2479,7 +2479,7 @@ public class CompletableFuture implements Future, CompletionStage { * cause. * * @return the new CompletionStage - * @since 1.9 + * @since 9 */ public CompletionStage minimalCompletionStage() { return uniAsMinimalStage(); @@ -2494,7 +2494,7 @@ public class CompletableFuture implements Future, CompletionStage { * to complete this CompletableFuture * @param executor the executor to use for asynchronous execution * @return this CompletableFuture - * @since 1.9 + * @since 9 */ public CompletableFuture completeAsync(Supplier supplier, Executor executor) { @@ -2512,7 +2512,7 @@ public class CompletableFuture implements Future, CompletionStage { * @param supplier a function returning the value to be used * to complete this CompletableFuture * @return this CompletableFuture - * @since 1.9 + * @since 9 */ public CompletableFuture completeAsync(Supplier supplier) { return completeAsync(supplier, defaultExecutor()); @@ -2528,7 +2528,7 @@ public class CompletableFuture implements Future, CompletionStage { * @param unit a {@code TimeUnit} determining how to interpret the * {@code timeout} parameter * @return this CompletableFuture - * @since 1.9 + * @since 9 */ public CompletableFuture orTimeout(long timeout, TimeUnit unit) { if (unit == null) @@ -2549,7 +2549,7 @@ public class CompletableFuture implements Future, CompletionStage { * @param unit a {@code TimeUnit} determining how to interpret the * {@code timeout} parameter * @return this CompletableFuture - * @since 1.9 + * @since 9 */ public CompletableFuture completeOnTimeout(T value, long timeout, TimeUnit unit) { @@ -2573,7 +2573,7 @@ public class CompletableFuture implements Future, CompletionStage { * {@code delay} parameter * @param executor the base executor * @return the new delayed executor - * @since 1.9 + * @since 9 */ public static Executor delayedExecutor(long delay, TimeUnit unit, Executor executor) { @@ -2592,7 +2592,7 @@ public class CompletableFuture implements Future, CompletionStage { * @param unit a {@code TimeUnit} determining how to interpret the * {@code delay} parameter * @return the new delayed executor - * @since 1.9 + * @since 9 */ public static Executor delayedExecutor(long delay, TimeUnit unit) { if (unit == null) @@ -2608,7 +2608,7 @@ public class CompletableFuture implements Future, CompletionStage { * @param value the value * @param the type of the value * @return the completed CompletionStage - * @since 1.9 + * @since 9 */ public static CompletionStage completedStage(U value) { return new MinimalStage((value == null) ? NIL : value); @@ -2621,7 +2621,7 @@ public class CompletableFuture implements Future, CompletionStage { * @param ex the exception * @param the type of the value * @return the exceptionally completed CompletableFuture - * @since 1.9 + * @since 9 */ public static CompletableFuture failedFuture(Throwable ex) { if (ex == null) throw new NullPointerException(); @@ -2636,7 +2636,7 @@ public class CompletableFuture implements Future, CompletionStage { * @param ex the exception * @param the type of the value * @return the exceptionally completed CompletionStage - * @since 1.9 + * @since 9 */ public static CompletionStage failedStage(Throwable ex) { if (ex == null) throw new NullPointerException(); diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/Flow.java b/jdk/src/java.base/share/classes/java/util/concurrent/Flow.java index c1418ffc0d6..fe137386d45 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/Flow.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/Flow.java @@ -161,7 +161,7 @@ package java.util.concurrent; * }} * * @author Doug Lea - * @since 1.9 + * @since 9 */ public final class Flow { diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java b/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java index 2b714dff9b4..888794e8e40 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java @@ -1301,7 +1301,7 @@ public abstract class ForkJoinTask implements Future, Serializable { * support extensions, and is unlikely to be useful otherwise. * * @return a task, or {@code null} if none are available - * @since 1.9 + * @since 9 */ protected static ForkJoinTask pollSubmission() { Thread t; diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java b/jdk/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java index 286c31b86a3..d3c4518a3b6 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java @@ -154,7 +154,7 @@ import java.util.function.Consumer; * * @param the published item type * @author Doug Lea - * @since 1.9 + * @since 9 */ public class SubmissionPublisher implements Flow.Publisher, AutoCloseable { diff --git a/jdk/src/java.base/share/classes/java/util/regex/Matcher.java b/jdk/src/java.base/share/classes/java/util/regex/Matcher.java index f8231e83e53..7f030af704a 100644 --- a/jdk/src/java.base/share/classes/java/util/regex/Matcher.java +++ b/jdk/src/java.base/share/classes/java/util/regex/Matcher.java @@ -974,7 +974,7 @@ public final class Matcher implements MatchResult { * @throws IndexOutOfBoundsException * If the replacement string refers to a capturing group * that does not exist in the pattern - * @since 1.9 + * @since 9 */ public Matcher appendReplacement(StringBuilder sb, String replacement) { // If no match, return error @@ -1117,7 +1117,7 @@ public final class Matcher implements MatchResult { * * @return The target string builder * - * @since 1.9 + * @since 9 */ public StringBuilder appendTail(StringBuilder sb) { sb.append(text, lastAppendPosition, getTextLength()); @@ -1229,7 +1229,7 @@ public final class Matcher implements MatchResult { * @throws ConcurrentModificationException if it is detected, on a * best-effort basis, that the replacer function modified this * matcher's state - * @since 1.9 + * @since 9 */ public String replaceAll(Function replacer) { Objects.requireNonNull(replacer); @@ -1273,7 +1273,7 @@ public final class Matcher implements MatchResult { * modification is detected. * * @return a sequential stream of match results. - * @since 1.9 + * @since 9 */ public Stream results() { class MatchResultIterator implements Iterator { @@ -1451,7 +1451,7 @@ public final class Matcher implements MatchResult { * @throws ConcurrentModificationException if it is detected, on a * best-effort basis, that the replacer function modified this * matcher's state - * @since 1.9 + * @since 9 */ public String replaceFirst(Function replacer) { Objects.requireNonNull(replacer); diff --git a/jdk/src/java.base/share/classes/java/util/stream/DoubleStream.java b/jdk/src/java.base/share/classes/java/util/stream/DoubleStream.java index 79ad66e5b87..574e4f17fc7 100644 --- a/jdk/src/java.base/share/classes/java/util/stream/DoubleStream.java +++ b/jdk/src/java.base/share/classes/java/util/stream/DoubleStream.java @@ -329,7 +329,7 @@ public interface DoubleStream extends BaseStream { * predicate to apply to elements to determine the longest * prefix of elements. * @return the new stream - * @since 1.9 + * @since 9 */ default DoubleStream takeWhile(DoublePredicate predicate) { Objects.requireNonNull(predicate); @@ -396,7 +396,7 @@ public interface DoubleStream extends BaseStream { * predicate to apply to elements to determine the longest * prefix of elements. * @return the new stream - * @since 1.9 + * @since 9 */ default DoubleStream dropWhile(DoublePredicate predicate) { Objects.requireNonNull(predicate); diff --git a/jdk/src/java.base/share/classes/java/util/stream/IntStream.java b/jdk/src/java.base/share/classes/java/util/stream/IntStream.java index 2da8629e901..91ddad2b2a8 100644 --- a/jdk/src/java.base/share/classes/java/util/stream/IntStream.java +++ b/jdk/src/java.base/share/classes/java/util/stream/IntStream.java @@ -326,7 +326,7 @@ public interface IntStream extends BaseStream { * predicate to apply to elements to determine the longest * prefix of elements. * @return the new stream - * @since 1.9 + * @since 9 */ default IntStream takeWhile(IntPredicate predicate) { Objects.requireNonNull(predicate); @@ -392,7 +392,7 @@ public interface IntStream extends BaseStream { * predicate to apply to elements to determine the longest * prefix of elements. * @return the new stream - * @since 1.9 + * @since 9 */ default IntStream dropWhile(IntPredicate predicate) { Objects.requireNonNull(predicate); diff --git a/jdk/src/java.base/share/classes/java/util/stream/LongStream.java b/jdk/src/java.base/share/classes/java/util/stream/LongStream.java index 7468a2715b2..c1a89eb4b76 100644 --- a/jdk/src/java.base/share/classes/java/util/stream/LongStream.java +++ b/jdk/src/java.base/share/classes/java/util/stream/LongStream.java @@ -327,7 +327,7 @@ public interface LongStream extends BaseStream { * predicate to apply to elements to determine the longest * prefix of elements. * @return the new stream - * @since 1.9 + * @since 9 */ default LongStream takeWhile(LongPredicate predicate) { Objects.requireNonNull(predicate); @@ -394,7 +394,7 @@ public interface LongStream extends BaseStream { * predicate to apply to elements to determine the longest * prefix of elements. * @return the new stream - * @since 1.9 + * @since 9 */ default LongStream dropWhile(LongPredicate predicate) { Objects.requireNonNull(predicate); diff --git a/jdk/src/java.base/share/classes/java/util/stream/Stream.java b/jdk/src/java.base/share/classes/java/util/stream/Stream.java index 0ca9e3d2ef2..aef2581d0eb 100644 --- a/jdk/src/java.base/share/classes/java/util/stream/Stream.java +++ b/jdk/src/java.base/share/classes/java/util/stream/Stream.java @@ -533,7 +533,7 @@ public interface Stream extends BaseStream> { * predicate to apply to elements to determine the longest * prefix of elements. * @return the new stream - * @since 1.9 + * @since 9 */ default Stream takeWhile(Predicate predicate) { Objects.requireNonNull(predicate); @@ -599,7 +599,7 @@ public interface Stream extends BaseStream> { * predicate to apply to elements to determine the longest * prefix of elements. * @return the new stream - * @since 1.9 + * @since 9 */ default Stream dropWhile(Predicate predicate) { Objects.requireNonNull(predicate); @@ -1146,7 +1146,7 @@ public interface Stream extends BaseStream> { * @param the type of stream elements * @return a stream with a single element if the specified element * is non-null, otherwise an empty stream - * @since 1.9 + * @since 9 */ public static Stream ofNullable(T t) { return t == null ? Stream.empty() diff --git a/jdk/src/java.base/share/classes/java/util/stream/WhileOps.java b/jdk/src/java.base/share/classes/java/util/stream/WhileOps.java index cabe6883528..1288333df01 100644 --- a/jdk/src/java.base/share/classes/java/util/stream/WhileOps.java +++ b/jdk/src/java.base/share/classes/java/util/stream/WhileOps.java @@ -43,7 +43,7 @@ import java.util.function.Predicate; * Factory for instances of a takeWhile and dropWhile operations * that produce subsequences of their input stream. * - * @since 1.9 + * @since 9 */ final class WhileOps { diff --git a/jdk/src/java.base/share/classes/java/util/zip/CRC32C.java b/jdk/src/java.base/share/classes/java/util/zip/CRC32C.java index 2d82625780e..3b414954417 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/CRC32C.java +++ b/jdk/src/java.base/share/classes/java/util/zip/CRC32C.java @@ -44,7 +44,7 @@ import sun.nio.ch.DirectBuffer; * {@link NullPointerException} to be thrown. *

      * - * @since 1.9 + * @since 9 */ public final class CRC32C implements Checksum { diff --git a/jdk/src/java.base/share/classes/java/util/zip/Checksum.java b/jdk/src/java.base/share/classes/java/util/zip/Checksum.java index 121b687df0b..eb681861785 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/Checksum.java +++ b/jdk/src/java.base/share/classes/java/util/zip/Checksum.java @@ -51,7 +51,7 @@ public interface Checksum { * @throws NullPointerException * if {@code b} is {@code null} * - * @since 1.9 + * @since 9 */ default public void update(byte[] b) { update(b, 0, b.length); @@ -99,7 +99,7 @@ public interface Checksum { * @throws NullPointerException * if {@code buffer} is {@code null} * - * @since 1.9 + * @since 9 */ default public void update(ByteBuffer buffer) { int pos = buffer.position(); diff --git a/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java b/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java index c380058356b..ee91cee3ed8 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java +++ b/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java @@ -220,7 +220,7 @@ class ZipEntry implements ZipConstants, Cloneable { * The last modification time of the entry in local date-time * * @see #getTimeLocal() - * @since 1.9 + * @since 9 */ public void setTimeLocal(LocalDateTime time) { int year = time.getYear() - 1980; @@ -259,7 +259,7 @@ class ZipEntry implements ZipConstants, Cloneable { * @return The last modification time of the entry in local date-time * * @see #setTimeLocal(LocalDateTime) - * @since 1.9 + * @since 9 */ public LocalDateTime getTimeLocal() { if (mtime != null) { diff --git a/jdk/src/java.base/share/classes/jdk/internal/HotSpotIntrinsicCandidate.java b/jdk/src/java.base/share/classes/jdk/internal/HotSpotIntrinsicCandidate.java index 95ea0b44b87..8f3661fbfa3 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/HotSpotIntrinsicCandidate.java +++ b/jdk/src/java.base/share/classes/jdk/internal/HotSpotIntrinsicCandidate.java @@ -117,7 +117,7 @@ import java.lang.annotation.*; * and that (2) for all methods of that class annotated with * {@code @HotSpotIntrinsicCandidate} there is an intrinsic in the list. * - * @since 1.9 + * @since 9 */ @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) @Retention(RetentionPolicy.RUNTIME) diff --git a/jdk/src/java.base/share/classes/jdk/internal/logger/package-info.java b/jdk/src/java.base/share/classes/jdk/internal/logger/package-info.java index 28c622d4cde..46b571aa137 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/logger/package-info.java +++ b/jdk/src/java.base/share/classes/jdk/internal/logger/package-info.java @@ -63,6 +63,6 @@ * @see sun.util.logging.PlatformLogger.Bridge * @see sun.util.logging.internal * - * @since 1.9 + * @since 9 */ package jdk.internal.logger; diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java b/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java index 9176784def0..f130d383a84 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java +++ b/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java @@ -1081,7 +1081,7 @@ public final class Unsafe { * @return the value fetched from the indicated object * @throws RuntimeException No defined exceptions are thrown, not even * {@link NullPointerException} - * @since 1.9 + * @since 9 */ @HotSpotIntrinsicCandidate public final long getLongUnaligned(Object o, long offset) { @@ -1115,7 +1115,7 @@ public final class Unsafe { * @param offset The offset in bytes from the start of the object * @param bigEndian The endianness of the value * @return the value fetched from the indicated object - * @since 1.9 + * @since 9 */ public final long getLongUnaligned(Object o, long offset, boolean bigEndian) { return convEndian(bigEndian, getLongUnaligned(o, offset)); @@ -1193,7 +1193,7 @@ public final class Unsafe { * @param x the value to store * @throws RuntimeException No defined exceptions are thrown, not even * {@link NullPointerException} - * @since 1.9 + * @since 9 */ @HotSpotIntrinsicCandidate public final void putLongUnaligned(Object o, long offset, long x) { @@ -1231,7 +1231,7 @@ public final class Unsafe { * @param bigEndian The endianness of the value * @throws RuntimeException No defined exceptions are thrown, not even * {@link NullPointerException} - * @since 1.9 + * @since 9 */ public final void putLongUnaligned(Object o, long offset, long x, boolean bigEndian) { putLongUnaligned(o, offset, convEndian(bigEndian, x)); diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/ResponderId.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/ResponderId.java index 68d3811265d..f67786e432c 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/ResponderId.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/ResponderId.java @@ -49,7 +49,7 @@ import sun.security.util.DerValue; * * * @see ResponderId.Type - * @since 1.9 + * @since 9 */ public final class ResponderId { @@ -58,7 +58,7 @@ public final class ResponderId { * {@code ResponderId}. * * @see ResponderId - * @since 1.9 + * @since 9 */ public static enum Type { /** diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java b/jdk/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java index d68f0fad056..8da221961a0 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java @@ -41,7 +41,7 @@ import java.util.*; * Models a service that provides support for a particular client key exchange * mode. Currently used to implement Kerberos-related cipher suites. * - * @since 1.9 + * @since 9 */ public interface ClientKeyExchangeService { diff --git a/jdk/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java b/jdk/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java index 81e52ae3448..b43aa234833 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java +++ b/jdk/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java @@ -37,7 +37,7 @@ import sun.security.util.Debug; /** * This class delegates to a primary or secondary keystore implementation. * - * @since 1.9 + * @since 9 */ public class KeyStoreDelegator extends KeyStoreSpi { diff --git a/jdk/src/java.datatransfer/share/classes/sun/datatransfer/DataFlavorUtil.java b/jdk/src/java.datatransfer/share/classes/sun/datatransfer/DataFlavorUtil.java index 28991f05d4c..8bdc82b7b10 100644 --- a/jdk/src/java.datatransfer/share/classes/sun/datatransfer/DataFlavorUtil.java +++ b/jdk/src/java.datatransfer/share/classes/sun/datatransfer/DataFlavorUtil.java @@ -55,7 +55,7 @@ import java.util.function.Supplier; /** * Utility class with different datatransfer helper functions * - * @since 1.9 + * @since 9 */ public class DataFlavorUtil { diff --git a/jdk/src/java.datatransfer/share/classes/sun/datatransfer/DesktopDatatransferService.java b/jdk/src/java.datatransfer/share/classes/sun/datatransfer/DesktopDatatransferService.java index c0775487607..37499195bed 100644 --- a/jdk/src/java.datatransfer/share/classes/sun/datatransfer/DesktopDatatransferService.java +++ b/jdk/src/java.datatransfer/share/classes/sun/datatransfer/DesktopDatatransferService.java @@ -35,7 +35,7 @@ import java.util.function.Supplier; * to enrich it's functionality * * @author Petr Pchelko - * @since 1.9 + * @since 9 */ public interface DesktopDatatransferService { diff --git a/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java b/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java index 09bee025b5f..524fc999ad1 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java +++ b/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java @@ -965,7 +965,7 @@ public class RenderingHints *
    • {@link #VALUE_RESOLUTION_VARIANT_SIZE_FIT} *
    • {@link #VALUE_RESOLUTION_VARIANT_DPI_FIT} * - * @since 1.9 + * @since 9 */ public static final Key KEY_RESOLUTION_VARIANT = SunHints.KEY_RESOLUTION_VARIANT; @@ -976,7 +976,7 @@ public class RenderingHints * of the platform * * @see #KEY_RESOLUTION_VARIANT - * @since 1.9 + * @since 9 */ public static final Object VALUE_RESOLUTION_VARIANT_DEFAULT = SunHints.VALUE_RESOLUTION_VARIANT_DEFAULT; @@ -986,7 +986,7 @@ public class RenderingHints * is always used. * * @see #KEY_RESOLUTION_VARIANT - * @since 1.9 + * @since 9 */ public static final Object VALUE_RESOLUTION_VARIANT_BASE = SunHints.VALUE_RESOLUTION_VARIANT_BASE; @@ -997,7 +997,7 @@ public class RenderingHints * context. * * @see #KEY_RESOLUTION_VARIANT - * @since 1.9 + * @since 9 */ public static final Object VALUE_RESOLUTION_VARIANT_SIZE_FIT = SunHints.VALUE_RESOLUTION_VARIANT_SIZE_FIT; @@ -1007,7 +1007,7 @@ public class RenderingHints * chosen based only on the DPI of the screen. * * @see #KEY_RESOLUTION_VARIANT - * @since 1.9 + * @since 9 */ public static final Object VALUE_RESOLUTION_VARIANT_DPI_FIT = SunHints.VALUE_RESOLUTION_VARIANT_DPI_FIT; diff --git a/jdk/src/java.desktop/share/classes/java/awt/font/NumericShaper.java b/jdk/src/java.desktop/share/classes/java/awt/font/NumericShaper.java index 524d230fdc4..2d486827e3c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/font/NumericShaper.java +++ b/jdk/src/java.desktop/share/classes/java/awt/font/NumericShaper.java @@ -321,12 +321,12 @@ public final class NumericShaper implements java.io.Serializable { MEETEI_MAYEK ('\uabf0', '\uabc0', '\uac00'), /** * The Sinhala range with the Sinhala digits. - * @since 1.9 + * @since 9 */ SINHALA ('\u0de6', '\u0d80', '\u0e00'), /** * The Myanmar Extended-B range with the Myanmar Tai Laing digits. - * @since 1.9 + * @since 9 */ MYANMAR_TAI_LAING ('\ua9f0', '\ua9e0', '\uaa00'); diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/AbstractMultiResolutionImage.java b/jdk/src/java.desktop/share/classes/java/awt/image/AbstractMultiResolutionImage.java index 606661b3e69..5dc41d88d60 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/image/AbstractMultiResolutionImage.java +++ b/jdk/src/java.desktop/share/classes/java/awt/image/AbstractMultiResolutionImage.java @@ -59,7 +59,7 @@ import java.awt.Image; * @see java.awt.Image * @see java.awt.image.MultiResolutionImage * - * @since 1.9 + * @since 9 */ public abstract class AbstractMultiResolutionImage extends java.awt.Image implements MultiResolutionImage { @@ -96,7 +96,7 @@ public abstract class AbstractMultiResolutionImage extends java.awt.Image * * @return the base image of the set of multi-resolution images * - * @since 1.9 + * @since 9 */ protected abstract Image getBaseImage(); } \ No newline at end of file diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/BaseMultiResolutionImage.java b/jdk/src/java.desktop/share/classes/java/awt/image/BaseMultiResolutionImage.java index 653057632a5..fb26bf161fc 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/image/BaseMultiResolutionImage.java +++ b/jdk/src/java.desktop/share/classes/java/awt/image/BaseMultiResolutionImage.java @@ -50,7 +50,7 @@ import java.util.Objects; * @see java.awt.image.MultiResolutionImage * @see java.awt.image.AbstractMultiResolutionImage * - * @since 1.9 + * @since 9 */ public class BaseMultiResolutionImage extends AbstractMultiResolutionImage { @@ -66,7 +66,7 @@ public class BaseMultiResolutionImage extends AbstractMultiResolutionImage { * @throws NullPointerException if the specified {@code resolutionVariants} * contains one or more null elements * - * @since 1.9 + * @since 9 */ public BaseMultiResolutionImage(Image... resolutionVariants) { this(0, resolutionVariants); @@ -86,7 +86,7 @@ public class BaseMultiResolutionImage extends AbstractMultiResolutionImage { * negative or greater than or equal to {@code resolutionVariants} * length. * - * @since 1.9 + * @since 9 */ public BaseMultiResolutionImage(int baseImageIndex, Image... resolutionVariants) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/MultiResolutionImage.java b/jdk/src/java.desktop/share/classes/java/awt/image/MultiResolutionImage.java index 26b4b534d81..f5634823e74 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/image/MultiResolutionImage.java +++ b/jdk/src/java.desktop/share/classes/java/awt/image/MultiResolutionImage.java @@ -52,7 +52,7 @@ import java.util.List; * @see java.awt.Toolkit#getImage(java.lang.String filename) * @see java.awt.Toolkit#getImage(java.net.URL url) * - * @since 1.9 + * @since 9 */ public interface MultiResolutionImage { @@ -67,7 +67,7 @@ public interface MultiResolutionImage { * {@code destImageHeight} is less than or equal to zero, infinity, * or NaN. * - * @since 1.9 + * @since 9 */ Image getResolutionVariant(double destImageWidth, double destImageHeight); @@ -78,7 +78,7 @@ public interface MultiResolutionImage { * Note that many implementations might return an unmodifiable list. *

      * @return list of resolution variants. - * @since 1.9 + * @since 9 */ public List getResolutionVariants(); } \ No newline at end of file diff --git a/jdk/src/java.desktop/share/classes/java/beans/BeanProperty.java b/jdk/src/java.desktop/share/classes/java/beans/BeanProperty.java index a997f1ea9f5..b18aae551ac 100644 --- a/jdk/src/java.desktop/share/classes/java/beans/BeanProperty.java +++ b/jdk/src/java.desktop/share/classes/java/beans/BeanProperty.java @@ -39,7 +39,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; * which does not imply the automatic analysis. * * @see BeanInfo#getPropertyDescriptors - * @since 1.9 + * @since 9 * * @author Sergey A. Malenkov */ diff --git a/jdk/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java b/jdk/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java index 6979827b960..27c3e5e57db 100644 --- a/jdk/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java +++ b/jdk/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java @@ -152,7 +152,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor { * and the {@code value} is the automatically generated property info * @param bound the flag indicating whether it is possible to treat this property as a bound property * - * @since 1.9 + * @since 9 */ IndexedPropertyDescriptor(Entry entry, boolean bound) { super(entry, bound); diff --git a/jdk/src/java.desktop/share/classes/java/beans/JavaBean.java b/jdk/src/java.desktop/share/classes/java/beans/JavaBean.java index 84efb292b14..1a6f870139a 100644 --- a/jdk/src/java.desktop/share/classes/java/beans/JavaBean.java +++ b/jdk/src/java.desktop/share/classes/java/beans/JavaBean.java @@ -39,7 +39,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; * which does not imply the automatic analysis. * * @see BeanInfo#getBeanDescriptor - * @since 1.9 + * @since 9 * * @author Sergey A. Malenkov */ diff --git a/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java b/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java index f82f7f533da..012b495724d 100644 --- a/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java +++ b/jdk/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java @@ -150,7 +150,7 @@ public class PropertyDescriptor extends FeatureDescriptor { * and the {@code value} is the automatically generated property info * @param bound the flag indicating whether it is possible to treat this property as a bound property * - * @since 1.9 + * @since 9 */ PropertyDescriptor(Entry entry, boolean bound) { String base = entry.getKey(); diff --git a/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibilityProvider.java b/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibilityProvider.java index 001b42f15d6..59b8ab18d8d 100644 --- a/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibilityProvider.java +++ b/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibilityProvider.java @@ -43,7 +43,7 @@ package javax.accessibility; * * @see java.awt.Toolkit#getDefaultToolkit * @see java.util.ServiceLoader - * @since 1.9 + * @since 9 */ public abstract class AccessibilityProvider { diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html b/jdk/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html index b2d168b7661..2fc49cfec0f 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html +++ b/jdk/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html @@ -1194,7 +1194,7 @@ The DTD for the TIFF native image metadata format is as follows: ]> -@since 1.9 +@since 9 diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java index fd0e925238b..d434acf8ab3 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java +++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java @@ -55,7 +55,7 @@ import java.util.List; *

    • * * - * @since 1.9 + * @since 9 * @see TIFF 6.0 Specification */ public class BaselineTIFFTagSet extends TIFFTagSet { diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java index af9334daeff..d37a1330d12 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java +++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java @@ -35,7 +35,7 @@ import java.util.List; *

      The definitions of the data types referenced by the field * definitions may be found in the {@link TIFFTag TIFFTag} class. * - * @since 1.9 + * @since 9 * @see ExifTIFFTagSet */ public class ExifGPSTagSet extends TIFFTagSet { diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifInteroperabilityTagSet.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifInteroperabilityTagSet.java index 11654b1d0f6..b2a52790f0b 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifInteroperabilityTagSet.java +++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifInteroperabilityTagSet.java @@ -31,7 +31,7 @@ import java.util.List; /** * A class representing the tags found in an Exif Interoperability IFD. * - * @since 1.9 + * @since 9 * @see ExifTIFFTagSet */ public class ExifInteroperabilityTagSet extends TIFFTagSet { diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifParentTIFFTagSet.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifParentTIFFTagSet.java index faa8c371156..29647711fc4 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifParentTIFFTagSet.java +++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifParentTIFFTagSet.java @@ -34,7 +34,7 @@ import java.util.List; * TIFFImageReadParam.addAllowedTagSet} method if Exif * support is desired. * - * @since 1.9 + * @since 9 */ public class ExifParentTIFFTagSet extends TIFFTagSet { diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java index 13bf8c2614f..5867a0ffef5 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java +++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java @@ -39,7 +39,7 @@ import java.util.List; *

      The definitions of the data types referenced by the field * definitions may be found in the {@link TIFFTag TIFFTag} class. * - * @since 1.9 + * @since 9 */ public class ExifTIFFTagSet extends TIFFTagSet { diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/FaxTIFFTagSet.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/FaxTIFFTagSet.java index 0266e2c7fc0..fa9733cd3f0 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/FaxTIFFTagSet.java +++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/FaxTIFFTagSet.java @@ -31,7 +31,7 @@ import java.util.List; * A class representing the extra tags found in a * TIFF-F (RFC 2036) file. * - * @since 1.9 + * @since 9 */ public class FaxTIFFTagSet extends TIFFTagSet { diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/GeoTIFFTagSet.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/GeoTIFFTagSet.java index 74ecc36beba..c478f7c03e7 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/GeoTIFFTagSet.java +++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/GeoTIFFTagSet.java @@ -39,7 +39,7 @@ import java.util.List; *

      The definitions of the data types referenced by the field * definitions may be found in the {@link TIFFTag TIFFTag} class.

      * - * @since 1.9 + * @since 9 */ public class GeoTIFFTagSet extends TIFFTagSet { diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFDirectory.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFDirectory.java index b2299dd0786..ea13664767c 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFDirectory.java +++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFDirectory.java @@ -95,7 +95,7 @@ import com.sun.imageio.plugins.tiff.TIFFImageMetadata; * or removing TIFFFields or TIFFTagSets, it * must be synchronized externally.

      * - * @since 1.9 + * @since 9 * @see IIOMetadata * @see TIFFField * @see TIFFTag diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java index e393cedb39f..7afc44520f9 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java +++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java @@ -257,7 +257,7 @@ import com.sun.imageio.plugins.tiff.TIFFIFD; * * * - * @since 1.9 + * @since 9 * @see TIFFDirectory * @see TIFFTag */ diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFImageReadParam.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFImageReadParam.java index 8bfe0d59d3a..27f633c7cfd 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFImageReadParam.java +++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFImageReadParam.java @@ -46,7 +46,7 @@ import javax.imageio.ImageReadParam; * ExifParentTIFFTagSet, and GeoTIFFTagSet * are included. * - * @since 1.9 + * @since 9 */ public class TIFFImageReadParam extends ImageReadParam { diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFTag.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFTag.java index 50f06eee8a6..68542c4078d 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFTag.java +++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFTag.java @@ -40,7 +40,7 @@ import java.util.TreeMap; * tiff stream are defined in the {@link BaselineTIFFTagSet * BaselineTIFFTagSet} class. * - * @since 1.9 + * @since 9 * @see BaselineTIFFTagSet * @see TIFFField * @see TIFFTagSet diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFTagSet.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFTagSet.java index 4af5d34e435..8082fba86b8 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFTagSet.java +++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFTagSet.java @@ -44,7 +44,7 @@ import java.util.TreeSet; * name, legal data types, and mnemonic names for some or all of ts * data values. * - * @since 1.9 + * @since 9 * @see TIFFTag */ public class TIFFTagSet { diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/package.html b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/package.html index f13be9e1a6b..1c2153a96a3 100644 --- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/package.html +++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/package.html @@ -46,6 +46,6 @@ specification and usage notes.

      -@since 1.9 +@since 9 diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java index b6fa1b7bd81..883e0c0cf7c 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java @@ -616,7 +616,7 @@ public abstract class JComponent extends Container implements Serializable, * Returns the look and feel delegate that renders this component. * * @return the {@code ComponentUI} object that renders this component - * @since 1.9 + * @since 9 */ @Transient public ComponentUI getUI() { diff --git a/jdk/src/java.desktop/share/classes/javax/swing/SwingContainer.java b/jdk/src/java.desktop/share/classes/javax/swing/SwingContainer.java index bcf78f37360..08eae7f34f6 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/SwingContainer.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/SwingContainer.java @@ -45,7 +45,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; * with the {@code isContainer} attribute allow to directly specify * whether a Swing component is a container or not. * - * @since 1.9 + * @since 9 * * @author Sergey A. Malenkov */ diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java b/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java index b965ccfcbc0..815aee02244 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java @@ -3023,7 +3023,7 @@ public abstract class AbstractDocument implements Document, Serializable { /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public void lockEdit() { @@ -3032,7 +3032,7 @@ public abstract class AbstractDocument implements Document, Serializable { /** * {@inheritDoc} - * @since 1.9 + * @since 9 */ @Override public void unlockEdit() { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DesktopDatatransferServiceImpl.java b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DesktopDatatransferServiceImpl.java index f0727eccf4e..e96ca888ee3 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DesktopDatatransferServiceImpl.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DesktopDatatransferServiceImpl.java @@ -39,7 +39,7 @@ import java.util.function.Supplier; * {@code DesktopDatatransferService} interface. * * @author Petr Pchelko - * @since 1.9 + * @since 9 */ public class DesktopDatatransferServiceImpl implements DesktopDatatransferService { diff --git a/jdk/src/java.desktop/share/classes/sun/swing/text/UndoableEditLockSupport.java b/jdk/src/java.desktop/share/classes/sun/swing/text/UndoableEditLockSupport.java index 43440da0dc8..1e9cb47f6ce 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/text/UndoableEditLockSupport.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/text/UndoableEditLockSupport.java @@ -28,7 +28,7 @@ import javax.swing.undo.UndoableEdit; /** * UndoableEdit support for undo/redo actions synchronization - * @since 1.9 + * @since 9 */ public interface UndoableEditLockSupport extends UndoableEdit { /** diff --git a/jdk/src/java.logging/share/classes/java/util/logging/FileHandler.java b/jdk/src/java.logging/share/classes/java/util/logging/FileHandler.java index 61b0c817818..0778571d3f5 100644 --- a/jdk/src/java.logging/share/classes/java/util/logging/FileHandler.java +++ b/jdk/src/java.logging/share/classes/java/util/logging/FileHandler.java @@ -423,7 +423,7 @@ public class FileHandler extends StreamHandler { * @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}. * @exception IllegalArgumentException if pattern is an empty string * - * @since 1.9 + * @since 9 * */ public FileHandler(String pattern, long limit, int count, boolean append) diff --git a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java index d1c59fc763f..81f3387be8c 100644 --- a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java +++ b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java @@ -2548,7 +2548,7 @@ public class LogManager { * caller does not have LoggingPermission("control"). * @throws NullPointerException if the listener is null. * - * @since 1.9 + * @since 9 */ public LogManager addConfigurationListener(Runnable listener) { final Runnable r = Objects.requireNonNull(listener); @@ -2575,7 +2575,7 @@ public class LogManager { * @throws SecurityException if a security manager exists and if the * caller does not have LoggingPermission("control"). * - * @since 1.9 + * @since 9 */ public void removeConfigurationListener(Runnable listener) { final Runnable key = Objects.requireNonNull(listener); diff --git a/jdk/src/java.logging/share/classes/java/util/logging/LogRecord.java b/jdk/src/java.logging/share/classes/java/util/logging/LogRecord.java index a7bbc761ba7..571a792c4dc 100644 --- a/jdk/src/java.logging/share/classes/java/util/logging/LogRecord.java +++ b/jdk/src/java.logging/share/classes/java/util/logging/LogRecord.java @@ -138,7 +138,7 @@ public class LogRecord implements java.io.Serializable { /** * Event time. - * @since 1.9 + * @since 9 */ private Instant instant; @@ -158,7 +158,7 @@ public class LogRecord implements java.io.Serializable { * The event time instant can be reconstructed using * Instant.ofEpochSecond(millis/1000, (millis % 1000) * 1000_000 + nanoAdjustment) *

      - * Since: 1.9 + * Since: 9 * @serialField thrown Throwable The Throwable (if any) associated with log * message * @serialField loggerName String Name of the source Logger @@ -207,7 +207,7 @@ public class LogRecord implements java.io.Serializable { * The sequence property will be initialized with a new unique value. * These sequence values are allocated in increasing order within a VM. *

      - * Since JDK 1.9, the event time is represented by an {@link Instant}. + * Since JDK 9, the event time is represented by an {@link Instant}. * The instant property will be initialized to the {@linkplain * Instant#now() current instant}, using the best available * {@linkplain Clock#systemUTC() clock} on the system. @@ -505,7 +505,7 @@ public class LogRecord implements java.io.Serializable { * * @return the instant that the event occurred. * - * @since 1.9 + * @since 9 */ public Instant getInstant() { return instant; @@ -525,7 +525,7 @@ public class LogRecord implements java.io.Serializable { * @throws ArithmeticException if numeric overflow would occur while * calling {@link Instant#toEpochMilli() instant.toEpochMilli()}. * - * @since 1.9 + * @since 9 */ public void setInstant(Instant instant) { instant.toEpochMilli(); diff --git a/jdk/src/java.logging/share/classes/java/util/logging/Logger.java b/jdk/src/java.logging/share/classes/java/util/logging/Logger.java index 077b272f3ac..3cc00d0e630 100644 --- a/jdk/src/java.logging/share/classes/java/util/logging/Logger.java +++ b/jdk/src/java.logging/share/classes/java/util/logging/Logger.java @@ -1300,7 +1300,7 @@ public class Logger { * can be {@code null}. * @param msg The string message (or a key in the message catalog) * @param params Parameters to the message (optional, may be none). - * @since 1.9 + * @since 9 */ public void logrb(Level level, ResourceBundle bundle, String msg, Object... params) { if (!isLoggable(level)) { @@ -1417,7 +1417,7 @@ public class Logger { * can be {@code null}. * @param msg The string message (or a key in the message catalog) * @param thrown Throwable associated with the log message. - * @since 1.9 + * @since 9 */ public void logrb(Level level, ResourceBundle bundle, String msg, Throwable thrown) { diff --git a/jdk/src/java.logging/share/classes/sun/util/logging/internal/package-info.java b/jdk/src/java.logging/share/classes/sun/util/logging/internal/package-info.java index 22f45a70959..6fd293300a5 100644 --- a/jdk/src/java.logging/share/classes/sun/util/logging/internal/package-info.java +++ b/jdk/src/java.logging/share/classes/sun/util/logging/internal/package-info.java @@ -50,6 +50,6 @@ * @see sun.util.logging.PlatformLogger.Bridge * @see jdk.internal.logger * - * @since 1.9 + * @since 9 */ package sun.util.logging.internal; diff --git a/jdk/src/java.management/share/classes/java/lang/management/ThreadInfo.java b/jdk/src/java.management/share/classes/java/lang/management/ThreadInfo.java index 5d5515ca9ed..46f92a248e4 100644 --- a/jdk/src/java.management/share/classes/java/lang/management/ThreadInfo.java +++ b/jdk/src/java.management/share/classes/java/lang/management/ThreadInfo.java @@ -590,7 +590,7 @@ public class ThreadInfo { * @return {@code true} if the thread is a daemon thread, * {@code false} otherwise. * @see Thread#isDaemon - * @since 1.9 + * @since 9 */ public boolean isDaemon() { return daemon; @@ -602,7 +602,7 @@ public class ThreadInfo { * * @return The priority of the thread associated with this * {@code ThreadInfo}. - * @since 1.9 + * @since 9 */ public int getPriority() { return priority; diff --git a/jdk/src/java.management/share/classes/javax/management/ConstructorParameters.java b/jdk/src/java.management/share/classes/javax/management/ConstructorParameters.java index d3d447e2a53..7c53794293b 100644 --- a/jdk/src/java.management/share/classes/javax/management/ConstructorParameters.java +++ b/jdk/src/java.management/share/classes/javax/management/ConstructorParameters.java @@ -62,7 +62,7 @@ import static java.lang.annotation.RetentionPolicy.*; * the JMX introspection will give an absolute precedence to the latter one. *

      * - * @since 1.9 + * @since 9 */ @Documented @Target(CONSTRUCTOR) @Retention(RUNTIME) public @interface ConstructorParameters { diff --git a/jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/JdkLDAP.java b/jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/JdkLDAP.java index c44b9a70ed1..10895e8f000 100644 --- a/jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/JdkLDAP.java +++ b/jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/JdkLDAP.java @@ -34,7 +34,7 @@ import java.security.cert.CertStoreParameters; * Provider class for the JdkLDAP provider. * Supports LDAP cert store. * - * @since 1.9 + * @since 9 */ public final class JdkLDAP extends Provider { diff --git a/jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java b/jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java index c64175ec1c7..5d6932420cc 100644 --- a/jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java +++ b/jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java @@ -54,7 +54,7 @@ import sun.security.x509.X500Name; * Core implementation of a LDAP Cert Store. * @see java.security.cert.CertStore * - * @since 1.9 + * @since 9 */ final class LDAPCertStoreImpl { diff --git a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/EncryptionKey.java b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/EncryptionKey.java index 3cd0c9b5055..41af8929e33 100644 --- a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/EncryptionKey.java +++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/EncryptionKey.java @@ -44,7 +44,7 @@ import javax.security.auth.DestroyFailedException; * The key material of an {@code EncryptionKey} is defined as the value * of the {@code keyValue} above. * - * @since 1.9 + * @since 9 */ public final class EncryptionKey implements SecretKey { diff --git a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosCredMessage.java b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosCredMessage.java index ab079b8570b..27c2741d911 100644 --- a/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosCredMessage.java +++ b/jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosCredMessage.java @@ -45,7 +45,7 @@ import java.util.Objects; * } * * - * @since 1.9 + * @since 9 */ public final class KerberosCredMessage implements Destroyable { diff --git a/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/ssl/Krb5KeyExchangeService.java b/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/ssl/Krb5KeyExchangeService.java index 1c9debf40ad..1f6662ddbd2 100644 --- a/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/ssl/Krb5KeyExchangeService.java +++ b/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/ssl/Krb5KeyExchangeService.java @@ -65,7 +65,7 @@ import java.util.Set; /** * The provider for TLS_KRB_ cipher suites. * - * @since 1.9 + * @since 9 */ public class Krb5KeyExchangeService implements ClientKeyExchangeService { diff --git a/jdk/src/java.sql/share/classes/java/sql/Connection.java b/jdk/src/java.sql/share/classes/java/sql/Connection.java index 36c61c930d2..3051c835d17 100644 --- a/jdk/src/java.sql/share/classes/java/sql/Connection.java +++ b/jdk/src/java.sql/share/classes/java/sql/Connection.java @@ -1538,7 +1538,7 @@ throws SQLException; * prior to returning the {@code PooledConnection} back to the cache * * @throws SQLException if an error occurs - * @since 1.9 + * @since 9 * @see endRequest * @see javax.sql.PooledConnection */ @@ -1580,7 +1580,7 @@ throws SQLException; * prior to returning the {@code PooledConnection} back to the cache * * @throws SQLException if an error occurs - * @since 1.9 + * @since 9 * @see beginRequest * @see javax.sql.PooledConnection */ @@ -1614,7 +1614,7 @@ throws SQLException; * this method is called on a closed {@code connection}; or * the {@code timeout} value is less than 0. * @throws SQLFeatureNotSupportedException if the driver does not support sharding - * @since 1.9 + * @since 9 * @see ShardingKey * @see ShardingKeyBuilder */ @@ -1645,7 +1645,7 @@ throws SQLException; * this method is called on a closed {@code connection}; the {@code shardingkey} * is {@code null}; or the {@code timeout} value is less than 0. * @throws SQLFeatureNotSupportedException if the driver does not support sharding - * @since 1.9 + * @since 9 * @see ShardingKey * @see ShardingKeyBuilder */ @@ -1671,7 +1671,7 @@ throws SQLException; * the {@code shardingkey} is {@code null}; or * a {@code superSharedingKey} is specified without a {@code shardingKey} * @throws SQLFeatureNotSupportedException if the driver does not support sharding - * @since 1.9 + * @since 9 * @see ShardingKey * @see ShardingKeyBuilder */ @@ -1694,7 +1694,7 @@ throws SQLException; * this method is called on a closed {@code connection}; or the * {@code shardkingKey} is {@code null} * @throws SQLFeatureNotSupportedException if the driver does not support sharding - * @since 1.9 + * @since 9 * @see ShardingKey * @see ShardingKeyBuilder */ diff --git a/jdk/src/java.sql/share/classes/java/sql/ConnectionBuilder.java b/jdk/src/java.sql/share/classes/java/sql/ConnectionBuilder.java index 9025814a181..b9ddf1606ad 100644 --- a/jdk/src/java.sql/share/classes/java/sql/ConnectionBuilder.java +++ b/jdk/src/java.sql/share/classes/java/sql/ConnectionBuilder.java @@ -49,7 +49,7 @@ package java.sql; * .build(); * } * - * @since 1.9 + * @since 9 * */ public interface ConnectionBuilder { diff --git a/jdk/src/java.sql/share/classes/java/sql/DatabaseMetaData.java b/jdk/src/java.sql/share/classes/java/sql/DatabaseMetaData.java index 6c0e0bb782f..8d8c621506c 100644 --- a/jdk/src/java.sql/share/classes/java/sql/DatabaseMetaData.java +++ b/jdk/src/java.sql/share/classes/java/sql/DatabaseMetaData.java @@ -3694,7 +3694,7 @@ public interface DatabaseMetaData extends Wrapper { * @return {@code true} if this database supports sharding; * {@code false} otherwise * @exception SQLException if a database access error occurs - * @since 1.9 + * @since 9 */ default boolean supportsSharding() throws SQLException { return false; diff --git a/jdk/src/java.sql/share/classes/java/sql/DriverManager.java b/jdk/src/java.sql/share/classes/java/sql/DriverManager.java index 7f74c4c869b..331239e3733 100644 --- a/jdk/src/java.sql/share/classes/java/sql/DriverManager.java +++ b/jdk/src/java.sql/share/classes/java/sql/DriverManager.java @@ -449,7 +449,7 @@ public class DriverManager { * to which the current caller has access. * * @return the stream of JDBC Drivers loaded by the caller's class loader - * @since 1.9 + * @since 9 */ @CallerSensitive public static Stream drivers() { diff --git a/jdk/src/java.sql/share/classes/java/sql/ShardingKey.java b/jdk/src/java.sql/share/classes/java/sql/ShardingKey.java index 6dce0b27d52..db56bee084b 100644 --- a/jdk/src/java.sql/share/classes/java/sql/ShardingKey.java +++ b/jdk/src/java.sql/share/classes/java/sql/ShardingKey.java @@ -69,7 +69,7 @@ package java.sql; * } * * - * @since 1.9 + * @since 9 */ public interface ShardingKey { diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java index c245ec78716..cbc4410907c 100644 --- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java +++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java @@ -35,7 +35,7 @@ import java.io.IOException; * fails in the target VM. If there is a communication error, * a regular IOException will be thrown. * - * @since 1.9 + * @since 9 */ public class AttachOperationFailedException extends IOException { diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/CipherContextRef.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/CipherContextRef.java index 1ecdda7812e..ab42015e20a 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/CipherContextRef.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/CipherContextRef.java @@ -41,7 +41,7 @@ import javax.crypto.spec.IvParameterSpec; /** * Internal class for context resource clean up. * - * @since 1.9 + * @since 9 */ final class CipherContextRef extends PhantomReference implements Comparable { diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/Config.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/Config.java index 7d07103a289..e9abf1a73ec 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/Config.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/Config.java @@ -49,7 +49,7 @@ import sun.security.util.PropertyExpander; * where can be "MessageDigest", "Cipher", etc. and * reprepresents the value that's passed into the various getInstance() calls. * - * @since 1.9 + * @since 9 */ final class Config { diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/GCMParameters.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/GCMParameters.java index fc7ada58e6a..c0aa5db2067 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/GCMParameters.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/GCMParameters.java @@ -48,7 +48,7 @@ import sun.security.util.*; * as possible AES-GCM-ICVlen values, so we allow all 6 values. * * - * @since 1.9 + * @since 9 */ public final class GCMParameters extends AlgorithmParametersSpi { diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipher.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipher.java index af7767924a3..5699b5e734f 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipher.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipher.java @@ -48,7 +48,7 @@ import sun.security.jca.JCAUtil; * - AES/CFB128/NOPADDING * (Support for GCM mode is inside the child class NativeGCMCipher) * - * @since 1.9 + * @since 9 */ class NativeCipher extends CipherSpi { diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipherWithJavaPadding.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipherWithJavaPadding.java index 0bea2d08eb8..4d36710ab0d 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipherWithJavaPadding.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeCipherWithJavaPadding.java @@ -59,7 +59,7 @@ import javax.crypto.spec.IvParameterSpec; * - AES/CBC/PKCS5PADDING * - AES/CFB128/PKCS5PADDING * - * @since 1.9 + * @since 9 */ public class NativeCipherWithJavaPadding extends CipherSpi { diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeDigest.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeDigest.java index 80397ca222f..9c0929a95b2 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeDigest.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeDigest.java @@ -36,7 +36,7 @@ import java.security.*; * MessageDigest implementation class. This class currently supports * MD5, SHA1, SHA256, SHA384, and SHA512 * - * @since 1.9 + * @since 9 */ public abstract class NativeDigest extends MessageDigestSpi implements Cloneable { diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeGCMCipher.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeGCMCipher.java index 10913cb3c06..ca23f877772 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeGCMCipher.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeGCMCipher.java @@ -42,7 +42,7 @@ import sun.security.jca.JCAUtil; * Cipher wrapper class utilizing ucrypto APIs. This class currently supports * - AES/GCM/NoPADDING * - * @since 1.9 + * @since 9 */ class NativeGCMCipher extends NativeCipher { diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeKey.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeKey.java index 69409809860..a4a8866f30b 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeKey.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeKey.java @@ -39,7 +39,7 @@ import java.security.spec.*; * Wrapper class for native keys needed for using ucrypto APIs. * This class currently supports native RSA private/public keys. * - * @since 1.9 + * @since 9 */ abstract class NativeKey implements Key { diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java index 4b4e408e42d..a5b489ec380 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSACipher.java @@ -72,7 +72,7 @@ import sun.security.util.KeyUtil; * - RSA/ECB/NOPADDING * - RSA/ECB/PKCS1PADDING * - * @since 1.9 + * @since 9 */ public class NativeRSACipher extends CipherSpi { // fields set in constructor diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSAKeyFactory.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSAKeyFactory.java index 750cc41bc08..d92a22c61b0 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSAKeyFactory.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSAKeyFactory.java @@ -44,7 +44,7 @@ import java.security.spec.*; * Ucrypto-private KeyFactory class for generating native keys * needed for using ucrypto APIs. * - * @since 1.9 + * @since 9 */ public final class NativeRSAKeyFactory extends KeyFactorySpi { diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java index f1fe8e58c1b..6a2007ae9ef 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java @@ -59,7 +59,7 @@ import java.nio.ByteBuffer; * . SHA384withRSA * . SHA512withRSA * - * @since 1.9 + * @since 9 */ class NativeRSASignature extends SignatureSpi { diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoException.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoException.java index 8ef10f8be67..0ba6c198ed3 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoException.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoException.java @@ -33,7 +33,7 @@ import java.security.ProviderException; * object of this class indicates that a function call to the underlying * native calls returned a value not equal to CRYPTO_SUCCESS. * - * @since 1.9 + * @since 9 */ public final class UcryptoException extends ProviderException { diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoMech.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoMech.java index f1597e3e4a2..cb6b4ffe597 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoMech.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoMech.java @@ -30,7 +30,7 @@ import java.util.HashMap; /** * Enum for representing the ucrypto mechanisms. * - * @since 1.9 + * @since 9 */ // Check /usr/include/libsoftcrypto.h for updates public enum UcryptoMech { diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoProvider.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoProvider.java index 1c976065697..e3595359019 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoProvider.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/UcryptoProvider.java @@ -33,7 +33,7 @@ import java.security.*; /** * OracleUcrypto provider main class. * - * @since 1.9 + * @since 9 */ public final class UcryptoProvider extends Provider { diff --git a/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java index e761a2c9205..a2cb8d70253 100644 --- a/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java +++ b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java @@ -73,7 +73,7 @@ public interface ContentSignerParameters { * Retreives the message digest algorithm that is used to generate * the message imprint to be sent to the TSA server. * - * @since 1.9 + * @since 9 * @return The non-null string of the message digest algorithm name. */ public default String getTSADigestAlg() { diff --git a/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java b/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java index a25ff87513c..d74edd570e8 100644 --- a/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java +++ b/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java @@ -77,7 +77,7 @@ import java.util.zip.ZipOutputStream; * } * * - * @since 1.9 + * @since 9 */ public final class JarSigner { @@ -85,7 +85,7 @@ public final class JarSigner { * A mutable builder class that can create an immutable {@code JarSigner} * from various signing-related parameters. * - * @since 1.9 + * @since 9 */ public static class Builder { diff --git a/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSignerException.java b/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSignerException.java index d1b5449dbef..ded5734a852 100644 --- a/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSignerException.java +++ b/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSignerException.java @@ -28,7 +28,7 @@ package jdk.security.jarsigner; /** * This exception is thrown when {@link JarSigner#sign} fails. * - * @since 1.9 + * @since 9 */ public class JarSignerException extends RuntimeException { diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java b/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java index 4d9290035ef..72e2870532e 100644 --- a/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java @@ -96,7 +96,7 @@ public class VMOption { ERGONOMIC, /** * The VM option was set using the attach framework. - * @since 1.9 + * @since 9 */ ATTACH_ON_DEMAND, /** diff --git a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireType.java b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireType.java index 5ba482dbd6e..6240f0d3ddf 100644 --- a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireType.java +++ b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireType.java @@ -40,7 +40,7 @@ public enum InquireType { *
    • Format: "RAW" *
    • Encoded form: the raw key bytes, not in any ASN.1 encoding * - * @deprecated as of 1.9, replaced by {@link #KRB5_GET_SESSION_KEY_EX} + * @deprecated as of 9, replaced by {@link #KRB5_GET_SESSION_KEY_EX} * which returns an instance of * {@link javax.security.auth.kerberos.EncryptionKey} * that implements the {@link javax.crypto.SecretKey} interface and @@ -53,7 +53,7 @@ public enum InquireType { * established Kerberos 5 security context. The return value is an * instance of {@link javax.security.auth.kerberos.EncryptionKey}. * - * @since 1.9 + * @since 9 */ KRB5_GET_SESSION_KEY_EX, /** @@ -83,7 +83,7 @@ public enum InquireType { * is about to send to an acceptor. The return type is an instance of * {@link javax.security.auth.kerberos.KerberosCredMessage}. * - * @since 1.9 + * @since 9 */ KRB5_GET_KRB_CRED, } diff --git a/jdk/test/lib/testlibrary/ExtendedRobot.java b/jdk/test/lib/testlibrary/ExtendedRobot.java index 1e33c7d0d0c..778cd9e6cd3 100644 --- a/jdk/test/lib/testlibrary/ExtendedRobot.java +++ b/jdk/test/lib/testlibrary/ExtendedRobot.java @@ -48,7 +48,7 @@ import java.awt.event.KeyEvent; * * * @author Dmitriy Ermashov - * @since 1.9 + * @since 9 */ public class ExtendedRobot extends Robot { From 3cc90f5cd6b7a580b2f463fe71ca1eb325505f2d Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Thu, 21 Jan 2016 09:26:13 +0000 Subject: [PATCH 209/228] 8147922: Remove sun.misc.ClassFileTransformer Reviewed-by: alanb, mchung --- .../sun/misc/ClassFileTransformer.java | 79 ------------------- 1 file changed, 79 deletions(-) delete mode 100644 jdk/src/java.base/share/classes/sun/misc/ClassFileTransformer.java diff --git a/jdk/src/java.base/share/classes/sun/misc/ClassFileTransformer.java b/jdk/src/java.base/share/classes/sun/misc/ClassFileTransformer.java deleted file mode 100644 index 06a195987c8..00000000000 --- a/jdk/src/java.base/share/classes/sun/misc/ClassFileTransformer.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package sun.misc; - -import java.util.ArrayList; -import java.util.List; - -/** - * This is an abstract base class originally intended to be called by - * {@code java.lang.ClassLoader} when {@code ClassFormatError} is - * thrown inside {@code defineClass()}. It is no longer hooked into - * {@code ClassLoader} and will be removed in a future release. - * - * @author Stanley Man-Kit Ho - */ - -@Deprecated -public abstract class ClassFileTransformer { - - private static final List transformers - = new ArrayList(); - - /** - * Add the class file transformer object. - * - * @param t Class file transformer instance - */ - public static void add(ClassFileTransformer t) { - synchronized (transformers) { - transformers.add(t); - } - } - - /** - * Get the array of ClassFileTransformer object. - * - * @return ClassFileTransformer object array - */ - public static ClassFileTransformer[] getTransformers() { - synchronized (transformers) { - ClassFileTransformer[] result = new ClassFileTransformer[transformers.size()]; - return transformers.toArray(result); - } - } - - - /** - * Transform a byte array from one to the other. - * - * @param b Byte array - * @param off Offset - * @param len Length of byte array - * @return Transformed byte array - */ - public abstract byte[] transform(byte[] b, int off, int len) - throws ClassFormatError; -} From 08694bb7e1ba77cc4a8eedca74211433d21539d0 Mon Sep 17 00:00:00 2001 From: Rob McKenna Date: Thu, 21 Jan 2016 09:33:23 +0000 Subject: [PATCH 210/228] 8064330: Remove SHA224 from the default support list if SunMSCAPI enabled Reviewed-by: xuelei --- .../ssl/SignatureAndHashAlgorithm.java | 83 ++++++++++--------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java b/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java index 59568562a3c..66192211198 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java @@ -166,13 +166,10 @@ final class SignatureAndHashAlgorithm { // Get supported algorithm collection from an untrusted collection static Collection getSupportedAlgorithms( - AlgorithmConstraints constraints, Collection algorithms ) { Collection supported = new ArrayList<>(); for (SignatureAndHashAlgorithm sigAlg : algorithms) { - if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM && - constraints.permits(SIGNATURE_PRIMITIVE_SET, - sigAlg.algorithm, null)) { + if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM) { supported.add(sigAlg); } } @@ -236,42 +233,30 @@ final class SignatureAndHashAlgorithm { } static SignatureAndHashAlgorithm getPreferableAlgorithm( - Collection algorithms, - String expected, PrivateKey signingKey) { + Collection algorithms, + String expected, PrivateKey signingKey) { - int maxDigestLength = getMaxDigestLength(signingKey); - for (SignatureAndHashAlgorithm algorithm : algorithms) { - int signValue = algorithm.id & 0xFF; - if ((expected == null) || - (expected.equalsIgnoreCase("rsa") && - signValue == SignatureAlgorithm.RSA.value) || - (expected.equalsIgnoreCase("dsa") && - signValue == SignatureAlgorithm.DSA.value) || - (expected.equalsIgnoreCase("ecdsa") && - signValue == SignatureAlgorithm.ECDSA.value) || - (expected.equalsIgnoreCase("ec") && - signValue == SignatureAlgorithm.ECDSA.value)) { - - if (algorithm.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM && - algorithm.hash.length <= maxDigestLength) { - - return algorithm; + if (expected == null && !algorithms.isEmpty()) { + for (SignatureAndHashAlgorithm sigAlg : algorithms) { + if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM) { + return sigAlg; } } + + return null; // no supported algorithm } - return null; - } + if (expected == null ) { + return null; // no expected algorithm, no supported algorithm + } - /* - * Need to check key length to match the length of hash value - */ - private static int getMaxDigestLength(PrivateKey signingKey) { + /* + * Need to check RSA key length to match the length of hash value + */ int maxDigestLength = Integer.MAX_VALUE; - - // only need to check RSA algorithm at present. if (signingKey != null && - "rsa".equalsIgnoreCase(signingKey.getAlgorithm())) { + "rsa".equalsIgnoreCase(signingKey.getAlgorithm()) && + expected.equalsIgnoreCase("rsa")) { /* * RSA keys of 512 bits have been shown to be practically * breakable, it does not make much sense to use the strong @@ -299,7 +284,25 @@ final class SignatureAndHashAlgorithm { // preferable hash algorithm. } - return maxDigestLength; + for (SignatureAndHashAlgorithm algorithm : algorithms) { + int signValue = algorithm.id & 0xFF; + if (expected.equalsIgnoreCase("rsa") && + signValue == SignatureAlgorithm.RSA.value) { + if (algorithm.hash.length <= maxDigestLength) { + return algorithm; + } + } else if ( + (expected.equalsIgnoreCase("dsa") && + signValue == SignatureAlgorithm.DSA.value) || + (expected.equalsIgnoreCase("ecdsa") && + signValue == SignatureAlgorithm.ECDSA.value) || + (expected.equalsIgnoreCase("ec") && + signValue == SignatureAlgorithm.ECDSA.value)) { + return algorithm; + } + } + + return null; } static enum HashAlgorithm { @@ -412,12 +415,14 @@ final class SignatureAndHashAlgorithm { supports(HashAlgorithm.SHA1, SignatureAlgorithm.ECDSA, "SHA1withECDSA", --p); - supports(HashAlgorithm.SHA224, SignatureAlgorithm.DSA, - "SHA224withDSA", --p); - supports(HashAlgorithm.SHA224, SignatureAlgorithm.RSA, - "SHA224withRSA", --p); - supports(HashAlgorithm.SHA224, SignatureAlgorithm.ECDSA, - "SHA224withECDSA", --p); + if (Security.getProvider("SunMSCAPI") == null) { + supports(HashAlgorithm.SHA224, SignatureAlgorithm.DSA, + "SHA224withDSA", --p); + supports(HashAlgorithm.SHA224, SignatureAlgorithm.RSA, + "SHA224withRSA", --p); + supports(HashAlgorithm.SHA224, SignatureAlgorithm.ECDSA, + "SHA224withECDSA", --p); + } supports(HashAlgorithm.SHA256, SignatureAlgorithm.DSA, "SHA256withDSA", --p); From 9ed7f823140cd2dfe979afa51a75c8a999f44ee4 Mon Sep 17 00:00:00 2001 From: Rob McKenna Date: Thu, 21 Jan 2016 10:31:45 +0000 Subject: [PATCH 211/228] 8147931: Incorrect edits for JDK-8064330 Reviewed-by: coffeys --- .../ssl/SignatureAndHashAlgorithm.java | 69 +++++++++---------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java b/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java index 66192211198..8445a665da3 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java @@ -166,10 +166,13 @@ final class SignatureAndHashAlgorithm { // Get supported algorithm collection from an untrusted collection static Collection getSupportedAlgorithms( + AlgorithmConstraints constraints, Collection algorithms ) { Collection supported = new ArrayList<>(); for (SignatureAndHashAlgorithm sigAlg : algorithms) { - if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM) { + if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM && + constraints.permits(SIGNATURE_PRIMITIVE_SET, + sigAlg.algorithm, null)) { supported.add(sigAlg); } } @@ -233,30 +236,42 @@ final class SignatureAndHashAlgorithm { } static SignatureAndHashAlgorithm getPreferableAlgorithm( - Collection algorithms, - String expected, PrivateKey signingKey) { + Collection algorithms, + String expected, PrivateKey signingKey) { - if (expected == null && !algorithms.isEmpty()) { - for (SignatureAndHashAlgorithm sigAlg : algorithms) { - if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM) { - return sigAlg; + int maxDigestLength = getMaxDigestLength(signingKey); + for (SignatureAndHashAlgorithm algorithm : algorithms) { + int signValue = algorithm.id & 0xFF; + if ((expected == null) || + (expected.equalsIgnoreCase("rsa") && + signValue == SignatureAlgorithm.RSA.value) || + (expected.equalsIgnoreCase("dsa") && + signValue == SignatureAlgorithm.DSA.value) || + (expected.equalsIgnoreCase("ecdsa") && + signValue == SignatureAlgorithm.ECDSA.value) || + (expected.equalsIgnoreCase("ec") && + signValue == SignatureAlgorithm.ECDSA.value)) { + + if (algorithm.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM && + algorithm.hash.length <= maxDigestLength) { + + return algorithm; } } - - return null; // no supported algorithm } - if (expected == null ) { - return null; // no expected algorithm, no supported algorithm - } + return null; + } - /* - * Need to check RSA key length to match the length of hash value - */ + /* + * Need to check key length to match the length of hash value + */ + private static int getMaxDigestLength(PrivateKey signingKey) { int maxDigestLength = Integer.MAX_VALUE; + + // only need to check RSA algorithm at present. if (signingKey != null && - "rsa".equalsIgnoreCase(signingKey.getAlgorithm()) && - expected.equalsIgnoreCase("rsa")) { + "rsa".equalsIgnoreCase(signingKey.getAlgorithm())) { /* * RSA keys of 512 bits have been shown to be practically * breakable, it does not make much sense to use the strong @@ -284,25 +299,7 @@ final class SignatureAndHashAlgorithm { // preferable hash algorithm. } - for (SignatureAndHashAlgorithm algorithm : algorithms) { - int signValue = algorithm.id & 0xFF; - if (expected.equalsIgnoreCase("rsa") && - signValue == SignatureAlgorithm.RSA.value) { - if (algorithm.hash.length <= maxDigestLength) { - return algorithm; - } - } else if ( - (expected.equalsIgnoreCase("dsa") && - signValue == SignatureAlgorithm.DSA.value) || - (expected.equalsIgnoreCase("ecdsa") && - signValue == SignatureAlgorithm.ECDSA.value) || - (expected.equalsIgnoreCase("ec") && - signValue == SignatureAlgorithm.ECDSA.value)) { - return algorithm; - } - } - - return null; + return maxDigestLength; } static enum HashAlgorithm { From c0662e94e8f3cd1eb7219cddbcd73e27e6bf3267 Mon Sep 17 00:00:00 2001 From: Artem Smotrakov Date: Thu, 21 Jan 2016 09:15:31 -0800 Subject: [PATCH 212/228] 8138990: Implementation of HTTP Digest authentication may be more flexible Reviewed-by: michaelm --- .../protocol/http/DigestAuthentication.java | 11 +- .../http/HttpURLConnection/DigestAuth.java | 424 ++++++++++++++++++ 2 files changed, 429 insertions(+), 6 deletions(-) create mode 100644 jdk/test/sun/net/www/http/HttpURLConnection/DigestAuth.java diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java index 51268080884..32fe64c609e 100644 --- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java +++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, 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 @@ -30,7 +30,6 @@ import java.net.URL; import java.net.ProtocolException; import java.net.PasswordAuthentication; import java.util.Arrays; -import java.util.StringTokenizer; import java.util.Random; import sun.net.www.HeaderParser; @@ -146,9 +145,9 @@ class DigestAuthentication extends AuthenticationInfo { synchronized void setQop (String qop) { if (qop != null) { - StringTokenizer st = new StringTokenizer (qop, " "); - while (st.hasMoreTokens()) { - if (st.nextToken().equalsIgnoreCase ("auth")) { + String items[] = qop.split(","); + for (String item : items) { + if ("auth".equalsIgnoreCase(item.trim())) { serverQop = true; return; } @@ -163,7 +162,7 @@ class DigestAuthentication extends AuthenticationInfo { synchronized String getNonce () { return nonce;} synchronized void setNonce (String s) { - if (!s.equals(nonce)) { + if (nonce == null || !s.equals(nonce)) { nonce=s; NCcount = 0; redoCachedHA1 = true; diff --git a/jdk/test/sun/net/www/http/HttpURLConnection/DigestAuth.java b/jdk/test/sun/net/www/http/HttpURLConnection/DigestAuth.java new file mode 100644 index 00000000000..11d6729ae21 --- /dev/null +++ b/jdk/test/sun/net/www/http/HttpURLConnection/DigestAuth.java @@ -0,0 +1,424 @@ +/* + * Copyright (c) 2016, 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. + */ + +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.IOException; +import java.io.InputStream; +import java.net.Authenticator; +import java.net.InetSocketAddress; +import java.net.PasswordAuthentication; +import java.net.URL; +import java.net.URLConnection; +import java.util.List; + +/* + * @test + * @bug 8138990 + * @summary Tests for HTTP Digest auth + * The impl maintains a cache for auth info, + * the testcases run in a separate JVM to avoid cache hits + * @run main/othervm DigestAuth good + * @run main/othervm DigestAuth only_nonce + * @run main/othervm DigestAuth sha1 + * @run main/othervm DigestAuth no_header + * @run main/othervm DigestAuth no_nonce + * @run main/othervm DigestAuth no_qop + * @run main/othervm DigestAuth invalid_alg + * @run main/othervm DigestAuth validate_server + * @run main/othervm DigestAuth validate_server_no_qop + */ +public class DigestAuth { + + static final String LOCALHOST = "localhost"; + static final String EXPECT_FAILURE = null; + static final String EXPECT_DIGEST = "Digest"; + static final String REALM = "testrealm@host.com"; + static final String NEXT_NONCE = "40f2e879449675f288476d772627370a"; + + static final String GOOD_WWW_AUTH_HEADER = "Digest " + + "realm=\"testrealm@host.com\", " + + "qop=\"auth,auth-int\", " + + "nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\", " + + "opaque=\"5ccc069c403ebaf9f0171e9517f40e41\""; + + static final String GOOD_WWW_AUTH_HEADER_NO_QOP = "Digest " + + "realm=\"testrealm@host.com\", " + + "nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\", " + + "opaque=\"5ccc069c403ebaf9f0171e9517f40e41\""; + + static final String WWW_AUTH_HEADER_NO_NONCE = "Digest " + + "realm=\"testrealm@host.com\", " + + "qop=\"auth,auth-int\", " + + "opaque=\"5ccc069c403ebaf9f0171e9517f40e41\""; + + static final String WWW_AUTH_HEADER_NO_QOP = "Digest " + + "realm=\"testrealm@host.com\", " + + "nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\", " + + "opaque=\"5ccc069c403ebaf9f0171e9517f40e41\""; + + static final String WWW_AUTH_HEADER_ONLY_NONCE = "Digest " + + "nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\""; + + static final String WWW_AUTH_HEADER_SHA1 = "Digest " + + "nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\", " + + "algorithm=\"SHA1\""; + + static final String WWW_AUTH_HEADER_INVALID_ALGORITHM = "Digest " + + "nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\", " + + "algorithm=\"SHA123\""; + + static final String AUTH_INFO_HEADER_NO_QOP_FIRST = + "nextnonce=\"" + NEXT_NONCE + "\", " + + "rspauth=\"ee85bc4315d8b18757809f1a8b9382d8\""; + + static final String AUTH_INFO_HEADER_NO_QOP_SECOND = + "rspauth=\"12f2fa12841b3775b6054576722446b2\""; + + static final String AUTH_INFO_HEADER_WRONG_DIGEST = + "nextnonce=\"" + NEXT_NONCE + "\", " + + "rspauth=\"7327570c586207eca2afae94fc20903d\", " + + "cnonce=\"0a4f113b\", " + + "nc=00000001, " + + "qop=auth"; + + public static void main(String[] args) throws Exception { + if (args.length == 0) { + throw new RuntimeException("No testcase specified"); + } + String testcase = args[0]; + + // start a local HTTP server + try (LocalHttpServer server = LocalHttpServer.startServer()) { + + // set authenticator + AuthenticatorImpl auth = new AuthenticatorImpl(); + Authenticator.setDefault(auth); + + String url = String.format("http://%s:%d/test/", + LOCALHOST, server.getPort()); + + boolean success = true; + switch (testcase) { + case "good": + // server returns a good WWW-Authenticate header + server.setWWWAuthHeader(GOOD_WWW_AUTH_HEADER); + success = testAuth(url, auth, EXPECT_DIGEST); + if (auth.lastRequestedPrompt == null || + !auth.lastRequestedPrompt.equals(REALM)) { + System.out.println("Unexpected realm: " + + auth.lastRequestedPrompt); + success = false; + } + break; + case "validate_server": + // enable processing Authentication-Info headers + System.setProperty("http.auth.digest.validateServer", + "true"); + + /* Server returns good WWW-Authenticate + * and Authentication-Info headers with wrong digest + */ + server.setWWWAuthHeader(GOOD_WWW_AUTH_HEADER); + server.setAuthInfoHeader(AUTH_INFO_HEADER_WRONG_DIGEST); + success = testAuth(url, auth, EXPECT_FAILURE); + if (auth.lastRequestedPrompt == null || + !auth.lastRequestedPrompt.equals(REALM)) { + System.out.println("Unexpected realm: " + + auth.lastRequestedPrompt); + success = false; + } + break; + case "validate_server_no_qop": + // enable processing Authentication-Info headers + System.setProperty("http.auth.digest.validateServer", + "true"); + + /* Server returns good both WWW-Authenticate + * and Authentication-Info headers without any qop field, + * so that client-nonce should not be taked into account, + * and connection should succeed. + */ + server.setWWWAuthHeader(GOOD_WWW_AUTH_HEADER_NO_QOP); + server.setAuthInfoHeader(AUTH_INFO_HEADER_NO_QOP_FIRST); + success = testAuth(url, auth, EXPECT_DIGEST); + if (auth.lastRequestedPrompt == null || + !auth.lastRequestedPrompt.equals(REALM)) { + System.out.println("Unexpected realm: " + + auth.lastRequestedPrompt); + success = false; + } + + // connect again and check if nextnonce was used + server.setAuthInfoHeader(AUTH_INFO_HEADER_NO_QOP_SECOND); + success &= testAuth(url, auth, EXPECT_DIGEST); + if (!NEXT_NONCE.equals(server.lastRequestedNonce)) { + System.out.println("Unexpected next nonce: " + + server.lastRequestedNonce); + success = false; + } + break; + case "only_nonce": + /* Server returns a good WWW-Authenticate header + * which contains only nonce (no realm set). + * + * Realm from WWW-Authenticate header is passed to + * authenticator which can use it as a prompt + * when it asks a user for credentials. + * + * It's fine if an HTTP client doesn't fail if no realm set, + * and delegates making a decision to authenticator/user. + */ + server.setWWWAuthHeader(WWW_AUTH_HEADER_ONLY_NONCE); + success = testAuth(url, auth, EXPECT_DIGEST); + if (auth.lastRequestedPrompt != null && + !auth.lastRequestedPrompt.trim().isEmpty()) { + System.out.println("Unexpected realm: " + + auth.lastRequestedPrompt); + success = false; + } + break; + case "sha1": + // server returns a good WWW-Authenticate header with SHA-1 + server.setWWWAuthHeader(WWW_AUTH_HEADER_SHA1); + success = testAuth(url, auth, EXPECT_DIGEST); + break; + case "no_header": + // server returns no WWW-Authenticate header + success = testAuth(url, auth, EXPECT_FAILURE); + if (auth.lastRequestedScheme != null) { + System.out.println("Unexpected scheme: " + + auth.lastRequestedScheme); + success = false; + } + break; + case "no_nonce": + // server returns a wrong WWW-Authenticate header (no nonce) + server.setWWWAuthHeader(WWW_AUTH_HEADER_NO_NONCE); + success = testAuth(url, auth, EXPECT_FAILURE); + break; + case "invalid_alg": + // server returns a wrong WWW-Authenticate header + // (invalid hash algorithm) + server.setWWWAuthHeader(WWW_AUTH_HEADER_INVALID_ALGORITHM); + success = testAuth(url, auth, EXPECT_FAILURE); + break; + case "no_qop": + // server returns a good WWW-Authenticate header + // without QOPs + server.setWWWAuthHeader(WWW_AUTH_HEADER_NO_QOP); + success = testAuth(url, auth, EXPECT_DIGEST); + break; + default: + throw new RuntimeException("Unexpected testcase: " + + testcase); + } + + if (!success) { + throw new RuntimeException("Test failed"); + } + } + + System.out.println("Test passed"); + } + + static boolean testAuth(String url, AuthenticatorImpl auth, + String expectedScheme) { + + try { + System.out.printf("Connect to %s, expected auth scheme is '%s'%n", + url, expectedScheme); + load(url); + + if (expectedScheme == null) { + System.out.println("Unexpected successful connection"); + return false; + } + + System.out.printf("Actual auth scheme is '%s'%n", + auth.lastRequestedScheme); + if (!expectedScheme.equalsIgnoreCase(auth.lastRequestedScheme)) { + System.out.println("Unexpected auth scheme"); + return false; + } + } catch (IOException e) { + if (expectedScheme != null) { + System.out.println("Unexpected exception: " + e); + e.printStackTrace(System.out); + return false; + } + System.out.println("Expected exception: " + e); + } + + return true; + } + + static void load(String url) throws IOException { + URLConnection conn = new URL(url).openConnection(); + conn.setUseCaches(false); + try (BufferedReader reader = new BufferedReader( + new InputStreamReader(conn.getInputStream()))) { + + String line = reader.readLine(); + if (line == null) { + throw new IOException("Couldn't read response"); + } + do { + System.out.println(line); + } while ((line = reader.readLine()) != null); + } + } + + private static class AuthenticatorImpl extends Authenticator { + + private String lastRequestedScheme; + private String lastRequestedPrompt; + + @Override + public PasswordAuthentication getPasswordAuthentication() { + lastRequestedScheme = getRequestingScheme(); + lastRequestedPrompt = getRequestingPrompt(); + System.out.println("AuthenticatorImpl: requested " + + lastRequestedScheme); + + return new PasswordAuthentication("Mufasa", + "Circle Of Life".toCharArray()); + } + } + + // local HTTP server which pretends to support HTTP Digest auth + static class LocalHttpServer implements HttpHandler, AutoCloseable { + + private final HttpServer server; + private volatile String wwwAuthHeader = null; + private volatile String authInfoHeader = null; + private volatile String lastRequestedNonce; + + private LocalHttpServer(HttpServer server) { + this.server = server; + } + + void setWWWAuthHeader(String wwwAuthHeader) { + this.wwwAuthHeader = wwwAuthHeader; + } + + void setAuthInfoHeader(String authInfoHeader) { + this.authInfoHeader = authInfoHeader; + } + + static LocalHttpServer startServer() throws IOException { + HttpServer httpServer = HttpServer.create( + new InetSocketAddress(0), 0); + LocalHttpServer localHttpServer = new LocalHttpServer(httpServer); + localHttpServer.start(); + + return localHttpServer; + } + + void start() { + server.createContext("/test", this); + server.start(); + System.out.println("HttpServer: started on port " + getPort()); + } + + void stop() { + server.stop(0); + System.out.println("HttpServer: stopped"); + } + + int getPort() { + return server.getAddress().getPort(); + } + + @Override + public void handle(HttpExchange t) throws IOException { + System.out.println("HttpServer: handle connection"); + + // read a request + try (InputStream is = t.getRequestBody()) { + while (is.read() > 0); + } + + try { + List headers = t.getRequestHeaders() + .get("Authorization"); + String header = ""; + if (headers != null && !headers.isEmpty()) { + header = headers.get(0).trim().toLowerCase(); + } + if (header.startsWith("digest")) { + if (authInfoHeader != null) { + t.getResponseHeaders().add("Authentication-Info", + authInfoHeader); + } + lastRequestedNonce = findParameter(header, "nonce"); + byte[] output = "hello".getBytes(); + t.sendResponseHeaders(200, output.length); + t.getResponseBody().write(output); + System.out.println("HttpServer: return 200"); + } else { + if (wwwAuthHeader != null) { + t.getResponseHeaders().add( + "WWW-Authenticate", wwwAuthHeader); + } + byte[] output = "forbidden".getBytes(); + t.sendResponseHeaders(401, output.length); + t.getResponseBody().write(output); + System.out.println("HttpServer: return 401"); + } + } catch (IOException e) { + System.out.println("HttpServer: exception: " + e); + System.out.println("HttpServer: return 500"); + t.sendResponseHeaders(500, 0); + } finally { + t.close(); + } + } + + private static String findParameter(String header, String name) { + name = name.toLowerCase(); + if (header != null) { + String[] params = header.split("\\s"); + for (String param : params) { + param = param.trim().toLowerCase(); + if (param.startsWith(name)) { + String[] parts = param.split("="); + if (parts.length > 1) { + return parts[1] + .replaceAll("\"", "").replaceAll(",", ""); + } + } + } + } + return null; + } + + @Override + public void close() { + stop(); + } + } +} From 4b50f0d923f3584cace7bf316c82dcfa0455d12c Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 21 Jan 2016 09:46:03 -0800 Subject: [PATCH 213/228] Added tag jdk-9+102 for changeset 93b315c61ca3 --- jdk/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/.hgtags b/jdk/.hgtags index 20eb3f6d94f..9f1d47685fb 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -344,3 +344,4 @@ f86ee68d1107dad41a27efc34306e0e56244a12e jdk-9+98 e1a789be1535741274c9779f4d4ca3495196b5c3 jdk-9+99 3d452840f48299a36842760d17c0c8402f0e1266 jdk-9+100 5e8370fb3ed925335164afe340d1e54beab2d4d5 jdk-9+101 +6eb3c8132e489dab81adde4ce29844904ce15482 jdk-9+102 From 05f72555a985e37f5dabb9cfd03a614916d61774 Mon Sep 17 00:00:00 2001 From: Alejandro Murillo Date: Thu, 21 Jan 2016 13:51:58 -0800 Subject: [PATCH 214/228] 8147985: Exclude sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java on jdk9/dev Reviewed-by: dsamersoff --- jdk/test/ProblemList.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 87f567f2e49..08a1eb94c28 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -159,6 +159,9 @@ javax/management/MBeanServer/OldMBeanServerTest.java aix-all # 8042215 javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java generic-all +# 8147985 +sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java generic-all + ############################################################################ # jdk_net From fa2f8f2716c7a666847757a10402ceb5bbfcd9f3 Mon Sep 17 00:00:00 2001 From: Felix Yang Date: Fri, 22 Jan 2016 13:26:56 +0000 Subject: [PATCH 215/228] 8133035: test/com/sun/jndi/dns/IPv6NameserverPlatformParsingTest.java fails to compile Reviewed-by: alanb --- jdk/test/com/sun/jndi/dns/Test6991580.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jdk/test/com/sun/jndi/dns/Test6991580.java b/jdk/test/com/sun/jndi/dns/Test6991580.java index d0b065f794c..b06f78a23de 100644 --- a/jdk/test/com/sun/jndi/dns/Test6991580.java +++ b/jdk/test/com/sun/jndi/dns/Test6991580.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, 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 @@ -32,9 +32,10 @@ import java.awt.event.ActionListener; /** * @test - * @bug 6991580 8080108 + * @bug 6991580 8080108 8133035 * @requires os.family != "windows" * @summary IPv6 Nameservers in resolv.conf throws NumberFormatException + * @modules jdk.naming.dns/com.sun.jndi.dns * @build IPv6NameserverPlatformParsingTest * @run main/manual Test6991580 */ From 4f725a93a857c419afb26b785342cc1ac9379484 Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Fri, 22 Jan 2016 17:43:21 +0000 Subject: [PATCH 216/228] 8147857: RMIConnector logs attribute names incorrectly Fix order of arguments to Collectors.joining Reviewed-by: andrew, dfuchs, jbachorik --- .../management/remote/rmi/RMIConnector.java | 2 +- .../remote/mandatory/connection/Name.java | 49 ++++++ .../mandatory/connection/NameMBean.java | 31 ++++ .../RMIConnectorLogAttributesTest.java | 163 ++++++++++++++++++ .../mandatory/connection/TestLogHandler.java | 64 +++++++ 5 files changed, 308 insertions(+), 1 deletion(-) create mode 100644 jdk/test/javax/management/remote/mandatory/connection/Name.java create mode 100644 jdk/test/javax/management/remote/mandatory/connection/NameMBean.java create mode 100644 jdk/test/javax/management/remote/mandatory/connection/RMIConnectorLogAttributesTest.java create mode 100644 jdk/test/javax/management/remote/mandatory/connection/TestLogHandler.java diff --git a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java index bb4057db54a..5fdcd54ea78 100644 --- a/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java +++ b/jdk/src/java.management/share/classes/javax/management/remote/rmi/RMIConnector.java @@ -2250,7 +2250,7 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable return attributes != null ? attributes.asList().stream() .map(Attribute::getName) - .collect(Collectors.joining("[", ", ", "]")) + .collect(Collectors.joining(", ", "[", "]")) : "[]"; } } diff --git a/jdk/test/javax/management/remote/mandatory/connection/Name.java b/jdk/test/javax/management/remote/mandatory/connection/Name.java new file mode 100644 index 00000000000..16b8ba0124a --- /dev/null +++ b/jdk/test/javax/management/remote/mandatory/connection/Name.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2016, 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 + * 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. + */ + +public class Name implements NameMBean { + + private String firstName; + private String lastName; + + @Override + public String getFirstName() { + return firstName; + } + + @Override + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + @Override + public String getLastName() { + return lastName; + } + + @Override + public void setLastName(String lastName) { + this.lastName = lastName; + } + +} diff --git a/jdk/test/javax/management/remote/mandatory/connection/NameMBean.java b/jdk/test/javax/management/remote/mandatory/connection/NameMBean.java new file mode 100644 index 00000000000..0ad8d9533c2 --- /dev/null +++ b/jdk/test/javax/management/remote/mandatory/connection/NameMBean.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2016, 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 + * 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. + */ + +public interface NameMBean { + + String getFirstName(); + void setFirstName(String firstName); + + String getLastName(); + void setLastName(String lastName); +} diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorLogAttributesTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorLogAttributesTest.java new file mode 100644 index 00000000000..2284180d95b --- /dev/null +++ b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorLogAttributesTest.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2016, 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 + * 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. + */ + +import java.io.IOException; +import java.lang.management.ManagementFactory; +import java.net.ServerSocket; +import java.rmi.registry.LocateRegistry; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.management.Attribute; +import javax.management.AttributeList; +import javax.management.AttributeNotFoundException; +import javax.management.InstanceAlreadyExistsException; +import javax.management.InstanceNotFoundException; +import javax.management.InvalidAttributeValueException; +import javax.management.MBeanException; +import javax.management.MBeanRegistrationException; +import javax.management.MBeanServer; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.NotCompliantMBeanException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXConnectorServer; +import javax.management.remote.JMXConnectorServerFactory; +import javax.management.remote.JMXServiceURL; + +/** + * @test + * @bug 8147857 + * @summary Tests whether RMIConnector logs attribute names correctly. + * @author Severin Gehwolf + */ +public class RMIConnectorLogAttributesTest { + + private static final String ILLEGAL = ", FirstName[LastName]"; + private static final Logger logger = Logger.getLogger("javax.management.remote.rmi"); + private static final String ANY_NAME = "foo"; + private static final TestLogHandler handler; + static { + handler = new TestLogHandler(ILLEGAL); + handler.setLevel(Level.FINEST); + logger.setLevel(Level.ALL); + logger.addHandler(handler); + } + + private JMXConnectorServer startServer(int rmiPort) throws Exception { + System.out.println("DEBUG: Create RMI registry on port " + rmiPort); + LocateRegistry.createRegistry(rmiPort); + + MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + + HashMap env = new HashMap(); + + JMXServiceURL url = + new JMXServiceURL("service:jmx:rmi:///jndi/rmi://127.0.0.1:" + rmiPort + "/jmxrmi"); + JMXConnectorServer cs = + JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs); + + cs.start(); + System.out.println("DEBUG: Started the RMI connector server"); + return cs; + } + + private int findPort() { + for (int i = 13333; i < 13333 + 100; i++) { + try { + ServerSocket socket = new ServerSocket(i); + socket.close(); + return i; + } catch (IOException e) { + continue; + } + } + return -1; + } + + private void runTest() { + int rmiPort = findPort(); + if (rmiPort == -1) { + throw new RuntimeException("Test failed. No available port"); + } + JMXConnectorServer server = null; + try { + server = startServer(rmiPort); + JMXConnector connector = connectToServer(server); + doTest(connector); + } catch (Exception e) { + throw new RuntimeException("Test failed unexpectedly", e); + } finally { + if (server != null) { + try { + server.stop(); + } catch (IOException e) { + // ignore + } + } + } + } + + private JMXConnector connectToServer(JMXConnectorServer server) throws IOException, MalformedObjectNameException, NullPointerException, InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException, ReflectionException, MBeanException { + JMXServiceURL url = server.getAddress(); + Map env = new HashMap(); + JMXConnector connector = JMXConnectorFactory.connect(url, env); + + System.out.println("DEBUG: Client connected to RMI at: " + url); + + return connector; + } + + private void doTest(JMXConnector connector) throws IOException, + MalformedObjectNameException, ReflectionException, + InstanceAlreadyExistsException, MBeanRegistrationException, + MBeanException, NotCompliantMBeanException, InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException { + MBeanServerConnection mbsc = connector.getMBeanServerConnection(); + + + ObjectName objName = new ObjectName("com.redhat.test.jmx:type=NameMBean"); + System.out.println("DEBUG: Calling createMBean"); + mbsc.createMBean(Name.class.getName(), objName); + + System.out.println("DEBUG: Calling setAttributes"); + AttributeList attList = new AttributeList(); + attList.add(new Attribute("FirstName", ANY_NAME)); + attList.add(new Attribute("LastName", ANY_NAME)); + mbsc.setAttributes(objName, attList); + } + + public static void main(String[] args) throws Exception { + RMIConnectorLogAttributesTest test = new RMIConnectorLogAttributesTest(); + test.runTest(); + if (handler.testFailed()) { + throw new RuntimeException("Test failed. Logged incorrect: '" + ILLEGAL + "'"); + } + System.out.println("Test passed!"); + } + +} diff --git a/jdk/test/javax/management/remote/mandatory/connection/TestLogHandler.java b/jdk/test/javax/management/remote/mandatory/connection/TestLogHandler.java new file mode 100644 index 00000000000..2fe48eb1d0c --- /dev/null +++ b/jdk/test/javax/management/remote/mandatory/connection/TestLogHandler.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2016, 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 + * 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. + */ + +import java.util.logging.Handler; +import java.util.logging.LogRecord; + +public class TestLogHandler extends Handler { + + private final String illegal; + private boolean testFailed; + + public TestLogHandler(String illegal) { + this.illegal = illegal; + this.testFailed = false; + } + + @Override + public void publish(LogRecord record) { + String msg = record.getMessage(); + String method = record.getSourceMethodName(); + String className = record.getSourceClassName(); + if (msg.contains(illegal)) { + testFailed = true; + } + if (msg.contains("attribute names=")) { + System.err.println("LOG: " + className + "." + method + ": " + msg); + } + } + + @Override + public void flush() { + // nothing + } + + @Override + public void close() throws SecurityException { + // nothing + } + + public boolean testFailed() { + return testFailed; + } + +} From bbf1451c7eaa29fcf24115310e7af19b0a253f00 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Fri, 22 Jan 2016 12:44:32 -0800 Subject: [PATCH 217/228] 8147545: Remove sun.misc.ManagedLocalsThread from java.prefs Replace ManagedLocalsThread with Thread(null,null,threadName,0,false) Reviewed-by: chegar --- .../classes/java/util/prefs/MacOSXPreferencesFile.java | 6 +++--- .../classes/java/util/prefs/AbstractPreferences.java | 9 ++++++--- .../classes/java/util/prefs/FileSystemPreferences.java | 6 +++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/jdk/src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java b/jdk/src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java index dc54a0d539b..3bf9db1a7e2 100644 --- a/jdk/src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java +++ b/jdk/src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ import java.util.Iterator; import java.util.Timer; import java.util.TimerTask; import java.lang.ref.WeakReference; -import sun.misc.ManagedLocalsThread; /* @@ -344,7 +343,8 @@ class MacOSXPreferencesFile { { if (timer == null) { timer = new Timer(true); // daemon - Thread flushThread = new ManagedLocalsThread() { + Thread flushThread = + new Thread(null, null, "Flush Thread", 0, false) { @Override public void run() { flushWorld(); diff --git a/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java b/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java index 39f65522b6c..74f7d9e94b2 100644 --- a/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java +++ b/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -29,7 +29,6 @@ import java.util.*; import java.io.*; import java.security.AccessController; import java.security.PrivilegedAction; -import sun.misc.ManagedLocalsThread; // These imports needed only as a workaround for a JavaDoc bug import java.lang.Integer; import java.lang.Long; @@ -1515,7 +1514,11 @@ public abstract class AbstractPreferences extends Preferences { * A single background thread ("the event notification thread") monitors * the event queue and delivers events that are placed on the queue. */ - private static class EventDispatchThread extends ManagedLocalsThread { + private static class EventDispatchThread extends Thread { + private EventDispatchThread() { + super(null, null, "Event Dispatch Thread", 0, false); + } + public void run() { while(true) { // Wait on eventQueue till an event is present diff --git a/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java b/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java index 10188cc98c5..1f9ce97cb93 100644 --- a/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java +++ b/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -30,7 +30,6 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; -import sun.misc.ManagedLocalsThread; import sun.util.logging.PlatformLogger; /** @@ -443,7 +442,8 @@ class FileSystemPreferences extends AbstractPreferences { // Add shutdown hook to flush cached prefs on normal termination AccessController.doPrivileged(new PrivilegedAction() { public Void run() { - Runtime.getRuntime().addShutdownHook(new ManagedLocalsThread() { + Runtime.getRuntime().addShutdownHook( + new Thread(null, null, "Sync Timer Thread", 0, false) { public void run() { syncTimer.cancel(); syncWorld(); From 0e9196c50f4dc534e9d7c0b762efc4f1f88d6e70 Mon Sep 17 00:00:00 2001 From: Martin Buchholz Date: Fri, 8 Jan 2016 19:53:36 -0800 Subject: [PATCH 218/228] 8146568: NegativeArraySizeException in ArrayList.grow(int) Improve management of internal array Reviewed-by: smarks --- .../share/classes/java/util/ArrayList.java | 155 ++++++++----- .../java/util/ArrayList/ArrayManagement.java | 212 ++++++++++++++++++ jdk/test/java/util/ArrayList/Bug8146568.java | 43 ++++ 3 files changed, 350 insertions(+), 60 deletions(-) create mode 100644 jdk/test/java/util/ArrayList/ArrayManagement.java create mode 100644 jdk/test/java/util/ArrayList/Bug8146568.java diff --git a/jdk/src/java.base/share/classes/java/util/ArrayList.java b/jdk/src/java.base/share/classes/java/util/ArrayList.java index 6afb4338350..fca4ae228f3 100644 --- a/jdk/src/java.base/share/classes/java/util/ArrayList.java +++ b/jdk/src/java.base/share/classes/java/util/ArrayList.java @@ -207,39 +207,19 @@ public class ArrayList extends AbstractList * necessary, to ensure that it can hold at least the number of elements * specified by the minimum capacity argument. * - * @param minCapacity the desired minimum capacity + * @param minCapacity the desired minimum capacity */ public void ensureCapacity(int minCapacity) { - int minExpand = (elementData != DEFAULTCAPACITY_EMPTY_ELEMENTDATA) - // any size if not default element table - ? 0 - // larger than default for default empty table. It's already - // supposed to be at default size. - : DEFAULT_CAPACITY; - - if (minCapacity > minExpand) { - ensureExplicitCapacity(minCapacity); - } - } - - private void ensureCapacityInternal(int minCapacity) { - if (elementData == DEFAULTCAPACITY_EMPTY_ELEMENTDATA) { - minCapacity = Math.max(DEFAULT_CAPACITY, minCapacity); - } - - ensureExplicitCapacity(minCapacity); - } - - private void ensureExplicitCapacity(int minCapacity) { - modCount++; - - // overflow-conscious code - if (minCapacity - elementData.length > 0) + if (minCapacity > elementData.length + && !(elementData == DEFAULTCAPACITY_EMPTY_ELEMENTDATA + && minCapacity <= DEFAULT_CAPACITY)) { + modCount++; grow(minCapacity); + } } /** - * The maximum size of array to allocate. + * The maximum size of array to allocate (unless necessary). * Some VMs reserve some header words in an array. * Attempts to allocate larger arrays may result in * OutOfMemoryError: Requested array size exceeds VM limit @@ -251,25 +231,48 @@ public class ArrayList extends AbstractList * number of elements specified by the minimum capacity argument. * * @param minCapacity the desired minimum capacity + * @throws OutOfMemoryError if minCapacity is less than zero */ - private void grow(int minCapacity) { + private Object[] grow(int minCapacity) { + return elementData = Arrays.copyOf(elementData, + newCapacity(minCapacity)); + } + + private Object[] grow() { + return grow(size + 1); + } + + /** + * Returns a capacity at least as large as the given minimum capacity. + * Returns the current capacity increased by 50% if that suffices. + * Will not return a capacity greater than MAX_ARRAY_SIZE unless + * the given minimum capacity is greater than MAX_ARRAY_SIZE. + * + * @param minCapacity the desired minimum capacity + * @throws OutOfMemoryError if minCapacity is less than zero + */ + private int newCapacity(int minCapacity) { // overflow-conscious code int oldCapacity = elementData.length; int newCapacity = oldCapacity + (oldCapacity >> 1); - if (newCapacity - minCapacity < 0) - newCapacity = minCapacity; - if (newCapacity - MAX_ARRAY_SIZE > 0) - newCapacity = hugeCapacity(minCapacity); - // minCapacity is usually close to size, so this is a win: - elementData = Arrays.copyOf(elementData, newCapacity); + if (newCapacity - minCapacity <= 0) { + if (elementData == DEFAULTCAPACITY_EMPTY_ELEMENTDATA) + return Math.max(DEFAULT_CAPACITY, minCapacity); + if (minCapacity < 0) // overflow + throw new OutOfMemoryError(); + return minCapacity; + } + return (newCapacity - MAX_ARRAY_SIZE <= 0) + ? newCapacity + : hugeCapacity(minCapacity); } private static int hugeCapacity(int minCapacity) { if (minCapacity < 0) // overflow throw new OutOfMemoryError(); - return (minCapacity > MAX_ARRAY_SIZE) ? - Integer.MAX_VALUE : - MAX_ARRAY_SIZE; + return (minCapacity > MAX_ARRAY_SIZE) + ? Integer.MAX_VALUE + : MAX_ARRAY_SIZE; } /** @@ -451,6 +454,18 @@ public class ArrayList extends AbstractList return oldValue; } + /** + * This helper method split out from add(E) to keep method + * bytecode size under 35 (the -XX:MaxInlineSize default value), + * which helps when add(E) is called in a C1-compiled loop. + */ + private void add(E e, Object[] elementData, int s) { + if (s == elementData.length) + elementData = grow(); + elementData[s] = e; + size = s + 1; + } + /** * Appends the specified element to the end of this list. * @@ -458,8 +473,8 @@ public class ArrayList extends AbstractList * @return {@code true} (as specified by {@link Collection#add}) */ public boolean add(E e) { - ensureCapacityInternal(size + 1); // Increments modCount!! - elementData[size++] = e; + modCount++; + add(e, elementData, size); return true; } @@ -474,12 +489,16 @@ public class ArrayList extends AbstractList */ public void add(int index, E element) { rangeCheckForAdd(index); - - ensureCapacityInternal(size + 1); // Increments modCount!! - System.arraycopy(elementData, index, elementData, index + 1, - size - index); + modCount++; + final int s; + Object[] elementData; + if ((s = size) == (elementData = this.elementData).length) + elementData = grow(); + System.arraycopy(elementData, index, + elementData, index + 1, + s - index); elementData[index] = element; - size++; + size = s + 1; } /** @@ -578,11 +597,17 @@ public class ArrayList extends AbstractList */ public boolean addAll(Collection c) { Object[] a = c.toArray(); + modCount++; int numNew = a.length; - ensureCapacityInternal(size + numNew); // Increments modCount - System.arraycopy(a, 0, elementData, size, numNew); - size += numNew; - return numNew != 0; + if (numNew == 0) + return false; + Object[] elementData; + final int s; + if (numNew > (elementData = this.elementData).length - (s = size)) + elementData = grow(s + numNew); + System.arraycopy(a, 0, elementData, s, numNew); + size = s + numNew; + return true; } /** @@ -604,17 +629,23 @@ public class ArrayList extends AbstractList rangeCheckForAdd(index); Object[] a = c.toArray(); + modCount++; int numNew = a.length; - ensureCapacityInternal(size + numNew); // Increments modCount + if (numNew == 0) + return false; + Object[] elementData; + final int s; + if (numNew > (elementData = this.elementData).length - (s = size)) + elementData = grow(s + numNew); - int numMoved = size - index; + int numMoved = s - index; if (numMoved > 0) - System.arraycopy(elementData, index, elementData, index + numNew, + System.arraycopy(elementData, index, + elementData, index + numNew, numMoved); - System.arraycopy(a, 0, elementData, index, numNew); - size += numNew; - return numNew != 0; + size = s + numNew; + return true; } /** @@ -786,7 +817,6 @@ public class ArrayList extends AbstractList */ private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { - elementData = EMPTY_ELEMENTDATA; // Read in size, and any hidden stuff s.defaultReadObject(); @@ -795,14 +825,19 @@ public class ArrayList extends AbstractList s.readInt(); // ignored if (size > 0) { - // be like clone(), allocate array based upon size not capacity - ensureCapacityInternal(size); + // like clone(), allocate array based upon size not capacity + Object[] elements = new Object[size]; - Object[] a = elementData; // Read in all elements in the proper order. - for (int i=0; i list) { + try { + return (Object[]) ELEMENT_DATA.get(list); + } catch (ReflectiveOperationException huh) { + throw new AssertionError(huh); + } + } + + static int modCount(ArrayList list) { + try { + return MODCOUNT.getInt(list); + } catch (ReflectiveOperationException huh) { + throw new AssertionError(huh); + } + } + + static int capacity(ArrayList list) { + return elementData(list).length; + } + + static int newCapacity(int oldCapacity) { + return oldCapacity + (oldCapacity >> 1); + } + + static void ensureCapacity(ArrayList list, int capacity) { + int oldCapacity = capacity(list); + int oldModCount = modCount(list); + list.ensureCapacity(capacity); + assertEquals(modCount(list), + (capacity(list) == oldCapacity) + ? oldModCount + : oldModCount + 1); + } + + static List singletonList() { + return Collections.singletonList(Boolean.TRUE); + } + + /** Opportunistically randomly test various add operations. */ + static void addOneElement(ArrayList list) { + int size = list.size(); + int modCount = modCount(list); + switch (rnd.nextInt(4)) { + case 0: assertTrue(list.add(Boolean.TRUE)); break; + case 1: list.add(size, Boolean.TRUE); break; + case 2: assertTrue(list.addAll(singletonList())); break; + case 3: assertTrue(list.addAll(size, singletonList())); break; + default: throw new AssertionError(); + } + assertEquals(modCount(list), modCount + 1); + assertEquals(list.size(), size + 1); + } + + @Test public void defaultCapacity() { + ArrayList list = new ArrayList<>(); + assertEquals(capacity(new ArrayList()), 0); + for (int i = 0; i < DEFAULT_CAPACITY; i++) { + addOneElement(list); + assertEquals(capacity(list), DEFAULT_CAPACITY); + } + addOneElement(list); + assertEquals(capacity(list), newCapacity(DEFAULT_CAPACITY)); + } + + @Test public void defaultCapacityEnsureCapacity() { + ArrayList list = new ArrayList<>(); + for (int i = 0; i <= DEFAULT_CAPACITY; i++) { + ensureCapacity(list, i); // no-op! + assertEquals(capacity(list), 0); + } + for (int i = 0; i < DEFAULT_CAPACITY; i++) { + addOneElement(list); + assertEquals(capacity(list), DEFAULT_CAPACITY); + } + addOneElement(list); + assertEquals(capacity(list), newCapacity(DEFAULT_CAPACITY)); + { + int capacity = capacity(list); + ensureCapacity(list, capacity + 1); + assertEquals(capacity(list), newCapacity(capacity)); + } + { + int capacity = capacity(list); + ensureCapacity(list, 3 * capacity); + assertEquals(capacity(list), 3 * capacity); + } + } + + @Test public void ensureCapacityBeyondDefaultCapacity() { + ArrayList list = new ArrayList<>(); + list.ensureCapacity(DEFAULT_CAPACITY + 1); + assertEquals(capacity(list), DEFAULT_CAPACITY + 1); + for (int i = 0; i < DEFAULT_CAPACITY + 1; i++) { + addOneElement(list); + assertEquals(capacity(list), DEFAULT_CAPACITY + 1); + } + addOneElement(list); + assertEquals(capacity(list), newCapacity(DEFAULT_CAPACITY + 1)); + } + + @Test public void explicitZeroCapacity() { + ArrayList list = new ArrayList<>(0); + assertEquals(capacity(list), 0); + addOneElement(list); + assertEquals(capacity(list), 1); + addOneElement(list); + assertEquals(capacity(list), 2); + addOneElement(list); + assertEquals(capacity(list), 3); + addOneElement(list); + assertEquals(capacity(list), 4); + addOneElement(list); + assertEquals(capacity(list), 6); + addOneElement(list); + assertEquals(capacity(list), 6); + addOneElement(list); + assertEquals(capacity(list), 9); + list.clear(); + assertEquals(capacity(list), 9); + } + + @Test public void explicitLargeCapacity() { + int n = DEFAULT_CAPACITY * 3; + ArrayList list = new ArrayList<>(n); + assertEquals(capacity(list), n); + ensureCapacity(list, 0); + ensureCapacity(list, n); + for (int i = 0; i < n; i++) addOneElement(list); + assertEquals(capacity(list), n); + + addOneElement(list); + assertEquals(capacity(list), newCapacity(n)); + } + + @Test public void emptyArraysAreShared() { + assertSame(elementData(new ArrayList()), + elementData(new ArrayList())); + assertSame(elementData(new ArrayList(0)), + elementData(new ArrayList(0))); + } + + @Test public void emptyArraysDifferBetweenDefaultAndExplicit() { + assertNotSame(elementData(new ArrayList()), + elementData(new ArrayList(0))); + } + + @Test public void negativeCapacity() { + for (int capacity : new int[] { -1, Integer.MIN_VALUE }) { + try { + new ArrayList(capacity); + fail("should throw"); + } catch (IllegalArgumentException success) {} + } + } +} diff --git a/jdk/test/java/util/ArrayList/Bug8146568.java b/jdk/test/java/util/ArrayList/Bug8146568.java new file mode 100644 index 00000000000..e20cba5bcbe --- /dev/null +++ b/jdk/test/java/util/ArrayList/Bug8146568.java @@ -0,0 +1,43 @@ +/* + * Copyright 2016 Google, Inc. 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 8146568 + * @summary repro for: NegativeArraySizeException in ArrayList.grow(int) + * @run main/othervm -Xmx17g Bug8146568 + * @ignore This test has huge memory requirements + */ + +public class Bug8146568 { + public static void main(String[] args) { + int size = Integer.MAX_VALUE - 2; + java.util.ArrayList huge = new java.util.ArrayList<>(size); + for (int i = 0; i < size; i++) + huge.add(null); + try { + huge.addAll(huge); + throw new Error("expected OutOfMemoryError not thrown"); + } catch (OutOfMemoryError success) {} + } +} From d1460d5224833ed365c38a04bcd04e740fcc15b6 Mon Sep 17 00:00:00 2001 From: Alejandro Murillo Date: Wed, 13 Jan 2016 12:45:36 -0800 Subject: [PATCH 219/228] 8146660: Resolve merge issue in resulting from sun.misc.VM move to jdk.internal.misc Reviewed-by: twisti, erikj, chegar --- hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk | 1 + .../src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk index 969330eec19..cfcf9329a3d 100644 --- a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk +++ b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk @@ -69,6 +69,7 @@ $(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) \ $(eval $(call ListPathsSafely,PROC_SRCS,$(@D)/_gensrc_proc_files)) $(JAVA_SMALL) $(NEW_JAVAC) \ -XDignore.symbol.file \ + -bootclasspath $(JDK_OUTPUTDIR)/modules/java.base \ -sourcepath $(SOURCEPATH) \ -implicit:none \ -proc:only \ diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java index bf7f255d4db..4077c0f40f4 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @@ -49,7 +49,7 @@ import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; import jdk.vm.ci.runtime.JVMCICompiler; import jdk.vm.ci.service.Services; -import sun.misc.VM; +import jdk.internal.misc.VM; //JaCoCo Exclude From 7f812c4c8644354bbe7e945012028570548a2c99 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Wed, 20 Jan 2016 09:54:39 +0100 Subject: [PATCH 220/228] 8145596: Enable debug symbols for all libraries Reviewed-by: erikj --- hotspot/make/lib/Lib-jdk.hotspot.agent.gmk | 1 - 1 file changed, 1 deletion(-) diff --git a/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk b/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk index 6c911565aed..51ff9691c84 100644 --- a/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk +++ b/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk @@ -110,7 +110,6 @@ $(eval $(call SetupNativeCompilation, BUILD_LIBSA, \ LIBS := $(SA_LIBS), \ MAPFILE := $(SA_MAPFILE), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsa, \ - DEBUG_SYMBOLS := true, \ STRIP_SYMBOLS := true, \ )) From 108a946d760047ab7dc962eabaa3bc09538c45ee Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Thu, 21 Jan 2016 15:08:49 +0100 Subject: [PATCH 221/228] 8147933: Configure check for number of cpus ignores HT on Macosx Reviewed-by: ihse --- common/autoconf/build-performance.m4 | 10 +++++----- common/autoconf/generated-configure.sh | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/autoconf/build-performance.m4 b/common/autoconf/build-performance.m4 index 463498f8471..8d653aa71d6 100644 --- a/common/autoconf/build-performance.m4 +++ b/common/autoconf/build-performance.m4 @@ -37,9 +37,9 @@ AC_DEFUN([BPERF_CHECK_CORES], # Looks like a Solaris system NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line` FOUND_CORES=yes - elif test -x /usr/sbin/system_profiler; then + elif test -x /usr/sbin/sysctl; then # Looks like a MacOSX system - NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'` + NUM_CORES=`/usr/sbin/sysctl -n hw.ncpu` FOUND_CORES=yes elif test "x$OPENJDK_BUILD_OS" = xaix ; then NUM_CORES=`/usr/sbin/prtconf | grep "^Number Of Processors" | awk '{ print [$]4 }'` @@ -74,10 +74,10 @@ AC_DEFUN([BPERF_CHECK_MEMORY_SIZE], # Looks like a Solaris or AIX system MEMORY_SIZE=`/usr/sbin/prtconf | grep "^Memory [[Ss]]ize" | awk '{ print [$]3 }'` FOUND_MEM=yes - elif test -x /usr/sbin/system_profiler; then + elif test -x /usr/sbin/sysctl; then # Looks like a MacOSX system - MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print [$]2}'` - MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024` + MEMORY_SIZE=`/usr/sbin/sysctl -n hw.memsize` + MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024` FOUND_MEM=yes elif test "x$OPENJDK_BUILD_OS" = xwindows; then # Windows, but without cygwin diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 15203c2855e..c295b3bf838 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -4849,7 +4849,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1453279620 +DATE_WHEN_GENERATED=1453385294 ############################################################################### # @@ -59249,9 +59249,9 @@ $as_echo_n "checking for number of cores... " >&6; } # Looks like a Solaris system NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line` FOUND_CORES=yes - elif test -x /usr/sbin/system_profiler; then + elif test -x /usr/sbin/sysctl; then # Looks like a MacOSX system - NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print $5}'` + NUM_CORES=`/usr/sbin/sysctl -n hw.ncpu` FOUND_CORES=yes elif test "x$OPENJDK_BUILD_OS" = xaix ; then NUM_CORES=`/usr/sbin/prtconf | grep "^Number Of Processors" | awk '{ print $4 }'` @@ -59303,10 +59303,10 @@ $as_echo_n "checking for memory size... " >&6; } # Looks like a Solaris or AIX system MEMORY_SIZE=`/usr/sbin/prtconf | grep "^Memory [Ss]ize" | awk '{ print $3 }'` FOUND_MEM=yes - elif test -x /usr/sbin/system_profiler; then + elif test -x /usr/sbin/sysctl; then # Looks like a MacOSX system - MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print $2}'` - MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024` + MEMORY_SIZE=`/usr/sbin/sysctl -n hw.memsize` + MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024` FOUND_MEM=yes elif test "x$OPENJDK_BUILD_OS" = xwindows; then # Windows, but without cygwin From 0e1008cb2009d53968cf5c45de1327cbbcb483e0 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Thu, 21 Jan 2016 15:10:42 +0100 Subject: [PATCH 222/228] 8147934: Remove --with-sdk-name from macosx jib profile Reviewed-by: ihse --- common/conf/jib-profiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/conf/jib-profiles.js b/common/conf/jib-profiles.js index 90d9621c6af..926fb9d5424 100644 --- a/common/conf/jib-profiles.js +++ b/common/conf/jib-profiles.js @@ -257,7 +257,7 @@ var getJibProfilesProfiles = function (input, common) { target_os: "macosx", target_cpu: "x64", dependencies: concat(common.dependencies, "devkit"), - configure_args: concat(common.configure_args, "--with-sdk-name=macosx10.9"), + configure_args: common.configure_args, make_args: common.make_args }, From 1f8105bb0cec9e222809134577bca0f26ae8cabc Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Thu, 21 Jan 2016 17:35:28 +0100 Subject: [PATCH 223/228] 8147950: Change JPRT to use new platforms for Linux, Windows and Macosx Reviewed-by: tbell --- make/jprt.properties | 141 ++++++++++++++++++++++--------------------- 1 file changed, 72 insertions(+), 69 deletions(-) diff --git a/make/jprt.properties b/make/jprt.properties index ba560fba636..16084ed7375 100644 --- a/make/jprt.properties +++ b/make/jprt.properties @@ -34,7 +34,7 @@ jprt.selective.test.bundle.installation=true # The current release name jprt.tools.default.release=jdk9 -# Allow concurrent changes to be merged in prior to pushing +# Allow concurrent changes to be merged in prior to pushing jprt.sync.push=true # Directories to be excluded from the source bundles @@ -43,6 +43,9 @@ jprt.bundle.exclude.src.dirs=build dist webrev # Use configure when building jprt.build.use.configure=true +# Disable the need for preinstalled Xcode +jprt.macosx.jdk9.target.attribute.compilerXcode511.appliesTo.builds=none + # Set up the run flavors (jvm variants) jprt.run.flavors=c1,c2,default,${my.additional.run.flavors} @@ -99,7 +102,7 @@ jprt.build.configure.args= \ --with-output-sync=recurse \ --with-boot-jdk=$ALT_BOOTDIR \ --with-jobs=$ALT_PARALLEL_COMPILE_JOBS \ - --with-version-opt=$JPRT_JOB_ID \ + --with-version-opt=$JPRT_JOB_ID \ MAKE=$JPRT_MAKE \ ${my.additional.build.configure.args.${jprt.test.set}} \ ${my.custom.build.configure.args} @@ -157,21 +160,21 @@ my.build.flavors.default=fastdebug,product my.build.targets.default= \ solaris_sparcv9_5.11-{product|fastdebug}, \ solaris_x64_5.11-{product|fastdebug}, \ - linux_i586_2.6-{product|fastdebug}, \ - linux_x64_2.6-{product|fastdebug}, \ + linux_i586_3.8-{product|fastdebug}, \ + linux_x64_3.8-{product|fastdebug}, \ macosx_x64_10.9-{product|fastdebug}, \ - windows_i586_6.2-{product|fastdebug}, \ - windows_x64_6.2-{product|fastdebug} + windows_i586_6.3-{product|fastdebug}, \ + windows_x64_6.3-{product|fastdebug} # Test target list (no fastdebug & limited c2 testing) my.test.target.set= \ solaris_sparcv9_5.11-product-c2-TESTNAME, \ solaris_x64_5.11-product-c2-TESTNAME, \ - linux_i586_2.6-product-{c1|c2}-TESTNAME, \ - linux_x64_2.6-product-c2-TESTNAME, \ + linux_i586_3.8-product-{c1|c2}-TESTNAME, \ + linux_x64_3.8-product-c2-TESTNAME, \ macosx_x64_10.9-product-c2-TESTNAME, \ - windows_i586_6.2-product-c1-TESTNAME, \ - windows_x64_6.2-product-c2-TESTNAME + windows_i586_6.3-product-c1-TESTNAME, \ + windows_x64_6.3-product-c2-TESTNAME # Default vm test targets (testset=default) my.test.targets.default= \ @@ -255,8 +258,8 @@ my.make.rule.test.targets.pit= \ my.test.target.set.jck= \ solaris_sparcv9_5.11-product-c2-JCK7TESTRULE, \ solaris_x64_5.11-product-c2-JCK7TESTRULE, \ - linux_i586_2.6-product-c1-JCK7TESTRULE, \ - linux_x64_2.6-product-c2-JCK7TESTRULE + linux_i586_3.8-product-c1-JCK7TESTRULE, \ + linux_x64_3.8-product-c2-JCK7TESTRULE # JCK testset targets my.make.rule.test.targets.jck= \ @@ -279,13 +282,13 @@ my.build.flavors.hotspot= \ my.build.targets.hotspot= \ solaris_sparcv9_5.11-{product|fastdebug}, \ solaris_x64_5.11-{product|fastdebug}, \ - linux_i586_2.6-{product|fastdebug}, \ - linux_x64_2.6-{product|fastdebug}, \ + linux_i586_3.8-{product|fastdebug}, \ + linux_x64_3.8-{product|fastdebug}, \ macosx_x64_10.9-{product|fastdebug}, \ - windows_i586_6.2-{product|fastdebug}, \ - windows_x64_6.2-{product|fastdebug}, \ + windows_i586_6.3-{product|fastdebug}, \ + windows_x64_6.3-{product|fastdebug}, \ solaris_x64_5.11-{debugOpen}, \ - linux_x64_2.6-{productOpen}, \ + linux_x64_3.8-{productOpen}, \ ${my.additional.build.targets.hotspot} # Tests to run on the various platforms for hotspot push jobs @@ -312,27 +315,27 @@ my.test.targets.hotspot.solaris.x64= \ solaris_x64_5.11-{product|fastdebug}-c2-GCBasher_G1 my.test.targets.hotspot.linux.i586= \ - linux_i586_2.6-{product|fastdebug}-{c1|c2}-jvm98, \ - linux_i586_2.6-{product|fastdebug}-c2-jvm98_nontiered, \ - linux_i586_2.6-{product|fastdebug}-{c1|c2}-scimark, \ - linux_i586_2.6-product-c1-runThese8_Xcomp_lang, \ - linux_i586_2.6-product-c1-runThese8_Xcomp_vm, \ - linux_i586_2.6-fastdebug-c1-runThese8_Xshare, \ - linux_i586_2.6-fastdebug-c2-runThese8_Xcomp_lang, \ - linux_i586_2.6-fastdebug-c2-runThese8_Xcomp_vm, \ - linux_i586_2.6-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ - linux_i586_2.6-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ - linux_i586_2.6-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ - linux_i586_2.6-{product|fastdebug}-{c1|c2}-GCBasher_G1 + linux_i586_3.8-{product|fastdebug}-{c1|c2}-jvm98, \ + linux_i586_3.8-{product|fastdebug}-c2-jvm98_nontiered, \ + linux_i586_3.8-{product|fastdebug}-{c1|c2}-scimark, \ + linux_i586_3.8-product-c1-runThese8_Xcomp_lang, \ + linux_i586_3.8-product-c1-runThese8_Xcomp_vm, \ + linux_i586_3.8-fastdebug-c1-runThese8_Xshare, \ + linux_i586_3.8-fastdebug-c2-runThese8_Xcomp_lang, \ + linux_i586_3.8-fastdebug-c2-runThese8_Xcomp_vm, \ + linux_i586_3.8-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ + linux_i586_3.8-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ + linux_i586_3.8-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ + linux_i586_3.8-{product|fastdebug}-{c1|c2}-GCBasher_G1 my.test.targets.hotspot.linux.x64= \ - linux_x64_2.6-{product|fastdebug}-c2-jvm98, \ - linux_x64_2.6-{product|fastdebug}-c2-jvm98_nontiered, \ - linux_x64_2.6-{product|fastdebug}-c2-scimark, \ - linux_x64_2.6-{product|fastdebug}-c2-GCBasher_SerialGC, \ - linux_x64_2.6-{product|fastdebug}-c2-GCBasher_ParallelGC, \ - linux_x64_2.6-{product|fastdebug}-c2-GCBasher_CMS, \ - linux_x64_2.6-{product|fastdebug}-c2-GCBasher_G1 + linux_x64_3.8-{product|fastdebug}-c2-jvm98, \ + linux_x64_3.8-{product|fastdebug}-c2-jvm98_nontiered, \ + linux_x64_3.8-{product|fastdebug}-c2-scimark, \ + linux_x64_3.8-{product|fastdebug}-c2-GCBasher_SerialGC, \ + linux_x64_3.8-{product|fastdebug}-c2-GCBasher_ParallelGC, \ + linux_x64_3.8-{product|fastdebug}-c2-GCBasher_CMS, \ + linux_x64_3.8-{product|fastdebug}-c2-GCBasher_G1 my.test.targets.hotspot.macosx.x64= \ macosx_x64_10.9-{product|fastdebug}-c2-jvm98, \ @@ -344,34 +347,34 @@ my.test.targets.hotspot.macosx.x64= \ macosx_x64_10.9-{product|fastdebug}-c2-GCBasher_G1 my.test.targets.hotspot.windows.i586= \ - windows_i586_6.2-{product|fastdebug}-{c1|c2}-jvm98, \ - windows_i586_6.2-{product|fastdebug}-c2-jvm98_nontiered, \ - windows_i586_6.2-{product|fastdebug}-{c1|c2}-scimark, \ - windows_i586_6.2-product-{c1|c2}-runThese8, \ - windows_i586_6.2-product-{c1|c2}-runThese8_Xcomp_lang, \ - windows_i586_6.2-product-{c1|c2}-runThese8_Xcomp_vm, \ - windows_i586_6.2-fastdebug-c1-runThese8_Xshare, \ - windows_i586_6.2-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ - windows_i586_6.2-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ - windows_i586_6.2-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ - windows_i586_6.2-{product|fastdebug}-{c1|c2}-GCBasher_G1 + windows_i586_6.3-{product|fastdebug}-{c1|c2}-jvm98, \ + windows_i586_6.3-{product|fastdebug}-c2-jvm98_nontiered, \ + windows_i586_6.3-{product|fastdebug}-{c1|c2}-scimark, \ + windows_i586_6.3-product-{c1|c2}-runThese8, \ + windows_i586_6.3-product-{c1|c2}-runThese8_Xcomp_lang, \ + windows_i586_6.3-product-{c1|c2}-runThese8_Xcomp_vm, \ + windows_i586_6.3-fastdebug-c1-runThese8_Xshare, \ + windows_i586_6.3-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ + windows_i586_6.3-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ + windows_i586_6.3-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ + windows_i586_6.3-{product|fastdebug}-{c1|c2}-GCBasher_G1 my.test.targets.hotspot.windows.x64= \ - windows_x64_6.2-{product|fastdebug}-c2-jvm98, \ - windows_x64_6.2-{product|fastdebug}-c2-jvm98_nontiered, \ - windows_x64_6.2-{product|fastdebug}-c2-scimark, \ - windows_x64_6.2-product-c2-runThese8, \ - windows_x64_6.2-product-c2-runThese8_Xcomp_lang, \ - windows_x64_6.2-product-c2-runThese8_Xcomp_vm, \ - windows_x64_6.2-{product|fastdebug}-c2-GCBasher_SerialGC, \ - windows_x64_6.2-{product|fastdebug}-c2-GCBasher_ParallelGC, \ - windows_x64_6.2-{product|fastdebug}-c2-GCBasher_CMS, \ - windows_x64_6.2-{product|fastdebug}-c2-GCBasher_G1 + windows_x64_6.3-{product|fastdebug}-c2-jvm98, \ + windows_x64_6.3-{product|fastdebug}-c2-jvm98_nontiered, \ + windows_x64_6.3-{product|fastdebug}-c2-scimark, \ + windows_x64_6.3-product-c2-runThese8, \ + windows_x64_6.3-product-c2-runThese8_Xcomp_lang, \ + windows_x64_6.3-product-c2-runThese8_Xcomp_vm, \ + windows_x64_6.3-{product|fastdebug}-c2-GCBasher_SerialGC, \ + windows_x64_6.3-{product|fastdebug}-c2-GCBasher_ParallelGC, \ + windows_x64_6.3-{product|fastdebug}-c2-GCBasher_CMS, \ + windows_x64_6.3-{product|fastdebug}-c2-GCBasher_G1 # Some basic "smoke" tests for OpenJDK builds my.test.targets.hotspot.open= \ solaris_x64_5.11-{productOpen|fastdebugOpen}-c2-jvm98, \ - linux_x64_2.6-{productOpen|fastdebugOpen}-c2-jvm98 + linux_x64_3.8-{productOpen|fastdebugOpen}-c2-jvm98 # The complete list of test targets for jprt my.test.targets.hotspot= \ @@ -394,24 +397,24 @@ my.test.targets.hotspot= \ # Make file based test targets my.make.rule.test.targets.hotspot.basicvmtests= \ - linux_i586_2.6-*-default-hotspot_basicvmtest, \ - linux_x64_2.6-*-default-hotspot_basicvmtest, \ + linux_i586_3.8-*-default-hotspot_basicvmtest, \ + linux_x64_3.8-*-default-hotspot_basicvmtest, \ macosx_x64_10.9-*-default-hotspot_basicvmtest, \ solaris_sparcv9_5.11-*-default-hotspot_basicvmtest, \ solaris_x64_5.11-*-default-hotspot_basicvmtest, \ - windows_i586_6.2-*-default-hotspot_basicvmtest, \ - windows_x64_6.2-*-default-hotspot_basicvmtest - + windows_i586_6.3-*-default-hotspot_basicvmtest, \ + windows_x64_6.3-*-default-hotspot_basicvmtest + my.make.rule.test.targets.hotspot.reg.group= \ solaris_sparcv9_5.11-fastdebug-c2-GROUP, \ solaris_x64_5.11-fastdebug-c2-GROUP, \ - linux_i586_2.6-fastdebug-c2-GROUP, \ - linux_x64_2.6-fastdebug-c2-GROUP, \ + linux_i586_3.8-fastdebug-c2-GROUP, \ + linux_x64_3.8-fastdebug-c2-GROUP, \ macosx_x64_10.9-fastdebug-c2-GROUP, \ - windows_i586_6.2-fastdebug-c2-GROUP, \ - windows_x64_6.2-fastdebug-c2-GROUP, \ - linux_i586_2.6-fastdebug-c1-GROUP, \ - windows_i586_6.2-fastdebug-c1-GROUP + windows_i586_6.3-fastdebug-c2-GROUP, \ + windows_x64_6.3-fastdebug-c2-GROUP, \ + linux_i586_3.8-fastdebug-c1-GROUP, \ + windows_i586_6.3-fastdebug-c1-GROUP # Hotspot jtreg tests my.make.rule.test.targets.hotspot.reg= \ From 50bc1e72da19535b5599f72ad4b2d0d6f6c836c9 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 21 Jan 2016 09:45:55 -0800 Subject: [PATCH 224/228] Added tag jdk-9+102 for changeset f510188ef3ac --- .hgtags-top-repo | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags-top-repo b/.hgtags-top-repo index ad5eaa36b36..ae78a92b7f7 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -344,3 +344,4 @@ cf1dc4c035fb84693d4ae5ad818785cb4d1465d1 jdk9-b90 7c0577bea4c65d69c5bef67023a89d2efa4fb2f7 jdk-9+99 c1f30ac14db0eaff398429c04cd9fab92e1b4b2a jdk-9+100 c4d72a1620835b5d657b7b6792c2879367d0154f jdk-9+101 +6406ecf5d39482623225bb1b3098c2cac6f7d450 jdk-9+102 From c688dcc7e0035bccd78fd9c80a22bf88ce9075d1 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 21 Jan 2016 09:45:58 -0800 Subject: [PATCH 225/228] Added tag jdk-9+102 for changeset 62df07007db2 --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 2861744a267..4731b6143c4 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -504,3 +504,4 @@ e5b1a23be1e105417ba1c4c576ab373eb3fa2c2b jdk-9+98 f008e8cc10d5b3212fb22d58c96fa01d38654f19 jdk-9+99 bdb0acafc63c42e84d9d8195bf2e2b25ee9c3306 jdk-9+100 9f45d3d57d6948cf526fbc2e2891a9a74ac6941a jdk-9+101 +d5239fc1b69749ae50793c61b899fcdacf3df857 jdk-9+102 From 1cbdf12c056362cc6ac85239de7c8d93a356ee0f Mon Sep 17 00:00:00 2001 From: Mark Sheppard Date: Sun, 24 Jan 2016 22:27:16 +0000 Subject: [PATCH 226/228] 8147862: Null check too late in sun.net.httpserver.ServerImpl Reviewed-by: chegar --- .../sun/net/httpserver/ServerImpl.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java b/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java index 5b97c16477c..1c3ac29f936 100644 --- a/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java +++ b/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java @@ -373,22 +373,22 @@ class ServerImpl implements TimeSource { } SocketChannel chan = schan.accept(); - // Set TCP_NODELAY, if appropriate - if (ServerConfig.noDelay()) { - chan.socket().setTcpNoDelay(true); + // optimist there's a channel + if (chan != null) { + // Set TCP_NODELAY, if appropriate + if (ServerConfig.noDelay()) { + chan.socket().setTcpNoDelay(true); + } + chan.configureBlocking (false); + SelectionKey newkey = + chan.register (selector, SelectionKey.OP_READ); + HttpConnection c = new HttpConnection (); + c.selectionKey = newkey; + c.setChannel (chan); + newkey.attach (c); + requestStarted (c); + allConnections.add (c); } - - if (chan == null) { - continue; /* cancel something ? */ - } - chan.configureBlocking (false); - SelectionKey newkey = chan.register (selector, SelectionKey.OP_READ); - HttpConnection c = new HttpConnection (); - c.selectionKey = newkey; - c.setChannel (chan); - newkey.attach (c); - requestStarted (c); - allConnections.add (c); } else { try { if (key.isReadable()) { From 60134cc040dd899fc815fb23c871930ddf5c7a69 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Mon, 25 Jan 2016 12:23:55 +0100 Subject: [PATCH 227/228] 8148044: Remove Enum[0] constants from EnumSet and EnumMap Reviewed-by: alanb, chegar, shade, smarks --- .../java.base/share/classes/java/util/EnumMap.java | 3 --- .../java.base/share/classes/java/util/EnumSet.java | 5 +++-- jdk/test/java/util/EnumMap/EnumMapBash.java | 2 -- jdk/test/java/util/EnumSet/BogusEnumSet.java | 12 +++++++++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/util/EnumMap.java b/jdk/src/java.base/share/classes/java/util/EnumMap.java index b665eaad856..686a0a9b98e 100644 --- a/jdk/src/java.base/share/classes/java/util/EnumMap.java +++ b/jdk/src/java.base/share/classes/java/util/EnumMap.java @@ -25,7 +25,6 @@ package java.util; -import java.util.Map.Entry; import jdk.internal.misc.SharedSecrets; /** @@ -125,8 +124,6 @@ public class EnumMap, V> extends AbstractMap return (V)(value == NULL ? null : value); } - private static final Enum[] ZERO_LENGTH_ENUM_ARRAY = new Enum[0]; - /** * Creates an empty enum map with the specified key type. * diff --git a/jdk/src/java.base/share/classes/java/util/EnumSet.java b/jdk/src/java.base/share/classes/java/util/EnumSet.java index 52a4b3f19ef..0ca61870976 100644 --- a/jdk/src/java.base/share/classes/java/util/EnumSet.java +++ b/jdk/src/java.base/share/classes/java/util/EnumSet.java @@ -92,8 +92,6 @@ public abstract class EnumSet> extends AbstractSet */ final Enum[] universe; - private static Enum[] ZERO_LENGTH_ENUM_ARRAY = new Enum[0]; - EnumSet(ClasselementType, Enum[] universe) { this.elementType = elementType; this.universe = universe; @@ -421,6 +419,9 @@ public abstract class EnumSet> extends AbstractSet private static class SerializationProxy > implements java.io.Serializable { + + private static final Enum[] ZERO_LENGTH_ENUM_ARRAY = new Enum[0]; + /** * The element type of this enum set. * diff --git a/jdk/test/java/util/EnumMap/EnumMapBash.java b/jdk/test/java/util/EnumMap/EnumMapBash.java index 53bb9706dea..89102fb5112 100644 --- a/jdk/test/java/util/EnumMap/EnumMapBash.java +++ b/jdk/test/java/util/EnumMap/EnumMapBash.java @@ -48,8 +48,6 @@ public class EnumMapBash { bash(Silly500.class); } - private static Enum[] ZERO_LENGTH_ENUM_ARRAY = new Enum[0]; - static > void bash(Class enumClass) { Enum[] universe = enumClass.getEnumConstants(); diff --git a/jdk/test/java/util/EnumSet/BogusEnumSet.java b/jdk/test/java/util/EnumSet/BogusEnumSet.java index 9769cfebe2d..6ba2840b149 100644 --- a/jdk/test/java/util/EnumSet/BogusEnumSet.java +++ b/jdk/test/java/util/EnumSet/BogusEnumSet.java @@ -32,6 +32,11 @@ import java.io.*; public class BogusEnumSet { public static void main(String[] args) throws Throwable { + // This test depends on the current serialVersionUID of EnumSet, + // which may change if the EnumSet class is modified. + // The current value is 4168005130090799668L = 0x39D7BA9531116234L + // If the value changes, it will have to be patched into the + // serialized byte stream below at the location noted. byte[] serializedForm = { (byte)0xac, (byte)0xed, 0x0, 0x5, 0x73, 0x72, 0x0, 0x18, 0x6a, 0x61, 0x76, 0x61, 0x2e, 0x75, 0x74, 0x69, @@ -40,9 +45,10 @@ public class BogusEnumSet { 0x7e, (byte)0xb0, (byte)0xd0, 0x7e, 0x2, 0x0, 0x1, 0x4a, 0x0, 0x8, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x78, 0x72, 0x0, 0x11, 0x6a, 0x61, 0x76, 0x61, 0x2e, 0x75, 0x74, 0x69, - 0x6c, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x53, 0x65, 0x74, 0xe, - 0x3, 0x21, 0x6a, (byte)0xcd, (byte)0x8c, 0x29, (byte)0xdd, 0x2, - 0x0, 0x2, 0x4c, 0x0, 0xb, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x6c, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x53, 0x65, 0x74, + // EnumSet's serialVersionUID is the following eight bytes (big-endian) + 0x39, (byte)0xd7, (byte)0xba, (byte)0x95, 0x31, 0x11, 0x62, 0x34, + 0x2, 0x0, 0x2, 0x4c, 0x0, 0xb, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x74, 0x0, 0x11, 0x4c, 0x6a, 0x61, 0x76, 0x61, 0x2f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x3b, 0x5b, 0x0, 0x8, 0x75, 0x6e, 0x69, 0x76, 0x65, 0x72, From 3573d650403353b91b57ce2a1e474fec2cce9cec Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Mon, 25 Jan 2016 19:01:19 +0000 Subject: [PATCH 228/228] 8148147: Sync up @modules from jigsaw/jake Reviewed-by: chegar, mchung --- jdk/test/com/oracle/security/ucrypto/TestCICOWithGCM.java | 1 - .../com/oracle/security/ucrypto/TestGCMKeyAndIvCheck.java | 1 - jdk/test/com/oracle/security/ucrypto/TestGCMWithSBE.java | 1 - jdk/test/com/sun/crypto/provider/Cipher/AES/Test4513830.java | 1 - .../com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java | 1 - .../sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java | 1 - jdk/test/com/sun/crypto/provider/Cipher/AES/TestGHASH.java | 1 + .../sun/crypto/provider/Cipher/AES/TestISO10126Padding.java | 1 - .../com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java | 1 - .../com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java | 1 - .../com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java | 1 - .../jmx/mbeanserver/introspector/SimpleIntrospectorTest.java | 2 +- .../GarbageCollectionNotificationContentTest.java | 3 ++- .../GarbageCollectionNotificationTest.java | 3 ++- .../internal/BootstrapLogger/BootstrapLoggerAPIsTest.java | 1 + jdk/test/java/lang/invoke/AccessControlTest.java | 4 +--- jdk/test/java/lang/invoke/ExplicitCastArgumentsTest.java | 1 + jdk/test/java/lang/invoke/lambda/LambdaAsm.java | 2 +- jdk/test/java/nio/channels/SocketChannel/VectorIO.java | 1 - jdk/test/java/nio/channels/SocketChannel/Write.java | 1 - .../channels/spi/SelectorProvider/inheritedChannel/Util.java | 3 --- jdk/test/java/security/KeyStore/EntryMethods.java | 2 -- jdk/test/java/util/Locale/Bug8008577.java | 1 + .../java/util/PluggableLocale/BreakIteratorProviderTest.java | 2 -- jdk/test/javax/net/ssl/DTLS/CipherSuite.java | 3 ++- jdk/test/javax/net/ssl/DTLS/ClientAuth.java | 3 ++- jdk/test/javax/net/ssl/DTLS/InvalidCookie.java | 3 ++- jdk/test/javax/net/ssl/DTLS/InvalidRecords.java | 3 ++- jdk/test/javax/net/ssl/DTLS/NoMacInitialClientHello.java | 3 ++- jdk/test/javax/net/ssl/DTLS/Reordered.java | 3 ++- jdk/test/javax/net/ssl/DTLS/Retransmission.java | 3 ++- jdk/test/javax/net/ssl/DTLS/WeakCipherSuite.java | 3 ++- .../jaxp/PrecisionDecimalDV/XPrecisionDecimalToString.java | 1 + jdk/test/jdk/internal/jline/KeyConversionTest.java | 1 + jdk/test/jdk/internal/jline/console/StripAnsiTest.java | 1 + jdk/test/sun/awt/shell/ShellFolderMemoryLeak.java | 4 ++-- .../sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java | 1 + .../sun/reflect/CallerSensitive/CallerSensitiveFinder.java | 2 +- .../sun/reflect/CallerSensitive/MissingCallerSensitive.java | 1 - .../provider/FileInputStreamPool/FileInputStreamPoolTest.java | 1 + .../provider/certpath/Extensions/OCSPNonceExtensionTests.java | 3 +++ .../provider/certpath/ResponderId/ResponderIdTests.java | 2 ++ jdk/test/sun/security/ssl/ExtensionType/OptimalListSize.java | 1 + jdk/test/sun/security/ssl/SSLSocketImpl/CheckMethods.java | 1 - jdk/test/sun/security/x509/AVA/EmailAddressEncoding.java | 1 - jdk/test/sun/text/resources/LocaleDataTest.java | 1 + jdk/test/sun/util/logging/PlatformLoggerTest.java | 1 + 47 files changed, 43 insertions(+), 40 deletions(-) diff --git a/jdk/test/com/oracle/security/ucrypto/TestCICOWithGCM.java b/jdk/test/com/oracle/security/ucrypto/TestCICOWithGCM.java index 3191fd8b321..287552ecfb8 100644 --- a/jdk/test/com/oracle/security/ucrypto/TestCICOWithGCM.java +++ b/jdk/test/com/oracle/security/ucrypto/TestCICOWithGCM.java @@ -34,7 +34,6 @@ import javax.crypto.*; import javax.crypto.spec.*; import java.math.*; import java.io.*; -import com.sun.crypto.provider.*; import java.util.*; diff --git a/jdk/test/com/oracle/security/ucrypto/TestGCMKeyAndIvCheck.java b/jdk/test/com/oracle/security/ucrypto/TestGCMKeyAndIvCheck.java index cac898b5d90..eae2160bace 100644 --- a/jdk/test/com/oracle/security/ucrypto/TestGCMKeyAndIvCheck.java +++ b/jdk/test/com/oracle/security/ucrypto/TestGCMKeyAndIvCheck.java @@ -32,7 +32,6 @@ import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; import java.math.*; -import com.sun.crypto.provider.*; import java.util.*; diff --git a/jdk/test/com/oracle/security/ucrypto/TestGCMWithSBE.java b/jdk/test/com/oracle/security/ucrypto/TestGCMWithSBE.java index f049c5453ee..04884f697e1 100644 --- a/jdk/test/com/oracle/security/ucrypto/TestGCMWithSBE.java +++ b/jdk/test/com/oracle/security/ucrypto/TestGCMWithSBE.java @@ -32,7 +32,6 @@ import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; import java.math.*; -import com.sun.crypto.provider.*; import java.util.*; diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/Test4513830.java b/jdk/test/com/sun/crypto/provider/Cipher/AES/Test4513830.java index a3bfc0012ff..856c55a6fbe 100644 --- a/jdk/test/com/sun/crypto/provider/Cipher/AES/Test4513830.java +++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/Test4513830.java @@ -37,7 +37,6 @@ import java.util.Random; import javax.crypto.*; import javax.crypto.spec.*; import java.security.Provider; -import com.sun.crypto.provider.*; public class Test4513830 { diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java index 1d5e5abbb62..c6c7a66c5e4 100644 --- a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java +++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestCICOWithGCM.java @@ -37,7 +37,6 @@ import javax.crypto.*; import javax.crypto.spec.*; import java.math.*; import java.io.*; -import com.sun.crypto.provider.*; import java.util.*; diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java index e7d6e57bef7..0777508b36f 100644 --- a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java +++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestGCMKeyAndIvCheck.java @@ -36,7 +36,6 @@ import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; import java.math.*; -import com.sun.crypto.provider.*; import java.util.*; diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestGHASH.java b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestGHASH.java index dbd97239be8..e58acb24872 100644 --- a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestGHASH.java +++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestGHASH.java @@ -25,6 +25,7 @@ /* * @test * @bug 8069072 + * @modules java.base/com.sun.crypto.provider * @summary Test vectors for com.sun.crypto.provider.GHASH. * * Single iteration to verify software-only GHASH algorithm. diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestISO10126Padding.java b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestISO10126Padding.java index 926320393dd..9b91e612c35 100644 --- a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestISO10126Padding.java +++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestISO10126Padding.java @@ -35,7 +35,6 @@ import java.security.spec.*; import javax.crypto.*; import javax.crypto.spec.*; import java.security.Provider; -import com.sun.crypto.provider.*; public class TestISO10126Padding { private static final String ALGO = "AES"; diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java index 7cdd845cd5b..a9576e7f3eb 100644 --- a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java +++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestKATForECB_IV.java @@ -34,7 +34,6 @@ import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; import java.math.*; -import com.sun.crypto.provider.*; import java.util.*; diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java index 360201393d2..3595bbd22f1 100644 --- a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java +++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestKATForGCM.java @@ -37,7 +37,6 @@ import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; import java.math.*; -import com.sun.crypto.provider.*; import java.util.*; diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java index c05899541a3..52d6c43bdb1 100644 --- a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java +++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestShortBuffer.java @@ -35,7 +35,6 @@ import java.math.BigInteger; import javax.crypto.*; import javax.crypto.spec.*; import java.security.Provider; -import com.sun.crypto.provider.*; public class TestShortBuffer { private static final String ALGO = "AES"; diff --git a/jdk/test/com/sun/jmx/mbeanserver/introspector/SimpleIntrospectorTest.java b/jdk/test/com/sun/jmx/mbeanserver/introspector/SimpleIntrospectorTest.java index 1b463f585a2..3784c9392eb 100644 --- a/jdk/test/com/sun/jmx/mbeanserver/introspector/SimpleIntrospectorTest.java +++ b/jdk/test/com/sun/jmx/mbeanserver/introspector/SimpleIntrospectorTest.java @@ -33,7 +33,7 @@ import java.lang.reflect.Method; * with a lower-case letter * * @author Jaroslav Bachorik - * @modules java.management + * @modules java.management/com.sun.jmx.mbeanserver * @run clean SimpleIntrospectorTest * @run build SimpleIntrospectorTest BeanClass * @run main SimpleIntrospectorTest diff --git a/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java b/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java index be135904128..10d10f40903 100644 --- a/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java +++ b/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java @@ -27,7 +27,8 @@ * @summary Check that GarbageCollectionNotification contents are reasonable * @author Frederic Parain * @requires vm.opt.ExplicitGCInvokesConcurrent == null | vm.opt.ExplicitGCInvokesConcurrent == false - * @modules jdk.management + * @modules java.management/sun.management + * jdk.management * @run main/othervm GarbageCollectionNotificationContentTest */ diff --git a/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java b/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java index 599c9e900ef..3bbfea44193 100644 --- a/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java +++ b/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java @@ -27,7 +27,8 @@ * @summary Check that GarbageCollection notification are thrown by every GarbageCollectorMXBean * @author Frederic Parain * @requires vm.opt.ExplicitGCInvokesConcurrent == null | vm.opt.ExplicitGCInvokesConcurrent == false - * @modules jdk.management + * @modules java.management/sun.management + * jdk.management * @run main/othervm GarbageCollectionNotificationTest */ diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java index 4cacb966906..7c62eb9a763 100644 --- a/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java +++ b/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java @@ -40,6 +40,7 @@ import jdk.internal.logger.LazyLoggers; * @summary Cover the logXX and LogEvent.valueOf APIs of BootstrapLogger * and logXX APIs of SimpleConsoleLogger. * @modules java.base/jdk.internal.logger + * java.base/sun.util.logging * @build BootstrapLoggerUtils LogStream * @run main/othervm BootstrapLoggerAPIsTest */ diff --git a/jdk/test/java/lang/invoke/AccessControlTest.java b/jdk/test/java/lang/invoke/AccessControlTest.java index f10a2300745..5e6fc14a0fb 100644 --- a/jdk/test/java/lang/invoke/AccessControlTest.java +++ b/jdk/test/java/lang/invoke/AccessControlTest.java @@ -23,9 +23,7 @@ /* @test * @summary test access checking by java.lang.invoke.MethodHandles.Lookup - * @library ../../../.. - * @build test.java.lang.invoke.AccessControlTest - * @build test.java.lang.invoke.AccessControlTest_subpkg.Acquaintance_remote + * @compile AccessControlTest.java AccessControlTest_subpkg/Acquaintance_remote.java * @run testng/othervm test.java.lang.invoke.AccessControlTest */ diff --git a/jdk/test/java/lang/invoke/ExplicitCastArgumentsTest.java b/jdk/test/java/lang/invoke/ExplicitCastArgumentsTest.java index 0bc335181ba..347e312e3b2 100644 --- a/jdk/test/java/lang/invoke/ExplicitCastArgumentsTest.java +++ b/jdk/test/java/lang/invoke/ExplicitCastArgumentsTest.java @@ -38,6 +38,7 @@ import sun.invoke.util.Wrapper; * @bug 8060483 8066746 * @key randomness * @library /lib/testlibrary /lib/testlibrary/jsr292 + * @modules java.base/sun.invoke.util * @summary unit tests for MethodHandles.explicitCastArguments() * @run main ExplicitCastArgumentsTest */ diff --git a/jdk/test/java/lang/invoke/lambda/LambdaAsm.java b/jdk/test/java/lang/invoke/lambda/LambdaAsm.java index f69c865f056..8148733923c 100644 --- a/jdk/test/java/lang/invoke/lambda/LambdaAsm.java +++ b/jdk/test/java/lang/invoke/lambda/LambdaAsm.java @@ -27,7 +27,7 @@ * @summary ensures that j.l.i.InvokerByteCodeGenerator and ASM visitMethodInsn * generate bytecodes with correct constant pool references * @modules java.base/jdk.internal.org.objectweb.asm - * jdk.compiler/com.sun.tools.classfile + * jdk.jdeps/com.sun.tools.classfile * @compile -XDignore.symbol.file LambdaAsm.java LUtils.java * @run main/othervm LambdaAsm */ diff --git a/jdk/test/java/nio/channels/SocketChannel/VectorIO.java b/jdk/test/java/nio/channels/SocketChannel/VectorIO.java index d7975dbfa44..4242be4dfa2 100644 --- a/jdk/test/java/nio/channels/SocketChannel/VectorIO.java +++ b/jdk/test/java/nio/channels/SocketChannel/VectorIO.java @@ -32,7 +32,6 @@ import java.net.*; import java.nio.*; import java.nio.channels.*; import java.util.*; -import sun.misc.*; public class VectorIO { diff --git a/jdk/test/java/nio/channels/SocketChannel/Write.java b/jdk/test/java/nio/channels/SocketChannel/Write.java index 95a1f185de7..d0cee8cadd1 100644 --- a/jdk/test/java/nio/channels/SocketChannel/Write.java +++ b/jdk/test/java/nio/channels/SocketChannel/Write.java @@ -32,7 +32,6 @@ import java.net.*; import java.nio.*; import java.nio.channels.*; import java.util.*; -import sun.misc.*; public class Write { diff --git a/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/Util.java b/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/Util.java index 1ad05a96806..79653811f87 100644 --- a/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/Util.java +++ b/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/Util.java @@ -30,9 +30,6 @@ import java.io.*; import java.nio.channels.*; import java.lang.reflect.*; -// dependency on Sun implementation -import sun.nio.ch.*; - public class Util { private static Object get(String className, String fieldName, Object o) throws Exception { diff --git a/jdk/test/java/security/KeyStore/EntryMethods.java b/jdk/test/java/security/KeyStore/EntryMethods.java index 410fd1a6cee..434aaf0f724 100644 --- a/jdk/test/java/security/KeyStore/EntryMethods.java +++ b/jdk/test/java/security/KeyStore/EntryMethods.java @@ -32,8 +32,6 @@ import java.security.cert.*; import java.util.*; import java.io.*; -import sun.security.provider.*; - public class EntryMethods extends Provider implements KeyStore.Entry diff --git a/jdk/test/java/util/Locale/Bug8008577.java b/jdk/test/java/util/Locale/Bug8008577.java index 7cc3b9dc6d0..ee267ecfa06 100644 --- a/jdk/test/java/util/Locale/Bug8008577.java +++ b/jdk/test/java/util/Locale/Bug8008577.java @@ -26,6 +26,7 @@ * @bug 8008577 8138613 * @summary Check whether CLDR locale provider adapter is enabled by default * @compile -XDignore.symbol.file Bug8008577.java + * @modules java.base/sun.util.locale.provider * @run main Bug8008577 */ diff --git a/jdk/test/java/util/PluggableLocale/BreakIteratorProviderTest.java b/jdk/test/java/util/PluggableLocale/BreakIteratorProviderTest.java index 754e3f7a277..f32cb2a74ad 100644 --- a/jdk/test/java/util/PluggableLocale/BreakIteratorProviderTest.java +++ b/jdk/test/java/util/PluggableLocale/BreakIteratorProviderTest.java @@ -26,9 +26,7 @@ import java.text.*; import java.util.*; -import sun.text.resources.*; import sun.util.locale.provider.*; -import sun.util.resources.*; public class BreakIteratorProviderTest extends ProviderTest { diff --git a/jdk/test/javax/net/ssl/DTLS/CipherSuite.java b/jdk/test/javax/net/ssl/DTLS/CipherSuite.java index 14370108b46..92896565b8c 100644 --- a/jdk/test/javax/net/ssl/DTLS/CipherSuite.java +++ b/jdk/test/javax/net/ssl/DTLS/CipherSuite.java @@ -28,7 +28,8 @@ * @test * @bug 8043758 * @summary Datagram Transport Layer Security (DTLS) - * @compile DTLSOverDatagram.java + * @modules java.base/sun.security.util + * @build DTLSOverDatagram * @run main/othervm CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA * @run main/othervm CipherSuite TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 * @run main/othervm CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 diff --git a/jdk/test/javax/net/ssl/DTLS/ClientAuth.java b/jdk/test/javax/net/ssl/DTLS/ClientAuth.java index 37c6da286ee..26060b46f04 100644 --- a/jdk/test/javax/net/ssl/DTLS/ClientAuth.java +++ b/jdk/test/javax/net/ssl/DTLS/ClientAuth.java @@ -28,7 +28,8 @@ * @test * @bug 8043758 * @summary Datagram Transport Layer Security (DTLS) - * @compile DTLSOverDatagram.java + * @modules java.base/sun.security.util + * @build DTLSOverDatagram * @run main/othervm ClientAuth */ diff --git a/jdk/test/javax/net/ssl/DTLS/InvalidCookie.java b/jdk/test/javax/net/ssl/DTLS/InvalidCookie.java index 735b396bc79..c12b74466b7 100644 --- a/jdk/test/javax/net/ssl/DTLS/InvalidCookie.java +++ b/jdk/test/javax/net/ssl/DTLS/InvalidCookie.java @@ -28,7 +28,8 @@ * @test * @bug 8043758 * @summary Datagram Transport Layer Security (DTLS) - * @compile DTLSOverDatagram.java + * @modules java.base/sun.security.util + * @build DTLSOverDatagram * @run main/othervm InvalidCookie */ diff --git a/jdk/test/javax/net/ssl/DTLS/InvalidRecords.java b/jdk/test/javax/net/ssl/DTLS/InvalidRecords.java index 38ab4c958bc..223606eda61 100644 --- a/jdk/test/javax/net/ssl/DTLS/InvalidRecords.java +++ b/jdk/test/javax/net/ssl/DTLS/InvalidRecords.java @@ -28,7 +28,8 @@ * @test * @bug 8043758 * @summary Datagram Transport Layer Security (DTLS) - * @compile DTLSOverDatagram.java + * @modules java.base/sun.security.util + * @build DTLSOverDatagram * @run main/othervm InvalidRecords */ diff --git a/jdk/test/javax/net/ssl/DTLS/NoMacInitialClientHello.java b/jdk/test/javax/net/ssl/DTLS/NoMacInitialClientHello.java index 540efd8686f..2a5c74fa684 100644 --- a/jdk/test/javax/net/ssl/DTLS/NoMacInitialClientHello.java +++ b/jdk/test/javax/net/ssl/DTLS/NoMacInitialClientHello.java @@ -28,7 +28,8 @@ * @test * @bug 8043758 * @summary Datagram Transport Layer Security (DTLS) - * @compile DTLSOverDatagram.java + * @modules java.base/sun.security.util + * @build DTLSOverDatagram * @run main/othervm -Djdk.tls.client.enableStatusRequestExtension=false * NoMacInitialClientHello */ diff --git a/jdk/test/javax/net/ssl/DTLS/Reordered.java b/jdk/test/javax/net/ssl/DTLS/Reordered.java index 23da7486f56..9e91979a909 100644 --- a/jdk/test/javax/net/ssl/DTLS/Reordered.java +++ b/jdk/test/javax/net/ssl/DTLS/Reordered.java @@ -28,7 +28,8 @@ * @test * @bug 8043758 * @summary Datagram Transport Layer Security (DTLS) - * @compile DTLSOverDatagram.java + * @modules java.base/sun.security.util + * @build DTLSOverDatagram * @run main/othervm Reordered */ diff --git a/jdk/test/javax/net/ssl/DTLS/Retransmission.java b/jdk/test/javax/net/ssl/DTLS/Retransmission.java index 997840983aa..75aecab22fb 100644 --- a/jdk/test/javax/net/ssl/DTLS/Retransmission.java +++ b/jdk/test/javax/net/ssl/DTLS/Retransmission.java @@ -28,7 +28,8 @@ * @test * @bug 8043758 * @summary Datagram Transport Layer Security (DTLS) - * @compile DTLSOverDatagram.java + * @modules java.base/sun.security.util + * @build DTLSOverDatagram * @run main/othervm Retransmission */ diff --git a/jdk/test/javax/net/ssl/DTLS/WeakCipherSuite.java b/jdk/test/javax/net/ssl/DTLS/WeakCipherSuite.java index bddb73fa8b2..8cd6af1a517 100644 --- a/jdk/test/javax/net/ssl/DTLS/WeakCipherSuite.java +++ b/jdk/test/javax/net/ssl/DTLS/WeakCipherSuite.java @@ -28,7 +28,8 @@ * @test * @bug 8043758 * @summary Datagram Transport Layer Security (DTLS) - * @compile DTLSOverDatagram.java + * @modules java.base/sun.security.util + * @build DTLSOverDatagram * @run main/othervm WeakCipherSuite TLS_DH_anon_WITH_AES_128_GCM_SHA256 * @run main/othervm WeakCipherSuite SSL_DH_anon_WITH_DES_CBC_SHA * @run main/othervm WeakCipherSuite SSL_RSA_WITH_DES_CBC_SHA diff --git a/jdk/test/javax/xml/jaxp/PrecisionDecimalDV/XPrecisionDecimalToString.java b/jdk/test/javax/xml/jaxp/PrecisionDecimalDV/XPrecisionDecimalToString.java index 07f1e161ddd..32254e4fb4d 100644 --- a/jdk/test/javax/xml/jaxp/PrecisionDecimalDV/XPrecisionDecimalToString.java +++ b/jdk/test/javax/xml/jaxp/PrecisionDecimalDV/XPrecisionDecimalToString.java @@ -31,6 +31,7 @@ import java.lang.reflect.Method; * in com.sun.org.apache.xerces.internal.impl.dv.xs.PrecisionDecimalDV$XPrecisionDecimal. * Since that method is private the test unfortunately needs to use reflection * to invoke the method. + * @modules java.xml/com.sun.org.apache.xerces.internal.impl.dv.xs * @run main XPrecisionDecimalToString * @author Daniel Fuchs */ diff --git a/jdk/test/jdk/internal/jline/KeyConversionTest.java b/jdk/test/jdk/internal/jline/KeyConversionTest.java index 887ce8290ad..988aee1cd32 100644 --- a/jdk/test/jdk/internal/jline/KeyConversionTest.java +++ b/jdk/test/jdk/internal/jline/KeyConversionTest.java @@ -25,6 +25,7 @@ * @test * @bug 8080679 * @summary Verify the conversion from key events to escape sequences works properly. + * @modules jdk.internal.le/jdk.internal.jline * @requires os.family == "windows" */ diff --git a/jdk/test/jdk/internal/jline/console/StripAnsiTest.java b/jdk/test/jdk/internal/jline/console/StripAnsiTest.java index 6aa11d78c7d..f9b03cecc23 100644 --- a/jdk/test/jdk/internal/jline/console/StripAnsiTest.java +++ b/jdk/test/jdk/internal/jline/console/StripAnsiTest.java @@ -24,6 +24,7 @@ /** * @test * @bug 8080679 + * @modules jdk.internal.le/jdk.internal.jline.console * @summary Verify ConsoleReader.stripAnsi strips escape sequences from its input correctly. */ diff --git a/jdk/test/sun/awt/shell/ShellFolderMemoryLeak.java b/jdk/test/sun/awt/shell/ShellFolderMemoryLeak.java index 68a18e0e42c..fc905968496 100644 --- a/jdk/test/sun/awt/shell/ShellFolderMemoryLeak.java +++ b/jdk/test/sun/awt/shell/ShellFolderMemoryLeak.java @@ -28,7 +28,7 @@ after calling Win32ShellFolder:listFiles multiple times on some directory with large number of files/folders - * @modules java.desktop/sun.awt + * @modules java.desktop/sun.awt.shell * @requires (os.family == "windows") * @run main/timeout=1000 ShellFolderMemoryLeak */ @@ -223,4 +223,4 @@ public class ShellFolderMemoryLeak { .log(Level.SEVERE, "Unable to delete files", ex); } } -} \ No newline at end of file +} diff --git a/jdk/test/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java b/jdk/test/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java index 1859576a273..d5dfde58233 100644 --- a/jdk/test/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java +++ b/jdk/test/sun/net/www/http/HttpURLConnection/NTLMAuthWithSM.java @@ -39,6 +39,7 @@ import sun.net.www.protocol.http.ntlm.NTLMAuthenticationCallback; /* * @test * @bug 8137174 + * @modules java.base/sun.net.www.protocol.http.ntlm * @summary Checks if NTLM auth works fine if security manager set * @run main/othervm/java.security.policy=NTLMAuthWithSM.policy NTLMAuthWithSM */ diff --git a/jdk/test/sun/reflect/CallerSensitive/CallerSensitiveFinder.java b/jdk/test/sun/reflect/CallerSensitive/CallerSensitiveFinder.java index 9986415aeb1..d4805fb1d2d 100644 --- a/jdk/test/sun/reflect/CallerSensitive/CallerSensitiveFinder.java +++ b/jdk/test/sun/reflect/CallerSensitive/CallerSensitiveFinder.java @@ -48,7 +48,7 @@ import java.util.stream.Stream; * @bug 8010117 * @summary Verify if CallerSensitive methods are annotated with * sun.reflect.CallerSensitive annotation - * @modules jdk.compiler/com.sun.tools.classfile jdk.jdeps/com.sun.tools.jdeps + * @modules jdk.jdeps/com.sun.tools.classfile jdk.jdeps/com.sun.tools.jdeps * @build CallerSensitiveFinder * @run main/othervm/timeout=900 CallerSensitiveFinder */ diff --git a/jdk/test/sun/reflect/CallerSensitive/MissingCallerSensitive.java b/jdk/test/sun/reflect/CallerSensitive/MissingCallerSensitive.java index 86b12a6748d..fb2b6c20a7b 100644 --- a/jdk/test/sun/reflect/CallerSensitive/MissingCallerSensitive.java +++ b/jdk/test/sun/reflect/CallerSensitive/MissingCallerSensitive.java @@ -29,7 +29,6 @@ * @modules java.base/sun.reflect * jdk.jdeps/com.sun.tools.classfile * jdk.jdeps/com.sun.tools.jdeps - * @modules java.base/sun.reflect * @compile -XDignore.symbol.file MissingCallerSensitive.java * @build CallerSensitiveFinder * @run main MissingCallerSensitive diff --git a/jdk/test/sun/security/provider/FileInputStreamPool/FileInputStreamPoolTest.java b/jdk/test/sun/security/provider/FileInputStreamPool/FileInputStreamPoolTest.java index 762515637f3..63d5fce25ba 100644 --- a/jdk/test/sun/security/provider/FileInputStreamPool/FileInputStreamPoolTest.java +++ b/jdk/test/sun/security/provider/FileInputStreamPool/FileInputStreamPoolTest.java @@ -24,6 +24,7 @@ /** * @test * @bug 8047769 + * @modules java.base/sun.security.provider * @summary SecureRandom should be more frugal with file descriptors */ diff --git a/jdk/test/sun/security/provider/certpath/Extensions/OCSPNonceExtensionTests.java b/jdk/test/sun/security/provider/certpath/Extensions/OCSPNonceExtensionTests.java index 9f3b1044ccc..b3561b4e8dd 100644 --- a/jdk/test/sun/security/provider/certpath/Extensions/OCSPNonceExtensionTests.java +++ b/jdk/test/sun/security/provider/certpath/Extensions/OCSPNonceExtensionTests.java @@ -25,6 +25,9 @@ * @test * @bug 8046321 * @summary Unit tests for OCSPNonceExtension objects + * @modules java.base/sun.security.provider.certpath + * java.base/sun.security.util + * java.base/sun.security.x509 */ import java.security.cert.Extension; diff --git a/jdk/test/sun/security/provider/certpath/ResponderId/ResponderIdTests.java b/jdk/test/sun/security/provider/certpath/ResponderId/ResponderIdTests.java index 30aa5230698..0e1da683f1f 100644 --- a/jdk/test/sun/security/provider/certpath/ResponderId/ResponderIdTests.java +++ b/jdk/test/sun/security/provider/certpath/ResponderId/ResponderIdTests.java @@ -25,6 +25,8 @@ * @test * @bug 8046321 * @summary OCSP Stapling for TLS (ResponderId tests) + * @modules java.base/sun.security.provider.certpath + * java.base/sun.security.x509 */ import java.io.*; diff --git a/jdk/test/sun/security/ssl/ExtensionType/OptimalListSize.java b/jdk/test/sun/security/ssl/ExtensionType/OptimalListSize.java index 86e39359c2f..d6b5280f98b 100644 --- a/jdk/test/sun/security/ssl/ExtensionType/OptimalListSize.java +++ b/jdk/test/sun/security/ssl/ExtensionType/OptimalListSize.java @@ -26,6 +26,7 @@ * @bug 8080535 * @summary Expected size of Character.UnicodeBlock.map is not optimal * @library /lib/testlibrary + * @modules java.base/sun.security.ssl * @build jdk.testlibrary.OptimalCapacity * @run main OptimalListSize */ diff --git a/jdk/test/sun/security/ssl/SSLSocketImpl/CheckMethods.java b/jdk/test/sun/security/ssl/SSLSocketImpl/CheckMethods.java index 1d63110cdf7..a5bd7f0cad4 100644 --- a/jdk/test/sun/security/ssl/SSLSocketImpl/CheckMethods.java +++ b/jdk/test/sun/security/ssl/SSLSocketImpl/CheckMethods.java @@ -29,7 +29,6 @@ import java.net.*; import java.util.*; import java.lang.reflect.*; -import com.sun.net.ssl.internal.ssl.*; public class CheckMethods { static boolean debug = false; diff --git a/jdk/test/sun/security/x509/AVA/EmailAddressEncoding.java b/jdk/test/sun/security/x509/AVA/EmailAddressEncoding.java index 33d1d9de794..0e447d57448 100644 --- a/jdk/test/sun/security/x509/AVA/EmailAddressEncoding.java +++ b/jdk/test/sun/security/x509/AVA/EmailAddressEncoding.java @@ -33,7 +33,6 @@ import java.io.*; import javax.security.auth.x500.*; import sun.security.util.*; import sun.security.pkcs.*; -import sun.security.x509.*; public class EmailAddressEncoding { diff --git a/jdk/test/sun/text/resources/LocaleDataTest.java b/jdk/test/sun/text/resources/LocaleDataTest.java index 08f8f31cd46..86ccbd594b3 100644 --- a/jdk/test/sun/text/resources/LocaleDataTest.java +++ b/jdk/test/sun/text/resources/LocaleDataTest.java @@ -38,6 +38,7 @@ * 7114053 7074882 7040556 8008577 8013836 8021121 6192407 6931564 8027695 * 8017142 8037343 8055222 8042126 8074791 8075173 8080774 8129361 8134916 * @summary Verify locale data + * @modules java.base/sun.util.resources * @run main LocaleDataTest * @run main LocaleDataTest -cldr * diff --git a/jdk/test/sun/util/logging/PlatformLoggerTest.java b/jdk/test/sun/util/logging/PlatformLoggerTest.java index c3719c96eb5..0bf94d64a5a 100644 --- a/jdk/test/sun/util/logging/PlatformLoggerTest.java +++ b/jdk/test/sun/util/logging/PlatformLoggerTest.java @@ -30,6 +30,7 @@ * is not initialized. * * @modules java.base/sun.util.logging + * java.logging/sun.util.logging.internal * @compile -XDignore.symbol.file PlatformLoggerTest.java * @run main/othervm PlatformLoggerTest */