Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e598dec140d6
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c9cc8a82718b
Choose a head ref
  • 4 commits
  • 9 files changed
  • 1 contributor

Commits on Dec 3, 2015

  1. Copy the full SHA
    6f252ea View commit details
  2. Remove threadPollInstrs count. Vestigial baggage from original profiler

    experiments and this will reduce our memory usage a bit for a field we are
    not using.
    
    Updated comments in Profiler to better describe how the current deisgn works.
    
    Removed some comments I figured out along the way.
    enebo committed Dec 3, 2015
    Copy the full SHA
    dee6d2c View commit details

Commits on Dec 4, 2015

  1. Random changes

    enebo committed Dec 4, 2015
    Copy the full SHA
    9dcb6cc View commit details

Commits on Dec 5, 2015

  1. New strategy for pushing before a call so JIT can get into the action.

    Interpreter will still pass callbase since it has a reference.  For JIT,
    since we do not we wll push the callsiteid.  When we analyzeProfile we
    will then figure out the callbase based on callsiteid and the profiler
    will be happy enough to inline.
    
    Note: This is still broken but we are at the point where we are almost
    inlining from profiled data after being JIT'd.  This is getting close
    to being able to re-JIT.
    enebo committed Dec 5, 2015
    Copy the full SHA
    c9cc8a8 View commit details
Original file line number Diff line number Diff line change
@@ -54,6 +54,10 @@ public SkinnyMethodAdapter(ClassVisitor cv, int flags, String name, String signa
this.end = new Label();
}

public String getName() {
return name;
}

public ClassVisitor getClassVisitor() {
return cv;
}
2 changes: 0 additions & 2 deletions core/src/main/java/org/jruby/ir/IRBuilder.java
Original file line number Diff line number Diff line change
@@ -308,8 +308,6 @@ public void addInstr(Instr instr) {
// If we are building an ensure body, stash the instruction
// in the ensure body's list. If not, add it to the scope directly.
if (ensureBodyBuildStack.empty()) {
if (instr instanceof ThreadPollInstr) scope.threadPollInstrsCount++;

instr.computeScopeFlags(scope);

if (hasListener()) manager.getIRScopeListener().addedInstr(scope, instr, instructions.size());
12 changes: 1 addition & 11 deletions core/src/main/java/org/jruby/ir/IRScope.java
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
import org.jruby.RubyInstanceConfig;
import org.jruby.RubyModule;
import org.jruby.compiler.Compilable;
import org.jruby.internal.runtime.methods.DynamicMethod;
import org.jruby.ir.dataflow.analyses.LiveVariablesProblem;
import org.jruby.ir.dataflow.analyses.StoreLocalVarPlacementProblem;
import org.jruby.ir.dataflow.analyses.UnboxableOpsAnalysisProblem;
@@ -120,9 +119,6 @@ public abstract class IRScope implements ParseResult {
/** Have scope flags been computed? */
private boolean flagsComputed;

/** # of thread poll instrs added to this scope */
protected int threadPollInstrsCount;

private IRManager manager;

private TemporaryVariable yieldClosureVariable;
@@ -135,7 +131,6 @@ protected IRScope(IRScope s, IRScope lexicalParent) {
this.manager = s.manager;
this.lineNumber = s.lineNumber;
this.staticScope = s.staticScope;
this.threadPollInstrsCount = s.threadPollInstrsCount;
this.nextClosureIndex = s.nextClosureIndex;
this.temporaryVariableIndex = s.temporaryVariableIndex;
this.floatVariableIndex = s.floatVariableIndex;
@@ -158,7 +153,6 @@ public IRScope(IRManager manager, IRScope lexicalParent, String name,
this.name = name;
this.lineNumber = lineNumber;
this.staticScope = staticScope;
this.threadPollInstrsCount = 0;
this.nextClosureIndex = 0;
this.temporaryVariableIndex = -1;
this.floatVariableIndex = -1;
@@ -909,10 +903,6 @@ public Variable getNewInlineVariable(String inlinePrefix, Variable v) {
}
}

public int getThreadPollInstrsCount() {
return threadPollInstrsCount;
}

public int getLocalVariablesCount() {
return localVars.size();
}
@@ -1036,7 +1026,7 @@ public void inlineMethod(Compilable method, RubyModule implClass, int classToken
newContext.generateInstructionsForIntepretation();
this.fullInterpreterContext = newContext;

//System.out.println(fullInterpreterContext.toStringInstrs());
System.out.println(fullInterpreterContext.toStringInstrs());
compilable.setInterpreterContext(fullInterpreterContext);
// Since inline is an if/else of logic in this version of inlining we will just replace the FIC.
}
Original file line number Diff line number Diff line change
@@ -140,7 +140,7 @@ public IRubyObject interpret(ThreadContext context, Block block, IRubyObject sel
// Init profiling this scope
boolean debug = IRRuntimeHelpers.isDebug();
boolean profile = IRRuntimeHelpers.inProfileMode();
if (profile) Profiler.initProfiling(interpreterContext);
if (profile) Profiler.initProfiling(interpreterContext.getScope());

// Enter the looooop!
while (ipc < n) {
Loading