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

Commits on Nov 12, 2014

  1. Copy the full SHA
    f1c23b8 View commit details
  2. Copy the full SHA
    0deb5e3 View commit details
  3. Copy the full SHA
    a302093 View commit details
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/targets/JVMVisitor.java
Original file line number Diff line number Diff line change
@@ -1631,7 +1631,7 @@ public void RuntimeHelperCall(RuntimeHelperCall runtimehelpercall) {
case CHECK_FOR_LJE:
jvmMethod().loadContext();
jvmLoadLocal(DYNAMIC_SCOPE);
jvmMethod().pushBoolean(((Boolean)runtimehelpercall.getArgs()[0]).isTrue());
jvmAdapter().ldc(((Boolean)runtimehelpercall.getArgs()[0]).isTrue());
jvmMethod().loadBlockType();
jvmAdapter().invokestatic(p(IRRuntimeHelpers.class), "checkForLJE", sig(void.class, ThreadContext.class, DynamicScope.class, boolean.class, Block.Type.class));
break;
5 changes: 5 additions & 0 deletions core/src/main/java/org/jruby/runtime/ObjectSpace.java
Original file line number Diff line number Diff line change
@@ -127,6 +127,11 @@ public void removeFinalizers(long id) {

public void add(IRubyObject object) {
if (true && object.getMetaClass() != null && !(object instanceof JavaProxy)) {
// If the object is already frozen when we encounter it, it's pre-frozen.
// Since this only (currently) applies to objects created outside the
// normal routes of construction, we don't show it in ObjectSpace.
if (object.isFrozen()) return;

getObjectGroup().add(object);
} else {
addIndividualWeakReference(object);
22 changes: 11 additions & 11 deletions core/src/test/java/org/jruby/test/TestObjectSpace.java
Original file line number Diff line number Diff line change
@@ -76,30 +76,30 @@ public void testIdentities() {
}

public void testObjectSpace() {
IRubyObject o1 = runtime.newFixnum(10);
IRubyObject o2 = runtime.newFixnum(20);
IRubyObject o3 = runtime.newFixnum(30);
IRubyObject o1 = runtime.newArray(10);
IRubyObject o2 = runtime.newArray(20);
IRubyObject o3 = runtime.newArray(30);
IRubyObject o4 = runtime.newString("hello");

target.add(o1);
target.add(o2);
target.add(o3);
target.add(o4);

List storedFixnums = new ArrayList(3);
storedFixnums.add(o1);
storedFixnums.add(o2);
storedFixnums.add(o3);
List storedArrays = new ArrayList(3);
storedArrays.add(o1);
storedArrays.add(o2);
storedArrays.add(o3);

Iterator strings = target.iterator(runtime.getString());
assertSame(o4, strings.next());
assertNull(strings.next());

Iterator numerics = target.iterator(runtime.getNumeric());
Iterator array = target.iterator(runtime.getArray());
for (int i = 0; i < 3; i++) {
Object item = numerics.next();
assertTrue(storedFixnums.contains(item));
Object item = array.next();
assertTrue(storedArrays.contains(item));
}
assertNull(numerics.next());
assertNull(array.next());
}
}
6 changes: 3 additions & 3 deletions spec/compiler/general_spec.rb
Original file line number Diff line number Diff line change
@@ -87,13 +87,13 @@ def compile_run(src, filename, line)
modes << InterpreterSpecUtils unless (ENV['INTERPRETER_TEST'] == 'false')
modes << JITSpecUtils unless (ENV['COMPILER_TEST'] == 'false')

Block = org.jruby.runtime.Block
IRubyObject = org.jruby.runtime.builtin.IRubyObject

modes.each do |mode|
describe "JRuby's #{mode.name}" do
include mode

Block = org.jruby.runtime.Block
IRubyObject = org.jruby.runtime.builtin.IRubyObject

it "assigns literal values to locals" do
run("a = 5; a") {|result| expect(result).to eq 5 }
run("a = 5.5; a") {|result| expect(result).to eq 5.5 }