43972
|
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 |
*/
|
|
23 |
package jdk.vm.ci.hotspot;
|
|
24 |
|
|
25 |
/**
|
|
26 |
* An empty implementation for {@link EventProvider}. This implementation is used when no logging is
|
|
27 |
* requested.
|
|
28 |
*/
|
|
29 |
final class EmptyEventProvider implements EventProvider {
|
|
30 |
|
|
31 |
static InternalError shouldNotReachHere() {
|
|
32 |
throw new InternalError("should not reach here");
|
|
33 |
}
|
|
34 |
|
|
35 |
@Override
|
|
36 |
public CompilationEvent newCompilationEvent() {
|
|
37 |
return new EmptyCompilationEvent();
|
|
38 |
}
|
|
39 |
|
|
40 |
static class EmptyCompilationEvent implements CompilationEvent {
|
50858
|
41 |
@Override
|
43972
|
42 |
public void commit() {
|
|
43 |
throw shouldNotReachHere();
|
|
44 |
}
|
|
45 |
|
50858
|
46 |
@Override
|
43972
|
47 |
public boolean shouldWrite() {
|
|
48 |
// Events of this class should never been written.
|
|
49 |
return false;
|
|
50 |
}
|
|
51 |
|
50858
|
52 |
@Override
|
43972
|
53 |
public void begin() {
|
|
54 |
}
|
|
55 |
|
50858
|
56 |
@Override
|
43972
|
57 |
public void end() {
|
|
58 |
}
|
|
59 |
|
50858
|
60 |
@Override
|
43972
|
61 |
public void setMethod(String method) {
|
|
62 |
throw shouldNotReachHere();
|
|
63 |
}
|
|
64 |
|
50858
|
65 |
@Override
|
43972
|
66 |
public void setCompileId(int compileId) {
|
|
67 |
throw shouldNotReachHere();
|
|
68 |
}
|
|
69 |
|
50858
|
70 |
@Override
|
43972
|
71 |
public void setCompileLevel(int compileLevel) {
|
|
72 |
throw shouldNotReachHere();
|
|
73 |
}
|
|
74 |
|
50858
|
75 |
@Override
|
43972
|
76 |
public void setSucceeded(boolean succeeded) {
|
|
77 |
throw shouldNotReachHere();
|
|
78 |
}
|
|
79 |
|
50858
|
80 |
@Override
|
43972
|
81 |
public void setIsOsr(boolean isOsr) {
|
|
82 |
throw shouldNotReachHere();
|
|
83 |
}
|
|
84 |
|
50858
|
85 |
@Override
|
43972
|
86 |
public void setCodeSize(int codeSize) {
|
|
87 |
throw shouldNotReachHere();
|
|
88 |
}
|
|
89 |
|
50858
|
90 |
@Override
|
43972
|
91 |
public void setInlinedBytes(int inlinedBytes) {
|
|
92 |
throw shouldNotReachHere();
|
|
93 |
}
|
|
94 |
}
|
|
95 |
|
|
96 |
@Override
|
|
97 |
public CompilerFailureEvent newCompilerFailureEvent() {
|
|
98 |
return new EmptyCompilerFailureEvent();
|
|
99 |
}
|
|
100 |
|
|
101 |
static class EmptyCompilerFailureEvent implements CompilerFailureEvent {
|
50858
|
102 |
@Override
|
43972
|
103 |
public void commit() {
|
|
104 |
throw shouldNotReachHere();
|
|
105 |
}
|
|
106 |
|
50858
|
107 |
@Override
|
43972
|
108 |
public boolean shouldWrite() {
|
|
109 |
// Events of this class should never been written.
|
|
110 |
return false;
|
|
111 |
}
|
|
112 |
|
50858
|
113 |
@Override
|
43972
|
114 |
public void setCompileId(int compileId) {
|
|
115 |
throw shouldNotReachHere();
|
|
116 |
}
|
|
117 |
|
50858
|
118 |
@Override
|
43972
|
119 |
public void setMessage(String message) {
|
|
120 |
throw shouldNotReachHere();
|
|
121 |
}
|
|
122 |
}
|
|
123 |
|
|
124 |
}
|