public void array(int length) { adapter.invokedynamic("array", sig(JVM.OBJECT, params(ThreadContext.class, JVM.OBJECT, length)), Bootstrap.array()); }
public void attrAssign(String name) { adapter.invokedynamic("attrAssign:" + JavaNameMangler.mangleMethodName(name), sig(JVM.OBJECT, ThreadContext.class, JVM.OBJECT, JVM.OBJECT), Bootstrap.attrAssign()); }
MethodHandle getHandle(IRubyObject self, RubyClass dispatchClass, DynamicMethod method) throws Throwable { boolean blockGiven = signature.lastArgType() == Block.class; MethodHandle mh = buildNewInstanceHandle(method, self); if (mh == null) mh = buildNotEqualHandle(method, self); if (mh == null) mh = Bootstrap.buildNativeHandle(this, method, blockGiven); if (mh == null) mh = buildJavaFieldHandle(this, method, self); if (mh == null) mh = Bootstrap.buildIndyHandle(this, method, method.getImplementationClass()); if (mh == null) mh = Bootstrap.buildJittedHandle(this, method, blockGiven); if (mh == null) mh = Bootstrap.buildAttrHandle(this, method, self, dispatchClass); if (mh == null) mh = buildAliasHandle(method, self, dispatchClass); if (mh == null) mh = buildStructHandle(method, self, dispatchClass); if (mh == null) mh = Bootstrap.buildGenericHandle(this, method, dispatchClass); assert mh != null : "we should have a method handle of some sort by now"; return mh; }
public void pushString(ByteList bl, int cr) { loadContext(); adapter.invokedynamic("string", sig(RubyString.class, ThreadContext.class), Bootstrap.string(), new String(bl.bytes(), RubyEncoding.ISO), bl.getEncoding().toString(), cr); }
public static CallSite bytelist(Lookup lookup, String name, MethodType type, String value, String encodingName) { return new ConstantCallSite(constant(ByteList.class, bytelist(value, encodingName))); }
public void checkpoint() { loadContext(); adapter.invokedynamic( "checkpoint", sig(void.class, ThreadContext.class), Bootstrap.checkpointHandle()); }
public void pushString(ByteList bl) { adapter.aload(0); adapter.invokedynamic("string", sig(JVM.OBJECT, ThreadContext.class), Bootstrap.string(), new String(bl.bytes(), RubyEncoding.ISO), bl.getEncoding().getIndex()); }
public static CallSite bytelist(Lookup lookup, String name, MethodType type, String value, String encodingName) { return new ConstantCallSite(constant(ByteList.class, bytelist(value, encodingName))); }
public void checkpoint() { loadContext(); adapter.invokedynamic( "checkpoint", sig(void.class, ThreadContext.class), Bootstrap.checkpointHandle()); }
MethodHandle getHandle(IRubyObject self, RubyClass dispatchClass, DynamicMethod method) throws Throwable { boolean blockGiven = signature.lastArgType() == Block.class; MethodHandle mh = buildNewInstanceHandle(method, self); if (mh == null) mh = buildNotEqualHandle(method, self); if (mh == null) mh = Bootstrap.buildNativeHandle(this, method, blockGiven); if (mh == null) mh = buildJavaFieldHandle(this, method, self); if (mh == null) mh = Bootstrap.buildIndyHandle(this, method, method.getImplementationClass()); if (mh == null) mh = Bootstrap.buildJittedHandle(this, method, blockGiven); if (mh == null) mh = Bootstrap.buildAttrHandle(this, method, self, dispatchClass); if (mh == null) mh = buildAliasHandle(method, self, dispatchClass); if (mh == null) mh = buildStructHandle(method, self, dispatchClass); if (mh == null) mh = Bootstrap.buildGenericHandle(this, method, dispatchClass); assert mh != null : "we should have a method handle of some sort by now"; return mh; }
public void array(int length) { adapter.invokedynamic("array", sig(JVM.OBJECT, params(ThreadContext.class, JVM.OBJECT, length)), Bootstrap.array()); }
public void pushString(ByteList bl, int cr) { loadContext(); adapter.invokedynamic("string", sig(RubyString.class, ThreadContext.class), Bootstrap.string(), new String(bl.bytes(), RubyEncoding.ISO), bl.getEncoding().toString(), cr); }
public void pushByteList(ByteList bl) { adapter.invokedynamic("bytelist", sig(ByteList.class), Bootstrap.bytelist(), new String(bl.bytes(), RubyEncoding.ISO), bl.getEncoding().toString()); }
public void attrAssign(String name) { adapter.invokedynamic("attrAssign:" + JavaNameMangler.mangleMethodName(name), sig(JVM.OBJECT, ThreadContext.class, JVM.OBJECT, JVM.OBJECT), Bootstrap.attrAssign()); }
public void array(int length) { if (length > MAX_ARGUMENTS) throw new NotCompilableException("literal array has more than " + MAX_ARGUMENTS + " elements"); // use utility method for supported sizes if (length <= RubyArraySpecialized.MAX_PACKED_SIZE) { super.array(length); return; } adapter.invokedynamic("array", sig(JVM.OBJECT, params(ThreadContext.class, JVM.OBJECT, length)), Bootstrap.array()); }
public void pushString(ByteList bl) { adapter.aload(0); adapter.invokedynamic("string", sig(JVM.OBJECT, ThreadContext.class), Bootstrap.string(), new String(bl.bytes(), RubyEncoding.ISO), bl.getEncoding().getIndex()); }
public void pushByteList(ByteList bl) { adapter.invokedynamic("bytelist", sig(ByteList.class), Bootstrap.bytelist(), new String(bl.bytes(), RubyEncoding.ISO), bl.getEncoding().toString()); }
public void array(int length) { if (length > MAX_ARGUMENTS) throw new NotCompilableException("literal array has more than " + MAX_ARGUMENTS + " elements"); // use utility method for supported sizes if (length <= RubyArraySpecialized.MAX_PACKED_SIZE) { super.array(length); return; } adapter.invokedynamic("array", sig(JVM.OBJECT, params(ThreadContext.class, JVM.OBJECT, length)), Bootstrap.array()); }
public static CallSite fstring(Lookup lookup, String name, MethodType type, String value, String encodingName, int cr, String file, int line) { MutableCallSite site = new MutableCallSite(type); Binder binder = Binder .from(RubyString.class, ThreadContext.class) .insert(0, arrayOf(MutableCallSite.class, ByteList.class, int.class, String.class, int.class), site, bytelist(value, encodingName), cr, file, line); site.setTarget(binder.invokeStaticQuiet(lookup, Bootstrap.class, "frozenString")); return site; }
public static CallSite string(Lookup lookup, String name, MethodType type, String value, String encodingName, int cr) { MutableCallSite site = new MutableCallSite(type); Binder binder = Binder .from(RubyString.class, ThreadContext.class) .insert(0, arrayOf(MutableCallSite.class, ByteList.class, int.class), site, bytelist(value, encodingName), cr); site.setTarget(binder.invokeStaticQuiet(lookup, Bootstrap.class, "string")); return site; }