Skip to content
Snippets Groups Projects
Commit 27c5ae63 authored by Mick Jordan's avatar Mick Jordan
Browse files

Merge

parents 12ae06bf 33a51adf
Branches
No related tags found
No related merge requests found
......@@ -189,7 +189,8 @@ public final class RTruffleVisitor extends BasicVisitor<RNode> {
FormalArguments formals = FormalArguments.create(argumentNames, defaultValues);
String functionBody = func.getSource().getCode();
FunctionDefinitionNode rootNode = new FunctionDefinitionNode(func.getSource(), funcEnvironment, body, formals, functionBody.substring(0, Math.min(functionBody.length(), 50)), false);
FunctionDefinitionNode rootNode = new FunctionDefinitionNode(func.getSource(), funcEnvironment, body, formals, functionBody.substring(0, Math.min(functionBody.length(), 50)).replace("\n",
"\\n"), false);
callTarget = Truffle.getRuntime().createCallTarget(rootNode);
} catch (Throwable err) {
err.printStackTrace();
......
......@@ -287,6 +287,7 @@ public class ArgumentMatcher {
* @param <T> The type of the given arguments
* @return An array of type <T> with the supplied arguments in the correct order
*/
@SlowPath
private static <T> T[] permuteArguments(RFunction function, T[] suppliedArgs, String[] suppliedNames, FormalArguments formals, VarArgsFactory<T> listFactory, ArrayFactory<T> arrFactory,
SourceSection callSrc, SourceSection argsSrc) {
String[] formalNames = formals.getNames();
......@@ -785,7 +786,7 @@ public class ArgumentMatcher {
* {@link VarArgsFactory} implementation that returns varargs as <code>Object[]</code>.
*/
public static final class VarArgsAsObjectArrayFactory implements VarArgsFactory<Object> {
public Object makeList(final Object[] elements, final String[] names) {
public Object makeList(Object[] elements, String[] names) {
if (elements.length > 0) {
return new RArgsValuesAndNames(elements, names);
} else {
......@@ -814,7 +815,7 @@ public class ArgumentMatcher {
* {@link VarArgsAsObjectArrayNode}.
*/
public static final class VarArgsAsObjectArrayNodeFactory implements VarArgsFactory<RNode> {
public RNode makeList(final RNode[] elements, final String[] names) {
public RNode makeList(RNode[] elements, String[] names) {
if (elements.length > 0) {
return new VarArgsAsObjectArrayNode(elements, names);
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment