Mercurial > hg > graal-jvmci-8
comparison jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/services/EventProvider.java @ 23380:cd8fd4cced6c
added JVMCIPermission (JDK-8155023)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 09 May 2016 16:34:20 +0200 |
parents | 8153a654bd10 |
children |
comparison
equal
deleted
inserted
replaced
23379:24505bf61633 | 23380:cd8fd4cced6c |
---|---|
22 */ | 22 */ |
23 package jdk.vm.ci.hotspot.services; | 23 package jdk.vm.ci.hotspot.services; |
24 | 24 |
25 import jdk.vm.ci.hotspot.services.EmptyEventProvider.EmptyCompilationEvent; | 25 import jdk.vm.ci.hotspot.services.EmptyEventProvider.EmptyCompilationEvent; |
26 import jdk.vm.ci.hotspot.services.EmptyEventProvider.EmptyCompilerFailureEvent; | 26 import jdk.vm.ci.hotspot.services.EmptyEventProvider.EmptyCompilerFailureEvent; |
27 import jdk.vm.ci.services.JVMCIPermission; | |
27 | 28 |
28 /** | 29 /** |
29 * Service-provider class for logging compiler related events. | 30 * Service-provider class for logging compiler related events. |
30 */ | 31 */ |
31 public abstract class EventProvider { | 32 public abstract class EventProvider { |
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 EventProvider() { | 52 protected EventProvider() { |
52 this(checkPermission()); | 53 this(checkPermission()); |
53 } | 54 } |
54 | 55 |