Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
chakrashim: add warning for ignored engine flags
Browse files Browse the repository at this point in the history
* Added a warning for any ignored engine-specific flags.
* Added `--max-old-space-size=` to the list of ignored flags.

PR-URL: #502
Reviewed-By: Seth Brenith <[email protected]>
  • Loading branch information
kfarnung committed Mar 28, 2018
1 parent 4f6dd32 commit b405ded
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions deps/chakrashim/src/v8v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ static bool startsWith(const char* str, const char (&prefix)[N]) {
return strncmp(str, prefix, N - 1) == 0;
}




void V8::SetFlagsFromCommandLine(int *argc, char **argv, bool remove_flags) {
for (int i = 1; i < *argc; i++) {
// Note: Node now exits on invalid options. We may not recognize V8 flags
Expand All @@ -142,18 +139,24 @@ void V8::SetFlagsFromCommandLine(int *argc, char **argv, bool remove_flags) {
argv[i] = nullptr;
}
} else if (equals("--trace-debug-json", arg) ||
equals("--trace_debug_json", arg)) {
equals("--trace_debug_json", arg)) {
g_trace_debug_json = true;
if (remove_flags) {
argv[i] = nullptr;
}
} else if (remove_flags &&
(startsWith(
arg, "--debug") // Ignore some flags to reduce unit test noise
|| startsWith(arg, "--harmony")
|| startsWith(arg, "--stack-size=")
|| startsWith(arg, "--nolazy"))) {
argv[i] = nullptr;
} else if (startsWith(arg, "--debug") ||
startsWith(arg, "--harmony") ||
startsWith(arg, "--max-old-space-size=") ||
startsWith(arg, "--nolazy") ||
startsWith(arg, "--stack-size=")) {
// Ignore some flags to reduce compatibility issues. These flags don't
// have any functionality differences in ChakraCore and are generally
// invisible to the running code.
fprintf(stderr, "Warning: Ignored engine flag: %s\n", arg);

if (remove_flags) {
argv[i] = nullptr;
}
} else if (equals("--help", arg)) {
printf(
"Options:\n"
Expand Down

0 comments on commit b405ded

Please sign in to comment.