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 import static jdk.vm.ci.common.InitTimer.timer;
26
27 import java.io.IOException;
28 import java.io.OutputStream;
29 import java.io.PrintStream;
30 import java.util.Collections;
31 import java.util.HashMap;
32 import java.util.List;
33 import java.util.Map;
34 import java.util.Objects;
35 import java.util.ServiceLoader;
36 import java.util.TreeMap;
37
38 import jdk.internal.misc.VM;
39 import jdk.vm.ci.code.Architecture;
40 import jdk.vm.ci.code.CompilationRequestResult;
41 import jdk.vm.ci.code.CompiledCode;
42 import jdk.vm.ci.code.InstalledCode;
43 import jdk.vm.ci.common.InitTimer;
44 import jdk.vm.ci.common.JVMCIError;
45 import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory.CompilationLevel;
46 import jdk.vm.ci.meta.JavaKind;
47 import jdk.vm.ci.meta.JavaType;
48 import jdk.vm.ci.meta.ResolvedJavaType;
49 import jdk.vm.ci.runtime.JVMCI;
50 import jdk.vm.ci.runtime.JVMCIBackend;
51 import jdk.vm.ci.runtime.JVMCICompiler;
52 import jdk.vm.ci.runtime.JVMCICompilerFactory;
53 import jdk.vm.ci.services.JVMCIServiceLocator;
54
55 /**
56 * HotSpot implementation of a JVMCI runtime.
57 *
531 } else if (off < 0 || off > b.length || len < 0 || (off + len) > b.length || (off + len) < 0) {
532 throw new IndexOutOfBoundsException();
533 } else if (len == 0) {
534 return;
535 }
536 compilerToVm.writeDebugOutput(b, off, len);
537 }
538
539 @Override
540 public void write(int b) throws IOException {
541 write(new byte[]{(byte) b}, 0, 1);
542 }
543
544 @Override
545 public void flush() throws IOException {
546 compilerToVm.flushDebugOutput();
547 }
548 };
549 }
550
551 /**
552 * Collects the current values of all JVMCI benchmark counters, summed up over all threads.
553 */
554 public long[] collectCounters() {
555 return compilerToVm.collectCounters();
556 }
557 }
|
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 import static jdk.vm.ci.common.InitTimer.timer;
26
27 import java.io.IOException;
28 import java.io.OutputStream;
29 import java.io.PrintStream;
30 import java.util.Collections;
31 import java.util.HashMap;
32 import java.util.List;
33 import java.util.Map;
34 import java.util.Objects;
35 import java.util.ServiceLoader;
36 import java.util.TreeMap;
37
38 import javax.management.MBeanInfo;
39 import jdk.internal.misc.VM;
40 import jdk.vm.ci.code.Architecture;
41 import jdk.vm.ci.code.CompilationRequestResult;
42 import jdk.vm.ci.code.CompiledCode;
43 import jdk.vm.ci.code.InstalledCode;
44 import jdk.vm.ci.common.InitTimer;
45 import jdk.vm.ci.common.JVMCIError;
46 import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory.CompilationLevel;
47 import jdk.vm.ci.meta.JavaKind;
48 import jdk.vm.ci.meta.JavaType;
49 import jdk.vm.ci.meta.ResolvedJavaType;
50 import jdk.vm.ci.runtime.JVMCI;
51 import jdk.vm.ci.runtime.JVMCIBackend;
52 import jdk.vm.ci.runtime.JVMCICompiler;
53 import jdk.vm.ci.runtime.JVMCICompilerFactory;
54 import jdk.vm.ci.services.JVMCIServiceLocator;
55
56 /**
57 * HotSpot implementation of a JVMCI runtime.
58 *
532 } else if (off < 0 || off > b.length || len < 0 || (off + len) > b.length || (off + len) < 0) {
533 throw new IndexOutOfBoundsException();
534 } else if (len == 0) {
535 return;
536 }
537 compilerToVm.writeDebugOutput(b, off, len);
538 }
539
540 @Override
541 public void write(int b) throws IOException {
542 write(new byte[]{(byte) b}, 0, 1);
543 }
544
545 @Override
546 public void flush() throws IOException {
547 compilerToVm.flushDebugOutput();
548 }
549 };
550 }
551
552 /** Name of the {@link MBeanInfo MBean} representing the internals
553 * of the current JVMCI runtime.
554 *
555 * @return name of the bean or <code>null</code> if no such bean
556 * is provided by the runtime
557 */
558 public String mbeanName() {
559 return hsCompilerFactory == null ? null : hsCompilerFactory.mbeanName();
560 }
561
562 /** Instance of the {@link MBeanInfo MBean} representing the internals
563 * of the current JVMCI runtime.
564 *
565 * @return instance of the bean or <code>null</code> if no such bean
566 * is provided by the runtime
567 */
568 public Object mbean() {
569 return hsCompilerFactory == null ? null : hsCompilerFactory.mbean();
570 }
571
572 /**
573 * Collects the current values of all JVMCI benchmark counters, summed up over all threads.
574 */
575 public long[] collectCounters() {
576 return compilerToVm.collectCounters();
577 }
578 }
|