< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorld.java

Print this page
rev 48551 : imported patch webrev.0
   1 /*
   2  * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  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  */


 536                     println("CompileTheWorld : Compiling all methods in " + entry + " matching one of the following filters: " + include);
 537                 }
 538                 if (excludeMethodFilters != null && excludeMethodFilters.length > 0) {
 539                     String exclude = Arrays.asList(excludeMethodFilters).stream().map(MethodFilter::toString).collect(Collectors.joining(", "));
 540                     println("CompileTheWorld : Excluding all methods matching one of the following filters: " + exclude);
 541                 }
 542                 println();
 543 
 544                 ClassLoader loader = cpe.createClassLoader();
 545 
 546                 for (String className : cpe.getClassNames()) {
 547 
 548                     // Are we done?
 549                     if (classFileCounter >= stopAt) {
 550                         break;
 551                     }
 552 
 553                     classFileCounter++;
 554 
 555                     if (className.startsWith("jdk.management.") ||
 556                                     className.startsWith("jdk.internal.cmm.*") ||
 557                                     // GR-5881: The class initializer for
 558                                     // sun.tools.jconsole.OutputViewer
 559                                     // spawns non-daemon threads for redirecting sysout and syserr.
 560                                     // These threads tend to cause deadlock at VM exit
 561                                     className.startsWith("sun.tools.jconsole.")) {
 562                         continue;
 563                     }
 564 
 565                     try {
 566                         // Load and initialize class
 567                         Class<?> javaClass = Class.forName(className, true, loader);
 568 
 569                         // Pre-load all classes in the constant pool.
 570                         try {
 571                             HotSpotResolvedObjectType objectType = HotSpotResolvedObjectType.fromObjectClass(javaClass);
 572                             ConstantPool constantPool = objectType.getConstantPool();
 573                             for (int cpi = 1; cpi < constantPool.length(); cpi++) {
 574                                 constantPool.loadReferencedType(cpi, Bytecodes.LDC);
 575                             }
 576                         } catch (Throwable t) {


   1 /*
   2  * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  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  */


 536                     println("CompileTheWorld : Compiling all methods in " + entry + " matching one of the following filters: " + include);
 537                 }
 538                 if (excludeMethodFilters != null && excludeMethodFilters.length > 0) {
 539                     String exclude = Arrays.asList(excludeMethodFilters).stream().map(MethodFilter::toString).collect(Collectors.joining(", "));
 540                     println("CompileTheWorld : Excluding all methods matching one of the following filters: " + exclude);
 541                 }
 542                 println();
 543 
 544                 ClassLoader loader = cpe.createClassLoader();
 545 
 546                 for (String className : cpe.getClassNames()) {
 547 
 548                     // Are we done?
 549                     if (classFileCounter >= stopAt) {
 550                         break;
 551                     }
 552 
 553                     classFileCounter++;
 554 
 555                     if (className.startsWith("jdk.management.") ||

 556                                     // GR-5881: The class initializer for
 557                                     // sun.tools.jconsole.OutputViewer
 558                                     // spawns non-daemon threads for redirecting sysout and syserr.
 559                                     // These threads tend to cause deadlock at VM exit
 560                                     className.startsWith("sun.tools.jconsole.")) {
 561                         continue;
 562                     }
 563 
 564                     try {
 565                         // Load and initialize class
 566                         Class<?> javaClass = Class.forName(className, true, loader);
 567 
 568                         // Pre-load all classes in the constant pool.
 569                         try {
 570                             HotSpotResolvedObjectType objectType = HotSpotResolvedObjectType.fromObjectClass(javaClass);
 571                             ConstantPool constantPool = objectType.getConstantPool();
 572                             for (int cpi = 1; cpi < constantPool.length(); cpi++) {
 573                                 constantPool.loadReferencedType(cpi, Bytecodes.LDC);
 574                             }
 575                         } catch (Throwable t) {


< prev index next >