This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
AJP/DiSLProject2022/src-profiler/ex5/Instrumentation.java
2023-01-09 08:01:15 +01:00

21 lines
726 B
Java

package ex5;
import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.marker.BodyMarker;
import ch.usi.dag.disl.marker.BytecodeMarker;
import ch.usi.dag.disl.staticcontext.MethodStaticContext;
//import jdk.internal.misc.Unsafe;
public class Instrumentation {
@Before(marker = BytecodeMarker.class, args = "new,newarray,anewarray,multianewarray", scope = "*")
static void handleSafeAllocation() {
Profiler.addSafeAllocation();
}
// TODO why is it always 0
@Before(marker = BodyMarker.class, scope = "jdk.internal.misc.Unsafe.allocateInstance")
static void handleUnsafeAllocation() {
Profiler.addUnsafeAllocation();
}
}