Mercurial > hg > graal-jvmci-8
comparison jvmci/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/services/JVMCICompilerFactory.java @ 23380:cd8fd4cced6c
added JVMCIPermission (JDK-8155023)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 09 May 2016 16:34:20 +0200 |
parents | 24505bf61633 |
children | c61554b3f6df |
comparison
equal
deleted
inserted
replaced
23379:24505bf61633 | 23380:cd8fd4cced6c |
---|---|
22 */ | 22 */ |
23 package jdk.vm.ci.runtime.services; | 23 package jdk.vm.ci.runtime.services; |
24 | 24 |
25 import jdk.vm.ci.runtime.JVMCICompiler; | 25 import jdk.vm.ci.runtime.JVMCICompiler; |
26 import jdk.vm.ci.runtime.JVMCIRuntime; | 26 import jdk.vm.ci.runtime.JVMCIRuntime; |
27 import jdk.vm.ci.services.JVMCIPermission; | |
27 | 28 |
28 /** | 29 /** |
29 * Service-provider class for creating JVMCI compilers. | 30 * Service-provider class for creating JVMCI compilers. |
30 */ | 31 */ |
31 public abstract class JVMCICompilerFactory { | 32 public abstract class JVMCICompilerFactory { |
32 | 33 |
33 private static Void checkPermission() { | 34 private static Void checkPermission() { |
34 SecurityManager sm = System.getSecurityManager(); | 35 SecurityManager sm = System.getSecurityManager(); |
35 if (sm != null) { | 36 if (sm != null) { |
36 sm.checkPermission(new RuntimePermission("jvmci")); | 37 sm.checkPermission(new JVMCIPermission()); |
37 } | 38 } |
38 return null; | 39 return null; |
39 } | 40 } |
40 | 41 |
41 @SuppressWarnings("unused") | 42 @SuppressWarnings("unused") |
44 | 45 |
45 /** | 46 /** |
46 * Initializes a new instance of this class. | 47 * Initializes a new instance of this class. |
47 * | 48 * |
48 * @throws SecurityException if a security manager has been installed and it denies | 49 * @throws SecurityException if a security manager has been installed and it denies |
49 * {@code RuntimePermission("jvmci")} | 50 * {@link JVMCIPermission} |
50 */ | 51 */ |
51 protected JVMCICompilerFactory() { | 52 protected JVMCICompilerFactory() { |
52 this(checkPermission()); | 53 this(checkPermission()); |
53 } | 54 } |
54 | 55 |