diff --git a/.hgtags b/.hgtags
index 7e5d08a0b80..1cd85cdd1a5 100644
--- a/.hgtags
+++ b/.hgtags
@@ -96,3 +96,4 @@ a4e6aa1f45ad23a6f083ed98d970b5006ea4d292 jdk7-b116
4951967a61b4dbbf514828879f57bd1a0d4b420b jdk7-b119
8c840d3ab24f8d0f422b991638acb44b6ab1d98c jdk7-b120
0ce0a2c3a6926677dc507839a820ab6625541e5a jdk7-b121
+6f09ea1c034f087916d2a8cf0d22be768400118f jdk7-b122
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index 9180b32f19c..86759295812 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -96,3 +96,4 @@ a12a9e78df8a9d534da0b4a244ed68f0de0bd58e jdk7-b118
661360bef6ccad6c119f067f5829b207de80c936 jdk7-b119
366ff0b6d2151595629806b033e2e1497e3a55d4 jdk7-b120
2c2d4f88637b488014c37e1a2eb401f68bca8838 jdk7-b121
+f1591eed71f64f6eba79fb7426f5616cc4dfea73 jdk7-b122
diff --git a/README b/README
index 5dd05f46abe..eef68df24a7 100644
--- a/README
+++ b/README
@@ -26,6 +26,6 @@ Simple Build Instructions:
gnumake all
The resulting JDK image should be found in build/*/j2sdk-image
-where gnumake is GNU make 3.78.1 or newer, /usr/bin/make on Linux and
+where gnumake is GNU make 3.81 or newer, /usr/bin/make on Linux and
/usr/sfw/bin/gmake or /opt/sfw/bin/gmake on Solaris.
diff --git a/README-builds.html b/README-builds.html
index 81ada58e303..1c2504c4dc5 100644
--- a/README-builds.html
+++ b/README-builds.html
@@ -524,7 +524,7 @@
A few notes about using GNU make:
-
- In general, you need GNU make version 3.78.1 or newer.
+ In general, you need GNU make version 3.81 or newer.
-
Place the location of the GNU make binary in the PATH.
diff --git a/corba/.hgtags b/corba/.hgtags
index de24085cb76..331d411b743 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -96,3 +96,4 @@ fa502e4834dac2176499cc1f44794d5dc32a11b9 jdk7-b117
39829414ae31a0080578a49b751899edd518cd7d jdk7-b119
cff5a173ec1e89013359e804a3e31736ef6fb462 jdk7-b120
2cc9f32992101732b23730b737740e64ebc5fa89 jdk7-b121
+1523a060032c8a5b7840198da8911abeff88118f jdk7-b122
diff --git a/corba/make/common/shared/Platform.gmk b/corba/make/common/shared/Platform.gmk
index e1bb4466531..07d0b505d27 100644
--- a/corba/make/common/shared/Platform.gmk
+++ b/corba/make/common/shared/Platform.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -383,7 +383,7 @@ endif
REQUIRED_ZIP_VER = 2.2
REQUIRED_UNZIP_VER = 5.12
-REQUIRED_MAKE_VER = 3.78
+REQUIRED_MAKE_VER = 3.81
# Unix type settings (same for all unix platforms)
ifneq ($(PLATFORM), windows)
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java b/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java
index da369f9c365..0c7844325cd 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java
@@ -30,12 +30,14 @@ import com.sun.corba.se.impl.orbutil.ORBConstants;
import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
import com.sun.corba.se.impl.protocol.giopmsgheaders.FragmentMessage;
+import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
import com.sun.corba.se.impl.encoding.BufferManagerWrite;
import com.sun.corba.se.impl.encoding.ByteBufferWithInfo;
import com.sun.corba.se.impl.encoding.CDROutputObject;
import com.sun.corba.se.spi.orb.ORB;
import com.sun.corba.se.pept.transport.Connection;
import com.sun.corba.se.pept.encoding.OutputObject;
+import org.omg.CORBA.SystemException;
/**
* Streaming buffer manager.
@@ -66,7 +68,13 @@ public class BufferManagerWriteStream extends BufferManagerWrite
// Set the fragment's moreFragments field to true
MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT);
- sendFragment(false);
+ try {
+ sendFragment(false);
+ } catch(SystemException se){
+ orb.getPIHandler().invokeClientPIEndingPoint(
+ ReplyMessage.SYSTEM_EXCEPTION, se);
+ throw se;
+ }
// Reuse the old buffer
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java b/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
index 09eb3d2ea2e..a8f55670d4e 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
@@ -85,6 +85,9 @@ public class ObjectStreamClass implements java.io.Serializable {
private static Hashtable translatedFields;
+ /** true if represents enum type */
+ private boolean isEnum;
+
private static final Bridge bridge =
(Bridge)AccessController.doPrivileged(
new PrivilegedAction() {
@@ -359,6 +362,7 @@ public class ObjectStreamClass implements java.io.Serializable {
}
name = cl.getName();
+ isEnum = Enum.class.isAssignableFrom(cl);
superclass = superdesc;
serializable = serial;
if (!forProxyClass) {
@@ -401,7 +405,8 @@ public class ObjectStreamClass implements java.io.Serializable {
if (!serializable ||
externalizable ||
forProxyClass ||
- name.equals("java.lang.String")) {
+ name.equals("java.lang.String") ||
+ isEnum) {
fields = NO_FIELDS;
} else if (serializable) {
/* Ask for permission to override field access checks.
@@ -502,7 +507,7 @@ public class ObjectStreamClass implements java.io.Serializable {
*
* NonSerializable classes have a serialVerisonUID of 0L.
*/
- if (isNonSerializable()) {
+ if (isNonSerializable() || isEnum) {
suid = 0L;
} else {
// Lookup special Serializable members using reflection.
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/AOMEntry.java b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/AOMEntry.java
index b7564e716e4..d906afef923 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/AOMEntry.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/AOMEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -45,6 +45,10 @@ import com.sun.corba.se.spi.orbutil.fsm.StateEngineFactory ;
import com.sun.corba.se.impl.orbutil.concurrent.Mutex ;
import com.sun.corba.se.impl.orbutil.concurrent.CondVar ;
+import org.omg.CORBA.SystemException ;
+
+import org.omg.PortableServer.POAPackage.ObjectAlreadyActive ;
+
/** AOMEntry represents a Servant or potential Servant in the ActiveObjectMap.
* It may be in several states to allow for long incarnate or etherealize operations.
* The methods on this class mostly represent input symbols to the state machine
@@ -121,6 +125,12 @@ public class AOMEntry extends FSMImpl {
}
} ;
+ private static Action oaaAction = new ActionBase( "throwObjectAlreadyActive" ) {
+ public void doIt( FSM fsm, Input in ) {
+ throw new RuntimeException( new ObjectAlreadyActive() ) ;
+ }
+ } ;
+
private static Guard waitGuard = new GuardBase( "wait" ) {
public Guard.Result evaluate( FSM fsm, Input in ) {
AOMEntry entry = (AOMEntry)fsm ;
@@ -173,19 +183,23 @@ public class AOMEntry extends FSMImpl {
engine.add( INCARN, START_ETH, waitGuard, null, INCARN ) ;
engine.add( INCARN, INC_DONE, null, VALID ) ;
engine.add( INCARN, INC_FAIL, decrementAction, INVALID ) ;
+ engine.add( INCARN, ACTIVATE, oaaAction, INCARN ) ;
engine.add( VALID, ENTER, incrementAction, VALID ) ;
engine.add( VALID, EXIT, decrementAction, VALID ) ;
engine.add( VALID, START_ETH, greaterZeroGuard, null, ETHP ) ;
engine.add( VALID, START_ETH, zeroGuard, null, ETH ) ;
+ engine.add( VALID, ACTIVATE, oaaAction, VALID ) ;
engine.add( ETHP, ENTER, waitGuard, null, ETHP ) ;
engine.add( ETHP, START_ETH, null, ETHP ) ;
engine.add( ETHP, EXIT, greaterOneGuard, decrementAction, ETHP ) ;
engine.add( ETHP, EXIT, oneGuard, decrementAction, ETH ) ;
+ engine.add( ETHP, ACTIVATE, oaaAction, ETHP ) ;
engine.add( ETH, START_ETH, null, ETH ) ;
engine.add( ETH, ETH_DONE, null, DESTROYED ) ;
+ engine.add( ETH, ACTIVATE, oaaAction, ETH ) ;
engine.add( ETH, ENTER, waitGuard, null, ETH ) ;
engine.setDefault( DESTROYED, throwIllegalStateExceptionAction, DESTROYED ) ;
@@ -217,7 +231,17 @@ public class AOMEntry extends FSMImpl {
public void etherealizeComplete() { doIt( ETH_DONE ) ; }
public void incarnateComplete() { doIt( INC_DONE ) ; }
public void incarnateFailure() { doIt( INC_FAIL ) ; }
- public void activateObject() { doIt( ACTIVATE ) ; }
+ public void activateObject() throws ObjectAlreadyActive {
+ try {
+ doIt( ACTIVATE ) ;
+ } catch (RuntimeException exc) {
+ Throwable thr = exc.getCause() ;
+ if (thr instanceof ObjectAlreadyActive)
+ throw (ObjectAlreadyActive)thr ;
+ else
+ throw exc ;
+ }
+ }
public void enter() { doIt( ENTER ) ; }
public void exit() { doIt( EXIT ) ; }
}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java
index b396ac5227d..1bc9130e109 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -107,13 +107,9 @@ public abstract class POAPolicyMediatorBase_R extends POAPolicyMediatorBase {
throw new ServantAlreadyActive();
ActiveObjectMap.Key key = new ActiveObjectMap.Key( id ) ;
- // Note that this can't happen for system assigned IDs since the
- // POA never hands out the same ID. However, we make this redundant
- // check here to share the code.
- if (activeObjectMap.containsKey(key))
- throw new ObjectAlreadyActive() ;
-
AOMEntry entry = activeObjectMap.get( key ) ;
+
+ // Check for an ObjectAlreadyActive error
entry.activateObject() ;
activateServant( key, entry, servant ) ;
}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java
index 0bdd1072128..65d8246f7ad 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -245,7 +245,14 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
// All access to resolver, localResolver, and urlOperation must be protected using
// resolverLock. Do not hold the ORBImpl lock while accessing
// resolver, or deadlocks may occur.
- private Object resolverLock ;
+ // Note that we now have separate locks for each resolver type. This is due
+ // to bug 6980681 and 6238477, which was caused by a deadlock while resolving a
+ // corbaname: URL that contained a reference to the same ORB as the
+ // ORB making the call to string_to_object. This caused a deadlock between the
+ // client thread holding the single lock for access to the urlOperation,
+ // and the server thread handling the client is_a request waiting on the
+ // same lock to access the localResolver.
+
// Used for resolver_initial_references and list_initial_services
private Resolver resolver ;
@@ -255,8 +262,14 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
// Converts strings to object references for resolvers and string_to_object
private Operation urlOperation ;
+ private final Object urlOperationLock = new java.lang.Object() ;
private CorbaServerRequestDispatcher insNamingDelegate ;
+ // resolverLock must be used for all access to either resolver or
+ // localResolver, since it is possible for the resolver to indirectly
+ // refer to the localResolver. Also used to protect access to
+ // insNamingDelegate.
+ private final Object resolverLock = new Object() ;
private TaggedComponentFactoryFinder taggedComponentFactoryFinder ;
@@ -396,7 +409,6 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
}
};
- resolverLock = new java.lang.Object() ;
requestDispatcherRegistry = new RequestDispatcherRegistryImpl(
this, ORBConstants.DEFAULT_SCID);
@@ -832,7 +844,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
if (str == null)
throw wrapper.nullParam() ;
- synchronized (resolverLock) {
+ synchronized (urlOperationLock) {
org.omg.CORBA.Object obj = (org.omg.CORBA.Object)op.operate( str ) ;
return obj ;
}
@@ -1778,7 +1790,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
*/
public void setURLOperation( Operation stringToObject )
{
- synchronized (resolverLock) {
+ synchronized (urlOperationLock) {
urlOperation = stringToObject ;
}
}
@@ -1788,7 +1800,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
*/
public Operation getURLOperation()
{
- synchronized (resolverLock) {
+ synchronized (urlOperationLock) {
return urlOperation ;
}
}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_pt_BR.properties b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_pt_BR.properties
new file mode 100644
index 00000000000..17b104b8e2f
--- /dev/null
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_pt_BR.properties
@@ -0,0 +1,107 @@
+
+# Copyright (c) 2001, 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. 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.
+#
+
+orbd.usage=Uso: {0} \n\nem que inclui:\n -port porta de ativa\u00e7\u00e3o na qual o ORBD deve ser iniciado, padr\u00e3o 1049 (opcional)\n -defaultdb diret\u00f3rio dos arquivos ORBD, padr\u00e3o "./orb.db" (opcional)\n -serverid id do servidor para ORBD, padr\u00e3o 1 (opcional)\n -ORBInitialPort porta inicial (necess\u00e1rio)\n -ORBInitialHost nome de host inicial (necess\u00e1rio)\n
+
+servertool.usage=Uso: {0} \n\nem que inclui:\n -ORBInitialPort porta inicial (necess\u00e1rio)\n -ORBInitialHost nome de host inicial (necess\u00e1rio)\n
+servertool.banner=\n\nBem-vindo a ferramenta de servidor IDL Java \ninsira os comandos no prompt \n
+servertool.shorthelp=\n\n\tComandos dispon\u00edveis: \n\t------------------- \n
+servertool.baddef=Servidor mal definido: {0}
+servertool.nosuchserver=\tservidor n\u00e3o encontrado.
+servertool.helddown=\to servidor est\u00e1 em espera.
+servertool.nosuchorb=\tORB inv\u00e1lido.
+servertool.serverup=\to servidor j\u00e1 est\u00e1 ativo.
+servertool.appname=\tapplicationName - {0}
+servertool.name=\tname - {0}
+servertool.classpath=\tclasspath - {0}
+servertool.args=\targs - {0}
+servertool.vmargs=\tvmargs - {0}
+servertool.serverid=\tserver id - {0}
+servertool.servernotrunning=\to servidor n\u00e3o est\u00e1 em execu\u00e7\u00e3o.
+servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n
+servertool.register1=registra um servidor ativ\u00e1vel
+servertool.register2=\tservidor registrado (serverid = {0}).
+servertool.register3=\tservidor registrado, mas em espera (serverid = {0}).
+servertool.register4=\tservidor j\u00e1 registrado (serverid = {0}).
+
+servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n
+servertool.unregister1=cancela o registro de um servidor registrado
+servertool.unregister2=\tservidor n\u00e3o registrado.
+
+servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n
+servertool.locate1=localiza portas de tipo espec\u00edfico para um servidor registrado
+servertool.locate2=\n\n\tNome do host {0} \n\n\t\tPorta\t\tTipo de porta\t\tId do ORB\n\t\t----\t\t---------\t\t------\n
+servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n
+servertool.locateorb1=localiza portas para um orb espec\u00edfico de servidor registrado
+servertool.locateorb2=\n\n\tNome do host {0} \n\n\t\tPorta\t\tTipo de porta\t\tId do ORB\n\t\t----\t\t--------\t\t------\n
+servertool.getserverid=\n\tgetserverid [ -applicationName ] \n
+servertool.getserverid1=retorna o id do servidor de um applicationName
+servertool.getserverid2=\tID do servidor de applicationName {0} \u00e9 {1}
+
+servertool.list=\n\tlist\n
+servertool.list1=lista todos os servidores registrados
+servertool.list2=\n\tId do servidor\tNome de classe do servidor\t\tAplicativo do servidor\n\t---------\t-----------------\t\t------------------\n
+servertool.listactive=\n\tlistactive
+servertool.listactive1=lista os servidores atualmente ativos
+servertool.listappnames=\tlistappnames\n
+servertool.listappnames1=lista os applicationNames atualmente definidos
+servertool.listappnames2=applicationNames do servidor atualmente definidos:
+
+servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n
+servertool.shutdown1=desliga um servidor registrado
+servertool.shutdown2=\tservidor desligado com \u00eaxito.
+servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n
+servertool.startserver1=inicia um servidor registrado
+servertool.startserver2=\tservidor iniciado com \u00eaxito.
+
+servertool.quit=\n\tquit\n
+servertool.quit1=sai desta ferramenta
+
+servertool.help=\thelp\n\tOR\n\thelp \n
+servertool.help1=obt\u00e9m ajuda
+
+servertool.orbidmap=\tUso: orblist [ -serverid | -applicationName ]\n
+servertool.orbidmap1=lista de nomes de orb e seus mapeamentos
+servertool.orbidmap2=\n\tId de ORB\t\tNome de ORB\n\t------\t\t--------\n
+pnameserv.success=NameServer persistente iniciado com \u00eaxito
+
+
+bootstrap.usage=Uso: {0} \n\nem que inclui:\n -ORBInitialPort porta inicial (necess\u00e1rio)\n -InitialServicesFile arquivo que cont\u00e9m a lista de servi\u00e7os iniciais (necess\u00e1rio)\n
+bootstrap.success=configurando porta para {0} e lendo servi\u00e7os de {1}
+bootstrap.filenotreadable=o arquivo {0} n\u00e3o \u00e9 leg\u00edvel
+bootstrap.filenotfound=arquivo {0} n\u00e3o encontrado
+bootstrap.exception=exce\u00e7\u00e3o capturada ao salvar as propriedades no arquivo {0}: Exce\u00e7\u00e3o {1}
+
+tnameserv.exception=uma exce\u00e7\u00e3o capturada ao iniciar o servi\u00e7o de inicializa\u00e7\u00e3o na porta {0}
+tnameserv.usage=tente usar outra porta com os argumentos de linha de comando -ORBInitialPort
+tnameserv.invalidhostoption=ORBInitialHost n\u00e3o \u00e9 uma op\u00e7\u00e3o v\u00e1lida para NameService
+tnameserv.orbinitialport0=ORBInitialPort 0 n\u00e3o \u00e9 uma op\u00e7\u00e3o v\u00e1lida para NameService
+tnameserv.hs1=Contexto de nomea\u00e7\u00e3o inicial:\n{0}
+tnameserv.hs2=TransientNameServer: definindo porta para as refer\u00eancias de objeto iniciais: {0}
+tnameserv.hs3=Pronto.
+
+orbd.commfailure=\nFalha ao iniciar ORBD porque ORBinitialPort j\u00e1 est\u00e1 em uso
+orbd.internalexception=\nFalha ao iniciar ORBD devido a uma exce\u00e7\u00e3o interna. \nPoss\u00edveis causas: \n1. ORBInitialPort especificado ou ORBActivationPort j\u00e1 em uso \n2. Sem permiss\u00e3o de grava\u00e7\u00e3o para gravar orb.db
+
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java
index 5c7555f3c70..7728a677ecd 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -122,9 +122,6 @@ public class CorbaClientRequestDispatcherImpl
implements
ClientRequestDispatcher
{
- // Used for locking
- private Object lock = new Object();
-
public OutputObject beginRequest(Object self, String opName,
boolean isOneWay, ContactInfo contactInfo)
{
@@ -151,7 +148,8 @@ public class CorbaClientRequestDispatcherImpl
// This locking is done so that multiple connections are not created
// for the same endpoint
- synchronized (lock) {
+ //6929137 - Synchronized on contactInfo to avoid blocking across multiple endpoints
+ synchronized (contactInfo) {
if (contactInfo.isConnectionBased()) {
if (contactInfo.shouldCacheConnection()) {
connection = (CorbaConnection)
@@ -256,7 +254,7 @@ public class CorbaClientRequestDispatcherImpl
registerWaiter(messageMediator);
// Do connection reclaim now
- synchronized (lock) {
+ synchronized (contactInfo) {
if (contactInfo.isConnectionBased()) {
if (contactInfo.shouldCacheConnection()) {
OutboundConnectionCache connectionCache =
@@ -387,11 +385,15 @@ public class CorbaClientRequestDispatcherImpl
boolean retry =
getContactInfoListIterator(orb)
.reportException(messageMediator.getContactInfo(), e);
- if (retry) {
- // Must run interceptor end point before retrying.
- Exception newException =
+
+ //Bug 6382377: must not lose exception in PI
+
+ // Must run interceptor end point before retrying.
+ Exception newException =
orb.getPIHandler().invokeClientPIEndingPoint(
- ReplyMessage.SYSTEM_EXCEPTION, e);
+ ReplyMessage.SYSTEM_EXCEPTION, e);
+
+ if (retry) {
if (newException == e) {
continueOrThrowSystemOrRemarshal(messageMediator,
new RemarshalException());
@@ -400,6 +402,14 @@ public class CorbaClientRequestDispatcherImpl
newException);
}
} else {
+ if (newException instanceof RuntimeException){
+ throw (RuntimeException)newException;
+ }
+ else if (newException instanceof RemarshalException)
+ {
+ throw (RemarshalException)newException;
+ }
+
// NOTE: Interceptor ending point will run in releaseReply.
throw e;
}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java
index d8608f21ab5..0cbce53ffc1 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -34,6 +34,7 @@ import com.sun.corba.se.pept.transport.ConnectionCache;
import com.sun.corba.se.spi.logging.CORBALogDomains;
import com.sun.corba.se.spi.orb.ORB;
+import com.sun.corba.se.spi.transport.CorbaConnection;
import com.sun.corba.se.spi.transport.CorbaConnectionCache;
import com.sun.corba.se.impl.logging.ORBUtilSystemException;
@@ -87,6 +88,14 @@ public abstract class CorbaConnectionCacheBase
}
}
+ public void close() {
+ synchronized (backingStore()) {
+ for (Object obj : values()) {
+ ((CorbaConnection)obj).closeConnectionResources() ;
+ }
+ }
+ }
+
public long numberOfIdleConnections()
{
long count = 0;
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaTransportManagerImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaTransportManagerImpl.java
index 5f56b560a95..fae2d157969 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaTransportManagerImpl.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaTransportManagerImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -38,6 +38,7 @@ import org.omg.CORBA.INTERNAL;
import org.omg.CORBA.CompletionStatus;
import com.sun.corba.se.pept.transport.Acceptor;
+import com.sun.corba.se.pept.transport.ConnectionCache;
import com.sun.corba.se.pept.transport.ByteBufferPool;
import com.sun.corba.se.pept.transport.ContactInfo;
import com.sun.corba.se.pept.transport.InboundConnectionCache;
@@ -49,6 +50,8 @@ import com.sun.corba.se.spi.ior.ObjectAdapterId;
import com.sun.corba.se.spi.orb.ORB;
import com.sun.corba.se.spi.transport.CorbaAcceptor;
import com.sun.corba.se.spi.transport.CorbaTransportManager;
+import com.sun.corba.se.pept.transport.Connection;
+import com.sun.corba.se.pept.transport.ConnectionCache;
// REVISIT - impl/poa specific:
import com.sun.corba.se.impl.oa.poa.Policies;
@@ -182,6 +185,12 @@ public class CorbaTransportManagerImpl
if (orb.transportDebugFlag) {
dprint(".close->");
}
+ for (Object cc : outboundConnectionCaches.values()) {
+ ((ConnectionCache)cc).close() ;
+ }
+ for (Object cc : inboundConnectionCaches.values()) {
+ ((ConnectionCache)cc).close() ;
+ }
getSelector(0).close();
} finally {
if (orb.transportDebugFlag) {
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java
index 8686439b84f..1c60088a7a3 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -32,6 +32,7 @@ import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Map;
import java.util.Iterator;
import java.util.List;
@@ -66,7 +67,7 @@ public class SelectorImpl
private List deferredRegistrations;
private List interestOpsList;
private HashMap listenerThreads;
- private HashMap readerThreads;
+ private Map readerThreads;
private boolean selectorStarted;
private boolean closed;
private ORBUtilSystemException wrapper ;
@@ -81,7 +82,7 @@ public class SelectorImpl
deferredRegistrations = new ArrayList();
interestOpsList = new ArrayList();
listenerThreads = new HashMap();
- readerThreads = new HashMap();
+ readerThreads = java.util.Collections.synchronizedMap(new HashMap());
closed = false;
wrapper = ORBUtilSystemException.get(orb,CORBALogDomains.RPC_TRANSPORT);
}
@@ -178,8 +179,13 @@ public class SelectorImpl
}
if (eventHandler.shouldUseSelectThreadToWait()) {
- SelectionKey selectionKey = eventHandler.getSelectionKey();
- selectionKey.cancel();
+ SelectionKey selectionKey ;
+ synchronized(deferredRegistrations) {
+ selectionKey = eventHandler.getSelectionKey();
+ }
+ if (selectionKey != null) {
+ selectionKey.cancel();
+ }
selector.wakeup();
return;
}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java
index e294067184e..913cd903755 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java
@@ -811,6 +811,7 @@ public class SocketOrChannelConnectionImpl
dprint(".close: " + this, e);
}
}
+ closeConnectionResources();
} finally {
if (orb.transportDebugFlag) {
dprint(".close<-: " + this);
@@ -818,6 +819,28 @@ public class SocketOrChannelConnectionImpl
}
}
+ public void closeConnectionResources() {
+ if (orb.transportDebugFlag) {
+ dprint(".closeConnectionResources->: " + this);
+ }
+ Selector selector = orb.getTransportManager().getSelector(0);
+ selector.unregisterForEvent(this);
+ try {
+ if (socketChannel != null)
+ socketChannel.close() ;
+ if (socket != null && !socket.isClosed())
+ socket.close() ;
+ } catch (IOException e) {
+ if (orb.transportDebugFlag) {
+ dprint( ".closeConnectionResources: " + this, e ) ;
+ }
+ }
+ if (orb.transportDebugFlag) {
+ dprint(".closeConnectionResources<-: " + this);
+ }
+ }
+
+
public Acceptor getAcceptor()
{
return acceptor;
diff --git a/corba/src/share/classes/com/sun/corba/se/pept/transport/ConnectionCache.java b/corba/src/share/classes/com/sun/corba/se/pept/transport/ConnectionCache.java
index d5bee7d927f..ac926d063c0 100644
--- a/corba/src/share/classes/com/sun/corba/se/pept/transport/ConnectionCache.java
+++ b/corba/src/share/classes/com/sun/corba/se/pept/transport/ConnectionCache.java
@@ -41,6 +41,12 @@ public interface ConnectionCache
public long numberOfBusyConnections();
public boolean reclaim();
+
+ /** Close all connections in the connection cache.
+ * This is used as a final cleanup, and will result
+ * in abrupt termination of any pending communications.
+ */
+ public void close();
}
// End of file.
diff --git a/corba/src/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java b/corba/src/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java
index b0e3f6f04dc..c7ec1ac0aa1 100644
--- a/corba/src/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java
+++ b/corba/src/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java
@@ -163,6 +163,10 @@ public interface CorbaConnection
// REVISIT - MessageMediator parameter?
public void serverRequestProcessingBegins();
public void serverRequestProcessingEnds();
+
+ /** Clean up all connection resources. Used when shutting down an ORB.
+ */
+ public void closeConnectionResources();
}
// End of file.
diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Stub.java b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Stub.java
index 3efe5609535..c305ada5b24 100644
--- a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Stub.java
+++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Stub.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -344,17 +344,27 @@ public class Stub implements AuxGen
stream.println (" String str = s.readUTF ();");
stream.println (" String[] args = null;");
stream.println (" java.util.Properties props = null;");
- stream.println (" org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);");
+ stream.println (" org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);");
+ stream.println (" try {");
+ stream.println (" org.omg.CORBA.Object obj = orb.string_to_object (str);");
stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();");
stream.println (" _set_delegate (delegate);");
+ stream.println (" } finally {");
+ stream.println (" orb.destroy() ;");
+ stream.println (" }");
stream.println (" }");
stream.println ();
stream.println (" private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException");
stream.println (" {");
stream.println (" String[] args = null;");
stream.println (" java.util.Properties props = null;");
- stream.println (" String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);");
+ stream.println (" org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);");
+ stream.println (" try {");
+ stream.println (" String str = orb.object_to_string (this);");
stream.println (" s.writeUTF (str);");
+ stream.println (" } finally {");
+ stream.println (" orb.destroy() ;");
+ stream.println (" }");
stream.println (" }");
}
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index bb184649761..b92574b671c 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -134,3 +134,5 @@ bdbc48857210a509b3c50a3291ecb9dd6a72e016 jdk7-b115
5484e7c53fa7da5e869902437ee08a9ae10c1c69 jdk7-b119
f5603a6e50422046ebc0d2f1671d55cb8f1bf1e9 jdk7-b120
3f3653ab7af8dc1ddb9fa75dad56bf94f89e81a8 jdk7-b121
+3a548dc9cb456110ca8fc1514441a8c3bda0014d jdk7-b122
+5484e7c53fa7da5e869902437ee08a9ae10c1c69 hs20-b03
diff --git a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/agent/src/os/linux/ps_proc.c
index 5ad3ff7f367..73b99c50021 100644
--- a/hotspot/agent/src/os/linux/ps_proc.c
+++ b/hotspot/agent/src/os/linux/ps_proc.c
@@ -121,15 +121,13 @@ static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct use
#define ptrace_getregs(request, pid, addr, data) ptrace(request, pid, data, addr)
#endif
-#ifdef _LP64
-#ifdef PTRACE_GETREGS64
+#if defined(_LP64) && defined(PTRACE_GETREGS64)
#define PTRACE_GETREGS_REQ PTRACE_GETREGS64
-#endif
-#else
-#if defined(PTRACE_GETREGS) || defined(PT_GETREGS)
+#elif defined(PTRACE_GETREGS)
#define PTRACE_GETREGS_REQ PTRACE_GETREGS
+#elif defined(PT_GETREGS)
+#define PTRACE_GETREGS_REQ PT_GETREGS
#endif
-#endif /* _LP64 */
#ifdef PTRACE_GETREGS_REQ
if (ptrace_getregs(PTRACE_GETREGS_REQ, pid, user, NULL) < 0) {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java
index fb7727a7cc3..31cc2a956e1 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java
@@ -60,10 +60,7 @@ public class ConstantPool extends Oop implements ClassConstants {
headerSize = type.getSize();
elementSize = 0;
// fetch constants:
- MULTI_OPERAND_COUNT_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_multi_operand_count_offset").intValue();
- MULTI_OPERAND_BASE_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_multi_operand_base_offset").intValue();
INDY_BSM_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_bsm_offset").intValue();
- INDY_NT_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_nt_offset").intValue();
INDY_ARGC_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_argc_offset").intValue();
INDY_ARGV_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_argv_offset").intValue();
}
@@ -83,10 +80,7 @@ public class ConstantPool extends Oop implements ClassConstants {
private static long headerSize;
private static long elementSize;
- private static int MULTI_OPERAND_COUNT_OFFSET;
- private static int MULTI_OPERAND_BASE_OFFSET;
private static int INDY_BSM_OFFSET;
- private static int INDY_NT_OFFSET;
private static int INDY_ARGC_OFFSET;
private static int INDY_ARGV_OFFSET;
@@ -296,20 +290,23 @@ public class ConstantPool extends Oop implements ClassConstants {
}
/** Lookup for multi-operand (InvokeDynamic) entries. */
- public int[] getMultiOperandsAt(int i) {
+ public short[] getBootstrapSpecifierAt(int i) {
if (Assert.ASSERTS_ENABLED) {
Assert.that(getTagAt(i).isInvokeDynamic(), "Corrupted constant pool");
}
- int pos = this.getIntAt(i);
- int countPos = pos + MULTI_OPERAND_COUNT_OFFSET; // == pos-1
- int basePos = pos + MULTI_OPERAND_BASE_OFFSET; // == pos
- if (countPos < 0) return null; // safety first
+ if (getTagAt(i).value() == JVM_CONSTANT_InvokeDynamicTrans)
+ return null;
+ int bsmSpec = extractLowShortFromInt(this.getIntAt(i));
TypeArray operands = getOperands();
if (operands == null) return null; // safety first
- int length = operands.getIntAt(countPos);
- int[] values = new int[length];
- for (int j = 0; j < length; j++) {
- values[j] = operands.getIntAt(basePos+j);
+ int basePos = VM.getVM().buildIntFromShorts(operands.getShortAt(bsmSpec * 2 + 0),
+ operands.getShortAt(bsmSpec * 2 + 1));
+ int argv = basePos + INDY_ARGV_OFFSET;
+ int argc = operands.getShortAt(basePos + INDY_ARGC_OFFSET);
+ int endPos = argv + argc;
+ short[] values = new short[endPos - basePos];
+ for (int j = 0; j < values.length; j++) {
+ values[j] = operands.getShortAt(basePos+j);
}
return values;
}
@@ -334,6 +331,7 @@ public class ConstantPool extends Oop implements ClassConstants {
case JVM_CONSTANT_MethodHandle: return "JVM_CONSTANT_MethodHandle";
case JVM_CONSTANT_MethodType: return "JVM_CONSTANT_MethodType";
case JVM_CONSTANT_InvokeDynamic: return "JVM_CONSTANT_InvokeDynamic";
+ case JVM_CONSTANT_InvokeDynamicTrans: return "JVM_CONSTANT_InvokeDynamic/transitional";
case JVM_CONSTANT_Invalid: return "JVM_CONSTANT_Invalid";
case JVM_CONSTANT_UnresolvedClass: return "JVM_CONSTANT_UnresolvedClass";
case JVM_CONSTANT_UnresolvedClassInError: return "JVM_CONSTANT_UnresolvedClassInError";
@@ -393,6 +391,7 @@ public class ConstantPool extends Oop implements ClassConstants {
case JVM_CONSTANT_MethodHandle:
case JVM_CONSTANT_MethodType:
case JVM_CONSTANT_InvokeDynamic:
+ case JVM_CONSTANT_InvokeDynamicTrans:
visitor.doInt(new IntField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true);
break;
}
@@ -556,19 +555,16 @@ public class ConstantPool extends Oop implements ClassConstants {
break;
}
+ case JVM_CONSTANT_InvokeDynamicTrans:
case JVM_CONSTANT_InvokeDynamic: {
dos.writeByte(cpConstType);
- int[] values = getMultiOperandsAt(ci);
- for (int vn = 0; vn < values.length; vn++) {
- dos.writeShort(values[vn]);
- }
- int bootstrapMethodIndex = values[INDY_BSM_OFFSET];
- int nameAndTypeIndex = values[INDY_NT_OFFSET];
- int argumentCount = values[INDY_ARGC_OFFSET];
- assert(INDY_ARGV_OFFSET + argumentCount == values.length);
- if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + bootstrapMethodIndex
- + ", N&T = " + nameAndTypeIndex
- + ", argc = " + argumentCount);
+ int value = getIntAt(ci);
+ short bsmIndex = (short) extractLowShortFromInt(value);
+ short nameAndTypeIndex = (short) extractHighShortFromInt(value);
+ dos.writeShort(bsmIndex);
+ dos.writeShort(nameAndTypeIndex);
+ if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + bsmIndex
+ + ", N&T = " + nameAndTypeIndex);
break;
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java
index c0780918398..494f1765f13 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java
@@ -321,13 +321,16 @@ public class ClassWriter implements /* imports */ ClassConstants
break;
}
+ case JVM_CONSTANT_InvokeDynamicTrans:
case JVM_CONSTANT_InvokeDynamic: {
dos.writeByte(cpConstType);
- int[] values = cpool.getMultiOperandsAt(ci);
- for (int vn = 0; vn < values.length; vn++) {
- dos.writeShort(values[vn]);
- }
- if (DEBUG) debugMessage("CP[" + ci + "] = INDY indexes = " + Arrays.toString(values));
+ int value = cpool.getIntAt(ci);
+ short bsmIndex = (short) extractLowShortFromInt(value);
+ short nameAndTypeIndex = (short) extractHighShortFromInt(value);
+ dos.writeShort(bsmIndex);
+ dos.writeShort(nameAndTypeIndex);
+ if (DEBUG) debugMessage("CP[" + ci + "] = INDY bsm = " +
+ bsmIndex + ", N&T = " + nameAndTypeIndex);
break;
}
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 49c101fe6a0..d7101696cad 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
@@ -460,7 +460,8 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
return buf.toString();
}
- private String genListOfShort(int[] values) {
+ private String genListOfShort(short[] values) {
+ if (values == null || values.length == 0) return "";
Formatter buf = new Formatter(genHTML);
buf.append('[');
for (int i = 0; i < values.length; i++) {
@@ -594,9 +595,11 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.cell(Integer.toString(cpool.getIntAt(index)));
break;
+ case JVM_CONSTANT_InvokeDynamicTrans:
case JVM_CONSTANT_InvokeDynamic:
buf.cell("JVM_CONSTANT_InvokeDynamic");
- buf.cell(genListOfShort(cpool.getMultiOperandsAt(index)));
+ buf.cell(genLowHighShort(cpool.getIntAt(index)) +
+ genListOfShort(cpool.getBootstrapSpecifierAt(index)));
break;
default:
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java
index 849531da1a5..1ee547be39c 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java
@@ -40,7 +40,7 @@ public class ConstantTag {
private static int JVM_CONSTANT_NameAndType = 12;
private static int JVM_CONSTANT_MethodHandle = 15; // JSR 292
private static int JVM_CONSTANT_MethodType = 16; // JSR 292
- // static int JVM_CONSTANT_InvokeDynamicTrans = 17; // JSR 292, only occurs in old class files
+ private static int JVM_CONSTANT_InvokeDynamicTrans = 17; // JSR 292, only occurs in old class files
private static int JVM_CONSTANT_InvokeDynamic = 18; // JSR 292
private static int JVM_CONSTANT_Invalid = 0; // For bad value initialization
private static int JVM_CONSTANT_UnresolvedClass = 100; // Temporary tag until actual use
@@ -67,6 +67,8 @@ public class ConstantTag {
this.tag = tag;
}
+ public int value() { return tag; }
+
public boolean isKlass() { return tag == JVM_CONSTANT_Class; }
public boolean isField () { return tag == JVM_CONSTANT_Fieldref; }
public boolean isMethod() { return tag == JVM_CONSTANT_Methodref; }
@@ -81,6 +83,7 @@ public class ConstantTag {
public boolean isMethodHandle() { return tag == JVM_CONSTANT_MethodHandle; }
public boolean isMethodType() { return tag == JVM_CONSTANT_MethodType; }
public boolean isInvokeDynamic() { return tag == JVM_CONSTANT_InvokeDynamic; }
+ public boolean isInvokeDynamicTrans() { return tag == JVM_CONSTANT_InvokeDynamicTrans; }
public boolean isInvalid() { return tag == JVM_CONSTANT_Invalid; }
diff --git a/hotspot/make/defs.make b/hotspot/make/defs.make
index 528d9405bf8..48b91684ba7 100644
--- a/hotspot/make/defs.make
+++ b/hotspot/make/defs.make
@@ -101,15 +101,14 @@ ifndef HOTSPOT_RELEASE_VERSION
endif
ifdef HOTSPOT_BUILD_VERSION
-# specified in command line (PRT build)
+# specified in command line
else
- ifdef JPRT_BUILD_VERSION
-# JPR build
- HOTSPOT_BUILD_VERSION=$(JPRT_BUILD_VERSION)
- else
- ifdef COOKED_BUILD_NUMBER
+ ifdef COOKED_BUILD_NUMBER
# JRE build
- HOTSPOT_BUILD_VERSION=
+ HOTSPOT_BUILD_VERSION=
+ else
+ ifdef USER_RELEASE_SUFFIX
+ HOTSPOT_BUILD_VERSION=internal-$(USER_RELEASE_SUFFIX)
else
HOTSPOT_BUILD_VERSION=internal
endif
diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version
index 44a13d661e4..57260490cc0 100644
--- a/hotspot/make/hotspot_version
+++ b/hotspot/make/hotspot_version
@@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2010
HS_MAJOR_VER=20
HS_MINOR_VER=0
-HS_BUILD_NUMBER=03
+HS_BUILD_NUMBER=04
JDK_MAJOR_VER=1
JDK_MINOR_VER=7
diff --git a/hotspot/make/jprt.gmk b/hotspot/make/jprt.gmk
index b7f5292a1b5..7495cc31456 100644
--- a/hotspot/make/jprt.gmk
+++ b/hotspot/make/jprt.gmk
@@ -25,9 +25,6 @@
# JPRT rule to build this workspace
JPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip
-ifdef JPRT_BUILD_VERSION
- MILESTONE=$(JPRT_BUILD_VERSION)
-endif
ifeq ($(OSNAME),windows)
ZIPFLAGS=-q
diff --git a/hotspot/make/linux/makefiles/adlc.make b/hotspot/make/linux/makefiles/adlc.make
index 35b7a89ccff..a4d2babb4b8 100644
--- a/hotspot/make/linux/makefiles/adlc.make
+++ b/hotspot/make/linux/makefiles/adlc.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 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
@@ -42,16 +42,14 @@ SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad
SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \
$(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad
-Src_Dirs += $(GAMMADIR)/src/share/vm/adlc
-
EXEC = $(OUTDIR)/adlc
# set VPATH so make knows where to look for source files
-Src_Dirs_V = ${Src_Dirs} $(GENERATED)/incls
-VPATH += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(GAMMADIR)/src/share/vm/adlc
+VPATH += $(Src_Dirs_V:%=%:)
# set INCLUDES for C preprocessor
-Src_Dirs_I = ${Src_Dirs} $(GENERATED)
+Src_Dirs_I += $(GAMMADIR)/src/share/vm/adlc $(GENERATED)
INCLUDES += $(Src_Dirs_I:%=-I%)
# set flags for adlc compilation
diff --git a/hotspot/make/linux/makefiles/amd64.make b/hotspot/make/linux/makefiles/amd64.make
index b6f1f2f18fc..ecdac17ee3a 100644
--- a/hotspot/make/linux/makefiles/amd64.make
+++ b/hotspot/make/linux/makefiles/amd64.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 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
@@ -22,9 +22,6 @@
#
#
-# Not included in includeDB because it has no dependencies
-Obj_Files += linux_x86_64.o
-
# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
diff --git a/hotspot/make/linux/makefiles/build_vm_def.sh b/hotspot/make/linux/makefiles/build_vm_def.sh
index 2b6f906eee8..fb9a0d57a78 100644
--- a/hotspot/make/linux/makefiles/build_vm_def.sh
+++ b/hotspot/make/linux/makefiles/build_vm_def.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# If we're cross compiling use that path for nm
-if [ "$ALT_COMPILER_PATH" != "" ]; then
+if [ "$CROSS_COMPILE_ARCH" != "" ]; then
NM=$ALT_COMPILER_PATH/nm
else
NM=nm
diff --git a/hotspot/make/linux/makefiles/buildtree.make b/hotspot/make/linux/makefiles/buildtree.make
index af34617f46c..4ba1f0e74b4 100644
--- a/hotspot/make/linux/makefiles/buildtree.make
+++ b/hotspot/make/linux/makefiles/buildtree.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
# OS_FAMILY - operating system
# VARIANT - core, compiler1, compiler2, or tiered
# HOTSPOT_RELEASE_VERSION - .-b (11.0-b07)
-# HOTSPOT_BUILD_VERSION - internal, PRTjob ID, JPRTjob ID
+# HOTSPOT_BUILD_VERSION - internal, internal-$(USER_RELEASE_SUFFIX) or empty
# JRE_RELEASE_VERSION - .. (1.7.0)
#
# Builds the directory trees with makefiles plus some convenience files in
@@ -113,7 +113,7 @@ endif
COMPILER = $(shell sed -n 's/^compiler[ ]*=[ ]*//p' $(PLATFORM_FILE))
SIMPLE_DIRS = \
- $(PLATFORM_DIR)/generated/incls \
+ $(PLATFORM_DIR)/generated/dependencies \
$(PLATFORM_DIR)/generated/adfiles \
$(PLATFORM_DIR)/generated/jvmtifiles
@@ -124,7 +124,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
- env.sh env.csh .dbxrc test_gamma
+ env.sh env.csh jdkpath.sh .dbxrc test_gamma
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@@ -197,11 +197,27 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
echo; \
- echo "Src_Dirs = \\"; \
+ echo "# Used for platform dispatching"; \
+ echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \
+ echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \
+ echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \
+ echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \
+ echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \
+ echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \
+ echo "CFLAGS += \$$(TARGET_DEFINES)"; \
+ echo; \
+ echo "Src_Dirs_V = \\"; \
sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \
echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
+ echo; \
+ echo "Src_Dirs_I = \\"; \
+ echo "\$$(GAMMADIR)/src/share/vm \\"; \
+ echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \
+ echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
+ echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
+ echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
[ -n "$(CFLAGS_BROWSE)" ] && \
echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
[ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
@@ -302,6 +318,13 @@ env.csh: env.sh
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
) > $@
+jdkpath.sh: $(BUILDTREE_MAKE)
+ @echo Creating $@ ...
+ $(QUIETLY) ( \
+ $(BUILDTREE_COMMENT); \
+ echo "JDK=${JAVA_HOME}"; \
+ ) > $@
+
.dbxrc: $(BUILDTREE_MAKE)
@echo Creating $@ ...
$(QUIETLY) ( \
diff --git a/hotspot/make/linux/makefiles/core.make b/hotspot/make/linux/makefiles/core.make
index eb662de79cb..e032d964f57 100644
--- a/hotspot/make/linux/makefiles/core.make
+++ b/hotspot/make/linux/makefiles/core.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 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
@@ -24,8 +24,7 @@
# Sets make macros for making core version of VM
-# Note the effect on includeDB lists in top.make:
-# includeDB_compiler* and ad_.*pp are excluded from the build,
+# Select which files to use (in top.make)
TYPE=CORE
# There is no "core" directory in JDK. Install core build in server directory.
diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make
index 7107858f7d9..aa879b10fc3 100644
--- a/hotspot/make/linux/makefiles/gcc.make
+++ b/hotspot/make/linux/makefiles/gcc.make
@@ -25,7 +25,9 @@
#------------------------------------------------------------------------
# CC, CPP & AS
-ifdef ALT_COMPILER_PATH
+# When cross-compiling the ALT_COMPILER_PATH points
+# to the cross-compilation toolset
+ifdef CROSS_COMPILE_ARCH
CPP = $(ALT_COMPILER_PATH)/g++
CC = $(ALT_COMPILER_PATH)/gcc
else
@@ -42,9 +44,13 @@ CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
# check for precompiled headers support
ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
+# Allow the user to turn off precompiled headers from the command line.
+ifneq ($(USE_PRECOMPILED_HEADER),0)
USE_PRECOMPILED_HEADER=1
PRECOMPILED_HEADER_DIR=.
-PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/incls/_precompiled.incl.gch
+PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled.hpp
+PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
+endif
endif
@@ -144,6 +150,16 @@ ifneq "$(shell expr \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) = 3 \) \)
OPT_CFLAGS/mulnode.o += -O0
endif
+# Flags for generating make dependency flags.
+ifneq ("${CC_VER_MAJOR}", "2")
+DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+ifneq ($(USE_PRECOMPILED_HEADER),1)
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+endif
+
#------------------------------------------------------------------------
# Linker flags
diff --git a/hotspot/make/linux/makefiles/i486.make b/hotspot/make/linux/makefiles/i486.make
index 6764e2d5d1f..86e825d3e9d 100644
--- a/hotspot/make/linux/makefiles/i486.make
+++ b/hotspot/make/linux/makefiles/i486.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 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
@@ -23,8 +23,6 @@
#
# TLS helper, assembled from .s file
-# Not included in includeDB because it has no dependencies
-Obj_Files += linux_x86_32.o
# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
diff --git a/hotspot/make/linux/makefiles/jvmti.make b/hotspot/make/linux/makefiles/jvmti.make
index 7694b1c9b15..292ccc8ef2d 100644
--- a/hotspot/make/linux/makefiles/jvmti.make
+++ b/hotspot/make/linux/makefiles/jvmti.make
@@ -37,11 +37,10 @@ JvmtiOutDir = $(GENERATED)/jvmtifiles
JvmtiSrcDir = $(GAMMADIR)/src/share/vm/prims
InterpreterSrcDir = $(GAMMADIR)/src/share/vm/interpreter
-Src_Dirs += $(JvmtiSrcDir)
# set VPATH so make knows where to look for source files
-Src_Dirs_V = ${Src_Dirs}
-VPATH += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(JvmtiSrcDir)
+VPATH += $(Src_Dirs_V:%=%:)
JvmtiGeneratedNames = \
jvmtiEnv.hpp \
diff --git a/hotspot/make/linux/makefiles/launcher.make b/hotspot/make/linux/makefiles/launcher.make
index 52ba511aea9..d9e34406bcb 100644
--- a/hotspot/make/linux/makefiles/launcher.make
+++ b/hotspot/make/linux/makefiles/launcher.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -24,19 +24,23 @@
# Rules to build gamma launcher, used by vm.make
-# gamma[_g]: launcher
+LAUNCHER_SCRIPT = hotspot
LAUNCHER = gamma
-LAUNCHER_G = $(LAUNCHER)$(G_SUFFIX)
-LAUNCHERDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher
-LAUNCHERFLAGS = $(ARCHFLAG) \
+LAUNCHERDIR := $(GAMMADIR)/src/os/posix/launcher
+LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher
+LAUNCHERFLAGS := $(ARCHFLAG) \
-I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \
+ -I$(LAUNCHERDIR_SHARE) \
-DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
+ -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
+ -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
-DARCH=\"$(LIBARCH)\" \
-DGAMMA \
-DLAUNCHER_TYPE=\"gamma\" \
- -DLINK_INTO_$(LINK_INTO)
+ -DLINK_INTO_$(LINK_INTO) \
+ $(TARGET_DEFINES)
ifeq ($(LINK_INTO),AOUT)
LAUNCHER.o = launcher.o $(JVM_OBJ_FILES)
@@ -55,22 +59,35 @@ LINK_LAUNCHER = $(LINK.c)
LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CC/PRE_HOOK)
LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CC/POST_HOOK)
-launcher.o: launcher.c $(LAUNCHERDIR)/java.c $(LAUNCHERDIR)/java_md.c
- $(CC) -g -c -o $@ launcher.c $(LAUNCHERFLAGS) $(CPPFLAGS)
+LAUNCHER_OUT = launcher
-launcher.c:
- @echo Generating $@
- $(QUIETLY) { \
- echo '#define debug launcher_debug'; \
- echo '#include "java.c"'; \
- echo '#include "java_md.c"'; \
- } > $@
+SUFFIXES += .d
+
+SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c")
+SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c")
+
+OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE))
+
+DEPFILES := $(patsubst %.o,%.d,$(OBJS))
+-include $(DEPFILES)
+
+$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c
+ $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
+ $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS)
+
+$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c
+ $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
+ $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS)
+
+$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
+ $(QUIETLY) echo Linking launcher...
+ $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
+ $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER)
+ $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
+
+$(LAUNCHER): $(LAUNCHER_SCRIPT)
+
+$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script
+ $(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@
+ $(QUIETLY) chmod +x $@
-$(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE)
- $(QUIETLY) { \
- echo Linking launcher...; \
- $(LINK_LAUNCHER/PRE_HOOK) \
- $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER); \
- $(LINK_LAUNCHER/POST_HOOK) \
- [ -f $(LAUNCHER_G) ] || { ln -s $@ $(LAUNCHER_G); }; \
- }
diff --git a/hotspot/make/linux/makefiles/makedeps.make b/hotspot/make/linux/makefiles/makedeps.make
deleted file mode 100644
index 1ea4f3b117f..00000000000
--- a/hotspot/make/linux/makefiles/makedeps.make
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Copyright (c) 2000, 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.
-#
-#
-
-include $(GAMMADIR)/make/linux/makefiles/rules.make
-
-COMPILE.JAVAC.FLAGS += -d $(OUTDIR)
-
-MakeDepsSources=\
- $(GAMMADIR)/src/share/tools/MakeDeps/Database.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTree.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTreeNode.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/FileFormatException.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/FileList.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/FileName.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/Macro.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/MacroDefinitions.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/MakeDeps.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/MetroWerksMacPlatform.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/Platform.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/UnixPlatform.java
-
-MakeDepsOptions=
diff --git a/hotspot/make/linux/makefiles/rules.make b/hotspot/make/linux/makefiles/rules.make
index 73f2eb44d7e..4ce9e3db872 100644
--- a/hotspot/make/linux/makefiles/rules.make
+++ b/hotspot/make/linux/makefiles/rules.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 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
@@ -151,20 +151,20 @@ ifdef LP64
%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
- $(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
+ $(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
else
%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
- $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) -o $@ $< $(COMPILE_DONE), \
- $(COMPILE.CC) -o $@ $< $(COMPILE_DONE))
+ $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \
+ $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE))
endif
%.o: %.s
@echo Assembling $<
$(QUIETLY) $(REMOVE_TARGET)
- $(QUIETLY) $(AS.S) -o $@ $< $(COMPILE_DONE)
+ $(QUIETLY) $(AS.S) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
%.s: %.cpp
@echo Generating assembly for $<
diff --git a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make
index bc4fc66c5fa..e65bf5ba142 100644
--- a/hotspot/make/linux/makefiles/saproc.make
+++ b/hotspot/make/linux/makefiles/saproc.make
@@ -55,10 +55,12 @@ endif
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium, PPC, ARM or zero.
-checkAndBuildSA:
- $(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "arm" -a "$(SRCARCH)" != "ppc" -a "$(SRCARCH)" != "zero" ] ; then \
- $(MAKE) -f vm.make $(LIBSAPROC); \
- fi
+ifneq ($(wildcard $(AGENT_DIR)),)
+ifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),)
+ BUILDLIBSAPROC = $(LIBSAPROC)
+endif
+endif
+
SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE)
@@ -81,10 +83,10 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
-lthread_db
$(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
-install_saproc: checkAndBuildSA
+install_saproc: $(BUILDLIBSAPROC)
$(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \
echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \
cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \
fi
-.PHONY: checkAndBuildSA install_saproc
+.PHONY: install_saproc
diff --git a/hotspot/make/linux/makefiles/sparc.make b/hotspot/make/linux/makefiles/sparc.make
index ef5b122eab4..ddb05132fab 100644
--- a/hotspot/make/linux/makefiles/sparc.make
+++ b/hotspot/make/linux/makefiles/sparc.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,3 @@
#
#
-# Not included in includeDB because it has no dependencies
-Obj_Files += linux_sparc.o
-
diff --git a/hotspot/make/linux/makefiles/sparcWorks.make b/hotspot/make/linux/makefiles/sparcWorks.make
index 900c7ddea00..d6fe9679b4b 100644
--- a/hotspot/make/linux/makefiles/sparcWorks.make
+++ b/hotspot/make/linux/makefiles/sparcWorks.make
@@ -74,6 +74,14 @@ CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
OPT_CFLAGS+=-xO4
OPT_CFLAGS/NOOPT=-xO0
+# Flags for creating the dependency files.
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
+DEPFLAGS = -xMMD -xMF $(DEP_DIR)/$(@:%=%.d)
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+
#------------------------------------------------------------------------
# Linker flags
diff --git a/hotspot/make/linux/makefiles/sparcv9.make b/hotspot/make/linux/makefiles/sparcv9.make
index 8687dfb4bb1..b9e4e525d76 100644
--- a/hotspot/make/linux/makefiles/sparcv9.make
+++ b/hotspot/make/linux/makefiles/sparcv9.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -21,10 +21,6 @@
# questions.
#
-#
-# Not included in includeDB because it has no dependencies
-Obj_Files += linux_sparc.o
-
# gcc 4.0 miscompiles this code in -m64
OPT_CFLAGS/macro.o = -O0
diff --git a/hotspot/make/linux/makefiles/top.make b/hotspot/make/linux/makefiles/top.make
index c9988f6aba7..db9224fc215 100644
--- a/hotspot/make/linux/makefiles/top.make
+++ b/hotspot/make/linux/makefiles/top.make
@@ -31,7 +31,7 @@
# -generate sa-jdi.jar (JDI binding to core files)
# It assumes the following flags are set:
-# CFLAGS Platform_file, Src_Dirs, SYSDEFS, AOUT, Obj_Files
+# CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Obj_Files
# -- D. Ungar (5/97) from a file by Bill Bush
@@ -45,10 +45,6 @@ VM = $(GAMMADIR)/src/share/vm
Plat_File = $(Platform_file)
CDG = cd $(GENERATED);
-# Pick up MakeDeps' sources and definitions
-include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/makedeps.make
-MakeDepsClass = MakeDeps.class
-
ifdef USE_PRECOMPILED_HEADER
PrecompiledOption = -DUSE_PRECOMPILED_HEADER
UpdatePCH = $(MAKE) -f vm.make $(PRECOMPILED_HEADER) $(MFLAGS)
@@ -57,33 +53,7 @@ UpdatePCH = \# precompiled header is not used
PrecompiledOption =
endif
-MakeDeps = $(RUN.JAVA) $(PrecompiledOption) -classpath $(GENERATED) MakeDeps
-
-Include_DBs/GC = $(VM)/includeDB_gc \
- $(VM)/includeDB_gc_parallel \
- $(VM)/gc_implementation/includeDB_gc_parallelScavenge \
- $(VM)/gc_implementation/includeDB_gc_concurrentMarkSweep \
- $(VM)/gc_implementation/includeDB_gc_parNew \
- $(VM)/gc_implementation/includeDB_gc_g1 \
- $(VM)/gc_implementation/includeDB_gc_serial \
- $(VM)/gc_implementation/includeDB_gc_shared
-
-Include_DBs/CORE = $(VM)/includeDB_core $(Include_DBs/GC) \
- $(VM)/includeDB_jvmti \
- $(VM)/includeDB_features
-Include_DBs/COMPILER1 = $(Include_DBs/CORE) $(VM)/includeDB_compiler1
-Include_DBs/COMPILER2 = $(Include_DBs/CORE) $(VM)/includeDB_compiler2
-Include_DBs/TIERED = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 $(VM)/includeDB_compiler2
-Include_DBs/ZERO = $(Include_DBs/CORE) $(VM)/includeDB_zero
-Include_DBs/SHARK = $(Include_DBs/ZERO) $(VM)/includeDB_shark
-Include_DBs = $(Include_DBs/$(TYPE))
-
Cached_plat = $(GENERATED)/platform.current
-Cached_db = $(GENERATED)/includeDB.current
-
-Incremental_Lists = $(Cached_db)
-# list generation also creates $(GENERATED)/$(Cached_plat)
-
AD_Dir = $(GENERATED)/adfiles
ADLC = $(AD_Dir)/adlc
@@ -102,7 +72,7 @@ adjust-mflags = $(GENERATED)/adjust-mflags
MFLAGS-adjusted = -r `$(adjust-mflags) "$(MFLAGS)" "$(HOTSPOT_BUILD_JOBS)"`
-# default target: make makeDeps, update lists, make vm
+# default target: update lists, make vm
# done in stages to force sequential order with parallel make
#
@@ -110,39 +80,18 @@ default: vm_build_preliminaries the_vm
@echo All done.
# This is an explicit dependency for the sake of parallel makes.
-vm_build_preliminaries: checks $(Incremental_Lists) $(AD_Files_If_Required) jvmti_stuff sa_stuff
+vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff sa_stuff
@# We need a null action here, so implicit rules don't get consulted.
-# make makeDeps: (and zap the cached db files to force a nonincremental run)
-
-$(GENERATED)/$(MakeDepsClass): $(MakeDepsSources)
- @$(REMOTE) $(COMPILE.JAVAC) -classpath $(GAMMADIR)/src/share/tools/MakeDeps -d $(GENERATED) $(MakeDepsSources)
- @echo Removing $(Incremental_Lists) to force regeneration.
- @rm -f $(Incremental_Lists)
- @$(CDG) echo >$(Cached_plat)
-
-# make incremental_lists, if cached files out of date, run makeDeps
-
-$(Incremental_Lists): $(Include_DBs) $(Plat_File) $(GENERATED)/$(MakeDepsClass)
- $(CDG) cat $(Include_DBs) > $(GENERATED)/includeDB
- $(CDG) if [ ! -r incls ] ; then \
- mkdir incls ; \
- fi
- $(CDG) (echo $(CDG) echo $(MakeDeps) diffs UnixPlatform $(Cached_plat) $(Cached_db) $(Plat_File) $(GENERATED)/includeDB $(MakeDepsOptions)) > makeDeps.sh
- $(CDG) $(REMOTE) sh $(GENERATED)/makeDeps.sh
- $(CDG) cp includeDB $(Cached_db)
+$(Cached_plat): $(Plat_File)
$(CDG) cp $(Plat_File) $(Cached_plat)
-# symbolic target for command lines
-lists: $(Incremental_Lists)
- @: lists are now up to date
-
# make AD files as necessary
-ad_stuff: $(Incremental_Lists) $(adjust-mflags)
+ad_stuff: $(Cached_plat) $(adjust-mflags)
@$(MAKE) -f adlc.make $(MFLAGS-adjusted)
# generate JVMTI files from the spec
-jvmti_stuff: $(Incremental_Lists) $(adjust-mflags)
+jvmti_stuff: $(Cached_plat) $(adjust-mflags)
@$(MAKE) -f jvmti.make $(MFLAGS-adjusted)
# generate SA jar files and native header
@@ -169,7 +118,7 @@ the_vm: vm_build_preliminaries $(adjust-mflags)
install: the_vm
@$(MAKE) -f vm.make install
-# next rules support "make foo.[oi]"
+# next rules support "make foo.[ois]"
%.o %.i %.s:
$(UpdatePCH)
@@ -179,7 +128,6 @@ install: the_vm
# this should force everything to be rebuilt
clean:
rm -f $(GENERATED)/*.class
- $(MAKE) $(MFLAGS) $(GENERATED)/$(MakeDepsClass)
$(MAKE) -f vm.make $(MFLAGS) clean
# just in case it doesn't, this should do it
diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make
index 92add561f09..653da7de6a7 100644
--- a/hotspot/make/linux/makefiles/vm.make
+++ b/hotspot/make/linux/makefiles/vm.make
@@ -35,9 +35,10 @@ default: build
# Defs
GENERATED = ../generated
+DEP_DIR = $(GENERATED)/dependencies
-# read a generated file defining the set of .o's and the .o .h dependencies
-include $(GENERATED)/Dependencies
+# reads the generated files defining the set of .o's and the .o .h dependencies
+-include $(DEP_DIR)/*.d
# read machine-specific adjustments (%%% should do this via buildtree.make?)
ifeq ($(ZERO_BUILD), true)
@@ -47,16 +48,16 @@ else
endif
# set VPATH so make knows where to look for source files
-# Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
-# The incls directory contains generated header file lists for inclusion.
+# Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
# The adfiles directory contains ad_.[ch]pp.
# The jvmtifiles directory contains jvmti*.[ch]pp
-Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls
-VPATH += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles
+VPATH += $(Src_Dirs_V:%=%:)
-# set INCLUDES for C preprocessor
-Src_Dirs_I = $(PRECOMPILED_HEADER_DIR) $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)
-INCLUDES += $(Src_Dirs_I:%=-I%)
+# set INCLUDES for C preprocessor.
+Src_Dirs_I += $(GENERATED)
+# The order is important for the precompiled headers to work.
+INCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%)
ifeq (${VERSION}, debug)
SYMFLAG = -g
@@ -118,6 +119,64 @@ JVM = jvm
LIBJVM = lib$(JVM).so
LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
+CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \))
+CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm
+CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm
+CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm
+CORE_PATHS += $(GENERATED)/jvmtifiles
+
+COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1
+
+COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto
+COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt
+COMPILER2_PATHS += $(GENERATED)/adfiles
+
+# Include dirs per type.
+Src_Dirs/CORE := $(CORE_PATHS)
+Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
+Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS)
+Src_Dirs/TIERED := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
+Src_Dirs/ZERO := $(CORE_PATHS)
+Src_Dirs/SHARK := $(CORE_PATHS)
+Src_Dirs := $(Src_Dirs/$(TYPE))
+
+COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\*
+COMPILER1_SPECIFIC_FILES := c1_\*
+SHARK_SPECIFIC_FILES := shark
+ZERO_SPECIFIC_FILES := zero
+
+# Always exclude these.
+Src_Files_EXCLUDE := jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
+
+# Exclude per type.
+Src_Files_EXCLUDE/CORE := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/COMPILER1 := $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/COMPILER2 := $(COMPILER1_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
+Src_Files_EXCLUDE/TIERED := $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
+Src_Files_EXCLUDE/ZERO := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/SHARK := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES)
+
+Src_Files_EXCLUDE += $(Src_Files_EXCLUDE/$(TYPE))
+
+# Special handling of arch model.
+ifeq ($(Platform_arch_model), x86_32)
+Src_Files_EXCLUDE += \*x86_64\*
+endif
+ifeq ($(Platform_arch_model), x86_64)
+Src_Files_EXCLUDE += \*x86_32\*
+endif
+
+# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
+define findsrc
+ $(notdir $(shell find $(1)/. ! -name . -prune \
+ -a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \
+ -a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \)))
+endef
+
+Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e)))
+
+Obj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files))))
+
JVM_OBJ_FILES = $(Obj_Files)
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
@@ -180,10 +239,10 @@ endif
LINK_VM = $(LINK_LIB.c)
# rule for building precompiled header
-$(PRECOMPILED_HEADER): $(Precompiled_Files)
+$(PRECOMPILED_HEADER):
$(QUIETLY) echo Generating precompiled header $@
- $(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)/incls
- $(QUIETLY) $(COMPILE.CC) -x c++-header -c $(GENERATED)/incls/_precompiled.incl -o $@ $(COMPILE_DONE)
+ $(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)
+ $(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -x c++-header $(PRECOMPILED_HEADER_SRC) -o $@ $(COMPILE_DONE)
# making the library:
@@ -252,7 +311,7 @@ include $(MAKEFILES_DIR)/saproc.make
#----------------------------------------------------------------------
-build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) checkAndBuildSA
+build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC)
install: install_jvm install_jsig install_saproc
diff --git a/hotspot/make/linux/makefiles/zero.make b/hotspot/make/linux/makefiles/zero.make
index 6de6d0e6374..0270711f5cb 100644
--- a/hotspot/make/linux/makefiles/zero.make
+++ b/hotspot/make/linux/makefiles/zero.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 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.
#
@@ -25,7 +25,7 @@
# Setup for Zero (non-Shark) version of VM
-# Select which includeDB files to use (in top.make)
+# Select which files to use (in top.make)
TYPE = ZERO
# Install libjvm.so, etc in in server directory.
diff --git a/hotspot/make/solaris/makefiles/adlc.make b/hotspot/make/solaris/makefiles/adlc.make
index 35cce4b99cf..7fc55b9d39e 100644
--- a/hotspot/make/solaris/makefiles/adlc.make
+++ b/hotspot/make/solaris/makefiles/adlc.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -42,16 +42,14 @@ SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad
SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \
$(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad
-Src_Dirs += $(GAMMADIR)/src/share/vm/adlc
-
EXEC = $(OUTDIR)/adlc
# set VPATH so make knows where to look for source files
-Src_Dirs_V = ${Src_Dirs} $(GENERATED)/incls
-VPATH += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(GAMMADIR)/src/share/vm/adlc
+VPATH += $(Src_Dirs_V:%=%:)
# set INCLUDES for C preprocessor
-Src_Dirs_I = ${Src_Dirs} $(GENERATED)
+Src_Dirs_I += $(GAMMADIR)/src/share/vm/adlc $(GENERATED)
INCLUDES += $(Src_Dirs_I:%=-I%)
# set flags for adlc compilation
diff --git a/hotspot/make/solaris/makefiles/amd64.make b/hotspot/make/solaris/makefiles/amd64.make
index 4c6afaad702..f88d743fe7c 100644
--- a/hotspot/make/solaris/makefiles/amd64.make
+++ b/hotspot/make/solaris/makefiles/amd64.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
@@ -25,9 +25,6 @@
# Must also specify if CPU is little endian
CFLAGS += -DVM_LITTLE_ENDIAN
-# Not included in includeDB because it has no dependencies
-Obj_Files += solaris_x86_64.o
-
#
# Special case flags for compilers and compiler versions on amd64.
#
diff --git a/hotspot/make/solaris/makefiles/buildtree.make b/hotspot/make/solaris/makefiles/buildtree.make
index a505963a252..9a1e5fd96d4 100644
--- a/hotspot/make/solaris/makefiles/buildtree.make
+++ b/hotspot/make/solaris/makefiles/buildtree.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 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
@@ -37,7 +37,7 @@
# OS_FAMILY - operating system
# VARIANT - core, compiler1, compiler2, or tiered
# HOTSPOT_RELEASE_VERSION - .-b (11.0-b07)
-# HOTSPOT_BUILD_VERSION - internal, PRTjob ID, JPRTjob ID
+# HOTSPOT_BUILD_VERSION - internal, internal-$(USER_RELEASE_SUFFIX) or empty
# JRE_RELEASE_VERSION - .. (1.7.0)
#
# Builds the directory trees with makefiles plus some convenience files in
@@ -106,7 +106,7 @@ endif
COMPILER = $(shell sed -n 's/^compiler[ ]*=[ ]*//p' $(PLATFORM_FILE))
SIMPLE_DIRS = \
- $(PLATFORM_DIR)/generated/incls \
+ $(PLATFORM_DIR)/generated/dependencies \
$(PLATFORM_DIR)/generated/adfiles \
$(PLATFORM_DIR)/generated/jvmtifiles
@@ -117,7 +117,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
- env.ksh env.csh .dbxrc test_gamma
+ env.ksh env.csh jdkpath.sh .dbxrc test_gamma
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@@ -191,11 +191,27 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
echo "$(LP64_SETTING/$(DATA_MODE))"; \
echo; \
- echo "Src_Dirs = \\"; \
+ echo "# Used for platform dispatching"; \
+ echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \
+ echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \
+ echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \
+ echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \
+ echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \
+ echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \
+ echo "CFLAGS += \$$(TARGET_DEFINES)"; \
+ echo; \
+ echo "Src_Dirs_V = \\"; \
sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \
echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
+ echo; \
+ echo "Src_Dirs_I = \\"; \
+ echo "\$$(GAMMADIR)/src/share/vm \\"; \
+ echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \
+ echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
+ echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
+ echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
[ -n "$(CFLAGS_BROWSE)" ] && \
echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
[ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
@@ -298,6 +314,13 @@ env.csh: env.ksh
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
) > $@
+jdkpath.sh: $(BUILDTREE_MAKE)
+ @echo Creating $@ ...
+ $(QUIETLY) ( \
+ $(BUILDTREE_COMMENT); \
+ echo "JDK=${JAVA_HOME}"; \
+ ) > $@
+
.dbxrc: $(BUILDTREE_MAKE)
@echo Creating $@ ...
$(QUIETLY) ( \
diff --git a/hotspot/make/solaris/makefiles/core.make b/hotspot/make/solaris/makefiles/core.make
index 66d73b6618d..64400556fcc 100644
--- a/hotspot/make/solaris/makefiles/core.make
+++ b/hotspot/make/solaris/makefiles/core.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
@@ -24,8 +24,7 @@
# Sets make macros for making core version of VM
-# Note the effect on includeDB lists in top.make:
-# includeDB_compiler* and ad_.*pp are excluded from the build,
+# Select which files to use (in top.make)
TYPE=CORE
# There is no "core" directory in JDK. Install core build in server directory.
diff --git a/hotspot/make/solaris/makefiles/dtrace.make b/hotspot/make/solaris/makefiles/dtrace.make
index 2338c01099d..8b750858cd3 100644
--- a/hotspot/make/solaris/makefiles/dtrace.make
+++ b/hotspot/make/solaris/makefiles/dtrace.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -63,8 +63,6 @@ endif
# making libjvm_db
-INCLS = $(GENERATED)/incls
-
# Use mapfile with libjvm_db.so
LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db
LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE))
@@ -114,7 +112,7 @@ LFLAGS_GENOFFS += -mt -xnolib -norunpath
endif
lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \
- $(INCLS)/_vmStructs.cpp.incl $(LIBJVM.o)
+ $(LIBJVM.o)
$(QUIETLY) $(CCC) $(CPPFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \
$(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc
@@ -161,6 +159,27 @@ $(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \
$(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
$(QUIETLY) cat $^ > $@
+DTraced_Files = ciEnv.o \
+ classLoadingService.o \
+ compileBroker.o \
+ hashtable.o \
+ instanceKlass.o \
+ java.o \
+ jni.o \
+ jvm.o \
+ memoryManager.o \
+ nmethod.o \
+ objectMonitor.o \
+ runtimeService.o \
+ sharedRuntime.o \
+ synchronizer.o \
+ thread.o \
+ unsafe.o \
+ vmThread.o \
+ vmCMSOperations.o \
+ vmPSOperations.o \
+ vmGCOperations.o \
+
# Dtrace is available, so we build $(DTRACE.o)
$(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
@echo Compiling $(DTRACE).d
diff --git a/hotspot/make/solaris/makefiles/gcc.make b/hotspot/make/solaris/makefiles/gcc.make
index 0bbba240498..b0cdfc9a231 100644
--- a/hotspot/make/solaris/makefiles/gcc.make
+++ b/hotspot/make/solaris/makefiles/gcc.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
@@ -47,9 +47,13 @@ $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
# check for precompiled headers support
ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
+# Allow the user to turn off precompiled headers from the command line.
+ifneq ($(USE_PRECOMPILED_HEADER),0)
USE_PRECOMPILED_HEADER=1
PRECOMPILED_HEADER_DIR=.
-PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/incls/_precompiled.incl.gch
+PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled.hpp
+PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
+endif
endif
@@ -131,6 +135,17 @@ OPT_CFLAGS/bytecodeInterpreter.o += -fno-expensive-optimizations
endif
OPT_CFLAGS/NOOPT=-O0
+
+# Flags for generating make dependency flags.
+ifneq ("${CC_VER_MAJOR}", "2")
+DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+ifneq ($(USE_PRECOMPILED_HEADER),1)
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+endif
+
#------------------------------------------------------------------------
# Linker flags
diff --git a/hotspot/make/solaris/makefiles/i486.make b/hotspot/make/solaris/makefiles/i486.make
index c5c15035e67..c2e6ff8395a 100644
--- a/hotspot/make/solaris/makefiles/i486.make
+++ b/hotspot/make/solaris/makefiles/i486.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
@@ -26,8 +26,6 @@
CFLAGS += -DVM_LITTLE_ENDIAN
# TLS helper, assembled from .s file
-# Not included in includeDB because it has no dependencies
-Obj_Files += solaris_x86_32.o
#
# Special case flags for compilers and compiler versions on i486.
diff --git a/hotspot/make/solaris/makefiles/jvmti.make b/hotspot/make/solaris/makefiles/jvmti.make
index 08b4f0edfb4..1a32cab7060 100644
--- a/hotspot/make/solaris/makefiles/jvmti.make
+++ b/hotspot/make/solaris/makefiles/jvmti.make
@@ -36,11 +36,10 @@ JvmtiOutDir = $(GENERATED)/jvmtifiles
JvmtiSrcDir = $(GAMMADIR)/src/share/vm/prims
InterpreterSrcDir = $(GAMMADIR)/src/share/vm/interpreter
-Src_Dirs += $(JvmtiSrcDir)
# set VPATH so make knows where to look for source files
-Src_Dirs_V = ${Src_Dirs}
-VPATH += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(JvmtiSrcDir)
+VPATH += $(Src_Dirs_V:%=%:)
JvmtiGeneratedNames = \
jvmtiEnv.hpp \
diff --git a/hotspot/make/solaris/makefiles/launcher.make b/hotspot/make/solaris/makefiles/launcher.make
index 0051fd9892b..e0a2ee31640 100644
--- a/hotspot/make/solaris/makefiles/launcher.make
+++ b/hotspot/make/solaris/makefiles/launcher.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -24,18 +24,22 @@
# Rules to build gamma launcher, used by vm.make
-# gamma[_g]: launcher
+LAUNCHER_SCRIPT = hotspot
LAUNCHER = gamma
-LAUNCHER_G = $(LAUNCHER)$(G_SUFFIX)
-LAUNCHERDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher
+LAUNCHERDIR = $(GAMMADIR)/src/os/posix/launcher
+LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher
LAUNCHERFLAGS = $(ARCHFLAG) \
-I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \
+ -I$(LAUNCHERDIR_SHARE) \
-DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
+ -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
+ -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
-DARCH=\"$(LIBARCH)\" \
-DGAMMA \
-DLAUNCHER_TYPE=\"gamma\" \
- -DLINK_INTO_$(LINK_INTO)
+ -DLINK_INTO_$(LINK_INTO) \
+ $(TARGET_DEFINES)
ifeq ($(LINK_INTO),AOUT)
LAUNCHER.o = launcher.o $(JVM_OBJ_FILES)
@@ -68,24 +72,37 @@ ifeq ("${Platform_compiler}", "sparcWorks")
#LAUNCHERFLAGS += -W0,-noglobal
endif # Platform_compiler == sparcWorks
-launcher.o: launcher.c $(LAUNCHERDIR)/java.c $(LAUNCHERDIR)/java_md.c
- $(CC) -g -c -o $@ launcher.c $(LAUNCHERFLAGS) $(CPPFLAGS)
+LAUNCHER_OUT = launcher
-launcher.c:
- @echo Generating $@
- $(QUIETLY) { \
- echo '#define debug launcher_debug'; \
- echo '#include "java.c"'; \
- echo '#include "java_md.c"'; \
- } > $@
+SUFFIXES += .d
-$(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE)
+SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c")
+SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c")
+
+OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE))
+
+DEPFILES := $(patsubst %.o,%.d,$(OBJS))
+-include $(DEPFILES)
+
+$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c
+ $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
+ $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS)
+
+$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c
+ $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
+ $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS)
+
+$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
ifeq ($(filter -sbfast -xsbfast, $(CFLAGS_BROWSE)),)
- @echo Linking launcher...
+ $(QUIETLY) echo Linking launcher...
$(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
- $(QUIETLY) \
- $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER)
+ $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER)
$(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
- [ -f $(LAUNCHER_G) ] || ln -s $@ $(LAUNCHER_G)
endif # filter -sbfast -xsbfast
+$(LAUNCHER): $(LAUNCHER_SCRIPT)
+
+$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script
+ $(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@
+ $(QUIETLY) chmod +x $@
+
diff --git a/hotspot/make/solaris/makefiles/makedeps.make b/hotspot/make/solaris/makefiles/makedeps.make
deleted file mode 100644
index 671b53df29f..00000000000
--- a/hotspot/make/solaris/makefiles/makedeps.make
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Copyright (c) 1999, 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.
-#
-#
-
-include $(GAMMADIR)/make/solaris/makefiles/rules.make
-
-COMPILE.JAVAC.FLAGS += -d $(OUTDIR)
-
-MakeDepsSources=\
- $(GAMMADIR)/src/share/tools/MakeDeps/Database.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTree.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTreeNode.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/FileFormatException.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/FileList.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/FileName.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/Macro.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/MacroDefinitions.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/MakeDeps.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/MetroWerksMacPlatform.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/Platform.java \
- $(GAMMADIR)/src/share/tools/MakeDeps/UnixPlatform.java
-
-MakeDepsOptions=
diff --git a/hotspot/make/solaris/makefiles/rules.make b/hotspot/make/solaris/makefiles/rules.make
index e9e87365f57..baafe9c4fd0 100644
--- a/hotspot/make/solaris/makefiles/rules.make
+++ b/hotspot/make/solaris/makefiles/rules.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 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
@@ -151,14 +151,14 @@ ifdef LP64
%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
- $(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
+ $(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
else
%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
- $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) -o $@ $< $(COMPILE_DONE), \
- $(COMPILE.CC) -o $@ $< $(COMPILE_DONE))
+ $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \
+ $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE))
endif
%.o: %.s
diff --git a/hotspot/make/solaris/makefiles/saproc.make b/hotspot/make/solaris/makefiles/saproc.make
index 99661ce6b22..0f5a0bb4cd6 100644
--- a/hotspot/make/solaris/makefiles/saproc.make
+++ b/hotspot/make/solaris/makefiles/saproc.make
@@ -44,10 +44,9 @@ DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
# if $(AGENT_DIR) does not exist, we don't build SA
-checkAndBuildSA:
- $(QUIETLY) if [ -d $(AGENT_DIR) ] ; then \
- $(MAKE) -f vm.make $(LIBSAPROC); \
- fi
+ifneq ($(wildcard $(AGENT_DIR)),)
+ BUILDLIBSAPROC = $(LIBSAPROC)
+endif
SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
@@ -75,10 +74,10 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
-ldl -ldemangle -lthread -lc
[ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
-install_saproc: checkAndBuildSA
+install_saproc: $(BULDLIBSAPROC)
$(QUIETLY) if [ -f $(LIBSAPROC) ] ; then \
echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \
cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \
fi
-.PHONY: checkAndBuildSA install_saproc
+.PHONY: install_saproc
diff --git a/hotspot/make/solaris/makefiles/sparcWorks.make b/hotspot/make/solaris/makefiles/sparcWorks.make
index 8e13e44063d..b3b0d514570 100644
--- a/hotspot/make/solaris/makefiles/sparcWorks.make
+++ b/hotspot/make/solaris/makefiles/sparcWorks.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
@@ -145,7 +145,15 @@ OPT_CFLAGS/SLOWER=-xO3
OPT_CFLAGS/O2=-xO2
OPT_CFLAGS/NOOPT=-xO1
-#################################################
+# Flags for creating the dependency files.
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
+DEPFLAGS = -xMMD -xMF $(DEP_DIR)/$(@:%=%.d)
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+
+################################################
# Begin current (>=5.9) Forte compiler options #
#################################################
diff --git a/hotspot/make/solaris/makefiles/sparcv9.make b/hotspot/make/solaris/makefiles/sparcv9.make
index af8f0f082c2..ae2fad447f9 100644
--- a/hotspot/make/solaris/makefiles/sparcv9.make
+++ b/hotspot/make/solaris/makefiles/sparcv9.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
#
#
-Obj_Files += solaris_sparc.o
ASFLAGS += $(AS_ARCHFLAG)
ifeq ("${Platform_compiler}", "sparcWorks")
diff --git a/hotspot/make/solaris/makefiles/top.make b/hotspot/make/solaris/makefiles/top.make
index 1cc8ad11fdf..b0505e77aae 100644
--- a/hotspot/make/solaris/makefiles/top.make
+++ b/hotspot/make/solaris/makefiles/top.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
@@ -31,7 +31,7 @@
# -generate sa-jdi.jar (JDI binding to core files)
# It assumes the following flags are set:
-# CFLAGS Platform_file, Src_Dirs, SYSDEFS, AOUT, Jvm_Obj_Files
+# CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Jvm_Obj_Files
# -- D. Ungar (5/97) from a file by Bill Bush
@@ -44,42 +44,7 @@ VM = $(GAMMADIR)/src/share/vm
Plat_File = $(Platform_file)
CDG = cd $(GENERATED);
-# Pick up MakeDeps' sources and definitions
-include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/makedeps.make
-MakeDepsClass = MakeDeps.class
-MakeDeps = $(RUN.JAVA) -classpath . MakeDeps
-
-Include_DBs/GC = $(VM)/includeDB_gc \
- $(VM)/includeDB_gc_parallel \
- $(VM)/gc_implementation/includeDB_gc_parallelScavenge \
- $(VM)/gc_implementation/includeDB_gc_concurrentMarkSweep \
- $(VM)/gc_implementation/includeDB_gc_parNew \
- $(VM)/gc_implementation/includeDB_gc_g1 \
- $(VM)/gc_implementation/includeDB_gc_serial \
- $(VM)/gc_implementation/includeDB_gc_shared
-
-
-Include_DBs/KERNEL = $(VM)/includeDB_core $(VM)/includeDB_gc \
- $(VM)/gc_implementation/includeDB_gc_serial \
- $(VM)/includeDB_jvmti \
- $(VM)/includeDB_compiler1
-
-Include_DBs/CORE = $(VM)/includeDB_core $(Include_DBs/GC) \
- $(VM)/includeDB_jvmti \
- $(VM)/includeDB_features
-Include_DBs/COMPILER1 = $(Include_DBs/CORE) $(VM)/includeDB_compiler1
-Include_DBs/COMPILER2 = $(Include_DBs/CORE) $(VM)/includeDB_compiler2
-Include_DBs/TIERED = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 \
- $(VM)/includeDB_compiler2
-
-Include_DBs = $(Include_DBs/$(TYPE))
-
-Cached_plat = platform.current
-Cached_db = includeDB.current
-
-Incremental_Lists =$(GENERATED)/$(Cached_db)
-# list generation also creates $(GENERATED)/$(Cached_plat)
-
+Cached_plat = $(GENERATED)/platform.current
AD_Dir = $(GENERATED)/adfiles
ADLC = $(AD_Dir)/adlc
@@ -98,7 +63,7 @@ adjust-mflags = $(GENERATED)/adjust-mflags
MFLAGS-adjusted = -r `$(adjust-mflags) "$(MFLAGS)" "$(HOTSPOT_BUILD_JOBS)"`
-# default target: make makeDeps, update lists, make vm
+# default target: update lists, make vm
# done in stages to force sequential order with parallel make
#
@@ -106,38 +71,18 @@ default: vm_build_preliminaries the_vm
@echo All done.
# This is an explicit dependency for the sake of parallel makes.
-vm_build_preliminaries: checks $(Incremental_Lists) $(AD_Files_If_Required) jvmti_stuff sa_stuff
+vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff sa_stuff
@# We need a null action here, so implicit rules don't get consulted.
-# make makeDeps: (and zap the cached db files to force a nonincremental run)
-
-$(GENERATED)/$(MakeDepsClass): $(MakeDepsSources)
- @$(COMPILE.JAVAC) -classpath $(GAMMADIR)/src/share/tools/MakeDeps -d $(GENERATED) $(MakeDepsSources)
- @echo Removing $(Incremental_Lists) to force regeneration.
- @rm -f $(Incremental_Lists)
- @$(CDG) echo >$(Cached_plat)
-
-# make incremental_lists, if cached files out of date, run makeDeps
-
-$(Incremental_Lists): $(Include_DBs) $(Plat_File) $(GENERATED)/$(MakeDepsClass)
- $(CDG) cat $(Include_DBs) > includeDB
- $(CDG) if [ ! -r incls ] ; then \
- mkdir incls ; \
- fi
- $(CDG) $(MakeDeps) diffs UnixPlatform $(Cached_plat) $(Cached_db) $(Plat_File) includeDB $(MakeDepsOptions)
- $(CDG) cp includeDB $(Cached_db)
- $(CDG) cp $(Plat_File) $(Cached_plat)
-
-# symbolic target for command lines
-lists: $(Incremental_Lists)
- @: lists are now up to date
+$(Cached_plat): $(Plat_File)
+ $(CDG) cp $(Plat_File) $(Cached_plat)
# make AD files as necessary
-ad_stuff: $(Incremental_Lists) $(adjust-mflags)
+ad_stuff: $(Cached_plat) $(adjust-mflags)
@$(MAKE) -f adlc.make $(MFLAGS-adjusted)
# generate JVMTI files from the spec
-jvmti_stuff: $(Incremental_Lists) $(adjust-mflags)
+jvmti_stuff: $(Cached_plat) $(adjust-mflags)
@$(MAKE) -f jvmti.make $(MFLAGS-adjusted)
# generate SA jar files and native header
@@ -172,7 +117,6 @@ install: the_vm
# this should force everything to be rebuilt
clean:
rm -f $(GENERATED)/*.class
- $(MAKE) $(MFLAGS) $(GENERATED)/$(MakeDepsClass)
$(MAKE) -f vm.make $(MFLAGS) clean
# just in case it doesn't, this should do it
diff --git a/hotspot/make/solaris/makefiles/vm.make b/hotspot/make/solaris/makefiles/vm.make
index 7289c72f950..93d8396faa9 100644
--- a/hotspot/make/solaris/makefiles/vm.make
+++ b/hotspot/make/solaris/makefiles/vm.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
@@ -35,23 +35,23 @@ default: build
# Defs
GENERATED = ../generated
+DEP_DIR = $(GENERATED)/dependencies
-# read a generated file defining the set of .o's and the .o .h dependencies
-include $(GENERATED)/Dependencies
+# reads the generated files defining the set of .o's and the .o .h dependencies
+-include $(DEP_DIR)/*.d
# read machine-specific adjustments (%%% should do this via buildtree.make?)
include $(MAKEFILES_DIR)/$(BUILDARCH).make
# set VPATH so make knows where to look for source files
-# Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
-# The incls directory contains generated header file lists for inclusion.
+# Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
# The adfiles directory contains ad_.[ch]pp.
# The jvmtifiles directory contains jvmti*.[ch]pp
-Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls
-VPATH += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles
+VPATH += $(Src_Dirs_V:%=%:)
# set INCLUDES for C preprocessor
-Src_Dirs_I = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)
+Src_Dirs_I += $(GENERATED)
INCLUDES += $(Src_Dirs_I:%=-I%)
ifeq (${VERSION}, debug)
@@ -106,17 +106,17 @@ ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1)
# Not sure what the 'designed for' comment is referring too above.
# The order may not be too significant anymore, but I have placed this
# older libm before libCrun, just to make sure it's found and used first.
-LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc
+LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc -ldemangle
else
ifeq ($(COMPILER_REV_NUMERIC), 502)
# SC6.1 has it's own libm.so: specifying anything else provokes a name conflict.
-LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor
+LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor -ldemangle
else
-LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor
+LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor -ldemangle
endif # 502
endif # 505
else
-LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc
+LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc -ldemangle
endif # sparcWorks
# By default, link the *.o into the library, not the executable.
@@ -135,6 +135,64 @@ JVM = jvm
LIBJVM = lib$(JVM).so
LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
+CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \))
+CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm
+CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm
+CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm
+CORE_PATHS += $(GENERATED)/jvmtifiles
+
+COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1
+
+COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto
+COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt
+COMPILER2_PATHS += $(GENERATED)/adfiles
+
+# Include dirs per type.
+Src_Dirs/CORE := $(CORE_PATHS)
+Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
+Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS)
+Src_Dirs/TIERED := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
+Src_Dirs/ZERO := $(CORE_PATHS)
+Src_Dirs/SHARK := $(CORE_PATHS)
+Src_Dirs := $(Src_Dirs/$(TYPE))
+
+COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\*
+COMPILER1_SPECIFIC_FILES := c1_\*
+SHARK_SPECIFIC_FILES := shark
+ZERO_SPECIFIC_FILES := zero
+
+# Always exclude these.
+Src_Files_EXCLUDE := dtrace jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
+
+# Exclude per type.
+Src_Files_EXCLUDE/CORE := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/COMPILER1 := $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/COMPILER2 := $(COMPILER1_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
+Src_Files_EXCLUDE/TIERED := $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
+Src_Files_EXCLUDE/ZERO := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/SHARK := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES)
+
+Src_Files_EXCLUDE += $(Src_Files_EXCLUDE/$(TYPE))
+
+# Special handling of arch model.
+ifeq ($(Platform_arch_model), x86_32)
+Src_Files_EXCLUDE += \*x86_64\*
+endif
+ifeq ($(Platform_arch_model), x86_64)
+Src_Files_EXCLUDE += \*x86_32\*
+endif
+
+# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
+define findsrc
+ $(notdir $(shell find $(1)/. ! -name . -prune \
+ -a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \
+ -a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \)))
+endef
+
+Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e)))
+
+Obj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files))))
+
JVM_OBJ_FILES = $(Obj_Files) $(DTRACE_OBJS)
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
@@ -205,7 +263,7 @@ include $(MAKEFILES_DIR)/saproc.make
#----------------------------------------------------------------------
-build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) checkAndBuildSA dtraceCheck
+build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) $(BUILDLIBSAPROC) dtraceCheck
install: install_jvm install_jsig install_saproc
diff --git a/hotspot/make/windows/README b/hotspot/make/windows/README
deleted file mode 100644
index 2f966374fab..00000000000
--- a/hotspot/make/windows/README
+++ /dev/null
@@ -1,212 +0,0 @@
-Copyright (c) 2007 Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
-
-________________________________________________________________________________
-
-__Introduction__________________________________________________________________
-
-This readme file should provide all the information needed to build
-the HotSpot VM for Windows 95/Windows NT from its teamware workspace.
-It is intended as a starting point for people who want to learn how
-to work with the current HotSpot source workspace and who need to
-build the VM locally. It is not intended as a tutorial for licensees.
-
-Last update: 03/28/05
-
-
-__Platform______________________________________________________________________
-
-The VM builds under the following platforms:
-- Windows NT 4.0 on Intel x486 or greater
-- x486 PC (or greater), 32MByte or more
-
-
-__Tools_________________________________________________________________________
-
-For building/testing the following tools need to be available:
-- Microsoft Visual C++ 6.0 (with nmake version 1.62.7022 or greater)
-- MKS Toolkit 6.1 or greater
- see: /net/reinstall/export/vol0/pc-archive/software/mks6.1 (NFS)
- or: \\reinstall\pc-archive\software\mks6.1 (NT)
-
-
-__JDK___________________________________________________________________________
-
-The workspace works with the following version of the JDK:
-(NOTE: these are out of date)
-- JDK1.2FCS "V" build
- see: /usr/local/java/jdk1.2/win32
-
-and the following version(s) of HotJava:
-- hjb1.1.4
-- hjb1.1.5
- see /usr/local/java/hjb1.1.x/win32
-
-
-__Environment variables_________________________________________________________
-
-The following environment variables need to be set up for the IDE
-build process. For batch builds these do not need to be set.
-
-HotSpotMksHome points to the (NFS or PC-local) directory where the MKS
- executables (like sh.exe and grep.exe) are installed
-
-Optionally you may set the following variables in your environment and they
-will be picked up by the create.bat script used to generate the vm.vcproj files.
-See the section on building within MS Developer Studio for more details.
-
-HotSpotWorkSpace points to the (NFS) directory where the workspace is located
-HotSpotBuildSpace points to the (PC-local) directory where the vm is built
-HotSpotReleaseBinDest points to the (NFS or PC-local) directory where the product DLL is
- written
-HotSpotDebugBinDest points to the (NFS or PC-local) directory where the debug DLL is
- written
-
-NOTE: For both batch and IDE builds, java and javac must be in your
-PATH, and the versions found by default must work. (If this turns out
-to be a problem, we can define HotSpotJava and HotSpotJavaC for
-bootstrapping...)
-
-__Building the JVM from the command line________________________________________
-
-1) choose a directory in which you want to build the vm
- (the build process will create a subdirectory)
-
-2) To build the 'core' version (debug || optimized)
- %HotSpotWorkSpace%\build\windows\build core %HotSpotWorkSpace%
- To build the 'compiler2' version (debug || optimized)
- %HotSpotWorkSpace%\build\windows\build compiler2 %HotSpotWorkSpace%
-
- where is a full path to a JDK in which bin/java and
- bin/javac are present and working.
-
-3) If you have problems with building, first try:
- vcvars32 (sets path for VC++)
-
-4) In addition to jvm.dll, the Serviceability Agent (SA) based JDI connector
- and command line tools are built if dbgeng.h and dbgeng.lib
- can be located, and BUILD_WIN_SA=1 is specified. We look for dbgeng.h here:
- $(MSVCDIR)\PlatformSDK\Include
- $(SYSTEMROOT)\..\Program Files\Microsoft SDK\include
-
- The first directory is part of Visual Studio VC .NET 2003.
- The second is used on Windows-amd64.
-
-
-__Building the JVM from within MS Developer Studio______________________________
-
-0) Set environment variables as described above
-
-1) Run the following script:
- %HotSpotWorkSpace%\build\windows\create { }
- where type is one of core, compiler1, compiler2. If you leave off the
- " " part, the script expects to find their
- values in the HotSpotWorkSpace, HotSpotBuildSpace, HotSpotReleaseBinDest, and HotSpotDebugBinDest environment
- variables. The resulting vm.vcproj does not depend on these values in the environment.
-
- This will populate the build space with the appropriate makefiles
- and run nmake in it. This builds and runs makedeps, which now
- generates the appropriate vm.vcproj into the build space. It also
- builds and runs adlc.
-
- To regenerate the .incl and .dsp files after changing the include
- databases, just run nmake in the build space.
-
- The build process now relies on java and javac. For the IDE builds,
- the full path to a JDK (in which bin/java and bin/javac are present
- and working) can be specified either explicitly with the
- ALT_BOOTDIR environment variable (like the JDK build process), via
- the JDK build's default BOOTDIR environment variable, via JAVA_HOME,
- or implicitly via the PATH.
-
- (Note that there are now many more command line options to MakeDeps
- on the Windows platform than before. These have been bundled into
- makefiles/makedeps.make, but it is still necessary to keep this in
- sync with the batch makefiles, in vm/generated.)
-
- If you have problems with building (i.e,. finding nmake), first try:
- vcvars32 (sets path for VC++)
-
-2) Double-click the vm.vcproj file in the %HotSpotBuildSpace% directory
- to open MS Developer Studio.
-
-3) build desired or all versions:
- menu Build -> Batch Build... -> Build (or Rebuild All)
-
-4) jvm.dll is in the %HotSpotReleaseBinDest% or %HotSpotDebugBinDest% directory
- depending on which configuration you built (release or debug).
-
-Note: do not edit any of the files (especially the vm.vcproj file) in the
-build space, since they are all either autogenerated or copied from
-the work space. If necessary, modify the original Makefiles in
-%HotSpotWorkSpace%\build\windows\projectfiles, or the shared
-makedeps arguments in
-%HotSpotWorkSpace%\build\windows\makefiles\makedeps.make.
-
-Note that it appears that some options set in the IDE (for example,
-the default executable) show up not in the .dsp file, but in the .opt
-file, so the automatic regeneration of the .dsp file should not
-destroy the project settings. However, makedeps.make should be edited
-to supply per-file compiler options.
-
-To build adlc from within the IDE for debugging purposes:
-
-1) in MS Developer Studio, open ADLCompiler.dsw:
- menu File -> Open Workspace...
- select & double-click ADLCompiler.dsw
-
-2) rebuild all (debug mode is enough)
- menu Build -> Rebuild All (make sure Win32 Debug version is selected)
-
-
-__Testing the VM________________________________________________________________
-
-To test the VM using the Tonga Testsuite, use testlook. testlook is a very
-simple testing framework on top of Tonga which allows us to use one (Tonga)
-test file, that can be extended with attributes.
-
-1) copy %HotSpotWorkSpace%\test\testlook.bat onto PC (preferably
- %HotSpotBuildSpace%\bin, which should ideally be in the path)
-
-2) run testlook or testlook help for details
-
-3) to run testlook you need to have Tonga mounted:
- net use T: \\tapas\export1\psqe
-
-
-__HotJava under HotSpot_________________________________________________________
-
-To run HotJava, use the .bat file %HotSpotWorkSpace%\test\h.bat. Copy
-it into %HotSpotBuildSpace%/ (which ideally is in the path) and run
-HotJava: h java (e.g., h java_g -Xint).
-
-
-__Preferred directory setup under Windows NT____________________________________
-
-Within the HotSpot group we are using the following directory setup:
-
-D:\jdk1.2 - where we install the JDK
-
-The following drives are mounted for testing/putbacks/etc.:
-
-net use T: \\tapas\export1\psqe
-net use Y: \\rschmidt\GammaBase
-net use Z: \\animorphic\animorphic
diff --git a/hotspot/make/windows/build_vm_def.sh b/hotspot/make/windows/build_vm_def.sh
index 5eae61ce390..9c9593b4a7f 100644
--- a/hotspot/make/windows/build_vm_def.sh
+++ b/hotspot/make/windows/build_vm_def.sh
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 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
@@ -45,6 +45,9 @@ fi
echo "EXPORTS" > vm1.def
AWK="$MKS_HOME/awk.exe"
+if [ ! -e $AWK ]; then
+ AWK="$MKS_HOME/gawk.exe"
+fi
GREP="$MKS_HOME/grep.exe"
SORT="$MKS_HOME/sort.exe"
UNIQ="$MKS_HOME/uniq.exe"
@@ -57,7 +60,7 @@ if [ "x$1" != "x" ]; then
LINK_VER="$1"
fi
-if [ "x$LINK_VER" != "x800" -a "x$LINK_VER" != "x900" ]; then
+if [ "x$LINK_VER" != "x800" -a "x$LINK_VER" != "x900" -a "x$LINK_VER" != "x1000" ]; then
$DUMPBIN /symbols *.obj | "$GREP" "??_7.*@@6B@" | "$GREP" -v "type_info" | "$AWK" '{print $7}' | "$SORT" | "$UNIQ" > vm2.def
else
# Can't use pipes when calling cl.exe or link.exe from IDE. Using transit file vm3.def
diff --git a/hotspot/make/windows/create.bat b/hotspot/make/windows/create.bat
index 172f706f15b..4592d8becfe 100644
--- a/hotspot/make/windows/create.bat
+++ b/hotspot/make/windows/create.bat
@@ -1,6 +1,6 @@
@echo off
REM
-REM Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+REM Copyright (c) 1999, 2010, 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
@@ -26,11 +26,8 @@ REM
REM This is the interactive build setup script (as opposed to the batch
REM build execution script). It creates $HotSpotBuildSpace if necessary,
REM copies the appropriate files out of $HotSpotWorkSpace into it, and
-REM builds and runs MakeDeps in it. This has the side-effect of creating
+REM builds and runs ProjectCreator in it. This has the side-effect of creating
REM the vm.vcproj file in the buildspace, which is then used in Visual C++.
-REM
-REM The generated project file depends upon the include databases. If
-REM those are changed then MakeDeps is rerun.
REM
REM Since we don't have uname and we could be cross-compiling,
@@ -39,6 +36,20 @@ REM
REM Note: Running this batch file from the Windows command shell requires
REM that "grep" be accessible on the PATH. An MKS install does this.
REM
+
+cl 2>NUL >NUL
+if %errorlevel% == 0 goto nexttest
+echo Make sure cl.exe is in your PATH before running this script.
+goto end
+
+:nexttest
+grep -V 2>NUL >NUL
+if %errorlevel% == 0 goto testit
+echo Make sure grep.exe is in your PATH before running this script. Either cygwin or MKS should work.
+goto end
+
+
+:testit
cl 2>&1 | grep "IA-64" >NUL
if %errorlevel% == 0 goto isia64
cl 2>&1 | grep "AMD64" >NUL
@@ -47,37 +58,40 @@ set ARCH=x86
set BUILDARCH=i486
set Platform_arch=x86
set Platform_arch_model=x86_32
-goto end
+goto done
:amd64
set ARCH=x86
set BUILDARCH=amd64
set Platform_arch=x86
set Platform_arch_model=x86_64
-goto end
+goto done
:isia64
set ARCH=ia64
set BUILDARCH=ia64
set Platform_arch=ia64
set Platform_arch_model=ia64
-:end
+:done
setlocal
if "%1" == "" goto usage
-if not "%4" == "" goto usage
+if not "%2" == "" goto usage
+
+REM Set HotSpotWorkSpace to the directy two steps above this script
+for %%i in ("%~dp0..") do ( set HotSpotWorkSpace=%%~dpi)
+set HotSpotBuildRoot=%HotSpotWorkSpace%build
+set HotSpotBuildSpace=%HotSpotBuildRoot%\vs
+set HotSpotJDKDist=%1
-set HotSpotWorkSpace=%1
-set HotSpotBuildSpace=%2
-set HotSpotJDKDist=%3
REM figure out MSC version
for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i
echo **************************************************************
-set ProjectFile=vm.vcproj
+set ProjectFile=jvm.vcproj
if "%MSC_VER%" == "1200" (
-set ProjectFile=vm.dsp
+set ProjectFile=jvm.dsp
echo Will generate VC6 project {unsupported}
) else (
if "%MSC_VER%" == "1400" (
@@ -86,10 +100,16 @@ echo Will generate VC8 {Visual Studio 2005}
if "%MSC_VER%" == "1500" (
echo Will generate VC9 {Visual Studio 2008}
) else (
+if "%MSC_VER%" == "1600" (
+echo Detected Visual Studio 2010, but
+echo will generate VC9 {Visual Studio 2008}
+echo Use conversion wizard in VS 2010.
+) else (
echo Will generate VC7 project {Visual Studio 2003 .NET}
)
)
)
+)
echo %ProjectFile%
echo **************************************************************
@@ -121,6 +141,8 @@ goto usage
:test3
if not "%HOTSPOTMKSHOME%" == "" goto makedir
+if exist c:\cygwin\bin set HOTSPOTMKSHOME=c:\cygwin\bin
+if not "%HOTSPOTMKSHOME%" == "" goto makedir
echo Warning: please set variable HOTSPOTMKSHOME to place where
echo your MKS/Cygwin installation is
echo.
@@ -136,21 +158,24 @@ echo HotSpotJDKDist=%HotSpotJDKDist%
REM This is now safe to do.
:copyfiles
for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
-if NOT EXIST %HotSpotBuildSpace%\%%i mkdir %HotSpotBuildSpace%\%%i
-copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\ > NUL
+if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated
+copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL
)
REM force regneration of ProjectFile
if exist %HotSpotBuildSpace%\%ProjectFile% del %HotSpotBuildSpace%\%ProjectFile%
for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
-
-echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make
+echo -- %%i --
+echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make
echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make
echo # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%%i\local.make
-echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make
+echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make
echo. >> %HotSpotBuildSpace%\%%i\local.make
+echo Variant=%%i >> %HotSpotBuildSpace%\%%i\local.make
+echo WorkSpace=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make
echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make
+echo HOTSPOTBUILDROOT=%HotSpotBuildRoot% >> %HotSpotBuildSpace%\%%i\local.make
echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%%i\local.make
echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%%i\local.make
echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.make
@@ -158,28 +183,36 @@ echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.m
echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.make
echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.make
-REM build config specific stuff
+for /D %%j in (debug, fastdebug, product) do (
+if NOT EXIST %HotSpotBuildSpace%\%%i\%%j mkdir %HotSpotBuildSpace%\%%i\%%j
+)
-pushd %HotSpotBuildSpace%\%%i
+pushd %HotSpotBuildSpace%\%%i\generated
nmake /nologo
popd
+
)
+pushd %HotSpotBuildRoot%
+
+REM It doesn't matter which variant we use here, "compiler1" is as good as any of the others - we need the common variables
+nmake /nologo /F %HotSpotWorkSpace%/make/windows/projectfiles/common/Makefile LOCAL_MAKE=%HotSpotBuildSpace%\compiler1\local.make %HotSpotBuildRoot%/%ProjectFile%
+
+popd
+
goto end
:usage
-echo Usage: create HotSpotWorkSpace HotSpotBuildSpace HotSpotJDKDist
+echo Usage: create HotSpotJDKDist
echo.
-echo This is the interactive build setup script (as opposed to the batch
-echo build execution script). It creates HotSpotBuildSpace if necessary,
-echo copies the appropriate files out of HotSpotWorkSpace into it, and
-echo builds and runs MakeDeps in it. This has the side-effect of creating
+echo This is the VS build setup script (as opposed to the batch
+echo build execution script). It creates a build directory if necessary,
+echo copies the appropriate files out of the workspace into it, and
+echo builds and runs ProjectCreator in it. This has the side-effect of creating
echo the %ProjectFile% file in the build space, which is then used in Visual C++.
-echo The HotSpotJDKDist defines place where JVM binaries should be placed.
-echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection.
echo.
-echo The generated project file depends upon the include databases. If
-echo those are changed then MakeDeps is rerun.
+echo The HotSpotJDKDist defines the JDK that should be used when running the JVM.
+echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection.
echo.
echo NOTE that it is now NOT safe to modify any of the files in the build
echo space, since they may be overwritten whenever this script is run or
diff --git a/hotspot/make/windows/create_obj_files.sh b/hotspot/make/windows/create_obj_files.sh
new file mode 100644
index 00000000000..52ae0bb785c
--- /dev/null
+++ b/hotspot/make/windows/create_obj_files.sh
@@ -0,0 +1,128 @@
+#
+# Copyright (c) 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.
+#
+#
+
+set -e
+
+# Note that we currently do not have a way to set HotSpotMksHome in
+# the batch build, but so far this has not seemed to be a problem. The
+# reason this environment variable is necessary is that it seems that
+# Windows truncates very long PATHs when executing shells like MKS's
+# sh, and it has been found that sometimes `which sh` fails.
+
+if [ "x$HotSpotMksHome" != "x" ]; then
+ TOOL_DIR="$HotSpotMksHome"
+else
+ # HotSpotMksHome is not set so use the directory that contains "sh".
+ # This works with both MKS and Cygwin.
+ SH=`which sh`
+ TOOL_DIR=`dirname "$SH"`
+fi
+
+DIRNAME="$TOOL_DIR/dirname"
+FIND="$TOOL_DIR/find"
+
+TYPE=$1
+Platform_arch=$2
+Platform_arch_model=$3
+Platform_os_family=windows
+Platform_os_arch=windows_$Platform_arch
+
+WorkSpace=$4
+GENERATED=$5
+
+BASE_PATHS="` $FIND ${WorkSpace}/src/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)`"
+BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/share/vm/gc_implementation/shared"
+BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/os/${Platform_os_family}/vm"
+BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/cpu/${Platform_arch}/vm"
+BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/os_cpu/${Platform_os_arch}/vm"
+BASE_PATHS="${BASE_PATHS} ${GENERATED}/jvmtifiles"
+
+CORE_PATHS="${BASE_PATHS}"
+# shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS.
+CORE_PATHS="${CORE_PATHS} `$FIND ${WorkSpace}/src/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
+
+COMPILER1_PATHS="${WorkSpace}/src/share/vm/c1"
+
+COMPILER2_PATHS="${WorkSpace}/src/share/vm/opto"
+COMPILER2_PATHS="${COMPILER2_PATHS} ${WorkSpace}/src/share/vm/libadt"
+COMPILER2_PATHS="${COMPILER2_PATHS} ${GENERATED}/adfiles"
+
+# Include dirs per type.
+case "${TYPE}" in
+ "core") Src_Dirs="${CORE_PATHS}" ;;
+ "kernel") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS}" ;;
+ "compiler1") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS}" ;;
+ "compiler2") Src_Dirs="${CORE_PATHS} ${COMPILER2_PATHS}" ;;
+ "tiered") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;;
+ "zero") Src_Dirs="${CORE_PATHS}" ;;
+ "shark") Src_Dirs="${CORE_PATHS}" ;;
+esac
+
+COMPILER2_SPECIFIC_FILES="opto libadt bcEscapeAnalyzer.cpp chaitin* c2_* runtime_*"
+COMPILER1_SPECIFIC_FILES="c1_*"
+SHARK_SPECIFIC_FILES="shark"
+ZERO_SPECIFIC_FILES="zero"
+
+# These files need to be excluded when building the kernel target.
+KERNEL_EXCLUDED_FILES="attachListener.cpp attachListener_windows.cpp dump.cpp dump_${Platform_arch_model}.cpp forte.cpp fprofiler.cpp heapDumper.cpp heapInspection.cpp jniCheck.cpp jvmtiCodeBlobEvents.cpp jvmtiExtensions.cpp jvmtiImpl.cpp jvmtiRawMonitor.cpp jvmtiTagMap.cpp jvmtiTrace.cpp restore.cpp serialize.cpp vmStructs.cpp g1MemoryPool.cpp psMemoryPool.cpp gcAdaptivePolicyCounters.cpp concurrentGCThread.cpp mutableNUMASpace.cpp allocationStats.cpp gSpaceCounters.cpp immutableSpace.cpp mutableSpace.cpp spaceCounters.cpp yieldingWorkgroup.cpp"
+
+# Always exclude these.
+Src_Files_EXCLUDE="jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp"
+
+# Exclude per type.
+case "${TYPE}" in
+ "core") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
+ "kernel") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ${KERNEL_EXCLUDED_FILES} ciTypeFlow.cpp" ;;
+ "compiler1") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
+ "compiler2") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;
+ "tiered") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;
+ "zero") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
+ "shark") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES}" ;;
+esac
+
+# Special handling of arch model.
+case "${Platform_arch_model}" in
+ "x86_32") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} *x86_64*" ;;
+ "x86_64") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} *x86_32*" ;;
+esac
+
+# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
+function findsrc {
+ $FIND ${1}/. ! -name . -prune \
+ -a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \
+ -a \! \( -name ${Src_Files_EXCLUDE// / -o -name } \) \
+ | sed 's/.*\/\(.*\)/\1/';
+}
+
+Src_Files=
+for e in ${Src_Dirs}; do
+ Src_Files="${Src_Files}`findsrc ${e}` "
+done
+
+Obj_Files=
+for e in ${Src_Files}; do
+ Obj_Files="${Obj_Files}${e%\.[!.]*}.obj "
+done
+
+echo Obj_Files=${Obj_Files}
diff --git a/hotspot/make/windows/makefiles/adlc.make b/hotspot/make/windows/makefiles/adlc.make
index c7519da4955..d03e73373ea 100644
--- a/hotspot/make/windows/makefiles/adlc.make
+++ b/hotspot/make/windows/makefiles/adlc.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
#
#
-!include $(WorkSpace)/make/windows/makefiles/compile.make
# Rules for building adlc.exe
@@ -46,27 +45,16 @@ ADLCFLAGS=-q -T -D_LP64
ADLCFLAGS=-q -T -U_LP64
!endif
-CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
+ADLC_CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
CPP_INCLUDE_DIRS=\
- /I "..\generated" \
- /I "$(WorkSpace)\src\share\vm\compiler" \
- /I "$(WorkSpace)\src\share\vm\code" \
- /I "$(WorkSpace)\src\share\vm\interpreter" \
- /I "$(WorkSpace)\src\share\vm\classfile" \
- /I "$(WorkSpace)\src\share\vm\asm" \
- /I "$(WorkSpace)\src\share\vm\memory" \
- /I "$(WorkSpace)\src\share\vm\oops" \
- /I "$(WorkSpace)\src\share\vm\prims" \
- /I "$(WorkSpace)\src\share\vm\runtime" \
- /I "$(WorkSpace)\src\share\vm\utilities" \
- /I "$(WorkSpace)\src\share\vm\libadt" \
- /I "$(WorkSpace)\src\share\vm\opto" \
- /I "$(WorkSpace)\src\os\windows\vm" \
+ /I "..\generated" \
+ /I "$(WorkSpace)\src\share\vm" \
+ /I "$(WorkSpace)\src\os\windows\vm" \
/I "$(WorkSpace)\src\cpu\$(Platform_arch)\vm"
-# NOTE! If you add any files here, you must also update GENERATED_NAMES_IN_INCL
-# and MakeDepsIDEOptions in makedeps.make.
+# NOTE! If you add any files here, you must also update GENERATED_NAMES_IN_DIR
+# and ProjectCreatorIDEOptions in projectcreator.make.
GENERATED_NAMES=\
ad_$(Platform_arch_model).cpp \
ad_$(Platform_arch_model).hpp \
@@ -81,24 +69,24 @@ GENERATED_NAMES=\
dfa_$(Platform_arch_model).cpp
# NOTE! This must be kept in sync with GENERATED_NAMES
-GENERATED_NAMES_IN_INCL=\
- incls/ad_$(Platform_arch_model).cpp \
- incls/ad_$(Platform_arch_model).hpp \
- incls/ad_$(Platform_arch_model)_clone.cpp \
- incls/ad_$(Platform_arch_model)_expand.cpp \
- incls/ad_$(Platform_arch_model)_format.cpp \
- incls/ad_$(Platform_arch_model)_gen.cpp \
- incls/ad_$(Platform_arch_model)_misc.cpp \
- incls/ad_$(Platform_arch_model)_peephole.cpp \
- incls/ad_$(Platform_arch_model)_pipeline.cpp \
- incls/adGlobals_$(Platform_arch_model).hpp \
- incls/dfa_$(Platform_arch_model).cpp
+GENERATED_NAMES_IN_DIR=\
+ $(AdlcOutDir)\ad_$(Platform_arch_model).cpp \
+ $(AdlcOutDir)\ad_$(Platform_arch_model).hpp \
+ $(AdlcOutDir)\ad_$(Platform_arch_model)_clone.cpp \
+ $(AdlcOutDir)\ad_$(Platform_arch_model)_expand.cpp \
+ $(AdlcOutDir)\ad_$(Platform_arch_model)_format.cpp \
+ $(AdlcOutDir)\ad_$(Platform_arch_model)_gen.cpp \
+ $(AdlcOutDir)\ad_$(Platform_arch_model)_misc.cpp \
+ $(AdlcOutDir)\ad_$(Platform_arch_model)_peephole.cpp \
+ $(AdlcOutDir)\ad_$(Platform_arch_model)_pipeline.cpp \
+ $(AdlcOutDir)\adGlobals_$(Platform_arch_model).hpp \
+ $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp
{$(WorkSpace)\src\share\vm\adlc}.cpp.obj::
- $(CPP) $(CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
+ $(CPP) $(ADLC_CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
{$(WorkSpace)\src\share\vm\opto}.cpp.obj::
- $(CPP) $(CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
+ $(CPP) $(ADLC_CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
adlc.exe: main.obj adlparse.obj archDesc.obj arena.obj dfa.obj dict2.obj filebuff.obj \
forms.obj formsopt.obj formssel.obj opcodes.obj output_c.obj output_h.obj
@@ -110,10 +98,12 @@ adlc.exe: main.obj adlparse.obj archDesc.obj arena.obj dfa.obj dict2.obj filebuf
$(MT) /manifest $@.manifest /outputresource:$@;#1
!endif
-$(GENERATED_NAMES_IN_INCL): $(Platform_arch_model).ad adlc.exe includeDB.current
+$(GENERATED_NAMES_IN_DIR): $(Platform_arch_model).ad adlc.exe
rm -f $(GENERATED_NAMES)
+ if exist $(AdlcOutDir) rmdir /s /q $(AdlcOutDir)
+ mkdir $(AdlcOutDir)
$(ADLC) $(ADLCFLAGS) $(Platform_arch_model).ad
- mv $(GENERATED_NAMES) incls/
+ mv $(GENERATED_NAMES) $(AdlcOutDir)/
$(Platform_arch_model).ad: $(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad $(WorkSpace)/src/os_cpu/windows_$(Platform_arch)/vm/windows_$(Platform_arch_model).ad
rm -f $(Platform_arch_model).ad
diff --git a/hotspot/make/windows/makefiles/compile.make b/hotspot/make/windows/makefiles/compile.make
index 7d7cb8642c3..42c1e8ab3b7 100644
--- a/hotspot/make/windows/makefiles/compile.make
+++ b/hotspot/make/windows/makefiles/compile.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -80,6 +80,20 @@ CPP_FLAGS=$(CPP_FLAGS) /D "IA32"
CPP=ARCH_ERROR
!endif
+CPP_FLAGS=$(CPP_FLAGS) /D "WIN32" /D "_WINDOWS"
+
+# Must specify this for sharedRuntimeTrig.cpp
+CPP_FLAGS=$(CPP_FLAGS) /D "VM_LITTLE_ENDIAN"
+
+# Used for platform dispatching
+CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_FAMILY_windows
+CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_$(Platform_arch)
+CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_MODEL_$(Platform_arch_model)
+CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_windows_$(Platform_arch)
+CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model)
+CPP_FLAGS=$(CPP_FLAGS) /D TARGET_COMPILER_visCPP
+
+
# MSC_VER is a 4 digit number that tells us what compiler is being used
# and is generated when the local.make file is created by build.make
# via the script get_msc_ver.sh
diff --git a/hotspot/make/windows/makefiles/debug.make b/hotspot/make/windows/makefiles/debug.make
index 893a252d522..32d4f46e91d 100644
--- a/hotspot/make/windows/makefiles/debug.make
+++ b/hotspot/make/windows/makefiles/debug.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -28,7 +28,12 @@ AOUT=$(HS_FNAME)
SAWINDBG=sawindbg.dll
GENERATED=../generated
-default:: _build_pch_file.obj $(AOUT) checkAndBuildSA
+# Allow the user to turn off precompiled headers from the command line.
+!if "$(USE_PRECOMPILED_HEADER)" != "0"
+BUILD_PCH_FILE=_build_pch_file.obj
+!endif
+
+default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
!include ../local.make
!include compile.make
@@ -38,15 +43,15 @@ CPP_FLAGS=$(CPP_FLAGS) $(DEBUG_OPT_OPTION)
!include $(WorkSpace)/make/windows/makefiles/vm.make
!include local.make
-!include $(GENERATED)/Dependencies
-
HS_BUILD_ID=$(HS_BUILD_VER)-debug
# Force resources to be rebuilt every time
$(Res_Files): FORCE
-$(AOUT): $(Res_Files) $(Obj_Files)
+vm.def: $(Obj_Files)
sh $(WorkSpace)/make/windows/build_vm_def.sh
+
+$(AOUT): $(Res_Files) $(Obj_Files) vm.def
$(LINK) @<<
$(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files)
<<
@@ -59,3 +64,4 @@ $(AOUT): $(Res_Files) $(Obj_Files)
!include $(WorkSpace)/make/windows/makefiles/shared.make
!include $(WorkSpace)/make/windows/makefiles/sa.make
+!include $(WorkSpace)/make/windows/makefiles/launcher.make
diff --git a/hotspot/make/windows/makefiles/fastdebug.make b/hotspot/make/windows/makefiles/fastdebug.make
index 4b59010cbe6..b9e828b7483 100644
--- a/hotspot/make/windows/makefiles/fastdebug.make
+++ b/hotspot/make/windows/makefiles/fastdebug.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,12 @@ AOUT=$(HS_FNAME)
SAWINDBG=sawindbg.dll
GENERATED=../generated
-default:: _build_pch_file.obj $(AOUT) checkAndBuildSA
+# Allow the user to turn off precompiled headers from the command line.
+!if "$(USE_PRECOMPILED_HEADER)" != "0"
+BUILD_PCH_FILE=_build_pch_file.obj
+!endif
+
+default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
!include ../local.make
!include compile.make
@@ -38,15 +43,15 @@ CPP_FLAGS=$(CPP_FLAGS) $(FASTDEBUG_OPT_OPTION)
!include $(WorkSpace)/make/windows/makefiles/vm.make
!include local.make
-!include $(GENERATED)/Dependencies
-
HS_BUILD_ID=$(HS_BUILD_VER)-fastdebug
# Force resources to be rebuilt every time
$(Res_Files): FORCE
-$(AOUT): $(Res_Files) $(Obj_Files)
+vm.def: $(Obj_Files)
sh $(WorkSpace)/make/windows/build_vm_def.sh
+
+$(AOUT): $(Res_Files) $(Obj_Files) vm.def
$(LINK) @<<
$(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files)
<<
@@ -57,6 +62,6 @@ $(AOUT): $(Res_Files) $(Obj_Files)
$(MT) /manifest $@.manifest /outputresource:$@;#2
!endif
-
!include $(WorkSpace)/make/windows/makefiles/shared.make
!include $(WorkSpace)/make/windows/makefiles/sa.make
+!include $(WorkSpace)/make/windows/makefiles/launcher.make
diff --git a/hotspot/make/windows/makefiles/generated.make b/hotspot/make/windows/makefiles/generated.make
index 47d3bd8b78b..d5add4b030f 100644
--- a/hotspot/make/windows/makefiles/generated.make
+++ b/hotspot/make/windows/makefiles/generated.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
#
!include ../local.make
-!include $(WorkSpace)/make/windows/makefiles/makedeps.make
+!include $(WorkSpace)/make/windows/makefiles/projectcreator.make
!include local.make
# Pick up rules for building JVMTI (JSR-163)
@@ -33,68 +33,25 @@ JvmtiOutDir=jvmtifiles
# Pick up rules for building SA
!include $(WorkSpace)/make/windows/makefiles/sa.make
+AdlcOutDir=adfiles
+
!if ("$(Variant)" == "compiler2") || ("$(Variant)" == "tiered")
-default:: includeDB.current Dependencies incls/ad_$(Platform_arch_model).cpp incls/dfa_$(Platform_arch_model).cpp $(JvmtiGeneratedFiles)
+default:: $(AdlcOutDir)/ad_$(Platform_arch_model).cpp $(AdlcOutDir)/dfa_$(Platform_arch_model).cpp $(JvmtiGeneratedFiles) buildobjfiles
!else
-default:: includeDB.current Dependencies $(JvmtiGeneratedFiles)
+default:: $(JvmtiGeneratedFiles) buildobjfiles
!endif
-# core plus serial gc
-IncludeDBs_base=$(WorkSpace)/src/share/vm/includeDB_core \
- $(WorkSpace)/src/share/vm/includeDB_jvmti \
- $(WorkSpace)/src/share/vm/includeDB_gc \
- $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_serial
+buildobjfiles:
+ @ sh $(WorkSpace)/make/windows/create_obj_files.sh $(Variant) $(Platform_arch) $(Platform_arch_model) $(WorkSpace) . > objfiles.make
-# parallel gc
-IncludeDBs_gc= $(WorkSpace)/src/share/vm/includeDB_gc_parallel \
- $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge \
- $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_shared \
- $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_parNew \
- $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep \
- $(WorkSpace)/src/share/vm/gc_implementation/includeDB_gc_g1
-
-IncludeDBs_core=$(IncludeDBs_base) $(IncludeDBs_gc) \
- $(WorkSpace)/src/share/vm/includeDB_features
-
-!if "$(Variant)" == "core"
-IncludeDBs=$(IncludeDBs_core)
-!endif
-
-!if "$(Variant)" == "kernel"
-IncludeDBs=$(IncludeDBs_base) $(WorkSpace)/src/share/vm/includeDB_compiler1
-!endif
-
-!if "$(Variant)" == "compiler1"
-IncludeDBs=$(IncludeDBs_core) $(WorkSpace)/src/share/vm/includeDB_compiler1
-!endif
-
-
-!if "$(Variant)" == "compiler2"
-IncludeDBs=$(IncludeDBs_core) $(WorkSpace)/src/share/vm/includeDB_compiler2
-!endif
-
-!if "$(Variant)" == "tiered"
-IncludeDBs=$(IncludeDBs_core) $(WorkSpace)/src/share/vm/includeDB_compiler1 \
- $(WorkSpace)/src/share/vm/includeDB_compiler2
-!endif
-
-# Note we don't generate a Visual C++ project file using MakeDeps for
-# the batch build.
-includeDB.current Dependencies: classes/MakeDeps.class $(IncludeDBs)
- cat $(IncludeDBs) > includeDB
- if exist incls rmdir /s /q incls
- mkdir incls
- $(RUN_JAVA) -Djava.class.path=classes MakeDeps WinGammaPlatform$(VcVersion) $(WorkSpace)/make/windows/platform_$(BUILDARCH) includeDB $(MakeDepsOptions)
- rm -f includeDB.current
- cp includeDB includeDB.current
-
-classes/MakeDeps.class: $(MakeDepsSources)
+classes/ProjectCreator.class: $(ProjectCreatorSources)
if exist classes rmdir /s /q classes
mkdir classes
- $(COMPILE_JAVAC) -classpath $(WorkSpace)\src\share\tools\MakeDeps -d classes $(MakeDepsSources)
+ $(COMPILE_JAVAC) -classpath $(WorkSpace)\src\share\tools\ProjectCreator -d classes $(ProjectCreatorSources)
!if ("$(Variant)" == "compiler2") || ("$(Variant)" == "tiered")
+!include $(WorkSpace)/make/windows/makefiles/compile.make
!include $(WorkSpace)/make/windows/makefiles/adlc.make
!endif
diff --git a/hotspot/make/windows/makefiles/launcher.make b/hotspot/make/windows/makefiles/launcher.make
new file mode 100644
index 00000000000..ddee8e2139b
--- /dev/null
+++ b/hotspot/make/windows/makefiles/launcher.make
@@ -0,0 +1,71 @@
+#
+# Copyright (c) 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.
+#
+#
+
+
+LAUNCHER_FLAGS=$(CPP_FLAGS) $(ARCHFLAG) \
+ /D FULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
+ /D JDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
+ /D JDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
+ /D GAMMA \
+ /D LAUNCHER_TYPE=\"gamma\" \
+ /D _CRT_SECURE_NO_WARNINGS \
+ /D _CRT_SECURE_NO_DEPRECATE \
+ /D LINK_INTO_LIBJVM \
+ /I $(WorkSpace)\src\os\windows\launcher \
+ /I $(WorkSpace)\src\share\tools\launcher \
+ /I $(WorkSpace)\src\share\vm\prims \
+ /I $(WorkSpace)\src\share\vm \
+ /I $(WorkSpace)\src\cpu\$(Platform_arch)\vm \
+ /I $(WorkSpace)\src\os\windows\vm
+
+LINK_FLAGS=/manifest $(HS_INTERNAL_NAME).lib kernel32.lib user32.lib /nologo /machine:$(MACHINE) /map /debug /subsystem:console
+
+!if "$(COMPILER_NAME)" == "VS2005"
+# This VS2005 compiler has /GS as a default and requires bufferoverflowU.lib
+# on the link command line, otherwise we get missing __security_check_cookie
+# externals at link time. Even with /GS-, you need bufferoverflowU.lib.
+BUFFEROVERFLOWLIB = bufferoverflowU.lib
+LINK_FLAGS = $(LINK_FLAGS) $(BUFFEROVERFLOWLIB)
+!endif
+
+LAUNCHERDIR = $(WorkSpace)/src/os/windows/launcher
+LAUNCHERDIR_SHARE = $(WorkSpace)/src/share/tools/launcher
+
+OUTDIR = launcher
+
+{$(LAUNCHERDIR)}.c{$(OUTDIR)}.obj:
+ -mkdir $(OUTDIR) 2>NUL >NUL
+ $(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $<
+
+{$(LAUNCHERDIR_SHARE)}.c{$(OUTDIR)}.obj:
+ -mkdir $(OUTDIR) 2>NUL >NUL
+ $(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $<
+
+$(OUTDIR)\*.obj: $(LAUNCHERDIR)\*.c $(LAUNCHERDIR)\*.h $(LAUNCHERDIR_SHARE)\*.c $(LAUNCHERDIR_SHARE)\*.h
+
+launcher: $(OUTDIR)\java.obj $(OUTDIR)\java_md.obj $(OUTDIR)\jli_util.obj
+ echo $(JAVA_HOME) > jdkpath.txt
+ $(LINK) $(LINK_FLAGS) /out:hotspot.exe $**
+
+
diff --git a/hotspot/make/windows/makefiles/makedeps.make b/hotspot/make/windows/makefiles/makedeps.make
deleted file mode 100644
index a25d3a18708..00000000000
--- a/hotspot/make/windows/makefiles/makedeps.make
+++ /dev/null
@@ -1,177 +0,0 @@
-#
-# Copyright (c) 1999, 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.
-#
-#
-
-!include $(WorkSpace)/make/windows/makefiles/rules.make
-
-# This is used externally by both batch and IDE builds, so can't
-# reference any of the HOTSPOTWORKSPACE, HOTSPOTBUILDSPACE,
-# HOTSPOTRELEASEBINDEST, or HOTSPOTDEBUGBINDEST environment variables.
-#
-# NOTE: unfortunately the MakeDepsSources list must be kept
-# synchronized between this and the Solaris version
-# (make/solaris/makefiles/makedeps.make).
-
-MakeDepsSources=\
- $(WorkSpace)\src\share\tools\MakeDeps\Database.java \
- $(WorkSpace)\src\share\tools\MakeDeps\DirectoryTree.java \
- $(WorkSpace)\src\share\tools\MakeDeps\DirectoryTreeNode.java \
- $(WorkSpace)\src\share\tools\MakeDeps\FileFormatException.java \
- $(WorkSpace)\src\share\tools\MakeDeps\FileList.java \
- $(WorkSpace)\src\share\tools\MakeDeps\FileName.java \
- $(WorkSpace)\src\share\tools\MakeDeps\Macro.java \
- $(WorkSpace)\src\share\tools\MakeDeps\MacroDefinitions.java \
- $(WorkSpace)\src\share\tools\MakeDeps\MakeDeps.java \
- $(WorkSpace)\src\share\tools\MakeDeps\MetroWerksMacPlatform.java \
- $(WorkSpace)\src\share\tools\MakeDeps\Platform.java \
- $(WorkSpace)\src\share\tools\MakeDeps\UnixPlatform.java \
- $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatform.java \
- $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatformVC6.java \
- $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatformVC7.java \
- $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatformVC8.java \
- $(WorkSpace)\src\share\tools\MakeDeps\WinGammaPlatformVC9.java \
- $(WorkSpace)\src\share\tools\MakeDeps\Util.java \
- $(WorkSpace)\src\share\tools\MakeDeps\BuildConfig.java \
- $(WorkSpace)\src\share\tools\MakeDeps\ArgsParser.java
-
-# This is only used internally
-MakeDepsIncludesPRIVATE=\
- -relativeInclude src\share\vm\c1 \
- -relativeInclude src\share\vm\compiler \
- -relativeInclude src\share\vm\code \
- -relativeInclude src\share\vm\interpreter \
- -relativeInclude src\share\vm\ci \
- -relativeInclude src\share\vm\classfile \
- -relativeInclude src\share\vm\gc_implementation\parallelScavenge \
- -relativeInclude src\share\vm\gc_implementation\shared \
- -relativeInclude src\share\vm\gc_implementation\parNew \
- -relativeInclude src\share\vm\gc_implementation\concurrentMarkSweep \
- -relativeInclude src\share\vm\gc_implementation\g1 \
- -relativeInclude src\share\vm\gc_interface \
- -relativeInclude src\share\vm\asm \
- -relativeInclude src\share\vm\memory \
- -relativeInclude src\share\vm\oops \
- -relativeInclude src\share\vm\prims \
- -relativeInclude src\share\vm\runtime \
- -relativeInclude src\share\vm\services \
- -relativeInclude src\share\vm\utilities \
- -relativeInclude src\share\vm\libadt \
- -relativeInclude src\share\vm\opto \
- -relativeInclude src\os\windows\vm \
- -relativeInclude src\os_cpu\windows_$(Platform_arch)\vm \
- -relativeInclude src\cpu\$(Platform_arch)\vm
-
-# This is referenced externally by both the IDE and batch builds
-MakeDepsOptions=
-
-# This is used externally, but only by the IDE builds, so we can
-# reference environment variables which aren't defined in the batch
-# build process.
-
-MakeDepsIDEOptions = \
- -useToGeneratePch java.cpp \
- -disablePch os_windows.cpp \
- -disablePch os_windows_$(Platform_arch).cpp \
- -disablePch osThread_windows.cpp \
- -disablePch bytecodeInterpreter.cpp \
- -disablePch bytecodeInterpreterWithChecks.cpp \
- -disablePch getThread_windows_$(Platform_arch).cpp \
- -disablePch_compiler2 opcodes.cpp
-
-# Common options for the IDE builds for core, c1, and c2
-MakeDepsIDEOptions=\
- $(MakeDepsIDEOptions) \
- -sourceBase $(HOTSPOTWORKSPACE) \
- -buildBase $(HOTSPOTBUILDSPACE)\%f\%b \
- -startAt src \
- -compiler $(VcVersion) \
- -projectFileName $(HOTSPOTBUILDSPACE)\$(ProjectFile) \
- -jdkTargetRoot $(HOTSPOTJDKDIST) \
- -define ALIGN_STACK_FRAMES \
- -define VM_LITTLE_ENDIAN \
- -additionalFile includeDB_compiler1 \
- -additionalFile includeDB_compiler2 \
- -additionalFile includeDB_core \
- -additionalFile includeDB_features \
- -additionalFile includeDB_jvmti \
- -additionalFile includeDB_gc \
- -additionalFile includeDB_gc_parallel \
- -additionalFile includeDB_gc_parallelScavenge \
- -additionalFile includeDB_gc_concurrentMarkSweep \
- -additionalFile includeDB_gc_g1 \
- -additionalFile includeDB_gc_parNew \
- -additionalFile includeDB_gc_shared \
- -additionalFile includeDB_gc_serial \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)\%f\%b vm.def \
- -prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LINK_VER)" \
- $(MakeDepsIncludesPRIVATE)
-
-# Add in build-specific options
-!if "$(BUILDARCH)" == "i486"
-MakeDepsIDEOptions=$(MakeDepsIDEOptions) -define IA32
-!endif
-
-##################################################
-# JKERNEL specific options
-##################################################
-MakeDepsIDEOptions=$(MakeDepsIDEOptions) \
- -define_kernel KERNEL \
-
-##################################################
-# Client(C1) compiler specific options
-##################################################
-MakeDepsIDEOptions=$(MakeDepsIDEOptions) \
- -define_compiler1 COMPILER1 \
-
-##################################################
-# Server(C2) compiler specific options
-##################################################
-#NOTE! This list must be kept in sync with GENERATED_NAMES in adlc.make.
-MakeDepsIDEOptions=$(MakeDepsIDEOptions) \
- -define_compiler2 COMPILER2 \
- -absoluteInclude_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls \
- -additionalFile_compiler2 $(Platform_arch_model).ad \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model).cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model).hpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_clone.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_expand.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_format.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_gen.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_misc.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_peephole.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls ad_$(Platform_arch_model)_pipeline.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls adGlobals_$(Platform_arch_model).hpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/incls dfa_$(Platform_arch_model).cpp
-
-# Add in the jvmti (JSR-163) options
-# NOTE: do not pull in jvmtiEnvRecommended.cpp. This file is generated
-# so the programmer can diff it with jvmtiEnv.cpp to be sure the
-# code merge was done correctly (@see jvmti.make and jvmtiEnvFill.java).
-# If so, they would then check it in as a new version of jvmtiEnv.cpp.
-MakeDepsIDEOptions=$(MakeDepsIDEOptions) \
- -absoluteInclude $(HOTSPOTBUILDSPACE)/jvmtifiles \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles jvmtiEnv.hpp \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles jvmtiEnter.cpp \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles jvmtiEnterTrace.cpp \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles jvmti.h \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/jvmtifiles bytecodeInterpreterWithChecks.cpp
diff --git a/hotspot/make/windows/makefiles/product.make b/hotspot/make/windows/makefiles/product.make
index 537791e6338..182f1f2518c 100644
--- a/hotspot/make/windows/makefiles/product.make
+++ b/hotspot/make/windows/makefiles/product.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,12 @@ HS_FNAME=$(HS_INTERNAL_NAME).dll
AOUT=$(HS_FNAME)
GENERATED=../generated
-default:: _build_pch_file.obj $(AOUT) checkAndBuildSA
+# Allow the user to turn off precompiled headers from the command line.
+!if "$(USE_PRECOMPILED_HEADER)" != "0"
+BUILD_PCH_FILE=_build_pch_file.obj
+!endif
+
+default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
!include ../local.make
!include compile.make
@@ -41,8 +46,6 @@ RC_FLAGS=$(RC_FLAGS) /D "NDEBUG"
!include $(WorkSpace)/make/windows/makefiles/vm.make
!include local.make
-!include $(GENERATED)/Dependencies
-
HS_BUILD_ID=$(HS_BUILD_VER)
# Force resources to be rebuilt every time
@@ -55,8 +58,10 @@ $(AOUT): $(Res_Files) $(Obj_Files)
$(LINK_FLAGS) /out:$@ /implib:$*.lib $(Obj_Files) $(Res_Files)
<<
!else
-$(AOUT): $(Res_Files) $(Obj_Files)
+vm.def: $(Obj_Files)
sh $(WorkSpace)/make/windows/build_vm_def.sh
+
+$(AOUT): $(Res_Files) $(Obj_Files) vm.def
$(LINK) @<<
$(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files)
<<
@@ -70,3 +75,4 @@ $(AOUT): $(Res_Files) $(Obj_Files)
!include $(WorkSpace)/make/windows/makefiles/shared.make
!include $(WorkSpace)/make/windows/makefiles/sa.make
+!include $(WorkSpace)/make/windows/makefiles/launcher.make
diff --git a/hotspot/make/windows/makefiles/projectcreator.make b/hotspot/make/windows/makefiles/projectcreator.make
new file mode 100644
index 00000000000..1dc307f9545
--- /dev/null
+++ b/hotspot/make/windows/makefiles/projectcreator.make
@@ -0,0 +1,235 @@
+#
+# Copyright (c) 1999, 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.
+#
+#
+
+!include $(WorkSpace)/make/windows/makefiles/rules.make
+
+# This is used externally by both batch and IDE builds, so can't
+# reference any of the HOTSPOTWORKSPACE, HOTSPOTBUILDSPACE,
+# HOTSPOTRELEASEBINDEST, or HOTSPOTDEBUGBINDEST environment variables.
+#
+# NOTE: unfortunately the ProjectCreatorSources list must be kept
+# synchronized between this and the Solaris version
+# (make/solaris/makefiles/projectcreator.make).
+
+ProjectCreatorSources=\
+ $(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTree.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTreeNode.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\FileFormatException.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\Macro.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\MacroDefinitions.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\ProjectCreator.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatform.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC6.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC7.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC8.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC9.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\Util.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\BuildConfig.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\ArgsParser.java
+
+# This is only used internally
+ProjectCreatorIncludesPRIVATE=\
+ -relativeInclude src\share\vm \
+ -relativeInclude src\share\vm\prims \
+ -relativeInclude src\os\windows\vm \
+ -relativeInclude src\os_cpu\windows_$(Platform_arch)\vm \
+ -relativeInclude src\cpu\$(Platform_arch)\vm \
+ -absoluteInclude $(HOTSPOTBUILDSPACE)/%f/generated \
+ -ignorePath $(HOTSPOTBUILDSPACE)/%f/generated \
+ -ignorePath src\share\vm\adlc \
+ -ignorePath src\share\vm\shark
+
+# This is referenced externally by both the IDE and batch builds
+ProjectCreatorOptions=
+
+# This is used externally, but only by the IDE builds, so we can
+# reference environment variables which aren't defined in the batch
+# build process.
+
+ProjectCreatorIDEOptions = \
+ -useToGeneratePch java.cpp \
+ -disablePch os_windows.cpp \
+ -disablePch os_windows_$(Platform_arch).cpp \
+ -disablePch osThread_windows.cpp \
+ -disablePch bytecodeInterpreter.cpp \
+ -disablePch bytecodeInterpreterWithChecks.cpp \
+ -disablePch getThread_windows_$(Platform_arch).cpp \
+ -disablePch_compiler2 opcodes.cpp
+
+# Common options for the IDE builds for core, c1, and c2
+ProjectCreatorIDEOptions=\
+ $(ProjectCreatorIDEOptions) \
+ -sourceBase $(HOTSPOTWORKSPACE) \
+ -buildBase $(HOTSPOTBUILDSPACE)\%f\%b \
+ -startAt src \
+ -compiler $(VcVersion) \
+ -projectFileName $(HOTSPOTBUILDROOT)\$(ProjectFile) \
+ -jdkTargetRoot $(HOTSPOTJDKDIST) \
+ -define ALIGN_STACK_FRAMES \
+ -define VM_LITTLE_ENDIAN \
+ -prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LINK_VER)" \
+ -postbuild "" "Building hotspot.exe..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) nmake -f $(HOTSPOTWORKSPACE)\make\windows\projectfiles\common\Makefile LOCAL_MAKE=$(HOTSPOTBUILDSPACE)\%f\local.make JAVA_HOME=$(HOTSPOTJDKDIST) launcher" \
+ -ignoreFile jsig.c \
+ -ignoreFile jvmtiEnvRecommended.cpp \
+ -ignoreFile jvmtiEnvStub.cpp \
+ -ignoreFile globalDefinitions_gcc.hpp \
+ -ignoreFile globalDefinitions_sparcWorks.hpp \
+ -ignoreFile version.rc \
+ -ignoreFile Xusage.txt \
+ -define TARGET_ARCH_x86 \
+ -define TARGET_OS_ARCH_windows_x86 \
+ -define TARGET_OS_FAMILY_windows \
+ -define TARGET_COMPILER_visCPP \
+ $(ProjectCreatorIncludesPRIVATE)
+
+# Add in build-specific options
+!if "$(BUILDARCH)" == "i486"
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+ -define IA32 \
+ -ignorePath x86_64 \
+ -define TARGET_ARCH_MODEL_x86_32
+!else
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+ -ignorePath x86_32 \
+ -define TARGET_ARCH_MODEL_x86_64
+!endif
+
+ProjectCreatorIDEOptionsIgnoreCompiler1=\
+ -ignorePath_TARGET c1_
+
+ProjectCreatorIDEOptionsIgnoreCompiler2=\
+ -ignorePath_TARGET src/share/vm/opto \
+ -ignorePath_TARGET src/share/vm/libadt \
+ -ignorePath_TARGET adfiles \
+ -ignoreFile_TARGET bcEscapeAnalyzer.cpp \
+ -ignoreFile_TARGET bcEscapeAnalyzer.hpp \
+ -ignorePath_TARGET chaitin \
+ -ignorePath_TARGET c2_ \
+ -ignorePath_TARGET runtime_ \
+ -ignoreFile_TARGET ciTypeFlow.cpp \
+ -ignoreFile_TARGET ciTypeFlow.hpp \
+ -ignoreFile_TARGET $(Platform_arch_model).ad
+
+##################################################
+# Without compiler(core) specific options
+##################################################
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+$(ProjectCreatorIDEOptionsIgnoreCompiler1:TARGET=core) \
+$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=core)
+
+##################################################
+# JKERNEL specific options
+##################################################
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+ -define_kernel KERNEL \
+$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=kernel) \
+ -ignorePath_kernel src/share/vm/gc_implementation/parallelScavenge \
+ -ignorePath_kernel src/share/vm/gc_implementation/parNew \
+ -ignorePath_kernel src/share/vm/gc_implementation/concurrentMarkSweep \
+ -ignorePath_kernel src/share/vm/gc_implementation/g1 \
+ -ignoreFile_kernel attachListener.cpp \
+ -ignoreFile_kernel attachListener_windows.cpp \
+ -ignoreFile_kernel dump.cpp \
+ -ignoreFile_kernel dump_$(Platform_arch_model).cpp \
+ -ignoreFile_kernel forte.cpp \
+ -ignoreFile_kernel fprofiler.cpp \
+ -ignoreFile_kernel heapDumper.cpp \
+ -ignoreFile_kernel heapInspection.cpp \
+ -ignoreFile_kernel jniCheck.cpp \
+ -ignoreFile_kernel jvmtiCodeBlobEvents.cpp \
+ -ignoreFile_kernel jvmtiExtensions.cpp \
+ -ignoreFile_kernel jvmtiImpl.cpp \
+ -ignoreFile_kernel jvmtiRawMonitor.cpp \
+ -ignoreFile_kernel jvmtiTagMap.cpp \
+ -ignoreFile_kernel jvmtiTrace.cpp \
+ -ignoreFile_kernel jvmtiTrace.hpp \
+ -ignoreFile_kernel restore.cpp \
+ -ignoreFile_kernel serialize.cpp \
+ -ignoreFile_kernel vmStructs.cpp \
+ -ignoreFile_kernel g1MemoryPool.cpp \
+ -ignoreFile_kernel g1MemoryPool.hpp \
+ -ignoreFile_kernel psMemoryPool.cpp \
+ -ignoreFile_kernel psMemoryPool.hpp \
+ -ignoreFile_kernel gcAdaptivePolicyCounters.cpp \
+ -ignoreFile_kernel concurrentGCThread.cpp \
+ -ignoreFile_kernel mutableNUMASpace.cpp \
+ -ignoreFile_kernel ciTypeFlow.cpp \
+ -ignoreFile_kernel ciTypeFlow.hpp \
+ -ignoreFile_kernel oop.pcgc.inline.hpp \
+ -ignoreFile_kernel oop.psgc.inline.hpp \
+ -ignoreFile_kernel allocationStats.cpp \
+ -ignoreFile_kernel allocationStats.hpp \
+ -ignoreFile_kernel concurrentGCThread.hpp \
+ -ignoreFile_kernel gSpaceCounters.cpp \
+ -ignoreFile_kernel gSpaceCounters.hpp \
+ -ignoreFile_kernel gcAdaptivePolicyCounters.hpp \
+ -ignoreFile_kernel immutableSpace.cpp \
+ -ignoreFile_kernel mutableNUMASpace.hpp \
+ -ignoreFile_kernel mutableSpace.cpp \
+ -ignoreFile_kernel spaceCounters.cpp \
+ -ignoreFile_kernel spaceCounters.hpp \
+ -ignoreFile_kernel yieldingWorkgroup.cpp \
+ -ignoreFile_kernel yieldingWorkgroup.hpp \
+ -ignorePath_kernel vmStructs_ \
+ -ignoreFile_kernel $(Platform_arch_model).ad \
+ -additionalFile_kernel gcTaskManager.hpp
+
+##################################################
+# Client(C1) compiler specific options
+##################################################
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+ -define_compiler1 COMPILER1 \
+$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1)
+
+##################################################
+# Server(C2) compiler specific options
+##################################################
+#NOTE! This list must be kept in sync with GENERATED_NAMES in adlc.make.
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+ -define_compiler2 COMPILER2 \
+ -additionalFile_compiler2 $(Platform_arch_model).ad \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model).cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model).hpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_clone.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_expand.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_format.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_gen.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_misc.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_peephole.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_pipeline.cpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles adGlobals_$(Platform_arch_model).hpp \
+ -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles dfa_$(Platform_arch_model).cpp \
+ $(ProjectCreatorIDEOptionsIgnoreCompiler1:TARGET=compiler2)
+
+# Add in the jvmti (JSR-163) options
+# NOTE: do not pull in jvmtiEnvRecommended.cpp. This file is generated
+# so the programmer can diff it with jvmtiEnv.cpp to be sure the
+# code merge was done correctly (@see jvmti.make and jvmtiEnvFill.java).
+# If so, they would then check it in as a new version of jvmtiEnv.cpp.
+ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
+ -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmtiEnv.hpp \
+ -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmtiEnter.cpp \
+ -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmtiEnterTrace.cpp \
+ -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmti.h \
+ -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles bytecodeInterpreterWithChecks.cpp
diff --git a/hotspot/make/windows/makefiles/rules.make b/hotspot/make/windows/makefiles/rules.make
index 6a6b379d95d..431ff3ecb85 100644
--- a/hotspot/make/windows/makefiles/rules.make
+++ b/hotspot/make/windows/makefiles/rules.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 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
@@ -48,7 +48,7 @@ BOOT_TARGET_CLASS_VERSION=6
JAVAC_FLAGS=-g -encoding ascii
BOOTSTRAP_JAVAC_FLAGS=$(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
-ProjectFile=vm.vcproj
+ProjectFile=jvm.vcproj
!if "$(MSC_VER)" == "1200"
@@ -63,6 +63,11 @@ VcVersion=VC8
VcVersion=VC9
+!elseif "$(MSC_VER)" == "1600"
+
+# for compatibility - we don't yet have a ProjectCreator for VC10
+VcVersion=VC9
+
!else
VcVersion=VC7
diff --git a/hotspot/make/windows/makefiles/vm.make b/hotspot/make/windows/makefiles/vm.make
index 0f4cd002ca1..69ff1a7e780 100644
--- a/hotspot/make/windows/makefiles/vm.make
+++ b/hotspot/make/windows/makefiles/vm.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -25,6 +25,8 @@
# Resource file containing VERSIONINFO
Res_Files=.\version.res
+!include ..\generated\objfiles.make
+
!ifdef RELEASE
!ifdef DEVELOP
CPP_FLAGS=$(CPP_FLAGS) /D "DEBUG"
@@ -69,10 +71,7 @@ CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_BUILD_TARGET=\"$(BUILD_FLAVOR)\""
CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_BUILD_USER=\"$(BuildUser)\""
CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_VM_DISTRO=\"$(HOTSPOT_VM_DISTRO)\""
-CPP_FLAGS=$(CPP_FLAGS) /D "WIN32" /D "_WINDOWS" $(CPP_INCLUDE_DIRS)
-
-# Must specify this for sharedRuntimeTrig.cpp
-CPP_FLAGS=$(CPP_FLAGS) /D "VM_LITTLE_ENDIAN"
+CPP_FLAGS=$(CPP_FLAGS) $(CPP_INCLUDE_DIRS)
# Define that so jni.h is on correct side
CPP_FLAGS=$(CPP_FLAGS) /D "_JNI_IMPLEMENTATION_"
@@ -94,6 +93,8 @@ AGCT_EXPORT=/export:AsyncGetCallTrace
!endif
!endif
+# If you modify exports below please do the corresponding changes in
+# src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
LINK_FLAGS=$(LINK_FLAGS) $(STACK_SIZE) /subsystem:windows /dll /base:0x8000000 \
/export:JNI_GetDefaultJavaVMInitArgs \
/export:JNI_CreateJavaVM \
@@ -111,37 +112,24 @@ LINK_FLAGS=$(LINK_FLAGS) $(STACK_SIZE) /subsystem:windows /dll /base:0x8000000 \
/export:JVM_InitAgentProperties
CPP_INCLUDE_DIRS=\
- /I "..\generated" \
- /I "..\generated\jvmtifiles" \
- /I "$(WorkSpace)\src\share\vm\c1" \
- /I "$(WorkSpace)\src\share\vm\compiler" \
- /I "$(WorkSpace)\src\share\vm\code" \
- /I "$(WorkSpace)\src\share\vm\interpreter" \
- /I "$(WorkSpace)\src\share\vm\ci" \
- /I "$(WorkSpace)\src\share\vm\classfile" \
- /I "$(WorkSpace)\src\share\vm\gc_implementation\parallelScavenge"\
- /I "$(WorkSpace)\src\share\vm\gc_implementation\shared"\
- /I "$(WorkSpace)\src\share\vm\gc_implementation\parNew"\
- /I "$(WorkSpace)\src\share\vm\gc_implementation\concurrentMarkSweep"\
- /I "$(WorkSpace)\src\share\vm\gc_implementation\g1"\
- /I "$(WorkSpace)\src\share\vm\gc_interface"\
- /I "$(WorkSpace)\src\share\vm\asm" \
- /I "$(WorkSpace)\src\share\vm\memory" \
- /I "$(WorkSpace)\src\share\vm\oops" \
- /I "$(WorkSpace)\src\share\vm\prims" \
- /I "$(WorkSpace)\src\share\vm\runtime" \
- /I "$(WorkSpace)\src\share\vm\services" \
- /I "$(WorkSpace)\src\share\vm\utilities" \
- /I "$(WorkSpace)\src\share\vm\libadt" \
- /I "$(WorkSpace)\src\share\vm\opto" \
- /I "$(WorkSpace)\src\os\windows\vm" \
+ /I "..\generated" \
+ /I "$(WorkSpace)\src\share\vm" \
+ /I "$(WorkSpace)\src\share\vm\prims" \
+ /I "$(WorkSpace)\src\os\windows\vm" \
/I "$(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm" \
/I "$(WorkSpace)\src\cpu\$(Platform_arch)\vm"
-CPP_USE_PCH=/Fp"vm.pch" /Yu"incls/_precompiled.incl"
+CPP_DONT_USE_PCH=/D DONT_USE_PRECOMPILED_HEADER
+
+!if "$(USE_PRECOMPILED_HEADER)" != "0"
+CPP_USE_PCH=/Fp"vm.pch" /Yu"precompiled.hpp"
+!else
+CPP_USE_PCH=$(CPP_DONT_USE_PCH)
+!endif
# Where to find the source code for the virtual machine
-VM_PATH=../generated/incls
+VM_PATH=../generated
+VM_PATH=$(VM_PATH);../generated/adfiles
VM_PATH=$(VM_PATH);../generated/jvmtifiles
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/c1
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/compiler
@@ -173,31 +161,31 @@ VM_PATH={$(VM_PATH)}
# Special case files not using precompiled header files.
c1_RInfo_$(Platform_arch).obj: $(WorkSpace)\src\cpu\$(Platform_arch)\vm\c1_RInfo_$(Platform_arch).cpp
- $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\cpu\$(Platform_arch)\vm\c1_RInfo_$(Platform_arch).cpp
+ $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\cpu\$(Platform_arch)\vm\c1_RInfo_$(Platform_arch).cpp
os_windows.obj: $(WorkSpace)\src\os\windows\vm\os_windows.cpp
- $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os\windows\vm\os_windows.cpp
+ $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os\windows\vm\os_windows.cpp
os_windows_$(Platform_arch).obj: $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\os_windows_$(Platform_arch).cpp
- $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\os_windows_$(Platform_arch).cpp
+ $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\os_windows_$(Platform_arch).cpp
osThread_windows.obj: $(WorkSpace)\src\os\windows\vm\osThread_windows.cpp
- $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os\windows\vm\osThread_windows.cpp
+ $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os\windows\vm\osThread_windows.cpp
conditionVar_windows.obj: $(WorkSpace)\src\os\windows\vm\conditionVar_windows.cpp
- $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os\windows\vm\conditionVar_windows.cpp
+ $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os\windows\vm\conditionVar_windows.cpp
getThread_windows_$(Platform_arch).obj: $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\getThread_windows_$(Platform_arch).cpp
- $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\getThread_windows_$(Platform_arch).cpp
+ $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\getThread_windows_$(Platform_arch).cpp
opcodes.obj: $(WorkSpace)\src\share\vm\opto\opcodes.cpp
- $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\share\vm\opto\opcodes.cpp
+ $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\share\vm\opto\opcodes.cpp
bytecodeInterpreter.obj: $(WorkSpace)\src\share\vm\interpreter\bytecodeInterpreter.cpp
- $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\share\vm\interpreter\bytecodeInterpreter.cpp
+ $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\share\vm\interpreter\bytecodeInterpreter.cpp
bytecodeInterpreterWithChecks.obj: ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp
- $(CPP) $(CPP_FLAGS) /c ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp
+ $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp
# Default rules for the Virtual Machine
{$(WorkSpace)\src\share\vm\c1}.cpp.obj::
@@ -280,11 +268,14 @@ bytecodeInterpreterWithChecks.obj: ..\generated\jvmtifiles\bytecodeInterpreterWi
{..\generated\incls}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
+{..\generated\adfiles}.cpp.obj::
+ $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
+
{..\generated\jvmtifiles}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
default::
_build_pch_file.obj:
- @echo #include "incls/_precompiled.incl" > ../generated/_build_pch_file.cpp
- $(CPP) $(CPP_FLAGS) /Fp"vm.pch" /Yc"incls/_precompiled.incl" /c ../generated/_build_pch_file.cpp
+ @echo #include "precompiled.hpp" > ../generated/_build_pch_file.cpp
+ $(CPP) $(CPP_FLAGS) /Fp"vm.pch" /Yc"precompiled.hpp" /c ../generated/_build_pch_file.cpp
diff --git a/hotspot/make/windows/projectfiles/common/Makefile b/hotspot/make/windows/projectfiles/common/Makefile
index 038cb280b2f..8d55b9097f9 100644
--- a/hotspot/make/windows/projectfiles/common/Makefile
+++ b/hotspot/make/windows/projectfiles/common/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 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
@@ -22,6 +22,11 @@
#
#
+!ifdef LOCAL_MAKE
+!include $(LOCAL_MAKE)
+!endif
+
+
WorkSpace=$(HOTSPOTWORKSPACE)
!ifdef ALT_BOOTDIR
@@ -32,74 +37,39 @@ BootStrapDir=$(BOOTDIR)
!else
!ifdef JAVA_HOME
BootStrapDir=$(JAVA_HOME)
+!else
+!ifdef HOTSPOTJDKDIST
+BootStrapDir=$(HOTSPOTJDKDIST)
+!endif
!endif
!endif
!endif
-!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/makedeps.make
+
+
+!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/projectcreator.make
+!include $(WorkSpace)/make/windows/makefiles/compile.make
# Pick up rules for building JVMTI (JSR-163)
-JvmtiOutDir=$(HOTSPOTBUILDSPACE)\jvmtifiles
+JvmtiOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\jvmtifiles
!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/jvmti.make
Platform=$(HOTSPOTWORKSPACE)/make/windows/platform_$(BUILDARCH)
-default:: $(AdditionalTargets) $(JvmtiGeneratedFiles)
-
-IncludeDBs_base=$(HOTSPOTWORKSPACE)/src/share/vm/includeDB_core \
- $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_jvmti \
- $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_gc \
- $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_serial
-
-# Parallel gc files
-IncludeDBs_gc=$(HOTSPOTWORKSPACE)/src/share/vm/includeDB_gc_parallel \
- $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_shared \
- $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_parNew \
- $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge \
- $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep \
- $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_g1
-
-
-IncludeDBs_kernel =$(IncludeDBs_base) \
- $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler1
-
-IncludeDBs_core =$(IncludeDBs_base) $(IncludeDBs_gc) \
- $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_features
-
-IncludeDBs_compiler1=$(IncludeDBs_core) \
- $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler1
-
-IncludeDBs_compiler2=$(IncludeDBs_core) \
- $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler2
-
-IncludeDBs_tiered=$(IncludeDBs_core) \
- $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler1 \
- $(HOTSPOTWORKSPACE)/src/share/vm/includeDB_compiler2
-
-
-!if "$(Variant)" == "compiler1"
-IncludeDBs = $(IncludeDBs_compiler1)
-!endif
-
!if "$(Variant)" == "compiler2"
-IncludeDBs = $(IncludeDBs_compiler2)
# Pick up rules for building adlc
!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/adlc.make
!endif
!if "$(Variant)" == "tiered"
-IncludeDBs = $(IncludeDBs_tiered)
# Pick up rules for building adlc
!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/adlc.make
!endif
-!if "$(Variant)" == "core"
-IncludeDBs = $(IncludeDBs_core)
-!endif
+HS_INTERNAL_NAME=jvm
+!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/launcher.make
-!if "$(Variant)" == "kernel"
-IncludeDBs = $(IncludeDBs_kernel)
-!endif
+default:: $(AdditionalTargets) $(JvmtiGeneratedFiles)
!include $(HOTSPOTWORKSPACE)/make/hotspot_version
@@ -108,7 +78,11 @@ HOTSPOT_RELEASE_VERSION="$(HOTSPOT_RELEASE_VERSION)"
!else
HOTSPOT_RELEASE_VERSION="$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER)"
!endif
+!if "$(USER_RELEASE_SUFFIX)" != ""
+HOTSPOT_BUILD_VERSION$(HOTSPOT_BUILD_VERSION) = internal-$(USER_RELEASE_SUFFIX)
+!else
HOTSPOT_BUILD_VERSION$(HOTSPOT_BUILD_VERSION) = internal
+!endif
!if "$(HOTSPOT_BUILD_VERSION)" != ""
HOTSPOT_RELEASE_VERSION="$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)"
!endif
@@ -130,55 +104,22 @@ HOTSPOT_VM_DISTRO="OpenJDK"
!endif
!endif
-MakeDepsIDEOptions = $(MakeDepsIDEOptions) \
- -includeDB_kernel $(HOTSPOTBUILDSPACE)\includeDB_kernel \
- -includeDB_core $(HOTSPOTBUILDSPACE)\includeDB_core \
- -includeDB_compiler1 $(HOTSPOTBUILDSPACE)\includeDB_compiler1 \
- -includeDB_compiler2 $(HOTSPOTBUILDSPACE)\includeDB_compiler2 \
- -includeDB_tiered $(HOTSPOTBUILDSPACE)\includeDB_tiered \
+ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) \
-platform $(Platform) \
-define HOTSPOT_RELEASE_VERSION=\\\"$(HOTSPOT_RELEASE_VERSION)\\\" \
-define JRE_RELEASE_VERSION=\\\"$(JRE_RELEASE_VERSION)\\\" \
-define HOTSPOT_VM_DISTRO=\\\"$(HOTSPOT_VM_DISTRO)\\\"
-incls:
- @mkdir incls
-
-includeDB.current $(ProjectFile) Dependencies: local.make $(HOTSPOTBUILDSPACE)/classes/MakeDeps.class \
- $(IncludeDBs) incls
- @rm -f includeDB $(HOTSPOTBUILDSPACE)\includeDB_kernel \
- $(HOTSPOTBUILDSPACE)\includeDB_core \
- $(HOTSPOTBUILDSPACE)\includeDB_compiler1 \
- $(HOTSPOTBUILDSPACE)\includeDB_compiler2 \
- $(HOTSPOTBUILDSPACE)\includeDB_tiered
- @cat $(IncludeDBs_kernel) > $(HOTSPOTBUILDSPACE)\includeDB_kernel
- @cat $(IncludeDBs_core) > $(HOTSPOTBUILDSPACE)\includeDB_core
- @cat $(IncludeDBs_compiler1) > $(HOTSPOTBUILDSPACE)\includeDB_compiler1
- @cat $(IncludeDBs_compiler2) > $(HOTSPOTBUILDSPACE)\includeDB_compiler2
- @cat $(IncludeDBs_tiered) > $(HOTSPOTBUILDSPACE)\includeDB_tiered
- @echo java.cpp jni.h > includeDB
- @$(RUN_JAVA) -Djava.class.path=$(HOTSPOTBUILDSPACE)/classes MakeDeps diffs WinGammaPlatform$(VcVersion) \
- $(Platform) includeDB.current $(Platform) includeDB $(MakeDepsOptions) $(MakeDepsIDEOptions)
- @rm -f includeDB.current
- @cp includeDB includeDB.current
-
-lists: $(HOTSPOTBUILDSPACE)/classes/MakeDeps.class FORCE
- @if exist incls rmdir /s /q incls
- @rm -f includeDB
- @cat $(IncludeDBs) > includeDB
- @mkdir incls
- @$(RUN_JAVA) -Djava.class.path=$(HOTSPOTBUILDSPACE)/classes MakeDeps WinGammaPlatform$(VcVersion) \
- $(Platform) includeDB $(MakeDepsOptions) $(MakeDepsIDEOptions)
- @rm -f includeDB.current
- @cp includeDB includeDB.current
+$(HOTSPOTBUILDROOT)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
+ @$(RUN_JAVA) -Djava.class.path=$(HOTSPOTBUILDSPACE)/classes ProjectCreator WinGammaPlatform$(VcVersion) $(ProjectCreatorIDEOptions)
clean:
- @rm -rf incls $(HOTSPOTBUILDSPACE)/classes
- @rm -f includeDB includeDB.current $(ProjectFile) Dependencies
+ @rm -rf $(HOTSPOTBUILDSPACE)/classes
+ @rm -r ../$(ProjectFile)
-$(HOTSPOTBUILDSPACE)/classes/MakeDeps.class: $(MakeDepsSources)
+$(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class: $(ProjectCreatorSources)
@if exist $(HOTSPOTBUILDSPACE)\classes rmdir /s /q $(HOTSPOTBUILDSPACE)\classes
@mkdir $(HOTSPOTBUILDSPACE)\classes
- @$(COMPILE_JAVAC) -classpath $(HOTSPOTWORKSPACE)\src\share\tools\MakeDeps -d $(HOTSPOTBUILDSPACE)/classes $(MakeDepsSources)
+ @$(COMPILE_JAVAC) -classpath $(HOTSPOTWORKSPACE)\src\share\tools\ProjectCreator -d $(HOTSPOTBUILDSPACE)/classes $(ProjectCreatorSources)
FORCE:
diff --git a/hotspot/make/windows/projectfiles/compiler1/Makefile b/hotspot/make/windows/projectfiles/compiler1/Makefile
index 83c3897f735..183a27647dd 100644
--- a/hotspot/make/windows/projectfiles/compiler1/Makefile
+++ b/hotspot/make/windows/projectfiles/compiler1/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
#
#
-Variant=compiler1
-!include local.make
+!include ../local.make
!include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
diff --git a/hotspot/make/windows/projectfiles/compiler1/vm.def b/hotspot/make/windows/projectfiles/compiler1/vm.def
index 7811a1fc9bb..b450e81fd01 100644
--- a/hotspot/make/windows/projectfiles/compiler1/vm.def
+++ b/hotspot/make/windows/projectfiles/compiler1/vm.def
@@ -2,6 +2,6 @@
; This .DEF file is a placeholder for one which is automatically
; generated during the build process. See
; make\windows\build_vm_def.sh and
-; make\windows\makefiles\makedeps.make (esp. the "-prelink"
+; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
; options).
;
diff --git a/hotspot/make/windows/projectfiles/compiler2/Makefile b/hotspot/make/windows/projectfiles/compiler2/Makefile
index 49f96eb7f11..1df97d232a8 100644
--- a/hotspot/make/windows/projectfiles/compiler2/Makefile
+++ b/hotspot/make/windows/projectfiles/compiler2/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
@@ -22,8 +22,8 @@
#
#
-Variant=compiler2
-!include local.make
-AdditionalTargets=incls/ad_$(Platform_arch_model).cpp incls/dfa_$(Platform_arch_model).cpp
+!include ../local.make
+AdlcOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\adfiles
+AdditionalTargets=$(AdlcOutDir)\ad_$(Platform_arch_model).cpp $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp
!include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
diff --git a/hotspot/make/windows/projectfiles/compiler2/vm.def b/hotspot/make/windows/projectfiles/compiler2/vm.def
index 7811a1fc9bb..b450e81fd01 100644
--- a/hotspot/make/windows/projectfiles/compiler2/vm.def
+++ b/hotspot/make/windows/projectfiles/compiler2/vm.def
@@ -2,6 +2,6 @@
; This .DEF file is a placeholder for one which is automatically
; generated during the build process. See
; make\windows\build_vm_def.sh and
-; make\windows\makefiles\makedeps.make (esp. the "-prelink"
+; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
; options).
;
diff --git a/hotspot/make/windows/projectfiles/core/Makefile b/hotspot/make/windows/projectfiles/core/Makefile
index 27ea55ff1a2..5b23a8467cb 100644
--- a/hotspot/make/windows/projectfiles/core/Makefile
+++ b/hotspot/make/windows/projectfiles/core/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
#
#
-Variant=core
-!include local.make
+!include ../local.make
!include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
diff --git a/hotspot/make/windows/projectfiles/core/vm.def b/hotspot/make/windows/projectfiles/core/vm.def
index 7811a1fc9bb..b450e81fd01 100644
--- a/hotspot/make/windows/projectfiles/core/vm.def
+++ b/hotspot/make/windows/projectfiles/core/vm.def
@@ -2,6 +2,6 @@
; This .DEF file is a placeholder for one which is automatically
; generated during the build process. See
; make\windows\build_vm_def.sh and
-; make\windows\makefiles\makedeps.make (esp. the "-prelink"
+; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
; options).
;
diff --git a/hotspot/make/windows/projectfiles/kernel/Makefile b/hotspot/make/windows/projectfiles/kernel/Makefile
index e18305a67b3..bb231fca6c8 100644
--- a/hotspot/make/windows/projectfiles/kernel/Makefile
+++ b/hotspot/make/windows/projectfiles/kernel/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 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
@@ -22,7 +22,6 @@
#
#
-Variant=compiler1
-!include local.make
+!include ../local.make
!include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
diff --git a/hotspot/make/windows/projectfiles/kernel/vm.def b/hotspot/make/windows/projectfiles/kernel/vm.def
index 7811a1fc9bb..b450e81fd01 100644
--- a/hotspot/make/windows/projectfiles/kernel/vm.def
+++ b/hotspot/make/windows/projectfiles/kernel/vm.def
@@ -2,6 +2,6 @@
; This .DEF file is a placeholder for one which is automatically
; generated during the build process. See
; make\windows\build_vm_def.sh and
-; make\windows\makefiles\makedeps.make (esp. the "-prelink"
+; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
; options).
;
diff --git a/hotspot/make/windows/projectfiles/tiered/Makefile b/hotspot/make/windows/projectfiles/tiered/Makefile
index b513759ad7b..5398cb99d46 100644
--- a/hotspot/make/windows/projectfiles/tiered/Makefile
+++ b/hotspot/make/windows/projectfiles/tiered/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 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
@@ -22,8 +22,8 @@
#
#
-Variant=tiered
-!include local.make
-AdditionalTargets=incls/ad_$(Platform_arch_model).cpp incls/dfa_$(Platform_arch_model).cpp
+!include ../local.make
+AdlcOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\adfiles
+AdditionalTargets=$(AdlcOutDir)\ad_$(Platform_arch_model).cpp $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp
!include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
diff --git a/hotspot/make/windows/projectfiles/tiered/vm.def b/hotspot/make/windows/projectfiles/tiered/vm.def
index 7811a1fc9bb..b450e81fd01 100644
--- a/hotspot/make/windows/projectfiles/tiered/vm.def
+++ b/hotspot/make/windows/projectfiles/tiered/vm.def
@@ -2,6 +2,6 @@
; This .DEF file is a placeholder for one which is automatically
; generated during the build process. See
; make\windows\build_vm_def.sh and
-; make\windows\makefiles\makedeps.make (esp. the "-prelink"
+; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
; options).
;
diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp
index a677b20dfa0..8512afcba95 100644
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp
@@ -22,8 +22,24 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#endif
// Convert the raw encoding form into the form expected by the
// constructor for Address.
@@ -893,10 +909,10 @@ void MacroAssembler::verify_thread() {
#if defined(COMPILER2) && !defined(_LP64)
// Save & restore possible 64-bit Long arguments in G-regs
sllx(L0,32,G2); // Move old high G1 bits high in G2
- sllx(G1, 0,G1); // Clear current high G1 bits
+ srl(G1, 0,G1); // Clear current high G1 bits
or3 (G1,G2,G1); // Recover 64-bit G1
sllx(L6,32,G2); // Move old high G4 bits high in G2
- sllx(G4, 0,G4); // Clear current high G4 bits
+ srl(G4, 0,G4); // Clear current high G4 bits
or3 (G4,G2,G4); // Recover 64-bit G4
#endif
restore(O0, 0, G2_thread);
@@ -1427,6 +1443,45 @@ void MacroAssembler::set64(jlong value, Register d, Register tmp) {
}
}
+int MacroAssembler::size_of_set64(jlong value) {
+ v9_dep();
+
+ int hi = (int)(value >> 32);
+ int lo = (int)(value & ~0);
+ int count = 0;
+
+ // (Matcher::isSimpleConstant64 knows about the following optimizations.)
+ if (Assembler::is_simm13(lo) && value == lo) {
+ count++;
+ } else if (hi == 0) {
+ count++;
+ if (low10(lo) != 0)
+ count++;
+ }
+ else if (hi == -1) {
+ count += 2;
+ }
+ else if (lo == 0) {
+ if (Assembler::is_simm13(hi)) {
+ count++;
+ } else {
+ count++;
+ if (low10(hi) != 0)
+ count++;
+ }
+ count++;
+ }
+ else {
+ count += 2;
+ if (low10(hi) != 0)
+ count++;
+ if (low10(lo) != 0)
+ count++;
+ count += 2;
+ }
+ return count;
+}
+
// compute size in bytes of sparc frame, given
// number of extraWords
int MacroAssembler::total_frame_size_in_bytes(int extraWords) {
diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
index 486222751b5..ae4357edd76 100644
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_ASSEMBLER_SPARC_HPP
+#define CPU_SPARC_VM_ASSEMBLER_SPARC_HPP
+
class BiasedLockingCounters;
// promises that the system will not use traps 16-31
@@ -1618,6 +1621,10 @@ public:
void sub( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | rs2(s2) ); }
void sub( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
+
+ // Note: offset is added to s2.
+ inline void sub(Register s1, RegisterOrConstant s2, Register d, int offset = 0);
+
void subcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | rs2(s2) ); }
void subcc( Register s1, int simm13a, Register d ) { emit_long( 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_long( op(arith_op) | rd(d) | op3(subc_op3 ) | rs1(s1) | rs2(s2) ); }
@@ -1795,6 +1802,7 @@ class MacroAssembler: public Assembler {
// branches that use right instruction for v8 vs. v9
inline void br( Condition c, bool a, Predict p, address d, relocInfo::relocType rt = relocInfo::none );
inline void br( Condition c, bool a, Predict p, Label& L );
+
inline void fb( Condition c, bool a, Predict p, address d, relocInfo::relocType rt = relocInfo::none );
inline void fb( Condition c, bool a, Predict p, Label& L );
@@ -1891,6 +1899,9 @@ public:
void patchable_set(intptr_t value, Register d);
void set64(jlong value, Register d, Register tmp);
+ // Compute size of set64.
+ static int size_of_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); }
@@ -2500,3 +2511,5 @@ class SkipIfEqual : public StackObj {
// On RISC, there's no benefit to verifying instruction boundaries.
inline bool AbstractAssembler::pd_check_instruction_mark() { return false; }
#endif
+
+#endif // CPU_SPARC_VM_ASSEMBLER_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
index db8807cfd06..106aa14e5b0 100644
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
@@ -22,6 +22,14 @@
*
*/
+#ifndef CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP
+#define CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP
+
+#include "asm/assembler.inline.hpp"
+#include "asm/codeBuffer.hpp"
+#include "code/codeCache.hpp"
+#include "runtime/handles.inline.hpp"
+
inline void MacroAssembler::pd_patch_instruction(address branch, address target) {
jint& stub_inst = *(jint*) branch;
stub_inst = patched_branch(target - branch, stub_inst, 0);
@@ -320,6 +328,11 @@ inline void Assembler::stcsr( int crd, Register s1, int simm13a) { v8_only();
inline void Assembler::stdcq( int crd, Register s1, Register s2) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | rs2(s2) ); }
inline void Assembler::stdcq( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
+inline void Assembler::sub(Register s1, RegisterOrConstant s2, Register d, int offset) {
+ if (s2.is_register()) sub(s1, s2.as_register(), d);
+ else { sub(s1, s2.as_constant() + offset, d); offset = 0; }
+ if (offset != 0) sub(d, offset, d);
+}
// pp 231
@@ -822,3 +835,5 @@ inline void MacroAssembler::membar( Membar_mask_bits const7a ) {
Assembler::ldstub(SP, 0, G0);
}
}
+
+#endif // CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP
diff --git a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp
index 9e3b78920e9..643762eca01 100644
--- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,4 +22,24 @@
*
*/
+#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/methodDataOop.hpp"
+#include "oops/methodOop.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
index d339d3485e3..aad5bc7162c 100644
--- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#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 */
@@ -97,3 +100,5 @@ public:
((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
index 6bd42a8ec84..d9c8e66de6a 100644
--- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp
+++ b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#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; }
@@ -331,3 +334,5 @@ class u8_converter {
}
};
#endif /* ALIGN_CONVERTER */
+
+#endif // CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP
diff --git a/hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp b/hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp
index d8701db24d9..8874d8ca8cc 100644
--- a/hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,8 +22,8 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_bytecodes_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecodes.hpp"
void Bytecodes::pd_initialize() {
diff --git a/hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp b/hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp
index b6913fa5621..f1d08b336ab 100644
--- a/hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_BYTECODES_SPARC_HPP
+#define CPU_SPARC_VM_BYTECODES_SPARC_HPP
+
#ifdef SPARC
#define NLOCALS_IN_REGS 6
#endif
@@ -30,3 +33,5 @@
// Sparc specific bytecodes
// (none)
+
+#endif // CPU_SPARC_VM_BYTECODES_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/bytes_sparc.hpp b/hotspot/src/cpu/sparc/vm/bytes_sparc.hpp
index 7593326364a..67d4307ff74 100644
--- a/hotspot/src/cpu/sparc/vm/bytes_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/bytes_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,11 @@
*
*/
+#ifndef CPU_SPARC_VM_BYTES_SPARC_HPP
+#define CPU_SPARC_VM_BYTES_SPARC_HPP
+
+#include "memory/allocation.hpp"
+
class Bytes: AllStatic {
public:
// Efficient reading and writing of unaligned unsigned data in platform-specific byte ordering
@@ -155,3 +160,5 @@ class Bytes: AllStatic {
// 1.15 98/10/05 16:30:21 bytes_i486.hpp
// 1.17 99/06/22 16:37:35 bytes_i486.hpp
//End
+
+#endif // CPU_SPARC_VM_BYTES_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
index effc007d7db..ee5f6afb5de 100644
--- a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
@@ -22,8 +22,18 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_c1_CodeStubs_sparc.cpp.incl"
+#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_sparc.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_sparc.inline.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif
#define __ ce->masm()->
@@ -424,7 +434,7 @@ void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {
Register pre_val_reg = pre_val()->as_register();
- ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false);
+ ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);
if (__ is_in_wdisp16_range(_continuation)) {
__ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt,
pre_val_reg, _continuation);
diff --git a/hotspot/src/cpu/sparc/vm/c1_Defs_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_Defs_sparc.hpp
index c03873d4e65..a63e28fafe3 100644
--- a/hotspot/src/cpu/sparc/vm/c1_Defs_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/c1_Defs_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_C1_DEFS_SPARC_HPP
+#define CPU_SPARC_VM_C1_DEFS_SPARC_HPP
+
// native word offsets from memory address (big endian)
enum {
pd_lo_word_offset_in_bytes = BytesPerInt,
@@ -65,3 +68,5 @@ enum {
enum {
pd_float_saved_as_double = false
};
+
+#endif // CPU_SPARC_VM_C1_DEFS_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp
index 3a2c65d9f17..8c3a19a9e78 100644
--- a/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,4 +22,10 @@
*
*/
+#include "precompiled.hpp"
+#include "c1/c1_FpuStackSim.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "utilities/array.hpp"
+#include "utilities/ostream.hpp"
+
// No FPU stack on SPARC
diff --git a/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp
index 3aa967d4627..83f14968bb1 100644
--- a/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,5 +22,10 @@
*
*/
+#ifndef CPU_SPARC_VM_C1_FPUSTACKSIM_SPARC_HPP
+#define CPU_SPARC_VM_C1_FPUSTACKSIM_SPARC_HPP
+
// No FPU stack on SPARC
class FpuStackSim;
+
+#endif // CPU_SPARC_VM_C1_FPUSTACKSIM_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp
index 2bf36306771..6b9e5652ae7 100644
--- a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp
@@ -22,8 +22,11 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_c1_FrameMap_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_LIR.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_sparc.inline.hpp"
const int FrameMap::pd_c_runtime_reserved_arg_size = 7;
diff --git a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp
index 10dfbceadd6..2304c2d0103 100644
--- a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP
+#define CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP
+
public:
enum {
@@ -151,3 +154,8 @@
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; }
+
+#endif // CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
index 7d10f9ba013..1e02e0a68fd 100644
--- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
@@ -22,8 +22,20 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_c1_LIRAssembler_sparc.cpp.incl"
+#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_interface/collectedHeap.hpp"
+#include "memory/barrierSet.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "nativeInst_sparc.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "runtime/sharedRuntime.hpp"
#define __ _masm->
@@ -88,6 +100,11 @@ bool LIR_Assembler::is_single_instruction(LIR_Op* op) {
return false;
}
+ if (UseCompressedOops) {
+ if (dst->is_address() && !dst->is_stack() && (dst->type() == T_OBJECT || dst->type() == T_ARRAY)) return false;
+ if (src->is_address() && !src->is_stack() && (src->type() == T_OBJECT || src->type() == T_ARRAY)) return false;
+ }
+
if (dst->is_register()) {
if (src->is_address() && Assembler::is_simm13(src->as_address_ptr()->disp())) {
return !PatchALot;
@@ -241,7 +258,7 @@ void LIR_Assembler::emit_string_compare(LIR_Opr left, LIR_Opr right, LIR_Opr dst
int offset_offset = java_lang_String::offset_offset_in_bytes(); // first character position
int count_offset = java_lang_String:: count_offset_in_bytes();
- __ ld_ptr(str0, value_offset, tmp0);
+ __ load_heap_oop(str0, value_offset, tmp0);
__ ld(str0, offset_offset, tmp2);
__ add(tmp0, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp0);
__ ld(str0, count_offset, str0);
@@ -250,7 +267,7 @@ void LIR_Assembler::emit_string_compare(LIR_Opr left, LIR_Opr right, LIR_Opr dst
// str1 may be null
add_debug_info_for_null_check_here(info);
- __ ld_ptr(str1, value_offset, tmp1);
+ __ load_heap_oop(str1, value_offset, tmp1);
__ add(tmp0, tmp2, tmp0);
__ ld(str1, offset_offset, tmp2);
@@ -754,7 +771,7 @@ void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
add_debug_info_for_null_check_here(op->info());
- __ ld_ptr(O0, oopDesc::klass_offset_in_bytes(), G3_scratch);
+ __ load_klass(O0, G3_scratch);
if (__ is_simm13(op->vtable_offset())) {
__ ld_ptr(G3_scratch, op->vtable_offset(), G5_method);
} else {
@@ -768,138 +785,17 @@ void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
// the peephole pass fills the delay slot
}
-
-// load with 32-bit displacement
-int LIR_Assembler::load(Register s, int disp, Register d, BasicType ld_type, CodeEmitInfo *info) {
- int load_offset = code_offset();
- if (Assembler::is_simm13(disp)) {
- if (info != NULL) add_debug_info_for_null_check_here(info);
- switch(ld_type) {
- case T_BOOLEAN: // fall through
- case T_BYTE : __ ldsb(s, disp, d); break;
- case T_CHAR : __ lduh(s, disp, d); break;
- case T_SHORT : __ ldsh(s, disp, d); break;
- case T_INT : __ ld(s, disp, d); break;
- case T_ADDRESS:// fall through
- case T_ARRAY : // fall through
- case T_OBJECT: __ ld_ptr(s, disp, d); break;
- default : ShouldNotReachHere();
- }
- } else {
- __ set(disp, O7);
- if (info != NULL) add_debug_info_for_null_check_here(info);
- load_offset = code_offset();
- switch(ld_type) {
- case T_BOOLEAN: // fall through
- case T_BYTE : __ ldsb(s, O7, d); break;
- case T_CHAR : __ lduh(s, O7, d); break;
- case T_SHORT : __ ldsh(s, O7, d); break;
- case T_INT : __ ld(s, O7, d); break;
- case T_ADDRESS:// fall through
- case T_ARRAY : // fall through
- case T_OBJECT: __ ld_ptr(s, O7, d); break;
- default : ShouldNotReachHere();
- }
- }
- if (ld_type == T_ARRAY || ld_type == T_OBJECT) __ verify_oop(d);
- return load_offset;
-}
-
-
-// store with 32-bit displacement
-void LIR_Assembler::store(Register value, Register base, int offset, BasicType type, CodeEmitInfo *info) {
- if (Assembler::is_simm13(offset)) {
- if (info != NULL) add_debug_info_for_null_check_here(info);
- switch (type) {
- case T_BOOLEAN: // fall through
- case T_BYTE : __ stb(value, base, offset); break;
- case T_CHAR : __ sth(value, base, offset); break;
- case T_SHORT : __ sth(value, base, offset); break;
- case T_INT : __ stw(value, base, offset); break;
- case T_ADDRESS:// fall through
- case T_ARRAY : // fall through
- case T_OBJECT: __ st_ptr(value, base, offset); break;
- default : ShouldNotReachHere();
- }
- } else {
- __ set(offset, O7);
- if (info != NULL) add_debug_info_for_null_check_here(info);
- switch (type) {
- case T_BOOLEAN: // fall through
- case T_BYTE : __ stb(value, base, O7); break;
- case T_CHAR : __ sth(value, base, O7); break;
- case T_SHORT : __ sth(value, base, O7); break;
- case T_INT : __ stw(value, base, O7); break;
- case T_ADDRESS:// fall through
- case T_ARRAY : //fall through
- case T_OBJECT: __ st_ptr(value, base, O7); break;
- default : ShouldNotReachHere();
- }
- }
- // Note: Do the store before verification as the code might be patched!
- if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(value);
-}
-
-
-// load float with 32-bit displacement
-void LIR_Assembler::load(Register s, int disp, FloatRegister d, BasicType ld_type, CodeEmitInfo *info) {
- FloatRegisterImpl::Width w;
- switch(ld_type) {
- case T_FLOAT : w = FloatRegisterImpl::S; break;
- case T_DOUBLE: w = FloatRegisterImpl::D; break;
- default : ShouldNotReachHere();
- }
-
- if (Assembler::is_simm13(disp)) {
- if (info != NULL) add_debug_info_for_null_check_here(info);
- if (disp % BytesPerLong != 0 && w == FloatRegisterImpl::D) {
- __ ldf(FloatRegisterImpl::S, s, disp + BytesPerWord, d->successor());
- __ ldf(FloatRegisterImpl::S, s, disp , d);
- } else {
- __ ldf(w, s, disp, d);
- }
- } else {
- __ set(disp, O7);
- if (info != NULL) add_debug_info_for_null_check_here(info);
- __ ldf(w, s, O7, d);
- }
-}
-
-
-// store float with 32-bit displacement
-void LIR_Assembler::store(FloatRegister value, Register base, int offset, BasicType type, CodeEmitInfo *info) {
- FloatRegisterImpl::Width w;
- switch(type) {
- case T_FLOAT : w = FloatRegisterImpl::S; break;
- case T_DOUBLE: w = FloatRegisterImpl::D; break;
- default : ShouldNotReachHere();
- }
-
- if (Assembler::is_simm13(offset)) {
- if (info != NULL) add_debug_info_for_null_check_here(info);
- if (w == FloatRegisterImpl::D && offset % BytesPerLong != 0) {
- __ stf(FloatRegisterImpl::S, value->successor(), base, offset + BytesPerWord);
- __ stf(FloatRegisterImpl::S, value , base, offset);
- } else {
- __ stf(w, value, base, offset);
- }
- } else {
- __ set(offset, O7);
- if (info != NULL) add_debug_info_for_null_check_here(info);
- __ stf(w, value, O7, base);
- }
-}
-
-
-int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool unaligned) {
+int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool wide, bool unaligned) {
int store_offset;
if (!Assembler::is_simm13(offset + (type == T_LONG) ? wordSize : 0)) {
assert(!unaligned, "can't handle this");
// for offsets larger than a simm13 we setup the offset in O7
__ set(offset, O7);
- store_offset = store(from_reg, base, O7, type);
+ store_offset = store(from_reg, base, O7, type, wide);
} else {
- if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(from_reg->as_register());
+ if (type == T_ARRAY || type == T_OBJECT) {
+ __ verify_oop(from_reg->as_register());
+ }
store_offset = code_offset();
switch (type) {
case T_BOOLEAN: // fall through
@@ -922,9 +818,22 @@ int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType
__ stw(from_reg->as_register_hi(), base, offset + hi_word_offset_in_bytes);
#endif
break;
- case T_ADDRESS:// fall through
+ case T_ADDRESS:
+ __ st_ptr(from_reg->as_register(), base, offset);
+ break;
case T_ARRAY : // fall through
- case T_OBJECT: __ st_ptr(from_reg->as_register(), base, offset); break;
+ case T_OBJECT:
+ {
+ if (UseCompressedOops && !wide) {
+ __ encode_heap_oop(from_reg->as_register(), G3_scratch);
+ store_offset = code_offset();
+ __ stw(G3_scratch, base, offset);
+ } else {
+ __ st_ptr(from_reg->as_register(), base, offset);
+ }
+ break;
+ }
+
case T_FLOAT : __ stf(FloatRegisterImpl::S, from_reg->as_float_reg(), base, offset); break;
case T_DOUBLE:
{
@@ -946,8 +855,10 @@ int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType
}
-int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicType type) {
- if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(from_reg->as_register());
+int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicType type, bool wide) {
+ if (type == T_ARRAY || type == T_OBJECT) {
+ __ verify_oop(from_reg->as_register());
+ }
int store_offset = code_offset();
switch (type) {
case T_BOOLEAN: // fall through
@@ -963,9 +874,21 @@ int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicTy
__ std(from_reg->as_register_hi(), base, disp);
#endif
break;
- case T_ADDRESS:// fall through
+ case T_ADDRESS:
+ __ st_ptr(from_reg->as_register(), base, disp);
+ break;
case T_ARRAY : // fall through
- case T_OBJECT: __ st_ptr(from_reg->as_register(), base, disp); break;
+ case T_OBJECT:
+ {
+ if (UseCompressedOops && !wide) {
+ __ encode_heap_oop(from_reg->as_register(), G3_scratch);
+ store_offset = code_offset();
+ __ stw(G3_scratch, base, disp);
+ } else {
+ __ st_ptr(from_reg->as_register(), base, disp);
+ }
+ break;
+ }
case T_FLOAT : __ stf(FloatRegisterImpl::S, from_reg->as_float_reg(), base, disp); break;
case T_DOUBLE: __ stf(FloatRegisterImpl::D, from_reg->as_double_reg(), base, disp); break;
default : ShouldNotReachHere();
@@ -974,14 +897,14 @@ int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicTy
}
-int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool unaligned) {
+int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool wide, bool unaligned) {
int load_offset;
if (!Assembler::is_simm13(offset + (type == T_LONG) ? wordSize : 0)) {
assert(base != O7, "destroying register");
assert(!unaligned, "can't handle this");
// for offsets larger than a simm13 we setup the offset in O7
__ set(offset, O7);
- load_offset = load(base, O7, to_reg, type);
+ load_offset = load(base, O7, to_reg, type, wide);
} else {
load_offset = code_offset();
switch(type) {
@@ -1018,9 +941,18 @@ int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType typ
#endif
}
break;
- case T_ADDRESS:// fall through
+ case T_ADDRESS: __ ld_ptr(base, offset, to_reg->as_register()); break;
case T_ARRAY : // fall through
- case T_OBJECT: __ ld_ptr(base, offset, to_reg->as_register()); break;
+ case T_OBJECT:
+ {
+ if (UseCompressedOops && !wide) {
+ __ lduw(base, offset, to_reg->as_register());
+ __ decode_heap_oop(to_reg->as_register());
+ } else {
+ __ ld_ptr(base, offset, to_reg->as_register());
+ }
+ break;
+ }
case T_FLOAT: __ ldf(FloatRegisterImpl::S, base, offset, to_reg->as_float_reg()); break;
case T_DOUBLE:
{
@@ -1036,23 +968,34 @@ int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType typ
}
default : ShouldNotReachHere();
}
- if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(to_reg->as_register());
+ if (type == T_ARRAY || type == T_OBJECT) {
+ __ verify_oop(to_reg->as_register());
+ }
}
return load_offset;
}
-int LIR_Assembler::load(Register base, Register disp, LIR_Opr to_reg, BasicType type) {
+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 : __ ldsb(base, disp, to_reg->as_register()); break;
- case T_CHAR : __ lduh(base, disp, to_reg->as_register()); break;
- case T_SHORT : __ ldsh(base, disp, to_reg->as_register()); break;
- case T_INT : __ ld(base, disp, to_reg->as_register()); break;
- case T_ADDRESS:// fall through
+ case T_BYTE : __ ldsb(base, disp, to_reg->as_register()); break;
+ case T_CHAR : __ lduh(base, disp, to_reg->as_register()); break;
+ case T_SHORT : __ ldsh(base, disp, to_reg->as_register()); break;
+ case T_INT : __ ld(base, disp, to_reg->as_register()); break;
+ case T_ADDRESS: __ ld_ptr(base, disp, to_reg->as_register()); break;
case T_ARRAY : // fall through
- case T_OBJECT: __ ld_ptr(base, disp, to_reg->as_register()); break;
+ case T_OBJECT:
+ {
+ if (UseCompressedOops && !wide) {
+ __ lduw(base, disp, to_reg->as_register());
+ __ decode_heap_oop(to_reg->as_register());
+ } else {
+ __ ld_ptr(base, disp, to_reg->as_register());
+ }
+ break;
+ }
case T_FLOAT: __ ldf(FloatRegisterImpl::S, base, disp, to_reg->as_float_reg()); break;
case T_DOUBLE: __ ldf(FloatRegisterImpl::D, base, disp, to_reg->as_double_reg()); break;
case T_LONG :
@@ -1066,61 +1009,17 @@ int LIR_Assembler::load(Register base, Register disp, LIR_Opr to_reg, BasicType
break;
default : ShouldNotReachHere();
}
- if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(to_reg->as_register());
+ if (type == T_ARRAY || type == T_OBJECT) {
+ __ verify_oop(to_reg->as_register());
+ }
return load_offset;
}
-
-// load/store with an Address
-void LIR_Assembler::load(const Address& a, Register d, BasicType ld_type, CodeEmitInfo *info, int offset) {
- load(a.base(), a.disp() + offset, d, ld_type, info);
-}
-
-
-void LIR_Assembler::store(Register value, const Address& dest, BasicType type, CodeEmitInfo *info, int offset) {
- store(value, dest.base(), dest.disp() + offset, type, info);
-}
-
-
-// loadf/storef with an Address
-void LIR_Assembler::load(const Address& a, FloatRegister d, BasicType ld_type, CodeEmitInfo *info, int offset) {
- load(a.base(), a.disp() + offset, d, ld_type, info);
-}
-
-
-void LIR_Assembler::store(FloatRegister value, const Address& dest, BasicType type, CodeEmitInfo *info, int offset) {
- store(value, dest.base(), dest.disp() + offset, type, info);
-}
-
-
-// load/store with an Address
-void LIR_Assembler::load(LIR_Address* a, Register d, BasicType ld_type, CodeEmitInfo *info) {
- load(as_Address(a), d, ld_type, info);
-}
-
-
-void LIR_Assembler::store(Register value, LIR_Address* dest, BasicType type, CodeEmitInfo *info) {
- store(value, as_Address(dest), type, info);
-}
-
-
-// loadf/storef with an Address
-void LIR_Assembler::load(LIR_Address* a, FloatRegister d, BasicType ld_type, CodeEmitInfo *info) {
- load(as_Address(a), d, ld_type, info);
-}
-
-
-void LIR_Assembler::store(FloatRegister value, LIR_Address* dest, BasicType type, CodeEmitInfo *info) {
- store(value, as_Address(dest), type, info);
-}
-
-
void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) {
LIR_Const* c = src->as_constant_ptr();
switch (c->type()) {
case T_INT:
- case T_FLOAT:
- case T_ADDRESS: {
+ case T_FLOAT: {
Register src_reg = O7;
int value = c->as_jint_bits();
if (value == 0) {
@@ -1132,6 +1031,18 @@ void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) {
__ stw(src_reg, addr.base(), addr.disp());
break;
}
+ case T_ADDRESS: {
+ Register src_reg = O7;
+ int value = c->as_jint_bits();
+ if (value == 0) {
+ src_reg = G0;
+ } else {
+ __ set(value, O7);
+ }
+ Address addr = frame_map()->address_for_slot(dest->single_stack_ix());
+ __ st_ptr(src_reg, addr.base(), addr.disp());
+ break;
+ }
case T_OBJECT: {
Register src_reg = O7;
jobject2reg(c->as_jobject(), src_reg);
@@ -1166,14 +1077,12 @@ void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) {
}
-void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info ) {
+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();
+ int offset = -1;
- if (info != NULL) {
- add_debug_info_for_null_check_here(info);
- }
switch (c->type()) {
case T_INT:
case T_FLOAT:
@@ -1187,10 +1096,10 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi
}
if (addr->index()->is_valid()) {
assert(addr->disp() == 0, "must be zero");
- store(tmp, base, addr->index()->as_pointer_register(), type);
+ offset = store(tmp, base, addr->index()->as_pointer_register(), type, wide);
} else {
assert(Assembler::is_simm13(addr->disp()), "can't handle larger addresses");
- store(tmp, base, addr->disp(), type);
+ offset = store(tmp, base, addr->disp(), type, wide, false);
}
break;
}
@@ -1200,21 +1109,21 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi
assert(Assembler::is_simm13(addr->disp()) &&
Assembler::is_simm13(addr->disp() + 4), "can't handle larger addresses");
- Register tmp = O7;
+ LIR_Opr tmp = FrameMap::O7_opr;
int value_lo = c->as_jint_lo_bits();
if (value_lo == 0) {
- tmp = G0;
+ tmp = FrameMap::G0_opr;
} else {
__ set(value_lo, O7);
}
- store(tmp, base, addr->disp() + lo_word_offset_in_bytes, T_INT);
+ offset = store(tmp, base, addr->disp() + lo_word_offset_in_bytes, T_INT, wide, false);
int value_hi = c->as_jint_hi_bits();
if (value_hi == 0) {
- tmp = G0;
+ tmp = FrameMap::G0_opr;
} else {
__ set(value_hi, O7);
}
- store(tmp, base, addr->disp() + hi_word_offset_in_bytes, T_INT);
+ offset = store(tmp, base, addr->disp() + hi_word_offset_in_bytes, T_INT, wide, false);
break;
}
case T_OBJECT: {
@@ -1229,10 +1138,10 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi
// handle either reg+reg or reg+disp address
if (addr->index()->is_valid()) {
assert(addr->disp() == 0, "must be zero");
- store(tmp, base, addr->index()->as_pointer_register(), type);
+ offset = store(tmp, base, addr->index()->as_pointer_register(), type, wide);
} else {
assert(Assembler::is_simm13(addr->disp()), "can't handle larger addresses");
- store(tmp, base, addr->disp(), type);
+ offset = store(tmp, base, addr->disp(), type, wide, false);
}
break;
@@ -1240,6 +1149,10 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi
default:
Unimplemented();
}
+ if (info != NULL) {
+ assert(offset != -1, "offset should've been set");
+ add_debug_info_for_null_check(offset, info);
+ }
}
@@ -1324,7 +1237,7 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod
assert(to_reg->is_single_cpu(), "Must be a cpu register.");
__ set(const_addrlit, O7);
- load(O7, 0, to_reg->as_register(), T_INT);
+ __ ld(O7, 0, to_reg->as_register());
}
}
break;
@@ -1417,7 +1330,7 @@ Address LIR_Assembler::as_Address_lo(LIR_Address* addr) {
void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type,
- LIR_PatchCode patch_code, CodeEmitInfo* info, bool unaligned) {
+ LIR_PatchCode patch_code, CodeEmitInfo* info, bool wide, bool unaligned) {
LIR_Address* addr = src_opr->as_address_ptr();
LIR_Opr to_reg = dest;
@@ -1463,16 +1376,15 @@ void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type,
assert(disp_reg != noreg || Assembler::is_simm13(disp_value), "should have set this up");
if (disp_reg == noreg) {
- offset = load(src, disp_value, to_reg, type, unaligned);
+ offset = load(src, disp_value, to_reg, type, wide, unaligned);
} else {
assert(!unaligned, "can't handle this");
- offset = load(src, disp_reg, to_reg, type);
+ offset = load(src, disp_reg, to_reg, type, wide);
}
if (patch != NULL) {
patching_epilog(patch, patch_code, src, info);
}
-
if (info != NULL) add_debug_info_for_null_check(offset, info);
}
@@ -1506,7 +1418,7 @@ void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) {
}
bool unaligned = (addr.disp() - STACK_BIAS) % 8 != 0;
- load(addr.base(), addr.disp(), dest, dest->type(), unaligned);
+ load(addr.base(), addr.disp(), dest, dest->type(), true /*wide*/, unaligned);
}
@@ -1518,7 +1430,7 @@ void LIR_Assembler::reg2stack(LIR_Opr from_reg, LIR_Opr dest, BasicType type, bo
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(), unaligned);
+ store(from_reg, addr.base(), addr.disp(), from_reg->type(), true /*wide*/, unaligned);
}
@@ -1566,7 +1478,7 @@ void LIR_Assembler::reg2reg(LIR_Opr from_reg, LIR_Opr to_reg) {
void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type,
LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack,
- bool unaligned) {
+ bool wide, bool unaligned) {
LIR_Address* addr = dest->as_address_ptr();
Register src = addr->base()->as_pointer_register();
@@ -1610,10 +1522,10 @@ void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type,
assert(disp_reg != noreg || Assembler::is_simm13(disp_value), "should have set this up");
if (disp_reg == noreg) {
- offset = store(from_reg, src, disp_value, type, unaligned);
+ offset = store(from_reg, src, disp_value, type, wide, unaligned);
} else {
assert(!unaligned, "can't handle this");
- offset = store(from_reg, src, disp_reg, type);
+ offset = store(from_reg, src, disp_reg, type, wide);
}
if (patch != NULL) {
@@ -2172,13 +2084,13 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
// make sure src and dst are non-null and load array length
if (flags & LIR_OpArrayCopy::src_null_check) {
__ tst(src);
- __ br(Assembler::equal, false, Assembler::pn, *stub->entry());
+ __ brx(Assembler::equal, false, Assembler::pn, *stub->entry());
__ delayed()->nop();
}
if (flags & LIR_OpArrayCopy::dst_null_check) {
__ tst(dst);
- __ br(Assembler::equal, false, Assembler::pn, *stub->entry());
+ __ brx(Assembler::equal, false, Assembler::pn, *stub->entry());
__ delayed()->nop();
}
@@ -2220,10 +2132,18 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
}
if (flags & LIR_OpArrayCopy::type_check) {
- __ ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp);
- __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2);
- __ cmp(tmp, tmp2);
- __ br(Assembler::notEqual, false, Assembler::pt, *stub->entry());
+ if (UseCompressedOops) {
+ // We don't need decode because we just need to compare
+ __ lduw(src, oopDesc::klass_offset_in_bytes(), tmp);
+ __ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2);
+ __ cmp(tmp, tmp2);
+ __ br(Assembler::notEqual, false, Assembler::pt, *stub->entry());
+ } else {
+ __ ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp);
+ __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2);
+ __ cmp(tmp, tmp2);
+ __ brx(Assembler::notEqual, false, Assembler::pt, *stub->entry());
+ }
__ delayed()->nop();
}
@@ -2238,20 +2158,44 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
// but not necessarily exactly of type default_type.
Label known_ok, halt;
jobject2reg(op->expected_type()->constant_encoding(), tmp);
- __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2);
- if (basic_type != T_OBJECT) {
- __ cmp(tmp, tmp2);
- __ br(Assembler::notEqual, false, Assembler::pn, halt);
- __ delayed()->ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp2);
- __ cmp(tmp, tmp2);
- __ br(Assembler::equal, false, Assembler::pn, known_ok);
- __ delayed()->nop();
+ if (UseCompressedOops) {
+ // tmp holds the default type. It currently comes uncompressed after the
+ // load of a constant, so encode it.
+ __ encode_heap_oop(tmp);
+ // load the raw value of the dst klass, since we will be comparing
+ // uncompressed values directly.
+ __ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2);
+ if (basic_type != T_OBJECT) {
+ __ cmp(tmp, tmp2);
+ __ br(Assembler::notEqual, false, Assembler::pn, halt);
+ // load the raw value of the src klass.
+ __ delayed()->lduw(src, oopDesc::klass_offset_in_bytes(), tmp2);
+ __ cmp(tmp, tmp2);
+ __ br(Assembler::equal, false, Assembler::pn, known_ok);
+ __ delayed()->nop();
+ } else {
+ __ cmp(tmp, tmp2);
+ __ br(Assembler::equal, false, Assembler::pn, known_ok);
+ __ delayed()->cmp(src, dst);
+ __ brx(Assembler::equal, false, Assembler::pn, known_ok);
+ __ delayed()->nop();
+ }
} else {
- __ cmp(tmp, tmp2);
- __ br(Assembler::equal, false, Assembler::pn, known_ok);
- __ delayed()->cmp(src, dst);
- __ br(Assembler::equal, false, Assembler::pn, known_ok);
- __ delayed()->nop();
+ __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2);
+ if (basic_type != T_OBJECT) {
+ __ cmp(tmp, tmp2);
+ __ brx(Assembler::notEqual, false, Assembler::pn, halt);
+ __ delayed()->ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp2);
+ __ cmp(tmp, tmp2);
+ __ brx(Assembler::equal, false, Assembler::pn, known_ok);
+ __ delayed()->nop();
+ } else {
+ __ cmp(tmp, tmp2);
+ __ brx(Assembler::equal, false, Assembler::pn, known_ok);
+ __ delayed()->cmp(src, dst);
+ __ brx(Assembler::equal, false, Assembler::pn, known_ok);
+ __ delayed()->nop();
+ }
}
__ bind(halt);
__ stop("incorrect type information in arraycopy");
@@ -2459,7 +2403,7 @@ void LIR_Assembler::type_profile_helper(Register mdo, int mdo_offset_bias,
Label next_test;
Address recv_addr(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) -
mdo_offset_bias);
- load(recv_addr, tmp1, T_OBJECT);
+ __ ld_ptr(recv_addr, tmp1);
__ br_notnull(tmp1, false, Assembler::pt, next_test);
__ delayed()->nop();
__ st_ptr(recv, recv_addr);
@@ -2475,11 +2419,8 @@ void LIR_Assembler::type_profile_helper(Register mdo, int mdo_offset_bias,
void LIR_Assembler::setup_md_access(ciMethod* method, int bci,
ciMethodData*& md, ciProfileData*& data, int& mdo_offset_bias) {
- md = method->method_data();
- if (md == NULL) {
- bailout("out of memory building methodDataOop");
- return;
- }
+ 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");
@@ -2551,7 +2492,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
// get object class
// not a safepoint as obj null check happens earlier
- load(obj, oopDesc::klass_offset_in_bytes(), klass_RInfo, T_OBJECT, NULL);
+ __ load_klass(obj, klass_RInfo);
if (op->fast_check()) {
assert_different_registers(klass_RInfo, k_RInfo);
__ cmp(k_RInfo, klass_RInfo);
@@ -2593,7 +2534,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
__ set(mdo_offset_bias, tmp1);
__ add(mdo, tmp1, mdo);
}
- load(Address(obj, oopDesc::klass_offset_in_bytes()), recv, T_OBJECT);
+ __ load_klass(obj, recv);
type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, success);
// Jump over the failure case
__ ba(false, *success);
@@ -2662,11 +2603,12 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
__ br_null(value, false, Assembler::pn, done);
__ delayed()->nop();
}
- load(array, oopDesc::klass_offset_in_bytes(), k_RInfo, T_OBJECT, op->info_for_exception());
- load(value, oopDesc::klass_offset_in_bytes(), klass_RInfo, T_OBJECT, NULL);
+ add_debug_info_for_null_check_here(op->info_for_exception());
+ __ load_klass(array, k_RInfo);
+ __ load_klass(value, klass_RInfo);
// get instance klass
- load(k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc), k_RInfo, T_OBJECT, NULL);
+ __ ld_ptr(Address(k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc)), k_RInfo);
// perform the fast part of the checking logic
__ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, O7, success_target, failure_target, NULL);
@@ -2688,7 +2630,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
__ set(mdo_offset_bias, tmp1);
__ add(mdo, tmp1, mdo);
}
- load(Address(value, oopDesc::klass_offset_in_bytes()), recv, T_OBJECT);
+ __ load_klass(value, recv);
type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, &done);
__ ba(false, done);
__ delayed()->nop();
@@ -2769,14 +2711,17 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
Register t2 = op->tmp2()->as_register();
__ mov(cmp_value, t1);
__ mov(new_value, t2);
-#ifdef _LP64
if (op->code() == lir_cas_obj) {
- __ casx(addr, t1, t2);
- } else
-#endif
- {
+ if (UseCompressedOops) {
+ __ encode_heap_oop(t1);
+ __ encode_heap_oop(t2);
__ cas(addr, t1, t2);
+ } else {
+ __ cas_ptr(addr, t1, t2);
}
+ } else {
+ __ cas(addr, t1, t2);
+ }
__ cmp(t1, t2);
} else {
Unimplemented();
@@ -2873,11 +2818,8 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
int bci = op->profiled_bci();
// Update counter for all call types
- ciMethodData* md = method->method_data();
- if (md == NULL) {
- bailout("out of memory building methodDataOop");
- return;
- }
+ 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");
@@ -2954,7 +2896,7 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
}
}
} else {
- load(Address(recv, oopDesc::klass_offset_in_bytes()), recv, T_OBJECT);
+ __ 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.
@@ -3148,7 +3090,7 @@ void LIR_Assembler::volatile_move_op(LIR_Opr src, LIR_Opr dest, BasicType type,
} else {
// use normal move for all other volatiles since they don't need
// special handling to remain atomic.
- move_op(src, dest, type, lir_patch_none, info, false, false);
+ move_op(src, dest, type, lir_patch_none, info, false, false, false);
}
}
diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp
index f6f715408e4..386159c89b8 100644
--- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_C1_LIRASSEMBLER_SPARC_HPP
+#define CPU_SPARC_VM_C1_LIRASSEMBLER_SPARC_HPP
+
private:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -37,33 +40,11 @@
// and then a load or store is emitted with ([O7] + [d]).
//
- // some load/store variants return the code_offset for proper positioning of debug info for null checks
+ 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);
- // load/store with 32 bit displacement
- int load(Register s, int disp, Register d, BasicType ld_type, CodeEmitInfo* info = NULL);
- void store(Register value, Register base, int offset, BasicType type, CodeEmitInfo *info = NULL);
-
- // loadf/storef with 32 bit displacement
- void load(Register s, int disp, FloatRegister d, BasicType ld_type, CodeEmitInfo* info = NULL);
- void store(FloatRegister d, Register s1, int disp, BasicType st_type, CodeEmitInfo* info = NULL);
-
- // convienence methods for calling load/store with an Address
- void load(const Address& a, Register d, BasicType ld_type, CodeEmitInfo* info = NULL, int offset = 0);
- void store(Register d, const Address& a, BasicType st_type, CodeEmitInfo* info = NULL, int offset = 0);
- void load(const Address& a, FloatRegister d, BasicType ld_type, CodeEmitInfo* info = NULL, int offset = 0);
- void store(FloatRegister d, const Address& a, BasicType st_type, CodeEmitInfo* info = NULL, int offset = 0);
-
- // convienence methods for calling load/store with an LIR_Address
- void load(LIR_Address* a, Register d, BasicType ld_type, CodeEmitInfo* info = NULL);
- void store(Register d, LIR_Address* a, BasicType st_type, CodeEmitInfo* info = NULL);
- void load(LIR_Address* a, FloatRegister d, BasicType ld_type, CodeEmitInfo* info = NULL);
- void store(FloatRegister d, LIR_Address* a, BasicType st_type, CodeEmitInfo* info = NULL);
-
- int store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool unaligned = false);
- int store(LIR_Opr from_reg, Register base, Register disp, BasicType type);
-
- int load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool unaligned = false);
- int load(Register base, Register disp, LIR_Opr to_reg, BasicType type);
+ 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);
void monitorexit(LIR_Opr obj_opr, LIR_Opr lock_opr, Register hdr, int monitor_no);
@@ -90,3 +71,5 @@ enum {
#endif // _LP64
exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(10*4),
deopt_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(10*4) };
+
+#endif // CPU_SPARC_VM_C1_LIRASSEMBLER_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
index 2566f3f8227..1abbdb51d49 100644
--- a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
@@ -22,8 +22,20 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_c1_LIRGenerator_sparc.cpp.incl"
+#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_sparc.inline.hpp"
#ifdef ASSERT
#define __ gen()->lir(__FILE__, __LINE__)->
diff --git a/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp
index 92fc7e08624..e09039e7e4c 100644
--- a/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_c1_LinearScan_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_LinearScan.hpp"
+#include "utilities/bitMap.inline.hpp"
void LinearScan::allocate_fpu_stack() {
// No FPU stack on SPARC
diff --git a/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp
index f9aaf1f77e1..ddb6f9a5bd5 100644
--- a/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP
+#define CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP
+
inline bool LinearScan::is_processed_reg_num(int reg_num) {
return reg_num < 26 || reg_num > 31;
}
@@ -71,3 +74,5 @@ inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) {
}
return false;
}
+
+#endif // CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
index db9ef843c7e..6340156f779 100644
--- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
@@ -22,15 +22,25 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_c1_MacroAssembler_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_interface/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"
void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
Label L;
const Register temp_reg = G3_scratch;
// Note: needs more testing of out-of-line vs. inline slow case
verify_oop(receiver);
- ld_ptr(receiver, oopDesc::klass_offset_in_bytes(), temp_reg);
+ load_klass(receiver, temp_reg);
cmp(temp_reg, iCache);
brx(Assembler::equal, true, Assembler::pt, L);
delayed()->nop();
@@ -175,9 +185,19 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register
} else {
set((intx)markOopDesc::prototype(), t1);
}
- st_ptr(t1 , obj, oopDesc::mark_offset_in_bytes ());
- st_ptr(klass, obj, oopDesc::klass_offset_in_bytes ());
- if (len->is_valid()) st(len , obj, arrayOopDesc::length_offset_in_bytes());
+ st_ptr(t1, obj, oopDesc::mark_offset_in_bytes());
+ if (UseCompressedOops) {
+ // Save klass
+ mov(klass, t1);
+ encode_heap_oop_not_null(t1);
+ stw(t1, obj, oopDesc::klass_offset_in_bytes());
+ } else {
+ st_ptr(klass, obj, oopDesc::klass_offset_in_bytes());
+ }
+ if (len->is_valid()) st(len, obj, arrayOopDesc::length_offset_in_bytes());
+ else if (UseCompressedOops) {
+ store_klass_gap(G0, obj);
+ }
}
@@ -225,7 +245,7 @@ void C1_MacroAssembler::initialize_object(
Register t1, // temp register
Register t2 // temp register
) {
- const int hdr_size_in_bytes = instanceOopDesc::base_offset_in_bytes();
+ const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize;
initialize_header(obj, klass, noreg, t1, t2);
diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp
index 891d577ee67..b8b063928ab 100644
--- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_C1_MACROASSEMBLER_SPARC_HPP
+#define CPU_SPARC_VM_C1_MACROASSEMBLER_SPARC_HPP
+
void pd_init() { /* nothing to do */ }
public:
@@ -84,3 +87,5 @@
// invalidates registers in this window
void invalidate_registers(bool iregisters, bool lregisters, bool oregisters,
Register preserve1 = noreg, Register preserve2 = noreg);
+
+#endif // CPU_SPARC_VM_C1_MACROASSEMBLER_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
index 649e9b12388..7dabe35c23e 100644
--- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
@@ -22,8 +22,20 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_c1_Runtime1_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Defs.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_sparc.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "register_sparc.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/vframeArray.hpp"
+#include "vmreg_sparc.inline.hpp"
// Implementation of StubAssembler
@@ -600,7 +612,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
// load the klass and check the has finalizer flag
Label register_finalizer;
Register t = O1;
- __ ld_ptr(O0, oopDesc::klass_offset_in_bytes(), t);
+ __ load_klass(O0, t);
__ ld(t, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc), t);
__ set(JVM_ACC_HAS_FINALIZER, G3);
__ andcc(G3, t, G0);
diff --git a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp
index c1ca004f1ff..ef5900debf0 100644
--- a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_SPARC_VM_C1_GLOBALS_SPARC_HPP
+#define CPU_SPARC_VM_C1_GLOBALS_SPARC_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)
@@ -61,3 +67,5 @@ define_pd_global(bool, CSEArrayLength, true );
define_pd_global(bool, TwoOperandLIRForm, false);
define_pd_global(intx, SafepointPollOffset, 0 );
+
+#endif // CPU_SPARC_VM_C1_GLOBALS_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp
index cb54d3ba767..0e870e63cc7 100644
--- a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_SPARC_VM_C2_GLOBALS_SPARC_HPP
+#define CPU_SPARC_VM_C2_GLOBALS_SPARC_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
// Sets the default values for platform dependent flags used by the server compiler.
// (see c2_globals.hpp). Alpha-sorted.
@@ -88,3 +94,5 @@ define_pd_global(uintx,MaxPermSize, ScaleForWordSize(64*M));
// Ergonomics related flags
define_pd_global(bool, NeverActAsServerClassMachine, false);
+
+#endif // CPU_SPARC_VM_C2_GLOBALS_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp b/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp
index b82f89017e1..685a39dbf0f 100644
--- a/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,8 +22,9 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_c2_init_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/compile.hpp"
+#include "opto/node.hpp"
// processor dependent initialization for sparc
diff --git a/hotspot/src/cpu/sparc/vm/codeBuffer_sparc.hpp b/hotspot/src/cpu/sparc/vm/codeBuffer_sparc.hpp
index 258ff281e7e..f1a371acf1e 100644
--- a/hotspot/src/cpu/sparc/vm/codeBuffer_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/codeBuffer_sparc.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_CODEBUFFER_SPARC_HPP
+#define CPU_SPARC_VM_CODEBUFFER_SPARC_HPP
+
private:
void pd_initialize() {}
@@ -32,3 +35,5 @@ public:
bool is_backward_branch(Label& L) {
return L.is_bound() && insts_end() <= locator_address(L.loc());
}
+
+#endif // CPU_SPARC_VM_CODEBUFFER_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/copy_sparc.hpp b/hotspot/src/cpu/sparc/vm/copy_sparc.hpp
index e082ab8a687..0267d25a670 100644
--- a/hotspot/src/cpu/sparc/vm/copy_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/copy_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_COPY_SPARC_HPP
+#define CPU_SPARC_VM_COPY_SPARC_HPP
+
// Inline functions for memory copy and fill.
static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
@@ -186,3 +189,5 @@ static void pd_zero_to_words(HeapWord* tohw, size_t count) {
static void pd_zero_to_bytes(void* to, size_t count) {
(void)memset(to, 0, count);
}
+
+#endif // CPU_SPARC_VM_COPY_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp b/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp
index 271f7b2729f..2dc68c74f63 100644
--- a/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#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;
@@ -32,3 +35,5 @@
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
index c048ba34098..8cae2273632 100644
--- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,8 +22,32 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_cppInterpreter_sparc.cpp.incl"
+#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 "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.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"
+#ifdef SHARK
+#include "shark/shark_globals.hpp"
+#endif
#ifdef CC_INTERP
diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp
index 381ecc06abf..3d613f36a02 100644
--- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp
@@ -22,6 +22,9 @@
*
*/
+#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.
@@ -37,3 +40,5 @@
#else
const static int InterpreterCodeSize = 180 * K;
#endif
+
+#endif // CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/debug_sparc.cpp b/hotspot/src/cpu/sparc/vm/debug_sparc.cpp
index 2958a5238ce..76441c0ceb0 100644
--- a/hotspot/src/cpu/sparc/vm/debug_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/debug_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,8 +22,14 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_debug_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/nmethod.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/init.hpp"
+#include "runtime/os.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/top.hpp"
#ifndef PRODUCT
diff --git a/hotspot/src/cpu/sparc/vm/depChecker_sparc.cpp b/hotspot/src/cpu/sparc/vm/depChecker_sparc.cpp
index 296a6c877b3..abb0243a2f6 100644
--- a/hotspot/src/cpu/sparc/vm/depChecker_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/depChecker_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,7 +22,8 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_depChecker_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/disassembler.hpp"
+#include "depChecker_sparc.hpp"
// Nothing to do on Sparc
diff --git a/hotspot/src/cpu/sparc/vm/depChecker_sparc.hpp b/hotspot/src/cpu/sparc/vm/depChecker_sparc.hpp
index e484d8d7609..6e275437fae 100644
--- a/hotspot/src/cpu/sparc/vm/depChecker_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/depChecker_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,4 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_DEPCHECKER_SPARC_HPP
+#define CPU_SPARC_VM_DEPCHECKER_SPARC_HPP
+
// Nothing to do on Sparc
+
+#endif // CPU_SPARC_VM_DEPCHECKER_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp
index caa6bd2a9a4..761d0e3810e 100644
--- a/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_DISASSEMBLER_SPARC_HPP
+#define CPU_SPARC_VM_DISASSEMBLER_SPARC_HPP
+
static int pd_instruction_alignment() {
return sizeof(int);
}
@@ -30,3 +33,5 @@
return (VM_Version::v9_instructions_work()?
(VM_Version::v8_instructions_work()? "" : "v9only") : "v8only");
}
+
+#endif // CPU_SPARC_VM_DISASSEMBLER_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/dump_sparc.cpp b/hotspot/src/cpu/sparc/vm/dump_sparc.cpp
index 60f3e1388fd..5bfa1cebffd 100644
--- a/hotspot/src/cpu/sparc/vm/dump_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/dump_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -22,8 +22,11 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_dump_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "memory/compactingPermGenGen.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/space.inline.hpp"
diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp
index 1ee91aedae0..e6fa47a5b75 100644
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp
@@ -22,8 +22,24 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_frame_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/monitorChunk.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "vmreg_sparc.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#include "runtime/vframeArray.hpp"
+#endif
void RegisterMap::pd_clear() {
if (_thread->has_last_Java_frame()) {
diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp
index 15a07f8492f..ed30d40e284 100644
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_SPARC_VM_FRAME_SPARC_HPP
+#define CPU_SPARC_VM_FRAME_SPARC_HPP
+
+#include "runtime/synchronizer.hpp"
+#include "utilities/top.hpp"
+
// A frame represents a physical stack frame (an activation). Frames can be
// C or Java frames, and the Java frames can be interpreted or compiled.
// In contrast, vframes represent source-level activations, so that one physical frame
@@ -309,3 +315,5 @@
return reg->is_out() || reg->is_global();
#endif
}
+
+#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 8fa763f095e..3a8bc79b823 100644
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP
+#define CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP
+
// Inline functions for SPARC frames:
// Constructors
@@ -295,3 +298,5 @@ inline oop frame::saved_oop_result(RegisterMap* map) const {
inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
*((oop*) map->location(O0->as_VMReg())) = obj;
}
+
+#endif // CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP
diff --git a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp
index 21d41d73012..e90896c4919 100644
--- a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,12 @@
*
*/
+#ifndef CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP
+#define CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP
+
// Size of Sparc Instructions
const int BytesPerInstWord = 4;
const int StackAlignmentInBytes = (2*wordSize);
+
+#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 071f6b58d68..1854475a5a9 100644
--- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_SPARC_VM_GLOBALS_SPARC_HPP
+#define CPU_SPARC_VM_GLOBALS_SPARC_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)
@@ -64,3 +70,5 @@ define_pd_global(bool, RewriteBytecodes, true);
define_pd_global(bool, RewriteFrequentPairs, true);
define_pd_global(bool, UseMembar, false);
+
+#endif // CPU_SPARC_VM_GLOBALS_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp b/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp
index d192084face..6327cc7a554 100644
--- a/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,16 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_icBuffer_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "code/icBuffer.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/resourceArea.hpp"
+#include "nativeInst_sparc.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
int InlineCacheBuffer::ic_stub_code_size() {
#ifdef _LP64
diff --git a/hotspot/src/cpu/sparc/vm/icache_sparc.cpp b/hotspot/src/cpu/sparc/vm/icache_sparc.cpp
index 40ab79bc767..af7a4c09b01 100644
--- a/hotspot/src/cpu/sparc/vm/icache_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/icache_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_icache_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "runtime/icache.hpp"
#define __ _masm->
diff --git a/hotspot/src/cpu/sparc/vm/icache_sparc.hpp b/hotspot/src/cpu/sparc/vm/icache_sparc.hpp
index e0b7579d9de..e3b5bad7aa1 100644
--- a/hotspot/src/cpu/sparc/vm/icache_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/icache_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_ICACHE_SPARC_HPP
+#define CPU_SPARC_VM_ICACHE_SPARC_HPP
+
// Interface for updating the instruction cache. Whenever the VM modifies
// code, part of the processor instruction cache potentially has to be flushed.
@@ -36,3 +39,5 @@ class ICache : public AbstractICache {
// Use default implementation
};
+
+#endif // CPU_SPARC_VM_ICACHE_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
index 91c3bc09fa0..ea17d6f574e 100644
--- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
@@ -22,8 +22,26 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_interp_masm_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "interp_masm_sparc.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/sharedRuntime.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
#ifndef CC_INTERP
#ifndef FAST_DISPATCH
diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp
index b893f9413a1..835dcac6836 100644
--- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_SPARC_VM_INTERP_MASM_SPARC_HPP
+#define CPU_SPARC_VM_INTERP_MASM_SPARC_HPP
+
+#include "assembler_sparc.inline.hpp"
+#include "interpreter/invocationCounter.hpp"
+
// This file specializes the assember with interpreter-specific macros
REGISTER_DECLARATION( Register, Otos_i , O0); // tos for ints, etc
@@ -327,3 +333,5 @@ class InterpreterMacroAssembler: public MacroAssembler {
void restore_return_value(TosState state, bool is_native_call);
};
+
+#endif // CPU_SPARC_VM_INTERP_MASM_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp b/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp
index 2478f089acf..ce3c3d48f69 100644
--- a/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP
+#define CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP
+
friend class AbstractInterpreterGenerator;
private:
@@ -39,3 +42,5 @@
void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue);
void generate_counter_overflow(Label& Lcontinue);
+
+#endif // CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp
index fb95f8ad4a3..bc7d556d517 100644
--- a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp
@@ -22,8 +22,17 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_interpreterRT_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/signature.hpp"
#define __ _masm->
diff --git a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.hpp b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.hpp
index 97f861cf37b..6d90042c013 100644
--- a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,11 @@
*
*/
+#ifndef CPU_SPARC_VM_INTERPRETERRT_SPARC_HPP
+#define CPU_SPARC_VM_INTERPRETERRT_SPARC_HPP
+
+#include "memory/allocation.hpp"
+
static int binary_search(int key, LookupswitchPair* array, int n);
static address iload (JavaThread* thread);
@@ -54,3 +59,5 @@ class SignatureHandlerGenerator: public NativeSignatureIterator {
// Code generation
void generate( uint64_t fingerprint );
};
+
+#endif // CPU_SPARC_VM_INTERPRETERRT_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp
index e22ecde84db..503fb67d1dc 100644
--- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp
@@ -22,8 +22,32 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_interpreter_sparc.cpp.incl"
+#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/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "prims/methodHandles.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"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp
index 2f3bb3f6fa8..bc38d6e882f 100644
--- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp
@@ -22,6 +22,9 @@
*
*/
+#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; }
@@ -34,3 +37,5 @@
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/javaFrameAnchor_sparc.hpp b/hotspot/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp
index f9607f8fede..1b4b3bf2ffc 100644
--- a/hotspot/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_JAVAFRAMEANCHOR_SPARC_HPP
+#define CPU_SPARC_VM_JAVAFRAMEANCHOR_SPARC_HPP
+
private:
volatile int _flags;
@@ -97,3 +100,5 @@ private:
_flags |= flushed;
OrderAccess::fence();
}
+
+#endif // CPU_SPARC_VM_JAVAFRAMEANCHOR_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp b/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp
index f390efff1b9..e31fa87b3aa 100644
--- a/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp
@@ -22,8 +22,12 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_jniFastGetField_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm_misc.hpp"
+#include "runtime/safepoint.hpp"
// TSO ensures that loads are blocking and ordered with respect to
// to earlier loads, so we don't need LoadLoad membars.
diff --git a/hotspot/src/cpu/sparc/vm/jniTypes_sparc.hpp b/hotspot/src/cpu/sparc/vm/jniTypes_sparc.hpp
index 1c91caac29f..9c3049141fd 100644
--- a/hotspot/src/cpu/sparc/vm/jniTypes_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/jniTypes_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,13 @@
*
*/
+#ifndef CPU_SPARC_VM_JNITYPES_SPARC_HPP
+#define CPU_SPARC_VM_JNITYPES_SPARC_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/oop.hpp"
+#include "prims/jni.h"
+
// This file holds platform-dependent routines used to write primitive jni
// types to the array of arguments passed into JavaCalls::call
@@ -106,3 +113,5 @@ public:
#endif
};
+
+#endif // CPU_SPARC_VM_JNITYPES_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/jni_sparc.h b/hotspot/src/cpu/sparc/vm/jni_sparc.h
index 9bb86a05c7e..9712dfc9d0d 100644
--- a/hotspot/src/cpu/sparc/vm/jni_sparc.h
+++ b/hotspot/src/cpu/sparc/vm/jni_sparc.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
diff --git a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp
index c38d1f0235a..699f9151b8c 100644
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp
@@ -22,8 +22,10 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_methodHandles_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/allocation.inline.hpp"
+#include "prims/methodHandles.hpp"
#define __ _masm->
@@ -687,8 +689,8 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
{
// Perform an in-place conversion to int or an int subword.
__ ldsw(G3_amh_vmargslot, O0_argslot);
- Address vmarg = __ argument_address(O0_argslot);
Address value;
+ Address vmarg = __ argument_address(O0_argslot);
bool value_left_justified = false;
switch (ek) {
@@ -698,9 +700,21 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
case _adapter_opt_l2i:
{
// just delete the extra slot
+#ifdef _LP64
+ // In V9, longs are given 2 64-bit slots in the interpreter, but the
+ // data is passed in only 1 slot.
+ // Keep the second slot.
+ __ add(Gargs, __ argument_offset(O0_argslot, -1), O0_argslot);
+ remove_arg_slots(_masm, -stack_move_unit(), O0_argslot, O1_scratch, O2_scratch, O3_scratch);
+ value = Address(O0_argslot, 4); // Get least-significant 32-bit of 64-bit value.
+ vmarg = Address(O0_argslot, Interpreter::stackElementSize);
+#else
+ // Keep the first slot.
__ add(Gargs, __ argument_offset(O0_argslot), O0_argslot);
remove_arg_slots(_masm, -stack_move_unit(), O0_argslot, O1_scratch, O2_scratch, O3_scratch);
- value = vmarg = Address(O0_argslot, 0);
+ value = Address(O0_argslot, 0);
+ vmarg = value;
+#endif
}
break;
case _adapter_opt_unboxi:
diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp
index 3c578c95e1f..d38c979fa87 100644
--- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp
@@ -22,8 +22,18 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_nativeInst_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "nativeInst_sparc.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/ostream.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
bool NativeInstruction::is_dtrace_trap() {
diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp
index b5d2aac6dec..3ecb6d93720 100644
--- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,15 @@
*
*/
+#ifndef CPU_SPARC_VM_NATIVEINST_SPARC_HPP
+#define CPU_SPARC_VM_NATIVEINST_SPARC_HPP
+
+#include "asm/assembler.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/os.hpp"
+#include "utilities/top.hpp"
+
// We have interface for the following instructions:
// - NativeInstruction
// - - NativeCall
@@ -913,3 +922,5 @@ class NativeIllegalInstruction: public NativeInstruction {
// Insert illegal opcode as specific address
static void insert(address code_pos);
};
+
+#endif // CPU_SPARC_VM_NATIVEINST_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/registerMap_sparc.hpp b/hotspot/src/cpu/sparc/vm/registerMap_sparc.hpp
index 79a9456fc9c..0ce8294663f 100644
--- a/hotspot/src/cpu/sparc/vm/registerMap_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/registerMap_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_REGISTERMAP_SPARC_HPP
+#define CPU_SPARC_VM_REGISTERMAP_SPARC_HPP
+
// machine-dependent implemention for register maps
friend class frame;
@@ -51,3 +54,5 @@
void shift_individual_registers();
// When popping out of compiled frames, we make all IRegs disappear.
void make_integer_regs_unsaved() { _location_valid[0] = 0; }
+
+#endif // CPU_SPARC_VM_REGISTERMAP_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp b/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp
index a726217fd0a..03d08ddfa35 100644
--- a/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp
@@ -25,8 +25,11 @@
// make sure the defines don't screw up the declarations later on in this file
#define DONT_USE_REGISTER_DEFINES
-#include "incls/_precompiled.incl"
-#include "incls/_register_definitions_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "asm/register.hpp"
+#include "interp_masm_sparc.hpp"
+#include "register_sparc.hpp"
REGISTER_DEFINITION(Register, noreg);
diff --git a/hotspot/src/cpu/sparc/vm/register_sparc.cpp b/hotspot/src/cpu/sparc/vm/register_sparc.cpp
index bf6f872b44f..4ed28c6a0b5 100644
--- a/hotspot/src/cpu/sparc/vm/register_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/register_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,8 +22,8 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_register_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "register_sparc.hpp"
const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers << 1;
const int ConcreteRegisterImpl::max_fpr = ConcreteRegisterImpl::max_gpr + FloatRegisterImpl::number_of_registers;
diff --git a/hotspot/src/cpu/sparc/vm/register_sparc.hpp b/hotspot/src/cpu/sparc/vm/register_sparc.hpp
index 3f1eb90285e..945866e539f 100644
--- a/hotspot/src/cpu/sparc/vm/register_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/register_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_SPARC_VM_REGISTER_SPARC_HPP
+#define CPU_SPARC_VM_REGISTER_SPARC_HPP
+
+#include "asm/register.hpp"
+#include "vm_version_sparc.hpp"
+
// forward declaration
class Address;
class VMRegImpl;
@@ -440,3 +446,5 @@ class QuadFloatRegisterImpl {
return as_FloatRegister( ((encoding & 1) << 5) | (encoding & 0x1c) );
}
};
+
+#endif // CPU_SPARC_VM_REGISTER_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp
index a96f6a674a8..d2cefd35d55 100644
--- a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,8 +22,13 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_relocInfo_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.inline.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "code/relocInfo.hpp"
+#include "nativeInst_sparc.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/safepoint.hpp"
void Relocation::pd_set_data_value(address x, intptr_t o) {
NativeInstruction* ip = nativeInstruction_at(addr());
diff --git a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp
index 626e117a49f..a2d3b2c3928 100644
--- a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_RELOCINFO_SPARC_HPP
+#define CPU_SPARC_VM_RELOCINFO_SPARC_HPP
+
// machine-dependent parts of class relocInfo
private:
enum {
@@ -49,3 +52,5 @@
// 1.8 99/06/22 16:37:50 relocInfo_i486.hpp
// 1.9 99/07/16 11:12:11 relocInfo_i486.hpp
//End
+
+#endif // CPU_SPARC_VM_RELOCINFO_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp b/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp
index e6f641e26b7..560e67a2113 100644
--- a/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp
@@ -22,8 +22,22 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_runtime_sparc.cpp.incl"
+#include "precompiled.hpp"
+#ifdef COMPILER2
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/vmreg.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_sparc.hpp"
+#include "opto/runtime.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "vmreg_sparc.inline.hpp"
+#endif
#define __ masm->
diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
index bae042e8f66..751b512084d 100644
--- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
@@ -22,8 +22,28 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_sharedRuntime_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/vframeArray.hpp"
+#include "vmreg_sparc.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
+#ifdef SHARK
+#include "compiler/compileBroker.hpp"
+#include "shark/sharkCompiler.hpp"
+#endif
#define __ masm->
diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad
index 386b38f634b..018fe70b9ec 100644
--- a/hotspot/src/cpu/sparc/vm/sparc.ad
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad
@@ -667,6 +667,20 @@ intptr_t get_offset_from_base_2(const MachNode* n, const TypePtr* atype, int dis
return offset;
}
+static inline jdouble replicate_immI(int con, int count, int width) {
+ // Load a constant replicated "count" times with width "width"
+ int bit_width = width * 8;
+ jlong elt_val = con;
+ elt_val &= (((jlong) 1) << bit_width) - 1; // mask off sign bits
+ jlong val = elt_val;
+ for (int i = 0; i < count - 1; i++) {
+ val <<= bit_width;
+ val |= elt_val;
+ }
+ jdouble dval = *((jdouble*) &val); // coerce to double type
+ return dval;
+}
+
// Standard Sparc opcode form2 field breakdown
static inline void emit2_19(CodeBuffer &cbuf, int f30, int f29, int f25, int f22, int f20, int f19, int f0 ) {
f0 &= (1<<19)-1; // Mask displacement to 19 bits
@@ -1007,6 +1021,90 @@ void emit_lo(CodeBuffer &cbuf, int val) { }
void emit_hi(CodeBuffer &cbuf, int val) { }
+//=============================================================================
+const bool Matcher::constant_table_absolute_addressing = false;
+const RegMask& MachConstantBaseNode::_out_RegMask = PTR_REG_mask;
+
+void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
+ Compile* C = ra_->C;
+ Compile::ConstantTable& constant_table = C->constant_table();
+ MacroAssembler _masm(&cbuf);
+
+ Register r = as_Register(ra_->get_encode(this));
+ CodeSection* cs = __ code()->consts();
+ int consts_size = cs->align_at_start(cs->size());
+
+ if (UseRDPCForConstantTableBase) {
+ // For the following RDPC logic to work correctly the consts
+ // section must be allocated right before the insts section. This
+ // assert checks for that. The layout and the SECT_* constants
+ // are defined in src/share/vm/asm/codeBuffer.hpp.
+ assert(CodeBuffer::SECT_CONSTS + 1 == CodeBuffer::SECT_INSTS, "must be");
+ int offset = __ offset();
+ int disp;
+
+ // If the displacement from the current PC to the constant table
+ // base fits into simm13 we set the constant table base to the
+ // current PC.
+ if (__ is_simm13(-(consts_size + offset))) {
+ constant_table.set_table_base_offset(-(consts_size + offset));
+ disp = 0;
+ } else {
+ // If the offset of the top constant (last entry in the table)
+ // fits into simm13 we set the constant table base to the actual
+ // table base.
+ if (__ is_simm13(constant_table.top_offset())) {
+ constant_table.set_table_base_offset(0);
+ disp = consts_size + offset;
+ } else {
+ // Otherwise we set the constant table base in the middle of the
+ // constant table.
+ int half_consts_size = consts_size / 2;
+ assert(half_consts_size * 2 == consts_size, "sanity");
+ constant_table.set_table_base_offset(-half_consts_size); // table base offset gets added to the load displacement.
+ disp = half_consts_size + offset;
+ }
+ }
+
+ __ rdpc(r);
+
+ if (disp != 0) {
+ assert(r != O7, "need temporary");
+ __ sub(r, __ ensure_simm13_or_reg(disp, O7), r);
+ }
+ }
+ else {
+ // Materialize the constant table base.
+ assert(constant_table.size() == consts_size, err_msg("must be: %d == %d", constant_table.size(), consts_size));
+ address baseaddr = cs->start() + -(constant_table.table_base_offset());
+ RelocationHolder rspec = internal_word_Relocation::spec(baseaddr);
+ AddressLiteral base(baseaddr, rspec);
+ __ set(base, r);
+ }
+}
+
+uint MachConstantBaseNode::size(PhaseRegAlloc*) const {
+ if (UseRDPCForConstantTableBase) {
+ // This is really the worst case but generally it's only 1 instruction.
+ return 4 /*rdpc*/ + 4 /*sub*/ + MacroAssembler::worst_case_size_of_set();
+ } else {
+ return MacroAssembler::worst_case_size_of_set();
+ }
+}
+
+#ifndef PRODUCT
+void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
+ char reg[128];
+ ra_->dump_register(this, reg);
+ if (UseRDPCForConstantTableBase) {
+ st->print("RDPC %s\t! constant table base", reg);
+ } else {
+ st->print("SET &constanttable,%s\t! constant table base", reg);
+ }
+}
+#endif
+
+
//=============================================================================
#ifndef PRODUCT
@@ -2247,25 +2345,6 @@ encode %{
__ delayed()->nop();
%}
- enc_class jump_enc( iRegX switch_val, o7RegI table) %{
- MacroAssembler _masm(&cbuf);
-
- Register switch_reg = as_Register($switch_val$$reg);
- Register table_reg = O7;
-
- address table_base = __ address_table_constant(_index2label);
- RelocationHolder rspec = internal_word_Relocation::spec(table_base);
-
- // Move table address into a register.
- __ set(table_base, table_reg, rspec);
-
- // Jump to base address + switch value
- __ ld_ptr(table_reg, switch_reg, table_reg);
- __ jmp(table_reg, G0);
- __ delayed()->nop();
-
- %}
-
enc_class enc_ba( Label labl ) %{
MacroAssembler _masm(&cbuf);
Label &L = *($labl$$label);
@@ -2384,20 +2463,6 @@ encode %{
cbuf.insts()->emit_int32(op);
%}
- // Utility encoding for loading a 64 bit Pointer into a register
- // The 64 bit pointer is stored in the generated code stream
- enc_class SetPtr( immP src, iRegP rd ) %{
- Register dest = reg_to_register_object($rd$$reg);
- MacroAssembler _masm(&cbuf);
- // [RGV] This next line should be generated from ADLC
- if ( _opnds[1]->constant_is_oop() ) {
- intptr_t val = $src$$constant;
- __ set_oop_constant((jobject)val, dest);
- } else { // non-oop pointers, e.g. card mark base, heap top
- __ set($src$$constant, dest);
- }
- %}
-
enc_class Set13( immI13 src, iRegI rd ) %{
emit3_simm13( cbuf, Assembler::arith_op, $rd$$reg, Assembler::or_op3, 0, $src$$constant );
%}
@@ -2411,10 +2476,6 @@ encode %{
__ set($src$$constant, reg_to_register_object($rd$$reg));
%}
- enc_class SetNull( iRegI rd ) %{
- emit3_simm13( cbuf, Assembler::arith_op, $rd$$reg, Assembler::or_op3, 0, 0 );
- %}
-
enc_class call_epilog %{
if( VerifyStackAtCalls ) {
MacroAssembler _masm(&cbuf);
@@ -2778,35 +2839,6 @@ enc_class Fast_Unlock(iRegP oop, iRegP box, o7RegP scratch, iRegP scratch2) %{
__ float_cmp( $primary, -1, Fsrc1, Fsrc2, Rdst);
%}
- enc_class LdImmL (immL src, iRegL dst, o7RegL tmp) %{ // Load Immediate
- MacroAssembler _masm(&cbuf);
- Register dest = reg_to_register_object($dst$$reg);
- Register temp = reg_to_register_object($tmp$$reg);
- __ set64( $src$$constant, dest, temp );
- %}
-
- enc_class LdReplImmI(immI src, regD dst, o7RegP tmp, int count, int width) %{
- // Load a constant replicated "count" times with width "width"
- int bit_width = $width$$constant * 8;
- jlong elt_val = $src$$constant;
- elt_val &= (((jlong)1) << bit_width) - 1; // mask off sign bits
- jlong val = elt_val;
- for (int i = 0; i < $count$$constant - 1; i++) {
- val <<= bit_width;
- val |= elt_val;
- }
- jdouble dval = *(jdouble*)&val; // coerce to double type
- MacroAssembler _masm(&cbuf);
- address double_address = __ double_constant(dval);
- RelocationHolder rspec = internal_word_Relocation::spec(double_address);
- AddressLiteral addrlit(double_address, rspec);
-
- __ sethi(addrlit, $tmp$$Register);
- // XXX This is a quick fix for 6833573.
- //__ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec);
- __ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), as_DoubleFloatRegister($dst$$reg), rspec);
- %}
-
// Compiler ensures base is doubleword aligned and cnt is count of doublewords
enc_class enc_Clear_Array(iRegX cnt, iRegP base, iRegX temp) %{
MacroAssembler _masm(&cbuf);
@@ -3521,6 +3553,29 @@ operand immP() %{
interface(CONST_INTER);
%}
+// Pointer Immediate: 32 or 64-bit
+operand immP_set() %{
+ predicate(!VM_Version::is_niagara1_plus());
+ match(ConP);
+
+ op_cost(5);
+ // formats are generated automatically for constants and base registers
+ format %{ %}
+ interface(CONST_INTER);
+%}
+
+// Pointer Immediate: 32 or 64-bit
+// From Niagara2 processors on a load should be better than materializing.
+operand immP_load() %{
+ predicate(VM_Version::is_niagara1_plus());
+ match(ConP);
+
+ op_cost(5);
+ // formats are generated automatically for constants and base registers
+ format %{ %}
+ interface(CONST_INTER);
+%}
+
operand immP13() %{
predicate((-4096 < n->get_ptr()) && (n->get_ptr() <= 4095));
match(ConP);
@@ -3616,6 +3671,26 @@ operand immL_32bits() %{
interface(CONST_INTER);
%}
+// Long Immediate: cheap (materialize in <= 3 instructions)
+operand immL_cheap() %{
+ predicate(!VM_Version::is_niagara1_plus() || MacroAssembler::size_of_set64(n->get_long()) <= 3);
+ match(ConL);
+ op_cost(0);
+
+ format %{ %}
+ interface(CONST_INTER);
+%}
+
+// Long Immediate: expensive (materialize in > 3 instructions)
+operand immL_expensive() %{
+ predicate(VM_Version::is_niagara1_plus() && MacroAssembler::size_of_set64(n->get_long()) > 3);
+ match(ConL);
+ op_cost(0);
+
+ format %{ %}
+ interface(CONST_INTER);
+%}
+
// Double Immediate
operand immD() %{
match(ConD);
@@ -5981,25 +6056,59 @@ instruct loadConI13( iRegI dst, immI13 src ) %{
ins_pipe(ialu_imm);
%}
-instruct loadConP(iRegP dst, immP src) %{
- match(Set dst src);
+#ifndef _LP64
+instruct loadConP(iRegP dst, immP con) %{
+ match(Set dst con);
ins_cost(DEFAULT_COST * 3/2);
- format %{ "SET $src,$dst\t!ptr" %}
- // This rule does not use "expand" unlike loadConI because then
- // the result type is not known to be an Oop. An ADLC
- // enhancement will be needed to make that work - not worth it!
-
- ins_encode( SetPtr( src, dst ) );
+ format %{ "SET $con,$dst\t!ptr" %}
+ ins_encode %{
+ // [RGV] This next line should be generated from ADLC
+ if (_opnds[1]->constant_is_oop()) {
+ intptr_t val = $con$$constant;
+ __ set_oop_constant((jobject) val, $dst$$Register);
+ } else { // non-oop pointers, e.g. card mark base, heap top
+ __ set($con$$constant, $dst$$Register);
+ }
+ %}
ins_pipe(loadConP);
-
%}
+#else
+instruct loadConP_set(iRegP dst, immP_set con) %{
+ match(Set dst con);
+ ins_cost(DEFAULT_COST * 3/2);
+ format %{ "SET $con,$dst\t! ptr" %}
+ ins_encode %{
+ // [RGV] This next line should be generated from ADLC
+ if (_opnds[1]->constant_is_oop()) {
+ intptr_t val = $con$$constant;
+ __ set_oop_constant((jobject) val, $dst$$Register);
+ } else { // non-oop pointers, e.g. card mark base, heap top
+ __ set($con$$constant, $dst$$Register);
+ }
+ %}
+ ins_pipe(loadConP);
+%}
+
+instruct loadConP_load(iRegP dst, immP_load con) %{
+ match(Set dst con);
+ ins_cost(MEMORY_REF_COST);
+ format %{ "LD [$constanttablebase + $constantoffset],$dst\t! load from constant table: ptr=$con" %}
+ ins_encode %{
+ RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $dst$$Register);
+ __ ld_ptr($constanttablebase, con_offset, $dst$$Register);
+ %}
+ ins_pipe(loadConP);
+%}
+#endif // _LP64
instruct loadConP0(iRegP dst, immP0 src) %{
match(Set dst src);
size(4);
format %{ "CLR $dst\t!ptr" %}
- ins_encode( SetNull( dst ) );
+ ins_encode %{
+ __ clr($dst$$Register);
+ %}
ins_pipe(ialu_imm);
%}
@@ -6019,7 +6128,9 @@ instruct loadConN0(iRegN dst, immN0 src) %{
size(4);
format %{ "CLR $dst\t! compressed NULL ptr" %}
- ins_encode( SetNull( dst ) );
+ ins_encode %{
+ __ clr($dst$$Register);
+ %}
ins_pipe(ialu_imm);
%}
@@ -6034,13 +6145,27 @@ instruct loadConN(iRegN dst, immN src) %{
ins_pipe(ialu_hi_lo_reg);
%}
-instruct loadConL(iRegL dst, immL src, o7RegL tmp) %{
- // %%% maybe this should work like loadConD
- match(Set dst src);
+// Materialize long value (predicated by immL_cheap).
+instruct loadConL_set64(iRegL dst, immL_cheap con, o7RegL tmp) %{
+ match(Set dst con);
effect(KILL tmp);
- ins_cost(DEFAULT_COST * 4);
- format %{ "SET64 $src,$dst KILL $tmp\t! long" %}
- ins_encode( LdImmL(src, dst, tmp) );
+ ins_cost(DEFAULT_COST * 3);
+ format %{ "SET64 $con,$dst KILL $tmp\t! cheap long" %}
+ ins_encode %{
+ __ set64($con$$constant, $dst$$Register, $tmp$$Register);
+ %}
+ ins_pipe(loadConL);
+%}
+
+// Load long value from constant table (predicated by immL_expensive).
+instruct loadConL_ldx(iRegL dst, immL_expensive con) %{
+ match(Set dst con);
+ ins_cost(MEMORY_REF_COST);
+ format %{ "LDX [$constanttablebase + $constantoffset],$dst\t! load from constant table: long=$con" %}
+ ins_encode %{
+ RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $dst$$Register);
+ __ ldx($constanttablebase, con_offset, $dst$$Register);
+ %}
ins_pipe(loadConL);
%}
@@ -6063,50 +6188,26 @@ instruct loadConL13( iRegL dst, immL13 src ) %{
ins_pipe(ialu_imm);
%}
-instruct loadConF(regF dst, immF src, o7RegP tmp) %{
- match(Set dst src);
+instruct loadConF(regF dst, immF con, o7RegI tmp) %{
+ match(Set dst con);
effect(KILL tmp);
-
-#ifdef _LP64
- size(8*4);
-#else
- size(2*4);
-#endif
-
- format %{ "SETHI hi(&$src),$tmp\t!get float $src from table\n\t"
- "LDF [$tmp+lo(&$src)],$dst" %}
+ format %{ "LDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: float=$con" %}
ins_encode %{
- address float_address = __ float_constant($src$$constant);
- RelocationHolder rspec = internal_word_Relocation::spec(float_address);
- AddressLiteral addrlit(float_address, rspec);
-
- __ sethi(addrlit, $tmp$$Register);
- __ ldf(FloatRegisterImpl::S, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec);
+ RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $tmp$$Register);
+ __ ldf(FloatRegisterImpl::S, $constanttablebase, con_offset, $dst$$FloatRegister);
%}
ins_pipe(loadConFD);
%}
-instruct loadConD(regD dst, immD src, o7RegP tmp) %{
- match(Set dst src);
+instruct loadConD(regD dst, immD con, o7RegI tmp) %{
+ match(Set dst con);
effect(KILL tmp);
-
-#ifdef _LP64
- size(8*4);
-#else
- size(2*4);
-#endif
-
- format %{ "SETHI hi(&$src),$tmp\t!get double $src from table\n\t"
- "LDDF [$tmp+lo(&$src)],$dst" %}
+ format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: double=$con" %}
ins_encode %{
- address double_address = __ double_constant($src$$constant);
- RelocationHolder rspec = internal_word_Relocation::spec(double_address);
- AddressLiteral addrlit(double_address, rspec);
-
- __ sethi(addrlit, $tmp$$Register);
// XXX This is a quick fix for 6833573.
- //__ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec);
- __ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), as_DoubleFloatRegister($dst$$reg), rspec);
+ //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset($con), $dst$$FloatRegister);
+ RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $tmp$$Register);
+ __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg));
%}
ins_pipe(loadConFD);
%}
@@ -8558,16 +8659,16 @@ instruct Repl8B_reg(stackSlotD dst, iRegI src) %{
%}
// Replicate scalar constant to packed byte values in Double register
-instruct Repl8B_immI(regD dst, immI13 src, o7RegP tmp) %{
- match(Set dst (Replicate8B src));
-#ifdef _LP64
- size(36);
-#else
- size(8);
-#endif
- format %{ "SETHI hi(&Repl8($src)),$tmp\t!get Repl8B($src) from table\n\t"
- "LDDF [$tmp+lo(&Repl8($src))],$dst" %}
- ins_encode( LdReplImmI(src, dst, tmp, (8), (1)) );
+instruct Repl8B_immI(regD dst, immI13 con, o7RegI tmp) %{
+ match(Set dst (Replicate8B con));
+ effect(KILL tmp);
+ format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl8B($con)" %}
+ ins_encode %{
+ // XXX This is a quick fix for 6833573.
+ //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 8, 1)), $dst$$FloatRegister);
+ RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 8, 1)), $tmp$$Register);
+ __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg));
+ %}
ins_pipe(loadConFD);
%}
@@ -8594,16 +8695,16 @@ instruct Repl4C_reg(stackSlotD dst, iRegI src) %{
%}
// Replicate scalar constant to packed char values in Double register
-instruct Repl4C_immI(regD dst, immI src, o7RegP tmp) %{
- match(Set dst (Replicate4C src));
-#ifdef _LP64
- size(36);
-#else
- size(8);
-#endif
- format %{ "SETHI hi(&Repl4($src)),$tmp\t!get Repl4C($src) from table\n\t"
- "LDDF [$tmp+lo(&Repl4($src))],$dst" %}
- ins_encode( LdReplImmI(src, dst, tmp, (4), (2)) );
+instruct Repl4C_immI(regD dst, immI con, o7RegI tmp) %{
+ match(Set dst (Replicate4C con));
+ effect(KILL tmp);
+ format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl4C($con)" %}
+ ins_encode %{
+ // XXX This is a quick fix for 6833573.
+ //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 4, 2)), $dst$$FloatRegister);
+ RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 4, 2)), $tmp$$Register);
+ __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg));
+ %}
ins_pipe(loadConFD);
%}
@@ -8630,16 +8731,16 @@ instruct Repl4S_reg(stackSlotD dst, iRegI src) %{
%}
// Replicate scalar constant to packed short values in Double register
-instruct Repl4S_immI(regD dst, immI src, o7RegP tmp) %{
- match(Set dst (Replicate4S src));
-#ifdef _LP64
- size(36);
-#else
- size(8);
-#endif
- format %{ "SETHI hi(&Repl4($src)),$tmp\t!get Repl4S($src) from table\n\t"
- "LDDF [$tmp+lo(&Repl4($src))],$dst" %}
- ins_encode( LdReplImmI(src, dst, tmp, (4), (2)) );
+instruct Repl4S_immI(regD dst, immI con, o7RegI tmp) %{
+ match(Set dst (Replicate4S con));
+ effect(KILL tmp);
+ format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl4S($con)" %}
+ ins_encode %{
+ // XXX This is a quick fix for 6833573.
+ //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 4, 2)), $dst$$FloatRegister);
+ RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 4, 2)), $tmp$$Register);
+ __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg));
+ %}
ins_pipe(loadConFD);
%}
@@ -8664,16 +8765,16 @@ instruct Repl2I_reg(stackSlotD dst, iRegI src) %{
%}
// Replicate scalar zero constant to packed int values in Double register
-instruct Repl2I_immI(regD dst, immI src, o7RegP tmp) %{
- match(Set dst (Replicate2I src));
-#ifdef _LP64
- size(36);
-#else
- size(8);
-#endif
- format %{ "SETHI hi(&Repl2($src)),$tmp\t!get Repl2I($src) from table\n\t"
- "LDDF [$tmp+lo(&Repl2($src))],$dst" %}
- ins_encode( LdReplImmI(src, dst, tmp, (2), (4)) );
+instruct Repl2I_immI(regD dst, immI con, o7RegI tmp) %{
+ match(Set dst (Replicate2I con));
+ effect(KILL tmp);
+ format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl2I($con)" %}
+ ins_encode %{
+ // XXX This is a quick fix for 6833573.
+ //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 2, 4)), $dst$$FloatRegister);
+ RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 2, 4)), $tmp$$Register);
+ __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg));
+ %}
ins_pipe(loadConFD);
%}
@@ -8929,12 +9030,27 @@ instruct jumpXtnd(iRegX switch_val, o7RegI table) %{
ins_cost(350);
- format %{ "SETHI [hi(table_base)],O7\n\t"
- "ADD O7, lo(table_base), O7\n\t"
- "LD [O7+$switch_val], O7\n\t"
+ format %{ "ADD $constanttablebase, $constantoffset, O7\n\t"
+ "LD [O7 + $switch_val], O7\n\t"
"JUMP O7"
%}
- ins_encode( jump_enc( switch_val, table) );
+ ins_encode %{
+ // Calculate table address into a register.
+ Register table_reg;
+ Register label_reg = O7;
+ if (constant_offset() == 0) {
+ table_reg = $constanttablebase;
+ } else {
+ table_reg = O7;
+ RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset, O7);
+ __ add($constanttablebase, con_offset, table_reg);
+ }
+
+ // Jump to base address + switch value
+ __ ld_ptr(table_reg, $switch_val$$Register, label_reg);
+ __ jmp(label_reg, G0);
+ __ delayed()->nop();
+ %}
ins_pc_relative(1);
ins_pipe(ialu_reg_reg);
%}
diff --git a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
index 8a4dc2ad9b9..7bb56140d61 100644
--- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
@@ -22,8 +22,31 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_stubGenerator_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_sparc.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
// Declaration and definition of StubGenerator (no .hpp file).
// For a more detailed description of the stub routine structure
diff --git a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp
index 162f6469d5b..68785abfc73 100644
--- a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,16 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
// Implementation of the platform-specific part of StubRoutines - for
// a description of how to extend it, see the stubRoutines.hpp file.
diff --git a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp
index d56655b3e3b..11350f2d400 100644
--- a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_STUBROUTINES_SPARC_HPP
+#define CPU_SPARC_VM_STUBROUTINES_SPARC_HPP
+
// This file holds the platform specific parts of the StubRoutines
// definition. See stubRoutines.hpp for a description on how to
// extend it.
@@ -100,3 +103,5 @@ class Sparc {
static address partial_subtype_check() { return _partial_subtype_check; }
};
+
+#endif // CPU_SPARC_VM_STUBROUTINES_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp
index 1519d3ea1f2..73b0f1478b5 100644
--- a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,13 @@
*
*/
+#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 cc05ddb7e96..80e3a759d1d 100644
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
@@ -22,8 +22,28 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_templateInterpreter_sparc.cpp.incl"
+#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/methodDataOop.hpp"
+#include "oops/methodOop.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"
#ifndef CC_INTERP
#ifndef FAST_DISPATCH
diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp
index 5770131e1df..9b6cd216fbb 100644
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP
+#define CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP
+
protected:
@@ -38,3 +41,5 @@
#else
const static int InterpreterCodeSize = 180 * 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 9a68a2169a9..89637223745 100644
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
@@ -22,8 +22,18 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_templateTable_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodDataOop.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"
#ifndef CC_INTERP
#define __ _masm->
diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.hpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.hpp
index cf82ef4e827..35c8ca1c59b 100644
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_TEMPLATETABLE_SPARC_HPP
+#define CPU_SPARC_VM_TEMPLATETABLE_SPARC_HPP
+
// helper function
static void invokevfinal_helper(Register Rcache, Register Rret);
static void invokeinterface_object_method(Register RklassOop, Register Rcall,
@@ -29,3 +32,5 @@
Register Rflags);
static void generate_vtable_call(Register Rrecv, Register Rindex, Register Rret);
static void volatile_barrier(Assembler::Membar_mask_bits order_constraint);
+
+#endif // CPU_SPARC_VM_TEMPLATETABLE_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp b/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp
index 47db8d52f0d..8103a6395b7 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, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP
+#define CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP
+
// These are the CPU-specific fields, types and integer
// constants required by the Serviceability Agent. This file is
// referenced by vmStructs.cpp.
@@ -97,3 +100,5 @@
/* NOTE that we do not use the last_entry() macro here; it is used */
/* in vmStructs__.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */
/* be present there) */
+
+#endif // CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
index 0e323c4e630..9e192861926 100644
--- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
@@ -22,8 +22,18 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/java.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "vm_version_sparc.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
int VM_Version::_features = VM_Version::unknown_m;
const char* VM_Version::_features_str = "";
diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
index 9fd851b747b..5ae1fcbc30c 100644
--- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_SPARC_VM_VM_VERSION_SPARC_HPP
+#define CPU_SPARC_VM_VM_VERSION_SPARC_HPP
+
+#include "runtime/globals_extension.hpp"
+#include "runtime/vm_version.hpp"
+
class VM_Version: public Abstract_VM_Version {
protected:
enum Feature_Flag {
@@ -74,9 +80,6 @@ protected:
static bool is_sparc64(int features) { return (features & fmaf_instructions_m) != 0; }
static int maximum_niagara1_processor_count() { return 32; }
- // Returns true if the platform is in the niagara line and
- // newer than the niagara1.
- static bool is_niagara1_plus();
public:
// Initialization
@@ -99,6 +102,9 @@ public:
static bool is_ultra3() { return (_features & ultra3_m) == ultra3_m; }
static bool is_sun4v() { return (_features & sun4v_m) != 0; }
static bool is_niagara1() { return is_niagara1(_features); }
+ // Returns true if the platform is in the niagara line and
+ // newer than the niagara1.
+ static bool is_niagara1_plus();
static bool is_sparc64() { return is_sparc64(_features); }
static bool has_fast_fxtof() { return has_v9() && !is_ultra3(); }
@@ -152,3 +158,5 @@ public:
// Calculates the number of parallel threads
static unsigned int calc_parallel_worker_threads();
};
+
+#endif // CPU_SPARC_VM_VM_VERSION_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.cpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.cpp
index 1693ea297b6..470f354bf46 100644
--- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_vmreg_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "code/vmreg.hpp"
diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp
index 6234fdd6f85..ce8cb4c3d3a 100644
--- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,8 +22,13 @@
*
*/
+#ifndef CPU_SPARC_VM_VMREG_SPARC_HPP
+#define CPU_SPARC_VM_VMREG_SPARC_HPP
+
bool is_Register();
Register as_Register();
bool is_FloatRegister();
FloatRegister as_FloatRegister();
+
+#endif // CPU_SPARC_VM_VMREG_SPARC_HPP
diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp
index fa92eea8e12..993216fc12d 100644
--- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp
+++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP
+#define CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP
+
inline VMReg RegisterImpl::as_VMReg() {
if( this==noreg ) return VMRegImpl::Bad();
return VMRegImpl::as_VMReg(encoding() << 1 );
@@ -60,3 +63,5 @@ inline bool VMRegImpl::is_concrete() {
assert(false, "what register?");
return false;
}
+
+#endif // CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP
diff --git a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp
index 2932cfc42b2..9c040216e06 100644
--- a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,19 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_vtableStubs_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "code/vtableStubs.hpp"
+#include "interp_masm_sparc.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klassVtable.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_sparc.inline.hpp"
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
// machine-dependent part of VtableStubs: create vtableStub of correct size and
// initialize its code
diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp
index 64be76d7c84..85dc5411f02 100644
--- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp
@@ -22,8 +22,24 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#endif
// Implementation of AddressLiteral
@@ -2633,6 +2649,37 @@ void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) {
emit_byte(0xC0 | encode);
}
+void Assembler::sqrtsd(XMMRegister dst, Address src) {
+ NOT_LP64(assert(VM_Version::supports_sse2(), ""));
+ InstructionMark im(this);
+ emit_byte(0xF2);
+ prefix(src, dst);
+ emit_byte(0x0F);
+ emit_byte(0x51);
+ emit_operand(dst, src);
+}
+
+void Assembler::sqrtss(XMMRegister dst, XMMRegister src) {
+ // HMM Table D-1 says sse2
+ // NOT_LP64(assert(VM_Version::supports_sse(), ""));
+ NOT_LP64(assert(VM_Version::supports_sse2(), ""));
+ emit_byte(0xF3);
+ int encode = prefix_and_encode(dst->encoding(), src->encoding());
+ emit_byte(0x0F);
+ emit_byte(0x51);
+ emit_byte(0xC0 | encode);
+}
+
+void Assembler::sqrtss(XMMRegister dst, Address src) {
+ NOT_LP64(assert(VM_Version::supports_sse2(), ""));
+ InstructionMark im(this);
+ emit_byte(0xF3);
+ prefix(src, dst);
+ emit_byte(0x0F);
+ emit_byte(0x51);
+ emit_operand(dst, src);
+}
+
void Assembler::stmxcsr( Address dst) {
NOT_LP64(assert(VM_Version::supports_sse(), ""));
InstructionMark im(this);
@@ -4342,16 +4389,6 @@ void Assembler::shrq(Register dst) {
emit_byte(0xE8 | encode);
}
-void Assembler::sqrtsd(XMMRegister dst, Address src) {
- NOT_LP64(assert(VM_Version::supports_sse2(), ""));
- InstructionMark im(this);
- emit_byte(0xF2);
- prefix(src, dst);
- emit_byte(0x0F);
- emit_byte(0x51);
- emit_operand(dst, src);
-}
-
void Assembler::subq(Address dst, int32_t imm32) {
InstructionMark im(this);
prefixq(dst);
@@ -4913,10 +4950,6 @@ void MacroAssembler::movptr(Address dst, intptr_t src) {
}
-void MacroAssembler::movsd(XMMRegister dst, AddressLiteral src) {
- movsd(dst, as_Address(src));
-}
-
void MacroAssembler::pop_callee_saved_registers() {
pop(rcx);
pop(rdx);
@@ -5522,17 +5555,14 @@ void MacroAssembler::stop(const char* msg) {
}
void MacroAssembler::warn(const char* msg) {
- push(r12);
- movq(r12, rsp);
+ push(rsp);
andq(rsp, -16); // align stack as required by push_CPU_state and call
push_CPU_state(); // keeps alignment at 16 bytes
lea(c_rarg0, ExternalAddress((address) msg));
call_VM_leaf(CAST_FROM_FN_PTR(address, warning), c_rarg0);
pop_CPU_state();
-
- movq(rsp, r12);
- pop(r12);
+ pop(rsp);
}
#ifndef PRODUCT
@@ -5844,6 +5874,10 @@ void MacroAssembler::call_VM_base(Register oop_result,
// debugging support
assert(number_of_arguments >= 0 , "cannot have negative number of arguments");
LP64_ONLY(assert(java_thread == r15_thread, "unexpected register"));
+#ifdef ASSERT
+ LP64_ONLY(if (UseCompressedOops) verify_heapbase("call_VM_base");)
+#endif // ASSERT
+
assert(java_thread != oop_result , "cannot use the same register for java_thread & oop_result");
assert(java_thread != last_java_sp, "cannot use the same register for java_thread & last_java_sp");
diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp
index fb832b689d5..b9fcc2eff00 100644
--- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_ASSEMBLER_X86_HPP
+#define CPU_X86_VM_ASSEMBLER_X86_HPP
+
class BiasedLockingCounters;
// Contains all the definitions needed for x86 assembly code generation.
@@ -132,6 +135,7 @@ REGISTER_DECLARATION(Register, r15_thread, r15); // callee-saved
// Using noreg ensures if the dead code is incorrectly live and executed it
// will cause an assertion failure
#define rscratch1 noreg
+#define rscratch2 noreg
#endif // _LP64
@@ -1349,6 +1353,10 @@ private:
void sqrtsd(XMMRegister dst, Address src);
void sqrtsd(XMMRegister dst, XMMRegister src);
+ // Compute Square Root of Scalar Single-Precision Floating-Point Value
+ void sqrtss(XMMRegister dst, Address src);
+ void sqrtss(XMMRegister dst, XMMRegister src);
+
void std() { emit_byte(0xfd); }
void stmxcsr( Address dst );
@@ -2121,6 +2129,9 @@ class MacroAssembler: public Assembler {
void comisd(XMMRegister dst, Address src) { Assembler::comisd(dst, src); }
void comisd(XMMRegister dst, AddressLiteral src);
+ void fadd_s(Address src) { Assembler::fadd_s(src); }
+ void fadd_s(AddressLiteral src) { Assembler::fadd_s(as_Address(src)); }
+
void fldcw(Address src) { Assembler::fldcw(src); }
void fldcw(AddressLiteral src);
@@ -2134,6 +2145,9 @@ class MacroAssembler: public Assembler {
void fld_x(Address src) { Assembler::fld_x(src); }
void fld_x(AddressLiteral src);
+ void fmul_s(Address src) { Assembler::fmul_s(src); }
+ void fmul_s(AddressLiteral src) { Assembler::fmul_s(as_Address(src)); }
+
void ldmxcsr(Address src) { Assembler::ldmxcsr(src); }
void ldmxcsr(AddressLiteral src);
@@ -2150,10 +2164,50 @@ private:
public:
- void movsd(XMMRegister dst, XMMRegister src) { Assembler::movsd(dst, src); }
- void movsd(Address dst, XMMRegister src) { Assembler::movsd(dst, src); }
- void movsd(XMMRegister dst, Address src) { Assembler::movsd(dst, src); }
- void movsd(XMMRegister dst, AddressLiteral src);
+ void addsd(XMMRegister dst, XMMRegister src) { Assembler::addsd(dst, src); }
+ void addsd(XMMRegister dst, Address src) { Assembler::addsd(dst, src); }
+ void addsd(XMMRegister dst, AddressLiteral src) { Assembler::addsd(dst, as_Address(src)); }
+
+ void addss(XMMRegister dst, XMMRegister src) { Assembler::addss(dst, src); }
+ void addss(XMMRegister dst, Address src) { Assembler::addss(dst, src); }
+ void addss(XMMRegister dst, AddressLiteral src) { Assembler::addss(dst, as_Address(src)); }
+
+ void divsd(XMMRegister dst, XMMRegister src) { Assembler::divsd(dst, src); }
+ void divsd(XMMRegister dst, Address src) { Assembler::divsd(dst, src); }
+ void divsd(XMMRegister dst, AddressLiteral src) { Assembler::divsd(dst, as_Address(src)); }
+
+ void divss(XMMRegister dst, XMMRegister src) { Assembler::divss(dst, src); }
+ void divss(XMMRegister dst, Address src) { Assembler::divss(dst, src); }
+ void divss(XMMRegister dst, AddressLiteral src) { Assembler::divss(dst, as_Address(src)); }
+
+ void movsd(XMMRegister dst, XMMRegister src) { Assembler::movsd(dst, src); }
+ void movsd(Address dst, XMMRegister src) { Assembler::movsd(dst, src); }
+ void movsd(XMMRegister dst, Address src) { Assembler::movsd(dst, src); }
+ void movsd(XMMRegister dst, AddressLiteral src) { Assembler::movsd(dst, as_Address(src)); }
+
+ void mulsd(XMMRegister dst, XMMRegister src) { Assembler::mulsd(dst, src); }
+ void mulsd(XMMRegister dst, Address src) { Assembler::mulsd(dst, src); }
+ void mulsd(XMMRegister dst, AddressLiteral src) { Assembler::mulsd(dst, as_Address(src)); }
+
+ void mulss(XMMRegister dst, XMMRegister src) { Assembler::mulss(dst, src); }
+ void mulss(XMMRegister dst, Address src) { Assembler::mulss(dst, src); }
+ void mulss(XMMRegister dst, AddressLiteral src) { Assembler::mulss(dst, as_Address(src)); }
+
+ void sqrtsd(XMMRegister dst, XMMRegister src) { Assembler::sqrtsd(dst, src); }
+ void sqrtsd(XMMRegister dst, Address src) { Assembler::sqrtsd(dst, src); }
+ void sqrtsd(XMMRegister dst, AddressLiteral src) { Assembler::sqrtsd(dst, as_Address(src)); }
+
+ void sqrtss(XMMRegister dst, XMMRegister src) { Assembler::sqrtss(dst, src); }
+ void sqrtss(XMMRegister dst, Address src) { Assembler::sqrtss(dst, src); }
+ void sqrtss(XMMRegister dst, AddressLiteral src) { Assembler::sqrtss(dst, as_Address(src)); }
+
+ void subsd(XMMRegister dst, XMMRegister src) { Assembler::subsd(dst, src); }
+ void subsd(XMMRegister dst, Address src) { Assembler::subsd(dst, src); }
+ void subsd(XMMRegister dst, AddressLiteral src) { Assembler::subsd(dst, as_Address(src)); }
+
+ void subss(XMMRegister dst, XMMRegister src) { Assembler::subss(dst, src); }
+ void subss(XMMRegister dst, Address src) { Assembler::subss(dst, src); }
+ void subss(XMMRegister dst, AddressLiteral src) { Assembler::subss(dst, as_Address(src)); }
void ucomiss(XMMRegister dst, XMMRegister src) { Assembler::ucomiss(dst, src); }
void ucomiss(XMMRegister dst, Address src) { Assembler::ucomiss(dst, src); }
@@ -2273,3 +2327,5 @@ class SkipIfEqual {
#ifdef ASSERT
inline bool AbstractAssembler::pd_check_instruction_mark() { return true; }
#endif
+
+#endif // CPU_X86_VM_ASSEMBLER_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.inline.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.inline.hpp
index 1198dad1e58..125bf3ffff0 100644
--- a/hotspot/src/cpu/x86/vm/assembler_x86.inline.hpp
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,14 @@
*
*/
+#ifndef CPU_X86_VM_ASSEMBLER_X86_INLINE_HPP
+#define CPU_X86_VM_ASSEMBLER_X86_INLINE_HPP
+
+#include "asm/assembler.inline.hpp"
+#include "asm/codeBuffer.hpp"
+#include "code/codeCache.hpp"
+#include "runtime/handles.inline.hpp"
+
inline void MacroAssembler::pd_patch_instruction(address branch, address target) {
unsigned char op = branch[0];
assert(op == 0xE8 /* call */ ||
@@ -85,3 +93,5 @@ inline void Assembler::emit_long64(jlong x) {
code_section()->set_end(_code_pos);
}
#endif // _LP64
+
+#endif // CPU_X86_VM_ASSEMBLER_X86_INLINE_HPP
diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp
index bb6fe1e1d59..5e606224fac 100644
--- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,8 +22,30 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_bytecodeInterpreter_x86.cpp.incl"
+#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/methodDataOop.hpp"
+#include "oops/methodOop.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_MODEL_x86_32
+# include "interp_masm_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "interp_masm_x86_64.hpp"
+#endif
#ifdef CC_INTERP
diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp
index 00343c045b3..e4eaa751286 100644
--- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP
+#define CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP
+
// Platform specific for C++ based Interpreter
private:
@@ -108,3 +111,5 @@ inline intptr_t* sender_sp() {
((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
index 1c5616aa352..4f60b455801 100644
--- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp
+++ b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#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; }
@@ -278,3 +281,5 @@ inline jshort BytecodeInterpreter::VMint2Short(jint 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/bytecodes_x86.cpp b/hotspot/src/cpu/x86/vm/bytecodes_x86.cpp
index d9ddba8dd38..4e6993548c9 100644
--- a/hotspot/src/cpu/x86/vm/bytecodes_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/bytecodes_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,8 +22,8 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_bytecodes_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecodes.hpp"
void Bytecodes::pd_initialize() {
diff --git a/hotspot/src/cpu/x86/vm/bytecodes_x86.hpp b/hotspot/src/cpu/x86/vm/bytecodes_x86.hpp
index aab08d90b42..e21c16a09ae 100644
--- a/hotspot/src/cpu/x86/vm/bytecodes_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/bytecodes_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,4 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_BYTECODES_X86_HPP
+#define CPU_X86_VM_BYTECODES_X86_HPP
+
// No i486 specific bytecodes
+
+#endif // CPU_X86_VM_BYTECODES_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/bytes_x86.hpp b/hotspot/src/cpu/x86/vm/bytes_x86.hpp
index d62120c7041..ac096dc3737 100644
--- a/hotspot/src/cpu/x86/vm/bytes_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/bytes_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,11 @@
*
*/
+#ifndef CPU_X86_VM_BYTES_X86_HPP
+#define CPU_X86_VM_BYTES_X86_HPP
+
+#include "memory/allocation.hpp"
+
class Bytes: AllStatic {
private:
#ifndef AMD64
@@ -67,4 +72,15 @@ class Bytes: AllStatic {
// The following header contains the implementations of swap_u2, swap_u4, and swap_u8[_base]
-#include "incls/_bytes_pd.inline.hpp.incl"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "bytes_linux_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "bytes_solaris_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "bytes_windows_x86.inline.hpp"
+#endif
+
+
+#endif // CPU_X86_VM_BYTES_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp
index b6f9eea591b..62088bd100e 100644
--- a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp
@@ -22,8 +22,18 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_c1_CodeStubs_x86.cpp.incl"
+#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_x86.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_x86.inline.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif
#define __ ce->masm()->
@@ -473,7 +483,7 @@ void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {
Register pre_val_reg = pre_val()->as_register();
- ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false);
+ ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);
__ cmpptr(pre_val_reg, (int32_t) NULL_WORD);
__ jcc(Assembler::equal, _continuation);
diff --git a/hotspot/src/cpu/x86/vm/c1_Defs_x86.hpp b/hotspot/src/cpu/x86/vm/c1_Defs_x86.hpp
index 2fd08e2140b..dab876adc8a 100644
--- a/hotspot/src/cpu/x86/vm/c1_Defs_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/c1_Defs_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_C1_DEFS_X86_HPP
+#define CPU_X86_VM_C1_DEFS_X86_HPP
+
// native word offsets from memory address (little endian)
enum {
pd_lo_word_offset_in_bytes = 0,
@@ -58,8 +61,8 @@ enum {
pd_nof_xmm_regs_linearscan = pd_nof_xmm_regs_frame_map, // number of registers visible to linear scan
pd_first_cpu_reg = 0,
pd_last_cpu_reg = NOT_LP64(5) LP64_ONLY(11),
- pd_first_byte_reg = 2,
- pd_last_byte_reg = 5,
+ pd_first_byte_reg = NOT_LP64(2) LP64_ONLY(0),
+ pd_last_byte_reg = NOT_LP64(5) LP64_ONLY(11),
pd_first_fpu_reg = pd_nof_cpu_regs_frame_map,
pd_last_fpu_reg = pd_first_fpu_reg + 7,
pd_first_xmm_reg = pd_nof_cpu_regs_frame_map + pd_nof_fpu_regs_frame_map,
@@ -71,3 +74,5 @@ enum {
enum {
pd_float_saved_as_double = true
};
+
+#endif // CPU_X86_VM_C1_DEFS_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.cpp b/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.cpp
index f8ce059955d..3fbd57c5ca3 100644
--- a/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_c1_FpuStackSim_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_FpuStackSim.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "utilities/array.hpp"
+#include "utilities/ostream.hpp"
//--------------------------------------------------------
// FpuStackSim
diff --git a/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.hpp b/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.hpp
index 29dabd254be..ae1e0d5904d 100644
--- a/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/c1_FpuStackSim_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_C1_FPUSTACKSIM_X86_HPP
+#define CPU_X86_VM_C1_FPUSTACKSIM_X86_HPP
+
// Simulates the FPU stack and maintains mapping [fpu-register -> stack offset]
// FPU registers are described as numbers from 0..nof_fpu_regs-1
@@ -65,3 +68,5 @@ class FpuStackSim VALUE_OBJ_CLASS_SPEC {
void print() PRODUCT_RETURN;
};
+
+#endif // CPU_X86_VM_C1_FPUSTACKSIM_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp
index 20e78c242c5..52f42977f71 100644
--- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp
@@ -22,8 +22,11 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_c1_FrameMap_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_FrameMap.hpp"
+#include "c1/c1_LIR.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_x86.inline.hpp"
const int FrameMap::pd_c_runtime_reserved_arg_size = 0;
@@ -155,9 +158,11 @@ void FrameMap::initialize() {
map_register( 6, r8); r8_opr = LIR_OprFact::single_cpu(6);
map_register( 7, r9); r9_opr = LIR_OprFact::single_cpu(7);
map_register( 8, r11); r11_opr = LIR_OprFact::single_cpu(8);
- map_register( 9, r12); r12_opr = LIR_OprFact::single_cpu(9);
- map_register(10, r13); r13_opr = LIR_OprFact::single_cpu(10);
- map_register(11, r14); r14_opr = LIR_OprFact::single_cpu(11);
+ map_register( 9, r13); r13_opr = LIR_OprFact::single_cpu(9);
+ map_register(10, r14); r14_opr = LIR_OprFact::single_cpu(10);
+ // r12 is allocated conditionally. With compressed oops it holds
+ // the heapbase value and is not visible to the allocator.
+ map_register(11, r12); r12_opr = LIR_OprFact::single_cpu(11);
// The unallocatable registers are at the end
map_register(12, r10); r10_opr = LIR_OprFact::single_cpu(12);
map_register(13, r15); r15_opr = LIR_OprFact::single_cpu(13);
@@ -188,9 +193,9 @@ void FrameMap::initialize() {
_caller_save_cpu_regs[6] = r8_opr;
_caller_save_cpu_regs[7] = r9_opr;
_caller_save_cpu_regs[8] = r11_opr;
- _caller_save_cpu_regs[9] = r12_opr;
- _caller_save_cpu_regs[10] = r13_opr;
- _caller_save_cpu_regs[11] = r14_opr;
+ _caller_save_cpu_regs[9] = r13_opr;
+ _caller_save_cpu_regs[10] = r14_opr;
+ _caller_save_cpu_regs[11] = r12_opr;
#endif // _LP64
diff --git a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp
index c479663ca6e..642701c2831 100644
--- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_C1_FRAMEMAP_X86_HPP
+#define CPU_X86_VM_C1_FRAMEMAP_X86_HPP
+
// On i486 the frame looks as follows:
//
// +-----------------------------+---------+----------------------------------------+----------------+-----------
@@ -126,3 +129,16 @@
assert(i >= 0 && i < nof_caller_save_xmm_regs, "out of bounds");
return _caller_save_xmm_regs[i];
}
+
+ static int adjust_reg_range(int range) {
+ // Reduce the number of available regs (to free r12) in case of compressed oops
+ if (UseCompressedOops) return range - 1;
+ return range;
+ }
+
+ static int nof_caller_save_cpu_regs() { return adjust_reg_range(pd_nof_caller_save_cpu_regs_frame_map); }
+ static int last_cpu_reg() { return adjust_reg_range(pd_last_cpu_reg); }
+ static int last_byte_reg() { return adjust_reg_range(pd_last_byte_reg); }
+
+#endif // CPU_X86_VM_C1_FRAMEMAP_X86_HPP
+
diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
index e9ca3d885c7..724d8411bb5 100644
--- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
@@ -22,8 +22,20 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_c1_LIRAssembler_x86.cpp.incl"
+#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_interface/collectedHeap.hpp"
+#include "memory/barrierSet.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "runtime/sharedRuntime.hpp"
// These masks are used to provide 128-bit aligned bitmasks to the XMM
@@ -331,8 +343,8 @@ int LIR_Assembler::check_icache() {
Register receiver = FrameMap::receiver_opr->as_register();
Register ic_klass = IC_Klass;
const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9);
-
- if (!VerifyOops) {
+ const bool do_post_padding = VerifyOops || UseCompressedOops;
+ if (!do_post_padding) {
// insert some nops so that the verified entry point is aligned on CodeEntryAlignment
while ((__ offset() + ic_cmp_size) % CodeEntryAlignment != 0) {
__ nop();
@@ -340,8 +352,8 @@ int LIR_Assembler::check_icache() {
}
int offset = __ offset();
__ inline_cache_check(receiver, IC_Klass);
- assert(__ offset() % CodeEntryAlignment == 0 || VerifyOops, "alignment must be correct");
- if (VerifyOops) {
+ assert(__ offset() % CodeEntryAlignment == 0 || do_post_padding, "alignment must be correct");
+ if (do_post_padding) {
// force alignment after the cache check.
// It's been verified to be aligned if !VerifyOops
__ align(CodeEntryAlignment);
@@ -547,16 +559,16 @@ void LIR_Assembler::emit_string_compare(LIR_Opr arg0, LIR_Opr arg1, LIR_Opr dst,
__ movptr (rax, arg1->as_register());
// Get addresses of first characters from both Strings
- __ movptr (rsi, Address(rax, java_lang_String::value_offset_in_bytes()));
- __ movptr (rcx, Address(rax, java_lang_String::offset_offset_in_bytes()));
- __ lea (rsi, Address(rsi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
+ __ load_heap_oop(rsi, Address(rax, java_lang_String::value_offset_in_bytes()));
+ __ movptr (rcx, Address(rax, java_lang_String::offset_offset_in_bytes()));
+ __ lea (rsi, Address(rsi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
// rbx, may be NULL
add_debug_info_for_null_check_here(info);
- __ movptr (rdi, Address(rbx, java_lang_String::value_offset_in_bytes()));
- __ movptr (rcx, Address(rbx, java_lang_String::offset_offset_in_bytes()));
- __ lea (rdi, Address(rdi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
+ __ load_heap_oop(rdi, Address(rbx, java_lang_String::value_offset_in_bytes()));
+ __ movptr (rcx, Address(rbx, java_lang_String::offset_offset_in_bytes()));
+ __ lea (rdi, Address(rdi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
// compute minimum length (in rax) and difference of lengths (on top of stack)
if (VM_Version::supports_cmov()) {
@@ -684,13 +696,18 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod
LIR_Const* c = src->as_constant_ptr();
switch (c->type()) {
- case T_INT:
- case T_ADDRESS: {
+ case T_INT: {
assert(patch_code == lir_patch_none, "no patching handled here");
__ movl(dest->as_register(), c->as_jint());
break;
}
+ case T_ADDRESS: {
+ assert(patch_code == lir_patch_none, "no patching handled here");
+ __ movptr(dest->as_register(), c->as_jint());
+ break;
+ }
+
case T_LONG: {
assert(patch_code == lir_patch_none, "no patching handled here");
#ifdef _LP64
@@ -768,10 +785,13 @@ void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) {
switch (c->type()) {
case T_INT: // fall through
case T_FLOAT:
- case T_ADDRESS:
__ movl(frame_map()->address_for_slot(dest->single_stack_ix()), c->as_jint_bits());
break;
+ case T_ADDRESS:
+ __ movptr(frame_map()->address_for_slot(dest->single_stack_ix()), c->as_jint_bits());
+ break;
+
case T_OBJECT:
__ movoop(frame_map()->address_for_slot(dest->single_stack_ix()), c->as_jobject());
break;
@@ -794,7 +814,7 @@ void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) {
}
}
-void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info ) {
+void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info, bool wide) {
assert(src->is_constant(), "should not call otherwise");
assert(dest->is_address(), "should not call otherwise");
LIR_Const* c = src->as_constant_ptr();
@@ -804,14 +824,21 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi
switch (type) {
case T_INT: // fall through
case T_FLOAT:
- case T_ADDRESS:
__ movl(as_Address(addr), c->as_jint_bits());
break;
+ case T_ADDRESS:
+ __ movptr(as_Address(addr), c->as_jint_bits());
+ break;
+
case T_OBJECT: // fall through
case T_ARRAY:
if (c->as_jobject() == NULL) {
- __ movptr(as_Address(addr), NULL_WORD);
+ if (UseCompressedOops && !wide) {
+ __ movl(as_Address(addr), (int32_t)NULL_WORD);
+ } else {
+ __ movptr(as_Address(addr), NULL_WORD);
+ }
} else {
if (is_literal_address(addr)) {
ShouldNotReachHere();
@@ -819,8 +846,14 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi
} else {
#ifdef _LP64
__ movoop(rscratch1, c->as_jobject());
- null_check_here = code_offset();
- __ movptr(as_Address_lo(addr), rscratch1);
+ if (UseCompressedOops && !wide) {
+ __ encode_heap_oop(rscratch1);
+ null_check_here = code_offset();
+ __ movl(as_Address_lo(addr), rscratch1);
+ } else {
+ null_check_here = code_offset();
+ __ movptr(as_Address_lo(addr), rscratch1);
+ }
#else
__ movoop(as_Address(addr), c->as_jobject());
#endif
@@ -997,22 +1030,28 @@ void LIR_Assembler::reg2stack(LIR_Opr src, LIR_Opr dest, BasicType type, bool po
}
-void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool /* unaligned */) {
+void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool wide, bool /* unaligned */) {
LIR_Address* to_addr = dest->as_address_ptr();
PatchingStub* patch = NULL;
+ Register compressed_src = rscratch1;
if (type == T_ARRAY || type == T_OBJECT) {
__ verify_oop(src->as_register());
+#ifdef _LP64
+ if (UseCompressedOops && !wide) {
+ __ movptr(compressed_src, src->as_register());
+ __ encode_heap_oop(compressed_src);
+ }
+#endif
}
+
if (patch_code != lir_patch_none) {
patch = new PatchingStub(_masm, PatchingStub::access_field_id);
Address toa = as_Address(to_addr);
assert(toa.disp() != 0, "must have");
}
- if (info != NULL) {
- add_debug_info_for_null_check_here(info);
- }
+ int null_check_here = code_offset();
switch (type) {
case T_FLOAT: {
if (src->is_single_xmm()) {
@@ -1038,13 +1077,17 @@ void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
break;
}
- case T_ADDRESS: // fall through
case T_ARRAY: // fall through
case T_OBJECT: // fall through
-#ifdef _LP64
+ if (UseCompressedOops && !wide) {
+ __ movl(as_Address(to_addr), compressed_src);
+ } else {
+ __ movptr(as_Address(to_addr), src->as_register());
+ }
+ break;
+ case T_ADDRESS:
__ movptr(as_Address(to_addr), src->as_register());
break;
-#endif // _LP64
case T_INT:
__ movl(as_Address(to_addr), src->as_register());
break;
@@ -1101,6 +1144,9 @@ void LIR_Assembler::reg2mem(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
default:
ShouldNotReachHere();
}
+ if (info != NULL) {
+ add_debug_info_for_null_check(null_check_here, info);
+ }
if (patch_code != lir_patch_none) {
patching_epilog(patch, patch_code, to_addr->base()->as_register(), info);
@@ -1184,7 +1230,7 @@ void LIR_Assembler::stack2stack(LIR_Opr src, LIR_Opr dest, BasicType type) {
}
-void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool /* unaligned */) {
+void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool wide, bool /* unaligned */) {
assert(src->is_address(), "should not call otherwise");
assert(dest->is_register(), "should not call otherwise");
@@ -1238,13 +1284,18 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
break;
}
- case T_ADDRESS: // fall through
case T_OBJECT: // fall through
case T_ARRAY: // fall through
-#ifdef _LP64
+ if (UseCompressedOops && !wide) {
+ __ movl(dest->as_register(), from_addr);
+ } else {
+ __ movptr(dest->as_register(), from_addr);
+ }
+ break;
+
+ case T_ADDRESS:
__ movptr(dest->as_register(), from_addr);
break;
-#endif // _L64
case T_INT:
__ movl(dest->as_register(), from_addr);
break;
@@ -1339,6 +1390,11 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
}
if (type == T_ARRAY || type == T_OBJECT) {
+#ifdef _LP64
+ if (UseCompressedOops && !wide) {
+ __ decode_heap_oop(dest->as_register());
+ }
+#endif
__ verify_oop(dest->as_register());
}
}
@@ -1660,11 +1716,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
ciMethod* method = op->profiled_method();
assert(method != NULL, "Should have method");
int bci = op->profiled_bci();
- md = method->method_data();
- if (md == NULL) {
- bailout("out of memory building methodDataOop");
- return;
- }
+ md = method->method_data_or_null();
+ assert(md != NULL, "Sanity");
data = md->bci_to_data(bci);
assert(data != NULL, "need data for type check");
assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check");
@@ -1678,7 +1731,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
} else if (obj == klass_RInfo) {
klass_RInfo = dst;
}
- if (k->is_loaded()) {
+ if (k->is_loaded() && !UseCompressedOops) {
select_different_registers(obj, dst, k_RInfo, klass_RInfo);
} else {
Rtmp1 = op->tmp3()->as_register();
@@ -1715,21 +1768,26 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
if (op->fast_check()) {
// get object class
// not a safepoint as obj null check happens earlier
- if (k->is_loaded()) {
#ifdef _LP64
- __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));
-#else
- __ cmpoop(Address(obj, oopDesc::klass_offset_in_bytes()), k->constant_encoding());
-#endif // _LP64
+ if (UseCompressedOops) {
+ __ load_klass(Rtmp1, obj);
+ __ cmpptr(k_RInfo, Rtmp1);
} else {
__ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));
}
+#else
+ if (k->is_loaded()) {
+ __ cmpoop(Address(obj, oopDesc::klass_offset_in_bytes()), k->constant_encoding());
+ } else {
+ __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));
+ }
+#endif
__ jcc(Assembler::notEqual, *failure_target);
// successful cast, fall through to profile or jump
} else {
// get object class
// not a safepoint as obj null check happens earlier
- __ movptr(klass_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));
+ __ load_klass(klass_RInfo, obj);
if (k->is_loaded()) {
// See if we get an immediate positive hit
#ifdef _LP64
@@ -1784,7 +1842,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
Register mdo = klass_RInfo, recv = k_RInfo;
__ bind(profile_cast_success);
__ movoop(mdo, md->constant_encoding());
- __ movptr(recv, Address(obj, oopDesc::klass_offset_in_bytes()));
+ __ load_klass(recv, obj);
Label update_done;
type_profile_helper(mdo, md, data, recv, success);
__ jmp(*success);
@@ -1818,11 +1876,8 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
ciMethod* method = op->profiled_method();
assert(method != NULL, "Should have method");
int bci = op->profiled_bci();
- md = method->method_data();
- if (md == NULL) {
- bailout("out of memory building methodDataOop");
- return;
- }
+ md = method->method_data_or_null();
+ assert(md != NULL, "Sanity");
data = md->bci_to_data(bci);
assert(data != NULL, "need data for type check");
assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check");
@@ -1848,10 +1903,10 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
}
add_debug_info_for_null_check_here(op->info_for_exception());
- __ movptr(k_RInfo, Address(array, oopDesc::klass_offset_in_bytes()));
- __ movptr(klass_RInfo, Address(value, oopDesc::klass_offset_in_bytes()));
+ __ load_klass(k_RInfo, array);
+ __ load_klass(klass_RInfo, value);
- // get instance klass
+ // get instance klass (it's already uncompressed)
__ movptr(k_RInfo, Address(k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc)));
// perform the fast part of the checking logic
__ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, NULL);
@@ -1870,7 +1925,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
Register mdo = klass_RInfo, recv = k_RInfo;
__ bind(profile_cast_success);
__ movoop(mdo, md->constant_encoding());
- __ movptr(recv, Address(value, oopDesc::klass_offset_in_bytes()));
+ __ load_klass(recv, value);
Label update_done;
type_profile_helper(mdo, md, data, recv, &done);
__ jmpb(done);
@@ -1934,12 +1989,31 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
assert(cmpval != newval, "cmp and new values must be in different registers");
assert(cmpval != addr, "cmp and addr must be in different registers");
assert(newval != addr, "new value and addr must be in different registers");
- if (os::is_MP()) {
- __ lock();
- }
+
if ( op->code() == lir_cas_obj) {
- __ cmpxchgptr(newval, Address(addr, 0));
- } else if (op->code() == lir_cas_int) {
+#ifdef _LP64
+ if (UseCompressedOops) {
+ __ encode_heap_oop(cmpval);
+ __ mov(rscratch1, newval);
+ __ encode_heap_oop(rscratch1);
+ if (os::is_MP()) {
+ __ lock();
+ }
+ // cmpval (rax) is implicitly used by this instruction
+ __ cmpxchgl(rscratch1, Address(addr, 0));
+ } else
+#endif
+ {
+ if (os::is_MP()) {
+ __ lock();
+ }
+ __ cmpxchgptr(newval, Address(addr, 0));
+ }
+ } else {
+ assert(op->code() == lir_cas_int, "lir_cas_int expected");
+ if (os::is_MP()) {
+ __ lock();
+ }
__ cmpxchgl(newval, Address(addr, 0));
}
#ifdef _LP64
@@ -3181,8 +3255,13 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
}
if (flags & LIR_OpArrayCopy::type_check) {
- __ movptr(tmp, src_klass_addr);
- __ cmpptr(tmp, dst_klass_addr);
+ if (UseCompressedOops) {
+ __ movl(tmp, src_klass_addr);
+ __ cmpl(tmp, dst_klass_addr);
+ } else {
+ __ movptr(tmp, src_klass_addr);
+ __ cmpptr(tmp, dst_klass_addr);
+ }
__ jcc(Assembler::notEqual, *stub->entry());
}
@@ -3197,13 +3276,23 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
// but not necessarily exactly of type default_type.
Label known_ok, halt;
__ movoop(tmp, default_type->constant_encoding());
+#ifdef _LP64
+ if (UseCompressedOops) {
+ __ encode_heap_oop(tmp);
+ }
+#endif
+
if (basic_type != T_OBJECT) {
- __ cmpptr(tmp, dst_klass_addr);
+
+ if (UseCompressedOops) __ cmpl(tmp, dst_klass_addr);
+ else __ cmpptr(tmp, dst_klass_addr);
__ jcc(Assembler::notEqual, halt);
- __ cmpptr(tmp, src_klass_addr);
+ if (UseCompressedOops) __ cmpl(tmp, src_klass_addr);
+ else __ cmpptr(tmp, src_klass_addr);
__ jcc(Assembler::equal, known_ok);
} else {
- __ cmpptr(tmp, dst_klass_addr);
+ if (UseCompressedOops) __ cmpl(tmp, dst_klass_addr);
+ else __ cmpptr(tmp, dst_klass_addr);
__ jcc(Assembler::equal, known_ok);
__ cmpptr(src, dst);
__ jcc(Assembler::equal, known_ok);
@@ -3277,11 +3366,8 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
int bci = op->profiled_bci();
// Update counter for all call types
- ciMethodData* md = method->method_data();
- if (md == NULL) {
- bailout("out of memory building methodDataOop");
- return;
- }
+ 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");
@@ -3332,7 +3418,7 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
}
}
} else {
- __ movptr(recv, Address(recv, oopDesc::klass_offset_in_bytes()));
+ __ load_klass(recv, recv);
Label update_done;
type_profile_helper(mdo, md, data, recv, &update_done);
// Receiver did not match any saved receiver and there is no empty row for it.
diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.hpp
index f1b0ed88021..daccb39e0f2 100644
--- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_C1_LIRASSEMBLER_X86_HPP
+#define CPU_X86_VM_C1_LIRASSEMBLER_X86_HPP
+
private:
Address::ScaleFactor array_element_size(BasicType type) const;
@@ -56,3 +59,5 @@ public:
exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(175),
deopt_handler_size = NOT_LP64(10) LP64_ONLY(17)
};
+
+#endif // CPU_X86_VM_C1_LIRASSEMBLER_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
index dd8bc8d9962..d792a0f62a6 100644
--- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
@@ -22,8 +22,20 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_c1_LIRGenerator_x86.cpp.incl"
+#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_x86.inline.hpp"
#ifdef ASSERT
#define __ gen()->lir(__FILE__, __LINE__)->
@@ -862,6 +874,10 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
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);
@@ -904,7 +920,6 @@ void LIRGenerator::do_ArrayCopy(Intrinsic* x) {
ciArrayKlass* expected_type;
arraycopy_helper(x, &flags, &expected_type);
- CodeEmitInfo* info = state_for(x, x->state()); // we may want to have stack (deoptimization?)
__ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(), length.result(), tmp, expected_type, flags, info); // does add_safepoint
}
@@ -1139,9 +1154,12 @@ void LIRGenerator::do_CheckCast(CheckCast* x) {
stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception);
}
LIR_Opr reg = rlock_result(x);
+ LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
+ if (!x->klass()->is_loaded() || UseCompressedOops) {
+ tmp3 = new_register(objectType);
+ }
__ checkcast(reg, obj.result(), x->klass(),
- new_register(objectType), new_register(objectType),
- !x->klass()->is_loaded() ? new_register(objectType) : LIR_OprFact::illegalOpr,
+ new_register(objectType), new_register(objectType), tmp3,
x->direct_compare(), info_for_exception, patching_info, stub,
x->profiled_method(), x->profiled_bci());
}
@@ -1158,9 +1176,12 @@ void LIRGenerator::do_InstanceOf(InstanceOf* x) {
patching_info = state_for(x, x->state_before());
}
obj.load_item();
+ LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
+ if (!x->klass()->is_loaded() || UseCompressedOops) {
+ tmp3 = new_register(objectType);
+ }
__ instanceof(reg, obj.result(), x->klass(),
- new_register(objectType), new_register(objectType),
- !x->klass()->is_loaded() ? new_register(objectType) : LIR_OprFact::illegalOpr,
+ new_register(objectType), new_register(objectType), tmp3,
x->direct_compare(), patching_info, x->profiled_method(), x->profiled_bci());
}
diff --git a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp
index f1d005d6ace..0c19851b31f 100644
--- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_c1_LinearScan_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Instruction.hpp"
+#include "c1/c1_LinearScan.hpp"
+#include "utilities/bitMap.inline.hpp"
//----------------------------------------------------------------------
diff --git a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp
index 814d25eaf1a..efb2002fd65 100644
--- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,24 +22,26 @@
*
*/
+#ifndef CPU_X86_VM_C1_LINEARSCAN_X86_HPP
+#define CPU_X86_VM_C1_LINEARSCAN_X86_HPP
+
inline bool LinearScan::is_processed_reg_num(int reg_num) {
#ifndef _LP64
// rsp and rbp (numbers 6 ancd 7) are ignored
assert(FrameMap::rsp_opr->cpu_regnr() == 6, "wrong assumption below");
assert(FrameMap::rbp_opr->cpu_regnr() == 7, "wrong assumption below");
assert(reg_num >= 0, "invalid reg_num");
-
- return reg_num < 6 || reg_num > 7;
#else
- // rsp and rbp, r10, r15 (numbers 6 ancd 7) are ignored
+ // rsp and rbp, r10, r15 (numbers [12,15]) are ignored
+ // r12 (number 11) is conditional on compressed oops.
+ assert(FrameMap::r12_opr->cpu_regnr() == 11, "wrong assumption below");
assert(FrameMap::r10_opr->cpu_regnr() == 12, "wrong assumption below");
assert(FrameMap::r15_opr->cpu_regnr() == 13, "wrong assumption below");
assert(FrameMap::rsp_opr->cpu_regnrLo() == 14, "wrong assumption below");
assert(FrameMap::rbp_opr->cpu_regnrLo() == 15, "wrong assumption below");
assert(reg_num >= 0, "invalid reg_num");
-
- return reg_num < 12 || reg_num > 15;
#endif // _LP64
+ return reg_num <= FrameMap::last_cpu_reg() || reg_num >= pd_nof_cpu_regs_frame_map;
}
inline int LinearScan::num_physical_regs(BasicType type) {
@@ -101,7 +103,7 @@ inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) {
if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::byte_reg)) {
assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only");
_first_reg = pd_first_byte_reg;
- _last_reg = pd_last_byte_reg;
+ _last_reg = FrameMap::last_byte_reg();
return true;
} else if ((UseSSE >= 1 && cur->type() == T_FLOAT) || (UseSSE >= 2 && cur->type() == T_DOUBLE)) {
_first_reg = pd_first_xmm_reg;
@@ -185,3 +187,5 @@ class FpuStackAllocator VALUE_OBJ_CLASS_SPEC {
FpuStackAllocator(Compilation* compilation, LinearScan* allocator);
void allocate();
};
+
+#endif // CPU_X86_VM_C1_LINEARSCAN_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp
index b3d8c1f2e66..48d117b3fd5 100644
--- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp
@@ -22,8 +22,18 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_c1_MacroAssembler_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_interface/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"
int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr, Register scratch, Label& slow_case) {
const int aligned_mask = BytesPerWord -1;
@@ -145,11 +155,26 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register
// This assumes that all prototype bits fit in an int32_t
movptr(Address(obj, oopDesc::mark_offset_in_bytes ()), (int32_t)(intptr_t)markOopDesc::prototype());
}
+#ifdef _LP64
+ if (UseCompressedOops) { // Take care not to kill klass
+ movptr(t1, klass);
+ encode_heap_oop_not_null(t1);
+ movl(Address(obj, oopDesc::klass_offset_in_bytes()), t1);
+ } else
+#endif
+ {
+ movptr(Address(obj, oopDesc::klass_offset_in_bytes()), klass);
+ }
- movptr(Address(obj, oopDesc::klass_offset_in_bytes()), klass);
if (len->is_valid()) {
movl(Address(obj, arrayOopDesc::length_offset_in_bytes()), len);
}
+#ifdef _LP64
+ else if (UseCompressedOops) {
+ xorptr(t1, t1);
+ store_klass_gap(obj, t1);
+ }
+#endif
}
@@ -220,7 +245,7 @@ void C1_MacroAssembler::allocate_object(Register obj, Register t1, Register t2,
void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2) {
assert((con_size_in_bytes & MinObjAlignmentInBytesMask) == 0,
"con_size_in_bytes is not multiple of alignment");
- const int hdr_size_in_bytes = instanceOopDesc::base_offset_in_bytes();
+ const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize;
initialize_header(obj, klass, noreg, t1, t2);
@@ -307,13 +332,19 @@ void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
// check against inline cache
assert(!MacroAssembler::needs_explicit_null_check(oopDesc::klass_offset_in_bytes()), "must add explicit null check");
int start_offset = offset();
- cmpptr(iCache, Address(receiver, oopDesc::klass_offset_in_bytes()));
+
+ if (UseCompressedOops) {
+ load_klass(rscratch1, receiver);
+ cmpptr(rscratch1, iCache);
+ } else {
+ cmpptr(iCache, Address(receiver, oopDesc::klass_offset_in_bytes()));
+ }
// if icache check fails, then jump to runtime routine
// Note: RECEIVER must still contain the receiver!
jump_cc(Assembler::notEqual,
RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9);
- assert(offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry");
+ assert(UseCompressedOops || offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry");
}
diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp
index 56765a34f85..c53937c78a0 100644
--- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_C1_MACROASSEMBLER_X86_HPP
+#define CPU_X86_VM_C1_MACROASSEMBLER_X86_HPP
+
// C1_MacroAssembler contains high-level macros for C1
private:
@@ -113,3 +116,5 @@
}
void invalidate_registers(bool inv_rax, bool inv_rbx, bool inv_rcx, bool inv_rdx, bool inv_rsi, bool inv_rdi) PRODUCT_RETURN;
+
+#endif // CPU_X86_VM_C1_MACROASSEMBLER_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp
index 9c9341038ec..ce51fea3add 100644
--- a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp
@@ -22,8 +22,20 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_c1_Runtime1_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "c1/c1_Defs.hpp"
+#include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "register_x86.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/vframeArray.hpp"
+#include "vmreg_x86.inline.hpp"
// Implementation of StubAssembler
@@ -1249,7 +1261,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
// load the klass and check the has finalizer flag
Label register_finalizer;
Register t = rsi;
- __ movptr(t, Address(rax, oopDesc::klass_offset_in_bytes()));
+ __ load_klass(t, rax);
__ movl(t, Address(t, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc)));
__ testl(t, JVM_ACC_HAS_FINALIZER);
__ jcc(Assembler::notZero, register_finalizer);
diff --git a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp
index f3700f33c7b..d6a5cc45c10 100644
--- a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_X86_VM_C1_GLOBALS_X86_HPP
+#define CPU_X86_VM_C1_GLOBALS_X86_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)
@@ -60,3 +66,5 @@ define_pd_global(bool, CSEArrayLength, false);
define_pd_global(bool, TwoOperandLIRForm, true );
define_pd_global(intx, SafepointPollOffset, 256 );
+
+#endif // CPU_X86_VM_C1_GLOBALS_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp
index ae3029c4064..f41d722b42f 100644
--- a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_X86_VM_C2_GLOBALS_X86_HPP
+#define CPU_X86_VM_C2_GLOBALS_X86_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
// Sets the default values for platform dependent flags used by the server compiler.
// (see c2_globals.hpp). Alpha-sorted.
@@ -87,3 +93,5 @@ define_pd_global(uintx,MaxPermSize, ScaleForWordSize(64*M));
// Ergonomics related flags
define_pd_global(bool, NeverActAsServerClassMachine, false);
+
+#endif // CPU_X86_VM_C2_GLOBALS_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/c2_init_x86.cpp b/hotspot/src/cpu/x86/vm/c2_init_x86.cpp
index 2d54e39c3d0..286fec21376 100644
--- a/hotspot/src/cpu/x86/vm/c2_init_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c2_init_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,8 +22,9 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_c2_init_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/compile.hpp"
+#include "opto/node.hpp"
// processor dependent initialization for i486
diff --git a/hotspot/src/cpu/x86/vm/codeBuffer_x86.hpp b/hotspot/src/cpu/x86/vm/codeBuffer_x86.hpp
index 3b304a2b031..7f20314ffca 100644
--- a/hotspot/src/cpu/x86/vm/codeBuffer_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/codeBuffer_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,13 @@
*
*/
+#ifndef CPU_X86_VM_CODEBUFFER_X86_HPP
+#define CPU_X86_VM_CODEBUFFER_X86_HPP
+
private:
void pd_initialize() {}
public:
void flush_bundle(bool start_new_bundle) {}
+
+#endif // CPU_X86_VM_CODEBUFFER_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/copy_x86.hpp b/hotspot/src/cpu/x86/vm/copy_x86.hpp
index 32229c5a695..dbadb0e9f9e 100644
--- a/hotspot/src/cpu/x86/vm/copy_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/copy_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,10 +22,22 @@
*
*/
+#ifndef CPU_X86_VM_COPY_X86_HPP
+#define CPU_X86_VM_COPY_X86_HPP
+
// Inline functions for memory copy and fill.
// Contains inline asm implementations
-#include "incls/_copy_pd.inline.hpp.incl"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "copy_linux_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "copy_solaris_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "copy_windows_x86.inline.hpp"
+#endif
+
static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) {
#ifdef AMD64
@@ -58,3 +70,5 @@ static void pd_zero_to_words(HeapWord* tohw, size_t count) {
static void pd_zero_to_bytes(void* to, size_t count) {
(void)memset(to, 0, count);
}
+
+#endif // CPU_X86_VM_COPY_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp
index a6d1596911c..8f5bdd7d4ab 100644
--- a/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP
+#define CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP
+
protected:
#if 0
@@ -45,3 +48,5 @@
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
index e68219ec2cb..936bde4d811 100644
--- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,8 +22,32 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_cppInterpreter_x86.cpp.incl"
+#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 "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.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"
+#ifdef SHARK
+#include "shark/shark_globals.hpp"
+#endif
#ifdef CC_INTERP
diff --git a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp
index 6fda06cb3fe..797fcebe385 100644
--- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_CPPINTERPRETER_X86_HPP
+#define CPU_X86_VM_CPPINTERPRETER_X86_HPP
+
protected:
@@ -31,3 +34,5 @@
// 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/debug_x86.cpp b/hotspot/src/cpu/x86/vm/debug_x86.cpp
index 0169c28395e..b128439ef23 100644
--- a/hotspot/src/cpu/x86/vm/debug_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/debug_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,13 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_debug_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/nmethod.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/init.hpp"
+#include "runtime/os.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/top.hpp"
void pd_ps(frame f) {}
diff --git a/hotspot/src/cpu/x86/vm/depChecker_x86.cpp b/hotspot/src/cpu/x86/vm/depChecker_x86.cpp
index 9277100d15f..f00d6453137 100644
--- a/hotspot/src/cpu/x86/vm/depChecker_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/depChecker_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,7 +22,8 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_depChecker_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "compiler/disassembler.hpp"
+#include "depChecker_x86.hpp"
// Nothing to do on i486
diff --git a/hotspot/src/cpu/x86/vm/depChecker_x86.hpp b/hotspot/src/cpu/x86/vm/depChecker_x86.hpp
index a9aeec14d8a..5654bbd12d4 100644
--- a/hotspot/src/cpu/x86/vm/depChecker_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/depChecker_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,4 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_DEPCHECKER_X86_HPP
+#define CPU_X86_VM_DEPCHECKER_X86_HPP
+
// Nothing to do on i486
+
+#endif // CPU_X86_VM_DEPCHECKER_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/disassembler_x86.hpp b/hotspot/src/cpu/x86/vm/disassembler_x86.hpp
index d597da8bbe2..a3b74bac422 100644
--- a/hotspot/src/cpu/x86/vm/disassembler_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/disassembler_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_DISASSEMBLER_X86_HPP
+#define CPU_X86_VM_DISASSEMBLER_X86_HPP
+
static int pd_instruction_alignment() {
return 1;
}
@@ -29,3 +32,5 @@
static const char* pd_cpu_opts() {
return "";
}
+
+#endif // CPU_X86_VM_DISASSEMBLER_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/dump_x86_32.cpp b/hotspot/src/cpu/x86/vm/dump_x86_32.cpp
index 057d47db1e8..a9e9ff0d91f 100644
--- a/hotspot/src/cpu/x86/vm/dump_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/dump_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -22,8 +22,11 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_dump_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "memory/compactingPermGenGen.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/space.inline.hpp"
diff --git a/hotspot/src/cpu/x86/vm/dump_x86_64.cpp b/hotspot/src/cpu/x86/vm/dump_x86_64.cpp
index cc3a4ade2d2..b74d2ed72d0 100644
--- a/hotspot/src/cpu/x86/vm/dump_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/dump_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -22,8 +22,11 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_dump_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "memory/compactingPermGenGen.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/space.inline.hpp"
diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp
index a41ff1dbe3a..8f1585fb9fc 100644
--- a/hotspot/src/cpu/x86/vm/frame_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp
@@ -22,8 +22,24 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_frame_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/monitorChunk.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "vmreg_x86.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#include "runtime/vframeArray.hpp"
+#endif
#ifdef ASSERT
void RegisterMap::check_location_valid() {
diff --git a/hotspot/src/cpu/x86/vm/frame_x86.hpp b/hotspot/src/cpu/x86/vm/frame_x86.hpp
index 8bb73797ba4..d949e250c59 100644
--- a/hotspot/src/cpu/x86/vm/frame_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/frame_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_X86_VM_FRAME_X86_HPP
+#define CPU_X86_VM_FRAME_X86_HPP
+
+#include "runtime/synchronizer.hpp"
+#include "utilities/top.hpp"
+
// A frame represents a physical stack frame (an activation). Frames can be
// C or Java frames, and the Java frames can be interpreted or compiled.
// In contrast, vframes represent source-level activations, so that one physical frame
@@ -199,3 +205,5 @@
#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 0f4881c2b9a..bb9ac15cb31 100644
--- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp
+++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_FRAME_X86_INLINE_HPP
+#define CPU_X86_VM_FRAME_X86_INLINE_HPP
+
// Inline functions for Intel frames:
// Constructors:
@@ -296,3 +299,5 @@ inline oop frame::saved_oop_result(RegisterMap* map) const {
inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
*((oop*) map->location(rax->as_VMReg())) = obj;
}
+
+#endif // CPU_X86_VM_FRAME_X86_INLINE_HPP
diff --git a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp
index 3a339086201..1c032e632b2 100644
--- a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,4 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP
+#define CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP
+
const int StackAlignmentInBytes = 16;
+
+#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 e62e6748210..41917378b56 100644
--- a/hotspot/src/cpu/x86/vm/globals_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_X86_VM_GLOBALS_X86_HPP
+#define CPU_X86_VM_GLOBALS_X86_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)
@@ -65,3 +71,5 @@ define_pd_global(bool, RewriteBytecodes, true);
define_pd_global(bool, RewriteFrequentPairs, true);
define_pd_global(bool, UseMembar, false);
+
+#endif // CPU_X86_VM_GLOBALS_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp b/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp
index a21a764d625..992a67947cf 100644
--- a/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,16 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_icBuffer_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "code/icBuffer.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/resourceArea.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
int InlineCacheBuffer::ic_stub_code_size() {
return NativeMovConstReg::instruction_size +
diff --git a/hotspot/src/cpu/x86/vm/icache_x86.cpp b/hotspot/src/cpu/x86/vm/icache_x86.cpp
index a03d9a32945..91d4f4da1c1 100644
--- a/hotspot/src/cpu/x86/vm/icache_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/icache_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_icache_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "runtime/icache.hpp"
#define __ _masm->
diff --git a/hotspot/src/cpu/x86/vm/icache_x86.hpp b/hotspot/src/cpu/x86/vm/icache_x86.hpp
index 3c446979d87..e02b1031073 100644
--- a/hotspot/src/cpu/x86/vm/icache_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/icache_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_ICACHE_X86_HPP
+#define CPU_X86_VM_ICACHE_X86_HPP
+
// Interface for updating the instruction cache. Whenever the VM modifies
// code, part of the processor instruction cache potentially has to be flushed.
@@ -53,3 +56,5 @@ class ICache : public AbstractICache {
};
#endif // AMD64
};
+
+#endif // CPU_X86_VM_ICACHE_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp
index 013c6c03739..6cc321b5576 100644
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp
@@ -22,8 +22,29 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_interp_masm_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "interp_masm_x86_32.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/sharedRuntime.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
// Implementation of InterpreterMacroAssembler
diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp
index 600f0566f7d..404b4d5723b 100644
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_X86_VM_INTERP_MASM_X86_32_HPP
+#define CPU_X86_VM_INTERP_MASM_X86_32_HPP
+
+#include "assembler_x86.inline.hpp"
+#include "interpreter/invocationCounter.hpp"
+
// This file specializes the assember with interpreter-specific macros
@@ -227,3 +233,5 @@ class InterpreterMacroAssembler: public MacroAssembler {
void notify_method_exit(TosState state, NotifyMethodExitMode mode);
};
+
+#endif // CPU_X86_VM_INTERP_MASM_X86_32_HPP
diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp
index 6392742aac5..a156d24d66a 100644
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp
@@ -22,8 +22,29 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_interp_masm_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "interp_masm_x86_64.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/sharedRuntime.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
// Implementation of InterpreterMacroAssembler
@@ -428,10 +449,9 @@ void InterpreterMacroAssembler::jump_from_interpreted(Register method, Register
// JVMTI events, such as single-stepping, are implemented partly by avoiding running
// compiled code in threads for which the event is enabled. Check here for
// interp_only_mode if these events CAN be enabled.
- get_thread(temp);
// interp_only is an int, on little endian it is sufficient to test the byte only
- // Is a cmpl faster (ce
- cmpb(Address(temp, JavaThread::interp_only_mode_offset()), 0);
+ // Is a cmpl faster?
+ cmpb(Address(r15_thread, JavaThread::interp_only_mode_offset()), 0);
jcc(Assembler::zero, run_compiled_code);
jmp(Address(method, methodOopDesc::interpreter_entry_offset()));
bind(run_compiled_code);
diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp
index 6f485952580..62539a73548 100644
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_X86_VM_INTERP_MASM_X86_64_HPP
+#define CPU_X86_VM_INTERP_MASM_X86_64_HPP
+
+#include "assembler_x86.inline.hpp"
+#include "interpreter/invocationCounter.hpp"
+
// This file specializes the assember with interpreter-specific macros
@@ -243,3 +249,5 @@ class InterpreterMacroAssembler: public MacroAssembler {
void notify_method_entry();
void notify_method_exit(TosState state, NotifyMethodExitMode mode);
};
+
+#endif // CPU_X86_VM_INTERP_MASM_X86_64_HPP
diff --git a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp
index e12ab0c850a..7f92fbd15c5 100644
--- a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP
+#define CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP
+
// Generation of Interpreter
//
@@ -41,3 +44,5 @@
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/interpreterRT_x86.hpp b/hotspot/src/cpu/x86/vm/interpreterRT_x86.hpp
index debe9c5c379..f35f0122d43 100644
--- a/hotspot/src/cpu/x86/vm/interpreterRT_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/interpreterRT_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,11 @@
*
*/
+#ifndef CPU_X86_VM_INTERPRETERRT_X86_HPP
+#define CPU_X86_VM_INTERPRETERRT_X86_HPP
+
+#include "memory/allocation.hpp"
+
// native method calls
class SignatureHandlerGenerator: public NativeSignatureIterator {
@@ -72,3 +77,5 @@ class SignatureHandlerGenerator: public NativeSignatureIterator {
static Register to();
static Register temp();
};
+
+#endif // CPU_X86_VM_INTERPRETERRT_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/interpreterRT_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreterRT_x86_32.cpp
index ab70515a69f..05b3ded09e1 100644
--- a/hotspot/src/cpu/x86/vm/interpreterRT_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/interpreterRT_x86_32.cpp
@@ -22,8 +22,17 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_interpreterRT_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/signature.hpp"
#define __ _masm->
diff --git a/hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp
index 1a362b7b9bf..c3a1f5413d1 100644
--- a/hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp
@@ -22,8 +22,17 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_interpreterRT_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/signature.hpp"
#define __ _masm->
diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86.hpp b/hotspot/src/cpu/x86/vm/interpreter_x86.hpp
index 7c0cd214ff9..105a4038ced 100644
--- a/hotspot/src/cpu/x86/vm/interpreter_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/interpreter_x86.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_INTERPRETER_X86_HPP
+#define CPU_X86_VM_INTERPRETER_X86_HPP
+
public:
// Sentinel placed in the code for interpreter returns so
@@ -44,3 +47,5 @@
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 0dc6ffab9a2..d5424c63c58 100644
--- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp
@@ -22,8 +22,32 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_interpreter_x86_32.cpp.incl"
+#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/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "prims/methodHandles.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"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
#define __ _masm->
diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp
index 4c221d9e97e..373379663a8 100644
--- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,8 +22,32 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_interpreter_x86_64.cpp.incl"
+#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/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "prims/methodHandles.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"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
#define __ _masm->
diff --git a/hotspot/src/cpu/x86/vm/javaFrameAnchor_x86.hpp b/hotspot/src/cpu/x86/vm/javaFrameAnchor_x86.hpp
index d78bead14cb..77298e53770 100644
--- a/hotspot/src/cpu/x86/vm/javaFrameAnchor_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/javaFrameAnchor_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_JAVAFRAMEANCHOR_X86_HPP
+#define CPU_X86_VM_JAVAFRAMEANCHOR_X86_HPP
+
private:
// FP value associated with _last_Java_sp:
@@ -79,3 +82,5 @@ public:
intptr_t* last_Java_fp(void) { return _last_Java_fp; }
// Assert (last_Java_sp == NULL || fp == NULL)
void set_last_Java_fp(intptr_t* fp) { _last_Java_fp = fp; }
+
+#endif // CPU_X86_VM_JAVAFRAMEANCHOR_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp
index 0a63657dcb4..57edd9b195b 100644
--- a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp
@@ -22,8 +22,12 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_jniFastGetField_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm_misc.hpp"
+#include "runtime/safepoint.hpp"
#define __ masm->
diff --git a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp
index f07ae42e1a8..8b0d2e6fa6f 100644
--- a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp
@@ -22,8 +22,12 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_jniFastGetField_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm_misc.hpp"
+#include "runtime/safepoint.hpp"
#define __ masm->
diff --git a/hotspot/src/cpu/x86/vm/jniTypes_x86.hpp b/hotspot/src/cpu/x86/vm/jniTypes_x86.hpp
index d858ad136ef..170cd6e3adc 100644
--- a/hotspot/src/cpu/x86/vm/jniTypes_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/jniTypes_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,13 @@
*
*/
+#ifndef CPU_X86_VM_JNITYPES_X86_HPP
+#define CPU_X86_VM_JNITYPES_X86_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/oop.hpp"
+#include "prims/jni.h"
+
// This file holds platform-dependent routines used to write primitive jni
// types to the array of arguments passed into JavaCalls::call
@@ -122,3 +129,5 @@ public:
static inline jdouble get_double(intptr_t *from) { return *(jdouble *)(from + _JNI_SLOT_OFFSET); }
#undef _JNI_SLOT_OFFSET
};
+
+#endif // CPU_X86_VM_JNITYPES_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/jni_x86.h b/hotspot/src/cpu/x86/vm/jni_x86.h
index 887afbdd099..c6d322f2b24 100644
--- a/hotspot/src/cpu/x86/vm/jni_x86.h
+++ b/hotspot/src/cpu/x86/vm/jni_x86.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
diff --git a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp
index 0a65e5a29f1..5c707fec000 100644
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp
@@ -22,8 +22,10 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_methodHandles_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/allocation.inline.hpp"
+#include "prims/methodHandles.hpp"
#define __ _masm->
diff --git a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp
index 1c68f604864..7ec07737f61 100644
--- a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,18 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_nativeInst_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/ostream.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
void NativeInstruction::wrote(int offset) {
ICache::invalidate_word(addr_at(offset));
diff --git a/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp b/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp
index b99aacab5fd..d41bcccdb31 100644
--- a/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,15 @@
*
*/
+#ifndef CPU_X86_VM_NATIVEINST_X86_HPP
+#define CPU_X86_VM_NATIVEINST_X86_HPP
+
+#include "asm/assembler.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/os.hpp"
+#include "utilities/top.hpp"
+
// We have interfaces for the following instructions:
// - NativeInstruction
// - - NativeCall
@@ -547,3 +556,5 @@ inline bool NativeInstruction::is_mov_literal64() {
return false;
#endif // AMD64
}
+
+#endif // CPU_X86_VM_NATIVEINST_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/registerMap_x86.hpp b/hotspot/src/cpu/x86/vm/registerMap_x86.hpp
index 7087589a160..5d91b1ba755 100644
--- a/hotspot/src/cpu/x86/vm/registerMap_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/registerMap_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_REGISTERMAP_X86_HPP
+#define CPU_X86_VM_REGISTERMAP_X86_HPP
+
// machine-dependent implemention for register maps
friend class frame;
@@ -37,3 +40,5 @@
void pd_clear() {}
void pd_initialize() {}
void pd_initialize_from(const RegisterMap* map) {}
+
+#endif // CPU_X86_VM_REGISTERMAP_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp b/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp
index ee19fdd26cc..f1fd229b96b 100644
--- a/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp
@@ -22,8 +22,16 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_register_definitions_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "asm/register.hpp"
+#include "register_x86.hpp"
+#ifdef TARGET_ARCH_MODEL_x86_32
+# include "interp_masm_x86_32.hpp"
+#endif
+#ifdef TARGET_ARCH_MODEL_x86_64
+# include "interp_masm_x86_64.hpp"
+#endif
REGISTER_DEFINITION(Register, noreg);
REGISTER_DEFINITION(Register, rax);
diff --git a/hotspot/src/cpu/x86/vm/register_x86.cpp b/hotspot/src/cpu/x86/vm/register_x86.cpp
index c5ada7d9a93..a6301eafe4d 100644
--- a/hotspot/src/cpu/x86/vm/register_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/register_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_register_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "register_x86.hpp"
+
#ifndef AMD64
const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers;
#else
diff --git a/hotspot/src/cpu/x86/vm/register_x86.hpp b/hotspot/src/cpu/x86/vm/register_x86.hpp
index 846f65a8cef..2f4cd0dcac6 100644
--- a/hotspot/src/cpu/x86/vm/register_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/register_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_X86_VM_REGISTER_X86_HPP
+#define CPU_X86_VM_REGISTER_X86_HPP
+
+#include "asm/register.hpp"
+#include "vm_version_x86.hpp"
+
class VMRegImpl;
typedef VMRegImpl* VMReg;
@@ -219,3 +225,5 @@ class ConcreteRegisterImpl : public AbstractRegisterImpl {
static const int max_xmm;
};
+
+#endif // CPU_X86_VM_REGISTER_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp b/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp
index 0c49edf39e8..97e3645bd3c 100644
--- a/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,8 +22,13 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_relocInfo_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.inline.hpp"
+#include "assembler_x86.inline.hpp"
+#include "code/relocInfo.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/safepoint.hpp"
void Relocation::pd_set_data_value(address x, intptr_t o) {
diff --git a/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp b/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp
index a27e4698cc9..32855b343c2 100644
--- a/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_RELOCINFO_X86_HPP
+#define CPU_X86_VM_RELOCINFO_X86_HPP
+
// machine-dependent parts of class relocInfo
private:
enum {
@@ -36,3 +39,5 @@
format_width = 2
#endif
};
+
+#endif // CPU_X86_VM_RELOCINFO_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp b/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp
index 9a32a67fe74..a541fa213c3 100644
--- a/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp
@@ -22,9 +22,23 @@
*
*/
+#include "precompiled.hpp"
+#ifdef COMPILER2
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/vmreg.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_x86.hpp"
+#include "opto/runtime.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "vmreg_x86.inline.hpp"
+#endif
-#include "incls/_precompiled.incl"
-#include "incls/_runtime_x86_32.cpp.incl"
#define __ masm->
diff --git a/hotspot/src/cpu/x86/vm/runtime_x86_64.cpp b/hotspot/src/cpu/x86/vm/runtime_x86_64.cpp
index 79fa77e62c0..8f53518bb4b 100644
--- a/hotspot/src/cpu/x86/vm/runtime_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/runtime_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,23 @@
*
*/
-#include "incls/_precompiled.incl"
+#include "precompiled.hpp"
+#ifdef COMPILER2
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/vmreg.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_x86.hpp"
+#include "opto/runtime.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/vframeArray.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "vmreg_x86.inline.hpp"
+#endif
+
// This file should really contain the code for generating the OptoRuntime
// exception_blob. However that code uses SimpleRuntimeFrame which only
diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
index 847e68fda37..5a34d46314c 100644
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
@@ -22,8 +22,24 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_sharedRuntime_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/vframeArray.hpp"
+#include "vmreg_x86.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
#define __ masm->
#ifdef COMPILER2
diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp
index 4f679636492..e3455dea520 100644
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp
@@ -22,8 +22,24 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_sharedRuntime_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/vframeArray.hpp"
+#include "vmreg_x86.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
DeoptimizationBlob *SharedRuntime::_deopt_blob;
#ifdef COMPILER2
diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp
index 9a7c6a022da..c3cf3f84835 100644
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp
@@ -22,8 +22,34 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_stubGenerator_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
// Declaration and definition of StubGenerator (no .hpp file).
// For a more detailed description of the stub routine structure
diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
index 57d3b5147d4..3d5bcc99bfb 100644
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
@@ -22,8 +22,34 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_stubGenerator_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_x86.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
// Declaration and definition of StubGenerator (no .hpp file).
// For a more detailed description of the stub routine structure
@@ -2171,9 +2197,6 @@ class StubGenerator: public StubCodeGenerator {
__ enter(); // required for proper stackwalking of RuntimeStub frame
- checkcast_copy_entry = __ pc();
- BLOCK_COMMENT("Entry:");
-
#ifdef ASSERT
// caller guarantees that the arrays really are different
// otherwise, we would have to make conjoint checks
@@ -2184,26 +2207,28 @@ class StubGenerator: public StubCodeGenerator {
}
#endif //ASSERT
- // allocate spill slots for r13, r14
- enum {
- saved_r13_offset,
- saved_r14_offset,
- saved_rbp_offset,
- saved_rip_offset,
- saved_rarg0_offset
- };
- __ subptr(rsp, saved_rbp_offset * wordSize);
- __ movptr(Address(rsp, saved_r13_offset * wordSize), r13);
- __ movptr(Address(rsp, saved_r14_offset * wordSize), r14);
setup_arg_regs(4); // from => rdi, to => rsi, length => rdx
// ckoff => rcx, ckval => r8
// r9 and r10 may be used to save non-volatile registers
#ifdef _WIN64
// last argument (#4) is on stack on Win64
- const int ckval_offset = saved_rarg0_offset + 4;
- __ movptr(ckval, Address(rsp, ckval_offset * wordSize));
+ __ movptr(ckval, Address(rsp, 6 * wordSize));
#endif
+ // Caller of this entry point must set up the argument registers.
+ checkcast_copy_entry = __ pc();
+ BLOCK_COMMENT("Entry:");
+
+ // allocate spill slots for r13, r14
+ enum {
+ saved_r13_offset,
+ saved_r14_offset,
+ saved_rbp_offset
+ };
+ __ subptr(rsp, saved_rbp_offset * wordSize);
+ __ movptr(Address(rsp, saved_r13_offset * wordSize), r13);
+ __ movptr(Address(rsp, saved_r14_offset * wordSize), r14);
+
// check that int operands are properly extended to size_t
assert_clean_int(length, rax);
assert_clean_int(ckoff, rax);
@@ -2417,11 +2442,10 @@ class StubGenerator: public StubCodeGenerator {
const Register src_pos = c_rarg1; // source position
const Register dst = c_rarg2; // destination array oop
const Register dst_pos = c_rarg3; // destination position
- // elements count is on stack on Win64
-#ifdef _WIN64
-#define C_RARG4 Address(rsp, 6 * wordSize)
+#ifndef _WIN64
+ const Register length = c_rarg4;
#else
-#define C_RARG4 c_rarg4
+ const Address length(rsp, 6 * wordSize); // elements count is on stack on Win64
#endif
{ int modulus = CodeEntryAlignment;
@@ -2488,27 +2512,27 @@ class StubGenerator: public StubCodeGenerator {
// registers used as temp
const Register r11_length = r11; // elements count to copy
const Register r10_src_klass = r10; // array klass
- const Register r9_dst_klass = r9; // dest array klass
// if (length < 0) return -1;
- __ movl(r11_length, C_RARG4); // length (elements count, 32-bits value)
+ __ movl(r11_length, length); // length (elements count, 32-bits value)
__ testl(r11_length, r11_length);
__ jccb(Assembler::negative, L_failed_0);
__ load_klass(r10_src_klass, src);
#ifdef ASSERT
// assert(src->klass() != NULL);
- BLOCK_COMMENT("assert klasses not null");
- { Label L1, L2;
+ {
+ BLOCK_COMMENT("assert klasses not null {");
+ Label L1, L2;
__ testptr(r10_src_klass, r10_src_klass);
__ jcc(Assembler::notZero, L2); // it is broken if klass is NULL
__ bind(L1);
__ stop("broken null klass");
__ bind(L2);
- __ load_klass(r9_dst_klass, dst);
- __ cmpq(r9_dst_klass, 0);
+ __ load_klass(rax, dst);
+ __ cmpq(rax, 0);
__ jcc(Assembler::equal, L1); // this would be broken also
- BLOCK_COMMENT("assert done");
+ BLOCK_COMMENT("} assert klasses not null done");
}
#endif
@@ -2520,34 +2544,36 @@ class StubGenerator: public StubCodeGenerator {
// array_tag: typeArray = 0x3, objArray = 0x2, non-array = 0x0
//
- int lh_offset = klassOopDesc::header_size() * HeapWordSize +
- Klass::layout_helper_offset_in_bytes();
-
- const Register rax_lh = rax; // layout helper
-
- __ movl(rax_lh, Address(r10_src_klass, lh_offset));
+ const int lh_offset = klassOopDesc::header_size() * HeapWordSize +
+ Klass::layout_helper_offset_in_bytes();
// Handle objArrays completely differently...
- jint objArray_lh = Klass::array_layout_helper(T_OBJECT);
- __ cmpl(rax_lh, objArray_lh);
+ const jint objArray_lh = Klass::array_layout_helper(T_OBJECT);
+ __ cmpl(Address(r10_src_klass, lh_offset), objArray_lh);
__ jcc(Assembler::equal, L_objArray);
// if (src->klass() != dst->klass()) return -1;
- __ load_klass(r9_dst_klass, dst);
- __ cmpq(r10_src_klass, r9_dst_klass);
+ __ load_klass(rax, dst);
+ __ cmpq(r10_src_klass, rax);
__ jcc(Assembler::notEqual, L_failed);
+ const Register rax_lh = rax; // layout helper
+ __ movl(rax_lh, Address(r10_src_klass, lh_offset));
+
// if (!src->is_Array()) return -1;
__ cmpl(rax_lh, Klass::_lh_neutral_value);
__ jcc(Assembler::greaterEqual, L_failed);
// At this point, it is known to be a typeArray (array_tag 0x3).
#ifdef ASSERT
- { Label L;
+ {
+ BLOCK_COMMENT("assert primitive array {");
+ Label L;
__ cmpl(rax_lh, (Klass::_lh_array_tag_type_value << Klass::_lh_array_tag_shift));
__ jcc(Assembler::greaterEqual, L);
__ stop("must be a primitive array");
__ bind(L);
+ BLOCK_COMMENT("} assert primitive array done");
}
#endif
@@ -2605,11 +2631,14 @@ class StubGenerator: public StubCodeGenerator {
__ BIND(L_copy_longs);
#ifdef ASSERT
- { Label L;
+ {
+ BLOCK_COMMENT("assert long copy {");
+ Label L;
__ cmpl(rax_elsize, LogBytesPerLong);
__ jcc(Assembler::equal, 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::times_8, 0));// src_addr
@@ -2619,12 +2648,12 @@ class StubGenerator: public StubCodeGenerator {
// objArrayKlass
__ BIND(L_objArray);
- // live at this point: r10_src_klass, src[_pos], dst[_pos]
+ // live at this point: r10_src_klass, r11_length, src[_pos], dst[_pos]
Label L_plain_copy, L_checkcast_copy;
// test array classes for subtyping
- __ load_klass(r9_dst_klass, dst);
- __ cmpq(r10_src_klass, r9_dst_klass); // usual case is exact equality
+ __ load_klass(rax, dst);
+ __ cmpq(r10_src_klass, rax); // usual case is exact equality
__ jcc(Assembler::notEqual, L_checkcast_copy);
// Identically typed arrays can be copied without element-wise checks.
@@ -2640,41 +2669,33 @@ class StubGenerator: public StubCodeGenerator {
__ jump(RuntimeAddress(oop_copy_entry));
__ BIND(L_checkcast_copy);
- // live at this point: r10_src_klass, !r11_length
+ // live at this point: r10_src_klass, r11_length, rax (dst_klass)
{
- // assert(r11_length == C_RARG4); // will reload from here
- Register r11_dst_klass = r11;
- __ load_klass(r11_dst_klass, dst);
-
// Before looking at dst.length, make sure dst is also an objArray.
- __ cmpl(Address(r11_dst_klass, lh_offset), objArray_lh);
+ __ cmpl(Address(rax, lh_offset), objArray_lh);
__ jcc(Assembler::notEqual, L_failed);
// It is safe to examine both src.length and dst.length.
-#ifndef _WIN64
- arraycopy_range_checks(src, src_pos, dst, dst_pos, C_RARG4,
- rax, L_failed);
-#else
- __ movl(r11_length, C_RARG4); // reload
arraycopy_range_checks(src, src_pos, dst, dst_pos, r11_length,
rax, L_failed);
+
+ const Register r11_dst_klass = r11;
__ load_klass(r11_dst_klass, dst); // reload
-#endif
// Marshal the base address arguments now, freeing registers.
__ lea(from, Address(src, src_pos, TIMES_OOP,
arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
__ lea(to, Address(dst, dst_pos, TIMES_OOP,
arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
- __ movl(count, C_RARG4); // length (reloaded)
+ __ movl(count, length); // length (reloaded)
Register sco_temp = c_rarg3; // this register is free now
assert_different_registers(from, to, count, sco_temp,
r11_dst_klass, r10_src_klass);
assert_clean_int(count, sco_temp);
// Generate the type check.
- int sco_offset = (klassOopDesc::header_size() * HeapWordSize +
- Klass::super_check_offset_offset_in_bytes());
+ const int sco_offset = (klassOopDesc::header_size() * HeapWordSize +
+ Klass::super_check_offset_offset_in_bytes());
__ movl(sco_temp, Address(r11_dst_klass, sco_offset));
assert_clean_int(sco_temp, rax);
generate_type_check(r10_src_klass, sco_temp, r11_dst_klass, L_plain_copy);
@@ -2683,12 +2704,14 @@ class StubGenerator: public StubCodeGenerator {
int ek_offset = (klassOopDesc::header_size() * HeapWordSize +
objArrayKlass::element_klass_offset_in_bytes());
__ movptr(r11_dst_klass, Address(r11_dst_klass, ek_offset));
- __ movl(sco_temp, Address(r11_dst_klass, sco_offset));
+ __ movl( sco_temp, Address(r11_dst_klass, sco_offset));
assert_clean_int(sco_temp, rax);
// the checkcast_copy loop needs two extra arguments:
assert(c_rarg3 == sco_temp, "#3 already in place");
- __ movptr(C_RARG4, r11_dst_klass); // dst.klass.element_klass
+ // Set up arguments for checkcast_copy_entry.
+ setup_arg_regs(4);
+ __ movptr(r8, r11_dst_klass); // dst.klass.element_klass, r8 is c_rarg4 on Linux/Solaris
__ jump(RuntimeAddress(checkcast_copy_entry));
}
@@ -2701,8 +2724,6 @@ class StubGenerator: public StubCodeGenerator {
return start;
}
-#undef length_arg
-
void generate_arraycopy_stubs() {
// Call the conjoint generation methods immediately after
// the disjoint ones so that short branches from the former
diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp
index baf766d4df2..a04b3f29a1a 100644
--- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,19 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
// Implementation of the platform-specific part of StubRoutines - for
// a description of how to extend it, see the stubRoutines.hpp file.
diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp
index cfbd52fde9f..0a78618e1b0 100644
--- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp
+++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_STUBROUTINES_X86_32_HPP
+#define CPU_X86_VM_STUBROUTINES_X86_32_HPP
+
// This file holds the platform specific parts of the StubRoutines
// definition. See stubRoutines.hpp for a description on how to
// extend it.
@@ -60,3 +63,5 @@ class x86 {
static bool returns_to_call_stub(address return_pc) { return (return_pc == _call_stub_return_address) ||
return_pc == x86::get_call_stub_compiled_return(); }
+
+#endif // CPU_X86_VM_STUBROUTINES_X86_32_HPP
diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp
index c0588a322a4..caab63bfc1c 100644
--- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,8 +22,19 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "thread_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "thread_windows.inline.hpp"
+#endif
// Implementation of the platform-specific part of StubRoutines - for
// a description of how to extend it, see the stubRoutines.hpp file.
diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp
index 71a4115127b..b1726caa692 100644
--- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp
+++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_STUBROUTINES_X86_64_HPP
+#define CPU_X86_VM_STUBROUTINES_X86_64_HPP
+
// This file holds the platform specific parts of the StubRoutines
// definition. See stubRoutines.hpp for a description on how to
// extend it.
@@ -113,3 +116,5 @@ class x86 {
return _mxcsr_std;
}
};
+
+#endif // CPU_X86_VM_STUBROUTINES_X86_64_HPP
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp
index bcec7e124a2..60e95057cef 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,13 @@
*
*/
+#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/templateInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp
index a0e22b6af00..c828c90fba1 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP
+#define CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP
+
protected:
@@ -35,3 +38,5 @@
#else
const static int InterpreterCodeSize = 168 * 1024;
#endif // AMD64
+
+#endif // CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
index 513263486ec..ee518b31405 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
@@ -22,8 +22,28 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_templateInterpreter_x86_32.cpp.incl"
+#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/methodDataOop.hpp"
+#include "oops/methodOop.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"
#define __ _masm->
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
index b39c7f8575d..2d7aa60cfca 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
@@ -22,8 +22,28 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_interpreter_x86_64.cpp.incl"
+#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/methodDataOop.hpp"
+#include "oops/methodOop.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"
#define __ _masm->
@@ -1049,7 +1069,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
// runtime call by hand.
//
__ mov(c_rarg0, r15_thread);
- __ mov(r12, rsp); // remember sp
+ __ mov(r12, rsp); // remember sp (can only use r12 if not using call_VM)
__ subptr(rsp, frame::arg_reg_save_area_bytes); // windows
__ andptr(rsp, -16); // align stack as required by ABI
__ call(RuntimeAddress(CAST_FROM_FN_PTR(address, JavaThread::check_special_condition_for_native_trans)));
@@ -1096,7 +1116,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
__ jcc(Assembler::notEqual, no_reguard);
__ pusha(); // XXX only save smashed registers
- __ mov(r12, rsp); // remember sp
+ __ mov(r12, rsp); // remember sp (can only use r12 if not using call_VM)
__ subptr(rsp, frame::arg_reg_save_area_bytes); // windows
__ andptr(rsp, -16); // align stack as required by ABI
__ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::reguard_yellow_pages)));
@@ -1887,7 +1907,7 @@ void TemplateInterpreterGenerator::trace_bytecode(Template* t) {
assert(Interpreter::trace_code(t->tos_in()) != NULL,
"entry must have been generated");
- __ mov(r12, rsp); // remember sp
+ __ mov(r12, rsp); // remember sp (can only use r12 if not using call_VM)
__ andptr(rsp, -16); // align stack as required by ABI
__ call(RuntimeAddress(Interpreter::trace_code(t->tos_in())));
__ mov(rsp, r12); // restore sp
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
index cca834336db..898069bc948 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
@@ -22,8 +22,18 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_templateTable_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodDataOop.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"
#ifndef CC_INTERP
#define __ _masm->
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp
index 39652a59271..05293afe878 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_TEMPLATETABLE_X86_32_HPP
+#define CPU_X86_VM_TEMPLATETABLE_X86_32_HPP
+
static void prepare_invoke(Register method, Register index, int byte_no);
static void invokevirtual_helper(Register index, Register recv,
Register flags);
@@ -30,3 +33,5 @@
// Helpers
static void index_check(Register array, Register index);
static void index_check_without_pop(Register array, Register index);
+
+#endif // CPU_X86_VM_TEMPLATETABLE_X86_32_HPP
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
index dc16a49e340..a396e88da8b 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
@@ -22,8 +22,18 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_templateTable_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodDataOop.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"
#ifndef CC_INTERP
@@ -2752,7 +2762,7 @@ void TemplateTable::fast_accessfield(TosState state) {
// access constant pool cache entry
__ get_cache_entry_pointer_at_bcp(c_rarg2, rcx, 1);
__ verify_oop(rax);
- __ mov(r12, rax); // save object pointer before call_VM() clobbers it
+ __ push_ptr(rax); // save object pointer before call_VM() clobbers it
__ mov(c_rarg1, rax);
// c_rarg1: object pointer copied above
// c_rarg2: cache entry pointer
@@ -2760,8 +2770,7 @@ void TemplateTable::fast_accessfield(TosState state) {
CAST_FROM_FN_PTR(address,
InterpreterRuntime::post_field_access),
c_rarg1, c_rarg2);
- __ mov(rax, r12); // restore object pointer
- __ reinit_heapbase();
+ __ pop_ptr(rax); // restore object pointer
__ bind(L1);
}
@@ -3355,10 +3364,7 @@ void TemplateTable::checkcast() {
JVM_CONSTANT_Class);
__ jcc(Assembler::equal, quicked);
__ push(atos); // save receiver for result, and for GC
- __ mov(r12, rcx); // save rcx XXX
call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
- __ movq(rcx, r12); // restore rcx XXX
- __ reinit_heapbase();
__ pop_ptr(rdx); // restore receiver
__ jmpb(resolved);
@@ -3412,11 +3418,9 @@ void TemplateTable::instanceof() {
__ jcc(Assembler::equal, quicked);
__ push(atos); // save receiver for result, and for GC
- __ mov(r12, rcx); // save rcx
call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
- __ movq(rcx, r12); // restore rcx
- __ reinit_heapbase();
__ pop_ptr(rdx); // restore receiver
+ __ verify_oop(rdx);
__ load_klass(rdx, rdx);
__ jmpb(resolved);
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp
index fce09f5c4f1..922e49542e6 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_TEMPLATETABLE_X86_64_HPP
+#define CPU_X86_VM_TEMPLATETABLE_X86_64_HPP
+
static void prepare_invoke(Register method, Register index, int byte_no);
static void invokevirtual_helper(Register index, Register recv,
Register flags);
@@ -30,3 +33,5 @@
// Helpers
static void index_check(Register array, Register index);
static void index_check_without_pop(Register array, Register index);
+
+#endif // CPU_X86_VM_TEMPLATETABLE_X86_64_HPP
diff --git a/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp b/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp
index bb3c3b68db4..8dddc9c3e1d 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, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_VMSTRUCTS_X86_HPP
+#define CPU_X86_VM_VMSTRUCTS_X86_HPP
+
// These are the CPU-specific fields, types and integer
// constants required by the Serviceability Agent. This file is
// referenced by vmStructs.cpp.
@@ -60,3 +63,5 @@
/* NOTE that we do not use the last_entry() macro here; it is used */
/* in vmStructs__.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */
/* be present there) */
+
+#endif // CPU_X86_VM_VMSTRUCTS_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
index 887e71b79e7..df40c5638b7 100644
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
@@ -22,8 +22,21 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_x86.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/java.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "vm_version_x86.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
int VM_Version::_cpu;
diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp
index d33edb4d0a1..6f23cb0cada 100644
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef CPU_X86_VM_VM_VERSION_X86_HPP
+#define CPU_X86_VM_VM_VERSION_X86_HPP
+
+#include "runtime/globals_extension.hpp"
+#include "runtime/vm_version.hpp"
+
class VM_Version : public Abstract_VM_Version {
public:
// cpuid result register layouts. These are all unions of a uint32_t
@@ -520,3 +526,5 @@ public:
return count >= 0 ? count : 1;
}
};
+
+#endif // CPU_X86_VM_VM_VERSION_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.cpp b/hotspot/src/cpu/x86/vm/vmreg_x86.cpp
index 88f775c81b8..a0bfe6e69c1 100644
--- a/hotspot/src/cpu/x86/vm/vmreg_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/vmreg_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_vmreg_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "code/vmreg.hpp"
diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.hpp b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp
index 7195f3e1c36..38d47dccfc3 100644
--- a/hotspot/src/cpu/x86/vm/vmreg_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_VMREG_X86_HPP
+#define CPU_X86_VM_VMREG_X86_HPP
+
bool is_Register();
Register as_Register();
@@ -30,3 +33,5 @@
bool is_XMMRegister();
XMMRegister as_XMMRegister();
+
+#endif // CPU_X86_VM_VMREG_X86_HPP
diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp
index 8de4d0ea13d..88201bd3d83 100644
--- a/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp
+++ b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_X86_VM_VMREG_X86_INLINE_HPP
+#define CPU_X86_VM_VMREG_X86_INLINE_HPP
+
inline VMReg RegisterImpl::as_VMReg() {
if( this==noreg ) return VMRegImpl::Bad();
#ifdef AMD64
@@ -82,3 +85,5 @@ inline bool VMRegImpl::is_concrete() {
#endif // AMD64
return is_even(value());
}
+
+#endif // CPU_X86_VM_VMREG_X86_INLINE_HPP
diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp
index e6fe9dd381b..1517ca30bf3 100644
--- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,19 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_vtableStubs_x86_32.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "code/vtableStubs.hpp"
+#include "interp_masm_x86_32.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klassVtable.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_x86.inline.hpp"
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
// machine-dependent part of VtableStubs: create VtableStub of correct size and
// initialize its code
diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp
index 6a27f4fdeef..f12d85aa787 100644
--- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp
@@ -22,8 +22,19 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_vtableStubs_x86_64.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "code/vtableStubs.hpp"
+#include "interp_masm_x86_64.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klassVtable.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_x86.inline.hpp"
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
// machine-dependent part of VtableStubs: create VtableStub of correct size and
// initialize its code
diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad
index 21b6bf97bfe..b73bcda7fa9 100644
--- a/hotspot/src/cpu/x86/vm/x86_32.ad
+++ b/hotspot/src/cpu/x86/vm/x86_32.ad
@@ -506,6 +506,25 @@ void encode_CopyXD( CodeBuffer &cbuf, int dst_encoding, int src_encoding ) {
}
+//=============================================================================
+const bool Matcher::constant_table_absolute_addressing = true;
+const RegMask& MachConstantBaseNode::_out_RegMask = RegMask::Empty;
+
+void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
+ // Empty encoding
+}
+
+uint MachConstantBaseNode::size(PhaseRegAlloc* ra_) const {
+ return 0;
+}
+
+#ifndef PRODUCT
+void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
+ st->print("# MachConstantBaseNode (empty encoding)");
+}
+#endif
+
+
//=============================================================================
#ifndef PRODUCT
void MachPrologNode::format( PhaseRegAlloc *ra_, outputStream* st ) const {
@@ -1320,29 +1339,6 @@ int emit_deopt_handler(CodeBuffer& cbuf) {
}
-static void emit_double_constant(CodeBuffer& cbuf, double x) {
- int mark = cbuf.insts()->mark_off();
- MacroAssembler _masm(&cbuf);
- address double_address = __ double_constant(x);
- cbuf.insts()->set_mark_off(mark); // preserve mark across masm shift
- emit_d32_reloc(cbuf,
- (int)double_address,
- internal_word_Relocation::spec(double_address),
- RELOC_DISP32);
-}
-
-static void emit_float_constant(CodeBuffer& cbuf, float x) {
- int mark = cbuf.insts()->mark_off();
- MacroAssembler _masm(&cbuf);
- address float_address = __ float_constant(x);
- cbuf.insts()->set_mark_off(mark); // preserve mark across masm shift
- emit_d32_reloc(cbuf,
- (int)float_address,
- internal_word_Relocation::spec(float_address),
- RELOC_DISP32);
-}
-
-
const bool Matcher::match_rule_supported(int opcode) {
if (!has_match_rule(opcode))
return false;
@@ -1354,22 +1350,6 @@ int Matcher::regnum_to_fpu_offset(int regnum) {
return regnum - 32; // The FP registers are in the second chunk
}
-bool is_positive_zero_float(jfloat f) {
- return jint_cast(f) == jint_cast(0.0F);
-}
-
-bool is_positive_one_float(jfloat f) {
- return jint_cast(f) == jint_cast(1.0F);
-}
-
-bool is_positive_zero_double(jdouble d) {
- return jlong_cast(d) == jlong_cast(0.0);
-}
-
-bool is_positive_one_double(jdouble d) {
- return jlong_cast(d) == jlong_cast(1.0);
-}
-
// This is UltraSparc specific, true just means we have fast l2f conversion
const bool Matcher::convL2FSupported(void) {
return true;
@@ -2036,67 +2016,6 @@ encode %{
%}
- enc_class LdImmD (immD src) %{ // Load Immediate
- if( is_positive_zero_double($src$$constant)) {
- // FLDZ
- emit_opcode(cbuf,0xD9);
- emit_opcode(cbuf,0xEE);
- } else if( is_positive_one_double($src$$constant)) {
- // FLD1
- emit_opcode(cbuf,0xD9);
- emit_opcode(cbuf,0xE8);
- } else {
- emit_opcode(cbuf,0xDD);
- emit_rm(cbuf, 0x0, 0x0, 0x5);
- emit_double_constant(cbuf, $src$$constant);
- }
- %}
-
-
- enc_class LdImmF (immF src) %{ // Load Immediate
- if( is_positive_zero_float($src$$constant)) {
- emit_opcode(cbuf,0xD9);
- emit_opcode(cbuf,0xEE);
- } else if( is_positive_one_float($src$$constant)) {
- emit_opcode(cbuf,0xD9);
- emit_opcode(cbuf,0xE8);
- } else {
- $$$emit8$primary;
- // Load immediate does not have a zero or sign extended version
- // for 8-bit immediates
- // First load to TOS, then move to dst
- emit_rm(cbuf, 0x0, 0x0, 0x5);
- emit_float_constant(cbuf, $src$$constant);
- }
- %}
-
- enc_class LdImmX (regX dst, immXF con) %{ // Load Immediate
- emit_rm(cbuf, 0x0, $dst$$reg, 0x5);
- emit_float_constant(cbuf, $con$$constant);
- %}
-
- enc_class LdImmXD (regXD dst, immXD con) %{ // Load Immediate
- emit_rm(cbuf, 0x0, $dst$$reg, 0x5);
- emit_double_constant(cbuf, $con$$constant);
- %}
-
- enc_class load_conXD (regXD dst, immXD con) %{ // Load double constant
- // UseXmmLoadAndClearUpper ? movsd(dst, con) : movlpd(dst, con)
- emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0xF2 : 0x66);
- emit_opcode(cbuf, 0x0F);
- emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0x10 : 0x12);
- emit_rm(cbuf, 0x0, $dst$$reg, 0x5);
- emit_double_constant(cbuf, $con$$constant);
- %}
-
- enc_class Opc_MemImm_F(immF src) %{
- cbuf.set_insts_mark();
- $$$emit8$primary;
- emit_rm(cbuf, 0x0, $secondary, 0x5);
- emit_float_constant(cbuf, $src$$constant);
- %}
-
-
enc_class MovI2X_reg(regX dst, eRegI src) %{
emit_opcode(cbuf, 0x66 ); // MOVD dst,src
emit_opcode(cbuf, 0x0F );
@@ -4801,7 +4720,7 @@ operand immD0() %{
interface(CONST_INTER);
%}
-// Double Immediate
+// Double Immediate one
operand immD1() %{
predicate( UseSSE<=1 && n->getd() == 1.0 );
match(ConD);
@@ -4844,7 +4763,17 @@ operand immXD0() %{
// Float Immediate zero
operand immF0() %{
- predicate( UseSSE == 0 && n->getf() == 0.0 );
+ predicate(UseSSE == 0 && n->getf() == 0.0F);
+ match(ConF);
+
+ op_cost(5);
+ format %{ %}
+ interface(CONST_INTER);
+%}
+
+// Float Immediate one
+operand immF1() %{
+ predicate(UseSSE == 0 && n->getf() == 1.0F);
match(ConF);
op_cost(5);
@@ -7215,24 +7144,53 @@ instruct loadConL0(eRegL dst, immL0 src, eFlagsReg cr) %{
%}
// The instruction usage is guarded by predicate in operand immF().
-instruct loadConF(regF dst, immF src) %{
- match(Set dst src);
+instruct loadConF(regF dst, immF con) %{
+ match(Set dst con);
ins_cost(125);
-
- format %{ "FLD_S ST,$src\n\t"
+ format %{ "FLD_S ST,[$constantaddress]\t# load from constant table: float=$con\n\t"
"FSTP $dst" %}
- opcode(0xD9, 0x00); /* D9 /0 */
- ins_encode(LdImmF(src), Pop_Reg_F(dst) );
- ins_pipe( fpu_reg_con );
+ ins_encode %{
+ __ fld_s($constantaddress($con));
+ __ fstp_d($dst$$reg);
+ %}
+ ins_pipe(fpu_reg_con);
+%}
+
+// The instruction usage is guarded by predicate in operand immF0().
+instruct loadConF0(regF dst, immF0 con) %{
+ match(Set dst con);
+ ins_cost(125);
+ format %{ "FLDZ ST\n\t"
+ "FSTP $dst" %}
+ ins_encode %{
+ __ fldz();
+ __ fstp_d($dst$$reg);
+ %}
+ ins_pipe(fpu_reg_con);
+%}
+
+// The instruction usage is guarded by predicate in operand immF1().
+instruct loadConF1(regF dst, immF1 con) %{
+ match(Set dst con);
+ ins_cost(125);
+ format %{ "FLD1 ST\n\t"
+ "FSTP $dst" %}
+ ins_encode %{
+ __ fld1();
+ __ fstp_d($dst$$reg);
+ %}
+ ins_pipe(fpu_reg_con);
%}
// The instruction usage is guarded by predicate in operand immXF().
instruct loadConX(regX dst, immXF con) %{
match(Set dst con);
ins_cost(125);
- format %{ "MOVSS $dst,[$con]" %}
- ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x10), LdImmX(dst, con));
- ins_pipe( pipe_slow );
+ format %{ "MOVSS $dst,[$constantaddress]\t# load from constant table: float=$con" %}
+ ins_encode %{
+ __ movflt($dst$$XMMRegister, $constantaddress($con));
+ %}
+ ins_pipe(pipe_slow);
%}
// The instruction usage is guarded by predicate in operand immXF0().
@@ -7240,28 +7198,63 @@ instruct loadConX0(regX dst, immXF0 src) %{
match(Set dst src);
ins_cost(100);
format %{ "XORPS $dst,$dst\t# float 0.0" %}
- ins_encode( Opcode(0x0F), Opcode(0x57), RegReg(dst,dst));
- ins_pipe( pipe_slow );
+ ins_encode %{
+ __ xorps($dst$$XMMRegister, $dst$$XMMRegister);
+ %}
+ ins_pipe(pipe_slow);
%}
// The instruction usage is guarded by predicate in operand immD().
-instruct loadConD(regD dst, immD src) %{
- match(Set dst src);
+instruct loadConD(regD dst, immD con) %{
+ match(Set dst con);
ins_cost(125);
- format %{ "FLD_D ST,$src\n\t"
+ format %{ "FLD_D ST,[$constantaddress]\t# load from constant table: double=$con\n\t"
"FSTP $dst" %}
- ins_encode(LdImmD(src), Pop_Reg_D(dst) );
- ins_pipe( fpu_reg_con );
+ ins_encode %{
+ __ fld_d($constantaddress($con));
+ __ fstp_d($dst$$reg);
+ %}
+ ins_pipe(fpu_reg_con);
+%}
+
+// The instruction usage is guarded by predicate in operand immD0().
+instruct loadConD0(regD dst, immD0 con) %{
+ match(Set dst con);
+ ins_cost(125);
+
+ format %{ "FLDZ ST\n\t"
+ "FSTP $dst" %}
+ ins_encode %{
+ __ fldz();
+ __ fstp_d($dst$$reg);
+ %}
+ ins_pipe(fpu_reg_con);
+%}
+
+// The instruction usage is guarded by predicate in operand immD1().
+instruct loadConD1(regD dst, immD1 con) %{
+ match(Set dst con);
+ ins_cost(125);
+
+ format %{ "FLD1 ST\n\t"
+ "FSTP $dst" %}
+ ins_encode %{
+ __ fld1();
+ __ fstp_d($dst$$reg);
+ %}
+ ins_pipe(fpu_reg_con);
%}
// The instruction usage is guarded by predicate in operand immXD().
instruct loadConXD(regXD dst, immXD con) %{
match(Set dst con);
ins_cost(125);
- format %{ "MOVSD $dst,[$con]" %}
- ins_encode(load_conXD(dst, con));
- ins_pipe( pipe_slow );
+ format %{ "MOVSD $dst,[$constantaddress]\t# load from constant table: double=$con" %}
+ ins_encode %{
+ __ movdbl($dst$$XMMRegister, $constantaddress($con));
+ %}
+ ins_pipe(pipe_slow);
%}
// The instruction usage is guarded by predicate in operand immXD0().
@@ -10303,41 +10296,45 @@ instruct addD_mem_reg(memory dst, regD src) %{
ins_pipe( fpu_reg_mem );
%}
-instruct addD_reg_imm1(regD dst, immD1 src) %{
+instruct addD_reg_imm1(regD dst, immD1 con) %{
predicate(UseSSE<=1);
- match(Set dst (AddD dst src));
+ match(Set dst (AddD dst con));
ins_cost(125);
format %{ "FLD1\n\t"
"DADDp $dst,ST" %}
- opcode(0xDE, 0x00);
- ins_encode( LdImmD(src),
- OpcP, RegOpc(dst) );
- ins_pipe( fpu_reg );
+ ins_encode %{
+ __ fld1();
+ __ faddp($dst$$reg);
+ %}
+ ins_pipe(fpu_reg);
%}
-instruct addD_reg_imm(regD dst, immD src) %{
+instruct addD_reg_imm(regD dst, immD con) %{
predicate(UseSSE<=1 && _kids[1]->_leaf->getd() != 0.0 && _kids[1]->_leaf->getd() != 1.0 );
- match(Set dst (AddD dst src));
+ match(Set dst (AddD dst con));
ins_cost(200);
- format %{ "FLD_D [$src]\n\t"
+ format %{ "FLD_D [$constantaddress]\t# load from constant table: double=$con\n\t"
"DADDp $dst,ST" %}
- opcode(0xDE, 0x00); /* DE /0 */
- ins_encode( LdImmD(src),
- OpcP, RegOpc(dst));
- ins_pipe( fpu_reg_mem );
+ ins_encode %{
+ __ fld_d($constantaddress($con));
+ __ faddp($dst$$reg);
+ %}
+ ins_pipe(fpu_reg_mem);
%}
instruct addD_reg_imm_round(stackSlotD dst, regD src, immD con) %{
predicate(UseSSE<=1 && _kids[0]->_kids[1]->_leaf->getd() != 0.0 && _kids[0]->_kids[1]->_leaf->getd() != 1.0 );
match(Set dst (RoundDouble (AddD src con)));
ins_cost(200);
- format %{ "FLD_D [$con]\n\t"
+ format %{ "FLD_D [$constantaddress]\t# load from constant table: double=$con\n\t"
"DADD ST,$src\n\t"
"FSTP_D $dst\t# D-round" %}
- opcode(0xD8, 0x00); /* D8 /0 */
- ins_encode( LdImmD(con),
- OpcP, RegOpc(src), Pop_Mem_D(dst));
- ins_pipe( fpu_mem_reg_con );
+ ins_encode %{
+ __ fld_d($constantaddress($con));
+ __ fadd($src$$reg);
+ __ fstp_d(Address(rsp, $dst$$disp));
+ %}
+ ins_pipe(fpu_mem_reg_con);
%}
// Add two double precision floating point values in xmm
@@ -10352,9 +10349,11 @@ instruct addXD_reg(regXD dst, regXD src) %{
instruct addXD_imm(regXD dst, immXD con) %{
predicate(UseSSE>=2);
match(Set dst (AddD dst con));
- format %{ "ADDSD $dst,[$con]" %}
- ins_encode( Opcode(0xF2), Opcode(0x0F), Opcode(0x58), LdImmXD(dst, con) );
- ins_pipe( pipe_slow );
+ format %{ "ADDSD $dst,[$constantaddress]\t# load from constant table: double=$con" %}
+ ins_encode %{
+ __ addsd($dst$$XMMRegister, $constantaddress($con));
+ %}
+ ins_pipe(pipe_slow);
%}
instruct addXD_mem(regXD dst, memory mem) %{
@@ -10377,9 +10376,11 @@ instruct subXD_reg(regXD dst, regXD src) %{
instruct subXD_imm(regXD dst, immXD con) %{
predicate(UseSSE>=2);
match(Set dst (SubD dst con));
- format %{ "SUBSD $dst,[$con]" %}
- ins_encode( Opcode(0xF2), Opcode(0x0F), Opcode(0x5C), LdImmXD(dst, con) );
- ins_pipe( pipe_slow );
+ format %{ "SUBSD $dst,[$constantaddress]\t# load from constant table: double=$con" %}
+ ins_encode %{
+ __ subsd($dst$$XMMRegister, $constantaddress($con));
+ %}
+ ins_pipe(pipe_slow);
%}
instruct subXD_mem(regXD dst, memory mem) %{
@@ -10402,9 +10403,11 @@ instruct mulXD_reg(regXD dst, regXD src) %{
instruct mulXD_imm(regXD dst, immXD con) %{
predicate(UseSSE>=2);
match(Set dst (MulD dst con));
- format %{ "MULSD $dst,[$con]" %}
- ins_encode( Opcode(0xF2), Opcode(0x0F), Opcode(0x59), LdImmXD(dst, con) );
- ins_pipe( pipe_slow );
+ format %{ "MULSD $dst,[$constantaddress]\t# load from constant table: double=$con" %}
+ ins_encode %{
+ __ mulsd($dst$$XMMRegister, $constantaddress($con));
+ %}
+ ins_pipe(pipe_slow);
%}
instruct mulXD_mem(regXD dst, memory mem) %{
@@ -10428,9 +10431,11 @@ instruct divXD_reg(regXD dst, regXD src) %{
instruct divXD_imm(regXD dst, immXD con) %{
predicate(UseSSE>=2);
match(Set dst (DivD dst con));
- format %{ "DIVSD $dst,[$con]" %}
- ins_encode( Opcode(0xF2), Opcode(0x0F), Opcode(0x5E), LdImmXD(dst, con));
- ins_pipe( pipe_slow );
+ format %{ "DIVSD $dst,[$constantaddress]\t# load from constant table: double=$con" %}
+ ins_encode %{
+ __ divsd($dst$$XMMRegister, $constantaddress($con));
+ %}
+ ins_pipe(pipe_slow);
%}
instruct divXD_mem(regXD dst, memory mem) %{
@@ -10481,16 +10486,17 @@ instruct strictfp_mulD_reg(regDPR1 dst, regnotDPR1 src) %{
ins_pipe( fpu_reg_reg );
%}
-instruct mulD_reg_imm(regD dst, immD src) %{
+instruct mulD_reg_imm(regD dst, immD con) %{
predicate( UseSSE<=1 && _kids[1]->_leaf->getd() != 0.0 && _kids[1]->_leaf->getd() != 1.0 );
- match(Set dst (MulD dst src));
+ match(Set dst (MulD dst con));
ins_cost(200);
- format %{ "FLD_D [$src]\n\t"
+ format %{ "FLD_D [$constantaddress]\t# load from constant table: double=$con\n\t"
"DMULp $dst,ST" %}
- opcode(0xDE, 0x1); /* DE /1 */
- ins_encode( LdImmD(src),
- OpcP, RegOpc(dst) );
- ins_pipe( fpu_reg_mem );
+ ins_encode %{
+ __ fld_d($constantaddress($con));
+ __ fmulp($dst$$reg);
+ %}
+ ins_pipe(fpu_reg_mem);
%}
@@ -11224,9 +11230,11 @@ instruct addX_reg(regX dst, regX src) %{
instruct addX_imm(regX dst, immXF con) %{
predicate(UseSSE>=1);
match(Set dst (AddF dst con));
- format %{ "ADDSS $dst,[$con]" %}
- ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x58), LdImmX(dst, con) );
- ins_pipe( pipe_slow );
+ format %{ "ADDSS $dst,[$constantaddress]\t# load from constant table: float=$con" %}
+ ins_encode %{
+ __ addss($dst$$XMMRegister, $constantaddress($con));
+ %}
+ ins_pipe(pipe_slow);
%}
instruct addX_mem(regX dst, memory mem) %{
@@ -11249,9 +11257,11 @@ instruct subX_reg(regX dst, regX src) %{
instruct subX_imm(regX dst, immXF con) %{
predicate(UseSSE>=1);
match(Set dst (SubF dst con));
- format %{ "SUBSS $dst,[$con]" %}
- ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x5C), LdImmX(dst, con) );
- ins_pipe( pipe_slow );
+ format %{ "SUBSS $dst,[$constantaddress]\t# load from constant table: float=$con" %}
+ ins_encode %{
+ __ subss($dst$$XMMRegister, $constantaddress($con));
+ %}
+ ins_pipe(pipe_slow);
%}
instruct subX_mem(regX dst, memory mem) %{
@@ -11274,9 +11284,11 @@ instruct mulX_reg(regX dst, regX src) %{
instruct mulX_imm(regX dst, immXF con) %{
predicate(UseSSE>=1);
match(Set dst (MulF dst con));
- format %{ "MULSS $dst,[$con]" %}
- ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x59), LdImmX(dst, con) );
- ins_pipe( pipe_slow );
+ format %{ "MULSS $dst,[$constantaddress]\t# load from constant table: float=$con" %}
+ ins_encode %{
+ __ mulss($dst$$XMMRegister, $constantaddress($con));
+ %}
+ ins_pipe(pipe_slow);
%}
instruct mulX_mem(regX dst, memory mem) %{
@@ -11299,9 +11311,11 @@ instruct divX_reg(regX dst, regX src) %{
instruct divX_imm(regX dst, immXF con) %{
predicate(UseSSE>=1);
match(Set dst (DivF dst con));
- format %{ "DIVSS $dst,[$con]" %}
- ins_encode( Opcode(0xF3), Opcode(0x0F), Opcode(0x5E), LdImmX(dst, con) );
- ins_pipe( pipe_slow );
+ format %{ "DIVSS $dst,[$constantaddress]\t# load from constant table: float=$con" %}
+ ins_encode %{
+ __ divss($dst$$XMMRegister, $constantaddress($con));
+ %}
+ ins_pipe(pipe_slow);
%}
instruct divX_mem(regX dst, memory mem) %{
@@ -11456,31 +11470,33 @@ instruct addF24_mem_mem(stackSlotF dst, memory src1, memory src2) %{
// Spill to obtain 24-bit precision
-instruct addF24_reg_imm(stackSlotF dst, regF src1, immF src2) %{
+instruct addF24_reg_imm(stackSlotF dst, regF src, immF con) %{
predicate(UseSSE==0 && Compile::current()->select_24_bit_instr());
- match(Set dst (AddF src1 src2));
- format %{ "FLD $src1\n\t"
- "FADD $src2\n\t"
+ match(Set dst (AddF src con));
+ format %{ "FLD $src\n\t"
+ "FADD_S [$constantaddress]\t# load from constant table: float=$con\n\t"
"FSTP_S $dst" %}
- opcode(0xD8, 0x00); /* D8 /0 */
- ins_encode( Push_Reg_F(src1),
- Opc_MemImm_F(src2),
- Pop_Mem_F(dst));
- ins_pipe( fpu_mem_reg_con );
+ ins_encode %{
+ __ fld_s($src$$reg - 1); // FLD ST(i-1)
+ __ fadd_s($constantaddress($con));
+ __ fstp_s(Address(rsp, $dst$$disp));
+ %}
+ ins_pipe(fpu_mem_reg_con);
%}
//
// This instruction does not round to 24-bits
-instruct addF_reg_imm(regF dst, regF src1, immF src2) %{
+instruct addF_reg_imm(regF dst, regF src, immF con) %{
predicate(UseSSE==0 && !Compile::current()->select_24_bit_instr());
- match(Set dst (AddF src1 src2));
- format %{ "FLD $src1\n\t"
- "FADD $src2\n\t"
- "FSTP_S $dst" %}
- opcode(0xD8, 0x00); /* D8 /0 */
- ins_encode( Push_Reg_F(src1),
- Opc_MemImm_F(src2),
- Pop_Reg_F(dst));
- ins_pipe( fpu_reg_reg_con );
+ match(Set dst (AddF src con));
+ format %{ "FLD $src\n\t"
+ "FADD_S [$constantaddress]\t# load from constant table: float=$con\n\t"
+ "FSTP $dst" %}
+ ins_encode %{
+ __ fld_s($src$$reg - 1); // FLD ST(i-1)
+ __ fadd_s($constantaddress($con));
+ __ fstp_d($dst$$reg);
+ %}
+ ins_pipe(fpu_reg_reg_con);
%}
// Spill to obtain 24-bit precision
@@ -11559,29 +11575,35 @@ instruct mulF24_mem_mem(stackSlotF dst, memory src1, memory src2) %{
%}
// Spill to obtain 24-bit precision
-instruct mulF24_reg_imm(stackSlotF dst, regF src1, immF src2) %{
+instruct mulF24_reg_imm(stackSlotF dst, regF src, immF con) %{
predicate(UseSSE==0 && Compile::current()->select_24_bit_instr());
- match(Set dst (MulF src1 src2));
+ match(Set dst (MulF src con));
- format %{ "FMULc $dst,$src1,$src2" %}
- opcode(0xD8, 0x1); /* D8 /1*/
- ins_encode( Push_Reg_F(src1),
- Opc_MemImm_F(src2),
- Pop_Mem_F(dst));
- ins_pipe( fpu_mem_reg_con );
+ format %{ "FLD $src\n\t"
+ "FMUL_S [$constantaddress]\t# load from constant table: float=$con\n\t"
+ "FSTP_S $dst" %}
+ ins_encode %{
+ __ fld_s($src$$reg - 1); // FLD ST(i-1)
+ __ fmul_s($constantaddress($con));
+ __ fstp_s(Address(rsp, $dst$$disp));
+ %}
+ ins_pipe(fpu_mem_reg_con);
%}
//
// This instruction does not round to 24-bits
-instruct mulF_reg_imm(regF dst, regF src1, immF src2) %{
+instruct mulF_reg_imm(regF dst, regF src, immF con) %{
predicate(UseSSE==0 && !Compile::current()->select_24_bit_instr());
- match(Set dst (MulF src1 src2));
+ match(Set dst (MulF src con));
- format %{ "FMULc $dst. $src1, $src2" %}
- opcode(0xD8, 0x1); /* D8 /1*/
- ins_encode( Push_Reg_F(src1),
- Opc_MemImm_F(src2),
- Pop_Reg_F(dst));
- ins_pipe( fpu_reg_reg_con );
+ format %{ "FLD $src\n\t"
+ "FMUL_S [$constantaddress]\t# load from constant table: float=$con\n\t"
+ "FSTP $dst" %}
+ ins_encode %{
+ __ fld_s($src$$reg - 1); // FLD ST(i-1)
+ __ fmul_s($constantaddress($con));
+ __ fstp_d($dst$$reg);
+ %}
+ ins_pipe(fpu_reg_reg_con);
%}
@@ -12939,16 +12961,11 @@ instruct maxI_eReg(eRegI dst, eRegI src, eFlagsReg flags) %{
instruct jumpXtnd(eRegI switch_val) %{
match(Jump switch_val);
ins_cost(350);
-
- format %{ "JMP [table_base](,$switch_val,1)\n\t" %}
-
+ format %{ "JMP [$constantaddress](,$switch_val,1)\n\t" %}
ins_encode %{
- address table_base = __ address_table_constant(_index2label);
-
// Jump to Address(table_base + switch_reg)
- InternalAddress table(table_base);
Address index(noreg, $switch_val$$Register, Address::times_1);
- __ jump(ArrayAddress(table, index));
+ __ jump(ArrayAddress($constantaddress, index));
%}
ins_pc_relative(1);
ins_pipe(pipe_jmp);
diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad
index 8f6912307bf..e007ce96cc8 100644
--- a/hotspot/src/cpu/x86/vm/x86_64.ad
+++ b/hotspot/src/cpu/x86/vm/x86_64.ad
@@ -832,6 +832,25 @@ void encode_CopyXD( CodeBuffer &cbuf, int dst_encoding, int src_encoding ) {
}
+//=============================================================================
+const bool Matcher::constant_table_absolute_addressing = true;
+const RegMask& MachConstantBaseNode::_out_RegMask = RegMask::Empty;
+
+void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
+ // Empty encoding
+}
+
+uint MachConstantBaseNode::size(PhaseRegAlloc* ra_) const {
+ return 0;
+}
+
+#ifndef PRODUCT
+void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
+ st->print("# MachConstantBaseNode (empty encoding)");
+}
+#endif
+
+
//=============================================================================
#ifndef PRODUCT
void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const
@@ -1922,28 +1941,6 @@ int emit_deopt_handler(CodeBuffer& cbuf)
return offset;
}
-static void emit_double_constant(CodeBuffer& cbuf, double x) {
- int mark = cbuf.insts()->mark_off();
- MacroAssembler _masm(&cbuf);
- address double_address = __ double_constant(x);
- cbuf.insts()->set_mark_off(mark); // preserve mark across masm shift
- emit_d32_reloc(cbuf,
- (int) (double_address - cbuf.insts_end() - 4),
- internal_word_Relocation::spec(double_address),
- RELOC_DISP32);
-}
-
-static void emit_float_constant(CodeBuffer& cbuf, float x) {
- int mark = cbuf.insts()->mark_off();
- MacroAssembler _masm(&cbuf);
- address float_address = __ float_constant(x);
- cbuf.insts()->set_mark_off(mark); // preserve mark across masm shift
- emit_d32_reloc(cbuf,
- (int) (float_address - cbuf.insts_end() - 4),
- internal_word_Relocation::spec(float_address),
- RELOC_DISP32);
-}
-
const bool Matcher::match_rule_supported(int opcode) {
if (!has_match_rule(opcode))
@@ -2789,43 +2786,6 @@ encode %{
}
%}
- enc_class load_immF(regF dst, immF con)
- %{
- // XXX reg_mem doesn't support RIP-relative addressing yet
- emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101
- emit_float_constant(cbuf, $con$$constant);
- %}
-
- enc_class load_immD(regD dst, immD con)
- %{
- // XXX reg_mem doesn't support RIP-relative addressing yet
- emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101
- emit_double_constant(cbuf, $con$$constant);
- %}
-
- enc_class load_conF (regF dst, immF con) %{ // Load float constant
- emit_opcode(cbuf, 0xF3);
- if ($dst$$reg >= 8) {
- emit_opcode(cbuf, Assembler::REX_R);
- }
- emit_opcode(cbuf, 0x0F);
- emit_opcode(cbuf, 0x10);
- emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101
- emit_float_constant(cbuf, $con$$constant);
- %}
-
- enc_class load_conD (regD dst, immD con) %{ // Load double constant
- // UseXmmLoadAndClearUpper ? movsd(dst, con) : movlpd(dst, con)
- emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0xF2 : 0x66);
- if ($dst$$reg >= 8) {
- emit_opcode(cbuf, Assembler::REX_R);
- }
- emit_opcode(cbuf, 0x0F);
- emit_opcode(cbuf, UseXmmLoadAndClearUpper ? 0x10 : 0x12);
- emit_rm(cbuf, 0x0, $dst$$reg & 7, 0x5); // 00 reg 101
- emit_double_constant(cbuf, $con$$constant);
- %}
-
// Encode a reg-reg copy. If it is useless, then empty encoding.
enc_class enc_copy(rRegI dst, rRegI src)
%{
@@ -2926,63 +2886,6 @@ encode %{
emit_d32(cbuf, 0x00);
%}
- enc_class jump_enc(rRegL switch_val, rRegI dest) %{
- MacroAssembler masm(&cbuf);
-
- Register switch_reg = as_Register($switch_val$$reg);
- Register dest_reg = as_Register($dest$$reg);
- address table_base = masm.address_table_constant(_index2label);
-
- // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
- // to do that and the compiler is using that register as one it can allocate.
- // So we build it all by hand.
- // Address index(noreg, switch_reg, Address::times_1);
- // ArrayAddress dispatch(table, index);
-
- Address dispatch(dest_reg, switch_reg, Address::times_1);
-
- masm.lea(dest_reg, InternalAddress(table_base));
- masm.jmp(dispatch);
- %}
-
- enc_class jump_enc_addr(rRegL switch_val, immI2 shift, immL32 offset, rRegI dest) %{
- MacroAssembler masm(&cbuf);
-
- Register switch_reg = as_Register($switch_val$$reg);
- Register dest_reg = as_Register($dest$$reg);
- address table_base = masm.address_table_constant(_index2label);
-
- // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
- // to do that and the compiler is using that register as one it can allocate.
- // So we build it all by hand.
- // Address index(noreg, switch_reg, (Address::ScaleFactor)$shift$$constant, (int)$offset$$constant);
- // ArrayAddress dispatch(table, index);
-
- Address dispatch(dest_reg, switch_reg, (Address::ScaleFactor)$shift$$constant, (int)$offset$$constant);
-
- masm.lea(dest_reg, InternalAddress(table_base));
- masm.jmp(dispatch);
- %}
-
- enc_class jump_enc_offset(rRegL switch_val, immI2 shift, rRegI dest) %{
- MacroAssembler masm(&cbuf);
-
- Register switch_reg = as_Register($switch_val$$reg);
- Register dest_reg = as_Register($dest$$reg);
- address table_base = masm.address_table_constant(_index2label);
-
- // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
- // to do that and the compiler is using that register as one it can allocate.
- // So we build it all by hand.
- // Address index(noreg, switch_reg, (Address::ScaleFactor)$shift$$constant);
- // ArrayAddress dispatch(table, index);
-
- Address dispatch(dest_reg, switch_reg, (Address::ScaleFactor)$shift$$constant);
- masm.lea(dest_reg, InternalAddress(table_base));
- masm.jmp(dispatch);
-
- %}
-
enc_class lock_prefix()
%{
if (os::is_MP()) {
@@ -6641,12 +6544,11 @@ instruct loadConL32(rRegL dst, immL32 src)
ins_pipe(ialu_reg);
%}
-instruct loadConP(rRegP dst, immP src)
-%{
- match(Set dst src);
+instruct loadConP(rRegP dst, immP con) %{
+ match(Set dst con);
- format %{ "movq $dst, $src\t# ptr" %}
- ins_encode(load_immP(dst, src));
+ format %{ "movq $dst, $con\t# ptr" %}
+ ins_encode(load_immP(dst, con));
ins_pipe(ialu_reg_fat); // XXX
%}
@@ -6673,13 +6575,13 @@ instruct loadConP31(rRegP dst, immP31 src, rFlagsReg cr)
ins_pipe(ialu_reg);
%}
-instruct loadConF(regF dst, immF src)
-%{
- match(Set dst src);
+instruct loadConF(regF dst, immF con) %{
+ match(Set dst con);
ins_cost(125);
-
- format %{ "movss $dst, [$src]" %}
- ins_encode(load_conF(dst, src));
+ format %{ "movss $dst, [$constantaddress]\t# load from constant table: float=$con" %}
+ ins_encode %{
+ __ movflt($dst$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
@@ -6721,13 +6623,13 @@ instruct loadConF0(regF dst, immF0 src)
%}
// Use the same format since predicate() can not be used here.
-instruct loadConD(regD dst, immD src)
-%{
- match(Set dst src);
+instruct loadConD(regD dst, immD con) %{
+ match(Set dst con);
ins_cost(125);
-
- format %{ "movsd $dst, [$src]" %}
- ins_encode(load_conD(dst, src));
+ format %{ "movsd $dst, [$constantaddress]\t# load from constant table: double=$con" %}
+ ins_encode %{
+ __ movdbl($dst$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
@@ -7694,9 +7596,18 @@ instruct jumpXtnd_offset(rRegL switch_val, immI2 shift, rRegI dest) %{
predicate(false);
effect(TEMP dest);
- format %{ "leaq $dest, table_base\n\t"
+ format %{ "leaq $dest, [$constantaddress]\n\t"
"jmp [$dest + $switch_val << $shift]\n\t" %}
- ins_encode(jump_enc_offset(switch_val, shift, dest));
+ ins_encode %{
+ // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
+ // to do that and the compiler is using that register as one it can allocate.
+ // So we build it all by hand.
+ // Address index(noreg, switch_reg, (Address::ScaleFactor)$shift$$constant);
+ // ArrayAddress dispatch(table, index);
+ Address dispatch($dest$$Register, $switch_val$$Register, (Address::ScaleFactor) $shift$$constant);
+ __ lea($dest$$Register, $constantaddress);
+ __ jmp(dispatch);
+ %}
ins_pipe(pipe_jmp);
ins_pc_relative(1);
%}
@@ -7706,9 +7617,18 @@ instruct jumpXtnd_addr(rRegL switch_val, immI2 shift, immL32 offset, rRegI dest)
ins_cost(350);
effect(TEMP dest);
- format %{ "leaq $dest, table_base\n\t"
+ format %{ "leaq $dest, [$constantaddress]\n\t"
"jmp [$dest + $switch_val << $shift + $offset]\n\t" %}
- ins_encode(jump_enc_addr(switch_val, shift, offset, dest));
+ ins_encode %{
+ // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
+ // to do that and the compiler is using that register as one it can allocate.
+ // So we build it all by hand.
+ // Address index(noreg, switch_reg, (Address::ScaleFactor) $shift$$constant, (int) $offset$$constant);
+ // ArrayAddress dispatch(table, index);
+ Address dispatch($dest$$Register, $switch_val$$Register, (Address::ScaleFactor) $shift$$constant, (int) $offset$$constant);
+ __ lea($dest$$Register, $constantaddress);
+ __ jmp(dispatch);
+ %}
ins_pipe(pipe_jmp);
ins_pc_relative(1);
%}
@@ -7718,9 +7638,18 @@ instruct jumpXtnd(rRegL switch_val, rRegI dest) %{
ins_cost(350);
effect(TEMP dest);
- format %{ "leaq $dest, table_base\n\t"
+ format %{ "leaq $dest, [$constantaddress]\n\t"
"jmp [$dest + $switch_val]\n\t" %}
- ins_encode(jump_enc(switch_val, dest));
+ ins_encode %{
+ // We could use jump(ArrayAddress) except that the macro assembler needs to use r10
+ // to do that and the compiler is using that register as one it can allocate.
+ // So we build it all by hand.
+ // Address index(noreg, switch_reg, Address::times_1);
+ // ArrayAddress dispatch(table, index);
+ Address dispatch($dest$$Register, $switch_val$$Register, Address::times_1);
+ __ lea($dest$$Register, $constantaddress);
+ __ jmp(dispatch);
+ %}
ins_pipe(pipe_jmp);
ins_pc_relative(1);
%}
@@ -10376,30 +10305,36 @@ instruct cmpF_cc_memCF(rFlagsRegUCF cr, regF src1, memory src2) %{
ins_pipe(pipe_slow);
%}
-instruct cmpF_cc_imm(rFlagsRegU cr, regF src1, immF src2)
-%{
- match(Set cr (CmpF src1 src2));
+instruct cmpF_cc_imm(rFlagsRegU cr, regF src, immF con) %{
+ match(Set cr (CmpF src con));
ins_cost(145);
- format %{ "ucomiss $src1, $src2\n\t"
+ format %{ "ucomiss $src, [$constantaddress]\t# load from constant table: float=$con\n\t"
"jnp,s exit\n\t"
"pushfq\t# saw NaN, set CF\n\t"
"andq [rsp], #0xffffff2b\n\t"
"popfq\n"
"exit: nop\t# avoid branch to branch" %}
- opcode(0x0F, 0x2E);
- ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, load_immF(src1, src2),
- cmpfp_fixup);
+ ins_encode %{
+ Label L_exit;
+ __ ucomiss($src$$XMMRegister, $constantaddress($con));
+ __ jcc(Assembler::noParity, L_exit);
+ __ pushf();
+ __ andq(rsp, 0xffffff2b);
+ __ popf();
+ __ bind(L_exit);
+ __ nop();
+ %}
ins_pipe(pipe_slow);
%}
-instruct cmpF_cc_immCF(rFlagsRegUCF cr, regF src1, immF src2) %{
- match(Set cr (CmpF src1 src2));
-
+instruct cmpF_cc_immCF(rFlagsRegUCF cr, regF src, immF con) %{
+ match(Set cr (CmpF src con));
ins_cost(100);
- format %{ "ucomiss $src1, $src2" %}
- opcode(0x0F, 0x2E);
- ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, load_immF(src1, src2));
+ format %{ "ucomiss $src, [$constantaddress]\t# load from constant table: float=$con" %}
+ ins_encode %{
+ __ ucomiss($src$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
@@ -10458,30 +10393,36 @@ instruct cmpD_cc_memCF(rFlagsRegUCF cr, regD src1, memory src2) %{
ins_pipe(pipe_slow);
%}
-instruct cmpD_cc_imm(rFlagsRegU cr, regD src1, immD src2)
-%{
- match(Set cr (CmpD src1 src2));
+instruct cmpD_cc_imm(rFlagsRegU cr, regD src, immD con) %{
+ match(Set cr (CmpD src con));
ins_cost(145);
- format %{ "ucomisd $src1, [$src2]\n\t"
+ format %{ "ucomisd $src, [$constantaddress]\t# load from constant table: double=$con\n\t"
"jnp,s exit\n\t"
"pushfq\t# saw NaN, set CF\n\t"
"andq [rsp], #0xffffff2b\n\t"
"popfq\n"
"exit: nop\t# avoid branch to branch" %}
- opcode(0x66, 0x0F, 0x2E);
- ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, load_immD(src1, src2),
- cmpfp_fixup);
+ ins_encode %{
+ Label L_exit;
+ __ ucomisd($src$$XMMRegister, $constantaddress($con));
+ __ jcc(Assembler::noParity, L_exit);
+ __ pushf();
+ __ andq(rsp, 0xffffff2b);
+ __ popf();
+ __ bind(L_exit);
+ __ nop();
+ %}
ins_pipe(pipe_slow);
%}
-instruct cmpD_cc_immCF(rFlagsRegUCF cr, regD src1, immD src2) %{
- match(Set cr (CmpD src1 src2));
-
+instruct cmpD_cc_immCF(rFlagsRegUCF cr, regD src, immD con) %{
+ match(Set cr (CmpD src con));
ins_cost(100);
- format %{ "ucomisd $src1, [$src2]" %}
- opcode(0x66, 0x0F, 0x2E);
- ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, load_immD(src1, src2));
+ format %{ "ucomisd $src, [$constantaddress]\t# load from constant table: double=$con" %}
+ ins_encode %{
+ __ ucomisd($src$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
@@ -10528,23 +10469,29 @@ instruct cmpF_mem(rRegI dst, regF src1, memory src2, rFlagsReg cr)
%}
// Compare into -1,0,1
-instruct cmpF_imm(rRegI dst, regF src1, immF src2, rFlagsReg cr)
-%{
- match(Set dst (CmpF3 src1 src2));
+instruct cmpF_imm(rRegI dst, regF src, immF con, rFlagsReg cr) %{
+ match(Set dst (CmpF3 src con));
effect(KILL cr);
ins_cost(275);
- format %{ "ucomiss $src1, [$src2]\n\t"
+ format %{ "ucomiss $src, [$constantaddress]\t# load from constant table: float=$con\n\t"
"movl $dst, #-1\n\t"
"jp,s done\n\t"
"jb,s done\n\t"
"setne $dst\n\t"
"movzbl $dst, $dst\n"
"done:" %}
-
- opcode(0x0F, 0x2E);
- ins_encode(REX_reg_mem(src1, src2), OpcP, OpcS, load_immF(src1, src2),
- cmpfp3(dst));
+ ins_encode %{
+ Label L_done;
+ Register Rdst = $dst$$Register;
+ __ ucomiss($src$$XMMRegister, $constantaddress($con));
+ __ movl(Rdst, -1);
+ __ jcc(Assembler::parity, L_done);
+ __ jcc(Assembler::below, L_done);
+ __ setb(Assembler::notEqual, Rdst);
+ __ movzbl(Rdst, Rdst);
+ __ bind(L_done);
+ %}
ins_pipe(pipe_slow);
%}
@@ -10591,23 +10538,29 @@ instruct cmpD_mem(rRegI dst, regD src1, memory src2, rFlagsReg cr)
%}
// Compare into -1,0,1
-instruct cmpD_imm(rRegI dst, regD src1, immD src2, rFlagsReg cr)
-%{
- match(Set dst (CmpD3 src1 src2));
+instruct cmpD_imm(rRegI dst, regD src, immD con, rFlagsReg cr) %{
+ match(Set dst (CmpD3 src con));
effect(KILL cr);
ins_cost(275);
- format %{ "ucomisd $src1, [$src2]\n\t"
+ format %{ "ucomisd $src, [$constantaddress]\t# load from constant table: double=$con\n\t"
"movl $dst, #-1\n\t"
"jp,s done\n\t"
"jb,s done\n\t"
"setne $dst\n\t"
"movzbl $dst, $dst\n"
"done:" %}
-
- opcode(0x66, 0x0F, 0x2E);
- ins_encode(OpcP, REX_reg_mem(src1, src2), OpcS, OpcT, load_immD(src1, src2),
- cmpfp3(dst));
+ ins_encode %{
+ Register Rdst = $dst$$Register;
+ Label L_done;
+ __ ucomisd($src$$XMMRegister, $constantaddress($con));
+ __ movl(Rdst, -1);
+ __ jcc(Assembler::parity, L_done);
+ __ jcc(Assembler::below, L_done);
+ __ setb(Assembler::notEqual, Rdst);
+ __ movzbl(Rdst, Rdst);
+ __ bind(L_done);
+ %}
ins_pipe(pipe_slow);
%}
@@ -10633,14 +10586,13 @@ instruct addF_mem(regF dst, memory src)
ins_pipe(pipe_slow);
%}
-instruct addF_imm(regF dst, immF src)
-%{
- match(Set dst (AddF dst src));
-
- format %{ "addss $dst, [$src]" %}
+instruct addF_imm(regF dst, immF con) %{
+ match(Set dst (AddF dst con));
+ format %{ "addss $dst, [$constantaddress]\t# load from constant table: float=$con" %}
ins_cost(150); // XXX
- opcode(0xF3, 0x0F, 0x58);
- ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
+ ins_encode %{
+ __ addss($dst$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
@@ -10666,14 +10618,13 @@ instruct addD_mem(regD dst, memory src)
ins_pipe(pipe_slow);
%}
-instruct addD_imm(regD dst, immD src)
-%{
- match(Set dst (AddD dst src));
-
- format %{ "addsd $dst, [$src]" %}
+instruct addD_imm(regD dst, immD con) %{
+ match(Set dst (AddD dst con));
+ format %{ "addsd $dst, [$constantaddress]\t# load from constant table: double=$con" %}
ins_cost(150); // XXX
- opcode(0xF2, 0x0F, 0x58);
- ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
+ ins_encode %{
+ __ addsd($dst$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
@@ -10699,14 +10650,13 @@ instruct subF_mem(regF dst, memory src)
ins_pipe(pipe_slow);
%}
-instruct subF_imm(regF dst, immF src)
-%{
- match(Set dst (SubF dst src));
-
- format %{ "subss $dst, [$src]" %}
+instruct subF_imm(regF dst, immF con) %{
+ match(Set dst (SubF dst con));
+ format %{ "subss $dst, [$constantaddress]\t# load from constant table: float=$con" %}
ins_cost(150); // XXX
- opcode(0xF3, 0x0F, 0x5C);
- ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
+ ins_encode %{
+ __ subss($dst$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
@@ -10732,14 +10682,13 @@ instruct subD_mem(regD dst, memory src)
ins_pipe(pipe_slow);
%}
-instruct subD_imm(regD dst, immD src)
-%{
- match(Set dst (SubD dst src));
-
- format %{ "subsd $dst, [$src]" %}
+instruct subD_imm(regD dst, immD con) %{
+ match(Set dst (SubD dst con));
+ format %{ "subsd $dst, [$constantaddress]\t# load from constant table: double=$con" %}
ins_cost(150); // XXX
- opcode(0xF2, 0x0F, 0x5C);
- ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
+ ins_encode %{
+ __ subsd($dst$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
@@ -10765,14 +10714,13 @@ instruct mulF_mem(regF dst, memory src)
ins_pipe(pipe_slow);
%}
-instruct mulF_imm(regF dst, immF src)
-%{
- match(Set dst (MulF dst src));
-
- format %{ "mulss $dst, [$src]" %}
+instruct mulF_imm(regF dst, immF con) %{
+ match(Set dst (MulF dst con));
+ format %{ "mulss $dst, [$constantaddress]\t# load from constant table: float=$con" %}
ins_cost(150); // XXX
- opcode(0xF3, 0x0F, 0x59);
- ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
+ ins_encode %{
+ __ mulss($dst$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
@@ -10798,14 +10746,13 @@ instruct mulD_mem(regD dst, memory src)
ins_pipe(pipe_slow);
%}
-instruct mulD_imm(regD dst, immD src)
-%{
- match(Set dst (MulD dst src));
-
- format %{ "mulsd $dst, [$src]" %}
+instruct mulD_imm(regD dst, immD con) %{
+ match(Set dst (MulD dst con));
+ format %{ "mulsd $dst, [$constantaddress]\t# load from constant table: double=$con" %}
ins_cost(150); // XXX
- opcode(0xF2, 0x0F, 0x59);
- ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
+ ins_encode %{
+ __ mulsd($dst$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
@@ -10831,14 +10778,13 @@ instruct divF_mem(regF dst, memory src)
ins_pipe(pipe_slow);
%}
-instruct divF_imm(regF dst, immF src)
-%{
- match(Set dst (DivF dst src));
-
- format %{ "divss $dst, [$src]" %}
+instruct divF_imm(regF dst, immF con) %{
+ match(Set dst (DivF dst con));
+ format %{ "divss $dst, [$constantaddress]\t# load from constant table: float=$con" %}
ins_cost(150); // XXX
- opcode(0xF3, 0x0F, 0x5E);
- ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
+ ins_encode %{
+ __ divss($dst$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
@@ -10864,14 +10810,13 @@ instruct divD_mem(regD dst, memory src)
ins_pipe(pipe_slow);
%}
-instruct divD_imm(regD dst, immD src)
-%{
- match(Set dst (DivD dst src));
-
- format %{ "divsd $dst, [$src]" %}
+instruct divD_imm(regD dst, immD con) %{
+ match(Set dst (DivD dst con));
+ format %{ "divsd $dst, [$constantaddress]\t# load from constant table: double=$con" %}
ins_cost(150); // XXX
- opcode(0xF2, 0x0F, 0x5E);
- ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
+ ins_encode %{
+ __ divsd($dst$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
@@ -10897,14 +10842,13 @@ instruct sqrtF_mem(regF dst, memory src)
ins_pipe(pipe_slow);
%}
-instruct sqrtF_imm(regF dst, immF src)
-%{
- match(Set dst (ConvD2F (SqrtD (ConvF2D src))));
-
- format %{ "sqrtss $dst, [$src]" %}
+instruct sqrtF_imm(regF dst, immF con) %{
+ match(Set dst (ConvD2F (SqrtD (ConvF2D con))));
+ format %{ "sqrtss $dst, [$constantaddress]\t# load from constant table: float=$con" %}
ins_cost(150); // XXX
- opcode(0xF3, 0x0F, 0x51);
- ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immF(dst, src));
+ ins_encode %{
+ __ sqrtss($dst$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
@@ -10930,14 +10874,13 @@ instruct sqrtD_mem(regD dst, memory src)
ins_pipe(pipe_slow);
%}
-instruct sqrtD_imm(regD dst, immD src)
-%{
- match(Set dst (SqrtD src));
-
- format %{ "sqrtsd $dst, [$src]" %}
+instruct sqrtD_imm(regD dst, immD con) %{
+ match(Set dst (SqrtD con));
+ format %{ "sqrtsd $dst, [$constantaddress]\t# load from constant table: double=$con" %}
ins_cost(150); // XXX
- opcode(0xF2, 0x0F, 0x51);
- ins_encode(OpcP, REX_reg_mem(dst, src), OpcS, OpcT, load_immD(dst, src));
+ ins_encode %{
+ __ sqrtsd($dst$$XMMRegister, $constantaddress($con));
+ %}
ins_pipe(pipe_slow);
%}
diff --git a/hotspot/src/cpu/zero/vm/assembler_zero.cpp b/hotspot/src/cpu/zero/vm/assembler_zero.cpp
index a748d4009c2..a3e36276415 100644
--- a/hotspot/src/cpu/zero/vm/assembler_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/assembler_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,24 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_zero.inline.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/cardTableModRefBS.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifndef SERIALGC
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#endif
int AbstractAssembler::code_fill_byte() {
return 0;
diff --git a/hotspot/src/cpu/zero/vm/assembler_zero.hpp b/hotspot/src/cpu/zero/vm/assembler_zero.hpp
index ec7ac47920e..2cc25a73aa0 100644
--- a/hotspot/src/cpu/zero/vm/assembler_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/assembler_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_ASSEMBLER_ZERO_HPP
+#define CPU_ZERO_VM_ASSEMBLER_ZERO_HPP
+
// In normal, CPU-specific ports of HotSpot these two classes are used
// for generating assembly language. We don't do any of this in zero,
// of course, but we do sneak entry points around in CodeBuffers so we
@@ -62,3 +65,5 @@ inline bool AbstractAssembler::pd_check_instruction_mark() {
address ShouldNotCallThisStub();
address ShouldNotCallThisEntry();
+
+#endif // CPU_ZERO_VM_ASSEMBLER_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/assembler_zero.inline.hpp b/hotspot/src/cpu/zero/vm/assembler_zero.inline.hpp
index 1e7f6703a71..274ded2a097 100644
--- a/hotspot/src/cpu/zero/vm/assembler_zero.inline.hpp
+++ b/hotspot/src/cpu/zero/vm/assembler_zero.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,14 @@
*
*/
+#ifndef CPU_ZERO_VM_ASSEMBLER_ZERO_INLINE_HPP
+#define CPU_ZERO_VM_ASSEMBLER_ZERO_INLINE_HPP
+
+#include "asm/assembler.inline.hpp"
+#include "asm/codeBuffer.hpp"
+#include "code/codeCache.hpp"
+#include "runtime/handles.inline.hpp"
+
// This file is intentionally empty
+
+#endif // CPU_ZERO_VM_ASSEMBLER_ZERO_INLINE_HPP
diff --git a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp
index 0ef2c5db186..1dc891231bb 100644
--- a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2008 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,25 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_cppInterpreter_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "interp_masm_zero.hpp"
+#include "interpreter/bytecodeInterpreter.hpp"
+#include "interpreter/bytecodeInterpreter.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.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 CC_INTERP
diff --git a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp
index 49da4359d25..1980be2ba5c 100644
--- a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, 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.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_HPP
+#define CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_HPP
+
// Platform specific for C++ based Interpreter
#if defined(PPC) || defined(SPARC) || defined(IA64)
@@ -146,3 +149,5 @@
((VMJavaVal64*)(addr))->d)
#define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \
((VMJavaVal64*)(addr))->l)
+
+#endif // CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp
index a35809f0a5b..6a32ea6a39f 100644
--- a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp
+++ b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP
+#define CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP
+
// Inline interpreter functions for zero
inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) {
@@ -299,3 +302,5 @@ inline jshort BytecodeInterpreter::VMint2Short(jint val) {
inline jbyte BytecodeInterpreter::VMint2Byte(jint val) {
return (jbyte) val;
}
+
+#endif // CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP
diff --git a/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp b/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp
index 0655291158d..e3f801f400a 100644
--- a/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,8 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_bytecodes_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/bytecodes.hpp"
void Bytecodes::pd_initialize() {
// No zero specific initialization
diff --git a/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp b/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp
index 1e7f6703a71..f214bb74512 100644
--- a/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_BYTECODES_ZERO_HPP
+#define CPU_ZERO_VM_BYTECODES_ZERO_HPP
+
// This file is intentionally empty
+
+#endif // CPU_ZERO_VM_BYTECODES_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/bytes_zero.hpp b/hotspot/src/cpu/zero/vm/bytes_zero.hpp
index 5bd0254c481..39caaeabcc3 100644
--- a/hotspot/src/cpu/zero/vm/bytes_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/bytes_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,11 @@
*
*/
+#ifndef CPU_ZERO_VM_BYTES_ZERO_HPP
+#define CPU_ZERO_VM_BYTES_ZERO_HPP
+
+#include "memory/allocation.hpp"
+
typedef union unaligned {
u4 u;
u2 us;
@@ -160,5 +165,10 @@ class Bytes: AllStatic {
#ifdef VM_LITTLE_ENDIAN
// The following header contains the implementations of swap_u2,
// swap_u4, and swap_u8
-#include "incls/_bytes_pd.inline.hpp.incl"
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "bytes_linux_zero.inline.hpp"
+#endif
+
#endif // VM_LITTLE_ENDIAN
+
+#endif // CPU_ZERO_VM_BYTES_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/codeBuffer_zero.hpp b/hotspot/src/cpu/zero/vm/codeBuffer_zero.hpp
index c3348ba8cd0..7837f9a239c 100644
--- a/hotspot/src/cpu/zero/vm/codeBuffer_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/codeBuffer_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,5 +23,10 @@
*
*/
+#ifndef CPU_ZERO_VM_CODEBUFFER_ZERO_HPP
+#define CPU_ZERO_VM_CODEBUFFER_ZERO_HPP
+
private:
void pd_initialize() {}
+
+#endif // CPU_ZERO_VM_CODEBUFFER_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/copy_zero.hpp b/hotspot/src/cpu/zero/vm/copy_zero.hpp
index 971d45d05c0..1837e2b98eb 100644
--- a/hotspot/src/cpu/zero/vm/copy_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/copy_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_COPY_ZERO_HPP
+#define CPU_ZERO_VM_COPY_ZERO_HPP
+
// Inline functions for memory copy and fill.
static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
@@ -176,3 +179,5 @@ static void pd_zero_to_words(HeapWord* tohw, size_t count) {
static void pd_zero_to_bytes(void* to, size_t count) {
memset(to, 0, count);
}
+
+#endif // CPU_ZERO_VM_COPY_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp b/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp
index 78bacdfa2b4..ff61306c760 100644
--- a/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP
+#define CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP
+
protected:
MacroAssembler* assembler() const {
return _masm;
@@ -35,3 +38,5 @@
entry->set_entry_point(entry_point);
return (address) entry;
}
+
+#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 3d55bbecd37..1c945f22dd4 100644
--- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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.
*
@@ -23,8 +23,33 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_cppInterpreter_zero.cpp.incl"
+#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 "oops/arrayOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.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 "stack_zero.inline.hpp"
+#include "utilities/debug.hpp"
+#ifdef SHARK
+#include "shark/shark_globals.hpp"
+#endif
#ifdef CC_INTERP
diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp
index 9c101e91382..26f0e0414c8 100644
--- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_CPPINTERPRETER_ZERO_HPP
+#define CPU_ZERO_VM_CPPINTERPRETER_ZERO_HPP
+
protected:
// Size of interpreter code
const static int InterpreterCodeSize = 6 * K;
@@ -41,3 +44,5 @@
private:
// Fast result type determination
static BasicType result_type_of(methodOop method);
+
+#endif // CPU_ZERO_VM_CPPINTERPRETER_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/debug_zero.cpp b/hotspot/src/cpu/zero/vm/debug_zero.cpp
index 062198e52f5..19d00e33cdc 100644
--- a/hotspot/src/cpu/zero/vm/debug_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/debug_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,14 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_debug_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/nmethod.hpp"
+#include "runtime/frame.hpp"
+#include "runtime/init.hpp"
+#include "runtime/os.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/top.hpp"
void pd_ps(frame f) {
ShouldNotCallThis();
diff --git a/hotspot/src/cpu/zero/vm/depChecker_zero.cpp b/hotspot/src/cpu/zero/vm/depChecker_zero.cpp
index 1e7f6703a71..fcc514141e5 100644
--- a/hotspot/src/cpu/zero/vm/depChecker_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/depChecker_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,8 @@
*
*/
+#include "precompiled.hpp"
+#include "compiler/disassembler.hpp"
+#include "depChecker_zero.hpp"
+
// This file is intentionally empty
diff --git a/hotspot/src/cpu/zero/vm/depChecker_zero.hpp b/hotspot/src/cpu/zero/vm/depChecker_zero.hpp
index 1e7f6703a71..cf5a401c4a8 100644
--- a/hotspot/src/cpu/zero/vm/depChecker_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/depChecker_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_DEPCHECKER_ZERO_HPP
+#define CPU_ZERO_VM_DEPCHECKER_ZERO_HPP
+
// This file is intentionally empty
+
+#endif // CPU_ZERO_VM_DEPCHECKER_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/disassembler_zero.cpp b/hotspot/src/cpu/zero/vm/disassembler_zero.cpp
index 1e7f6703a71..944a52f5dd9 100644
--- a/hotspot/src/cpu/zero/vm/disassembler_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/disassembler_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,6 @@
*
*/
+#include "precompiled.hpp"
+
// This file is intentionally empty
diff --git a/hotspot/src/cpu/zero/vm/disassembler_zero.hpp b/hotspot/src/cpu/zero/vm/disassembler_zero.hpp
index c488cf8e765..889b91330e6 100644
--- a/hotspot/src/cpu/zero/vm/disassembler_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/disassembler_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_DISASSEMBLER_ZERO_HPP
+#define CPU_ZERO_VM_DISASSEMBLER_ZERO_HPP
+
static int pd_instruction_alignment() {
return 1;
}
@@ -30,3 +33,5 @@
static const char* pd_cpu_opts() {
return "";
}
+
+#endif // CPU_ZERO_VM_DISASSEMBLER_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/dump_zero.cpp b/hotspot/src/cpu/zero/vm/dump_zero.cpp
index 5ff4d60d59f..c9f341bdc05 100644
--- a/hotspot/src/cpu/zero/vm/dump_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/dump_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,11 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_dump_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_zero.inline.hpp"
+#include "memory/compactingPermGenGen.hpp"
+#include "memory/generation.inline.hpp"
+#include "memory/space.inline.hpp"
void CompactingPermGenGen::generate_vtable_methods(void** vtbl_list,
void** vtable,
diff --git a/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp b/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp
index 95643f906a9..434b11adf1f 100644
--- a/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2008, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,12 @@
*
*/
+#ifndef CPU_ZERO_VM_ENTRYFRAME_ZERO_HPP
+#define CPU_ZERO_VM_ENTRYFRAME_ZERO_HPP
+
+#include "runtime/javaCalls.hpp"
+#include "stack_zero.hpp"
+
// | ... |
// +--------------------+ ------------------
// | parameter n-1 | low addresses
@@ -63,3 +69,5 @@ class EntryFrame : public ZeroFrame {
char* valuebuf,
int buflen) const;
};
+
+#endif // CPU_ZERO_VM_ENTRYFRAME_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/entry_zero.hpp b/hotspot/src/cpu/zero/vm/entry_zero.hpp
index ed7dff57720..78e25a6757d 100644
--- a/hotspot/src/cpu/zero/vm/entry_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/entry_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_ENTRY_ZERO_HPP
+#define CPU_ZERO_VM_ENTRY_ZERO_HPP
+
class ZeroEntry {
public:
ZeroEntry() {
@@ -72,3 +75,5 @@ class ZeroEntry {
return byte_offset_of(ZeroEntry, _entry_point);
}
};
+
+#endif // CPU_ZERO_VM_ENTRY_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/fakeStubFrame_zero.hpp b/hotspot/src/cpu/zero/vm/fakeStubFrame_zero.hpp
index ccaf9f5bb71..b7a3b01ca80 100644
--- a/hotspot/src/cpu/zero/vm/fakeStubFrame_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/fakeStubFrame_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2008, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,11 @@
*
*/
+#ifndef CPU_ZERO_VM_FAKESTUBFRAME_ZERO_HPP
+#define CPU_ZERO_VM_FAKESTUBFRAME_ZERO_HPP
+
+#include "stack_zero.hpp"
+
// | ... |
// +--------------------+ ------------------
// | frame_type | low addresses
@@ -51,3 +56,5 @@ class FakeStubFrame : public ZeroFrame {
char* valuebuf,
int buflen) const {}
};
+
+#endif // CPU_ZERO_VM_FAKESTUBFRAME_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/frame_zero.cpp b/hotspot/src/cpu/zero/vm/frame_zero.cpp
index cc68ec905e6..a1e5ea6cfa1 100644
--- a/hotspot/src/cpu/zero/vm/frame_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/frame_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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.
*
@@ -23,8 +23,26 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_frame_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "code/scopeDesc.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/monitorChunk.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "vmreg_zero.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#include "runtime/vframeArray.hpp"
+#endif
#ifdef ASSERT
void RegisterMap::check_location_valid() {
diff --git a/hotspot/src/cpu/zero/vm/frame_zero.hpp b/hotspot/src/cpu/zero/vm/frame_zero.hpp
index f70e8d44148..56f0a1716b0 100644
--- a/hotspot/src/cpu/zero/vm/frame_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/frame_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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.
*
@@ -23,6 +23,12 @@
*
*/
+#ifndef CPU_ZERO_VM_FRAME_ZERO_HPP
+#define CPU_ZERO_VM_FRAME_ZERO_HPP
+
+#include "runtime/synchronizer.hpp"
+#include "utilities/top.hpp"
+
// A frame represents a physical stack frame on the Zero stack.
public:
@@ -72,3 +78,5 @@
outputStream* st,
char* buf,
int buflen) const;
+
+#endif // CPU_ZERO_VM_FRAME_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp
index 50fda705ad9..9ad237de945 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, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
+#define CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
+
// Constructors
inline frame::frame() {
@@ -149,3 +152,5 @@ inline intptr_t* frame::unextended_sp() const {
else
return (intptr_t *) -1;
}
+
+#endif // CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
diff --git a/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp b/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp
index 2ab140aa4c5..ceb010f3cc8 100644
--- a/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_GLOBALDEFINITIONS_ZERO_HPP
+#define CPU_ZERO_VM_GLOBALDEFINITIONS_ZERO_HPP
+
#include
+
+#endif // CPU_ZERO_VM_GLOBALDEFINITIONS_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/globals_zero.hpp b/hotspot/src/cpu/zero/vm/globals_zero.hpp
index d55a9ca29ec..88c7d0888df 100644
--- a/hotspot/src/cpu/zero/vm/globals_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, 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.
*
@@ -23,6 +23,12 @@
*
*/
+#ifndef CPU_ZERO_VM_GLOBALS_ZERO_HPP
+#define CPU_ZERO_VM_GLOBALS_ZERO_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
// Set the default values for platform dependent flags used by the
// runtime system. See globals.hpp for details of what they do.
@@ -47,3 +53,5 @@ define_pd_global(bool, RewriteBytecodes, true);
define_pd_global(bool, RewriteFrequentPairs, true);
define_pd_global(bool, UseMembar, false);
+
+#endif // CPU_ZERO_VM_GLOBALS_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp
index 3291c387dba..85e9f729140 100644
--- a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,16 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_icBuffer_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_zero.inline.hpp"
+#include "code/icBuffer.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/resourceArea.hpp"
+#include "nativeInst_zero.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
int InlineCacheBuffer::ic_stub_code_size() {
// NB set this once the functions below are implemented
diff --git a/hotspot/src/cpu/zero/vm/icache_zero.cpp b/hotspot/src/cpu/zero/vm/icache_zero.cpp
index 5253ff55e7a..b37465016dd 100644
--- a/hotspot/src/cpu/zero/vm/icache_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/icache_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_icache_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_zero.inline.hpp"
+#include "runtime/icache.hpp"
void ICacheStubGenerator::generate_icache_flush(
ICache::flush_icache_stub_t* flush_icache_stub) {
diff --git a/hotspot/src/cpu/zero/vm/icache_zero.hpp b/hotspot/src/cpu/zero/vm/icache_zero.hpp
index 7dd2bcb79e3..2383d211e2e 100644
--- a/hotspot/src/cpu/zero/vm/icache_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/icache_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_ICACHE_ZERO_HPP
+#define CPU_ZERO_VM_ICACHE_ZERO_HPP
+
// Interface for updating the instruction cache. Whenever the VM
// modifies code, part of the processor instruction cache potentially
// has to be flushed. This implementation is empty: Zero never deals
@@ -34,3 +37,5 @@ class ICache : public AbstractICache {
static void invalidate_word(address addr) {}
static void invalidate_range(address start, int nbytes) {}
};
+
+#endif // CPU_ZERO_VM_ICACHE_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp b/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp
index 1e7f6703a71..8b470ebcee7 100644
--- a/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,22 @@
*
*/
+#include "precompiled.hpp"
+#include "interp_masm_zero.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "oops/arrayOop.hpp"
+#include "oops/markOop.hpp"
+#include "oops/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "runtime/basicLock.hpp"
+#include "runtime/biasedLocking.hpp"
+#include "runtime/sharedRuntime.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+
// This file is intentionally empty
diff --git a/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp b/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp
index 75b9be05e04..493f0b7909d 100644
--- a/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,12 @@
*
*/
+#ifndef CPU_ZERO_VM_INTERP_MASM_ZERO_HPP
+#define CPU_ZERO_VM_INTERP_MASM_ZERO_HPP
+
+#include "assembler_zero.inline.hpp"
+#include "interpreter/invocationCounter.hpp"
+
// This file specializes the assember with interpreter-specific macros
class InterpreterMacroAssembler : public MacroAssembler {
@@ -36,3 +42,5 @@ class InterpreterMacroAssembler : public MacroAssembler {
ShouldNotCallThis();
}
};
+
+#endif // CPU_ZERO_VM_INTERP_MASM_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp b/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp
index e0f3a5eac76..0e2b7888077 100644
--- a/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2008, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,14 @@
*
*/
+#ifndef CPU_ZERO_VM_INTERPRETERFRAME_ZERO_HPP
+#define CPU_ZERO_VM_INTERPRETERFRAME_ZERO_HPP
+
+#include "interpreter/bytecodeInterpreter.hpp"
+#include "oops/methodOop.hpp"
+#include "runtime/thread.hpp"
+#include "stack_zero.hpp"
+
#ifdef CC_INTERP
// | ... |
// +--------------------+ ------------------
@@ -71,3 +79,5 @@ class InterpreterFrame : public ZeroFrame {
int buflen) const;
};
#endif // CC_INTERP
+
+#endif // CPU_ZERO_VM_INTERPRETERFRAME_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp b/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp
index 2f0ce7ad11e..fe9acbf7595 100644
--- a/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP
+#define CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP
+
// Generation of Interpreter
//
friend class AbstractInterpreterGenerator;
@@ -35,3 +38,5 @@
address generate_empty_entry();
address generate_accessor_entry();
address generate_method_handle_entry();
+
+#endif // CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp b/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp
index c8c50a47aa1..785645ac77e 100644
--- a/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,18 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_interpreterRT_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/signature.hpp"
+#include "stack_zero.inline.hpp"
void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_int() {
push(T_INT);
diff --git a/hotspot/src/cpu/zero/vm/interpreterRT_zero.hpp b/hotspot/src/cpu/zero/vm/interpreterRT_zero.hpp
index 5ff34d99bb5..6330dd4fe4b 100644
--- a/hotspot/src/cpu/zero/vm/interpreterRT_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/interpreterRT_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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.
*
@@ -23,6 +23,11 @@
*
*/
+#ifndef CPU_ZERO_VM_INTERPRETERRT_ZERO_HPP
+#define CPU_ZERO_VM_INTERPRETERRT_ZERO_HPP
+
+#include "memory/allocation.hpp"
+
class SignatureHandler {
public:
static SignatureHandler *from_handlerAddr(address handlerAddr) {
@@ -125,3 +130,5 @@ class SlowSignatureHandlerGenerator : public SignatureHandlerGeneratorBase {
return (SignatureHandler *) cif();
}
};
+
+#endif // CPU_ZERO_VM_INTERPRETERRT_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp
index a74cef8ae01..027d372a2f6 100644
--- a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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.
*
@@ -23,8 +23,32 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_interpreter_zero.cpp.incl"
+#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/methodDataOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/jvmtiExport.hpp"
+#include "prims/jvmtiThreadState.hpp"
+#include "prims/methodHandles.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"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
address AbstractInterpreterGenerator::generate_slow_signature_handler() {
_masm->advance(1);
diff --git a/hotspot/src/cpu/zero/vm/interpreter_zero.hpp b/hotspot/src/cpu/zero/vm/interpreter_zero.hpp
index 192fe210391..b7b0f1d8b32 100644
--- a/hotspot/src/cpu/zero/vm/interpreter_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/interpreter_zero.hpp
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_INTERPRETER_ZERO_HPP
+#define CPU_ZERO_VM_INTERPRETER_ZERO_HPP
+
public:
static void invoke_method(methodOop method, address entry_point, TRAPS) {
((ZeroEntry *) entry_point)->invoke(method, THREAD);
@@ -47,3 +50,5 @@
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/javaFrameAnchor_zero.hpp b/hotspot/src/cpu/zero/vm/javaFrameAnchor_zero.hpp
index 0763790b64e..275fcf53dca 100644
--- a/hotspot/src/cpu/zero/vm/javaFrameAnchor_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/javaFrameAnchor_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_JAVAFRAMEANCHOR_ZERO_HPP
+#define CPU_ZERO_VM_JAVAFRAMEANCHOR_ZERO_HPP
+
private:
ZeroFrame* volatile _last_Java_fp;
@@ -89,3 +92,5 @@
static ByteSize last_Java_fp_offset() {
return byte_offset_of(JavaFrameAnchor, _last_Java_fp);
}
+
+#endif // CPU_ZERO_VM_JAVAFRAMEANCHOR_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/jniFastGetField_zero.cpp b/hotspot/src/cpu/zero/vm/jniFastGetField_zero.cpp
index 1d089430b97..d37ed807b69 100644
--- a/hotspot/src/cpu/zero/vm/jniFastGetField_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/jniFastGetField_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,12 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_jniFastGetField_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_zero.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm_misc.hpp"
+#include "runtime/safepoint.hpp"
address JNI_FastGetField::generate_fast_get_boolean_field() {
return (address) -1;
diff --git a/hotspot/src/cpu/zero/vm/jniTypes_zero.hpp b/hotspot/src/cpu/zero/vm/jniTypes_zero.hpp
index 0ee26a77215..766b5e1d6bc 100644
--- a/hotspot/src/cpu/zero/vm/jniTypes_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/jniTypes_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,13 @@
*
*/
+#ifndef CPU_ZERO_VM_JNITYPES_ZERO_HPP
+#define CPU_ZERO_VM_JNITYPES_ZERO_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/oop.hpp"
+#include "prims/jni.h"
+
// This file holds platform-dependent routines used to write primitive jni
// types to the array of arguments passed into JavaCalls::call
@@ -106,3 +113,5 @@ public:
#endif
};
+
+#endif // CPU_ZERO_VM_JNITYPES_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/jni_zero.h b/hotspot/src/cpu/zero/vm/jni_zero.h
index e814a9e1c9c..0e21634dff6 100644
--- a/hotspot/src/cpu/zero/vm/jni_zero.h
+++ b/hotspot/src/cpu/zero/vm/jni_zero.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
diff --git a/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp b/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp
index fa6e675f93f..b76b2a7c2f9 100644
--- a/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,10 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_methodHandles_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "memory/allocation.inline.hpp"
+#include "prims/methodHandles.hpp"
int MethodHandles::adapter_conversion_ops_supported_mask() {
ShouldNotCallThis();
diff --git a/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp b/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp
index 60fb24f2d1d..98a2121a8da 100644
--- a/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2008 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,18 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_nativeInst_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "assembler_zero.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "nativeInst_zero.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "utilities/ostream.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
// This method is called by nmethod::make_not_entrant_or_zombie to
// insert a jump to SharedRuntime::get_handle_wrong_method_stub()
diff --git a/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp b/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp
index 005574dff28..16d1d3f0dee 100644
--- a/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,15 @@
*
*/
+#ifndef CPU_ZERO_VM_NATIVEINST_ZERO_HPP
+#define CPU_ZERO_VM_NATIVEINST_ZERO_HPP
+
+#include "asm/assembler.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/icache.hpp"
+#include "runtime/os.hpp"
+#include "utilities/top.hpp"
+
// We have interfaces for the following instructions:
// - NativeInstruction
// - - NativeCall
@@ -183,3 +192,5 @@ class NativeGeneralJump : public NativeInstruction {
inline NativeGeneralJump* nativeGeneralJump_at(address address) {
ShouldNotCallThis();
}
+
+#endif // CPU_ZERO_VM_NATIVEINST_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/registerMap_zero.hpp b/hotspot/src/cpu/zero/vm/registerMap_zero.hpp
index 64a6b65afae..6c9e0e6827b 100644
--- a/hotspot/src/cpu/zero/vm/registerMap_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/registerMap_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef CPU_ZERO_VM_REGISTERMAP_ZERO_HPP
+#define CPU_ZERO_VM_REGISTERMAP_ZERO_HPP
+
// machine-dependent implemention for register maps
friend class frame;
@@ -37,3 +40,5 @@
void pd_clear() {}
void pd_initialize() {}
void pd_initialize_from(const RegisterMap* map) {}
+
+#endif // CPU_ZERO_VM_REGISTERMAP_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp b/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp
index 1e7f6703a71..4ed89fe2b28 100644
--- a/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,10 @@
*
*/
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "asm/register.hpp"
+#include "interp_masm_zero.hpp"
+#include "register_zero.hpp"
+
// This file is intentionally empty
diff --git a/hotspot/src/cpu/zero/vm/register_zero.cpp b/hotspot/src/cpu/zero/vm/register_zero.cpp
index ddea3c248ff..31bee7baf78 100644
--- a/hotspot/src/cpu/zero/vm/register_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/register_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,8 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_register_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "register_zero.hpp"
const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers;
const int ConcreteRegisterImpl::max_fpr =
diff --git a/hotspot/src/cpu/zero/vm/register_zero.hpp b/hotspot/src/cpu/zero/vm/register_zero.hpp
index 65f5ca6eda9..0bcc7638248 100644
--- a/hotspot/src/cpu/zero/vm/register_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/register_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,12 @@
*
*/
+#ifndef CPU_ZERO_VM_REGISTER_ZERO_HPP
+#define CPU_ZERO_VM_REGISTER_ZERO_HPP
+
+#include "asm/register.hpp"
+#include "vm_version_zero.hpp"
+
class VMRegImpl;
typedef VMRegImpl* VMReg;
@@ -108,3 +114,5 @@ class ConcreteRegisterImpl : public AbstractRegisterImpl {
};
CONSTANT_REGISTER_DECLARATION(Register, noreg, (-1));
+
+#endif // CPU_ZERO_VM_REGISTER_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp b/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp
index 637d9c799d8..e04acad8fd0 100644
--- a/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,13 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_relocInfo_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.inline.hpp"
+#include "assembler_zero.inline.hpp"
+#include "code/relocInfo.hpp"
+#include "nativeInst_zero.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/safepoint.hpp"
void Relocation::pd_set_data_value(address x, intptr_t o) {
ShouldNotCallThis();
diff --git a/hotspot/src/cpu/zero/vm/relocInfo_zero.hpp b/hotspot/src/cpu/zero/vm/relocInfo_zero.hpp
index 6abcb888152..75cf0eaf9af 100644
--- a/hotspot/src/cpu/zero/vm/relocInfo_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/relocInfo_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_RELOCINFO_ZERO_HPP
+#define CPU_ZERO_VM_RELOCINFO_ZERO_HPP
+
// machine-dependent parts of class relocInfo
private:
enum {
@@ -30,3 +33,5 @@
offset_unit = 1,
format_width = 1
};
+
+#endif // CPU_ZERO_VM_RELOCINFO_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp b/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp
index 2fa914482eb..b88c5e810f6 100644
--- a/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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.
*
@@ -23,8 +23,28 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_sharedRuntime_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_zero.inline.hpp"
+#include "code/debugInfoRec.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "oops/compiledICHolderOop.hpp"
+#include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/vframeArray.hpp"
+#include "vmreg_zero.inline.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
+#ifdef SHARK
+#include "compiler/compileBroker.hpp"
+#include "shark/sharkCompiler.hpp"
+#endif
DeoptimizationBlob *SharedRuntime::_deopt_blob;
SafepointBlob *SharedRuntime::_polling_page_safepoint_handler_blob;
diff --git a/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp b/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp
index 4cea6594d32..0dd4b0a52d7 100644
--- a/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,6 +23,12 @@
*
*/
+#ifndef CPU_ZERO_VM_SHARKFRAME_ZERO_HPP
+#define CPU_ZERO_VM_SHARKFRAME_ZERO_HPP
+
+#include "oops/methodOop.hpp"
+#include "stack_zero.hpp"
+
// | ... |
// +--------------------+ ------------------
// | stack slot n-1 | low addresses
@@ -77,3 +83,5 @@ class SharkFrame : public ZeroFrame {
char* valuebuf,
int buflen) const;
};
+
+#endif // CPU_ZERO_VM_SHARKFRAME_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp b/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp
index 30151973840..32a2646139f 100644
--- a/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_SHARK_GLOBALS_ZERO_HPP
+#define CPU_ZERO_VM_SHARK_GLOBALS_ZERO_HPP
+
// Set the default values for platform dependent flags used by the
// Shark compiler. See globals.hpp for details of what they do.
@@ -60,3 +63,5 @@ define_pd_global(uintx, MaxPermSize, 64*M );
define_pd_global(bool, NeverActAsServerClassMachine, true );
define_pd_global(uint64_t, MaxRAM, 1ULL*G);
define_pd_global(bool, CICompileOSR, true );
+
+#endif // CPU_ZERO_VM_SHARK_GLOBALS_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/stack_zero.cpp b/hotspot/src/cpu/zero/vm/stack_zero.cpp
index 59e94978baf..f1b31cc95ae 100644
--- a/hotspot/src/cpu/zero/vm/stack_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/stack_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,10 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_stack_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "stack_zero.hpp"
+#include "stack_zero.inline.hpp"
int ZeroStack::suggest_size(Thread *thread) const {
assert(needs_setup(), "already set up");
diff --git a/hotspot/src/cpu/zero/vm/stack_zero.hpp b/hotspot/src/cpu/zero/vm/stack_zero.hpp
index 304944aa1a2..5f34b7c1cb7 100644
--- a/hotspot/src/cpu/zero/vm/stack_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/stack_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,11 @@
*
*/
+#ifndef CPU_ZERO_VM_STACK_ZERO_HPP
+#define CPU_ZERO_VM_STACK_ZERO_HPP
+
+#include "utilities/sizes.hpp"
+
class ZeroStack {
private:
intptr_t *_base; // the last available word
@@ -217,3 +222,5 @@ class ZeroFrame {
char* fieldbuf,
int buflen) const;
};
+
+#endif // CPU_ZERO_VM_STACK_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp b/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp
index 516312f436a..f0387bb7bfd 100644
--- a/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp
+++ b/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,12 @@
*
*/
+#ifndef CPU_ZERO_VM_STACK_ZERO_INLINE_HPP
+#define CPU_ZERO_VM_STACK_ZERO_INLINE_HPP
+
+#include "runtime/thread.hpp"
+#include "stack_zero.hpp"
+
// This function should match SharkStack::CreateStackOverflowCheck
inline void ZeroStack::overflow_check(int required_words, TRAPS) {
// Check the Zero stack
@@ -46,3 +52,5 @@ inline int ZeroStack::abi_stack_available(Thread *thread) const {
int stack_free = thread->stack_size() - stack_used;
return stack_free - shadow_pages_size();
}
+
+#endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP
diff --git a/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp b/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp
index ada26e089bc..77d23a4ffb7 100644
--- a/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,29 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_stubGenerator_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_zero.inline.hpp"
+#include "interpreter/interpreter.hpp"
+#include "nativeInst_zero.hpp"
+#include "oops/instanceOop.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
+#include "prims/methodHandles.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "stack_zero.inline.hpp"
+#include "utilities/top.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
// Declaration and definition of StubGenerator (no .hpp file).
// For a more detailed description of the stub routine structure
diff --git a/hotspot/src/cpu/zero/vm/stubRoutines_zero.cpp b/hotspot/src/cpu/zero/vm/stubRoutines_zero.cpp
index ba92c3b9324..4a8c7cb9329 100644
--- a/hotspot/src/cpu/zero/vm/stubRoutines_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/stubRoutines_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,8 +23,13 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/deoptimization.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/stubRoutines.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "thread_linux.inline.hpp"
+#endif
#ifdef IA32
address StubRoutines::x86::_call_stub_compiled_return = NULL;
diff --git a/hotspot/src/cpu/zero/vm/stubRoutines_zero.hpp b/hotspot/src/cpu/zero/vm/stubRoutines_zero.hpp
index b088f548a36..d4d521b4bc4 100644
--- a/hotspot/src/cpu/zero/vm/stubRoutines_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/stubRoutines_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_STUBROUTINES_ZERO_HPP
+#define CPU_ZERO_VM_STUBROUTINES_ZERO_HPP
+
// This file holds the platform specific parts of the StubRoutines
// definition. See stubRoutines.hpp for a description on how to
// extend it.
@@ -53,3 +56,5 @@
static address _call_stub_compiled_return;
};
#endif // IA32
+
+#endif // CPU_ZERO_VM_STUBROUTINES_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp b/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp
index 1e7f6703a71..1747bc6ea26 100644
--- a/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,9 @@
*
*/
+#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
index 1e7f6703a71..53486a3907b 100644
--- a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,27 @@
*
*/
+#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/methodDataOop.hpp"
+#include "oops/methodOop.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
index 1e7f6703a71..fb0e266a3a9 100644
--- a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,9 @@
*
*/
+#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
index 1e7f6703a71..e5fb7b17f7a 100644
--- a/hotspot/src/cpu/zero/vm/templateTable_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/templateTable_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,17 @@
*
*/
+#include "precompiled.hpp"
+#include "interpreter/interpreter.hpp"
+#include "interpreter/interpreterRuntime.hpp"
+#include "interpreter/templateTable.hpp"
+#include "memory/universe.inline.hpp"
+#include "oops/methodDataOop.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
index 1e7f6703a71..6fc38560522 100644
--- a/hotspot/src/cpu/zero/vm/templateTable_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/templateTable_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,9 @@
*
*/
+#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/cpu/zero/vm/vmStructs_zero.hpp b/hotspot/src/cpu/zero/vm/vmStructs_zero.hpp
index 872d37fcc25..1b3815a0a2c 100644
--- a/hotspot/src/cpu/zero/vm/vmStructs_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/vmStructs_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_VMSTRUCTS_ZERO_HPP
+#define CPU_ZERO_VM_VMSTRUCTS_ZERO_HPP
+
// These are the CPU-specific fields, types and integer
// constants required by the Serviceability Agent. This file is
// referenced by vmStructs.cpp.
@@ -50,3 +53,5 @@
/* NOTE that we do not use the last_entry() macro here; it is used */
/* in vmStructs__.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */
/* be present there) */
+
+#endif // CPU_ZERO_VM_VMSTRUCTS_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/vm_version_zero.cpp b/hotspot/src/cpu/zero/vm/vm_version_zero.cpp
index 1e7f6703a71..87ff88be5ae 100644
--- a/hotspot/src/cpu/zero/vm/vm_version_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/vm_version_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,14 @@
*
*/
+#include "precompiled.hpp"
+#include "assembler_zero.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/java.hpp"
+#include "runtime/stubCodeGenerator.hpp"
+#include "vm_version_zero.hpp"
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+
// This file is intentionally empty
diff --git a/hotspot/src/cpu/zero/vm/vm_version_zero.hpp b/hotspot/src/cpu/zero/vm/vm_version_zero.hpp
index c16ab5ddc71..78109b933f4 100644
--- a/hotspot/src/cpu/zero/vm/vm_version_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/vm_version_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,9 +23,17 @@
*
*/
+#ifndef CPU_ZERO_VM_VM_VERSION_ZERO_HPP
+#define CPU_ZERO_VM_VM_VERSION_ZERO_HPP
+
+#include "runtime/globals_extension.hpp"
+#include "runtime/vm_version.hpp"
+
class VM_Version : public Abstract_VM_Version {
public:
static const char* cpu_features() {
return "";
}
};
+
+#endif // CPU_ZERO_VM_VM_VERSION_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/vmreg_zero.cpp b/hotspot/src/cpu/zero/vm/vmreg_zero.cpp
index 8385cb976dc..a5181cf8f53 100644
--- a/hotspot/src/cpu/zero/vm/vmreg_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/vmreg_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_vmreg_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "code/vmreg.hpp"
void VMRegImpl::set_regName() {
int i = 0;
diff --git a/hotspot/src/cpu/zero/vm/vmreg_zero.hpp b/hotspot/src/cpu/zero/vm/vmreg_zero.hpp
index 6234fdd6f85..60354a11ca0 100644
--- a/hotspot/src/cpu/zero/vm/vmreg_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/vmreg_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,8 +22,13 @@
*
*/
+#ifndef CPU_ZERO_VM_VMREG_ZERO_HPP
+#define CPU_ZERO_VM_VMREG_ZERO_HPP
+
bool is_Register();
Register as_Register();
bool is_FloatRegister();
FloatRegister as_FloatRegister();
+
+#endif // CPU_ZERO_VM_VMREG_ZERO_HPP
diff --git a/hotspot/src/cpu/zero/vm/vmreg_zero.inline.hpp b/hotspot/src/cpu/zero/vm/vmreg_zero.inline.hpp
index 56c7b8712ce..0c771062a25 100644
--- a/hotspot/src/cpu/zero/vm/vmreg_zero.inline.hpp
+++ b/hotspot/src/cpu/zero/vm/vmreg_zero.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef CPU_ZERO_VM_VMREG_ZERO_INLINE_HPP
+#define CPU_ZERO_VM_VMREG_ZERO_INLINE_HPP
+
inline VMReg RegisterImpl::as_VMReg() {
return VMRegImpl::as_VMReg(encoding());
}
@@ -30,3 +33,5 @@ inline VMReg RegisterImpl::as_VMReg() {
inline VMReg FloatRegisterImpl::as_VMReg() {
return VMRegImpl::as_VMReg(encoding() + ConcreteRegisterImpl::max_gpr);
}
+
+#endif // CPU_ZERO_VM_VMREG_ZERO_INLINE_HPP
diff --git a/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp b/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp
index 13605d9362d..e4ea32e44c1 100644
--- a/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,19 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_vtableStubs_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_zero.inline.hpp"
+#include "code/vtableStubs.hpp"
+#include "interp_masm_zero.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klassVtable.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "vmreg_zero.inline.hpp"
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
ShouldNotCallThis();
diff --git a/hotspot/src/os/linux/launcher/java.h b/hotspot/src/os/linux/launcher/java.h
deleted file mode 100644
index 88b0ccb541d..00000000000
--- a/hotspot/src/os/linux/launcher/java.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- */
-
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- */
-
-#ifndef _JAVA_H_
-#define _JAVA_H_
-
-/*
- * Get system specific defines.
- */
-#include "jni.h"
-#include "java_md.h"
-
-/*
- * Pointers to the needed JNI invocation API, initialized by LoadJavaVM.
- */
-typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args);
-typedef jint (JNICALL *GetDefaultJavaVMInitArgs_t)(void *args);
-
-typedef struct {
- CreateJavaVM_t CreateJavaVM;
- GetDefaultJavaVMInitArgs_t GetDefaultJavaVMInitArgs;
-} InvocationFunctions;
-
-/*
- * Prototypes for launcher functions in the system specific java_md.c.
- */
-
-jboolean
-LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn);
-
-void
-GetXUsagePath(char *buf, jint bufsize);
-
-jboolean
-GetApplicationHome(char *buf, jint bufsize);
-
-const char *
-GetArch();
-
-void CreateExecutionEnvironment(int *_argc,
- char ***_argv,
- char jrepath[],
- jint so_jrepath,
- char jvmpath[],
- jint so_jvmpath,
- char **original_argv);
-
-/*
- * Report an error message to stderr or a window as appropriate. The
- * flag always is set to JNI_TRUE if message is to be reported to both
- * strerr and windows and set to JNI_FALSE if the message should only
- * be sent to a window.
- */
-void ReportErrorMessage(char * message, jboolean always);
-void ReportErrorMessage2(char * format, char * string, jboolean always);
-
-/*
- * Report an exception which terminates the vm to stderr or a window
- * as appropriate.
- */
-void ReportExceptionDescription(JNIEnv * env);
-
-jboolean RemovableMachineDependentOption(char * option);
-void PrintMachineDependentOptions();
-
-/*
- * Functions defined in java.c and used in java_md.c.
- */
-jint ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative);
-char *CheckJvmType(int *argc, char ***argv, jboolean speculative);
-void* MemAlloc(size_t size);
-
-/*
- * Make launcher spit debug output.
- */
-extern jboolean _launcher_debug;
-/*
- * This allows for finding classes from the VM's bootstrap class loader
- * directly, FindClass uses the application class loader internally, this will
- * cause unnecessary searching of the classpath for the required classes.
- */
-typedef jclass (JNICALL FindClassFromBootLoader_t(JNIEnv *env,
- const char *name,
- jboolean throwError));
-
-jclass FindBootStrapClass(JNIEnv *env, const char *classname);
-
-#endif /* _JAVA_H_ */
diff --git a/hotspot/src/os/linux/vm/attachListener_linux.cpp b/hotspot/src/os/linux/vm/attachListener_linux.cpp
index a97f5869b61..5b9c7294995 100644
--- a/hotspot/src/os/linux/vm/attachListener_linux.cpp
+++ b/hotspot/src/os/linux/vm/attachListener_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_attachListener_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/os.hpp"
+#include "services/attachListener.hpp"
+#include "services/dtraceAttacher.hpp"
#include
#include
diff --git a/hotspot/src/os/linux/vm/c1_globals_linux.hpp b/hotspot/src/os/linux/vm/c1_globals_linux.hpp
index 301d169c178..0507898060a 100644
--- a/hotspot/src/os/linux/vm/c1_globals_linux.hpp
+++ b/hotspot/src/os/linux/vm/c1_globals_linux.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,15 @@
*
*/
+#ifndef OS_LINUX_VM_C1_GLOBALS_LINUX_HPP
+#define OS_LINUX_VM_C1_GLOBALS_LINUX_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_LINUX_VM_C1_GLOBALS_LINUX_HPP
diff --git a/hotspot/src/os/linux/vm/c2_globals_linux.hpp b/hotspot/src/os/linux/vm/c2_globals_linux.hpp
index b14af55c55c..d81638946c4 100644
--- a/hotspot/src/os/linux/vm/c2_globals_linux.hpp
+++ b/hotspot/src/os/linux/vm/c2_globals_linux.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,15 @@
*
*/
+#ifndef OS_LINUX_VM_C2_GLOBALS_LINUX_HPP
+#define OS_LINUX_VM_C2_GLOBALS_LINUX_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
//
// Sets the default values for operating system dependent flags used by the
// server compiler. (see c2_globals.hpp)
//
+
+#endif // OS_LINUX_VM_C2_GLOBALS_LINUX_HPP
diff --git a/hotspot/src/os/linux/vm/chaitin_linux.cpp b/hotspot/src/os/linux/vm/chaitin_linux.cpp
index 461ad342c53..e4925644dbc 100644
--- a/hotspot/src/os/linux/vm/chaitin_linux.cpp
+++ b/hotspot/src/os/linux/vm/chaitin_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_chaitin_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/machnode.hpp"
void PhaseRegAlloc::pd_preallocate_hook() {
// no action
diff --git a/hotspot/src/os/linux/vm/decoder_linux.cpp b/hotspot/src/os/linux/vm/decoder_linux.cpp
new file mode 100644
index 00000000000..88da33b65b3
--- /dev/null
+++ b/hotspot/src/os/linux/vm/decoder_linux.cpp
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ *
+ */
+
+#include "prims/jvm.h"
+#include "utilities/decoder.hpp"
+
+#include
+
+bool Decoder::demangle(const char* symbol, char *buf, int buflen) {
+ int status;
+ char* result;
+ size_t size = (size_t)buflen;
+
+ // Don't pass buf to __cxa_demangle. In case of the 'buf' is too small,
+ // __cxa_demangle will call system "realloc" for additional memory, which
+ // may use different malloc/realloc mechanism that allocates 'buf'.
+ if ((result = abi::__cxa_demangle(symbol, NULL, NULL, &status)) != NULL) {
+ jio_snprintf(buf, buflen, "%s", result);
+ // call c library's free
+ ::free(result);
+ return true;
+ }
+ return false;
+}
diff --git a/hotspot/src/os/linux/vm/dtraceJSDT_linux.cpp b/hotspot/src/os/linux/vm/dtraceJSDT_linux.cpp
index a7be2486e13..0f340fb5730 100644
--- a/hotspot/src/os/linux/vm/dtraceJSDT_linux.cpp
+++ b/hotspot/src/os/linux/vm/dtraceJSDT_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,16 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_dtraceJSDT_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "code/codeBlob.hpp"
+#include "memory/allocation.hpp"
+#include "prims/jvm.h"
+#include "runtime/dtraceJSDT.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/os.hpp"
+#include "runtime/signature.hpp"
+#include "utilities/globalDefinitions.hpp"
int DTraceJSDT::pd_activate(
void* baseAddress, jstring module,
diff --git a/hotspot/src/os/linux/vm/globals_linux.hpp b/hotspot/src/os/linux/vm/globals_linux.hpp
index 75b31373703..cd74589e40c 100644
--- a/hotspot/src/os/linux/vm/globals_linux.hpp
+++ b/hotspot/src/os/linux/vm/globals_linux.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_LINUX_VM_GLOBALS_LINUX_HPP
+#define OS_LINUX_VM_GLOBALS_LINUX_HPP
+
//
// Defines Linux specific flags. They are not available on other platforms.
//
@@ -42,3 +45,5 @@ define_pd_global(bool, UseLargePages, false);
define_pd_global(bool, UseLargePagesIndividualAllocation, false);
define_pd_global(bool, UseOSErrorReporting, false);
define_pd_global(bool, UseThreadPriorities, true) ;
+
+#endif // OS_LINUX_VM_GLOBALS_LINUX_HPP
diff --git a/hotspot/src/os/linux/vm/hpi_linux.cpp b/hotspot/src/os/linux/vm/hpi_linux.cpp
deleted file mode 100644
index 04bec5d2db0..00000000000
--- a/hotspot/src/os/linux/vm/hpi_linux.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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 "incls/_precompiled.incl"
-# include "incls/_hpi_linux.cpp.incl"
-
-# include
-# include
-
-typedef jint (JNICALL *init_t)(GetInterfaceFunc *, void *);
-
-void hpi::initialize_get_interface(vm_calls_t *callbacks) {
- char buf[JVM_MAXPATHLEN];
- void *hpi_handle;
- GetInterfaceFunc& getintf = _get_interface;
- jint (JNICALL * DLL_Initialize)(GetInterfaceFunc *, void *);
-
- if (HPILibPath && HPILibPath[0]) {
- strncpy(buf, HPILibPath, JVM_MAXPATHLEN - 1);
- buf[JVM_MAXPATHLEN - 1] = '\0';
- } else {
- const char *thread_type = "native_threads";
-
- os::jvm_path(buf, JVM_MAXPATHLEN);
-
-#ifdef PRODUCT
- const char * hpi_lib = "/libhpi.so";
-#else
- char * ptr = strrchr(buf, '/');
- assert(strstr(ptr, "/libjvm") == ptr, "invalid library name");
- const char * hpi_lib = strstr(ptr, "_g") ? "/libhpi_g.so" : "/libhpi.so";
-#endif
-
- *(strrchr(buf, '/')) = '\0'; /* get rid of /libjvm.so */
- char* p = strrchr(buf, '/');
- if (p != NULL) p[1] = '\0'; /* get rid of hotspot */
- strcat(buf, thread_type);
- strcat(buf, hpi_lib);
- }
-
- if (TraceHPI) tty->print_cr("Loading HPI %s ", buf);
-#ifdef SPARC
- // On 64-bit Ubuntu Sparc RTLD_NOW leads to unresolved deps in libpthread.so
-# define OPEN_MODE RTLD_LAZY
-#else
- // We use RTLD_NOW because of bug 4032715
-# define OPEN_MODE RTLD_NOW
-#endif
- hpi_handle = dlopen(buf, OPEN_MODE);
-#undef OPEN_MODE
-
- if (hpi_handle == NULL) {
- if (TraceHPI) tty->print_cr("HPI dlopen failed: %s", dlerror());
- return;
- }
- DLL_Initialize = CAST_TO_FN_PTR(jint (JNICALL *)(GetInterfaceFunc *, void *),
- dlsym(hpi_handle, "DLL_Initialize"));
- if (TraceHPI && DLL_Initialize == NULL) tty->print_cr("HPI dlsym of DLL_Initialize failed: %s", dlerror());
- if (DLL_Initialize == NULL ||
- (*DLL_Initialize)(&getintf, callbacks) < 0) {
- if (TraceHPI) tty->print_cr("HPI DLL_Initialize failed");
- return;
- }
- if (TraceHPI) tty->print_cr("HPI loaded successfully");
-}
diff --git a/hotspot/src/os/linux/vm/hpi_linux.hpp b/hotspot/src/os/linux/vm/hpi_linux.hpp
deleted file mode 100644
index 5e0daf8e722..00000000000
--- a/hotspot/src/os/linux/vm/hpi_linux.hpp
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- */
-
-//
-// Because the interruptible IO has been dropped for HotSpot/Linux,
-// the following HPI interface is very different from HotSparc.
-//
-
-#include
-#include
-#include
-#include
-#include
-
-// HPI_FileInterface
-
-inline int hpi::close(int fd) {
- return ::close(fd);
-}
-
-inline size_t hpi::read(int fd, void *buf, unsigned int nBytes) {
- size_t res;
- RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res);
- return res;
-}
-
-inline size_t hpi::write(int fd, const void *buf, unsigned int nBytes) {
- size_t res;
- RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res);
- return res;
-}
-
-
-// HPI_SocketInterface
-
-inline int hpi::socket_close(int fd) {
- return ::close(fd);
-}
-
-inline int hpi::socket(int domain, int type, int protocol) {
- return ::socket(domain, type, protocol);
-}
-
-inline int hpi::recv(int fd, char *buf, int nBytes, int flags) {
- RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, (unsigned int) flags));
-}
-
-inline int hpi::send(int fd, char *buf, int nBytes, int flags) {
- RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, (unsigned int) flags));
-}
-
-inline int hpi::raw_send(int fd, char *buf, int nBytes, int flags) {
- return send(fd, buf, nBytes, flags);
-}
-
-inline int hpi::timeout(int fd, long timeout) {
- julong prevtime,newtime;
- struct timeval t;
-
- gettimeofday(&t, NULL);
- prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000;
-
- for(;;) {
- struct pollfd pfd;
-
- pfd.fd = fd;
- pfd.events = POLLIN | POLLERR;
-
- int res = ::poll(&pfd, 1, timeout);
-
- if (res == OS_ERR && errno == EINTR) {
-
- // On Linux any value < 0 means "forever"
-
- if(timeout >= 0) {
- gettimeofday(&t, NULL);
- newtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000;
- timeout -= newtime - prevtime;
- if(timeout <= 0)
- return OS_OK;
- prevtime = newtime;
- }
- } else
- return res;
- }
-}
-
-inline int hpi::listen(int fd, int count) {
- return ::listen(fd, count);
-}
-
-inline int hpi::connect(int fd, struct sockaddr *him, int len) {
- RESTARTABLE_RETURN_INT(::connect(fd, him, len));
-}
-
-inline int hpi::accept(int fd, struct sockaddr *him, int *len) {
- // This cast is from int to unsigned int on linux. Since we
- // only pass the parameter "len" around the vm and don't try to
- // fetch it's value, this cast is safe for now. The java.net group
- // may need and want to change this interface someday if socklen_t goes
- // to 64 bits on some platform that we support.
- // Linux doc says this can't return EINTR, unlike accept() on Solaris
-
- return ::accept(fd, him, (socklen_t *)len);
-}
-
-inline int hpi::recvfrom(int fd, char *buf, int nBytes, int flags,
- sockaddr *from, int *fromlen) {
- RESTARTABLE_RETURN_INT(::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen));
-}
-
-inline int hpi::sendto(int fd, char *buf, int len, int flags,
- struct sockaddr *to, int tolen) {
- RESTARTABLE_RETURN_INT(::sendto(fd, buf, len, (unsigned int) flags, to, tolen));
-}
-
-inline int hpi::socket_available(int fd, jint *pbytes) {
- // Linux doc says EINTR not returned, unlike Solaris
- int ret = ::ioctl(fd, FIONREAD, pbytes);
-
- //%% note ioctl can return 0 when successful, JVM_SocketAvailable
- // is expected to return 0 on failure and 1 on success to the jdk.
- return (ret < 0) ? 0 : 1;
-}
-
-
-// following methods have been updated to avoid problems in
-// hpi's sockets calls based on sys_api_td.c (JDK1.3)
-
-/*
-HPIDECL(socket_shutdown, "socket_shutdown", _socket, SocketShutdown,
- int, "%d",
- (int fd, int howto),
- ("fd = %d, howto = %d", fd, howto),
- (fd, howto));
- */
-inline int hpi::socket_shutdown(int fd, int howto){
- return ::shutdown(fd, howto);
-}
-
-/*
-HPIDECL(bind, "bind", _socket, Bind,
- int, "%d",
- (int fd, struct sockaddr *him, int len),
- ("fd = %d, him = %p, len = %d",
- fd, him, len),
- (fd, him, len));
-*/
-inline int hpi::bind(int fd, struct sockaddr *him, int len){
- return ::bind(fd, him, len);
-}
-
-/*
-HPIDECL(get_sock_name, "get_sock_name", _socket, GetSocketName,
- int, "%d",
- (int fd, struct sockaddr *him, int *len),
- ("fd = %d, him = %p, len = %p",
- fd, him, len),
- (fd, him, len));
- */
-inline int hpi::get_sock_name(int fd, struct sockaddr *him, int *len){
- return ::getsockname(fd, him, (socklen_t *)len);
-}
-
-/*
-HPIDECL(get_host_name, "get_host_name", _socket, GetHostName, int, "%d",
- (char *hostname, int namelen),
- ("hostname = %p, namelen = %d",
- hostname, namelen),
- (hostname, namelen));
- */
-inline int hpi::get_host_name(char* name, int namelen){
- return ::gethostname(name, namelen);
-}
-
-/*
-HPIDECL(get_sock_opt, "get_sock_opt", _socket, SocketGetOption, int, "%d",
- (int fd, int level, int optname, char *optval, int* optlen),
- ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %p",
- fd, level, optname, optval, optlen),
- (fd, level, optname, optval, optlen));
- */
-inline int hpi::get_sock_opt(int fd, int level, int optname,
- char *optval, int* optlen){
- return ::getsockopt(fd, level, optname, optval, (socklen_t *)optlen);
-}
-
-/*
-HPIDECL(set_sock_opt, "set_sock_opt", _socket, SocketSetOption, int, "%d",
- (int fd, int level, int optname, const char *optval, int optlen),
- ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %d",
- fd, level, optname, optval, optlen),
- (fd, level, optname, optval, optlen));
- */
-inline int hpi::set_sock_opt(int fd, int level, int optname,
- const char *optval, int optlen){
- return ::setsockopt(fd, level, optname, optval, optlen);
-}
-
-
-// Reconciliation History
-// hpi_solaris.hpp 1.9 99/08/30 16:31:23
-// End
diff --git a/hotspot/src/os/linux/vm/interfaceSupport_linux.hpp b/hotspot/src/os/linux/vm/interfaceSupport_linux.hpp
index acc096be80f..5ea58c3b945 100644
--- a/hotspot/src/os/linux/vm/interfaceSupport_linux.hpp
+++ b/hotspot/src/os/linux/vm/interfaceSupport_linux.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
*
*/
+#ifndef OS_LINUX_VM_INTERFACESUPPORT_LINUX_HPP
+#define OS_LINUX_VM_INTERFACESUPPORT_LINUX_HPP
+
// Contains inlined functions for class InterfaceSupport
static inline void serialize_memory(JavaThread *thread) {
os::write_memory_serialize_page(thread);
}
+
+#endif // OS_LINUX_VM_INTERFACESUPPORT_LINUX_HPP
diff --git a/hotspot/src/os/linux/vm/jsig.c b/hotspot/src/os/linux/vm/jsig.c
index 638b5e70ec5..13ddb668341 100644
--- a/hotspot/src/os/linux/vm/jsig.c
+++ b/hotspot/src/os/linux/vm/jsig.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
diff --git a/hotspot/src/os/linux/vm/jvm_linux.cpp b/hotspot/src/os/linux/vm/jvm_linux.cpp
index 0d1615eb1f2..ea5bf2d36c7 100644
--- a/hotspot/src/os/linux/vm/jvm_linux.cpp
+++ b/hotspot/src/os/linux/vm/jvm_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,8 +22,10 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_jvm_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "prims/jvm.h"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/osThread.hpp"
#include
diff --git a/hotspot/src/os/linux/vm/jvm_linux.h b/hotspot/src/os/linux/vm/jvm_linux.h
index 63ef30353c6..795fec11337 100644
--- a/hotspot/src/os/linux/vm/jvm_linux.h
+++ b/hotspot/src/os/linux/vm/jvm_linux.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_LINUX_VM_JVM_LINUX_H
+#define OS_LINUX_VM_JVM_LINUX_H
+
/*
// HotSpot integration note:
//
@@ -95,3 +98,5 @@
// Reconciliation History
// jvm_solaris.h 1.6 99/06/22 16:38:47
// End
+
+#endif // OS_LINUX_VM_JVM_LINUX_H
diff --git a/hotspot/src/os/linux/vm/mutex_linux.cpp b/hotspot/src/os/linux/vm/mutex_linux.cpp
index 3cc4bbd4239..864aca7e86a 100644
--- a/hotspot/src/os/linux/vm/mutex_linux.cpp
+++ b/hotspot/src/os/linux/vm/mutex_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,8 +22,12 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_mutex_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "mutex_linux.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/mutex.hpp"
+#include "thread_linux.inline.hpp"
+#include "utilities/events.hpp"
// put OS-includes here
# include
diff --git a/hotspot/src/os/linux/vm/mutex_linux.inline.hpp b/hotspot/src/os/linux/vm/mutex_linux.inline.hpp
index 87c6a3701ec..cde6dfe428b 100644
--- a/hotspot/src/os/linux/vm/mutex_linux.inline.hpp
+++ b/hotspot/src/os/linux/vm/mutex_linux.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,16 @@
*
*/
+#ifndef OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP
+#define OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP
+
+#include "os_linux.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "thread_linux.inline.hpp"
+
// Reconciliation History
// mutex_solaris.inline.hpp 1.5 99/06/22 16:38:49
// End
+
+#endif // OS_LINUX_VM_MUTEX_LINUX_INLINE_HPP
diff --git a/hotspot/src/os/linux/vm/osThread_linux.cpp b/hotspot/src/os/linux/vm/osThread_linux.cpp
index 6a387225e29..f4ec9f78faa 100644
--- a/hotspot/src/os/linux/vm/osThread_linux.cpp
+++ b/hotspot/src/os/linux/vm/osThread_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,8 +22,23 @@
*
*/
-// do not include precompiled header file
-# include "incls/_osThread_linux.cpp.incl"
+// no precompiled headers
+#include "runtime/atomic.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/vmThread.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "assembler_zero.inline.hpp"
+#endif
void OSThread::pd_initialize() {
diff --git a/hotspot/src/os/linux/vm/osThread_linux.hpp b/hotspot/src/os/linux/vm/osThread_linux.hpp
index 389e4a8722c..22945135b78 100644
--- a/hotspot/src/os/linux/vm/osThread_linux.hpp
+++ b/hotspot/src/os/linux/vm/osThread_linux.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_LINUX_VM_OSTHREAD_LINUX_HPP
+#define OS_LINUX_VM_OSTHREAD_LINUX_HPP
+
private:
int _thread_type;
@@ -139,3 +142,5 @@ private:
// Reconciliation History
// osThread_solaris.hpp 1.24 99/08/27 13:11:54
// End
+
+#endif // OS_LINUX_VM_OSTHREAD_LINUX_HPP
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
index e42507f4aa7..330e347a7e5 100644
--- a/hotspot/src/os/linux/vm/os_linux.cpp
+++ b/hotspot/src/os/linux/vm/os_linux.cpp
@@ -24,8 +24,64 @@
# define __STDC_FORMAT_MACROS
-// do not include precompiled header file
-# include "incls/_os_linux.cpp.incl"
+// no precompiled headers
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "compiler/compileBroker.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_linux.h"
+#include "memory/allocation.inline.hpp"
+#include "memory/filemap.hpp"
+#include "mutex_linux.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "os_share_linux.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/perfMemory.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/statSampler.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/threadCritical.hpp"
+#include "runtime/timer.hpp"
+#include "services/attachListener.hpp"
+#include "services/runtimeService.hpp"
+#include "thread_linux.inline.hpp"
+#include "utilities/decoder.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/events.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/vmError.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+# include "nativeInst_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.inline.hpp"
+# include "nativeInst_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "assembler_zero.inline.hpp"
+# include "nativeInst_zero.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
// put OS-includes here
# include
@@ -59,6 +115,7 @@
# include
# include
# include
+# include
#define MAX_PATH (2 * K)
@@ -1509,6 +1566,24 @@ void os::die() {
// unused on linux for now.
void os::set_error_file(const char *logfile) {}
+
+// This method is a copy of JDK's sysGetLastErrorString
+// from src/solaris/hpi/src/system_md.c
+
+size_t os::lasterror(char *buf, size_t len) {
+
+ if (errno == 0) return 0;
+
+ const char *s = ::strerror(errno);
+ size_t n = ::strlen(s);
+ if (n >= len) {
+ n = len - 1;
+ }
+ ::strncpy(buf, s, n);
+ buf[n] = '\0';
+ return n;
+}
+
intx os::current_thread_id() { return (intx)pthread_self(); }
int os::current_process_id() {
@@ -1615,14 +1690,23 @@ bool os::dll_address_to_function_name(address addr, char *buf,
Dl_info dlinfo;
if (dladdr((void*)addr, &dlinfo) && dlinfo.dli_sname != NULL) {
- if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname);
- if (offset) *offset = addr - (address)dlinfo.dli_saddr;
+ if (buf != NULL) {
+ if(!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) {
+ jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname);
+ }
+ }
+ if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
return true;
- } else {
- if (buf) buf[0] = '\0';
- if (offset) *offset = -1;
- return false;
+ } else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
+ if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
+ dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) {
+ return true;
+ }
}
+
+ if (buf != NULL) buf[0] = '\0';
+ if (offset != NULL) *offset = -1;
+ return false;
}
struct _address_to_library_name {
@@ -1873,19 +1957,19 @@ void* os::dll_lookup(void* handle, const char* name) {
}
-bool _print_ascii_file(const char* filename, outputStream* st) {
- int fd = open(filename, O_RDONLY);
+static bool _print_ascii_file(const char* filename, outputStream* st) {
+ int fd = ::open(filename, O_RDONLY);
if (fd == -1) {
return false;
}
char buf[32];
int bytes;
- while ((bytes = read(fd, buf, sizeof(buf))) > 0) {
+ while ((bytes = ::read(fd, buf, sizeof(buf))) > 0) {
st->print_raw(buf, bytes);
}
- close(fd);
+ ::close(fd);
return true;
}
@@ -2163,8 +2247,6 @@ void os::jvm_path(char *buf, jint buflen) {
// Use current module name "libjvm[_g].so" instead of
// "libjvm"debug_only("_g")".so" since for fastdebug version
// we should have "libjvm.so" but debug_only("_g") adds "_g"!
- // It is used when we are choosing the HPI library's name
- // "libhpi[_g].so" in hpi::initialize_get_interface().
len = strlen(buf);
snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p);
} else {
@@ -2348,18 +2430,18 @@ void linux_wrap_code(char* base, size_t size) {
os::get_temp_directory(), os::current_process_id(), num);
unlink(buf);
- int fd = open(buf, O_CREAT | O_RDWR, S_IRWXU);
+ int fd = ::open(buf, O_CREAT | O_RDWR, S_IRWXU);
if (fd != -1) {
- off_t rv = lseek(fd, size-2, SEEK_SET);
+ off_t rv = ::lseek(fd, size-2, SEEK_SET);
if (rv != (off_t)-1) {
- if (write(fd, "", 1) == 1) {
+ if (::write(fd, "", 1) == 1) {
mmap(base, size,
PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE, fd, 0);
}
}
- close(fd);
+ ::close(fd);
unlink(buf);
}
}
@@ -3991,13 +4073,6 @@ jint os::init_2(void)
// Initialize lock used to serialize thread creation (see os::create_thread)
Linux::set_createThread_lock(new Mutex(Mutex::leaf, "createThread_lock", false));
- // Initialize HPI.
- jint hpi_result = hpi::initialize();
- if (hpi_result != JNI_OK) {
- tty->print_cr("There was an error trying to initialize the HPI library.");
- return hpi_result;
- }
-
// at-exit methods are called in the reverse order of their registration.
// atexit functions are called on return from main or as a result of a
// call to exit(3C). There can be only 32 of these functions registered
@@ -4195,7 +4270,7 @@ int os::stat(const char *path, struct stat *sbuf) {
errno = ENAMETOOLONG;
return -1;
}
- hpi::native_path(strcpy(pathbuf, path));
+ os::native_path(strcpy(pathbuf, path));
return ::stat(pathbuf, sbuf);
}
@@ -4227,6 +4302,85 @@ bool os::dir_is_empty(const char* path) {
return result;
}
+// This code originates from JDK's sysOpen and open64_w
+// from src/solaris/hpi/src/system_md.c
+
+#ifndef O_DELETE
+#define O_DELETE 0x10000
+#endif
+
+// Open a file. Unlink the file immediately after open returns
+// if the specified oflag has the O_DELETE flag set.
+// O_DELETE is used only in j2se/src/share/native/java/util/zip/ZipFile.c
+
+int os::open(const char *path, int oflag, int mode) {
+
+ if (strlen(path) > MAX_PATH - 1) {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+ int fd;
+ int o_delete = (oflag & O_DELETE);
+ oflag = oflag & ~O_DELETE;
+
+ fd = ::open64(path, oflag, mode);
+ if (fd == -1) return -1;
+
+ //If the open succeeded, the file might still be a directory
+ {
+ struct stat64 buf64;
+ int ret = ::fstat64(fd, &buf64);
+ int st_mode = buf64.st_mode;
+
+ if (ret != -1) {
+ if ((st_mode & S_IFMT) == S_IFDIR) {
+ errno = EISDIR;
+ ::close(fd);
+ return -1;
+ }
+ } else {
+ ::close(fd);
+ return -1;
+ }
+ }
+
+ /*
+ * All file descriptors that are opened in the JVM and not
+ * specifically destined for a subprocess should have the
+ * close-on-exec flag set. If we don't set it, then careless 3rd
+ * party native code might fork and exec without closing all
+ * appropriate file descriptors (e.g. as we do in closeDescriptors in
+ * UNIXProcess.c), and this in turn might:
+ *
+ * - cause end-of-file to fail to be detected on some file
+ * descriptors, resulting in mysterious hangs, or
+ *
+ * - might cause an fopen in the subprocess to fail on a system
+ * suffering from bug 1085341.
+ *
+ * (Yes, the default setting of the close-on-exec flag is a Unix
+ * design flaw)
+ *
+ * See:
+ * 1085341: 32-bit stdio routines should support file descriptors >255
+ * 4843136: (process) pipe file descriptor from Runtime.exec not being closed
+ * 6339493: (process) Runtime.exec does not close all file descriptors on Solaris 9
+ */
+#ifdef FD_CLOEXEC
+ {
+ int flags = ::fcntl(fd, F_GETFD);
+ if (flags != -1)
+ ::fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
+ }
+#endif
+
+ if (o_delete != 0) {
+ ::unlink(path);
+ }
+ return fd;
+}
+
+
// create binary file, rewriting existing file if required
int os::create_binary_file(const char* path, bool rewrite_existing) {
int oflags = O_WRONLY | O_CREAT;
@@ -4246,6 +4400,49 @@ jlong os::seek_to_file_offset(int fd, jlong offset) {
return (jlong)::lseek64(fd, (off64_t)offset, SEEK_SET);
}
+// This code originates from JDK's sysAvailable
+// from src/solaris/hpi/src/native_threads/src/sys_api_td.c
+
+int os::available(int fd, jlong *bytes) {
+ jlong cur, end;
+ int mode;
+ struct stat64 buf64;
+
+ if (::fstat64(fd, &buf64) >= 0) {
+ mode = buf64.st_mode;
+ if (S_ISCHR(mode) || S_ISFIFO(mode) || S_ISSOCK(mode)) {
+ /*
+ * XXX: is the following call interruptible? If so, this might
+ * need to go through the INTERRUPT_IO() wrapper as for other
+ * blocking, interruptible calls in this file.
+ */
+ int n;
+ if (::ioctl(fd, FIONREAD, &n) >= 0) {
+ *bytes = n;
+ return 1;
+ }
+ }
+ }
+ if ((cur = ::lseek64(fd, 0L, SEEK_CUR)) == -1) {
+ return 0;
+ } else if ((end = ::lseek64(fd, 0L, SEEK_END)) == -1) {
+ return 0;
+ } else if (::lseek64(fd, cur, SEEK_SET) == -1) {
+ return 0;
+ }
+ *bytes = end - cur;
+ return 1;
+}
+
+int os::socket_available(int fd, jint *pbytes) {
+ // Linux doc says EINTR not returned, unlike Solaris
+ int ret = ::ioctl(fd, FIONREAD, pbytes);
+
+ //%% note ioctl can return 0 when successful, JVM_SocketAvailable
+ // is expected to return 0 on failure and 1 on success to the jdk.
+ return (ret < 0) ? 0 : 1;
+}
+
// Map a block of memory.
char* os::map_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
@@ -4472,7 +4669,7 @@ void os::pause() {
int fd = ::open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (fd != -1) {
struct stat buf;
- close(fd);
+ ::close(fd);
while (::stat(filename, &buf) == 0) {
(void)::poll(NULL, 0, 100);
}
diff --git a/hotspot/src/os/linux/vm/os_linux.hpp b/hotspot/src/os/linux/vm/os_linux.hpp
index 15b2c1efc69..18803ac3496 100644
--- a/hotspot/src/os/linux/vm/os_linux.hpp
+++ b/hotspot/src/os/linux/vm/os_linux.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_LINUX_VM_OS_LINUX_HPP
+#define OS_LINUX_VM_OS_LINUX_HPP
+
// Linux_OS defines the interface to Linux operating systems
/* pthread_getattr_np comes with LinuxThreads-0.9-7 on RedHat 7.1 */
@@ -328,3 +331,5 @@ class PlatformParker : public CHeapObj {
assert_status(status == 0, status, "mutex_init");
}
} ;
+
+#endif // OS_LINUX_VM_OS_LINUX_HPP
diff --git a/hotspot/src/os/linux/vm/os_linux.inline.hpp b/hotspot/src/os/linux/vm/os_linux.inline.hpp
index 035465da8c7..9af7e789764 100644
--- a/hotspot/src/os/linux/vm/os_linux.inline.hpp
+++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,31 @@
*
*/
+#ifndef OS_LINUX_VM_OS_LINUX_INLINE_HPP
+#define OS_LINUX_VM_OS_LINUX_INLINE_HPP
+
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "atomic_linux_x86.inline.hpp"
+# include "orderAccess_linux_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "atomic_linux_sparc.inline.hpp"
+# include "orderAccess_linux_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "atomic_linux_zero.inline.hpp"
+# include "orderAccess_linux_zero.inline.hpp"
+#endif
+
+// System includes
+
+#include
+#include
+#include
+#include
+
inline void* os::thread_local_storage_at(int index) {
return pthread_getspecific((pthread_key_t)index);
}
@@ -75,6 +100,12 @@ inline void os::split_reserved_memory(char *base, size_t size,
inline void os::bang_stack_shadow_pages() {
}
+inline void os::dll_unload(void *lib) {
+ ::dlclose(lib);
+}
+
+inline const int os::default_file_open_flags() { return 0;}
+
inline DIR* os::opendir(const char* dirname)
{
assert(dirname != NULL, "just checking");
@@ -86,6 +117,22 @@ inline int os::readdir_buf_size(const char *path)
return NAME_MAX + sizeof(dirent) + 1;
}
+inline jlong os::lseek(int fd, jlong offset, int whence) {
+ return (jlong) ::lseek64(fd, offset, whence);
+}
+
+inline int os::fsync(int fd) {
+ return ::fsync(fd);
+}
+
+inline char* os::native_path(char *path) {
+ return path;
+}
+
+inline int os::ftruncate(int fd, jlong length) {
+ return ::ftruncate64(fd, length);
+}
+
inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf)
{
dirent* p;
@@ -103,9 +150,8 @@ inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf)
return p;
}
-inline int os::closedir(DIR *dirp)
-{
- assert(dirp != NULL, "just checking");
+inline int os::closedir(DIR *dirp) {
+ assert(dirp != NULL, "argument is NULL");
return ::closedir(dirp);
}
@@ -123,3 +169,130 @@ inline int os::closedir(DIR *dirp)
inline bool os::numa_has_static_binding() { return true; }
inline bool os::numa_has_group_homing() { return false; }
+
+inline size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
+ size_t res;
+ RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res);
+ return res;
+}
+
+inline size_t os::write(int fd, const void *buf, unsigned int nBytes) {
+ size_t res;
+ RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res);
+ return res;
+}
+
+inline int os::close(int fd) {
+ return ::close(fd);
+}
+
+inline int os::socket_close(int fd) {
+ return ::close(fd);
+}
+
+inline int os::socket(int domain, int type, int protocol) {
+ return ::socket(domain, type, protocol);
+}
+
+inline int os::recv(int fd, char *buf, int nBytes, int flags) {
+ RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, (unsigned int) flags));
+}
+
+inline int os::send(int fd, char *buf, int nBytes, int flags) {
+ RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, (unsigned int) flags));
+}
+
+inline int os::raw_send(int fd, char *buf, int nBytes, int flags) {
+ return os::send(fd, buf, nBytes, flags);
+}
+
+inline int os::timeout(int fd, long timeout) {
+ julong prevtime,newtime;
+ struct timeval t;
+
+ gettimeofday(&t, NULL);
+ prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000;
+
+ for(;;) {
+ struct pollfd pfd;
+
+ pfd.fd = fd;
+ pfd.events = POLLIN | POLLERR;
+
+ int res = ::poll(&pfd, 1, timeout);
+
+ if (res == OS_ERR && errno == EINTR) {
+
+ // On Linux any value < 0 means "forever"
+
+ if(timeout >= 0) {
+ gettimeofday(&t, NULL);
+ newtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000;
+ timeout -= newtime - prevtime;
+ if(timeout <= 0)
+ return OS_OK;
+ prevtime = newtime;
+ }
+ } else
+ return res;
+ }
+}
+
+inline int os::listen(int fd, int count) {
+ return ::listen(fd, count);
+}
+
+inline int os::connect(int fd, struct sockaddr *him, int len) {
+ RESTARTABLE_RETURN_INT(::connect(fd, him, len));
+}
+
+inline int os::accept(int fd, struct sockaddr *him, int *len) {
+ // This cast is from int to unsigned int on linux. Since we
+ // only pass the parameter "len" around the vm and don't try to
+ // fetch it's value, this cast is safe for now. The java.net group
+ // may need and want to change this interface someday if socklen_t goes
+ // to 64 bits on some platform that we support.
+ // Linux doc says this can't return EINTR, unlike accept() on Solaris
+
+ return ::accept(fd, him, (socklen_t *)len);
+}
+
+inline int os::recvfrom(int fd, char *buf, int nBytes, int flags,
+ sockaddr *from, int *fromlen) {
+ RESTARTABLE_RETURN_INT(::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen));
+}
+
+inline int os::sendto(int fd, char *buf, int len, int flags,
+ struct sockaddr *to, int tolen) {
+ RESTARTABLE_RETURN_INT(::sendto(fd, buf, len, (unsigned int) flags, to, tolen));
+}
+
+inline int os::socket_shutdown(int fd, int howto){
+ return ::shutdown(fd, howto);
+}
+
+inline int os::bind(int fd, struct sockaddr *him, int len){
+ return ::bind(fd, him, len);
+}
+
+inline int os::get_sock_name(int fd, struct sockaddr *him, int *len){
+ return ::getsockname(fd, him, (socklen_t *)len);
+}
+
+inline int os::get_host_name(char* name, int namelen){
+ return ::gethostname(name, namelen);
+}
+
+inline struct hostent* os::get_host_by_name(char* name) {
+ return ::gethostbyname(name);
+}
+inline int os::get_sock_opt(int fd, int level, int optname,
+ char *optval, int* optlen){
+ return ::getsockopt(fd, level, optname, optval, (socklen_t *)optlen);
+}
+
+inline int os::set_sock_opt(int fd, int level, int optname,
+ const char *optval, int optlen){
+ return ::setsockopt(fd, level, optname, optval, optlen);
+}
+#endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP
diff --git a/hotspot/src/os/linux/vm/os_share_linux.hpp b/hotspot/src/os/linux/vm/os_share_linux.hpp
index 5b9d5321c02..7cc2635980a 100644
--- a/hotspot/src/os/linux/vm/os_share_linux.hpp
+++ b/hotspot/src/os/linux/vm/os_share_linux.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_LINUX_VM_OS_SHARE_LINUX_HPP
+#define OS_LINUX_VM_OS_SHARE_LINUX_HPP
+
// misc
void signalHandler(int, siginfo_t*, ucontext_t*);
void handle_unexpected_exception(Thread* thread, int sig, siginfo_t* info, address pc, address adjusted_pc);
@@ -30,3 +33,5 @@ void continue_with_dump(void);
#endif
#define PROCFILE_LENGTH 128
+
+#endif // OS_LINUX_VM_OS_SHARE_LINUX_HPP
diff --git a/hotspot/src/os/linux/vm/perfMemory_linux.cpp b/hotspot/src/os/linux/vm/perfMemory_linux.cpp
index da5e0d643b7..db5340f9d7c 100644
--- a/hotspot/src/os/linux/vm/perfMemory_linux.cpp
+++ b/hotspot/src/os/linux/vm/perfMemory_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,8 +22,15 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_perfMemory_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "os_linux.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/perfMemory.hpp"
+#include "utilities/exceptions.hpp"
// put OS-includes here
# include
diff --git a/hotspot/src/os/linux/vm/stubRoutines_linux.cpp b/hotspot/src/os/linux/vm/stubRoutines_linux.cpp
index c705716dc56..3723a0f7dfa 100644
--- a/hotspot/src/os/linux/vm/stubRoutines_linux.cpp
+++ b/hotspot/src/os/linux/vm/stubRoutines_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,5 +22,7 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "runtime/stubRoutines.hpp"
+
diff --git a/hotspot/src/os/linux/vm/threadCritical_linux.cpp b/hotspot/src/os/linux/vm/threadCritical_linux.cpp
index 526352ce910..b1d9ab2aa44 100644
--- a/hotspot/src/os/linux/vm/threadCritical_linux.cpp
+++ b/hotspot/src/os/linux/vm/threadCritical_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_threadCritical_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadCritical.hpp"
+#include "thread_linux.inline.hpp"
// put OS-includes here
# include
diff --git a/hotspot/src/os/linux/vm/thread_linux.inline.hpp b/hotspot/src/os/linux/vm/thread_linux.inline.hpp
index 5367a569e0d..f09ed2877ef 100644
--- a/hotspot/src/os/linux/vm/thread_linux.inline.hpp
+++ b/hotspot/src/os/linux/vm/thread_linux.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,31 @@
*
*/
+#ifndef OS_LINUX_VM_THREAD_LINUX_INLINE_HPP
+#define OS_LINUX_VM_THREAD_LINUX_INLINE_HPP
+
+#include "runtime/atomic.hpp"
+#include "runtime/prefetch.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "atomic_linux_x86.inline.hpp"
+# include "orderAccess_linux_x86.inline.hpp"
+# include "prefetch_linux_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_sparc
+# include "atomic_linux_sparc.inline.hpp"
+# include "orderAccess_linux_sparc.inline.hpp"
+# include "prefetch_linux_sparc.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_linux_zero
+# include "atomic_linux_zero.inline.hpp"
+# include "orderAccess_linux_zero.inline.hpp"
+# include "prefetch_linux_zero.inline.hpp"
+#endif
+
// Contains inlined functions for class Thread and ThreadLocalStorage
inline void ThreadLocalStorage::pd_invalidate_all() {} // nothing to do
+
+#endif // OS_LINUX_VM_THREAD_LINUX_INLINE_HPP
diff --git a/hotspot/src/os/linux/vm/vmError_linux.cpp b/hotspot/src/os/linux/vm/vmError_linux.cpp
index 8e73d288634..8ec6ca04c25 100644
--- a/hotspot/src/os/linux/vm/vmError_linux.cpp
+++ b/hotspot/src/os/linux/vm/vmError_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,8 +22,11 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_vmError_linux.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/os.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/vmError.hpp"
#include
#include
@@ -41,11 +44,11 @@ void VMError::show_message_box(char *buf, int buflen) {
jio_snprintf(p, buflen - len,
"\n\n"
"Do you want to debug the problem?\n\n"
- "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " INTX_FORMAT "\n"
+ "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " INTX_FORMAT " (" INTPTR_FORMAT ")\n"
"Enter 'yes' to launch gdb automatically (PATH must include gdb)\n"
"Otherwise, press RETURN to abort...",
os::current_process_id(), os::current_process_id(),
- os::current_thread_id());
+ os::current_thread_id(), os::current_thread_id());
yes = os::message_box("Unexpected Error", buf);
diff --git a/hotspot/src/os/linux/launcher/java_md.c b/hotspot/src/os/posix/launcher/java_md.c
similarity index 88%
rename from hotspot/src/os/linux/launcher/java_md.c
rename to hotspot/src/os/posix/launcher/java_md.c
index 3308ff62df3..78a1ca33a8f 100644
--- a/hotspot/src/os/linux/launcher/java_md.c
+++ b/hotspot/src/os/posix/launcher/java_md.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,16 +22,13 @@
*
*/
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- */
#include "java.h"
#include
#include
#include
#include
+#include
#include
#include
#include
@@ -45,64 +42,42 @@
#include "version_comp.h"
#endif
+#ifdef __linux__
+#include
+#else
+#include
+#endif
+
#define JVM_DLL "libjvm.so"
#define JAVA_DLL "libjava.so"
#ifndef GAMMA /* launcher.make defines ARCH */
-
/*
* If a processor / os combination has the ability to run binaries of
* two data models and cohabitation of jre/jdk bits with both data
* models is supported, then DUAL_MODE is defined. When DUAL_MODE is
* defined, the architecture names for the narrow and wide version of
- * the architecture are defined in BIG_ARCH and SMALL_ARCH. Currently
+ * the architecture are defined in LIBARCH64NAME and LIBARCH32NAME. Currently
* only Solaris on sparc/sparcv9 and i586/amd64 is DUAL_MODE; linux
* i586/amd64 could be defined as DUAL_MODE but that is not the
* current policy.
*/
-#ifdef _LP64
-
-# ifdef ia64
-# define ARCH "ia64"
-# elif defined(amd64)
-# define ARCH "amd64"
-# elif defined(__sparc)
-# define ARCH "sparcv9"
-# else
-# define ARCH "unknown" /* unknown 64-bit architecture */
-# endif
-
-#else /* 32-bit data model */
-
-# ifdef i586
-# define ARCH "i386"
-# elif defined(__sparc)
-# define ARCH "sparc"
-# elif defined(arm)
-# define ARCH "arm"
-# elif defined(PPC)
-# define ARCH "ppc"
-# endif
-
-#endif /* _LP64 */
+#ifndef LIBARCHNAME
+# error "The macro LIBARCHNAME was not defined on the compile line"
+#endif
#ifdef __sun
# define DUAL_MODE
-# ifdef __sparc
-# define BIG_ARCH "sparcv9"
-# define SMALL_ARCH "sparc"
-# else
-# define BIG_ARCH "amd64"
-# define SMALL_ARCH "i386"
+# ifndef LIBARCH32NAME
+# error "The macro LIBARCH32NAME was not defined on the compile line"
+# endif
+# ifndef LIBARCH64NAME
+# error "The macro LIBARCH64NAME was not defined on the compile line"
# endif
# include
# include
# include
-#else
-# ifndef ARCH
-# include
-# endif
#endif
#endif /* ifndef GAMMA */
@@ -111,7 +86,6 @@
extern char **environ;
#ifndef GAMMA
-
/*
* A collection of useful strings. One should think of these as #define
* entries, but actual strings can be more efficient (with many compilers).
@@ -124,7 +98,7 @@ static const char *system_dir = "/usr/jdk";
static const char *user_dir = "/jdk";
#endif
-#endif /* ifndef GAMMA */
+#endif /* ifndef GAMMA */
/*
* Flowchart of launcher execs and options processing on unix
@@ -196,23 +170,13 @@ static jboolean GetJVMPath(const char *jrepath, const char *jvmtype,
char *jvmpath, jint jvmpathsize, char * arch);
static jboolean GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative);
+#ifndef GAMMA
const char *
GetArch()
{
- static char *arch = NULL;
- static char buf[12];
- if (arch) {
- return arch;
- }
-
-#ifdef ARCH
- strcpy(buf, ARCH);
-#else
- sysinfo(SI_ARCHITECTURE, buf, sizeof(buf));
-#endif
- arch = buf;
- return arch;
+ return LIBARCHNAME;
}
+#endif /* ifndef GAMMA */
void
CreateExecutionEnvironment(int *_argcp,
@@ -287,7 +251,7 @@ CreateExecutionEnvironment(int *_argcp,
{ /* open new scope to declare local variables */
int i;
- newargv = (char **)MemAlloc((argc+1) * sizeof(*newargv));
+ newargv = (char **)JLI_MemAlloc((argc+1) * sizeof(*newargv));
newargv[newargc++] = argv[0];
/* scan for data model arguments and remove from argument list;
@@ -358,7 +322,7 @@ CreateExecutionEnvironment(int *_argcp,
#ifdef DUAL_MODE
if (running != wanted) {
/* Find out where the JRE is that we will be using. */
- if (!GetJREPath(jrepath, so_jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), JNI_TRUE)) {
+ if (!GetJREPath(jrepath, so_jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), JNI_TRUE)) {
goto EndDataModelSpeculate;
}
@@ -366,14 +330,14 @@ CreateExecutionEnvironment(int *_argcp,
* Read in jvm.cfg for target data model and process vm
* selection options.
*/
- if (ReadKnownVMs(jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), JNI_TRUE) < 1) {
+ if (ReadKnownVMs(jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), JNI_TRUE) < 1) {
goto EndDataModelSpeculate;
}
jvmpath[0] = '\0';
jvmtype = CheckJvmType(_argcp, _argvp, JNI_TRUE);
/* exec child can do error checking on the existence of the path */
jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath,
- ((wanted==64)?BIG_ARCH:SMALL_ARCH));
+ ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME));
}
EndDataModelSpeculate: /* give up and let other code report error message */
@@ -388,8 +352,8 @@ CreateExecutionEnvironment(int *_argcp,
* We will set the LD_LIBRARY_PATH as follows:
*
* o $JVMPATH (directory portion only)
- * o $JRE/lib/$ARCH
- * o $JRE/../lib/$ARCH
+ * o $JRE/lib/$LIBARCHNAME
+ * o $JRE/../lib/$LIBARCHNAME
*
* followed by the user's previous effective LD_LIBRARY_PATH, if
* any.
@@ -483,8 +447,8 @@ CreateExecutionEnvironment(int *_argcp,
/* runpath contains current effective LD_LIBRARY_PATH setting */
- jvmpath = strdup(jvmpath);
- new_runpath = MemAlloc( ((runpath!=NULL)?strlen(runpath):0) +
+ jvmpath = JLI_StringDup(jvmpath);
+ new_runpath = JLI_MemAlloc( ((runpath!=NULL)?strlen(runpath):0) +
2*strlen(jrepath) + 2*strlen(arch) +
strlen(jvmpath) + 52);
newpath = new_runpath + strlen("LD_LIBRARY_PATH=");
@@ -500,7 +464,7 @@ CreateExecutionEnvironment(int *_argcp,
*lastslash = '\0';
- /* jvmpath, ((running != wanted)?((wanted==64)?"/"BIG_ARCH:"/.."):""), */
+ /* jvmpath, ((running != wanted)?((wanted==64)?"/"LIBARCH64NAME:"/.."):""), */
sprintf(new_runpath, "LD_LIBRARY_PATH="
"%s:"
@@ -508,8 +472,8 @@ CreateExecutionEnvironment(int *_argcp,
"%s/../lib/%s",
jvmpath,
#ifdef DUAL_MODE
- jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH),
- jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH)
+ jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME),
+ jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME)
#else
jrepath, arch,
jrepath, arch
@@ -576,7 +540,7 @@ CreateExecutionEnvironment(int *_argcp,
* executable must be updated accordingly; the executable name
* and directory the executable resides in are separate. In the
* case of 32 => 64, the new bits are assumed to reside in, e.g.
- * "olddir/BIGARCH/execname"; in the case of 64 => 32,
+ * "olddir/LIBARCH64NAME/execname"; in the case of 64 => 32,
* the bits are assumed to be in "olddir/../execname". For example,
*
* olddir/sparcv9/execname
@@ -586,19 +550,21 @@ CreateExecutionEnvironment(int *_argcp,
*/
if (running != wanted) {
- char *oldexec = strcpy(MemAlloc(strlen(execname) + 1), execname);
+ char *oldexec = strcpy(JLI_MemAlloc(strlen(execname) + 1), execname);
char *olddir = oldexec;
char *oldbase = strrchr(oldexec, '/');
- newexec = MemAlloc(strlen(execname) + 20);
+ newexec = JLI_MemAlloc(strlen(execname) + 20);
*oldbase++ = 0;
sprintf(newexec, "%s/%s/%s", olddir,
- ((wanted==64) ? BIG_ARCH : ".."), oldbase);
+ ((wanted==64) ? LIBARCH64NAME : ".."), oldbase);
argv[0] = newexec;
}
#endif
+ (void)fflush(stdout);
+ (void)fflush(stderr);
execve(newexec, argv, newenvp);
perror("execve()");
@@ -630,12 +596,14 @@ CreateExecutionEnvironment(int *_argcp,
#else /* ifndef GAMMA */
- /* gamma launcher is simpler in that it doesn't handle VM flavors, data */
- /* model, LD_LIBRARY_PATH, etc. Assuming everything is set-up correctly */
- /* all we need to do here is to return correct path names. See also */
- /* GetJVMPath() and GetApplicationHome(). */
+ /*
+ * gamma launcher is simpler in that it doesn't handle VM flavors, data
+ * model, LD_LIBRARY_PATH, etc. Assuming everything is set-up correctly
+ * all we need to do here is to return correct path names. See also
+ * GetJVMPath() and GetApplicationHome().
+ */
- { char *arch = (char *)GetArch(); /* like sparc or sparcv9 */
+ { char *arch = (char *) ARCH; /* like sparc or sparcv9 */
char *p;
if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) {
@@ -669,9 +637,11 @@ GetJVMPath(const char *jrepath, const char *jvmtype,
sprintf(jvmpath, "%s/lib/%s/%s/" JVM_DLL, jrepath, arch, jvmtype);
}
#else
- /* For gamma launcher, JVM is either built-in or in the same directory. */
- /* Either way we return "/libjvm.so" where is the */
- /* directory where gamma launcher is located. */
+ /*
+ * For gamma launcher, JVM is either built-in or in the same directory.
+ * Either way we return "/libjvm.so" where is the
+ * directory where gamma launcher is located.
+ */
char *p;
@@ -684,7 +654,7 @@ GetJVMPath(const char *jrepath, const char *jvmtype,
/* this case shouldn't happen */
snprintf(jvmpath, jvmpathsize, "%s", JVM_DLL);
}
-#endif
+#endif /* ifndef GAMMA */
if (_launcher_debug)
printf("Does `%s' exist ... ", jvmpath);
@@ -742,7 +712,7 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs;
return JNI_TRUE;
#else
- Dl_info dlinfo;
+ Dl_info dlinfo;
void *libjvm;
if (_launcher_debug) {
@@ -813,24 +783,7 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
error:
fprintf(stderr, "Error: failed %s, because %s\n", jvmpath, dlerror());
return JNI_FALSE;
-#endif /* GAMMA */
-}
-
-/*
- * Get the path to the file that has the usage message for -X options.
- */
-void
-GetXUsagePath(char *buf, jint bufsize)
-{
- static const char Xusage_txt[] = "/Xusage.txt";
- Dl_info dlinfo;
-
- /* we use RTLD_NOW because of problems with ld.so.1 and green threads */
- dladdr(dlsym(dlopen(JVM_DLL, RTLD_NOW), "JNI_CreateJavaVM"), &dlinfo);
- strncpy(buf, (char *)dlinfo.dli_fname, bufsize - sizeof(Xusage_txt));
-
- buf[bufsize-1] = '\0';
- strcpy(strrchr(buf, '/'), Xusage_txt);
+#endif /* ifndef GAMMA */
}
/*
@@ -860,13 +813,13 @@ GetApplicationHome(char *buf, jint bufsize)
#ifdef GAMMA
{
- /* gamma launcher uses JAVA_HOME environment variable to find JDK/JRE */
- char* java_home_var = getenv("JAVA_HOME");
- if (java_home_var == NULL) {
- printf("JAVA_HOME must point to a valid JDK/JRE to run gamma\n");
- return JNI_FALSE;
- }
- snprintf(buf, bufsize, "%s", java_home_var);
+ /* gamma launcher uses JAVA_HOME environment variable to find JDK/JRE */
+ char* java_home_var = getenv("JAVA_HOME");
+ if (java_home_var == NULL) {
+ printf("JAVA_HOME must point to a valid JDK/JRE to run gamma\n");
+ return JNI_FALSE;
+ }
+ snprintf(buf, bufsize, "%s", java_home_var);
}
#else
if (strrchr(buf, '/') == 0) {
@@ -885,7 +838,7 @@ GetApplicationHome(char *buf, jint bufsize)
return JNI_FALSE;
}
*(strrchr(buf, '/')) = '\0'; /* bin */
-#endif /* GAMMA */
+#endif /* ifndef GAMMA */
return JNI_TRUE;
}
@@ -915,7 +868,7 @@ Resolve(char *indir, char *cmd)
if ((strlen(indir) + strlen(cmd) + 1) > PATH_MAX) return 0;
sprintf(name, "%s%c%s", indir, FILE_SEPARATOR, cmd);
if (!ProgramExists(name)) return 0;
- real = MemAlloc(PATH_MAX + 2);
+ real = JLI_MemAlloc(PATH_MAX + 2);
if (!realpath(name, real))
strcpy(real, name);
return real;
@@ -948,7 +901,7 @@ FindExecName(char *program)
/* from search path? */
path = getenv("PATH");
if (!path || !*path) path = ".";
- tmp_path = MemAlloc(strlen(path) + 2);
+ tmp_path = JLI_MemAlloc(strlen(path) + 2);
strcpy(tmp_path, path);
for (f=tmp_path; *f && result==0; ) {
@@ -967,7 +920,7 @@ FindExecName(char *program)
if (result != 0) break;
}
- free(tmp_path);
+ JLI_MemFree(tmp_path);
return result;
}
@@ -1000,11 +953,11 @@ SetExecname(char **argv)
{
Dl_info dlinfo;
if (dladdr((void*)&SetExecname, &dlinfo)) {
- char *resolved = (char*)MemAlloc(PATH_MAX+1);
+ char *resolved = (char*)JLI_MemAlloc(PATH_MAX+1);
if (resolved != NULL) {
exec_path = realpath(dlinfo.dli_fname, resolved);
if (exec_path == NULL) {
- free(resolved);
+ JLI_MemFree(resolved);
}
}
}
@@ -1016,7 +969,7 @@ SetExecname(char **argv)
int len = readlink(self, buf, PATH_MAX);
if (len >= 0) {
buf[len] = '\0'; /* readlink doesn't nul terminate */
- exec_path = strdup(buf);
+ exec_path = JLI_StringDup(buf);
}
}
#else /* !__sun && !__linux */
@@ -1091,8 +1044,7 @@ void PrintMachineDependentOptions() {
return;
}
-#ifndef GAMMA /* gamma launcher does not have ergonomics */
-
+#ifndef GAMMA
/*
* The following methods (down to ServerClassMachine()) answer
* the question about whether a machine is a "server-class"
@@ -1164,7 +1116,7 @@ solaris_sparc_ServerClassMachine(void) {
}
}
if (_launcher_debug) {
- printf("solaris_" ARCH "_ServerClassMachine: %s\n",
+ printf("solaris_" LIBARCHNAME "_ServerClassMachine: %s\n",
(result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE"));
}
return result;
@@ -1262,7 +1214,6 @@ get_cpuid(uint32_t arg,
uint32_t value_of_edx = 0;
__asm__ volatile (/* Instructions */
/* ebx is callee-save, so push it */
- /* even though it's in the clobbers section */
" pushl %%ebx \n"
" movl %4, %%eax \n"
" cpuid \n"
@@ -1281,7 +1232,7 @@ get_cpuid(uint32_t arg,
: /* Inputs */
"m" (arg)
: /* Clobbers */
- "%eax", "%ebx", "%ecx", "%edx"
+ "%eax", "%ecx", "%edx"
);
*eaxp = value_of_eax;
*ebxp = value_of_ebx;
@@ -1461,7 +1412,7 @@ solaris_i586_ServerClassMachine(void) {
}
}
if (_launcher_debug) {
- printf("solaris_" ARCH "_ServerClassMachine: %s\n",
+ printf("solaris_" LIBARCHNAME "_ServerClassMachine: %s\n",
(result == JNI_TRUE ? "true" : "false"));
}
return result;
@@ -1494,7 +1445,7 @@ linux_i586_ServerClassMachine(void) {
}
}
if (_launcher_debug) {
- printf("linux_" ARCH "_ServerClassMachine: %s\n",
+ printf("linux_" LIBARCHNAME "_ServerClassMachine: %s\n",
(result == JNI_TRUE ? "true" : "false"));
}
return result;
@@ -1506,7 +1457,11 @@ linux_i586_ServerClassMachine(void) {
jboolean
ServerClassMachine(void) {
jboolean result = JNI_FALSE;
-#if defined(__sun) && defined(__sparc)
+#if defined(NEVER_ACT_AS_SERVER_CLASS_MACHINE)
+ result = JNI_FALSE;
+#elif defined(ALWAYS_ACT_AS_SERVER_CLASS_MACHINE)
+ result = JNI_TRUE;
+#elif defined(__sun) && defined(__sparc)
result = solaris_sparc_ServerClassMachine();
#elif defined(__sun) && defined(i586)
result = solaris_i586_ServerClassMachine();
@@ -1521,10 +1476,6 @@ ServerClassMachine(void) {
return result;
}
-#endif /* ifndef GAMMA */
-
-#ifndef GAMMA /* gamma launcher does not choose JDK/JRE/JVM */
-
/*
* Since using the file system as a registry is a bit risky, perform
* additional sanity checks on the identified directory to validate
@@ -1591,13 +1542,13 @@ static char
else if (strncmp(dp->d_name, "j2sdk", 5) == 0)
offset = 5;
if (offset > 0) {
- if ((acceptable_release(dp->d_name + offset,
+ if ((JLI_AcceptableRelease(dp->d_name + offset,
info->jre_version)) && CheckSanity(dirname, dp->d_name))
- if ((best == NULL) || (exact_version_id(
+ if ((best == NULL) || (JLI_ExactVersionId(
dp->d_name + offset, best + best_offset) > 0)) {
if (best != NULL)
- free(best);
- best = strdup(dp->d_name);
+ JLI_MemFree(best);
+ best = JLI_StringDup(dp->d_name);
best_offset = offset;
}
}
@@ -1607,9 +1558,9 @@ static char
if (best == NULL)
return (NULL);
else {
- ret_str = MemAlloc(strlen(dirname) + strlen(best) + 2);
+ ret_str = JLI_MemAlloc(strlen(dirname) + strlen(best) + 2);
ret_str = strcat(strcat(strcpy(ret_str, dirname), "/"), best);
- free(best);
+ JLI_MemFree(best);
return (ret_str);
}
}
@@ -1636,16 +1587,17 @@ LocateJRE(manifest_info* info)
* Start by getting JAVA_VERSION_PATH
*/
if (info->jre_restrict_search)
- path = strdup(system_dir);
+ path = JLI_StringDup(system_dir);
else if ((path = getenv("JAVA_VERSION_PATH")) != NULL)
- path = strdup(path);
+ path = JLI_StringDup(path);
else
if ((home = getenv("HOME")) != NULL) {
- path = (char *)MemAlloc(strlen(home) + 13);
+ path = (char *)JLI_MemAlloc(strlen(home) + strlen(system_dir) +
+ strlen(user_dir) + 2);
path = strcat(strcat(strcat(strcpy(path, home),
user_dir), ":"), system_dir);
} else
- path = strdup(system_dir);
+ path = JLI_StringDup(system_dir);
/*
* Step through each directory on the path. Terminate the scan with
@@ -1662,7 +1614,7 @@ LocateJRE(manifest_info* info)
if (dp != NULL)
dp++;
}
- free(path);
+ JLI_MemFree(path);
return (target);
}
@@ -1740,16 +1692,19 @@ ExecJRE(char *jre, char **argv)
argv[0] = progname;
if (_launcher_debug) {
int i;
- printf("execv(\"%s\"", wanted);
- for (i = 0; argv[i] != NULL; i++)
- printf(", \"%s\"", argv[i]);
- printf(")\n");
+ printf("ReExec Command: %s (%s)\n", wanted, argv[0]);
+ printf("ReExec Args:");
+ for (i = 1; argv[i] != NULL; i++)
+ printf(" %s", argv[i]);
+ printf("\n");
}
+ (void)fflush(stdout);
+ (void)fflush(stderr);
execv(wanted, argv);
+ perror("execv()");
fprintf(stderr, "Exec of %s failed\n", wanted);
exit(1);
}
-
#endif /* ifndef GAMMA */
/*
@@ -1830,23 +1785,92 @@ UnsetEnv(char *name)
{
return(borrowed_unsetenv(name));
}
-/*
- * The implementation for finding classes from the bootstrap
- * class loader, refer to java.h
- */
-static FindClassFromBootLoader_t *findBootClass = NULL;
-jclass
-FindBootStrapClass(JNIEnv *env, const char* classname)
-{
- if (findBootClass == NULL) {
- findBootClass = (FindClassFromBootLoader_t *)dlsym(RTLD_DEFAULT,
- "JVM_FindClassFromBootLoader");
- if (findBootClass == NULL) {
- fprintf(stderr, "Error: could load method JVM_FindClassFromBootLoader");
- return NULL;
- }
- }
- return findBootClass(env, classname, JNI_FALSE);
+/* --- Splash Screen shared library support --- */
+
+static const char* SPLASHSCREEN_SO = "libsplashscreen.so";
+
+static void* hSplashLib = NULL;
+
+void* SplashProcAddress(const char* name) {
+ if (!hSplashLib) {
+ hSplashLib = dlopen(SPLASHSCREEN_SO, RTLD_LAZY | RTLD_GLOBAL);
+ }
+ if (hSplashLib) {
+ void* sym = dlsym(hSplashLib, name);
+ return sym;
+ } else {
+ return NULL;
+ }
}
+void SplashFreeLibrary() {
+ if (hSplashLib) {
+ dlclose(hSplashLib);
+ hSplashLib = NULL;
+ }
+}
+
+const char *
+jlong_format_specifier() {
+ return "%lld";
+}
+
+/*
+ * Block current thread and continue execution in a new thread
+ */
+int
+ContinueInNewThread(int (JNICALL *continuation)(void *), jlong stack_size, void * args) {
+ int rslt;
+#ifdef __linux__
+ pthread_t tid;
+ pthread_attr_t attr;
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
+
+ if (stack_size > 0) {
+ pthread_attr_setstacksize(&attr, stack_size);
+ }
+
+ if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
+ void * tmp;
+ pthread_join(tid, &tmp);
+ rslt = (int)(intptr_t)tmp;
+ } else {
+ /*
+ * Continue execution in current thread if for some reason (e.g. out of
+ * memory/LWP) a new thread can't be created. This will likely fail
+ * later in continuation as JNI_CreateJavaVM needs to create quite a
+ * few new threads, anyway, just give it a try..
+ */
+ rslt = continuation(args);
+ }
+
+ pthread_attr_destroy(&attr);
+#else
+ thread_t tid;
+ long flags = 0;
+ if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) {
+ void * tmp;
+ thr_join(tid, NULL, &tmp);
+ rslt = (int)(intptr_t)tmp;
+ } else {
+ /* See above. Continue in current thread if thr_create() failed */
+ rslt = continuation(args);
+ }
+#endif
+ return rslt;
+}
+
+/* Coarse estimation of number of digits assuming the worst case is a 64-bit pid. */
+#define MAX_PID_STR_SZ 20
+
+void SetJavaLauncherPlatformProps() {
+ /* Linux only */
+#ifdef __linux__
+ const char *substr = "-Dsun.java.launcher.pid=";
+ char *pid_prop_str = (char *)JLI_MemAlloc(strlen(substr) + MAX_PID_STR_SZ + 1);
+ sprintf(pid_prop_str, "%s%d", substr, getpid());
+ AddOption(pid_prop_str, NULL);
+#endif
+}
diff --git a/hotspot/src/os/solaris/launcher/java_md.h b/hotspot/src/os/posix/launcher/java_md.h
similarity index 89%
rename from hotspot/src/os/solaris/launcher/java_md.h
rename to hotspot/src/os/posix/launcher/java_md.h
index 9b025060341..ed36fd1af67 100644
--- a/hotspot/src/os/solaris/launcher/java_md.h
+++ b/hotspot/src/os/posix/launcher/java_md.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,11 +22,6 @@
*
*/
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- */
-
#ifndef JAVA_MD_H
#define JAVA_MD_H
@@ -36,10 +31,12 @@
#ifndef GAMMA
#include "manifest_info.h"
#endif
+#include "jli_util.h"
#define PATH_SEPARATOR ':'
#define FILESEP "/"
#define FILE_SEPARATOR '/'
+#define IS_FILE_SEPARATOR(c) ((c) == '/')
#ifndef MAXNAMELEN
#define MAXNAMELEN PATH_MAX
#endif
@@ -71,7 +68,7 @@
* Function prototypes.
*/
#ifndef GAMMA
-char *LocateJRE(manifest_info* info);
+char *LocateJRE(manifest_info *info);
void ExecJRE(char *jre, char **argv);
#endif
int UnsetEnv(char *name);
diff --git a/hotspot/src/os/posix/launcher/launcher.script b/hotspot/src/os/posix/launcher/launcher.script
new file mode 100644
index 00000000000..22ed66b9c2f
--- /dev/null
+++ b/hotspot/src/os/posix/launcher/launcher.script
@@ -0,0 +1,212 @@
+#!/bin/bash
+
+# Copyright (c) 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.
+
+
+# This script launches HotSpot.
+#
+# If the first parameter is either "-gdb" or "-gud", HotSpot will be
+# launched inside gdb. "-gud" means "open an Emacs window and run gdb
+# inside Emacs".
+#
+# If the first parameter is "-dbx", HotSpot will be launched inside dbx.
+#
+# If the first parameter is "-valgrind", HotSpot will be launched
+# inside Valgrind (http://valgrind.kde.org) using the Memcheck skin,
+# and with memory leak detection enabled. This currently (2005jan19)
+# requires at least Valgrind 2.3.0. -Xmx16m will also be passed as
+# the first parameter to HotSpot, since lowering HotSpot's memory
+# consumption makes execution inside of Valgrind *a lot* faster.
+#
+
+
+#
+# User changeable parameters ------------------------------------------------
+#
+
+# This is the name of the gdb binary to use
+if [ ! "$GDB" ]
+then
+ GDB=gdb
+fi
+
+# This is the name of the gdb binary to use
+if [ ! "$DBX" ]
+then
+ DBX=dbx
+fi
+
+# This is the name of the Valgrind binary to use
+if [ ! "$VALGRIND" ]
+then
+ VALGRIND=valgrind
+fi
+
+# This is the name of Emacs for running GUD
+EMACS=emacs
+
+#
+# End of user changeable parameters -----------------------------------------
+#
+
+# Make sure the paths are fully specified, i.e. they must begin with /.
+SCRIPT=$(cd $(dirname $0) && pwd)/$(basename $0)
+RUNDIR=$(pwd)
+
+# Look whether the user wants to run inside gdb
+case "$1" in
+ -gdb)
+ MODE=gdb
+ shift
+ ;;
+ -gud)
+ MODE=gud
+ shift
+ ;;
+ -dbx)
+ MODE=dbx
+ shift
+ ;;
+ -valgrind)
+ MODE=valgrind
+ shift
+ ;;
+ *)
+ MODE=run
+ ;;
+esac
+
+# Find out the absolute path to this script
+MYDIR=$(cd $(dirname $SCRIPT) && pwd)
+
+JDK=
+if [ "${ALT_JAVA_HOME}" = "" ]; then
+ source ${MYDIR}/jdkpath.sh
+else
+ JDK=${ALT_JAVA_HOME%%/jre};
+fi
+
+if [ "${JDK}" = "" ]; then
+ echo Failed to find JDK. ALT_JAVA_HOME is not set or ./jdkpath.sh is empty or not found.
+ exit 1
+fi
+
+# We will set the LD_LIBRARY_PATH as follows:
+# o $JVMPATH (directory portion only)
+# o $JRE/lib/$ARCH
+# followed by the user's previous effective LD_LIBRARY_PATH, if
+# any.
+JRE=$JDK/jre
+JAVA_HOME=$JDK
+ARCH=@@LIBARCH@@
+
+# Find out the absolute path to this script
+MYDIR=$(cd $(dirname $SCRIPT) && pwd)
+
+SBP=${MYDIR}:${JRE}/lib/${ARCH}
+
+# Set up a suitable LD_LIBRARY_PATH
+
+if [ -z "$LD_LIBRARY_PATH" ]
+then
+ LD_LIBRARY_PATH="$SBP"
+else
+ LD_LIBRARY_PATH="$SBP:$LD_LIBRARY_PATH"
+fi
+
+export LD_LIBRARY_PATH
+export JAVA_HOME
+
+JPARMS="$@ $JAVA_ARGS";
+
+# Locate the gamma development launcher
+LAUNCHER=${MYDIR}/gamma
+if [ ! -x $LAUNCHER ] ; then
+ echo Error: Cannot find the gamma development launcher \"$LAUNCHER\"
+ exit 1
+fi
+
+GDBSRCDIR=$MYDIR
+BASEDIR=$(cd $MYDIR/../../.. && pwd)
+
+init_gdb() {
+# Create a gdb script in case we should run inside gdb
+ GDBSCR=/tmp/hsl.$$
+ rm -f $GDBSCR
+ cat >>$GDBSCR <= 22.1
+ case $($EMACS -version 2> /dev/null) in
+ *GNU\ Emacs\ 2[23]*)
+ emacs_gud_cmd="gdba"
+ emacs_gud_args="--annotate=3"
+ ;;
+ *)
+ emacs_gud_cmd="gdb"
+ emacs_gud_args=
+ ;;
+ esac
+ $EMACS --eval "($emacs_gud_cmd \"$GDB $emacs_gud_args -x $GDBSCR\")";
+ rm -f $GDBSCR
+ ;;
+ dbx)
+ $DBX -s $MYDIR/.dbxrc $LAUNCHER $JPARAMS
+ ;;
+ valgrind)
+ echo Warning: Defaulting to 16Mb heap to make Valgrind run faster, use -Xmx for larger heap
+ echo
+ $VALGRIND --tool=memcheck --leak-check=yes --num-callers=50 $LAUNCHER -Xmx16m $JPARMS
+ ;;
+ run)
+ LD_PRELOAD=$PRELOADING exec $LAUNCHER $JPARMS
+ ;;
+ *)
+ echo Error: Internal error, unknown launch mode \"$MODE\"
+ exit 1
+ ;;
+esac
+RETVAL=$?
+exit $RETVAL
diff --git a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp
index d60d0bb6469..632a2126394 100644
--- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp
+++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp
@@ -38,9 +38,22 @@
#define protected public
#include
-#include "incls/_precompiled.incl"
-#include "incls/_vmStructs.cpp.incl"
-
+#include "code/codeBlob.hpp"
+#include "code/nmethod.hpp"
+#include "code/pcDesc.hpp"
+#include "gc_interface/collectedHeap.hpp"
+#include "memory/heap.hpp"
+#include "memory/memRegion.hpp"
+#include "memory/universe.hpp"
+#include "oops/constMethodOop.hpp"
+#include "oops/klass.hpp"
+#include "oops/methodOop.hpp"
+#include "oops/oop.hpp"
+#include "oops/symbolOop.hpp"
+#include "runtime/virtualspace.hpp"
+#include "runtime/vmStructs.hpp"
+#include "utilities/accessFlags.hpp"
+#include "utilities/globalDefinitions.hpp"
#ifdef COMPILER1
#if defined(DEBUG) || defined(FASTDEBUG)
diff --git a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.h b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.h
index eb425828673..99146f12c3b 100644
--- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.h
+++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_SOLARIS_DTRACE_GENERATEJVMOFFSETS_H
+#define OS_SOLARIS_DTRACE_GENERATEJVMOFFSETS_H
+
#include
#include
@@ -36,3 +39,5 @@ extern "C" {
void gen_prologue(GEN_variant gen_var);
void gen_epilogue(GEN_variant gen_var);
}
+
+#endif // OS_SOLARIS_DTRACE_GENERATEJVMOFFSETS_H
diff --git a/hotspot/src/os/solaris/dtrace/generateJvmOffsetsMain.c b/hotspot/src/os/solaris/dtrace/generateJvmOffsetsMain.c
index d253c74a383..4cd8ebfb49e 100644
--- a/hotspot/src/os/solaris/dtrace/generateJvmOffsetsMain.c
+++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsetsMain.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
diff --git a/hotspot/src/os/solaris/dtrace/jvm_dtrace.c b/hotspot/src/os/solaris/dtrace/jvm_dtrace.c
index 81884196397..fd0c4333cba 100644
--- a/hotspot/src/os/solaris/dtrace/jvm_dtrace.c
+++ b/hotspot/src/os/solaris/dtrace/jvm_dtrace.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
diff --git a/hotspot/src/os/solaris/dtrace/jvm_dtrace.h b/hotspot/src/os/solaris/dtrace/jvm_dtrace.h
index ba1cebc7724..edc6dbdfc3b 100644
--- a/hotspot/src/os/solaris/dtrace/jvm_dtrace.h
+++ b/hotspot/src/os/solaris/dtrace/jvm_dtrace.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
diff --git a/hotspot/src/os/solaris/dtrace/libjvm_db.h b/hotspot/src/os/solaris/dtrace/libjvm_db.h
index 2893646236a..d1c5a5ee074 100644
--- a/hotspot/src/os/solaris/dtrace/libjvm_db.h
+++ b/hotspot/src/os/solaris/dtrace/libjvm_db.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_SOLARIS_DTRACE_LIBJVM_DB_H
+#define OS_SOLARIS_DTRACE_LIBJVM_DB_H
+
#include
#ifdef __cplusplus
@@ -61,3 +64,5 @@ void Jagent_destroy(jvm_agent_t *J);
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
+
+#endif // OS_SOLARIS_DTRACE_LIBJVM_DB_H
diff --git a/hotspot/src/os/solaris/launcher/java.c b/hotspot/src/os/solaris/launcher/java.c
deleted file mode 100644
index d62f8dd5d43..00000000000
--- a/hotspot/src/os/solaris/launcher/java.c
+++ /dev/null
@@ -1,1842 +0,0 @@
-/*
- * Copyright (c) 1998, 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.
- *
- */
-
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- *
- * GAMMA: gamma launcher is much simpler than regular java launcher in that
- * JVM is either statically linked in or it is installed in the
- * same directory where the launcher exists, so we don't have to
- * worry about choosing the right JVM based on command line flag, jar
- * file and/or ergonomics. Intead of removing unused logic from source
- * they are commented out with #ifndef GAMMA, hopefully it'll be easier
- * to maintain this file in sync with regular JDK launcher.
- */
-
-/*
- * Shared source for 'java' command line tool.
- *
- * If JAVA_ARGS is defined, then acts as a launcher for applications. For
- * instance, the JDK command line tools such as javac and javadoc (see
- * makefiles for more details) are built with this program. Any arguments
- * prefixed with '-J' will be passed directly to the 'java' command.
- */
-
-#ifdef GAMMA
-# ifdef JAVA_ARGS
-# error Do NOT define JAVA_ARGS when building gamma launcher
-# endif
-# if !defined(LINK_INTO_AOUT) && !defined(LINK_INTO_LIBJVM)
-# error Either LINK_INTO_AOUT or LINK_INTO_LIBJVM must be defined
-# endif
-#endif
-
-/*
- * One job of the launcher is to remove command line options which the
- * vm does not understand and will not process. These options include
- * options which select which style of vm is run (e.g. -client and
- * -server) as well as options which select the data model to use.
- * Additionally, for tools which invoke an underlying vm "-J-foo"
- * options are turned into "-foo" options to the vm. This option
- * filtering is handled in a number of places in the launcher, some of
- * it in machine-dependent code. In this file, the function
- * CheckJVMType removes vm style options and TranslateDashJArgs
- * removes "-J" prefixes. On unix platforms, the
- * CreateExecutionEnvironment function from the unix java_md.c file
- * processes and removes -d options. However, in case
- * CreateExecutionEnvironment does not need to exec because
- * LD_LIBRARY_PATH is set acceptably and the data model does not need
- * to be changed, ParseArguments will screen out the redundant -d
- * options and prevent them from being passed to the vm; this is done
- * by using the machine-dependent call
- * RemovableMachineDependentOption.
- */
-
-#include
-#include
-#include
-
-#include
-#include "java.h"
-
-#ifndef GAMMA
-#include "manifest_info.h"
-#include "version_comp.h"
-#endif
-
-#ifndef FULL_VERSION
-#define FULL_VERSION JDK_MAJOR_VERSION "." JDK_MINOR_VERSION
-#endif
-
-/*
- * The following environment variable is used to influence the behavior
- * of the jre exec'd through the SelectVersion routine. The command line
- * options which specify the version are not passed to the exec'd version,
- * because that jre may be an older version which wouldn't recognize them.
- * This environment variable is known to this (and later) version and serves
- * to suppress the version selection code. This is not only for efficiency,
- * but also for correctness, since any command line options have been
- * removed which would cause any value found in the manifest to be used.
- * This would be incorrect because the command line options are defined
- * to take precedence.
- *
- * The value associated with this environment variable is the MainClass
- * name from within the executable jar file (if any). This is strictly a
- * performance enhancement to avoid re-reading the jar file manifest.
- *
- * A NOTE TO DEVELOPERS: For performance reasons it is important that
- * the program image remain relatively small until after SelectVersion
- * CreateExecutionEnvironment have finished their possibly recursive
- * processing. Watch everything, but resist all temptations to use Java
- * interfaces.
- */
-#define ENV_ENTRY "_JAVA_VERSION_SET"
-
-static jboolean printVersion = JNI_FALSE; /* print and exit */
-static jboolean showVersion = JNI_FALSE; /* print but continue */
-static char *progname;
-jboolean _launcher_debug = JNI_FALSE;
-
-/*
- * List of VM options to be specified when the VM is created.
- */
-static JavaVMOption *options;
-static int numOptions, maxOptions;
-
-/*
- * Prototypes for functions internal to launcher.
- */
-static void AddOption(char *str, void *info);
-static void SetClassPath(char *s);
-static void SelectVersion(int argc, char **argv, char **main_class);
-static jboolean ParseArguments(int *pargc, char ***pargv, char **pjarfile,
- char **pclassname, int *pret);
-static jboolean InitializeJVM(JavaVM **pvm, JNIEnv **penv,
- InvocationFunctions *ifn);
-static jstring NewPlatformString(JNIEnv *env, char *s);
-static jobjectArray NewPlatformStringArray(JNIEnv *env, char **strv, int strc);
-static jclass LoadClass(JNIEnv *env, char *name);
-static jstring GetMainClassName(JNIEnv *env, char *jarname);
-static void SetJavaCommandLineProp(char* classname, char* jarfile, int argc, char** argv);
-#ifdef GAMMA
-static void SetJavaLauncherProp(void);
-#endif
-
-#ifdef JAVA_ARGS
-static void TranslateDashJArgs(int *pargc, char ***pargv);
-static jboolean AddApplicationOptions(void);
-#endif
-
-static void PrintJavaVersion(JNIEnv *env);
-static void PrintUsage(void);
-static jint PrintXUsage(void);
-
-static void SetPaths(int argc, char **argv);
-
-/* Maximum supported entries from jvm.cfg. */
-#define INIT_MAX_KNOWN_VMS 10
-/* Values for vmdesc.flag */
-#define VM_UNKNOWN -1
-#define VM_KNOWN 0
-#define VM_ALIASED_TO 1
-#define VM_WARN 2
-#define VM_ERROR 3
-#define VM_IF_SERVER_CLASS 4
-#define VM_IGNORE 5
-struct vmdesc {
- char *name;
- int flag;
- char *alias;
- char *server_class;
-};
-static struct vmdesc *knownVMs = NULL;
-static int knownVMsCount = 0;
-static int knownVMsLimit = 0;
-
-static void GrowKnownVMs();
-static int KnownVMIndex(const char* name);
-static void FreeKnownVMs();
-
-jboolean ServerClassMachine();
-
-/* flag which if set suppresses error messages from the launcher */
-static int noExitErrorMessage = 0;
-
-/*
- * Entry point.
- */
-int
-main(int argc, char ** argv)
-{
- JavaVM *vm = 0;
- JNIEnv *env = 0;
- char *jarfile = 0;
- char *classname = 0;
- char *s = 0;
- char *main_class = NULL;
- jstring mainClassName;
- jclass mainClass;
- jmethodID mainID;
- jobjectArray mainArgs;
- int ret;
- InvocationFunctions ifn;
- jlong start, end;
- char jrepath[MAXPATHLEN], jvmpath[MAXPATHLEN];
- char ** original_argv = argv;
-
- /*
- * Error message to print or display; by default the message will
- * only be displayed in a window.
- */
- char * message = "Fatal exception occurred. Program will exit.";
- jboolean messageDest = JNI_FALSE;
-
- if (getenv("_JAVA_LAUNCHER_DEBUG") != 0) {
- _launcher_debug = JNI_TRUE;
- printf("----_JAVA_LAUNCHER_DEBUG----\n");
- }
-
-#ifndef GAMMA
- /*
- * Make sure the specified version of the JRE is running.
- *
- * There are three things to note about the SelectVersion() routine:
- * 1) If the version running isn't correct, this routine doesn't
- * return (either the correct version has been exec'd or an error
- * was issued).
- * 2) Argc and Argv in this scope are *not* altered by this routine.
- * It is the responsibility of subsequent code to ignore the
- * arguments handled by this routine.
- * 3) As a side-effect, the variable "main_class" is guaranteed to
- * be set (if it should ever be set). This isn't exactly the
- * poster child for structured programming, but it is a small
- * price to pay for not processing a jar file operand twice.
- * (Note: This side effect has been disabled. See comment on
- * bugid 5030265 below.)
- */
- SelectVersion(argc, argv, &main_class);
-#endif /* ifndef GAMMA */
-
- /* copy original argv */
- {
- int i;
- original_argv = (char**)MemAlloc(sizeof(char*)*(argc+1));
- for(i = 0; i < argc+1; i++)
- original_argv[i] = argv[i];
- }
-
- CreateExecutionEnvironment(&argc, &argv,
- jrepath, sizeof(jrepath),
- jvmpath, sizeof(jvmpath),
- original_argv);
- ifn.CreateJavaVM = 0;
- ifn.GetDefaultJavaVMInitArgs = 0;
-
- if (_launcher_debug)
- start = CounterGet();
- if (!LoadJavaVM(jvmpath, &ifn)) {
- exit(6);
- }
- if (_launcher_debug) {
- end = CounterGet();
- printf("%ld micro seconds to LoadJavaVM\n",
- (long)(jint)Counter2Micros(end-start));
- }
-
-#ifdef JAVA_ARGS /* javac, jar and friends. */
- progname = "java";
-#else /* java, oldjava, javaw and friends */
-#ifdef PROGNAME
- progname = PROGNAME;
-#else
- progname = *argv;
- if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) {
- progname = s + 1;
- }
-#endif /* PROGNAME */
-#endif /* JAVA_ARGS */
- ++argv;
- --argc;
-
-#ifdef JAVA_ARGS
- /* Preprocess wrapper arguments */
- TranslateDashJArgs(&argc, &argv);
- if (!AddApplicationOptions()) {
- exit(1);
- }
-#endif
-
- /* Set default CLASSPATH */
- if ((s = getenv("CLASSPATH")) == 0) {
- s = ".";
- }
-#ifndef JAVA_ARGS
- SetClassPath(s);
-#endif
-
- /*
- * Parse command line options; if the return value of
- * ParseArguments is false, the program should exit.
- */
- if (!ParseArguments(&argc, &argv, &jarfile, &classname, &ret)) {
- exit(ret);
- }
-
- /* Override class path if -jar flag was specified */
- if (jarfile != 0) {
- SetClassPath(jarfile);
- }
-
- /* set the -Dsun.java.command pseudo property */
- SetJavaCommandLineProp(classname, jarfile, argc, argv);
-
-#ifdef GAMMA
- /* Set the -Dsun.java.launcher pseudo property */
- SetJavaLauncherProp();
-#endif
-
- /*
- * Done with all command line processing and potential re-execs so
- * clean up the environment.
- */
- (void)UnsetEnv(ENV_ENTRY);
-
- /* Initialize the virtual machine */
-
- if (_launcher_debug)
- start = CounterGet();
- if (!InitializeJVM(&vm, &env, &ifn)) {
- ReportErrorMessage("Could not create the Java virtual machine.",
- JNI_TRUE);
- exit(1);
- }
-
- if (printVersion || showVersion) {
- PrintJavaVersion(env);
- if ((*env)->ExceptionOccurred(env)) {
- ReportExceptionDescription(env);
- goto leave;
- }
- if (printVersion) {
- ret = 0;
- message = NULL;
- goto leave;
- }
- if (showVersion) {
- fprintf(stderr, "\n");
- }
- }
-
- /* If the user specified neither a class name nor a JAR file */
- if (jarfile == 0 && classname == 0) {
- PrintUsage();
- message = NULL;
- goto leave;
- }
-
-#ifndef GAMMA
- FreeKnownVMs(); /* after last possible PrintUsage() */
-#endif
-
- if (_launcher_debug) {
- end = CounterGet();
- printf("%ld micro seconds to InitializeJVM\n",
- (long)(jint)Counter2Micros(end-start));
- }
-
- /* At this stage, argc/argv have the applications' arguments */
- if (_launcher_debug) {
- int i = 0;
- printf("Main-Class is '%s'\n", classname ? classname : "");
- printf("Apps' argc is %d\n", argc);
- for (; i < argc; i++) {
- printf(" argv[%2d] = '%s'\n", i, argv[i]);
- }
- }
-
- ret = 1;
-
- /*
- * Get the application's main class.
- *
- * See bugid 5030265. The Main-Class name has already been parsed
- * from the manifest, but not parsed properly for UTF-8 support.
- * Hence the code here ignores the value previously extracted and
- * uses the pre-existing code to reextract the value. This is
- * possibly an end of release cycle expedient. However, it has
- * also been discovered that passing some character sets through
- * the environment has "strange" behavior on some variants of
- * Windows. Hence, maybe the manifest parsing code local to the
- * launcher should never be enhanced.
- *
- * Hence, future work should either:
- * 1) Correct the local parsing code and verify that the
- * Main-Class attribute gets properly passed through
- * all environments,
- * 2) Remove the vestages of maintaining main_class through
- * the environment (and remove these comments).
- */
- if (jarfile != 0) {
- mainClassName = GetMainClassName(env, jarfile);
- if ((*env)->ExceptionOccurred(env)) {
- ReportExceptionDescription(env);
- goto leave;
- }
- if (mainClassName == NULL) {
- const char * format = "Failed to load Main-Class manifest "
- "attribute from\n%s";
- message = (char*)MemAlloc((strlen(format) + strlen(jarfile)) *
- sizeof(char));
- sprintf(message, format, jarfile);
- messageDest = JNI_TRUE;
- goto leave;
- }
- classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
- if (classname == NULL) {
- ReportExceptionDescription(env);
- goto leave;
- }
- mainClass = LoadClass(env, classname);
- if(mainClass == NULL) { /* exception occurred */
- ReportExceptionDescription(env);
- message = "Could not find the main class. Program will exit.";
- goto leave;
- }
- (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
- } else {
- mainClassName = NewPlatformString(env, classname);
- if (mainClassName == NULL) {
- const char * format = "Failed to load Main Class: %s";
- message = (char *)MemAlloc((strlen(format) + strlen(classname)) *
- sizeof(char) );
- sprintf(message, format, classname);
- messageDest = JNI_TRUE;
- goto leave;
- }
- classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
- if (classname == NULL) {
- ReportExceptionDescription(env);
- goto leave;
- }
- mainClass = LoadClass(env, classname);
- if(mainClass == NULL) { /* exception occurred */
- ReportExceptionDescription(env);
- message = "Could not find the main class. Program will exit.";
- goto leave;
- }
- (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
- }
-
- /* Get the application's main method */
- mainID = (*env)->GetStaticMethodID(env, mainClass, "main",
- "([Ljava/lang/String;)V");
- if (mainID == NULL) {
- if ((*env)->ExceptionOccurred(env)) {
- ReportExceptionDescription(env);
- } else {
- message = "No main method found in specified class.";
- messageDest = JNI_TRUE;
- }
- goto leave;
- }
-
- { /* Make sure the main method is public */
- jint mods;
- jmethodID mid;
- jobject obj = (*env)->ToReflectedMethod(env, mainClass,
- mainID, JNI_TRUE);
-
- if( obj == NULL) { /* exception occurred */
- ReportExceptionDescription(env);
- goto leave;
- }
-
- mid =
- (*env)->GetMethodID(env,
- (*env)->GetObjectClass(env, obj),
- "getModifiers", "()I");
- if ((*env)->ExceptionOccurred(env)) {
- ReportExceptionDescription(env);
- goto leave;
- }
-
- mods = (*env)->CallIntMethod(env, obj, mid);
- if ((mods & 1) == 0) { /* if (!Modifier.isPublic(mods)) ... */
- message = "Main method not public.";
- messageDest = JNI_TRUE;
- goto leave;
- }
- }
-
- /* Build argument array */
- mainArgs = NewPlatformStringArray(env, argv, argc);
- if (mainArgs == NULL) {
- ReportExceptionDescription(env);
- goto leave;
- }
-
- /* Invoke main method. */
- (*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs);
-
- /*
- * The launcher's exit code (in the absence of calls to
- * System.exit) will be non-zero if main threw an exception.
- */
- ret = (*env)->ExceptionOccurred(env) == NULL ? 0 : 1;
-
- /*
- * Detach the main thread so that it appears to have ended when
- * the application's main method exits. This will invoke the
- * uncaught exception handler machinery if main threw an
- * exception. An uncaught exception handler cannot change the
- * launcher's return code except by calling System.exit.
- */
- if ((*vm)->DetachCurrentThread(vm) != 0) {
- message = "Could not detach main thread.";
- messageDest = JNI_TRUE;
- ret = 1;
- goto leave;
- }
-
- message = NULL;
-
- leave:
- /*
- * Wait for all non-daemon threads to end, then destroy the VM.
- * This will actually create a trivial new Java waiter thread
- * named "DestroyJavaVM", but this will be seen as a different
- * thread from the one that executed main, even though they are
- * the same C thread. This allows mainThread.join() and
- * mainThread.isAlive() to work as expected.
- */
- (*vm)->DestroyJavaVM(vm);
-
- if(message != NULL && !noExitErrorMessage)
- ReportErrorMessage(message, messageDest);
- return ret;
-}
-
-
-#ifndef GAMMA
-/*
- * Checks the command line options to find which JVM type was
- * specified. If no command line option was given for the JVM type,
- * the default type is used. The environment variable
- * JDK_ALTERNATE_VM and the command line option -XXaltjvm= are also
- * checked as ways of specifying which JVM type to invoke.
- */
-char *
-CheckJvmType(int *pargc, char ***argv, jboolean speculative) {
- int i, argi;
- int argc;
- char **newArgv;
- int newArgvIdx = 0;
- int isVMType;
- int jvmidx = -1;
- char *jvmtype = getenv("JDK_ALTERNATE_VM");
-
- argc = *pargc;
-
- /* To make things simpler we always copy the argv array */
- newArgv = MemAlloc((argc + 1) * sizeof(char *));
-
- /* The program name is always present */
- newArgv[newArgvIdx++] = (*argv)[0];
-
- for (argi = 1; argi < argc; argi++) {
- char *arg = (*argv)[argi];
- isVMType = 0;
-
-#ifdef JAVA_ARGS
- if (arg[0] != '-') {
- newArgv[newArgvIdx++] = arg;
- continue;
- }
-#else
- if (strcmp(arg, "-classpath") == 0 ||
- strcmp(arg, "-cp") == 0) {
- newArgv[newArgvIdx++] = arg;
- argi++;
- if (argi < argc) {
- newArgv[newArgvIdx++] = (*argv)[argi];
- }
- continue;
- }
- if (arg[0] != '-') break;
-#endif
-
- /* Did the user pass an explicit VM type? */
- i = KnownVMIndex(arg);
- if (i >= 0) {
- jvmtype = knownVMs[jvmidx = i].name + 1; /* skip the - */
- isVMType = 1;
- *pargc = *pargc - 1;
- }
-
- /* Did the user specify an "alternate" VM? */
- else if (strncmp(arg, "-XXaltjvm=", 10) == 0 || strncmp(arg, "-J-XXaltjvm=", 12) == 0) {
- isVMType = 1;
- jvmtype = arg+((arg[1]=='X')? 10 : 12);
- jvmidx = -1;
- }
-
- if (!isVMType) {
- newArgv[newArgvIdx++] = arg;
- }
- }
-
- /*
- * Finish copying the arguments if we aborted the above loop.
- * NOTE that if we aborted via "break" then we did NOT copy the
- * last argument above, and in addition argi will be less than
- * argc.
- */
- while (argi < argc) {
- newArgv[newArgvIdx++] = (*argv)[argi];
- argi++;
- }
-
- /* argv is null-terminated */
- newArgv[newArgvIdx] = 0;
-
- /* Copy back argv */
- *argv = newArgv;
- *pargc = newArgvIdx;
-
- /* use the default VM type if not specified (no alias processing) */
- if (jvmtype == NULL) {
- char* result = knownVMs[0].name+1;
- /* Use a different VM type if we are on a server class machine? */
- if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) &&
- (ServerClassMachine() == JNI_TRUE)) {
- result = knownVMs[0].server_class+1;
- }
- if (_launcher_debug) {
- printf("Default VM: %s\n", result);
- }
- return result;
- }
-
- /* if using an alternate VM, no alias processing */
- if (jvmidx < 0)
- return jvmtype;
-
- /* Resolve aliases first */
- {
- int loopCount = 0;
- while (knownVMs[jvmidx].flag == VM_ALIASED_TO) {
- int nextIdx = KnownVMIndex(knownVMs[jvmidx].alias);
-
- if (loopCount > knownVMsCount) {
- if (!speculative) {
- ReportErrorMessage("Error: Corrupt jvm.cfg file; cycle in alias list.",
- JNI_TRUE);
- exit(1);
- } else {
- return "ERROR";
- /* break; */
- }
- }
-
- if (nextIdx < 0) {
- if (!speculative) {
- ReportErrorMessage2("Error: Unable to resolve VM alias %s",
- knownVMs[jvmidx].alias, JNI_TRUE);
- exit(1);
- } else {
- return "ERROR";
- }
- }
- jvmidx = nextIdx;
- jvmtype = knownVMs[jvmidx].name+1;
- loopCount++;
- }
- }
-
- switch (knownVMs[jvmidx].flag) {
- case VM_WARN:
- if (!speculative) {
- fprintf(stderr, "Warning: %s VM not supported; %s VM will be used\n",
- jvmtype, knownVMs[0].name + 1);
- }
- /* fall through */
- case VM_IGNORE:
- jvmtype = knownVMs[jvmidx=0].name + 1;
- /* fall through */
- case VM_KNOWN:
- break;
- case VM_ERROR:
- if (!speculative) {
- ReportErrorMessage2("Error: %s VM not supported", jvmtype, JNI_TRUE);
- exit(1);
- } else {
- return "ERROR";
- }
- }
-
- return jvmtype;
-}
-#endif /* ifndef GAMMA */
-
-/*
- * Adds a new VM option with the given given name and value.
- */
-static void
-AddOption(char *str, void *info)
-{
- /*
- * Expand options array if needed to accommodate at least one more
- * VM option.
- */
- if (numOptions >= maxOptions) {
- if (options == 0) {
- maxOptions = 4;
- options = MemAlloc(maxOptions * sizeof(JavaVMOption));
- } else {
- JavaVMOption *tmp;
- maxOptions *= 2;
- tmp = MemAlloc(maxOptions * sizeof(JavaVMOption));
- memcpy(tmp, options, numOptions * sizeof(JavaVMOption));
- free(options);
- options = tmp;
- }
- }
- options[numOptions].optionString = str;
- options[numOptions++].extraInfo = info;
-}
-
-static void
-SetClassPath(char *s)
-{
- char *def = MemAlloc(strlen(s) + 40);
- sprintf(def, "-Djava.class.path=%s", s);
- AddOption(def, NULL);
-}
-
-#ifndef GAMMA
-/*
- * The SelectVersion() routine ensures that an appropriate version of
- * the JRE is running. The specification for the appropriate version
- * is obtained from either the manifest of a jar file (preferred) or
- * from command line options.
- */
-static void
-SelectVersion(int argc, char **argv, char **main_class)
-{
- char *arg;
- char **new_argv;
- char **new_argp;
- char *operand;
- char *version = NULL;
- char *jre = NULL;
- int jarflag = 0;
- int restrict_search = -1; /* -1 implies not known */
- manifest_info info;
- char env_entry[MAXNAMELEN + 24] = ENV_ENTRY "=";
- char *env_in;
- int res;
-
- /*
- * If the version has already been selected, set *main_class
- * with the value passed through the environment (if any) and
- * simply return.
- */
- if ((env_in = getenv(ENV_ENTRY)) != NULL) {
- if (*env_in != '\0')
- *main_class = strdup(env_in);
- return;
- }
-
- /*
- * Scan through the arguments for options relevant to multiple JRE
- * support. For reference, the command line syntax is defined as:
- *
- * SYNOPSIS
- * java [options] class [argument...]
- *
- * java [options] -jar file.jar [argument...]
- *
- * As the scan is performed, make a copy of the argument list with
- * the version specification options (new to 1.5) removed, so that
- * a version less than 1.5 can be exec'd.
- */
- new_argv = MemAlloc((argc + 1) * sizeof(char*));
- new_argv[0] = argv[0];
- new_argp = &new_argv[1];
- argc--;
- argv++;
- while ((arg = *argv) != 0 && *arg == '-') {
- if (strncmp(arg, "-version:", 9) == 0) {
- version = arg + 9;
- } else if (strcmp(arg, "-jre-restrict-search") == 0) {
- restrict_search = 1;
- } else if (strcmp(arg, "-no-jre-restrict-search") == 0) {
- restrict_search = 0;
- } else {
- if (strcmp(arg, "-jar") == 0)
- jarflag = 1;
- /* deal with "unfortunate" classpath syntax */
- if ((strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) &&
- (argc >= 2)) {
- *new_argp++ = arg;
- argc--;
- argv++;
- arg = *argv;
- }
- *new_argp++ = arg;
- }
- argc--;
- argv++;
- }
- if (argc <= 0) { /* No operand? Possibly legit with -[full]version */
- operand = NULL;
- } else {
- argc--;
- *new_argp++ = operand = *argv++;
- }
- while (argc-- > 0) /* Copy over [argument...] */
- *new_argp++ = *argv++;
- *new_argp = NULL;
-
- /*
- * If there is a jar file, read the manifest. If the jarfile can't be
- * read, the manifest can't be read from the jar file, or the manifest
- * is corrupt, issue the appropriate error messages and exit.
- *
- * Even if there isn't a jar file, construct a manifest_info structure
- * containing the command line information. It's a convenient way to carry
- * this data around.
- */
- if (jarflag && operand) {
- if ((res = parse_manifest(operand, &info)) != 0) {
- if (res == -1)
- ReportErrorMessage2("Unable to access jarfile %s",
- operand, JNI_TRUE);
- else
- ReportErrorMessage2("Invalid or corrupt jarfile %s",
- operand, JNI_TRUE);
- exit(1);
- }
- } else {
- info.manifest_version = NULL;
- info.main_class = NULL;
- info.jre_version = NULL;
- info.jre_restrict_search = 0;
- }
-
- /*
- * The JRE-Version and JRE-Restrict-Search values (if any) from the
- * manifest are overwritten by any specified on the command line.
- */
- if (version != NULL)
- info.jre_version = version;
- if (restrict_search != -1)
- info.jre_restrict_search = restrict_search;
-
- /*
- * "Valid" returns (other than unrecoverable errors) follow. Set
- * main_class as a side-effect of this routine.
- */
- if (info.main_class != NULL)
- *main_class = strdup(info.main_class);
-
- /*
- * If no version selection information is found either on the command
- * line or in the manifest, simply return.
- */
- if (info.jre_version == NULL) {
- free_manifest();
- free(new_argv);
- return;
- }
-
- /*
- * Check for correct syntax of the version specification (JSR 56).
- */
- if (!valid_version_string(info.jre_version)) {
- ReportErrorMessage2("Syntax error in version specification \"%s\"",
- info.jre_version, JNI_TRUE);
- exit(1);
- }
-
- /*
- * Find the appropriate JVM on the system. Just to be as forgiving as
- * possible, if the standard algorithms don't locate an appropriate
- * jre, check to see if the one running will satisfy the requirements.
- * This can happen on systems which haven't been set-up for multiple
- * JRE support.
- */
- jre = LocateJRE(&info);
- if (_launcher_debug)
- printf("JRE-Version = %s, JRE-Restrict-Search = %s Selected = %s\n",
- (info.jre_version?info.jre_version:"null"),
- (info.jre_restrict_search?"true":"false"), (jre?jre:"null"));
- if (jre == NULL) {
- if (acceptable_release(FULL_VERSION, info.jre_version)) {
- free_manifest();
- free(new_argv);
- return;
- } else {
- ReportErrorMessage2(
- "Unable to locate JRE meeting specification \"%s\"",
- info.jre_version, JNI_TRUE);
- exit(1);
- }
- }
-
- /*
- * If I'm not the chosen one, exec the chosen one. Returning from
- * ExecJRE indicates that I am indeed the chosen one.
- *
- * The private environment variable _JAVA_VERSION_SET is used to
- * prevent the chosen one from re-reading the manifest file and
- * using the values found within to override the (potential) command
- * line flags stripped from argv (because the target may not
- * understand them). Passing the MainClass value is an optimization
- * to avoid locating, expanding and parsing the manifest extra
- * times.
- */
- if (info.main_class != NULL)
- (void)strcat(env_entry, info.main_class);
- (void)putenv(env_entry);
- ExecJRE(jre, new_argv);
- free_manifest();
- free(new_argv);
- return;
-}
-#endif /* ifndef GAMMA */
-
-/*
- * Parses command line arguments. Returns JNI_FALSE if launcher
- * should exit without starting vm (e.g. certain version and usage
- * options); returns JNI_TRUE if vm needs to be started to process
- * given options. *pret (the launcher process return value) is set to
- * 0 for a normal exit.
- */
-static jboolean
-ParseArguments(int *pargc, char ***pargv, char **pjarfile,
- char **pclassname, int *pret)
-{
- int argc = *pargc;
- char **argv = *pargv;
- jboolean jarflag = JNI_FALSE;
- char *arg;
-
- *pret = 1;
- while ((arg = *argv) != 0 && *arg == '-') {
- argv++; --argc;
- if (strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) {
- if (argc < 1) {
- ReportErrorMessage2("%s requires class path specification",
- arg, JNI_TRUE);
- PrintUsage();
- return JNI_FALSE;
- }
- SetClassPath(*argv);
- argv++; --argc;
- } else if (strcmp(arg, "-jar") == 0) {
- jarflag = JNI_TRUE;
- } else if (strcmp(arg, "-help") == 0 ||
- strcmp(arg, "-h") == 0 ||
- strcmp(arg, "-?") == 0) {
- PrintUsage();
- *pret = 0;
- return JNI_FALSE;
- } else if (strcmp(arg, "-version") == 0) {
- printVersion = JNI_TRUE;
- return JNI_TRUE;
- } else if (strcmp(arg, "-showversion") == 0) {
- showVersion = JNI_TRUE;
- } else if (strcmp(arg, "-X") == 0) {
- *pret = PrintXUsage();
- return JNI_FALSE;
-/*
- * The following case provide backward compatibility with old-style
- * command line options.
- */
- } else if (strcmp(arg, "-fullversion") == 0) {
- fprintf(stderr, "%s full version \"%s\"\n", progname,
- FULL_VERSION);
- *pret = 0;
- return JNI_FALSE;
- } else if (strcmp(arg, "-verbosegc") == 0) {
- AddOption("-verbose:gc", NULL);
- } else if (strcmp(arg, "-t") == 0) {
- AddOption("-Xt", NULL);
- } else if (strcmp(arg, "-tm") == 0) {
- AddOption("-Xtm", NULL);
- } else if (strcmp(arg, "-debug") == 0) {
- AddOption("-Xdebug", NULL);
- } else if (strcmp(arg, "-noclassgc") == 0) {
- AddOption("-Xnoclassgc", NULL);
- } else if (strcmp(arg, "-Xfuture") == 0) {
- AddOption("-Xverify:all", NULL);
- } else if (strcmp(arg, "-verify") == 0) {
- AddOption("-Xverify:all", NULL);
- } else if (strcmp(arg, "-verifyremote") == 0) {
- AddOption("-Xverify:remote", NULL);
- } else if (strcmp(arg, "-noverify") == 0) {
- AddOption("-Xverify:none", NULL);
- } else if (strcmp(arg, "-XXsuppressExitMessage") == 0) {
- noExitErrorMessage = 1;
- } else if (strncmp(arg, "-prof", 5) == 0) {
- char *p = arg + 5;
- char *tmp = MemAlloc(strlen(arg) + 50);
- if (*p) {
- sprintf(tmp, "-Xrunhprof:cpu=old,file=%s", p + 1);
- } else {
- sprintf(tmp, "-Xrunhprof:cpu=old,file=java.prof");
- }
- AddOption(tmp, NULL);
- } else if (strncmp(arg, "-ss", 3) == 0 ||
- strncmp(arg, "-oss", 4) == 0 ||
- strncmp(arg, "-ms", 3) == 0 ||
- strncmp(arg, "-mx", 3) == 0) {
- char *tmp = MemAlloc(strlen(arg) + 6);
- sprintf(tmp, "-X%s", arg + 1); /* skip '-' */
- AddOption(tmp, NULL);
- } else if (strcmp(arg, "-checksource") == 0 ||
- strcmp(arg, "-cs") == 0 ||
- strcmp(arg, "-noasyncgc") == 0) {
- /* No longer supported */
- fprintf(stderr,
- "Warning: %s option is no longer supported.\n",
- arg);
- } else if (strncmp(arg, "-version:", 9) == 0 ||
- strcmp(arg, "-no-jre-restrict-search") == 0 ||
- strcmp(arg, "-jre-restrict-search") == 0) {
- ; /* Ignore machine independent options already handled */
- } else if (RemovableMachineDependentOption(arg) ) {
- ; /* Do not pass option to vm. */
- }
- else {
- AddOption(arg, NULL);
- }
- }
-
- if (--argc >= 0) {
- if (jarflag) {
- *pjarfile = *argv++;
- *pclassname = 0;
- } else {
- *pjarfile = 0;
- *pclassname = *argv++;
- }
- *pargc = argc;
- *pargv = argv;
- }
-
- return JNI_TRUE;
-}
-
-/*
- * Initializes the Java Virtual Machine. Also frees options array when
- * finished.
- */
-static jboolean
-InitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunctions *ifn)
-{
- JavaVMInitArgs args;
- jint r;
-
- memset(&args, 0, sizeof(args));
- args.version = JNI_VERSION_1_2;
- args.nOptions = numOptions;
- args.options = options;
- args.ignoreUnrecognized = JNI_FALSE;
-
- if (_launcher_debug) {
- int i = 0;
- printf("JavaVM args:\n ");
- printf("version 0x%08lx, ", (long)args.version);
- printf("ignoreUnrecognized is %s, ",
- args.ignoreUnrecognized ? "JNI_TRUE" : "JNI_FALSE");
- printf("nOptions is %ld\n", (long)args.nOptions);
- for (i = 0; i < numOptions; i++)
- printf(" option[%2d] = '%s'\n",
- i, args.options[i].optionString);
- }
-
- r = ifn->CreateJavaVM(pvm, (void **)penv, &args);
- free(options);
- return r == JNI_OK;
-}
-
-
-#define NULL_CHECK0(e) if ((e) == 0) return 0
-#define NULL_CHECK(e) if ((e) == 0) return
-
-/*
- * Returns a pointer to a block of at least 'size' bytes of memory.
- * Prints error message and exits if the memory could not be allocated.
- */
-void *
-MemAlloc(size_t size)
-{
- void *p = malloc(size);
- if (p == 0) {
- perror("malloc");
- exit(1);
- }
- return p;
-}
-
-static jstring platformEncoding = NULL;
-static jstring getPlatformEncoding(JNIEnv *env) {
- if (platformEncoding == NULL) {
- jstring propname = (*env)->NewStringUTF(env, "sun.jnu.encoding");
- if (propname) {
- jclass cls;
- jmethodID mid;
- NULL_CHECK0 (cls = FindBootStrapClass(env, "java/lang/System"));
- NULL_CHECK0 (mid = (*env)->GetStaticMethodID(
- env, cls,
- "getProperty",
- "(Ljava/lang/String;)Ljava/lang/String;"));
- platformEncoding = (*env)->CallStaticObjectMethod (
- env, cls, mid, propname);
- }
- }
- return platformEncoding;
-}
-
-static jboolean isEncodingSupported(JNIEnv *env, jstring enc) {
- jclass cls;
- jmethodID mid;
- NULL_CHECK0 (cls = FindBootStrapClass(env, "java/nio/charset/Charset"));
- NULL_CHECK0 (mid = (*env)->GetStaticMethodID(
- env, cls,
- "isSupported",
- "(Ljava/lang/String;)Z"));
- return (jboolean)(*env)->CallStaticObjectMethod (env, cls, mid, enc);
-}
-
-/*
- * Returns a new Java string object for the specified platform string.
- */
-static jstring
-NewPlatformString(JNIEnv *env, char *s)
-{
- int len = (int)strlen(s);
- jclass cls;
- jmethodID mid;
- jbyteArray ary;
- jstring enc;
-
- if (s == NULL)
- return 0;
- enc = getPlatformEncoding(env);
-
- ary = (*env)->NewByteArray(env, len);
- if (ary != 0) {
- jstring str = 0;
- (*env)->SetByteArrayRegion(env, ary, 0, len, (jbyte *)s);
- if (!(*env)->ExceptionOccurred(env)) {
-#ifdef GAMMA
- /* We support running JVM with older JDK, so here we have to deal */
- /* with the case that sun.jnu.encoding is undefined (enc == NULL) */
- if (enc != NULL && isEncodingSupported(env, enc) == JNI_TRUE) {
-#else
- if (isEncodingSupported(env, enc) == JNI_TRUE) {
-#endif
- NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String"));
- NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "",
- "([BLjava/lang/String;)V"));
- str = (*env)->NewObject(env, cls, mid, ary, enc);
- } else {
- /*If the encoding specified in sun.jnu.encoding is not
- endorsed by "Charset.isSupported" we have to fall back
- to use String(byte[]) explicitly here without specifying
- the encoding name, in which the StringCoding class will
- pickup the iso-8859-1 as the fallback converter for us.
- */
- NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String"));
- NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "",
- "([B)V"));
- str = (*env)->NewObject(env, cls, mid, ary);
- }
- (*env)->DeleteLocalRef(env, ary);
- return str;
- }
- }
- return 0;
-}
-
-/*
- * Returns a new array of Java string objects for the specified
- * array of platform strings.
- */
-static jobjectArray
-NewPlatformStringArray(JNIEnv *env, char **strv, int strc)
-{
- jarray cls;
- jarray ary;
- int i;
-
- NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String"));
- NULL_CHECK0(ary = (*env)->NewObjectArray(env, strc, cls, 0));
- for (i = 0; i < strc; i++) {
- jstring str = NewPlatformString(env, *strv++);
- NULL_CHECK0(str);
- (*env)->SetObjectArrayElement(env, ary, i, str);
- (*env)->DeleteLocalRef(env, str);
- }
- return ary;
-}
-
-/*
- * Loads a class, convert the '.' to '/'.
- */
-static jclass
-LoadClass(JNIEnv *env, char *name)
-{
- char *buf = MemAlloc(strlen(name) + 1);
- char *s = buf, *t = name, c;
- jclass cls;
- jlong start, end;
-
- if (_launcher_debug)
- start = CounterGet();
-
- do {
- c = *t++;
- *s++ = (c == '.') ? '/' : c;
- } while (c != '\0');
- // use the application class loader for the main-class
- cls = (*env)->FindClass(env, buf);
- free(buf);
-
- if (_launcher_debug) {
- end = CounterGet();
- printf("%ld micro seconds to load main class\n",
- (long)(jint)Counter2Micros(end-start));
- printf("----_JAVA_LAUNCHER_DEBUG----\n");
- }
-
- return cls;
-}
-
-
-/*
- * Returns the main class name for the specified jar file.
- */
-static jstring
-GetMainClassName(JNIEnv *env, char *jarname)
-{
-#define MAIN_CLASS "Main-Class"
- jclass cls;
- jmethodID mid;
- jobject jar, man, attr;
- jstring str, result = 0;
-
- NULL_CHECK0(cls = FindBootStrapClass(env, "java/util/jar/JarFile"));
- NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "",
- "(Ljava/lang/String;)V"));
- NULL_CHECK0(str = NewPlatformString(env, jarname));
- NULL_CHECK0(jar = (*env)->NewObject(env, cls, mid, str));
- NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "getManifest",
- "()Ljava/util/jar/Manifest;"));
- man = (*env)->CallObjectMethod(env, jar, mid);
- if (man != 0) {
- NULL_CHECK0(mid = (*env)->GetMethodID(env,
- (*env)->GetObjectClass(env, man),
- "getMainAttributes",
- "()Ljava/util/jar/Attributes;"));
- attr = (*env)->CallObjectMethod(env, man, mid);
- if (attr != 0) {
- NULL_CHECK0(mid = (*env)->GetMethodID(env,
- (*env)->GetObjectClass(env, attr),
- "getValue",
- "(Ljava/lang/String;)Ljava/lang/String;"));
- NULL_CHECK0(str = NewPlatformString(env, MAIN_CLASS));
- result = (*env)->CallObjectMethod(env, attr, mid, str);
- }
- }
- return result;
-}
-
-#ifdef JAVA_ARGS
-static char *java_args[] = JAVA_ARGS;
-static char *app_classpath[] = APP_CLASSPATH;
-
-/*
- * For tools convert 'javac -J-ms32m' to 'java -ms32m ...'
- */
-static void
-TranslateDashJArgs(int *pargc, char ***pargv)
-{
- const int NUM_ARGS = (sizeof(java_args) / sizeof(char *));
- int argc = *pargc;
- char **argv = *pargv;
- int nargc = argc + NUM_ARGS;
- char **nargv = MemAlloc((nargc + 1) * sizeof(char *));
- int i;
-
- *pargc = nargc;
- *pargv = nargv;
-
- /* Copy the VM arguments (i.e. prefixed with -J) */
- for (i = 0; i < NUM_ARGS; i++) {
- char *arg = java_args[i];
- if (arg[0] == '-' && arg[1] == 'J') {
- *nargv++ = arg + 2;
- }
- }
-
- for (i = 0; i < argc; i++) {
- char *arg = argv[i];
- if (arg[0] == '-' && arg[1] == 'J') {
- if (arg[2] == '\0') {
- ReportErrorMessage("Error: the -J option should not be "
- "followed by a space.", JNI_TRUE);
- exit(1);
- }
- *nargv++ = arg + 2;
- }
- }
-
- /* Copy the rest of the arguments */
- for (i = 0; i < NUM_ARGS; i++) {
- char *arg = java_args[i];
- if (arg[0] != '-' || arg[1] != 'J') {
- *nargv++ = arg;
- }
- }
- for (i = 0; i < argc; i++) {
- char *arg = argv[i];
- if (arg[0] != '-' || arg[1] != 'J') {
- *nargv++ = arg;
- }
- }
- *nargv = 0;
-}
-
-/*
- * For our tools, we try to add 3 VM options:
- * -Denv.class.path=
- * -Dapplication.home=
- * -Djava.class.path=
- * is the user's setting of CLASSPATH -- for instance the user
- * tells javac where to find binary classes through this environment
- * variable. Notice that users will be able to compile against our
- * tools classes (sun.tools.javac.Main) only if they explicitly add
- * tools.jar to CLASSPATH.
- * is the directory where the application is installed.
- * is the classpath to where our apps' classfiles are.
- */
-static jboolean
-AddApplicationOptions()
-{
- const int NUM_APP_CLASSPATH = (sizeof(app_classpath) / sizeof(char *));
- char *s, *envcp, *appcp, *apphome;
- char home[MAXPATHLEN]; /* application home */
- char separator[] = { PATH_SEPARATOR, '\0' };
- int size, i;
- int strlenHome;
-
- s = getenv("CLASSPATH");
- if (s) {
- /* 40 for -Denv.class.path= */
- envcp = (char *)MemAlloc(strlen(s) + 40);
- sprintf(envcp, "-Denv.class.path=%s", s);
- AddOption(envcp, NULL);
- }
-
- if (!GetApplicationHome(home, sizeof(home))) {
- ReportErrorMessage("Can't determine application home", JNI_TRUE);
- return JNI_FALSE;
- }
-
- /* 40 for '-Dapplication.home=' */
- apphome = (char *)MemAlloc(strlen(home) + 40);
- sprintf(apphome, "-Dapplication.home=%s", home);
- AddOption(apphome, NULL);
-
- /* How big is the application's classpath? */
- size = 40; /* 40: "-Djava.class.path=" */
- strlenHome = (int)strlen(home);
- for (i = 0; i < NUM_APP_CLASSPATH; i++) {
- size += strlenHome + (int)strlen(app_classpath[i]) + 1; /* 1: separator */
- }
- appcp = (char *)MemAlloc(size + 1);
- strcpy(appcp, "-Djava.class.path=");
- for (i = 0; i < NUM_APP_CLASSPATH; i++) {
- strcat(appcp, home); /* c:\program files\myapp */
- strcat(appcp, app_classpath[i]); /* \lib\myapp.jar */
- strcat(appcp, separator); /* ; */
- }
- appcp[strlen(appcp)-1] = '\0'; /* remove trailing path separator */
- AddOption(appcp, NULL);
- return JNI_TRUE;
-}
-#endif
-
-/*
- * inject the -Dsun.java.command pseudo property into the args structure
- * this pseudo property is used in the HotSpot VM to expose the
- * Java class name and arguments to the main method to the VM. The
- * HotSpot VM uses this pseudo property to store the Java class name
- * (or jar file name) and the arguments to the class's main method
- * to the instrumentation memory region. The sun.java.command pseudo
- * property is not exported by HotSpot to the Java layer.
- */
-void
-SetJavaCommandLineProp(char *classname, char *jarfile,
- int argc, char **argv)
-{
-
- int i = 0;
- size_t len = 0;
- char* javaCommand = NULL;
- char* dashDstr = "-Dsun.java.command=";
-
- if (classname == NULL && jarfile == NULL) {
- /* unexpected, one of these should be set. just return without
- * setting the property
- */
- return;
- }
-
- /* if the class name is not set, then use the jarfile name */
- if (classname == NULL) {
- classname = jarfile;
- }
-
- /* determine the amount of memory to allocate assuming
- * the individual components will be space separated
- */
- len = strlen(classname);
- for (i = 0; i < argc; i++) {
- len += strlen(argv[i]) + 1;
- }
-
- /* allocate the memory */
- javaCommand = (char*) MemAlloc(len + strlen(dashDstr) + 1);
-
- /* build the -D string */
- *javaCommand = '\0';
- strcat(javaCommand, dashDstr);
- strcat(javaCommand, classname);
-
- for (i = 0; i < argc; i++) {
- /* the components of the string are space separated. In
- * the case of embedded white space, the relationship of
- * the white space separated components to their true
- * positional arguments will be ambiguous. This issue may
- * be addressed in a future release.
- */
- strcat(javaCommand, " ");
- strcat(javaCommand, argv[i]);
- }
-
- AddOption(javaCommand, NULL);
-}
-
-/*
- * JVM wants to know launcher type, so tell it.
- */
-#ifdef GAMMA
-void SetJavaLauncherProp() {
- AddOption("-Dsun.java.launcher=" LAUNCHER_TYPE, NULL);
-}
-#endif
-
-/*
- * Prints the version information from the java.version and other properties.
- */
-static void
-PrintJavaVersion(JNIEnv *env)
-{
- jclass ver;
- jmethodID print;
-
- NULL_CHECK(ver = FindBootStrapClass(env, "sun/misc/Version"));
- NULL_CHECK(print = (*env)->GetStaticMethodID(env, ver, "print", "()V"));
-
- (*env)->CallStaticVoidMethod(env, ver, print);
-}
-
-/*
- * Prints default usage message.
- */
-static void
-PrintUsage(void)
-{
- int i;
-
- fprintf(stdout,
- "Usage: %s [-options] class [args...]\n"
- " (to execute a class)\n"
- " or %s [-options] -jar jarfile [args...]\n"
- " (to execute a jar file)\n"
- "\n"
- "where options include:\n",
- progname,
- progname);
-
-#ifndef GAMMA
- PrintMachineDependentOptions();
-
- if ((knownVMs[0].flag == VM_KNOWN) ||
- (knownVMs[0].flag == VM_IF_SERVER_CLASS)) {
- fprintf(stdout, " %s\t to select the \"%s\" VM\n",
- knownVMs[0].name, knownVMs[0].name+1);
- }
- for (i=1; i\n"
-" -classpath \n"
-" A %c separated list of directories, JAR archives,\n"
-" and ZIP archives to search for class files.\n"
-" -D=\n"
-" set a system property\n"
-" -verbose[:class|gc|jni]\n"
-" enable verbose output\n"
-" -version print product version and exit\n"
-" -version:\n"
-" require the specified version to run\n"
-" -showversion print product version and continue\n"
-" -jre-restrict-search | -jre-no-restrict-search\n"
-" include/exclude user private JREs in the version search\n"
-" -? -help print this help message\n"
-" -X print help on non-standard options\n"
-" -ea[:...|:]\n"
-" -enableassertions[:...|:]\n"
-" enable assertions\n"
-" -da[:...|:]\n"
-" -disableassertions[:...|:]\n"
-" disable assertions\n"
-" -esa | -enablesystemassertions\n"
-" enable system assertions\n"
-" -dsa | -disablesystemassertions\n"
-" disable system assertions\n"
-" -agentlib:[=]\n"
-" load native agent library , e.g. -agentlib:hprof\n"
-" see also, -agentlib:jdwp=help and -agentlib:hprof=help\n"
-" -agentpath:[=]\n"
-" load native agent library by full pathname\n"
-" -javaagent:[=]\n"
-" load Java programming language agent, see java.lang.instrument\n"
-
- ,PATH_SEPARATOR);
-}
-
-/*
- * Print usage message for -X options.
- */
-static jint
-PrintXUsage(void)
-{
- char path[MAXPATHLEN];
- char buf[128];
- size_t n;
- FILE *fp;
-
- GetXUsagePath(path, sizeof(path));
- fp = fopen(path, "r");
- if (fp == 0) {
- fprintf(stderr, "Can't open %s\n", path);
- return 1;
- }
- while ((n = fread(buf, 1, sizeof(buf), fp)) != 0) {
- fwrite(buf, 1, n, stdout);
- }
- fclose(fp);
- return 0;
-}
-
-#ifndef GAMMA
-
-/*
- * Read the jvm.cfg file and fill the knownJVMs[] array.
- *
- * The functionality of the jvm.cfg file is subject to change without
- * notice and the mechanism will be removed in the future.
- *
- * The lexical structure of the jvm.cfg file is as follows:
- *
- * jvmcfg := { vmLine }
- * vmLine := knownLine
- * | aliasLine
- * | warnLine
- * | ignoreLine
- * | errorLine
- * | predicateLine
- * | commentLine
- * knownLine := flag "KNOWN" EOL
- * warnLine := flag "WARN" EOL
- * ignoreLine := flag "IGNORE" EOL
- * errorLine := flag "ERROR" EOL
- * aliasLine := flag "ALIASED_TO" flag EOL
- * predicateLine := flag "IF_SERVER_CLASS" flag EOL
- * commentLine := "#" text EOL
- * flag := "-" identifier
- *
- * The semantics are that when someone specifies a flag on the command line:
- * - if the flag appears on a knownLine, then the identifier is used as
- * the name of the directory holding the JVM library (the name of the JVM).
- * - if the flag appears as the first flag on an aliasLine, the identifier
- * of the second flag is used as the name of the JVM.
- * - if the flag appears on a warnLine, the identifier is used as the
- * name of the JVM, but a warning is generated.
- * - if the flag appears on an ignoreLine, the identifier is recognized as the
- * name of a JVM, but the identifier is ignored and the default vm used
- * - if the flag appears on an errorLine, an error is generated.
- * - if the flag appears as the first flag on a predicateLine, and
- * the machine on which you are running passes the predicate indicated,
- * then the identifier of the second flag is used as the name of the JVM,
- * otherwise the identifier of the first flag is used as the name of the JVM.
- * If no flag is given on the command line, the first vmLine of the jvm.cfg
- * file determines the name of the JVM.
- * PredicateLines are only interpreted on first vmLine of a jvm.cfg file,
- * since they only make sense if someone hasn't specified the name of the
- * JVM on the command line.
- *
- * The intent of the jvm.cfg file is to allow several JVM libraries to
- * be installed in different subdirectories of a single JRE installation,
- * for space-savings and convenience in testing.
- * The intent is explicitly not to provide a full aliasing or predicate
- * mechanism.
- */
-jint
-ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative)
-{
- FILE *jvmCfg;
- char jvmCfgName[MAXPATHLEN+20];
- char line[MAXPATHLEN+20];
- int cnt = 0;
- int lineno = 0;
- jlong start, end;
- int vmType;
- char *tmpPtr;
- char *altVMName;
- char *serverClassVMName;
- static char *whiteSpace = " \t";
- if (_launcher_debug) {
- start = CounterGet();
- }
-
- strcpy(jvmCfgName, jrepath);
- strcat(jvmCfgName, FILESEP "lib" FILESEP);
- strcat(jvmCfgName, arch);
- strcat(jvmCfgName, FILESEP "jvm.cfg");
-
- jvmCfg = fopen(jvmCfgName, "r");
- if (jvmCfg == NULL) {
- if (!speculative) {
- ReportErrorMessage2("Error: could not open `%s'", jvmCfgName,
- JNI_TRUE);
- exit(1);
- } else {
- return -1;
- }
- }
- while (fgets(line, sizeof(line), jvmCfg) != NULL) {
- vmType = VM_UNKNOWN;
- lineno++;
- if (line[0] == '#')
- continue;
- if (line[0] != '-') {
- fprintf(stderr, "Warning: no leading - on line %d of `%s'\n",
- lineno, jvmCfgName);
- }
- if (cnt >= knownVMsLimit) {
- GrowKnownVMs(cnt);
- }
- line[strlen(line)-1] = '\0'; /* remove trailing newline */
- tmpPtr = line + strcspn(line, whiteSpace);
- if (*tmpPtr == 0) {
- fprintf(stderr, "Warning: missing VM type on line %d of `%s'\n",
- lineno, jvmCfgName);
- } else {
- /* Null-terminate this string for strdup below */
- *tmpPtr++ = 0;
- tmpPtr += strspn(tmpPtr, whiteSpace);
- if (*tmpPtr == 0) {
- fprintf(stderr, "Warning: missing VM type on line %d of `%s'\n",
- lineno, jvmCfgName);
- } else {
- if (!strncmp(tmpPtr, "KNOWN", strlen("KNOWN"))) {
- vmType = VM_KNOWN;
- } else if (!strncmp(tmpPtr, "ALIASED_TO", strlen("ALIASED_TO"))) {
- tmpPtr += strcspn(tmpPtr, whiteSpace);
- if (*tmpPtr != 0) {
- tmpPtr += strspn(tmpPtr, whiteSpace);
- }
- if (*tmpPtr == 0) {
- fprintf(stderr, "Warning: missing VM alias on line %d of `%s'\n",
- lineno, jvmCfgName);
- } else {
- /* Null terminate altVMName */
- altVMName = tmpPtr;
- tmpPtr += strcspn(tmpPtr, whiteSpace);
- *tmpPtr = 0;
- vmType = VM_ALIASED_TO;
- }
- } else if (!strncmp(tmpPtr, "WARN", strlen("WARN"))) {
- vmType = VM_WARN;
- } else if (!strncmp(tmpPtr, "IGNORE", strlen("IGNORE"))) {
- vmType = VM_IGNORE;
- } else if (!strncmp(tmpPtr, "ERROR", strlen("ERROR"))) {
- vmType = VM_ERROR;
- } else if (!strncmp(tmpPtr,
- "IF_SERVER_CLASS",
- strlen("IF_SERVER_CLASS"))) {
- tmpPtr += strcspn(tmpPtr, whiteSpace);
- if (*tmpPtr != 0) {
- tmpPtr += strspn(tmpPtr, whiteSpace);
- }
- if (*tmpPtr == 0) {
- fprintf(stderr, "Warning: missing server class VM on line %d of `%s'\n",
- lineno, jvmCfgName);
- } else {
- /* Null terminate server class VM name */
- serverClassVMName = tmpPtr;
- tmpPtr += strcspn(tmpPtr, whiteSpace);
- *tmpPtr = 0;
- vmType = VM_IF_SERVER_CLASS;
- }
- } else {
- fprintf(stderr, "Warning: unknown VM type on line %d of `%s'\n",
- lineno, &jvmCfgName[0]);
- vmType = VM_KNOWN;
- }
- }
- }
-
- if (_launcher_debug)
- printf("jvm.cfg[%d] = ->%s<-\n", cnt, line);
- if (vmType != VM_UNKNOWN) {
- knownVMs[cnt].name = strdup(line);
- knownVMs[cnt].flag = vmType;
- switch (vmType) {
- default:
- break;
- case VM_ALIASED_TO:
- knownVMs[cnt].alias = strdup(altVMName);
- if (_launcher_debug) {
- printf(" name: %s vmType: %s alias: %s\n",
- knownVMs[cnt].name, "VM_ALIASED_TO", knownVMs[cnt].alias);
- }
- break;
- case VM_IF_SERVER_CLASS:
- knownVMs[cnt].server_class = strdup(serverClassVMName);
- if (_launcher_debug) {
- printf(" name: %s vmType: %s server_class: %s\n",
- knownVMs[cnt].name, "VM_IF_SERVER_CLASS", knownVMs[cnt].server_class);
- }
- break;
- }
- cnt++;
- }
- }
- fclose(jvmCfg);
- knownVMsCount = cnt;
-
- if (_launcher_debug) {
- end = CounterGet();
- printf("%ld micro seconds to parse jvm.cfg\n",
- (long)(jint)Counter2Micros(end-start));
- }
-
- return cnt;
-}
-
-
-static void
-GrowKnownVMs(int minimum)
-{
- struct vmdesc* newKnownVMs;
- int newMax;
-
- newMax = (knownVMsLimit == 0 ? INIT_MAX_KNOWN_VMS : (2 * knownVMsLimit));
- if (newMax <= minimum) {
- newMax = minimum;
- }
- newKnownVMs = (struct vmdesc*) MemAlloc(newMax * sizeof(struct vmdesc));
- if (knownVMs != NULL) {
- memcpy(newKnownVMs, knownVMs, knownVMsLimit * sizeof(struct vmdesc));
- }
- free(knownVMs);
- knownVMs = newKnownVMs;
- knownVMsLimit = newMax;
-}
-
-
-/* Returns index of VM or -1 if not found */
-static int
-KnownVMIndex(const char* name)
-{
- int i;
- if (strncmp(name, "-J", 2) == 0) name += 2;
- for (i = 0; i < knownVMsCount; i++) {
- if (!strcmp(name, knownVMs[i].name)) {
- return i;
- }
- }
- return -1;
-}
-
-static void
-FreeKnownVMs()
-{
- int i;
- for (i = 0; i < knownVMsCount; i++) {
- free(knownVMs[i].name);
- knownVMs[i].name = NULL;
- }
- free(knownVMs);
-}
-
-#endif /* ifndef GAMMA */
diff --git a/hotspot/src/os/solaris/launcher/java_md.c b/hotspot/src/os/solaris/launcher/java_md.c
deleted file mode 100644
index 5c62b6450aa..00000000000
--- a/hotspot/src/os/solaris/launcher/java_md.c
+++ /dev/null
@@ -1,1849 +0,0 @@
-/*
- * Copyright (c) 1998, 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.
- *
- */
-
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- */
-
-#include "java.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#ifndef GAMMA
-#include "manifest_info.h"
-#include "version_comp.h"
-#endif
-
-#define JVM_DLL "libjvm.so"
-#define JAVA_DLL "libjava.so"
-
-#ifndef GAMMA /* launcher.make defines ARCH */
-
-/*
- * If a processor / os combination has the ability to run binaries of
- * two data models and cohabitation of jre/jdk bits with both data
- * models is supported, then DUAL_MODE is defined. When DUAL_MODE is
- * defined, the architecture names for the narrow and wide version of
- * the architecture are defined in BIG_ARCH and SMALL_ARCH. Currently
- * only Solaris on sparc/sparcv9 and i586/amd64 is DUAL_MODE; linux
- * i586/amd64 could be defined as DUAL_MODE but that is not the
- * current policy.
- */
-
-#ifdef _LP64
-
-# ifdef ia64
-# define ARCH "ia64"
-# elif defined(amd64)
-# define ARCH "amd64"
-# elif defined(__sparc)
-# define ARCH "sparcv9"
-# else
-# define ARCH "unknown" /* unknown 64-bit architecture */
-# endif
-
-#else /* 32-bit data model */
-
-# ifdef i586
-# define ARCH "i386"
-# elif defined(__sparc)
-# define ARCH "sparc"
-# endif
-
-#endif /* _LP64 */
-
-#ifdef __sun
-# define DUAL_MODE
-# ifdef __sparc
-# define BIG_ARCH "sparcv9"
-# define SMALL_ARCH "sparc"
-# else
-# define BIG_ARCH "amd64"
-# define SMALL_ARCH "i386"
-# endif
-# include
-# include
-# include
-#else
-# ifndef ARCH
-# include
-# endif
-#endif
-
-#endif /* ifndef GAMMA */
-
-/* pointer to environment */
-extern char **environ;
-
-#ifndef GAMMA
-
-/*
- * A collection of useful strings. One should think of these as #define
- * entries, but actual strings can be more efficient (with many compilers).
- */
-#ifdef __linux__
-static const char *system_dir = "/usr/java";
-static const char *user_dir = "/java";
-#else /* Solaris */
-static const char *system_dir = "/usr/jdk";
-static const char *user_dir = "/jdk";
-#endif
-
-#endif /* ifndef GAMMA */
-
-/*
- * Flowchart of launcher execs and options processing on unix
- *
- * The selection of the proper vm shared library to open depends on
- * several classes of command line options, including vm "flavor"
- * options (-client, -server) and the data model options, -d32 and
- * -d64, as well as a version specification which may have come from
- * the command line or from the manifest of an executable jar file.
- * The vm selection options are not passed to the running
- * virtual machine; they must be screened out by the launcher.
- *
- * The version specification (if any) is processed first by the
- * platform independent routine SelectVersion. This may result in
- * the exec of the specified launcher version.
- *
- * Typically, the launcher execs at least once to ensure a suitable
- * LD_LIBRARY_PATH is in effect for the process. The first exec
- * screens out all the data model options; leaving the choice of data
- * model implicit in the binary selected to run. However, in case no
- * exec is done, the data model options are screened out before the vm
- * is invoked.
- *
- * incoming argv ------------------------------
- * | |
- * \|/ |
- * CheckJVMType |
- * (removes -client, -server, etc.) |
- * \|/
- * CreateExecutionEnvironment
- * (removes -d32 and -d64,
- * determines desired data model,
- * sets up LD_LIBRARY_PATH,
- * and exec's)
- * |
- * --------------------------------------------
- * |
- * \|/
- * exec child 1 incoming argv -----------------
- * | |
- * \|/ |
- * CheckJVMType |
- * (removes -client, -server, etc.) |
- * | \|/
- * | CreateExecutionEnvironment
- * | (verifies desired data model
- * | is running and acceptable
- * | LD_LIBRARY_PATH;
- * | no-op in child)
- * |
- * \|/
- * TranslateDashJArgs...
- * (Prepare to pass args to vm)
- * |
- * |
- * |
- * \|/
- * ParseArguments
- * (ignores -d32 and -d64,
- * processes version options,
- * creates argument list for vm,
- * etc.)
- *
- */
-
-static char *SetExecname(char **argv);
-static char * GetExecname();
-static jboolean GetJVMPath(const char *jrepath, const char *jvmtype,
- char *jvmpath, jint jvmpathsize, char * arch);
-static jboolean GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative);
-
-const char *
-GetArch()
-{
- static char *arch = NULL;
- static char buf[12];
- if (arch) {
- return arch;
- }
-
-#ifdef ARCH
- strcpy(buf, ARCH);
-#else
- sysinfo(SI_ARCHITECTURE, buf, sizeof(buf));
-#endif
- arch = buf;
- return arch;
-}
-
-void
-CreateExecutionEnvironment(int *_argcp,
- char ***_argvp,
- char jrepath[],
- jint so_jrepath,
- char jvmpath[],
- jint so_jvmpath,
- char **original_argv) {
- /*
- * First, determine if we are running the desired data model. If we
- * are running the desired data model, all the error messages
- * associated with calling GetJREPath, ReadKnownVMs, etc. should be
- * output. However, if we are not running the desired data model,
- * some of the errors should be suppressed since it is more
- * informative to issue an error message based on whether or not the
- * os/processor combination has dual mode capabilities.
- */
-
- char *execname = NULL;
- int original_argc = *_argcp;
- jboolean jvmpathExists;
-
- /* Compute the name of the executable */
- execname = SetExecname(*_argvp);
-
-#ifndef GAMMA
- /* Set the LD_LIBRARY_PATH environment variable, check data model
- flags, and exec process, if needed */
- {
- char *arch = (char *)GetArch(); /* like sparc or sparcv9 */
- char * jvmtype = NULL;
- int argc = *_argcp;
- char **argv = original_argv;
-
- char *runpath = NULL; /* existing effective LD_LIBRARY_PATH
- setting */
-
- int running = /* What data model is being ILP32 =>
- 32 bit vm; LP64 => 64 bit vm */
-#ifdef _LP64
- 64;
-#else
- 32;
-#endif
-
- int wanted = running; /* What data mode is being
- asked for? Current model is
- fine unless another model
- is asked for */
-
- char* new_runpath = NULL; /* desired new LD_LIBRARY_PATH string */
- char* newpath = NULL; /* path on new LD_LIBRARY_PATH */
- char* lastslash = NULL;
-
- char** newenvp = NULL; /* current environment */
-
- char** newargv = NULL;
- int newargc = 0;
-#ifdef __sun
- char* dmpath = NULL; /* data model specific LD_LIBRARY_PATH,
- Solaris only */
-#endif
-
- /*
- * Starting in 1.5, all unix platforms accept the -d32 and -d64
- * options. On platforms where only one data-model is supported
- * (e.g. ia-64 Linux), using the flag for the other data model is
- * an error and will terminate the program.
- */
-
- { /* open new scope to declare local variables */
- int i;
-
- newargv = (char **)MemAlloc((argc+1) * sizeof(*newargv));
- newargv[newargc++] = argv[0];
-
- /* scan for data model arguments and remove from argument list;
- last occurrence determines desired data model */
- for (i=1; i < argc; i++) {
-
- if (strcmp(argv[i], "-J-d64") == 0 || strcmp(argv[i], "-d64") == 0) {
- wanted = 64;
- continue;
- }
- if (strcmp(argv[i], "-J-d32") == 0 || strcmp(argv[i], "-d32") == 0) {
- wanted = 32;
- continue;
- }
- newargv[newargc++] = argv[i];
-
-#ifdef JAVA_ARGS
- if (argv[i][0] != '-')
- continue;
-#else
- if (strcmp(argv[i], "-classpath") == 0 || strcmp(argv[i], "-cp") == 0) {
- i++;
- if (i >= argc) break;
- newargv[newargc++] = argv[i];
- continue;
- }
- if (argv[i][0] != '-') { i++; break; }
-#endif
- }
-
- /* copy rest of args [i .. argc) */
- while (i < argc) {
- newargv[newargc++] = argv[i++];
- }
- newargv[newargc] = NULL;
-
- /*
- * newargv has all proper arguments here
- */
-
- argc = newargc;
- argv = newargv;
- }
-
- /* If the data model is not changing, it is an error if the
- jvmpath does not exist */
- if (wanted == running) {
- /* Find out where the JRE is that we will be using. */
- if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) {
- fprintf(stderr, "Error: could not find Java 2 Runtime Environment.\n");
- exit(2);
- }
-
- /* Find the specified JVM type */
- if (ReadKnownVMs(jrepath, arch, JNI_FALSE) < 1) {
- fprintf(stderr, "Error: no known VMs. (check for corrupt jvm.cfg file)\n");
- exit(1);
- }
-
- jvmpath[0] = '\0';
- jvmtype = CheckJvmType(_argcp, _argvp, JNI_FALSE);
-
- if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, arch )) {
- fprintf(stderr, "Error: no `%s' JVM at `%s'.\n", jvmtype, jvmpath);
- exit(4);
- }
- } else { /* do the same speculatively or exit */
-#ifdef DUAL_MODE
- if (running != wanted) {
- /* Find out where the JRE is that we will be using. */
- if (!GetJREPath(jrepath, so_jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), JNI_TRUE)) {
- goto EndDataModelSpeculate;
- }
-
- /*
- * Read in jvm.cfg for target data model and process vm
- * selection options.
- */
- if (ReadKnownVMs(jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH), JNI_TRUE) < 1) {
- goto EndDataModelSpeculate;
- }
- jvmpath[0] = '\0';
- jvmtype = CheckJvmType(_argcp, _argvp, JNI_TRUE);
- /* exec child can do error checking on the existence of the path */
- jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath,
- ((wanted==64)?BIG_ARCH:SMALL_ARCH));
-
- }
- EndDataModelSpeculate: /* give up and let other code report error message */
- ;
-#else
- fprintf(stderr, "Running a %d-bit JVM is not supported on this platform.\n", wanted);
- exit(1);
-#endif
- }
-
- /*
- * We will set the LD_LIBRARY_PATH as follows:
- *
- * o $JVMPATH (directory portion only)
- * o $JRE/lib/$ARCH
- * o $JRE/../lib/$ARCH
- *
- * followed by the user's previous effective LD_LIBRARY_PATH, if
- * any.
- */
-
-#ifdef __sun
- /*
- * Starting in Solaris 7, ld.so.1 supports three LD_LIBRARY_PATH
- * variables:
- *
- * 1. LD_LIBRARY_PATH -- used for 32 and 64 bit searches if
- * data-model specific variables are not set.
- *
- * 2. LD_LIBRARY_PATH_64 -- overrides and replaces LD_LIBRARY_PATH
- * for 64-bit binaries.
- *
- * 3. LD_LIBRARY_PATH_32 -- overrides and replaces LD_LIBRARY_PATH
- * for 32-bit binaries.
- *
- * The vm uses LD_LIBRARY_PATH to set the java.library.path system
- * property. To shield the vm from the complication of multiple
- * LD_LIBRARY_PATH variables, if the appropriate data model
- * specific variable is set, we will act as if LD_LIBRARY_PATH had
- * the value of the data model specific variant and the data model
- * specific variant will be unset. Note that the variable for the
- * *wanted* data model must be used (if it is set), not simply the
- * current running data model.
- */
-
- switch(wanted) {
- case 0:
- if(running == 32) {
- dmpath = getenv("LD_LIBRARY_PATH_32");
- wanted = 32;
- }
- else {
- dmpath = getenv("LD_LIBRARY_PATH_64");
- wanted = 64;
- }
- break;
-
- case 32:
- dmpath = getenv("LD_LIBRARY_PATH_32");
- break;
-
- case 64:
- dmpath = getenv("LD_LIBRARY_PATH_64");
- break;
-
- default:
- fprintf(stderr, "Improper value at line %d.", __LINE__);
- exit(1); /* unknown value in wanted */
- break;
- }
-
- /*
- * If dmpath is NULL, the relevant data model specific variable is
- * not set and normal LD_LIBRARY_PATH should be used.
- */
- if( dmpath == NULL) {
- runpath = getenv("LD_LIBRARY_PATH");
- }
- else {
- runpath = dmpath;
- }
-#else
- /*
- * If not on Solaris, assume only a single LD_LIBRARY_PATH
- * variable.
- */
- runpath = getenv("LD_LIBRARY_PATH");
-#endif /* __sun */
-
-#ifdef __linux
- /*
- * On linux, if a binary is running as sgid or suid, glibc sets
- * LD_LIBRARY_PATH to the empty string for security purposes. (In
- * contrast, on Solaris the LD_LIBRARY_PATH variable for a
- * privileged binary does not lose its settings; but the dynamic
- * linker does apply more scrutiny to the path.) The launcher uses
- * the value of LD_LIBRARY_PATH to prevent an exec loop.
- * Therefore, if we are running sgid or suid, this function's
- * setting of LD_LIBRARY_PATH will be ineffective and we should
- * return from the function now. Getting the right libraries to
- * be found must be handled through other mechanisms.
- */
- if((getgid() != getegid()) || (getuid() != geteuid()) ) {
- return;
- }
-#endif
-
- /* runpath contains current effective LD_LIBRARY_PATH setting */
-
- jvmpath = strdup(jvmpath);
- new_runpath = MemAlloc( ((runpath!=NULL)?strlen(runpath):0) +
- 2*strlen(jrepath) + 2*strlen(arch) +
- strlen(jvmpath) + 52);
- newpath = new_runpath + strlen("LD_LIBRARY_PATH=");
-
-
- /*
- * Create desired LD_LIBRARY_PATH value for target data model.
- */
- {
- /* remove the name of the .so from the JVM path */
- lastslash = strrchr(jvmpath, '/');
- if (lastslash)
- *lastslash = '\0';
-
-
- /* jvmpath, ((running != wanted)?((wanted==64)?"/"BIG_ARCH:"/.."):""), */
-
- sprintf(new_runpath, "LD_LIBRARY_PATH="
- "%s:"
- "%s/lib/%s:"
- "%s/../lib/%s",
- jvmpath,
-#ifdef DUAL_MODE
- jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH),
- jrepath, ((wanted==64)?BIG_ARCH:SMALL_ARCH)
-#else
- jrepath, arch,
- jrepath, arch
-#endif
- );
-
-
- /*
- * Check to make sure that the prefix of the current path is the
- * desired environment variable setting.
- */
- if (runpath != NULL &&
- strncmp(newpath, runpath, strlen(newpath))==0 &&
- (runpath[strlen(newpath)] == 0 || runpath[strlen(newpath)] == ':') &&
- (running == wanted) /* data model does not have to be changed */
-#ifdef __sun
- && (dmpath == NULL) /* data model specific variables not set */
-#endif
- ) {
-
- return;
-
- }
- }
-
- /*
- * Place the desired environment setting onto the prefix of
- * LD_LIBRARY_PATH. Note that this prevents any possible infinite
- * loop of execv() because we test for the prefix, above.
- */
- if (runpath != 0) {
- strcat(new_runpath, ":");
- strcat(new_runpath, runpath);
- }
-
- if( putenv(new_runpath) != 0) {
- exit(1); /* problem allocating memory; LD_LIBRARY_PATH not set
- properly */
- }
-
- /*
- * Unix systems document that they look at LD_LIBRARY_PATH only
- * once at startup, so we have to re-exec the current executable
- * to get the changed environment variable to have an effect.
- */
-
-#ifdef __sun
- /*
- * If dmpath is not NULL, remove the data model specific string
- * in the environment for the exec'ed child.
- */
-
- if( dmpath != NULL)
- (void)UnsetEnv((wanted==32)?"LD_LIBRARY_PATH_32":"LD_LIBRARY_PATH_64");
-#endif
-
- newenvp = environ;
-
- {
- char *newexec = execname;
-#ifdef DUAL_MODE
- /*
- * If the data model is being changed, the path to the
- * executable must be updated accordingly; the executable name
- * and directory the executable resides in are separate. In the
- * case of 32 => 64, the new bits are assumed to reside in, e.g.
- * "olddir/BIGARCH/execname"; in the case of 64 => 32,
- * the bits are assumed to be in "olddir/../execname". For example,
- *
- * olddir/sparcv9/execname
- * olddir/amd64/execname
- *
- * for Solaris SPARC and Linux amd64, respectively.
- */
-
- if (running != wanted) {
- char *oldexec = strcpy(MemAlloc(strlen(execname) + 1), execname);
- char *olddir = oldexec;
- char *oldbase = strrchr(oldexec, '/');
-
-
- newexec = MemAlloc(strlen(execname) + 20);
- *oldbase++ = 0;
- sprintf(newexec, "%s/%s/%s", olddir,
- ((wanted==64) ? BIG_ARCH : ".."), oldbase);
- argv[0] = newexec;
- }
-#endif
-
- execve(newexec, argv, newenvp);
- perror("execve()");
-
- fprintf(stderr, "Error trying to exec %s.\n", newexec);
- fprintf(stderr, "Check if file exists and permissions are set correctly.\n");
-
-#ifdef DUAL_MODE
- if (running != wanted) {
- fprintf(stderr, "Failed to start a %d-bit JVM process from a %d-bit JVM.\n",
- wanted, running);
-# ifdef __sun
-
-# ifdef __sparc
- fprintf(stderr, "Verify all necessary J2SE components have been installed.\n" );
- fprintf(stderr,
- "(Solaris SPARC 64-bit components must be installed after 32-bit components.)\n" );
-# else
- fprintf(stderr, "Either 64-bit processes are not supported by this platform\n");
- fprintf(stderr, "or the 64-bit components have not been installed.\n");
-# endif
- }
-# endif
-#endif
-
- }
-
- exit(1);
- }
-
-#else /* ifndef GAMMA */
-
- /* gamma launcher is simpler in that it doesn't handle VM flavors, data */
- /* model, LD_LIBRARY_PATH, etc. Assuming everything is set-up correctly */
- /* all we need to do here is to return correct path names. See also */
- /* GetJVMPath() and GetApplicationHome(). */
-
- { char *arch = (char *)GetArch(); /* like sparc or sparcv9 */
- char *p;
-
- if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) {
- fprintf(stderr, "Error: could not find Java 2 Runtime Environment.\n");
- exit(2);
- }
-
- if (!GetJVMPath(jrepath, NULL, jvmpath, so_jvmpath, arch )) {
- fprintf(stderr, "Error: no JVM at `%s'.\n", jvmpath);
- exit(4);
- }
- }
-
-#endif /* ifndef GAMMA */
-}
-
-
-/*
- * On Solaris VM choosing is done by the launcher (java.c).
- */
-static jboolean
-GetJVMPath(const char *jrepath, const char *jvmtype,
- char *jvmpath, jint jvmpathsize, char * arch)
-{
- struct stat s;
-
-#ifndef GAMMA
- if (strchr(jvmtype, '/')) {
- sprintf(jvmpath, "%s/" JVM_DLL, jvmtype);
- } else {
- sprintf(jvmpath, "%s/lib/%s/%s/" JVM_DLL, jrepath, arch, jvmtype);
- }
-#else
- /* For gamma launcher, JVM is either built-in or in the same directory. */
- /* Either way we return "/libjvm.so" where is the */
- /* directory where gamma launcher is located. */
-
- char *p;
-
- snprintf(jvmpath, jvmpathsize, "%s", GetExecname());
- p = strrchr(jvmpath, '/');
- if (p) {
- /* replace executable name with libjvm.so */
- snprintf(p + 1, jvmpathsize - (p + 1 - jvmpath), "%s", JVM_DLL);
- } else {
- /* this case shouldn't happen */
- snprintf(jvmpath, jvmpathsize, "%s", JVM_DLL);
- }
-#endif
-
- if (_launcher_debug)
- printf("Does `%s' exist ... ", jvmpath);
-
- if (stat(jvmpath, &s) == 0) {
- if (_launcher_debug)
- printf("yes.\n");
- return JNI_TRUE;
- } else {
- if (_launcher_debug)
- printf("no.\n");
- return JNI_FALSE;
- }
-}
-
-/*
- * Find path to JRE based on .exe's location or registry settings.
- */
-static jboolean
-GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative)
-{
- char libjava[MAXPATHLEN];
-
- if (GetApplicationHome(path, pathsize)) {
- /* Is JRE co-located with the application? */
- sprintf(libjava, "%s/lib/%s/" JAVA_DLL, path, arch);
- if (access(libjava, F_OK) == 0) {
- goto found;
- }
-
- /* Does the app ship a private JRE in /jre directory? */
- sprintf(libjava, "%s/jre/lib/%s/" JAVA_DLL, path, arch);
- if (access(libjava, F_OK) == 0) {
- strcat(path, "/jre");
- goto found;
- }
- }
-
- if (!speculative)
- fprintf(stderr, "Error: could not find " JAVA_DLL "\n");
- return JNI_FALSE;
-
- found:
- if (_launcher_debug)
- printf("JRE path is %s\n", path);
- return JNI_TRUE;
-}
-
-jboolean
-LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
-{
-#ifdef GAMMA
- /* JVM is directly linked with gamma launcher; no dlopen() */
- ifn->CreateJavaVM = JNI_CreateJavaVM;
- ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs;
- return JNI_TRUE;
-#else
- Dl_info dlinfo;
- void *libjvm;
-
- if (_launcher_debug) {
- printf("JVM path is %s\n", jvmpath);
- }
-
- libjvm = dlopen(jvmpath, RTLD_NOW + RTLD_GLOBAL);
- if (libjvm == NULL) {
-#if defined(__sparc) && !defined(_LP64) /* i.e. 32-bit sparc */
- FILE * fp;
- Elf32_Ehdr elf_head;
- int count;
- int location;
-
- fp = fopen(jvmpath, "r");
- if(fp == NULL)
- goto error;
-
- /* read in elf header */
- count = fread((void*)(&elf_head), sizeof(Elf32_Ehdr), 1, fp);
- fclose(fp);
- if(count < 1)
- goto error;
-
- /*
- * Check for running a server vm (compiled with -xarch=v8plus)
- * on a stock v8 processor. In this case, the machine type in
- * the elf header would not be included the architecture list
- * provided by the isalist command, which is turn is gotten from
- * sysinfo. This case cannot occur on 64-bit hardware and thus
- * does not have to be checked for in binaries with an LP64 data
- * model.
- */
- if(elf_head.e_machine == EM_SPARC32PLUS) {
- char buf[257]; /* recommended buffer size from sysinfo man
- page */
- long length;
- char* location;
-
- length = sysinfo(SI_ISALIST, buf, 257);
- if(length > 0) {
- location = strstr(buf, "sparcv8plus ");
- if(location == NULL) {
- fprintf(stderr, "SPARC V8 processor detected; Server compiler requires V9 or better.\n");
- fprintf(stderr, "Use Client compiler on V8 processors.\n");
- fprintf(stderr, "Could not create the Java virtual machine.\n");
- return JNI_FALSE;
- }
- }
- }
-#endif
- fprintf(stderr, "dl failure on line %d", __LINE__);
- goto error;
- }
-
- ifn->CreateJavaVM = (CreateJavaVM_t)
- dlsym(libjvm, "JNI_CreateJavaVM");
- if (ifn->CreateJavaVM == NULL)
- goto error;
-
- ifn->GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t)
- dlsym(libjvm, "JNI_GetDefaultJavaVMInitArgs");
- if (ifn->GetDefaultJavaVMInitArgs == NULL)
- goto error;
-
- return JNI_TRUE;
-
-error:
- fprintf(stderr, "Error: failed %s, because %s\n", jvmpath, dlerror());
- return JNI_FALSE;
-#endif /* GAMMA */
-}
-
-/*
- * Get the path to the file that has the usage message for -X options.
- */
-void
-GetXUsagePath(char *buf, jint bufsize)
-{
- static const char Xusage_txt[] = "/Xusage.txt";
- Dl_info dlinfo;
-
- /* we use RTLD_NOW because of problems with ld.so.1 and green threads */
- dladdr(dlsym(dlopen(JVM_DLL, RTLD_NOW), "JNI_CreateJavaVM"), &dlinfo);
- strncpy(buf, (char *)dlinfo.dli_fname, bufsize - sizeof(Xusage_txt));
-
- buf[bufsize-1] = '\0';
- strcpy(strrchr(buf, '/'), Xusage_txt);
-}
-
-/*
- * If app is "/foo/bin/javac", or "/foo/bin/sparcv9/javac" then put
- * "/foo" into buf.
- */
-jboolean
-GetApplicationHome(char *buf, jint bufsize)
-{
-#ifdef __linux__
- char *execname = GetExecname();
- if (execname) {
- strncpy(buf, execname, bufsize-1);
- buf[bufsize-1] = '\0';
- } else {
- return JNI_FALSE;
- }
-#else
- Dl_info dlinfo;
-
- dladdr((void *)GetApplicationHome, &dlinfo);
- if (realpath(dlinfo.dli_fname, buf) == NULL) {
- fprintf(stderr, "Error: realpath(`%s') failed.\n", dlinfo.dli_fname);
- return JNI_FALSE;
- }
-#endif
-
-#ifdef GAMMA
- {
- /* gamma launcher uses JAVA_HOME environment variable to find JDK/JRE */
- char* java_home_var = getenv("JAVA_HOME");
- if (java_home_var == NULL) {
- printf("JAVA_HOME must point to a valid JDK/JRE to run gamma\n");
- return JNI_FALSE;
- }
- snprintf(buf, bufsize, "%s", java_home_var);
- }
-#else
- if (strrchr(buf, '/') == 0) {
- buf[0] = '\0';
- return JNI_FALSE;
- }
- *(strrchr(buf, '/')) = '\0'; /* executable file */
- if (strlen(buf) < 4 || strrchr(buf, '/') == 0) {
- buf[0] = '\0';
- return JNI_FALSE;
- }
- if (strcmp("/bin", buf + strlen(buf) - 4) != 0)
- *(strrchr(buf, '/')) = '\0'; /* sparcv9 or amd64 */
- if (strlen(buf) < 4 || strcmp("/bin", buf + strlen(buf) - 4) != 0) {
- buf[0] = '\0';
- return JNI_FALSE;
- }
- *(strrchr(buf, '/')) = '\0'; /* bin */
-#endif /* GAMMA */
-
- return JNI_TRUE;
-}
-
-
-/*
- * Return true if the named program exists
- */
-static int
-ProgramExists(char *name)
-{
- struct stat sb;
- if (stat(name, &sb) != 0) return 0;
- if (S_ISDIR(sb.st_mode)) return 0;
- return (sb.st_mode & S_IEXEC) != 0;
-}
-
-
-/*
- * Find a command in a directory, returning the path.
- */
-static char *
-Resolve(char *indir, char *cmd)
-{
- char name[PATH_MAX + 2], *real;
-
- if ((strlen(indir) + strlen(cmd) + 1) > PATH_MAX) return 0;
- sprintf(name, "%s%c%s", indir, FILE_SEPARATOR, cmd);
- if (!ProgramExists(name)) return 0;
- real = MemAlloc(PATH_MAX + 2);
- if (!realpath(name, real))
- strcpy(real, name);
- return real;
-}
-
-
-/*
- * Find a path for the executable
- */
-static char *
-FindExecName(char *program)
-{
- char cwdbuf[PATH_MAX+2];
- char *path;
- char *tmp_path;
- char *f;
- char *result = NULL;
-
- /* absolute path? */
- if (*program == FILE_SEPARATOR ||
- (FILE_SEPARATOR=='\\' && strrchr(program, ':')))
- return Resolve("", program+1);
-
- /* relative path? */
- if (strrchr(program, FILE_SEPARATOR) != 0) {
- char buf[PATH_MAX+2];
- return Resolve(getcwd(cwdbuf, sizeof(cwdbuf)), program);
- }
-
- /* from search path? */
- path = getenv("PATH");
- if (!path || !*path) path = ".";
- tmp_path = MemAlloc(strlen(path) + 2);
- strcpy(tmp_path, path);
-
- for (f=tmp_path; *f && result==0; ) {
- char *s = f;
- while (*f && (*f != PATH_SEPARATOR)) ++f;
- if (*f) *f++ = 0;
- if (*s == FILE_SEPARATOR)
- result = Resolve(s, program);
- else {
- /* relative path element */
- char dir[2*PATH_MAX];
- sprintf(dir, "%s%c%s", getcwd(cwdbuf, sizeof(cwdbuf)),
- FILE_SEPARATOR, s);
- result = Resolve(dir, program);
- }
- if (result != 0) break;
- }
-
- free(tmp_path);
- return result;
-}
-
-
-/* Store the name of the executable once computed */
-static char *execname = NULL;
-
-/*
- * Compute the name of the executable
- *
- * In order to re-exec securely we need the absolute path of the
- * executable. On Solaris getexecname(3c) may not return an absolute
- * path so we use dladdr to get the filename of the executable and
- * then use realpath to derive an absolute path. From Solaris 9
- * onwards the filename returned in DL_info structure from dladdr is
- * an absolute pathname so technically realpath isn't required.
- * On Linux we read the executable name from /proc/self/exe.
- * As a fallback, and for platforms other than Solaris and Linux,
- * we use FindExecName to compute the executable name.
- */
-static char *
-SetExecname(char **argv)
-{
- char* exec_path = NULL;
-
- if (execname != NULL) /* Already determined */
- return (execname);
-
-#if defined(__sun)
- {
- Dl_info dlinfo;
- if (dladdr((void*)&SetExecname, &dlinfo)) {
- char *resolved = (char*)MemAlloc(PATH_MAX+1);
- if (resolved != NULL) {
- exec_path = realpath(dlinfo.dli_fname, resolved);
- if (exec_path == NULL) {
- free(resolved);
- }
- }
- }
- }
-#elif defined(__linux__)
- {
- const char* self = "/proc/self/exe";
- char buf[PATH_MAX+1];
- int len = readlink(self, buf, PATH_MAX);
- if (len >= 0) {
- buf[len] = '\0'; /* readlink doesn't nul terminate */
- exec_path = strdup(buf);
- }
- }
-#else /* !__sun && !__linux */
- {
- /* Not implemented */
- }
-#endif
-
- if (exec_path == NULL) {
- exec_path = FindExecName(argv[0]);
- }
- execname = exec_path;
- return exec_path;
-}
-
-/*
- * Return the name of the executable. Used in java_md.c to find the JRE area.
- */
-static char *
-GetExecname() {
- return execname;
-}
-
-void ReportErrorMessage(char * message, jboolean always) {
- if (always) {
- fprintf(stderr, "%s\n", message);
- }
-}
-
-void ReportErrorMessage2(char * format, char * string, jboolean always) {
- if (always) {
- fprintf(stderr, format, string);
- fprintf(stderr, "\n");
- }
-}
-
-void ReportExceptionDescription(JNIEnv * env) {
- (*env)->ExceptionDescribe(env);
-}
-
-/*
- * Return JNI_TRUE for an option string that has no effect but should
- * _not_ be passed on to the vm; return JNI_FALSE otherwise. On
- * Solaris SPARC, this screening needs to be done if:
- * 1) LD_LIBRARY_PATH does _not_ need to be reset and
- * 2) -d32 or -d64 is passed to a binary with a matching data model
- * (the exec in SetLibraryPath removes -d options and points the
- * exec to the proper binary). When this exec is not done, these options
- * would end up getting passed onto the vm.
- */
-jboolean RemovableMachineDependentOption(char * option) {
- /*
- * Unconditionally remove both -d32 and -d64 options since only
- * the last such options has an effect; e.g.
- * java -d32 -d64 -d32 -version
- * is equivalent to
- * java -d32 -version
- */
-
- if( (strcmp(option, "-d32") == 0 ) ||
- (strcmp(option, "-d64") == 0 ))
- return JNI_TRUE;
- else
- return JNI_FALSE;
-}
-
-void PrintMachineDependentOptions() {
- fprintf(stdout,
- " -d32 use a 32-bit data model if available\n"
- "\n"
- " -d64 use a 64-bit data model if available\n");
- return;
-}
-
-#ifndef GAMMA /* gamma launcher does not have ergonomics */
-
-/*
- * The following methods (down to ServerClassMachine()) answer
- * the question about whether a machine is a "server-class"
- * machine. A server-class machine is loosely defined as one
- * with 2 or more processors and 2 gigabytes or more physical
- * memory. The definition of a processor is a physical package,
- * not a hyperthreaded chip masquerading as a multi-processor.
- * The definition of memory is also somewhat fuzzy, since x86
- * machines seem not to report all the memory in their DIMMs, we
- * think because of memory mapping of graphics cards, etc.
- *
- * This code is somewhat more confused with #ifdef's than we'd
- * like because this file is used by both Solaris and Linux
- * platforms, and so needs to be parameterized for SPARC and
- * i586 hardware. The other Linux platforms (amd64 and ia64)
- * don't even ask this question, because they only come with
- * server JVMs. */
-
-# define KB (1024UL)
-# define MB (1024UL * KB)
-# define GB (1024UL * MB)
-
-/* Compute physical memory by asking the OS */
-uint64_t
-physical_memory(void) {
- const uint64_t pages = (uint64_t) sysconf(_SC_PHYS_PAGES);
- const uint64_t page_size = (uint64_t) sysconf(_SC_PAGESIZE);
- const uint64_t result = pages * page_size;
-# define UINT64_FORMAT "%" PRIu64
-
- if (_launcher_debug) {
- printf("pages: " UINT64_FORMAT
- " page_size: " UINT64_FORMAT
- " physical memory: " UINT64_FORMAT " (%.3fGB)\n",
- pages, page_size, result, result / (double) GB);
- }
- return result;
-}
-
-#if defined(__sun) && defined(__sparc)
-
-/* Methods for solaris-sparc: these are easy. */
-
-/* Ask the OS how many processors there are. */
-unsigned long
-physical_processors(void) {
- const unsigned long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
-
- if (_launcher_debug) {
- printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
- }
- return sys_processors;
-}
-
-/* The solaris-sparc version of the "server-class" predicate. */
-jboolean
-solaris_sparc_ServerClassMachine(void) {
- jboolean result = JNI_FALSE;
- /* How big is a server class machine? */
- const unsigned long server_processors = 2UL;
- const uint64_t server_memory = 2UL * GB;
- const uint64_t actual_memory = physical_memory();
-
- /* Is this a server class machine? */
- if (actual_memory >= server_memory) {
- const unsigned long actual_processors = physical_processors();
- if (actual_processors >= server_processors) {
- result = JNI_TRUE;
- }
- }
- if (_launcher_debug) {
- printf("solaris_" ARCH "_ServerClassMachine: %s\n",
- (result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE"));
- }
- return result;
-}
-
-#endif /* __sun && __sparc */
-
-#if defined(__sun) && defined(i586)
-
-/*
- * A utility method for asking the CPU about itself.
- * There's a corresponding version of linux-i586
- * because the compilers are different.
- */
-void
-get_cpuid(uint32_t arg,
- uint32_t* eaxp,
- uint32_t* ebxp,
- uint32_t* ecxp,
- uint32_t* edxp) {
-#ifdef _LP64
- asm(
- /* rbx is a callee-saved register */
- " movq %rbx, %r11 \n"
- /* rdx and rcx are 3rd and 4th argument registers */
- " movq %rdx, %r10 \n"
- " movq %rcx, %r9 \n"
- " movl %edi, %eax \n"
- " cpuid \n"
- " movl %eax, (%rsi)\n"
- " movl %ebx, (%r10)\n"
- " movl %ecx, (%r9) \n"
- " movl %edx, (%r8) \n"
- /* Restore rbx */
- " movq %r11, %rbx");
-#else
- /* EBX is a callee-saved register */
- asm(" pushl %ebx");
- /* Need ESI for storing through arguments */
- asm(" pushl %esi");
- asm(" movl 8(%ebp), %eax \n"
- " cpuid \n"
- " movl 12(%ebp), %esi \n"
- " movl %eax, (%esi) \n"
- " movl 16(%ebp), %esi \n"
- " movl %ebx, (%esi) \n"
- " movl 20(%ebp), %esi \n"
- " movl %ecx, (%esi) \n"
- " movl 24(%ebp), %esi \n"
- " movl %edx, (%esi) ");
- /* Restore ESI and EBX */
- asm(" popl %esi");
- /* Restore EBX */
- asm(" popl %ebx");
-#endif
-}
-
-#endif /* __sun && i586 */
-
-#if defined(__linux__) && defined(i586)
-
-/*
- * A utility method for asking the CPU about itself.
- * There's a corresponding version of solaris-i586
- * because the compilers are different.
- */
-void
-get_cpuid(uint32_t arg,
- uint32_t* eaxp,
- uint32_t* ebxp,
- uint32_t* ecxp,
- uint32_t* edxp) {
-#ifdef _LP64
- __asm__ volatile (/* Instructions */
- " movl %4, %%eax \n"
- " cpuid \n"
- " movl %%eax, (%0)\n"
- " movl %%ebx, (%1)\n"
- " movl %%ecx, (%2)\n"
- " movl %%edx, (%3)\n"
- : /* Outputs */
- : /* Inputs */
- "r" (eaxp),
- "r" (ebxp),
- "r" (ecxp),
- "r" (edxp),
- "r" (arg)
- : /* Clobbers */
- "%rax", "%rbx", "%rcx", "%rdx", "memory"
- );
-#else
- uint32_t value_of_eax = 0;
- uint32_t value_of_ebx = 0;
- uint32_t value_of_ecx = 0;
- uint32_t value_of_edx = 0;
- __asm__ volatile (/* Instructions */
- /* ebx is callee-save, so push it */
- /* even though it's in the clobbers section */
- " pushl %%ebx \n"
- " movl %4, %%eax \n"
- " cpuid \n"
- " movl %%eax, %0 \n"
- " movl %%ebx, %1 \n"
- " movl %%ecx, %2 \n"
- " movl %%edx, %3 \n"
- /* restore ebx */
- " popl %%ebx \n"
-
- : /* Outputs */
- "=m" (value_of_eax),
- "=m" (value_of_ebx),
- "=m" (value_of_ecx),
- "=m" (value_of_edx)
- : /* Inputs */
- "m" (arg)
- : /* Clobbers */
- "%eax", "%ebx", "%ecx", "%edx"
- );
- *eaxp = value_of_eax;
- *ebxp = value_of_ebx;
- *ecxp = value_of_ecx;
- *edxp = value_of_edx;
-#endif
-}
-
-#endif /* __linux__ && i586 */
-
-#ifdef i586
-/*
- * Routines shared by solaris-i586 and linux-i586.
- */
-
-enum HyperThreadingSupport_enum {
- hts_supported = 1,
- hts_too_soon_to_tell = 0,
- hts_not_supported = -1,
- hts_not_pentium4 = -2,
- hts_not_intel = -3
-};
-typedef enum HyperThreadingSupport_enum HyperThreadingSupport;
-
-/* Determine if hyperthreading is supported */
-HyperThreadingSupport
-hyperthreading_support(void) {
- HyperThreadingSupport result = hts_too_soon_to_tell;
- /* Bits 11 through 8 is family processor id */
-# define FAMILY_ID_SHIFT 8
-# define FAMILY_ID_MASK 0xf
- /* Bits 23 through 20 is extended family processor id */
-# define EXT_FAMILY_ID_SHIFT 20
-# define EXT_FAMILY_ID_MASK 0xf
- /* Pentium 4 family processor id */
-# define PENTIUM4_FAMILY_ID 0xf
- /* Bit 28 indicates Hyper-Threading Technology support */
-# define HT_BIT_SHIFT 28
-# define HT_BIT_MASK 1
- uint32_t vendor_id[3] = { 0U, 0U, 0U };
- uint32_t value_of_eax = 0U;
- uint32_t value_of_edx = 0U;
- uint32_t dummy = 0U;
-
- /* Yes, this is supposed to be [0], [2], [1] */
- get_cpuid(0, &dummy, &vendor_id[0], &vendor_id[2], &vendor_id[1]);
- if (_launcher_debug) {
- printf("vendor: %c %c %c %c %c %c %c %c %c %c %c %c \n",
- ((vendor_id[0] >> 0) & 0xff),
- ((vendor_id[0] >> 8) & 0xff),
- ((vendor_id[0] >> 16) & 0xff),
- ((vendor_id[0] >> 24) & 0xff),
- ((vendor_id[1] >> 0) & 0xff),
- ((vendor_id[1] >> 8) & 0xff),
- ((vendor_id[1] >> 16) & 0xff),
- ((vendor_id[1] >> 24) & 0xff),
- ((vendor_id[2] >> 0) & 0xff),
- ((vendor_id[2] >> 8) & 0xff),
- ((vendor_id[2] >> 16) & 0xff),
- ((vendor_id[2] >> 24) & 0xff));
- }
- get_cpuid(1, &value_of_eax, &dummy, &dummy, &value_of_edx);
- if (_launcher_debug) {
- printf("value_of_eax: 0x%x value_of_edx: 0x%x\n",
- value_of_eax, value_of_edx);
- }
- if ((((value_of_eax >> FAMILY_ID_SHIFT) & FAMILY_ID_MASK) == PENTIUM4_FAMILY_ID) ||
- (((value_of_eax >> EXT_FAMILY_ID_SHIFT) & EXT_FAMILY_ID_MASK) != 0)) {
- if ((((vendor_id[0] >> 0) & 0xff) == 'G') &&
- (((vendor_id[0] >> 8) & 0xff) == 'e') &&
- (((vendor_id[0] >> 16) & 0xff) == 'n') &&
- (((vendor_id[0] >> 24) & 0xff) == 'u') &&
- (((vendor_id[1] >> 0) & 0xff) == 'i') &&
- (((vendor_id[1] >> 8) & 0xff) == 'n') &&
- (((vendor_id[1] >> 16) & 0xff) == 'e') &&
- (((vendor_id[1] >> 24) & 0xff) == 'I') &&
- (((vendor_id[2] >> 0) & 0xff) == 'n') &&
- (((vendor_id[2] >> 8) & 0xff) == 't') &&
- (((vendor_id[2] >> 16) & 0xff) == 'e') &&
- (((vendor_id[2] >> 24) & 0xff) == 'l')) {
- if (((value_of_edx >> HT_BIT_SHIFT) & HT_BIT_MASK) == HT_BIT_MASK) {
- if (_launcher_debug) {
- printf("Hyperthreading supported\n");
- }
- result = hts_supported;
- } else {
- if (_launcher_debug) {
- printf("Hyperthreading not supported\n");
- }
- result = hts_not_supported;
- }
- } else {
- if (_launcher_debug) {
- printf("Not GenuineIntel\n");
- }
- result = hts_not_intel;
- }
- } else {
- if (_launcher_debug) {
- printf("not Pentium 4 or extended\n");
- }
- result = hts_not_pentium4;
- }
- return result;
-}
-
-/* Determine how many logical processors there are per CPU */
-unsigned int
-logical_processors_per_package(void) {
- /*
- * After CPUID with EAX==1, register EBX bits 23 through 16
- * indicate the number of logical processors per package
- */
-# define NUM_LOGICAL_SHIFT 16
-# define NUM_LOGICAL_MASK 0xff
- unsigned int result = 1U;
- const HyperThreadingSupport hyperthreading = hyperthreading_support();
-
- if (hyperthreading == hts_supported) {
- uint32_t value_of_ebx = 0U;
- uint32_t dummy = 0U;
-
- get_cpuid(1, &dummy, &value_of_ebx, &dummy, &dummy);
- result = (value_of_ebx >> NUM_LOGICAL_SHIFT) & NUM_LOGICAL_MASK;
- if (_launcher_debug) {
- printf("logical processors per package: %u\n", result);
- }
- }
- return result;
-}
-
-/* Compute the number of physical processors, not logical processors */
-unsigned long
-physical_processors(void) {
- const long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
- unsigned long result = sys_processors;
-
- if (_launcher_debug) {
- printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
- }
- if (sys_processors > 1) {
- unsigned int logical_processors = logical_processors_per_package();
- if (logical_processors > 1) {
- result = (unsigned long) sys_processors / logical_processors;
- }
- }
- if (_launcher_debug) {
- printf("physical processors: %lu\n", result);
- }
- return result;
-}
-
-#endif /* i586 */
-
-#if defined(__sun) && defined(i586)
-
-/* The definition of a server-class machine for solaris-i586/amd64 */
-jboolean
-solaris_i586_ServerClassMachine(void) {
- jboolean result = JNI_FALSE;
- /* How big is a server class machine? */
- const unsigned long server_processors = 2UL;
- const uint64_t server_memory = 2UL * GB;
- /*
- * We seem not to get our full complement of memory.
- * We allow some part (1/8?) of the memory to be "missing",
- * based on the sizes of DIMMs, and maybe graphics cards.
- */
- const uint64_t missing_memory = 256UL * MB;
- const uint64_t actual_memory = physical_memory();
-
- /* Is this a server class machine? */
- if (actual_memory >= (server_memory - missing_memory)) {
- const unsigned long actual_processors = physical_processors();
- if (actual_processors >= server_processors) {
- result = JNI_TRUE;
- }
- }
- if (_launcher_debug) {
- printf("solaris_" ARCH "_ServerClassMachine: %s\n",
- (result == JNI_TRUE ? "true" : "false"));
- }
- return result;
-}
-
-#endif /* __sun && i586 */
-
-#if defined(__linux__) && defined(i586)
-
-/* The definition of a server-class machine for linux-i586 */
-jboolean
-linux_i586_ServerClassMachine(void) {
- jboolean result = JNI_FALSE;
- /* How big is a server class machine? */
- const unsigned long server_processors = 2UL;
- const uint64_t server_memory = 2UL * GB;
- /*
- * We seem not to get our full complement of memory.
- * We allow some part (1/8?) of the memory to be "missing",
- * based on the sizes of DIMMs, and maybe graphics cards.
- */
- const uint64_t missing_memory = 256UL * MB;
- const uint64_t actual_memory = physical_memory();
-
- /* Is this a server class machine? */
- if (actual_memory >= (server_memory - missing_memory)) {
- const unsigned long actual_processors = physical_processors();
- if (actual_processors >= server_processors) {
- result = JNI_TRUE;
- }
- }
- if (_launcher_debug) {
- printf("linux_" ARCH "_ServerClassMachine: %s\n",
- (result == JNI_TRUE ? "true" : "false"));
- }
- return result;
-}
-
-#endif /* __linux__ && i586 */
-
-/* Dispatch to the platform-specific definition of "server-class" */
-jboolean
-ServerClassMachine(void) {
- jboolean result = JNI_FALSE;
-#if defined(__sun) && defined(__sparc)
- result = solaris_sparc_ServerClassMachine();
-#elif defined(__sun) && defined(i586)
- result = solaris_i586_ServerClassMachine();
-#elif defined(__linux__) && defined(i586)
- result = linux_i586_ServerClassMachine();
-#else
- if (_launcher_debug) {
- printf("ServerClassMachine: returns default value of %s\n",
- (result == JNI_TRUE ? "true" : "false"));
- }
-#endif
- return result;
-}
-
-#endif /* ifndef GAMMA */
-
-#ifndef GAMMA /* gamma launcher does not choose JDK/JRE/JVM */
-
-/*
- * Since using the file system as a registry is a bit risky, perform
- * additional sanity checks on the identified directory to validate
- * it as a valid jre/sdk.
- *
- * Return 0 if the tests fail; otherwise return non-zero (true).
- *
- * Note that checking for anything more than the existence of an
- * executable object at bin/java relative to the path being checked
- * will break the regression tests.
- */
-static int
-CheckSanity(char *path, char *dir)
-{
- char buffer[PATH_MAX];
-
- if (strlen(path) + strlen(dir) + 11 > PATH_MAX)
- return (0); /* Silently reject "impossibly" long paths */
-
- (void)strcat(strcat(strcat(strcpy(buffer, path), "/"), dir), "/bin/java");
- return ((access(buffer, X_OK) == 0) ? 1 : 0);
-}
-
-/*
- * Determine if there is an acceptable JRE in the directory dirname.
- * Upon locating the "best" one, return a fully qualified path to
- * it. "Best" is defined as the most advanced JRE meeting the
- * constraints contained in the manifest_info. If no JRE in this
- * directory meets the constraints, return NULL.
- *
- * Note that we don't check for errors in reading the directory
- * (which would be done by checking errno). This is because it
- * doesn't matter if we get an error reading the directory, or
- * we just don't find anything interesting in the directory. We
- * just return NULL in either case.
- *
- * The historical names of j2sdk and j2re were changed to jdk and
- * jre respecively as part of the 1.5 rebranding effort. Since the
- * former names are legacy on Linux, they must be recognized for
- * all time. Fortunately, this is a minor cost.
- */
-static char
-*ProcessDir(manifest_info *info, char *dirname)
-{
- DIR *dirp;
- struct dirent *dp;
- char *best = NULL;
- int offset;
- int best_offset = 0;
- char *ret_str = NULL;
- char buffer[PATH_MAX];
-
- if ((dirp = opendir(dirname)) == NULL)
- return (NULL);
-
- do {
- if ((dp = readdir(dirp)) != NULL) {
- offset = 0;
- if ((strncmp(dp->d_name, "jre", 3) == 0) ||
- (strncmp(dp->d_name, "jdk", 3) == 0))
- offset = 3;
- else if (strncmp(dp->d_name, "j2re", 4) == 0)
- offset = 4;
- else if (strncmp(dp->d_name, "j2sdk", 5) == 0)
- offset = 5;
- if (offset > 0) {
- if ((acceptable_release(dp->d_name + offset,
- info->jre_version)) && CheckSanity(dirname, dp->d_name))
- if ((best == NULL) || (exact_version_id(
- dp->d_name + offset, best + best_offset) > 0)) {
- if (best != NULL)
- free(best);
- best = strdup(dp->d_name);
- best_offset = offset;
- }
- }
- }
- } while (dp != NULL);
- (void) closedir(dirp);
- if (best == NULL)
- return (NULL);
- else {
- ret_str = MemAlloc(strlen(dirname) + strlen(best) + 2);
- ret_str = strcat(strcat(strcpy(ret_str, dirname), "/"), best);
- free(best);
- return (ret_str);
- }
-}
-
-/*
- * This is the global entry point. It examines the host for the optimal
- * JRE to be used by scanning a set of directories. The set of directories
- * is platform dependent and can be overridden by the environment
- * variable JAVA_VERSION_PATH.
- *
- * This routine itself simply determines the set of appropriate
- * directories before passing control onto ProcessDir().
- */
-char*
-LocateJRE(manifest_info* info)
-{
- char *path;
- char *home;
- char *target = NULL;
- char *dp;
- char *cp;
-
- /*
- * Start by getting JAVA_VERSION_PATH
- */
- if (info->jre_restrict_search)
- path = strdup(system_dir);
- else if ((path = getenv("JAVA_VERSION_PATH")) != NULL)
- path = strdup(path);
- else
- if ((home = getenv("HOME")) != NULL) {
- path = (char *)MemAlloc(strlen(home) + 13);
- path = strcat(strcat(strcat(strcpy(path, home),
- user_dir), ":"), system_dir);
- } else
- path = strdup(system_dir);
-
- /*
- * Step through each directory on the path. Terminate the scan with
- * the first directory with an acceptable JRE.
- */
- cp = dp = path;
- while (dp != NULL) {
- cp = strchr(dp, (int)':');
- if (cp != NULL)
- *cp = (char)NULL;
- if ((target = ProcessDir(info, dp)) != NULL)
- break;
- dp = cp;
- if (dp != NULL)
- dp++;
- }
- free(path);
- return (target);
-}
-
-/*
- * Given a path to a jre to execute, this routine checks if this process
- * is indeed that jre. If not, it exec's that jre.
- *
- * We want to actually check the paths rather than just the version string
- * built into the executable, so that given version specification (and
- * JAVA_VERSION_PATH) will yield the exact same Java environment, regardless
- * of the version of the arbitrary launcher we start with.
- */
-void
-ExecJRE(char *jre, char **argv)
-{
- char wanted[PATH_MAX];
- char *execname;
- char *progname;
-
- /*
- * Resolve the real path to the directory containing the selected JRE.
- */
- if (realpath(jre, wanted) == NULL) {
- fprintf(stderr, "Unable to resolve %s\n", jre);
- exit(1);
- }
-
- /*
- * Resolve the real path to the currently running launcher.
- */
- execname = SetExecname(argv);
- if (execname == NULL) {
- fprintf(stderr, "Unable to resolve current executable\n");
- exit(1);
- }
-
- /*
- * If the path to the selected JRE directory is a match to the initial
- * portion of the path to the currently executing JRE, we have a winner!
- * If so, just return.
- */
- if (strncmp(wanted, execname, strlen(wanted)) == 0)
- return; /* I am the droid you were looking for */
-
- /*
- * If this isn't the selected version, exec the selected version.
- */
-#ifdef JAVA_ARGS /* javac, jar and friends. */
- progname = "java";
-#else /* java, oldjava, javaw and friends */
-#ifdef PROGNAME
- progname = PROGNAME;
-#else
- progname = *argv;
- if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) {
- progname = s + 1;
- }
-#endif /* PROGNAME */
-#endif /* JAVA_ARGS */
-
- /*
- * This should never happen (because of the selection code in SelectJRE),
- * but check for "impossibly" long path names just because buffer overruns
- * can be so deadly.
- */
- if (strlen(wanted) + strlen(progname) + 6 > PATH_MAX) {
- fprintf(stderr, "Path length exceeds maximum length (PATH_MAX)\n");
- exit(1);
- }
-
- /*
- * Construct the path and exec it.
- */
- (void)strcat(strcat(wanted, "/bin/"), progname);
- argv[0] = progname;
- if (_launcher_debug) {
- int i;
- printf("execv(\"%s\"", wanted);
- for (i = 0; argv[i] != NULL; i++)
- printf(", \"%s\"", argv[i]);
- printf(")\n");
- }
- execv(wanted, argv);
- fprintf(stderr, "Exec of %s failed\n", wanted);
- exit(1);
-}
-
-#endif /* ifndef GAMMA */
-
-/*
- * "Borrowed" from Solaris 10 where the unsetenv() function is being added
- * to libc thanks to SUSv3 (Standard Unix Specification, version 3). As
- * such, in the fullness of time this will appear in libc on all relevant
- * Solaris/Linux platforms and maybe even the Windows platform. At that
- * time, this stub can be removed.
- *
- * This implementation removes the environment locking for multithreaded
- * applications. (We don't have access to these mutexes within libc and
- * the launcher isn't multithreaded.) Note that what remains is platform
- * independent, because it only relies on attributes that a POSIX environment
- * defines.
- *
- * Returns 0 on success, -1 on failure.
- *
- * Also removed was the setting of errno. The only value of errno set
- * was EINVAL ("Invalid Argument").
- */
-
-/*
- * s1(environ) is name=value
- * s2(name) is name(not the form of name=value).
- * if names match, return value of 1, else return 0
- */
-static int
-match_noeq(const char *s1, const char *s2)
-{
- while (*s1 == *s2++) {
- if (*s1++ == '=')
- return (1);
- }
- if (*s1 == '=' && s2[-1] == '\0')
- return (1);
- return (0);
-}
-
-/*
- * added for SUSv3 standard
- *
- * Delete entry from environ.
- * Do not free() memory! Other threads may be using it.
- * Keep it around forever.
- */
-static int
-borrowed_unsetenv(const char *name)
-{
- long idx; /* index into environ */
-
- if (name == NULL || *name == '\0' ||
- strchr(name, '=') != NULL) {
- return (-1);
- }
-
- for (idx = 0; environ[idx] != NULL; idx++) {
- if (match_noeq(environ[idx], name))
- break;
- }
- if (environ[idx] == NULL) {
- /* name not found but still a success */
- return (0);
- }
- /* squeeze up one entry */
- do {
- environ[idx] = environ[idx+1];
- } while (environ[++idx] != NULL);
-
- return (0);
-}
-/* --- End of "borrowed" code --- */
-
-/*
- * Wrapper for unsetenv() function.
- */
-int
-UnsetEnv(char *name)
-{
- return(borrowed_unsetenv(name));
-}
-
-/*
- * The implementation for finding classes from the bootstrap
- * class loader, refer to java.h
- */
-static FindClassFromBootLoader_t *findBootClass = NULL;
-
-jclass
-FindBootStrapClass(JNIEnv *env, const char* classname)
-{
- if (findBootClass == NULL) {
- findBootClass = (FindClassFromBootLoader_t *)dlsym(RTLD_DEFAULT,
- "JVM_FindClassFromBootLoader");
- if (findBootClass == NULL) {
- fprintf(stderr, "Error: could not load method JVM_FindClassFromBootLoader");
- return NULL;
- }
- }
- return findBootClass(env, classname, JNI_FALSE);
-}
-
diff --git a/hotspot/src/os/solaris/vm/attachListener_solaris.cpp b/hotspot/src/os/solaris/vm/attachListener_solaris.cpp
index 9ae81cb53d5..b56a32a40af 100644
--- a/hotspot/src/os/solaris/vm/attachListener_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/attachListener_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_attachListener_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/os.hpp"
+#include "services/attachListener.hpp"
+#include "services/dtraceAttacher.hpp"
#include
#include
diff --git a/hotspot/src/os/solaris/vm/c1_globals_solaris.hpp b/hotspot/src/os/solaris/vm/c1_globals_solaris.hpp
index 301d169c178..ad2075dbc10 100644
--- a/hotspot/src/os/solaris/vm/c1_globals_solaris.hpp
+++ b/hotspot/src/os/solaris/vm/c1_globals_solaris.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,15 @@
*
*/
+#ifndef OS_SOLARIS_VM_C1_GLOBALS_SOLARIS_HPP
+#define OS_SOLARIS_VM_C1_GLOBALS_SOLARIS_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_SOLARIS_VM_C1_GLOBALS_SOLARIS_HPP
diff --git a/hotspot/src/os/solaris/vm/c2_globals_solaris.hpp b/hotspot/src/os/solaris/vm/c2_globals_solaris.hpp
index b14af55c55c..9909831d983 100644
--- a/hotspot/src/os/solaris/vm/c2_globals_solaris.hpp
+++ b/hotspot/src/os/solaris/vm/c2_globals_solaris.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,15 @@
*
*/
+#ifndef OS_SOLARIS_VM_C2_GLOBALS_SOLARIS_HPP
+#define OS_SOLARIS_VM_C2_GLOBALS_SOLARIS_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
//
// Sets the default values for operating system dependent flags used by the
// server compiler. (see c2_globals.hpp)
//
+
+#endif // OS_SOLARIS_VM_C2_GLOBALS_SOLARIS_HPP
diff --git a/hotspot/src/os/solaris/vm/chaitin_solaris.cpp b/hotspot/src/os/solaris/vm/chaitin_solaris.cpp
index 9d61ae5dae6..92a437f9683 100644
--- a/hotspot/src/os/solaris/vm/chaitin_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/chaitin_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_chaitin_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/machnode.hpp"
void PhaseRegAlloc::pd_preallocate_hook() {
// no action
diff --git a/langtools/test/tools/javac/diags/examples/VarargsPlural/VarargsFilename.java b/hotspot/src/os/solaris/vm/decoder_solaris.cpp
similarity index 78%
rename from langtools/test/tools/javac/diags/examples/VarargsPlural/VarargsFilename.java
rename to hotspot/src/os/solaris/vm/decoder_solaris.cpp
index 2e3cd0ff9a5..a7b4b51fb6a 100644
--- a/langtools/test/tools/javac/diags/examples/VarargsPlural/VarargsFilename.java
+++ b/hotspot/src/os/solaris/vm/decoder_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -19,8 +19,13 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
+ *
*/
-class VarargsFilename {
- void m(T... items) { }
+#include "utilities/decoder.hpp"
+
+#include
+
+bool Decoder::demangle(const char* symbol, char *buf, int buflen) {
+ return !cplus_demangle(symbol, buf, (size_t)buflen);
}
diff --git a/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp b/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp
index 856c8fcfcfd..fb901a1ed2e 100644
--- a/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_dtraceJSDT_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "code/codeBlob.hpp"
+#include "memory/allocation.hpp"
+#include "prims/jvm.h"
+#include "runtime/dtraceJSDT.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/os.hpp"
+#include "runtime/signature.hpp"
+#include "utilities/globalDefinitions.hpp"
#ifdef HAVE_DTRACE_H
diff --git a/hotspot/src/os/solaris/vm/globals_solaris.hpp b/hotspot/src/os/solaris/vm/globals_solaris.hpp
index 4d0c9eddda2..a567a357e16 100644
--- a/hotspot/src/os/solaris/vm/globals_solaris.hpp
+++ b/hotspot/src/os/solaris/vm/globals_solaris.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_SOLARIS_VM_GLOBALS_SOLARIS_HPP
+#define OS_SOLARIS_VM_GLOBALS_SOLARIS_HPP
+
//
// Defines Solaris specific flags. They are not available on other platforms.
//
@@ -47,3 +50,5 @@ define_pd_global(bool, UseLargePages, true);
define_pd_global(bool, UseLargePagesIndividualAllocation, false);
define_pd_global(bool, UseOSErrorReporting, false);
define_pd_global(bool, UseThreadPriorities, false);
+
+#endif // OS_SOLARIS_VM_GLOBALS_SOLARIS_HPP
diff --git a/hotspot/src/os/solaris/vm/hpi_solaris.cpp b/hotspot/src/os/solaris/vm/hpi_solaris.cpp
deleted file mode 100644
index ad50b085728..00000000000
--- a/hotspot/src/os/solaris/vm/hpi_solaris.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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 "incls/_precompiled.incl"
-# include "incls/_hpi_solaris.cpp.incl"
-
-# include
-# include
-
-typedef jint (JNICALL *init_t)(GetInterfaceFunc *, void *);
-
-void hpi::initialize_get_interface(vm_calls_t *callbacks)
-{
- char buf[JVM_MAXPATHLEN];
- void *hpi_handle;
- GetInterfaceFunc& getintf = _get_interface;
- jint (JNICALL * DLL_Initialize)(GetInterfaceFunc *, void *);
-
- if (HPILibPath && HPILibPath[0]) {
- strncpy(buf, HPILibPath, JVM_MAXPATHLEN - 1);
- buf[JVM_MAXPATHLEN - 1] = '\0';
- } else {
- const char *thread_type = "native_threads";
-
- os::jvm_path(buf, JVM_MAXPATHLEN);
-
-#ifdef PRODUCT
- const char * hpi_lib = "/libhpi.so";
-#else
- char * ptr = strrchr(buf, '/');
- assert(strstr(ptr, "/libjvm") == ptr, "invalid library name");
- const char * hpi_lib = strstr(ptr, "_g") ? "/libhpi_g.so" : "/libhpi.so";
-#endif
-
- *(strrchr(buf, '/')) = '\0'; /* get rid of /libjvm.so */
- char* p = strrchr(buf, '/');
- if (p != NULL) p[1] = '\0'; /* get rid of hotspot */
- strcat(buf, thread_type);
- strcat(buf, hpi_lib);
- }
- /* we use RTLD_NOW because of bug 4032715 */
- if (TraceHPI) tty->print_cr("Loading HPI %s ", buf);
- hpi_handle = dlopen(buf, RTLD_NOW);
- if (hpi_handle == NULL) {
- if (TraceHPI) tty->print_cr("HPI dlopen failed: %s", dlerror());
- return;
- }
- DLL_Initialize = CAST_TO_FN_PTR(jint (JNICALL *)(GetInterfaceFunc *, void *),
- dlsym(hpi_handle, "DLL_Initialize"));
- if (TraceHPI && DLL_Initialize == NULL) tty->print_cr("HPI dlsym of DLL_Initialize failed: %s", dlerror());
- if (DLL_Initialize == NULL ||
- (*DLL_Initialize)(&getintf, callbacks) < 0) {
- if (TraceHPI) tty->print_cr("HPI DLL_Initialize failed");
- return;
- }
- if (TraceHPI) tty->print_cr("HPI loaded successfully");
-}
diff --git a/hotspot/src/os/solaris/vm/hpi_solaris.hpp b/hotspot/src/os/solaris/vm/hpi_solaris.hpp
deleted file mode 100644
index bd171a79a1e..00000000000
--- a/hotspot/src/os/solaris/vm/hpi_solaris.hpp
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-//
-// Parts of the HPI interface for which the HotSparc does not use the
-// HPI (because the interruptible IO mechanims used are different).
-//
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-// HPI_FileInterface
-
-// Many system calls can be interrupted by signals and must be restarted.
-// Restart support was added without disturbing the extent of thread
-// interruption support.
-
-inline int hpi::close(int fd) {
- RESTARTABLE_RETURN_INT(::close(fd));
-}
-
-inline size_t hpi::read(int fd, void *buf, unsigned int nBytes) {
- INTERRUPTIBLE_RETURN_INT(::read(fd, buf, nBytes), os::Solaris::clear_interrupted);
-}
-
-inline size_t hpi::write(int fd, const void *buf, unsigned int nBytes) {
- INTERRUPTIBLE_RETURN_INT(::write(fd, buf, nBytes), os::Solaris::clear_interrupted);
-}
-
-
-// HPI_SocketInterface
-
-inline int hpi::socket_close(int fd) {
- RESTARTABLE_RETURN_INT(::close(fd));
-}
-
-inline int hpi::socket(int domain, int type, int protocol) {
- return ::socket(domain, type, protocol);
-}
-
-inline int hpi::recv(int fd, char *buf, int nBytes, int flags) {
- INTERRUPTIBLE_RETURN_INT(::recv(fd, buf, nBytes, flags), os::Solaris::clear_interrupted);
-}
-
-inline int hpi::send(int fd, char *buf, int nBytes, int flags) {
- INTERRUPTIBLE_RETURN_INT(::send(fd, buf, nBytes, flags), os::Solaris::clear_interrupted);
-}
-
-inline int hpi::raw_send(int fd, char *buf, int nBytes, int flags) {
- RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags));
-}
-
-// As both poll and select can be interrupted by signals, we have to be
-// prepared to restart the system call after updating the timeout, unless
-// a poll() is done with timeout == -1, in which case we repeat with this
-// "wait forever" value.
-
-inline int hpi::timeout(int fd, long timeout) {
- int res;
- struct timeval t;
- julong prevtime, newtime;
- static const char* aNull = 0;
-
- struct pollfd pfd;
- pfd.fd = fd;
- pfd.events = POLLIN;
-
- gettimeofday(&t, &aNull);
- prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000;
-
- for(;;) {
- INTERRUPTIBLE_NORESTART(::poll(&pfd, 1, timeout), res, os::Solaris::clear_interrupted);
- if(res == OS_ERR && errno == EINTR) {
- if(timeout != -1) {
- gettimeofday(&t, &aNull);
- newtime = ((julong)t.tv_sec * 1000) + t.tv_usec /1000;
- timeout -= newtime - prevtime;
- if(timeout <= 0)
- return OS_OK;
- prevtime = newtime;
- }
- } else
- return res;
- }
-}
-
-inline int hpi::listen(int fd, int count) {
- if (fd < 0)
- return OS_ERR;
-
- return ::listen(fd, count);
-}
-
-inline int
-hpi::connect(int fd, struct sockaddr *him, int len) {
- do {
- int _result;
- INTERRUPTIBLE_NORESTART(::connect(fd, him, len), _result,
- os::Solaris::clear_interrupted);
-
- // Depending on when thread interruption is reset, _result could be
- // one of two values when errno == EINTR
-
- if (((_result == OS_INTRPT) || (_result == OS_ERR)) && (errno == EINTR)) {
- /* restarting a connect() changes its errno semantics */
- INTERRUPTIBLE(::connect(fd, him, len), _result,
- os::Solaris::clear_interrupted);
- /* undo these changes */
- if (_result == OS_ERR) {
- if (errno == EALREADY) errno = EINPROGRESS; /* fall through */
- else if (errno == EISCONN) { errno = 0; return OS_OK; }
- }
- }
- return _result;
- } while(false);
-}
-
-inline int hpi::accept(int fd, struct sockaddr *him, int *len) {
- if (fd < 0)
- return OS_ERR;
- INTERRUPTIBLE_RETURN_INT((int)::accept(fd, him, (socklen_t*) len), os::Solaris::clear_interrupted);
-}
-
-inline int hpi::recvfrom(int fd, char *buf, int nBytes, int flags,
- sockaddr *from, int *fromlen) {
- //%%note jvm_r11
- INTERRUPTIBLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen), os::Solaris::clear_interrupted);
-}
-
-inline int hpi::sendto(int fd, char *buf, int len, int flags,
- struct sockaddr *to, int tolen) {
- //%%note jvm_r11
- INTERRUPTIBLE_RETURN_INT((int)::sendto(fd, buf, len, (unsigned int) flags, to, tolen),os::Solaris::clear_interrupted);
-}
-
-inline int hpi::socket_available(int fd, jint *pbytes) {
- if (fd < 0)
- return OS_OK;
-
- int ret;
-
- RESTARTABLE(::ioctl(fd, FIONREAD, pbytes), ret);
-
- //%% note ioctl can return 0 when successful, JVM_SocketAvailable
- // is expected to return 0 on failure and 1 on success to the jdk.
-
- return (ret == OS_ERR) ? 0 : 1;
-}
-
-
-/*
-HPIDECL(socket_shutdown, "socket_shutdown", _socket, SocketShutdown,
- int, "%d",
- (int fd, int howto),
- ("fd = %d, howto = %d", fd, howto),
- (fd, howto));
- */
-inline int hpi::socket_shutdown(int fd, int howto){
- return ::shutdown(fd, howto);
-}
-
-/*
-HPIDECL(bind, "bind", _socket, Bind,
- int, "%d",
- (int fd, struct sockaddr *him, int len),
- ("fd = %d, him = %p, len = %d",
- fd, him, len),
- (fd, him, len));
-*/
-inline int hpi::bind(int fd, struct sockaddr *him, int len){
- INTERRUPTIBLE_RETURN_INT_NORESTART(::bind(fd, him, len),os::Solaris::clear_interrupted);
-}
-
-/*
-HPIDECL(get_sock_name, "get_sock_name", _socket, GetSocketName,
- int, "%d",
- (int fd, struct sockaddr *him, int *len),
- ("fd = %d, him = %p, len = %p",
- fd, him, len),
- (fd, him, len));
- */
-inline int hpi::get_sock_name(int fd, struct sockaddr *him, int *len){
- return ::getsockname(fd, him, (socklen_t*) len);
-}
-
-/*
-HPIDECL(get_host_name, "get_host_name", _socket, GetHostName, int, "%d",
- (char *hostname, int namelen),
- ("hostname = %p, namelen = %d",
- hostname, namelen),
- (hostname, namelen));
- */
-inline int hpi::get_host_name(char* name, int namelen){
- return ::gethostname(name, namelen);
-}
-
-/*
-HPIDECL(get_sock_opt, "get_sock_opt", _socket, SocketGetOption, int, "%d",
- (int fd, int level, int optname, char *optval, int* optlen),
- ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %p",
- fd, level, optname, optval, optlen),
- (fd, level, optname, optval, optlen));
- */
-inline int hpi::get_sock_opt(int fd, int level, int optname,
- char *optval, int* optlen){
- return ::getsockopt(fd, level, optname, optval, (socklen_t*) optlen);
-}
-
-/*
-HPIDECL(set_sock_opt, "set_sock_opt", _socket, SocketSetOption, int, "%d",
- (int fd, int level, int optname, const char *optval, int optlen),
- ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %d",
- fd, level, optname, optval, optlen),
- (fd, level, optname, optval, optlen));
- */
-inline int hpi::set_sock_opt(int fd, int level, int optname,
- const char *optval, int optlen){
- return ::setsockopt(fd, level, optname, optval, optlen);
-}
-
-//Reconciliation History
-// 1.3 98/10/21 18:17:14 hpi_win32.hpp
-// 1.6 99/06/28 11:01:36 hpi_win32.hpp
-//End
diff --git a/hotspot/src/os/solaris/vm/interfaceSupport_solaris.hpp b/hotspot/src/os/solaris/vm/interfaceSupport_solaris.hpp
index acc096be80f..4332d428184 100644
--- a/hotspot/src/os/solaris/vm/interfaceSupport_solaris.hpp
+++ b/hotspot/src/os/solaris/vm/interfaceSupport_solaris.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,13 @@
*
*/
+#ifndef OS_SOLARIS_VM_INTERFACESUPPORT_SOLARIS_HPP
+#define OS_SOLARIS_VM_INTERFACESUPPORT_SOLARIS_HPP
+
// Contains inlined functions for class InterfaceSupport
static inline void serialize_memory(JavaThread *thread) {
os::write_memory_serialize_page(thread);
}
+
+#endif // OS_SOLARIS_VM_INTERFACESUPPORT_SOLARIS_HPP
diff --git a/hotspot/src/os/solaris/vm/jsig.c b/hotspot/src/os/solaris/vm/jsig.c
index bf1a25ca184..3c509159a2d 100644
--- a/hotspot/src/os/solaris/vm/jsig.c
+++ b/hotspot/src/os/solaris/vm/jsig.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
diff --git a/hotspot/src/os/solaris/vm/jvm_solaris.cpp b/hotspot/src/os/solaris/vm/jvm_solaris.cpp
index 00981bbbb23..2f5ccb3bb17 100644
--- a/hotspot/src/os/solaris/vm/jvm_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/jvm_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,8 +22,10 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_jvm_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "prims/jvm.h"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/osThread.hpp"
#include
diff --git a/hotspot/src/os/solaris/vm/jvm_solaris.h b/hotspot/src/os/solaris/vm/jvm_solaris.h
index 50d6a95e073..1513c16e8f9 100644
--- a/hotspot/src/os/solaris/vm/jvm_solaris.h
+++ b/hotspot/src/os/solaris/vm/jvm_solaris.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_SOLARIS_VM_JVM_SOLARIS_H
+#define OS_SOLARIS_VM_JVM_SOLARIS_H
+
/*
// HotSpot integration note:
//
@@ -98,3 +101,5 @@
#define JSIG_VERSION_1_4_1 0x30140100
#endif /* JVM_MD_H */
+
+#endif // OS_SOLARIS_VM_JVM_SOLARIS_H
diff --git a/hotspot/src/os/solaris/vm/mutex_solaris.cpp b/hotspot/src/os/solaris/vm/mutex_solaris.cpp
index 97649c37b6f..30be73721c6 100644
--- a/hotspot/src/os/solaris/vm/mutex_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/mutex_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,8 +22,12 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_mutex_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "mutex_solaris.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/mutex.hpp"
+#include "thread_solaris.inline.hpp"
+#include "utilities/events.hpp"
// Solaris-specific include, therefore not in includeDB_*
# include "os_share_solaris.hpp"
diff --git a/hotspot/src/os/solaris/vm/mutex_solaris.inline.hpp b/hotspot/src/os/solaris/vm/mutex_solaris.inline.hpp
index 44565f567be..00e91a79449 100644
--- a/hotspot/src/os/solaris/vm/mutex_solaris.inline.hpp
+++ b/hotspot/src/os/solaris/vm/mutex_solaris.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -21,3 +21,12 @@
* questions.
*
*/
+
+#ifndef OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP
+#define OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP
+
+#include "os_solaris.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "thread_solaris.inline.hpp"
+
+#endif // OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP
diff --git a/hotspot/src/os/solaris/vm/osThread_solaris.cpp b/hotspot/src/os/solaris/vm/osThread_solaris.cpp
index e0209cfc4e6..937ae5cbbcf 100644
--- a/hotspot/src/os/solaris/vm/osThread_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/osThread_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,8 +22,21 @@
*
*/
-// do not include precompiled header file
-# include "incls/_osThread_solaris.cpp.incl"
+// no precompiled headers
+#include "runtime/atomic.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/vmThread.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.inline.hpp"
+#endif
+
# include
// ***************************************************************
diff --git a/hotspot/src/os/solaris/vm/osThread_solaris.hpp b/hotspot/src/os/solaris/vm/osThread_solaris.hpp
index 2d358de1380..07742ac8e40 100644
--- a/hotspot/src/os/solaris/vm/osThread_solaris.hpp
+++ b/hotspot/src/os/solaris/vm/osThread_solaris.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP
+#define OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP
+
// This is embedded via include into the class OSThread
private:
@@ -149,3 +152,5 @@ private:
void pd_initialize();
void pd_destroy();
+
+#endif // OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP
diff --git a/hotspot/src/os/solaris/vm/os_share_solaris.hpp b/hotspot/src/os/solaris/vm/os_share_solaris.hpp
index 67416054f67..a7c1ce8c0ee 100644
--- a/hotspot/src/os/solaris/vm/os_share_solaris.hpp
+++ b/hotspot/src/os/solaris/vm/os_share_solaris.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_SOLARIS_VM_OS_SHARE_SOLARIS_HPP
+#define OS_SOLARIS_VM_OS_SHARE_SOLARIS_HPP
+
// Defines the interfaces to Solaris operating systems that vary across platforms
@@ -65,3 +68,5 @@ extern "C" void _mark_fpu_nosave() ;
#endif
#define PROCFILE_LENGTH 128
+
+#endif // OS_SOLARIS_VM_OS_SHARE_SOLARIS_HPP
diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp
index 08a16b76369..0141763216a 100644
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp
@@ -22,8 +22,60 @@
*
*/
-// do not include precompiled header file
-# include "incls/_os_solaris.cpp.incl"
+// no precompiled headers
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "compiler/compileBroker.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_solaris.h"
+#include "memory/allocation.inline.hpp"
+#include "memory/filemap.hpp"
+#include "mutex_solaris.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "os_share_solaris.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/perfMemory.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/statSampler.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/threadCritical.hpp"
+#include "runtime/timer.hpp"
+#include "services/attachListener.hpp"
+#include "services/runtimeService.hpp"
+#include "thread_solaris.inline.hpp"
+#include "utilities/decoder.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/events.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/vmError.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+# include "nativeInst_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "assembler_sparc.inline.hpp"
+# include "nativeInst_sparc.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
// put OS-includes here
# include
@@ -63,6 +115,7 @@
# include
# include
# include
+# include
# define _STRUCTURED_PROC 1 // this gets us the new structured proc interfaces of 5.6 & later
# include // see comment in
@@ -167,6 +220,9 @@ int prio_policy1[MaxPriority+1] = { -99999, 0, 16, 32, 48, 64,
// System parameters used internally
static clock_t clock_tics_per_sec = 100;
+// Track if we have called enable_extended_FILE_stdio (on Solaris 10u4+)
+static bool enabled_extended_FILE_stdio = false;
+
// For diagnostics to print a message once. see run_periodic_checks
static bool check_addr0_done = false;
static sigset_t check_signal_done;
@@ -334,7 +390,7 @@ struct tm* os::localtime_pd(const time_t* clock, struct tm* res) {
// The saved state is used to restore the thread to
// its former state whether or not an interrupt is received.
// Used by classloader os::read
-// hpi calls skip this layer and stay in _thread_in_native
+// os::restartable_read calls skip this layer and stay in _thread_in_native
void os::Solaris::setup_interruptible(JavaThread* thread) {
@@ -1698,13 +1754,13 @@ bool os::getTimesSecs(double* process_real_time,
bool os::supports_vtime() { return true; }
bool os::enable_vtime() {
- int fd = open("/proc/self/ctl", O_WRONLY);
+ int fd = ::open("/proc/self/ctl", O_WRONLY);
if (fd == -1)
return false;
long cmd[] = { PCSET, PR_MSACCT };
- int res = write(fd, cmd, sizeof(long) * 2);
- close(fd);
+ int res = ::write(fd, cmd, sizeof(long) * 2);
+ ::close(fd);
if (res != sizeof(long) * 2)
return false;
@@ -1712,13 +1768,13 @@ bool os::enable_vtime() {
}
bool os::vtime_enabled() {
- int fd = open("/proc/self/status", O_RDONLY);
+ int fd = ::open("/proc/self/status", O_RDONLY);
if (fd == -1)
return false;
pstatus_t status;
- int res = read(fd, (void*) &status, sizeof(pstatus_t));
- close(fd);
+ int res = os::read(fd, (void*) &status, sizeof(pstatus_t));
+ ::close(fd);
if (res != sizeof(pstatus_t))
return false;
@@ -1834,7 +1890,6 @@ static bool file_exists(const char* filename) {
void os::dll_build_name(char* buffer, size_t buflen,
const char* pname, const char* fname) {
- // Copied from libhpi
const size_t pnamelen = pname ? strlen(pname) : 0;
// Quietly truncate on buffer overflow. Should be an error.
@@ -1915,27 +1970,42 @@ bool os::dll_address_to_function_name(address addr, char *buf,
Sym * info;
if (dladdr1_func((void *)addr, &dlinfo, (void **)&info,
RTLD_DL_SYMENT)) {
- if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname);
- if (offset) *offset = addr - (address)dlinfo.dli_saddr;
-
- // check if the returned symbol really covers addr
- return ((char *)dlinfo.dli_saddr + info->st_size > (char *)addr);
- } else {
- if (buf) buf[0] = '\0';
- if (offset) *offset = -1;
- return false;
+ if ((char *)dlinfo.dli_saddr + info->st_size > (char *)addr) {
+ if (buf != NULL) {
+ if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen))
+ jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname);
+ }
+ if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
+ return true;
+ }
}
+ if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
+ if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
+ dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) {
+ return true;
+ }
+ }
+ if (buf != NULL) buf[0] = '\0';
+ if (offset != NULL) *offset = -1;
+ return false;
} else {
// no, only dladdr is available
- if(dladdr((void *)addr, &dlinfo)) {
- if (buf) jio_snprintf(buf, buflen, dlinfo.dli_sname);
- if (offset) *offset = addr - (address)dlinfo.dli_saddr;
+ if (dladdr((void *)addr, &dlinfo)) {
+ if (buf != NULL) {
+ if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen))
+ jio_snprintf(buf, buflen, dlinfo.dli_sname);
+ }
+ if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
+ return true;
+ } else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
+ if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
+ dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) {
return true;
- } else {
- if (buf) buf[0] = '\0';
- if (offset) *offset = -1;
- return false;
+ }
}
+ if (buf != NULL) buf[0] = '\0';
+ if (offset != NULL) *offset = -1;
+ return false;
}
}
@@ -2130,20 +2200,29 @@ void* os::dll_lookup(void* handle, const char* name) {
return dlsym(handle, name);
}
+int os::stat(const char *path, struct stat *sbuf) {
+ char pathbuf[MAX_PATH];
+ if (strlen(path) > MAX_PATH - 1) {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+ os::native_path(strcpy(pathbuf, path));
+ return ::stat(pathbuf, sbuf);
+}
-bool _print_ascii_file(const char* filename, outputStream* st) {
- int fd = open(filename, O_RDONLY);
+static bool _print_ascii_file(const char* filename, outputStream* st) {
+ int fd = ::open(filename, O_RDONLY);
if (fd == -1) {
return false;
}
char buf[32];
int bytes;
- while ((bytes = read(fd, buf, sizeof(buf))) > 0) {
+ while ((bytes = ::read(fd, buf, sizeof(buf))) > 0) {
st->print_raw(buf, bytes);
}
- close(fd);
+ ::close(fd);
return true;
}
@@ -2206,10 +2285,10 @@ void os::print_os_info(outputStream* st) {
static bool check_addr0(outputStream* st) {
jboolean status = false;
- int fd = open("/proc/self/map",O_RDONLY);
+ int fd = ::open("/proc/self/map",O_RDONLY);
if (fd >= 0) {
prmap_t p;
- while(read(fd, &p, sizeof(p)) > 0) {
+ while(::read(fd, &p, sizeof(p)) > 0) {
if (p.pr_vaddr == 0x0) {
st->print("Warning: Address: 0x%x, Size: %dK, ",p.pr_vaddr, p.pr_size/1024, p.pr_mapname);
st->print("Mapped file: %s, ", p.pr_mapname[0] == '\0' ? "None" : p.pr_mapname);
@@ -2220,7 +2299,7 @@ static bool check_addr0(outputStream* st) {
st->cr();
status = true;
}
- close(fd);
+ ::close(fd);
}
}
return status;
@@ -2468,8 +2547,6 @@ void os::jvm_path(char *buf, jint buflen) {
// Use current module name "libjvm[_g].so" instead of
// "libjvm"debug_only("_g")".so" since for fastdebug version
// we should have "libjvm.so" but debug_only("_g") adds "_g"!
- // It is used when we are choosing the HPI library's name
- // "libhpi[_g].so" in hpi::initialize_get_interface().
len = strlen(buf);
snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p);
} else {
@@ -2493,6 +2570,23 @@ void os::print_jni_name_suffix_on(outputStream* st, int args_size) {
// no suffix required
}
+// This method is a copy of JDK's sysGetLastErrorString
+// from src/solaris/hpi/src/system_md.c
+
+size_t os::lasterror(char *buf, size_t len) {
+
+ if (errno == 0) return 0;
+
+ const char *s = ::strerror(errno);
+ size_t n = ::strlen(s);
+ if (n >= len) {
+ n = len - 1;
+ }
+ ::strncpy(buf, s, n);
+ buf[n] = '\0';
+ return n;
+}
+
// sun.misc.Signal
@@ -3375,7 +3469,12 @@ static int os_sleep(jlong millis, bool interruptible) {
// INTERRUPTIBLE_NORESTART_VM_ALWAYS returns res == OS_INTRPT for
// thread.Interrupt.
- if((res == OS_ERR) && (errno == EINTR)) {
+ // See c/r 6751923. Poll can return 0 before time
+ // has elapsed if time is set via clock_settime (as NTP does).
+ // res == 0 if poll timed out (see man poll RETURN VALUES)
+ // using the logic below checks that we really did
+ // sleep at least "millis" if not we'll sleep again.
+ if( ( res == 0 ) || ((res == OS_ERR) && (errno == EINTR))) {
newtime = getTimeMillis();
assert(newtime >= prevtime, "time moving backwards");
/* Doing prevtime and newtime in microseconds doesn't help precision,
@@ -3397,6 +3496,10 @@ size_t os::read(int fd, void *buf, unsigned int nBytes) {
INTERRUPTIBLE_RETURN_INT_VM(::read(fd, buf, nBytes), os::Solaris::clear_interrupted);
}
+size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
+ INTERRUPTIBLE_RETURN_INT(::read(fd, buf, nBytes), os::Solaris::clear_interrupted);
+}
+
int os::sleep(Thread* thread, jlong millis, bool interruptible) {
assert(thread == Thread::current(), "thread consistency check");
@@ -4566,16 +4669,16 @@ bool isT2_libthread() {
#define ADR(x) ((uintptr_t)(x))
#define LWPINDEX(ary,ix) ((lwpstatus_t *)(((ary)->pr_entsize * (ix)) + (ADR((ary) + 1))))
- lwpFile = open("/proc/self/lstatus", O_RDONLY, 0);
+ lwpFile = ::open("/proc/self/lstatus", O_RDONLY, 0);
if (lwpFile < 0) {
if (ThreadPriorityVerbose) warning ("Couldn't open /proc/self/lstatus\n");
return false;
}
lwpSize = 16*1024;
for (;;) {
- lseek (lwpFile, 0, SEEK_SET);
+ ::lseek64 (lwpFile, 0, SEEK_SET);
lwpArray = (prheader_t *)NEW_C_HEAP_ARRAY(char, lwpSize);
- if (read(lwpFile, lwpArray, lwpSize) < 0) {
+ if (::read(lwpFile, lwpArray, lwpSize) < 0) {
if (ThreadPriorityVerbose) warning("Error reading /proc/self/lstatus\n");
break;
}
@@ -4596,7 +4699,7 @@ bool isT2_libthread() {
}
FREE_C_HEAP_ARRAY(char, lwpArray);
- close (lwpFile);
+ ::close (lwpFile);
if (ThreadPriorityVerbose) {
if (isT2) tty->print_cr("We are running with a T2 libthread\n");
else tty->print_cr("We are not running with a T2 libthread\n");
@@ -4792,7 +4895,7 @@ void os::init(void) {
// if we need them.
Solaris::misc_sym_init();
- int fd = open("/dev/zero", O_RDWR);
+ int fd = ::open("/dev/zero", O_RDWR);
if (fd < 0) {
fatal(err_msg("os::init: cannot open /dev/zero (%s)", strerror(errno)));
} else {
@@ -4962,13 +5065,6 @@ jint os::init_2(void) {
}
}
- // Initialize HPI.
- jint hpi_result = hpi::initialize();
- if (hpi_result != JNI_OK) {
- tty->print_cr("There was an error trying to initialize the HPI library.");
- return hpi_result;
- }
-
// Calculate theoretical max. size of Threads to guard gainst
// artifical out-of-memory situations, where all available address-
// space has been reserved by thread stacks. Default stack size is 1Mb.
@@ -5028,17 +5124,6 @@ void os::make_polling_page_readable(void) {
// OS interface.
-int os::stat(const char *path, struct stat *sbuf) {
- char pathbuf[MAX_PATH];
- if (strlen(path) > MAX_PATH - 1) {
- errno = ENAMETOOLONG;
- return -1;
- }
- hpi::native_path(strcpy(pathbuf, path));
- return ::stat(pathbuf, sbuf);
-}
-
-
bool os::check_heap(bool force) { return true; }
typedef int (*vsnprintf_t)(char* buf, size_t count, const char* fmt, va_list argptr);
@@ -5083,6 +5168,125 @@ bool os::dir_is_empty(const char* path) {
return result;
}
+// This code originates from JDK's sysOpen and open64_w
+// from src/solaris/hpi/src/system_md.c
+
+#ifndef O_DELETE
+#define O_DELETE 0x10000
+#endif
+
+// Open a file. Unlink the file immediately after open returns
+// if the specified oflag has the O_DELETE flag set.
+// O_DELETE is used only in j2se/src/share/native/java/util/zip/ZipFile.c
+
+int os::open(const char *path, int oflag, int mode) {
+ if (strlen(path) > MAX_PATH - 1) {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+ int fd;
+ int o_delete = (oflag & O_DELETE);
+ oflag = oflag & ~O_DELETE;
+
+ fd = ::open(path, oflag, mode);
+ if (fd == -1) return -1;
+
+ //If the open succeeded, the file might still be a directory
+ {
+ struct stat64 buf64;
+ int ret = ::fstat64(fd, &buf64);
+ int st_mode = buf64.st_mode;
+
+ if (ret != -1) {
+ if ((st_mode & S_IFMT) == S_IFDIR) {
+ errno = EISDIR;
+ ::close(fd);
+ return -1;
+ }
+ } else {
+ ::close(fd);
+ return -1;
+ }
+ }
+ /*
+ * 32-bit Solaris systems suffer from:
+ *
+ * - an historical default soft limit of 256 per-process file
+ * descriptors that is too low for many Java programs.
+ *
+ * - a design flaw where file descriptors created using stdio
+ * fopen must be less than 256, _even_ when the first limit above
+ * has been raised. This can cause calls to fopen (but not calls to
+ * open, for example) to fail mysteriously, perhaps in 3rd party
+ * native code (although the JDK itself uses fopen). One can hardly
+ * criticize them for using this most standard of all functions.
+ *
+ * We attempt to make everything work anyways by:
+ *
+ * - raising the soft limit on per-process file descriptors beyond
+ * 256
+ *
+ * - As of Solaris 10u4, we can request that Solaris raise the 256
+ * stdio fopen limit by calling function enable_extended_FILE_stdio.
+ * This is done in init_2 and recorded in enabled_extended_FILE_stdio
+ *
+ * - If we are stuck on an old (pre 10u4) Solaris system, we can
+ * workaround the bug by remapping non-stdio file descriptors below
+ * 256 to ones beyond 256, which is done below.
+ *
+ * See:
+ * 1085341: 32-bit stdio routines should support file descriptors >255
+ * 6533291: Work around 32-bit Solaris stdio limit of 256 open files
+ * 6431278: Netbeans crash on 32 bit Solaris: need to call
+ * enable_extended_FILE_stdio() in VM initialisation
+ * Giri Mandalika's blog
+ * http://technopark02.blogspot.com/2005_05_01_archive.html
+ */
+#ifndef _LP64
+ if ((!enabled_extended_FILE_stdio) && fd < 256) {
+ int newfd = ::fcntl(fd, F_DUPFD, 256);
+ if (newfd != -1) {
+ ::close(fd);
+ fd = newfd;
+ }
+ }
+#endif // 32-bit Solaris
+ /*
+ * All file descriptors that are opened in the JVM and not
+ * specifically destined for a subprocess should have the
+ * close-on-exec flag set. If we don't set it, then careless 3rd
+ * party native code might fork and exec without closing all
+ * appropriate file descriptors (e.g. as we do in closeDescriptors in
+ * UNIXProcess.c), and this in turn might:
+ *
+ * - cause end-of-file to fail to be detected on some file
+ * descriptors, resulting in mysterious hangs, or
+ *
+ * - might cause an fopen in the subprocess to fail on a system
+ * suffering from bug 1085341.
+ *
+ * (Yes, the default setting of the close-on-exec flag is a Unix
+ * design flaw)
+ *
+ * See:
+ * 1085341: 32-bit stdio routines should support file descriptors >255
+ * 4843136: (process) pipe file descriptor from Runtime.exec not being closed
+ * 6339493: (process) Runtime.exec does not close all file descriptors on Solaris 9
+ */
+#ifdef FD_CLOEXEC
+ {
+ int flags = ::fcntl(fd, F_GETFD);
+ if (flags != -1)
+ ::fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
+ }
+#endif
+
+ if (o_delete != 0) {
+ ::unlink(path);
+ }
+ return fd;
+}
+
// create binary file, rewriting existing file if required
int os::create_binary_file(const char* path, bool rewrite_existing) {
int oflags = O_WRONLY | O_CREAT;
@@ -5102,6 +5306,55 @@ jlong os::seek_to_file_offset(int fd, jlong offset) {
return (jlong)::lseek64(fd, (off64_t)offset, SEEK_SET);
}
+jlong os::lseek(int fd, jlong offset, int whence) {
+ return (jlong) ::lseek64(fd, offset, whence);
+}
+
+char * os::native_path(char *path) {
+ return path;
+}
+
+int os::ftruncate(int fd, jlong length) {
+ return ::ftruncate64(fd, length);
+}
+
+int os::fsync(int fd) {
+ RESTARTABLE_RETURN_INT(::fsync(fd));
+}
+
+int os::available(int fd, jlong *bytes) {
+ jlong cur, end;
+ int mode;
+ struct stat64 buf64;
+
+ if (::fstat64(fd, &buf64) >= 0) {
+ mode = buf64.st_mode;
+ if (S_ISCHR(mode) || S_ISFIFO(mode) || S_ISSOCK(mode)) {
+ /*
+ * XXX: is the following call interruptible? If so, this might
+ * need to go through the INTERRUPT_IO() wrapper as for other
+ * blocking, interruptible calls in this file.
+ */
+ int n,ioctl_return;
+
+ INTERRUPTIBLE(::ioctl(fd, FIONREAD, &n),ioctl_return,os::Solaris::clear_interrupted);
+ if (ioctl_return>= 0) {
+ *bytes = n;
+ return 1;
+ }
+ }
+ }
+ if ((cur = ::lseek64(fd, 0L, SEEK_CUR)) == -1) {
+ return 0;
+ } else if ((end = ::lseek64(fd, 0L, SEEK_END)) == -1) {
+ return 0;
+ } else if (::lseek64(fd, cur, SEEK_SET) == -1) {
+ return 0;
+ }
+ *bytes = end - cur;
+ return 1;
+}
+
// Map a block of memory.
char* os::map_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
@@ -5160,7 +5413,7 @@ void os::pause() {
int fd = ::open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (fd != -1) {
struct stat buf;
- close(fd);
+ ::close(fd);
while (::stat(filename, &buf) == 0) {
(void)::poll(NULL, 0, 100);
}
@@ -5357,16 +5610,16 @@ jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
sprintf(proc_name, "/proc/%d/lwp/%d/lwpusage",
getpid(),
thread->osthread()->lwp_id());
- fd = open(proc_name, O_RDONLY);
+ fd = ::open(proc_name, O_RDONLY);
if ( fd == -1 ) return -1;
do {
- count = pread(fd,
+ count = ::pread(fd,
(void *)&prusage.pr_utime,
thr_time_size,
thr_time_off);
} while (count < 0 && errno == EINTR);
- close(fd);
+ ::close(fd);
if ( count < 0 ) return -1;
if (user_sys_cpu_time) {
@@ -6038,4 +6291,127 @@ bool os::is_headless_jre() {
return true;
}
+size_t os::write(int fd, const void *buf, unsigned int nBytes) {
+ INTERRUPTIBLE_RETURN_INT(::write(fd, buf, nBytes), os::Solaris::clear_interrupted);
+}
+
+int os::close(int fd) {
+ RESTARTABLE_RETURN_INT(::close(fd));
+}
+
+int os::socket_close(int fd) {
+ RESTARTABLE_RETURN_INT(::close(fd));
+}
+
+int os::recv(int fd, char *buf, int nBytes, int flags) {
+ INTERRUPTIBLE_RETURN_INT(::recv(fd, buf, nBytes, flags), os::Solaris::clear_interrupted);
+}
+
+
+int os::send(int fd, char *buf, int nBytes, int flags) {
+ INTERRUPTIBLE_RETURN_INT(::send(fd, buf, nBytes, flags), os::Solaris::clear_interrupted);
+}
+
+int os::raw_send(int fd, char *buf, int nBytes, int flags) {
+ RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags));
+}
+
+// As both poll and select can be interrupted by signals, we have to be
+// prepared to restart the system call after updating the timeout, unless
+// a poll() is done with timeout == -1, in which case we repeat with this
+// "wait forever" value.
+
+int os::timeout(int fd, long timeout) {
+ int res;
+ struct timeval t;
+ julong prevtime, newtime;
+ static const char* aNull = 0;
+ struct pollfd pfd;
+ pfd.fd = fd;
+ pfd.events = POLLIN;
+
+ gettimeofday(&t, &aNull);
+ prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000;
+
+ for(;;) {
+ INTERRUPTIBLE_NORESTART(::poll(&pfd, 1, timeout), res, os::Solaris::clear_interrupted);
+ if(res == OS_ERR && errno == EINTR) {
+ if(timeout != -1) {
+ gettimeofday(&t, &aNull);
+ newtime = ((julong)t.tv_sec * 1000) + t.tv_usec /1000;
+ timeout -= newtime - prevtime;
+ if(timeout <= 0)
+ return OS_OK;
+ prevtime = newtime;
+ }
+ } else return res;
+ }
+}
+
+int os::connect(int fd, struct sockaddr *him, int len) {
+ int _result;
+ INTERRUPTIBLE_NORESTART(::connect(fd, him, len), _result,
+ os::Solaris::clear_interrupted);
+
+ // Depending on when thread interruption is reset, _result could be
+ // one of two values when errno == EINTR
+
+ if (((_result == OS_INTRPT) || (_result == OS_ERR))
+ && (errno == EINTR)) {
+ /* restarting a connect() changes its errno semantics */
+ INTERRUPTIBLE(::connect(fd, him, len), _result,
+ os::Solaris::clear_interrupted);
+ /* undo these changes */
+ if (_result == OS_ERR) {
+ if (errno == EALREADY) {
+ errno = EINPROGRESS; /* fall through */
+ } else if (errno == EISCONN) {
+ errno = 0;
+ return OS_OK;
+ }
+ }
+ }
+ return _result;
+ }
+
+int os::accept(int fd, struct sockaddr *him, int *len) {
+ if (fd < 0)
+ return OS_ERR;
+ INTERRUPTIBLE_RETURN_INT((int)::accept(fd, him,\
+ (socklen_t*) len), os::Solaris::clear_interrupted);
+ }
+
+int os::recvfrom(int fd, char *buf, int nBytes, int flags,
+ sockaddr *from, int *fromlen) {
+ //%%note jvm_r11
+ INTERRUPTIBLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes,\
+ flags, from, fromlen), os::Solaris::clear_interrupted);
+}
+
+int os::sendto(int fd, char *buf, int len, int flags,
+ struct sockaddr *to, int tolen) {
+ //%%note jvm_r11
+ INTERRUPTIBLE_RETURN_INT((int)::sendto(fd, buf, len, flags,\
+ to, tolen), os::Solaris::clear_interrupted);
+}
+
+int os::socket_available(int fd, jint *pbytes) {
+ if (fd < 0)
+ return OS_OK;
+
+ int ret;
+
+ RESTARTABLE(::ioctl(fd, FIONREAD, pbytes), ret);
+
+ //%% note ioctl can return 0 when successful, JVM_SocketAvailable
+ // is expected to return 0 on failure and 1 on success to the jdk.
+
+ return (ret == OS_ERR) ? 0 : 1;
+}
+
+
+int os::bind(int fd, struct sockaddr *him, int len) {
+ INTERRUPTIBLE_RETURN_INT_NORESTART(::bind(fd, him, len),\
+ os::Solaris::clear_interrupted);
+}
diff --git a/hotspot/src/os/solaris/vm/os_solaris.hpp b/hotspot/src/os/solaris/vm/os_solaris.hpp
index 07f7c75159f..991cf021082 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, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_SOLARIS_VM_OS_SOLARIS_HPP
+#define OS_SOLARIS_VM_OS_SOLARIS_HPP
+
// Solaris_OS defines the interface to Solaris operating systems
class Solaris {
@@ -394,3 +397,5 @@ class PlatformParker : public CHeapObj {
assert_status(status == 0, status, "mutex_init");
}
} ;
+
+#endif // OS_SOLARIS_VM_OS_SOLARIS_HPP
diff --git a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp
index 99f5e1aaa79..b1e42a52dcf 100644
--- a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp
+++ b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,30 @@
*
*/
+#ifndef OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
+#define OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
+
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "atomic_solaris_x86.inline.hpp"
+# include "orderAccess_solaris_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "atomic_solaris_sparc.inline.hpp"
+# include "orderAccess_solaris_sparc.inline.hpp"
+#endif
+
+// System includes
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
inline const char* os::file_separator() { return "/"; }
inline const char* os::line_separator() { return "\n"; }
inline const char* os::path_separator() { return ":"; }
@@ -55,21 +79,19 @@ inline void os::split_reserved_memory(char *base, size_t size,
// Bang the shadow pages if they need to be touched to be mapped.
inline void os::bang_stack_shadow_pages() {
}
+inline void os::dll_unload(void *lib) { ::dlclose(lib); }
-inline DIR* os::opendir(const char* dirname)
-{
+inline DIR* os::opendir(const char* dirname) {
assert(dirname != NULL, "just checking");
return ::opendir(dirname);
}
-inline int os::readdir_buf_size(const char *path)
-{
+inline int os::readdir_buf_size(const char *path) {
int size = pathconf(path, _PC_NAME_MAX);
return (size < 0 ? MAXPATHLEN : size) + sizeof(dirent) + 1;
}
-inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf)
-{
+inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) {
assert(dirp != NULL, "just checking");
#if defined(_LP64) || defined(_GNU_SOURCE)
dirent* p;
@@ -85,9 +107,8 @@ inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf)
#endif // defined(_LP64) || defined(_GNU_SOURCE)
}
-inline int os::closedir(DIR *dirp)
-{
- assert(dirp != NULL, "just checking");
+inline int os::closedir(DIR *dirp) {
+ assert(dirp != NULL, "argument is NULL");
return ::closedir(dirp);
}
@@ -207,3 +228,39 @@ do { \
inline bool os::numa_has_static_binding() { return false; }
inline bool os::numa_has_group_homing() { return true; }
+
+inline int os::socket(int domain, int type, int protocol) {
+ return ::socket(domain, type, protocol);
+}
+
+inline int os::listen(int fd, int count) {
+ if (fd < 0) return OS_ERR;
+
+ return ::listen(fd, count);
+}
+
+inline int os::socket_shutdown(int fd, int howto){
+ return ::shutdown(fd, howto);
+}
+
+inline int os::get_sock_name(int fd, struct sockaddr *him, int *len){
+ return ::getsockname(fd, him, (socklen_t*) len);
+}
+
+inline int os::get_host_name(char* name, int namelen){
+ return ::gethostname(name, namelen);
+}
+
+inline struct hostent* os::get_host_by_name(char* name) {
+ return ::gethostbyname(name);
+}
+inline int os::get_sock_opt(int fd, int level, int optname,
+ char *optval, int* optlen){
+ return ::getsockopt(fd, level, optname, optval, (socklen_t*) optlen);
+}
+
+inline int os::set_sock_opt(int fd, int level, int optname,
+ const char *optval, int optlen){
+ return ::setsockopt(fd, level, optname, optval, optlen);
+}
+#endif // OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
diff --git a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp
index dad0bf353c7..1d1ff260cd8 100644
--- a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,8 +22,15 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_perfMemory_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "os_solaris.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/perfMemory.hpp"
+#include "utilities/exceptions.hpp"
// put OS-includes here
# include
diff --git a/hotspot/src/os/solaris/vm/stubRoutines_solaris.cpp b/hotspot/src/os/solaris/vm/stubRoutines_solaris.cpp
index f827ec7115d..3723a0f7dfa 100644
--- a/hotspot/src/os/solaris/vm/stubRoutines_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/stubRoutines_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,5 +22,7 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "runtime/stubRoutines.hpp"
+
diff --git a/hotspot/src/os/solaris/vm/threadCritical_solaris.cpp b/hotspot/src/os/solaris/vm/threadCritical_solaris.cpp
index d629f3da7f3..b658183c2f3 100644
--- a/hotspot/src/os/solaris/vm/threadCritical_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/threadCritical_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_threadCritical_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadCritical.hpp"
+#include "thread_solaris.inline.hpp"
// OS-includes here
#include
diff --git a/hotspot/src/os/solaris/vm/thread_solaris.inline.hpp b/hotspot/src/os/solaris/vm/thread_solaris.inline.hpp
index fb0ee5f0f7e..94c51676d7a 100644
--- a/hotspot/src/os/solaris/vm/thread_solaris.inline.hpp
+++ b/hotspot/src/os/solaris/vm/thread_solaris.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,24 @@
*
*/
+#ifndef OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP
+#define OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP
+
+#include "runtime/atomic.hpp"
+#include "runtime/prefetch.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "atomic_solaris_x86.inline.hpp"
+# include "orderAccess_solaris_x86.inline.hpp"
+# include "prefetch_solaris_x86.inline.hpp"
+#endif
+#ifdef TARGET_OS_ARCH_solaris_sparc
+# include "atomic_solaris_sparc.inline.hpp"
+# include "orderAccess_solaris_sparc.inline.hpp"
+# include "prefetch_solaris_sparc.inline.hpp"
+#endif
+
// Thread::current is "hot" it's called > 128K times in the 1st 500 msecs of
// startup.
// ThreadLocalStorage::thread is warm -- it's called > 16K times in the same
@@ -43,3 +61,5 @@ inline Thread* ThreadLocalStorage::thread() {
return ThreadLocalStorage::get_thread_via_cache_slowly(raw, ix);
}
}
+
+#endif // OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP
diff --git a/hotspot/src/os/solaris/vm/vmError_solaris.cpp b/hotspot/src/os/solaris/vm/vmError_solaris.cpp
index 65026a85488..6f3f5b06fe6 100644
--- a/hotspot/src/os/solaris/vm/vmError_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/vmError_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,8 +22,11 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_vmError_solaris.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/os.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/vmError.hpp"
#include
#include
diff --git a/hotspot/src/os/windows/launcher/java_md.c b/hotspot/src/os/windows/launcher/java_md.c
new file mode 100644
index 00000000000..2fde40ad205
--- /dev/null
+++ b/hotspot/src/os/windows/launcher/java_md.c
@@ -0,0 +1,1512 @@
+/*
+ * Copyright (c) 1999, 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.
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include "java.h"
+#ifndef GAMMA
+#include "version_comp.h"
+#endif
+
+#define JVM_DLL "jvm.dll"
+#define JAVA_DLL "java.dll"
+#define CRT_DLL "msvcr71.dll"
+
+/*
+ * Prototypes.
+ */
+static jboolean GetPublicJREHome(char *path, jint pathsize);
+static jboolean GetJVMPath(const char *jrepath, const char *jvmtype,
+ char *jvmpath, jint jvmpathsize);
+static jboolean GetJREPath(char *path, jint pathsize);
+static void EnsureJreInstallation(const char *jrepath);
+
+/* We supports warmup for UI stack that is performed in parallel
+ * to VM initialization.
+ * This helps to improve startup of UI application as warmup phase
+ * might be long due to initialization of OS or hardware resources.
+ * It is not CPU bound and therefore it does not interfere with VM init.
+ * Obviously such warmup only has sense for UI apps and therefore it needs
+ * to be explicitly requested by passing -Dsun.awt.warmup=true property
+ * (this is always the case for plugin/javaws).
+ *
+ * Implementation launches new thread after VM starts and use it to perform
+ * warmup code (platform dependent).
+ * This thread is later reused as AWT toolkit thread as graphics toolkit
+ * often assume that they are used from the same thread they were launched on.
+ *
+ * At the moment we only support warmup for D3D. It only possible on windows
+ * and only if other flags do not prohibit this (e.g. OpenGL support requested).
+ */
+#undef ENABLE_AWT_PRELOAD
+#ifndef JAVA_ARGS /* turn off AWT preloading for javac, jar, etc */
+ #ifdef _X86_ /* for now disable AWT preloading for 64bit */
+ #define ENABLE_AWT_PRELOAD
+ #endif
+#endif
+
+#ifdef ENABLE_AWT_PRELOAD
+/* "AWT was preloaded" flag;
+ * Turned on by AWTPreload().
+ */
+int awtPreloaded = 0;
+
+/* Calls a function with the name specified.
+ * The function must be int(*fn)(void).
+ */
+int AWTPreload(const char *funcName);
+/* Stops AWT preloading. */
+void AWTPreloadStop();
+
+/* D3D preloading */
+/* -1: not initialized; 0: OFF, 1: ON */
+int awtPreloadD3D = -1;
+/* Command line parameter to swith D3D preloading on. */
+#define PARAM_PRELOAD_D3D "-Dsun.awt.warmup"
+/* D3D/OpenGL management parameters (may disable D3D preloading) */
+#define PARAM_NODDRAW "-Dsun.java2d.noddraw"
+#define PARAM_D3D "-Dsun.java2d.d3d"
+#define PARAM_OPENGL "-Dsun.java2d.opengl"
+/* funtion in awt.dll (src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp) */
+#define D3D_PRELOAD_FUNC "preloadD3D"
+
+
+/* Extracts value of a parameter with the specified name
+ * from command line argument (returns pointer in the argument).
+ * Returns NULL if the argument does not contains the parameter.
+ * e.g.:
+ * GetParamValue("theParam", "theParam=value") returns pointer to "value".
+ */
+const char * GetParamValue(const char *paramName, const char *arg) {
+ int nameLen = strlen(paramName);
+ if (strncmp(paramName, arg, nameLen) == 0) {
+ // arg[nameLen] is valid (may contain final NULL)
+ if (arg[nameLen] == '=') {
+ return arg + nameLen + 1;
+ }
+ }
+ return NULL;
+}
+
+/* Checks if commandline argument contains property specified
+ * and analyze it as boolean property (true/false).
+ * Returns -1 if the argument does not contain the parameter;
+ * Returns 1 if the argument contains the parameter and its value is "true";
+ * Returns 0 if the argument contains the parameter and its value is "false".
+ */
+int GetBoolParamValue(const char *paramName, const char *arg) {
+ const char * paramValue = GetParamValue(paramName, arg);
+ if (paramValue != NULL) {
+ if (stricmp(paramValue, "true") == 0) {
+ return 1;
+ }
+ if (stricmp(paramValue, "false") == 0) {
+ return 0;
+ }
+ }
+ return -1;
+}
+#endif /* ENABLE_AWT_PRELOAD */
+
+
+const char *
+GetArch()
+{
+
+#ifdef _M_AMD64
+ return "amd64";
+#elif defined(_M_IA64)
+ return "ia64";
+#else
+ return "i386";
+#endif
+}
+
+/*
+ *
+ */
+void
+CreateExecutionEnvironment(int *_argc,
+ char ***_argv,
+ char jrepath[],
+ jint so_jrepath,
+ char jvmpath[],
+ jint so_jvmpath,
+ char **original_argv) {
+#ifndef GAMMA
+ char * jvmtype;
+
+ /* Find out where the JRE is that we will be using. */
+ if (!GetJREPath(jrepath, so_jrepath)) {
+ ReportErrorMessage("Error: could not find Java SE Runtime Environment.",
+ JNI_TRUE);
+ exit(2);
+ }
+
+ /* Do this before we read jvm.cfg */
+ EnsureJreInstallation(jrepath);
+
+ /* Find the specified JVM type */
+ if (ReadKnownVMs(jrepath, (char*)GetArch(), JNI_FALSE) < 1) {
+ ReportErrorMessage("Error: no known VMs. (check for corrupt jvm.cfg file)",
+ JNI_TRUE);
+ exit(1);
+ }
+ jvmtype = CheckJvmType(_argc, _argv, JNI_FALSE);
+
+ jvmpath[0] = '\0';
+ if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath)) {
+ char * message=NULL;
+ const char * format = "Error: no `%s' JVM at `%s'.";
+ message = (char *)JLI_MemAlloc((strlen(format)+strlen(jvmtype)+
+ strlen(jvmpath)) * sizeof(char));
+ sprintf(message,format, jvmtype, jvmpath);
+ ReportErrorMessage(message, JNI_TRUE);
+ exit(4);
+ }
+ /* If we got here, jvmpath has been correctly initialized. */
+
+#else /* ifndef GAMMA */
+
+ /*
+ * gamma launcher is simpler in that it doesn't handle VM flavors, data
+ * model, etc. Assuming everything is set-up correctly
+ * all we need to do here is to return correct path names. See also
+ * GetJVMPath() and GetApplicationHome().
+ */
+
+ {
+ if (!GetJREPath(jrepath, so_jrepath) ) {
+ ReportErrorMessage("Error: could not find Java SE Runtime Environment.",
+ JNI_TRUE);
+ exit(2);
+ }
+
+ if (!GetJVMPath(jrepath, NULL, jvmpath, so_jvmpath)) {
+ char * message=NULL;
+ const char * format = "Error: no JVM at `%s'.";
+ message = (char *)JLI_MemAlloc((strlen(format)+
+ strlen(jvmpath)) * sizeof(char));
+ sprintf(message, format, jvmpath);
+ ReportErrorMessage(message, JNI_TRUE);
+ exit(4);
+ }
+ }
+
+#endif /* ifndef GAMMA */
+
+}
+
+
+static jboolean
+LoadMSVCRT()
+{
+ // Only do this once
+ static int loaded = 0;
+ char crtpath[MAXPATHLEN];
+
+ if (!loaded) {
+ /*
+ * The Microsoft C Runtime Library needs to be loaded first. A copy is
+ * assumed to be present in the "JRE path" directory. If it is not found
+ * there (or "JRE path" fails to resolve), skip the explicit load and let
+ * nature take its course, which is likely to be a failure to execute.
+ */
+ if (GetJREPath(crtpath, MAXPATHLEN)) {
+ (void)strcat(crtpath, "\\bin\\" CRT_DLL); /* Add crt dll */
+ if (_launcher_debug) {
+ printf("CRT path is %s\n", crtpath);
+ }
+ if (_access(crtpath, 0) == 0) {
+ if (LoadLibrary(crtpath) == 0) {
+ ReportErrorMessage2("Error loading: %s", crtpath, JNI_TRUE);
+ return JNI_FALSE;
+ }
+ }
+ }
+ loaded = 1;
+ }
+ return JNI_TRUE;
+}
+
+/*
+ * The preJVMStart is a function in the jkernel.dll, which
+ * performs the final step of synthesizing back the decomposed
+ * modules (partial install) to the full JRE. Any tool which
+ * uses the JRE must peform this step to ensure the complete synthesis.
+ * The EnsureJreInstallation function calls preJVMStart based on
+ * the conditions outlined below, noting that the operation
+ * will fail silently if any of conditions are not met.
+ * NOTE: this call must be made before jvm.dll is loaded, or jvm.cfg
+ * is read, since jvm.cfg will be modified by the preJVMStart.
+ * 1. Are we on a supported platform.
+ * 2. Find the location of the JRE or the Kernel JRE.
+ * 3. check existence of JREHOME/lib/bundles
+ * 4. check jkernel.dll and invoke the entry-point
+ */
+typedef VOID (WINAPI *PREJVMSTART)();
+
+static void
+EnsureJreInstallation(const char* jrepath)
+{
+ HINSTANCE handle;
+ char tmpbuf[MAXPATHLEN];
+ PREJVMSTART PreJVMStart;
+ struct stat s;
+
+ /* 32 bit windows only please */
+ if (strcmp(GetArch(), "i386") != 0 ) {
+ if (_launcher_debug) {
+ printf("EnsureJreInstallation:unsupported platform\n");
+ }
+ return;
+ }
+ /* Does our bundle directory exist ? */
+ strcpy(tmpbuf, jrepath);
+ strcat(tmpbuf, "\\lib\\bundles");
+ if (stat(tmpbuf, &s) != 0) {
+ if (_launcher_debug) {
+ printf("EnsureJreInstallation:<%s>:not found\n", tmpbuf);
+ }
+ return;
+ }
+ /* Does our jkernel dll exist ? */
+ strcpy(tmpbuf, jrepath);
+ strcat(tmpbuf, "\\bin\\jkernel.dll");
+ if (stat(tmpbuf, &s) != 0) {
+ if (_launcher_debug) {
+ printf("EnsureJreInstallation:<%s>:not found\n", tmpbuf);
+ }
+ return;
+ }
+ /* The Microsoft C Runtime Library needs to be loaded first. */
+ if (!LoadMSVCRT()) {
+ if (_launcher_debug) {
+ printf("EnsureJreInstallation:could not load C runtime DLL\n");
+ }
+ return;
+ }
+ /* Load the jkernel.dll */
+ if ((handle = LoadLibrary(tmpbuf)) == 0) {
+ if (_launcher_debug) {
+ printf("EnsureJreInstallation:%s:load failed\n", tmpbuf);
+ }
+ return;
+ }
+ /* Get the function address */
+ PreJVMStart = (PREJVMSTART)GetProcAddress(handle, "preJVMStart");
+ if (PreJVMStart == NULL) {
+ if (_launcher_debug) {
+ printf("EnsureJreInstallation:preJVMStart:function lookup failed\n");
+ }
+ FreeLibrary(handle);
+ return;
+ }
+ PreJVMStart();
+ if (_launcher_debug) {
+ printf("EnsureJreInstallation:preJVMStart:called\n");
+ }
+ FreeLibrary(handle);
+ return;
+}
+
+/*
+ * Find path to JRE based on .exe's location or registry settings.
+ */
+jboolean
+GetJREPath(char *path, jint pathsize)
+{
+ char javadll[MAXPATHLEN];
+ struct stat s;
+
+ if (GetApplicationHome(path, pathsize)) {
+ /* Is JRE co-located with the application? */
+ sprintf(javadll, "%s\\bin\\" JAVA_DLL, path);
+ if (stat(javadll, &s) == 0) {
+ goto found;
+ }
+
+ /* Does this app ship a private JRE in \jre directory? */
+ sprintf(javadll, "%s\\jre\\bin\\" JAVA_DLL, path);
+ if (stat(javadll, &s) == 0) {
+ strcat(path, "\\jre");
+ goto found;
+ }
+ }
+
+#ifndef GAMMA
+ /* Look for a public JRE on this machine. */
+ if (GetPublicJREHome(path, pathsize)) {
+ goto found;
+ }
+#endif
+
+ fprintf(stderr, "Error: could not find " JAVA_DLL "\n");
+ return JNI_FALSE;
+
+ found:
+ if (_launcher_debug)
+ printf("JRE path is %s\n", path);
+ return JNI_TRUE;
+}
+
+/*
+ * Given a JRE location and a JVM type, construct what the name the
+ * JVM shared library will be. Return true, if such a library
+ * exists, false otherwise.
+ */
+static jboolean
+GetJVMPath(const char *jrepath, const char *jvmtype,
+ char *jvmpath, jint jvmpathsize)
+{
+ struct stat s;
+
+#ifndef GAMMA
+ if (strchr(jvmtype, '/') || strchr(jvmtype, '\\')) {
+ sprintf(jvmpath, "%s\\" JVM_DLL, jvmtype);
+ } else {
+ sprintf(jvmpath, "%s\\bin\\%s\\" JVM_DLL, jrepath, jvmtype);
+ }
+#else
+ /*
+ * For gamma launcher, JVM is either built-in or in the same directory.
+ * Either way we return "/jvm.dll" where is the
+ * directory where gamma launcher is located.
+ */
+
+ char *p;
+ GetModuleFileName(0, jvmpath, jvmpathsize);
+
+ p = strrchr(jvmpath, '\\');
+ if (p) {
+ /* replace executable name with libjvm.so */
+ snprintf(p + 1, jvmpathsize - (p + 1 - jvmpath), "%s", JVM_DLL);
+ } else {
+ /* this case shouldn't happen */
+ snprintf(jvmpath, jvmpathsize, "%s", JVM_DLL);
+ }
+#endif /* ifndef GAMMA */
+
+ if (stat(jvmpath, &s) == 0) {
+ return JNI_TRUE;
+ } else {
+ return JNI_FALSE;
+ }
+}
+
+/*
+ * Load a jvm from "jvmpath" and initialize the invocation functions.
+ */
+jboolean
+LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
+{
+#ifdef GAMMA
+ /* JVM is directly linked with gamma launcher; no Loadlibrary() */
+ ifn->CreateJavaVM = JNI_CreateJavaVM;
+ ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs;
+ return JNI_TRUE;
+#else
+ HINSTANCE handle;
+
+ if (_launcher_debug) {
+ printf("JVM path is %s\n", jvmpath);
+ }
+
+ /* The Microsoft C Runtime Library needs to be loaded first. */
+ LoadMSVCRT();
+
+ /* Load the Java VM DLL */
+ if ((handle = LoadLibrary(jvmpath)) == 0) {
+ ReportErrorMessage2("Error loading: %s", (char *)jvmpath, JNI_TRUE);
+ return JNI_FALSE;
+ }
+
+ /* Now get the function addresses */
+ ifn->CreateJavaVM =
+ (void *)GetProcAddress(handle, "JNI_CreateJavaVM");
+ ifn->GetDefaultJavaVMInitArgs =
+ (void *)GetProcAddress(handle, "JNI_GetDefaultJavaVMInitArgs");
+ if (ifn->CreateJavaVM == 0 || ifn->GetDefaultJavaVMInitArgs == 0) {
+ ReportErrorMessage2("Error: can't find JNI interfaces in: %s",
+ (char *)jvmpath, JNI_TRUE);
+ return JNI_FALSE;
+ }
+
+ return JNI_TRUE;
+#endif /* ifndef GAMMA */
+}
+
+/*
+ * If app is "c:\foo\bin\javac", then put "c:\foo" into buf.
+ */
+jboolean
+GetApplicationHome(char *buf, jint bufsize)
+{
+#ifndef GAMMA
+ char *cp;
+ GetModuleFileName(0, buf, bufsize);
+ *strrchr(buf, '\\') = '\0'; /* remove .exe file name */
+ if ((cp = strrchr(buf, '\\')) == 0) {
+ /* This happens if the application is in a drive root, and
+ * there is no bin directory. */
+ buf[0] = '\0';
+ return JNI_FALSE;
+ }
+ *cp = '\0'; /* remove the bin\ part */
+ return JNI_TRUE;
+
+#else /* ifndef GAMMA */
+
+ char env[MAXPATHLEN + 1];
+
+ /* gamma launcher uses ALT_JAVA_HOME environment variable or jdkpath.txt file to find JDK/JRE */
+
+ if (getenv("ALT_JAVA_HOME") != NULL) {
+ snprintf(buf, bufsize, "%s", getenv("ALT_JAVA_HOME"));
+ }
+ else {
+ char path[MAXPATHLEN + 1];
+ char* p;
+ int len;
+ FILE* fp;
+
+ // find the path to the currect executable
+ len = GetModuleFileName(NULL, path, MAXPATHLEN + 1);
+ if (len == 0 || len > MAXPATHLEN) {
+ printf("Could not get directory of current executable.");
+ return JNI_FALSE;
+ }
+ // remove last path component ("hotspot.exe")
+ p = strrchr(path, '\\');
+ if (p == NULL) {
+ printf("Could not parse directory of current executable.\n");
+ return JNI_FALSE;
+ }
+ *p = '\0';
+
+ // open jdkpath.txt and read JAVA_HOME from it
+ if (strlen(path) + strlen("\\jdkpath.txt") + 1 >= MAXPATHLEN) {
+ printf("Path too long: %s\n", path);
+ return JNI_FALSE;
+ }
+ strcat(path, "\\jdkpath.txt");
+ fp = fopen(path, "r");
+ if (fp == NULL) {
+ printf("Could not open file %s to get path to JDK.\n", path);
+ return JNI_FALSE;
+ }
+
+ if (fgets(buf, bufsize, fp) == NULL) {
+ printf("Could not read from file %s to get path to JDK.\n", path);
+ fclose(fp);
+ return JNI_FALSE;
+ }
+ // trim the buffer
+ p = buf + strlen(buf) - 1;
+ while(isspace(*p)) {
+ *p = '\0';
+ p--;
+ }
+ fclose(fp);
+ }
+
+ _snprintf(env, MAXPATHLEN, "JAVA_HOME=%s", buf);
+ _putenv(env);
+
+ return JNI_TRUE;
+#endif /* ifndef GAMMA */
+}
+
+#ifdef JAVAW
+__declspec(dllimport) char **__initenv;
+
+int WINAPI
+WinMain(HINSTANCE inst, HINSTANCE previnst, LPSTR cmdline, int cmdshow)
+{
+ int ret;
+
+ __initenv = _environ;
+ ret = main(__argc, __argv);
+
+ return ret;
+}
+#endif
+
+#ifndef GAMMA
+
+/*
+ * Helpers to look in the registry for a public JRE.
+ */
+ /* Same for 1.5.0, 1.5.1, 1.5.2 etc. */
+#define DOTRELEASE JDK_MAJOR_VERSION "." JDK_MINOR_VERSION
+#define JRE_KEY "Software\\JavaSoft\\Java Runtime Environment"
+
+static jboolean
+GetStringFromRegistry(HKEY key, const char *name, char *buf, jint bufsize)
+{
+ DWORD type, size;
+
+ if (RegQueryValueEx(key, name, 0, &type, 0, &size) == 0
+ && type == REG_SZ
+ && (size < (unsigned int)bufsize)) {
+ if (RegQueryValueEx(key, name, 0, 0, buf, &size) == 0) {
+ return JNI_TRUE;
+ }
+ }
+ return JNI_FALSE;
+}
+
+static jboolean
+GetPublicJREHome(char *buf, jint bufsize)
+{
+ HKEY key, subkey;
+ char version[MAXPATHLEN];
+
+ /*
+ * Note: There is a very similar implementation of the following
+ * registry reading code in the Windows java control panel (javacp.cpl).
+ * If there are bugs here, a similar bug probably exists there. Hence,
+ * changes here require inspection there.
+ */
+
+ /* Find the current version of the JRE */
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, JRE_KEY, 0, KEY_READ, &key) != 0) {
+ fprintf(stderr, "Error opening registry key '" JRE_KEY "'\n");
+ return JNI_FALSE;
+ }
+
+ if (!GetStringFromRegistry(key, "CurrentVersion",
+ version, sizeof(version))) {
+ fprintf(stderr, "Failed reading value of registry key:\n\t"
+ JRE_KEY "\\CurrentVersion\n");
+ RegCloseKey(key);
+ return JNI_FALSE;
+ }
+
+ if (strcmp(version, DOTRELEASE) != 0) {
+ fprintf(stderr, "Registry key '" JRE_KEY "\\CurrentVersion'\nhas "
+ "value '%s', but '" DOTRELEASE "' is required.\n", version);
+ RegCloseKey(key);
+ return JNI_FALSE;
+ }
+
+ /* Find directory where the current version is installed. */
+ if (RegOpenKeyEx(key, version, 0, KEY_READ, &subkey) != 0) {
+ fprintf(stderr, "Error opening registry key '"
+ JRE_KEY "\\%s'\n", version);
+ RegCloseKey(key);
+ return JNI_FALSE;
+ }
+
+ if (!GetStringFromRegistry(subkey, "JavaHome", buf, bufsize)) {
+ fprintf(stderr, "Failed reading value of registry key:\n\t"
+ JRE_KEY "\\%s\\JavaHome\n", version);
+ RegCloseKey(key);
+ RegCloseKey(subkey);
+ return JNI_FALSE;
+ }
+
+ if (_launcher_debug) {
+ char micro[MAXPATHLEN];
+ if (!GetStringFromRegistry(subkey, "MicroVersion", micro,
+ sizeof(micro))) {
+ printf("Warning: Can't read MicroVersion\n");
+ micro[0] = '\0';
+ }
+ printf("Version major.minor.micro = %s.%s\n", version, micro);
+ }
+
+ RegCloseKey(key);
+ RegCloseKey(subkey);
+ return JNI_TRUE;
+}
+
+#endif /* ifndef GAMMA */
+
+/*
+ * Support for doing cheap, accurate interval timing.
+ */
+static jboolean counterAvailable = JNI_FALSE;
+static jboolean counterInitialized = JNI_FALSE;
+static LARGE_INTEGER counterFrequency;
+
+jlong CounterGet()
+{
+ LARGE_INTEGER count;
+
+ if (!counterInitialized) {
+ counterAvailable = QueryPerformanceFrequency(&counterFrequency);
+ counterInitialized = JNI_TRUE;
+ }
+ if (!counterAvailable) {
+ return 0;
+ }
+ QueryPerformanceCounter(&count);
+ return (jlong)(count.QuadPart);
+}
+
+jlong Counter2Micros(jlong counts)
+{
+ if (!counterAvailable || !counterInitialized) {
+ return 0;
+ }
+ return (counts * 1000 * 1000)/counterFrequency.QuadPart;
+}
+
+void ReportErrorMessage(char * message, jboolean always) {
+#ifdef JAVAW
+ if (message != NULL) {
+ MessageBox(NULL, message, "Java Virtual Machine Launcher",
+ (MB_OK|MB_ICONSTOP|MB_APPLMODAL));
+ }
+#else
+ if (always) {
+ fprintf(stderr, "%s\n", message);
+ }
+#endif
+}
+
+void ReportErrorMessage2(char * format, char * string, jboolean always) {
+ /*
+ * The format argument must be a printf format string with one %s
+ * argument, which is passed the string argument.
+ */
+#ifdef JAVAW
+ size_t size;
+ char * message;
+ size = strlen(format) + strlen(string);
+ message = (char*)JLI_MemAlloc(size*sizeof(char));
+ sprintf(message, (const char *)format, string);
+
+ if (message != NULL) {
+ MessageBox(NULL, message, "Java Virtual Machine Launcher",
+ (MB_OK|MB_ICONSTOP|MB_APPLMODAL));
+ JLI_MemFree(message);
+ }
+#else
+ if (always) {
+ fprintf(stderr, (const char *)format, string);
+ fprintf(stderr, "\n");
+ }
+#endif
+}
+
+/*
+ * As ReportErrorMessage2 (above) except the system message (if any)
+ * associated with this error is written to a second %s format specifier
+ * in the format argument.
+ */
+void ReportSysErrorMessage2(char * format, char * string, jboolean always) {
+ int save_errno = errno;
+ DWORD errval;
+ int freeit = 0;
+ char *errtext = NULL;
+
+ if ((errval = GetLastError()) != 0) { /* Platform SDK / DOS Error */
+ int n = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|
+ FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ NULL, errval, 0, (LPTSTR)&errtext, 0, NULL);
+ if (errtext == NULL || n == 0) { /* Paranoia check */
+ errtext = "";
+ n = 0;
+ } else {
+ freeit = 1;
+ if (n > 2) { /* Drop final CR, LF */
+ if (errtext[n - 1] == '\n') n--;
+ if (errtext[n - 1] == '\r') n--;
+ errtext[n] = '\0';
+ }
+ }
+ } else /* C runtime error that has no corresponding DOS error code */
+ errtext = strerror(save_errno);
+
+#ifdef JAVAW
+ {
+ size_t size;
+ char * message;
+ size = strlen(format) + strlen(string) + strlen(errtext);
+ message = (char*)JLI_MemAlloc(size*sizeof(char));
+ sprintf(message, (const char *)format, string, errtext);
+
+ if (message != NULL) {
+ MessageBox(NULL, message, "Java Virtual Machine Launcher",
+ (MB_OK|MB_ICONSTOP|MB_APPLMODAL));
+ JLI_MemFree(message);
+ }
+ }
+#else
+ if (always) {
+ fprintf(stderr, (const char *)format, string, errtext);
+ fprintf(stderr, "\n");
+ }
+#endif
+ if (freeit)
+ (void)LocalFree((HLOCAL)errtext);
+}
+
+void ReportExceptionDescription(JNIEnv * env) {
+#ifdef JAVAW
+ /*
+ * This code should be replaced by code which opens a window with
+ * the exception detail message.
+ */
+ (*env)->ExceptionDescribe(env);
+#else
+ (*env)->ExceptionDescribe(env);
+#endif
+}
+
+
+/*
+ * Return JNI_TRUE for an option string that has no effect but should
+ * _not_ be passed on to the vm; return JNI_FALSE otherwise. On
+ * windows, there are no options that should be screened in this
+ * manner.
+ */
+jboolean RemovableMachineDependentOption(char * option) {
+#ifdef ENABLE_AWT_PRELOAD
+ if (awtPreloadD3D < 0) {
+ /* Tests the command line parameter only if not set yet. */
+ if (GetBoolParamValue(PARAM_PRELOAD_D3D, option) == 1) {
+ awtPreloadD3D = 1;
+ }
+ }
+ if (awtPreloadD3D != 0) {
+ /* Don't test the command line parameters if already disabled. */
+ if (GetBoolParamValue(PARAM_NODDRAW, option) == 1
+ || GetBoolParamValue(PARAM_D3D, option) == 0
+ || GetBoolParamValue(PARAM_OPENGL, option) == 1)
+ {
+ awtPreloadD3D = 0;
+ }
+ }
+#endif /* ENABLE_AWT_PRELOAD */
+
+ return JNI_FALSE;
+}
+
+void PrintMachineDependentOptions() {
+ return;
+}
+
+#ifndef GAMMA
+
+jboolean
+ServerClassMachine() {
+ jboolean result = JNI_FALSE;
+#if defined(NEVER_ACT_AS_SERVER_CLASS_MACHINE)
+ result = JNI_FALSE;
+#elif defined(ALWAYS_ACT_AS_SERVER_CLASS_MACHINE)
+ result = JNI_TRUE;
+#endif
+ return result;
+}
+
+/*
+ * Determine if there is an acceptable JRE in the registry directory top_key.
+ * Upon locating the "best" one, return a fully qualified path to it.
+ * "Best" is defined as the most advanced JRE meeting the constraints
+ * contained in the manifest_info. If no JRE in this directory meets the
+ * constraints, return NULL.
+ *
+ * It doesn't matter if we get an error reading the registry, or we just
+ * don't find anything interesting in the directory. We just return NULL
+ * in either case.
+ */
+static char *
+ProcessDir(manifest_info* info, HKEY top_key) {
+ DWORD index = 0;
+ HKEY ver_key;
+ char name[MAXNAMELEN];
+ int len;
+ char *best = NULL;
+
+ /*
+ * Enumerate "/SOFTWARE/JavaSoft/Java Runtime Environment"
+ * searching for the best available version.
+ */
+ while (RegEnumKey(top_key, index, name, MAXNAMELEN) == ERROR_SUCCESS) {
+ index++;
+ if (JLI_AcceptableRelease(name, info->jre_version))
+ if ((best == NULL) || (JLI_ExactVersionId(name, best) > 0)) {
+ if (best != NULL)
+ JLI_MemFree(best);
+ best = JLI_StringDup(name);
+ }
+ }
+
+ /*
+ * Extract "JavaHome" from the "best" registry directory and return
+ * that path. If no appropriate version was located, or there is an
+ * error in extracting the "JavaHome" string, return null.
+ */
+ if (best == NULL)
+ return (NULL);
+ else {
+ if (RegOpenKeyEx(top_key, best, 0, KEY_READ, &ver_key)
+ != ERROR_SUCCESS) {
+ JLI_MemFree(best);
+ if (ver_key != NULL)
+ RegCloseKey(ver_key);
+ return (NULL);
+ }
+ JLI_MemFree(best);
+ len = MAXNAMELEN;
+ if (RegQueryValueEx(ver_key, "JavaHome", NULL, NULL, (LPBYTE)name, &len)
+ != ERROR_SUCCESS) {
+ if (ver_key != NULL)
+ RegCloseKey(ver_key);
+ return (NULL);
+ }
+ if (ver_key != NULL)
+ RegCloseKey(ver_key);
+ return (JLI_StringDup(name));
+ }
+}
+
+/*
+ * This is the global entry point. It examines the host for the optimal
+ * JRE to be used by scanning a set of registry entries. This set of entries
+ * is hardwired on Windows as "Software\JavaSoft\Java Runtime Environment"
+ * under the set of roots "{ HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE }".
+ *
+ * This routine simply opens each of these registry directories before passing
+ * control onto ProcessDir().
+ */
+char *
+LocateJRE(manifest_info* info) {
+ HKEY key = NULL;
+ char *path;
+ int key_index;
+ HKEY root_keys[2] = { HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE };
+
+ for (key_index = 0; key_index <= 1; key_index++) {
+ if (RegOpenKeyEx(root_keys[key_index], JRE_KEY, 0, KEY_READ, &key)
+ == ERROR_SUCCESS)
+ if ((path = ProcessDir(info, key)) != NULL) {
+ if (key != NULL)
+ RegCloseKey(key);
+ return (path);
+ }
+ if (key != NULL)
+ RegCloseKey(key);
+ }
+ return NULL;
+}
+
+
+/*
+ * Local helper routine to isolate a single token (option or argument)
+ * from the command line.
+ *
+ * This routine accepts a pointer to a character pointer. The first
+ * token (as defined by MSDN command-line argument syntax) is isolated
+ * from that string.
+ *
+ * Upon return, the input character pointer pointed to by the parameter s
+ * is updated to point to the remainding, unscanned, portion of the string,
+ * or to a null character if the entire string has been consummed.
+ *
+ * This function returns a pointer to a null-terminated string which
+ * contains the isolated first token, or to the null character if no
+ * token could be isolated.
+ *
+ * Note the side effect of modifying the input string s by the insertion
+ * of a null character, making it two strings.
+ *
+ * See "Parsing C Command-Line Arguments" in the MSDN Library for the
+ * parsing rule details. The rule summary from that specification is:
+ *
+ * * Arguments are delimited by white space, which is either a space or a tab.
+ *
+ * * A string surrounded by double quotation marks is interpreted as a single
+ * argument, regardless of white space contained within. A quoted string can
+ * be embedded in an argument. Note that the caret (^) is not recognized as
+ * an escape character or delimiter.
+ *
+ * * A double quotation mark preceded by a backslash, \", is interpreted as a
+ * literal double quotation mark (").
+ *
+ * * Backslashes are interpreted literally, unless they immediately precede a
+ * double quotation mark.
+ *
+ * * If an even number of backslashes is followed by a double quotation mark,
+ * then one backslash (\) is placed in the argv array for every pair of
+ * backslashes (\\), and the double quotation mark (") is interpreted as a
+ * string delimiter.
+ *
+ * * If an odd number of backslashes is followed by a double quotation mark,
+ * then one backslash (\) is placed in the argv array for every pair of
+ * backslashes (\\) and the double quotation mark is interpreted as an
+ * escape sequence by the remaining backslash, causing a literal double
+ * quotation mark (") to be placed in argv.
+ */
+static char*
+nextarg(char** s) {
+ char *p = *s;
+ char *head;
+ int slashes = 0;
+ int inquote = 0;
+
+ /*
+ * Strip leading whitespace, which MSDN defines as only space or tab.
+ * (Hence, no locale specific "isspace" here.)
+ */
+ while (*p != (char)0 && (*p == ' ' || *p == '\t'))
+ p++;
+ head = p; /* Save the start of the token to return */
+
+ /*
+ * Isolate a token from the command line.
+ */
+ while (*p != (char)0 && (inquote || !(*p == ' ' || *p == '\t'))) {
+ if (*p == '\\' && *(p+1) == '"' && slashes % 2 == 0)
+ p++;
+ else if (*p == '"')
+ inquote = !inquote;
+ slashes = (*p++ == '\\') ? slashes + 1 : 0;
+ }
+
+ /*
+ * If the token isolated isn't already terminated in a "char zero",
+ * then replace the whitespace character with one and move to the
+ * next character.
+ */
+ if (*p != (char)0)
+ *p++ = (char)0;
+
+ /*
+ * Update the parameter to point to the head of the remaining string
+ * reflecting the command line and return a pointer to the leading
+ * token which was isolated from the command line.
+ */
+ *s = p;
+ return (head);
+}
+
+/*
+ * Local helper routine to return a string equivalent to the input string
+ * s, but with quotes removed so the result is a string as would be found
+ * in argv[]. The returned string should be freed by a call to JLI_MemFree().
+ *
+ * The rules for quoting (and escaped quotes) are:
+ *
+ * 1 A double quotation mark preceded by a backslash, \", is interpreted as a
+ * literal double quotation mark (").
+ *
+ * 2 Backslashes are interpreted literally, unless they immediately precede a
+ * double quotation mark.
+ *
+ * 3 If an even number of backslashes is followed by a double quotation mark,
+ * then one backslash (\) is placed in the argv array for every pair of
+ * backslashes (\\), and the double quotation mark (") is interpreted as a
+ * string delimiter.
+ *
+ * 4 If an odd number of backslashes is followed by a double quotation mark,
+ * then one backslash (\) is placed in the argv array for every pair of
+ * backslashes (\\) and the double quotation mark is interpreted as an
+ * escape sequence by the remaining backslash, causing a literal double
+ * quotation mark (") to be placed in argv.
+ */
+static char*
+unquote(const char *s) {
+ const char *p = s; /* Pointer to the tail of the original string */
+ char *un = (char*)JLI_MemAlloc(strlen(s) + 1); /* Ptr to unquoted string */
+ char *pun = un; /* Pointer to the tail of the unquoted string */
+
+ while (*p != '\0') {
+ if (*p == '"') {
+ p++;
+ } else if (*p == '\\') {
+ const char *q = p + strspn(p,"\\");
+ if (*q == '"')
+ do {
+ *pun++ = '\\';
+ p += 2;
+ } while (*p == '\\' && p < q);
+ else
+ while (p < q)
+ *pun++ = *p++;
+ } else {
+ *pun++ = *p++;
+ }
+ }
+ *pun = '\0';
+ return un;
+}
+
+/*
+ * Given a path to a jre to execute, this routine checks if this process
+ * is indeed that jre. If not, it exec's that jre.
+ *
+ * We want to actually check the paths rather than just the version string
+ * built into the executable, so that given version specification will yield
+ * the exact same Java environment, regardless of the version of the arbitrary
+ * launcher we start with.
+ */
+void
+ExecJRE(char *jre, char **argv) {
+ int len;
+ char *progname;
+ char path[MAXPATHLEN + 1];
+
+ /*
+ * Determine the executable we are building (or in the rare case, running).
+ */
+#ifdef JAVA_ARGS /* javac, jar and friends. */
+ progname = "java";
+#else /* java, oldjava, javaw and friends */
+#ifdef PROGNAME
+ progname = PROGNAME;
+#else
+ {
+ char *s;
+ progname = *argv;
+ if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) {
+ progname = s + 1;
+ }
+ }
+#endif /* PROGNAME */
+#endif /* JAVA_ARGS */
+
+ /*
+ * Resolve the real path to the currently running launcher.
+ */
+ len = GetModuleFileName(NULL, path, MAXPATHLEN + 1);
+ if (len == 0 || len > MAXPATHLEN) {
+ ReportSysErrorMessage2(
+ "Unable to resolve path to current %s executable: %s",
+ progname, JNI_TRUE);
+ exit(1);
+ }
+
+ if (_launcher_debug) {
+ printf("ExecJRE: old: %s\n", path);
+ printf("ExecJRE: new: %s\n", jre);
+ }
+
+ /*
+ * If the path to the selected JRE directory is a match to the initial
+ * portion of the path to the currently executing JRE, we have a winner!
+ * If so, just return. (strnicmp() is the Windows equiv. of strncasecmp().)
+ */
+ if (strnicmp(jre, path, strlen(jre)) == 0)
+ return; /* I am the droid you were looking for */
+
+ /*
+ * If this isn't the selected version, exec the selected version.
+ */
+ (void)strcat(strcat(strcpy(path, jre), "\\bin\\"), progname);
+ (void)strcat(path, ".exe");
+
+ /*
+ * Although Windows has an execv() entrypoint, it doesn't actually
+ * overlay a process: it can only create a new process and terminate
+ * the old process. Therefore, any processes waiting on the initial
+ * process wake up and they shouldn't. Hence, a chain of pseudo-zombie
+ * processes must be retained to maintain the proper wait semantics.
+ * Fortunately the image size of the launcher isn't too large at this
+ * time.
+ *
+ * If it weren't for this semantic flaw, the code below would be ...
+ *
+ * execv(path, argv);
+ * ReportErrorMessage2("Exec of %s failed\n", path, JNI_TRUE);
+ * exit(1);
+ *
+ * The incorrect exec semantics could be addressed by:
+ *
+ * exit((int)spawnv(_P_WAIT, path, argv));
+ *
+ * Unfortunately, a bug in Windows spawn/exec impementation prevents
+ * this from completely working. All the Windows POSIX process creation
+ * interfaces are implemented as wrappers around the native Windows
+ * function CreateProcess(). CreateProcess() takes a single string
+ * to specify command line options and arguments, so the POSIX routine
+ * wrappers build a single string from the argv[] array and in the
+ * process, any quoting information is lost.
+ *
+ * The solution to this to get the original command line, to process it
+ * to remove the new multiple JRE options (if any) as was done for argv
+ * in the common SelectVersion() routine and finally to pass it directly
+ * to the native CreateProcess() Windows process control interface.
+ */
+ {
+ char *cmdline;
+ char *p;
+ char *np;
+ char *ocl;
+ char *ccl;
+ char *unquoted;
+ DWORD exitCode;
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+
+ /*
+ * The following code block gets and processes the original command
+ * line, replacing the argv[0] equivalent in the command line with
+ * the path to the new executable and removing the appropriate
+ * Multiple JRE support options. Note that similar logic exists
+ * in the platform independent SelectVersion routine, but is
+ * replicated here due to the syntax of CreateProcess().
+ *
+ * The magic "+ 4" characters added to the command line length are
+ * 2 possible quotes around the path (argv[0]), a space after the
+ * path and a terminating null character.
+ */
+ ocl = GetCommandLine();
+ np = ccl = JLI_StringDup(ocl);
+ p = nextarg(&np); /* Discard argv[0] */
+ cmdline = (char *)JLI_MemAlloc(strlen(path) + strlen(np) + 4);
+ if (strchr(path, (int)' ') == NULL && strchr(path, (int)'\t') == NULL)
+ cmdline = strcpy(cmdline, path);
+ else
+ cmdline = strcat(strcat(strcpy(cmdline, "\""), path), "\"");
+
+ while (*np != (char)0) { /* While more command-line */
+ p = nextarg(&np);
+ if (*p != (char)0) { /* If a token was isolated */
+ unquoted = unquote(p);
+ if (*unquoted == '-') { /* Looks like an option */
+ if (strcmp(unquoted, "-classpath") == 0 ||
+ strcmp(unquoted, "-cp") == 0) { /* Unique cp syntax */
+ cmdline = strcat(strcat(cmdline, " "), p);
+ p = nextarg(&np);
+ if (*p != (char)0) /* If a token was isolated */
+ cmdline = strcat(strcat(cmdline, " "), p);
+ } else if (strncmp(unquoted, "-version:", 9) != 0 &&
+ strcmp(unquoted, "-jre-restrict-search") != 0 &&
+ strcmp(unquoted, "-no-jre-restrict-search") != 0) {
+ cmdline = strcat(strcat(cmdline, " "), p);
+ }
+ } else { /* End of options */
+ cmdline = strcat(strcat(cmdline, " "), p);
+ cmdline = strcat(strcat(cmdline, " "), np);
+ JLI_MemFree((void *)unquoted);
+ break;
+ }
+ JLI_MemFree((void *)unquoted);
+ }
+ }
+ JLI_MemFree((void *)ccl);
+
+ if (_launcher_debug) {
+ np = ccl = JLI_StringDup(cmdline);
+ p = nextarg(&np);
+ printf("ReExec Command: %s (%s)\n", path, p);
+ printf("ReExec Args: %s\n", np);
+ JLI_MemFree((void *)ccl);
+ }
+ (void)fflush(stdout);
+ (void)fflush(stderr);
+
+ /*
+ * The following code is modeled after a model presented in the
+ * Microsoft Technical Article "Moving Unix Applications to
+ * Windows NT" (March 6, 1994) and "Creating Processes" on MSDN
+ * (Februrary 2005). It approximates UNIX spawn semantics with
+ * the parent waiting for termination of the child.
+ */
+ memset(&si, 0, sizeof(si));
+ si.cb =sizeof(STARTUPINFO);
+ memset(&pi, 0, sizeof(pi));
+
+ if (!CreateProcess((LPCTSTR)path, /* executable name */
+ (LPTSTR)cmdline, /* command line */
+ (LPSECURITY_ATTRIBUTES)NULL, /* process security attr. */
+ (LPSECURITY_ATTRIBUTES)NULL, /* thread security attr. */
+ (BOOL)TRUE, /* inherits system handles */
+ (DWORD)0, /* creation flags */
+ (LPVOID)NULL, /* environment block */
+ (LPCTSTR)NULL, /* current directory */
+ (LPSTARTUPINFO)&si, /* (in) startup information */
+ (LPPROCESS_INFORMATION)&pi)) { /* (out) process information */
+ ReportSysErrorMessage2("CreateProcess(%s, ...) failed: %s",
+ path, JNI_TRUE);
+ exit(1);
+ }
+
+ if (WaitForSingleObject(pi.hProcess, INFINITE) != WAIT_FAILED) {
+ if (GetExitCodeProcess(pi.hProcess, &exitCode) == FALSE)
+ exitCode = 1;
+ } else {
+ ReportErrorMessage("WaitForSingleObject() failed.", JNI_TRUE);
+ exitCode = 1;
+ }
+
+ CloseHandle(pi.hThread);
+ CloseHandle(pi.hProcess);
+
+ exit(exitCode);
+ }
+
+}
+
+#endif /* ifndef GAMMA */
+
+
+/*
+ * Wrapper for platform dependent unsetenv function.
+ */
+int
+UnsetEnv(char *name)
+{
+ int ret;
+ char *buf = JLI_MemAlloc(strlen(name) + 2);
+ buf = strcat(strcpy(buf, name), "=");
+ ret = _putenv(buf);
+ JLI_MemFree(buf);
+ return (ret);
+}
+
+/* --- Splash Screen shared library support --- */
+
+static const char* SPLASHSCREEN_SO = "\\bin\\splashscreen.dll";
+
+static HMODULE hSplashLib = NULL;
+
+void* SplashProcAddress(const char* name) {
+ char libraryPath[MAXPATHLEN]; /* some extra space for strcat'ing SPLASHSCREEN_SO */
+
+ if (!GetJREPath(libraryPath, MAXPATHLEN)) {
+ return NULL;
+ }
+ if (strlen(libraryPath)+strlen(SPLASHSCREEN_SO) >= MAXPATHLEN) {
+ return NULL;
+ }
+ strcat(libraryPath, SPLASHSCREEN_SO);
+
+ if (!hSplashLib) {
+ hSplashLib = LoadLibrary(libraryPath);
+ }
+ if (hSplashLib) {
+ return GetProcAddress(hSplashLib, name);
+ } else {
+ return NULL;
+ }
+}
+
+void SplashFreeLibrary() {
+ if (hSplashLib) {
+ FreeLibrary(hSplashLib);
+ hSplashLib = NULL;
+ }
+}
+
+const char *
+jlong_format_specifier() {
+ return "%I64d";
+}
+
+/*
+ * Block current thread and continue execution in a new thread
+ */
+int
+ContinueInNewThread(int (JNICALL *continuation)(void *), jlong stack_size, void * args) {
+ int rslt = 0;
+ unsigned thread_id;
+
+#ifndef STACK_SIZE_PARAM_IS_A_RESERVATION
+#define STACK_SIZE_PARAM_IS_A_RESERVATION (0x10000)
+#endif
+
+ /*
+ * STACK_SIZE_PARAM_IS_A_RESERVATION is what we want, but it's not
+ * supported on older version of Windows. Try first with the flag; and
+ * if that fails try again without the flag. See MSDN document or HotSpot
+ * source (os_win32.cpp) for details.
+ */
+ HANDLE thread_handle =
+ (HANDLE)_beginthreadex(NULL,
+ (unsigned)stack_size,
+ continuation,
+ args,
+ STACK_SIZE_PARAM_IS_A_RESERVATION,
+ &thread_id);
+ if (thread_handle == NULL) {
+ thread_handle =
+ (HANDLE)_beginthreadex(NULL,
+ (unsigned)stack_size,
+ continuation,
+ args,
+ 0,
+ &thread_id);
+ }
+
+ /* AWT preloading (AFTER main thread start) */
+#ifdef ENABLE_AWT_PRELOAD
+ /* D3D preloading */
+ if (awtPreloadD3D != 0) {
+ char *envValue;
+ /* D3D routines checks env.var J2D_D3D if no appropriate
+ * command line params was specified
+ */
+ envValue = getenv("J2D_D3D");
+ if (envValue != NULL && stricmp(envValue, "false") == 0) {
+ awtPreloadD3D = 0;
+ }
+ /* Test that AWT preloading isn't disabled by J2D_D3D_PRELOAD env.var */
+ envValue = getenv("J2D_D3D_PRELOAD");
+ if (envValue != NULL && stricmp(envValue, "false") == 0) {
+ awtPreloadD3D = 0;
+ }
+ if (awtPreloadD3D < 0) {
+ /* If awtPreloadD3D is still undefined (-1), test
+ * if it is turned on by J2D_D3D_PRELOAD env.var.
+ * By default it's turned OFF.
+ */
+ awtPreloadD3D = 0;
+ if (envValue != NULL && stricmp(envValue, "true") == 0) {
+ awtPreloadD3D = 1;
+ }
+ }
+ }
+ if (awtPreloadD3D) {
+ AWTPreload(D3D_PRELOAD_FUNC);
+ }
+#endif /* ENABLE_AWT_PRELOAD */
+
+ if (thread_handle) {
+ WaitForSingleObject(thread_handle, INFINITE);
+ GetExitCodeThread(thread_handle, &rslt);
+ CloseHandle(thread_handle);
+ } else {
+ rslt = continuation(args);
+ }
+
+#ifdef ENABLE_AWT_PRELOAD
+ if (awtPreloaded) {
+ AWTPreloadStop();
+ }
+#endif /* ENABLE_AWT_PRELOAD */
+
+ return rslt;
+}
+
+/* Linux only, empty on windows. */
+void SetJavaLauncherPlatformProps() {}
+
+
+//==============================
+// AWT preloading
+#ifdef ENABLE_AWT_PRELOAD
+
+typedef int FnPreloadStart(void);
+typedef void FnPreloadStop(void);
+static FnPreloadStop *fnPreloadStop = NULL;
+static HMODULE hPreloadAwt = NULL;
+
+/*
+ * Starts AWT preloading
+ */
+int AWTPreload(const char *funcName)
+{
+ int result = -1;
+
+ // load AWT library once (if several preload function should be called)
+ if (hPreloadAwt == NULL) {
+ // awt.dll is not loaded yet
+ char libraryPath[MAXPATHLEN];
+ int jrePathLen = 0;
+ HMODULE hJava = NULL;
+ HMODULE hVerify = NULL;
+
+ while (1) {
+ // awt.dll depends on jvm.dll & java.dll;
+ // jvm.dll is already loaded, so we need only java.dll;
+ // java.dll depends on MSVCRT lib & verify.dll.
+ if (!GetJREPath(libraryPath, MAXPATHLEN)) {
+ break;
+ }
+
+ // save path length
+ jrePathLen = strlen(libraryPath);
+
+ // load msvcrt 1st
+ LoadMSVCRT();
+
+ // load verify.dll
+ strcat(libraryPath, "\\bin\\verify.dll");
+ hVerify = LoadLibrary(libraryPath);
+ if (hVerify == NULL) {
+ break;
+ }
+
+ // restore jrePath
+ libraryPath[jrePathLen] = 0;
+ // load java.dll
+ strcat(libraryPath, "\\bin\\" JAVA_DLL);
+ hJava = LoadLibrary(libraryPath);
+ if (hJava == NULL) {
+ break;
+ }
+
+ // restore jrePath
+ libraryPath[jrePathLen] = 0;
+ // load awt.dll
+ strcat(libraryPath, "\\bin\\awt.dll");
+ hPreloadAwt = LoadLibrary(libraryPath);
+ if (hPreloadAwt == NULL) {
+ break;
+ }
+
+ // get "preloadStop" func ptr
+ fnPreloadStop = (FnPreloadStop *)GetProcAddress(hPreloadAwt, "preloadStop");
+
+ break;
+ }
+ }
+
+ if (hPreloadAwt != NULL) {
+ FnPreloadStart *fnInit = (FnPreloadStart *)GetProcAddress(hPreloadAwt, funcName);
+ if (fnInit != NULL) {
+ // don't forget to stop preloading
+ awtPreloaded = 1;
+
+ result = fnInit();
+ }
+ }
+
+ return result;
+}
+
+/*
+ * Terminates AWT preloading
+ */
+void AWTPreloadStop() {
+ if (fnPreloadStop != NULL) {
+ fnPreloadStop();
+ }
+}
+
+#endif /* ENABLE_AWT_PRELOAD */
diff --git a/hotspot/src/os/linux/launcher/java_md.h b/hotspot/src/os/windows/launcher/java_md.h
similarity index 66%
rename from hotspot/src/os/linux/launcher/java_md.h
rename to hotspot/src/os/windows/launcher/java_md.h
index 237a6526839..111be1ee13a 100644
--- a/hotspot/src/os/linux/launcher/java_md.h
+++ b/hotspot/src/os/windows/launcher/java_md.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,28 +22,31 @@
*
*/
-/*
- * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
- * search "GAMMA" for gamma specific changes.
- */
-
#ifndef JAVA_MD_H
#define JAVA_MD_H
-#include
-#include
-#include
+#include
+#include
+#include
#ifndef GAMMA
#include "manifest_info.h"
#endif
+#include "jli_util.h"
-#define PATH_SEPARATOR ':'
-#define FILESEP "/"
-#define FILE_SEPARATOR '/'
-#ifndef MAXNAMELEN
-#define MAXNAMELEN PATH_MAX
+#ifdef GAMMA
+#define stricmp _stricmp
+#define strnicmp _strnicmp
+#define snprintf _snprintf
+#define strdup _strdup
#endif
+#define PATH_SEPARATOR ';'
+#define FILESEP "\\"
+#define FILE_SEPARATOR '\\'
+#define IS_FILE_SEPARATOR(c) ((c) == '\\' || (c) == '/')
+#define MAXPATHLEN MAX_PATH
+#define MAXNAMELEN MAX_PATH
+
#ifdef JAVA_ARGS
/*
* ApplicationHome is prepended to each of these entries; the resulting
@@ -51,27 +54,26 @@
* value of -cp option to the launcher.
*/
#ifndef APP_CLASSPATH
-#define APP_CLASSPATH { "/lib/tools.jar", "/classes" }
+#define APP_CLASSPATH { "\\lib\\tools.jar", "\\classes" }
#endif
#endif
-#ifdef HAVE_GETHRTIME
/*
* Support for doing cheap, accurate interval timing.
*/
-#include
-#define CounterGet() (gethrtime()/1000)
-#define Counter2Micros(counts) (counts)
-#else
-#define CounterGet() (0)
-#define Counter2Micros(counts) (1)
-#endif /* HAVE_GETHRTIME */
+extern jlong CounterGet(void);
+extern jlong Counter2Micros(jlong counts);
+
+#ifdef JAVAW
+#define main _main
+extern int _main(int argc, char **argv);
+#endif
/*
* Function prototypes.
*/
#ifndef GAMMA
-char *LocateJRE(manifest_info* info);
+char *LocateJRE(manifest_info *info);
void ExecJRE(char *jre, char **argv);
#endif
int UnsetEnv(char *name);
diff --git a/hotspot/src/os/windows/vm/attachListener_windows.cpp b/hotspot/src/os/windows/vm/attachListener_windows.cpp
index 28295f9a74e..1d5857f1c2f 100644
--- a/hotspot/src/os/windows/vm/attachListener_windows.cpp
+++ b/hotspot/src/os/windows/vm/attachListener_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,11 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_attachListener_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/os.hpp"
+#include "services/attachListener.hpp"
+#include "services/dtraceAttacher.hpp"
#include
#include // SIGBREAK
diff --git a/hotspot/src/os/windows/vm/c1_globals_windows.hpp b/hotspot/src/os/windows/vm/c1_globals_windows.hpp
index 301d169c178..41789768d3d 100644
--- a/hotspot/src/os/windows/vm/c1_globals_windows.hpp
+++ b/hotspot/src/os/windows/vm/c1_globals_windows.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,15 @@
*
*/
+#ifndef OS_WINDOWS_VM_C1_GLOBALS_WINDOWS_HPP
+#define OS_WINDOWS_VM_C1_GLOBALS_WINDOWS_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_WINDOWS_VM_C1_GLOBALS_WINDOWS_HPP
diff --git a/hotspot/src/os/windows/vm/c2_globals_windows.hpp b/hotspot/src/os/windows/vm/c2_globals_windows.hpp
index b14af55c55c..a79fbdc7bda 100644
--- a/hotspot/src/os/windows/vm/c2_globals_windows.hpp
+++ b/hotspot/src/os/windows/vm/c2_globals_windows.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,15 @@
*
*/
+#ifndef OS_WINDOWS_VM_C2_GLOBALS_WINDOWS_HPP
+#define OS_WINDOWS_VM_C2_GLOBALS_WINDOWS_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
//
// Sets the default values for operating system dependent flags used by the
// server compiler. (see c2_globals.hpp)
//
+
+#endif // OS_WINDOWS_VM_C2_GLOBALS_WINDOWS_HPP
diff --git a/hotspot/src/os/windows/vm/chaitin_windows.cpp b/hotspot/src/os/windows/vm/chaitin_windows.cpp
index a459b992e17..bae10b3b5c4 100644
--- a/hotspot/src/os/windows/vm/chaitin_windows.cpp
+++ b/hotspot/src/os/windows/vm/chaitin_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_chaitin_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "opto/chaitin.hpp"
+#include "opto/machnode.hpp"
// Disallow the use of the frame pointer (EBP) for implicit null exceptions
// on win95/98. If we do not do this, the OS gets confused and gives a stack
diff --git a/hotspot/src/os/windows/vm/decoder_windows.cpp b/hotspot/src/os/windows/vm/decoder_windows.cpp
new file mode 100644
index 00000000000..c4eaf35c69a
--- /dev/null
+++ b/hotspot/src/os/windows/vm/decoder_windows.cpp
@@ -0,0 +1,123 @@
+/*
+ * 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.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "prims/jvm.h"
+#include "utilities/decoder.hpp"
+
+HMODULE Decoder::_dbghelp_handle = NULL;
+bool Decoder::_can_decode_in_vm = false;
+pfn_SymGetSymFromAddr64 Decoder::_pfnSymGetSymFromAddr64 = NULL;
+pfn_UndecorateSymbolName Decoder::_pfnUndecorateSymbolName = NULL;
+
+void Decoder::initialize() {
+ if (!_initialized) {
+ _initialized = true;
+
+ HMODULE handle = ::LoadLibrary("dbghelp.dll");
+ if (!handle) {
+ _decoder_status = helper_not_found;
+ return;
+ }
+
+ _dbghelp_handle = handle;
+
+ pfn_SymSetOptions _pfnSymSetOptions = (pfn_SymSetOptions)::GetProcAddress(handle, "SymSetOptions");
+ pfn_SymInitialize _pfnSymInitialize = (pfn_SymInitialize)::GetProcAddress(handle, "SymInitialize");
+ _pfnSymGetSymFromAddr64 = (pfn_SymGetSymFromAddr64)::GetProcAddress(handle, "SymGetSymFromAddr64");
+ _pfnUndecorateSymbolName = (pfn_UndecorateSymbolName)GetProcAddress(handle, "UnDecorateSymbolName");
+
+ if (_pfnSymSetOptions == NULL || _pfnSymInitialize == NULL || _pfnSymGetSymFromAddr64 == NULL) {
+ _pfnSymGetSymFromAddr64 = NULL;
+ _pfnUndecorateSymbolName = NULL;
+ ::FreeLibrary(handle);
+ _dbghelp_handle = NULL;
+ _decoder_status = helper_func_error;
+ return;
+ }
+
+ _pfnSymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS);
+ if (!_pfnSymInitialize(GetCurrentProcess(), NULL, TRUE)) {
+ _pfnSymGetSymFromAddr64 = NULL;
+ _pfnUndecorateSymbolName = NULL;
+ ::FreeLibrary(handle);
+ _dbghelp_handle = NULL;
+ _decoder_status = helper_init_error;
+ return;
+ }
+
+ // find out if jvm.dll contains private symbols, by decoding
+ // current function and comparing the result
+ address addr = (address)Decoder::initialize;
+ char buf[MAX_PATH];
+ if (decode(addr, buf, sizeof(buf), NULL) == no_error) {
+ _can_decode_in_vm = !strcmp(buf, "Decoder::initialize");
+ }
+ }
+}
+
+void Decoder::uninitialize() {
+ assert(_initialized, "Decoder not yet initialized");
+ _pfnSymGetSymFromAddr64 = NULL;
+ _pfnUndecorateSymbolName = NULL;
+ if (_dbghelp_handle != NULL) {
+ ::FreeLibrary(_dbghelp_handle);
+ }
+ _initialized = false;
+}
+
+bool Decoder::can_decode_C_frame_in_vm() {
+ initialize();
+ return _can_decode_in_vm;
+}
+
+
+Decoder::decoder_status Decoder::decode(address addr, char *buf, int buflen, int *offset) {
+ assert(_initialized, "Decoder not yet initialized");
+ if (_pfnSymGetSymFromAddr64 != NULL) {
+ PIMAGEHLP_SYMBOL64 pSymbol;
+ char symbolInfo[MAX_PATH + sizeof(IMAGEHLP_SYMBOL64)];
+ pSymbol = (PIMAGEHLP_SYMBOL64)symbolInfo;
+ pSymbol->MaxNameLength = MAX_PATH;
+ pSymbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64);
+ DWORD64 displacement;
+ if (_pfnSymGetSymFromAddr64(::GetCurrentProcess(), (DWORD64)addr, &displacement, pSymbol)) {
+ if (buf != NULL) {
+ if (!demangle(pSymbol->Name, buf, buflen)) {
+ jio_snprintf(buf, buflen, "%s", pSymbol->Name);
+ }
+ }
+ if (offset != NULL) *offset = (int)displacement;
+ return no_error;
+ }
+ }
+ return helper_not_found;
+}
+
+bool Decoder::demangle(const char* symbol, char *buf, int buflen) {
+ assert(_initialized, "Decoder not yet initialized");
+ return _pfnUndecorateSymbolName != NULL &&
+ _pfnUndecorateSymbolName(symbol, buf, buflen, UNDNAME_COMPLETE);
+}
+
diff --git a/hotspot/src/os/windows/vm/dtraceJSDT_windows.cpp b/hotspot/src/os/windows/vm/dtraceJSDT_windows.cpp
index aad6296c72d..0f340fb5730 100644
--- a/hotspot/src/os/windows/vm/dtraceJSDT_windows.cpp
+++ b/hotspot/src/os/windows/vm/dtraceJSDT_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,8 +22,16 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_dtraceJSDT_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "code/codeBlob.hpp"
+#include "memory/allocation.hpp"
+#include "prims/jvm.h"
+#include "runtime/dtraceJSDT.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/os.hpp"
+#include "runtime/signature.hpp"
+#include "utilities/globalDefinitions.hpp"
int DTraceJSDT::pd_activate(
void* baseAddress, jstring module,
diff --git a/hotspot/src/os/windows/vm/globals_windows.hpp b/hotspot/src/os/windows/vm/globals_windows.hpp
index 52f7d602b01..1860375c03e 100644
--- a/hotspot/src/os/windows/vm/globals_windows.hpp
+++ b/hotspot/src/os/windows/vm/globals_windows.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_WINDOWS_VM_GLOBALS_WINDOWS_HPP
+#define OS_WINDOWS_VM_GLOBALS_WINDOWS_HPP
+
//
// Defines Windows specific flags. They are not available on other platforms.
//
@@ -40,3 +43,5 @@ define_pd_global(bool, UseLargePages, false);
define_pd_global(bool, UseLargePagesIndividualAllocation, true);
define_pd_global(bool, UseOSErrorReporting, false); // for now.
define_pd_global(bool, UseThreadPriorities, true) ;
+
+#endif // OS_WINDOWS_VM_GLOBALS_WINDOWS_HPP
diff --git a/hotspot/src/os/windows/vm/hpi_windows.cpp b/hotspot/src/os/windows/vm/hpi_windows.cpp
deleted file mode 100644
index 2e78fc27148..00000000000
--- a/hotspot/src/os/windows/vm/hpi_windows.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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 "incls/_precompiled.incl"
-# include "incls/_hpi_windows.cpp.incl"
-
-typedef jint (JNICALL *init_t)(GetInterfaceFunc *, void *);
-
-void hpi::initialize_get_interface(vm_calls_t *callbacks)
-{
- // Build name of HPI.
- char lib_name[JVM_MAXPATHLEN];
-
- if (HPILibPath && HPILibPath[0]) {
- strncpy(lib_name, HPILibPath, JVM_MAXPATHLEN - 1);
- lib_name[JVM_MAXPATHLEN - 1] = '\0';
- } else {
- os::jvm_path(lib_name, sizeof lib_name);
-
-#ifdef PRODUCT
- const char *hpi_lib = "\\hpi.dll";
-#else
- char *ptr = strrchr(lib_name, '\\');
- // On Win98 GetModuleFileName() returns the path in the upper case.
- assert(_strnicmp(ptr, "\\jvm",4) == 0, "invalid library name");
- const char *hpi_lib = (_strnicmp(ptr, "\\jvm_g",6) == 0) ? "\\hpi_g.dll" : "\\hpi.dll";
-#endif
-
- *(::strrchr(lib_name, '\\')) = '\0'; /* get rid of "\\jvm.dll" */
- char *p = ::strrchr(lib_name, '\\');
- if (p != NULL) *p = '\0'; /* get rid of "\\hotspot" */
- strcat(lib_name, hpi_lib);
- }
-
- // Load it.
- if (TraceHPI) tty->print_cr("Loading HPI %s ", lib_name);
- HINSTANCE lib_handle = LoadLibrary(lib_name);
- if (lib_handle == NULL) {
- if (TraceHPI) tty->print_cr("LoadLibrary failed, code = %d", GetLastError());
- return;
- }
-
- // Find hpi initializer.
- init_t initer = (init_t)GetProcAddress(lib_handle, "DLL_Initialize");
- if (initer == NULL) {
- if (TraceHPI) tty->print_cr("GetProcAddress failed, errcode = %d", GetLastError());
- return;
- }
-
- // Call initializer.
- jint init_result = (*initer)(&_get_interface, callbacks);
- if (init_result < 0) {
- if (TraceHPI) tty->print_cr("DLL_Initialize failed, returned %ld", init_result);
- return;
- }
-
- if (TraceHPI) tty->print_cr("success");
- return;
-}
diff --git a/hotspot/src/os/windows/vm/hpi_windows.hpp b/hotspot/src/os/windows/vm/hpi_windows.hpp
deleted file mode 100644
index 3d94b4e553f..00000000000
--- a/hotspot/src/os/windows/vm/hpi_windows.hpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 1998, 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.
- *
- */
-
-// Win32 delegates these to the HPI. Solaris provides its own
-// implementation without using the HPI (for Interrupitble I/O).
-
-// HPI_FileInterface
-
-HPIDECL(close, "close", _file, Close, int, "%d",
- (int fd),
- ("fd = %d", fd),
- (fd));
-
-HPIDECL(read, "read", _file, Read, size_t, "%ld",
- (int fd, void *buf, unsigned int nBytes),
- ("fd = %d, buf = %p, nBytes = %u", fd, buf, nBytes),
- (fd, buf, nBytes));
-
-HPIDECL(write, "write", _file, Write, size_t, "%ld",
- (int fd, const void *buf, unsigned int nBytes),
- ("fd = %d, buf = %p, nBytes = %u", fd, buf, nBytes),
- (fd, buf, nBytes));
-
-
-// HPI_SocketInterface
-
-HPIDECL(socket_close, "socket_close", _socket, Close, int, "%d",
- (int fd),
- ("fd = %d", fd),
- (fd));
-
-HPIDECL(socket_available, "socket_available", _socket, Available,
- int, "%d",
- (int fd, jint *pbytes),
- ("fd = %d, pbytes = %p", fd, pbytes),
- (fd, pbytes));
-
-HPIDECL(socket, "socket", _socket, Socket, int, "%d",
- (int domain, int type, int protocol),
- ("domain = %d, type = %d, protocol = %d", domain, type, protocol),
- (domain, type, protocol));
-
-HPIDECL(listen, "listen", _socket, Listen, int, "%d",
- (int fd, int count),
- ("fd = %d, count = %d", fd, count),
- (fd, count));
-
-HPIDECL(connect, "connect", _socket, Connect, int, "%d",
- (int fd, struct sockaddr *him, int len),
- ("fd = %d, him = %p, len = %d", fd, him, len),
- (fd, him, len));
-
-HPIDECL(accept, "accept", _socket, Accept, int, "%d",
- (int fd, struct sockaddr *him, int *len),
- ("fd = %d, him = %p, len = %p", fd, him, len),
- (fd, him, len));
-
-HPIDECL(sendto, "sendto", _socket, SendTo, int, "%d",
- (int fd, char *buf, int len, int flags,
- struct sockaddr *to, int tolen),
- ("fd = %d, buf = %p, len = %d, flags = %d, to = %p, tolen = %d",
- fd, buf, len, flags, to, tolen),
- (fd, buf, len, flags, to, tolen));
-
-HPIDECL(recvfrom, "recvfrom", _socket, RecvFrom, int, "%d",
- (int fd, char *buf, int nbytes, int flags,
- struct sockaddr *from, int *fromlen),
- ("fd = %d, buf = %p, len = %d, flags = %d, frm = %p, frmlen = %d",
- fd, buf, nbytes, flags, from, fromlen),
- (fd, buf, nbytes, flags, from, fromlen));
-
-HPIDECL(recv, "recv", _socket, Recv, int, "%d",
- (int fd, char *buf, int nBytes, int flags),
- ("fd = %d, buf = %p, nBytes = %d, flags = %d",
- fd, buf, nBytes, flags),
- (fd, buf, nBytes, flags));
-
-HPIDECL(send, "send", _socket, Send, int, "%d",
- (int fd, char *buf, int nBytes, int flags),
- ("fd = %d, buf = %p, nBytes = %d, flags = %d",
- fd, buf, nBytes, flags),
- (fd, buf, nBytes, flags));
-
-inline int hpi::raw_send(int fd, char *buf, int nBytes, int flags) {
- return send(fd, buf, nBytes, flags);
-}
-
-HPIDECL(timeout, "timeout", _socket, Timeout, int, "%d",
- (int fd, long timeout),
- ("fd = %d, timeout = %ld", fd, timeout),
- (fd, timeout));
-
-HPIDECL(get_host_by_name, "get_host_by_name", _socket, GetHostByName,
- struct hostent *, "(struct hostent *)%p",
- (char *name),
- ("%s", name),
- (name));
-
-HPIDECL(socket_shutdown, "socket_shutdown", _socket, SocketShutdown,
- int, "%d",
- (int fd, int howto),
- ("fd = %d, howto = %d", fd, howto),
- (fd, howto));
-
-HPIDECL(bind, "bind", _socket, Bind,
- int, "%d",
- (int fd, struct sockaddr *him, int len),
- ("fd = %d, him = %p, len = %d",
- fd, him, len),
- (fd, him, len));
-
-HPIDECL(get_sock_name, "get_sock_name", _socket, GetSocketName,
- int, "%d",
- (int fd, struct sockaddr *him, int *len),
- ("fd = %d, him = %p, len = %p",
- fd, him, len),
- (fd, him, len));
-
-HPIDECL(get_host_name, "get_host_name", _socket, GetHostName, int, "%d",
- (char *hostname, int namelen),
- ("hostname = %p, namelen = %d",
- hostname, namelen),
- (hostname, namelen));
-
-HPIDECL(get_host_by_addr, "get_host_by_addr", _socket, GetHostByAddr,
- struct hostent *, "(struct hostent *)%p",
- (const char* name, int len, int type),
- ("name = %p, len = %d, type = %d",
- name, len, type),
- (name, len, type));
-
-HPIDECL(get_sock_opt, "get_sock_opt", _socket, SocketGetOption, int, "%d",
- (int fd, int level, int optname, char *optval, int* optlen),
- ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %p",
- fd, level, optname, optval, optlen),
- (fd, level, optname, optval, optlen));
-
-HPIDECL(set_sock_opt, "set_sock_opt", _socket, SocketSetOption, int, "%d",
- (int fd, int level, int optname, const char *optval, int optlen),
- ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %d",
- fd, level, optname, optval, optlen),
- (fd, level, optname, optval, optlen));
-
-HPIDECL(get_proto_by_name, "get_proto_by_name", _socket, GetProtoByName,
- struct protoent *, "(struct protoent *)%p",
- (char* name),
- ("name = %p",
- name),
- (name));
diff --git a/hotspot/src/os/windows/vm/interfaceSupport_windows.hpp b/hotspot/src/os/windows/vm/interfaceSupport_windows.hpp
index 3e5a6bfc1d1..96236542972 100644
--- a/hotspot/src/os/windows/vm/interfaceSupport_windows.hpp
+++ b/hotspot/src/os/windows/vm/interfaceSupport_windows.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_WINDOWS_VM_INTERFACESUPPORT_WINDOWS_HPP
+#define OS_WINDOWS_VM_INTERFACESUPPORT_WINDOWS_HPP
+
// Contains inlined functions for class InterfaceSupport
static inline void serialize_memory(JavaThread *thread) {
@@ -39,3 +42,5 @@ static inline void serialize_memory(JavaThread *thread) {
serialize_fault_filter((_EXCEPTION_POINTERS*)_exception_info()))
{}
}
+
+#endif // OS_WINDOWS_VM_INTERFACESUPPORT_WINDOWS_HPP
diff --git a/hotspot/src/os/windows/vm/jvm_windows.cpp b/hotspot/src/os/windows/vm/jvm_windows.cpp
index d0d171b2327..d6a299a239c 100644
--- a/hotspot/src/os/windows/vm/jvm_windows.cpp
+++ b/hotspot/src/os/windows/vm/jvm_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,8 +22,10 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_jvm_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "prims/jvm.h"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/osThread.hpp"
#include
diff --git a/hotspot/src/os/windows/vm/jvm_windows.h b/hotspot/src/os/windows/vm/jvm_windows.h
index 47999961b84..6cb292ba974 100644
--- a/hotspot/src/os/windows/vm/jvm_windows.h
+++ b/hotspot/src/os/windows/vm/jvm_windows.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
diff --git a/hotspot/src/os/windows/vm/mutex_windows.cpp b/hotspot/src/os/windows/vm/mutex_windows.cpp
index 7ba6b0aba7c..66f018dd4a9 100644
--- a/hotspot/src/os/windows/vm/mutex_windows.cpp
+++ b/hotspot/src/os/windows/vm/mutex_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,8 +22,12 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_mutex_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "mutex_windows.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/mutex.hpp"
+#include "thread_windows.inline.hpp"
+#include "utilities/events.hpp"
// put OS-includes here
# include
diff --git a/hotspot/src/os/windows/vm/mutex_windows.inline.hpp b/hotspot/src/os/windows/vm/mutex_windows.inline.hpp
index b9c7bfabc31..ddc082279fb 100644
--- a/hotspot/src/os/windows/vm/mutex_windows.inline.hpp
+++ b/hotspot/src/os/windows/vm/mutex_windows.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -21,3 +21,12 @@
* questions.
*
*/
+
+#ifndef OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP
+#define OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP
+
+#include "os_windows.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "thread_windows.inline.hpp"
+
+#endif // OS_WINDOWS_VM_MUTEX_WINDOWS_INLINE_HPP
diff --git a/hotspot/src/os/windows/vm/osThread_windows.cpp b/hotspot/src/os/windows/vm/osThread_windows.cpp
index 7aaffc1b272..005643aa67a 100644
--- a/hotspot/src/os/windows/vm/osThread_windows.cpp
+++ b/hotspot/src/os/windows/vm/osThread_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,17 @@
*
*/
-#include "incls/_osThread_windows.cpp.incl"
+// no precompiled headers
+#include "runtime/atomic.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/os.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/safepoint.hpp"
+#include "runtime/vmThread.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+#endif
void OSThread::pd_initialize() {
set_thread_handle(NULL);
diff --git a/hotspot/src/os/windows/vm/osThread_windows.hpp b/hotspot/src/os/windows/vm/osThread_windows.hpp
index 37cdfaba147..1df8925c7a7 100644
--- a/hotspot/src/os/windows/vm/osThread_windows.hpp
+++ b/hotspot/src/os/windows/vm/osThread_windows.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP
+#define OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP
+
typedef void* HANDLE;
private:
@@ -64,3 +67,5 @@ typedef void* HANDLE;
private:
void pd_initialize();
void pd_destroy();
+
+#endif // OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP
diff --git a/hotspot/src/os/windows/vm/os_share_windows.hpp b/hotspot/src/os/windows/vm/os_share_windows.hpp
index e157ace8e6c..447fc9438c4 100644
--- a/hotspot/src/os/windows/vm/os_share_windows.hpp
+++ b/hotspot/src/os/windows/vm/os_share_windows.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,4 +22,9 @@
*
*/
+#ifndef OS_WINDOWS_VM_OS_SHARE_WINDOWS_HPP
+#define OS_WINDOWS_VM_OS_SHARE_WINDOWS_HPP
+
// Defines the interfaces to Windows operating system that vary across platforms
+
+#endif // OS_WINDOWS_VM_OS_SHARE_WINDOWS_HPP
diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp
index d0837200194..496a7ec80de 100644
--- a/hotspot/src/os/windows/vm/os_windows.cpp
+++ b/hotspot/src/os/windows/vm/os_windows.cpp
@@ -27,8 +27,56 @@
#define _WIN32_WINNT 0x500
#endif
-// do not include precompiled header file
-# include "incls/_os_windows.cpp.incl"
+// no precompiled headers
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "compiler/compileBroker.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_windows.h"
+#include "memory/allocation.inline.hpp"
+#include "memory/filemap.hpp"
+#include "mutex_windows.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "os_share_windows.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/globals.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/objectMonitor.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/perfMemory.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/statSampler.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/threadCritical.hpp"
+#include "runtime/timer.hpp"
+#include "services/attachListener.hpp"
+#include "services/runtimeService.hpp"
+#include "thread_windows.inline.hpp"
+#include "utilities/decoder.hpp"
+#include "utilities/defaultStream.hpp"
+#include "utilities/events.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/vmError.hpp"
+#ifdef TARGET_ARCH_x86
+# include "assembler_x86.inline.hpp"
+# include "nativeInst_x86.hpp"
+#endif
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
#ifdef _DEBUG
#include
@@ -996,8 +1044,6 @@ os::closedir(DIR *dirp)
return 0;
}
-const char* os::dll_file_extension() { return ".dll"; }
-
const char* os::get_temp_directory() {
const char *prop = Arguments::get_property("java.io.tmpdir");
if (prop != 0) return prop;
@@ -1019,7 +1065,6 @@ static bool file_exists(const char* filename) {
void os::dll_build_name(char *buffer, size_t buflen,
const char* pname, const char* fname) {
- // Copied from libhpi
const size_t pnamelen = pname ? strlen(pname) : 0;
const char c = (pnamelen > 0) ? pname[pnamelen-1] : 0;
@@ -1321,19 +1366,14 @@ bool os::dll_address_to_library_name(address addr, char* buf,
bool os::dll_address_to_function_name(address addr, char *buf,
int buflen, int *offset) {
- // Unimplemented on Windows - in order to use SymGetSymFromAddr(),
- // we need to initialize imagehlp/dbghelp, then load symbol table
- // for every module. That's too much work to do after a fatal error.
- // For an example on how to implement this function, see 1.4.2.
- if (offset) *offset = -1;
- if (buf) buf[0] = '\0';
+ if (Decoder::decode(addr, buf, buflen, offset) == Decoder::no_error) {
+ return true;
+ }
+ if (offset != NULL) *offset = -1;
+ if (buf != NULL) buf[0] = '\0';
return false;
}
-void* os::dll_lookup(void* handle, const char* name) {
- return GetProcAddress((HMODULE)handle, name);
-}
-
// save the start and end address of jvm.dll into param[0] and param[1]
static int _locate_jvm_dll(int pid, char* mod_fname, address base_addr,
unsigned size, void * param) {
@@ -1668,7 +1708,34 @@ void os::jvm_path(char *buf, jint buflen) {
return;
}
+ buf[0] = '\0';
+ if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) {
+ // Support for the gamma launcher. Check for an
+ // JAVA_HOME environment variable
+ // and fix up the path so it looks like
+ // libjvm.so is installed there (append a fake suffix
+ // hotspot/libjvm.so).
+ char* java_home_var = ::getenv("JAVA_HOME");
+ if (java_home_var != NULL && java_home_var[0] != 0) {
+
+ strncpy(buf, java_home_var, buflen);
+
+ // determine if this is a legacy image or modules image
+ // modules image doesn't have "jre" subdirectory
+ size_t len = strlen(buf);
+ char* jrebin_p = buf + len;
+ jio_snprintf(jrebin_p, buflen-len, "\\jre\\bin\\");
+ if (0 != _access(buf, 0)) {
+ jio_snprintf(jrebin_p, buflen-len, "\\bin\\");
+ }
+ len = strlen(buf);
+ jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll");
+ }
+ }
+
+ if(buf[0] == '\0') {
GetModuleFileName(vm_lib_handle, buf, buflen);
+ }
strcpy(saved_jvm_path, buf);
}
@@ -1686,6 +1753,44 @@ void os::print_jni_name_suffix_on(outputStream* st, int args_size) {
#endif
}
+// This method is a copy of JDK's sysGetLastErrorString
+// from src/windows/hpi/src/system_md.c
+
+size_t os::lasterror(char *buf, size_t len) {
+ long errval;
+
+ if ((errval = GetLastError()) != 0) {
+ /* DOS error */
+ int n = (int)FormatMessage(
+ FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ errval,
+ 0,
+ buf,
+ (DWORD)len,
+ NULL);
+ if (n > 3) {
+ /* Drop final '.', CR, LF */
+ if (buf[n - 1] == '\n') n--;
+ if (buf[n - 1] == '\r') n--;
+ if (buf[n - 1] == '.') n--;
+ buf[n] = '\0';
+ }
+ return n;
+ }
+
+ if (errno != 0) {
+ /* C runtime error that has no corresponding DOS error code */
+ const char *s = strerror(errno);
+ size_t n = strlen(s);
+ if (n >= len) n = len - 1;
+ strncpy(buf, s, n);
+ buf[n] = '\0';
+ return n;
+ }
+ return 0;
+}
+
// sun.misc.Signal
// NOTE that this is a workaround for an apparent kernel bug where if
// a signal handler for SIGBREAK is installed then that signal handler
@@ -2893,10 +2998,6 @@ void os::pd_start_thread(Thread* thread) {
assert(ret != SYS_THREAD_ERROR, "StartThread failed"); // should propagate back
}
-size_t os::read(int fd, void *buf, unsigned int nBytes) {
- return ::read(fd, buf, nBytes);
-}
-
class HighResolutionInterval {
// The default timer resolution seems to be 10 milliseconds.
// (Where is this written down?)
@@ -3375,10 +3476,6 @@ jint os::init_2(void) {
#endif
}
- // Initialize HPI.
- jint hpi_result = hpi::initialize();
- if (hpi_result != JNI_OK) { return hpi_result; }
-
// If stack_commit_size is 0, windows will reserve the default size,
// but only commit a small portion of it.
size_t stack_commit_size = round_to(ThreadStackSize*K, os::vm_page_size());
@@ -3483,7 +3580,7 @@ int os::stat(const char *path, struct stat *sbuf) {
errno = ENAMETOOLONG;
return -1;
}
- hpi::native_path(strcpy(pathbuf, path));
+ os::native_path(strcpy(pathbuf, path));
int ret = ::stat(pathbuf, sbuf);
if (sbuf != NULL && UseUTCFileTimestamp) {
// Fix for 6539723. st_mtime returned from stat() is dependent on
@@ -3627,6 +3724,20 @@ bool os::dont_yield() {
return DontYieldALot;
}
+// This method is a slightly reworked copy of JDK's sysOpen
+// from src/windows/hpi/src/sys_api_md.c
+
+int os::open(const char *path, int oflag, int mode) {
+ char pathbuf[MAX_PATH];
+
+ if (strlen(path) > MAX_PATH - 1) {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+ os::native_path(strcpy(pathbuf, path));
+ return ::open(pathbuf, oflag | O_BINARY | O_NOINHERIT, mode);
+}
+
// Is a (classpath) directory empty?
bool os::dir_is_empty(const char* path) {
WIN32_FIND_DATA fd;
@@ -3658,6 +3769,297 @@ jlong os::seek_to_file_offset(int fd, jlong offset) {
}
+jlong os::lseek(int fd, jlong offset, int whence) {
+ return (jlong) ::_lseeki64(fd, offset, whence);
+}
+
+// This method is a slightly reworked copy of JDK's sysNativePath
+// from src/windows/hpi/src/path_md.c
+
+/* Convert a pathname to native format. On win32, this involves forcing all
+ separators to be '\\' rather than '/' (both are legal inputs, but Win95
+ sometimes rejects '/') and removing redundant separators. The input path is
+ assumed to have been converted into the character encoding used by the local
+ system. Because this might be a double-byte encoding, care is taken to
+ treat double-byte lead characters correctly.
+
+ This procedure modifies the given path in place, as the result is never
+ longer than the original. There is no error return; this operation always
+ succeeds. */
+char * os::native_path(char *path) {
+ char *src = path, *dst = path, *end = path;
+ char *colon = NULL; /* If a drive specifier is found, this will
+ point to the colon following the drive
+ letter */
+
+ /* Assumption: '/', '\\', ':', and drive letters are never lead bytes */
+ assert(((!::IsDBCSLeadByte('/'))
+ && (!::IsDBCSLeadByte('\\'))
+ && (!::IsDBCSLeadByte(':'))),
+ "Illegal lead byte");
+
+ /* Check for leading separators */
+#define isfilesep(c) ((c) == '/' || (c) == '\\')
+ while (isfilesep(*src)) {
+ src++;
+ }
+
+ if (::isalpha(*src) && !::IsDBCSLeadByte(*src) && src[1] == ':') {
+ /* Remove leading separators if followed by drive specifier. This
+ hack is necessary to support file URLs containing drive
+ specifiers (e.g., "file://c:/path"). As a side effect,
+ "/c:/path" can be used as an alternative to "c:/path". */
+ *dst++ = *src++;
+ colon = dst;
+ *dst++ = ':';
+ src++;
+ } else {
+ src = path;
+ if (isfilesep(src[0]) && isfilesep(src[1])) {
+ /* UNC pathname: Retain first separator; leave src pointed at
+ second separator so that further separators will be collapsed
+ into the second separator. The result will be a pathname
+ beginning with "\\\\" followed (most likely) by a host name. */
+ src = dst = path + 1;
+ path[0] = '\\'; /* Force first separator to '\\' */
+ }
+ }
+
+ end = dst;
+
+ /* Remove redundant separators from remainder of path, forcing all
+ separators to be '\\' rather than '/'. Also, single byte space
+ characters are removed from the end of the path because those
+ are not legal ending characters on this operating system.
+ */
+ while (*src != '\0') {
+ if (isfilesep(*src)) {
+ *dst++ = '\\'; src++;
+ while (isfilesep(*src)) src++;
+ if (*src == '\0') {
+ /* Check for trailing separator */
+ end = dst;
+ if (colon == dst - 2) break; /* "z:\\" */
+ if (dst == path + 1) break; /* "\\" */
+ if (dst == path + 2 && isfilesep(path[0])) {
+ /* "\\\\" is not collapsed to "\\" because "\\\\" marks the
+ beginning of a UNC pathname. Even though it is not, by
+ itself, a valid UNC pathname, we leave it as is in order
+ to be consistent with the path canonicalizer as well
+ as the win32 APIs, which treat this case as an invalid
+ UNC pathname rather than as an alias for the root
+ directory of the current drive. */
+ break;
+ }
+ end = --dst; /* Path does not denote a root directory, so
+ remove trailing separator */
+ break;
+ }
+ end = dst;
+ } else {
+ if (::IsDBCSLeadByte(*src)) { /* Copy a double-byte character */
+ *dst++ = *src++;
+ if (*src) *dst++ = *src++;
+ end = dst;
+ } else { /* Copy a single-byte character */
+ char c = *src++;
+ *dst++ = c;
+ /* Space is not a legal ending character */
+ if (c != ' ') end = dst;
+ }
+ }
+ }
+
+ *end = '\0';
+
+ /* For "z:", add "." to work around a bug in the C runtime library */
+ if (colon == dst - 1) {
+ path[2] = '.';
+ path[3] = '\0';
+ }
+
+ #ifdef DEBUG
+ jio_fprintf(stderr, "sysNativePath: %s\n", path);
+ #endif DEBUG
+ return path;
+}
+
+// This code is a copy of JDK's sysSetLength
+// from src/windows/hpi/src/sys_api_md.c
+
+int os::ftruncate(int fd, jlong length) {
+ HANDLE h = (HANDLE)::_get_osfhandle(fd);
+ long high = (long)(length >> 32);
+ DWORD ret;
+
+ if (h == (HANDLE)(-1)) {
+ return -1;
+ }
+
+ ret = ::SetFilePointer(h, (long)(length), &high, FILE_BEGIN);
+ if ((ret == 0xFFFFFFFF) && (::GetLastError() != NO_ERROR)) {
+ return -1;
+ }
+
+ if (::SetEndOfFile(h) == FALSE) {
+ return -1;
+ }
+
+ return 0;
+}
+
+
+// This code is a copy of JDK's sysSync
+// from src/windows/hpi/src/sys_api_md.c
+// except for the legacy workaround for a bug in Win 98
+
+int os::fsync(int fd) {
+ HANDLE handle = (HANDLE)::_get_osfhandle(fd);
+
+ if ( (!::FlushFileBuffers(handle)) &&
+ (GetLastError() != ERROR_ACCESS_DENIED) ) {
+ /* from winerror.h */
+ return -1;
+ }
+ return 0;
+}
+
+static int nonSeekAvailable(int, long *);
+static int stdinAvailable(int, long *);
+
+#define S_ISCHR(mode) (((mode) & _S_IFCHR) == _S_IFCHR)
+#define S_ISFIFO(mode) (((mode) & _S_IFIFO) == _S_IFIFO)
+
+// This code is a copy of JDK's sysAvailable
+// from src/windows/hpi/src/sys_api_md.c
+
+int os::available(int fd, jlong *bytes) {
+ jlong cur, end;
+ struct _stati64 stbuf64;
+
+ if (::_fstati64(fd, &stbuf64) >= 0) {
+ int mode = stbuf64.st_mode;
+ if (S_ISCHR(mode) || S_ISFIFO(mode)) {
+ int ret;
+ long lpbytes;
+ if (fd == 0) {
+ ret = stdinAvailable(fd, &lpbytes);
+ } else {
+ ret = nonSeekAvailable(fd, &lpbytes);
+ }
+ (*bytes) = (jlong)(lpbytes);
+ return ret;
+ }
+ if ((cur = ::_lseeki64(fd, 0L, SEEK_CUR)) == -1) {
+ return FALSE;
+ } else if ((end = ::_lseeki64(fd, 0L, SEEK_END)) == -1) {
+ return FALSE;
+ } else if (::_lseeki64(fd, cur, SEEK_SET) == -1) {
+ return FALSE;
+ }
+ *bytes = end - cur;
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+// This code is a copy of JDK's nonSeekAvailable
+// from src/windows/hpi/src/sys_api_md.c
+
+static int nonSeekAvailable(int fd, long *pbytes) {
+ /* This is used for available on non-seekable devices
+ * (like both named and anonymous pipes, such as pipes
+ * connected to an exec'd process).
+ * Standard Input is a special case.
+ *
+ */
+ HANDLE han;
+
+ if ((han = (HANDLE) ::_get_osfhandle(fd)) == (HANDLE)(-1)) {
+ return FALSE;
+ }
+
+ if (! ::PeekNamedPipe(han, NULL, 0, NULL, (LPDWORD)pbytes, NULL)) {
+ /* PeekNamedPipe fails when at EOF. In that case we
+ * simply make *pbytes = 0 which is consistent with the
+ * behavior we get on Solaris when an fd is at EOF.
+ * The only alternative is to raise an Exception,
+ * which isn't really warranted.
+ */
+ if (::GetLastError() != ERROR_BROKEN_PIPE) {
+ return FALSE;
+ }
+ *pbytes = 0;
+ }
+ return TRUE;
+}
+
+#define MAX_INPUT_EVENTS 2000
+
+// This code is a copy of JDK's stdinAvailable
+// from src/windows/hpi/src/sys_api_md.c
+
+static int stdinAvailable(int fd, long *pbytes) {
+ HANDLE han;
+ DWORD numEventsRead = 0; /* Number of events read from buffer */
+ DWORD numEvents = 0; /* Number of events in buffer */
+ DWORD i = 0; /* Loop index */
+ DWORD curLength = 0; /* Position marker */
+ DWORD actualLength = 0; /* Number of bytes readable */
+ BOOL error = FALSE; /* Error holder */
+ INPUT_RECORD *lpBuffer; /* Pointer to records of input events */
+
+ if ((han = ::GetStdHandle(STD_INPUT_HANDLE)) == INVALID_HANDLE_VALUE) {
+ return FALSE;
+ }
+
+ /* Construct an array of input records in the console buffer */
+ error = ::GetNumberOfConsoleInputEvents(han, &numEvents);
+ if (error == 0) {
+ return nonSeekAvailable(fd, pbytes);
+ }
+
+ /* lpBuffer must fit into 64K or else PeekConsoleInput fails */
+ if (numEvents > MAX_INPUT_EVENTS) {
+ numEvents = MAX_INPUT_EVENTS;
+ }
+
+ lpBuffer = (INPUT_RECORD *)os::malloc(numEvents * sizeof(INPUT_RECORD));
+ if (lpBuffer == NULL) {
+ return FALSE;
+ }
+
+ error = ::PeekConsoleInput(han, lpBuffer, numEvents, &numEventsRead);
+ if (error == 0) {
+ os::free(lpBuffer);
+ return FALSE;
+ }
+
+ /* Examine input records for the number of bytes available */
+ for(i=0; ibKeyDown == TRUE) {
+ CHAR *keyPressed = (CHAR *) &(keyRecord->uChar);
+ curLength++;
+ if (*keyPressed == '\r') {
+ actualLength = curLength;
+ }
+ }
+ }
+ }
+
+ if(lpBuffer != NULL) {
+ os::free(lpBuffer);
+ }
+
+ *pbytes = (long) actualLength;
+ return TRUE;
+}
+
// Map a block of memory.
char* os::map_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
@@ -3823,7 +4225,7 @@ void os::pause() {
int fd = ::open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (fd != -1) {
struct stat buf;
- close(fd);
+ ::close(fd);
while (::stat(filename, &buf) == 0) {
Sleep(100);
}
@@ -4184,3 +4586,164 @@ static int getLastErrorString(char *buf, size_t len)
// We don't build a headless jre for Windows
bool os::is_headless_jre() { return false; }
+// OS_SocketInterface
+// Not used on Windows
+
+// OS_SocketInterface
+typedef struct hostent * (PASCAL FAR *ws2_ifn_ptr_t)(...);
+ws2_ifn_ptr_t *get_host_by_name_fn = NULL;
+
+typedef CRITICAL_SECTION mutex_t;
+#define mutexInit(m) InitializeCriticalSection(m)
+#define mutexDestroy(m) DeleteCriticalSection(m)
+#define mutexLock(m) EnterCriticalSection(m)
+#define mutexUnlock(m) LeaveCriticalSection(m)
+
+static bool sockfnptrs_initialized = FALSE;
+static mutex_t sockFnTableMutex;
+
+/* is Winsock2 loaded? better to be explicit than to rely on sockfnptrs */
+static bool winsock2Available = FALSE;
+
+
+static void initSockFnTable() {
+ int (PASCAL FAR* WSAStartupPtr)(WORD, LPWSADATA);
+ WSADATA wsadata;
+
+ ::mutexInit(&sockFnTableMutex);
+ ::mutexLock(&sockFnTableMutex);
+
+ if (sockfnptrs_initialized == FALSE) {
+ HMODULE hWinsock;
+
+ /* try to load Winsock2, and if that fails, load Winsock */
+ hWinsock = ::LoadLibrary("ws2_32.dll");
+
+ if (hWinsock == NULL) {
+ jio_fprintf(stderr, "Could not load Winsock 2 (error: %d)\n",
+ ::GetLastError());
+ return;
+ }
+
+ /* If we loaded a DLL, then we might as well initialize it. */
+ WSAStartupPtr = (int (PASCAL FAR *)(WORD, LPWSADATA))
+ ::GetProcAddress(hWinsock, "WSAStartup");
+
+ if (WSAStartupPtr(MAKEWORD(1,1), &wsadata) != 0) {
+ jio_fprintf(stderr, "Could not initialize Winsock\n");
+ }
+
+ get_host_by_name_fn
+ = (ws2_ifn_ptr_t*) GetProcAddress(hWinsock, "gethostbyname");
+ }
+
+ assert(get_host_by_name_fn != NULL,
+ "gethostbyname function not found");
+ sockfnptrs_initialized = TRUE;
+ ::mutexUnlock(&sockFnTableMutex);
+}
+
+struct hostent* os::get_host_by_name(char* name) {
+ if (!sockfnptrs_initialized) {
+ initSockFnTable();
+ }
+
+ assert(sockfnptrs_initialized == TRUE && get_host_by_name_fn != NULL,
+ "sockfnptrs is not initialized or pointer to gethostbyname function is NULL");
+ return (*get_host_by_name_fn)(name);
+}
+
+
+int os::socket_close(int fd) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::socket_available(int fd, jint *pbytes) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::socket(int domain, int type, int protocol) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::listen(int fd, int count) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::connect(int fd, struct sockaddr *him, int len) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::accept(int fd, struct sockaddr *him, int *len) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::sendto(int fd, char *buf, int len, int flags,
+ struct sockaddr *to, int tolen) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::recvfrom(int fd, char *buf, int nBytes, int flags,
+ sockaddr *from, int *fromlen) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::recv(int fd, char *buf, int nBytes, int flags) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::send(int fd, char *buf, int nBytes, int flags) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::raw_send(int fd, char *buf, int nBytes, int flags) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::timeout(int fd, long timeout) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::get_host_name(char* name, int namelen) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::socket_shutdown(int fd, int howto) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::bind(int fd, struct sockaddr *him, int len) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::get_sock_name(int fd, struct sockaddr *him, int *len) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::get_sock_opt(int fd, int level, int optname,
+ char *optval, int* optlen) {
+ ShouldNotReachHere();
+ return 0;
+}
+
+int os::set_sock_opt(int fd, int level, int optname,
+ const char *optval, int optlen) {
+ ShouldNotReachHere();
+ return 0;
+}
diff --git a/hotspot/src/os/windows/vm/os_windows.hpp b/hotspot/src/os/windows/vm/os_windows.hpp
index eacf1f8a1e8..ddc7e203657 100644
--- a/hotspot/src/os/windows/vm/os_windows.hpp
+++ b/hotspot/src/os/windows/vm/os_windows.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_WINDOWS_VM_OS_WINDOWS_HPP
+#define OS_WINDOWS_VM_OS_WINDOWS_HPP
+
// Win32_OS defines the interface to windows operating systems
class win32 {
@@ -124,3 +127,5 @@ class PlatformParker : public CHeapObj {
}
} ;
+
+#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 8c709b29fa9..cee281fada7 100644
--- a/hotspot/src/os/windows/vm/os_windows.inline.hpp
+++ b/hotspot/src/os/windows/vm/os_windows.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,18 +22,39 @@
*
*/
+#ifndef OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
+#define OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
+
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "atomic_windows_x86.inline.hpp"
+# include "orderAccess_windows_x86.inline.hpp"
+#endif
+
inline const char* os::file_separator() { return "\\"; }
inline const char* os::line_separator() { return "\r\n"; }
inline const char* os::path_separator() { return ";"; }
+inline const char* os::dll_file_extension() { return ".dll"; }
inline const char* os::jlong_format_specifier() { return "%I64d"; }
inline const char* os::julong_format_specifier() { return "%I64u"; }
+inline const int os::default_file_open_flags() { return O_BINARY | O_NOINHERIT;}
+
// File names are case-insensitive on windows only
inline int os::file_name_strcmp(const char* s, const char* t) {
return _stricmp(s, t);
}
+inline void os::dll_unload(void *lib) {
+ ::FreeLibrary((HMODULE)lib);
+}
+
+inline void* os::dll_lookup(void *lib, const char *name) {
+ return (void*)::GetProcAddress((HMODULE)lib, name);
+}
+
// Used to improve time-sharing on some systems
inline void os::loop_breaker(int attempts) {}
@@ -72,3 +93,20 @@ inline void os::bang_stack_shadow_pages() {
inline bool os::numa_has_static_binding() { return true; }
inline bool os::numa_has_group_homing() { return false; }
+
+inline size_t os::read(int fd, void *buf, unsigned int nBytes) {
+ return ::read(fd, buf, nBytes);
+}
+
+inline size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
+ return ::read(fd, buf, nBytes);
+}
+
+inline size_t os::write(int fd, const void *buf, unsigned int nBytes) {
+ return ::write(fd, buf, nBytes);
+}
+
+inline int os::close(int fd) {
+ return ::close(fd);
+}
+#endif // OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
diff --git a/hotspot/src/os/windows/vm/perfMemory_windows.cpp b/hotspot/src/os/windows/vm/perfMemory_windows.cpp
index 7274df0ccb7..fbccc3c89fa 100644
--- a/hotspot/src/os/windows/vm/perfMemory_windows.cpp
+++ b/hotspot/src/os/windows/vm/perfMemory_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,8 +22,15 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_perfMemory_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
+#include "os_windows.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/perfMemory.hpp"
+#include "utilities/exceptions.hpp"
#include
#include
@@ -889,6 +896,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
DWORD newACLsize = aclinfo.AclBytesInUse +
(sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD)) * ace_count;
for (int i = 0; i < ace_count; i++) {
+ assert(aces[i].pSid != 0, "pSid should not be 0");
newACLsize += GetLengthSid(aces[i].pSid);
}
@@ -1084,6 +1092,9 @@ static LPSECURITY_ATTRIBUTES make_user_everybody_admin_security_attr(
aces[0].pSid = get_user_sid(GetCurrentProcess());
aces[0].mask = umask;
+ if (aces[0].pSid == 0)
+ return NULL;
+
// get the well known SID for BUILTIN\Administrators
PSID administratorsSid = NULL;
SID_IDENTIFIER_AUTHORITY SIDAuthAdministrators = SECURITY_NT_AUTHORITY;
diff --git a/hotspot/src/os/windows/vm/stubRoutines_windows.cpp b/hotspot/src/os/windows/vm/stubRoutines_windows.cpp
index 4721d8275ce..3723a0f7dfa 100644
--- a/hotspot/src/os/windows/vm/stubRoutines_windows.cpp
+++ b/hotspot/src/os/windows/vm/stubRoutines_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,5 +22,7 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_stubRoutines_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "runtime/stubRoutines.hpp"
+
diff --git a/hotspot/src/os/windows/vm/threadCritical_windows.cpp b/hotspot/src/os/windows/vm/threadCritical_windows.cpp
index e638ce8252e..4a498e07e29 100644
--- a/hotspot/src/os/windows/vm/threadCritical_windows.cpp
+++ b/hotspot/src/os/windows/vm/threadCritical_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,8 +22,9 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_threadCritical_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadCritical.hpp"
+#include "thread_windows.inline.hpp"
// OS-includes here
# include
diff --git a/hotspot/src/os/windows/vm/thread_windows.inline.hpp b/hotspot/src/os/windows/vm/thread_windows.inline.hpp
index ade19efc009..9fe391574cc 100644
--- a/hotspot/src/os/windows/vm/thread_windows.inline.hpp
+++ b/hotspot/src/os/windows/vm/thread_windows.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,6 +22,21 @@
*
*/
+#ifndef OS_WINDOWS_VM_THREAD_WINDOWS_INLINE_HPP
+#define OS_WINDOWS_VM_THREAD_WINDOWS_INLINE_HPP
+
+#include "runtime/atomic.hpp"
+#include "runtime/prefetch.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "atomic_windows_x86.inline.hpp"
+# include "orderAccess_windows_x86.inline.hpp"
+# include "prefetch_windows_x86.inline.hpp"
+#endif
+
// Contains inlined functions for class Thread and ThreadLocalStorage
inline void ThreadLocalStorage::pd_invalidate_all() { return; }
+
+#endif // OS_WINDOWS_VM_THREAD_WINDOWS_INLINE_HPP
diff --git a/hotspot/src/os/windows/vm/vmError_windows.cpp b/hotspot/src/os/windows/vm/vmError_windows.cpp
index 468c6935537..7a4b96b2a47 100644
--- a/hotspot/src/os/windows/vm/vmError_windows.cpp
+++ b/hotspot/src/os/windows/vm/vmError_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,8 +22,11 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_vmError_windows.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/os.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/vmError.hpp"
void VMError::show_message_box(char *buf, int buflen) {
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp
index 342352bf8f1..20a5c5886dc 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,8 +22,11 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_linux_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/threadLocalStorage.hpp"
#include
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp
index b084e07f8c0..648543eadb8 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,14 @@
*
*/
+#ifndef OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP
+#define OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP
+
+#include "orderAccess_linux_sparc.inline.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_sparc.hpp"
+
// Implementation of class atomic
inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; }
@@ -204,3 +212,5 @@ inline intptr_t Atomic::cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t*
inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value) {
return (void*)cmpxchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest, (intptr_t)compare_value);
}
+
+#endif // OS_CPU_LINUX_SPARC_VM_ATOMIC_LINUX_SPARC_INLINE_HPP
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp
index e67d0d42fde..b0b8c07fe8f 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
+#define OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
+
//
// Sets the default values for platform dependent flags used by the
// runtime system. (see globals.hpp)
@@ -34,3 +37,5 @@ define_pd_global(intx, CompilerThreadStackSize, 0);
define_pd_global(uintx, HeapBaseMinAddress, 4*G);
// Only used on 64 bit Windows platforms
define_pd_global(bool, UseVectoredExceptions, false);
+
+#endif // OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp
index 2770baaabef..6833c1f4e61 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP
+#define OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP
+
+#include "runtime/orderAccess.hpp"
+#include "vm_version_sparc.hpp"
+
// Implementation of class OrderAccess.
// Assume TSO.
@@ -100,3 +106,5 @@ inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v)
inline void OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { *p = v; fence(); }
inline void OrderAccess::release_store_ptr_fence(volatile void* p, void* v) { *(void* volatile *)p = v; fence(); }
+
+#endif // OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP
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 ada91d9a293..e759e7d8dea 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
@@ -22,9 +22,43 @@
*
*/
-// do not include precompiled header file
+// no precompiled headers
+#include "assembler_sparc.inline.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_linux.h"
+#include "memory/allocation.inline.hpp"
+#include "mutex_linux.inline.hpp"
+#include "nativeInst_sparc.hpp"
+#include "os_share_linux.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "thread_linux.inline.hpp"
+#include "utilities/events.hpp"
+#include "utilities/vmError.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
-#include "incls/_os_linux_sparc.cpp.incl"
// Linux/Sparc has rather obscure naming of registers in sigcontext
// different between 32 and 64 bits
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp
index 7b3ef847e85..22d9cf0d88e 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_LINUX_SPARC_VM_OS_LINUX_SPARC_HPP
+#define OS_CPU_LINUX_SPARC_VM_OS_LINUX_SPARC_HPP
+
//
// NOTE: we are back in class os here, not Linux
//
@@ -42,3 +45,5 @@
// Used to register dynamic code cache area with the OS
// Note: Currently only used in 64 bit Windows implementations
static bool register_code_area(char *low, char *high) { return true; }
+
+#endif // OS_CPU_LINUX_SPARC_VM_OS_LINUX_SPARC_HPP
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/prefetch_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/prefetch_linux_sparc.inline.hpp
index 14af8a71528..edc472f7506 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/prefetch_linux_sparc.inline.hpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/prefetch_linux_sparc.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,6 +22,11 @@
*
*/
+#ifndef OS_CPU_LINUX_SPARC_VM_PREFETCH_LINUX_SPARC_INLINE_HPP
+#define OS_CPU_LINUX_SPARC_VM_PREFETCH_LINUX_SPARC_INLINE_HPP
+
+#include "runtime/prefetch.hpp"
+
#if defined(COMPILER2) || defined(_LP64)
inline void Prefetch::read(void *loc, intx interval) {
@@ -38,3 +43,5 @@ inline void Prefetch::read (void *loc, intx interval) {}
inline void Prefetch::write(void *loc, intx interval) {}
#endif
+
+#endif // OS_CPU_LINUX_SPARC_VM_PREFETCH_LINUX_SPARC_INLINE_HPP
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.cpp
index 2031f5a4683..d2ae5ca9f24 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.cpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_threadLS_linux_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "thread_linux.inline.hpp"
void ThreadLocalStorage::generate_code_for_get_thread() {
}
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.hpp
index cc4a46ffea4..0584108833a 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.hpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,12 @@
*
*/
+#ifndef OS_CPU_LINUX_SPARC_VM_THREADLS_LINUX_SPARC_HPP
+#define OS_CPU_LINUX_SPARC_VM_THREADLS_LINUX_SPARC_HPP
+
public:
static Thread* thread() {
return (Thread*) os::thread_local_storage_at(thread_index());
}
+
+#endif // OS_CPU_LINUX_SPARC_VM_THREADLS_LINUX_SPARC_HPP
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp
index 7b44e39eee7..8f3eaa3e540 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_thread_linux_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/frame.inline.hpp"
+#include "thread_linux.inline.hpp"
// For Forte Analyzer AsyncGetCallTrace profiling support - thread is
// currently interrupted by SIGPROF
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.hpp
index ddf7ad83ab7..a3174b579ea 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.hpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_LINUX_SPARC_VM_THREAD_LINUX_SPARC_HPP
+#define OS_CPU_LINUX_SPARC_VM_THREAD_LINUX_SPARC_HPP
+
private:
void pd_initialize() {
@@ -96,3 +99,5 @@ public:
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}
+
+#endif // OS_CPU_LINUX_SPARC_VM_THREAD_LINUX_SPARC_HPP
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp
index f2f1a83f636..4b0a3e63a29 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_LINUX_SPARC_VM_VMSTRUCTS_LINUX_SPARC_HPP
+#define OS_CPU_LINUX_SPARC_VM_VMSTRUCTS_LINUX_SPARC_HPP
+
// These are the OS and CPU-specific fields, types and integer
// constants required by the Serviceability Agent. This file is
// referenced by vmStructs.cpp.
@@ -67,3 +70,5 @@
\
/* This must be the last entry, and must be present */ \
last_entry()
+
+#endif // OS_CPU_LINUX_SPARC_VM_VMSTRUCTS_LINUX_SPARC_HPP
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp
index 519286881d0..c3d244d987d 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,8 +22,9 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_linux_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_sparc.hpp"
static bool detect_niagara() {
char cpu[128];
diff --git a/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp
index fc42b00c3e3..5cd94107507 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,8 +22,11 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_linux_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/threadLocalStorage.hpp"
#ifndef _LP64
void MacroAssembler::int3() {
diff --git a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp
index c58865aca4d..7a89e56e107 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,14 @@
*
*/
+#ifndef OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP
+#define OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP
+
+#include "orderAccess_linux_x86.inline.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_x86.hpp"
+
// Implementation of class atomic
inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; }
@@ -193,3 +201,5 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void*
return (void*)cmpxchg((jint)exchange_value, (volatile jint*)dest, (jint)compare_value);
}
#endif // AMD64
+
+#endif // OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP
diff --git a/hotspot/src/os_cpu/linux_x86/vm/bytes_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/bytes_linux_x86.inline.hpp
index 33d26d07860..93cb9882263 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/bytes_linux_x86.inline.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/bytes_linux_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_LINUX_X86_VM_BYTES_LINUX_X86_INLINE_HPP
+#define OS_CPU_LINUX_X86_VM_BYTES_LINUX_X86_INLINE_HPP
+
#include
// Efficient swapping of data bytes from Java byte
@@ -83,3 +86,5 @@ inline u8 Bytes::swap_u8(u8 x) {
return swap_u8_base(*(u4*)&x, *(((u4*)&x)+1));
}
#endif // !AMD64
+
+#endif // OS_CPU_LINUX_X86_VM_BYTES_LINUX_X86_INLINE_HPP
diff --git a/hotspot/src/os_cpu/linux_x86/vm/copy_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/copy_linux_x86.inline.hpp
index 5829e1a64a1..175019b8644 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/copy_linux_x86.inline.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/copy_linux_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP
+#define OS_CPU_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP
+
static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
#ifdef AMD64
(void)memmove(to, from, count * HeapWordSize);
@@ -302,3 +305,5 @@ static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count)
pd_conjoint_oops_atomic((oop*)from, (oop*)to, count);
#endif // AMD64
}
+
+#endif // OS_CPU_LINUX_X86_VM_COPY_LINUX_X86_INLINE_HPP
diff --git a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp
index 8a531a8a2fe..7ca61f27fac 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
+#define OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
+
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)
@@ -45,3 +48,5 @@ define_pd_global(uintx,JVMInvokeMethodSlack, 8192);
define_pd_global(uintx,HeapBaseMinAddress, 2*G);
// Only used on 64 bit Windows platforms
define_pd_global(bool, UseVectoredExceptions, false);
+
+#endif // OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
diff --git a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
index d487ece69a3..9adf947ad37 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP
+#define OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP
+
+#include "runtime/orderAccess.hpp"
+#include "vm_version_x86.hpp"
+
// Implementation of class OrderAccess.
inline void OrderAccess::loadload() { acquire(); }
@@ -204,3 +210,5 @@ inline void OrderAccess::release_store_ptr_fence(volatile void* p, void*
release_store_fence((volatile jint*)p, (jint)v);
#endif // AMD64
}
+
+#endif // OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP
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 5cfa380c40a..f657dfec2d6 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
@@ -22,8 +22,42 @@
*
*/
-// do not include precompiled header file
-# include "incls/_os_linux_x86.cpp.incl"
+// no precompiled headers
+#include "assembler_x86.inline.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_linux.h"
+#include "memory/allocation.inline.hpp"
+#include "mutex_linux.inline.hpp"
+#include "nativeInst_x86.hpp"
+#include "os_share_linux.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "thread_linux.inline.hpp"
+#include "utilities/events.hpp"
+#include "utilities/vmError.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
// put OS-includes here
# include
diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp
index fe5d35788a6..64954d480f8 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_LINUX_X86_VM_OS_LINUX_X86_HPP
+#define OS_CPU_LINUX_X86_VM_OS_LINUX_X86_HPP
+
static void setup_fpu();
static bool supports_sse();
@@ -30,3 +33,5 @@
// Used to register dynamic code cache area with the OS
// Note: Currently only used in 64 bit Windows implementations
static bool register_code_area(char *low, char *high) { return true; }
+
+#endif // OS_CPU_LINUX_X86_VM_OS_LINUX_X86_HPP
diff --git a/hotspot/src/os_cpu/linux_x86/vm/prefetch_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/prefetch_linux_x86.inline.hpp
index 0499df081b2..ba1cf32aacb 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/prefetch_linux_x86.inline.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/prefetch_linux_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,6 +22,11 @@
*
*/
+#ifndef OS_CPU_LINUX_X86_VM_PREFETCH_LINUX_X86_INLINE_HPP
+#define OS_CPU_LINUX_X86_VM_PREFETCH_LINUX_X86_INLINE_HPP
+
+#include "runtime/prefetch.hpp"
+
inline void Prefetch::read (void *loc, intx interval) {
#ifdef AMD64
@@ -38,3 +43,5 @@ inline void Prefetch::write(void *loc, intx interval) {
#endif // AMD64
}
+
+#endif // OS_CPU_LINUX_X86_VM_PREFETCH_LINUX_X86_INLINE_HPP
diff --git a/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp
index 5b84568714e..66340de7d7b 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_threadLS_linux_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "thread_linux.inline.hpp"
// Map stack pointer (%esp) to thread pointer for faster TLS access
//
diff --git a/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
index 2b1cb07dd62..55da9c0ca7b 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_LINUX_X86_VM_THREADLS_LINUX_X86_HPP
+#define OS_CPU_LINUX_X86_VM_THREADLS_LINUX_X86_HPP
+
// Processor dependent parts of ThreadLocalStorage
#ifndef AMD64
@@ -47,3 +50,5 @@ public:
return _sp_map[sp >> PAGE_SHIFT];
#endif // AMD64
}
+
+#endif // OS_CPU_LINUX_X86_VM_THREADLS_LINUX_X86_HPP
diff --git a/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp
index b3089810813..3f04c773003 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_thread_linux_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/frame.inline.hpp"
+#include "thread_linux.inline.hpp"
// For Forte Analyzer AsyncGetCallTrace profiling support - thread is
// currently interrupted by SIGPROF
diff --git a/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp
index 31eb0d05187..7a7d222521f 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/thread_linux_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_LINUX_X86_VM_THREAD_LINUX_X86_HPP
+#define OS_CPU_LINUX_X86_VM_THREAD_LINUX_X86_HPP
+
private:
void pd_initialize() {
_anchor.clear();
@@ -63,3 +66,5 @@
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}
+
+#endif // OS_CPU_LINUX_X86_VM_THREAD_LINUX_X86_HPP
diff --git a/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp
index 1057ec8afe3..c54cb1d729d 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_LINUX_X86_VM_VMSTRUCTS_LINUX_X86_HPP
+#define OS_CPU_LINUX_X86_VM_VMSTRUCTS_LINUX_X86_HPP
+
// These are the OS and CPU-specific fields, types and integer
// constants required by the Serviceability Agent. This file is
// referenced by vmStructs.cpp.
@@ -58,3 +61,5 @@
\
/* This must be the last entry, and must be present */ \
last_entry()
+
+#endif // OS_CPU_LINUX_X86_VM_VMSTRUCTS_LINUX_X86_HPP
diff --git a/hotspot/src/os_cpu/linux_x86/vm/vm_version_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/vm_version_linux_x86.cpp
index 4ca3fc8c12b..f1a3c3a0b88 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/vm_version_linux_x86.cpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/vm_version_linux_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,5 +22,7 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_linux_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_x86.hpp"
+
diff --git a/hotspot/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp
index 1e7f6703a71..ec56a35cd6b 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,10 @@
*
*/
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_zero.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/threadLocalStorage.hpp"
+
// This file is intentionally empty
diff --git a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
index f4b7d0c57be..fcada2aa417 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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.
*
@@ -23,6 +23,14 @@
*
*/
+#ifndef OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP
+#define OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP
+
+#include "orderAccess_linux_zero.inline.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_zero.hpp"
+
// Implementation of class atomic
#ifdef M68K
@@ -291,3 +299,5 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value,
(volatile intptr_t*) dest,
(intptr_t) compare_value);
}
+
+#endif // OS_CPU_LINUX_ZERO_VM_ATOMIC_LINUX_ZERO_INLINE_HPP
diff --git a/hotspot/src/os_cpu/linux_zero/vm/bytes_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/bytes_linux_zero.inline.hpp
index f427b9193d3..707cba2d057 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/bytes_linux_zero.inline.hpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/bytes_linux_zero.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_LINUX_ZERO_VM_BYTES_LINUX_ZERO_INLINE_HPP
+#define OS_CPU_LINUX_ZERO_VM_BYTES_LINUX_ZERO_INLINE_HPP
+
// Efficient swapping of data bytes from Java byte
// ordering to native byte ordering and vice versa.
@@ -38,3 +41,5 @@ inline u4 Bytes::swap_u4(u4 x) {
inline u8 Bytes::swap_u8(u8 x) {
return bswap_64(x);
}
+
+#endif // OS_CPU_LINUX_ZERO_VM_BYTES_LINUX_ZERO_INLINE_HPP
diff --git a/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp
index 06ce1a20d58..f12bec98636 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP
+#define OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP
+
//
// Set the default values for platform dependent flags used by the
// runtime system. See globals.hpp for details of what they do.
@@ -42,3 +45,5 @@ define_pd_global(uintx, JVMInvokeMethodSlack, 8192);
define_pd_global(bool, UseVectoredExceptions, false);
// Only used on 64 bit platforms
define_pd_global(uintx, HeapBaseMinAddress, 2*G);
+
+#endif // OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP
diff --git a/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp
index c54883b888c..773fd643ab7 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,12 @@
*
*/
+#ifndef OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP
+#define OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP
+
+#include "runtime/orderAccess.hpp"
+#include "vm_version_zero.hpp"
+
#ifdef ARM
/*
@@ -165,3 +171,5 @@ inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v)
inline void OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { release_store_ptr(p, v); fence(); }
inline void OrderAccess::release_store_ptr_fence(volatile void* p, void* v) { release_store_ptr(p, v); fence(); }
+
+#endif // OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP
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 fd78628b3eb..40e15e2f4f8 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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.
*
@@ -23,8 +23,42 @@
*
*/
-// do not include precompiled header file
-#include "incls/_os_linux_zero.cpp.incl"
+// no precompiled headers
+#include "assembler_zero.inline.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_linux.h"
+#include "memory/allocation.inline.hpp"
+#include "mutex_linux.inline.hpp"
+#include "nativeInst_zero.hpp"
+#include "os_share_linux.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "thread_linux.inline.hpp"
+#include "utilities/events.hpp"
+#include "utilities/vmError.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
address os::current_stack_pointer() {
address dummy = (address) &dummy;
@@ -370,6 +404,10 @@ void os::print_context(outputStream* st, void* context) {
ShouldNotCallThis();
}
+void os::print_register_info(outputStream *st, void *context) {
+ ShouldNotCallThis();
+}
+
/////////////////////////////////////////////////////////////////////////////
// Stubs for things that would be in linux_zero.s if it existed.
// You probably want to disassemble these monkeys to check they're ok.
diff --git a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
index 84c87f8073b..1d4576679d3 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef OS_CPU_LINUX_ZERO_VM_OS_LINUX_ZERO_HPP
+#define OS_CPU_LINUX_ZERO_VM_OS_LINUX_ZERO_HPP
+
static void setup_fpu() {}
static bool is_allocatable(size_t bytes);
@@ -49,3 +52,5 @@
*(jlong *) dst = *(jlong *) src;
#endif
}
+
+#endif // OS_CPU_LINUX_ZERO_VM_OS_LINUX_ZERO_HPP
diff --git a/hotspot/src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.hpp
index 346a6079808..e34fef0b85d 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.hpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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.
*
@@ -23,8 +23,15 @@
*
*/
+#ifndef OS_CPU_LINUX_ZERO_VM_PREFETCH_LINUX_ZERO_INLINE_HPP
+#define OS_CPU_LINUX_ZERO_VM_PREFETCH_LINUX_ZERO_INLINE_HPP
+
+#include "runtime/prefetch.hpp"
+
inline void Prefetch::read(void* loc, intx interval) {
}
inline void Prefetch::write(void* loc, intx interval) {
}
+
+#endif // OS_CPU_LINUX_ZERO_VM_PREFETCH_LINUX_ZERO_INLINE_HPP
diff --git a/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp
index 6dc339d700a..0981ea5dd61 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_threadLS_linux_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "thread_linux.inline.hpp"
void ThreadLocalStorage::generate_code_for_get_thread() {
// nothing to do
diff --git a/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp
index 260602df149..3fd4ccf973f 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,9 +22,14 @@
*
*/
+#ifndef OS_CPU_LINUX_ZERO_VM_THREADLS_LINUX_ZERO_HPP
+#define OS_CPU_LINUX_ZERO_VM_THREADLS_LINUX_ZERO_HPP
+
// Processor dependent parts of ThreadLocalStorage
public:
static Thread* thread() {
return (Thread*) os::thread_local_storage_at(thread_index());
}
+
+#endif // OS_CPU_LINUX_ZERO_VM_THREADLS_LINUX_ZERO_HPP
diff --git a/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp
index 8551eafce62..9c1b7336c63 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_thread_linux_zero.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/frame.inline.hpp"
+#include "thread_linux.inline.hpp"
void JavaThread::cache_global_variables() {
// nothing to do
diff --git a/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp
index 086bceea99e..39f77f858d0 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, 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.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef OS_CPU_LINUX_ZERO_VM_THREAD_LINUX_ZERO_HPP
+#define OS_CPU_LINUX_ZERO_VM_THREAD_LINUX_ZERO_HPP
+
private:
ZeroStack _zero_stack;
ZeroFrame* _top_zero_frame;
@@ -114,3 +117,5 @@
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}
+
+#endif // OS_CPU_LINUX_ZERO_VM_THREAD_LINUX_ZERO_HPP
diff --git a/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp
index 007ecfcaf85..46c7912c372 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,9 @@
*
*/
+#ifndef OS_CPU_LINUX_ZERO_VM_VMSTRUCTS_LINUX_ZERO_HPP
+#define OS_CPU_LINUX_ZERO_VM_VMSTRUCTS_LINUX_ZERO_HPP
+
// These are the OS and CPU-specific fields, types and integer
// constants required by the Serviceability Agent. This file is
// referenced by vmStructs.cpp.
@@ -43,3 +46,5 @@
#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
/* This must be the last entry, and must be present */ \
last_entry()
+
+#endif // OS_CPU_LINUX_ZERO_VM_VMSTRUCTS_LINUX_ZERO_HPP
diff --git a/hotspot/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp
index 1e7f6703a71..f2ca79f388c 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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.
*
@@ -23,4 +23,8 @@
*
*/
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_zero.hpp"
+
// This file is intentionally empty
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp
index 92fb4a45263..5e9eaa12a31 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,8 +22,11 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_solaris_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_sparc.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/threadLocalStorage.hpp"
#include // For trap numbers
#include // For V8 compatibility
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp
index 1931e6114c0..006962519ac 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,14 @@
*
*/
+#ifndef OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP
+
+#include "orderAccess_solaris_sparc.inline.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_sparc.hpp"
+
// Implementation of class atomic
inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; }
@@ -342,3 +350,5 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void*
#endif // _LP64 || COMPILER2
#endif // _GNU_SOURCE
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_ATOMIC_SOLARIS_SPARC_INLINE_HPP
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp
index f9e43a77b59..febba7cd211 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_SOLARIS_SPARC_VM_GLOBALS_SOLARIS_SPARC_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_GLOBALS_SOLARIS_SPARC_HPP
+
//
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)
@@ -36,3 +39,5 @@ define_pd_global(uintx, HeapBaseMinAddress, 4*G);
define_pd_global(bool, UseVectoredExceptions, false);
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_GLOBALS_SOLARIS_SPARC_HPP
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp
index 6075e010687..bb732bd6b16 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP
+
+#include "runtime/orderAccess.hpp"
+#include "vm_version_sparc.hpp"
+
// Implementation of class OrderAccess.
// Assume TSO.
@@ -124,3 +130,5 @@ inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v)
inline void OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { *p = v; fence(); }
inline void OrderAccess::release_store_ptr_fence(volatile void* p, void* v) { *(void* volatile *)p = v; fence(); }
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_ORDERACCESS_SOLARIS_SPARC_INLINE_HPP
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 556defca3d1..889f7549f80 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
@@ -22,12 +22,46 @@
*
*/
-// do not include precompiled header file
+// no precompiled headers
+#include "assembler_sparc.inline.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_solaris.h"
+#include "memory/allocation.inline.hpp"
+#include "mutex_solaris.inline.hpp"
+#include "nativeInst_sparc.hpp"
+#include "os_share_solaris.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "thread_solaris.inline.hpp"
+#include "utilities/events.hpp"
+#include "utilities/vmError.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
+
# include // needed first to avoid name collision for "std" with SC 5.0
-# include "incls/_os_solaris_sparc.cpp.incl"
-
// put OS-includes here
# include
# include
@@ -254,17 +288,17 @@ static int threadgetstate(thread_t tid, int *flags, lwpid_t *lwp, stack_t *ss, g
if (*flags == TRS_LWPID) {
sprintf(lwpstatusfile, "/proc/%d/lwp/%d/lwpstatus", getpid(),
*lwp);
- if ((lwpfd = open(lwpstatusfile, O_RDONLY)) < 0) {
+ if ((lwpfd = ::open(lwpstatusfile, O_RDONLY)) < 0) {
perror("thr_mutator_status: open lwpstatus");
return (EINVAL);
}
if (pread(lwpfd, lwpstatus, sizeof (lwpstatus_t), (off_t)0) !=
sizeof (lwpstatus_t)) {
perror("thr_mutator_status: read lwpstatus");
- (void) close(lwpfd);
+ (void) ::close(lwpfd);
return (EINVAL);
}
- (void) close(lwpfd);
+ (void) ::close(lwpfd);
}
return (0);
}
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp
index 9d9e6192f48..59bd417b470 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_SOLARIS_SPARC_VM_OS_SOLARIS_SPARC_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_OS_SOLARIS_SPARC_HPP
+
//
// NOTE: we are back in class os here, not Solaris
//
@@ -42,3 +45,5 @@
// Used to register dynamic code cache area with the OS
// Note: Currently only used in 64 bit Windows implementations
static bool register_code_area(char *low, char *high) { return true; }
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_OS_SOLARIS_SPARC_HPP
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/prefetch_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/prefetch_solaris_sparc.inline.hpp
index cd8cddecbc6..70729176433 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/prefetch_solaris_sparc.inline.hpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/prefetch_solaris_sparc.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,6 +22,11 @@
*
*/
+#ifndef OS_CPU_SOLARIS_SPARC_VM_PREFETCH_SOLARIS_SPARC_INLINE_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_PREFETCH_SOLARIS_SPARC_INLINE_HPP
+
+#include "runtime/prefetch.hpp"
+
#if defined(COMPILER2) || defined(_LP64)
// For Sun Studio inplementation is in solaris_sparc.il
@@ -56,3 +61,5 @@ inline void Prefetch::read (void *loc, intx interval) {}
inline void Prefetch::write(void *loc, intx interval) {}
#endif // defined(COMPILER2) || defined(_LP64)
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_PREFETCH_SOLARIS_SPARC_INLINE_HPP
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.cpp
index 92cccf36ec6..178808ffb3f 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.cpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,13 +22,15 @@
*
*/
+#include "precompiled.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "thread_solaris.inline.hpp"
+
// Provides an entry point we can link against and
// a buffer we can emit code into. The buffer is
// filled by ThreadLocalStorage::generate_code_for_get_thread
// and called from ThreadLocalStorage::thread()
-#include "incls/_precompiled.incl"
-#include "incls/_threadLS_solaris_sparc.cpp.incl"
#include
// The portable TLS mechanism (get_thread_via_cache) is enough on SPARC.
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.hpp
index 9d78f743e51..98a8fc58c31 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.hpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_SOLARIS_SPARC_VM_THREADLS_SOLARIS_SPARC_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_THREADLS_SOLARIS_SPARC_HPP
+
public:
// Java Thread - force inlining
static inline Thread* thread() ;
@@ -64,3 +67,5 @@ public:
uintptr_t ix = (int) (((raw_id >> 9) ^ (raw_id >> 20)) % _pd_cache_size);
return ix;
}
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_THREADLS_SOLARIS_SPARC_HPP
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp
index 84efd5e76d1..f622943fedb 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_thread_solaris_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/frame.inline.hpp"
+#include "thread_solaris.inline.hpp"
// For Forte Analyzer AsyncGetCallTrace profiling support - thread is
// currently interrupted by SIGPROF
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.hpp
index 4f8ab325bd9..1cd0709b6e3 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.hpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -21,6 +21,9 @@
* questions.
*
*/
+
+#ifndef OS_CPU_SOLARIS_SPARC_VM_THREAD_SOLARIS_SPARC_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_THREAD_SOLARIS_SPARC_HPP
private:
void pd_initialize() {
@@ -95,3 +98,5 @@ public:
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_THREAD_SOLARIS_SPARC_HPP
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp
index 182a7184831..710e3369042 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_SOLARIS_SPARC_VM_VMSTRUCTS_SOLARIS_SPARC_HPP
+#define OS_CPU_SOLARIS_SPARC_VM_VMSTRUCTS_SOLARIS_SPARC_HPP
+
// These are the OS and CPU-specific fields, types and integer
// constants required by the Serviceability Agent. This file is
// referenced by vmStructs.cpp.
@@ -65,3 +68,5 @@
\
/* This must be the last entry, and must be present */ \
last_entry()
+
+#endif // OS_CPU_SOLARIS_SPARC_VM_VMSTRUCTS_SOLARIS_SPARC_HPP
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp
index 6e086f25c46..982f987c3d7 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp
@@ -22,8 +22,9 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_solaris_sparc.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_sparc.hpp"
# include
# include
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp
index bb782860f64..d1cd12f2803 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,8 +22,11 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_solaris_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/threadLocalStorage.hpp"
void MacroAssembler::int3() {
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp
index 240a8de5c1d..a4b04606b9a 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,14 @@
*
*/
+#ifndef OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP
+#define OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP
+
+#include "orderAccess_solaris_x86.inline.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_x86.hpp"
+
inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; }
inline void Atomic::store (jshort store_value, jshort* dest) { *dest = store_value; }
inline void Atomic::store (jint store_value, jint* dest) { *dest = store_value; }
@@ -245,3 +253,5 @@ extern "C" {
#undef LOCK_IF_MP
#endif // _GNU_SOURCE
+
+#endif // OS_CPU_SOLARIS_X86_VM_ATOMIC_SOLARIS_X86_INLINE_HPP
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/bytes_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/bytes_solaris_x86.inline.hpp
index 075986d2159..58620e59fd7 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/bytes_solaris_x86.inline.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/bytes_solaris_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_SOLARIS_X86_VM_BYTES_SOLARIS_X86_INLINE_HPP
+#define OS_CPU_SOLARIS_X86_VM_BYTES_SOLARIS_X86_INLINE_HPP
+
// For Sun Studio - implementation is in solaris_i486.il.
// For gcc - implementation is just below.
extern "C" u2 _raw_swap_u2(u2 x);
@@ -109,3 +112,5 @@ extern "C" {
#endif // AMD64
}
#endif //_GNU_SOURCE
+
+#endif // OS_CPU_SOLARIS_X86_VM_BYTES_SOLARIS_X86_INLINE_HPP
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/copy_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/copy_solaris_x86.inline.hpp
index a78ef6fe311..4d3790d504f 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/copy_solaris_x86.inline.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/copy_solaris_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_SOLARIS_X86_VM_COPY_SOLARIS_X86_INLINE_HPP
+#define OS_CPU_SOLARIS_X86_VM_COPY_SOLARIS_X86_INLINE_HPP
+
static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
(void)memmove(to, from, count * HeapWordSize);
}
@@ -136,3 +139,5 @@ static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count)
_Copy_arrayof_conjoint_jints(from, to, count);
#endif // AMD64
}
+
+#endif // OS_CPU_SOLARIS_X86_VM_COPY_SOLARIS_X86_INLINE_HPP
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp
index 36fd38fcc4d..0bbe0acba0c 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
+#define OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
+
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)
@@ -44,3 +47,5 @@ define_pd_global(intx, CompilerThreadStackSize, 0);
define_pd_global(uintx,HeapBaseMinAddress, 256*M);
// Only used on 64 bit Windows platforms
define_pd_global(bool, UseVectoredExceptions, false);
+
+#endif // OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp
index 84c1ce9238d..a4894c8f89a 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP
+#define OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP
+
+#include "runtime/orderAccess.hpp"
+#include "vm_version_x86.hpp"
+
// Implementation of class OrderAccess.
// For Sun Studio - implementation is in solaris_i486.il.
@@ -127,3 +133,5 @@ inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v)
inline void OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { *p = v; fence(); }
inline void OrderAccess::release_store_ptr_fence(volatile void* p, void* v) { *(void* volatile *)p = v; fence(); }
+
+#endif // OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP
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 01e0380aeca..91c7e75a0b4 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
@@ -22,8 +22,42 @@
*
*/
-// do not include precompiled header file
-# include "incls/_os_solaris_x86.cpp.incl"
+// no precompiled headers
+#include "assembler_x86.inline.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_solaris.h"
+#include "memory/allocation.inline.hpp"
+#include "mutex_solaris.inline.hpp"
+#include "nativeInst_x86.hpp"
+#include "os_share_solaris.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "thread_solaris.inline.hpp"
+#include "utilities/events.hpp"
+#include "utilities/vmError.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
// put OS-includes here
# include
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp
index fb714bb9680..5841fb3eb59 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_SOLARIS_X86_VM_OS_SOLARIS_X86_HPP
+#define OS_CPU_SOLARIS_X86_VM_OS_SOLARIS_X86_HPP
+
//
// NOTE: we are back in class os here, not Solaris
//
@@ -48,3 +51,5 @@
// Used to register dynamic code cache area with the OS
// Note: Currently only used in 64 bit Windows implementations
static bool register_code_area(char *low, char *high) { return true; }
+
+#endif // OS_CPU_SOLARIS_X86_VM_OS_SOLARIS_X86_HPP
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/prefetch_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/prefetch_solaris_x86.inline.hpp
index f481c0be39e..a83b6f6d659 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/prefetch_solaris_x86.inline.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/prefetch_solaris_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,6 +22,11 @@
*
*/
+#ifndef OS_CPU_SOLARIS_X86_VM_PREFETCH_SOLARIS_X86_INLINE_HPP
+#define OS_CPU_SOLARIS_X86_VM_PREFETCH_SOLARIS_X86_INLINE_HPP
+
+#include "runtime/prefetch.hpp"
+
extern "C" {
void _Prefetch_read (void *loc, intx interval);
void _Prefetch_write(void *loc, intx interval);
@@ -39,3 +44,5 @@ inline void Prefetch::write(void *loc, intx interval) {
_Prefetch_write(loc, interval);
#endif // AMD64
}
+
+#endif // OS_CPU_SOLARIS_X86_VM_PREFETCH_SOLARIS_X86_INLINE_HPP
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.cpp
index 978d22d4fa6..439a09c9583 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.cpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_threadLS_solaris_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "thread_solaris.inline.hpp"
#ifdef AMD64
extern "C" Thread* fs_load(ptrdiff_t tlsOffset);
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp
index 6150f9f52ae..05a9e7c25dd 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_SOLARIS_X86_VM_THREADLS_SOLARIS_X86_HPP
+#define OS_CPU_SOLARIS_X86_VM_THREADLS_SOLARIS_X86_HPP
+
// Processor dependent parts of ThreadLocalStorage
private:
@@ -78,3 +81,5 @@ public:
// Java Thread
static inline Thread* thread();
+
+#endif // OS_CPU_SOLARIS_X86_VM_THREADLS_SOLARIS_X86_HPP
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 fa308d54630..b1f785ada9e 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_thread_solaris_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/frame.inline.hpp"
+#include "thread_solaris.inline.hpp"
// For Forte Analyzer AsyncGetCallTrace profiling support - thread is
// currently interrupted by SIGPROF
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp
index e44a83df685..d9665d3925c 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_SOLARIS_X86_VM_THREAD_SOLARIS_X86_HPP
+#define OS_CPU_SOLARIS_X86_VM_THREAD_SOLARIS_X86_HPP
+
private:
void pd_initialize() { _anchor.clear(); }
@@ -57,3 +60,5 @@
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}
+
+#endif // OS_CPU_SOLARIS_X86_VM_THREAD_SOLARIS_X86_HPP
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp
index 83575234d05..76338956021 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_SOLARIS_X86_VM_VMSTRUCTS_SOLARIS_X86_HPP
+#define OS_CPU_SOLARIS_X86_VM_VMSTRUCTS_SOLARIS_X86_HPP
+
// These are the OS and CPU-specific fields, types and integer
// constants required by the Serviceability Agent. This file is
// referenced by vmStructs.cpp.
@@ -57,3 +60,5 @@
\
/* This must be the last entry, and must be present */ \
last_entry()
+
+#endif // OS_CPU_SOLARIS_X86_VM_VMSTRUCTS_SOLARIS_X86_HPP
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/vm_version_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/vm_version_solaris_x86.cpp
index ee79c6c6189..f1a3c3a0b88 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/vm_version_solaris_x86.cpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/vm_version_solaris_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,5 +22,7 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_solaris_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_x86.hpp"
+
diff --git a/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp
index 3573d495e76..55e5053387d 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,8 +22,11 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_assembler_windows_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "asm/assembler.hpp"
+#include "assembler_x86.inline.hpp"
+#include "runtime/os.hpp"
+#include "runtime/threadLocalStorage.hpp"
void MacroAssembler::int3() {
diff --git a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp
index 462c498f3d4..7c26cb61051 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,14 @@
*
*/
+#ifndef OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
+#define OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
+
+#include "orderAccess_windows_x86.inline.hpp"
+#include "runtime/atomic.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_x86.hpp"
+
// The following alternative implementations are needed because
// Windows 95 doesn't support (some of) the corresponding Windows NT
// calls. Furthermore, these versions allow inlining in the caller.
@@ -249,3 +257,5 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void*
#endif // AMD64
#pragma warning(default: 4035) // Enables warnings reporting missing return statement
+
+#endif // OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
diff --git a/hotspot/src/os_cpu/windows_x86/vm/bytes_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/bytes_windows_x86.inline.hpp
index b1ea58b3892..49a79e40974 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/bytes_windows_x86.inline.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/bytes_windows_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_WINDOWS_X86_VM_BYTES_WINDOWS_X86_INLINE_HPP
+#define OS_CPU_WINDOWS_X86_VM_BYTES_WINDOWS_X86_INLINE_HPP
+
#pragma warning(disable: 4035) // Disable warning 4035: no return value
// Efficient swapping of data bytes from Java byte
@@ -80,3 +83,5 @@ inline u8 Bytes::swap_u8(u8 x) {
#endif // AMD64
#pragma warning(default: 4035) // Enable warning 4035: no return value
+
+#endif // OS_CPU_WINDOWS_X86_VM_BYTES_WINDOWS_X86_INLINE_HPP
diff --git a/hotspot/src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp
index 68a3359d405..f39b7a0a520 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP
+#define OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP
+
static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
(void)memmove(to, from, count * HeapWordSize);
}
@@ -164,3 +167,5 @@ static void pd_arrayof_conjoint_jlongs(HeapWord* from, HeapWord* to, size_t coun
static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) {
pd_conjoint_oops_atomic((oop*)from, (oop*)to, count);
}
+
+#endif // OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP
diff --git a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp
index 146c1c3e92f..9363190eb25 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
+#define OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
+
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)
@@ -46,3 +49,5 @@ define_pd_global(uintx, JVMInvokeMethodSlack, 8192);
define_pd_global(uintx, HeapBaseMinAddress, 2*G);
// Only used on 64 bit Windows platforms
define_pd_global(bool, UseVectoredExceptions, false);
+
+#endif // OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
diff --git a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp
index 1ccddc4d397..b47753bf656 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp
@@ -22,6 +22,12 @@
*
*/
+#ifndef OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
+#define OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
+
+#include "runtime/orderAccess.hpp"
+#include "vm_version_x86.hpp"
+
#pragma warning(disable: 4035) // Disables warnings reporting missing return statement
// Implementation of class OrderAccess.
@@ -208,3 +214,5 @@ inline void OrderAccess::release_store_ptr_fence(volatile void* p, void*
}
#pragma warning(default: 4035) // Enables warnings reporting missing return statement
+
+#endif // OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
diff --git a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp
index 549a3b47499..960ceab665a 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp
@@ -22,8 +22,43 @@
*
*/
-// do not include precompiled header file
-# include "incls/_os_windows_x86.cpp.incl"
+// no precompiled headers
+#include "assembler_x86.inline.hpp"
+#include "classfile/classLoader.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "code/icBuffer.hpp"
+#include "code/vtableStubs.hpp"
+#include "interpreter/interpreter.hpp"
+#include "jvm_windows.h"
+#include "memory/allocation.inline.hpp"
+#include "mutex_windows.inline.hpp"
+#include "nativeInst_x86.hpp"
+#include "os_share_windows.hpp"
+#include "prims/jniFastGetField.hpp"
+#include "prims/jvm.h"
+#include "prims/jvm_misc.hpp"
+#include "runtime/arguments.hpp"
+#include "runtime/extendedPC.hpp"
+#include "runtime/frame.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
+#include "runtime/java.hpp"
+#include "runtime/javaCalls.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/osThread.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/stubRoutines.hpp"
+#include "runtime/timer.hpp"
+#include "thread_windows.inline.hpp"
+#include "utilities/events.hpp"
+#include "utilities/vmError.hpp"
+#ifdef COMPILER1
+#include "c1/c1_Runtime1.hpp"
+#endif
+#ifdef COMPILER2
+#include "opto/runtime.hpp"
+#endif
+
# include "unwind_windows_x86.hpp"
#undef REG_SP
#undef REG_FP
diff --git a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp
index e5dcc78bdfc..e7c3303c0f7 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_WINDOWS_X86_VM_OS_WINDOWS_X86_HPP
+#define OS_CPU_WINDOWS_X86_VM_OS_WINDOWS_X86_HPP
+
//
// NOTE: we are back in class os here, not win32
//
@@ -56,3 +59,5 @@
static bool supports_sse() { return true; }
static bool register_code_area(char *low, char *high);
+
+#endif // OS_CPU_WINDOWS_X86_VM_OS_WINDOWS_X86_HPP
diff --git a/hotspot/src/os_cpu/windows_x86/vm/prefetch_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/prefetch_windows_x86.inline.hpp
index 5294ec7d9bf..a09c1947755 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/prefetch_windows_x86.inline.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/prefetch_windows_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,5 +22,12 @@
*
*/
+#ifndef OS_CPU_WINDOWS_X86_VM_PREFETCH_WINDOWS_X86_INLINE_HPP
+#define OS_CPU_WINDOWS_X86_VM_PREFETCH_WINDOWS_X86_INLINE_HPP
+
+#include "runtime/prefetch.hpp"
+
inline void Prefetch::read (void *loc, intx interval) {}
inline void Prefetch::write(void *loc, intx interval) {}
+
+#endif // OS_CPU_WINDOWS_X86_VM_PREFETCH_WINDOWS_X86_INLINE_HPP
diff --git a/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp
index 103730575a7..9bb8b4ad7ab 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,14 +22,15 @@
*
*/
+#include "precompiled.hpp"
+#include "runtime/threadLocalStorage.hpp"
+#include "thread_windows.inline.hpp"
+
// Provides an entry point we can link against and
// a buffer we can emit code into. The buffer is
// filled by ThreadLocalStorage::generate_code_for_get_thread
// and called from ThreadLocalStorage::thread()
-#include "incls/_precompiled.incl"
-#include "incls/_threadLS_windows_x86.cpp.incl"
-
int ThreadLocalStorage::_thread_ptr_offset = 0;
static void call_wrapper_dummy() {}
diff --git a/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.hpp
index edb7fa18a3f..a764d7376f5 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_WINDOWS_X86_VM_THREADLS_WINDOWS_X86_HPP
+#define OS_CPU_WINDOWS_X86_VM_THREADLS_WINDOWS_X86_HPP
+
// Processor dependent parts of ThreadLocalStorage
protected:
@@ -42,3 +45,5 @@ public:
static inline void set_thread_ptr_offset( int offset ) { _thread_ptr_offset = offset; }
static inline int get_thread_ptr_offset() { return _thread_ptr_offset; }
+
+#endif // OS_CPU_WINDOWS_X86_VM_THREADLS_WINDOWS_X86_HPP
diff --git a/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp
index 7334845c3d9..6f8c4b84ac5 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,8 +22,9 @@
*
*/
-#include "incls/_precompiled.incl"
-#include "incls/_thread_windows_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/frame.inline.hpp"
+#include "thread_windows.inline.hpp"
// For Forte Analyzer AsyncGetCallTrace profiling support - thread is
// currently interrupted by SIGPROF
diff --git a/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp
index 11e018068a0..1199a3c5b45 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/thread_windows_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_WINDOWS_X86_VM_THREAD_WINDOWS_X86_HPP
+#define OS_CPU_WINDOWS_X86_VM_THREAD_WINDOWS_X86_HPP
+
private:
void pd_initialize() {
_anchor.clear();
@@ -60,3 +63,5 @@
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}
+
+#endif // OS_CPU_WINDOWS_X86_VM_THREAD_WINDOWS_X86_HPP
diff --git a/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp
index 9ad977224f4..6762bf2308a 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_WINDOWS_X86_VM_UNWIND_WINDOWS_X86_HPP
+#define OS_CPU_WINDOWS_X86_VM_UNWIND_WINDOWS_X86_HPP
+
#ifdef AMD64
typedef unsigned char UBYTE;
@@ -81,3 +84,5 @@ typedef EXCEPTION_DISPOSITION (*PEXCEPTION_ROUTINE) (
#endif
#endif // AMD64
+
+#endif // OS_CPU_WINDOWS_X86_VM_UNWIND_WINDOWS_X86_HPP
diff --git a/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp
index 765b2423949..6df1f7226fa 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,6 +22,9 @@
*
*/
+#ifndef OS_CPU_WINDOWS_X86_VM_VMSTRUCTS_WINDOWS_X86_HPP
+#define OS_CPU_WINDOWS_X86_VM_VMSTRUCTS_WINDOWS_X86_HPP
+
// These are the OS and CPU-specific fields, types and integer
// constants required by the Serviceability Agent. This file is
// referenced by vmStructs.cpp.
@@ -52,3 +55,5 @@
\
/* This must be the last entry, and must be present */ \
last_entry()
+
+#endif // OS_CPU_WINDOWS_X86_VM_VMSTRUCTS_WINDOWS_X86_HPP
diff --git a/hotspot/src/os_cpu/windows_x86/vm/vm_version_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/vm_version_windows_x86.cpp
index d88236783ac..f1a3c3a0b88 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/vm_version_windows_x86.cpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/vm_version_windows_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,5 +22,7 @@
*
*/
-# include "incls/_precompiled.incl"
-# include "incls/_vm_version_windows_x86.cpp.incl"
+#include "precompiled.hpp"
+#include "runtime/os.hpp"
+#include "vm_version_x86.hpp"
+
diff --git a/hotspot/src/share/tools/MakeDeps/Database.java b/hotspot/src/share/tools/MakeDeps/Database.java
deleted file mode 100644
index 2a19c29f082..00000000000
--- a/hotspot/src/share/tools/MakeDeps/Database.java
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- */
-
-import java.io.*;
-import java.util.*;
-
-public class Database {
- private MacroDefinitions macros;
- // allFiles is kept in lexicographically sorted order. See get().
- private FileList allFiles;
- // files that have implicit dependency on platform files
- // e.g. os.hpp: os_.hpp os_.hpp but only
- // recorded if the platform file was seen.
- private FileList platformFiles;
- private FileList outerFiles;
- private FileList indivIncludes;
- private FileList grandInclude; // the results for the grand include file
- private HashMap