# HG changeset patch # User lana # Date 1390936886 28800 # Node ID def24c6b5019285ffcc5fc3fc58c8f33baaef739 # Parent 6a74da13c52f6eb4b2530a707d5430f4ce11ab84# Parent b32e2219736e42baaf45daf0ad67ed34f6033799 Merge diff -r 6a74da13c52f -r def24c6b5019 .hgtags --- a/.hgtags Tue Jan 28 14:47:22 2014 +0100 +++ b/.hgtags Tue Jan 28 11:21:26 2014 -0800 @@ -243,3 +243,4 @@ 87b743b2263cc53955266411b7797b365a0fb050 jdk8-b119 a1ee9743f4ee165eae59389a020f2552f895dac8 jdk8-b120 13b877757b0b1c0d5813298df85364f41d7ba6fe jdk9-b00 +f130ca87de6637acae7d99fcd7a8573eea1cbaed jdk9-b01 diff -r 6a74da13c52f -r def24c6b5019 .hgtags-top-repo --- a/.hgtags-top-repo Tue Jan 28 14:47:22 2014 +0100 +++ b/.hgtags-top-repo Tue Jan 28 11:21:26 2014 -0800 @@ -243,3 +243,4 @@ 9e90215673be68a3e77a9e444e4232076373734d jdk8-b119 cd3825b2983045784d6fc6d1729c799b08215752 jdk8-b120 1e1f86d5d4e22c15a9bf9f1581acddb8c59abae2 jdk9-b00 +50669e45cec4491de0d921d3118a3fe2e767020a jdk9-b01 diff -r 6a74da13c52f -r def24c6b5019 corba/.hgtags --- a/corba/.hgtags Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/.hgtags Tue Jan 28 11:21:26 2014 -0800 @@ -243,3 +243,4 @@ 379fc7609beb7a3d85ebc0cc21a8a51c60d3c7d3 jdk8-b119 53fd772d28c8a9f0f43adfc06f75f6b3cfa93cb5 jdk8-b120 a7d3638deb2f4e33217b1ecf889479e90f9e5b50 jdk9-b00 +79a8136b18c1c6848f500088f5a4b39f262f082d jdk9-b01 diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java --- a/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java Tue Jan 28 11:21:26 2014 -0800 @@ -82,11 +82,18 @@ super((ORB)orb); } - public org.omg.CORBA.portable.InputStream create_input_stream() - { - return new AnyInputStream( - (com.sun.corba.se.impl.encoding.EncapsInputStream) - super.create_input_stream()); + public org.omg.CORBA.portable.InputStream create_input_stream() { + final org.omg.CORBA.portable.InputStream is = super + .create_input_stream(); + AnyInputStream aIS = AccessController + .doPrivileged(new PrivilegedAction() { + @Override + public AnyInputStream run() { + return new AnyInputStream( + (com.sun.corba.se.impl.encoding.EncapsInputStream) is); + } + }); + return aIS; } } diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/encoding/EncapsInputStream.java --- a/corba/src/share/classes/com/sun/corba/se/impl/encoding/EncapsInputStream.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/encoding/EncapsInputStream.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,11 +36,10 @@ import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; import com.sun.corba.se.spi.orb.ORB; - import com.sun.corba.se.spi.logging.CORBALogDomains; - import com.sun.corba.se.impl.logging.ORBUtilSystemException; +import sun.corba.EncapsInputStreamFactory; /** * Encapsulations are supposed to explicitly define their * code sets and GIOP version. The original resolution to issue 2784 @@ -148,7 +147,7 @@ } public CDRInputStream dup() { - return new EncapsInputStream(this); + return EncapsInputStreamFactory.newEncapsInputStream(this); } protected CodeSetConversion.BTCConverter createCharBTCConverter() { diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/encoding/EncapsOutputStream.java --- a/corba/src/share/classes/com/sun/corba/se/impl/encoding/EncapsOutputStream.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/encoding/EncapsOutputStream.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,8 @@ import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; import com.sun.corba.se.impl.orbutil.ORBConstants; +import sun.corba.EncapsInputStreamFactory; + /** * Encapsulations are supposed to explicitly define their * code sets and GIOP version. The original resolution to issue 2784 @@ -107,11 +109,11 @@ public org.omg.CORBA.portable.InputStream create_input_stream() { freeInternalCaches(); - return new EncapsInputStream(orb(), - getByteBuffer(), - getSize(), - isLittleEndian(), - getGIOPVersion()); + return EncapsInputStreamFactory.newEncapsInputStream(orb(), + getByteBuffer(), + getSize(), + isLittleEndian(), + getGIOPVersion()); } protected CodeSetConversion.CTBConverter createCharCTBConverter() { diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeInputStream.java --- a/corba/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeInputStream.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeInputStream.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,6 +64,8 @@ import com.sun.corba.se.impl.encoding.CDROutputStream; import com.sun.corba.se.impl.encoding.MarshalInputStream; +import sun.corba.EncapsInputStreamFactory; + public class TypeCodeInputStream extends EncapsInputStream implements TypeCodeReader { private Map typeMap = null; @@ -157,11 +159,13 @@ // create an encapsulation using the marshal buffer if (is instanceof CDRInputStream) { - encap = new TypeCodeInputStream((ORB)_orb, encapBuffer, encapBuffer.length, - ((CDRInputStream)is).isLittleEndian(), - ((CDRInputStream)is).getGIOPVersion()); + encap = EncapsInputStreamFactory.newTypeCodeInputStream((ORB) _orb, + encapBuffer, encapBuffer.length, + ((CDRInputStream) is).isLittleEndian(), + ((CDRInputStream) is).getGIOPVersion()); } else { - encap = new TypeCodeInputStream((ORB)_orb, encapBuffer, encapBuffer.length); + encap = EncapsInputStreamFactory.newTypeCodeInputStream((ORB) _orb, + encapBuffer, encapBuffer.length); } encap.setEnclosingInputStream(is); encap.makeEncapsulation(); diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java --- a/corba/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java Tue Jan 28 11:21:26 2014 -0800 @@ -61,6 +61,8 @@ import java.math.BigInteger; import java.nio.ByteBuffer; +import sun.corba.EncapsInputStreamFactory; + public final class TypeCodeOutputStream extends EncapsOutputStream { private OutputStream enclosure = null; @@ -77,9 +79,9 @@ public org.omg.CORBA.portable.InputStream create_input_stream() { - //return new TypeCodeInputStream((ORB)orb(), getByteBuffer(), getIndex(), isLittleEndian()); - TypeCodeInputStream tcis - = new TypeCodeInputStream((ORB)orb(), getByteBuffer(), getIndex(), isLittleEndian(), getGIOPVersion()); + TypeCodeInputStream tcis = EncapsInputStreamFactory + .newTypeCodeInputStream((ORB) orb(), getByteBuffer(), + getIndex(), isLittleEndian(), getGIOPVersion()); //if (TypeCodeImpl.debug) { //System.out.println("Created TypeCodeInputStream " + tcis + " with no parent"); //tcis.printBuffer(); diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/interceptors/CDREncapsCodec.java --- a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/CDREncapsCodec.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/CDREncapsCodec.java Tue Jan 28 11:21:26 2014 -0800 @@ -33,6 +33,8 @@ import com.sun.corba.se.spi.ior.iiop.GIOPVersion; import com.sun.corba.se.spi.logging.CORBALogDomains; +import sun.corba.EncapsInputStreamFactory; + import com.sun.corba.se.impl.corba.AnyImpl; import com.sun.corba.se.impl.encoding.EncapsInputStream; import com.sun.corba.se.impl.encoding.EncapsOutputStream; @@ -193,8 +195,9 @@ // it is turned into a FormatMismatch exception. try { - EncapsInputStream cdrIn = new EncapsInputStream( orb, data, - data.length, giopVersion ); + EncapsInputStream cdrIn = EncapsInputStreamFactory.newEncapsInputStream( orb, data, + data.length, giopVersion ); + cdrIn.consumeEndian(); diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java --- a/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java Tue Jan 28 11:21:26 2014 -0800 @@ -370,7 +370,7 @@ * @exception IOException Any of the usual Input/Output related exceptions. * @since JDK1.1 */ - public final Object readObjectDelegate() throws IOException + public final synchronized Object readObjectDelegate() throws IOException { try { @@ -389,7 +389,7 @@ } } - final Object simpleReadObject(Class clz, + final synchronized Object simpleReadObject(Class clz, String repositoryID, com.sun.org.omg.SendingContext.CodeBase sender, int offset) @@ -461,7 +461,7 @@ return obj; } - public final void simpleSkipObject(String repositoryID, + public final synchronized void simpleSkipObject(String repositoryID, com.sun.org.omg.SendingContext.CodeBase sender) /* throws OptionalDataException, ClassNotFoundException, IOException */ { @@ -559,7 +559,7 @@ * objects. * @since JDK1.1 */ - public final void defaultReadObjectDelegate() + final synchronized void defaultReadObjectDelegate() /* throws IOException, ClassNotFoundException, NotActiveException */ { try { @@ -988,7 +988,7 @@ } } - private Object inputObject(Class clz, + private synchronized Object inputObject(Class clz, String repositoryID, com.sun.org.omg.SendingContext.CodeBase sender, int offset) @@ -1317,7 +1317,7 @@ * a form of custom marshaling. * */ - private Object inputObjectUsingFVD(Class clz, + private synchronized Object inputObjectUsingFVD(Class clz, String repositoryID, com.sun.org.omg.SendingContext.CodeBase sender, int offset) diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/io/InputStreamHook.java --- a/corba/src/share/classes/com/sun/corba/se/impl/io/InputStreamHook.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/io/InputStreamHook.java Tue Jan 28 11:21:26 2014 -0800 @@ -201,7 +201,7 @@ readObjectState.endDefaultReadObject(this); } - public abstract void defaultReadObjectDelegate(); + abstract void defaultReadObjectDelegate(); abstract void readFields(java.util.Map fieldToValueMap) throws java.io.InvalidClassException, java.io.StreamCorruptedException, diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/ior/EncapsulationUtility.java --- a/corba/src/share/classes/com/sun/corba/se/impl/ior/EncapsulationUtility.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/ior/EncapsulationUtility.java Tue Jan 28 11:21:26 2014 -0800 @@ -47,6 +47,8 @@ import com.sun.corba.se.impl.encoding.EncapsOutputStream ; import com.sun.corba.se.impl.encoding.EncapsInputStream ; +import sun.corba.EncapsInputStreamFactory; + /** * This static utility class contains various utility methods for reading and * writing CDR encapsulations. @@ -108,8 +110,8 @@ static public InputStream getEncapsulationStream( InputStream is ) { byte[] data = readOctets( is ) ; - EncapsInputStream result = new EncapsInputStream( is.orb(), data, - data.length ) ; + EncapsInputStream result = EncapsInputStreamFactory.newEncapsInputStream( is.orb(), data, + data.length ) ; result.consumeEndian() ; return result ; } diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/ior/ObjectKeyFactoryImpl.java --- a/corba/src/share/classes/com/sun/corba/se/impl/ior/ObjectKeyFactoryImpl.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/ior/ObjectKeyFactoryImpl.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,6 +49,8 @@ import com.sun.corba.se.impl.logging.IORSystemException ; import com.sun.corba.se.impl.encoding.EncapsInputStream ; +import sun.corba.EncapsInputStreamFactory; + /** Based on the magic and scid, return the appropriate * ObjectKeyTemplate. Expects to be called with a valid @@ -217,7 +219,7 @@ public ObjectKey create( byte[] key ) { OctetSeqHolder osh = new OctetSeqHolder() ; - EncapsInputStream is = new EncapsInputStream( orb, key, key.length ) ; + EncapsInputStream is = EncapsInputStreamFactory.newEncapsInputStream( orb, key, key.length ); ObjectKeyTemplate oktemp = create( is, fullKey, osh ) ; if (oktemp == null) diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java --- a/corba/src/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java Tue Jan 28 11:21:26 2014 -0800 @@ -70,6 +70,8 @@ import com.sun.corba.se.impl.encoding.EncapsInputStream ; import com.sun.corba.se.impl.encoding.EncapsOutputStream ; +import sun.corba.EncapsInputStreamFactory; + import com.sun.corba.se.impl.util.JDKBridge; import com.sun.corba.se.impl.logging.IORSystemException; @@ -170,8 +172,8 @@ throw wrapper.invalidTaggedProfile() ; } - EncapsInputStream istr = new EncapsInputStream((ORB)orb, profile.profile_data, - profile.profile_data.length); + EncapsInputStream istr = EncapsInputStreamFactory.newEncapsInputStream((ORB)orb, profile.profile_data, + profile.profile_data.length); istr.consumeEndian(); init( istr ) ; } diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryDynamicBase.java --- a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryDynamicBase.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryDynamicBase.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ package com.sun.corba.se.impl.presentation.rmi ; +import java.io.SerializablePermission; import java.lang.reflect.InvocationHandler ; import java.lang.reflect.Proxy ; @@ -38,11 +39,18 @@ { protected final ClassLoader loader ; - public StubFactoryDynamicBase( PresentationManager.ClassData classData, - ClassLoader loader ) - { - super( classData ) ; + private static Void checkPermission() { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new SerializablePermission( + "enableSubclassImplementation")); + } + return null; + } + private StubFactoryDynamicBase(Void unused, + PresentationManager.ClassData classData, ClassLoader loader) { + super(classData); // this.loader must not be null, or the newProxyInstance call // will fail. if (loader == null) { @@ -55,5 +63,11 @@ } } + public StubFactoryDynamicBase( PresentationManager.ClassData classData, + ClassLoader loader ) + { + this (checkPermission(), classData, loader); + } + public abstract org.omg.CORBA.Object makeStub() ; } diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryFactoryProxyImpl.java --- a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryFactoryProxyImpl.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/StubFactoryFactoryProxyImpl.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,14 +25,22 @@ package com.sun.corba.se.impl.presentation.rmi; +import java.security.AccessController; +import java.security.PrivilegedAction; import com.sun.corba.se.spi.presentation.rmi.PresentationManager ; public class StubFactoryFactoryProxyImpl extends StubFactoryFactoryDynamicBase { public PresentationManager.StubFactory makeDynamicStubFactory( - PresentationManager pm, PresentationManager.ClassData classData, - ClassLoader classLoader ) + PresentationManager pm, final PresentationManager.ClassData classData, + final ClassLoader classLoader ) { - return new StubFactoryProxyImpl( classData, classLoader ) ; + return AccessController + .doPrivileged(new PrivilegedAction() { + @Override + public StubFactoryProxyImpl run() { + return new StubFactoryProxyImpl(classData, classLoader); + } + }); } } diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java --- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -115,6 +115,7 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentHashMap; +import sun.corba.EncapsInputStreamFactory; /** * ClientDelegate is the RMI client-side subcontract or representation @@ -847,8 +848,8 @@ } byte[] data = ((UnknownServiceContext)sc).getData(); EncapsInputStream in = - new EncapsInputStream((ORB)messageMediator.getBroker(), - data, data.length); + EncapsInputStreamFactory.newEncapsInputStream((ORB)messageMediator.getBroker(), + data, data.length); in.consumeEndian(); String msg = diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/protocol/SharedCDRClientRequestDispatcherImpl.java --- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/SharedCDRClientRequestDispatcherImpl.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/protocol/SharedCDRClientRequestDispatcherImpl.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,8 @@ import java.util.Iterator; import java.rmi.RemoteException; import java.nio.ByteBuffer; - +import java.security.AccessController; +import java.security.PrivilegedAction; import javax.rmi.CORBA.Util; import javax.rmi.CORBA.Tie; @@ -111,6 +112,7 @@ import com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr; import com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr; import com.sun.corba.se.impl.transport.CorbaContactInfoListIteratorImpl; +import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; import com.sun.corba.se.impl.util.JDKBridge; /** @@ -156,10 +158,17 @@ ByteBufferWithInfo bbwi = cdrOutputObject.getByteBufferWithInfo(); cdrOutputObject.getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize()); - - CDRInputObject cdrInputObject = - new CDRInputObject(orb, null, bbwi.byteBuffer, - cdrOutputObject.getMessageHeader()); + final ORB inOrb = orb; + final ByteBuffer inBuffer = bbwi.byteBuffer; + final Message inMsg = cdrOutputObject.getMessageHeader(); + CDRInputObject cdrInputObject = AccessController + .doPrivileged(new PrivilegedAction() { + @Override + public CDRInputObject run() { + return new CDRInputObject(inOrb, null, inBuffer, + inMsg); + } + }); messageMediator.setInputObject(cdrInputObject); cdrInputObject.setMessageMediator(messageMediator); @@ -192,9 +201,17 @@ cdrOutputObject = (CDROutputObject) messageMediator.getOutputObject(); bbwi = cdrOutputObject.getByteBufferWithInfo(); cdrOutputObject.getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize()); - cdrInputObject = - new CDRInputObject(orb, null, bbwi.byteBuffer, - cdrOutputObject.getMessageHeader()); + final ORB inOrb2 = orb; + final ByteBuffer inBuffer2 = bbwi.byteBuffer; + final Message inMsg2 = cdrOutputObject.getMessageHeader(); + cdrInputObject = AccessController + .doPrivileged(new PrivilegedAction() { + @Override + public CDRInputObject run() { + return new CDRInputObject(inOrb2, null, inBuffer2, + inMsg2); + } + }); messageMediator.setInputObject(cdrInputObject); cdrInputObject.setMessageMediator(messageMediator); diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java --- a/corba/src/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,8 @@ import org.omg.CosNaming.NamingContextExt ; import org.omg.CosNaming.NamingContextExtHelper ; +import sun.corba.EncapsInputStreamFactory; + import com.sun.corba.se.spi.ior.IOR; import com.sun.corba.se.spi.ior.IORTemplate; import com.sun.corba.se.spi.ior.ObjectKey; @@ -114,8 +116,8 @@ buf[j] = (byte)((ORBUtility.hexOf(str.charAt(i)) << UN_SHIFT) & 0xF0); buf[j] |= (byte)(ORBUtility.hexOf(str.charAt(i+1)) & 0x0F); } - EncapsInputStream s = new EncapsInputStream(orb, buf, buf.length, - orb.getORBData().getGIOPVersion()); + EncapsInputStream s = EncapsInputStreamFactory.newEncapsInputStream(orb, buf, buf.length, + orb.getORBData().getGIOPVersion()); s.consumeEndian(); return s.read_Object() ; } diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContexts.java --- a/corba/src/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContexts.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContexts.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,6 +58,9 @@ import com.sun.corba.se.impl.util.Utility ; import com.sun.corba.se.impl.logging.ORBUtilSystemException ; +import sun.corba.EncapsInputStreamFactory; + + public class ServiceContexts { private static boolean isDebugging( OutputStream os ) { @@ -198,11 +201,11 @@ // Note: As of Jan 2001, no standard OMG or Sun service contexts // ship wchar data or are defined as using anything but GIOP 1.0 CDR. EncapsInputStream eis - = new EncapsInputStream(orb, - data, - data.length, - giopVersion, - codeBase); + = EncapsInputStreamFactory.newEncapsInputStream(orb, + data, + data.length, + giopVersion, + codeBase); eis.consumeEndian(); // Now the input stream passed to a ServiceContext diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/org/omg/CORBA_2_3/portable/InputStream.java --- a/corba/src/share/classes/org/omg/CORBA_2_3/portable/InputStream.java Tue Jan 28 14:47:22 2014 +0100 +++ b/corba/src/share/classes/org/omg/CORBA_2_3/portable/InputStream.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,10 @@ package org.omg.CORBA_2_3.portable; +import java.io.SerializablePermission; +import java.security.AccessController; +import java.security.PrivilegedAction; + /** * InputStream provides for the reading of all of the mapped IDL types * from the stream. It extends org.omg.CORBA.portable.InputStream. This @@ -43,6 +47,43 @@ public abstract class InputStream extends org.omg.CORBA.portable.InputStream { + + private static final String ALLOW_SUBCLASS_PROP = "jdk.corba.allowInputStreamSubclass"; + + private static final boolean allowSubclass = AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public Boolean run() { + String prop = System.getProperty(ALLOW_SUBCLASS_PROP); + return prop == null ? false : + (prop.equalsIgnoreCase("false") ? false : true); + } + }); + + private static Void checkPermission() { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + if (!allowSubclass) + sm.checkPermission(new + SerializablePermission("enableSubclassImplementation")); + } + return null; + } + + private InputStream(Void ignore) { } + + /** + * Create a new instance of this class. + * + * throw SecurityException if SecurityManager is installed and + * enableSubclassImplementation SerializablePermission + * is not granted or jdk.corba.allowOutputStreamSubclass system + * property is either not set or is set to 'false' + */ + public InputStream() { + this(checkPermission()); + } + /** * Unmarshalls a value type from the input stream. * @return the value type unmarshalled from the input stream diff -r 6a74da13c52f -r def24c6b5019 corba/src/share/classes/sun/corba/EncapsInputStreamFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/corba/src/share/classes/sun/corba/EncapsInputStreamFactory.java Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.corba; + +import java.nio.ByteBuffer; +import java.security.AccessController; +import java.security.PrivilegedAction; + + +import com.sun.corba.se.impl.encoding.EncapsInputStream; +import com.sun.corba.se.impl.encoding.TypeCodeInputStream; +import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; +import com.sun.corba.se.pept.protocol.MessageMediator; +import com.sun.corba.se.spi.ior.iiop.GIOPVersion; +import com.sun.corba.se.spi.orb.ORB; +import com.sun.org.omg.SendingContext.CodeBase; + +public class EncapsInputStreamFactory { + + public static EncapsInputStream newEncapsInputStream( + final org.omg.CORBA.ORB orb, final byte[] buf, final int size, + final boolean littleEndian, final GIOPVersion version) { + return AccessController + .doPrivileged(new PrivilegedAction() { + @Override + public EncapsInputStream run() { + return new EncapsInputStream(orb, buf, size, + littleEndian, version); + } + }); + } + + public static EncapsInputStream newEncapsInputStream( + final org.omg.CORBA.ORB orb, final ByteBuffer byteBuffer, + final int size, final boolean littleEndian, + final GIOPVersion version) { + return AccessController + .doPrivileged(new PrivilegedAction() { + @Override + public EncapsInputStream run() { + return new EncapsInputStream(orb, byteBuffer, size, + littleEndian, version); + } + }); + } + + public static EncapsInputStream newEncapsInputStream( + final org.omg.CORBA.ORB orb, final byte[] data, final int size) { + return AccessController + .doPrivileged(new PrivilegedAction() { + @Override + public EncapsInputStream run() { + return new EncapsInputStream(orb, data, size); + } + }); + } + + public static EncapsInputStream newEncapsInputStream( + final EncapsInputStream eis) { + return AccessController + .doPrivileged(new PrivilegedAction() { + @Override + public EncapsInputStream run() { + return new EncapsInputStream(eis); + } + }); + } + + public static EncapsInputStream newEncapsInputStream( + final org.omg.CORBA.ORB orb, final byte[] data, final int size, + final GIOPVersion version) { + return AccessController + .doPrivileged(new PrivilegedAction() { + @Override + public EncapsInputStream run() { + return new EncapsInputStream(orb, data, size, version); + } + }); + } + + public static EncapsInputStream newEncapsInputStream( + final org.omg.CORBA.ORB orb, final byte[] data, final int size, + final GIOPVersion version, final CodeBase codeBase) { + return AccessController + .doPrivileged(new PrivilegedAction() { + @Override + public EncapsInputStream run() { + return new EncapsInputStream(orb, data, size, version, + codeBase); + } + }); + } + + public static TypeCodeInputStream newTypeCodeInputStream( + final org.omg.CORBA.ORB orb, final byte[] buf, final int size, + final boolean littleEndian, final GIOPVersion version) { + return AccessController + .doPrivileged(new PrivilegedAction() { + @Override + public TypeCodeInputStream run() { + return new TypeCodeInputStream(orb, buf, size, + littleEndian, version); + } + }); + } + + public static TypeCodeInputStream newTypeCodeInputStream( + final org.omg.CORBA.ORB orb, final ByteBuffer byteBuffer, + final int size, final boolean littleEndian, + final GIOPVersion version) { + return AccessController + .doPrivileged(new PrivilegedAction() { + @Override + public TypeCodeInputStream run() { + return new TypeCodeInputStream(orb, byteBuffer, size, + littleEndian, version); + } + }); + } + + public static TypeCodeInputStream newTypeCodeInputStream( + final org.omg.CORBA.ORB orb, final byte[] data, final int size) { + return AccessController + .doPrivileged(new PrivilegedAction() { + @Override + public TypeCodeInputStream run() { + return new TypeCodeInputStream(orb, data, size); + } + }); + } +} diff -r 6a74da13c52f -r def24c6b5019 hotspot/.hgtags --- a/hotspot/.hgtags Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/.hgtags Tue Jan 28 11:21:26 2014 -0800 @@ -403,3 +403,4 @@ 05fedd51e40da22c9460bf17c7185889e435db3d hs25-b62 fca262db9c4309f99d2f5542ab0780e45c2f1578 jdk8-b120 ce2d7e46f3c7e41241f3b407705a4071323a11ab jdk9-b00 +050a626a88951140df874f7b163e304d07b6c296 jdk9-b01 diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/make/Makefile --- a/hotspot/agent/make/Makefile Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/make/Makefile Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/os/linux/libproc.h --- a/hotspot/agent/src/os/linux/libproc.h Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/os/linux/libproc.h Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/os/linux/salibelf.c --- a/hotspot/agent/src/os/linux/salibelf.c Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/os/linux/salibelf.c Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/os/linux/symtab.c --- a/hotspot/agent/src/os/linux/symtab.c Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/os/linux/symtab.c Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -214,8 +214,10 @@ + 2); strcpy(debug_pathname, name); char *last_slash = strrchr(debug_pathname, '/'); - if (last_slash == NULL) + if (last_slash == NULL) { + free(debug_pathname); return -1; + } /* Look in the same directory as the object. */ strcpy(last_slash+1, debug_filename); diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/os/solaris/proc/saproc.cpp --- a/hotspot/agent/src/os/solaris/proc/saproc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/os/solaris/proc/saproc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/os/win32/windbg/sawindbg.cpp --- a/hotspot/agent/src/os/win32/windbg/sawindbg.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/os/win32/windbg/sawindbg.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,9 +95,15 @@ int entryBci = task.osrBci(); int compLevel = task.compLevel(); Klass holder = method.getMethodHolder(); - out.println("compile " + holder.getName().asString() + " " + - OopUtilities.escapeString(method.getName().asString()) + " " + - method.getSignature().asString() + " " + - entryBci + " " + compLevel); + out.print("compile " + holder.getName().asString() + " " + + OopUtilities.escapeString(method.getName().asString()) + " " + + method.getSignature().asString() + " " + + entryBci + " " + compLevel); + Compile compiler = compilerData(); + if (compiler != null) { + // Dump inlining data. + compiler.dumpInlineData(out); + } + out.println(); } } diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java Tue Jan 28 11:21:26 2014 -0800 @@ -24,19 +24,29 @@ package sun.jvm.hotspot.jdi; -import com.sun.jdi.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; import sun.jvm.hotspot.oops.ArrayKlass; +import sun.jvm.hotspot.oops.Instance; import sun.jvm.hotspot.oops.InstanceKlass; -import sun.jvm.hotspot.oops.ObjArrayKlass; -import sun.jvm.hotspot.oops.TypeArrayKlass; import sun.jvm.hotspot.oops.Klass; -import sun.jvm.hotspot.oops.Instance; +import sun.jvm.hotspot.oops.ObjArrayKlass; import sun.jvm.hotspot.oops.Symbol; -import java.util.List; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Map; +import sun.jvm.hotspot.oops.TypeArrayKlass; + +import com.sun.jdi.ArrayReference; +import com.sun.jdi.ArrayType; +import com.sun.jdi.ClassLoaderReference; +import com.sun.jdi.ClassNotLoadedException; +import com.sun.jdi.InterfaceType; +import com.sun.jdi.Method; +import com.sun.jdi.PrimitiveType; +import com.sun.jdi.ReferenceType; +import com.sun.jdi.Type; +import com.sun.jdi.VirtualMachine; public class ArrayTypeImpl extends ReferenceTypeImpl implements ArrayType { protected ArrayTypeImpl(VirtualMachine aVm, ArrayKlass aRef) { @@ -75,7 +85,8 @@ } } - void addVisibleMethods(Map methodMap) { + @Override + void addVisibleMethods(Map methodMap, Set handledInterfaces) { // arrays don't have methods } diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java Tue Jan 28 11:21:26 2014 -0800 @@ -24,12 +24,30 @@ package sun.jvm.hotspot.jdi; -import com.sun.jdi.*; -import sun.jvm.hotspot.oops.Klass; +import java.lang.ref.SoftReference; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + import sun.jvm.hotspot.oops.InstanceKlass; -import java.util.*; -import java.lang.ref.SoftReference; +import com.sun.jdi.ClassNotLoadedException; +import com.sun.jdi.ClassType; +import com.sun.jdi.Field; +import com.sun.jdi.IncompatibleThreadStateException; +import com.sun.jdi.InterfaceType; +import com.sun.jdi.InvalidTypeException; +import com.sun.jdi.InvocationException; +import com.sun.jdi.Method; +import com.sun.jdi.ObjectReference; +import com.sun.jdi.ReferenceType; +import com.sun.jdi.ThreadReference; +import com.sun.jdi.Value; +import com.sun.jdi.VirtualMachine; public class ClassTypeImpl extends ReferenceTypeImpl implements ClassType @@ -195,22 +213,26 @@ return null; } - void addVisibleMethods(Map methodMap) { + @Override + void addVisibleMethods(Map methodMap, Set seenInterfaces) { /* * Add methods from * parent types first, so that the methods in this class will * overwrite them in the hash table */ - Iterator iter = interfaces().iterator(); + Iterator iter = interfaces().iterator(); while (iter.hasNext()) { InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next(); - interfaze.addVisibleMethods(methodMap); + if (!seenInterfaces.contains(interfaze)) { + interfaze.addVisibleMethods(methodMap, seenInterfaces); + seenInterfaces.add(interfaze); + } } ClassTypeImpl clazz = (ClassTypeImpl)superclass(); if (clazz != null) { - clazz.addVisibleMethods(methodMap); + clazz.addVisibleMethods(methodMap, seenInterfaces); } addToMethodMap(methodMap, methods()); diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java Tue Jan 28 11:21:26 2014 -0800 @@ -24,15 +24,22 @@ package sun.jvm.hotspot.jdi; -import com.sun.jdi.*; +import java.lang.ref.SoftReference; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + import sun.jvm.hotspot.oops.InstanceKlass; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.Iterator; -import java.util.Collections; -import java.lang.ref.SoftReference; +import com.sun.jdi.ClassNotPreparedException; +import com.sun.jdi.ClassType; +import com.sun.jdi.InterfaceType; +import com.sun.jdi.Method; +import com.sun.jdi.ReferenceType; +import com.sun.jdi.VirtualMachine; public class InterfaceTypeImpl extends ReferenceTypeImpl implements InterfaceType { @@ -96,16 +103,20 @@ return implementors; } - void addVisibleMethods(Map methodMap) { + @Override + void addVisibleMethods(Map methodMap, Set seenInterfaces) { /* * Add methods from * parent types first, so that the methods in this class will * overwrite them in the hash table */ - Iterator iter = superinterfaces().iterator(); + Iterator iter = superinterfaces().iterator(); while (iter.hasNext()) { InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next(); - interfaze.addVisibleMethods(methodMap); + if (!seenInterfaces.contains(interfaze)) { + interfaze.addVisibleMethods(methodMap, seenInterfaces); + seenInterfaces.add(interfaze); + } } addToMethodMap(methodMap, methods()); diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java Tue Jan 28 11:21:26 2014 -0800 @@ -24,24 +24,45 @@ package sun.jvm.hotspot.jdi; -import java.io.*; - -import com.sun.jdi.*; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.lang.ref.SoftReference; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; import sun.jvm.hotspot.memory.SystemDictionary; +import sun.jvm.hotspot.oops.ArrayKlass; +import sun.jvm.hotspot.oops.DefaultHeapVisitor; import sun.jvm.hotspot.oops.Instance; import sun.jvm.hotspot.oops.InstanceKlass; -import sun.jvm.hotspot.oops.ArrayKlass; import sun.jvm.hotspot.oops.JVMDIClassStatus; import sun.jvm.hotspot.oops.Klass; -import sun.jvm.hotspot.oops.ObjArray; import sun.jvm.hotspot.oops.Oop; import sun.jvm.hotspot.oops.Symbol; -import sun.jvm.hotspot.oops.DefaultHeapVisitor; import sun.jvm.hotspot.utilities.Assert; -import java.util.*; -import java.lang.ref.SoftReference; +import com.sun.jdi.AbsentInformationException; +import com.sun.jdi.ArrayType; +import com.sun.jdi.ClassLoaderReference; +import com.sun.jdi.ClassNotLoadedException; +import com.sun.jdi.ClassNotPreparedException; +import com.sun.jdi.ClassObjectReference; +import com.sun.jdi.Field; +import com.sun.jdi.InterfaceType; +import com.sun.jdi.Method; +import com.sun.jdi.ObjectReference; +import com.sun.jdi.PrimitiveType; +import com.sun.jdi.ReferenceType; +import com.sun.jdi.Type; +import com.sun.jdi.Value; +import com.sun.jdi.VirtualMachine; public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceType { @@ -421,7 +442,8 @@ } } - abstract void addVisibleMethods(Map methodMap); + abstract void addVisibleMethods(Map methodMap, Set seenInterfaces); + public final List visibleMethods() throws ClassNotPreparedException { checkPrepared(); /* @@ -430,8 +452,8 @@ * concatenation of name and signature. */ //System.out.println("jj: RTI: Calling addVisibleMethods for:" + this); - Map map = new HashMap(); - addVisibleMethods(map); + Map map = new HashMap(); + addVisibleMethods(map, new HashSet()); /* * ... but the hash map destroys order. Methods should be @@ -441,7 +463,7 @@ */ //System.out.println("jj: RTI: Calling allMethods for:" + this); - List list = new ArrayList(allMethods()); + List list = new ArrayList(allMethods()); //System.out.println("jj: allMethods = " + jjstr(list)); //System.out.println("jj: map = " + map.toString()); //System.out.println("jj: map = " + jjstr(map.values())); diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CMSCollector.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CMSCollector.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CMSCollector.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodCounters.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodCounters.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodCounters.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -364,7 +364,7 @@ } catch (AddressException e) { // This is okay at the top of these regions - } + } catch (UnknownOopException e) { // This is okay at the top of these regions } @@ -373,7 +373,7 @@ visitor.epilogue(); } - private void addLiveRegions(List input, List output) { + private void addLiveRegions(String name, List input, List output) { for (Iterator itr = input.iterator(); itr.hasNext();) { MemRegion reg = (MemRegion) itr.next(); Address top = reg.end(); @@ -386,6 +386,9 @@ } output.add(top); output.add(bottom); + if (DEBUG) { + System.err.println("Live region: " + name + ": " + bottom + ", " + top); + } } } @@ -395,7 +398,7 @@ } public void doSpace(Space s) { - addLiveRegions(s.getLiveRegions(), liveRegions); + addLiveRegions(s.toString(), s.getLiveRegions(), liveRegions); } private List liveRegions; } @@ -426,11 +429,11 @@ ParallelScavengeHeap psh = (ParallelScavengeHeap) heap; PSYoungGen youngGen = psh.youngGen(); // Add eden space - addLiveRegions(youngGen.edenSpace().getLiveRegions(), liveRegions); + addLiveRegions("eden", youngGen.edenSpace().getLiveRegions(), liveRegions); // Add from-space but not to-space - addLiveRegions(youngGen.fromSpace().getLiveRegions(), liveRegions); + addLiveRegions("from", youngGen.fromSpace().getLiveRegions(), liveRegions); PSOldGen oldGen = psh.oldGen(); - addLiveRegions(oldGen.objectSpace().getLiveRegions(), liveRegions); + addLiveRegions("old ", oldGen.objectSpace().getLiveRegions(), liveRegions); } else if (heap instanceof G1CollectedHeap) { G1CollectedHeap g1h = (G1CollectedHeap) heap; g1h.heapRegionIterate(lrc); @@ -451,23 +454,27 @@ if (VM.getVM().getUseTLAB()) { for (JavaThread thread = VM.getVM().getThreads().first(); thread != null; thread = thread.next()) { - if (thread.isJavaThread()) { - ThreadLocalAllocBuffer tlab = thread.tlab(); - if (tlab.start() != null) { - if ((tlab.top() == null) || (tlab.end() == null)) { - System.err.print("Warning: skipping invalid TLAB for thread "); + ThreadLocalAllocBuffer tlab = thread.tlab(); + if (tlab.start() != null) { + if ((tlab.top() == null) || (tlab.end() == null)) { + System.err.print("Warning: skipping invalid TLAB for thread "); + thread.printThreadIDOn(System.err); + System.err.println(); + } else { + if (DEBUG) { + System.err.print("TLAB for " + thread.getThreadName() + ", #"); thread.printThreadIDOn(System.err); - System.err.println(); - } else { - // Go from: - // - below start() to start() - // - start() to top() - // - end() and above - liveRegions.add(tlab.start()); - liveRegions.add(tlab.start()); - liveRegions.add(tlab.top()); - liveRegions.add(tlab.hardEnd()); + System.err.print(": "); + tlab.printOn(System.err); } + // Go from: + // - below start() to start() + // - start() to top() + // - end() and above + liveRegions.add(tlab.start()); + liveRegions.add(tlab.start()); + liveRegions.add(tlab.top()); + liveRegions.add(tlab.hardEnd()); } } } @@ -480,6 +487,15 @@ Assert.that(liveRegions.size() % 2 == 0, "Must have even number of region boundaries"); } + if (DEBUG) { + System.err.println("liveRegions:"); + for (int i = 0; i < liveRegions.size(); i += 2) { + Address bottom = (Address) liveRegions.get(i); + Address top = (Address) liveRegions.get(i+1); + System.err.println(" " + bottom + " - " + top); + } + } + return liveRegions; } diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Compile.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Compile.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Compile.java Tue Jan 28 11:21:26 2014 -0800 @@ -25,6 +25,7 @@ package sun.jvm.hotspot.opto; import java.util.*; +import java.io.PrintStream; import sun.jvm.hotspot.ci.*; import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.runtime.*; @@ -92,4 +93,13 @@ } return null; } + + public void dumpInlineData(PrintStream out) { + InlineTree inlTree = ilt(); + if (inlTree != null) { + out.print(" inline " + inlTree.count()); + inlTree.dumpReplayData(out); + } + } + } diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/InlineTree.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/InlineTree.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/InlineTree.java Tue Jan 28 11:21:26 2014 -0800 @@ -87,6 +87,11 @@ return GrowableArray.create(addr, inlineTreeConstructor); } + public int inlineLevel() { + JVMState jvms = callerJvms(); + return (jvms != null) ? jvms.depth() : 0; + } + public void printImpl(PrintStream st, int indent) { for (int i = 0; i < indent; i++) st.print(" "); st.printf(" @ %d ", callerBci()); @@ -101,4 +106,28 @@ public void print(PrintStream st) { printImpl(st, 2); } + + // Count number of nodes in this subtree + public int count() { + int result = 1; + GrowableArray subt = subtrees(); + for (int i = 0 ; i < subt.length(); i++) { + result += subt.at(i).count(); + } + return result; + } + + public void dumpReplayData(PrintStream out) { + out.printf(" %d %d ", inlineLevel(), callerBci()); + Method method = (Method)method().getMetadata(); + Klass holder = method.getMethodHolder(); + out.print(holder.getName().asString() + " " + + OopUtilities.escapeString(method.getName().asString()) + " " + + method.getSignature().asString()); + + GrowableArray subt = subtrees(); + for (int i = 0 ; i < subt.length(); i++) { + subt.at(i).dumpReplayData(out); + } + } } diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/JVMState.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/JVMState.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/JVMState.java Tue Jan 28 11:21:26 2014 -0800 @@ -88,6 +88,10 @@ return (int)bciField.getValue(getAddress()); } + public int depth() { + return (int)depthField.getValue(getAddress()); + } + public JVMState caller() { return create(callerField.getValue(getAddress())); } diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -109,6 +109,6 @@ public void printOn(PrintStream tty) { tty.println(" [" + start() + "," + - top() + "," + end() + ")"); + top() + "," + end() + ",{" + hardEnd() + "})"); } } diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAPanel.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAPanel.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAPanel.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/bsd/makefiles/adlc.make --- a/hotspot/make/bsd/makefiles/adlc.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/bsd/makefiles/adlc.make Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/bsd/makefiles/gcc.make --- a/hotspot/make/bsd/makefiles/gcc.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/bsd/makefiles/gcc.make Tue Jan 28 11:21:26 2014 -0800 @@ -260,14 +260,13 @@ WARNINGS_ARE_ERRORS += -Wno-empty-body endif -WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef +WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" +ifeq ($(USE_CLANG),) # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit # conversions which might affect the values. Only enable it in earlier versions. - WARNING_FLAGS = -Wunused-function - ifeq ($(USE_CLANG),) - WARNING_FLAGS += -Wconversion + ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" + WARNINGS_FLAGS += -Wconversion endif endif diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/bsd/makefiles/mapfile-vers-debug --- a/hotspot/make/bsd/makefiles/mapfile-vers-debug Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/bsd/makefiles/mapfile-vers-debug Tue Jan 28 11:21:26 2014 -0800 @@ -242,11 +242,6 @@ _JVM_Yield _JVM_handle_bsd_signal - # debug _JVM - _JVM_AccessVMBooleanFlag - _JVM_AccessVMIntFlag - _JVM_VMBreakPoint - # miscellaneous functions _jio_fprintf _jio_printf diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/bsd/makefiles/minimal1.make --- a/hotspot/make/bsd/makefiles/minimal1.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/bsd/makefiles/minimal1.make Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/hotspot.script --- a/hotspot/make/hotspot.script Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/hotspot.script Tue Jan 28 11:21:26 2014 -0800 @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/linux/makefiles/adlc.make --- a/hotspot/make/linux/makefiles/adlc.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/linux/makefiles/adlc.make Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/linux/makefiles/jsig.make --- a/hotspot/make/linux/makefiles/jsig.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/linux/makefiles/jsig.make Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/linux/makefiles/mapfile-vers-debug --- a/hotspot/make/linux/makefiles/mapfile-vers-debug Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/linux/makefiles/mapfile-vers-debug Tue Jan 28 11:21:26 2014 -0800 @@ -244,11 +244,6 @@ JVM_Yield; JVM_handle_linux_signal; - # debug JVM - JVM_AccessVMBooleanFlag; - JVM_AccessVMIntFlag; - JVM_VMBreakPoint; - # miscellaneous functions jio_fprintf; jio_printf; diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/linux/makefiles/minimal1.make --- a/hotspot/make/linux/makefiles/minimal1.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/linux/makefiles/minimal1.make Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/linux/makefiles/saproc.make --- a/hotspot/make/linux/makefiles/saproc.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/linux/makefiles/saproc.make Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/sa.files --- a/hotspot/make/sa.files Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/sa.files Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/solaris/makefiles/adlc.make --- a/hotspot/make/solaris/makefiles/adlc.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/solaris/makefiles/adlc.make Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/solaris/makefiles/gcc.make --- a/hotspot/make/solaris/makefiles/gcc.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/solaris/makefiles/gcc.make Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/solaris/makefiles/mapfile-vers-debug --- a/hotspot/make/solaris/makefiles/mapfile-vers-debug Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/solaris/makefiles/mapfile-vers-debug Tue Jan 28 11:21:26 2014 -0800 @@ -28,10 +28,6 @@ SUNWprivate_1.1 { global: - # debug JVM - JVM_AccessVMBooleanFlag; - JVM_AccessVMIntFlag; - JVM_VMBreakPoint; # miscellaneous }; diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/windows/build_vm_def.sh --- a/hotspot/make/windows/build_vm_def.sh Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/windows/build_vm_def.sh Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/windows/makefiles/adlc.make --- a/hotspot/make/windows/makefiles/adlc.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/windows/makefiles/adlc.make Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/windows/makefiles/debug.make --- a/hotspot/make/windows/makefiles/debug.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/windows/makefiles/debug.make Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/windows/makefiles/product.make --- a/hotspot/make/windows/makefiles/product.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/windows/makefiles/product.make Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/windows/makefiles/rules.make --- a/hotspot/make/windows/makefiles/rules.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/windows/makefiles/rules.make Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/make/windows/makefiles/sa.make --- a/hotspot/make/windows/makefiles/sa.make Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/make/windows/makefiles/sa.make Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -94,7 +94,7 @@ SA_LD_FLAGS = bufferoverflowU.lib !endif !else -SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 -Gm $(GX_OPTION) -Od -D "WIN32" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -GZ -c +SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -RTC1 -c !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1" SA_CFLAGS = $(SA_CFLAGS) -ZI !endif diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/assembler_sparc.hpp --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp --- a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp --- a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp --- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp --- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp --- a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp --- a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp --- a/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp --- a/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp --- a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp --- a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/globals_sparc.hpp --- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/jni_sparc.h --- a/hotspot/src/cpu/sparc/vm/jni_sparc.h Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/jni_sparc.h Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp --- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/register_sparc.hpp --- a/hotspot/src/cpu/sparc/vm/register_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/register_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp --- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/sparc.ad --- a/hotspot/src/cpu/sparc/vm/sparc.ad Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/sparc.ad Tue Jan 28 11:21:26 2014 -0800 @@ -757,7 +757,7 @@ #endif -void emit_form3_mem_reg(CodeBuffer &cbuf, const MachNode* n, int primary, int tertiary, +void emit_form3_mem_reg(CodeBuffer &cbuf, PhaseRegAlloc* ra, const MachNode* n, int primary, int tertiary, int src1_enc, int disp32, int src2_enc, int dst_enc) { #ifdef ASSERT @@ -912,8 +912,14 @@ uint index = src2_enc; int disp = disp32; - if (src1_enc == R_SP_enc || src1_enc == R_FP_enc) + if (src1_enc == R_SP_enc || src1_enc == R_FP_enc) { disp += STACK_BIAS; + // Quick fix for JDK-8029668: check that stack offset fits, bailout if not + if (!Assembler::is_simm13(disp)) { + ra->C->record_method_not_compilable("unable to handle large constant offsets"); + return; + } + } // We should have a compiler bailout here rather than a guarantee. // Better yet would be some mechanism to handle variable-size matches correctly. @@ -1279,20 +1285,15 @@ return rc_float; } -static int impl_helper( const MachNode *mach, CodeBuffer *cbuf, PhaseRegAlloc *ra_, bool do_size, bool is_load, int offset, int reg, int opcode, const char *op_str, int size, outputStream* st ) { - if( cbuf ) { - // Better yet would be some mechanism to handle variable-size matches correctly - if (!Assembler::is_simm13(offset + STACK_BIAS)) { - ra_->C->record_method_not_compilable("unable to handle large constant offsets"); - } else { - emit_form3_mem_reg(*cbuf, mach, opcode, -1, R_SP_enc, offset, 0, Matcher::_regEncode[reg]); - } +static int impl_helper(const MachNode* mach, CodeBuffer* cbuf, PhaseRegAlloc* ra, bool do_size, bool is_load, int offset, int reg, int opcode, const char *op_str, int size, outputStream* st ) { + if (cbuf) { + emit_form3_mem_reg(*cbuf, ra, mach, opcode, -1, R_SP_enc, offset, 0, Matcher::_regEncode[reg]); } #ifndef PRODUCT - else if( !do_size ) { - if( size != 0 ) st->print("\n\t"); - if( is_load ) st->print("%s [R_SP + #%d],R_%s\t! spill",op_str,offset,OptoReg::regname(reg)); - else st->print("%s R_%s,[R_SP + #%d]\t! spill",op_str,OptoReg::regname(reg),offset); + else if (!do_size) { + if (size != 0) st->print("\n\t"); + if (is_load) st->print("%s [R_SP + #%d],R_%s\t! spill",op_str,offset,OptoReg::regname(reg)); + else st->print("%s R_%s,[R_SP + #%d]\t! spill",op_str,OptoReg::regname(reg),offset); } #endif return size+4; @@ -2087,22 +2088,22 @@ %} enc_class form3_mem_reg( memory mem, iRegI dst ) %{ - emit_form3_mem_reg(cbuf, this, $primary, $tertiary, + emit_form3_mem_reg(cbuf, ra_, this, $primary, $tertiary, $mem$$base, $mem$$disp, $mem$$index, $dst$$reg); %} enc_class simple_form3_mem_reg( memory mem, iRegI dst ) %{ - emit_form3_mem_reg(cbuf, this, $primary, -1, + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp, $mem$$index, $dst$$reg); %} enc_class form3_mem_prefetch_read( memory mem ) %{ - emit_form3_mem_reg(cbuf, this, $primary, -1, + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp, $mem$$index, 0/*prefetch function many-reads*/); %} enc_class form3_mem_prefetch_write( memory mem ) %{ - emit_form3_mem_reg(cbuf, this, $primary, -1, + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp, $mem$$index, 2/*prefetch function many-writes*/); %} @@ -2110,8 +2111,8 @@ assert(Assembler::is_simm13($mem$$disp ), "need disp and disp+4"); assert(Assembler::is_simm13($mem$$disp+4), "need disp and disp+4"); guarantee($mem$$index == R_G0_enc, "double index?"); - emit_form3_mem_reg(cbuf, this, $primary, -1, $mem$$base, $mem$$disp+4, R_G0_enc, R_O7_enc ); - emit_form3_mem_reg(cbuf, this, $primary, -1, $mem$$base, $mem$$disp, R_G0_enc, $reg$$reg ); + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp+4, R_G0_enc, R_O7_enc ); + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp, R_G0_enc, $reg$$reg ); emit3_simm13( cbuf, Assembler::arith_op, $reg$$reg, Assembler::sllx_op3, $reg$$reg, 0x1020 ); emit3( cbuf, Assembler::arith_op, $reg$$reg, Assembler::or_op3, $reg$$reg, 0, R_O7_enc ); %} @@ -2121,14 +2122,14 @@ assert(Assembler::is_simm13($mem$$disp+4), "need disp and disp+4"); guarantee($mem$$index == R_G0_enc, "double index?"); // Load long with 2 instructions - emit_form3_mem_reg(cbuf, this, $primary, -1, $mem$$base, $mem$$disp, R_G0_enc, $reg$$reg+0 ); - emit_form3_mem_reg(cbuf, this, $primary, -1, $mem$$base, $mem$$disp+4, R_G0_enc, $reg$$reg+1 ); + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp, R_G0_enc, $reg$$reg+0 ); + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp+4, R_G0_enc, $reg$$reg+1 ); %} //%%% form3_mem_plus_4_reg is a hack--get rid of it enc_class form3_mem_plus_4_reg( memory mem, iRegI dst ) %{ guarantee($mem$$disp, "cannot offset a reg-reg operand by 4"); - emit_form3_mem_reg(cbuf, this, $primary, -1, $mem$$base, $mem$$disp + 4, $mem$$index, $dst$$reg); + emit_form3_mem_reg(cbuf, ra_, this, $primary, -1, $mem$$base, $mem$$disp + 4, $mem$$index, $dst$$reg); %} enc_class form3_g0_rs2_rd_move( iRegI rs2, iRegI rd ) %{ diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp --- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp --- a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp --- a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp --- a/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp --- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp --- a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp --- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp --- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp --- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp --- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp --- a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/c1_globals_x86.hpp --- a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/c2_globals_x86.hpp --- a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/frame_x86.cpp --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -94,13 +94,6 @@ // other generic buffer blobs are more problematic so we just assume they are // ok. adapter blobs never have a frame complete and are never ok. - // check for a valid frame_size, otherwise we are unlikely to get a valid sender_pc - - if (!Interpreter::contains(_pc) && _cb->frame_size() <= 0) { - //assert(0, "Invalid frame_size"); - return false; - } - if (!_cb->is_frame_complete_at(_pc)) { if (_cb->is_nmethod() || _cb->is_adapter_blob() || _cb->is_runtime_stub()) { return false; @@ -144,6 +137,11 @@ // must be some sort of compiled/runtime frame // fp does not have to be safe (although it could be check for c1?) + // check for a valid frame_size, otherwise we are unlikely to get a valid sender_pc + if (_cb->frame_size() <= 0) { + return false; + } + sender_sp = _unextended_sp + _cb->frame_size(); // On Intel the return_address is always the word on the stack sender_pc = (address) *(sender_sp-1); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/frame_x86.hpp --- a/hotspot/src/cpu/x86/vm/frame_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/frame_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/frame_x86.inline.hpp --- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp --- a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/register_definitions_x86.cpp --- a/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/vmStructs_x86.hpp --- a/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp --- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp --- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/assembler_zero.cpp --- a/hotspot/src/cpu/zero/vm/assembler_zero.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/assembler_zero.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, 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. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/entryFrame_zero.hpp --- a/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, 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. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/frame_zero.cpp --- a/hotspot/src/cpu/zero/vm/frame_zero.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/frame_zero.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/frame_zero.inline.hpp --- a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, 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. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/globals_zero.hpp --- a/hotspot/src/cpu/zero/vm/globals_zero.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/icBuffer_zero.cpp --- a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/interp_masm_zero.hpp --- a/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/interpreter_zero.cpp --- a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/jni_zero.h --- a/hotspot/src/cpu/zero/vm/jni_zero.h Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/jni_zero.h Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, 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 -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/nativeInst_zero.hpp --- a/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/register_zero.cpp --- a/hotspot/src/cpu/zero/vm/register_zero.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/register_zero.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/relocInfo_zero.cpp --- a/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp --- a/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp --- a/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, 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. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp --- a/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, 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. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/vmStructs_zero.hpp --- a/hotspot/src/cpu/zero/vm/vmStructs_zero.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/vmStructs_zero.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp --- a/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os/bsd/dtrace/hotspot.d --- a/hotspot/src/os/bsd/dtrace/hotspot.d Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os/bsd/dtrace/hotspot.d Tue Jan 28 11:21:26 2014 -0800 @@ -47,8 +47,8 @@ probe mem__pool__gc__end( char*, uintptr_t, char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); - probe thread__probe__start(char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t); - probe thread__probe__stop(char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t); + probe thread__start(char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t); + probe thread__stop(char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t); probe thread__sleep__begin(long long); probe thread__sleep__end(int); probe thread__yield(); @@ -68,7 +68,7 @@ probe monitor__contended__entered(uintptr_t, uintptr_t, char*, uintptr_t); probe monitor__contended__exit(uintptr_t, uintptr_t, char*, uintptr_t); probe monitor__wait(uintptr_t, uintptr_t, char*, uintptr_t, uintptr_t); - probe monitor__probe__waited(uintptr_t, uintptr_t, char*, uintptr_t); + probe monitor__waited(uintptr_t, uintptr_t, char*, uintptr_t); probe monitor__notify(uintptr_t, uintptr_t, char*, uintptr_t); probe monitor__notifyAll(uintptr_t, uintptr_t, char*, uintptr_t); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os/bsd/dtrace/jvm_dtrace.c --- a/hotspot/src/os/bsd/dtrace/jvm_dtrace.c Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os/bsd/dtrace/jvm_dtrace.c Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os/posix/vm/os_posix.hpp --- a/hotspot/src/os/posix/vm/os_posix.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os/posix/vm/os_posix.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os/solaris/dtrace/jvm_dtrace.c --- a/hotspot/src/os/solaris/dtrace/jvm_dtrace.c Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os/solaris/dtrace/jvm_dtrace.c Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os/solaris/vm/globals_solaris.hpp --- a/hotspot/src/os/solaris/vm/globals_solaris.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os/solaris/vm/globals_solaris.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os/windows/vm/decoder_windows.hpp --- a/hotspot/src/os/windows/vm/decoder_windows.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os/windows/vm/decoder_windows.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s --- a/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s --- a/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp --- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp --- a/hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp --- a/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, 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. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp --- a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, 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. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/bsd_zero/vm/thread_bsd_zero.hpp --- a/hotspot/src/os_cpu/bsd_zero/vm/thread_bsd_zero.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/bsd_zero/vm/thread_bsd_zero.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, 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. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/bsd_zero/vm/vmStructs_bsd_zero.hpp --- a/hotspot/src/os_cpu/bsd_zero/vm/vmStructs_bsd_zero.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/bsd_zero/vm/vmStructs_bsd_zero.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp --- a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s --- a/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp --- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp --- a/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp --- a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s --- a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s --- a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp --- a/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/linux_x86/vm/vmStructs_linux_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp --- a/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, 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. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp --- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, 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. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp --- a/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/linux_zero/vm/vmStructs_linux_zero.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp --- a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.il --- a/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.il Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.il Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ // -// Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s --- a/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ !! -!! Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +!! Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. !! DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. !! !! This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp --- a/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/solaris_sparc/vm/vmStructs_solaris_sparc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp --- a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.s --- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.s Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.s Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ // -// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.s --- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.s Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.s Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ / -/ Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. +/ Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. / DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. / / This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp --- a/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/solaris_x86/vm/vmStructs_solaris_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp --- a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp --- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp --- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp --- a/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/os_cpu/windows_x86/vm/vmStructs_windows_x86.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java --- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java --- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java --- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/tools/hsdis/hsdis.c --- a/hotspot/src/share/tools/hsdis/hsdis.c Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/tools/hsdis/hsdis.c Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/adlc/adlc.hpp --- a/hotspot/src/share/vm/adlc/adlc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/adlc/adlc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -38,6 +38,9 @@ #include "stdarg.h" #include +/* Make sure that we have the intptr_t and uintptr_t definitions */ +#ifdef _WIN32 + #if _MSC_VER >= 1300 using namespace std; #endif @@ -46,8 +49,6 @@ #define strdup _strdup #endif -/* Make sure that we have the intptr_t and uintptr_t definitions */ -#ifdef _WIN32 #ifndef _INTPTR_T_DEFINED #ifdef _WIN64 typedef __int64 intptr_t; @@ -65,6 +66,7 @@ #endif #define _UINTPTR_T_DEFINED #endif + #endif // _WIN32 #if defined(LINUX) || defined(_ALLBSD_SOURCE) diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/adlc/adlparse.cpp --- a/hotspot/src/share/vm/adlc/adlparse.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/adlc/adlparse.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/adlc/archDesc.cpp --- a/hotspot/src/share/vm/adlc/archDesc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/adlc/archDesc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ // -// Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it @@ -43,32 +43,6 @@ return result; } -// Utilities to characterize effect statements -static bool is_def(int usedef) { - switch(usedef) { - case Component::DEF: - case Component::USE_DEF: return true; break; - } - return false; -} - -static bool is_use(int usedef) { - switch(usedef) { - case Component::USE: - case Component::USE_DEF: - case Component::USE_KILL: return true; break; - } - return false; -} - -static bool is_kill(int usedef) { - switch(usedef) { - case Component::KILL: - case Component::USE_KILL: return true; break; - } - return false; -} - //---------------------------ChainList Methods------------------------------- ChainList::ChainList() { } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/adlc/dfa.cpp --- a/hotspot/src/share/vm/adlc/dfa.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/adlc/dfa.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/adlc/dict2.cpp --- a/hotspot/src/share/vm/adlc/dict2.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/adlc/dict2.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/adlc/formssel.cpp --- a/hotspot/src/share/vm/adlc/formssel.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/adlc/formssel.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/adlc/formssel.hpp --- a/hotspot/src/share/vm/adlc/formssel.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/adlc/formssel.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/adlc/main.cpp --- a/hotspot/src/share/vm/adlc/main.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/adlc/main.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -29,7 +29,6 @@ static void usage(ArchDesc& AD); // Print usage message and exit static char *strip_ext(char *fname); // Strip off name extension static char *base_plus_suffix(const char* base, const char *suffix);// New concatenated string -static char *prefix_plus_base_plus_suffix(const char* prefix, const char* base, const char *suffix);// New concatenated string static int get_legal_text(FileBuff &fbuf, char **legal_text); // Get pointer to legal text ArchDesc* globalAD = NULL; // global reference to Architecture Description object diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/adlc/output_c.cpp --- a/hotspot/src/share/vm/adlc/output_c.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/adlc/output_c.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,23 +35,6 @@ return false; } -static bool is_use(int usedef) { - switch(usedef) { - case Component::USE: - case Component::USE_DEF: - case Component::USE_KILL: return true; break; - } - return false; -} - -static bool is_kill(int usedef) { - switch(usedef) { - case Component::KILL: - case Component::USE_KILL: return true; break; - } - return false; -} - // Define an array containing the machine register names, strings. static void defineRegNames(FILE *fp, RegisterForm *registers) { if (registers) { diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/adlc/output_h.cpp --- a/hotspot/src/share/vm/adlc/output_h.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/adlc/output_h.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/asm/assembler.cpp --- a/hotspot/src/share/vm/asm/assembler.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/asm/assembler.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/asm/assembler.hpp --- a/hotspot/src/share/vm/asm/assembler.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/asm/assembler.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/asm/codeBuffer.cpp --- a/hotspot/src/share/vm/asm/codeBuffer.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/asm/codeBuffer.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/asm/macroAssembler.hpp --- a/hotspot/src/share/vm/asm/macroAssembler.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/asm/macroAssembler.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/asm/macroAssembler.inline.hpp --- a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_Canonicalizer.cpp --- a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_Canonicalizer.hpp --- a/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_CodeStubs.hpp --- a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_Compilation.cpp --- a/hotspot/src/share/vm/c1/c1_Compilation.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_Compilation.hpp --- a/hotspot/src/share/vm/c1/c1_Compilation.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_Compilation.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -259,6 +259,9 @@ } ciKlass* cha_exact_type(ciType* type); + + // Dump inlining replay data to the stream. + void dump_inline_data(outputStream* out) { /* do nothing now */ } }; diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_Compiler.cpp --- a/hotspot/src/share/vm/c1/c1_Compiler.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_Compiler.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,8 @@ #include "runtime/sharedRuntime.hpp" -Compiler::Compiler () {} +Compiler::Compiler() : AbstractCompiler(c1) { +} void Compiler::init_c1_runtime() { BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob(); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_Compiler.hpp --- a/hotspot/src/share/vm/c1/c1_Compiler.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_Compiler.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,8 +42,6 @@ // Name of this compiler virtual const char* name() { return "C1"; } - virtual bool is_c1() { return true; }; - // Missing feature tests virtual bool supports_native() { return true; } virtual bool supports_osr () { return true; } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_FrameMap.cpp --- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_FrameMap.hpp --- a/hotspot/src/share/vm/c1/c1_FrameMap.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_FrameMap.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_GraphBuilder.cpp --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -4338,11 +4338,15 @@ #endif // PRODUCT void GraphBuilder::profile_call(ciMethod* callee, Value recv, ciKlass* known_holder, Values* obj_args, bool inlined) { - // A default method's holder is an interface - if (known_holder != NULL && known_holder->is_interface()) { - assert(known_holder->is_instance_klass() && ((ciInstanceKlass*)known_holder)->has_default_methods(), "should be default method"); - known_holder = NULL; + assert(known_holder == NULL || (known_holder->is_instance_klass() && + (!known_holder->is_interface() || + ((ciInstanceKlass*)known_holder)->has_default_methods())), "should be default method"); + if (known_holder != NULL) { + if (known_holder->exact_klass() == NULL) { + known_holder = compilation()->cha_exact_type(known_holder); + } } + append(new ProfileCall(method(), bci(), callee, recv, known_holder, obj_args, inlined)); } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_GraphBuilder.hpp --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_IR.cpp --- a/hotspot/src/share/vm/c1/c1_IR.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_IR.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_IR.hpp --- a/hotspot/src/share/vm/c1/c1_IR.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_IR.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_Instruction.cpp --- a/hotspot/src/share/vm/c1/c1_Instruction.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_Instruction.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp --- a/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_LIRAssembler.cpp --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -858,9 +858,7 @@ void LIR_Assembler::verify_oop_map(CodeEmitInfo* info) { #ifndef PRODUCT - if (VerifyOopMaps || VerifyOops) { - bool v = VerifyOops; - VerifyOops = true; + if (VerifyOops) { OopMapStream s(info->oop_map()); while (!s.is_done()) { OopMapValue v = s.current(); @@ -883,7 +881,6 @@ s.next(); } - VerifyOops = v; } #endif } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_LinearScan.cpp --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_Optimizer.cpp --- a/hotspot/src/share/vm/c1/c1_Optimizer.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_Optimizer.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp --- a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp --- a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_Runtime1.hpp --- a/hotspot/src/share/vm/c1/c1_Runtime1.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_Runtime1.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_ValueMap.cpp --- a/hotspot/src/share/vm/c1/c1_ValueMap.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_ValueMap.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_ValueMap.hpp --- a/hotspot/src/share/vm/c1/c1_ValueMap.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_ValueMap.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_globals.cpp --- a/hotspot/src/share/vm/c1/c1_globals.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_globals.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/c1/c1_globals.hpp --- a/hotspot/src/share/vm/c1/c1_globals.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_globals.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -269,9 +269,6 @@ develop(bool, PrintNotLoaded, false, \ "Prints where classes are not loaded during code generation") \ \ - notproduct(bool, VerifyOopMaps, false, \ - "Adds oopmap verification code to the generated code") \ - \ develop(bool, PrintLIR, false, \ "print low-level IR") \ \ diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp --- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp --- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciArray.cpp --- a/hotspot/src/share/vm/ci/ciArray.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciArray.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciArray.hpp --- a/hotspot/src/share/vm/ci/ciArray.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciArray.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciClassList.hpp --- a/hotspot/src/share/vm/ci/ciClassList.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciClassList.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciConstant.hpp --- a/hotspot/src/share/vm/ci/ciConstant.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciConstant.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciEnv.cpp --- a/hotspot/src/share/vm/ci/ciEnv.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciEnv.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1147,6 +1147,33 @@ // Don't change thread state and acquire any locks. // Safe to call from VM error reporter. + +void ciEnv::dump_compile_data(outputStream* out) { + CompileTask* task = this->task(); + Method* method = task->method(); + int entry_bci = task->osr_bci(); + int comp_level = task->comp_level(); + out->print("compile %s %s %s %d %d", + method->klass_name()->as_quoted_ascii(), + method->name()->as_quoted_ascii(), + method->signature()->as_quoted_ascii(), + entry_bci, comp_level); + if (compiler_data() != NULL) { + if (is_c2_compile(comp_level)) { // C2 or Shark +#ifdef COMPILER2 + // Dump C2 inlining data. + ((Compile*)compiler_data())->dump_inline_data(out); +#endif + } else if (is_c1_compile(comp_level)) { // C1 +#ifdef COMPILER1 + // Dump C1 inlining data. + ((Compilation*)compiler_data())->dump_inline_data(out); +#endif + } + } + out->cr(); +} + void ciEnv::dump_replay_data_unsafe(outputStream* out) { ResourceMark rm; #if INCLUDE_JVMTI @@ -1160,16 +1187,7 @@ for (int i = 0; i < objects->length(); i++) { objects->at(i)->dump_replay_data(out); } - CompileTask* task = this->task(); - Method* method = task->method(); - int entry_bci = task->osr_bci(); - int comp_level = task->comp_level(); - // Klass holder = method->method_holder(); - out->print_cr("compile %s %s %s %d %d", - method->klass_name()->as_quoted_ascii(), - method->name()->as_quoted_ascii(), - method->signature()->as_quoted_ascii(), - entry_bci, comp_level); + dump_compile_data(out); out->flush(); } @@ -1179,3 +1197,45 @@ dump_replay_data_unsafe(out); ) } + +void ciEnv::dump_replay_data(int compile_id) { + static char buffer[O_BUFLEN]; + int ret = jio_snprintf(buffer, O_BUFLEN, "replay_pid%p_compid%d.log", os::current_process_id(), compile_id); + if (ret > 0) { + int fd = open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666); + if (fd != -1) { + FILE* replay_data_file = os::open(fd, "w"); + if (replay_data_file != NULL) { + fileStream replay_data_stream(replay_data_file, /*need_close=*/true); + dump_replay_data(&replay_data_stream); + tty->print("# Compiler replay data is saved as: "); + tty->print_cr(buffer); + } else { + tty->print_cr("# Can't open file to dump replay data."); + } + } + } +} + +void ciEnv::dump_inline_data(int compile_id) { + static char buffer[O_BUFLEN]; + int ret = jio_snprintf(buffer, O_BUFLEN, "inline_pid%p_compid%d.log", os::current_process_id(), compile_id); + if (ret > 0) { + int fd = open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666); + if (fd != -1) { + FILE* inline_data_file = os::open(fd, "w"); + if (inline_data_file != NULL) { + fileStream replay_data_stream(inline_data_file, /*need_close=*/true); + GUARDED_VM_ENTRY( + MutexLocker ml(Compile_lock); + dump_compile_data(&replay_data_stream); + ) + replay_data_stream.flush(); + tty->print("# Compiler inline data is saved as: "); + tty->print_cr(buffer); + } else { + tty->print_cr("# Can't open file to dump inline data."); + } + } + } +} diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciEnv.hpp --- a/hotspot/src/share/vm/ci/ciEnv.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciEnv.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -451,8 +451,11 @@ void metadata_do(void f(Metadata*)) { _factory->metadata_do(f); } // Dump the compilation replay data for the ciEnv to the stream. + void dump_replay_data(int compile_id); + void dump_inline_data(int compile_id); void dump_replay_data(outputStream* out); void dump_replay_data_unsafe(outputStream* out); + void dump_compile_data(outputStream* out); }; #endif // SHARE_VM_CI_CIENV_HPP diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciFlags.hpp --- a/hotspot/src/share/vm/ci/ciFlags.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciFlags.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciInstance.cpp --- a/hotspot/src/share/vm/ci/ciInstance.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciInstance.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciInstanceKlass.hpp --- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciKlass.cpp --- a/hotspot/src/share/vm/ci/ciKlass.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciKlass.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciKlass.hpp --- a/hotspot/src/share/vm/ci/ciKlass.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciKlass.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciMethod.cpp --- a/hotspot/src/share/vm/ci/ciMethod.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciMethod.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1357,15 +1357,21 @@ #undef FETCH_FLAG_FROM_VM +void ciMethod::dump_name_as_ascii(outputStream* st) { + Method* method = get_Method(); + st->print("%s %s %s", + method->klass_name()->as_quoted_ascii(), + method->name()->as_quoted_ascii(), + method->signature()->as_quoted_ascii()); +} + void ciMethod::dump_replay_data(outputStream* st) { ResourceMark rm; Method* method = get_Method(); MethodCounters* mcs = method->method_counters(); - Klass* holder = method->method_holder(); - st->print_cr("ciMethod %s %s %s %d %d %d %d %d", - holder->name()->as_quoted_ascii(), - method->name()->as_quoted_ascii(), - method->signature()->as_quoted_ascii(), + st->print("ciMethod "); + dump_name_as_ascii(st); + st->print_cr(" %d %d %d %d %d", mcs == NULL ? 0 : mcs->invocation_counter()->raw_counter(), mcs == NULL ? 0 : mcs->backedge_counter()->raw_counter(), interpreter_invocation_count(), diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciMethod.hpp --- a/hotspot/src/share/vm/ci/ciMethod.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciMethod.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -310,10 +310,13 @@ bool is_accessor () const; bool is_initializer () const; bool can_be_statically_bound() const { return _can_be_statically_bound; } - void dump_replay_data(outputStream* st); bool is_boxing_method() const; bool is_unboxing_method() const; + // Replay data methods + void dump_name_as_ascii(outputStream* st); + void dump_replay_data(outputStream* st); + // Print the bytecodes of this method. void print_codes_on(outputStream* st); void print_codes() { diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciMethodData.cpp --- a/hotspot/src/share/vm/ci/ciMethodData.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciMethodData.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciMethodData.hpp --- a/hotspot/src/share/vm/ci/ciMethodData.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciMethodData.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciObjArrayKlass.cpp --- a/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciObjArrayKlass.hpp --- a/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciObjectFactory.cpp --- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciObjectFactory.hpp --- a/hotspot/src/share/vm/ci/ciObjectFactory.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciObjectFactory.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciReplay.cpp --- a/hotspot/src/share/vm/ci/ciReplay.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciReplay.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -24,6 +24,8 @@ #include "precompiled.hpp" #include "ci/ciMethodData.hpp" #include "ci/ciReplay.hpp" +#include "ci/ciSymbol.hpp" +#include "ci/ciKlass.hpp" #include "ci/ciUtilities.hpp" #include "compiler/compileBroker.hpp" #include "memory/allocation.inline.hpp" @@ -37,74 +39,107 @@ // ciReplay typedef struct _ciMethodDataRecord { - const char* klass; - const char* method; - const char* signature; - int state; - int current_mileage; - intptr_t* data; - int data_length; - char* orig_data; - int orig_data_length; - int oops_length; - jobject* oops_handles; - int* oops_offsets; + const char* _klass_name; + const char* _method_name; + const char* _signature; + + int _state; + int _current_mileage; + + intptr_t* _data; + char* _orig_data; + jobject* _oops_handles; + int* _oops_offsets; + int _data_length; + int _orig_data_length; + int _oops_length; } ciMethodDataRecord; typedef struct _ciMethodRecord { - const char* klass; - const char* method; - const char* signature; - int instructions_size; - int interpreter_invocation_count; - int interpreter_throwout_count; - int invocation_counter; - int backedge_counter; + const char* _klass_name; + const char* _method_name; + const char* _signature; + + int _instructions_size; + int _interpreter_invocation_count; + int _interpreter_throwout_count; + int _invocation_counter; + int _backedge_counter; } ciMethodRecord; -class CompileReplay; +typedef struct _ciInlineRecord { + const char* _klass_name; + const char* _method_name; + const char* _signature; + + int _inline_depth; + int _inline_bci; +} ciInlineRecord; + +class CompileReplay; static CompileReplay* replay_state; class CompileReplay : public StackObj { private: - FILE* stream; - Thread* thread; - Handle protection_domain; - Handle loader; + FILE* _stream; + Thread* _thread; + Handle _protection_domain; + Handle _loader; - GrowableArray ci_method_records; - GrowableArray ci_method_data_records; + GrowableArray _ci_method_records; + GrowableArray _ci_method_data_records; + + // Use pointer because we may need to return inline records + // without destroying them. + GrowableArray* _ci_inline_records; const char* _error_message; - char* bufptr; - char* buffer; - int buffer_length; - int buffer_end; - int line_no; + char* _bufptr; + char* _buffer; + int _buffer_length; + int _buffer_pos; + + // "compile" data + ciKlass* _iklass; + Method* _imethod; + int _entry_bci; + int _comp_level; public: CompileReplay(const char* filename, TRAPS) { - thread = THREAD; - loader = Handle(thread, SystemDictionary::java_system_loader()); - stream = fopen(filename, "rt"); - if (stream == NULL) { + _thread = THREAD; + _loader = Handle(_thread, SystemDictionary::java_system_loader()); + _protection_domain = Handle(); + + _stream = fopen(filename, "rt"); + if (_stream == NULL) { fprintf(stderr, "ERROR: Can't open replay file %s\n", filename); } - buffer_length = 32; - buffer = NEW_RESOURCE_ARRAY(char, buffer_length); + + _ci_inline_records = NULL; _error_message = NULL; + _buffer_length = 32; + _buffer = NEW_RESOURCE_ARRAY(char, _buffer_length); + _bufptr = _buffer; + _buffer_pos = 0; + + _imethod = NULL; + _iklass = NULL; + _entry_bci = 0; + _comp_level = 0; + test(); } ~CompileReplay() { - if (stream != NULL) fclose(stream); + if (_stream != NULL) fclose(_stream); } void test() { - strcpy(buffer, "1 2 foo 4 bar 0x9 \"this is it\""); - bufptr = buffer; + strcpy(_buffer, "1 2 foo 4 bar 0x9 \"this is it\""); + _bufptr = _buffer; assert(parse_int("test") == 1, "what"); assert(parse_int("test") == 2, "what"); assert(strcmp(parse_string(), "foo") == 0, "what"); @@ -115,18 +150,18 @@ } bool had_error() { - return _error_message != NULL || thread->has_pending_exception(); + return _error_message != NULL || _thread->has_pending_exception(); } bool can_replay() { - return !(stream == NULL || had_error()); + return !(_stream == NULL || had_error()); } void report_error(const char* msg) { _error_message = msg; - // Restore the buffer contents for error reporting - for (int i = 0; i < buffer_end; i++) { - if (buffer[i] == '\0') buffer[i] = ' '; + // Restore the _buffer contents for error reporting + for (int i = 0; i < _buffer_pos; i++) { + if (_buffer[i] == '\0') _buffer[i] = ' '; } } @@ -137,10 +172,10 @@ int v = 0; int read; - if (sscanf(bufptr, "%i%n", &v, &read) != 1) { + if (sscanf(_bufptr, "%i%n", &v, &read) != 1) { report_error(label); } else { - bufptr += read; + _bufptr += read; } return v; } @@ -152,31 +187,31 @@ intptr_t v = 0; int read; - if (sscanf(bufptr, INTPTR_FORMAT "%n", &v, &read) != 1) { + if (sscanf(_bufptr, INTPTR_FORMAT "%n", &v, &read) != 1) { report_error(label); } else { - bufptr += read; + _bufptr += read; } return v; } void skip_ws() { // Skip any leading whitespace - while (*bufptr == ' ' || *bufptr == '\t') { - bufptr++; + while (*_bufptr == ' ' || *_bufptr == '\t') { + _bufptr++; } } char* scan_and_terminate(char delim) { - char* str = bufptr; - while (*bufptr != delim && *bufptr != '\0') { - bufptr++; + char* str = _bufptr; + while (*_bufptr != delim && *_bufptr != '\0') { + _bufptr++; } - if (*bufptr != '\0') { - *bufptr++ = '\0'; + if (*_bufptr != '\0') { + *_bufptr++ = '\0'; } - if (bufptr == str) { + if (_bufptr == str) { // nothing here return NULL; } @@ -195,8 +230,8 @@ skip_ws(); - if (*bufptr == '"') { - bufptr++; + if (*_bufptr == '"') { + _bufptr++; return scan_and_terminate('"'); } else { return scan_and_terminate(' '); @@ -273,7 +308,12 @@ const char* str = parse_escaped_string(); Symbol* klass_name = SymbolTable::lookup(str, (int)strlen(str), CHECK_NULL); if (klass_name != NULL) { - Klass* k = SystemDictionary::resolve_or_fail(klass_name, loader, protection_domain, true, THREAD); + Klass* k = NULL; + if (_iklass != NULL) { + k = (Klass*)_iklass->find_klass(ciSymbol::make(klass_name->as_C_string()))->constant_encoding(); + } else { + k = SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, THREAD); + } if (HAS_PENDING_EXCEPTION) { oop throwable = PENDING_EXCEPTION; java_lang_Throwable::print(throwable, tty); @@ -289,7 +329,7 @@ // Lookup a klass Klass* resolve_klass(const char* klass, TRAPS) { Symbol* klass_name = SymbolTable::lookup(klass, (int)strlen(klass), CHECK_NULL); - return SystemDictionary::resolve_or_fail(klass_name, loader, protection_domain, true, CHECK_NULL); + return SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, CHECK_NULL); } // Parse the standard tuple of @@ -304,40 +344,45 @@ return m; } + int get_line(int c) { + while(c != EOF) { + if (_buffer_pos + 1 >= _buffer_length) { + int new_length = _buffer_length * 2; + // Next call will throw error in case of OOM. + _buffer = REALLOC_RESOURCE_ARRAY(char, _buffer, _buffer_length, new_length); + _buffer_length = new_length; + } + if (c == '\n') { + c = getc(_stream); // get next char + break; + } else if (c == '\r') { + // skip LF + } else { + _buffer[_buffer_pos++] = c; + } + c = getc(_stream); + } + // null terminate it, reset the pointer + _buffer[_buffer_pos] = '\0'; // NL or EOF + _buffer_pos = 0; + _bufptr = _buffer; + return c; + } + // Process each line of the replay file executing each command until // the file ends. void process(TRAPS) { - line_no = 1; - int pos = 0; - int c = getc(stream); + int line_no = 1; + int c = getc(_stream); while(c != EOF) { - if (pos + 1 >= buffer_length) { - int newl = buffer_length * 2; - char* newb = NEW_RESOURCE_ARRAY(char, newl); - memcpy(newb, buffer, pos); - buffer = newb; - buffer_length = newl; + c = get_line(c); + process_command(CHECK); + if (had_error()) { + tty->print_cr("Error while parsing line %d: %s\n", line_no, _error_message); + tty->print_cr("%s", _buffer); + return; } - if (c == '\n') { - // null terminate it, reset the pointer and process the line - buffer[pos] = '\0'; - buffer_end = pos++; - bufptr = buffer; - process_command(CHECK); - if (had_error()) { - tty->print_cr("Error while parsing line %d: %s\n", line_no, _error_message); - tty->print_cr("%s", buffer); - return; - } - pos = 0; - buffer_end = 0; - line_no++; - } else if (c == '\r') { - // skip LF - } else { - buffer[pos++] = c; - } - c = getc(stream); + line_no++; } } @@ -396,7 +441,37 @@ return true; } - // compile + // compile inline ... + void* process_inline(ciMethod* imethod, Method* m, int entry_bci, int comp_level, TRAPS) { + _imethod = m; + _iklass = imethod->holder(); + _entry_bci = entry_bci; + _comp_level = comp_level; + int line_no = 1; + int c = getc(_stream); + while(c != EOF) { + c = get_line(c); + // Expecting only lines with "compile" command in inline replay file. + char* cmd = parse_string(); + if (cmd == NULL || strcmp("compile", cmd) != 0) { + return NULL; + } + process_compile(CHECK_NULL); + if (had_error()) { + tty->print_cr("Error while parsing line %d: %s\n", line_no, _error_message); + tty->print_cr("%s", _buffer); + return NULL; + } + if (_ci_inline_records != NULL && _ci_inline_records->length() > 0) { + // Found inlining record for the requested method. + return _ci_inline_records; + } + line_no++; + } + return NULL; + } + + // compile inline ... void process_compile(TRAPS) { Method* method = parse_method(CHECK); if (had_error()) return; @@ -410,6 +485,43 @@ if (!is_valid_comp_level(comp_level)) { return; } + if (_imethod != NULL) { + // Replay Inlining + if (entry_bci != _entry_bci || comp_level != _comp_level) { + return; + } + const char* iklass_name = _imethod->method_holder()->name()->as_utf8(); + const char* imethod_name = _imethod->name()->as_utf8(); + const char* isignature = _imethod->signature()->as_utf8(); + const char* klass_name = method->method_holder()->name()->as_utf8(); + const char* method_name = method->name()->as_utf8(); + const char* signature = method->signature()->as_utf8(); + if (strcmp(iklass_name, klass_name) != 0 || + strcmp(imethod_name, method_name) != 0 || + strcmp(isignature, signature) != 0) { + return; + } + } + int inline_count = 0; + if (parse_tag_and_count("inline", inline_count)) { + // Record inlining data + _ci_inline_records = new GrowableArray(); + for (int i = 0; i < inline_count; i++) { + int depth = parse_int("inline_depth"); + int bci = parse_int("inline_bci"); + if (had_error()) { + break; + } + Method* inl_method = parse_method(CHECK); + if (had_error()) { + break; + } + new_ciInlineRecord(inl_method, bci, depth); + } + } + if (_imethod != NULL) { + return; // Replay Inlining + } Klass* k = method->method_holder(); ((InstanceKlass*)k)->initialize(THREAD); if (HAS_PENDING_EXCEPTION) { @@ -442,11 +554,11 @@ Method* method = parse_method(CHECK); if (had_error()) return; ciMethodRecord* rec = new_ciMethod(method); - rec->invocation_counter = parse_int("invocation_counter"); - rec->backedge_counter = parse_int("backedge_counter"); - rec->interpreter_invocation_count = parse_int("interpreter_invocation_count"); - rec->interpreter_throwout_count = parse_int("interpreter_throwout_count"); - rec->instructions_size = parse_int("instructions_size"); + rec->_invocation_counter = parse_int("invocation_counter"); + rec->_backedge_counter = parse_int("backedge_counter"); + rec->_interpreter_invocation_count = parse_int("interpreter_invocation_count"); + rec->_interpreter_throwout_count = parse_int("interpreter_throwout_count"); + rec->_instructions_size = parse_int("instructions_size"); } // ciMethodData orig # # ... data # # ... oops @@ -471,32 +583,32 @@ // collect and record all the needed information for later ciMethodDataRecord* rec = new_ciMethodData(method); - rec->state = parse_int("state"); - rec->current_mileage = parse_int("current_mileage"); + rec->_state = parse_int("state"); + rec->_current_mileage = parse_int("current_mileage"); - rec->orig_data = parse_data("orig", rec->orig_data_length); - if (rec->orig_data == NULL) { + rec->_orig_data = parse_data("orig", rec->_orig_data_length); + if (rec->_orig_data == NULL) { return; } - rec->data = parse_intptr_data("data", rec->data_length); - if (rec->data == NULL) { + rec->_data = parse_intptr_data("data", rec->_data_length); + if (rec->_data == NULL) { return; } - if (!parse_tag_and_count("oops", rec->oops_length)) { + if (!parse_tag_and_count("oops", rec->_oops_length)) { return; } - rec->oops_handles = NEW_RESOURCE_ARRAY(jobject, rec->oops_length); - rec->oops_offsets = NEW_RESOURCE_ARRAY(int, rec->oops_length); - for (int i = 0; i < rec->oops_length; i++) { + rec->_oops_handles = NEW_RESOURCE_ARRAY(jobject, rec->_oops_length); + rec->_oops_offsets = NEW_RESOURCE_ARRAY(int, rec->_oops_length); + for (int i = 0; i < rec->_oops_length; i++) { int offset = parse_int("offset"); if (had_error()) { return; } Klass* k = parse_klass(CHECK); - rec->oops_offsets[i] = offset; + rec->_oops_offsets[i] = offset; KlassHandle *kh = NEW_C_HEAP_OBJ(KlassHandle, mtCompiler); ::new ((void*)kh) KlassHandle(THREAD, k); - rec->oops_handles[i] = (jobject)kh; + rec->_oops_handles[i] = (jobject)kh; } } @@ -570,6 +682,9 @@ case JVM_CONSTANT_Utf8: case JVM_CONSTANT_Integer: case JVM_CONSTANT_Float: + case JVM_CONSTANT_MethodHandle: + case JVM_CONSTANT_MethodType: + case JVM_CONSTANT_InvokeDynamic: if (tag != cp->tag_at(i).value()) { report_error("tag mismatch: wrong class files?"); return; @@ -729,10 +844,10 @@ // Create and initialize a record for a ciMethod ciMethodRecord* new_ciMethod(Method* method) { ciMethodRecord* rec = NEW_RESOURCE_OBJ(ciMethodRecord); - rec->klass = method->method_holder()->name()->as_utf8(); - rec->method = method->name()->as_utf8(); - rec->signature = method->signature()->as_utf8(); - ci_method_records.append(rec); + rec->_klass_name = method->method_holder()->name()->as_utf8(); + rec->_method_name = method->name()->as_utf8(); + rec->_signature = method->signature()->as_utf8(); + _ci_method_records.append(rec); return rec; } @@ -741,11 +856,11 @@ const char* klass_name = method->method_holder()->name()->as_utf8(); const char* method_name = method->name()->as_utf8(); const char* signature = method->signature()->as_utf8(); - for (int i = 0; i < ci_method_records.length(); i++) { - ciMethodRecord* rec = ci_method_records.at(i); - if (strcmp(rec->klass, klass_name) == 0 && - strcmp(rec->method, method_name) == 0 && - strcmp(rec->signature, signature) == 0) { + for (int i = 0; i < _ci_method_records.length(); i++) { + ciMethodRecord* rec = _ci_method_records.at(i); + if (strcmp(rec->_klass_name, klass_name) == 0 && + strcmp(rec->_method_name, method_name) == 0 && + strcmp(rec->_signature, signature) == 0) { return rec; } } @@ -755,10 +870,10 @@ // Create and initialize a record for a ciMethodData ciMethodDataRecord* new_ciMethodData(Method* method) { ciMethodDataRecord* rec = NEW_RESOURCE_OBJ(ciMethodDataRecord); - rec->klass = method->method_holder()->name()->as_utf8(); - rec->method = method->name()->as_utf8(); - rec->signature = method->signature()->as_utf8(); - ci_method_data_records.append(rec); + rec->_klass_name = method->method_holder()->name()->as_utf8(); + rec->_method_name = method->name()->as_utf8(); + rec->_signature = method->signature()->as_utf8(); + _ci_method_data_records.append(rec); return rec; } @@ -767,25 +882,65 @@ const char* klass_name = method->method_holder()->name()->as_utf8(); const char* method_name = method->name()->as_utf8(); const char* signature = method->signature()->as_utf8(); - for (int i = 0; i < ci_method_data_records.length(); i++) { - ciMethodDataRecord* rec = ci_method_data_records.at(i); - if (strcmp(rec->klass, klass_name) == 0 && - strcmp(rec->method, method_name) == 0 && - strcmp(rec->signature, signature) == 0) { + for (int i = 0; i < _ci_method_data_records.length(); i++) { + ciMethodDataRecord* rec = _ci_method_data_records.at(i); + if (strcmp(rec->_klass_name, klass_name) == 0 && + strcmp(rec->_method_name, method_name) == 0 && + strcmp(rec->_signature, signature) == 0) { return rec; } } return NULL; } + // Create and initialize a record for a ciInlineRecord + ciInlineRecord* new_ciInlineRecord(Method* method, int bci, int depth) { + ciInlineRecord* rec = NEW_RESOURCE_OBJ(ciInlineRecord); + rec->_klass_name = method->method_holder()->name()->as_utf8(); + rec->_method_name = method->name()->as_utf8(); + rec->_signature = method->signature()->as_utf8(); + rec->_inline_bci = bci; + rec->_inline_depth = depth; + _ci_inline_records->append(rec); + return rec; + } + + // Lookup inlining data for a ciMethod + ciInlineRecord* find_ciInlineRecord(Method* method, int bci, int depth) { + if (_ci_inline_records != NULL) { + return find_ciInlineRecord(_ci_inline_records, method, bci, depth); + } + return NULL; + } + + static ciInlineRecord* find_ciInlineRecord(GrowableArray* records, + Method* method, int bci, int depth) { + if (records != NULL) { + const char* klass_name = method->method_holder()->name()->as_utf8(); + const char* method_name = method->name()->as_utf8(); + const char* signature = method->signature()->as_utf8(); + for (int i = 0; i < records->length(); i++) { + ciInlineRecord* rec = records->at(i); + if ((rec->_inline_bci == bci) && + (rec->_inline_depth == depth) && + (strcmp(rec->_klass_name, klass_name) == 0) && + (strcmp(rec->_method_name, method_name) == 0) && + (strcmp(rec->_signature, signature) == 0)) { + return rec; + } + } + } + return NULL; + } + const char* error_message() { return _error_message; } void reset() { _error_message = NULL; - ci_method_records.clear(); - ci_method_data_records.clear(); + _ci_method_records.clear(); + _ci_method_data_records.clear(); } // Take an ascii string contain \u#### escapes and convert it to utf8 @@ -845,6 +1000,37 @@ vm_exit(exit_code); } +void* ciReplay::load_inline_data(ciMethod* method, int entry_bci, int comp_level) { + if (FLAG_IS_DEFAULT(InlineDataFile)) { + tty->print_cr("ERROR: no inline replay data file specified (use -XX:InlineDataFile=inline_pid12345.txt)."); + return NULL; + } + + VM_ENTRY_MARK; + // Load and parse the replay data + CompileReplay rp(InlineDataFile, THREAD); + if (!rp.can_replay()) { + tty->print_cr("ciReplay: !rp.can_replay()"); + return NULL; + } + void* data = rp.process_inline(method, method->get_Method(), entry_bci, comp_level, THREAD); + if (HAS_PENDING_EXCEPTION) { + oop throwable = PENDING_EXCEPTION; + CLEAR_PENDING_EXCEPTION; + java_lang_Throwable::print(throwable, tty); + tty->cr(); + java_lang_Throwable::print_stack_trace(throwable, tty); + tty->cr(); + return NULL; + } + + if (rp.had_error()) { + tty->print_cr("ciReplay: Failed on %s", rp.error_message()); + return NULL; + } + return data; +} + int ciReplay::replay_impl(TRAPS) { HandleMark hm; ResourceMark rm; @@ -890,7 +1076,6 @@ return exit_code; } - void ciReplay::initialize(ciMethodData* m) { if (replay_state == NULL) { return; @@ -909,28 +1094,28 @@ method->print_name(tty); tty->cr(); } else { - m->_state = rec->state; - m->_current_mileage = rec->current_mileage; - if (rec->data_length != 0) { - assert(m->_data_size == rec->data_length * (int)sizeof(rec->data[0]), "must agree"); + m->_state = rec->_state; + m->_current_mileage = rec->_current_mileage; + if (rec->_data_length != 0) { + assert(m->_data_size == rec->_data_length * (int)sizeof(rec->_data[0]), "must agree"); // Write the correct ciObjects back into the profile data ciEnv* env = ciEnv::current(); - for (int i = 0; i < rec->oops_length; i++) { - KlassHandle *h = (KlassHandle *)rec->oops_handles[i]; - *(ciMetadata**)(rec->data + rec->oops_offsets[i]) = + for (int i = 0; i < rec->_oops_length; i++) { + KlassHandle *h = (KlassHandle *)rec->_oops_handles[i]; + *(ciMetadata**)(rec->_data + rec->_oops_offsets[i]) = env->get_metadata((*h)()); } // Copy the updated profile data into place as intptr_ts #ifdef _LP64 - Copy::conjoint_jlongs_atomic((jlong *)rec->data, (jlong *)m->_data, rec->data_length); + Copy::conjoint_jlongs_atomic((jlong *)rec->_data, (jlong *)m->_data, rec->_data_length); #else - Copy::conjoint_jints_atomic((jint *)rec->data, (jint *)m->_data, rec->data_length); + Copy::conjoint_jints_atomic((jint *)rec->_data, (jint *)m->_data, rec->_data_length); #endif } // copy in the original header - Copy::conjoint_jbytes(rec->orig_data, (char*)&m->_orig, rec->orig_data_length); + Copy::conjoint_jbytes(rec->_orig_data, (char*)&m->_orig, rec->_orig_data_length); } } @@ -939,12 +1124,38 @@ if (replay_state == NULL) { return false; } - VM_ENTRY_MARK; // ciMethod without a record shouldn't be inlined. return replay_state->find_ciMethodRecord(method->get_Method()) == NULL; } +bool ciReplay::should_inline(void* data, ciMethod* method, int bci, int inline_depth) { + if (data != NULL) { + GrowableArray* records = (GrowableArray*)data; + VM_ENTRY_MARK; + // Inline record are ordered by bci and depth. + return CompileReplay::find_ciInlineRecord(records, method->get_Method(), bci, inline_depth) != NULL; + } else if (replay_state != NULL) { + VM_ENTRY_MARK; + // Inline record are ordered by bci and depth. + return replay_state->find_ciInlineRecord(method->get_Method(), bci, inline_depth) != NULL; + } + return false; +} + +bool ciReplay::should_not_inline(void* data, ciMethod* method, int bci, int inline_depth) { + if (data != NULL) { + GrowableArray* records = (GrowableArray*)data; + VM_ENTRY_MARK; + // Inline record are ordered by bci and depth. + return CompileReplay::find_ciInlineRecord(records, method->get_Method(), bci, inline_depth) == NULL; + } else if (replay_state != NULL) { + VM_ENTRY_MARK; + // Inline record are ordered by bci and depth. + return replay_state->find_ciInlineRecord(method->get_Method(), bci, inline_depth) == NULL; + } + return false; +} void ciReplay::initialize(ciMethod* m) { if (replay_state == NULL) { @@ -965,14 +1176,14 @@ tty->cr(); } else { EXCEPTION_CONTEXT; - // m->_instructions_size = rec->instructions_size; + // m->_instructions_size = rec->_instructions_size; m->_instructions_size = -1; - m->_interpreter_invocation_count = rec->interpreter_invocation_count; - m->_interpreter_throwout_count = rec->interpreter_throwout_count; + m->_interpreter_invocation_count = rec->_interpreter_invocation_count; + m->_interpreter_throwout_count = rec->_interpreter_throwout_count; MethodCounters* mcs = method->get_method_counters(CHECK_AND_CLEAR); guarantee(mcs != NULL, "method counters allocation failed"); - mcs->invocation_counter()->_counter = rec->invocation_counter; - mcs->backedge_counter()->_counter = rec->backedge_counter; + mcs->invocation_counter()->_counter = rec->_invocation_counter; + mcs->backedge_counter()->_counter = rec->_backedge_counter; } } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciReplay.hpp --- a/hotspot/src/share/vm/ci/ciReplay.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciReplay.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -29,6 +29,73 @@ // ciReplay +// +// Replay compilation of a java method by using an information in replay file. +// Replay inlining decisions during compilation by using an information in inline file. +// +// NOTE: these replay functions only exist in debug version of VM. +// +// Replay compilation. +// ------------------- +// +// Replay data file replay.txt can be created by Serviceability Agent +// from a core file, see agent/doc/cireplay.html +// +// $ java -cp /lib/sa-jdi.jar sun.jvm.hotspot.CLHSDB +// hsdb> attach /bin/java ./core +// hsdb> threads +// t@10 Service Thread +// t@9 C2 CompilerThread0 +// t@8 Signal Dispatcher +// t@7 Finalizer +// t@6 Reference Handler +// t@2 main +// hsdb> dumpreplaydata t@9 > replay.txt +// hsdb> quit +// +// (Note: SA could be also used to extract app.jar and boot.jar files +// from core file to replay compilation if only core file is available) +// +// Replay data file replay_pid%p.log is also created when VM crashes +// in Compiler thread during compilation. It is controlled by +// DumpReplayDataOnError flag which is ON by default. +// +// Replay file replay_pid%p_compid%d.log can be created +// for the specified java method during normal execution using +// CompileCommand option DumpReplay: +// +// -XX:CompileCommand=option,Benchmark::test,DumpReplay +// +// In this case the file name has additional compilation id "_compid%d" +// because the method could be compiled several times. +// +// To replay compilation the replay file should be specified: +// +// -XX:+ReplayCompiles -XX:ReplayDataFile=replay_pid2133.log +// +// VM thread reads data from the file immediately after VM initialization +// and puts the compilation task on compile queue. After that it goes into +// wait state (BackgroundCompilation flag is set to false) since there is no +// a program to execute. VM exits when the compilation is finished. +// +// +// Replay inlining. +// ---------------- +// +// Replay inlining file inline_pid%p_compid%d.log is created for +// a specific java method during normal execution of a java program +// using CompileCommand option DumpInline: +// +// -XX:CompileCommand=option,Benchmark::test,DumpInline +// +// To replay inlining the replay file and the method should be specified: +// +// -XX:CompileCommand=option,Benchmark::test,ReplayInline -XX:InlineDataFile=inline_pid3244_compid6.log +// +// The difference from replay compilation is that replay inlining +// is performed during normal java program execution. +// + class ciReplay { CI_PACKAGE_ACCESS @@ -37,7 +104,11 @@ static int replay_impl(TRAPS); public: + // Replay specified compilation and exit VM. static void replay(TRAPS); + // Load inlining decisions from file and use them + // during compilation of specified method. + static void* load_inline_data(ciMethod* method, int entry_bci, int comp_level); // These are used by the CI to fill in the cached data from the // replay file when replaying compiles. @@ -48,6 +119,8 @@ static bool is_loaded(Klass* klass); static bool should_not_inline(ciMethod* method); + static bool should_inline(void* data, ciMethod* method, int bci, int inline_depth); + static bool should_not_inline(void* data, ciMethod* method, int bci, int inline_depth); #endif }; diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciStreams.hpp --- a/hotspot/src/share/vm/ci/ciStreams.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciStreams.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciType.cpp --- a/hotspot/src/share/vm/ci/ciType.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciType.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciType.hpp --- a/hotspot/src/share/vm/ci/ciType.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciType.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciTypeArray.cpp --- a/hotspot/src/share/vm/ci/ciTypeArray.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciTypeArray.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp --- a/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciTypeFlow.cpp --- a/hotspot/src/share/vm/ci/ciTypeFlow.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciTypeFlow.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/ci/ciUtilities.hpp --- a/hotspot/src/share/vm/ci/ciUtilities.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/ci/ciUtilities.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/classfile/bytecodeAssembler.cpp --- a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/classfile/classFileStream.cpp --- a/hotspot/src/share/vm/classfile/classFileStream.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/classfile/classFileStream.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/classfile/classFileStream.hpp --- a/hotspot/src/share/vm/classfile/classFileStream.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/classfile/classFileStream.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/classfile/classLoaderData.cpp --- a/hotspot/src/share/vm/classfile/classLoaderData.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -648,12 +648,12 @@ return array; } -#ifndef PRODUCT -// for debugging and hsfind(x) -bool ClassLoaderDataGraph::contains(address x) { - // I think we need the _metaspace_lock taken here because the class loader - // data graph could be changing while we are walking it (new entries added, - // new entries being unloaded, etc). +// For profiling and hsfind() only. Otherwise, this is unsafe (and slow). This +// is done lock free to avoid lock inversion problems. It is safe because +// new ClassLoaderData are added to the end of the CLDG, and only removed at +// safepoint. The _unloading list can be deallocated concurrently with CMS so +// this doesn't look in metaspace for classes that have been unloaded. +bool ClassLoaderDataGraph::contains(const void* x) { if (DumpSharedSpaces) { // There are only two metaspaces to worry about. ClassLoaderData* ncld = ClassLoaderData::the_null_class_loader_data(); @@ -670,16 +670,11 @@ } } - // Could also be on an unloading list which is okay, ie. still allocated - // for a little while. - for (ClassLoaderData* ucld = _unloading; ucld != NULL; ucld = ucld->next()) { - if (ucld->metaspace_or_null() != NULL && ucld->metaspace_or_null()->contains(x)) { - return true; - } - } + // Do not check unloading list because deallocation can be concurrent. return false; } +#ifndef PRODUCT bool ClassLoaderDataGraph::contains_loader_data(ClassLoaderData* loader_data) { for (ClassLoaderData* data = _head; data != NULL; data = data->next()) { if (loader_data == data) { diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/classfile/classLoaderData.hpp --- a/hotspot/src/share/vm/classfile/classLoaderData.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -90,9 +90,9 @@ static void dump() { dump_on(tty); } static void verify(); + // expensive test for pointer in metaspace for debugging + static bool contains(const void* x); #ifndef PRODUCT - // expensive test for pointer in metaspace for debugging - static bool contains(address x); static bool contains_loader_data(ClassLoaderData* loader_data); #endif diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/classfile/classLoaderData.inline.hpp --- a/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/classfile/defaultMethods.cpp --- a/hotspot/src/share/vm/classfile/defaultMethods.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -349,6 +349,7 @@ } Symbol* generate_no_defaults_message(TRAPS) const; + Symbol* generate_method_message(Symbol *klass_name, Method* method, TRAPS) const; Symbol* generate_conflicts_message(GrowableArray* methods, TRAPS) const; public: @@ -414,21 +415,25 @@ } } - if (qualified_methods.length() == 0) { - _exception_message = generate_no_defaults_message(CHECK); + if (num_defaults == 0) { + if (qualified_methods.length() == 0) { + _exception_message = generate_no_defaults_message(CHECK); + } else { + assert(root != NULL, "Null root class"); + _exception_message = generate_method_message(root->name(), qualified_methods.at(0), CHECK); + } _exception_name = vmSymbols::java_lang_AbstractMethodError(); // If only one qualified method is default, select that } else if (num_defaults == 1) { _selected_target = qualified_methods.at(default_index); } else if (num_defaults > 1) { - _exception_message = generate_conflicts_message(&qualified_methods,CHECK); - _exception_name = vmSymbols::java_lang_IncompatibleClassChangeError(); + _exception_message = generate_conflicts_message(&qualified_methods,CHECK); + _exception_name = vmSymbols::java_lang_IncompatibleClassChangeError(); if (TraceDefaultMethods) { _exception_message->print_value_on(tty); tty->print_cr(""); } } - // leave abstract methods alone, they will be found via normal search path } bool contains_signature(Symbol* query) { @@ -486,6 +491,19 @@ return SymbolTable::new_symbol("No qualifying defaults found", CHECK_NULL); } +Symbol* MethodFamily::generate_method_message(Symbol *klass_name, Method* method, TRAPS) const { + stringStream ss; + ss.print("Method "); + Symbol* name = method->name(); + Symbol* signature = method->signature(); + ss.write((const char*)klass_name->bytes(), klass_name->utf8_length()); + ss.print("."); + ss.write((const char*)name->bytes(), name->utf8_length()); + ss.write((const char*)signature->bytes(), signature->utf8_length()); + ss.print(" is abstract"); + return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL); +} + Symbol* MethodFamily::generate_conflicts_message(GrowableArray* methods, TRAPS) const { stringStream ss; ss.print("Conflicting default methods:"); @@ -1026,7 +1044,8 @@ Array* merged_methods = MetadataFactory::new_array( klass->class_loader_data(), new_size, NULL, CHECK); - if (original_ordering != NULL && original_ordering->length() > 0) { + // original_ordering might be empty if this class has no methods of its own + if (JvmtiExport::can_maintain_original_method_order() || DumpSharedSpaces) { merged_ordering = MetadataFactory::new_array( klass->class_loader_data(), new_size, CHECK); } @@ -1053,6 +1072,8 @@ merged_methods->at_put(i, orig_method); original_methods->at_put(orig_idx, NULL); if (merged_ordering->length() > 0) { + assert(original_ordering != NULL && original_ordering->length() > 0, + "should have original order information for this method"); merged_ordering->at_put(i, original_ordering->at(orig_idx)); } ++orig_idx; @@ -1081,13 +1102,14 @@ // Replace klass methods with new merged lists klass->set_methods(merged_methods); klass->set_initial_method_idnum(new_size); + klass->set_method_ordering(merged_ordering); + // Free metadata ClassLoaderData* cld = klass->class_loader_data(); - if (original_methods ->length() > 0) { + if (original_methods->length() > 0) { MetadataFactory::free_array(cld, original_methods); } - if (original_ordering->length() > 0) { - klass->set_method_ordering(merged_ordering); + if (original_ordering != NULL && original_ordering->length() > 0) { MetadataFactory::free_array(cld, original_ordering); } } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/classfile/javaClasses.cpp --- a/hotspot/src/share/vm/classfile/javaClasses.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -3286,7 +3286,7 @@ sun_reflect_ConstantPool::compute_offsets(); sun_reflect_UnsafeStaticFieldAccessorImpl::compute_offsets(); } - if (JDK_Version::is_jdk18x_version()) + if (JDK_Version::is_gte_jdk18x_version()) java_lang_reflect_Parameter::compute_offsets(); // generated interpreter code wants to know about the offsets we just computed: diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/classfile/systemDictionary.cpp --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1049,6 +1049,9 @@ add_to_hierarchy(k, CHECK_NULL); // No exception, but can block // But, do not add to system dictionary. + + // compiled code dependencies need to be validated anyway + notice_modification(); } // Rewrite and patch constant pool here. diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/classfile/vmSymbols.cpp --- a/hotspot/src/share/vm/classfile/vmSymbols.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/classfile/vmSymbols.hpp --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -654,9 +654,9 @@ do_intrinsic(_addExactI, java_lang_Math, addExact_name, int2_int_signature, F_S) \ do_intrinsic(_addExactL, java_lang_Math, addExact_name, long2_long_signature, F_S) \ do_intrinsic(_decrementExactI, java_lang_Math, decrementExact_name, int_int_signature, F_S) \ - do_intrinsic(_decrementExactL, java_lang_Math, decrementExact_name, long2_long_signature, F_S) \ + do_intrinsic(_decrementExactL, java_lang_Math, decrementExact_name, long_long_signature, F_S) \ do_intrinsic(_incrementExactI, java_lang_Math, incrementExact_name, int_int_signature, F_S) \ - do_intrinsic(_incrementExactL, java_lang_Math, incrementExact_name, long2_long_signature, F_S) \ + do_intrinsic(_incrementExactL, java_lang_Math, incrementExact_name, long_long_signature, F_S) \ do_intrinsic(_multiplyExactI, java_lang_Math, multiplyExact_name, int2_int_signature, F_S) \ do_intrinsic(_multiplyExactL, java_lang_Math, multiplyExact_name, long2_long_signature, F_S) \ do_intrinsic(_negateExactI, java_lang_Math, negateExact_name, int_int_signature, F_S) \ diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/code/compiledIC.cpp --- a/hotspot/src/share/vm/code/compiledIC.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/code/compiledIC.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -418,7 +418,7 @@ TRAPS) { nmethod* method_code = method->code(); address entry = NULL; - if (method_code != NULL) { + if (method_code != NULL && method_code->is_in_use()) { // Call to compiled code if (static_bound || is_optimized) { entry = method_code->verified_entry_point(); @@ -545,7 +545,7 @@ void CompiledStaticCall::compute_entry(methodHandle m, StaticCallInfo& info) { nmethod* m_code = m->code(); info._callee = m; - if (m_code != NULL) { + if (m_code != NULL && m_code->is_in_use()) { info._to_interpreter = false; info._entry = m_code->verified_entry_point(); } else { diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/code/compiledIC.hpp --- a/hotspot/src/share/vm/code/compiledIC.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/code/compiledIC.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/code/compressedStream.cpp --- a/hotspot/src/share/vm/code/compressedStream.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/code/compressedStream.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/code/debugInfo.hpp --- a/hotspot/src/share/vm/code/debugInfo.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/code/debugInfo.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/code/dependencies.cpp --- a/hotspot/src/share/vm/code/dependencies.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/code/dependencies.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -655,8 +655,6 @@ } else { o = _deps->oop_recorder()->metadata_at(i); } - assert(o == NULL || o->is_metaspace_object(), - err_msg("Should be metadata " PTR_FORMAT, o)); return o; } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/code/icBuffer.hpp --- a/hotspot/src/share/vm/code/icBuffer.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/code/icBuffer.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/code/nmethod.cpp --- a/hotspot/src/share/vm/code/nmethod.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/code/nmethod.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -459,7 +459,7 @@ // Fill in default values for various flag fields void nmethod::init_defaults() { - _state = alive; + _state = in_use; _marked_for_reclamation = 0; _has_flushed_dependencies = 0; _has_unsafe_access = 0; @@ -1660,8 +1660,8 @@ CompiledICHolder* cichk_oop = ic->cached_icholder(); if (cichk_oop->holder_method()->method_holder()->is_loader_alive(is_alive) && cichk_oop->holder_klass()->is_loader_alive(is_alive)) { - continue; - } + continue; + } } else { Metadata* ic_oop = ic->cached_metadata(); if (ic_oop != NULL) { @@ -1677,8 +1677,8 @@ ShouldNotReachHere(); } } - } - ic->set_to_clean(); + } + ic->set_to_clean(); } } } @@ -2393,8 +2393,8 @@ void nmethod::verify_interrupt_point(address call_site) { // Verify IC only when nmethod installation is finished. - bool is_installed = (method()->code() == this) // nmethod is in state 'alive' and installed - || !this->is_in_use(); // nmethod is installed, but not in 'alive' state + bool is_installed = (method()->code() == this) // nmethod is in state 'in_use' and installed + || !this->is_in_use(); // nmethod is installed, but not in 'in_use' state if (is_installed) { Thread *cur = Thread::current(); if (CompiledIC_lock->owner() == cur || diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/code/nmethod.hpp --- a/hotspot/src/share/vm/code/nmethod.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/code/nmethod.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -184,11 +184,12 @@ bool _oops_are_stale; // indicates that it's no longer safe to access oops section #endif - enum { alive = 0, - not_entrant = 1, // uncommon trap has happened but activations may still exist - zombie = 2, - unloaded = 3 }; - + enum { in_use = 0, // executable nmethod + not_entrant = 1, // marked for deoptimization but activations may still exist, + // will be transformed to zombie when all activations are gone + zombie = 2, // no activations exist, nmethod is ready for purge + unloaded = 3 }; // there should be no activations, should not be called, + // will be transformed to zombie immediately jbyte _scavenge_root_state; @@ -407,8 +408,8 @@ address verified_entry_point() const { return _verified_entry_point; } // if klass is correct // flag accessing and manipulation - bool is_in_use() const { return _state == alive; } - bool is_alive() const { return _state == alive || _state == not_entrant; } + bool is_in_use() const { return _state == in_use; } + bool is_alive() const { return _state == in_use || _state == not_entrant; } bool is_not_entrant() const { return _state == not_entrant; } bool is_zombie() const { return _state == zombie; } bool is_unloaded() const { return _state == unloaded; } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/code/relocInfo.cpp --- a/hotspot/src/share/vm/code/relocInfo.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/code/relocInfo.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/code/scopeDesc.hpp --- a/hotspot/src/share/vm/code/scopeDesc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/code/scopeDesc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,8 +86,6 @@ // Tells whether sender() returns NULL bool is_top() const; - // Tells whether sd is equal to this - bool is_equal(ScopeDesc* sd) const; private: // Alternative constructor diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/code/stubs.cpp --- a/hotspot/src/share/vm/code/stubs.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/code/stubs.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/code/stubs.hpp --- a/hotspot/src/share/vm/code/stubs.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/code/stubs.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/compiler/abstractCompiler.cpp --- a/hotspot/src/share/vm/compiler/abstractCompiler.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/compiler/abstractCompiler.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ // -// Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/compiler/abstractCompiler.hpp --- a/hotspot/src/share/vm/compiler/abstractCompiler.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/compiler/abstractCompiler.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,8 +40,19 @@ // This thread will initialize the compiler runtime. bool should_perform_init(); + // The (closed set) of concrete compiler classes. + enum Type { + none, + c1, + c2, + shark + }; + + private: + Type _type; + public: - AbstractCompiler() : _compiler_state(uninitialized), _num_compiler_threads(0) {} + AbstractCompiler(Type type) : _type(type), _compiler_state(uninitialized), _num_compiler_threads(0) {} // This function determines the compiler thread that will perform the // shutdown of the corresponding compiler runtime. @@ -54,27 +65,11 @@ virtual bool supports_native() { return true; } virtual bool supports_osr () { return true; } virtual bool can_compile_method(methodHandle method) { return true; } -#if defined(TIERED) || ( !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK)) - virtual bool is_c1 () { return false; } - virtual bool is_c2 () { return false; } - virtual bool is_shark() { return false; } -#else -#ifdef COMPILER1 - bool is_c1 () { return true; } - bool is_c2 () { return false; } - bool is_shark() { return false; } -#endif // COMPILER1 -#ifdef COMPILER2 - bool is_c1 () { return false; } - bool is_c2 () { return true; } - bool is_shark() { return false; } -#endif // COMPILER2 -#ifdef SHARK - bool is_c1 () { return false; } - bool is_c2 () { return false; } - bool is_shark() { return true; } -#endif // SHARK -#endif // TIERED + + // Compiler type queries. + bool is_c1() { return _type == c1; } + bool is_c2() { return _type == c2; } + bool is_shark() { return _type == shark; } // Customization virtual void initialize () = 0; diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/compiler/compileBroker.cpp --- a/hotspot/src/share/vm/compiler/compileBroker.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -132,9 +132,9 @@ // The installed compiler(s) AbstractCompiler* CompileBroker::_compilers[2]; -// These counters are used for assigning id's to each compilation -uint CompileBroker::_compilation_id = 0; -uint CompileBroker::_osr_compilation_id = 0; +// These counters are used to assign an unique ID to each compilation. +volatile jint CompileBroker::_compilation_id = 0; +volatile jint CompileBroker::_osr_compilation_id = 0; // Debugging information int CompileBroker::_last_compile_type = no_compile; @@ -1158,7 +1158,7 @@ // We now know that this compilation is not pending, complete, // or prohibited. Assign a compile_id to this compilation // and check to see if it is in our [Start..Stop) range. - uint compile_id = assign_compile_id(method, osr_bci); + int compile_id = assign_compile_id(method, osr_bci); if (compile_id == 0) { // The compilation falls outside the allowed range. return; @@ -1305,18 +1305,12 @@ // do the compilation if (method->is_native()) { if (!PreferInterpreterNativeStubs || method->is_method_handle_intrinsic()) { - // Acquire our lock. - int compile_id; - { - MutexLocker locker(MethodCompileQueue_lock, THREAD); - compile_id = assign_compile_id(method, standard_entry_bci); - } // To properly handle the appendix argument for out-of-line calls we are using a small trampoline that // pops off the appendix argument and jumps to the target (see gen_special_dispatch in SharedRuntime). // // Since normal compiled-to-compiled calls are not able to handle such a thing we MUST generate an adapter // in this case. If we can't generate one and use it we can not execute the out-of-line method handle calls. - (void) AdapterHandlerLibrary::create_native_wrapper(method, compile_id); + AdapterHandlerLibrary::create_native_wrapper(method); } else { return NULL; } @@ -1419,27 +1413,28 @@ return false; } - -// ------------------------------------------------------------------ -// CompileBroker::assign_compile_id -// -// Assign a serialized id number to this compilation request. If the -// number falls out of the allowed range, return a 0. OSR -// compilations may be numbered separately from regular compilations -// if certain debugging flags are used. -uint CompileBroker::assign_compile_id(methodHandle method, int osr_bci) { - assert(MethodCompileQueue_lock->owner() == Thread::current(), - "must hold the compilation queue lock"); +/** + * Generate serialized IDs for compilation requests. If certain debugging flags are used + * and the ID is not within the specified range, the method is not compiled and 0 is returned. + * The function also allows to generate separate compilation IDs for OSR compilations. + */ +int CompileBroker::assign_compile_id(methodHandle method, int osr_bci) { +#ifdef ASSERT bool is_osr = (osr_bci != standard_entry_bci); - uint id; - if (CICountOSR && is_osr) { - id = ++_osr_compilation_id; - if ((uint)CIStartOSR <= id && id < (uint)CIStopOSR) { + int id; + if (method->is_native()) { + assert(!is_osr, "can't be osr"); + // Adapters, native wrappers and method handle intrinsics + // should be generated always. + return Atomic::add(1, &_compilation_id); + } else if (CICountOSR && is_osr) { + id = Atomic::add(1, &_osr_compilation_id); + if (CIStartOSR <= id && id < CIStopOSR) { return id; } } else { - id = ++_compilation_id; - if ((uint)CIStart <= id && id < (uint)CIStop) { + id = Atomic::add(1, &_compilation_id); + if (CIStart <= id && id < CIStop) { return id; } } @@ -1447,6 +1442,11 @@ // Method was not in the appropriate compilation range. method->set_not_compilable_quietly(); return 0; +#else + // CICountOSR is a develop flag and set to 'false' by default. In a product built, + // only _compilation_id is incremented. + return Atomic::add(1, &_compilation_id); +#endif } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/compiler/compileBroker.hpp --- a/hotspot/src/share/vm/compiler/compileBroker.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/compiler/compileBroker.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -246,6 +246,8 @@ // Compile type Information for print_last_compile() and CompilerCounters enum { no_compile, normal_compile, osr_compile, native_compile }; + static int assign_compile_id (methodHandle method, int osr_bci); + private: static bool _initialized; @@ -258,9 +260,8 @@ static AbstractCompiler* _compilers[2]; // These counters are used for assigning id's to each compilation - static uint _compilation_id; - static uint _osr_compilation_id; - static uint _native_compilation_id; + static volatile jint _compilation_id; + static volatile jint _osr_compilation_id; static int _last_compile_type; static int _last_compile_level; @@ -321,7 +322,6 @@ static void init_compiler_threads(int c1_compiler_count, int c2_compiler_count); static bool compilation_is_complete (methodHandle method, int osr_bci, int comp_level); static bool compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level); - static uint assign_compile_id (methodHandle method, int osr_bci); static bool is_compile_blocking (methodHandle method, int osr_bci); static void preload_classes (methodHandle method, TRAPS); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/compiler/compileLog.cpp --- a/hotspot/src/share/vm/compiler/compileLog.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/compiler/compileLog.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/compiler/compileLog.hpp --- a/hotspot/src/share/vm/compiler/compileLog.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/compiler/compileLog.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/compiler/compilerOracle.cpp --- a/hotspot/src/share/vm/compiler/compilerOracle.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/compiler/disassembler.cpp --- a/hotspot/src/share/vm/compiler/disassembler.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/compiler/disassembler.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/compiler/disassembler.hpp --- a/hotspot/src/share/vm/compiler/disassembler.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/compiler/disassembler.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -27,6 +27,7 @@ #include "gc_implementation/g1/concurrentG1RefineThread.hpp" #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" #include "gc_implementation/g1/g1HotCardCache.hpp" +#include "runtime/java.hpp" ConcurrentG1Refine::ConcurrentG1Refine(G1CollectedHeap* g1h) : _threads(NULL), _n_threads(0), @@ -62,6 +63,10 @@ for (int i = _n_threads - 1; i >= 0; i--) { ConcurrentG1RefineThread* t = new ConcurrentG1RefineThread(this, next, worker_id_offset, i); assert(t != NULL, "Conc refine should have been created"); + if (t->osthread() == NULL) { + vm_shutdown_during_initialization("Could not create ConcurrentG1RefineThread"); + } + assert(t->cg1r() == this, "Conc refine thread should refer to this"); _threads[i] = t; next = t; diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -553,6 +553,9 @@ _cmThread = new ConcurrentMarkThread(this); assert(cmThread() != NULL, "CM Thread should have been created"); assert(cmThread()->cm() != NULL, "CM Thread should refer to this cm"); + if (_cmThread->osthread() == NULL) { + vm_shutdown_during_initialization("Could not create ConcurrentMarkThread"); + } assert(CGC_lock != NULL, "Where's the CGC_lock?"); assert(_markBitMap1.covers(heap_rs), "_markBitMap1 inconsistency"); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -2376,25 +2376,6 @@ return blk.result(); } -size_t G1CollectedHeap::unsafe_max_alloc() { - if (free_regions() > 0) return HeapRegion::GrainBytes; - // otherwise, is there space in the current allocation region? - - // We need to store the current allocation region in a local variable - // here. The problem is that this method doesn't take any locks and - // there may be other threads which overwrite the current allocation - // region field. attempt_allocation(), for example, sets it to NULL - // and this can happen *after* the NULL check here but before the call - // to free(), resulting in a SIGSEGV. Note that this doesn't appear - // to be a problem in the optimized build, since the two loads of the - // current allocation region field are optimized away. - HeapRegion* hr = _mutator_alloc_region.get(); - if (hr == NULL) { - return 0; - } - return hr->free(); -} - bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) { switch (cause) { case GCCause::_gc_locker: return GCLockerInvokesConcurrent; diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1183,15 +1183,6 @@ // end fields defining the extent of the contiguous allocation region.) // But G1CollectedHeap doesn't yet support this. - // Return an estimate of the maximum allocation that could be performed - // without triggering any collection or expansion activity. In a - // generational collector, for example, this is probably the largest - // allocation that could be supported (without expansion) in the youngest - // generation. It is "unsafe" because no locks are taken; the result - // should be treated as an approximation, not a guarantee, for use in - // heuristic resizing decisions. - virtual size_t unsafe_max_alloc(); - virtual bool is_maximal_no_gc() const { return _g1_storage.uncommitted_size() == 0; } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MonitoringSupport.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp --- a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -484,10 +484,6 @@ young_gen()->eden_space()->ensure_parsability(); } -size_t ParallelScavengeHeap::unsafe_max_alloc() { - return young_gen()->eden_space()->free_in_bytes(); -} - size_t ParallelScavengeHeap::tlab_capacity(Thread* thr) const { return young_gen()->eden_space()->tlab_capacity(thr); } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -184,8 +184,6 @@ void accumulate_statistics_all_tlabs(); void resize_all_tlabs(); - size_t unsafe_max_alloc(); - bool supports_tlab_allocation() const { return true; } size_t tlab_capacity(Thread* thr) const; diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -2433,20 +2433,6 @@ _gc_tracer.report_object_count_after_gc(is_alive_closure()); } -void PSParallelCompact::follow_klass(ParCompactionManager* cm, Klass* klass) { - ClassLoaderData* cld = klass->class_loader_data(); - // The actual processing of the klass is done when we - // traverse the list of Klasses in the class loader data. - PSParallelCompact::follow_class_loader(cm, cld); -} - -void PSParallelCompact::adjust_klass(ParCompactionManager* cm, Klass* klass) { - ClassLoaderData* cld = klass->class_loader_data(); - // The actual processing of the klass is done when we - // traverse the list of Klasses in the class loader data. - PSParallelCompact::adjust_class_loader(cm, cld); -} - void PSParallelCompact::follow_class_loader(ParCompactionManager* cm, ClassLoaderData* cld) { PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm); @@ -2455,13 +2441,6 @@ cld->oops_do(&mark_and_push_closure, &follow_klass_closure, true); } -void PSParallelCompact::adjust_class_loader(ParCompactionManager* cm, - ClassLoaderData* cld) { - cld->oops_do(PSParallelCompact::adjust_pointer_closure(), - PSParallelCompact::adjust_klass_closure(), - true); -} - // This should be moved to the shared markSweep code! class PSAlwaysTrueClosure: public BoolObjectClosure { public: diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1200,13 +1200,10 @@ T* p); template static inline void adjust_pointer(T* p); - static void follow_klass(ParCompactionManager* cm, Klass* klass); - static void adjust_klass(ParCompactionManager* cm, Klass* klass); + static inline void follow_klass(ParCompactionManager* cm, Klass* klass); static void follow_class_loader(ParCompactionManager* cm, ClassLoaderData* klass); - static void adjust_class_loader(ParCompactionManager* cm, - ClassLoaderData* klass); // Compaction support. // Return true if p is in the range [beg_addr, end_addr). @@ -1380,6 +1377,11 @@ } } +inline void PSParallelCompact::follow_klass(ParCompactionManager* cm, Klass* klass) { + oop holder = klass->klass_holder(); + PSParallelCompact::mark_and_push(cm, &holder); +} + template inline void PSParallelCompact::KeepAliveClosure::do_oop_work(T* p) { mark_and_push(_compaction_manager, p); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -466,10 +466,12 @@ } } - GCTraceTime tm("StringTable", false, false, &_gc_timer); - // Unlink any dead interned Strings and process the remaining live ones. - PSScavengeRootsClosure root_closure(promotion_manager); - StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure); + { + GCTraceTime tm("StringTable", false, false, &_gc_timer); + // Unlink any dead interned Strings and process the remaining live ones. + PSScavengeRootsClosure root_closure(promotion_manager); + StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure); + } // Finally, flush the promotion_manager's labs, and deallocate its stacks. promotion_failure_occurred = PSPromotionManager::post_scavenge(_gc_tracer); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp --- a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp --- a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp --- a/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp --- a/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp --- a/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/gcAdaptivePolicyCounters.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp --- a/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/isGCActiveMark.hpp --- a/hotspot/src/share/vm/gc_implementation/shared/isGCActiveMark.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/isGCActiveMark.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp --- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp --- a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp --- a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp --- a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp --- a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp --- a/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp --- a/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_interface/collectedHeap.hpp --- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -389,15 +389,6 @@ // allocation from them and necessitating allocation of new TLABs. virtual void ensure_parsability(bool retire_tlabs); - // Return an estimate of the maximum allocation that could be performed - // without triggering any collection or expansion activity. In a - // generational collector, for example, this is probably the largest - // allocation that could be supported (without expansion) in the youngest - // generation. It is "unsafe" because no locks are taken; the result - // should be treated as an approximation, not a guarantee, for use in - // heuristic resizing decisions. - virtual size_t unsafe_max_alloc() = 0; - // Section on thread-local allocation buffers (TLABs) // If the heap supports thread-local allocation buffers, it should override // the following methods: diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp --- a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_interface/gcCause.cpp --- a/hotspot/src/share/vm/gc_interface/gcCause.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_interface/gcCause.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/gc_interface/gcCause.hpp --- a/hotspot/src/share/vm/gc_interface/gcCause.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/gc_interface/gcCause.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/interpreter/cppInterpreter.hpp --- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/interpreter/interpreter.hpp --- a/hotspot/src/share/vm/interpreter/interpreter.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/interpreter/interpreter.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/interpreter/linkResolver.cpp --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -242,8 +242,20 @@ // Look up method in klasses, including static methods // Then look up local default methods -void LinkResolver::lookup_method_in_klasses(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, bool checkpolymorphism, TRAPS) { +void LinkResolver::lookup_method_in_klasses(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, bool checkpolymorphism, bool in_imethod_resolve, TRAPS) { Method* result_oop = klass->uncached_lookup_method(name, signature); + + // JDK 8, JVMS 5.4.3.4: Interface method resolution should + // ignore static and non-public methods of java.lang.Object, + // like clone, finalize, registerNatives. + if (in_imethod_resolve && + result_oop != NULL && + klass->is_interface() && + (result_oop->is_static() || !result_oop->is_public()) && + result_oop->method_holder() == SystemDictionary::Object_klass()) { + result_oop = NULL; + } + if (result_oop == NULL) { Array* default_methods = InstanceKlass::cast(klass())->default_methods(); if (default_methods != NULL) { @@ -288,7 +300,7 @@ Symbol* signature = resolved_method->signature(); // First check in default method array - if (!resolved_method->is_abstract() && + if (!resolved_method->is_abstract() && (InstanceKlass::cast(klass())->default_methods() != NULL)) { int index = InstanceKlass::find_method_index(InstanceKlass::cast(klass())->default_methods(), name, signature); if (index >= 0 ) { @@ -306,7 +318,11 @@ void LinkResolver::lookup_method_in_interfaces(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS) { InstanceKlass *ik = InstanceKlass::cast(klass()); - result = methodHandle(THREAD, ik->lookup_method_in_all_interfaces(name, signature)); + + // Specify 'true' in order to skip default methods when searching the + // interfaces. Function lookup_method_in_klasses() already looked for + // the method in the default methods table. + result = methodHandle(THREAD, ik->lookup_method_in_all_interfaces(name, signature, true)); } void LinkResolver::lookup_polymorphic_method(methodHandle& result, @@ -420,28 +436,18 @@ AccessFlags flags = sel_method->access_flags(); - // Special case #1: arrays always override "clone". JVMS 2.15. + // Special case: arrays always override "clone". JVMS 2.15. // If the resolved klass is an array class, and the declaring class // is java.lang.Object and the method is "clone", set the flags // to public. - // Special case #2: If the resolved klass is an interface, and - // the declaring class is java.lang.Object, and the method is - // "clone" or "finalize", set the flags to public. If the - // resolved interface does not contain "clone" or "finalize" - // methods, the method/interface method resolution looks to - // the interface's super class, java.lang.Object. With JDK 8 - // interface accessability check requirement, special casing - // this scenario is necessary to avoid an IAE. // - // We'll check for each method name first and then java.lang.Object - // to best short-circuit out of these tests. - if (((sel_method->name() == vmSymbols::clone_name() && - (resolved_klass->oop_is_array() || resolved_klass->is_interface())) || - (sel_method->name() == vmSymbols::finalize_method_name() && - resolved_klass->is_interface())) && - sel_klass() == SystemDictionary::Object_klass()) { + // We'll check for the method name first, as that's most likely + // to be false (so we'll short-circuit out of these tests). + if (sel_method->name() == vmSymbols::clone_name() && + sel_klass() == SystemDictionary::Object_klass() && + resolved_klass->oop_is_array()) { // We need to change "protected" to "public". - assert(flags.is_protected(), "clone or finalize not protected?"); + assert(flags.is_protected(), "clone not protected?"); jint new_flags = flags.as_int(); new_flags = new_flags & (~JVM_ACC_PROTECTED); new_flags = new_flags | JVM_ACC_PUBLIC; @@ -531,7 +537,7 @@ } // 2. lookup method in resolved klass and its super klasses - lookup_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, true, CHECK); + lookup_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, true, false, CHECK); if (resolved_method.is_null()) { // not found in the class hierarchy // 3. lookup method in all the interfaces implemented by the resolved klass @@ -618,7 +624,7 @@ bool check_access, bool nostatics, TRAPS) { - // check if klass is interface + // check if klass is interface if (!resolved_klass->is_interface()) { ResourceMark rm(THREAD); char buf[200]; @@ -628,7 +634,7 @@ // lookup method in this interface or its super, java.lang.Object // JDK8: also look for static methods - lookup_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, false, CHECK); + lookup_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, false, true, CHECK); if (resolved_method.is_null()) { // lookup method in all the super-interfaces @@ -943,8 +949,17 @@ Klass *klass_to_check = !InstanceKlass::cast(current_klass())->is_anonymous() ? current_klass() : InstanceKlass::cast(current_klass())->host_klass(); + // As of the fix for 4486457 we disable verification for all of the + // dynamically-generated bytecodes associated with the 1.4 + // reflection implementation, not just those associated with + // sun/reflect/SerializationConstructorAccessor. + bool is_reflect = JDK_Version::is_gte_jdk14x_version() && + UseNewReflection && + klass_to_check->is_subclass_of( + SystemDictionary::reflect_MagicAccessorImpl_klass()); - if (!InstanceKlass::cast(klass_to_check)->is_same_or_direct_interface(resolved_klass())) { + if (!is_reflect && + !InstanceKlass::cast(klass_to_check)->is_same_or_direct_interface(resolved_klass())) { ResourceMark rm(THREAD); char buf[200]; jio_snprintf(buf, sizeof(buf), @@ -1276,8 +1291,11 @@ resolved_klass()->external_name()); THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } + // do lookup based on receiver klass methodHandle sel_method; + // This search must match the linktime preparation search for itable initialization + // to correctly enforce loader constraints for interface method inheritance lookup_instance_method_in_klasses(sel_method, recv_klass, resolved_method->name(), resolved_method->signature(), CHECK); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/interpreter/linkResolver.hpp --- a/hotspot/src/share/vm/interpreter/linkResolver.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -124,7 +124,7 @@ friend class klassItable; private: - static void lookup_method_in_klasses (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, bool checkpolymorphism, TRAPS); + static void lookup_method_in_klasses (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, bool checkpolymorphism, bool in_imethod_resolve, TRAPS); static void lookup_instance_method_in_klasses (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS); static void lookup_method_in_interfaces (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS); static void lookup_polymorphic_method (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/interpreter/templateInterpreter.hpp --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp --- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/interpreter/templateTable.hpp --- a/hotspot/src/share/vm/interpreter/templateTable.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/interpreter/templateTable.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/allocation.cpp --- a/hotspot/src/share/vm/memory/allocation.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/allocation.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -71,9 +71,8 @@ return MetaspaceShared::is_in_shared_space(this); } - bool MetaspaceObj::is_metaspace_object() const { - return Metaspace::contains((void*)this); + return ClassLoaderDataGraph::contains((void*)this); } void MetaspaceObj::print_address_on(outputStream* st) const { @@ -140,7 +139,7 @@ void ResourceObj::set_allocation_type(address res, allocation_type type) { // Set allocation type in the resource object uintptr_t allocation = (uintptr_t)res; - assert((allocation & allocation_mask) == 0, "address should be aligned to 4 bytes at least"); + assert((allocation & allocation_mask) == 0, err_msg("address should be aligned to 4 bytes at least: " PTR_FORMAT, res)); assert(type <= allocation_mask, "incorrect allocation type"); ResourceObj* resobj = (ResourceObj *)res; resobj->_allocation_t[0] = ~(allocation + type); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/allocation.hpp --- a/hotspot/src/share/vm/memory/allocation.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/allocation.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -264,7 +264,7 @@ class MetaspaceObj { public: - bool is_metaspace_object() const; // more specific test but slower + bool is_metaspace_object() const; bool is_shared() const; void print_address_on(outputStream* st) const; // nonvirtual address printing diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/binaryTreeDictionary.hpp --- a/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/blockOffsetTable.cpp --- a/hotspot/src/share/vm/memory/blockOffsetTable.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/blockOffsetTable.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/defNewGeneration.cpp --- a/hotspot/src/share/vm/memory/defNewGeneration.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -667,9 +667,6 @@ // for full GC's. AdaptiveSizePolicy* size_policy = gch->gen_policy()->size_policy(); size_policy->reset_gc_overhead_limit_count(); - if (PrintGC && !PrintGCDetails) { - gch->print_heap_change(gch_prev_used); - } assert(!gch->incremental_collection_failed(), "Should be clear"); } else { assert(_promo_failure_scan_stack.is_empty(), "post condition"); @@ -695,6 +692,9 @@ // Reset the PromotionFailureALot counters. NOT_PRODUCT(Universe::heap()->reset_promotion_should_fail();) } + if (PrintGC && !PrintGCDetails) { + gch->print_heap_change(gch_prev_used); + } // set new iteration safe limit for the survivor spaces from()->set_concurrent_iteration_safe_limit(from()->top()); to()->set_concurrent_iteration_safe_limit(to()->top()); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/freeBlockDictionary.cpp --- a/hotspot/src/share/vm/memory/freeBlockDictionary.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/freeBlockDictionary.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/freeList.cpp --- a/hotspot/src/share/vm/memory/freeList.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/freeList.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/freeList.hpp --- a/hotspot/src/share/vm/memory/freeList.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/freeList.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/gcLocker.cpp --- a/hotspot/src/share/vm/memory/gcLocker.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/gcLocker.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/gcLocker.hpp --- a/hotspot/src/share/vm/memory/gcLocker.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/gcLocker.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/genCollectedHeap.cpp --- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -673,10 +673,6 @@ return _gens[0]->end_addr(); } -size_t GenCollectedHeap::unsafe_max_alloc() { - return _gens[0]->unsafe_max_alloc_nogc(); -} - // public collection interfaces void GenCollectedHeap::collect(GCCause::Cause cause) { diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/genCollectedHeap.hpp --- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -166,14 +166,6 @@ HeapWord** top_addr() const; HeapWord** end_addr() const; - // Return an estimate of the maximum allocation that could be performed - // without triggering any collection activity. In a generational - // collector, for example, this is probably the largest allocation that - // could be supported in the youngest generation. It is "unsafe" because - // no locks are taken; the result should be treated as an approximation, - // not a guarantee. - size_t unsafe_max_alloc(); - // Does this heap support heap inspection? (+PrintClassHistogram) virtual bool supports_heap_inspection() const { return true; } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/genRemSet.cpp --- a/hotspot/src/share/vm/memory/genRemSet.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/genRemSet.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/genRemSet.hpp --- a/hotspot/src/share/vm/memory/genRemSet.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/genRemSet.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/generation.hpp --- a/hotspot/src/share/vm/memory/generation.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/generation.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/generationSpec.cpp --- a/hotspot/src/share/vm/memory/generationSpec.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/generationSpec.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/heap.hpp --- a/hotspot/src/share/vm/memory/heap.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/heap.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/iterator.cpp --- a/hotspot/src/share/vm/memory/iterator.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/iterator.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/iterator.hpp --- a/hotspot/src/share/vm/memory/iterator.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/iterator.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/metachunk.hpp --- a/hotspot/src/share/vm/memory/metachunk.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/metachunk.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -143,6 +143,8 @@ void set_is_tagged_free(bool v) { _is_tagged_free = v; } #endif + bool contains(const void* ptr) { return bottom() <= ptr && ptr < _top; } + NOT_PRODUCT(void mangle();) void print_on(outputStream* st) const; diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/metaspace.cpp --- a/hotspot/src/share/vm/memory/metaspace.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/metaspace.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -287,7 +287,7 @@ VirtualSpace* virtual_space() const { return (VirtualSpace*) &_virtual_space; } // Returns true if "word_size" is available in the VirtualSpace - bool is_available(size_t word_size) { return _top + word_size <= end(); } + bool is_available(size_t word_size) { return word_size <= pointer_delta(end(), _top, sizeof(MetaWord)); } MetaWord* top() const { return _top; } void inc_top(size_t word_size) { _top += word_size; } @@ -513,8 +513,6 @@ // Unlink empty VirtualSpaceNodes and free it. void purge(ChunkManager* chunk_manager); - bool contains(const void *ptr); - void print_on(outputStream* st) const; class VirtualSpaceListIterator : public StackObj { @@ -558,7 +556,7 @@ private: - // protects allocations and contains. + // protects allocations Mutex* const _lock; // Type of metadata allocated. @@ -595,7 +593,11 @@ private: // Accessors Metachunk* chunks_in_use(ChunkIndex index) const { return _chunks_in_use[index]; } - void set_chunks_in_use(ChunkIndex index, Metachunk* v) { _chunks_in_use[index] = v; } + void set_chunks_in_use(ChunkIndex index, Metachunk* v) { + // ensure lock-free iteration sees fully initialized node + OrderAccess::storestore(); + _chunks_in_use[index] = v; + } BlockFreelist* block_freelists() const { return (BlockFreelist*) &_block_freelists; @@ -708,6 +710,8 @@ void print_on(outputStream* st) const; void locked_print_chunks_in_use_on(outputStream* st) const; + bool contains(const void *ptr); + void verify(); void verify_chunk_size(Metachunk* chunk); NOT_PRODUCT(void mangle_freed_chunks();) @@ -1159,8 +1163,6 @@ } else { assert(new_entry->reserved_words() == vs_word_size, "Reserved memory size differs from requested memory size"); - // ensure lock-free iteration sees fully initialized node - OrderAccess::storestore(); link_vs(new_entry); return true; } @@ -1287,19 +1289,6 @@ } } -bool VirtualSpaceList::contains(const void *ptr) { - VirtualSpaceNode* list = virtual_space_list(); - VirtualSpaceListIterator iter(list); - while (iter.repeat()) { - VirtualSpaceNode* node = iter.get_next(); - if (node->reserved()->contains(ptr)) { - return true; - } - } - return false; -} - - // MetaspaceGC methods // VM_CollectForMetadataAllocation is the vm operation used to GC. @@ -2392,6 +2381,21 @@ return result; } +// This function looks at the chunks in the metaspace without locking. +// The chunks are added with store ordering and not deleted except for at +// unloading time. +bool SpaceManager::contains(const void *ptr) { + for (ChunkIndex i = ZeroIndex; i < NumberOfInUseLists; i = next_chunk_index(i)) + { + Metachunk* curr = chunks_in_use(i); + while (curr != NULL) { + if (curr->contains(ptr)) return true; + curr = curr->next(); + } + } + return false; +} + void SpaceManager::verify() { // If there are blocks in the dictionary, then // verfication of chunks does not work since @@ -3463,17 +3467,12 @@ } } -bool Metaspace::contains(const void * ptr) { - if (MetaspaceShared::is_in_shared_space(ptr)) { - return true; +bool Metaspace::contains(const void* ptr) { + if (vsm()->contains(ptr)) return true; + if (using_class_space()) { + return class_vsm()->contains(ptr); } - // This is checked while unlocked. As long as the virtualspaces are added - // at the end, the pointer will be in one of them. The virtual spaces - // aren't deleted presently. When they are, some sort of locking might - // be needed. Note, locking this can cause inversion problems with the - // caller in MetaspaceObj::is_metadata() function. - return space_list()->contains(ptr) || - (using_class_space() && class_space_list()->contains(ptr)); + return false; } void Metaspace::verify() { @@ -3641,10 +3640,82 @@ } } + +#define assert_is_available_positive(word_size) \ + assert(vsn.is_available(word_size), \ + err_msg(#word_size ": " PTR_FORMAT " bytes were not available in " \ + "VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", \ + (uintptr_t)(word_size * BytesPerWord), vsn.bottom(), vsn.end())); + +#define assert_is_available_negative(word_size) \ + assert(!vsn.is_available(word_size), \ + err_msg(#word_size ": " PTR_FORMAT " bytes should not be available in " \ + "VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", \ + (uintptr_t)(word_size * BytesPerWord), vsn.bottom(), vsn.end())); + + static void test_is_available_positive() { + // Reserve some memory. + VirtualSpaceNode vsn(os::vm_allocation_granularity()); + assert(vsn.initialize(), "Failed to setup VirtualSpaceNode"); + + // Commit some memory. + size_t commit_word_size = os::vm_allocation_granularity() / BytesPerWord; + bool expanded = vsn.expand_by(commit_word_size, commit_word_size); + assert(expanded, "Failed to commit"); + + // Check that is_available accepts the committed size. + assert_is_available_positive(commit_word_size); + + // Check that is_available accepts half the committed size. + size_t expand_word_size = commit_word_size / 2; + assert_is_available_positive(expand_word_size); + } + + static void test_is_available_negative() { + // Reserve some memory. + VirtualSpaceNode vsn(os::vm_allocation_granularity()); + assert(vsn.initialize(), "Failed to setup VirtualSpaceNode"); + + // Commit some memory. + size_t commit_word_size = os::vm_allocation_granularity() / BytesPerWord; + bool expanded = vsn.expand_by(commit_word_size, commit_word_size); + assert(expanded, "Failed to commit"); + + // Check that is_available doesn't accept a too large size. + size_t two_times_commit_word_size = commit_word_size * 2; + assert_is_available_negative(two_times_commit_word_size); + } + + static void test_is_available_overflow() { + // Reserve some memory. + VirtualSpaceNode vsn(os::vm_allocation_granularity()); + assert(vsn.initialize(), "Failed to setup VirtualSpaceNode"); + + // Commit some memory. + size_t commit_word_size = os::vm_allocation_granularity() / BytesPerWord; + bool expanded = vsn.expand_by(commit_word_size, commit_word_size); + assert(expanded, "Failed to commit"); + + // Calculate a size that will overflow the virtual space size. + void* virtual_space_max = (void*)(uintptr_t)-1; + size_t bottom_to_max = pointer_delta(virtual_space_max, vsn.bottom(), 1); + size_t overflow_size = bottom_to_max + BytesPerWord; + size_t overflow_word_size = overflow_size / BytesPerWord; + + // Check that is_available can handle the overflow. + assert_is_available_negative(overflow_word_size); + } + + static void test_is_available() { + TestVirtualSpaceNodeTest::test_is_available_positive(); + TestVirtualSpaceNodeTest::test_is_available_negative(); + TestVirtualSpaceNodeTest::test_is_available_overflow(); + } }; void TestVirtualSpaceNode_test() { TestVirtualSpaceNodeTest::test(); + TestVirtualSpaceNodeTest::test_is_available(); } #endif diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/metaspace.hpp --- a/hotspot/src/share/vm/memory/metaspace.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/metaspace.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -225,7 +225,7 @@ MetaWord* expand_and_allocate(size_t size, MetadataType mdtype); - static bool contains(const void *ptr); + bool contains(const void* ptr); void dump(outputStream* const out) const; // Free empty virtualspaces diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/metaspaceCounters.cpp --- a/hotspot/src/share/vm/memory/metaspaceCounters.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/metaspaceCounters.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/metaspaceCounters.hpp --- a/hotspot/src/share/vm/memory/metaspaceCounters.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/metaspaceCounters.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/sharedHeap.hpp --- a/hotspot/src/share/vm/memory/sharedHeap.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/sharedHeap.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/space.cpp --- a/hotspot/src/share/vm/memory/space.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/space.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/space.hpp --- a/hotspot/src/share/vm/memory/space.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/space.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/specialized_oop_closures.hpp --- a/hotspot/src/share/vm/memory/specialized_oop_closures.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/specialized_oop_closures.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/tenuredGeneration.cpp --- a/hotspot/src/share/vm/memory/tenuredGeneration.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/tenuredGeneration.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/memory/tenuredGeneration.hpp --- a/hotspot/src/share/vm/memory/tenuredGeneration.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/memory/tenuredGeneration.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/arrayKlass.cpp --- a/hotspot/src/share/vm/oops/arrayKlass.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/arrayKlass.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/arrayOop.hpp --- a/hotspot/src/share/vm/oops/arrayOop.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/arrayOop.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/compiledICHolder.cpp --- a/hotspot/src/share/vm/oops/compiledICHolder.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/compiledICHolder.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/fieldInfo.hpp --- a/hotspot/src/share/vm/oops/fieldInfo.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/fieldInfo.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/generateOopMap.cpp --- a/hotspot/src/share/vm/oops/generateOopMap.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/generateOopMap.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1863,11 +1863,8 @@ constantTag tag = cp->tag_at(ldc.pool_index()); // idx is index in resolved_references BasicType bt = ldc.result_type(); CellTypeState cts; - if (tag.is_klass() || - tag.is_unresolved_klass() || - tag.is_string() || - tag.is_method_handle() || - tag.is_method_type()) { + if (tag.basic_type() == T_OBJECT) { + assert(!tag.is_string_index() && !tag.is_klass_index(), "Unexpected index tag"); assert(bt == T_OBJECT, "Guard is incorrect"); cts = CellTypeState::make_line_ref(bci); } else { diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp --- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -150,10 +150,6 @@ int InstanceClassLoaderKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { InstanceKlass::oop_update_pointers(cm, obj); - ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data(obj); - if (loader_data != NULL) { - PSParallelCompact::adjust_class_loader(cm, loader_data); - } return size_helper(); } #endif // INCLUDE_ALL_GCS diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp --- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/instanceKlass.cpp --- a/hotspot/src/share/vm/oops/instanceKlass.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1498,13 +1498,18 @@ return -1; } -// lookup_method searches both the local methods array and all superclasses methods arrays +// uncached_lookup_method searches both the local class methods array and all +// superclasses methods arrays, skipping any overpass methods in superclasses. Method* InstanceKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const { Klass* klass = const_cast(this); + bool dont_ignore_overpasses = true; // For the class being searched, find its overpasses. while (klass != NULL) { Method* method = InstanceKlass::cast(klass)->find_method(name, signature); - if (method != NULL) return method; + if ((method != NULL) && (dont_ignore_overpasses || !method->is_overpass())) { + return method; + } klass = InstanceKlass::cast(klass)->super(); + dont_ignore_overpasses = false; // Ignore overpass methods in all superclasses. } return NULL; } @@ -1519,7 +1524,7 @@ } // Look up interfaces if (m == NULL) { - m = lookup_method_in_all_interfaces(name, signature); + m = lookup_method_in_all_interfaces(name, signature, false); } return m; } @@ -1528,14 +1533,16 @@ // Do NOT return private or static methods, new in JDK8 which are not externally visible // They should only be found in the initial InterfaceMethodRef Method* InstanceKlass::lookup_method_in_all_interfaces(Symbol* name, - Symbol* signature) const { + Symbol* signature, + bool skip_default_methods) const { Array* all_ifs = transitive_interfaces(); int num_ifs = all_ifs->length(); InstanceKlass *ik = NULL; for (int i = 0; i < num_ifs; i++) { ik = InstanceKlass::cast(all_ifs->at(i)); Method* m = ik->lookup_method(name, signature); - if (m != NULL && m->is_public() && !m->is_static()) { + if (m != NULL && m->is_public() && !m->is_static() && + (!skip_default_methods || !m->is_default_method())) { return m; } } @@ -2199,7 +2206,6 @@ obj, \ PSParallelCompact::adjust_pointer(p), \ assert_is_in) - obj->update_header(cm); return size; } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/instanceKlass.hpp --- a/hotspot/src/share/vm/oops/instanceKlass.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -525,7 +525,8 @@ // lookup a method in all the interfaces that this class implements // (returns NULL if not found) - Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature) const; + Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature, bool skip_default_methods) const; + // lookup a method in local defaults then in all interfaces // (returns NULL if not found) Method* lookup_method_in_ordered_interfaces(Symbol* name, Symbol* signature) const; diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/instanceMirrorKlass.cpp --- a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -155,8 +155,13 @@ // Follow the klass field in the mirror. Klass* klass = java_lang_Class::as_Klass(obj); if (klass != NULL) { - // For anonymous classes we need to handle the class loader data, - // otherwise it won't be claimed and can be unloaded. + // An anonymous class doesn't have its own class loader, so the call + // to follow_klass will mark and push its java mirror instead of the + // class loader. When handling the java mirror for an anonymous class + // we need to make sure its class loader data is claimed, this is done + // by calling follow_class_loader explicitly. For non-anonymous classes + // the call to follow_class_loader is made when the class loader itself + // is handled. if (klass->oop_is_instance() && InstanceKlass::cast(klass)->is_anonymous()) { MarkSweep::follow_class_loader(klass->class_loader_data()); } else { @@ -183,7 +188,18 @@ // Follow the klass field in the mirror. Klass* klass = java_lang_Class::as_Klass(obj); if (klass != NULL) { - PSParallelCompact::follow_klass(cm, klass); + // An anonymous class doesn't have its own class loader, so the call + // to follow_klass will mark and push its java mirror instead of the + // class loader. When handling the java mirror for an anonymous class + // we need to make sure its class loader data is claimed, this is done + // by calling follow_class_loader explicitly. For non-anonymous classes + // the call to follow_class_loader is made when the class loader itself + // is handled. + if (klass->oop_is_instance() && InstanceKlass::cast(klass)->is_anonymous()) { + PSParallelCompact::follow_class_loader(cm, klass->class_loader_data()); + } else { + PSParallelCompact::follow_klass(cm, klass); + } } else { // If klass is NULL then this a mirror for a primitive type. // We don't have to follow them, since they are handled as strong @@ -332,17 +348,6 @@ int size = oop_size(obj); InstanceKlass::oop_update_pointers(cm, obj); - // Follow the klass field in the mirror. - Klass* klass = java_lang_Class::as_Klass(obj); - if (klass != NULL) { - PSParallelCompact::adjust_klass(cm, klass); - } else { - // If klass is NULL then this a mirror for a primitive type. - // We don't have to follow them, since they are handled as strong - // roots in Universe::oops_do. - assert(java_lang_Class::is_primitive(obj), "Sanity check"); - } - InstanceMirrorKlass_OOP_ITERATE( \ start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj),\ PSParallelCompact::adjust_pointer(p), \ diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/instanceOop.hpp --- a/hotspot/src/share/vm/oops/instanceOop.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/instanceOop.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/instanceRefKlass.hpp --- a/hotspot/src/share/vm/oops/instanceRefKlass.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/instanceRefKlass.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/klass.cpp --- a/hotspot/src/share/vm/oops/klass.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/klass.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -376,8 +376,6 @@ } bool Klass::is_loader_alive(BoolObjectClosure* is_alive) { - assert(ClassLoaderDataGraph::contains((address)this), "is in the metaspace"); - #ifdef ASSERT // The class is alive iff the class loader is alive. oop loader = class_loader(); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/klassPS.hpp --- a/hotspot/src/share/vm/oops/klassPS.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/klassPS.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/klassVtable.cpp --- a/hotspot/src/share/vm/oops/klassVtable.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/klassVtable.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -622,7 +622,7 @@ // this check for all access permissions. InstanceKlass *sk = InstanceKlass::cast(super); if (sk->has_miranda_methods()) { - if (sk->lookup_method_in_all_interfaces(name, signature) != NULL) { + if (sk->lookup_method_in_all_interfaces(name, signature, false) != NULL) { return false; // found a matching miranda; we do not need a new entry } } @@ -743,7 +743,7 @@ if (is_miranda(im, class_methods, default_methods, super)) { // is it a miranda at all? InstanceKlass *sk = InstanceKlass::cast(super); // check if it is a duplicate of a super's miranda - if (sk->lookup_method_in_all_interfaces(im->name(), im->signature()) == NULL) { + if (sk->lookup_method_in_all_interfaces(im->name(), im->signature(), false) == NULL) { new_mirandas->append(im); } if (all_mirandas != NULL) { @@ -1085,6 +1085,8 @@ Method* m = methods->at(i); methodHandle target; if (m->has_itable_index()) { + // This search must match the runtime resolution, i.e. selection search for invokeinterface + // to correctly enforce loader constraints for interface method inheritance LinkResolver::lookup_instance_method_in_klasses(target, _klass, m->name(), m->signature(), CHECK); } if (target == NULL || !target->is_public() || target->is_abstract()) { diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/objArrayKlass.cpp --- a/hotspot/src/share/vm/oops/objArrayKlass.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -587,7 +587,6 @@ assert (obj->is_objArray(), "obj must be obj array"); objArrayOop a = objArrayOop(obj); int size = a->object_size(); - a->update_header(cm); ObjArrayKlass_OOP_ITERATE(a, p, PSParallelCompact::adjust_pointer(p)) return size; } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/objArrayKlass.hpp --- a/hotspot/src/share/vm/oops/objArrayKlass.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/objArrayKlass.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/objArrayKlass.inline.hpp --- a/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/oop.hpp --- a/hotspot/src/share/vm/oops/oop.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/oop.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -328,11 +328,6 @@ // return the size of this oop. This is used by the MarkSweep collector. int adjust_pointers(); -#if INCLUDE_ALL_GCS - // Parallel old - void update_header(ParCompactionManager* cm); -#endif // INCLUDE_ALL_GCS - // mark-sweep support void follow_body(int begin, int end); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/oop.pcgc.inline.hpp --- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -80,8 +80,4 @@ return forwardee(); } -inline void oopDesc::update_header(ParCompactionManager* cm) { - PSParallelCompact::adjust_klass(cm, klass()); -} - #endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/oop.psgc.inline.hpp --- a/hotspot/src/share/vm/oops/oop.psgc.inline.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/oop.psgc.inline.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/typeArrayKlass.cpp --- a/hotspot/src/share/vm/oops/typeArrayKlass.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/typeArrayKlass.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/oops/typeArrayKlass.hpp --- a/hotspot/src/share/vm/oops/typeArrayKlass.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/oops/typeArrayKlass.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/block.cpp --- a/hotspot/src/share/vm/opto/block.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/block.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/block.hpp --- a/hotspot/src/share/vm/opto/block.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/block.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/buildOopMap.cpp --- a/hotspot/src/share/vm/opto/buildOopMap.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/buildOopMap.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/bytecodeInfo.cpp --- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,10 @@ _subtrees(c->comp_arena(), 2, 0, NULL), _msg(NULL) { - NOT_PRODUCT(_count_inlines = 0;) +#ifndef PRODUCT + _count_inlines = 0; + _forced_inline = false; +#endif if (_caller_jvms != NULL) { // Keep a private copy of the caller_jvms: _caller_jvms = new (C) JVMState(caller_jvms->method(), caller_tree->caller_jvms()); @@ -81,7 +84,10 @@ _count_inline_bcs(method()->code_size()), _msg(NULL) { - NOT_PRODUCT(_count_inlines = 0;) +#ifndef PRODUCT + _count_inlines = 0; + _forced_inline = false; +#endif assert(!UseOldInlining, "do not use for old stuff"); } @@ -128,9 +134,19 @@ tty->print_cr("Inlined method is hot: "); } set_msg("force inline by CompilerOracle"); + _forced_inline = true; return true; } +#ifndef PRODUCT + int inline_depth = inline_level()+1; + if (ciReplay::should_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth)) { + set_msg("force inline by ciReplay"); + _forced_inline = true; + return true; + } +#endif + int size = callee_method->code_size_for_inlining(); // Check for too many throws (and not too huge) @@ -264,6 +280,18 @@ } #ifndef PRODUCT + int caller_bci = jvms->bci(); + int inline_depth = inline_level()+1; + if (ciReplay::should_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth)) { + set_msg("force inline by ciReplay"); + return false; + } + + if (ciReplay::should_not_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth)) { + set_msg("disallowed by ciReplay"); + return true; + } + if (ciReplay::should_not_inline(callee_method)) { set_msg("disallowed by ciReplay"); return true; @@ -343,6 +371,7 @@ } } + _forced_inline = false; // Reset if (!should_inline(callee_method, caller_method, caller_bci, profile, wci_result)) { return false; @@ -373,10 +402,10 @@ if ((!UseInterpreter || CompileTheWorld) && is_init_with_ea(callee_method, caller_method, C)) { - // Escape Analysis stress testing when running Xcomp or CTW: // inline constructors even if they are not reached. - + } else if (forced_inline()) { + // Inlining was forced by CompilerOracle or ciReplay } else if (profile.count() == 0) { // don't inline unreached call sites set_msg("call site not reached"); @@ -700,12 +729,28 @@ return iltp; } +// Count number of nodes in this subtree +int InlineTree::count() const { + int result = 1; + for (int i = 0 ; i < _subtrees.length(); i++) { + result += _subtrees.at(i)->count(); + } + return result; +} + +void InlineTree::dump_replay_data(outputStream* out) { + out->print(" %d %d ", inline_level(), caller_bci()); + method()->dump_name_as_ascii(out); + for (int i = 0 ; i < _subtrees.length(); i++) { + _subtrees.at(i)->dump_replay_data(out); + } +} #ifndef PRODUCT void InlineTree::print_impl(outputStream* st, int indent) const { for (int i = 0; i < indent; i++) st->print(" "); - st->print(" @ %d ", caller_bci()); + st->print(" @ %d", caller_bci()); method()->print_short_name(st); st->cr(); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/c2compiler.cpp --- a/hotspot/src/share/vm/opto/c2compiler.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/c2compiler.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/c2compiler.hpp --- a/hotspot/src/share/vm/opto/c2compiler.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/c2compiler.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,13 +32,11 @@ static bool init_c2_runtime(); public: + C2Compiler() : AbstractCompiler(c2) {} + // Name const char *name() { return "C2"; } -#ifdef TIERED - virtual bool is_c2() { return true; }; -#endif // TIERED - void initialize(); // Compilation entry point for methods diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/callGenerator.cpp --- a/hotspot/src/share/vm/opto/callGenerator.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/callGenerator.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/callnode.cpp --- a/hotspot/src/share/vm/opto/callnode.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/callnode.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/chaitin.cpp --- a/hotspot/src/share/vm/opto/chaitin.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/chaitin.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1682,9 +1682,21 @@ // (where top() node is placed). base->init_req(0, _cfg.get_root_node()); Block *startb = _cfg.get_block_for_node(C->top()); - startb->insert_node(base, startb->find_node(C->top())); + uint node_pos = startb->find_node(C->top()); + startb->insert_node(base, node_pos); _cfg.map_node_to_block(base, startb); assert(_lrg_map.live_range_id(base) == 0, "should not have LRG yet"); + + // The loadConP0 might have projection nodes depending on architecture + // Add the projection nodes to the CFG + for (DUIterator_Fast imax, i = base->fast_outs(imax); i < imax; i++) { + Node* use = base->fast_out(i); + if (use->is_MachProj()) { + startb->insert_node(use, ++node_pos); + _cfg.map_node_to_block(use, startb); + new_lrg(use, maxlrg++); + } + } } if (_lrg_map.live_range_id(base) == 0) { new_lrg(base, maxlrg++); diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/chaitin.hpp --- a/hotspot/src/share/vm/opto/chaitin.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/chaitin.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/classes.cpp --- a/hotspot/src/share/vm/opto/classes.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/classes.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/classes.hpp --- a/hotspot/src/share/vm/opto/classes.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/classes.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/coalesce.hpp --- a/hotspot/src/share/vm/opto/coalesce.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/coalesce.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/compile.cpp --- a/hotspot/src/share/vm/opto/compile.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/compile.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" #include "asm/macroAssembler.inline.hpp" +#include "ci/ciReplay.hpp" #include "classfile/systemDictionary.hpp" #include "code/exceptionHandlerTable.hpp" #include "code/nmethod.hpp" @@ -647,6 +648,7 @@ _printer(IdealGraphPrinter::printer()), #endif _congraph(NULL), + _replay_inline_data(NULL), _late_inlines(comp_arena(), 2, 0, NULL), _string_late_inlines(comp_arena(), 2, 0, NULL), _boxing_late_inlines(comp_arena(), 2, 0, NULL), @@ -680,6 +682,10 @@ } set_print_assembly(print_opto_assembly); set_parsed_irreducible_loop(false); + + if (method()->has_option("ReplayInline")) { + _replay_inline_data = ciReplay::load_inline_data(method(), entry_bci(), ci_env->comp_level()); + } #endif set_print_inlining(PrintInlining || method()->has_option("PrintInlining") NOT_PRODUCT( || PrintOptoInlining)); set_print_intrinsics(PrintIntrinsics || method()->has_option("PrintIntrinsics")); @@ -849,6 +855,15 @@ #endif NOT_PRODUCT( verify_barriers(); ) + + // Dump compilation data to replay it. + if (method()->has_option("DumpReplay")) { + env()->dump_replay_data(_compile_id); + } + if (method()->has_option("DumpInline") && (ilt() != NULL)) { + env()->dump_inline_data(_compile_id); + } + // Now that we know the size of all the monitors we can add a fixed slot // for the original deopt pc. @@ -938,6 +953,7 @@ _dead_node_list(comp_arena()), _dead_node_count(0), _congraph(NULL), + _replay_inline_data(NULL), _number_of_mh_late_inlines(0), _inlining_progress(false), _inlining_incrementally(false), @@ -3757,6 +3773,16 @@ } } +// Dump inlining replay data to the stream. +// Don't change thread state and acquire any locks. +void Compile::dump_inline_data(outputStream* out) { + InlineTree* inl_tree = ilt(); + if (inl_tree != NULL) { + out->print(" inline %d", inl_tree->count()); + inl_tree->dump_replay_data(out); + } +} + int Compile::cmp_expensive_nodes(Node* n1, Node* n2) { if (n1->Opcode() < n2->Opcode()) return -1; else if (n1->Opcode() > n2->Opcode()) return 1; diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/compile.hpp --- a/hotspot/src/share/vm/opto/compile.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/compile.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -431,6 +431,8 @@ // Are we within a PreserveJVMState block? int _preserve_jvm_state; + void* _replay_inline_data; // Pointer to data loaded from file + public: outputStream* print_inlining_stream() const { @@ -465,6 +467,11 @@ print_inlining_stream()->print(ss.as_string()); } + void* replay_inline_data() const { return _replay_inline_data; } + + // Dump inlining replay data to the stream. + void dump_inline_data(outputStream* out); + private: // Matching, CFG layout, allocation, code generation PhaseCFG* _cfg; // Results of CFG finding diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/connode.cpp --- a/hotspot/src/share/vm/opto/connode.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/connode.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/doCall.cpp --- a/hotspot/src/share/vm/opto/doCall.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/doCall.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/domgraph.cpp --- a/hotspot/src/share/vm/opto/domgraph.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/domgraph.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/escape.cpp --- a/hotspot/src/share/vm/opto/escape.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/escape.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1579,9 +1579,20 @@ jobj->set_scalar_replaceable(false); return; } + // 2. An object is not scalar replaceable if the field into which it is + // stored has multiple bases one of which is null. + if (field->base_count() > 1) { + for (BaseIterator i(field); i.has_next(); i.next()) { + PointsToNode* base = i.get(); + if (base == null_obj) { + jobj->set_scalar_replaceable(false); + return; + } + } + } } assert(use->is_Field() || use->is_LocalVar(), "sanity"); - // 2. An object is not scalar replaceable if it is merged with other objects. + // 3. An object is not scalar replaceable if it is merged with other objects. for (EdgeIterator j(use); j.has_next(); j.next()) { PointsToNode* ptn = j.get(); if (ptn->is_JavaObject() && ptn != jobj) { @@ -1600,13 +1611,13 @@ FieldNode* field = j.get()->as_Field(); int offset = field->as_Field()->offset(); - // 3. An object is not scalar replaceable if it has a field with unknown + // 4. An object is not scalar replaceable if it has a field with unknown // offset (array's element is accessed in loop). if (offset == Type::OffsetBot) { jobj->set_scalar_replaceable(false); return; } - // 4. Currently an object is not scalar replaceable if a LoadStore node + // 5. Currently an object is not scalar replaceable if a LoadStore node // access its field since the field value is unknown after it. // Node* n = field->ideal_node(); @@ -1617,7 +1628,7 @@ } } - // 5. Or the address may point to more then one object. This may produce + // 6. Or the address may point to more then one object. This may produce // the false positive result (set not scalar replaceable) // since the flow-insensitive escape analysis can't separate // the case when stores overwrite the field's value from the case diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/gcm.cpp --- a/hotspot/src/share/vm/opto/gcm.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/gcm.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/generateOptoStub.cpp --- a/hotspot/src/share/vm/opto/generateOptoStub.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/generateOptoStub.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/graphKit.cpp --- a/hotspot/src/share/vm/opto/graphKit.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/graphKit.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/graphKit.hpp --- a/hotspot/src/share/vm/opto/graphKit.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/graphKit.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/idealKit.cpp --- a/hotspot/src/share/vm/opto/idealKit.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/idealKit.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/idealKit.hpp --- a/hotspot/src/share/vm/opto/idealKit.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/idealKit.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/ifg.cpp --- a/hotspot/src/share/vm/opto/ifg.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/ifg.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/ifnode.cpp --- a/hotspot/src/share/vm/opto/ifnode.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/ifnode.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/lcm.cpp --- a/hotspot/src/share/vm/opto/lcm.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/lcm.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/live.cpp --- a/hotspot/src/share/vm/opto/live.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/live.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/live.hpp --- a/hotspot/src/share/vm/opto/live.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/live.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/loopPredicate.cpp --- a/hotspot/src/share/vm/opto/loopPredicate.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/loopPredicate.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/loopTransform.cpp --- a/hotspot/src/share/vm/opto/loopTransform.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/loopTransform.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/loopnode.hpp --- a/hotspot/src/share/vm/opto/loopnode.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/loopnode.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/loopopts.cpp --- a/hotspot/src/share/vm/opto/loopopts.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/loopopts.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/macro.cpp --- a/hotspot/src/share/vm/opto/macro.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/macro.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/macro.hpp --- a/hotspot/src/share/vm/opto/macro.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/macro.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/matcher.hpp --- a/hotspot/src/share/vm/opto/matcher.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/matcher.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/memnode.cpp --- a/hotspot/src/share/vm/opto/memnode.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/memnode.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2071,6 +2071,11 @@ if (t != NULL) { // constant oop => constant klass if (offset == java_lang_Class::array_klass_offset_in_bytes()) { + if (t->is_void()) { + // We cannot create a void array. Since void is a primitive type return null + // klass. Users of this result need to do a null check on the returned klass. + return TypePtr::NULL_PTR; + } return TypeKlassPtr::make(ciArrayKlass::make(t)); } if (!t->is_klass()) { diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/memnode.hpp --- a/hotspot/src/share/vm/opto/memnode.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/memnode.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/multnode.cpp --- a/hotspot/src/share/vm/opto/multnode.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/multnode.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/multnode.hpp --- a/hotspot/src/share/vm/opto/multnode.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/multnode.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/node.cpp --- a/hotspot/src/share/vm/opto/node.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/node.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/optoreg.hpp --- a/hotspot/src/share/vm/opto/optoreg.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/optoreg.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/output.cpp --- a/hotspot/src/share/vm/opto/output.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/output.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/output.hpp --- a/hotspot/src/share/vm/opto/output.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/output.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/parse.hpp --- a/hotspot/src/share/vm/opto/parse.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/parse.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -141,6 +141,13 @@ GrowableArray subtrees() { return _subtrees; } void print_value_on(outputStream* st) const PRODUCT_RETURN; + + bool _forced_inline; // Inlining was forced by CompilerOracle or ciReplay + bool forced_inline() const { return _forced_inline; } + // Count number of nodes in this subtree + int count() const; + // Dump inlining replay data to the stream. + void dump_replay_data(outputStream* out); }; diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/parse1.cpp --- a/hotspot/src/share/vm/opto/parse1.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/parse1.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/parse2.cpp --- a/hotspot/src/share/vm/opto/parse2.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/parse2.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/phase.cpp --- a/hotspot/src/share/vm/opto/phase.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/phase.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/phase.hpp --- a/hotspot/src/share/vm/opto/phase.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/phase.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/phaseX.cpp --- a/hotspot/src/share/vm/opto/phaseX.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/phaseX.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/phaseX.hpp --- a/hotspot/src/share/vm/opto/phaseX.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/phaseX.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/postaloc.cpp --- a/hotspot/src/share/vm/opto/postaloc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/postaloc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/reg_split.cpp --- a/hotspot/src/share/vm/opto/reg_split.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/reg_split.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/regalloc.cpp --- a/hotspot/src/share/vm/opto/regalloc.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/regalloc.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/regalloc.hpp --- a/hotspot/src/share/vm/opto/regalloc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/regalloc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/subnode.cpp --- a/hotspot/src/share/vm/opto/subnode.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/subnode.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/subnode.hpp --- a/hotspot/src/share/vm/opto/subnode.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/subnode.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/superword.cpp --- a/hotspot/src/share/vm/opto/superword.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/superword.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/superword.hpp --- a/hotspot/src/share/vm/opto/superword.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/superword.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/opto/type.cpp --- a/hotspot/src/share/vm/opto/type.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/opto/type.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -3812,17 +3812,17 @@ tary = TypeAry::make(Type::BOTTOM, tary->_size, tary->_stable); } } else // Non integral arrays. - // Must fall to bottom if exact klasses in upper lattice - // are not equal or super klass is exact. - if ( above_centerline(ptr) && klass() != tap->klass() && - // meet with top[] and bottom[] are processed further down: - tap ->_klass != NULL && this->_klass != NULL && - // both are exact and not equal: - ((tap ->_klass_is_exact && this->_klass_is_exact) || - // 'tap' is exact and super or unrelated: - (tap ->_klass_is_exact && !tap->klass()->is_subtype_of(klass())) || - // 'this' is exact and super or unrelated: - (this->_klass_is_exact && !klass()->is_subtype_of(tap->klass())))) { + // Must fall to bottom if exact klasses in upper lattice + // are not equal or super klass is exact. + if ((above_centerline(ptr) || ptr == Constant) && klass() != tap->klass() && + // meet with top[] and bottom[] are processed further down: + tap->_klass != NULL && this->_klass != NULL && + // both are exact and not equal: + ((tap->_klass_is_exact && this->_klass_is_exact) || + // 'tap' is exact and super or unrelated: + (tap->_klass_is_exact && !tap->klass()->is_subtype_of(klass())) || + // 'this' is exact and super or unrelated: + (this->_klass_is_exact && !klass()->is_subtype_of(tap->klass())))) { tary = TypeAry::make(Type::BOTTOM, tary->_size, tary->_stable); return make(NotNull, NULL, tary, lazy_klass, false, off, InstanceBot); } diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/precompiled/precompiled.hpp --- a/hotspot/src/share/vm/precompiled/precompiled.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/precompiled/precompiled.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/prims/forte.cpp --- a/hotspot/src/share/vm/prims/forte.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/prims/forte.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -613,7 +613,7 @@ #ifdef __APPLE__ // XXXDARWIN: Link errors occur even when __attribute__((weak_import)) // is added -#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) (0) +#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) ((void) 0) #else void collector_func_load(char* name, void* null_argument_1, diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/prims/jni.cpp --- a/hotspot/src/share/vm/prims/jni.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/prims/jni.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1804,34 +1804,34 @@ // the runtime type of subword integral basic types is integer DEFINE_CALLMETHODV(jboolean, Boolean, T_BOOLEAN - , HOTSPOT_JNI_CALLBOOLEANMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLBOOLEANMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLBOOLEANMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLBOOLEANMETHODV_RETURN(_ret_ref)) DEFINE_CALLMETHODV(jbyte, Byte, T_BYTE - , HOTSPOT_JNI_CALLBYTEMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLBYTEMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLBYTEMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLBYTEMETHODV_RETURN(_ret_ref)) DEFINE_CALLMETHODV(jchar, Char, T_CHAR - , HOTSPOT_JNI_CALLCHARMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLCHARMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLCHARMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLCHARMETHODV_RETURN(_ret_ref)) DEFINE_CALLMETHODV(jshort, Short, T_SHORT - , HOTSPOT_JNI_CALLSHORTMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLSHORTMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLSHORTMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLSHORTMETHODV_RETURN(_ret_ref)) DEFINE_CALLMETHODV(jobject, Object, T_OBJECT - , HOTSPOT_JNI_CALLOBJECTMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLOBJECTMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLOBJECTMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLOBJECTMETHODV_RETURN(_ret_ref)) DEFINE_CALLMETHODV(jint, Int, T_INT, - HOTSPOT_JNI_CALLINTMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLINTMETHOD_RETURN(_ret_ref)) + HOTSPOT_JNI_CALLINTMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLINTMETHODV_RETURN(_ret_ref)) DEFINE_CALLMETHODV(jlong, Long, T_LONG - , HOTSPOT_JNI_CALLLONGMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLLONGMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLLONGMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLLONGMETHODV_RETURN(_ret_ref)) // Float and double probes don't return value because dtrace doesn't currently support it DEFINE_CALLMETHODV(jfloat, Float, T_FLOAT - , HOTSPOT_JNI_CALLFLOATMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLFLOATMETHOD_RETURN()) + , HOTSPOT_JNI_CALLFLOATMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLFLOATMETHODV_RETURN()) DEFINE_CALLMETHODV(jdouble, Double, T_DOUBLE - , HOTSPOT_JNI_CALLDOUBLEMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLDOUBLEMETHOD_RETURN()) + , HOTSPOT_JNI_CALLDOUBLEMETHODV_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLDOUBLEMETHODV_RETURN()) #define DEFINE_CALLMETHODA(ResultType, Result, Tag \ , EntryProbe, ReturnProbe) \ @@ -1856,34 +1856,34 @@ // the runtime type of subword integral basic types is integer DEFINE_CALLMETHODA(jboolean, Boolean, T_BOOLEAN - , HOTSPOT_JNI_CALLBOOLEANMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLBOOLEANMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLBOOLEANMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLBOOLEANMETHODA_RETURN(_ret_ref)) DEFINE_CALLMETHODA(jbyte, Byte, T_BYTE - , HOTSPOT_JNI_CALLBYTEMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLBYTEMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLBYTEMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLBYTEMETHODA_RETURN(_ret_ref)) DEFINE_CALLMETHODA(jchar, Char, T_CHAR - , HOTSPOT_JNI_CALLCHARMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLCHARMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLCHARMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLCHARMETHODA_RETURN(_ret_ref)) DEFINE_CALLMETHODA(jshort, Short, T_SHORT - , HOTSPOT_JNI_CALLSHORTMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLSHORTMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLSHORTMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLSHORTMETHODA_RETURN(_ret_ref)) DEFINE_CALLMETHODA(jobject, Object, T_OBJECT - , HOTSPOT_JNI_CALLOBJECTMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLOBJECTMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLOBJECTMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLOBJECTMETHODA_RETURN(_ret_ref)) DEFINE_CALLMETHODA(jint, Int, T_INT, - HOTSPOT_JNI_CALLINTMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLINTMETHOD_RETURN(_ret_ref)) + HOTSPOT_JNI_CALLINTMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLINTMETHODA_RETURN(_ret_ref)) DEFINE_CALLMETHODA(jlong, Long, T_LONG - , HOTSPOT_JNI_CALLLONGMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLLONGMETHOD_RETURN(_ret_ref)) + , HOTSPOT_JNI_CALLLONGMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLLONGMETHODA_RETURN(_ret_ref)) // Float and double probes don't return value because dtrace doesn't currently support it DEFINE_CALLMETHODA(jfloat, Float, T_FLOAT - , HOTSPOT_JNI_CALLFLOATMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLFLOATMETHOD_RETURN()) + , HOTSPOT_JNI_CALLFLOATMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLFLOATMETHODA_RETURN()) DEFINE_CALLMETHODA(jdouble, Double, T_DOUBLE - , HOTSPOT_JNI_CALLDOUBLEMETHOD_ENTRY(env, obj, (uintptr_t)methodID), - HOTSPOT_JNI_CALLDOUBLEMETHOD_RETURN()) + , HOTSPOT_JNI_CALLDOUBLEMETHODA_ENTRY(env, obj, (uintptr_t)methodID), + HOTSPOT_JNI_CALLDOUBLEMETHODA_RETURN()) DT_VOID_RETURN_MARK_DECL(CallVoidMethod, HOTSPOT_JNI_CALLVOIDMETHOD_RETURN()); DT_VOID_RETURN_MARK_DECL(CallVoidMethodV, HOTSPOT_JNI_CALLVOIDMETHODV_RETURN()); @@ -3145,7 +3145,7 @@ JNI_END DEFINE_SETSTATICFIELD(jboolean, bool, Boolean, 'Z', z - , HOTSPOT_JNI_SETBOOLEANFIELD_ENTRY(env, clazz, (uintptr_t)fieldID, value), + , HOTSPOT_JNI_SETSTATICBOOLEANFIELD_ENTRY(env, clazz, (uintptr_t)fieldID, value), HOTSPOT_JNI_SETBOOLEANFIELD_RETURN()) DEFINE_SETSTATICFIELD(jbyte, byte, Byte, 'B', b , HOTSPOT_JNI_SETSTATICBYTEFIELD_ENTRY(env, clazz, (uintptr_t) fieldID, value), diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/prims/jniCheck.cpp --- a/hotspot/src/share/vm/prims/jniCheck.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/prims/jniCheck.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/prims/jvm.cpp --- a/hotspot/src/share/vm/prims/jvm.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/prims/jvm.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -3971,40 +3971,6 @@ } -// Internal SQE debugging support /////////////////////////////////////////////////////////// - -#ifndef PRODUCT - -extern "C" { - JNIEXPORT jboolean JNICALL JVM_AccessVMBooleanFlag(const char* name, jboolean* value, jboolean is_get); - JNIEXPORT jboolean JNICALL JVM_AccessVMIntFlag(const char* name, jint* value, jboolean is_get); - JNIEXPORT void JNICALL JVM_VMBreakPoint(JNIEnv *env, jobject obj); -} - -JVM_LEAF(jboolean, JVM_AccessVMBooleanFlag(const char* name, jboolean* value, jboolean is_get)) - JVMWrapper("JVM_AccessBoolVMFlag"); - return is_get ? CommandLineFlags::boolAt((char*) name, (bool*) value) : CommandLineFlags::boolAtPut((char*) name, (bool*) value, Flag::INTERNAL); -JVM_END - -JVM_LEAF(jboolean, JVM_AccessVMIntFlag(const char* name, jint* value, jboolean is_get)) - JVMWrapper("JVM_AccessVMIntFlag"); - intx v; - jboolean result = is_get ? CommandLineFlags::intxAt((char*) name, &v) : CommandLineFlags::intxAtPut((char*) name, &v, Flag::INTERNAL); - *value = (jint)v; - return result; -JVM_END - - -JVM_ENTRY(void, JVM_VMBreakPoint(JNIEnv *env, jobject obj)) - JVMWrapper("JVM_VMBreakPoint"); - oop the_obj = JNIHandles::resolve(obj); - BREAKPOINT; -JVM_END - - -#endif - - // Method /////////////////////////////////////////////////////////////////////////////////////////// JVM_ENTRY(jobject, JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0)) diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/prims/jvm_misc.hpp --- a/hotspot/src/share/vm/prims/jvm_misc.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/prims/jvm_misc.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp --- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.hpp --- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.hpp Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.hpp Tue Jan 28 11:21:26 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6a74da13c52f -r def24c6b5019 hotspot/src/share/vm/prims/jvmtiEnter.xsl --- a/hotspot/src/share/vm/prims/jvmtiEnter.xsl Tue Jan 28 14:47:22 2014 +0100 +++ b/hotspot/src/share/vm/prims/jvmtiEnter.xsl Tue Jan 28 11:21:26 2014 -0800 @@ -1,6 +1,6 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + octane-mandreel, octane-navier-stokes, octane-pdfjs, + octane-raytrace, octane-regexp, octane-richards, + octane-splay, octane-typescript"/> @@ -330,6 +369,9 @@ dir="."> + + + diff -r 6a74da13c52f -r def24c6b5019 nashorn/make/build.xml --- a/nashorn/make/build.xml Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/make/build.xml Tue Jan 28 11:21:26 2014 -0800 @@ -66,13 +66,16 @@ + + + + - - - + + @@ -301,6 +304,10 @@ permission java.lang.RuntimePermission "nashorn.JavaReflection"; }; +grant codeBase "file:/${basedir}/test/script/markdown.js" { + permission java.io.FilePermission "${basedir}/test/script/external/showdown/-", "read"; +}; + \/ @@ -316,6 +323,7 @@ + @@ -339,6 +347,9 @@ + + + @@ -393,6 +404,25 @@ + + + + + + + + + + + + + + + + + + @@ -403,6 +433,9 @@ + + + @@ -537,6 +570,11 @@ + + + + + diff -r 6a74da13c52f -r def24c6b5019 nashorn/make/project.properties --- a/nashorn/make/project.properties Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/make/project.properties Tue Jan 28 11:21:26 2014 -0800 @@ -71,6 +71,9 @@ fxshell.dir = tools/fxshell fxshell.jar = ${dist.dir}/nashornfx.jar +# configuration for java flight recorder +run.test.jvmargs.jfr=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=${build.dir},stackdepth=128 + # jars refererred file.reference.testng.jar=test/lib/testng.jar @@ -119,6 +122,7 @@ test262.dir=${test.external.dir}/test262 test262.suite.dir=${test262.dir}/test/suite testjfx.dir=${test.script.dir}/jfx +testmarkdown.dir=${test.script.dir}/markdown test-sys-prop.test.dir=${test.dir} test-sys-prop.test.js.roots=${test.basic.dir} ${test.error.dir} ${test.sandbox.dir} ${test.trusted.dir} @@ -209,6 +213,16 @@ ${test262.dir}/test/harness/framework.js \ ${test262.dir}/test/harness/sta.js +# testmarkdown test root +testmarkdown-test-sys-prop.test.js.roots=${testmarkdown.dir} + +# execute testmarkdown tests in shared nashorn context or not? +testmarkdown-test-sys-prop.test.js.shared.context=false + +# framework root for markdown script tests +testmarkdown-test-sys-prop.test.js.framework=\ + ${test.script.dir}${file.separator}markdown.js + # testjfx test root testjfx-test-sys-prop.test.js.roots=${testjfx.dir} diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/api/scripting/NashornException.java --- a/nashorn/src/jdk/nashorn/api/scripting/NashornException.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/api/scripting/NashornException.java Tue Jan 28 11:21:26 2014 -0800 @@ -29,6 +29,7 @@ import java.util.List; import jdk.nashorn.internal.codegen.CompilerConstants; import jdk.nashorn.internal.runtime.ECMAErrors; +import jdk.nashorn.internal.runtime.ScriptObject; /** * This is base exception for all Nashorn exceptions. These originate from @@ -44,11 +45,13 @@ @SuppressWarnings("serial") public abstract class NashornException extends RuntimeException { // script file name - private final String fileName; + private String fileName; // script line number - private final int line; + private int line; // script column number - private final int column; + private int column; + // underlying ECMA error object - lazily initialized + private Object ecmaError; /** script source name used for "engine.js" */ public static final String ENGINE_SCRIPT_SOURCE_NAME = "nashorn:engine/resources/engine.js"; @@ -122,6 +125,15 @@ } /** + * Set the source file name for this {@code NashornException} + * + * @param fileName the file name + */ + public final void setFileName(final String fileName) { + this.fileName = fileName; + } + + /** * Get the line number for this {@code NashornException} * * @return the line number @@ -131,15 +143,33 @@ } /** + * Set the line number for this {@code NashornException} + * + * @param line the line number + */ + public final void setLineNumber(final int line) { + this.line = line; + } + + /** * Get the column for this {@code NashornException} * - * @return the column + * @return the column number */ public final int getColumnNumber() { return column; } /** + * Set the column for this {@code NashornException} + * + * @param column the column number + */ + public final void setColumnNumber(final int column) { + this.column = column; + } + + /** * Returns array javascript stack frames from the given exception object. * * @param exception exception from which stack frames are retrieved and filtered @@ -155,6 +185,11 @@ if (methodName.equals(CompilerConstants.RUN_SCRIPT.symbolName())) { methodName = ""; } + + if (methodName.contains(CompilerConstants.ANON_FUNCTION_PREFIX.symbolName())) { + methodName = ""; + } + filtered.add(new StackTraceElement(className, methodName, st.getFileName(), st.getLineNumber())); } @@ -188,4 +223,43 @@ } return buf.toString(); } + + protected Object getThrown() { + return null; + } + + protected NashornException initEcmaError(final ScriptObject global) { + if (ecmaError != null) { + return this; // initialized already! + } + + final Object thrown = getThrown(); + if (thrown instanceof ScriptObject) { + setEcmaError(ScriptObjectMirror.wrap(thrown, global)); + } else { + setEcmaError(thrown); + } + + return this; + } + + /** + * Return the underlying ECMA error object, if available. + * + * @return underlying ECMA Error object's mirror or whatever was thrown + * from script such as a String, Number or a Boolean. + */ + public Object getEcmaError() { + return ecmaError; + } + + /** + * Return the underlying ECMA error object, if available. + * + * @param ecmaError underlying ECMA Error object's mirror or whatever was thrown + * from script such as a String, Number or a Boolean. + */ + public void setEcmaError(final Object ecmaError) { + this.ecmaError = ecmaError; + } } diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java --- a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java Tue Jan 28 11:21:26 2014 -0800 @@ -476,16 +476,19 @@ private Object invokeImpl(final Object selfObject, final String name, final Object... args) throws ScriptException, NoSuchMethodException { name.getClass(); // null check + ScriptObject invokeGlobal = null; ScriptObjectMirror selfMirror = null; if (selfObject instanceof ScriptObjectMirror) { selfMirror = (ScriptObjectMirror)selfObject; if (! isOfContext(selfMirror.getHomeGlobal(), nashornContext)) { throw new IllegalArgumentException(getMessage("script.object.from.another.engine")); } + invokeGlobal = selfMirror.getHomeGlobal(); } else if (selfObject instanceof ScriptObject) { // invokeMethod called from script code - in which case we may get 'naked' ScriptObject // Wrap it with oldGlobal to make a ScriptObjectMirror for the same. final ScriptObject oldGlobal = Context.getGlobal(); + invokeGlobal = oldGlobal; if (oldGlobal == null) { throw new IllegalArgumentException(getMessage("no.current.nashorn.global")); } @@ -498,6 +501,7 @@ } else if (selfObject == null) { // selfObject is null => global function call final ScriptObject ctxtGlobal = getNashornGlobalFrom(context); + invokeGlobal = ctxtGlobal; selfMirror = (ScriptObjectMirror)ScriptObjectMirror.wrap(ctxtGlobal, ctxtGlobal); } @@ -509,7 +513,7 @@ if (cause instanceof NoSuchMethodException) { throw (NoSuchMethodException)cause; } - throwAsScriptException(e); + throwAsScriptException(e, invokeGlobal); throw new AssertionError("should not reach here"); } } @@ -543,7 +547,7 @@ } return ScriptObjectMirror.translateUndefined(ScriptObjectMirror.wrap(ScriptRuntime.apply(script, ctxtGlobal), ctxtGlobal)); } catch (final Exception e) { - throwAsScriptException(e); + throwAsScriptException(e, ctxtGlobal); throw new AssertionError("should not reach here"); } finally { if (globalChanged) { @@ -552,7 +556,7 @@ } } - private static void throwAsScriptException(final Exception e) throws ScriptException { + private static void throwAsScriptException(final Exception e, final ScriptObject global) throws ScriptException { if (e instanceof ScriptException) { throw (ScriptException)e; } else if (e instanceof NashornException) { @@ -560,6 +564,7 @@ final ScriptException se = new ScriptException( ne.getMessage(), ne.getFileName(), ne.getLineNumber(), ne.getColumnNumber()); + ne.initEcmaError(global); se.initCause(e); throw se; } else if (e instanceof RuntimeException) { @@ -605,7 +610,7 @@ return nashornContext.compileScript(source, newGlobal); } catch (final Exception e) { - throwAsScriptException(e); + throwAsScriptException(e, newGlobal); throw new AssertionError("should not reach here"); } finally { if (globalChanged) { @@ -621,6 +626,11 @@ continue; } + // skip check for default methods - non-abstract, interface methods + if (! Modifier.isAbstract(method.getModifiers())) { + continue; + } + Object obj = sobj.get(method.getName()); if (! (obj instanceof ScriptFunction)) { return false; diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java --- a/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java Tue Jan 28 11:21:26 2014 -0800 @@ -108,6 +108,8 @@ } throw new RuntimeException("not a function: " + toString()); + } catch (final NashornException ne) { + throw ne.initEcmaError(global); } catch (final RuntimeException | Error e) { throw e; } catch (final Throwable t) { @@ -135,6 +137,8 @@ } throw new RuntimeException("not a constructor: " + toString()); + } catch (final NashornException ne) { + throw ne.initEcmaError(global); } catch (final RuntimeException | Error e) { throw e; } catch (final Throwable t) { @@ -182,6 +186,8 @@ } throw new NoSuchMethodException("No such function " + functionName); + } catch (final NashornException ne) { + throw ne.initEcmaError(global); } catch (final RuntimeException | Error e) { throw e; } catch (final Throwable t) { @@ -717,6 +723,8 @@ } try { return callable.call(); + } catch (final NashornException ne) { + throw ne.initEcmaError(global); } catch (final RuntimeException e) { throw e; } catch (final Exception e) { diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/codegen/Attr.java --- a/nashorn/src/jdk/nashorn/internal/codegen/Attr.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/codegen/Attr.java Tue Jan 28 11:21:26 2014 -0800 @@ -766,7 +766,7 @@ symbol.setType(Type.OBJECT); } - returnType = Type.widest(returnTypes.pop(), symbol.getSymbolType()); + returnType = widestReturnType(returnTypes.pop(), symbol.getSymbolType()); } else { returnType = Type.OBJECT; //undefined } @@ -1433,10 +1433,30 @@ ensureTypeNotUnknown(trueExpr); ensureTypeNotUnknown(falseExpr); - final Type type = Type.widest(trueExpr.getType(), falseExpr.getType()); + final Type type = widestReturnType(trueExpr.getType(), falseExpr.getType()); return end(ensureSymbol(type, ternaryNode)); } + /** + * When doing widening for return types of a function or a ternary operator, it is not valid to widen a boolean to + * anything other than Object. Also, widening a numeric type to an object type must widen to Object proper and not + * any more specific subclass (e.g. widest of int/long/double and String is Object). + * @param t1 type 1 + * @param t2 type 2 + * @return wider of t1 and t2, except if one is boolean and the other is neither boolean nor unknown, or if one is + * numeric and the other is neither numeric nor unknown in which case {@code Type.OBJECT} is returned. + */ + private static Type widestReturnType(final Type t1, final Type t2) { + if (t1.isUnknown()) { + return t2; + } else if (t2.isUnknown()) { + return t1; + } else if (t1.isBoolean() != t2.isBoolean() || t1.isNumeric() != t2.isNumeric()) { + return Type.OBJECT; + } + return Type.widest(t1, t2); + } + private void initCompileConstant(final CompilerConstants cc, final Block block, final int flags) { final Class type = cc.type(); // Must not call this method for constants with no explicit types; use the one with (..., Type) signature instead. diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java --- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java Tue Jan 28 11:21:26 2014 -0800 @@ -2023,8 +2023,6 @@ return false; } - method._new(ECMAException.class).dup(); - final Source source = lc.getCurrentFunction().getSource(); final Expression expression = throwNode.getExpression(); @@ -2037,7 +2035,7 @@ method.load(source.getName()); method.load(line); method.load(column); - method.invoke(ECMAException.THROW_INIT); + method.invoke(ECMAException.CREATE); method.athrow(); diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/codegen/CodeGeneratorLexicalContext.java --- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGeneratorLexicalContext.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGeneratorLexicalContext.java Tue Jan 28 11:21:26 2014 -0800 @@ -158,7 +158,7 @@ if (scopeCalls.containsKey(scopeCall)) { return scopeCalls.get(scopeCall); } - scopeCall.setClassAndName(unit, getCurrentFunction().uniqueName("scopeCall")); + scopeCall.setClassAndName(unit, getCurrentFunction().uniqueName(":scopeCall")); scopeCalls.put(scopeCall, scopeCall); return scopeCall; } @@ -177,7 +177,7 @@ if (scopeCalls.containsKey(scopeCall)) { return scopeCalls.get(scopeCall); } - scopeCall.setClassAndName(unit, getCurrentFunction().uniqueName("scopeCall")); + scopeCall.setClassAndName(unit, getCurrentFunction().uniqueName(":scopeCall")); scopeCalls.put(scopeCall, scopeCall); return scopeCall; } diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/codegen/Compiler.java --- a/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java Tue Jan 28 11:21:26 2014 -0800 @@ -85,6 +85,8 @@ private Source source; + private String sourceName; + private final Map bytecode; private final Set compileUnits; @@ -267,6 +269,7 @@ append('$'). append(safeSourceName(functionNode.getSource())); this.source = functionNode.getSource(); + this.sourceName = functionNode.getSourceName(); this.scriptName = sb.toString(); } @@ -573,7 +576,7 @@ } private CompileUnit initCompileUnit(final String unitClassName, final long initialWeight) { - final ClassEmitter classEmitter = new ClassEmitter(env, source.getName(), unitClassName, strict); + final ClassEmitter classEmitter = new ClassEmitter(env, sourceName, unitClassName, strict); final CompileUnit compileUnit = new CompileUnit(unitClassName, classEmitter, initialWeight); classEmitter.begin(); diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/codegen/CompilerConstants.java --- a/nashorn/src/jdk/nashorn/internal/codegen/CompilerConstants.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/codegen/CompilerConstants.java Tue Jan 28 11:21:26 2014 -0800 @@ -41,6 +41,7 @@ */ public enum CompilerConstants { + /** the __FILE__ variable */ __FILE__, @@ -75,7 +76,7 @@ DEFAULT_SCRIPT_NAME("Script"), /** function prefix for anonymous functions */ - FUNCTION_PREFIX("function$"), + ANON_FUNCTION_PREFIX("L:"), /** method name for Java method that is script entry point */ RUN_SCRIPT("runScript"), @@ -149,26 +150,31 @@ ALLOCATE("allocate"), /** prefix for split methods, @see Splitter */ - SPLIT_PREFIX("$split"), + SPLIT_PREFIX(":split"), /** prefix for split array method and slot */ - SPLIT_ARRAY_ARG("split_array", 3), + SPLIT_ARRAY_ARG(":split_array", 3), /** get string from constant pool */ - GET_STRING("$getString"), + GET_STRING(":getString"), /** get map */ - GET_MAP("$getMap"), + GET_MAP(":getMap"), /** get map */ - SET_MAP("$setMap"), + SET_MAP(":setMap"), /** get array prefix */ - GET_ARRAY_PREFIX("$get"), + GET_ARRAY_PREFIX(":get"), /** get array suffix */ GET_ARRAY_SUFFIX("$array"); + /** + * Prefix used for internal methods generated in script clases. + */ + public static final String INTERNAL_METHOD_PREFIX = ":"; + private final String symbolName; private final Class type; private final int slot; diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java --- a/nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java Tue Jan 28 11:21:26 2014 -0800 @@ -1130,7 +1130,11 @@ popType(Type.OBJECT); } - method.visitMethodInsn(opcode, className, methodName, methodDescriptor); + if (opcode == INVOKEINTERFACE) { + method.visitMethodInsn(opcode, className, methodName, methodDescriptor, true); + } else { + method.visitMethodInsn(opcode, className, methodName, methodDescriptor, false); + } if (returnType != null) { pushType(returnType); diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/codegen/types/Type.java --- a/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java Tue Jan 28 11:21:26 2014 -0800 @@ -261,7 +261,7 @@ } static void invokeStatic(final MethodVisitor method, final Call call) { - method.visitMethodInsn(INVOKESTATIC, call.className(), call.name(), call.descriptor()); + method.visitMethodInsn(INVOKESTATIC, call.className(), call.name(), call.descriptor(), false); } /** diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java --- a/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java Tue Jan 28 11:21:26 2014 -0800 @@ -29,6 +29,7 @@ import java.util.EnumSet; import java.util.HashSet; import java.util.List; +import java.util.Objects; import java.util.Set; import jdk.nashorn.internal.codegen.CompileUnit; import jdk.nashorn.internal.codegen.Compiler; @@ -138,6 +139,9 @@ /** Function flags. */ private final int flags; + /** //@ sourceURL or //# sourceURL for program function nodes */ + private final String sourceURL; + private final int lineNumber; /** Is anonymous function flag. */ @@ -223,6 +227,7 @@ * @param parameters parameter list * @param kind kind of function as in {@link FunctionNode.Kind} * @param flags initial flags + * @param sourceURL sourceURL specified in script (optional) */ public FunctionNode( final Source source, @@ -235,7 +240,8 @@ final String name, final List parameters, final FunctionNode.Kind kind, - final int flags) { + final int flags, + final String sourceURL) { super(token, finish); this.source = source; @@ -250,6 +256,7 @@ this.compilationState = EnumSet.of(CompilationState.INITIALIZED); this.declaredSymbols = new HashSet<>(); this.flags = flags; + this.sourceURL = sourceURL; this.compileUnit = null; this.body = null; this.snapshot = null; @@ -260,6 +267,7 @@ final FunctionNode functionNode, final long lastToken, final int flags, + final String sourceURL, final String name, final Type returnType, final CompileUnit compileUnit, @@ -271,6 +279,7 @@ super(functionNode); this.lineNumber = functionNode.lineNumber; this.flags = flags; + this.sourceURL = sourceURL; this.name = name; this.returnType = returnType; this.compileUnit = compileUnit; @@ -308,6 +317,38 @@ } /** + * get source name - sourceURL or name derived from Source. + * + * @return name for the script source + */ + public String getSourceName() { + return (sourceURL != null)? sourceURL : source.getName(); + } + + /** + * get the sourceURL + * @return the sourceURL + */ + public String getSourceURL() { + return sourceURL; + } + + /** + * Set the sourceURL + * + * @param lc lexical context + * @param newSourceURL source url string to set + * @return function node or a new one if state was changed + */ + public FunctionNode setSourceURL(final LexicalContext lc, final String newSourceURL) { + if (Objects.equals(sourceURL, newSourceURL)) { + return this; + } + + return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, newSourceURL, name, returnType, compileUnit, compilationState, body, parameters, null, hints)); + } + + /** * Returns the line number. * @return the line number. */ @@ -335,7 +376,7 @@ if (this.snapshot == null) { return this; } - return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, null, hints)); + return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, null, hints)); } /** @@ -351,7 +392,7 @@ if (isProgram() || parameters.isEmpty()) { return this; //never specialize anything that won't be recompiled } - return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, this, hints)); + return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, this, hints)); } /** @@ -409,7 +450,7 @@ } final EnumSet newState = EnumSet.copyOf(this.compilationState); newState.add(state); - return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, newState, body, parameters, snapshot, hints)); + return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, newState, body, parameters, snapshot, hints)); } /** @@ -430,7 +471,7 @@ if (this.hints == hints) { return this; } - return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); + return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); } /** @@ -483,7 +524,7 @@ if (this.flags == flags) { return this; } - return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); + return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); } @Override @@ -593,7 +634,7 @@ if(this.body == body) { return this; } - return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags | (body.needsScope() ? FunctionNode.HAS_SCOPE_BLOCK : 0), name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); + return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags | (body.needsScope() ? FunctionNode.HAS_SCOPE_BLOCK : 0), sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); } /** @@ -688,7 +729,7 @@ if (this.lastToken == lastToken) { return this; } - return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); + return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); } /** @@ -710,7 +751,7 @@ if (this.name.equals(name)) { return this; } - return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); + return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); } /** @@ -760,7 +801,7 @@ if (this.parameters == parameters) { return this; } - return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); + return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); } /** @@ -825,6 +866,7 @@ this, lastToken, flags, + sourceURL, name, type, compileUnit, @@ -863,7 +905,7 @@ if (this.compileUnit == compileUnit) { return this; } - return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); + return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, sourceURL, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints)); } /** diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/objects/Global.java --- a/nashorn/src/jdk/nashorn/internal/objects/Global.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/objects/Global.java Tue Jan 28 11:21:26 2014 -0800 @@ -44,6 +44,7 @@ import java.util.concurrent.ConcurrentHashMap; import jdk.internal.dynalink.linker.GuardedInvocation; import jdk.internal.dynalink.linker.LinkRequest; +import jdk.nashorn.internal.lookup.Lookup; import jdk.nashorn.internal.objects.annotations.Attribute; import jdk.nashorn.internal.objects.annotations.Property; import jdk.nashorn.internal.objects.annotations.ScriptClass; @@ -364,6 +365,11 @@ private ScriptObject builtinFloat32Array; private ScriptObject builtinFloat64Array; + /* + * ECMA section 13.2.3 The [[ThrowTypeError]] Function Object + */ + private ScriptFunction typeErrorThrower; + private PropertyMap accessorPropertyDescriptorMap; private PropertyMap arrayBufferViewMap; private PropertyMap dataPropertyDescriptorMap; @@ -1114,6 +1120,10 @@ return builtinArray; } + ScriptFunction getTypeErrorThrower() { + return typeErrorThrower; + } + /** * Called from compiled script code to test if builtin has been overridden * @@ -1695,8 +1705,25 @@ initScripting(env); } - if (Context.DEBUG && System.getSecurityManager() == null) { - initDebug(); + if (Context.DEBUG) { + boolean debugOkay; + final SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + try { + sm.checkPermission(new RuntimePermission(Context.NASHORN_DEBUG_MODE)); + debugOkay = true; + } catch (final SecurityException ignored) { + // if no permission, don't initialize Debug object + debugOkay = false; + } + + } else { + debugOkay = true; + } + + if (debugOkay) { + initDebug(); + } } copyBuiltins(); @@ -2000,6 +2027,13 @@ anon.set("constructor", builtinFunction, false); anon.deleteOwnProperty(anon.getMap().findProperty("prototype")); + // use "getter" so that [[ThrowTypeError]] function's arity is 0 - as specified in step 10 of section 13.2.3 + this.typeErrorThrower = new ScriptFunctionImpl("TypeErrorThrower", Lookup.TYPE_ERROR_THROWER_GETTER, null, null, false, false, false); + typeErrorThrower.setPrototype(UNDEFINED); + // Non-constructor built-in functions do not have "prototype" property + typeErrorThrower.deleteOwnProperty(typeErrorThrower.getMap().findProperty("prototype")); + typeErrorThrower.preventExtensions(); + // now initialize Object this.builtinObject = (ScriptFunction)initConstructor("Object"); final ScriptObject ObjectPrototype = getObjectPrototype(); diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/objects/NativeError.java --- a/nashorn/src/jdk/nashorn/internal/objects/NativeError.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeError.java Tue Jan 28 11:21:26 2014 -0800 @@ -38,7 +38,6 @@ import jdk.nashorn.internal.objects.annotations.Property; import jdk.nashorn.internal.objects.annotations.ScriptClass; import jdk.nashorn.internal.objects.annotations.Where; -import jdk.nashorn.internal.objects.ScriptFunctionImpl; import jdk.nashorn.internal.runtime.ECMAException; import jdk.nashorn.internal.runtime.JSType; import jdk.nashorn.internal.runtime.PropertyMap; @@ -75,7 +74,7 @@ static final String FILENAME = "__fileName__"; /** Message property name */ - @Property(name = NativeError.MESSAGE) + @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE) public Object instMessage; /** ECMA 15.11.4.2 Error.prototype.name */ @@ -86,6 +85,10 @@ @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE) public Object message; + /** Nashorn extension: underlying exception */ + @Property(attributes = Attribute.NOT_ENUMERABLE) + public Object nashornException; + // initialized by nasgen private static PropertyMap $nasgenmap$; @@ -93,6 +96,7 @@ return $nasgenmap$; } + @SuppressWarnings("LeakingThisInConstructor") private NativeError(final Object msg, final ScriptObject proto, final PropertyMap map) { super(proto, map); if (msg != UNDEFINED) { @@ -100,6 +104,7 @@ } else { this.delete(NativeError.MESSAGE, false); } + initException(this); } NativeError(final Object msg, final Global global) { @@ -129,6 +134,14 @@ return new NativeError(msg); } + // This is called NativeError, NativeTypeError etc. to + // associate a ECMAException with the ECMA Error object. + @SuppressWarnings("unused") + static void initException(final ScriptObject self) { + // ECMAException constructor has side effects + new ECMAException(self, null); + } + /** * Nashorn extension: Error.captureStackTrace. Capture stack trace at the point of call into the Error object provided. * @@ -136,16 +149,17 @@ * @param errorObj the error object * @return undefined */ - @SuppressWarnings("unused") @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) public static Object captureStackTrace(final Object self, final Object errorObj) { Global.checkObject(errorObj); final ScriptObject sobj = (ScriptObject)errorObj; - new ECMAException(sobj, null); //constructor has side effects - sobj.delete("stack", false); - final ScriptFunction getStack = ScriptFunctionImpl.makeFunction("getStack", GET_STACK); - final ScriptFunction setStack = ScriptFunctionImpl.makeFunction("setStack", SET_STACK); - sobj.addOwnProperty("stack", Attribute.NOT_ENUMERABLE, getStack, setStack); + initException(sobj); + sobj.delete(STACK, false); + if (! sobj.has("stack")) { + final ScriptFunction getStack = ScriptFunctionImpl.makeFunction("getStack", GET_STACK); + final ScriptFunction setStack = ScriptFunctionImpl.makeFunction("setStack", SET_STACK); + sobj.addOwnProperty("stack", Attribute.NOT_ENUMERABLE, getStack, setStack); + } return UNDEFINED; } @@ -226,7 +240,11 @@ public static Object setLineNumber(final Object self, final Object value) { Global.checkObject(self); final ScriptObject sobj = (ScriptObject)self; - sobj.set(LINENUMBER, value, false); + if (sobj.hasOwnProperty(LINENUMBER)) { + sobj.put(LINENUMBER, value, false); + } else { + sobj.addOwnProperty(LINENUMBER, Attribute.NOT_ENUMERABLE, value); + } return value; } @@ -254,7 +272,11 @@ public static Object setColumnNumber(final Object self, final Object value) { Global.checkObject(self); final ScriptObject sobj = (ScriptObject)self; - sobj.set(COLUMNNUMBER, value, false); + if (sobj.hasOwnProperty(COLUMNNUMBER)) { + sobj.put(COLUMNNUMBER, value, false); + } else { + sobj.addOwnProperty(COLUMNNUMBER, Attribute.NOT_ENUMERABLE, value); + } return value; } @@ -282,7 +304,11 @@ public static Object setFileName(final Object self, final Object value) { Global.checkObject(self); final ScriptObject sobj = (ScriptObject)self; - sobj.set(FILENAME, value, false); + if (sobj.hasOwnProperty(FILENAME)) { + sobj.put(FILENAME, value, false); + } else { + sobj.addOwnProperty(FILENAME, Attribute.NOT_ENUMERABLE, value); + } return value; } @@ -304,10 +330,12 @@ final Object exception = ECMAException.getException(sobj); if (exception instanceof Throwable) { - return getScriptStackString(sobj, (Throwable)exception); + Object value = getScriptStackString(sobj, (Throwable)exception); + sobj.put(STACK, value, false); + return value; } - return ""; + return UNDEFINED; } /** diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/objects/NativeEvalError.java --- a/nashorn/src/jdk/nashorn/internal/objects/NativeEvalError.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeEvalError.java Tue Jan 28 11:21:26 2014 -0800 @@ -44,7 +44,7 @@ public final class NativeEvalError extends ScriptObject { /** message property in instance */ - @Property(name = NativeError.MESSAGE) + @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE) public Object instMessage; /** error name property */ @@ -55,6 +55,10 @@ @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE) public Object message; + /** Nashorn extension: underlying exception */ + @Property(attributes = Attribute.NOT_ENUMERABLE) + public Object nashornException; + // initialized by nasgen private static PropertyMap $nasgenmap$; @@ -62,6 +66,7 @@ return $nasgenmap$; } + @SuppressWarnings("LeakingThisInConstructor") private NativeEvalError(final Object msg, final ScriptObject proto, final PropertyMap map) { super(proto, map); if (msg != UNDEFINED) { @@ -69,6 +74,7 @@ } else { this.delete(NativeError.MESSAGE, false); } + NativeError.initException(this); } NativeEvalError(final Object msg, final Global global) { diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/objects/NativeJavaImporter.java --- a/nashorn/src/jdk/nashorn/internal/objects/NativeJavaImporter.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeJavaImporter.java Tue Jan 28 11:21:26 2014 -0800 @@ -133,6 +133,11 @@ return createAndSetProperty(desc) ? super.lookup(desc, request) : super.noSuchMethod(desc, request); } + @Override + protected Object invokeNoSuchProperty(final String name) { + return createProperty(name); + } + private boolean createAndSetProperty(final CallSiteDescriptor desc) { final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND); final Object value = createProperty(name); diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/objects/NativeMath.java --- a/nashorn/src/jdk/nashorn/internal/objects/NativeMath.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeMath.java Tue Jan 28 11:21:26 2014 -0800 @@ -92,7 +92,7 @@ * @return abs of value */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object abs(final Object self, final Object x) { + public static double abs(final Object self, final Object x) { return Math.abs(JSType.toNumber(x)); } @@ -144,7 +144,7 @@ * @return acos of argument */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object acos(final Object self, final Object x) { + public static double acos(final Object self, final Object x) { return Math.acos(JSType.toNumber(x)); } @@ -170,7 +170,7 @@ * @return asin of argument */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object asin(final Object self, final Object x) { + public static double asin(final Object self, final Object x) { return Math.asin(JSType.toNumber(x)); } @@ -196,7 +196,7 @@ * @return atan of argument */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object atan(final Object self, final Object x) { + public static double atan(final Object self, final Object x) { return Math.atan(JSType.toNumber(x)); } @@ -223,7 +223,7 @@ * @return atan2 of x and y */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object atan2(final Object self, final Object y, final Object x) { + public static double atan2(final Object self, final Object y, final Object x) { return Math.atan2(JSType.toNumber(y), JSType.toNumber(x)); } @@ -250,7 +250,7 @@ * @return ceil of argument */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object ceil(final Object self, final Object x) { + public static double ceil(final Object self, final Object x) { return Math.ceil(JSType.toNumber(x)); } @@ -302,7 +302,7 @@ * @return cos of argument */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object cos(final Object self, final Object x) { + public static double cos(final Object self, final Object x) { return Math.cos(JSType.toNumber(x)); } @@ -328,7 +328,7 @@ * @return exp of argument */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object exp(final Object self, final Object x) { + public static double exp(final Object self, final Object x) { return Math.exp(JSType.toNumber(x)); } @@ -341,7 +341,7 @@ * @return floor of argument */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object floor(final Object self, final Object x) { + public static double floor(final Object self, final Object x) { return Math.floor(JSType.toNumber(x)); } @@ -393,7 +393,7 @@ * @return log of argument */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object log(final Object self, final Object x) { + public static double log(final Object self, final Object x) { return Math.log(JSType.toNumber(x)); } @@ -419,7 +419,7 @@ * @return the largest of the arguments, {@link Double#NEGATIVE_INFINITY} if no args given, or identity if one arg is given */ @Function(arity = 2, attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object max(final Object self, final Object... args) { + public static double max(final Object self, final Object... args) { switch (args.length) { case 0: return Double.NEGATIVE_INFINITY; @@ -497,7 +497,7 @@ * @return the smallest of the arguments, {@link Double#NEGATIVE_INFINITY} if no args given, or identity if one arg is given */ @Function(arity = 2, attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object min(final Object self, final Object... args) { + public static double min(final Object self, final Object... args) { switch (args.length) { case 0: return Double.POSITIVE_INFINITY; @@ -576,7 +576,7 @@ * @return x raised to the power of y */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object pow(final Object self, final Object x, final Object y) { + public static double pow(final Object self, final Object x, final Object y) { return Math.pow(JSType.toNumber(x), JSType.toNumber(y)); } @@ -602,7 +602,7 @@ * @return random number in the range [0..1) */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object random(final Object self) { + public static double random(final Object self) { return Math.random(); } @@ -615,7 +615,7 @@ * @return x rounded */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object round(final Object self, final Object x) { + public static double round(final Object self, final Object x) { final double d = JSType.toNumber(x); if (Math.getExponent(d) >= 52) { return d; @@ -632,7 +632,7 @@ * @return sin of x */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object sin(final Object self, final Object x) { + public static double sin(final Object self, final Object x) { return Math.sin(JSType.toNumber(x)); } @@ -658,7 +658,7 @@ * @return sqrt of x */ @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR) - public static Object sqrt(final Object self, final Object x) { + public static double sqrt(final Object self, final Object x) { return Math.sqrt(JSType.toNumber(x)); } @@ -684,7 +684,7 @@ * @return tan of x */ @Function(attributes = Attribute.NOT_ENUMERABLE, where=Where.CONSTRUCTOR) - public static Object tan(final Object self, final Object x) { + public static double tan(final Object self, final Object x) { return Math.tan(JSType.toNumber(x)); } diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/objects/NativeRangeError.java --- a/nashorn/src/jdk/nashorn/internal/objects/NativeRangeError.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeRangeError.java Tue Jan 28 11:21:26 2014 -0800 @@ -44,7 +44,7 @@ public final class NativeRangeError extends ScriptObject { /** message property in instance */ - @Property(name = NativeError.MESSAGE) + @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE) public Object instMessage; /** error name property */ @@ -55,6 +55,10 @@ @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE) public Object message; + /** Nashorn extension: underlying exception */ + @Property(attributes = Attribute.NOT_ENUMERABLE) + public Object nashornException; + // initialized by nasgen private static PropertyMap $nasgenmap$; @@ -62,6 +66,7 @@ return $nasgenmap$; } + @SuppressWarnings("LeakingThisInConstructor") private NativeRangeError(final Object msg, final ScriptObject proto, final PropertyMap map) { super(proto, map); if (msg != UNDEFINED) { @@ -69,6 +74,7 @@ } else { this.delete(NativeError.MESSAGE, false); } + NativeError.initException(this); } NativeRangeError(final Object msg, final Global global) { diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/objects/NativeReferenceError.java --- a/nashorn/src/jdk/nashorn/internal/objects/NativeReferenceError.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeReferenceError.java Tue Jan 28 11:21:26 2014 -0800 @@ -44,7 +44,7 @@ public final class NativeReferenceError extends ScriptObject { /** message property in instance */ - @Property(name = NativeError.MESSAGE) + @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE) public Object instMessage; /** error name property */ @@ -55,6 +55,10 @@ @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE) public Object message; + /** Nashorn extension: underlying exception */ + @Property(attributes = Attribute.NOT_ENUMERABLE) + public Object nashornException; + // initialized by nasgen private static PropertyMap $nasgenmap$; @@ -62,6 +66,7 @@ return $nasgenmap$; } + @SuppressWarnings("LeakingThisInConstructor") private NativeReferenceError(final Object msg, final ScriptObject proto, final PropertyMap map) { super(proto, map); if (msg != UNDEFINED) { @@ -69,6 +74,7 @@ } else { this.delete(NativeError.MESSAGE, false); } + NativeError.initException(this); } NativeReferenceError(final Object msg, final Global global) { diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/objects/NativeStrictArguments.java --- a/nashorn/src/jdk/nashorn/internal/objects/NativeStrictArguments.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeStrictArguments.java Tue Jan 28 11:21:26 2014 -0800 @@ -76,7 +76,7 @@ super(proto, map); setIsArguments(); - final ScriptFunction func = ScriptFunctionImpl.getTypeErrorThrower(); + final ScriptFunction func = Global.instance().getTypeErrorThrower(); // We have to fill user accessor functions late as these are stored // in this object rather than in the PropertyMap of this object. setUserAccessors("caller", func, func); diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/objects/NativeSyntaxError.java --- a/nashorn/src/jdk/nashorn/internal/objects/NativeSyntaxError.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeSyntaxError.java Tue Jan 28 11:21:26 2014 -0800 @@ -44,7 +44,7 @@ public final class NativeSyntaxError extends ScriptObject { /** message property in instance */ - @Property(name = NativeError.MESSAGE) + @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE) public Object instMessage; /** error name property */ @@ -55,6 +55,10 @@ @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE) public Object message; + /** Nashorn extension: underlying exception */ + @Property(attributes = Attribute.NOT_ENUMERABLE) + public Object nashornException; + // initialized by nasgen private static PropertyMap $nasgenmap$; @@ -62,6 +66,7 @@ return $nasgenmap$; } + @SuppressWarnings("LeakingThisInConstructor") NativeSyntaxError(final Object msg, final Global global) { super(global.getSyntaxErrorPrototype(), global.getSyntaxErrorMap()); if (msg != UNDEFINED) { @@ -69,6 +74,7 @@ } else { this.delete(NativeError.MESSAGE, false); } + NativeError.initException(this); } private NativeSyntaxError(final Object msg) { diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/objects/NativeTypeError.java --- a/nashorn/src/jdk/nashorn/internal/objects/NativeTypeError.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeTypeError.java Tue Jan 28 11:21:26 2014 -0800 @@ -44,7 +44,7 @@ public final class NativeTypeError extends ScriptObject { /** message property in instance */ - @Property(name = NativeError.MESSAGE) + @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE) public Object instMessage; /** error name property */ @@ -55,6 +55,10 @@ @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE) public Object message; + /** Nashorn extension: underlying exception */ + @Property(attributes = Attribute.NOT_ENUMERABLE) + public Object nashornException; + // initialized by nasgen private static PropertyMap $nasgenmap$; @@ -62,6 +66,7 @@ return $nasgenmap$; } + @SuppressWarnings("LeakingThisInConstructor") NativeTypeError(final Object msg, final Global global) { super(global.getTypeErrorPrototype(), global.getTypeErrorMap()); if (msg != UNDEFINED) { @@ -69,6 +74,7 @@ } else { delete(NativeError.MESSAGE, false); } + NativeError.initException(this); } private NativeTypeError(final Object msg) { diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/objects/NativeURIError.java --- a/nashorn/src/jdk/nashorn/internal/objects/NativeURIError.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeURIError.java Tue Jan 28 11:21:26 2014 -0800 @@ -43,7 +43,7 @@ public final class NativeURIError extends ScriptObject { /** message property in instance */ - @Property(name = NativeError.MESSAGE) + @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE) public Object instMessage; /** error name property */ @@ -54,6 +54,10 @@ @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE) public Object message; + /** Nashorn extension: underlying exception */ + @Property(attributes = Attribute.NOT_ENUMERABLE) + public Object nashornException; + // initialized by nasgen private static PropertyMap $nasgenmap$; @@ -61,6 +65,7 @@ return $nasgenmap$; } + @SuppressWarnings("LeakingThisInConstructor") NativeURIError(final Object msg, final Global global) { super(global.getURIErrorPrototype(), global.getURIErrorMap()); if (msg != UNDEFINED) { @@ -68,6 +73,7 @@ } else { this.delete(NativeError.MESSAGE, false); } + NativeError.initException(this); } private NativeURIError(final Object msg) { diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java --- a/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java Tue Jan 28 11:21:26 2014 -0800 @@ -170,26 +170,6 @@ boundfunctionmap$.setIsShared(); } - // function object representing TypeErrorThrower - private static ScriptFunction typeErrorThrower; - - /* - * ECMA section 13.2.3 The [[ThrowTypeError]] Function Object - */ - static synchronized ScriptFunction getTypeErrorThrower() { - if (typeErrorThrower == null) { - // use "getter" so that [[ThrowTypeError]] function's arity is 0 - as specified in step 10 of section 13.2.3 - final ScriptFunctionImpl func = new ScriptFunctionImpl("TypeErrorThrower", Lookup.TYPE_ERROR_THROWER_GETTER, null, null, false, false, false); - func.setPrototype(UNDEFINED); - // Non-constructor built-in functions do not have "prototype" property - func.deleteOwnProperty(func.getMap().findProperty("prototype")); - func.preventExtensions(); - typeErrorThrower = func; - } - - return typeErrorThrower; - } - private static PropertyMap createStrictModeMap(final PropertyMap map) { final int flags = Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE; PropertyMap newMap = map; @@ -313,12 +293,13 @@ // We have to fill user accessor functions late as these are stored // in this object rather than in the PropertyMap of this object. + final ScriptFunction errorThrower = global.getTypeErrorThrower(); if (findProperty("arguments", true) != null) { - setUserAccessors("arguments", getTypeErrorThrower(), getTypeErrorThrower()); + setUserAccessors("arguments", errorThrower, errorThrower); } if (findProperty("caller", true) != null) { - setUserAccessors("caller", getTypeErrorThrower(), getTypeErrorThrower()); + setUserAccessors("caller", errorThrower, errorThrower); } } } diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/parser/AbstractParser.java --- a/nashorn/src/jdk/nashorn/internal/parser/AbstractParser.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/parser/AbstractParser.java Tue Jan 28 11:21:26 2014 -0800 @@ -26,6 +26,7 @@ package jdk.nashorn.internal.parser; import static jdk.nashorn.internal.parser.TokenType.COMMENT; +import static jdk.nashorn.internal.parser.TokenType.DIRECTIVE_COMMENT; import static jdk.nashorn.internal.parser.TokenType.EOF; import static jdk.nashorn.internal.parser.TokenType.EOL; import static jdk.nashorn.internal.parser.TokenType.IDENT; @@ -84,6 +85,9 @@ /** Is this parser running under strict mode? */ protected boolean isStrictMode; + /** //@ sourceURL or //# sourceURL */ + protected String sourceURL; + /** * Construct a parser. * @@ -156,17 +160,38 @@ protected final TokenType nextOrEOL() { do { nextToken(); - } while (type == COMMENT); + if (type == DIRECTIVE_COMMENT) { + checkDirectiveComment(); + } + } while (type == COMMENT || type == DIRECTIVE_COMMENT); return type; } + // sourceURL= after directive comment + private static final String SOURCE_URL_PREFIX = "sourceURL="; + + // currently only @sourceURL=foo supported + private void checkDirectiveComment() { + // if already set, ignore this one + if (sourceURL != null) { + return; + } + + final String comment = (String) lexer.getValueOf(token, isStrictMode); + final int len = comment.length(); + // 4 characters for directive comment marker //@\s or //#\s + if (len > 4 && comment.substring(4).startsWith(SOURCE_URL_PREFIX)) { + sourceURL = comment.substring(4 + SOURCE_URL_PREFIX.length()); + } + } + /** * Seek next token. * * @return tokenType of next token. */ - private final TokenType nextToken() { + private TokenType nextToken() { // Capture last token tokenType. last = type; if (type != EOF) { diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/parser/Lexer.java --- a/nashorn/src/jdk/nashorn/internal/parser/Lexer.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/parser/Lexer.java Tue Jan 28 11:21:26 2014 -0800 @@ -27,6 +27,7 @@ import static jdk.nashorn.internal.parser.TokenType.ADD; import static jdk.nashorn.internal.parser.TokenType.COMMENT; +import static jdk.nashorn.internal.parser.TokenType.DIRECTIVE_COMMENT; import static jdk.nashorn.internal.parser.TokenType.DECIMAL; import static jdk.nashorn.internal.parser.TokenType.EOF; import static jdk.nashorn.internal.parser.TokenType.EOL; @@ -434,12 +435,18 @@ if (ch1 == '/') { // Skip over //. skip(2); + + boolean directiveComment = false; + if ((ch0 == '#' || ch0 == '@') && (ch1 == ' ')) { + directiveComment = true; + } + // Scan for EOL. while (!atEOF() && !isEOL(ch0)) { skip(1); } // Did detect a comment. - add(COMMENT, start); + add(directiveComment? DIRECTIVE_COMMENT : COMMENT, start); return true; } else if (ch1 == '*') { // Skip over /*. @@ -1623,6 +1630,8 @@ return valueOfPattern(start, len); // RegexToken::LexerToken case XML: return valueOfXML(start, len); // XMLToken::LexerToken + case DIRECTIVE_COMMENT: + return source.getString(start, len); default: break; } diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/parser/Parser.java --- a/nashorn/src/jdk/nashorn/internal/parser/Parser.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/parser/Parser.java Tue Jan 28 11:21:26 2014 -0800 @@ -26,7 +26,7 @@ package jdk.nashorn.internal.parser; import static jdk.nashorn.internal.codegen.CompilerConstants.EVAL; -import static jdk.nashorn.internal.codegen.CompilerConstants.FUNCTION_PREFIX; +import static jdk.nashorn.internal.codegen.CompilerConstants.ANON_FUNCTION_PREFIX; import static jdk.nashorn.internal.codegen.CompilerConstants.RUN_SCRIPT; import static jdk.nashorn.internal.parser.TokenType.ASSIGN; import static jdk.nashorn.internal.parser.TokenType.CASE; @@ -389,7 +389,9 @@ sb.append(parentFunction.getName()).append('$'); } - sb.append(ident != null ? ident.getName() : FUNCTION_PREFIX.symbolName()); + assert ident.getName() != null; + sb.append(ident.getName()); + final String name = namespace.uniqueName(sb.toString()); assert parentFunction != null || name.equals(RUN_SCRIPT.symbolName()) : "name = " + name;// must not rename runScript(). @@ -419,7 +421,8 @@ name, parameters, kind, - flags); + flags, + sourceURL); lc.push(functionNode); // Create new block, and just put it on the context stack, restoreFunctionNode() will associate it with the @@ -638,6 +641,10 @@ script = restoreFunctionNode(script, token); //commit code script = script.setBody(lc, script.getBody().setNeedsScope(lc)); + // user may have directive comment to set sourceURL + if (sourceURL != null) { + script = script.setSourceURL(lc, sourceURL); + } return script; } @@ -2132,11 +2139,20 @@ final String setterName = setIdent.getPropertyName(); final IdentNode setNameNode = new IdentNode(((Node)setIdent).getToken(), finish, NameCodec.encode("set " + setterName)); expect(LPAREN); - final IdentNode argIdent = getIdent(); - verifyStrictIdent(argIdent, "setter argument"); + // be sloppy and allow missing setter parameter even though + // spec does not permit it! + final IdentNode argIdent; + if (type == IDENT || isNonStrictModeIdent()) { + argIdent = getIdent(); + verifyStrictIdent(argIdent, "setter argument"); + } else { + argIdent = null; + } expect(RPAREN); List parameters = new ArrayList<>(); - parameters.add(argIdent); + if (argIdent != null) { + parameters.add(argIdent); + } functionNode = functionBody(getSetToken, setNameNode, parameters, FunctionNode.Kind.SETTER); return new PropertyNode(propertyToken, finish, setIdent, null, null, functionNode); @@ -2448,7 +2464,7 @@ // name is null, generate anonymous name boolean isAnonymous = false; if (name == null) { - final String tmpName = "_L" + functionLine; + final String tmpName = ANON_FUNCTION_PREFIX.symbolName() + functionLine; name = new IdentNode(functionToken, Token.descPosition(functionToken), tmpName); isAnonymous = true; } diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/parser/TokenType.java --- a/nashorn/src/jdk/nashorn/internal/parser/TokenType.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/parser/TokenType.java Tue Jan 28 11:21:26 2014 -0800 @@ -41,10 +41,14 @@ */ @SuppressWarnings("javadoc") public enum TokenType { - ERROR (SPECIAL, null), - EOF (SPECIAL, null), - EOL (SPECIAL, null), - COMMENT (SPECIAL, null), + ERROR (SPECIAL, null), + EOF (SPECIAL, null), + EOL (SPECIAL, null), + COMMENT (SPECIAL, null), + // comments of the form //@ foo=bar or //# foo=bar + // These comments are treated as special instructions + // to the lexer, parser or codegenerator. + DIRECTIVE_COMMENT (SPECIAL, null), NOT (UNARY, "!", 14, false), NE (BINARY, "!=", 9, true), diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/runtime/Context.java --- a/nashorn/src/jdk/nashorn/internal/runtime/Context.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/runtime/Context.java Tue Jan 28 11:21:26 2014 -0800 @@ -91,6 +91,11 @@ */ public static final String NASHORN_JAVA_REFLECTION = "nashorn.JavaReflection"; + /** + * Permission to enable nashorn debug mode. + */ + public static final String NASHORN_DEBUG_MODE = "nashorn.debugMode"; + // nashorn load psuedo URL prefixes private static final String LOAD_CLASSPATH = "classpath:"; private static final String LOAD_FX = "fx:"; diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/runtime/ECMAErrors.java --- a/nashorn/src/jdk/nashorn/internal/runtime/ECMAErrors.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/runtime/ECMAErrors.java Tue Jan 28 11:21:26 2014 -0800 @@ -30,6 +30,7 @@ import java.util.ResourceBundle; import jdk.nashorn.api.scripting.NashornException; import jdk.nashorn.internal.scripts.JS; +import jdk.nashorn.internal.codegen.CompilerConstants; /** * Helper class to throw various standard "ECMA error" exceptions such as Error, ReferenceError, TypeError etc. @@ -401,7 +402,7 @@ final String className = frame.getClassName(); // Look for script package in class name (into which compiler puts generated code) - if (className.startsWith(scriptPackage)) { + if (className.startsWith(scriptPackage) && !frame.getMethodName().startsWith(CompilerConstants.INTERNAL_METHOD_PREFIX)) { final String source = frame.getFileName(); /* * Make sure that it is not some Java code that Nashorn has in that package! diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/runtime/ECMAException.java --- a/nashorn/src/jdk/nashorn/internal/runtime/ECMAException.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/runtime/ECMAException.java Tue Jan 28 11:21:26 2014 -0800 @@ -25,7 +25,7 @@ package jdk.nashorn.internal.runtime; -import static jdk.nashorn.internal.codegen.CompilerConstants.constructorNoLookup; +import static jdk.nashorn.internal.codegen.CompilerConstants.staticCallNoLookup; import static jdk.nashorn.internal.codegen.CompilerConstants.virtualField; import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED; @@ -44,9 +44,9 @@ @SuppressWarnings("serial") public final class ECMAException extends NashornException { /** - * Method handle pointing to the constructor {@link ECMAException#ECMAException(Object, String, int, int)}, + * Method handle pointing to the constructor {@link ECMAException#create(Object, String, int, int)}, */ - public static final Call THROW_INIT = constructorNoLookup(ECMAException.class, Object.class, String.class, int.class, int.class); + public static final Call CREATE = staticCallNoLookup(ECMAException.class, "create", ECMAException.class, Object.class, String.class, int.class, int.class); /** Field handle to the{@link ECMAException#thrown} field, so that it can be accessed from generated code */ public static final FieldAccess THROWN = virtualField(ECMAException.class, "thrown", Object.class); @@ -57,23 +57,21 @@ public final Object thrown; /** - * Constructor. This is called from generated code to implement the {@code throw} - * instruction from generated script code + * Constructor. Called from the factory method 'create'. * * @param thrown object to be thrown * @param fileName script file name * @param line line number of throw * @param column column number of throw */ - public ECMAException(final Object thrown, final String fileName, final int line, final int column) { + private ECMAException(final Object thrown, final String fileName, final int line, final int column) { super(ScriptRuntime.safeToString(thrown), asThrowable(thrown), fileName, line, column); this.thrown = thrown; setExceptionToThrown(); } /** - * Constructor. This is called from runtime code in Nashorn to throw things like - * type errors. + * Constructor. This is called from the runtime code. * * @param thrown object to be thrown * @param cause Java exception that triggered this throw @@ -85,9 +83,39 @@ } /** + * Factory method to retrieve the underlying exception or create an exception. + * This method is called from the generated code. + * + * @param thrown object to be thrown + * @param fileName script file name + * @param line line number of throw + * @param column column number of throw + * @return ECMAException object + */ + public static ECMAException create(final Object thrown, final String fileName, final int line, final int column) { + // If thrown object is an Error or sub-object like TypeError, then + // an ECMAException object has been already initialized at constructor. + if (thrown instanceof ScriptObject) { + ScriptObject sobj = (ScriptObject)thrown; + Object exception = getException(sobj); + if (exception instanceof ECMAException) { + // copy over file name, line number and column number. + final ECMAException ee = (ECMAException)exception; + ee.setFileName(fileName); + ee.setLineNumber(line); + ee.setColumnNumber(column); + return ee; + } + } + + return new ECMAException(thrown, fileName, line, column); + } + + /** * Get the thrown object * @return thrown object */ + @Override public Object getThrown() { return thrown; } @@ -256,6 +284,8 @@ final ScriptObject sobj = (ScriptObject)thrown; if (!sobj.has(EXCEPTION_PROPERTY)) { sobj.addOwnProperty(EXCEPTION_PROPERTY, Property.NOT_ENUMERABLE, this); + } else { + sobj.set(EXCEPTION_PROPERTY, this, false); } } } diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/runtime/FindProperty.java --- a/nashorn/src/jdk/nashorn/internal/runtime/FindProperty.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/runtime/FindProperty.java Tue Jan 28 11:21:26 2014 -0800 @@ -112,7 +112,7 @@ return property != null && property.hasGetterFunction(prototype) ? self : prototype; } - /** + /** * Return the appropriate receiver for a setter. * @return appropriate receiver */ @@ -172,5 +172,20 @@ property.setObjectValue(getSetterReceiver(), getOwner(), value, strict); } + /** + * Get the number of objects in the prototype chain between the {@code self} and the + * {@code owner} objects. + * @return the prototype chain length + */ + int getProtoChainLength() { + assert self != null; + int length = 0; + for (ScriptObject obj = self; obj != prototype; obj = obj.getProto()) { + assert !(obj instanceof WithObject); + ++length; + } + return length; + } + } diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/runtime/NativeJavaPackage.java --- a/nashorn/src/jdk/nashorn/internal/runtime/NativeJavaPackage.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/runtime/NativeJavaPackage.java Tue Jan 28 11:21:26 2014 -0800 @@ -196,24 +196,13 @@ @Override public GuardedInvocation noSuchProperty(final CallSiteDescriptor desc, final LinkRequest request) { final String propertyName = desc.getNameToken(2); - final String fullName = name.isEmpty() ? propertyName : name + "." + propertyName; - - final Context context = Context.getContextTrusted(); + createProperty(propertyName); + return super.lookup(desc, request); + } - Class javaClass = null; - try { - javaClass = context.findClass(fullName); - } catch (final NoClassDefFoundError | ClassNotFoundException e) { - //ignored - } - - if (javaClass == null) { - set(propertyName, new NativeJavaPackage(fullName, getProto()), false); - } else { - set(propertyName, StaticClass.forClass(javaClass), false); - } - - return super.lookup(desc, request); + @Override + protected Object invokeNoSuchProperty(final String name) { + return createProperty(name); } @Override @@ -224,4 +213,26 @@ private static MethodHandle findOwnMH(final String name, final Class rtype, final Class... types) { return MH.findStatic(MethodHandles.lookup(), NativeJavaPackage.class, name, MH.type(rtype, types)); } + + private Object createProperty(final String propertyName) { + final String fullName = name.isEmpty() ? propertyName : name + "." + propertyName; + final Context context = Context.getContextTrusted(); + + Class javaClass = null; + try { + javaClass = context.findClass(fullName); + } catch (final NoClassDefFoundError | ClassNotFoundException e) { + //ignored + } + + final Object propertyValue; + if (javaClass == null) { + propertyValue = new NativeJavaPackage(fullName, getProto()); + } else { + propertyValue = StaticClass.forClass(javaClass); + } + + set(propertyName, propertyValue, false); + return propertyValue; + } } diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java --- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java Tue Jan 28 11:21:26 2014 -0800 @@ -143,6 +143,8 @@ private static final MethodHandle TRUNCATINGFILTER = findOwnMH("truncatingFilter", Object[].class, int.class, Object[].class); private static final MethodHandle KNOWNFUNCPROPGUARD = findOwnMH("knownFunctionPropertyGuard", boolean.class, Object.class, PropertyMap.class, MethodHandle.class, Object.class, ScriptFunction.class); + private static final ArrayList protoFilters = new ArrayList<>(); + /** Method handle for getting a function argument at a given index. Used from MapCreator */ public static final Call GET_ARGUMENT = virtualCall(MethodHandles.lookup(), ScriptObject.class, "getArgument", Object.class, int.class); @@ -1712,6 +1714,44 @@ } /** + * Test whether this object contains in its prototype chain or is itself a with-object. + * @return true if a with-object was found + */ + final boolean hasWithScope() { + if (isScope()) { + for (ScriptObject obj = this; obj != null; obj = obj.getProto()) { + if (obj instanceof WithObject) { + return true; + } + } + } + return false; + } + + /** + * Add a filter to the first argument of {@code methodHandle} that calls its {@link #getProto()} method + * {@code depth} times. + * @param methodHandle a method handle + * @param depth distance to target prototype + * @return the filtered method handle + */ + static MethodHandle addProtoFilter(final MethodHandle methodHandle, final int depth) { + if (depth == 0) { + return methodHandle; + } + final int listIndex = depth - 1; // We don't need 0-deep walker + MethodHandle filter = listIndex < protoFilters.size() ? protoFilters.get(listIndex) : null; + + if(filter == null) { + filter = addProtoFilter(GETPROTO, depth - 1); + protoFilters.add(null); + protoFilters.set(listIndex, filter); + } + + return MH.filterArguments(methodHandle, 0, filter.asType(filter.type().changeReturnType(methodHandle.type().parameterType(0)))); + } + + /** * Find the appropriate GET method for an invoke dynamic call. * * @param desc the call site descriptor @@ -1722,7 +1762,7 @@ */ protected GuardedInvocation findGetMethod(final CallSiteDescriptor desc, final LinkRequest request, final String operator) { final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND); - if (request.isCallSiteUnstable()) { + if (request.isCallSiteUnstable() || hasWithScope()) { return findMegaMorphicGetMethod(desc, name, "getMethod".equals(operator)); } @@ -1748,22 +1788,24 @@ final Property property = find.getProperty(); methodHandle = find.getGetter(returnType); + final boolean noGuard = ObjectClassGenerator.OBJECT_FIELDS_ONLY && NashornCallSiteDescriptor.isFastScope(desc) && !property.canChangeType(); // getMap() is fine as we have the prototype switchpoint depending on where the property was found - final MethodHandle guard = NashornGuards.getMapGuard(getMap()); + final MethodHandle guard = noGuard ? null : NashornGuards.getMapGuard(getMap()); if (methodHandle != null) { assert methodHandle.type().returnType().equals(returnType); if (find.isSelf()) { - return new GuardedInvocation(methodHandle, ObjectClassGenerator.OBJECT_FIELDS_ONLY && - NashornCallSiteDescriptor.isFastScope(desc) && !property.canChangeType() ? null : guard); + return new GuardedInvocation(methodHandle, guard); } - final ScriptObject prototype = find.getOwner(); - - if (!property.hasGetterFunction(prototype)) { - methodHandle = bindTo(methodHandle, prototype); + if (!property.hasGetterFunction(find.getOwner())) { + // If not a scope bind to actual prototype as changing prototype will change the property map. + // For scopes we install a filter that replaces the self object with the prototype owning the property. + methodHandle = isScope() ? + addProtoFilter(methodHandle, find.getProtoChainLength()) : + bindTo(methodHandle, find.getOwner()); } - return new GuardedInvocation(methodHandle, getMap().getProtoGetSwitchPoint(proto, name), guard); + return new GuardedInvocation(methodHandle, noGuard ? null : getMap().getProtoGetSwitchPoint(proto, name), guard); } assert !NashornCallSiteDescriptor.isFastScope(desc); @@ -1833,7 +1875,7 @@ */ protected GuardedInvocation findSetMethod(final CallSiteDescriptor desc, final LinkRequest request) { final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND); - if (request.isCallSiteUnstable()) { + if (request.isCallSiteUnstable() || hasWithScope()) { return findMegaMorphicSetMethod(desc, name); } @@ -1888,7 +1930,9 @@ final ScriptObject obj = (ScriptObject)self; final boolean isStrict = NashornCallSiteDescriptor.isStrict(desc); if (!obj.isExtensible()) { - throw typeError("object.non.extensible", desc.getNameToken(2), ScriptRuntime.safeToString(obj)); + if (isStrict) { + throw typeError("object.non.extensible", desc.getNameToken(2), ScriptRuntime.safeToString(obj)); + } } else if (obj.compareAndSetMap(oldMap, newMap)) { setter.invokeExact(self, value); } else { @@ -2049,12 +2093,13 @@ return createEmptyGetter(desc, name); } + /** * Invoke fall back if a property is not found. * @param name Name of property. * @return Result from call. */ - private Object invokeNoSuchProperty(final String name) { + protected Object invokeNoSuchProperty(final String name) { final FindProperty find = findProperty(NO_SUCH_PROPERTY_NAME, true); if (find != null) { @@ -2759,7 +2804,8 @@ public final void setObject(final FindProperty find, final boolean strict, final String key, final Object value) { FindProperty f = find; - if (f != null && f.isInherited() && !(f.getProperty() instanceof UserAccessorProperty)) { + if (f != null && f.isInherited() && !(f.getProperty() instanceof UserAccessorProperty) && !isScope()) { + // Setting a property should not modify the property in prototype unless this is a scope object. f = null; } diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/runtime/SetMethodCreator.java --- a/nashorn/src/jdk/nashorn/internal/runtime/SetMethodCreator.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/runtime/SetMethodCreator.java Tue Jan 28 11:21:26 2014 -0800 @@ -151,10 +151,12 @@ assert methodHandle != null; assert property != null; - final ScriptObject prototype = find.getOwner(); final MethodHandle boundHandle; - if (!property.hasSetterFunction(prototype) && find.isInherited()) { - boundHandle = ScriptObject.bindTo(methodHandle, prototype); + if (!property.hasSetterFunction(find.getOwner()) && find.isInherited()) { + // Bind or add prototype filter depending on whether this is a scope object. + boundHandle = sobj.isScope() ? + ScriptObject.addProtoFilter(methodHandle, find.getProtoChainLength()): + ScriptObject.bindTo(methodHandle, find.getOwner()); } else { boundHandle = methodHandle; } diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java --- a/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java Tue Jan 28 11:21:26 2014 -0800 @@ -317,7 +317,7 @@ final InstructionAdapter mv = new InstructionAdapter(cw.visitMethod(ACC_STATIC, CLASS_INIT, Type.getMethodDescriptor(Type.VOID_TYPE), null, null)); - mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getClassOverrides", GET_CLASS_INITIALIZER_DESCRIPTOR); + mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getClassOverrides", GET_CLASS_INITIALIZER_DESCRIPTOR, false); final Label initGlobal; if(samName != null) { // If the class is a SAM, allow having a ScriptFunction passed as class overrides @@ -333,7 +333,7 @@ if(mi.getName().equals(samName)) { mv.dup(); mv.aconst(Type.getMethodType(mi.type.toMethodDescriptorString())); - mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_FUNCTION_DESCRIPTOR); + mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_FUNCTION_DESCRIPTOR, false); } else { mv.visitInsn(ACONST_NULL); } @@ -350,7 +350,7 @@ mv.dup(); mv.aconst(mi.getName()); mv.aconst(Type.getMethodType(mi.type.toMethodDescriptorString())); - mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_OBJECT_DESCRIPTOR); + mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_OBJECT_DESCRIPTOR, false); mv.putstatic(generatedClassName, mi.methodHandleClassFieldName, METHOD_HANDLE_TYPE_DESCRIPTOR); } @@ -367,7 +367,7 @@ private static void invokeGetGlobalWithNullCheck(final InstructionAdapter mv) { invokeGetGlobal(mv); mv.dup(); - mv.invokevirtual(OBJECT_TYPE_NAME, "getClass", GET_CLASS_METHOD_DESCRIPTOR); // check against null Context + mv.invokevirtual(OBJECT_TYPE_NAME, "getClass", GET_CLASS_METHOD_DESCRIPTOR, false); // check against null Context mv.pop(); } @@ -424,7 +424,7 @@ mv.load(offset, argType); offset += argType.getSize(); } - mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor()); + mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor(), false); endInitMethod(mv); } @@ -477,7 +477,7 @@ mv.load(offset, argType); offset += argType.getSize(); } - mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor()); + mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor(), false); // Get a descriptor to the appropriate "JavaAdapterFactory.getHandle" method. final String getHandleDescriptor = fromFunction ? GET_HANDLE_FUNCTION_DESCRIPTOR : GET_HANDLE_OBJECT_DESCRIPTOR; @@ -496,7 +496,7 @@ mv.aconst(mi.getName()); } mv.aconst(Type.getMethodType(mi.type.toMethodDescriptorString())); - mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", getHandleDescriptor); + mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", getHandleDescriptor, false); } mv.putfield(generatedClassName, mi.methodHandleInstanceFieldName, METHOD_HANDLE_TYPE_DESCRIPTOR); } @@ -520,11 +520,11 @@ } private static void invokeGetGlobal(final InstructionAdapter mv) { - mv.invokestatic(CONTEXT_TYPE_NAME, "getGlobal", GET_GLOBAL_METHOD_DESCRIPTOR); + mv.invokestatic(CONTEXT_TYPE_NAME, "getGlobal", GET_GLOBAL_METHOD_DESCRIPTOR, false); } private static void invokeSetGlobal(final InstructionAdapter mv) { - mv.invokestatic(CONTEXT_TYPE_NAME, "setGlobal", SET_GLOBAL_METHOD_DESCRIPTOR); + mv.invokestatic(CONTEXT_TYPE_NAME, "setGlobal", SET_GLOBAL_METHOD_DESCRIPTOR, false); } /** @@ -647,11 +647,11 @@ // If the super method is abstract, throw an exception mv.anew(UNSUPPORTED_OPERATION_TYPE); mv.dup(); - mv.invokespecial(UNSUPPORTED_OPERATION_TYPE_NAME, INIT, VOID_NOARG_METHOD_DESCRIPTOR); + mv.invokespecial(UNSUPPORTED_OPERATION_TYPE_NAME, INIT, VOID_NOARG_METHOD_DESCRIPTOR, false); mv.athrow(); } else { // If the super method is not abstract, delegate to it. - emitSuperCall(mv, name, methodDesc); + emitSuperCall(mv, method.getDeclaringClass(), name, methodDesc); } final Label setupGlobal = new Label(); @@ -728,7 +728,7 @@ // Invoke the target method handle final Label tryBlockStart = new Label(); mv.visitLabel(tryBlockStart); - mv.invokevirtual(METHOD_HANDLE_TYPE.getInternalName(), "invokeExact", type.toMethodDescriptorString()); + mv.invokevirtual(METHOD_HANDLE_TYPE.getInternalName(), "invokeExact", type.toMethodDescriptorString(), false); final Label tryBlockEnd = new Label(); mv.visitLabel(tryBlockEnd); emitFinally(mv, currentGlobalVar, globalsDifferVar); @@ -744,7 +744,7 @@ mv.anew(RUNTIME_EXCEPTION_TYPE); mv.dupX1(); mv.swap(); - mv.invokespecial(RUNTIME_EXCEPTION_TYPE_NAME, INIT, Type.getMethodDescriptor(Type.VOID_TYPE, THROWABLE_TYPE)); + mv.invokespecial(RUNTIME_EXCEPTION_TYPE_NAME, INIT, Type.getMethodDescriptor(Type.VOID_TYPE, THROWABLE_TYPE), false); // Fall through to rethrow handler } else { throwableHandler = null; @@ -830,12 +830,12 @@ SUPER_PREFIX + name, methodDesc, null, getExceptionNames(method.getExceptionTypes()))); mv.visitCode(); - emitSuperCall(mv, name, methodDesc); + emitSuperCall(mv, method.getDeclaringClass(), name, methodDesc); endMethod(mv); } - private void emitSuperCall(final InstructionAdapter mv, final String name, final String methodDesc) { + private void emitSuperCall(final InstructionAdapter mv, final Class owner, final String name, final String methodDesc) { mv.visitVarInsn(ALOAD, 0); int nextParam = 1; final Type methodType = Type.getMethodType(methodDesc); @@ -843,7 +843,13 @@ mv.load(nextParam, t); nextParam += t.getSize(); } - mv.invokespecial(superClassName, name, methodDesc); + + // default method - non-abstract, interface method + if (Modifier.isInterface(owner.getModifiers())) { + mv.invokespecial(Type.getInternalName(owner), name, methodDesc, false); + } else { + mv.invokespecial(superClassName, name, methodDesc, false); + } mv.areturn(methodType.getReturnType()); } diff -r 6a74da13c52f -r def24c6b5019 nashorn/src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java --- a/nashorn/src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java Tue Jan 28 11:21:26 2014 -0800 @@ -75,7 +75,8 @@ if ((self instanceof Class) && Modifier.isPublic(((Class)self).getModifiers())) { final CallSiteDescriptor desc = requestWithoutContext.getCallSiteDescriptor(); if(CallSiteDescriptorFactory.tokenizeOperators(desc).contains("getProp")) { - if ("static".equals(desc.getNameToken(CallSiteDescriptor.NAME_OPERAND))) { + if (desc.getNameTokenCount() > CallSiteDescriptor.NAME_OPERAND && + "static".equals(desc.getNameToken(CallSiteDescriptor.NAME_OPERAND))) { if (Context.isAccessibleClass((Class)self) && !isReflectionClass((Class)self)) { // If "getProp:static" passes access checks, allow access. return; diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8010731.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8010731.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8010731: Nashorn exposes internal symbols such as __callee__, __scope__ to scripts + * + * @test + * @run + */ + +function checkCallee() { + var x = arguments[0]; // force __callee__ (renamed as :callee) + + print(__callee__); +} + +try { + checkCallee(); + fail("Should have thrown ReferenceError for __callee__"); +} catch (e) { + if (! (e instanceof ReferenceError)) { + fail("ReferenceError expected, got " + e); + } +} + +function checkScope() { + var x = 334; + + function inner() { + var y = x * x; // force __scope__ (renamed as :scope") + print(__scope__); + } + + inner(); +} + +try { + checkScope(); + fail("Should have thrown ReferenceError for __scope__"); +} catch (e) { + if (! (e instanceof ReferenceError)) { + fail("ReferenceError expected, got " + e); + } +} diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8025515.js --- a/nashorn/test/script/basic/JDK-8025515.js Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/test/script/basic/JDK-8025515.js Tue Jan 28 11:21:26 2014 -0800 @@ -30,13 +30,23 @@ // Make sure synthetic names of anonymous functions have correct line numbers +function getFirstScriptFrame(stack) { + for (frameNum in stack) { + var frame = stack[frameNum]; + if (frame.className.startsWith("jdk.nashorn.internal.scripts.Script$")) { + return frame; + } + } +} + function testMethodName(f, expected) { try { f(); fail("expected error"); } catch (e) { - var stack = e.getStackTrace(); - if (stack[0].methodName !== expected) { + var stack = e.nashornException.getStackTrace(); + var name = getFirstScriptFrame(stack).methodName; + if (name !== expected) { fail("got " + stack[0].methodName + ", expected " + expected); } } @@ -44,15 +54,15 @@ testMethodName(function() { return a.b.c; -}, "_L45"); +}, "L:55"); -testMethodName(function() { throw new Error() }, "_L49"); +testMethodName(function() { throw new Error() }, "L:59"); var f = (function() { return function() { a.b.c; }; })(); -testMethodName(f, "_L51$_L52"); +testMethodName(f, "L:61$L:62"); testMethodName((function() { return function() { return a.b.c; }; -})(), "_L56$_L57"); +})(), "L:66$L:67"); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8029364.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8029364.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8029364: NashornException to expose thrown object + * + * @test + * @run + */ + +var m = new javax.script.ScriptEngineManager(); +var e = m.getEngineByName("nashorn"); +var g = e.eval("this"); +try { + e.eval("var e = new Error('foo'); e.bar = 33; throw e"); +} catch (se) { + // ScriptException instance's cause is a NashornException + print(se.getClass()); + var cause = se.cause; + print(cause.getClass()); + // NashornException instance has 'ecmaError' bean getter + print(cause.ecmaError); + // access to underlying ECMA Error object + print(cause.ecmaError instanceof g.Error); + print(cause.ecmaError.name); + print(cause.ecmaError.message); + print(cause.ecmaError.bar); +} + diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8029364.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8029364.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,7 @@ +class javax.script.ScriptException +class jdk.nashorn.internal.runtime.ECMAException +Error: foo +true +Error +foo +33 diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8029467.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8029467.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8029467: Widening of booleans causes bad results + * + * @test + * @run + */ + +print((function (x) { return x ? true : 0 })(true)) +print((function (x) { if(x) { return true } else { return 0 } })(true)) +print(typeof (function (x) { return x ? 1 : "123" })(true) === "number") +print(typeof (function (x) { if(x) { return 1 } else { return "123" } })(true) === "number") diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8029467.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8029467.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,4 @@ +true +true +true +true diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8029667.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8029667.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8029667: Prototype linking is incorrect + * + * @test + * @run + */ + +function f(x) { + return (function inner() { + var y; (function dummy() { return y })() // force own scope for the inner function + with({}) { // 'with' block turns off fast scopes + return x + } + })(); +} +print(f(1)); +print(f(2)); + +function g(x) { + (function inner() { + var y; (function dummy() { return y })() // force own scope for the inner function + with({}) { // 'with' block turns off fast scopes + // Test setter as well as getter + x = x + 2; + } + })(); + print(x); +} + +g(1); +g(2); + +var withScopes = [{ func: function() { print("called 1");} }, { func: function() { print("called 2");} }]; + +for(var i in withScopes) { + with (withScopes[i]) { + var main = function() { + var frame; // <---- this local variable caused scope to be not set properly prior to fix + + function callFunc() { + frame = func(); + } + + callFunc(); + } + } + main(); +} + +for(var i in withScopes) { + with (withScopes[i]) { + var main = function() { + var frame; // <---- this local variable caused scope to be not set properly prior to fix + + function callFunc() { + frame = func = i; + } + + callFunc(); + } + } + main(); +} + +print(withScopes[0].func); +print(withScopes[1].func); + + diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8029667.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8029667.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,8 @@ +1 +2 +3 +4 +called 1 +called 2 +0 +1 diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8030182.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8030182.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8030182: scopeCall with -1 as line number + * + * @test + * @run + */ + +function func() { + throw new Error("Strange..."); +} + +var f2 = func; +var f3 = func; +var f4 = func; +var f5 = func; + +// check that "scopeCall" or some such internal method +// does not appear in script stack trace. +try { + func(); +} catch(err) { + print(err.stack.replace(/\\/g, '/')); +} diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8030182.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8030182.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,3 @@ +Error: Strange... + at func (test/script/basic/JDK-8030182.js:32) + at (test/script/basic/JDK-8030182.js:43) diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8030182_2.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8030182_2.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8030182: scopeCall with -1 as line number + * + * @test + * @run + */ + +var str = ""; + +// large code to force splitting +for (i = 0; i < 1000; ++i) + str +="o = new Object()\n"; + +str +="g()"; + +// check that "$split" or some such internal method +// does not appear in script stack trace!! +try { + eval(str); +} catch (e) { + print(e.stack.replace(/\\/g, '/')); +} + diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,3 @@ +ReferenceError: "g" is not defined + at (test/script/basic/JDK-8030182_2.js#42:4@0:-1) + at (test/script/basic/JDK-8030182_2.js:42) diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8030809.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8030809.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8030809: Anonymous functions should not be shown with internal names in script stack trace + * + * @test + * @run + */ + +function func() { + (function() { + throw new Error(); + })(); +} + +try { + func(); +} catch (e) { + print(e.stack.replace(/\\/g, '/')); +} diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8030809.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8030809.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,4 @@ +Error + at (test/script/basic/JDK-8030809.js:33) + at func (test/script/basic/JDK-8030809.js:32) + at (test/script/basic/JDK-8030809.js:38) diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8031317.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8031317.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8031317: SyntaxError when property setter has no parameter + * + * @test + * @run + */ + +var obj = { + get toto() { + print("in getter for 'toto'"); + }, + set toto() { + print("in setter for 'toto'"); + } +} + +obj.toto; +obj.toto = 344; diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8031317.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8031317.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,2 @@ +in getter for 'toto' +in setter for 'toto' diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8031359.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8031359.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8031359: Invocable.getInterface() works incorrectly if interface has default methods + * + * @test + * @run + */ + +var func = new java.util.function.Function() { + apply: function(arg) { + print("func called with " + arg); + return arg.toUpperCase(); + } +}; + +// Function.andThen is a default method +func.andThen(func)("hello"); + +// Function.compose is another default method +func.compose(new java.util.function.Function() { + apply: function(arg) { + print("compose called with " + arg); + return arg.charAt(0); + } +})("hello"); + +var func2 = new java.util.function.Function() { + apply: function(arg) { + print("I am func2: " + arg); + return arg; + }, + + andThen: function(func) { + print("This is my andThen!"); + return func; + } +}; + +func2.apply("hello"); +func2.andThen(func); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8031359.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8031359.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,6 @@ +func called with hello +func called with HELLO +compose called with hello +func called with h +I am func2: hello +This is my andThen! diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8031715.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8031715.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8031715: Indexed access to java package not working + * @test + * @run + */ + +print(java["net"]); +print(java["net"]["URL"]); +print(java["net"].URL); +print(java.net["URL"]); + +var is = "InputStream"; +var io = "io"; + +print(java.io[is]); +print(java[io]); +print(java[io][is]); + +var ji = new JavaImporter(java.util, java.io); +print(ji["InputStream"]); +print(ji['Vector']); + +var hash = "Hashtable"; +var printStream = "PrintStream"; +print(ji[hash]); +print(ji[printStream]); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8031715.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8031715.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,11 @@ +[JavaPackage java.net] +[JavaClass java.net.URL] +[JavaClass java.net.URL] +[JavaClass java.net.URL] +[JavaClass java.io.InputStream] +[JavaPackage java.io] +[JavaClass java.io.InputStream] +[JavaClass java.io.InputStream] +[JavaClass java.util.Vector] +[JavaClass java.util.Hashtable] +[JavaClass java.io.PrintStream] diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8031983.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8031983.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8031983: Error objects should capture stack at the constructor + * + * @test + * @run + */ + +var e = new Error(); +print("hello"); + +try { + throw e; +} catch (e) { + print(e.lineNumber); + print(e.stack.replace(/\\/g, '/')); +} + +Error.captureStackTrace(e); +try { + throw e; +} catch (e) { + print(e.lineNumber); + print(e.stack.replace(/\\/g, '/')); +} + +var obj = {}; +Error.captureStackTrace(obj); +try { + throw obj; +} catch (e) { + print(e.stack.replace(/\\/g, '/')); +} diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8031983.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8031983.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,9 @@ +hello +35 +Error + at (test/script/basic/JDK-8031983.js:31) +43 +Error + at (test/script/basic/JDK-8031983.js:41) +[object Object] + at (test/script/basic/JDK-8031983.js:50) diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8032004.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8032004.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8032004: instance property "message" of Error objects should be non-enumerable + * + * @test + * @run + */ + +function check(obj) { + if (obj.propertyIsEnumerable("message")) { + fail(obj.name + " object's message property is enumerable!"); + } +} + +check(new Error("test")); +check(new EvalError("test")); +check(new RangeError("test")); +check(new ReferenceError("test")); +check(new SyntaxError("test")); +check(new TypeError("test")); +check(new URIError("test")); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8032068.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8032068.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8032068: implement @sourceURL and #sourceURL directives. + * + * @test + * @run + */ + + +try { + Function("throw new Error();\n//# sourceURL=foo.js")(); +} catch (e) { + print(e.stack.replace(/\\/g, '/')); +} + +try { + eval("function g() { throw Error('x');\n } g();\n//# sourceURL=bar.js"); +} catch (e) { + print(e.stack.replace(/\\/g, '/')); +} + +// check @sourceURL for compatibility +try { + Function("throw new Error();\n//@ sourceURL=foo2.js")(); +} catch (e) { + print(e.stack.replace(/\\/g, '/')); +} + +try { + eval("function g() { throw Error('x');\n } g();\n//@ sourceURL=bar2.js"); +} catch (e) { + print(e.stack.replace(/\\/g, '/')); +} + diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/JDK-8032068.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/basic/JDK-8032068.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,14 @@ +Error + at (foo.js:2) + at (test/script/basic/JDK-8032068.js:33) +Error: x + at g (bar.js:1) + at (bar.js:2) + at (test/script/basic/JDK-8032068.js:39) +Error + at (foo2.js:2) + at (test/script/basic/JDK-8032068.js:46) +Error: x + at g (bar2.js:1) + at (bar2.js:2) + at (test/script/basic/JDK-8032068.js:52) diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/NASHORN-111.js.EXPECTED --- a/nashorn/test/script/basic/NASHORN-111.js.EXPECTED Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/test/script/basic/NASHORN-111.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -1,1 +1,1 @@ -{"message":"type error"} +{} diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/NASHORN-441.js.EXPECTED --- a/nashorn/test/script/basic/NASHORN-441.js.EXPECTED Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/test/script/basic/NASHORN-441.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -12,6 +12,6 @@ try 5 rethrow 5 finally 5 -Error: try 5 thrown in line 71 +Error: try 5 thrown in line 74 try 6 finally 6 diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/compile-octane-splitter.js.EXPECTED --- a/nashorn/test/script/basic/compile-octane-splitter.js.EXPECTED Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/test/script/basic/compile-octane-splitter.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -1,13 +1,14 @@ -Compiled OK: box2d -Compiled OK: code-load -Compiled OK: crypto -Compiled OK: deltablue -Compiled OK: earley-boyer -Compiled OK: gbemu -Compiled OK: mandreel -Compiled OK: navier-stokes -Compiled OK: pdfjs -Compiled OK: raytrace -Compiled OK: regexp -Compiled OK: richards -Compiled OK: splay +[box2d] Compiled OK +[code-load] Compiled OK +[crypto] Compiled OK +[deltablue] Compiled OK +[earley-boyer] Compiled OK +[gbemu] Compiled OK +[mandreel] Compiled OK +[navier-stokes] Compiled OK +[pdfjs] Compiled OK +[raytrace] Compiled OK +[regexp] Compiled OK +[richards] Compiled OK +[splay] Compiled OK +[typescript] Compiled OK diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/compile-octane.js.EXPECTED --- a/nashorn/test/script/basic/compile-octane.js.EXPECTED Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/test/script/basic/compile-octane.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -1,13 +1,14 @@ -Compiled OK: box2d -Compiled OK: code-load -Compiled OK: crypto -Compiled OK: deltablue -Compiled OK: earley-boyer -Compiled OK: gbemu -Compiled OK: mandreel -Compiled OK: navier-stokes -Compiled OK: pdfjs -Compiled OK: raytrace -Compiled OK: regexp -Compiled OK: richards -Compiled OK: splay +[box2d] Compiled OK +[code-load] Compiled OK +[crypto] Compiled OK +[deltablue] Compiled OK +[earley-boyer] Compiled OK +[gbemu] Compiled OK +[mandreel] Compiled OK +[navier-stokes] Compiled OK +[pdfjs] Compiled OK +[raytrace] Compiled OK +[regexp] Compiled OK +[richards] Compiled OK +[splay] Compiled OK +[typescript] Compiled OK diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/basic/run-octane.js --- a/nashorn/test/script/basic/run-octane.js Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/test/script/basic/run-octane.js Tue Jan 28 11:21:26 2014 -0800 @@ -26,19 +26,22 @@ */ var tests = [ - {file:"box2d",suite:"Box2DBenchmark"}, - {file:"code-load",suite:"CodeLoad"}, - {file:"crypto",suite:"Crypto"}, - {file:"deltablue",suite:"DeltaBlue"}, - {file:"earley-boyer", suite:"EarleyBoyer"}, - {file:"gbemu", suite:"GameboyBenchmark"}, - {file:"mandreel", suite:"MandreelBenchmark"}, - {file:"navier-stokes", suite:"NavierStokes"}, - {file:"pdfjs", suite:"PdfJS"}, - {file:"raytrace", suite:"RayTrace"}, - {file:"regexp", suite:"RegExpSuite"}, - {file:"richards", suite:"Richards"}, - {file:"splay", suite:"Splay"} + {name:"box2d", files:["box2d.js"], suite:"Box2DBenchmark"}, + {name:"code-load", files:["code-load.js"], suite:"CodeLoad"}, + {name:"crypto", files:["crypto.js"], suite:"Crypto"}, + {name:"deltablue", files:["deltablue.js"], suite:"DeltaBlue"}, + {name:"earley-boyer", files:["earley-boyer.js"], suite:"EarleyBoyer"}, + {name:"gbemu", files:["gbemu-part1.js", "gbemu-part2.js"], suite:"GameboyBenchmark"}, + {name:"mandreel", files:["mandreel.js"], suite:"MandreelBenchmark"}, + {name:"navier-stokes", files:["navier-stokes.js"], suite:"NavierStokes"}, + {name:"pdfjs", files:["pdfjs.js"], suite:"PdfJS"}, + {name:"raytrace", files:["raytrace.js"], suite:"RayTrace"}, + {name:"regexp", files:["regexp.js"], suite:"RegExpSuite"}, + {name:"richards", files:["richards.js"], suite:"Richards"}, + {name:"splay", files:["splay.js"], suite:"Splay"}, + {name:"typescript", files:["typescript.js", "typescript-input.js", "typescript-compiler.js"], suite:"typescript"} + //zlib currently disabled - requires read + // {name:"zlib", files:["zlib.js", "zlib-data.js"], suite:"zlib"}, ]; var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__; @@ -58,26 +61,36 @@ return (typeof compile_only !== 'undefined') } -function run_one_benchmark(arg, iters) { - var file_name; - var file = (arg.file + ".js").split('/'); +function load_bench(arg) { + + for (var idx = 0; idx < arg.files.length; idx++) { + var f = arg.files[idx]; + var file = f.split('/'); + var file_name = path + file[file.length - 1]; - file_name = path + file[file.length - 1]; - - var compile_and_return = should_compile_only(file_name); + var compile_and_return = should_compile_only(file_name); + if (compile_and_return) { + if (typeof compile_only === 'undefined') { //for a run, skip compile onlies, don't even compile them + return true; + } + } + + print_verbose(arg, "loading '" + arg.name + "' [" + f + "]..."); + load(file_name); + } + if (compile_and_return) { - if (typeof compile_only === 'undefined') { //for a run, skip compile onlies, don't even compile them - return; - } + print_always(arg, "Compiled OK"); } - - print_verbose("Loading... " + file_name); - load(file_name); - - if (compile_and_return) { - print_always("Compiled OK: " + arg.file); + return !compile_and_return; + +} + +function run_one_benchmark(arg, iters) { + + if (!load_bench(arg)) { return; - } + } var success = true; var current_name; @@ -95,9 +108,13 @@ try { for (var x = 0; x < benchmarks.length ; x++) { + //do warmup run + //reset random number generator needed as of octane 9 before each run + BenchmarkSuite.ResetRNG(); benchmarks[x].Setup(); } - print_verbose("Running '" + arg.file + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")"); + BenchmarkSuite.ResetRNG(); + print_verbose(arg, "running '" + arg.name + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")"); var scores = []; @@ -112,6 +129,9 @@ do { for (var i = 0; i < len; i++) { benchmarks[i].run(); + //important - no timing here like elapsed = new Date() - start, as in the + //original harness. This will make timing very non-deterministic. + //NOTHING else must live in this loop } ops += len; elapsed = new Date - start; @@ -120,7 +140,7 @@ var score = ops / elapsed * 1000 * 60; scores.push(score); var name = it == 0 ? "warmup" : "iteration " + it; - print_verbose("[" + arg.file + "] " + name + " finished " + score.toFixed(0) + " ops/minute"); + print_verbose(arg, name + " finished " + score.toFixed(0) + " ops/minute"); } for (var x = 0; x < benchmarks.length ; x++) { @@ -140,20 +160,20 @@ scores = [0]; } - var res = "[" + arg.file + "] " + mean_score.toFixed(0); + var res = mean_score.toFixed(0); if (verbose) { res += " ops/minute (" + min_score.toFixed(0) + "-" + max_score.toFixed(0) + "), warmup=" + scores[0].toFixed(0); } - print_always(res); + print_always(arg, res); } -function print_always(x) { - print(x); +function print_always(arg, x) { + print("[" + arg.name + "] " + x); } -function print_verbose(x) { +function print_verbose(arg, x) { if (verbose) { - print(x); + print_always(arg, x) } } @@ -209,7 +229,7 @@ } else { var found = false; for (j in tests) { - if (tests[j].file === arg) { + if (tests[j].name === arg) { tests_found.push(tests[j]); found = true; break; @@ -221,7 +241,7 @@ if (j != 0) { str += ", "; } - str += "'" + tests[j].file + "'"; + str += "'" + tests[j].name + "'"; } throw str; } diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Base library for Showdown markdown engine Nashorn testing. + * @subtest + * + * + */ + +load(__DIR__ + "external/showdown/showdown.js"); +var shdwn = Showdown; +var window = { + Showdown: shdwn +} +load(__DIR__ + "external/showdown/table.js"); +var converter = new Showdown.converter({extensions: ['table']}); + diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/anchors-by-reference.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/anchors-by-reference.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\nThis is [an example][id] reference-style link.\nThis is [another] [foo] reference-style link.\nThis is [a third][bar] reference-style link.\nThis is [a fourth][4] reference-style link.\n\n [id]: http://example.com/ \"Optional Title Here\"\n [foo]: http://example.com/ (Optional Title Here)\n [bar]: http://example.com/ (Optional Title Here)\n [4]: \n \"Optional Title Here\""; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/anchors-by-reference.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/anchors-by-reference.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,4 @@ +

This is an example reference-style link. +This is another reference-style link. +This is a third reference-style link. +This is a fourth reference-style link.

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/automatic-anchors.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/automatic-anchors.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/automatic-anchors.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/automatic-anchors.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

http://example.com/

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/blockquote-nested-markdown.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/blockquote-nested-markdown.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "> ## This is a header.\n>\n> 1. This is the first list item.\n> 2. This is the second list item.\n>\n> Here's some example code:\n>\n> return shell_exec(\"echo $input | $markdown_script\");"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/blockquote-nested-markdown.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/blockquote-nested-markdown.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,13 @@ +
+

This is a header.

+ +
    +
  1. This is the first list item.
  2. +
  3. This is the second list item.
  4. +
+ +

Here's some example code:

+ +
return shell_exec("echo $input | $markdown_script");
+
+
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/blockquote.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/blockquote.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = " \n > This is a multi line blockquote test\n >\n > With more than one line."; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/blockquote.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/blockquote.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,5 @@ +
+

This is a multi line blockquote test

+ +

With more than one line.

+
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/code-block-html-escape.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/code-block-html-escape.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\nThis is some HTML:\n\n

Heading

"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/code-block-html-escape.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/code-block-html-escape.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,4 @@ +

This is some HTML:

+ +
<h1>Heading</h1>
+
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/code-block.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/code-block.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\nThis is a normal paragraph:\n\n This is a code block."; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/code-block.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/code-block.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,4 @@ +

This is a normal paragraph:

+ +
This is a code block.
+
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/doubline-list.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/doubline-list.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n * Bird\n\n * Magic"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/doubline-list.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/doubline-list.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,4 @@ +
    +
  • Bird

  • +
  • Magic

  • +
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/emphasis.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/emphasis.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n*important*\n\n_important_\n\nthis mid*important*sentence"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/emphasis.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/emphasis.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,5 @@ +

important

+ +

important

+ +

this midimportantsentence

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/escaped-number-period.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/escaped-number-period.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "It happened in 1986\. What a great season."; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/escaped-number-period.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/escaped-number-period.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

It happened in 1986. What a great season.

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/escaping.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/escaping.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\nThese should all be escaped:\n\n\\\n\n\`\n\n\*\n\n\_\n\n\{\n\n\}\n\n\[\n\n\]\n\n\(\n\n\)\n\n\#\n\n\+\n\n\-\n\n\.\n\n\!"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/escaping.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/escaping.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,31 @@ +

These should all be escaped:

+ +

\

+ +

`

+ +

*

+ +

_

+ +

{

+ +

}

+ +

[

+ +

]

+ +

(

+ +

)

+ +

#

+ +

+

+ +

-

+ +

.

+ +

!

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/github-style-at-start.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/github-style-at-start.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "```\nfunction MyFunc(a) {\n // ...\n}\n```\n\nThat is some code!"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/github-style-at-start.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/github-style-at-start.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,6 @@ +
function MyFunc(a) {
+    // ...
+}
+
+ +

That is some code!

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/github-style-codeblock.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/github-style-codeblock.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\nDefine a function in javascript:\n\n```\nfunction MyFunc(a) {\n var s = '`';\n}\n```\n\nAnd some HTML\n\n```html\n
HTML!
\n```"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/github-style-codeblock.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/github-style-codeblock.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,11 @@ +

Define a function in javascript:

+ +
function MyFunc(a) {
+    var s = '`';
+}
+
+ +

And some HTML

+ +
<div>HTML!</div>
+
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/github-style-linebreaks.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/github-style-linebreaks.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "```\ncode can go here\nthis is rendered on a second line\n```"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/github-style-linebreaks.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/github-style-linebreaks.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,3 @@ +
code can go here
+this is rendered on a second line
+
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h1-with-double-hash.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h1-with-double-hash.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "# This is an H1 #"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h1-with-double-hash.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h1-with-double-hash.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

This is an H1

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h1-with-equals.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h1-with-equals.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "This is an H1\n============="; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h1-with-equals.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h1-with-equals.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

This is an H1

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h1-with-single-hash.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h1-with-single-hash.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "# This is an H1"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h1-with-single-hash.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h1-with-single-hash.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

This is an H1

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h2-with-dashes.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h2-with-dashes.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "This is an H2\n-------------"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h2-with-dashes.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h2-with-dashes.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

This is an H2

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h2-with-double-hash.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h2-with-double-hash.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "## This is an H2 ##"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h2-with-double-hash.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h2-with-double-hash.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

This is an H2

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h2-with-single-hash.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h2-with-single-hash.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "## This is an H2"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h2-with-single-hash.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h2-with-single-hash.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

This is an H2

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h3-with-double-hash.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h3-with-double-hash.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "### This is an H3 ###"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h3-with-double-hash.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h3-with-double-hash.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

This is an H3

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h3-with-single-hash.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h3-with-single-hash.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "### This is an H3"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h3-with-single-hash.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h3-with-single-hash.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

This is an H3

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h4-with-single-hash.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h4-with-single-hash.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "#### This is an H4"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h4-with-single-hash.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h4-with-single-hash.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

This is an H4

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h5-with-single-hash.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h5-with-single-hash.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "##### This is an H5"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h5-with-single-hash.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h5-with-single-hash.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +
This is an H5
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h6-with-single-hash.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h6-with-single-hash.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "###### This is an H6"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/h6-with-single-hash.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/h6-with-single-hash.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +
This is an H6
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/horizontal-rules.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/horizontal-rules.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n* * *\n\n***\n\n*****\n\n- - -\n\n---------------------------------------\n"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/horizontal-rules.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/horizontal-rules.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,9 @@ +
+ +
+ +
+ +
+ +
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/html5-strutural-tags.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/html5-strutural-tags.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\nThese HTML5 tags should pass through just fine.\n\n
hello
\n
head
\n
footsies
\n\n
read me
\n\n
read\nme
\n\n\nthe end"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/html5-strutural-tags.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/html5-strutural-tags.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,22 @@ +

These HTML5 tags should pass through just fine.

+ +
hello
+ +
head
+ +
footsies
+ + + +
read me
+ + + +
read +me
+ + + +

the end

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/images.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/images.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n![Alt text](/path/to/img.jpg)\n\n![Alt text](/path/to/img.jpg \"Optional title\")\n\n![Alt text][id]\n\n [id]: url/to/image \"Optional title attribute\""; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/images.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/images.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,5 @@ +

Alt text

+ +

Alt text

+ +

Alt text

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/implicit-anchors.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/implicit-anchors.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\nSearch the web at [Google][] or [Daring Fireball][].\n\n [Google]: http://google.com/\n [Daring Fireball]: http://daringfireball.net/"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/implicit-anchors.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/implicit-anchors.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

Search the web at Google or Daring Fireball.

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/inline-anchors.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/inline-anchors.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\nThis is [an example](http://example.com/ \"Title\") inline link.\n\n[This link](http://example.net/) has no title attribute."; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/inline-anchors.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/inline-anchors.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,3 @@ +

This is an example inline link.

+ +

This link has no title attribute.

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/inline-code.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/inline-code.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\nCreate a new `function`.\n\nUse the backtick in MySQL syntax ``SELECT `column` FROM whatever``.\n\nA single backtick in a code span: `` ` ``\n\nA backtick-delimited string in a code span: `` `foo` ``\n\nPlease don't use any `` tags.\n\n`—` is the decimal-encoded equivalent of `—`."; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/inline-code.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/inline-code.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,11 @@ +

Create a new function.

+ +

Use the backtick in MySQL syntax SELECT `column` FROM whatever.

+ +

A single backtick in a code span: `

+ +

A backtick-delimited string in a code span: `foo`

+ +

Please don't use any <blink> tags.

+ +

&#8212; is the decimal-encoded equivalent of &mdash;.

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/inline-style-tag.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/inline-style-tag.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n\n\nAn exciting sentence."; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/inline-style-tag.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/inline-style-tag.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,5 @@ + + +

An exciting sentence.

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/lazy-blockquote.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/lazy-blockquote.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n > This is a multi line blockquote test\n\n > With more than one line."; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/lazy-blockquote.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/lazy-blockquote.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,5 @@ +
+

This is a multi line blockquote test

+ +

With more than one line.

+
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/list-with-blockquote.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/list-with-blockquote.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "* A list item with a blockquote:\n\n > This is a blockquote\n > inside a list item."; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/list-with-blockquote.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/list-with-blockquote.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,8 @@ +
    +
  • A list item with a blockquote:

    + +
    +

    This is a blockquote + inside a list item.

    +
  • +
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/list-with-code.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/list-with-code.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "* A list item with code:\n\n alert('Hello world!');"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/list-with-code.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/list-with-code.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,6 @@ +
    +
  • A list item with code:

    + +
    alert('Hello world!');
    +
  • +
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/multi-paragraph-list.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/multi-paragraph-list.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n 1. This is a major bullet point.\n\n That contains multiple paragraphs.\n\n 2. And another line"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/multi-paragraph-list.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/multi-paragraph-list.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,6 @@ +
    +
  1. This is a major bullet point.

    + +

    That contains multiple paragraphs.

  2. +
  3. And another line

  4. +
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/multiline-unordered-list.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/multiline-unordered-list.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n - This line spans\n more than one line and is lazy\n - Similar to this line"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/multiline-unordered-list.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/multiline-unordered-list.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,5 @@ +
    +
  • This line spans +more than one line and is lazy
  • +
  • Similar to this line
  • +
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/nested-blockquote.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/nested-blockquote.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n > This is a multi line blockquote test\n >\n > > And nesting!\n >\n > With more than one line."; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/nested-blockquote.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/nested-blockquote.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,9 @@ +
+

This is a multi line blockquote test

+ +
+

And nesting!

+
+ +

With more than one line.

+
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/ordered-list-same-number.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/ordered-list-same-number.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n 1. Red\n 1. Green\n 1. Blue"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/ordered-list-same-number.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/ordered-list-same-number.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,5 @@ +
    +
  1. Red
  2. +
  3. Green
  4. +
  5. Blue
  6. +
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/ordered-list-wrong-numbers.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/ordered-list-wrong-numbers.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n 8. Red\n 1. Green\n 3. Blue"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/ordered-list-wrong-numbers.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/ordered-list-wrong-numbers.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,5 @@ +
    +
  1. Red
  2. +
  3. Green
  4. +
  5. Blue
  6. +
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/ordered-list.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/ordered-list.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n 1. Red\n 2. Green\n 3. Blue"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/ordered-list.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/ordered-list.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,5 @@ +
    +
  1. Red
  2. +
  3. Green
  4. +
  5. Blue
  6. +
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/relative-anchors.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/relative-anchors.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\nSee my [About](/about/) page for details."; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/relative-anchors.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/relative-anchors.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

See my About page for details.

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/simple-paragraph.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/simple-paragraph.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\nHello, world!"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/simple-paragraph.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/simple-paragraph.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

Hello, world!

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/strong.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/strong.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n**important**\n\n__important__\n\nreally **freaking**strong"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/strong.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/strong.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,5 @@ +

important

+ +

important

+ +

really freakingstrong

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/table-basic.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/table-basic.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "| First Header | Second Header |\n| ------------- | ------------- |\n| Row 1 Cell 1 | Row 1 Cell 2 |\n| Row 2 Cell 1 | Row 2 Cell 2 |\n"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/table-basic.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/table-basic.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + +
First Header Second Header

Row 1 Cell 1

Row 1 Cell 2

Row 2 Cell 1

Row 2 Cell 2

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/table-large.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/table-large.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "| First Header | Second Header | Third Header | Fourth Header |\n| ------------- | ------------- | ------------ | ------------- |\n| Row 1 Cell 1 | Row 1 Cell 2 | Row 1 Cell 3 | Row 1 Cell 4 |\n| Row 2 Cell 1 | Row 2 Cell 2 | Row 2 Cell 3 | Row 2 Cell 4 |\n| Row 3 Cell 1 | Row 3 Cell 2 | Row 3 Cell 3 | Row 3 Cell 4 |\n| Row 4 Cell 1 | Row 4 Cell 2 | Row 4 Cell 3 | Row 4 Cell 4 |\n| Row 5 Cell 1 | Row 5 Cell 2 | Row 5 Cell 3 | Row 5 Cell 4 |\n"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/table-large.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/table-large.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
First Header Second Header Third Header Fourth Header

Row 1 Cell 1

Row 1 Cell 2

Row 1 Cell 3

Row 1 Cell 4

Row 2 Cell 1

Row 2 Cell 2

Row 2 Cell 3

Row 2 Cell 4

Row 3 Cell 1

Row 3 Cell 2

Row 3 Cell 3

Row 3 Cell 4

Row 4 Cell 1

Row 4 Cell 2

Row 4 Cell 3

Row 4 Cell 4

Row 5 Cell 1

Row 5 Cell 2

Row 5 Cell 3

Row 5 Cell 4

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/table-with-equals.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/table-with-equals.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "| First Header | Second Header |\n| ============= | ============= |\n| Row 1 Cell 1 | Row 1 Cell 2 |\n| Row 2 Cell 1 | Row 2 Cell 2 |\n"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/table-with-equals.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/table-with-equals.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + +
First Header Second Header

Row 1 Cell 1

Row 1 Cell 2

Row 2 Cell 1

Row 2 Cell 2

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/unordered-list-asterisk.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/unordered-list-asterisk.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n * Red\n * Green\n * Blue"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/unordered-list-asterisk.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/unordered-list-asterisk.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,5 @@ +
    +
  • Red
  • +
  • Green
  • +
  • Blue
  • +
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/unordered-list-minus.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/unordered-list-minus.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n - Red\n - Green\n - Blue"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/unordered-list-minus.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/unordered-list-minus.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,5 @@ +
    +
  • Red
  • +
  • Green
  • +
  • Blue
  • +
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/unordered-list-plus.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/unordered-list-plus.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\n + Red\n + Green\n + Blue"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/unordered-list-plus.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/unordered-list-plus.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,5 @@ +
    +
  • Red
  • +
  • Green
  • +
  • Blue
  • +
diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/url-with-parenthesis.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/url-with-parenthesis.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Test for Showdown markdown parser work with Nashorn. + * + * @test + * @run + */ + +var input = "\nThere's an [episode](http://en.memory-alpha.org/wiki/Darmok_(episode)) of Star Trek: The Next Generation"; +var output = converter.makeHtml(input); +print(output); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/markdown/url-with-parenthesis.js.EXPECTED --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/markdown/url-with-parenthesis.js.EXPECTED Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,1 @@ +

There's an episode of Star Trek: The Next Generation

diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/sandbox/JDK-8031106.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/sandbox/JDK-8031106.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8031106: Nashorn: IndexOutOfBoundsException in NashornCallSiteDescriptor.getNameToken() + * + * @test + * @run + */ + +var cl = new java.lang.Object().getClass(); +try { + cl["forName"]; + fail("Should have thrown exception!"); +} catch (e) { + if (! (e instanceof java.lang.SecurityException)) { + fail("SecurityException expected, got " + e); + } +} diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/script/trusted/JDK-8032060.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/test/script/trusted/JDK-8032060.js Tue Jan 28 11:21:26 2014 -0800 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * JDK-8032060: PropertyMap of Error objects is not stable + * + * @test + * @option -Dnashorn.debug=true + * @fork + * @run + */ + +function checkMap(e1, e2) { + if (! Debug.identical(Debug.map(e1), Debug.map(e2))) { + fail("e1 and e2 have different maps"); + } + + var m1, m2; + + try { + throw e1 + } catch (e) { + m1 = Debug.map(e) + } + + try { + throw e2 + } catch (e) { + m2 = Debug.map(e) + } + + if (! Debug.identical(m1, m2)) { + fail("e1 and e2 have different maps after being thrown"); + } +} + +checkMap(new Error(), new Error()); +checkMap(new EvalError(), new EvalError()); +checkMap(new RangeError(), new RangeError()); +checkMap(new ReferenceError(), new ReferenceError()); +checkMap(new SyntaxError(), new SyntaxError()); +checkMap(new TypeError(), new TypeError()); +checkMap(new URIError(), new URIError()); + +// now try with message param +checkMap(new Error("x"), new Error("y")); +checkMap(new EvalError("x"), new EvalError("y")); +checkMap(new RangeError("x"), new RangeError("y")); +checkMap(new ReferenceError("x"), new ReferenceError("y")); +checkMap(new SyntaxError("x"), new SyntaxError("y")); +checkMap(new TypeError("x"), new TypeError("y")); +checkMap(new URIError("x"), new URIError("y")); diff -r 6a74da13c52f -r def24c6b5019 nashorn/test/src/jdk/nashorn/api/scripting/InvocableTest.java --- a/nashorn/test/src/jdk/nashorn/api/scripting/InvocableTest.java Tue Jan 28 14:47:22 2014 +0100 +++ b/nashorn/test/src/jdk/nashorn/api/scripting/InvocableTest.java Tue Jan 28 11:21:26 2014 -0800 @@ -26,6 +26,7 @@ package jdk.nashorn.api.scripting; import java.util.Objects; +import java.util.function.Function; import javax.script.Invocable; import javax.script.ScriptContext; import javax.script.ScriptEngine; @@ -522,4 +523,16 @@ Assert.assertEquals(itf.test1(42, "a", "b"), "i == 42, strings instanceof java.lang.String[] == true, strings == [a, b]"); Assert.assertEquals(itf.test2(44, "c", "d", "e"), "arguments[0] == 44, arguments[1] instanceof java.lang.String[] == true, arguments[1] == [c, d, e]"); } + + @Test + @SuppressWarnings("unchecked") + public void defaultMethodTest() throws ScriptException { + final ScriptEngineManager m = new ScriptEngineManager(); + final ScriptEngine e = m.getEngineByName("nashorn"); + final Invocable inv = (Invocable) e; + + Object obj = e.eval("({ apply: function(arg) { return arg.toUpperCase(); }})"); + Function func = inv.getInterface(obj, Function.class); + assertEquals(func.apply("hello"), "HELLO"); + } }