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.services;
24
25 /**
26 * An empty implementation for {@link EventProvider}. This implementation is used when no logging is
27 * requested.
28 */
29 final class EmptyEventProvider extends EventProvider {
30
31 EmptyEventProvider() {
32 super(null);
33 }
34
35 static InternalError shouldNotReachHere() {
36 throw new InternalError("should not reach here");
37 }
38
39 @Override
40 public CompilationEvent newCompilationEvent() {
41 return new EmptyCompilationEvent();
42 }
43
44 static class EmptyCompilationEvent implements CompilationEvent {
45 public void commit() {
46 throw shouldNotReachHere();
47 }
48
49 public boolean shouldWrite() {
50 // Events of this class should never been written.
51 return false;
52 }
53
|
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 {
41 public void commit() {
42 throw shouldNotReachHere();
43 }
44
45 public boolean shouldWrite() {
46 // Events of this class should never been written.
47 return false;
48 }
49
|