Tabnine Logo
Binder.from
Code IndexAdd Tabnine to your IDE (free)

How to use
from
method
in
com.headius.invokebinder.Binder

Best Java code snippets using com.headius.invokebinder.Binder.from (Showing top 20 results out of 315)

origin: org.dynjs/dynjs

public static MethodHandle nullReplacingFilter(Class<?> target) throws NoSuchMethodException, IllegalAccessException {
  Lookup lookup = MethodHandles.lookup();
  MethodHandle returnNull = lookup.findStatic(DynJSCoercionMatrix.class, "returnNull", methodType(Object.class, Object.class));
  return Binder.from(methodType(target, Object.class))
      //.drop(0)
      //.insert(0, new Class[]{Object.class}, new Object[]{null})
      .invoke(returnNull);
}
origin: org.projectodd.rephract/rephract

public MethodHandle getBootstrapMethodHandle() throws NoSuchMethodException, IllegalAccessException {
  Lookup lookup = MethodHandles.lookup();
  return Binder.from(CallSite.class, Lookup.class, String.class, MethodType.class)
      .insert(0, this)
      .invokeVirtual(lookup, "bootstrap");
}
origin: org.jruby/jruby-complete

public MethodHandle getNormalYieldSpecificHandle() {
  MethodHandle normalYieldSpecificHandle = this.normalYieldSpecificHandle;
  if (normalYieldSpecificHandle != null) return normalYieldSpecificHandle;
  return this.normalYieldSpecificHandle = Binder.from(IRubyObject.class, ThreadContext.class, Block.class)
      .append(new Class[] {StaticScope.class, IRubyObject.class, IRubyObject[].class, Block.class},
          getStaticScope(), null, null, Block.NULL_BLOCK)
      .invoke(handle);
}
origin: org.jruby/jruby-complete

private MethodHandle SMFC() {
  if (_SMFC != null) return _SMFC;
  return _SMFC = Binder.from(type())
      .insert(0, this)
      .invokeVirtualQuiet(Bootstrap.LOOKUP, "searchModuleForConst");
}
origin: org.jruby/jruby-complete

private MethodHandle ISC() {
  if (_ISC != null) return _ISC;
  return _ISC = Binder.from(type())
      .insert(0, this)
      .invokeVirtualQuiet(Bootstrap.LOOKUP, "inheritanceSearchConst");
}
origin: org.jruby/jruby-complete

public static CallSite array(Lookup lookup, String name, MethodType type) {
  MethodHandle handle = Binder
      .from(type)
      .collect(1, IRubyObject[].class)
      .invokeStaticQuiet(LOOKUP, Bootstrap.class, "array");
  CallSite site = new ConstantCallSite(handle);
  return site;
}
origin: org.jruby/jruby-complete

public static CallSite kwargsHash(Lookup lookup, String name, MethodType type) {
  MethodHandle handle = Binder
      .from(lookup, type)
      .collect(2, IRubyObject[].class)
      .invokeStaticQuiet(LOOKUP, Bootstrap.class, "kwargsHash");
  CallSite site = new ConstantCallSite(handle);
  return site;
}
origin: org.jruby/jruby-core

  private MethodHandle noCacheISC() {
    if (_noCacheISC != null) return _noCacheISC;
    return _noCacheISC = Binder.from(type())
        .insert(0, this)
        .invokeVirtualQuiet(Bootstrap.LOOKUP, "noCacheInheritanceSearchConst");
  }
}
origin: org.jruby/jruby-complete

public MethodHandle getTestBlockBody() {
  final MethodHandle testBlockBody = this.testBlockBody;
  if (testBlockBody != null) return testBlockBody;
  return this.testBlockBody = Binder.from(boolean.class, ThreadContext.class, Block.class).drop(0).append(this).invoke(TEST_BLOCK_BODY);
}
origin: org.jruby/jruby-complete

  @Override
  public Binder prepareBinder() {
    return Binder
        .from(type())
        .filterReturn(CACHE.bindTo(this));
  }
}
origin: org.jruby/jruby-complete

private MethodHandle noCacheSMFC() {
  if (_noCacheSMFC != null) return _noCacheSMFC;
  return _noCacheSMFC = Binder.from(type())
      .insert(0, this)
      .invokeVirtualQuiet(Bootstrap.LOOKUP, "noCacheSearchModuleForConst");
}
origin: com.headius/invokebinder

/**
 * Process the incoming arguments by calling the given static method on the
 * given class, inserting the result as the first argument.
 *
 * @param lookup the java.lang.invoke.MethodHandles.Lookup to use
 * @param target the class on which the method is defined
 * @param method the method to invoke on the first argument
 * @return a new Binder
 */
public Binder foldStatic(MethodHandles.Lookup lookup, Class<?> target, String method) {
  return fold(Binder.from(type()).invokeStaticQuiet(lookup, target, method));
}
origin: org.projectodd.rephract/rephract

  @Override
  public MethodHandle guardMethodHandle(MethodType inputType) throws Exception {
    Binder binder = Binder.from(inputType);
    return binder.drop(0, inputType.parameterCount())
        .constant(false);
  }
}
origin: org.jruby/jruby-complete

public static RubyString frozenString(MutableCallSite site, ByteList value, int cr, String file, int line, ThreadContext context) throws Throwable {
  RubyString frozen = IRRuntimeHelpers.newFrozenString(context, value, cr, file, line);
  MethodHandle handle = Binder.from(RubyString.class, ThreadContext.class)
      .dropAll()
      .constant(frozen);
  site.setTarget(handle);
  return frozen;
}
origin: org.jruby/jruby-complete

public static void checkpointFallback(MutableCallSite site, ThreadContext context) throws Throwable {
  Ruby runtime = context.runtime;
  Invalidator invalidator = runtime.getCheckpointInvalidator();
  MethodHandle target = Binder
      .from(void.class, ThreadContext.class)
      .nop();
  MethodHandle fallback = lookup().findStatic(Bootstrap.class, "checkpointFallback", methodType(void.class, MutableCallSite.class, ThreadContext.class));
  fallback = fallback.bindTo(site);
  target = ((SwitchPoint)invalidator.getData()).guardWithTest(target, fallback);
  site.setTarget(target);
}
origin: org.jruby/jruby-complete

public static CallSite constLookup(MethodHandles.Lookup lookup, String searchType, MethodType type, String constName, int publicOnly, int callConstMissing) {
  ConstantLookupSite site = new ConstantLookupSite(type, constName, publicOnly == 0 ? false : true, callConstMissing == 0 ? false : true);
  MethodHandle handle = Binder
      .from(lookup, type)
      .insert(0, site)
      .invokeVirtualQuiet(lookup, searchType);
  site.setTarget(handle);
  return site;
}
origin: org.jruby/jruby-complete

public static CallSite contextValue(Lookup lookup, String name, MethodType type) {
  MutableCallSite site = new MutableCallSite(type);
  site.setTarget(Binder.from(type).append(site).invokeStaticQuiet(lookup, Bootstrap.class, name));
  return site;
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

public static IRubyObject symbol(MutableCallSite site, String name, ThreadContext context) {
  RubySymbol symbol = RubySymbol.newSymbol(context.runtime, name);
  site.setTarget(Binder
      .from(IRubyObject.class, ThreadContext.class)
      .drop(0)
      .constant(symbol)
  );
  return symbol;
}
origin: org.jruby/jruby-complete

public boolean init(IRubyObject obj) {
  IRubyObject nil = obj.getRuntime().getNil();
  setTarget(
      Binder.from(type())
          .insert(0, RubyNil.class, nil)
          .invokeStaticQuiet(LOOKUP, IsNilSite.class, "isNil")
  );
  return nil == obj;
}
origin: org.jruby/jruby-core

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;
}
com.headius.invokebinderBinderfrom

Javadoc

Construct a new Binder, starting from a given invokebinder.

Popular methods of Binder

  • insert
    Insert at the given index the given argument value(s).
  • invoke
    Apply the chain of transforms and bind them to a static method specified using the end signature plu
  • collect
    Box all incoming arguments from the given position onward into the given array type.
  • constant
    Apply the tranforms, binding them to a constant value that will propagate back through the chain. Th
  • drop
    Drop from the given index a number of arguments.
  • filter
    Filter incoming arguments, from the given index, replacing each with the result of calling the assoc
  • fold
    Process the incoming arguments using the given handle, inserting the result as the first argument.
  • invokeVirtual
    Apply the chain of transforms and bind them to a virtual method specified using the end signature pl
  • permute
    Permute the incoming arguments to a new sequence specified by the given values. Arguments may be dup
  • cast
    Cast the incoming arguments to the given MethodType. The casts applied are equivalent to those in Me
  • filterReturn
    Filter return value, using a function that produces the current return type from another type. The n
  • invokeStaticQuiet
    Apply the chain of transforms and bind them to a static method specified using the end signature plu
  • filterReturn,
  • invokeStaticQuiet,
  • invokeVirtualQuiet,
  • tryFinally,
  • nop,
  • type,
  • append,
  • foldVoid,
  • identity

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now