Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[truffle] Abstract away call arguments, so that we may pass extra stuff
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 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
15 changes: 15 additions & 0 deletions
15
src/vm/jvm/runtime/org/perl6/nqp/truffle/runtime/NQPArguments.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,15 @@ | ||
package org.perl6.nqp.truffle.runtime; | ||
public final class NQPArguments { | ||
public static final int RUNTIME_ARGUMENT_COUNT = 0; | ||
public static Object getUserArgument(Object[] arguments, int index) { | ||
return arguments[index + RUNTIME_ARGUMENT_COUNT]; | ||
} | ||
public static void setUserArgument(Object[] arguments, int index, Object value) { | ||
arguments[index + RUNTIME_ARGUMENT_COUNT] = value; | ||
} | ||
|
||
public static Object[] createInitial(int userArgumentCount) { | ||
Object[] result = new Object[RUNTIME_ARGUMENT_COUNT + userArgumentCount]; | ||
return result; | ||
} | ||
} |