Skip to content

Instantly share code, notes, and snippets.

View Maccimo's full-sized avatar

Maxim Degtyarev Maccimo

View GitHub Profile
@Maccimo
Maccimo / TestLDC.class
Last active May 30, 2023 03:43
LDC with all 9 loadable constant pool types
javascript:(function() {const c=$("#xpanel .new");const n=$("#xpanel .next_new");const p=$("#xpanel .prev_new");$(".js-comment").addClass("js-comment_new").find(".comment__head").addClass("comment__head_new-comment");const x=$(".js-comment.js-comment_new").length;const h=(x > 0);if (h) c.text(x);c.toggle(h);p.toggle(h);n.toggle(h);})();
@Maccimo
Maccimo / Disturbed.java
Created October 7, 2021 03:16
JDK-8273914 bug demo.
/**
* Sample from https://habr.com/ru/post/581576/ article.
*/
import java.util.concurrent.atomic.AtomicInteger;
public class Disturbed {
public static void main(String... args) {
AtomicInteger counter = new AtomicInteger(1);
System.out.println(
@Maccimo
Maccimo / README.MD
Last active April 30, 2021 09:13
TestLdcMethodHandle.class

TestLdcMethodHandle

  • Successfully assembled with asmtools built from branch pull/15
  • Failed to be assembled with asmtools built from branch pull/17

The error message is:

TestLdcMethodHandle.jasm (17:42) Error: Wrong tag: Either Method or InterfaceMethod expected.
@Maccimo
Maccimo / LdcConDyTwice.class
Last active April 22, 2021 10:33
LdcConDyTwice.jasm
@Maccimo
Maccimo / 21524.MD
Last active May 20, 2020 00:50
A Java 1.5 enum class with 21_524 items

A Java 1.5 enum class with 21_524 items

@Maccimo
Maccimo / VarFail.java
Last active September 19, 2019 02:15
`var` is a fail!
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.io.PrintStream;
public class VarFail {
public static void main(String... args) throws Throwable {
@Maccimo
Maccimo / HelloJSR.class
Last active March 8, 2022 02:20
JSR/RET JVM instructions usage sample
! 26.07.2017, 11:15:41 https://habrahabr.ru/all/
habrahabr.ru##.promo-block_freelansim-tasks.promo-block
! 28.07.2017, 11:54:59 https://habrahabr.ru/all/
habrahabr.ru##.promo-block_vacancies.promo-block
! 15.08.2017, 15:42:50 https://geektimes.ru/post/292071/
geektimes.ru##.post-share
! 15.08.2017, 15:43:11 https://geektimes.ru/post/292071/