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

Commits on Feb 19, 2015

  1. Copy the full SHA
    a7b2d94 View commit details
  2. Copy the full SHA
    c6b7f03 View commit details
2 changes: 1 addition & 1 deletion test/truffle/pe/pe.rb
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ def self.counter_example(description)
end

def self.broken_example(description)
describe "#{description} is not constant" do
describe "#{description} is constant" do
@warnings.push "broken example not run: #{full_description}"
end
end
Original file line number Diff line number Diff line change
@@ -10,9 +10,7 @@
package org.jruby.truffle.nodes.dispatch;

import com.oracle.truffle.api.Assumption;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.DirectCallNode;
import com.oracle.truffle.api.nodes.IndirectCallNode;
@@ -23,6 +21,7 @@
import org.jruby.truffle.runtime.core.RubyClass;
import org.jruby.truffle.runtime.core.RubyProc;
import org.jruby.truffle.runtime.methods.InternalMethod;
import org.jruby.truffle.runtime.util.ArrayUtils;
import org.jruby.util.cli.Options;

public class CachedBoxedMethodMissingDispatchNode extends CachedDispatchNode {
@@ -110,7 +109,7 @@ public Object executeDispatch(
final Object[] argumentsObjectsArray = (Object[]) argumentsObjects;
final Object[] modifiedArgumentsObjects = new Object[1 + argumentsObjectsArray.length];
modifiedArgumentsObjects[0] = getCachedNameAsSymbol();
RubyArguments.arraycopy(argumentsObjectsArray, 0, modifiedArgumentsObjects, 1, argumentsObjectsArray.length);
ArrayUtils.arraycopy(argumentsObjectsArray, 0, modifiedArgumentsObjects, 1, argumentsObjectsArray.length);

if (isIndirect()) {
return indirectCallNode.call(
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.IndirectCallNode;
import com.oracle.truffle.api.utilities.BranchProfile;
@@ -27,6 +26,7 @@
import org.jruby.truffle.runtime.core.RubyModule;
import org.jruby.truffle.runtime.core.RubyProc;
import org.jruby.truffle.runtime.methods.InternalMethod;
import org.jruby.truffle.runtime.util.ArrayUtils;

public class UncachedDispatchNode extends DispatchNode {

@@ -130,7 +130,7 @@ public Object executeDispatch(

modifiedArgumentsObjects[0] = toSymbolNode.executeRubySymbol(frame, name);

RubyArguments.arraycopy(argumentsObjectsArray, 0, modifiedArgumentsObjects, 1, argumentsObjectsArray.length);
ArrayUtils.arraycopy(argumentsObjectsArray, 0, modifiedArgumentsObjects, 1, argumentsObjectsArray.length);

return callNode.call(
frame,
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ public static Object[] pack(InternalMethod method, MaterializedFrame declaration
packed[DECLARATION_FRAME_INDEX] = declarationFrame;
packed[SELF_INDEX] = self;
packed[BLOCK_INDEX] = block;
arraycopy(arguments, 0, packed, RUNTIME_ARGUMENT_COUNT, arguments.length);
ArrayUtils.arraycopy(arguments, 0, packed, RUNTIME_ARGUMENT_COUNT, arguments.length);

return packed;
}
@@ -57,25 +57,6 @@ public static Object[] extractUserArguments(Object[] arguments) {
return ArrayUtils.extractRange(arguments, RUNTIME_ARGUMENT_COUNT, arguments.length);
}

public static Object[] concatUserArguments(Object o, Object[] arguments) {
final Object[] concatenatedArguments;

if (o instanceof Object[]) {
Object[] concatArray = (Object[]) o;
concatenatedArguments = new Object[concatArray.length + arguments.length - RUNTIME_ARGUMENT_COUNT];

arraycopy(concatArray, 0, concatenatedArguments, 0, concatArray.length);
arraycopy(arguments, RUNTIME_ARGUMENT_COUNT, concatenatedArguments, concatArray.length, getUserArgumentsCount(arguments));
} else {
concatenatedArguments = new Object[1 + arguments.length - RUNTIME_ARGUMENT_COUNT];

concatenatedArguments[0] = o;
arraycopy(arguments, RUNTIME_ARGUMENT_COUNT, concatenatedArguments, 1, getUserArgumentsCount(arguments));
}

return concatenatedArguments;
}

public static int getUserArgumentsCount(Object[] internalArguments) {
return internalArguments.length - RUNTIME_ARGUMENT_COUNT;
}
@@ -104,13 +85,6 @@ public static MaterializedFrame getDeclarationFrame(Object[] arguments) {
return (MaterializedFrame) arguments[DECLARATION_FRAME_INDEX];
}

@ExplodeLoop
public static void arraycopy(Object[] src, int srcPos, Object[] dest, int destPos, int length) {
for (int i = 0; i < length; i++) {
dest[destPos + i] = src[srcPos + i];
}
}

/**
* Get the declaration frame a certain number of levels up from the current frame, where the
* current frame is 0.
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@

import com.oracle.truffle.api.CompilerAsserts;

import com.oracle.truffle.api.nodes.ExplodeLoop;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.runtime.RubyArguments;

import java.lang.reflect.Array;
import java.util.Arrays;
@@ -291,7 +291,7 @@ public static void copy(Object source, Object[] destination, int destinationStar
destination[destinationStart + n] = unboxedSource[n];
}
} else if (source instanceof Object[]) {
RubyArguments.arraycopy((Object[]) source, 0, destination, destinationStart, length);
arraycopy((Object[]) source, 0, destination, destinationStart, length);
} else {
throw new UnsupportedOperationException();
}
@@ -321,4 +321,10 @@ public static int capacity(int current, int needed) {
}
}

@ExplodeLoop
public static void arraycopy(Object[] src, int srcPos, Object[] dest, int destPos, int length) {
for (int i = 0; i < length; i++) {
dest[destPos + i] = src[srcPos + i];
}
}
}