Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
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 (322)
Collections:
Other Resources:
JDK 17 jdk.jfr.jmod - JFR Module
JDK 17 jdk.jfr.jmod is the JMOD file for JDK 17 JFR module.
JDK 17 JFR module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.jfr.jmod.
JDK 17 JFR module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 JFR module source code files are stored in \fyicenter\jdk-17.0.5\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, 2021, 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.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 {
String name = "/" + clazz.getName().replace(".", "/") + ".class";
try (InputStream is = SecuritySupport.getResourceAsStream(name)) {
return is.readAllBytes();
}
}
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.ASM7,
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-17.0.5-src.zip File size: 363343 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.jlink.jmod - JLink Tool
2023-04-17, ≈50🔥, 0💬
Popular Posts:
What Is HttpComponents httpcore-4.4.6.jar? HttpComponents httpcore-4.4.6.jar is the JAR file for Apa...
What Is wstx-asl-3.2.8.jar? wstx-asl-3.2.8.jar is JAR file for the ASL component of Woodstox 3.2.8. ...
How to download and install ojdbc14.jar for Oracle 10g R2? ojdbc14.jar for Oracle 10g R2 is a Java 1...
Apache Log4j Core Implementation provides the functional components of the logging system. Users are...
How to download and install JDK (Java Development Kit) 7? If you want to write Java applications, yo...