benchmark/src/main/java/com/alibaba/fastjson2/benchmark/fastcode/DecimalHugToString.java [23:46]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static {
        decimal = new BigDecimal("37335022433733502243.55");
        unscaledVal = decimal.unscaledValue();

        try {
            MethodHandles.Lookup lookup = JDKUtils.trustedLookup(BigDecimal.class);

            MethodHandle handle = lookup.findVirtual(
                    BigDecimal.class, "layoutChars", methodType(String.class, boolean.class)
            );

            CallSite callSite = LambdaMetafactory.metafactory(
                    lookup,
                    "apply",
                    methodType(BiFunction.class),
                    methodType(Object.class, Object.class, Object.class),
                    handle,
                    methodType(String.class, BigDecimal.class, Boolean.class)
            );
            LAYOUT_CHARS = (BiFunction<BigDecimal, Boolean, String>) callSite.getTarget().invokeExact();
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



benchmark/src/main/java/com/alibaba/fastjson2/benchmark/fastcode/DecimalDToString.java [23:46]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static {
        decimal = new BigDecimal("0.09313609545535894707057877894840203225612640380859375");
        unscaledVal = decimal.unscaledValue();

        try {
            MethodHandles.Lookup lookup = JDKUtils.trustedLookup(BigDecimal.class);

            MethodHandle handle = lookup.findVirtual(
                    BigDecimal.class, "layoutChars", methodType(String.class, boolean.class)
            );

            CallSite callSite = LambdaMetafactory.metafactory(
                    lookup,
                    "apply",
                    methodType(BiFunction.class),
                    methodType(Object.class, Object.class, Object.class),
                    handle,
                    methodType(String.class, BigDecimal.class, Boolean.class)
            );
            LAYOUT_CHARS = (BiFunction<BigDecimal, Boolean, String>) callSite.getTarget().invokeExact();
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



benchmark/src/main/java/com/alibaba/fastjson2/benchmark/fastcode/DecimalLargeToString.java [23:46]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static {
        decimal = new BigDecimal("2715737727.55");
        unscaledVal = decimal.unscaledValue();

        try {
            MethodHandles.Lookup lookup = JDKUtils.trustedLookup(BigDecimal.class);

            MethodHandle handle = lookup.findVirtual(
                    BigDecimal.class, "layoutChars", methodType(String.class, boolean.class)
            );

            CallSite callSite = LambdaMetafactory.metafactory(
                    lookup,
                    "apply",
                    methodType(BiFunction.class),
                    methodType(Object.class, Object.class, Object.class),
                    handle,
                    methodType(String.class, BigDecimal.class, Boolean.class)
            );
            LAYOUT_CHARS = (BiFunction<BigDecimal, Boolean, String>) callSite.getTarget().invokeExact();
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



benchmark/src/main/java/com/alibaba/fastjson2/benchmark/fastcode/DecimalSmallToString.java [23:46]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static {
        decimal = new BigDecimal("415246.55");
        unscaledVal = decimal.unscaledValue();

        try {
            MethodHandles.Lookup lookup = JDKUtils.trustedLookup(BigDecimal.class);

            MethodHandle handle = lookup.findVirtual(
                    BigDecimal.class, "layoutChars", methodType(String.class, boolean.class)
            );

            CallSite callSite = LambdaMetafactory.metafactory(
                    lookup,
                    "apply",
                    methodType(BiFunction.class),
                    methodType(Object.class, Object.class, Object.class),
                    handle,
                    methodType(String.class, BigDecimal.class, Boolean.class)
            );
            LAYOUT_CHARS = (BiFunction<BigDecimal, Boolean, String>) callSite.getTarget().invokeExact();
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



