예제 #1
0
파일: Main.java 프로젝트: rebx/jruby
  private Status doRunFromMain(Ruby runtime, InputStream in, String filename) {
    long now = -1;
    try {
      if (config.isBenchmarking()) {
        now = System.currentTimeMillis();
      }
      if (config.isSamplingEnabled()) {
        SimpleSampler.startSampleThread();
      }

      doCheckSecurityManager();

      try {
        runtime.runFromMain(in, filename);
      } finally {
        if (config.isBenchmarking()) {
          config.getOutput().println("Runtime: " + (System.currentTimeMillis() - now) + " ms");
        }
        if (config.isSamplingEnabled()) {
          org.jruby.util.SimpleSampler.report();
        }
      }
    } catch (RaiseException rj) {
      return new Status(handleRaiseException(rj));
    }
    return new Status();
  }
예제 #2
0
파일: Main.java 프로젝트: ratnikov/jruby
  private Status doRunFromMain(Ruby runtime, InputStream in, String filename) {
    long now = -1;
    try {
      doCheckSecurityManager();

      runtime.runFromMain(in, filename);

      runtime.getTruffleBridge().shutdown();

    } catch (RaiseException rj) {
      return new Status(handleRaiseException(rj));
    }
    return new Status();
  }