- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.jruby.ir.targets.YieldSite.setTarget()
方法的一些代码示例,展示了YieldSite.setTarget()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YieldSite.setTarget()
方法的具体详情如下:
包路径:org.jruby.ir.targets.YieldSite
类名称:YieldSite
方法名:setTarget
暂无
代码示例来源:origin: org.jruby/jruby-complete
public static CallSite bootstrap(MethodHandles.Lookup lookup, String name, MethodType type, int unwrap) throws Throwable {
YieldSite site = new YieldSite(type, unwrap == 1 ? true : false);
MethodHandle handle;
switch (name) {
case "yield":
case "yieldSpecific":
handle = Binder.from(type)
.prepend(YieldSite.class, site)
.invokeVirtual(lookup, name);
break;
case "yieldValues":
handle = Binder.from(type)
.collect(2, IRubyObject[].class)
.prepend(YieldSite.class, site)
.invokeVirtual(lookup, name);
break;
default:
throw new RuntimeException("invalid yield type: " + name);
}
site.setTarget(handle);
return site;
}
代码示例来源:origin: org.jruby/jruby-core
public static CallSite bootstrap(MethodHandles.Lookup lookup, String name, MethodType type, int unwrap) throws Throwable {
YieldSite site = new YieldSite(type, unwrap == 1 ? true : false);
MethodHandle handle;
switch (name) {
case "yield":
case "yieldSpecific":
handle = Binder.from(type)
.prepend(YieldSite.class, site)
.invokeVirtual(lookup, name);
break;
case "yieldValues":
handle = Binder.from(type)
.collect(2, IRubyObject[].class)
.prepend(YieldSite.class, site)
.invokeVirtual(lookup, name);
break;
default:
throw new RuntimeException("invalid yield type: " + name);
}
site.setTarget(handle);
return site;
}
代码示例来源:origin: org.jruby/jruby-complete
public IRubyObject yieldSpecific(ThreadContext context, Block block) throws Throwable {
if (Options.INVOKEDYNAMIC_YIELD.load()) {
BlockBody body = block.getBody();
MethodHandle target;
if (block.getBody() instanceof CompiledIRBlockBody) {
CompiledIRBlockBody compiledBody = (CompiledIRBlockBody) block.getBody();
if (Options.INVOKEDYNAMIC_LOG_BINDING.load()) {
LOG.info("yield \tbound directly as yieldSpecific:" + Bootstrap.logBlock(block));
}
target = compiledBody.getNormalYieldSpecificHandle();
} else {
if (Options.INVOKEDYNAMIC_LOG_BINDING.load()) {
LOG.info("yield \tbound indirectly as yieldSpecific:" + Bootstrap.logBlock(block));
}
target = Binder.from(type())
.permute(1, 0)
.invokeVirtualQuiet(MethodHandles.lookup(), "yieldSpecific");
}
MethodHandle fallback = getTarget();
MethodHandle test = body.getTestBlockBody();
MethodHandle guard = MethodHandles.guardWithTest(test, target, fallback);
setTarget(guard);
return (IRubyObject) target.invokeExact(context, block);
}
return block.yieldSpecific(context);
}
代码示例来源:origin: org.jruby/jruby-core
public IRubyObject yield(ThreadContext context, Block block, IRubyObject arg) throws Throwable {
if (Options.INVOKEDYNAMIC_YIELD.load()) {
BlockBody body = block.getBody();
MethodHandle target;
if (block.getBody() instanceof CompiledIRBlockBody) {
CompiledIRBlockBody compiledBody = (CompiledIRBlockBody) block.getBody();
if (Options.INVOKEDYNAMIC_LOG_BINDING.load()) {
LOG.info("yield \tbound directly as yield:" + Bootstrap.logBlock(block));
}
target = unwrap ? compiledBody.getNormalYieldUnwrapHandle() : compiledBody.getNormalYieldHandle();
} else {
if (Options.INVOKEDYNAMIC_LOG_BINDING.load()) {
LOG.info("yield \tbound indirectly as yield:" + Bootstrap.logBlock(block));
}
target = Binder.from(type())
.append(unwrap)
.invokeStaticQuiet(MethodHandles.lookup(), IRRuntimeHelpers.class, "yield");
}
MethodHandle fallback = getTarget();
MethodHandle test = body.getTestBlockBody();
MethodHandle guard = MethodHandles.guardWithTest(test, target, fallback);
setTarget(guard);
return (IRubyObject) target.invokeExact(context, block, arg);
}
return IRRuntimeHelpers.yield(context, block, arg, unwrap);
}
代码示例来源:origin: org.jruby/jruby-core
public IRubyObject yieldSpecific(ThreadContext context, Block block) throws Throwable {
if (Options.INVOKEDYNAMIC_YIELD.load()) {
BlockBody body = block.getBody();
MethodHandle target;
if (block.getBody() instanceof CompiledIRBlockBody) {
CompiledIRBlockBody compiledBody = (CompiledIRBlockBody) block.getBody();
if (Options.INVOKEDYNAMIC_LOG_BINDING.load()) {
LOG.info("yield \tbound directly as yieldSpecific:" + Bootstrap.logBlock(block));
}
target = compiledBody.getNormalYieldSpecificHandle();
} else {
if (Options.INVOKEDYNAMIC_LOG_BINDING.load()) {
LOG.info("yield \tbound indirectly as yieldSpecific:" + Bootstrap.logBlock(block));
}
target = Binder.from(type())
.permute(1, 0)
.invokeVirtualQuiet(MethodHandles.lookup(), "yieldSpecific");
}
MethodHandle fallback = getTarget();
MethodHandle test = body.getTestBlockBody();
MethodHandle guard = MethodHandles.guardWithTest(test, target, fallback);
setTarget(guard);
return (IRubyObject) target.invokeExact(context, block);
}
return block.yieldSpecific(context);
}
代码示例来源:origin: org.jruby/jruby-complete
public IRubyObject yield(ThreadContext context, Block block, IRubyObject arg) throws Throwable {
if (Options.INVOKEDYNAMIC_YIELD.load()) {
BlockBody body = block.getBody();
MethodHandle target;
if (block.getBody() instanceof CompiledIRBlockBody) {
CompiledIRBlockBody compiledBody = (CompiledIRBlockBody) block.getBody();
if (Options.INVOKEDYNAMIC_LOG_BINDING.load()) {
LOG.info("yield \tbound directly as yield:" + Bootstrap.logBlock(block));
}
target = unwrap ? compiledBody.getNormalYieldUnwrapHandle() : compiledBody.getNormalYieldHandle();
} else {
if (Options.INVOKEDYNAMIC_LOG_BINDING.load()) {
LOG.info("yield \tbound indirectly as yield:" + Bootstrap.logBlock(block));
}
target = Binder.from(type())
.append(unwrap)
.invokeStaticQuiet(MethodHandles.lookup(), IRRuntimeHelpers.class, "yield");
}
MethodHandle fallback = getTarget();
MethodHandle test = body.getTestBlockBody();
MethodHandle guard = MethodHandles.guardWithTest(test, target, fallback);
setTarget(guard);
return (IRubyObject) target.invokeExact(context, block, arg);
}
return IRRuntimeHelpers.yield(context, block, arg, unwrap);
}
对于大多数操作,我只需在 InterfaceBuilder 中单击并拖动即可将某个接口(interface)对象的调用“连接”到我的代码。例如,如果我想知道用户何时单击表中的一行,我将连接从表的操作拖
NSMenuItem -setTarget:它是否保留目标,还是应该显式保留它? 我见过关于此的相互矛盾的文档。我知道 NSInitation 中的 keepArguments,但我不确定这是否适用于
这是一个简单的程序,它为 Line 形状的 Y2 属性设置动画。请注意,我使用 SetTarget 方法来定位 Line。这个程序运行良好。 using System; using System.Wi
谁能帮我找出为什么这不起作用。 brushes 变量包含一个预填充的画笔列表。如果我尝试在迭代期间直接应用 BeginAnimation,它工作正常。但是单独启动每个动画的开销很大...... 所以我
为什么 Storyboard.SetTargetName 有效而 Storyboard.SetTarget 无效?这里 xaml -
本文整理了Java中org.jruby.ir.targets.YieldSite.setTarget()方法的一些代码示例,展示了YieldSite.setTarget()的具体用法。这些代码示例主要
我有模态窗口。在其 Controller 中我这样做: [[NSFontManager sharedFontManager] orderFrontFontPanel:self]; 而且效果很好。字体管
我找到了我的问题的一些答案,但它仍然不起作用。我在 IB 中设置了一个按钮,我想通过代码设置操作和目标(仅供学习)。我的 MainViewController 中有一个函数: - (IBAction)
本文整理了Java中pl.edu.icm.model.bwmeta.y.YRelation.setTarget()方法的一些代码示例,展示了YRelation.setTarget()的具体用法。这些代
我是一名优秀的程序员,十分优秀!