Skip to content

Commit

Permalink
[GR-7849] [GR-8810] Standalone native image should parse native/jvm o…
Browse files Browse the repository at this point in the history
…ptions.

PullRequest: graal/1227
  • Loading branch information
pitr-ch committed Mar 27, 2018
2 parents 1011454 + 48f8fa6 commit 61e981d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ final void launch(List<String> args, Map<String, String> defaultOptions, boolean

List<String> unrecognizedArgs = preprocessArguments(args, polyglotOptions);

if (isAOT() && doNativeSetup && IN_GRAALVM) {
if (isAOT() && doNativeSetup) {
assert nativeAccess != null;
nativeAccess.maybeExec(args, false, polyglotOptions, getDefaultVMType());
nativeAccess.maybeExec(args, false, polyglotOptions, getDefaultVMType(), IN_GRAALVM);
}

for (String arg : unrecognizedArgs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ private static void printInstruments(Engine engine, boolean printWhenEmpty) {
}

class Native {
void maybeExec(List<String> args, boolean isPolyglot, Map<String, String> polyglotOptions, VMType defaultVmType) {
void maybeExec(List<String> args, boolean isPolyglot, Map<String, String> polyglotOptions, VMType defaultVmType, boolean allowExec) {
assert isAOT();
VMType vmType = null;
boolean polyglot = false;
Expand Down Expand Up @@ -983,9 +983,15 @@ void maybeExec(List<String> args, boolean isPolyglot, Map<String, String> polygl
if (!isPolyglot && polyglot) {
remainingArgs.add(0, "--polyglot");
}
if (!allowExec) {
abort("--jvm.* options not supported");
}
execJVM(jvmArgs, remainingArgs, polyglotOptions);
} else if (!isPolyglot && polyglot) {
assert jvmArgs.isEmpty();
if (!allowExec) {
abort("--polyglot option not supported");
}
execNativePolyglot(remainingArgs, polyglotOptions);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected static void printVersion(Engine engine) {
private void launch(String[] args) {
List<String> arguments = new ArrayList<>(Arrays.asList(args));
if (isAOT()) {
nativeAccess.maybeExec(arguments, true, Collections.emptyMap(), VMType.Native);
nativeAccess.maybeExec(arguments, true, Collections.emptyMap(), VMType.Native, true);
nativeAccess.setGraalVMProperties();
}

Expand Down

0 comments on commit 61e981d

Please sign in to comment.