< prev index next >

test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java

Print this page




  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.io.File;
  25 import java.util.ArrayList;
  26 import java.util.Collections;
  27 
  28 import com.oracle.java.testlibrary.*;
  29 
  30 /*
  31  * @test
  32  * @bug 8050079
  33  * @summary Compiles a monomorphic call to finalizeObject() on a modified java.lang.Object to test C1 CHA.
  34  * @library /testlibrary

  35  * @compile -XDignore.symbol.file java/lang/Object.java TestMonomorphicObjectCall.java
  36  * @run main TestMonomorphicObjectCall
  37  */
  38 public class TestMonomorphicObjectCall {
  39     final static String testClasses = System.getProperty("test.classes") + File.separator;
  40 
  41     private static void callFinalize(Object object) throws Throwable {
  42         // Call modified version of java.lang.Object::finalize() that is
  43         // not overridden by any subclass. C1 CHA should mark the call site
  44         // as monomorphic and inline the method.
  45         object.finalizeObject();
  46     }
  47 
  48     public static void main(String[] args) throws Throwable {
  49         if (args.length == 0) {
  50             // Execute new instance with modified java.lang.Object
  51             executeTestJvm();
  52         } else {
  53             // Trigger compilation of 'callFinalize'
  54             callFinalize(new Object());


  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.io.File;
  25 import java.util.ArrayList;
  26 import java.util.Collections;
  27 
  28 import com.oracle.java.testlibrary.*;
  29 
  30 /*
  31  * @test
  32  * @bug 8050079
  33  * @summary Compiles a monomorphic call to finalizeObject() on a modified java.lang.Object to test C1 CHA.
  34  * @library /testlibrary
  35  * @build com.oracle.java.testlibrary.*
  36  * @compile -XDignore.symbol.file java/lang/Object.java TestMonomorphicObjectCall.java
  37  * @run main TestMonomorphicObjectCall
  38  */
  39 public class TestMonomorphicObjectCall {
  40     final static String testClasses = System.getProperty("test.classes") + File.separator;
  41 
  42     private static void callFinalize(Object object) throws Throwable {
  43         // Call modified version of java.lang.Object::finalize() that is
  44         // not overridden by any subclass. C1 CHA should mark the call site
  45         // as monomorphic and inline the method.
  46         object.finalizeObject();
  47     }
  48 
  49     public static void main(String[] args) throws Throwable {
  50         if (args.length == 0) {
  51             // Execute new instance with modified java.lang.Object
  52             executeTestJvm();
  53         } else {
  54             // Trigger compilation of 'callFinalize'
  55             callFinalize(new Object());
< prev index next >