|
22 | 22 | */ |
23 | 23 | package com.oracle.truffle.r.runtime.context; |
24 | 24 |
|
| 25 | +import static com.oracle.truffle.r.runtime.context.FastROptions.EagerEval; |
| 26 | +import static com.oracle.truffle.r.runtime.context.FastROptions.EagerEvalConstants; |
| 27 | +import static com.oracle.truffle.r.runtime.context.FastROptions.EagerEvalDefault; |
| 28 | +import static com.oracle.truffle.r.runtime.context.FastROptions.EagerEvalExpressions; |
| 29 | +import static com.oracle.truffle.r.runtime.context.FastROptions.EagerEvalVariables; |
| 30 | + |
25 | 31 | import java.io.IOException; |
26 | 32 | import java.io.InputStream; |
27 | 33 | import java.io.OutputStream; |
|
46 | 52 | import java.util.function.Consumer; |
47 | 53 | import java.util.function.Supplier; |
48 | 54 |
|
| 55 | +import org.graalvm.options.OptionKey; |
| 56 | + |
49 | 57 | import com.oracle.truffle.api.Assumption; |
| 58 | +import com.oracle.truffle.api.CompilerDirectives; |
50 | 59 | import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; |
51 | 60 | import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; |
52 | 61 | import com.oracle.truffle.api.RootCallTarget; |
|
67 | 76 | import com.oracle.truffle.api.source.Source; |
68 | 77 | import com.oracle.truffle.r.launcher.RCmdOptions; |
69 | 78 | import com.oracle.truffle.r.launcher.RStartParams; |
70 | | -import static com.oracle.truffle.r.runtime.context.FastROptions.EagerEval; |
71 | | -import static com.oracle.truffle.r.runtime.context.FastROptions.EagerEvalConstants; |
72 | | -import static com.oracle.truffle.r.runtime.context.FastROptions.EagerEvalDefault; |
73 | | -import static com.oracle.truffle.r.runtime.context.FastROptions.EagerEvalExpressions; |
74 | | -import static com.oracle.truffle.r.runtime.context.FastROptions.EagerEvalVariables; |
75 | 79 | import com.oracle.truffle.r.runtime.LazyDBCache; |
76 | 80 | import com.oracle.truffle.r.runtime.PrimitiveMethodsInfo; |
77 | 81 | import com.oracle.truffle.r.runtime.REnvVars; |
|
106 | 110 | import com.oracle.truffle.r.runtime.nodes.RCodeBuilder; |
107 | 111 | import com.oracle.truffle.r.runtime.nodes.RSyntaxNode; |
108 | 112 | import com.oracle.truffle.r.runtime.rng.RRNG; |
109 | | -import org.graalvm.options.OptionKey; |
110 | 113 |
|
111 | 114 | /** |
112 | 115 | * Encapsulates the runtime state ("context") of an R session. All access to that state from the |
@@ -646,21 +649,17 @@ public int getNonNegativeIntOption(OptionKey<Integer> key) { |
646 | 649 | if (res >= 0) { |
647 | 650 | return res; |
648 | 651 | } |
649 | | - System.out.println("non negative integer option value expected"); |
650 | | - new RuntimeException().printStackTrace(); |
651 | | - System.exit(2); |
652 | | - return -1; |
| 652 | + CompilerDirectives.transferToInterpreter(); |
| 653 | + throw RInternalError.shouldNotReachHere(String.format("R option '%s' has invalid value")); |
653 | 654 | } |
654 | 655 |
|
655 | 656 | public double getNonNegativeDoubleOption(OptionKey<Double> key) { |
656 | 657 | double res = getOption(key); |
657 | 658 | if (res >= 0) { |
658 | 659 | return res; |
659 | 660 | } |
660 | | - System.out.println("non negative double option value expected"); |
661 | | - new RuntimeException().printStackTrace(); |
662 | | - System.exit(2); |
663 | | - return -1; |
| 661 | + CompilerDirectives.transferToInterpreter(); |
| 662 | + throw RInternalError.shouldNotReachHere(String.format("R option '%s' has invalid value")); |
664 | 663 | } |
665 | 664 |
|
666 | 665 | public boolean noEagerEvalOption() { |
|
0 commit comments