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

23 lines
723 B
Java
Raw Permalink Normal View History

2023-01-02 09:46:59 +00:00
package ex5;
2023-01-09 07:01:15 +00:00
import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.marker.BodyMarker;
import ch.usi.dag.disl.marker.BytecodeMarker;
2023-01-02 09:46:59 +00:00
public class Instrumentation {
@Before(marker = BytecodeMarker.class, args = "new,newarray,anewarray,multianewarray")
2023-01-09 07:01:15 +00:00
static void handleSafeAllocation() {
Profiler.addSafeAllocation();
}
@Before(marker = BodyMarker.class, scope = "jdk.internal.misc.Unsafe.allocateInstance")
2023-01-09 17:04:35 +00:00
static void handleUnsafeAllocations() {
Profiler.addUnsafeAllocation();
}
@Before(marker = BodyMarker.class, scope = "sun.misc.Unsafe.allocateInstance")
static void handleUnsafeAllocationsPraiseTheSun() {
2023-01-09 07:01:15 +00:00
Profiler.addUnsafeAllocation();
}
2023-01-02 09:46:59 +00:00
}