Ejemplo n.º 1
0
  public void inlineMethod(
      IRScope method, RubyModule implClass, int classToken, BasicBlock basicBlock, CallBase call) {
    // Inline
    depends(cfg());
    new CFGInliner(cfg).inlineMethod(method, implClass, classToken, basicBlock, call);

    // Reset state
    resetState();

    // Re-run opts
    for (CompilerPass pass : getManager().getInliningCompilerPasses(this)) {
      pass.run(this);
    }
  }
Ejemplo n.º 2
0
  private void runCompilerPasses() {
    // SSS FIXME: Why is this again?  Document this weirdness!
    // Forcibly clear out the shared eval-scope variable allocator each time this method executes
    initEvalScopeVariableAllocator(true);

    // SSS FIXME: We should configure different optimization levels
    // and run different kinds of analysis depending on time budget.  Accordingly, we need to set
    // IR levels/states (basic, optimized, etc.) and the
    // ENEBO: If we use a MT optimization mechanism we cannot mutate CFG
    // while another thread is using it.  This may need to happen on a clone()
    // and we may need to update the method to return the new method.  Also,
    // if this scope is held in multiple locations how do we update all references?
    for (CompilerPass pass : getManager().getCompilerPasses(this)) {
      pass.run(this);
    }
  }