Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java @ 24225:a2dbb6fcc923
Added tag jvmci-0.33 for changeset 3aed4cb813f4
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 18 Aug 2017 22:47:33 +0200 |
parents | 5cf445d2acf6 |
children |
rev | line source |
---|---|
15663 | 1 /* |
2 * Copyright (c) 2014, 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 */ | |
23785
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23380
diff
changeset
|
23 package jdk.vm.ci.hotspot; |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
24 |
23785
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23380
diff
changeset
|
25 import jdk.vm.ci.hotspot.EmptyEventProvider.EmptyCompilationEvent; |
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23380
diff
changeset
|
26 import jdk.vm.ci.hotspot.EmptyEventProvider.EmptyCompilerFailureEvent; |
21631
77acf6ba2fc0
Move EventProvider to jvmci.hotspot, make it a JVMCI Service
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
15663
diff
changeset
|
27 |
15663 | 28 /** |
23785
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23380
diff
changeset
|
29 * Service for logging compiler related events. |
15663 | 30 */ |
23785
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23380
diff
changeset
|
31 public interface EventProvider { |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
32 |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
33 /** |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
34 * Creates and returns an empty implementation for {@link EventProvider}. This implementation |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
35 * can be used when no logging is requested. |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
36 */ |
23785
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23380
diff
changeset
|
37 static EventProvider createEmptyEventProvider() { |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
38 return new EmptyEventProvider(); |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
39 } |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
40 |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
41 /** |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
42 * Creates and returns an empty implementation for {@link CompilationEvent}. |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
43 */ |
23785
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23380
diff
changeset
|
44 static CompilationEvent createEmptyCompilationEvent() { |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
45 return new EmptyCompilationEvent(); |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
46 } |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
47 |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
48 /** |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
49 * Creates and returns an empty implementation for {@link CompilationEvent}. |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
50 */ |
23785
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23380
diff
changeset
|
51 static CompilerFailureEvent createEmptyCompilerFailureEvent() { |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
52 return new EmptyCompilerFailureEvent(); |
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
53 } |
15663 | 54 |
55 /** | |
56 * An instant event is an event that is not considered to have taken any time. | |
57 */ | |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
58 public interface InstantEvent { |
15663 | 59 /** |
60 * Commits the event. | |
61 */ | |
62 void commit(); | |
63 | |
64 /** | |
65 * Determines if this particular event instance would be committed to the data stream right | |
66 * now if application called {@link #commit()}. This in turn depends on whether the event is | |
67 * enabled and possible other factors. | |
68 * | |
69 * @return if this event would be committed on a call to {@link #commit()}. | |
70 */ | |
71 boolean shouldWrite(); | |
72 } | |
73 | |
74 /** | |
75 * Timed events describe an operation that somehow consumes time. | |
76 */ | |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
77 public interface TimedEvent extends InstantEvent { |
15663 | 78 /** |
79 * Starts the timing for this event. | |
80 */ | |
81 void begin(); | |
82 | |
83 /** | |
84 * Ends the timing period for this event. | |
85 */ | |
86 void end(); | |
87 } | |
88 | |
89 /** | |
90 * Creates a new {@link CompilationEvent}. | |
91 * | |
92 * @return a compilation event | |
93 */ | |
23785
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23380
diff
changeset
|
94 CompilationEvent newCompilationEvent(); |
15663 | 95 |
96 /** | |
97 * A compilation event. | |
98 */ | |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
99 public interface CompilationEvent extends TimedEvent { |
15663 | 100 void setMethod(String method); |
101 | |
102 void setCompileId(int compileId); | |
103 | |
104 void setCompileLevel(int compileLevel); | |
105 | |
106 void setSucceeded(boolean succeeded); | |
107 | |
108 void setIsOsr(boolean isOsr); | |
109 | |
110 void setCodeSize(int codeSize); | |
111 | |
112 void setInlinedBytes(int inlinedBytes); | |
113 } | |
114 | |
115 /** | |
116 * Creates a new {@link CompilerFailureEvent}. | |
117 * | |
118 * @return a compiler failure event | |
119 */ | |
23785
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23380
diff
changeset
|
120 CompilerFailureEvent newCompilerFailureEvent(); |
15663 | 121 |
122 /** | |
123 * A compiler failure event. | |
124 */ | |
23363
56479400913e
jdk.vm.ci needs to securely export services (JDK-8155023)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
125 public interface CompilerFailureEvent extends InstantEvent { |
15663 | 126 void setCompileId(int compileId); |
127 | |
128 void setMessage(String message); | |
129 } | |
130 } |