Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/services/HotSpotVMEventListener.java @ 23364:8153a654bd10
checkstyle fixes
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 29 Apr 2016 00:36:35 +0200 |
parents | 56479400913e |
children | cd8fd4cced6c |
rev | line source |
---|---|
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
22773
9273bb6ba33e
Simplify code installation interface: Use CompiledCode class instead of CompilationResult and DataSection.
Roland Schatz <roland.schatz@oracle.com>
parents:
22672
diff
changeset
|
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
23 package jdk.vm.ci.hotspot.services; |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 |
22773
9273bb6ba33e
Simplify code installation interface: Use CompiledCode class instead of CompilationResult and DataSection.
Roland Schatz <roland.schatz@oracle.com>
parents:
22672
diff
changeset
|
25 import jdk.vm.ci.code.CompiledCode; |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22569
diff
changeset
|
26 import jdk.vm.ci.code.InstalledCode; |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
27 import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
28 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22569
diff
changeset
|
29 import jdk.vm.ci.meta.JVMCIMetaAccessContext; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22569
diff
changeset
|
30 import jdk.vm.ci.meta.ResolvedJavaType; |
22299
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
31 |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
32 /** |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
33 * Service-provider class for responding to VM events and for creating |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
34 * {@link JVMCIMetaAccessContext}s. |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
35 */ |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
36 public abstract class HotSpotVMEventListener { |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
37 |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
38 private static Void checkPermission() { |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
39 SecurityManager sm = System.getSecurityManager(); |
23364 | 40 if (sm != null) { |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
41 sm.checkPermission(new RuntimePermission("jvmci")); |
23364 | 42 } |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
43 return null; |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
44 } |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
45 |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
46 @SuppressWarnings("unused") |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
47 HotSpotVMEventListener(Void ignore) { |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
48 } |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
49 |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
50 /** |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
51 * Initializes a new instance of this class. |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
52 * |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
53 * @throws SecurityException if a security manager has been installed and it denies |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
54 * {@code RuntimePermission("jvmci")} |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
55 */ |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
56 protected HotSpotVMEventListener() { |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
57 this(checkPermission()); |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
58 } |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
59 |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
60 /** |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
61 * Notifies this client that the VM is shutting down. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
62 */ |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
63 public void notifyShutdown() { |
21675
2e8c01def9a5
moved [AMD64|SPARC]HotSpotJVMCIBackendFactory into JVMCI namespace (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21616
diff
changeset
|
64 } |
22299
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
65 |
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
66 /** |
22562
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22546
diff
changeset
|
67 * Notify on successful install into the code cache. |
22299
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
68 * |
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
69 * @param hotSpotCodeCacheProvider |
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
70 * @param installedCode |
22773
9273bb6ba33e
Simplify code installation interface: Use CompiledCode class instead of CompilationResult and DataSection.
Roland Schatz <roland.schatz@oracle.com>
parents:
22672
diff
changeset
|
71 * @param compiledCode |
22299
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
72 */ |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
73 public void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompiledCode compiledCode) { |
22299
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
74 } |
22371
7d48038267b4
Eliminate jdk.internal.jvmci.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22299
diff
changeset
|
75 |
7d48038267b4
Eliminate jdk.internal.jvmci.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22299
diff
changeset
|
76 /** |
22422
a98a02bad801
Add simple interface to control caching policy for ResolvedJavaTypes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22417
diff
changeset
|
77 * Create a custom {@link JVMCIMetaAccessContext} to be used for managing the lifetime of loaded |
a98a02bad801
Add simple interface to control caching policy for ResolvedJavaTypes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22417
diff
changeset
|
78 * metadata. It a custom one isn't created then the default implementation will be a single |
a98a02bad801
Add simple interface to control caching policy for ResolvedJavaTypes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22417
diff
changeset
|
79 * context with globally shared instances of {@link ResolvedJavaType} that are never released. |
a98a02bad801
Add simple interface to control caching policy for ResolvedJavaTypes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22417
diff
changeset
|
80 * |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
81 * @param runtime the runtime instance that will use the returned context |
22422
a98a02bad801
Add simple interface to control caching policy for ResolvedJavaTypes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22417
diff
changeset
|
82 * @return a custom context or null |
a98a02bad801
Add simple interface to control caching policy for ResolvedJavaTypes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22417
diff
changeset
|
83 */ |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22773
diff
changeset
|
84 public JVMCIMetaAccessContext createMetaAccessContext(HotSpotJVMCIRuntime runtime) { |
22422
a98a02bad801
Add simple interface to control caching policy for ResolvedJavaTypes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22417
diff
changeset
|
85 return null; |
a98a02bad801
Add simple interface to control caching policy for ResolvedJavaTypes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22417
diff
changeset
|
86 } |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
87 } |