< prev index next >

jdk/src/java.base/share/classes/jdk/experimental/value/MethodHandleBuilder.java

Print this page

        

*** 37,46 **** --- 37,47 ---- import jdk.experimental.bytecode.TypedCodeBuilder; import jdk.experimental.value.MethodHandleBuilder.IsolatedMethodBuilder.IsolatedMethodPoolHelper; import jdk.internal.misc.Unsafe; import sun.security.action.GetPropertyAction; import valhalla.shady.MinimalValueTypes_1_0; + import valhalla.shady.ValueTypeHolder; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles.Lookup; import java.lang.invoke.MethodType; import java.util.*;
*** 102,124 **** } catch (Throwable e) { throw new IllegalStateException(e); } } ! static class IsolatedMethodBuilder extends ClassBuilder<Class<?>, String, IsolatedMethodBuilder> { private static final Class<?> THIS_CLASS = new Object() { }.getClass(); ! IsolatedMethodBuilder(String clazz, Lookup lookup) { super(ENABLE_POOL_PATCHES ? new IsolatedMethodPatchingPoolHelper(clazz) : new IsolatedMethodPoolHelper(clazz), new IsolatedMethodTypeHelper(lookup)); withThisClass(THIS_CLASS); } ! Class<?> thisClass() { return THIS_CLASS; } Object[] patches() { return ((IsolatedMethodPoolHelper)poolHelper).patches(); --- 103,125 ---- } catch (Throwable e) { throw new IllegalStateException(e); } } ! public static class IsolatedMethodBuilder extends ClassBuilder<Class<?>, String, IsolatedMethodBuilder> { private static final Class<?> THIS_CLASS = new Object() { }.getClass(); ! public IsolatedMethodBuilder(String clazz, Lookup lookup) { super(ENABLE_POOL_PATCHES ? new IsolatedMethodPatchingPoolHelper(clazz) : new IsolatedMethodPoolHelper(clazz), new IsolatedMethodTypeHelper(lookup)); withThisClass(THIS_CLASS); } ! public Class<?> thisClass() { return THIS_CLASS; } Object[] patches() { return ((IsolatedMethodPoolHelper)poolHelper).patches();
*** 180,190 **** numDims++; } Class<?> box = Class.forName(basicTypeHelper.symbol(desc) .replaceAll("/", ".") .replaceAll("\\$Value", ""), true, lookup.lookupClass().getClassLoader()); ! ValueType<?> vt = ValueType.forClass(box); return numDims == 0 ? vt.valueClass() : vt.arrayValueClass(numDims); } catch (ReflectiveOperationException ex) { throw new AssertionError(ex); } --- 181,191 ---- numDims++; } Class<?> box = Class.forName(basicTypeHelper.symbol(desc) .replaceAll("/", ".") .replaceAll("\\$Value", ""), true, lookup.lookupClass().getClassLoader()); ! ValueTypeHolder<?> vt = MinimalValueTypes_1_0.getValueFor(box); return numDims == 0 ? vt.valueClass() : vt.arrayValueClass(numDims); } catch (ReflectiveOperationException ex) { throw new AssertionError(ex); }
< prev index next >