< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java

Print this page




 155 
 156         protected void handleParsingException(Throwable t) {
 157             GraalError.shouldNotReachHere(t);
 158         }
 159     }
 160 
 161     @Test
 162     @SuppressWarnings("try")
 163     public void test() {
 164         runTest(new InvariantsTool());
 165     }
 166 
 167     @SuppressWarnings("try")
 168     public static void runTest(InvariantsTool tool) {
 169         RuntimeProvider rt = Graal.getRequiredCapability(RuntimeProvider.class);
 170         Providers providers = rt.getHostBackend().getProviders();
 171         MetaAccessProvider metaAccess = providers.getMetaAccess();
 172 
 173         PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
 174         Plugins plugins = new Plugins(new InvocationPlugins());
 175         GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
 176         graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
 177         HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
 178 
 179         Assume.assumeTrue(VerifyPhase.class.desiredAssertionStatus());
 180 
 181         String bootclasspath = tool.getClassPath();
 182         Assert.assertNotNull("Cannot find boot class path", bootclasspath);
 183 
 184         final List<String> classNames = new ArrayList<>();
 185         for (String path : bootclasspath.split(File.pathSeparator)) {
 186             if (tool.shouldProcess(path)) {
 187                 try {
 188                     final ZipFile zipFile = new ZipFile(new File(path));
 189                     for (final Enumeration<? extends ZipEntry> entry = zipFile.entries(); entry.hasMoreElements();) {
 190                         final ZipEntry zipEntry = entry.nextElement();
 191                         String name = zipEntry.getName();
 192                         if (name.endsWith(".class")) {
 193                             String className = name.substring(0, name.length() - ".class".length()).replace('/', '.');
 194                             if (isInNativeImage(className)) {
 195                                 /*




 155 
 156         protected void handleParsingException(Throwable t) {
 157             GraalError.shouldNotReachHere(t);
 158         }
 159     }
 160 
 161     @Test
 162     @SuppressWarnings("try")
 163     public void test() {
 164         runTest(new InvariantsTool());
 165     }
 166 
 167     @SuppressWarnings("try")
 168     public static void runTest(InvariantsTool tool) {
 169         RuntimeProvider rt = Graal.getRequiredCapability(RuntimeProvider.class);
 170         Providers providers = rt.getHostBackend().getProviders();
 171         MetaAccessProvider metaAccess = providers.getMetaAccess();
 172 
 173         PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
 174         Plugins plugins = new Plugins(new InvocationPlugins());
 175         GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true).withUnresolvedIsError(true);
 176         graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
 177         HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
 178 
 179         Assume.assumeTrue(VerifyPhase.class.desiredAssertionStatus());
 180 
 181         String bootclasspath = tool.getClassPath();
 182         Assert.assertNotNull("Cannot find boot class path", bootclasspath);
 183 
 184         final List<String> classNames = new ArrayList<>();
 185         for (String path : bootclasspath.split(File.pathSeparator)) {
 186             if (tool.shouldProcess(path)) {
 187                 try {
 188                     final ZipFile zipFile = new ZipFile(new File(path));
 189                     for (final Enumeration<? extends ZipEntry> entry = zipFile.entries(); entry.hasMoreElements();) {
 190                         final ZipEntry zipEntry = entry.nextElement();
 191                         String name = zipEntry.getName();
 192                         if (name.endsWith(".class")) {
 193                             String className = name.substring(0, name.length() - ".class".length()).replace('/', '.');
 194                             if (isInNativeImage(className)) {
 195                                 /*


< prev index next >