-
-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into non-indy-jit
Conflicts: core/src/main/java/org/jruby/ir/targets/JVMVisitor.java
- 9.4.12.0
- 9.4.11.0
- 9.4.10.0
- 9.4.9.0
- 9.4.8.0
- 9.4.7.0
- 9.4.6.0
- 9.4.5.0
- 9.4.4.0
- 9.4.3.0
- 9.4.2.0
- 9.4.1.0
- 9.4.0.0
- 9.3.15.0
- 9.3.14.0
- 9.3.13.0
- 9.3.12.0
- 9.3.11.0
- 9.3.10.0
- 9.3.9.0
- 9.3.8.0
- 9.3.7.0
- 9.3.6.0
- 9.3.5.0
- 9.3.4.0
- 9.3.3.0
- 9.3.2.0
- 9.3.1.0
- 9.3.0.0
- 9.2.21.0
- 9.2.20.1
- 9.2.20.0
- 9.2.19.0
- 9.2.18.0
- 9.2.17.0
- 9.2.16.0
- 9.2.15.0
- 9.2.14.0
- 9.2.13.0
- 9.2.12.0
- 9.2.11.1
- 9.2.11.0
- 9.2.10.0
- 9.2.9.0
- 9.2.8.0
- 9.2.7.0
- 9.2.6.0
- 9.2.5.0
- 9.2.4.1
- 9.2.4.0
- 9.2.3.0
- 9.2.2.0
- 9.2.1.0
- 9.2.0.0
- 9.1.17.0
- 9.1.16.0
- 9.1.15.0
- 9.1.14.0
- 9.1.13.0
- 9.1.12.0
- 9.1.11.0
- 9.1.10.0
- 9.1.9.0
- 9.1.8.0
- 9.1.7.0
- 9.1.6.0
- 9.1.5.0
- 9.1.4.0
- 9.1.3.0
- 9.1.2.0
- 9.1.1.0
- 9.1.0.0
- 9.0.5.0
- 9.0.4.0
- 9.0.3.0
- 9.0.1.0
- 9.0.0.0
- 9.0.0.0.rc2
- 9.0.0.0.rc1
- 9.0.0.0.pre2
- 9.0.0.0.pre1
Showing
35 changed files
with
484 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
core/src/main/java/org/jruby/ir/instructions/InterpreterPrologInstr.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
core/src/main/java/org/jruby/ir/operands/InterpreterContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package org.jruby.ir.operands; | ||
|
||
import java.util.EnumSet; | ||
import java.util.List; | ||
import org.jruby.ir.IRFlags; | ||
import org.jruby.ir.instructions.Instr; | ||
import org.jruby.ir.transformations.inlining.CloneInfo; | ||
|
||
/** | ||
* | ||
*/ | ||
public class InterpreterContext extends Operand { | ||
private int temporaryVariablecount; | ||
private int temporaryBooleanVariablecount; | ||
private int temporaryFixnumVariablecount; | ||
private int temporaryFloatVariablecount; | ||
|
||
private EnumSet<IRFlags> flags; | ||
|
||
private Instr[] instructions; | ||
|
||
public InterpreterContext(int temporaryVariablecount, int temporaryBooleanVariablecount, | ||
int temporaryFixnumVariablecount, int temporaryFloatVariablecount, | ||
EnumSet<IRFlags> flags, Instr[] instructions) { | ||
super(null); | ||
|
||
this.temporaryVariablecount = temporaryVariablecount; | ||
this.temporaryBooleanVariablecount = temporaryBooleanVariablecount; | ||
this.temporaryFixnumVariablecount = temporaryFixnumVariablecount; | ||
this.temporaryFloatVariablecount = temporaryFloatVariablecount; | ||
this.flags = flags; | ||
this.instructions = instructions; | ||
} | ||
|
||
@Override | ||
public void addUsedVariables(List<Variable> l) {} | ||
|
||
@Override | ||
public Operand cloneForInlining(CloneInfo ii) { | ||
throw new IllegalStateException("Should not clone interp context"); | ||
} | ||
|
||
|
||
public int getTemporaryVariablecount() { | ||
return temporaryVariablecount; | ||
} | ||
|
||
public int getTemporaryBooleanVariablecount() { | ||
return temporaryBooleanVariablecount; | ||
} | ||
|
||
public int getTemporaryFixnumVariablecount() { | ||
return temporaryFixnumVariablecount; | ||
} | ||
|
||
public int getTemporaryFloatVariablecount() { | ||
return temporaryFloatVariablecount; | ||
} | ||
|
||
public EnumSet<IRFlags> getFlags() { | ||
return flags; | ||
} | ||
|
||
public Instr[] getInstructions() { | ||
return instructions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
PETests.tests do | ||
|
||
describe "A small Array" do | ||
|
||
example "indexed by a constant" do | ||
array = [3, 1, 2] | ||
truffle_assert_constant array[1] | ||
end | ||
|
||
example "sorted and indexed" do | ||
array = [3, 1, 2] | ||
sorted = array.sort | ||
truffle_assert_constant sorted[1] | ||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
PETests.tests do | ||
|
||
describe "A small Hash" do | ||
|
||
example "indexed by a constant" do | ||
hash = {a: 0, b: 1, c: 2} | ||
truffle_assert_constant hash[:b] | ||
end | ||
|
||
example "mapped to an Array and indexed by a constant" do | ||
hash = {a: 0, b: 1, c: 2} | ||
array = hash.map { |k, v| v } | ||
truffle_assert_constant array[0] | ||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module KernelSetTraceFuncFixtures | ||
|
||
def self.method_with_many_lines(a, b) | ||
x = a | ||
y = b | ||
z = x + y | ||
z | ||
end | ||
|
||
end | ||
|
||
PETests.tests do | ||
|
||
describe "Kernel" do | ||
|
||
describe "set_trace_func" do | ||
|
||
begin | ||
set_trace_func proc { |event, file, line, id, binding, classname| | ||
} | ||
|
||
broken_example "still has Fixnum#+ Fixnum" do | ||
truffle_assert_constant KernelSetTraceFuncFixtures.method_with_many_lines(14, 2) | ||
end | ||
ensure | ||
set_trace_func nil | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module MetaprogrammingFixtures | ||
|
||
class MethodMissing | ||
|
||
def method_missing(method, *args) | ||
14 | ||
end | ||
|
||
end | ||
|
||
class ClassWithExistingMethod | ||
|
||
def existing_method(a) | ||
a | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
PETests.tests do | ||
|
||
example "A call that results in #method_missing" do | ||
method_missing = MetaprogrammingFixtures::MethodMissing.new | ||
truffle_assert_constant method_missing.does_not_exist | ||
end | ||
|
||
example "#respond_to? on a method that does exist" do | ||
object_with_existing_method = MetaprogrammingFixtures::ClassWithExistingMethod.new | ||
truffle_assert_constant object_with_existing_method.respond_to? :existing_method | ||
end | ||
|
||
example "#send on a method that exists using a symbol" do | ||
object_with_existing_method = MetaprogrammingFixtures::ClassWithExistingMethod.new | ||
truffle_assert_constant object_with_existing_method.send(:existing_method, 14) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module PushingPixelsFixtures | ||
|
||
module Foo | ||
extend self | ||
|
||
def foo(a, b, c) | ||
hash = {a: a, b: b, c: c} | ||
array = hash.map { |k, v| v } | ||
x = array[0] | ||
y = [a, b, c].sort[1] | ||
x + y | ||
end | ||
|
||
end | ||
|
||
class Bar | ||
|
||
def method_missing(method, *args) | ||
if Foo.respond_to?(method) | ||
Foo.send(method, *args) | ||
else | ||
0 | ||
end | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
PETests.tests do | ||
|
||
example "A set of constants used in a literal hash, mapped to an array, indexed, used in an array literal, sorted, indexed, and added, all via method_missing, respond_to? and send" do | ||
bar = PushingPixelsFixtures::Bar.new | ||
truffle_assert_constant bar.foo(14, 8, 6) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters