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

Commits on Feb 19, 2015

  1. Copy the full SHA
    30f27a3 View commit details
  2. [Truffle] The size of the resulting array from Hash#{collect, map} sh…

    …ould be bound by the number of hash entries.
    nirvdrum committed Feb 19, 2015
    2
    Copy the full SHA
    169a9e3 View commit details
Original file line number Diff line number Diff line change
@@ -879,8 +879,7 @@ public RubyArray mapPackedArray(VirtualFrame frame, RubyHash hash, RubyProc bloc
final Object[] store = (Object[]) hash.getStore();
final int size = hash.getSize();

final int resultSize = store.length / 2;
final Object[] result = new Object[resultSize];
final Object[] result = new Object[size];

int count = 0;

@@ -902,7 +901,7 @@ public RubyArray mapPackedArray(VirtualFrame frame, RubyHash hash, RubyProc bloc
}
}

return new RubyArray(getContext().getCoreLibrary().getArrayClass(), result, resultSize);
return new RubyArray(getContext().getCoreLibrary().getArrayClass(), result, size);
}

@Specialization(guards = "isBuckets")
Original file line number Diff line number Diff line change
@@ -541,7 +541,7 @@ public RubyClass getMetaClass(Object object) {
} else if (object instanceof Double) {
return floatClass;
} else if (object == null) {
throw new RuntimeException();
throw new RuntimeException("Can't get metaclass for null");
} else {
CompilerDirectives.transferToInterpreter();
throw new UnsupportedOperationException(String.format("Don't know how to get the metaclass for %s", object.getClass()));