Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 11 jdk.jfr.jmod - JFR Module
JDK 11 jdk.jfr.jmod is the JMOD file for JDK 11 JFR module.
JDK 11 JFR module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.jfr.jmod.
JDK 11 JFR module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 JFR module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.jfr.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/jfr/internal/instrument/JIClassInstrumentation.java
/* * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.jfr.internal.instrument; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import jdk.internal.org.objectweb.asm.ClassReader; import jdk.internal.org.objectweb.asm.ClassVisitor; import jdk.internal.org.objectweb.asm.ClassWriter; import jdk.internal.org.objectweb.asm.Opcodes; import jdk.internal.org.objectweb.asm.tree.ClassNode; import jdk.jfr.internal.SecuritySupport; import jdk.jfr.internal.Utils; /** * This class will perform byte code instrumentation given an "instrumentor" class. * * @see JITracer * * @author Staffan Larsen */ @Deprecated final class JIClassInstrumentation { private final Class<?> instrumentor; private final String targetName; private final String instrumentorName; private final byte[] newBytes; private final ClassReader targetClassReader; private final ClassReader instrClassReader; /** * Creates an instance and performs the instrumentation. * * @param instrumentor instrumentor class * @param target target class * @param old_target_bytes bytes in target * * @throws ClassNotFoundException * @throws IOException */ JIClassInstrumentation(Class<?> instrumentor, Class<?> target, byte[] old_target_bytes) throws ClassNotFoundException, IOException { instrumentorName = instrumentor.getName(); this.targetName = target.getName(); this.instrumentor = instrumentor; this.targetClassReader = new ClassReader(old_target_bytes); this.instrClassReader = new ClassReader(getOriginalClassBytes(instrumentor)); this.newBytes = makeBytecode(); Utils.writeGeneratedASM(target.getName(), newBytes); } private static byte[] getOriginalClassBytes(Class<?> clazz) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); String name = "/" + clazz.getName().replace(".", "/") + ".class"; InputStream is = SecuritySupport.getResourceAsStream(name); int bytesRead; byte[] buffer = new byte[16384]; while ((bytesRead = is.read(buffer, 0, buffer.length)) != -1) { baos.write(buffer, 0, bytesRead); } baos.flush(); is.close(); return baos.toByteArray(); } private byte[] makeBytecode() throws IOException, ClassNotFoundException { // Find the methods to instrument and inline final List<Method> instrumentationMethods = new ArrayList<>(); for (final Method m : instrumentor.getDeclaredMethods()) { JIInstrumentationMethod im = m.getAnnotation(JIInstrumentationMethod.class); if (im != null) { instrumentationMethods.add(m); } } // We begin by inlining the target's methods into the instrumentor ClassNode temporary = new ClassNode(); ClassVisitor inliner = new JIInliner( Opcodes.ASM5, temporary, targetName, instrumentorName, targetClassReader, instrumentationMethods); instrClassReader.accept(inliner, ClassReader.EXPAND_FRAMES); // Now we have the target's methods inlined into the instrumentation code (in 'temporary'). // We now need to replace the target's method with the code in the // instrumentation method. ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES); JIMethodMergeAdapter ma = new JIMethodMergeAdapter( cw, temporary, instrumentationMethods, instrumentor.getAnnotationsByType(JITypeMapping.class)); targetClassReader.accept(ma, ClassReader.EXPAND_FRAMES); return cw.toByteArray(); } /** * Get the instrumented byte codes that can be used to retransform the class. * * @return bytes */ public byte[] getNewBytes() { return newBytes.clone(); } }
⏎ jdk/jfr/internal/instrument/JIClassInstrumentation.java
Or download all of them as a single archive file:
File name: jdk.jfr-11.0.1-src.zip File size: 237632 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.jlink.jmod - JLink Tool
2020-06-30, 37763👍, 0💬
Popular Posts:
JRE 8 rt.jar is the JAR file for JRE 8 RT (Runtime) libraries. JRE (Java Runtime) 8 is the runtime e...
How to download and install JDK (Java Development Kit) 6? If you want to write Java applications, yo...
What Is log4j-1.2.15.jar? I got the JAR file from apache-log4j-1.2.15.zip. log4j-1.2.15.jar is the v...
Saxon-HE (home edition) is an open source product available under the Mozilla Public License. It pro...
JDK 11 java.naming.jmod is the JMOD file for JDK 11 Naming module. JDK 11 Naming module compiled cla...