This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import static java.lang.invoke.MethodHandles.constant; | |
| import static java.lang.invoke.MethodHandles.dropArguments; | |
| import static java.lang.invoke.MethodHandles.empty; | |
| import static java.lang.invoke.MethodHandles.identity; | |
| import static java.lang.invoke.MethodHandles.loop; | |
| import static java.lang.invoke.MethodHandles.publicLookup; | |
| import static java.lang.invoke.MethodType.methodType; | |
| import static java.util.stream.IntStream.range; | |
| import java.lang.invoke.MethodHandle; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| |----------------------------------------------------------------------------------------|--------------------| | |
| | Object Header (64 bits) | State | | |
| |-------------------------------------------------------|--------------------------------|--------------------| | |
| | Mark Word (32 bits) | Klass Word (32 bits) | | | |
| |-------------------------------------------------------|--------------------------------|--------------------| | |
| | identity_hashcode:25 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Normal | | |
| |-------------------------------------------------------|--------------------------------|--------------------| | |
| | thread:23 | epoch:2 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Biased | | |
| |-------------------------------------------------------|--------------------------------|--------------------| | |
| | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Main() | |
| { | |
| var summary = BenchmarkRunner.Run<Bench>(new AllowNonOptimized()); | |
| } | |
| public class AllowNonOptimized : ManualConfig | |
| { | |
| public AllowNonOptimized() | |
| { | |
| Add(JitOptimizationsValidator.DontFailOnError); // ALLOW NON-OPTIMIZED DLLS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public final class RuntimeAnnotations { | |
| private static final Constructor<?> AnnotationInvocationHandler_constructor; | |
| private static final Constructor<?> AnnotationData_constructor; | |
| private static final Method Class_annotationData; | |
| private static final Field Class_classRedefinedCount; | |
| private static final Field AnnotationData_annotations; | |
| private static final Field AnnotationData_declaredAnotations; | |
| private static final Method Atomic_casAnnotationData; | |
| private static final Class<?> Atomic_class; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sun.reflect.ConstantPool; | |
| import java.lang.reflect.InvocationTargetException; | |
| import java.lang.reflect.Method; | |
| import java.lang.reflect.ParameterizedType; | |
| import java.lang.reflect.Type; | |
| import java.util.Objects; | |
| /** | |
| * This approach was inspired by code from @danielbodart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package de.tdlabs.training.hacks; | |
| import java.io.Serializable; | |
| import java.lang.invoke.SerializedLambda; | |
| import java.lang.reflect.Method; | |
| import java.util.Objects; | |
| import java.util.function.Consumer; | |
| import java.util.function.Supplier; | |
| import static java.util.Arrays.asList; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Test | |
| { | |
| public static void Main(String[] args) | |
| { | |
| } | |
| interface Type1<T> { } |