org.jruby.Ruby.getJITCompiler()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(10.5k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中org.jruby.Ruby.getJITCompiler方法的一些代码示例,展示了Ruby.getJITCompiler的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.getJITCompiler方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:getJITCompiler

Ruby.getJITCompiler介绍

暂无

代码示例

代码示例来源:origin: org.jruby/jruby-complete

  1. private void tryJit(ThreadContext context) {
  2. if (context.runtime.isBooting() && !Options.JIT_KERNEL.load()) return; // don't JIT during runtime boot
  3. synchronized (this) {
  4. if (callCount >= 0 && callCount++ >= Options.JIT_THRESHOLD.load()) {
  5. context.runtime.getJITCompiler().buildThresholdReached(context, this);
  6. }
  7. }
  8. }

代码示例来源:origin: org.jruby/jruby-complete

  1. private void promoteToFullBuild(ThreadContext context) {
  2. if (context.runtime.isBooting() && !Options.JIT_KERNEL.load()) return; // don't Promote to full build during runtime boot
  3. if (callCount++ >= Options.JIT_THRESHOLD.load()) {
  4. context.runtime.getJITCompiler().buildThresholdReached(context, this);
  5. }
  6. }

代码示例来源:origin: org.jruby/jruby-core

  1. private void promoteToFullBuild(ThreadContext context) {
  2. if (context.runtime.isBooting() && !Options.JIT_KERNEL.load()) return; // don't Promote to full build during runtime boot
  3. if (callCount++ >= Options.JIT_THRESHOLD.load()) {
  4. context.runtime.getJITCompiler().buildThresholdReached(context, this);
  5. }
  6. }

代码示例来源:origin: org.jruby/jruby-core

  1. private void tryJit(ThreadContext context) {
  2. if (context.runtime.isBooting() && !Options.JIT_KERNEL.load()) return; // don't JIT during runtime boot
  3. synchronized (this) {
  4. if (callCount >= 0 && callCount++ >= Options.JIT_THRESHOLD.load()) {
  5. context.runtime.getJITCompiler().buildThresholdReached(context, this);
  6. }
  7. }
  8. }

代码示例来源:origin: org.jruby/jruby-complete

  1. private void promoteToFullBuild(ThreadContext context) {
  2. Ruby runtime = context.runtime;
  3. if (runtime.isBooting() && !Options.JIT_KERNEL.load()) return; // don't Promote to full build during runtime boot
  4. if (callCount++ >= Options.JIT_THRESHOLD.load()) runtime.getJITCompiler().buildThresholdReached(context, this);
  5. if (IRRuntimeHelpers.shouldPrintIR(implementationClass.getRuntime())) {
  6. ByteArrayOutputStream baos = IRDumper.printIR(method, true, true);
  7. LOG.info("Printing full IR for " + method.getId() + ":\n" + new String(baos.toByteArray()));
  8. }
  9. }

代码示例来源:origin: org.jruby/jruby-core

  1. private void promoteToFullBuild(ThreadContext context) {
  2. Ruby runtime = context.runtime;
  3. if (runtime.isBooting() && !Options.JIT_KERNEL.load()) return; // don't Promote to full build during runtime boot
  4. if (callCount++ >= Options.JIT_THRESHOLD.load()) runtime.getJITCompiler().buildThresholdReached(context, this);
  5. if (IRRuntimeHelpers.shouldPrintIR(implementationClass.getRuntime())) {
  6. ByteArrayOutputStream baos = IRDumper.printIR(method, true, true);
  7. LOG.info("Printing full IR for " + method.getId() + ":\n" + new String(baos.toByteArray()));
  8. }
  9. }

代码示例来源:origin: org.jruby/jruby-complete

  1. public void inlineMethod(IRMethod methodToInline, long callsiteId, int classToken, boolean cloneHost) {
  2. if (alreadyHasInline) return;
  3. FullInterpreterContext newContext = inlineMethodCommon(methodToInline, callsiteId, classToken, cloneHost);
  4. if (newContext == null) {
  5. if (IRManager.IR_INLINER_VERBOSE) LOG.info("Inline of " + methodToInline + " into " + this + " failed: " + inlineFailed + ".");
  6. return;
  7. } else {
  8. if (IRManager.IR_INLINER_VERBOSE) LOG.info("Inline of " + methodToInline + " into " + this + " succeeded.");
  9. }
  10. newContext.generateInstructionsForInterpretation();
  11. this.optimizedInterpreterContext = newContext;
  12. manager.getRuntime().getJITCompiler().getTaskFor(manager.getRuntime().getCurrentContext(), compilable).run();
  13. }

代码示例来源:origin: org.jruby/jruby-complete

  1. public void inlineMethodCompiled(IRMethod methodToInline, long callsiteId, int classToken, boolean cloneHost) {
  2. if (alreadyHasInline) return;
  3. FullInterpreterContext newContext = inlineMethodCommon(methodToInline, callsiteId, classToken, cloneHost);
  4. if (newContext == null) {
  5. if (IRManager.IR_INLINER_VERBOSE) LOG.info("Inline of " + methodToInline + " into " + this + " failed: " + inlineFailed + ".");
  6. return;
  7. } else {
  8. if (IRManager.IR_INLINER_VERBOSE) LOG.info("Inline of " + methodToInline + " into " + this + " succeeded.");
  9. }
  10. // We are not running any JIT-specific passes here.
  11. newContext.linearizeBasicBlocks();
  12. this.optimizedInterpreterContext = newContext;
  13. manager.getRuntime().getJITCompiler().getTaskFor(manager.getRuntime().getCurrentContext(), compilable).run();
  14. }

代码示例来源:origin: org.jruby/jruby-complete

  1. public void inlineMethodJIT(IRMethod methodToInline, long callsiteId, int classToken, boolean cloneHost) {
  2. if (alreadyHasInline) return;
  3. FullInterpreterContext newContext = inlineMethodCommon(methodToInline, callsiteId, classToken, cloneHost);
  4. if (newContext == null) {
  5. if (IRManager.IR_INLINER_VERBOSE) LOG.info("Inline of " + methodToInline + " into " + this + " failed: " + inlineFailed + ".");
  6. return;
  7. } else {
  8. if (IRManager.IR_INLINER_VERBOSE) LOG.info("Inline of " + methodToInline + " into " + this + " succeeded.");
  9. }
  10. // We are not running any JIT-specific passes here.
  11. newContext.linearizeBasicBlocks();
  12. this.optimizedInterpreterContext = newContext;
  13. manager.getRuntime().getJITCompiler().getTaskFor(manager.getRuntime().getCurrentContext(), compilable).run();
  14. }

代码示例来源:origin: org.jruby/jruby-core

  1. public void inlineMethod(IRMethod methodToInline, long callsiteId, int classToken, boolean cloneHost) {
  2. if (alreadyHasInline) return;
  3. FullInterpreterContext newContext = inlineMethodCommon(methodToInline, callsiteId, classToken, cloneHost);
  4. if (newContext == null) {
  5. if (IRManager.IR_INLINER_VERBOSE) LOG.info("Inline of " + methodToInline + " into " + this + " failed: " + inlineFailed + ".");
  6. return;
  7. } else {
  8. if (IRManager.IR_INLINER_VERBOSE) LOG.info("Inline of " + methodToInline + " into " + this + " succeeded.");
  9. }
  10. newContext.generateInstructionsForInterpretation();
  11. this.optimizedInterpreterContext = newContext;
  12. manager.getRuntime().getJITCompiler().getTaskFor(manager.getRuntime().getCurrentContext(), compilable).run();
  13. }

代码示例来源:origin: org.jruby/jruby-core

  1. public void inlineMethodCompiled(IRMethod methodToInline, long callsiteId, int classToken, boolean cloneHost) {
  2. if (alreadyHasInline) return;
  3. FullInterpreterContext newContext = inlineMethodCommon(methodToInline, callsiteId, classToken, cloneHost);
  4. if (newContext == null) {
  5. if (IRManager.IR_INLINER_VERBOSE) LOG.info("Inline of " + methodToInline + " into " + this + " failed: " + inlineFailed + ".");
  6. return;
  7. } else {
  8. if (IRManager.IR_INLINER_VERBOSE) LOG.info("Inline of " + methodToInline + " into " + this + " succeeded.");
  9. }
  10. // We are not running any JIT-specific passes here.
  11. newContext.linearizeBasicBlocks();
  12. this.optimizedInterpreterContext = newContext;
  13. manager.getRuntime().getJITCompiler().getTaskFor(manager.getRuntime().getCurrentContext(), compilable).run();
  14. }

代码示例来源:origin: org.jruby/jruby-core

  1. public void inlineMethodJIT(IRMethod methodToInline, long callsiteId, int classToken, boolean cloneHost) {
  2. if (alreadyHasInline) return;
  3. FullInterpreterContext newContext = inlineMethodCommon(methodToInline, callsiteId, classToken, cloneHost);
  4. if (newContext == null) {
  5. if (IRManager.IR_INLINER_VERBOSE) LOG.info("Inline of " + methodToInline + " into " + this + " failed: " + inlineFailed + ".");
  6. return;
  7. } else {
  8. if (IRManager.IR_INLINER_VERBOSE) LOG.info("Inline of " + methodToInline + " into " + this + " succeeded.");
  9. }
  10. // We are not running any JIT-specific passes here.
  11. newContext.linearizeBasicBlocks();
  12. this.optimizedInterpreterContext = newContext;
  13. manager.getRuntime().getJITCompiler().getTaskFor(manager.getRuntime().getCurrentContext(), compilable).run();
  14. }

代码示例来源:origin: org.talend.sdk.component/documentation

  1. }).thenAccept(ignored -> {
  2. Ruby.getGlobalRuntime().getJITCompiler().tearDown();
  3. });
  4. tasks.register(() -> generatedTypes(generatedDir));

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. private DynamicMethod tryJitReturnMethod(ThreadContext context) {
  2. String className;
  3. if (implementationClass.isSingleton()) {
  4. MetaClass metaClass = (MetaClass)implementationClass;
  5. RubyClass realClass = metaClass.getRealClass();
  6. // if real class is Class
  7. if (realClass == context.runtime.getClassClass()) {
  8. // use the attached class's name
  9. className = ((RubyClass)metaClass.getAttached()).getName();
  10. } else {
  11. // use the real class name
  12. className = realClass.getName();
  13. }
  14. } else {
  15. // use the class name
  16. className = implementationClass.getName();
  17. }
  18. context.runtime.getJITCompiler().tryJIT(this, context, className, name);
  19. return box.actualMethod;
  20. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. private DynamicMethod tryJitReturnMethod(ThreadContext context) {
  2. String className;
  3. if (implementationClass.isSingleton()) {
  4. MetaClass metaClass = (MetaClass)implementationClass;
  5. RubyClass realClass = metaClass.getRealClass();
  6. // if real class is Class
  7. if (realClass == context.runtime.getClassClass()) {
  8. // use the attached class's name
  9. className = ((RubyClass)metaClass.getAttached()).getName();
  10. } else {
  11. // use the real class name
  12. className = realClass.getName();
  13. }
  14. } else {
  15. // use the class name
  16. className = implementationClass.getName();
  17. }
  18. context.runtime.getJITCompiler().tryJIT(this, context, className, name);
  19. return box.actualMethod;
  20. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. getJITCompiler().tearDown();

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. getJITCompiler().tearDown();

代码示例来源:origin: org.jruby/jruby-complete

  1. private void promoteToFullBuild(ThreadContext context) {
  2. if (context.runtime.isBooting() && !Options.JIT_KERNEL.load()) return; // don't JIT during runtime boot
  3. if (callCount >= 0) {
  4. synchronized (this) {
  5. // check call count again
  6. if (callCount < 0) return;
  7. if (callCount++ >= Options.JIT_THRESHOLD.load()) {
  8. callCount = -1;
  9. // ensure we've got code ready for JIT
  10. ensureInstrsReady();
  11. closure.getNearestTopLocalVariableScope().prepareForCompilation();
  12. // if we don't have an explicit protocol, disable JIT
  13. if (!closure.hasExplicitCallProtocol()) {
  14. if (Options.JIT_LOGGING.load()) {
  15. LOG.info("JIT failed; no protocol found in block: " + closure);
  16. }
  17. return;
  18. }
  19. context.runtime.getJITCompiler().buildThresholdReached(context, this);
  20. }
  21. }
  22. }
  23. }

代码示例来源:origin: org.jruby/jruby-core

  1. private void promoteToFullBuild(ThreadContext context) {
  2. if (context.runtime.isBooting() && !Options.JIT_KERNEL.load()) return; // don't JIT during runtime boot
  3. if (callCount >= 0) {
  4. synchronized (this) {
  5. // check call count again
  6. if (callCount < 0) return;
  7. if (callCount++ >= Options.JIT_THRESHOLD.load()) {
  8. callCount = -1;
  9. // ensure we've got code ready for JIT
  10. ensureInstrsReady();
  11. closure.getNearestTopLocalVariableScope().prepareForCompilation();
  12. // if we don't have an explicit protocol, disable JIT
  13. if (!closure.hasExplicitCallProtocol()) {
  14. if (Options.JIT_LOGGING.load()) {
  15. LOG.info("JIT failed; no protocol found in block: " + closure);
  16. }
  17. return;
  18. }
  19. context.runtime.getJITCompiler().buildThresholdReached(context, this);
  20. }
  21. }
  22. }
  23. }

相关文章

Ruby类方法