|
53 | 53 | import java.util.Properties; |
54 | 54 | import java.util.Set; |
55 | 55 |
|
56 | | -import com.oracle.truffle.tck.tests.TruffleTestAssumptions; |
57 | 56 | import org.graalvm.options.OptionCategory; |
58 | 57 | import org.graalvm.options.OptionDescriptors; |
59 | 58 | import org.graalvm.options.OptionKey; |
|
79 | 78 | import com.oracle.truffle.api.Option; |
80 | 79 | import com.oracle.truffle.api.Truffle; |
81 | 80 | import com.oracle.truffle.api.TruffleLanguage; |
| 81 | +import com.oracle.truffle.api.TruffleOptions; |
82 | 82 | import com.oracle.truffle.api.impl.DefaultTruffleRuntime; |
83 | 83 | import com.oracle.truffle.api.instrumentation.TruffleInstrument; |
| 84 | +import com.oracle.truffle.tck.tests.TruffleTestAssumptions; |
84 | 85 |
|
85 | 86 | @RunWith(Parameterized.class) |
86 | 87 | public class SandboxPolicyTest { |
@@ -128,10 +129,20 @@ public static void tearDownClass() { |
128 | 129 | } |
129 | 130 | } |
130 | 131 |
|
| 132 | + /** |
| 133 | + * A mirror of the method {@link SandboxInstrument#isInterpreterCallStackHeadRoomSupported()} |
| 134 | + * taking into account the possibility to run in polyglot isolate spawned form HotSpot. |
| 135 | + */ |
| 136 | + private static boolean isInterpreterCallStackHeadRoomSupported() { |
| 137 | + Runtime.Version jdkVersion = Runtime.version(); |
| 138 | + return (TruffleTestAssumptions.isIsolateEncapsulation() || TruffleOptions.AOT) && jdkVersion.feature() >= 23; |
| 139 | + } |
| 140 | + |
131 | 141 | @Before |
132 | 142 | public void setUp() { |
133 | 143 | Assume.assumeFalse("Restricted Truffle compiler options are specified on the command line.", |
134 | 144 | configuration.sandboxPolicy != SandboxPolicy.TRUSTED && executedWithXCompOptions()); |
| 145 | + Assume.assumeTrue(configuration.sandboxPolicy != SandboxPolicy.UNTRUSTED || isInterpreterCallStackHeadRoomSupported()); |
135 | 146 | } |
136 | 147 |
|
137 | 148 | private static boolean executedWithXCompOptions() { |
|
0 commit comments