doc/nashorn/DEVELOPER_README
changeset 47216 71c04702a3d5
parent 40219 b381e616c242
child 47366 cefe2083f3d1
equal deleted inserted replaced
47215:4ebc2e2fb97c 47216:71c04702a3d5
       
     1 This document describes system properties that are used for internal
       
     2 debugging and instrumentation purposes, along with the system loggers,
       
     3 which are used for the same thing.
       
     4 
       
     5 This document is intended as a developer resource, and it is not
       
     6 needed as Nashorn documentation for normal usage. Flags and system
       
     7 properties described herein are subject to change without notice.
       
     8 
       
     9 =====================================
       
    10 1. System properties used internally
       
    11 =====================================
       
    12 
       
    13 This documentation of the system property flags assume that the
       
    14 default value of the flag is false, unless otherwise specified.
       
    15 
       
    16 SYSTEM PROPERTY: -Dnashorn.args=<string>
       
    17 
       
    18 This property takes as its value a space separated list of Nashorn
       
    19 command line options that should be passed to Nashorn. This might be
       
    20 useful in environments where it is hard to tell how a nashorn.jar is
       
    21 launched.
       
    22 
       
    23 Example:
       
    24 
       
    25 > java -Dnashorn.args="--lazy-complation --log=compiler" large-java-app-with-nashorn.jar 
       
    26 > ant -Dnashorn.args="--log=codegen" antjob
       
    27 
       
    28 SYSTEM PROPERTY: -Dnashorn.args.prepend=<string>
       
    29 
       
    30 This property behaves like nashorn.args, but adds the given arguments
       
    31 before the existing ones instead of after them. Later arguments will
       
    32 overwrite earlier ones, so this is useful for setting default arguments
       
    33 that can be overwritten.
       
    34 
       
    35 
       
    36 SYSTEM PROPERTY: -Dnashorn.unstable.relink.threshold=x
       
    37 
       
    38 NOTE: This property is deprecated in favor of the 
       
    39 "--unstable-relink-threshold" command line option. It controls how many
       
    40 call site misses are allowed before a callsite is relinked with "apply"
       
    41 semantics to never change again. In the case of megamorphic callsites, 
       
    42 this is necessary, or the program would spend all its time swapping out 
       
    43 callsite targets. When neither the system property nor the command line
       
    44 option are specified, defaults to 8, or 16 with optimistic types turned
       
    45 on.
       
    46 
       
    47 
       
    48 SYSTEM PROPERTY: -Dnashorn.compiler.splitter.threshold=x
       
    49 
       
    50 This will change the node weight that requires a subgraph of the IR to
       
    51 be split into several classes in order not to run out of bytecode space.
       
    52 The default value is 0x8000 (32768).
       
    53 
       
    54 
       
    55 SYSTEM PROPERTY: -Dnashorn.serialize.compression=<x>
       
    56 
       
    57 This property sets the compression level used when deflating serialized
       
    58 AST structures of anonymous split functions. Valid values range from 0 to 9,
       
    59 the default value is 4. Higher values will reduce memory size of serialized
       
    60 AST but increase CPU usage required for compression.
       
    61 
       
    62 
       
    63 SYSTEM PROPERTY: -Dnashorn.codegen.debug.trace=<x>
       
    64 
       
    65 See the description of the codegen logger below.
       
    66 
       
    67 
       
    68 SYSTEM PROPERTY: -Dnashorn.fields.objects, -Dnashorn.fields.dual
       
    69 
       
    70 When the nashorn.fields.objects property is true, Nashorn will always
       
    71 use object fields for AccessorProperties, requiring boxing for all
       
    72 primitive property values. When nashorn.fields.dual is set, Nashorn
       
    73 will always use dual long/object fields, which allows primitives to be
       
    74 stored without boxing. When neither system property is set, Nashorn
       
    75 chooses a setting depending on the optimistic types setting (dual
       
    76 fields when optimistic types are enabled, object-only fields otherwise).
       
    77 
       
    78 With dual fields, Nashorn uses long fields to store primitive values.
       
    79 Ints are represented as the 32 low bits of the long fields. Doubles
       
    80 are represented as the doubleToLongBits of their value. This way a
       
    81 single field can be used for all primitive types. Packing and
       
    82 unpacking doubles to their bit representation is intrinsified by
       
    83 the JVM and extremely fast.
       
    84 
       
    85 In the future, this might complement or be replaced by experimental
       
    86 feature sun.misc.TaggedArray, which has been discussed on the mlvm
       
    87 mailing list. TaggedArrays are basically a way to share data space
       
    88 between primitives and references, and have the GC understand this.
       
    89 
       
    90 
       
    91 SYSTEM PROPERTY: -Dnashorn.compiler.symbol.trace=[<x>[,*]], 
       
    92   -Dnashorn.compiler.symbol.stacktrace=[<x>[,*]]
       
    93 
       
    94 When this property is set, creation and manipulation of any symbol
       
    95 named "x" will show information about when the compiler changes its
       
    96 type assumption, bytecode local variable slot assignment and other
       
    97 data. This is useful if, for example, a symbol shows up as an Object,
       
    98 when you believe it should be a primitive. Usually there is an
       
    99 explanation for this, for example that it exists in the global scope
       
   100 and type analysis has to be more conservative. 
       
   101 
       
   102 Several symbols names to watch can be specified by comma separation.
       
   103 
       
   104 If no variable name is specified (and no equals sign), all symbols
       
   105 will be watched
       
   106 
       
   107 By using "stacktrace" instead of or together with "trace", stack
       
   108 traces will be displayed upon symbol changes according to the same
       
   109 semantics.
       
   110 
       
   111 
       
   112 SYSTEM PROPERTY: -Dnashorn.lexer.xmlliterals
       
   113 
       
   114 If this property it set, it means that the Lexer should attempt to
       
   115 parse XML literals, which would otherwise generate syntax
       
   116 errors. Warning: there are currently no unit tests for this
       
   117 functionality.
       
   118 
       
   119 XML literals, when this is enabled, end up as standard LiteralNodes in
       
   120 the IR.
       
   121 
       
   122 
       
   123 SYSTEM_PROPERTY: -Dnashorn.debug
       
   124 
       
   125 If this property is set to true, Nashorn runs in Debug mode. Debug
       
   126 mode is slightly slower, as for example statistics counters are enabled
       
   127 during the run. Debug mode makes available a NativeDebug instance
       
   128 called "Debug" in the global space that can be used to print property
       
   129 maps and layout for script objects, as well as a "dumpCounters" method
       
   130 that will print the current values of the previously mentioned stats
       
   131 counters.
       
   132 
       
   133 These functions currently exists for Debug:
       
   134 
       
   135 "map" - print(Debug.map(x)) will dump the PropertyMap for object x to
       
   136 stdout (currently there also exist functions called "embedX", where X
       
   137 is a value from 0 to 3, that will dump the contents of the embed pool
       
   138 for the first spill properties in any script object and "spill", that
       
   139 will dump the contents of the growing spill pool of spill properties
       
   140 in any script object. This is of course subject to change without
       
   141 notice, should we change the script object layout.
       
   142 
       
   143 "methodHandle" - this method returns the method handle that is used
       
   144 for invoking a particular script function.
       
   145 
       
   146 "identical" - this method compares two script objects for reference
       
   147 equality. It is a == Java comparison
       
   148 
       
   149 "equals" - Returns true if two objects are either referentially
       
   150 identical or equal as defined by java.lang.Object.equals.
       
   151 
       
   152 "dumpCounters" - will dump the debug counters' current values to
       
   153 stdout.
       
   154 
       
   155 Currently we count number of ScriptObjects in the system, number of
       
   156 Scope objects in the system, number of ScriptObject listeners added,
       
   157 removed and dead (without references).
       
   158 
       
   159 We also count number of ScriptFunctions, ScriptFunction invocations
       
   160 and ScriptFunction allocations.
       
   161 
       
   162 Furthermore we count PropertyMap statistics: how many property maps
       
   163 exist, how many times were property maps cloned, how many times did
       
   164 the property map history cache hit, prevent new allocations, how many
       
   165 prototype invalidations were done, how many time the property map
       
   166 proto cache hit.
       
   167 
       
   168 Finally we count callsite misses on a per callsite bases, which occur
       
   169 when a callsite has to be relinked, due to a previous assumption of
       
   170 object layout being invalidated.
       
   171 
       
   172 "getContext" - return the current Nashorn context.
       
   173 
       
   174 "equalWithoutType" - Returns true if if the two objects are both
       
   175 property maps, and they have identical properties in the same order,
       
   176 but allows the properties to differ in their types.
       
   177 
       
   178 "diffPropertyMaps" Returns a diagnostic string representing the difference
       
   179 of two property maps.
       
   180 
       
   181 "getClass" - Returns the Java class of an object, or undefined if null.
       
   182 
       
   183 "toJavaString" - Returns the Java toString representation of an object.
       
   184 
       
   185 "toIdentString" - Returns a string representation of an object consisting
       
   186 of its java class name and hash code.
       
   187 
       
   188 "getListenerCount" - Return the number of property listeners for a
       
   189 script object.
       
   190 
       
   191 "getEventQueueCapacity" - Get the capacity of the event queue.
       
   192 
       
   193 "setEventQueueCapacity" - Set the event queue capacity.
       
   194 
       
   195 "addRuntimeEvent" - Add a runtime event to the runtime event queue.
       
   196 The queue has a fixed size (see -Dnashorn.runtime.event.queue.size)
       
   197 and the oldest entry will be thrown out of the queue is about to overflow.
       
   198 
       
   199 "expandEventQueueCapacity" - Expands the event queue capacity,
       
   200 or truncates if capacity is lower than current capacity. Then only
       
   201 the newest entries are kept.
       
   202 
       
   203 "clearRuntimeEvents" - Clear the runtime event queue.
       
   204 
       
   205 "removeRuntimeEvent" - Remove a specific runtime event from the event queue.
       
   206 
       
   207 "getRuntimeEvents" - Return all runtime events in the queue as an array.
       
   208 
       
   209 "getLastRuntimeEvent" - Return the last runtime event in the queue.
       
   210 
       
   211 
       
   212 SYSTEM PROPERTY: -Dnashorn.methodhandles.debug.stacktrace
       
   213 
       
   214 This enhances methodhandles logging (see below) to also dump the
       
   215 stack trace for every instrumented method handle operation.
       
   216 Warning: This is enormously verbose, but provides a pretty
       
   217 decent "grep:able" picture of where the calls are coming from.
       
   218 
       
   219 
       
   220 SYSTEM PROPERTY: -Dnashorn.cce
       
   221 
       
   222 Setting this system property causes the Nashorn linker to rely on
       
   223 ClassCastExceptions for triggering a callsite relink. If not set, the linker
       
   224 will add an explicit instanceof guard.
       
   225 
       
   226 
       
   227 SYSTEM PROPERTY: -Dnashorn.spill.threshold=<x>
       
   228 
       
   229 This property sets the number of fields in an object from which to use
       
   230 generic array based spill storage instead of Java fields. The default value
       
   231 is 256.
       
   232 
       
   233 
       
   234 SYSTEM PROPERTY: -Dnashorn.tcs.miss.samplePercent=<x>
       
   235 
       
   236 When running with the trace callsite option (-tcs), Nashorn will count
       
   237 and instrument any callsite misses that require relinking. As the
       
   238 number of relinks is large and usually produces a lot of output, this
       
   239 system property can be used to constrain the percentage of misses that
       
   240 should be logged. Typically this is set to 1 or 5 (percent). 1% is the
       
   241 default value.
       
   242 
       
   243 SYSTEM PROPERTY: -Dnashorn.persistent.code.cache
       
   244 
       
   245 This property can be used to set the directory where Nashorn stores
       
   246 serialized script classes generated with the -pcc/--persistent-code-cache
       
   247 option. The default directory name is "nashorn_code_cache".
       
   248 
       
   249 
       
   250 SYSTEM PROPERTY: -Dnashorn.typeInfo.maxFiles
       
   251 
       
   252 Maximum number of files to store in the type info cache. The type info cache
       
   253 is used to cache type data of JavaScript functions when running with
       
   254 optimistic types (-ot/--optimistic-types). There is one file per JavaScript
       
   255 function in the cache.
       
   256 
       
   257 The default value is 0 which means the feature is disabled. Setting this
       
   258 to something like 20000 is probably good enough for most applications and
       
   259 will usually cap the cache directory to about 80MB presuming a 4kB
       
   260 filesystem allocation unit. Set this to "unlimited" to run without limit.
       
   261 
       
   262 If the value is not 0 or "unlimited", Nashorn will spawn a cleanup thread
       
   263 that makes sure the number of files in the cache does not exceed the given
       
   264 value by deleting the least recently modified files.
       
   265 
       
   266 
       
   267 SYSTEM PROPERTY: -Dnashorn.typeInfo.cacheDir
       
   268 
       
   269 This property can be used to set the directory where Nashorn stores the
       
   270 type info cache when -Dnashorn.typeInfo.maxFiles is set to a nonzero
       
   271 value. The default location is platform specific. On Windows, it is
       
   272 "${java.io.tmpdir}\com.oracle.java.NashornTypeInfo". On Linux and
       
   273 Solaris it is "~/.cache/com.oracle.java.NashornTypeInfo". On Mac OS X,
       
   274 it is "~/Library/Caches/com.oracle.java.NashornTypeInfo".
       
   275 
       
   276 
       
   277 SYSTEM PROPERTY: -Dnashorn.typeInfo.cleanupDelaySeconds=<value>
       
   278 
       
   279 This sets the delay between cleanups of the typeInfo cache, in seconds.
       
   280 The default delay is 20 seconds.
       
   281 
       
   282 
       
   283 SYSTEM PROPERTY: -Dnashorn.profilefile=<filename>
       
   284 
       
   285 When running with the profile callsite options (-pcs), Nashorn will
       
   286 dump profiling data for all callsites to stderr as a shutdown hook. To
       
   287 instead redirect this to a file, specify the path to the file using
       
   288 this system property.
       
   289 
       
   290 
       
   291 SYSTEM_PROPERTY: -Dnashorn.regexp.impl=[jdk|joni]
       
   292 
       
   293 This property defines the regular expression engine to be used by
       
   294 Nashorn. Set this flag to "jdk" to get an implementation based on the
       
   295 JDK's java.util.regex package. Set this property to "joni" to install
       
   296 an implementation based on Joni, the regular expression engine used by
       
   297 the JRuby project. The default value for this flag is "joni"
       
   298 
       
   299 SYSTEM PROPERTY: -Dnashorn.runtime.event.queue.size=<value>
       
   300 
       
   301 Nashorn provides a fixed sized runtime event queue for debugging purposes.
       
   302 See -Dnashorn.debug for methods to access the event queue.
       
   303 The default value is 1024.
       
   304 
       
   305 SYSTEM PROPERTY: -Dnashorn.anonymous.classes.threshold=<value>
       
   306 
       
   307 Nashorn can use anonymous classes for loading compiled scripts, depending
       
   308 on the --anonymous-classes=[auto|true|false] option. Anonymous classes load
       
   309 faster, but the loaded classes get less optimization applied to them and
       
   310 therefore usually run slower. In the default "auto" setting, scripts are
       
   311 loaded as anonymous classes if the script size does not exceed 512 bytes.
       
   312 The above system property allows to set this threshold to a user defined
       
   313 value.
       
   314 
       
   315 ===============
       
   316 2. The loggers.
       
   317 ===============
       
   318 
       
   319 It is very simple to create your own logger. Use the DebugLogger class
       
   320 and give the subsystem name as a constructor argument.
       
   321 
       
   322 The Nashorn loggers can be used to print per-module or per-subsystem
       
   323 debug information with different levels of verbosity. The loggers for
       
   324 a given subsystem are available are enabled by using
       
   325 
       
   326 --log=<systemname>[:<level>]
       
   327 
       
   328 on the command line.
       
   329 
       
   330 Here <systemname> identifies the name of the subsystem to be logged
       
   331 and the optional colon and level argument is a standard
       
   332 java.util.logging.Level name (severe, warning, info, config, fine,
       
   333 finer, finest). If the level is left out for a particular subsystem,
       
   334 it defaults to "info". Any log message logged as the level or a level
       
   335 that is more important will be output to stderr by the logger.
       
   336 
       
   337 Several loggers can be enabled by a single command line option, by
       
   338 putting a comma after each subsystem/level tuple (or each subsystem if
       
   339 level is unspecified). The --log option can also be given multiple
       
   340 times on the same command line, with the same effect.
       
   341 
       
   342 For example: --log=codegen,fields:finest is equivalent to
       
   343 --log=codegen:info --log=fields:finest
       
   344 
       
   345 The following is an incomplete list of subsystems that currently
       
   346 support logging. Look for classes implementing
       
   347 jdk.nashorn.internal.runtime.logging.Loggable for more loggers.
       
   348 
       
   349 
       
   350 * compiler
       
   351 
       
   352 The compiler is in charge of turning source code and function nodes
       
   353 into byte code, and installs the classes into a class loader
       
   354 controlled from the Context. Log messages are, for example, about
       
   355 things like new compile units being allocated. The compiler has global
       
   356 settings that all the tiers of codegen (e.g. Lower and CodeGenerator)
       
   357 use.s
       
   358 
       
   359 
       
   360 * recompile
       
   361 
       
   362 This logger shows information about recompilation of scripts and
       
   363 functions at runtime. Recompilation may happen because a function
       
   364 was called with different parameter types, or because an optimistic
       
   365 assumption failed while executing a function with -ot/--optimistic-types.
       
   366 
       
   367 
       
   368 * codegen
       
   369 
       
   370 The code generator is the emitter stage of the code pipeline, and
       
   371 turns the lowest tier of a FunctionNode into bytecode. Codegen logging
       
   372 shows byte codes as they are being emitted, line number information
       
   373 and jumps. It also shows the contents of the bytecode stack prior to
       
   374 each instruction being emitted. This is a good debugging aid. For
       
   375 example:
       
   376 
       
   377 [codegen] #41                       line:2 (f)_afc824e 
       
   378 [codegen] #42                           load symbol x slot=2 
       
   379 [codegen] #43  {1:O}                    load int 0 
       
   380 [codegen] #44  {2:I O}                  dynamic_runtime_call GT:ZOI_I args=2 returnType=boolean 
       
   381 [codegen] #45                              signature (Ljava/lang/Object;I)Z 
       
   382 [codegen] #46  {1:Z}                    ifeq  ternary_false_5402fe28 
       
   383 [codegen] #47                           load symbol x slot=2 
       
   384 [codegen] #48  {1:O}                    goto ternary_exit_107c1f2f 
       
   385 [codegen] #49                       ternary_false_5402fe28 
       
   386 [codegen] #50                           load symbol x slot=2 
       
   387 [codegen] #51  {1:O}                    convert object -> double 
       
   388 [codegen] #52  {1:D}                    neg 
       
   389 [codegen] #53  {1:D}                    convert double -> object 
       
   390 [codegen] #54  {1:O}                ternary_exit_107c1f2f 
       
   391 [codegen] #55  {1:O}                    return object 
       
   392 
       
   393 shows a ternary node being generated for the sequence "return x > 0 ?
       
   394 x : -x"
       
   395 
       
   396 The first number on the log line is a unique monotonically increasing
       
   397 emission id per bytecode. There is no guarantee this is the same id
       
   398 between runs.  depending on non deterministic code
       
   399 execution/compilation, but for small applications it usually is. If
       
   400 the system variable -Dnashorn.codegen.debug.trace=<x> is set, where x
       
   401 is a bytecode emission id, a stack trace will be shown as the
       
   402 particular bytecode is about to be emitted. This can be a quick way to
       
   403 determine where it comes from without attaching the debugger. "Who
       
   404 generated that neg?"
       
   405 
       
   406 The --log=codegen option is equivalent to setting the system variable
       
   407 "nashorn.codegen.debug" to true.
       
   408 
       
   409 * fold
       
   410 
       
   411 Shows constant folding taking place before lowering
       
   412 
       
   413 * lower
       
   414 
       
   415 This is the first lowering pass.
       
   416 
       
   417 Lower is a code generation pass that turns high level IR nodes into
       
   418 lower level one, for example substituting comparisons to RuntimeNodes
       
   419 and inlining finally blocks.
       
   420 
       
   421 Lower is also responsible for determining control flow information
       
   422 like end points.
       
   423 
       
   424 * symbols
       
   425 
       
   426 The symbols logger tracks the assignment os symbols to identifiers.
       
   427 
       
   428 * scopedepths
       
   429 
       
   430 This logs the calculation of scope depths for non-local symbols.
       
   431 
       
   432 * fields
       
   433 
       
   434 The --log=fields option (at info level) is equivalent to setting the
       
   435 system variable "nashorn.fields.debug" to true. At the info level it
       
   436 will only show info about type assumptions that were invalidated. If
       
   437 the level is set to finest, it will also trace every AccessorProperty
       
   438 getter and setter in the program, show arguments, return values
       
   439 etc. It will also show the internal representation of respective field
       
   440 (Object in the normal case, unless running with the dual field
       
   441 representation)
       
   442 
       
   443 * time
       
   444 
       
   445 This enables timers for various phases of script compilation. The timers
       
   446 will be dumped when the Nashorn process exits. We see a percentage value
       
   447 of how much time was spent not executing bytecode (i.e. compilation and
       
   448 internal tasks) at the end of the report. 
       
   449 
       
   450 A finer level than "info" will show individual compilation timings as they
       
   451 happen.
       
   452 
       
   453 Here is an example:
       
   454 
       
   455 [time] Accumulated complation phase Timings:
       
   456 [time] 
       
   457 [time] 'JavaScript Parsing'              1076 ms
       
   458 [time] 'Constant Folding'                 159 ms
       
   459 [time] 'Control Flow Lowering'            303 ms
       
   460 [time] 'Program Point Calculation'        282 ms
       
   461 [time] 'Builtin Replacement'               71 ms
       
   462 [time] 'Code Splitting'                   670 ms
       
   463 [time] 'Symbol Assignment'                474 ms
       
   464 [time] 'Scope Depth Computation'          249 ms
       
   465 [time] 'Optimistic Type Assignment'       186 ms
       
   466 [time] 'Local Variable Type Calculation'  526 ms
       
   467 [time] 'Bytecode Generation'             5177 ms
       
   468 [time] 'Class Installation'              1854 ms
       
   469 [time] 
       
   470 [time] Total runtime: 11994 ms (Non-runtime: 11027 ms [91%])
       
   471 
       
   472 * methodhandles
       
   473 
       
   474 If this logger is enabled, each MethodHandle related call that uses
       
   475 the java.lang.invoke package gets its MethodHandle intercepted and an
       
   476 instrumentation printout of arguments and return value appended to
       
   477 it. This shows exactly which method handles are executed and from
       
   478 where. (Also MethodTypes and SwitchPoints).
       
   479 
       
   480 * classcache
       
   481 
       
   482 This logger shows information about reusing code classes using the
       
   483 in-memory class cache. Nashorn will try to avoid compilation of
       
   484 scripts by using existing classes. This can significantly improve
       
   485 performance when repeatedly evaluating the same script.
       
   486 
       
   487 =======================
       
   488 3. Undocumented options
       
   489 =======================
       
   490 
       
   491 Here follows a short description of undocumented options for Nashorn.
       
   492 To see a list of all undocumented options, use the (undocumented) flag
       
   493 "-xhelp".
       
   494 
       
   495 i.e. jjs -xhelp or java -jar nashorn.jar -xhelp
       
   496 
       
   497 Undocumented options are not guaranteed to work, run correctly or be
       
   498 bug free. They are experimental and for internal or debugging use.
       
   499 They are also subject to change without notice.
       
   500 
       
   501 In practice, though, all options below not explicitly documented as
       
   502 EXPERIMENTAL can be relied upon, for example --dump-on-error is useful
       
   503 for any JavaScript/Nashorn developer, but there is no guarantee.
       
   504 
       
   505 A short summary follows:
       
   506 
       
   507 	-D (-Dname=value. Set a system property. This option can be repeated.)
       
   508 
       
   509 	-ccs, --class-cache-size (Size of the Class cache size per global scope.)
       
   510 
       
   511 	-cp, -classpath (-cp path. Specify where to find user class files.)
       
   512 
       
   513 	-co, --compile-only (Compile without running.)
       
   514 		param: [true|false]   default: false
       
   515 
       
   516 	-d, --dump-debug-dir (specify a destination directory to dump class files.)
       
   517 		param: <path>   
       
   518 
       
   519 	--debug-lines (Generate line number table in .class files.)
       
   520 		param: [true|false]   default: true
       
   521 
       
   522 	--debug-locals (Generate local variable table in .class files.)
       
   523 		param: [true|false]   default: false
       
   524 
       
   525 	-doe, -dump-on-error (Dump a stack trace on errors.)
       
   526 		param: [true|false]   default: false
       
   527 
       
   528 	--early-lvalue-error (invalid lvalue expressions should be reported as early errors.)
       
   529 		param: [true|false]   default: true
       
   530 
       
   531 	--empty-statements (Preserve empty statements in AST.)
       
   532 		param: [true|false]   default: false
       
   533 
       
   534 	-fv, -fullversion (Print full version info of Nashorn.)
       
   535 		param: [true|false]   default: false
       
   536 
       
   537 	--function-statement-error (Report an error when function declaration is used as a statement.)
       
   538 		param: [true|false]   default: false
       
   539 
       
   540 	--function-statement-warning (Warn when function declaration is used as a statement.)
       
   541 		param: [true|false]   default: false
       
   542 
       
   543 	-fx (Launch script as an fx application.)
       
   544 		param: [true|false]   default: false
       
   545 
       
   546 	--global-per-engine (Use single Global instance per script engine instance.)
       
   547 		param: [true|false]   default: false
       
   548 
       
   549 	-h, -help (Print help for command line flags.)
       
   550 		param: [true|false]   default: false
       
   551 
       
   552 	--loader-per-compile (Create a new class loader per compile.)
       
   553 		param: [true|false]   default: true
       
   554 
       
   555 	-l, --locale (Set Locale for script execution.)
       
   556 		param: <locale>   default: en-US
       
   557 
       
   558 	--log (Enable logging of a given level for a given number of sub systems. 
       
   559 	      [for example: --log=fields:finest,codegen:info].)
       
   560 		param: <module:level>,*   
       
   561 
       
   562 	-nj, --no-java (Disable Java support.)
       
   563 		param: [true|false]   default: false
       
   564 
       
   565 	-nse, --no-syntax-extensions (Disallow non-standard syntax extensions.)
       
   566 		param: [true|false]   default: false
       
   567 
       
   568 	-nta, --no-typed-arrays (Disable typed arrays support.)
       
   569 		param: [true|false]   default: false
       
   570 
       
   571 	--parse-only (Parse without compiling.)
       
   572 		param: [true|false]   default: false
       
   573 
       
   574 	--print-ast (Print abstract syntax tree.)
       
   575 		param: [true|false]   default: false
       
   576 
       
   577 	-pc, --print-code (Print generated bytecode. If a directory is specified, nothing will 
       
   578 	                  be dumped to stderr. Also, in that case, .dot files will be generated 
       
   579 	                  for all functions or for the function with the specified name only.)
       
   580 		param: [dir:<output-dir>,function:<name>]   
       
   581 
       
   582 	--print-lower-ast (Print lowered abstract syntax tree.)
       
   583 		param: [true|false]   default: false
       
   584 
       
   585 	-plp, --print-lower-parse (Print the parse tree after lowering.)
       
   586 		param: [true|false]   default: false
       
   587 
       
   588 	--print-mem-usage (Print memory usage of IR after each compile stage.)
       
   589 		param: [true|false]   default: false
       
   590 
       
   591 	--print-no-newline (Print function will not print new line char.)
       
   592 		param: [true|false]   default: false
       
   593 
       
   594 	-pp, --print-parse (Print the parse tree.)
       
   595 		param: [true|false]   default: false
       
   596 
       
   597 	--print-symbols (Print the symbol table.)
       
   598 		param: [true|false]   default: false
       
   599 
       
   600 	-pcs, --profile-callsites (Dump callsite profile data.)
       
   601 		param: [true|false]   default: false
       
   602 
       
   603 	-scripting (Enable scripting features.)
       
   604 		param: [true|false]   default: false
       
   605 
       
   606 	--stderr (Redirect stderr to a filename or to another tty, e.g. stdout.)
       
   607 		param: <output console>   
       
   608 
       
   609 	--stdout (Redirect stdout to a filename or to another tty, e.g. stderr.)
       
   610 		param: <output console>   
       
   611 
       
   612 	-strict (Run scripts in strict mode.)
       
   613 		param: [true|false]   default: false
       
   614 
       
   615 	-t, -timezone (Set timezone for script execution.)
       
   616 		param: <timezone>   default: Europe/Stockholm
       
   617 
       
   618 	-tcs, --trace-callsites (Enable callsite trace mode. Options are: miss [trace callsite misses] 
       
   619 	                         enterexit [trace callsite enter/exit], objects [print object properties].)
       
   620 		param: [=[option,]*]   
       
   621 
       
   622 	-urt, --unstable-relink-threshold (Number of times a dynamic call site has to be relinked before it 
       
   623 	                                  is considered unstable, when the runtime will try to link it as 
       
   624 	                                  if it is megamorphic.)
       
   625 
       
   626 	--verify-code (Verify byte code before running.)
       
   627 		param: [true|false]   default: false
       
   628 
       
   629 	-v, -version (Print version info of Nashorn.)
       
   630 		param: [true|false]   default: false
       
   631 
       
   632 	-xhelp (Print extended help for command line flags.)
       
   633 		param: [true|false]   default: false
       
   634