1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
8 #include "src/globals.h"
13 // Declare all of our flags.
14 #define FLAG_MODE_DECLARE
15 #include "src/flag-definitions.h" // NOLINT
17 // The global list of all flags.
20 // The list of all flags with a value different from the default
21 // and their values. The format of the list is like the format of the
22 // argv array passed to the main function, e.g.
23 // ("--prof", "--log-file", "v8.prof", "--nolazy").
25 // The caller is responsible for disposing the list, as well
26 // as every element of it.
27 static List<const char*>* argv();
29 // Set the flag values by parsing the command line. If remove_flags is
30 // set, the flags and associated values are removed from (argc,
31 // argv). Returns 0 if no error occurred. Otherwise, returns the argv
32 // index > 0 for the argument where an error occurred. In that case,
33 // (argc, argv) will remain unchanged independent of the remove_flags
34 // value, and no assumptions about flag settings should be made.
36 // The following syntax for flags is accepted (both '-' and '--' are ok):
38 // --flag (bool flags only)
39 // --noflag (bool flags only)
40 // --flag=value (non-bool flags only, no spaces around '=')
41 // --flag value (non-bool flags only)
42 // -- (equivalent to --js_arguments, captures all remaining args)
43 static int SetFlagsFromCommandLine(int* argc,
47 // Set the flag values by parsing the string str. Splits string into argc
48 // substrings argv[], each of which consisting of non-white-space chars,
49 // and then calls SetFlagsFromCommandLine() and returns its result.
50 static int SetFlagsFromString(const char* str, int len);
52 // Reset all flags to their default value.
53 static void ResetAllFlags();
55 // Print help to stdout with flags, types, and default values.
56 static void PrintHelp();
58 // Set flags as consequence of being implied by another flag.
59 static void EnforceFlagImplications();
61 // Hash of current flags (to quickly determine flag changes).
62 static uint32_t Hash();
65 } } // namespace v8::internal