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: e8a6f28730bb
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ebc009dd9203
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on May 25, 2017

  1. Reduce n conseq. lines to the last one since it is impossible to rais…

    …e on all previous line num instrs. Motivation is to help reduce bytecode size a bit once JITd.
    enebo committed May 25, 2017
    Copy the full SHA
    3a68111 View commit details
  2. Copy the full SHA
    ebc009d View commit details
Showing with 23 additions and 12 deletions.
  1. +1 −1 VERSION
  2. +1 −1 core/pom.xml
  3. +18 −7 core/src/main/java/org/jruby/ir/IRBuilder.java
  4. +2 −2 lib/pom.xml
  5. +1 −1 pom.xml
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.1.10.0-SNAPSHOT
9.1.11.0-SNAPSHOT
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ DO NOT MODIFIY - GENERATED CODE
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.1.10.0-SNAPSHOT</version>
<version>9.1.11.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-core</artifactId>
<name>JRuby Core</name>
25 changes: 18 additions & 7 deletions core/src/main/java/org/jruby/ir/IRBuilder.java
Original file line number Diff line number Diff line change
@@ -280,6 +280,12 @@ public void cloneIntoHostScope(IRBuilder builder) {

private int _lastProcessedLineNum = -1;

// We do not need n consecutive line num instrs but only the last one in the sequence.
// We set this flag to indicate that we need to emit a line number but have not yet.
// addInstr will then appropriately add line info when it is called (which will never be
// called by a linenum instr).
private boolean needsLineNumInfo = false;

public boolean underscoreVariableSeen = false;

public IRLoop getCurrentLoop() {
@@ -313,6 +319,17 @@ public void addArgumentDescription(ArgumentType type, String name) {
}

public void addInstr(Instr instr) {
if (needsLineNumInfo) {
needsLineNumInfo = false;
addInstr(manager.newLineNumber(_lastProcessedLineNum));
if (RubyInstanceConfig.FULL_TRACE_ENABLED) {
addInstr(new TraceInstr(RubyEvent.LINE, methodNameFor(), getFileName(), _lastProcessedLineNum));
if (needsCodeCoverage()) {
addInstr(new TraceInstr(RubyEvent.COVERAGE, methodNameFor(), getFileName(), _lastProcessedLineNum));
}
}
}

// 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()) {
@@ -373,13 +390,7 @@ private Operand buildOperand(Variable result, Node node) throws NotCompilableExc
if (node.isNewline()) {
int currLineNum = node.getLine();
if (currLineNum != _lastProcessedLineNum) { // Do not emit multiple line number instrs for the same line
addInstr(manager.newLineNumber(currLineNum));
if (RubyInstanceConfig.FULL_TRACE_ENABLED) {
addInstr(new TraceInstr(RubyEvent.LINE, methodNameFor(), getFileName(), currLineNum));
if (needsCodeCoverage()) {
addInstr(new TraceInstr(RubyEvent.COVERAGE, methodNameFor(), getFileName(), currLineNum));
}
}
needsLineNumInfo = true;
_lastProcessedLineNum = currLineNum;
}
}
4 changes: 2 additions & 2 deletions lib/pom.xml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ DO NOT MODIFIY - GENERATED CODE
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.1.10.0-SNAPSHOT</version>
<version>9.1.11.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-stdlib</artifactId>
<name>JRuby Lib Setup</name>
@@ -28,7 +28,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-core</artifactId>
<version>9.1.10.0-SNAPSHOT</version>
<version>9.1.11.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ DO NOT MODIFIY - GENERATED CODE
</parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.1.10.0-SNAPSHOT</version>
<version>9.1.11.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JRuby</name>
<description>JRuby is the effort to recreate the Ruby (http://www.ruby-lang.org) interpreter in Java.</description>