Skip to content

Commit cad0d25

Browse files
committed
[Truffle] Allow seed to be configured for randomization.
1 parent a595f9d commit cad0d25

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

core/src/main/java/org/jruby/util/cli/Options.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ public class Options {
158158
public static final Option<Boolean> TRUFFLE_DISPATCH_METHODMISSING_ALWAYS_INLINED = bool(TRUFFLE, "truffle.call.method_missing_always_inlined", true, "Always inline #method_missing call targets.");
159159

160160
public static final Option<Boolean> TRUFFLE_RANDOMIZE_STORAGE_ARRAY = bool(TRUFFLE, "truffle.randomize_storage.array", false, "Randomize Array storage strategy.");
161+
public static final Option<Integer> TRUFFLE_RANDOMIZE_SEED = integer(TRUFFLE, "truffle.randomize.seed", 0, "Seed for any randomization.");
161162

162163
public static final Option<TruffleBridge.BacktraceFormatter> TRUFFLE_BACKTRACE_DISPLAY_FORMAT = enumeration(TRUFFLE, "truffle.backtrace.display_format", TruffleBridge.BacktraceFormatter.class, TruffleBridge.BacktraceFormatter.MRI, "How to format backtraces displayed to the user.");
163164
public static final Option<TruffleBridge.BacktraceFormatter> TRUFFLE_BACKTRACE_DEBUG_FORMAT = enumeration(TRUFFLE, "truffle.backtrace.debug_format", TruffleBridge.BacktraceFormatter.class, TruffleBridge.BacktraceFormatter.DEBUG, "How to format backtraces displayed using TruffleDebug.dump_call_stack.");

truffle/src/main/java/org/jruby/truffle/runtime/core/RubyArray.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public final class RubyArray extends RubyBasicObject {
3030
public static final int ARRAYS_SMALL = Options.TRUFFLE_ARRAYS_SMALL.load();
3131

3232
private static final boolean RANDOMIZE_STORAGE_ARRAY = Options.TRUFFLE_RANDOMIZE_STORAGE_ARRAY.load();
33-
private static final Random random = new Random(0);
33+
private static final Random random = new Random(Options.TRUFFLE_RANDOMIZE_SEED.load());
3434

3535
private final ArrayAllocationSite allocationSite;
3636
private Object store;

0 commit comments

Comments
 (0)