Mercurial > hg > graal-compiler
annotate graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/events/EventProvider.java @ 21673:5024c80224c7
moved com.oracle.graal.[amd64|sparc] to com.oracle.jvmci.[amd64|sparc] (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 02 Jun 2015 22:11:52 +0200 |
parents | 77acf6ba2fc0 |
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 */ | |
21631
77acf6ba2fc0
Move EventProvider to jvmci.hotspot, make it a JVMCI Service
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
15663
diff
changeset
|
23 package com.oracle.jvmci.hotspot.events; |
77acf6ba2fc0
Move EventProvider to jvmci.hotspot, make it a JVMCI Service
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
15663
diff
changeset
|
24 |
77acf6ba2fc0
Move EventProvider to jvmci.hotspot, make it a JVMCI Service
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
15663
diff
changeset
|
25 import com.oracle.jvmci.service.*; |
15663 | 26 |
27 /** | |
28 * A provider that provides a specific implementation for events that can be logged in the compiler. | |
29 */ | |
21631
77acf6ba2fc0
Move EventProvider to jvmci.hotspot, make it a JVMCI Service
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
15663
diff
changeset
|
30 public interface EventProvider extends Service { |
15663 | 31 |
32 /** | |
33 * An instant event is an event that is not considered to have taken any time. | |
34 */ | |
35 interface InstantEvent { | |
36 /** | |
37 * Commits the event. | |
38 */ | |
39 void commit(); | |
40 | |
41 /** | |
42 * Determines if this particular event instance would be committed to the data stream right | |
43 * now if application called {@link #commit()}. This in turn depends on whether the event is | |
44 * enabled and possible other factors. | |
45 * | |
46 * @return if this event would be committed on a call to {@link #commit()}. | |
47 */ | |
48 boolean shouldWrite(); | |
49 } | |
50 | |
51 /** | |
52 * Timed events describe an operation that somehow consumes time. | |
53 */ | |
54 interface TimedEvent extends InstantEvent { | |
55 /** | |
56 * Starts the timing for this event. | |
57 */ | |
58 void begin(); | |
59 | |
60 /** | |
61 * Ends the timing period for this event. | |
62 */ | |
63 void end(); | |
64 } | |
65 | |
66 /** | |
67 * Creates a new {@link CompilationEvent}. | |
68 * | |
69 * @return a compilation event | |
70 */ | |
71 CompilationEvent newCompilationEvent(); | |
72 | |
73 /** | |
74 * A compilation event. | |
75 */ | |
76 interface CompilationEvent extends TimedEvent { | |
77 void setMethod(String method); | |
78 | |
79 void setCompileId(int compileId); | |
80 | |
81 void setCompileLevel(int compileLevel); | |
82 | |
83 void setSucceeded(boolean succeeded); | |
84 | |
85 void setIsOsr(boolean isOsr); | |
86 | |
87 void setCodeSize(int codeSize); | |
88 | |
89 void setInlinedBytes(int inlinedBytes); | |
90 } | |
91 | |
92 /** | |
93 * Creates a new {@link CompilerFailureEvent}. | |
94 * | |
95 * @return a compiler failure event | |
96 */ | |
97 CompilerFailureEvent newCompilerFailureEvent(); | |
98 | |
99 /** | |
100 * A compiler failure event. | |
101 */ | |
102 interface CompilerFailureEvent extends InstantEvent { | |
103 void setCompileId(int compileId); | |
104 | |
105 void setMessage(String message); | |
106 } | |
107 } |