├── .gitignore ├── .jsdocrc ├── .travis.yml ├── LICENSE ├── README.md ├── binding.gyp ├── example ├── list-flags.js ├── meta.js ├── use-strict-violator.js └── use-strict.js ├── flags-0.10.md ├── flags-0.11.md ├── flags-0.8.md ├── index.js ├── package.json ├── scripts ├── comments │ ├── always_opt.md │ ├── always_osr.md │ ├── cache_prototype_transitions.md │ ├── check_elimination.md │ ├── code_comments.md │ ├── code_stats.md │ ├── compilation_cache.md │ ├── concurrent_sweeping.md │ ├── crankshaft.md │ ├── dead_code_elimination.md │ ├── debug_compile_events.md │ ├── debug_sim.md │ ├── debugger.md │ ├── debugger_agent.md │ ├── debugger_port.md │ ├── harmony_collections.md │ ├── harmony_modules.md │ ├── harmony_proxies.md │ ├── harmony_scope.md │ └── harmony_typeof.md ├── gen-flag-doc.js └── preinstall.js ├── src ├── implications.h ├── v8_flag_list.cc ├── v8_flags.cc └── v8_flags_meta.cc ├── test.sh ├── test ├── debug-only │ └── index.js ├── fixtures │ ├── allow_natives_syntax.js │ ├── always_opt.js │ ├── code_stats.js │ ├── expose_gc.js │ ├── harmony_collections.js │ ├── harmony_modules-exports.js │ ├── harmony_modules-imports.js │ ├── harmony_proxies.js │ ├── harmony_scoping.js │ └── harmony_typeof.js ├── implications.js ├── index.js └── reset-all-flags.js └── v8 ├── flag-definitions.3.11.10.h ├── flag-definitions.3.14.5.h └── flag-definitions.3.25.30.h /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | 10 | pids 11 | logs 12 | results 13 | 14 | npm-debug.log 15 | node_modules 16 | build 17 | .clang_complete 18 | .syntastic_c 19 | spike.js 20 | src/v8_flag_definitions.h 21 | -------------------------------------------------------------------------------- /.jsdocrc: -------------------------------------------------------------------------------- 1 | { 2 | "tags": { 3 | "allowUnknownTags": true 4 | }, 5 | "source": { 6 | "includePattern": ".+\\.js(doc)?$", 7 | "excludePattern": ".*node_modules" 8 | }, 9 | "plugins": [ "plugins/markdown" ], 10 | "markdown": { 11 | "parser": "gfm", 12 | "hardwrap": true 13 | }, 14 | "templates": { 15 | 16 | "cleverLinks" : true, 17 | "monospaceLinks" : false, 18 | "linenums" : true, 19 | "collapseSymbols" : false, 20 | 21 | "default": { 22 | "outputSourceFiles": false 23 | } 24 | }, 25 | "opts": { 26 | "recurse": false, 27 | "private": false 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.8" 4 | - "0.10" 5 | - "0.11" 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Thorsten Lorenz. 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # v8-flags [![build status](https://secure.travis-ci.org/thlorenz/v8-flags.png)](http://travis-ci.org/thlorenz/v8-flags) 2 | 3 | Configures v8 flags at runtime. 4 | 5 | ```js 6 | // use-strict-violator.js 7 | a = "I'm the trouble starter, punking instigator" 8 | 9 | module.exports = a; 10 | ``` 11 | 12 | ```js 13 | var flags = require('v8-flags').flags; 14 | console.log('inital use strict', flags.use_strict()); 15 | 16 | flags.use_strict(true); 17 | console.log('set use strict to', flags.use_strict()); 18 | 19 | try { 20 | require('./use-strict-violator'); 21 | } catch(err) { 22 | console.error('FAIL:', err); 23 | } 24 | 25 | flags.use_strict(false); 26 | console.log('set use strict to', flags.use_strict()); 27 | 28 | var violator = require('./use-strict-violator'); 29 | console.log(violator) 30 | ``` 31 | 32 | ``` 33 | inital use strict false 34 | set use strict to true 35 | FAIL: [ReferenceError: a is not defined] 36 | set use strict to false 37 | I'm the trouble starter, punking instigator 38 | ``` 39 | 40 | ## Installation 41 | 42 | npm install v8-flags 43 | 44 | ## Contributions 45 | 46 | I am doing my best to document each flag, but am hoping for others *especially the ones with insider knowledge* to supply useful comments. 47 | 48 | I made this as easy as possible, all you have to do is add/edit the `.md` file with the name of the flag in [this 49 | folder](https://github.com/thlorenz/v8-flags/tree/master/scripts/comments) and run `npm run flag-doc` to 50 | update all documentation with the added details. 51 | 52 | ## API 53 | 54 | The different versions of v8 and thus Node.js have different flags and therefore the API fluctuates somewhat between the 55 | versions. The API is generated on install to match the Node.js version you are using. 56 | 57 | The flags for the *currently* latest Node.js versions `0.8`, `0.10` and `0.11` are documented in the following 58 | locations: 59 | 60 | - [0.8](https://github.com/thlorenz/v8-flags/blob/master/flags-0.8.md) 61 | - [0.10](https://github.com/thlorenz/v8-flags/blob/master/flags-0.10.md) 62 | - [0.11](https://github.com/thlorenz/v8-flags/blob/master/flags-0.11.md) 63 | 64 | The below API allows to access and configure these flags. 65 | 66 | 67 | 68 | **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* 69 | 70 | - [enforceFlagImplications()](#enforceflagimplications) 71 | - [flags()](#flags) 72 | - [Example](#example) 73 | - [listFlags() → {Object}](#listflags--object) 74 | - [meta() → {Array.}](#meta--arrayobject) 75 | - [printHelp()](#printhelp) 76 | - [resetAllFlags()](#resetallflags) 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |

enforceFlagImplications()

95 |
96 |
97 |
98 |

Enforces all flag implications.

99 |
100 |
101 |
Source:
102 |
109 |
110 |
111 |
112 |

flags()

113 |
114 |
115 |
116 |

Exposes methods to get and set v8 flags.

117 |

Example

118 |
var flags = require('v8-flags').flags;
119 | console.log(flags.use_strict()); // false
120 | flags.use_strict(true)
121 | console.log(flags.use_strict()); // true
122 |
123 |
124 |
Source:
125 |
132 |
133 |
134 |
135 |

listFlags() → {Object}

136 |
137 |
138 |
139 |

Lists all flags along with their current value.

140 |
141 |
142 |
Source:
143 |
150 |
151 |
Returns:
152 |
153 |

key/value pair for each flag

154 |
155 |
156 |
157 | Type 158 |
159 |
160 | Object 161 |
162 |
163 |
164 |
165 |

meta() → {Array.<Object>}

166 |
167 |
168 |
169 |

The meta data for the flags.

170 |

It is initialized on startup from the definitions found in C++ land.

171 |
172 |
173 |
Source:
174 |
181 |
182 |
Returns:
183 |
184 |

array of objects with the folloing properties each

185 |
    186 |
  • name: flag name
  • 187 |
  • default: default setting of the flag
  • 188 |
  • type: type of the flag
  • 189 |
  • description: the description of the flag
  • 190 |
  • readonly: set true if flag cannot be set
  • 191 |
  • configurable: set true if setting the flag at runtime has the desired effect
  • 192 |
  • implications: flags that will be set to true whenever this flag is true and enforceFlagImplications is called
  • 193 |
  • negativeImplications: flags that will be set to false whenever this flag is false and enforceFlagImplications is called
  • 194 |
195 |
196 |
197 |
198 | Type 199 |
200 |
201 | Array.<Object> 202 |
203 |
204 |
205 |
206 |

printHelp()

207 |
208 |
209 |
210 |

Prints flag help to the console.

211 |
212 |
213 |
Source:
214 |
221 |
222 |
223 |
224 |

resetAllFlags()

225 |
226 |
227 |
228 |

Resets all flags to their default values

229 |
230 |
231 |
Source:
232 |
239 |
240 |
241 |
242 |
243 |
244 |
245 | 246 | *generated with [docme](https://github.com/thlorenz/docme)* 247 |
248 | 249 | 250 | ## License 251 | 252 | MIT 253 | -------------------------------------------------------------------------------- /binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'targets': [ 3 | { 4 | 'target_name': 'v8_flag_list', 5 | 'sources': [ 6 | 'src/v8_flag_list.cc' 7 | ], 8 | 'include_dirs': [ 9 | ' 2 | 3 | **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* 4 | 5 | - [use_strict `false` *{Boolean}*](#use_strict-false-boolean) 6 | - [es5_readonly `false` *{Boolean}*](#es5_readonly-false-boolean) 7 | - [es52_globals `false` *{Boolean}*](#es52_globals-false-boolean) 8 | - [harmony_typeof `false` *{Boolean}*](#harmony_typeof-false-boolean) 9 | - [Resources](#resources) 10 | - [harmony_scoping `false` *{Boolean}*](#harmony_scoping-false-boolean) 11 | - [harmony_modules `false` *{Boolean}*](#harmony_modules-false-boolean) 12 | - [Implications](#implications) 13 | - [References](#references) 14 | - [harmony_proxies `false` *{Boolean}*](#harmony_proxies-false-boolean) 15 | - [Resources](#resources-1) 16 | - [harmony_collections `false` *{Boolean}*](#harmony_collections-false-boolean) 17 | - [References](#references-1) 18 | - [harmony `false` *{Boolean}*](#harmony-false-boolean) 19 | - [Implications](#implications-1) 20 | - [packed_arrays `false` *{Boolean}*](#packed_arrays-false-boolean) 21 | - [smi_only_arrays `true` *{Boolean}*](#smi_only_arrays-true-boolean) 22 | - [clever_optimizations `true` *{Boolean}*](#clever_optimizations-true-boolean) 23 | - [unbox_double_arrays `true` *{Boolean}*](#unbox_double_arrays-true-boolean) 24 | - [string_slices `true` *{Boolean}*](#string_slices-true-boolean) 25 | - [crankshaft `true` *{Boolean}*](#crankshaft-true-boolean) 26 | - [Resources](#resources-2) 27 | - [hydrogen_filter `` *{String}*](#hydrogen_filter--string) 28 | - [use_range `true` *{Boolean}*](#use_range-true-boolean) 29 | - [eliminate_dead_phis `true` *{Boolean}*](#eliminate_dead_phis-true-boolean) 30 | - [use_gvn `true` *{Boolean}*](#use_gvn-true-boolean) 31 | - [use_canonicalizing `true` *{Boolean}*](#use_canonicalizing-true-boolean) 32 | - [use_inlining `true` *{Boolean}*](#use_inlining-true-boolean) 33 | - [max_inlined_source_size `600` *{Integer}*](#max_inlined_source_size-600-integer) 34 | - [max_inlined_nodes `196` *{Integer}*](#max_inlined_nodes-196-integer) 35 | - [max_inlined_nodes_cumulative `196` *{Integer}*](#max_inlined_nodes_cumulative-196-integer) 36 | - [loop_invariant_code_motion `true` *{Boolean}*](#loop_invariant_code_motion-true-boolean) 37 | - [collect_megamorphic_maps_from_stub_cache `true` *{Boolean}*](#collect_megamorphic_maps_from_stub_cache-true-boolean) 38 | - [hydrogen_stats `false` *{Boolean}*](#hydrogen_stats-false-boolean) 39 | - [trace_hydrogen `false` *{Boolean}*](#trace_hydrogen-false-boolean) 40 | - [trace_phase `Z` *{String}*](#trace_phase-z-string) 41 | - [trace_inlining `false` *{Boolean}*](#trace_inlining-false-boolean) 42 | - [trace_alloc `false` *{Boolean}*](#trace_alloc-false-boolean) 43 | - [trace_all_uses `false` *{Boolean}*](#trace_all_uses-false-boolean) 44 | - [trace_range `false` *{Boolean}*](#trace_range-false-boolean) 45 | - [trace_gvn `false` *{Boolean}*](#trace_gvn-false-boolean) 46 | - [trace_representation `false` *{Boolean}*](#trace_representation-false-boolean) 47 | - [stress_pointer_maps `false` *{Boolean}*](#stress_pointer_maps-false-boolean) 48 | - [stress_environments `false` *{Boolean}*](#stress_environments-false-boolean) 49 | - [deopt_every_n_times `0` *{Integer}*](#deopt_every_n_times-0-integer) 50 | - [trap_on_deopt `false` *{Boolean}*](#trap_on_deopt-false-boolean) 51 | - [deoptimize_uncommon_cases `true` *{Boolean}*](#deoptimize_uncommon_cases-true-boolean) 52 | - [polymorphic_inlining `true` *{Boolean}*](#polymorphic_inlining-true-boolean) 53 | - [use_osr `true` *{Boolean}*](#use_osr-true-boolean) 54 | - [array_bounds_checks_elimination `false` *{Boolean}*](#array_bounds_checks_elimination-false-boolean) 55 | - [array_index_dehoisting `false` *{Boolean}*](#array_index_dehoisting-false-boolean) 56 | - [trace_osr `false` *{Boolean}*](#trace_osr-false-boolean) 57 | - [stress_runs `0` *{Integer}*](#stress_runs-0-integer) 58 | - [optimize_closures `true` *{Boolean}*](#optimize_closures-true-boolean) 59 | - [inline_construct `true` *{Boolean}*](#inline_construct-true-boolean) 60 | - [inline_arguments `true` *{Boolean}*](#inline_arguments-true-boolean) 61 | - [loop_weight `1` *{Integer}*](#loop_weight-1-integer) 62 | - [optimize_for_in `true` *{Boolean}*](#optimize_for_in-true-boolean) 63 | - [experimental_profiler `true` *{Boolean}*](#experimental_profiler-true-boolean) 64 | - [Implications](#implications-2) 65 | - [watch_ic_patching `false` *{Boolean}*](#watch_ic_patching-false-boolean) 66 | - [frame_count `1` *{Integer}*](#frame_count-1-integer) 67 | - [self_optimization `false` *{Boolean}*](#self_optimization-false-boolean) 68 | - [direct_self_opt `false` *{Boolean}*](#direct_self_opt-false-boolean) 69 | - [retry_self_opt `false` *{Boolean}*](#retry_self_opt-false-boolean) 70 | - [count_based_interrupts `false` *{Boolean}*](#count_based_interrupts-false-boolean) 71 | - [interrupt_at_exit `false` *{Boolean}*](#interrupt_at_exit-false-boolean) 72 | - [weighted_back_edges `false` *{Boolean}*](#weighted_back_edges-false-boolean) 73 | - [interrupt_budget `5900` *{Integer}*](#interrupt_budget-5900-integer) 74 | - [type_info_threshold `15` *{Integer}*](#type_info_threshold-15-integer) 75 | - [self_opt_count `130` *{Integer}*](#self_opt_count-130-integer) 76 | - [trace_opt_verbose `false` *{Boolean}*](#trace_opt_verbose-false-boolean) 77 | - [Implications](#implications-3) 78 | - [debug_code `false` *{Boolean}*](#debug_code-false-boolean) 79 | - [code_comments `false` *{Boolean}*](#code_comments-false-boolean) 80 | - [Resources](#resources-3) 81 | - [enable_sse2 `true` *{Boolean}*](#enable_sse2-true-boolean) 82 | - [enable_sse3 `true` *{Boolean}*](#enable_sse3-true-boolean) 83 | - [enable_sse4_1 `true` *{Boolean}*](#enable_sse4_1-true-boolean) 84 | - [enable_cmov `true` *{Boolean}*](#enable_cmov-true-boolean) 85 | - [enable_rdtsc `true` *{Boolean}*](#enable_rdtsc-true-boolean) 86 | - [enable_sahf `true` *{Boolean}*](#enable_sahf-true-boolean) 87 | - [enable_vfp3 `true` *{Boolean}*](#enable_vfp3-true-boolean) 88 | - [enable_vfp2 `true` *{Boolean}*](#enable_vfp2-true-boolean) 89 | - [enable_armv7 `true` *{Boolean}*](#enable_armv7-true-boolean) 90 | - [enable_fpu `true` *{Boolean}*](#enable_fpu-true-boolean) 91 | - [expose_natives_as `undefined` *{String}*](#expose_natives_as-undefined-string) 92 | - [expose_debug_as `undefined` *{String}*](#expose_debug_as-undefined-string) 93 | - [expose_gc `false` *{Boolean}*](#expose_gc-false-boolean) 94 | - [expose_externalize_string `false` *{Boolean}*](#expose_externalize_string-false-boolean) 95 | - [stack_trace_limit `10` *{Integer}*](#stack_trace_limit-10-integer) 96 | - [builtins_in_stack_traces `false` *{Boolean}*](#builtins_in_stack_traces-false-boolean) 97 | - [disable_native_files `false` *{Boolean}*](#disable_native_files-false-boolean) 98 | - [inline_new `true` *{Boolean}*](#inline_new-true-boolean) 99 | - [stack_trace_on_abort `true` *{Boolean}*](#stack_trace_on_abort-true-boolean) 100 | - [trace `false` *{Boolean}*](#trace-false-boolean) 101 | - [mask_constants_with_cookie `true` *{Boolean}*](#mask_constants_with_cookie-true-boolean) 102 | - [lazy `true` *{Boolean}*](#lazy-true-boolean) 103 | - [trace_opt `false` *{Boolean}*](#trace_opt-false-boolean) 104 | - [trace_opt_stats `false` *{Boolean}*](#trace_opt_stats-false-boolean) 105 | - [opt `true` *{Boolean}*](#opt-true-boolean) 106 | - [always_opt `false` *{Boolean}*](#always_opt-false-boolean) 107 | - [prepare_always_opt `false` *{Boolean}*](#prepare_always_opt-false-boolean) 108 | - [trace_deopt `false` *{Boolean}*](#trace_deopt-false-boolean) 109 | - [min_preparse_length `1024` *{Integer}*](#min_preparse_length-1024-integer) 110 | - [always_full_compiler `false` *{Boolean}*](#always_full_compiler-false-boolean) 111 | - [trace_bailout `false` *{Boolean}*](#trace_bailout-false-boolean) 112 | - [compilation_cache `true` *{Boolean}*](#compilation_cache-true-boolean) 113 | - [Resources](#resources-4) 114 | - [cache_prototype_transitions `true` *{Boolean}*](#cache_prototype_transitions-true-boolean) 115 | - [Resources:](#resources) 116 | - [trace_debug_json `false` *{Boolean}*](#trace_debug_json-false-boolean) 117 | - [debugger_auto_break `true` *{Boolean}*](#debugger_auto_break-true-boolean) 118 | - [enable_liveedit `true` *{Boolean}*](#enable_liveedit-true-boolean) 119 | - [break_on_abort `true` *{Boolean}*](#break_on_abort-true-boolean) 120 | - [stack_size `984` *{Integer}*](#stack_size-984-integer) 121 | - [max_stack_trace_source_length `300` *{Integer}*](#max_stack_trace_source_length-300-integer) 122 | - [always_inline_smi_code `false` *{Boolean}*](#always_inline_smi_code-false-boolean) 123 | - [max_new_space_size `0` *{Integer}*](#max_new_space_size-0-integer) 124 | - [max_old_space_size `0` *{Integer}*](#max_old_space_size-0-integer) 125 | - [max_executable_size `0` *{Integer}*](#max_executable_size-0-integer) 126 | - [gc_global `false` *{Boolean}*](#gc_global-false-boolean) 127 | - [gc_interval `-1` *{Integer}*](#gc_interval--1-integer) 128 | - [trace_gc `false` *{Boolean}*](#trace_gc-false-boolean) 129 | - [trace_gc_nvp `false` *{Boolean}*](#trace_gc_nvp-false-boolean) 130 | - [print_cumulative_gc_stat `false` *{Boolean}*](#print_cumulative_gc_stat-false-boolean) 131 | - [trace_gc_verbose `false` *{Boolean}*](#trace_gc_verbose-false-boolean) 132 | - [trace_fragmentation `false` *{Boolean}*](#trace_fragmentation-false-boolean) 133 | - [collect_maps `true` *{Boolean}*](#collect_maps-true-boolean) 134 | - [flush_code `true` *{Boolean}*](#flush_code-true-boolean) 135 | - [incremental_marking `true` *{Boolean}*](#incremental_marking-true-boolean) 136 | - [incremental_marking_steps `true` *{Boolean}*](#incremental_marking_steps-true-boolean) 137 | - [trace_incremental_marking `false` *{Boolean}*](#trace_incremental_marking-false-boolean) 138 | - [use_idle_notification `true` *{Boolean}*](#use_idle_notification-true-boolean) 139 | - [send_idle_notification `false` *{Boolean}*](#send_idle_notification-false-boolean) 140 | - [use_ic `true` *{Boolean}*](#use_ic-true-boolean) 141 | - [native_code_counters `false` *{Boolean}*](#native_code_counters-false-boolean) 142 | - [always_compact `false` *{Boolean}*](#always_compact-false-boolean) 143 | - [lazy_sweeping `true` *{Boolean}*](#lazy_sweeping-true-boolean) 144 | - [never_compact `false` *{Boolean}*](#never_compact-false-boolean) 145 | - [compact_code_space `true` *{Boolean}*](#compact_code_space-true-boolean) 146 | - [cleanup_code_caches_at_gc `true` *{Boolean}*](#cleanup_code_caches_at_gc-true-boolean) 147 | - [random_seed `0` *{Integer}*](#random_seed-0-integer) 148 | - [use_verbose_printer `true` *{Boolean}*](#use_verbose_printer-true-boolean) 149 | - [allow_natives_syntax `false` *{Boolean}*](#allow_natives_syntax-false-boolean) 150 | - [trace_sim `false` *{Boolean}*](#trace_sim-false-boolean) 151 | - [check_icache `false` *{Boolean}*](#check_icache-false-boolean) 152 | - [stop_sim_at `0` *{Integer}*](#stop_sim_at-0-integer) 153 | - [sim_stack_alignment `8` *{Integer}*](#sim_stack_alignment-8-integer) 154 | - [trace_exception `false` *{Boolean}*](#trace_exception-false-boolean) 155 | - [preallocate_message_memory `false` *{Boolean}*](#preallocate_message_memory-false-boolean) 156 | - [randomize_hashes `true` *{Boolean}*](#randomize_hashes-true-boolean) 157 | - [hash_seed `0` *{Integer}*](#hash_seed-0-integer) 158 | - [preemption `false` *{Boolean}*](#preemption-false-boolean) 159 | - [regexp_optimization `true` *{Boolean}*](#regexp_optimization-true-boolean) 160 | - [testing_string_flag `Hello, world!` *{String}*](#testing_string_flag-hello-world!-string) 161 | - [testing_serialization_file `/tmp/serdes` *{String}*](#testing_serialization_file-tmpserdes-string) 162 | - [help `false` *{Boolean}*](#help-false-boolean) 163 | - [dump_counters `false` *{Boolean}*](#dump_counters-false-boolean) 164 | - [map_counters `` *{String}*](#map_counters--string) 165 | - [debug_compile_events `true` *{Boolean}*](#debug_compile_events-true-boolean) 166 | - [Resources](#resources-5) 167 | - [debug_script_collected_events `true` *{Boolean}*](#debug_script_collected_events-true-boolean) 168 | - [gdbjit `false` *{Boolean}*](#gdbjit-false-boolean) 169 | - [gdbjit_full `false` *{Boolean}*](#gdbjit_full-false-boolean) 170 | - [gdbjit_dump `false` *{Boolean}*](#gdbjit_dump-false-boolean) 171 | - [gdbjit_dump_filter `` *{String}*](#gdbjit_dump_filter--string) 172 | - [force_marking_deque_overflows `false` *{Boolean}*](#force_marking_deque_overflows-false-boolean) 173 | - [stress_compaction `false` *{Boolean}*](#stress_compaction-false-boolean) 174 | - [enable_slow_asserts `false` *{Boolean}*](#enable_slow_asserts-false-boolean) 175 | - [trace_codegen `false` *{Boolean}*](#trace_codegen-false-boolean) 176 | - [print_source `false` *{Boolean}*](#print_source-false-boolean) 177 | - [print_builtin_source `false` *{Boolean}*](#print_builtin_source-false-boolean) 178 | - [print_ast `false` *{Boolean}*](#print_ast-false-boolean) 179 | - [print_builtin_ast `false` *{Boolean}*](#print_builtin_ast-false-boolean) 180 | - [stop_at `` *{String}*](#stop_at--string) 181 | - [print_builtin_scopes `false` *{Boolean}*](#print_builtin_scopes-false-boolean) 182 | - [print_scopes `false` *{Boolean}*](#print_scopes-false-boolean) 183 | - [trace_contexts `false` *{Boolean}*](#trace_contexts-false-boolean) 184 | - [gc_greedy `false` *{Boolean}*](#gc_greedy-false-boolean) 185 | - [gc_verbose `false` *{Boolean}*](#gc_verbose-false-boolean) 186 | - [heap_stats `false` *{Boolean}*](#heap_stats-false-boolean) 187 | - [code_stats `false` *{Boolean}*](#code_stats-false-boolean) 188 | - [Resources](#resources-6) 189 | - [verify_heap `false` *{Boolean}*](#verify_heap-false-boolean) 190 | - [print_handles `false` *{Boolean}*](#print_handles-false-boolean) 191 | - [print_global_handles `false` *{Boolean}*](#print_global_handles-false-boolean) 192 | - [trace_ic `false` *{Boolean}*](#trace_ic-false-boolean) 193 | - [print_interfaces `false` *{Boolean}*](#print_interfaces-false-boolean) 194 | - [print_interface_details `false` *{Boolean}*](#print_interface_details-false-boolean) 195 | - [print_interface_depth `5` *{Integer}*](#print_interface_depth-5-integer) 196 | - [trace_normalization `false` *{Boolean}*](#trace_normalization-false-boolean) 197 | - [trace_lazy `false` *{Boolean}*](#trace_lazy-false-boolean) 198 | - [collect_heap_spill_statistics `false` *{Boolean}*](#collect_heap_spill_statistics-false-boolean) 199 | - [trace_isolates `false` *{Boolean}*](#trace_isolates-false-boolean) 200 | - [log_state_changes `false` *{Boolean}*](#log_state_changes-false-boolean) 201 | - [regexp_possessive_quantifier `false` *{Boolean}*](#regexp_possessive_quantifier-false-boolean) 202 | - [trace_regexp_bytecodes `false` *{Boolean}*](#trace_regexp_bytecodes-false-boolean) 203 | - [trace_regexp_assembler `false` *{Boolean}*](#trace_regexp_assembler-false-boolean) 204 | - [log `false` *{Boolean}*](#log-false-boolean) 205 | - [log_all `false` *{Boolean}*](#log_all-false-boolean) 206 | - [log_runtime `false` *{Boolean}*](#log_runtime-false-boolean) 207 | - [log_api `false` *{Boolean}*](#log_api-false-boolean) 208 | - [log_code `false` *{Boolean}*](#log_code-false-boolean) 209 | - [log_gc `false` *{Boolean}*](#log_gc-false-boolean) 210 | - [log_handles `false` *{Boolean}*](#log_handles-false-boolean) 211 | - [log_snapshot_positions `false` *{Boolean}*](#log_snapshot_positions-false-boolean) 212 | - [log_suspect `false` *{Boolean}*](#log_suspect-false-boolean) 213 | - [prof `false` *{Boolean}*](#prof-false-boolean) 214 | - [prof_auto `true` *{Boolean}*](#prof_auto-true-boolean) 215 | - [prof_lazy `false` *{Boolean}*](#prof_lazy-false-boolean) 216 | - [prof_browser_mode `true` *{Boolean}*](#prof_browser_mode-true-boolean) 217 | - [log_regexp `false` *{Boolean}*](#log_regexp-false-boolean) 218 | - [sliding_state_window `false` *{Boolean}*](#sliding_state_window-false-boolean) 219 | - [logfile `v8.log` *{String}*](#logfile-v8log-string) 220 | - [ll_prof `false` *{Boolean}*](#ll_prof-false-boolean) 221 | - [trace_elements_transitions `false` *{Boolean}*](#trace_elements_transitions-false-boolean) 222 | - [print_code_stubs `false` *{Boolean}*](#print_code_stubs-false-boolean) 223 | - [test_secondary_stub_cache `false` *{Boolean}*](#test_secondary_stub_cache-false-boolean) 224 | - [test_primary_stub_cache `false` *{Boolean}*](#test_primary_stub_cache-false-boolean) 225 | - [print_code `false` *{Boolean}*](#print_code-false-boolean) 226 | - [print_opt_code `false` *{Boolean}*](#print_opt_code-false-boolean) 227 | - [print_unopt_code `false` *{Boolean}*](#print_unopt_code-false-boolean) 228 | - [print_code_verbose `false` *{Boolean}*](#print_code_verbose-false-boolean) 229 | - [print_builtin_code `false` *{Boolean}*](#print_builtin_code-false-boolean) 230 | 231 | 232 | 233 | 234 | ### use_strict `false` *{Boolean}* 235 | 236 | enforce strict mode 237 | 238 | - **default:** `false` 239 | - **type:** `Boolean` 240 | - **readonly:** `false` 241 | 242 | 243 | ### es5_readonly `false` *{Boolean}* 244 | 245 | activate correct semantics for inheriting readonliness 246 | 247 | - **default:** `false` 248 | - **type:** `Boolean` 249 | - **readonly:** `false` 250 | 251 | 252 | ### es52_globals `false` *{Boolean}* 253 | 254 | activate new semantics for global var declarations 255 | 256 | - **default:** `false` 257 | - **type:** `Boolean` 258 | - **readonly:** `false` 259 | 260 | 261 | ### harmony_typeof `false` *{Boolean}* 262 | 263 | enable harmony semantics for typeof 264 | 265 | - **default:** `false` 266 | - **type:** `Boolean` 267 | - **readonly:** `false` 268 | 269 | **Note:** this feature seems to work in v8 even without turning on this flag. 270 | 271 | #### Resources 272 | 273 | - *rejected?* [proposal](http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null&s=typeof) 274 | 275 | ### harmony_scoping `false` *{Boolean}* 276 | 277 | enable harmony block scoping 278 | 279 | - **default:** `false` 280 | - **type:** `Boolean` 281 | - **readonly:** `false` 282 | 283 | 284 | ### harmony_modules `false` *{Boolean}* 285 | 286 | enable harmony modules (implies block scoping) 287 | 288 | - **default:** `false` 289 | - **type:** `Boolean` 290 | - **readonly:** `false` 291 | 292 | #### Implications 293 | 294 | - harmony_scoping 295 | 296 | #### References 297 | 298 | - [spec](http://wiki.ecmascript.org/doku.php?id=harmony:modules) 299 | - [v8 parser.cc](https://github.com/v8/v8/blob/3.25.30/src/parser.cc#L1147) 300 | 301 | ### harmony_proxies `false` *{Boolean}* 302 | 303 | enable harmony proxies 304 | 305 | 306 | **NOTE:** This flag cannot be configured after the process started up! 307 | 308 | - **default:** `false` 309 | - **type:** `Boolean` 310 | - **readonly:** `false` 311 | 312 | #### Resources 313 | 314 | - [v8 bootstrapper.cc](https://github.com/v8/v8/blob/3.25.30/src/bootstrapper.cc#L1609-L1614) 315 | - [spec draft](http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxies) 316 | 317 | ### harmony_collections `false` *{Boolean}* 318 | 319 | enable harmony collections (sets, maps, and weak maps) 320 | 321 | 322 | **NOTE:** This flag cannot be configured after the process started up! 323 | 324 | - **default:** `false` 325 | - **type:** `Boolean` 326 | - **readonly:** `false` 327 | 328 | #### References 329 | 330 | - [v8 bootstrapper.cc](https://github.com/v8/v8/blob/3.25.30/src/bootstrapper.cc#L1363-L1374) 331 | - [example](http://dailyjs.com/2012/10/15/preparing-for-esnext/#example_collections) 332 | 333 | ### harmony `false` *{Boolean}* 334 | 335 | enable all harmony features (except typeof) 336 | 337 | - **default:** `false` 338 | - **type:** `Boolean` 339 | - **readonly:** `false` 340 | 341 | #### Implications 342 | 343 | - harmony_scoping 344 | - harmony_modules 345 | - harmony_proxies 346 | - harmony_collections 347 | 348 | 349 | ### packed_arrays `false` *{Boolean}* 350 | 351 | optimizes arrays that have no holes 352 | 353 | - **default:** `false` 354 | - **type:** `Boolean` 355 | - **readonly:** `false` 356 | 357 | 358 | ### smi_only_arrays `true` *{Boolean}* 359 | 360 | tracks arrays with only smi values 361 | 362 | - **default:** `true` 363 | - **type:** `Boolean` 364 | - **readonly:** `false` 365 | 366 | 367 | ### clever_optimizations `true` *{Boolean}* 368 | 369 | Optimize object size, Array shift, DOM strings and string + 370 | 371 | - **default:** `true` 372 | - **type:** `Boolean` 373 | - **readonly:** `false` 374 | 375 | 376 | ### unbox_double_arrays `true` *{Boolean}* 377 | 378 | automatically unbox arrays of doubles 379 | 380 | - **default:** `true` 381 | - **type:** `Boolean` 382 | - **readonly:** `false` 383 | 384 | 385 | ### string_slices `true` *{Boolean}* 386 | 387 | use string slices 388 | 389 | - **default:** `true` 390 | - **type:** `Boolean` 391 | - **readonly:** `false` 392 | 393 | 394 | ### crankshaft `true` *{Boolean}* 395 | 396 | use crankshaft 397 | 398 | - **default:** `true` 399 | - **type:** `Boolean` 400 | - **readonly:** `false` 401 | 402 | #### Resources 403 | 404 | - [v8 isolate.cc](https://github.com/v8/v8/blob/3.26.33/src/isolate.cc#L1778) 405 | - [v8 runtime.cc](https://github.com/v8/v8/blob/3.26.33/src/runtime.cc#L8509) 406 | 407 | ### hydrogen_filter `` *{String}* 408 | 409 | optimization filter 410 | 411 | - **default:** `` 412 | - **type:** `String` 413 | - **readonly:** `false` 414 | 415 | 416 | ### use_range `true` *{Boolean}* 417 | 418 | use hydrogen range analysis 419 | 420 | - **default:** `true` 421 | - **type:** `Boolean` 422 | - **readonly:** `false` 423 | 424 | 425 | ### eliminate_dead_phis `true` *{Boolean}* 426 | 427 | eliminate dead phis 428 | 429 | - **default:** `true` 430 | - **type:** `Boolean` 431 | - **readonly:** `false` 432 | 433 | 434 | ### use_gvn `true` *{Boolean}* 435 | 436 | use hydrogen global value numbering 437 | 438 | - **default:** `true` 439 | - **type:** `Boolean` 440 | - **readonly:** `false` 441 | 442 | 443 | ### use_canonicalizing `true` *{Boolean}* 444 | 445 | use hydrogen instruction canonicalizing 446 | 447 | - **default:** `true` 448 | - **type:** `Boolean` 449 | - **readonly:** `false` 450 | 451 | 452 | ### use_inlining `true` *{Boolean}* 453 | 454 | use function inlining 455 | 456 | - **default:** `true` 457 | - **type:** `Boolean` 458 | - **readonly:** `false` 459 | 460 | 461 | ### max_inlined_source_size `600` *{Integer}* 462 | 463 | maximum source size in bytes considered for a single inlining 464 | 465 | - **default:** `600` 466 | - **type:** `Integer` 467 | - **readonly:** `false` 468 | 469 | 470 | ### max_inlined_nodes `196` *{Integer}* 471 | 472 | maximum number of AST nodes considered for a single inlining 473 | 474 | - **default:** `196` 475 | - **type:** `Integer` 476 | - **readonly:** `false` 477 | 478 | 479 | ### max_inlined_nodes_cumulative `196` *{Integer}* 480 | 481 | maximum cumulative number of AST nodes considered for inlining 482 | 483 | - **default:** `196` 484 | - **type:** `Integer` 485 | - **readonly:** `false` 486 | 487 | 488 | ### loop_invariant_code_motion `true` *{Boolean}* 489 | 490 | loop invariant code motion 491 | 492 | - **default:** `true` 493 | - **type:** `Boolean` 494 | - **readonly:** `false` 495 | 496 | 497 | ### collect_megamorphic_maps_from_stub_cache `true` *{Boolean}* 498 | 499 | crankshaft harvests type feedback from stub cache 500 | 501 | - **default:** `true` 502 | - **type:** `Boolean` 503 | - **readonly:** `false` 504 | 505 | 506 | ### hydrogen_stats `false` *{Boolean}* 507 | 508 | print statistics for hydrogen 509 | 510 | - **default:** `false` 511 | - **type:** `Boolean` 512 | - **readonly:** `false` 513 | 514 | 515 | ### trace_hydrogen `false` *{Boolean}* 516 | 517 | trace generated hydrogen to file 518 | 519 | - **default:** `false` 520 | - **type:** `Boolean` 521 | - **readonly:** `false` 522 | 523 | 524 | ### trace_phase `Z` *{String}* 525 | 526 | trace generated IR for specified phases 527 | 528 | - **default:** `Z` 529 | - **type:** `String` 530 | - **readonly:** `false` 531 | 532 | 533 | ### trace_inlining `false` *{Boolean}* 534 | 535 | trace inlining decisions 536 | 537 | - **default:** `false` 538 | - **type:** `Boolean` 539 | - **readonly:** `false` 540 | 541 | 542 | ### trace_alloc `false` *{Boolean}* 543 | 544 | trace register allocator 545 | 546 | - **default:** `false` 547 | - **type:** `Boolean` 548 | - **readonly:** `false` 549 | 550 | 551 | ### trace_all_uses `false` *{Boolean}* 552 | 553 | trace all use positions 554 | 555 | - **default:** `false` 556 | - **type:** `Boolean` 557 | - **readonly:** `false` 558 | 559 | 560 | ### trace_range `false` *{Boolean}* 561 | 562 | trace range analysis 563 | 564 | - **default:** `false` 565 | - **type:** `Boolean` 566 | - **readonly:** `false` 567 | 568 | 569 | ### trace_gvn `false` *{Boolean}* 570 | 571 | trace global value numbering 572 | 573 | - **default:** `false` 574 | - **type:** `Boolean` 575 | - **readonly:** `false` 576 | 577 | 578 | ### trace_representation `false` *{Boolean}* 579 | 580 | trace representation types 581 | 582 | - **default:** `false` 583 | - **type:** `Boolean` 584 | - **readonly:** `false` 585 | 586 | 587 | ### stress_pointer_maps `false` *{Boolean}* 588 | 589 | pointer map for every instruction 590 | 591 | - **default:** `false` 592 | - **type:** `Boolean` 593 | - **readonly:** `false` 594 | 595 | 596 | ### stress_environments `false` *{Boolean}* 597 | 598 | environment for every instruction 599 | 600 | - **default:** `false` 601 | - **type:** `Boolean` 602 | - **readonly:** `false` 603 | 604 | 605 | ### deopt_every_n_times `0` *{Integer}* 606 | 607 | deoptimize every n times a deopt point is passed 608 | 609 | - **default:** `0` 610 | - **type:** `Integer` 611 | - **readonly:** `false` 612 | 613 | 614 | ### trap_on_deopt `false` *{Boolean}* 615 | 616 | put a break point before deoptimizing 617 | 618 | - **default:** `false` 619 | - **type:** `Boolean` 620 | - **readonly:** `false` 621 | 622 | 623 | ### deoptimize_uncommon_cases `true` *{Boolean}* 624 | 625 | deoptimize uncommon cases 626 | 627 | - **default:** `true` 628 | - **type:** `Boolean` 629 | - **readonly:** `false` 630 | 631 | 632 | ### polymorphic_inlining `true` *{Boolean}* 633 | 634 | polymorphic inlining 635 | 636 | - **default:** `true` 637 | - **type:** `Boolean` 638 | - **readonly:** `false` 639 | 640 | 641 | ### use_osr `true` *{Boolean}* 642 | 643 | use on-stack replacement 644 | 645 | - **default:** `true` 646 | - **type:** `Boolean` 647 | - **readonly:** `false` 648 | 649 | 650 | ### array_bounds_checks_elimination `false` *{Boolean}* 651 | 652 | perform array bounds checks elimination 653 | 654 | - **default:** `false` 655 | - **type:** `Boolean` 656 | - **readonly:** `false` 657 | 658 | 659 | ### array_index_dehoisting `false` *{Boolean}* 660 | 661 | perform array index dehoisting 662 | 663 | - **default:** `false` 664 | - **type:** `Boolean` 665 | - **readonly:** `false` 666 | 667 | 668 | ### trace_osr `false` *{Boolean}* 669 | 670 | trace on-stack replacement 671 | 672 | - **default:** `false` 673 | - **type:** `Boolean` 674 | - **readonly:** `false` 675 | 676 | 677 | ### stress_runs `0` *{Integer}* 678 | 679 | number of stress runs 680 | 681 | - **default:** `0` 682 | - **type:** `Integer` 683 | - **readonly:** `false` 684 | 685 | 686 | ### optimize_closures `true` *{Boolean}* 687 | 688 | optimize closures 689 | 690 | - **default:** `true` 691 | - **type:** `Boolean` 692 | - **readonly:** `false` 693 | 694 | 695 | ### inline_construct `true` *{Boolean}* 696 | 697 | inline constructor calls 698 | 699 | - **default:** `true` 700 | - **type:** `Boolean` 701 | - **readonly:** `false` 702 | 703 | 704 | ### inline_arguments `true` *{Boolean}* 705 | 706 | inline functions with arguments object 707 | 708 | - **default:** `true` 709 | - **type:** `Boolean` 710 | - **readonly:** `false` 711 | 712 | 713 | ### loop_weight `1` *{Integer}* 714 | 715 | loop weight for representation inference 716 | 717 | - **default:** `1` 718 | - **type:** `Integer` 719 | - **readonly:** `false` 720 | 721 | 722 | ### optimize_for_in `true` *{Boolean}* 723 | 724 | optimize functions containing for-in loops 725 | 726 | - **default:** `true` 727 | - **type:** `Boolean` 728 | - **readonly:** `false` 729 | 730 | 731 | ### experimental_profiler `true` *{Boolean}* 732 | 733 | enable all profiler experiments 734 | 735 | - **default:** `true` 736 | - **type:** `Boolean` 737 | - **readonly:** `false` 738 | 739 | #### Implications 740 | 741 | - watch_ic_patching 742 | - self_optimization 743 | - retry_self_opt 744 | - count_based_interrupts 745 | - interrupt_at_exit 746 | - weighted_back_edges 747 | 748 | 749 | ### watch_ic_patching `false` *{Boolean}* 750 | 751 | profiler considers IC stability 752 | 753 | - **default:** `false` 754 | - **type:** `Boolean` 755 | - **readonly:** `false` 756 | 757 | 758 | ### frame_count `1` *{Integer}* 759 | 760 | number of stack frames inspected by the profiler 761 | 762 | - **default:** `1` 763 | - **type:** `Integer` 764 | - **readonly:** `false` 765 | 766 | 767 | ### self_optimization `false` *{Boolean}* 768 | 769 | primitive functions trigger their own optimization 770 | 771 | - **default:** `false` 772 | - **type:** `Boolean` 773 | - **readonly:** `false` 774 | 775 | 776 | ### direct_self_opt `false` *{Boolean}* 777 | 778 | call recompile stub directly when self-optimizing 779 | 780 | - **default:** `false` 781 | - **type:** `Boolean` 782 | - **readonly:** `false` 783 | 784 | 785 | ### retry_self_opt `false` *{Boolean}* 786 | 787 | re-try self-optimization if it failed 788 | 789 | - **default:** `false` 790 | - **type:** `Boolean` 791 | - **readonly:** `false` 792 | 793 | 794 | ### count_based_interrupts `false` *{Boolean}* 795 | 796 | trigger profiler ticks based on counting instead of timing 797 | 798 | - **default:** `false` 799 | - **type:** `Boolean` 800 | - **readonly:** `false` 801 | 802 | 803 | ### interrupt_at_exit `false` *{Boolean}* 804 | 805 | insert an interrupt check at function exit 806 | 807 | - **default:** `false` 808 | - **type:** `Boolean` 809 | - **readonly:** `false` 810 | 811 | 812 | ### weighted_back_edges `false` *{Boolean}* 813 | 814 | weight back edges by jump distance for interrupt triggering 815 | 816 | - **default:** `false` 817 | - **type:** `Boolean` 818 | - **readonly:** `false` 819 | 820 | 821 | ### interrupt_budget `5900` *{Integer}* 822 | 823 | execution budget before interrupt is triggered 824 | 825 | - **default:** `5900` 826 | - **type:** `Integer` 827 | - **readonly:** `false` 828 | 829 | 830 | ### type_info_threshold `15` *{Integer}* 831 | 832 | percentage of ICs that must have type info to allow optimization 833 | 834 | - **default:** `15` 835 | - **type:** `Integer` 836 | - **readonly:** `false` 837 | 838 | 839 | ### self_opt_count `130` *{Integer}* 840 | 841 | call count before self-optimization 842 | 843 | - **default:** `130` 844 | - **type:** `Integer` 845 | - **readonly:** `false` 846 | 847 | 848 | ### trace_opt_verbose `false` *{Boolean}* 849 | 850 | extra verbose compilation tracing 851 | 852 | - **default:** `false` 853 | - **type:** `Boolean` 854 | - **readonly:** `false` 855 | 856 | #### Implications 857 | 858 | - trace_opt 859 | 860 | 861 | ### debug_code `false` *{Boolean}* 862 | 863 | generate extra code (assertions) for debugging 864 | 865 | - **default:** `false` 866 | - **type:** `Boolean` 867 | - **readonly:** `false` 868 | 869 | 870 | ### code_comments `false` *{Boolean}* 871 | 872 | emit comments in code disassembly 873 | 874 | - **default:** `false` 875 | - **type:** `Boolean` 876 | - **readonly:** `false` 877 | 878 | #### Resources 879 | 880 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/lithium-codegen.cc#L66-L73) 881 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/heap.cc#L4528-L4536) 882 | 883 | **Note**: not available below **node:** `0.11` - **v8:** `3.25` 884 | 885 | ### enable_sse2 `true` *{Boolean}* 886 | 887 | enable use of SSE2 instructions if available 888 | 889 | - **default:** `true` 890 | - **type:** `Boolean` 891 | - **readonly:** `false` 892 | 893 | 894 | ### enable_sse3 `true` *{Boolean}* 895 | 896 | enable use of SSE3 instructions if available 897 | 898 | - **default:** `true` 899 | - **type:** `Boolean` 900 | - **readonly:** `false` 901 | 902 | 903 | ### enable_sse4_1 `true` *{Boolean}* 904 | 905 | enable use of SSE4.1 instructions if available 906 | 907 | - **default:** `true` 908 | - **type:** `Boolean` 909 | - **readonly:** `false` 910 | 911 | 912 | ### enable_cmov `true` *{Boolean}* 913 | 914 | enable use of CMOV instruction if available 915 | 916 | - **default:** `true` 917 | - **type:** `Boolean` 918 | - **readonly:** `false` 919 | 920 | 921 | ### enable_rdtsc `true` *{Boolean}* 922 | 923 | enable use of RDTSC instruction if available 924 | 925 | - **default:** `true` 926 | - **type:** `Boolean` 927 | - **readonly:** `false` 928 | 929 | 930 | ### enable_sahf `true` *{Boolean}* 931 | 932 | enable use of SAHF instruction if available (X64 only) 933 | 934 | - **default:** `true` 935 | - **type:** `Boolean` 936 | - **readonly:** `false` 937 | 938 | 939 | ### enable_vfp3 `true` *{Boolean}* 940 | 941 | enable use of VFP3 instructions if available - this implies enabling ARMv7 and VFP2 instructions (ARM only) 942 | 943 | - **default:** `true` 944 | - **type:** `Boolean` 945 | - **readonly:** `false` 946 | 947 | 948 | ### enable_vfp2 `true` *{Boolean}* 949 | 950 | enable use of VFP2 instructions if available 951 | 952 | - **default:** `true` 953 | - **type:** `Boolean` 954 | - **readonly:** `false` 955 | 956 | 957 | ### enable_armv7 `true` *{Boolean}* 958 | 959 | enable use of ARMv7 instructions if available (ARM only) 960 | 961 | - **default:** `true` 962 | - **type:** `Boolean` 963 | - **readonly:** `false` 964 | 965 | 966 | ### enable_fpu `true` *{Boolean}* 967 | 968 | enable use of MIPS FPU instructions if available (MIPS only) 969 | 970 | - **default:** `true` 971 | - **type:** `Boolean` 972 | - **readonly:** `false` 973 | 974 | 975 | ### expose_natives_as `undefined` *{String}* 976 | 977 | expose natives in global object 978 | 979 | 980 | **NOTE:** This flag cannot be configured after the process started up! 981 | 982 | - **default:** `undefined` 983 | - **type:** `String` 984 | - **readonly:** `false` 985 | 986 | 987 | ### expose_debug_as `undefined` *{String}* 988 | 989 | expose debug in global object 990 | 991 | 992 | **NOTE:** This flag cannot be configured after the process started up! 993 | 994 | - **default:** `undefined` 995 | - **type:** `String` 996 | - **readonly:** `false` 997 | 998 | 999 | ### expose_gc `false` *{Boolean}* 1000 | 1001 | expose gc extension 1002 | 1003 | 1004 | **NOTE:** This flag cannot be configured after the process started up! 1005 | 1006 | - **default:** `false` 1007 | - **type:** `Boolean` 1008 | - **readonly:** `false` 1009 | 1010 | 1011 | ### expose_externalize_string `false` *{Boolean}* 1012 | 1013 | expose externalize string extension 1014 | 1015 | - **default:** `false` 1016 | - **type:** `Boolean` 1017 | - **readonly:** `false` 1018 | 1019 | 1020 | ### stack_trace_limit `10` *{Integer}* 1021 | 1022 | number of stack frames to capture 1023 | 1024 | - **default:** `10` 1025 | - **type:** `Integer` 1026 | - **readonly:** `false` 1027 | 1028 | 1029 | ### builtins_in_stack_traces `false` *{Boolean}* 1030 | 1031 | show built-in functions in stack traces 1032 | 1033 | - **default:** `false` 1034 | - **type:** `Boolean` 1035 | - **readonly:** `false` 1036 | 1037 | 1038 | ### disable_native_files `false` *{Boolean}* 1039 | 1040 | disable builtin natives files 1041 | 1042 | - **default:** `false` 1043 | - **type:** `Boolean` 1044 | - **readonly:** `false` 1045 | 1046 | 1047 | ### inline_new `true` *{Boolean}* 1048 | 1049 | use fast inline allocation 1050 | 1051 | - **default:** `true` 1052 | - **type:** `Boolean` 1053 | - **readonly:** `false` 1054 | 1055 | 1056 | ### stack_trace_on_abort `true` *{Boolean}* 1057 | 1058 | print a stack trace if an assertion failure occurs 1059 | 1060 | - **default:** `true` 1061 | - **type:** `Boolean` 1062 | - **readonly:** `false` 1063 | 1064 | 1065 | ### trace `false` *{Boolean}* 1066 | 1067 | trace function calls 1068 | 1069 | - **default:** `false` 1070 | - **type:** `Boolean` 1071 | - **readonly:** `false` 1072 | 1073 | 1074 | ### mask_constants_with_cookie `true` *{Boolean}* 1075 | 1076 | use random jit cookie to mask large constants 1077 | 1078 | - **default:** `true` 1079 | - **type:** `Boolean` 1080 | - **readonly:** `false` 1081 | 1082 | 1083 | ### lazy `true` *{Boolean}* 1084 | 1085 | use lazy compilation 1086 | 1087 | - **default:** `true` 1088 | - **type:** `Boolean` 1089 | - **readonly:** `false` 1090 | 1091 | 1092 | ### trace_opt `false` *{Boolean}* 1093 | 1094 | trace lazy optimization 1095 | 1096 | - **default:** `false` 1097 | - **type:** `Boolean` 1098 | - **readonly:** `false` 1099 | 1100 | 1101 | ### trace_opt_stats `false` *{Boolean}* 1102 | 1103 | trace lazy optimization statistics 1104 | 1105 | - **default:** `false` 1106 | - **type:** `Boolean` 1107 | - **readonly:** `false` 1108 | 1109 | 1110 | ### opt `true` *{Boolean}* 1111 | 1112 | use adaptive optimizations 1113 | 1114 | - **default:** `true` 1115 | - **type:** `Boolean` 1116 | - **readonly:** `false` 1117 | 1118 | 1119 | ### always_opt `false` *{Boolean}* 1120 | 1121 | always try to optimize functions 1122 | 1123 | - **default:** `false` 1124 | - **type:** `Boolean` 1125 | - **readonly:** `false` 1126 | 1127 | **Note**: not properly working below **node:** `0.10` - **v8:** `3.14` 1128 | 1129 | ### prepare_always_opt `false` *{Boolean}* 1130 | 1131 | prepare for turning on always opt 1132 | 1133 | - **default:** `false` 1134 | - **type:** `Boolean` 1135 | - **readonly:** `false` 1136 | 1137 | 1138 | ### trace_deopt `false` *{Boolean}* 1139 | 1140 | trace deoptimization 1141 | 1142 | - **default:** `false` 1143 | - **type:** `Boolean` 1144 | - **readonly:** `false` 1145 | 1146 | 1147 | ### min_preparse_length `1024` *{Integer}* 1148 | 1149 | minimum length for automatic enable preparsing 1150 | 1151 | - **default:** `1024` 1152 | - **type:** `Integer` 1153 | - **readonly:** `false` 1154 | 1155 | 1156 | ### always_full_compiler `false` *{Boolean}* 1157 | 1158 | try to use the dedicated run-once backend for all code 1159 | 1160 | - **default:** `false` 1161 | - **type:** `Boolean` 1162 | - **readonly:** `false` 1163 | 1164 | 1165 | ### trace_bailout `false` *{Boolean}* 1166 | 1167 | print reasons for falling back to using the classic V8 backend 1168 | 1169 | - **default:** `false` 1170 | - **type:** `Boolean` 1171 | - **readonly:** `false` 1172 | 1173 | 1174 | ### compilation_cache `true` *{Boolean}* 1175 | 1176 | enable compilation cache 1177 | 1178 | - **default:** `true` 1179 | - **type:** `Boolean` 1180 | - **readonly:** `false` 1181 | 1182 | The compilation cache keeps shared function infos for compiled 1183 | scripts and evals. The shared function infos are looked up using 1184 | the source string as the key. For regular expressions the 1185 | compilation data is cached. 1186 | 1187 | Enable/Disable is used by debugger to disable compilation cache during debugging to make sure new scripts are always 1188 | compiled, however both this flag and the `enabled_` property need to be `true` in order for the compilation cache to get 1189 | used. 1190 | 1191 | #### Resources 1192 | 1193 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/compilation-cache.h#L220) 1194 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/debug.cc#L3292-L3301) 1195 | 1196 | ### cache_prototype_transitions `true` *{Boolean}* 1197 | 1198 | cache prototype transitions 1199 | 1200 | - **default:** `true` 1201 | - **type:** `Boolean` 1202 | - **readonly:** `false` 1203 | 1204 | #### Resources: 1205 | 1206 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/objects.cc#L12076) 1207 | 1208 | ### trace_debug_json `false` *{Boolean}* 1209 | 1210 | trace debugging JSON request/response 1211 | 1212 | - **default:** `false` 1213 | - **type:** `Boolean` 1214 | - **readonly:** `false` 1215 | 1216 | 1217 | ### debugger_auto_break `true` *{Boolean}* 1218 | 1219 | automatically set the debug break flag when debugger commands are in the queue 1220 | 1221 | - **default:** `true` 1222 | - **type:** `Boolean` 1223 | - **readonly:** `false` 1224 | 1225 | 1226 | ### enable_liveedit `true` *{Boolean}* 1227 | 1228 | enable liveedit experimental feature 1229 | 1230 | - **default:** `true` 1231 | - **type:** `Boolean` 1232 | - **readonly:** `false` 1233 | 1234 | 1235 | ### break_on_abort `true` *{Boolean}* 1236 | 1237 | always cause a debug break before aborting 1238 | 1239 | - **default:** `true` 1240 | - **type:** `Boolean` 1241 | - **readonly:** `false` 1242 | 1243 | 1244 | ### stack_size `984` *{Integer}* 1245 | 1246 | default size of stack region v8 is allowed to use (in kBytes) 1247 | 1248 | - **default:** `984` 1249 | - **type:** `Integer` 1250 | - **readonly:** `false` 1251 | 1252 | 1253 | ### max_stack_trace_source_length `300` *{Integer}* 1254 | 1255 | maximum length of function source code printed in a stack trace. 1256 | 1257 | - **default:** `300` 1258 | - **type:** `Integer` 1259 | - **readonly:** `false` 1260 | 1261 | 1262 | ### always_inline_smi_code `false` *{Boolean}* 1263 | 1264 | always inline smi code in non-opt code 1265 | 1266 | - **default:** `false` 1267 | - **type:** `Boolean` 1268 | - **readonly:** `false` 1269 | 1270 | 1271 | ### max_new_space_size `0` *{Integer}* 1272 | 1273 | max size of the new generation (in kBytes) 1274 | 1275 | - **default:** `0` 1276 | - **type:** `Integer` 1277 | - **readonly:** `false` 1278 | 1279 | 1280 | ### max_old_space_size `0` *{Integer}* 1281 | 1282 | max size of the old generation (in Mbytes) 1283 | 1284 | - **default:** `0` 1285 | - **type:** `Integer` 1286 | - **readonly:** `false` 1287 | 1288 | 1289 | ### max_executable_size `0` *{Integer}* 1290 | 1291 | max size of executable memory (in Mbytes) 1292 | 1293 | - **default:** `0` 1294 | - **type:** `Integer` 1295 | - **readonly:** `false` 1296 | 1297 | 1298 | ### gc_global `false` *{Boolean}* 1299 | 1300 | always perform global GCs 1301 | 1302 | - **default:** `false` 1303 | - **type:** `Boolean` 1304 | - **readonly:** `false` 1305 | 1306 | 1307 | ### gc_interval `-1` *{Integer}* 1308 | 1309 | garbage collect after allocations 1310 | 1311 | - **default:** `-1` 1312 | - **type:** `Integer` 1313 | - **readonly:** `false` 1314 | 1315 | 1316 | ### trace_gc `false` *{Boolean}* 1317 | 1318 | print one trace line following each garbage collection 1319 | 1320 | - **default:** `false` 1321 | - **type:** `Boolean` 1322 | - **readonly:** `false` 1323 | 1324 | 1325 | ### trace_gc_nvp `false` *{Boolean}* 1326 | 1327 | print one detailed trace line in name=value format after each garbage collection 1328 | 1329 | - **default:** `false` 1330 | - **type:** `Boolean` 1331 | - **readonly:** `false` 1332 | 1333 | 1334 | ### print_cumulative_gc_stat `false` *{Boolean}* 1335 | 1336 | print cumulative GC statistics in name=value format on exit 1337 | 1338 | - **default:** `false` 1339 | - **type:** `Boolean` 1340 | - **readonly:** `false` 1341 | 1342 | 1343 | ### trace_gc_verbose `false` *{Boolean}* 1344 | 1345 | print more details following each garbage collection 1346 | 1347 | - **default:** `false` 1348 | - **type:** `Boolean` 1349 | - **readonly:** `false` 1350 | 1351 | 1352 | ### trace_fragmentation `false` *{Boolean}* 1353 | 1354 | report fragmentation for old pointer and data pages 1355 | 1356 | - **default:** `false` 1357 | - **type:** `Boolean` 1358 | - **readonly:** `false` 1359 | 1360 | 1361 | ### collect_maps `true` *{Boolean}* 1362 | 1363 | garbage collect maps from which no objects can be reached 1364 | 1365 | - **default:** `true` 1366 | - **type:** `Boolean` 1367 | - **readonly:** `false` 1368 | 1369 | 1370 | ### flush_code `true` *{Boolean}* 1371 | 1372 | flush code that we expect not to use again before full gc 1373 | 1374 | - **default:** `true` 1375 | - **type:** `Boolean` 1376 | - **readonly:** `false` 1377 | 1378 | 1379 | ### incremental_marking `true` *{Boolean}* 1380 | 1381 | use incremental marking 1382 | 1383 | - **default:** `true` 1384 | - **type:** `Boolean` 1385 | - **readonly:** `false` 1386 | 1387 | 1388 | ### incremental_marking_steps `true` *{Boolean}* 1389 | 1390 | do incremental marking steps 1391 | 1392 | - **default:** `true` 1393 | - **type:** `Boolean` 1394 | - **readonly:** `false` 1395 | 1396 | 1397 | ### trace_incremental_marking `false` *{Boolean}* 1398 | 1399 | trace progress of the incremental marking 1400 | 1401 | - **default:** `false` 1402 | - **type:** `Boolean` 1403 | - **readonly:** `false` 1404 | 1405 | 1406 | ### use_idle_notification `true` *{Boolean}* 1407 | 1408 | Use idle notification to reduce memory footprint. 1409 | 1410 | - **default:** `true` 1411 | - **type:** `Boolean` 1412 | - **readonly:** `false` 1413 | 1414 | 1415 | ### send_idle_notification `false` *{Boolean}* 1416 | 1417 | Send idle notifcation between stress runs. 1418 | 1419 | - **default:** `false` 1420 | - **type:** `Boolean` 1421 | - **readonly:** `false` 1422 | 1423 | 1424 | ### use_ic `true` *{Boolean}* 1425 | 1426 | use inline caching 1427 | 1428 | - **default:** `true` 1429 | - **type:** `Boolean` 1430 | - **readonly:** `false` 1431 | 1432 | 1433 | ### native_code_counters `false` *{Boolean}* 1434 | 1435 | generate extra code for manipulating stats counters 1436 | 1437 | - **default:** `false` 1438 | - **type:** `Boolean` 1439 | - **readonly:** `false` 1440 | 1441 | 1442 | ### always_compact `false` *{Boolean}* 1443 | 1444 | Perform compaction on every full GC 1445 | 1446 | - **default:** `false` 1447 | - **type:** `Boolean` 1448 | - **readonly:** `false` 1449 | 1450 | 1451 | ### lazy_sweeping `true` *{Boolean}* 1452 | 1453 | Use lazy sweeping for old pointer and data spaces 1454 | 1455 | - **default:** `true` 1456 | - **type:** `Boolean` 1457 | - **readonly:** `false` 1458 | 1459 | 1460 | ### never_compact `false` *{Boolean}* 1461 | 1462 | Never perform compaction on full GC - testing only 1463 | 1464 | - **default:** `false` 1465 | - **type:** `Boolean` 1466 | - **readonly:** `false` 1467 | 1468 | 1469 | ### compact_code_space `true` *{Boolean}* 1470 | 1471 | Compact code space on full non-incremental collections 1472 | 1473 | - **default:** `true` 1474 | - **type:** `Boolean` 1475 | - **readonly:** `false` 1476 | 1477 | 1478 | ### cleanup_code_caches_at_gc `true` *{Boolean}* 1479 | 1480 | Flush inline caches prior to mark compact collection and flush code caches in maps during mark compact cycle. 1481 | 1482 | - **default:** `true` 1483 | - **type:** `Boolean` 1484 | - **readonly:** `false` 1485 | 1486 | 1487 | ### random_seed `0` *{Integer}* 1488 | 1489 | Default seed for initializing random generator (0, the default, means to use system random). 1490 | 1491 | - **default:** `0` 1492 | - **type:** `Integer` 1493 | - **readonly:** `false` 1494 | 1495 | 1496 | ### use_verbose_printer `true` *{Boolean}* 1497 | 1498 | allows verbose printing 1499 | 1500 | - **default:** `true` 1501 | - **type:** `Boolean` 1502 | - **readonly:** `false` 1503 | 1504 | 1505 | ### allow_natives_syntax `false` *{Boolean}* 1506 | 1507 | allow natives syntax 1508 | 1509 | - **default:** `false` 1510 | - **type:** `Boolean` 1511 | - **readonly:** `false` 1512 | 1513 | 1514 | ### trace_sim `false` *{Boolean}* 1515 | 1516 | Trace simulator execution 1517 | 1518 | - **default:** `false` 1519 | - **type:** `Boolean` 1520 | - **readonly:** `false` 1521 | 1522 | 1523 | ### check_icache `false` *{Boolean}* 1524 | 1525 | Check icache flushes in ARM and MIPS simulator 1526 | 1527 | - **default:** `false` 1528 | - **type:** `Boolean` 1529 | - **readonly:** `false` 1530 | 1531 | 1532 | ### stop_sim_at `0` *{Integer}* 1533 | 1534 | Simulator stop after x number of instructions 1535 | 1536 | - **default:** `0` 1537 | - **type:** `Integer` 1538 | - **readonly:** `false` 1539 | 1540 | 1541 | ### sim_stack_alignment `8` *{Integer}* 1542 | 1543 | Stack alingment in bytes in simulator (4 or 8, 8 is default) 1544 | 1545 | - **default:** `8` 1546 | - **type:** `Integer` 1547 | - **readonly:** `false` 1548 | 1549 | 1550 | ### trace_exception `false` *{Boolean}* 1551 | 1552 | print stack trace when throwing exceptions 1553 | 1554 | - **default:** `false` 1555 | - **type:** `Boolean` 1556 | - **readonly:** `false` 1557 | 1558 | 1559 | ### preallocate_message_memory `false` *{Boolean}* 1560 | 1561 | preallocate some memory to build stack traces. 1562 | 1563 | - **default:** `false` 1564 | - **type:** `Boolean` 1565 | - **readonly:** `false` 1566 | 1567 | 1568 | ### randomize_hashes `true` *{Boolean}* 1569 | 1570 | randomize hashes to avoid predictable hash collisions (with snapshots this option cannot override the baked-in seed) 1571 | 1572 | - **default:** `true` 1573 | - **type:** `Boolean` 1574 | - **readonly:** `false` 1575 | 1576 | 1577 | ### hash_seed `0` *{Integer}* 1578 | 1579 | Fixed seed to use to hash property keys (0 means random)(with snapshots this option cannot override the baked-in seed) 1580 | 1581 | - **default:** `0` 1582 | - **type:** `Integer` 1583 | - **readonly:** `false` 1584 | 1585 | 1586 | ### preemption `false` *{Boolean}* 1587 | 1588 | activate a 100ms timer that switches between V8 threads 1589 | 1590 | - **default:** `false` 1591 | - **type:** `Boolean` 1592 | - **readonly:** `false` 1593 | 1594 | 1595 | ### regexp_optimization `true` *{Boolean}* 1596 | 1597 | generate optimized regexp code 1598 | 1599 | - **default:** `true` 1600 | - **type:** `Boolean` 1601 | - **readonly:** `false` 1602 | 1603 | 1604 | ### testing_string_flag `Hello, world!` *{String}* 1605 | 1606 | string-flag 1607 | 1608 | - **default:** `Hello, world!` 1609 | - **type:** `String` 1610 | - **readonly:** `false` 1611 | 1612 | 1613 | ### testing_serialization_file `/tmp/serdes` *{String}* 1614 | 1615 | file in which to serialize heap 1616 | 1617 | - **default:** `/tmp/serdes` 1618 | - **type:** `String` 1619 | - **readonly:** `false` 1620 | 1621 | 1622 | ### help `false` *{Boolean}* 1623 | 1624 | Print usage message, including flags, on console 1625 | 1626 | - **default:** `false` 1627 | - **type:** `Boolean` 1628 | - **readonly:** `false` 1629 | 1630 | 1631 | ### dump_counters `false` *{Boolean}* 1632 | 1633 | Dump counters on exit 1634 | 1635 | - **default:** `false` 1636 | - **type:** `Boolean` 1637 | - **readonly:** `false` 1638 | 1639 | 1640 | ### map_counters `` *{String}* 1641 | 1642 | Map counters to a file 1643 | 1644 | - **default:** `` 1645 | - **type:** `String` 1646 | - **readonly:** `false` 1647 | 1648 | 1649 | ### debug_compile_events `true` *{Boolean}* 1650 | 1651 | Enable debugger compile events 1652 | 1653 | - **default:** `true` 1654 | - **type:** `Boolean` 1655 | - **readonly:** `false` 1656 | 1657 | #### Resources 1658 | 1659 | [v8 debug.h](https://github.com/v8/v8/blob/3.26.33/src/debug.h#L843-L845) 1660 | 1661 | **Note:** disabled by default on `WebOS` 1662 | 1663 | ### debug_script_collected_events `true` *{Boolean}* 1664 | 1665 | Enable debugger script collected events 1666 | 1667 | - **default:** `true` 1668 | - **type:** `Boolean` 1669 | - **readonly:** `false` 1670 | 1671 | 1672 | ### gdbjit `false` *{Boolean}* 1673 | 1674 | enable GDBJIT interface (disables compacting GC) 1675 | 1676 | - **default:** `false` 1677 | - **type:** `Boolean` 1678 | - **readonly:** `false` 1679 | 1680 | 1681 | ### gdbjit_full `false` *{Boolean}* 1682 | 1683 | enable GDBJIT interface for all code objects 1684 | 1685 | - **default:** `false` 1686 | - **type:** `Boolean` 1687 | - **readonly:** `false` 1688 | 1689 | 1690 | ### gdbjit_dump `false` *{Boolean}* 1691 | 1692 | dump elf objects with debug info to disk 1693 | 1694 | - **default:** `false` 1695 | - **type:** `Boolean` 1696 | - **readonly:** `false` 1697 | 1698 | 1699 | ### gdbjit_dump_filter `` *{String}* 1700 | 1701 | dump only objects containing this substring 1702 | 1703 | - **default:** `` 1704 | - **type:** `String` 1705 | - **readonly:** `false` 1706 | 1707 | 1708 | ### force_marking_deque_overflows `false` *{Boolean}* 1709 | 1710 | force overflows of marking deque by reducing it's size to 64 words 1711 | 1712 | - **default:** `false` 1713 | - **type:** `Boolean` 1714 | - **readonly:** `false` 1715 | 1716 | 1717 | ### stress_compaction `false` *{Boolean}* 1718 | 1719 | stress the GC compactor to flush out bugs (implies --force_marking_deque_overflows) 1720 | 1721 | - **default:** `false` 1722 | - **type:** `Boolean` 1723 | - **readonly:** `false` 1724 | 1725 | 1726 | ### enable_slow_asserts `false` *{Boolean}* 1727 | 1728 | enable asserts that are slow to execute 1729 | 1730 | - **default:** `false` 1731 | - **type:** `Boolean` 1732 | - **readonly:** `true` 1733 | 1734 | 1735 | ### trace_codegen `false` *{Boolean}* 1736 | 1737 | print name of functions for which code is generated 1738 | 1739 | - **default:** `false` 1740 | - **type:** `Boolean` 1741 | - **readonly:** `true` 1742 | 1743 | 1744 | ### print_source `false` *{Boolean}* 1745 | 1746 | pretty print source code 1747 | 1748 | - **default:** `false` 1749 | - **type:** `Boolean` 1750 | - **readonly:** `true` 1751 | 1752 | 1753 | ### print_builtin_source `false` *{Boolean}* 1754 | 1755 | pretty print source code for builtins 1756 | 1757 | - **default:** `false` 1758 | - **type:** `Boolean` 1759 | - **readonly:** `true` 1760 | 1761 | 1762 | ### print_ast `false` *{Boolean}* 1763 | 1764 | print source AST 1765 | 1766 | - **default:** `false` 1767 | - **type:** `Boolean` 1768 | - **readonly:** `true` 1769 | 1770 | 1771 | ### print_builtin_ast `false` *{Boolean}* 1772 | 1773 | print source AST for builtins 1774 | 1775 | - **default:** `false` 1776 | - **type:** `Boolean` 1777 | - **readonly:** `true` 1778 | 1779 | 1780 | ### stop_at `` *{String}* 1781 | 1782 | function name where to insert a breakpoint 1783 | 1784 | - **default:** `` 1785 | - **type:** `String` 1786 | - **readonly:** `true` 1787 | 1788 | 1789 | ### print_builtin_scopes `false` *{Boolean}* 1790 | 1791 | print scopes for builtins 1792 | 1793 | - **default:** `false` 1794 | - **type:** `Boolean` 1795 | - **readonly:** `true` 1796 | 1797 | 1798 | ### print_scopes `false` *{Boolean}* 1799 | 1800 | print scopes 1801 | 1802 | - **default:** `false` 1803 | - **type:** `Boolean` 1804 | - **readonly:** `true` 1805 | 1806 | 1807 | ### trace_contexts `false` *{Boolean}* 1808 | 1809 | trace contexts operations 1810 | 1811 | - **default:** `false` 1812 | - **type:** `Boolean` 1813 | - **readonly:** `true` 1814 | 1815 | 1816 | ### gc_greedy `false` *{Boolean}* 1817 | 1818 | perform GC prior to some allocations 1819 | 1820 | - **default:** `false` 1821 | - **type:** `Boolean` 1822 | - **readonly:** `true` 1823 | 1824 | 1825 | ### gc_verbose `false` *{Boolean}* 1826 | 1827 | print stuff during garbage collection 1828 | 1829 | - **default:** `false` 1830 | - **type:** `Boolean` 1831 | - **readonly:** `true` 1832 | 1833 | 1834 | ### heap_stats `false` *{Boolean}* 1835 | 1836 | report heap statistics before and after GC 1837 | 1838 | - **default:** `false` 1839 | - **type:** `Boolean` 1840 | - **readonly:** `true` 1841 | 1842 | 1843 | ### code_stats `false` *{Boolean}* 1844 | 1845 | report code statistics after GC 1846 | 1847 | - **default:** `false` 1848 | - **type:** `Boolean` 1849 | - **readonly:** `true` 1850 | 1851 | #### Resources 1852 | 1853 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/heap.cc#L582) 1854 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/heap.cc#L4528-L4536) 1855 | 1856 | ### verify_heap `false` *{Boolean}* 1857 | 1858 | verify heap pointers before and after GC 1859 | 1860 | - **default:** `false` 1861 | - **type:** `Boolean` 1862 | - **readonly:** `true` 1863 | 1864 | 1865 | ### print_handles `false` *{Boolean}* 1866 | 1867 | report handles after GC 1868 | 1869 | - **default:** `false` 1870 | - **type:** `Boolean` 1871 | - **readonly:** `true` 1872 | 1873 | 1874 | ### print_global_handles `false` *{Boolean}* 1875 | 1876 | report global handles after GC 1877 | 1878 | - **default:** `false` 1879 | - **type:** `Boolean` 1880 | - **readonly:** `true` 1881 | 1882 | 1883 | ### trace_ic `false` *{Boolean}* 1884 | 1885 | trace inline cache state transitions 1886 | 1887 | - **default:** `false` 1888 | - **type:** `Boolean` 1889 | - **readonly:** `true` 1890 | 1891 | 1892 | ### print_interfaces `false` *{Boolean}* 1893 | 1894 | print interfaces 1895 | 1896 | - **default:** `false` 1897 | - **type:** `Boolean` 1898 | - **readonly:** `true` 1899 | 1900 | 1901 | ### print_interface_details `false` *{Boolean}* 1902 | 1903 | print interface inference details 1904 | 1905 | - **default:** `false` 1906 | - **type:** `Boolean` 1907 | - **readonly:** `true` 1908 | 1909 | 1910 | ### print_interface_depth `5` *{Integer}* 1911 | 1912 | depth for printing interfaces 1913 | 1914 | - **default:** `5` 1915 | - **type:** `Integer` 1916 | - **readonly:** `true` 1917 | 1918 | 1919 | ### trace_normalization `false` *{Boolean}* 1920 | 1921 | prints when objects are turned into dictionaries. 1922 | 1923 | - **default:** `false` 1924 | - **type:** `Boolean` 1925 | - **readonly:** `true` 1926 | 1927 | 1928 | ### trace_lazy `false` *{Boolean}* 1929 | 1930 | trace lazy compilation 1931 | 1932 | - **default:** `false` 1933 | - **type:** `Boolean` 1934 | - **readonly:** `true` 1935 | 1936 | 1937 | ### collect_heap_spill_statistics `false` *{Boolean}* 1938 | 1939 | report heap spill statistics along with heap_stats (requires heap_stats) 1940 | 1941 | - **default:** `false` 1942 | - **type:** `Boolean` 1943 | - **readonly:** `true` 1944 | 1945 | 1946 | ### trace_isolates `false` *{Boolean}* 1947 | 1948 | trace isolate state changes 1949 | 1950 | - **default:** `false` 1951 | - **type:** `Boolean` 1952 | - **readonly:** `true` 1953 | 1954 | 1955 | ### log_state_changes `false` *{Boolean}* 1956 | 1957 | Log state changes. 1958 | 1959 | - **default:** `false` 1960 | - **type:** `Boolean` 1961 | - **readonly:** `true` 1962 | 1963 | 1964 | ### regexp_possessive_quantifier `false` *{Boolean}* 1965 | 1966 | enable possessive quantifier syntax for testing 1967 | 1968 | - **default:** `false` 1969 | - **type:** `Boolean` 1970 | - **readonly:** `true` 1971 | 1972 | 1973 | ### trace_regexp_bytecodes `false` *{Boolean}* 1974 | 1975 | trace regexp bytecode execution 1976 | 1977 | - **default:** `false` 1978 | - **type:** `Boolean` 1979 | - **readonly:** `true` 1980 | 1981 | 1982 | ### trace_regexp_assembler `false` *{Boolean}* 1983 | 1984 | trace regexp macro assembler calls. 1985 | 1986 | - **default:** `false` 1987 | - **type:** `Boolean` 1988 | - **readonly:** `true` 1989 | 1990 | 1991 | ### log `false` *{Boolean}* 1992 | 1993 | Minimal logging (no API, code, GC, suspect, or handles samples). 1994 | 1995 | - **default:** `false` 1996 | - **type:** `Boolean` 1997 | - **readonly:** `false` 1998 | 1999 | 2000 | ### log_all `false` *{Boolean}* 2001 | 2002 | Log all events to the log file. 2003 | 2004 | - **default:** `false` 2005 | - **type:** `Boolean` 2006 | - **readonly:** `false` 2007 | 2008 | 2009 | ### log_runtime `false` *{Boolean}* 2010 | 2011 | Activate runtime system %Log call. 2012 | 2013 | - **default:** `false` 2014 | - **type:** `Boolean` 2015 | - **readonly:** `false` 2016 | 2017 | 2018 | ### log_api `false` *{Boolean}* 2019 | 2020 | Log API events to the log file. 2021 | 2022 | - **default:** `false` 2023 | - **type:** `Boolean` 2024 | - **readonly:** `false` 2025 | 2026 | 2027 | ### log_code `false` *{Boolean}* 2028 | 2029 | Log code events to the log file without profiling. 2030 | 2031 | - **default:** `false` 2032 | - **type:** `Boolean` 2033 | - **readonly:** `false` 2034 | 2035 | 2036 | ### log_gc `false` *{Boolean}* 2037 | 2038 | Log heap samples on garbage collection for the hp2ps tool. 2039 | 2040 | - **default:** `false` 2041 | - **type:** `Boolean` 2042 | - **readonly:** `false` 2043 | 2044 | 2045 | ### log_handles `false` *{Boolean}* 2046 | 2047 | Log global handle events. 2048 | 2049 | - **default:** `false` 2050 | - **type:** `Boolean` 2051 | - **readonly:** `false` 2052 | 2053 | 2054 | ### log_snapshot_positions `false` *{Boolean}* 2055 | 2056 | log positions of (de)serialized objects in the snapshot. 2057 | 2058 | - **default:** `false` 2059 | - **type:** `Boolean` 2060 | - **readonly:** `false` 2061 | 2062 | 2063 | ### log_suspect `false` *{Boolean}* 2064 | 2065 | Log suspect operations. 2066 | 2067 | - **default:** `false` 2068 | - **type:** `Boolean` 2069 | - **readonly:** `false` 2070 | 2071 | 2072 | ### prof `false` *{Boolean}* 2073 | 2074 | Log statistical profiling information (implies --log-code). 2075 | 2076 | - **default:** `false` 2077 | - **type:** `Boolean` 2078 | - **readonly:** `false` 2079 | 2080 | 2081 | ### prof_auto `true` *{Boolean}* 2082 | 2083 | Used with --prof, starts profiling automatically 2084 | 2085 | - **default:** `true` 2086 | - **type:** `Boolean` 2087 | - **readonly:** `false` 2088 | 2089 | 2090 | ### prof_lazy `false` *{Boolean}* 2091 | 2092 | Used with --prof, only does sampling and logging when profiler is active (implies --noprof_auto). 2093 | 2094 | - **default:** `false` 2095 | - **type:** `Boolean` 2096 | - **readonly:** `false` 2097 | 2098 | 2099 | ### prof_browser_mode `true` *{Boolean}* 2100 | 2101 | Used with --prof, turns on browser-compatible mode for profiling. 2102 | 2103 | - **default:** `true` 2104 | - **type:** `Boolean` 2105 | - **readonly:** `false` 2106 | 2107 | 2108 | ### log_regexp `false` *{Boolean}* 2109 | 2110 | Log regular expression execution. 2111 | 2112 | - **default:** `false` 2113 | - **type:** `Boolean` 2114 | - **readonly:** `false` 2115 | 2116 | 2117 | ### sliding_state_window `false` *{Boolean}* 2118 | 2119 | Update sliding state window counters. 2120 | 2121 | - **default:** `false` 2122 | - **type:** `Boolean` 2123 | - **readonly:** `false` 2124 | 2125 | 2126 | ### logfile `v8.log` *{String}* 2127 | 2128 | Specify the name of the log file. 2129 | 2130 | - **default:** `v8.log` 2131 | - **type:** `String` 2132 | - **readonly:** `false` 2133 | 2134 | 2135 | ### ll_prof `false` *{Boolean}* 2136 | 2137 | Enable low-level linux profiler. 2138 | 2139 | - **default:** `false` 2140 | - **type:** `Boolean` 2141 | - **readonly:** `false` 2142 | 2143 | 2144 | ### trace_elements_transitions `false` *{Boolean}* 2145 | 2146 | trace elements transitions 2147 | 2148 | - **default:** `false` 2149 | - **type:** `Boolean` 2150 | - **readonly:** `true` 2151 | 2152 | 2153 | ### print_code_stubs `false` *{Boolean}* 2154 | 2155 | print code stubs 2156 | 2157 | - **default:** `false` 2158 | - **type:** `Boolean` 2159 | - **readonly:** `true` 2160 | 2161 | 2162 | ### test_secondary_stub_cache `false` *{Boolean}* 2163 | 2164 | test secondary stub cache by disabling the primary one 2165 | 2166 | - **default:** `false` 2167 | - **type:** `Boolean` 2168 | - **readonly:** `true` 2169 | 2170 | 2171 | ### test_primary_stub_cache `false` *{Boolean}* 2172 | 2173 | test primary stub cache by disabling the secondary one 2174 | 2175 | - **default:** `false` 2176 | - **type:** `Boolean` 2177 | - **readonly:** `true` 2178 | 2179 | 2180 | ### print_code `false` *{Boolean}* 2181 | 2182 | print generated code 2183 | 2184 | - **default:** `false` 2185 | - **type:** `Boolean` 2186 | - **readonly:** `true` 2187 | 2188 | 2189 | ### print_opt_code `false` *{Boolean}* 2190 | 2191 | print optimized code 2192 | 2193 | - **default:** `false` 2194 | - **type:** `Boolean` 2195 | - **readonly:** `true` 2196 | 2197 | 2198 | ### print_unopt_code `false` *{Boolean}* 2199 | 2200 | print unoptimized code before printing optimized code based on it 2201 | 2202 | - **default:** `false` 2203 | - **type:** `Boolean` 2204 | - **readonly:** `true` 2205 | 2206 | 2207 | ### print_code_verbose `false` *{Boolean}* 2208 | 2209 | print more information for code 2210 | 2211 | - **default:** `false` 2212 | - **type:** `Boolean` 2213 | - **readonly:** `true` 2214 | 2215 | 2216 | ### print_builtin_code `false` *{Boolean}* 2217 | 2218 | print generated code for builtins 2219 | 2220 | - **default:** `false` 2221 | - **type:** `Boolean` 2222 | - **readonly:** `true` 2223 | 2224 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var v8_flags = require('./build/Release/v8_flags') 4 | , v8_meta = require('./build/Release/v8_flags_meta') 5 | , v8_flag_list = require('./build/Release/v8_flag_list') 6 | 7 | // The following flags aren't configurable after startup since they activate (or don't) during the bootstrapping process 8 | // https://github.com/v8/v8/blob/146bf7bec2518cf664994a658dfc4a72a9c6bb10/src/bootstrapper.cc#L86-L97 9 | var notConfigurable = [ 10 | 'expose_gc' 11 | , 'expose_gc_as' 12 | , 'expose_natives_as' 13 | , 'debugger' 14 | , 'debugger_agent' 15 | , 'debugger_port' 16 | , 'expose_debug_as' 17 | , 'harmony_proxies' 18 | , 'harmony_collections' 19 | ] 20 | 21 | /** 22 | * Exposes methods to get and set v8 flags. 23 | * 24 | * #### Example 25 | * 26 | * ```js 27 | * var flags = require('v8-flags').flags; 28 | * console.log(flags.use_strict()); // false 29 | * flags.use_strict(true) 30 | * console.log(flags.use_strict()); // true 31 | * ``` 32 | * 33 | * @name flags 34 | * @function 35 | */ 36 | var flags = exports.flags = v8_flags; 37 | 38 | // 39 | /** 40 | * The meta data for the flags. 41 | * 42 | * It is initialized on startup from the definitions found in C++ land. 43 | * 44 | * @name meta 45 | * @function 46 | * @return {Array.} array of objects with the folloing properties each 47 | * 48 | * - **name:** flag name 49 | * - **default:** default setting of the flag 50 | * - **type:** type of the flag 51 | * - **description:** the description of the flag 52 | * - **readonly:** set `true` if flag cannot be set 53 | * - **configurable:** set `true` if setting the flag at runtime has the desired effect 54 | * - **implications:** flags that will be set to `true` whenever this flag is `true` and `enforceFlagImplications` is called 55 | * - **negativeImplications:** flags that will be set to `false` whenever this flag is `false` and `enforceFlagImplications` is called 56 | */ 57 | exports.meta = Object.keys(v8_meta) 58 | .filter(function (k) { 59 | return k.slice(0, 13) !== 'implications_' 60 | && k.slice(0, 17) !== 'neg_implications_' 61 | }) 62 | .reduce(function (acc, k) { 63 | var implications, neg_implications; 64 | v8_meta['implications_' + k](function () { 65 | implications = [].slice.call(arguments); 66 | }) 67 | v8_meta['neg_implications_' + k](function () { 68 | neg_implications = [].slice.call(arguments); 69 | }) 70 | v8_meta[k](function () { 71 | acc[k] = { 72 | name : arguments[0] 73 | , default : arguments[1] 74 | , description : arguments[2] 75 | , type : arguments[3] 76 | , readonly : arguments[4] 77 | , implications : implications 78 | , negativeImplications : neg_implications 79 | , configurable : !~notConfigurable.indexOf(k) 80 | } 81 | }); 82 | return acc; 83 | }, {}); 84 | 85 | /** 86 | * Lists all flags along with their **current** value. 87 | * 88 | * @name listFlags 89 | * @function 90 | * @return {Object} key/value pair for each flag 91 | */ 92 | exports.listFlags = function () { 93 | return Object.keys(flags) 94 | .reduce(function (acc, k) { 95 | acc[k] = flags[k](); 96 | return acc; 97 | }, {}) 98 | } 99 | 100 | /** 101 | * Prints flag help to the console. 102 | * 103 | * @name printHelp 104 | * @function 105 | */ 106 | exports.printHelp = v8_flag_list.printHelp; 107 | 108 | /** 109 | * Resets all flags to their default values 110 | * 111 | * @name resetAllFlags 112 | * @function 113 | */ 114 | exports.resetAllFlags = v8_flag_list.resetAllFlags; 115 | 116 | 117 | /** 118 | * Enforces all flag implications. 119 | * 120 | * @name enforceFlagImplications 121 | * @function 122 | */ 123 | exports.enforceFlagImplications = v8_flag_list.enforceFlagImplications; 124 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "v8-flags", 3 | "version": "0.1.2", 4 | "description": "Configures v8 flags at runtime.", 5 | "main": "index.js", 6 | "scripts": { 7 | "preinstall": "node ./scripts/preinstall", 8 | "install": "node-gyp rebuild", 9 | "build": "node-gyp build", 10 | "gyp-remove": "node-gyp remove `node -e 'console.log(process.version)'`", 11 | "test-main": "sh test.sh `node --version`", 12 | "test-0.8": "sh test.sh 0.8", 13 | "test-0.10": "sh test.sh 0.10", 14 | "test-0.11": "sh test.sh 0.11", 15 | "test-all": "npm run test-main && npm run test-0.8 && npm run test-0.10 && npm run test-0.11", 16 | "test": "if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi", 17 | "flag-doc-0.8": "nave use 0.8 npm install && nave use 0.8 node ./scripts/gen-flag-doc > flags-0.8.md", 18 | "flag-doc-0.10": "nave use 0.10 npm install && nave use 0.10 node ./scripts/gen-flag-doc > flags-0.10.md", 19 | "flag-doc-0.11": "nave use 0.11 npm install && nave use 0.11 node ./scripts/gen-flag-doc > flags-0.11.md", 20 | "flag-doc": "npm run flag-doc-0.8 && npm run flag-doc-0.10 && npm run flag-doc-0.11", 21 | "docme": "docme README.md -- --configure .jsdocrc" 22 | }, 23 | "repository": { 24 | "type": "git", 25 | "url": "git://github.com/thlorenz/v8-flags.git" 26 | }, 27 | "homepage": "https://github.com/thlorenz/v8-flags", 28 | "dependencies": { 29 | "nan": "~1.2.0" 30 | }, 31 | "devDependencies": { 32 | "doctoc": "~0.7.1", 33 | "nave": "~0.4.3", 34 | "semver": "~2.3.1", 35 | "tap": "~0.4.11" 36 | }, 37 | "keywords": [ 38 | "v8", 39 | "flags", 40 | "configure", 41 | "tune" 42 | ], 43 | "author": { 44 | "name": "Thorsten Lorenz", 45 | "email": "thlorenz@gmx.de", 46 | "url": "http://thlorenz.com" 47 | }, 48 | "license": { 49 | "type": "MIT", 50 | "url": "https://github.com/thlorenz/v8-flags/blob/master/LICENSE" 51 | }, 52 | "engine": { 53 | "node": ">=0.8" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /scripts/comments/always_opt.md: -------------------------------------------------------------------------------- 1 | **Note**: not properly working below **node:** `0.10` - **v8:** `3.14` 2 | -------------------------------------------------------------------------------- /scripts/comments/always_osr.md: -------------------------------------------------------------------------------- 1 | OSR (*On Stack Replacement*) is used to convert a running function’s interpreter frame into a JIT’d frame – in the middle of that method. 2 | 3 | #### Resources: 4 | 5 | - [Efficient and General On-Stack Replacement for Aggressive Program Specialization](http://www.cs.ucsb.edu/~ckrintz/papers/osr.pdf) 6 | - [What the heck is OSR](http://www.azulsystems.com/blog/cliff/2011-11-22-what-the-heck-is-osr-and-why-is-it-bad-or-good) 7 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/runtime-profiler.cc#L178-L185) 8 | 9 | 10 | **Note**: available starting with **node:** `0.10` - **v8:** `3.14` 11 | -------------------------------------------------------------------------------- /scripts/comments/cache_prototype_transitions.md: -------------------------------------------------------------------------------- 1 | #### Resources: 2 | 3 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/objects.cc#L12076) 4 | -------------------------------------------------------------------------------- /scripts/comments/check_elimination.md: -------------------------------------------------------------------------------- 1 | #### Resources 2 | 3 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/hydrogen.cc#L4029) 4 | -------------------------------------------------------------------------------- /scripts/comments/code_comments.md: -------------------------------------------------------------------------------- 1 | #### Resources 2 | 3 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/lithium-codegen.cc#L66-L73) 4 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/heap.cc#L4528-L4536) 5 | 6 | **Note**: not available below **node:** `0.11` - **v8:** `3.25` 7 | -------------------------------------------------------------------------------- /scripts/comments/code_stats.md: -------------------------------------------------------------------------------- 1 | #### Resources 2 | 3 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/heap.cc#L582) 4 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/heap.cc#L4528-L4536) 5 | -------------------------------------------------------------------------------- /scripts/comments/compilation_cache.md: -------------------------------------------------------------------------------- 1 | The compilation cache keeps shared function infos for compiled 2 | scripts and evals. The shared function infos are looked up using 3 | the source string as the key. For regular expressions the 4 | compilation data is cached. 5 | 6 | Enable/Disable is used by debugger to disable compilation cache during debugging to make sure new scripts are always 7 | compiled, however both this flag and the `enabled_` property need to be `true` in order for the compilation cache to get 8 | used. 9 | 10 | #### Resources 11 | 12 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/compilation-cache.h#L220) 13 | - [v8 source](https://github.com/v8/v8/blob/3.26.33/src/debug.cc#L3292-L3301) 14 | -------------------------------------------------------------------------------- /scripts/comments/concurrent_sweeping.md: -------------------------------------------------------------------------------- 1 | #### Resources 2 | 3 | - [v8 mark-compact.cc](https://github.com/v8/v8/blob/3.26.33/src/mark-compact.cc#L210-L211) 4 | - [v8 mark-compact.cc](https://github.com/v8/v8/blob/3.26.33/src/mark-compact.cc#L4253) 5 | - [v8 sweeper-thread.cc](https://github.com/v8/v8/blob/3.26.33/src/sweeper-thread.cc#L79-L81) 6 | 7 | **Note**: not available below **node:** `0.11` - **v8:** `3.25` 8 | -------------------------------------------------------------------------------- /scripts/comments/crankshaft.md: -------------------------------------------------------------------------------- 1 | #### Resources 2 | 3 | - [v8 isolate.cc](https://github.com/v8/v8/blob/3.26.33/src/isolate.cc#L1778) 4 | - [v8 runtime.cc](https://github.com/v8/v8/blob/3.26.33/src/runtime.cc#L8509) 5 | -------------------------------------------------------------------------------- /scripts/comments/dead_code_elimination.md: -------------------------------------------------------------------------------- 1 | #### Resources 2 | 3 | [v8 hydrogen.cc](https://github.com/v8/v8/blob/3.26.33/src/hydrogen.cc#L3999) 4 | [v8 hydrogin-dce.cc](https://github.com/v8/v8/blob/3.26.33/src/hydrogen-dce.cc) 5 | 6 | **Note**: not available below **node:** `0.10` - **v8:** `3.14` 7 | -------------------------------------------------------------------------------- /scripts/comments/debug_compile_events.md: -------------------------------------------------------------------------------- 1 | #### Resources 2 | 3 | [v8 debug.h](https://github.com/v8/v8/blob/3.26.33/src/debug.h#L843-L845) 4 | 5 | **Note:** disabled by default on `WebOS` 6 | -------------------------------------------------------------------------------- /scripts/comments/debug_sim.md: -------------------------------------------------------------------------------- 1 | At this point this is only used inside the arm64 simulator. 2 | 3 | #### Resources 4 | 5 | [v8 arm64/simulator-arm64.cc](https://github.com/v8/v8/blob/3.26.33/src/arm64/simulator-arm64.cc#L113-L114) 6 | 7 | **Note**: not available below **node:** `0.11` - **v8:** `3.25` 8 | -------------------------------------------------------------------------------- /scripts/comments/debugger.md: -------------------------------------------------------------------------------- 1 | Only considered by **d8** in order to decide if the in process debugger should be activated. 2 | 3 | #### Resources 4 | 5 | [v8 d8.cc](https://github.com/v8/v8/blob/3.26.33/src/d8.cc#L799-L801) 6 | -------------------------------------------------------------------------------- /scripts/comments/debugger_agent.md: -------------------------------------------------------------------------------- 1 | Cnsidered **only** by **d8** in order to decide if the in debugger agent should be activated. 2 | 3 | #### Resources 4 | 5 | [v8 d8.cc](https://github.com/v8/v8/blob/3.26.33/src/d8.cc#L925-928) 6 | -------------------------------------------------------------------------------- /scripts/comments/debugger_port.md: -------------------------------------------------------------------------------- 1 | Cnsidered **only** by **d8** in order to decide on which port the remote debugger should listen. 2 | 3 | #### Resources 4 | 5 | [v8 d8.cc](https://github.com/v8/v8/blob/3.26.33/src/d8.cc#L925-928) 6 | -------------------------------------------------------------------------------- /scripts/comments/harmony_collections.md: -------------------------------------------------------------------------------- 1 | #### References 2 | 3 | - [v8 bootstrapper.cc](https://github.com/v8/v8/blob/3.25.30/src/bootstrapper.cc#L1363-L1374) 4 | - [example](http://dailyjs.com/2012/10/15/preparing-for-esnext/#example_collections) 5 | -------------------------------------------------------------------------------- /scripts/comments/harmony_modules.md: -------------------------------------------------------------------------------- 1 | #### References 2 | 3 | - [spec](http://wiki.ecmascript.org/doku.php?id=harmony:modules) 4 | - [v8 parser.cc](https://github.com/v8/v8/blob/3.25.30/src/parser.cc#L1147) 5 | -------------------------------------------------------------------------------- /scripts/comments/harmony_proxies.md: -------------------------------------------------------------------------------- 1 | #### Resources 2 | 3 | - [v8 bootstrapper.cc](https://github.com/v8/v8/blob/3.25.30/src/bootstrapper.cc#L1609-L1614) 4 | - [spec draft](http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxies) 5 | -------------------------------------------------------------------------------- /scripts/comments/harmony_scope.md: -------------------------------------------------------------------------------- 1 | #### Resources 2 | 3 | - [example](https://github.com/thlorenz/es6ify#block-scope-let) 4 | -------------------------------------------------------------------------------- /scripts/comments/harmony_typeof.md: -------------------------------------------------------------------------------- 1 | **Note:** this feature seems to work in v8 even without turning on this flag. 2 | 3 | #### Resources 4 | 5 | - *rejected?* [proposal](http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null&s=typeof) 6 | -------------------------------------------------------------------------------- /scripts/gen-flag-doc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var fs = require('fs') 4 | , path = require('path') 5 | , meta = require('../').meta 6 | , doctoc = require('doctoc/lib/transform') 7 | 8 | function implications(v) { 9 | var s = ''; 10 | if (v.implications.length) s += '\n#### Implications\n\n- ' + v.implications.join('\n- '); 11 | if (v.negativeImplications.length) s += '\n#### Negative implications\n\n- ' + v.negativeImplications.join('\n- '); 12 | return s.length ? s : undefined; 13 | } 14 | 15 | function configurable(v) { 16 | return v.configurable ? undefined : '\n**NOTE:** This flag cannot be configured after the process started up!\n'; 17 | } 18 | 19 | function docsFor(v) { 20 | return [ 21 | '' 22 | , '### ' + v.name + ' `' + v.default + '` *{' + v.type + '}*' 23 | , '' 24 | , v.description 25 | , '' 26 | , configurable(v) 27 | , '- **default:** `' + v.default + '`' 28 | , '- **type:** `' + v.type + '`' 29 | , '- **readonly:** `' + v.readonly + '`' 30 | , implications(v) 31 | , v.comment 32 | ] 33 | .filter(function (x) { return x !== undefined }) 34 | } 35 | 36 | function commentFromFile(name) { 37 | var filename = path.join(__dirname, 'comments', name + '.md'); 38 | if (!fs.existsSync(filename)) return null; 39 | 40 | return fs.readFileSync(filename, 'utf8').trim(/\\n/g) 41 | } 42 | 43 | var lines = Object.keys(meta) 44 | .reduce(function (acc, k) { 45 | var v = meta[k]; 46 | var comment = commentFromFile(v.name); 47 | v.comment = comment ? '\n' + comment : ''; 48 | return acc.concat(docsFor(v)); 49 | }, []) 50 | 51 | var api = lines.join('\n') 52 | var tocced = doctoc(api).data; 53 | 54 | console.log(tocced) 55 | -------------------------------------------------------------------------------- /scripts/preinstall.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var path = require('path') 4 | , fs = require('fs') 5 | , cp = require('child_process') 6 | 7 | var defineRe = /^ *DEFINE_(\w+)\(([^,]+), *([^,]+), *("[^"]+" *)+\)/; 8 | var defineArgsRe = /^ *DEFINE_args\(([^,"]+, *){1,2} *".+"\)/; 9 | 10 | function inspect(obj, depth) { 11 | console.error(require('util').inspect(obj, false, depth || 5, true)); 12 | } 13 | var gypPath = path.join(process.env.HOME, ".node-gyp", process.versions.node); 14 | if (fs.existsSync(gypPath)) { 15 | extractFlagDefinitions(); 16 | } else { 17 | console.log('Installing node-gyp files for node', process.version); 18 | cp.exec('node-gyp install', { stdio: 'inherit' }, function (err, stderr, stdout) { 19 | if (err) return console.error(err); 20 | console.log(stderr); 21 | console.log(stdout); 22 | extractFlagDefinitions(); 23 | }); 24 | } 25 | 26 | // some calls stretch across multiple lines, so we need to ensure to remove them completely 27 | function removeComplete(regex, lines, start) { 28 | var matches = lines[start].match(regex); 29 | var i = 0; 30 | var s = lines[start]; 31 | matches = s.match(regex); 32 | 33 | while (!matches) { 34 | i++; 35 | if ((start + i) > lines.length) return; 36 | s += lines[start + i]; 37 | matches = s.match(regex); 38 | } 39 | lines.splice(start, i + 1); 40 | } 41 | 42 | function removeDefine(lines, name) { 43 | var regexp = new RegExp('^ *DEFINE_\\w+\\(' + name + ','); 44 | for (var i = 0; i < lines.length; i++) { 45 | if (regexp.test(lines[i])) { 46 | removeComplete(defineRe, lines, i); 47 | break; 48 | } 49 | } 50 | } 51 | 52 | function removeDefineArgs(lines) { 53 | var regexp = /^ *DEFINE_args\(/; 54 | 55 | for (var i = 0; i < lines.length; i++) { 56 | if (regexp.test(lines[i])) { 57 | removeComplete(defineArgsRe, lines, i); 58 | i--; 59 | } 60 | } 61 | } 62 | 63 | function extractFlagDefinitions() { 64 | var flagDefinitionsHeader = path.join(gypPath, 'deps', 'v8', 'src', 'flag-definitions.h'); 65 | var lines = fs.readFileSync(flagDefinitionsHeader, 'utf8').split('\n'); 66 | 67 | // remove everything up to the FLAG declaration above the first definition 68 | while(!(/^ *#define *FLAG *FLAG_FULL *$/).test(lines[0])) lines.shift(); 69 | // inculde everything up to // Cleanup 70 | // that is a bit brittle but may work for good if that comment stays ;) 71 | while(!(/^\/\/ *Cleanup[.]+ * *$/).test(lines[lines.length - 1])) lines.pop(); 72 | 73 | // DEFINE_args are meaningess here and changes arg len from 3 to 2 between versions 74 | // so not easily fixed by just supplying an empty define, therefore clean that up here 75 | removeDefineArgs(lines); 76 | 77 | // remove test flags 78 | [ 'testing_bool_flag' 79 | , 'testing_maybe_bool_flag' 80 | , 'testing_int_flag' 81 | , 'testing_float_flag' 82 | , 'testing_string_flag' // not matched due to comma in string (not important) 83 | , 'testing_prng_seed' 84 | ].forEach(removeDefine.bind(null, lines)) 85 | 86 | var flagDefinitionsFile = path.join(__dirname, '..', 'src', 'v8_flag_definitions.h'); 87 | fs.writeFileSync(flagDefinitionsFile, lines.join('\n'), 'utf8'); 88 | } 89 | -------------------------------------------------------------------------------- /src/implications.h: -------------------------------------------------------------------------------- 1 | #ifndef __V8_FLAGS_IMPLICATIONS__ 2 | #define __V8_FLAGS_IMPLICATIONS__ 3 | 4 | #include 5 | #include "v8.h" 6 | #include "nan.h" 7 | 8 | #define MAX_IMPLICATIONS 20 9 | 10 | class SizedArray { 11 | const char* _items[MAX_IMPLICATIONS]; 12 | int _len; 13 | public: 14 | SizedArray() : _len(0) {} 15 | void add(const char* el) { _items[_len++] = el; } 16 | const char** items() { return _items; } 17 | int len() const { return _len; } 18 | }; 19 | 20 | typedef std::map Implications; 21 | static Implications implications; 22 | static Implications neg_implications; 23 | 24 | void create_implications(const char* name) { 25 | implications[name] = new SizedArray(); 26 | } 27 | 28 | void add_implication(const char* name, const char* impl) { 29 | implications[name]->add(impl); 30 | } 31 | 32 | void create_neg_implications(const char* name) { 33 | neg_implications[name] = new SizedArray(); 34 | } 35 | 36 | void add_neg_implication(const char* name, const char* impl) { 37 | neg_implications[name]->add(impl); 38 | } 39 | 40 | void get_implications(const char* name, v8::Local* argv, int* len) { 41 | *len = implications[name]->len(); 42 | const char **items = implications[name]->items(); 43 | 44 | for(int i = 0; i < *len; i++) { 45 | argv[i] = NanNew(items[i]); 46 | } 47 | } 48 | 49 | void get_neg_implications(const char* name, v8::Local* argv, int* len) { 50 | *len = neg_implications[name]->len(); 51 | const char **items = neg_implications[name]->items(); 52 | 53 | for(int i = 0; i < *len; i++) { 54 | argv[i] = NanNew(items[i]); 55 | } 56 | } 57 | #endif 58 | -------------------------------------------------------------------------------- /src/v8_flag_list.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "v8.h" 3 | 4 | #include "atomicops.h" 5 | #include "flags.h" 6 | #include 7 | 8 | namespace i = v8::internal; 9 | 10 | // Reset all flags to their default value. 11 | NAN_METHOD(ResetAllFlags) { 12 | i::FlagList::ResetAllFlags(); 13 | NanReturnUndefined(); 14 | } 15 | 16 | // Print help to stdout with flags, types, and default values. 17 | NAN_METHOD(PrintHelp) { 18 | i::FlagList::PrintHelp(); 19 | NanReturnUndefined(); 20 | } 21 | 22 | // Set flags as consequence of being implied by another flag. 23 | NAN_METHOD(EnforceFlagImplications) { 24 | i::FlagList::EnforceFlagImplications(); 25 | NanReturnUndefined(); 26 | } 27 | 28 | void init(v8::Handle exports) { 29 | exports->Set(NanNew("resetAllFlags"), NanNew(ResetAllFlags)->GetFunction()); 30 | exports->Set(NanNew("printHelp"), NanNew(PrintHelp)->GetFunction()); 31 | exports->Set(NanNew("enforceFlagImplications"), NanNew(EnforceFlagImplications)->GetFunction()); 32 | } 33 | 34 | NODE_MODULE(v8_flag_list, init) 35 | -------------------------------------------------------------------------------- /src/v8_flags.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "v8.h" 3 | 4 | #include "atomicops.h" 5 | #include "flags.h" 6 | #include 7 | 8 | namespace i = v8::internal; 9 | 10 | void ensureBoolean(v8::Local arg, const char* error) { 11 | if (arg->IsBoolean()) return; 12 | NanThrowError(error, -1); 13 | /*NanThrowError("Need to supply argument of type " 14 | " when setting '" "' flag!", -1);*/ 15 | } 16 | 17 | void ensureInt32(v8::Local arg, const char* error) { 18 | if (arg->IsInt32()) return; 19 | NanThrowError(error, -1); 20 | } 21 | 22 | void ensureNumber(v8::Local arg, const char* error) { 23 | if (arg->IsNumber()) return; 24 | NanThrowError(error, -1); 25 | } 26 | 27 | void ensureString(v8::Local arg, const char* error) { 28 | if (arg->IsString()) return; 29 | NanThrowError(error, -1); 30 | } 31 | 32 | bool convert(v8::Handle arg) { 33 | return arg->BooleanValue(); 34 | } 35 | 36 | int32_t convert(v8::Handle arg) { 37 | return arg->Int32Value(); 38 | } 39 | 40 | double convert(v8::Handle arg) { 41 | return arg->NumberValue(); 42 | } 43 | 44 | char* convert(v8::Handle arg) { 45 | size_t len; 46 | return NanCString(arg, &len); 47 | } 48 | 49 | // The below are just to avoid warning when checking for null for primitive types 50 | // via the Get_##nam macros. Overloaded functions are a quick and dirty way to run differnent code per type. 51 | bool is_null(bool val) { 52 | return false; 53 | } 54 | 55 | bool is_null(int val) { 56 | return false; 57 | } 58 | 59 | bool is_null(float val) { 60 | return false; 61 | } 62 | 63 | bool is_null(const char* val) { 64 | return val == NULL; 65 | } 66 | 67 | /* v8 flag-definitions.h not properly cleaning this one up */ 68 | #undef DEFINE_float 69 | #undef DEFINE_args 70 | #undef FLAG 71 | 72 | #define S(x) #x 73 | #define DEFINE_bool(nam, def, cmt) FLAG(Boolean, nam, Boolean) 74 | #define DEFINE_int(nam, def, cmt) FLAG(Integer, nam, Int32) 75 | #define DEFINE_float(nam, def, cmt) FLAG(Number, nam, Number) 76 | #define DEFINE_string(nam, def, cmt) FLAG(String, nam, String) 77 | #define DEFINE_implication(x, y) 78 | #define DEFINE_neg_implication(x, y) 79 | #define DEFINE_maybe_bool(name, def) 80 | 81 | #define FLAG_FULL(type, nam, istype) \ 82 | NAN_METHOD(Access_##nam) { \ 83 | NanScope(); \ 84 | if (args.Length()) { \ 85 | ensure##istype(args[0], \ 86 | "Need to supply argument of type " S(type) \ 87 | " when setting '" S(nam) "' flag!"); \ 88 | \ 89 | v8::Handle flag = args[0]->To##type(); \ 90 | i::FLAG_##nam = convert(flag); \ 91 | NanReturnUndefined(); \ 92 | } else { \ 93 | if (is_null(i::FLAG_##nam)) { \ 94 | NanReturnUndefined(); \ 95 | } else { \ 96 | NanReturnValue(NanNew(i::FLAG_##nam)); \ 97 | } \ 98 | } \ 99 | } 100 | 101 | #define FLAG_READONLY(type, nam, istype) \ 102 | NAN_METHOD(Access_##nam) { \ 103 | NanScope(); \ 104 | if (is_null(i::FLAG_##nam)) { \ 105 | NanReturnUndefined(); \ 106 | } else { \ 107 | NanReturnValue(NanNew(i::FLAG_##nam)); \ 108 | } \ 109 | } 110 | 111 | #include "v8_flag_definitions.h" 112 | 113 | #undef FLAG_FULL 114 | #undef FLAG_READONLY 115 | #undef FLAG 116 | 117 | #define FLAG_FULL(type, nam, istype) \ 118 | exports->Set(NanNew(S(nam)), NanNew(Access_##nam)->GetFunction()); 119 | 120 | #define FLAG_READONLY(type, nam, istype) FLAG_FULL(type, nam, istype) 121 | 122 | void init(v8::Handle exports) { 123 | #include "v8_flag_definitions.h" 124 | } 125 | 126 | #undef DEFINE_bool 127 | #undef DEFINE_int 128 | #undef DEFINE_float 129 | #undef DEFINE_string 130 | #undef FLAG_FULL 131 | #undef FLAG_READONLY 132 | #undef S 133 | #undef DEFINE_implication 134 | #undef DEFINE_neg_implication 135 | #undef DEFINE_maybe_bool 136 | 137 | NODE_MODULE(v8_flags, init) 138 | -------------------------------------------------------------------------------- /src/v8_flags_meta.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "v8.h" 3 | 4 | #include "atomicops.h" 5 | #include "flags.h" 6 | #include 7 | #include "implications.h" 8 | 9 | namespace i = v8::internal; 10 | using i::kPointerSize; 11 | using i::MB; 12 | using i::KB; 13 | 14 | // The below are just to avoid warning when checking for null for primitive types 15 | // via the Get_##nam macros. Overloaded functions are a quick and dirty way to run differnent code per type. 16 | bool is_null(bool val) { 17 | return false; 18 | } 19 | 20 | bool is_null(int val) { 21 | return false; 22 | } 23 | 24 | bool is_null(float val) { 25 | return false; 26 | } 27 | 28 | bool is_null(const char* val) { 29 | return val == NULL; 30 | } 31 | 32 | #undef DEFINE_float 33 | #undef DEFINE_args 34 | #undef FLAG 35 | #define DEFINE_bool(nam, def, cmt) FLAG(nam, def, cmt, Boolean) 36 | #define DEFINE_int(nam, def, cmt) FLAG(nam, def, cmt, Integer) 37 | #define DEFINE_float(nam, def, cmt) FLAG(nam, def, cmt, Number) 38 | #define DEFINE_string(nam, def, cmt) FLAG(nam, (const char*)def, cmt, String) 39 | #define DEFINE_implication(nam, implication) 40 | #define DEFINE_neg_implication(nam, implication) 41 | #define DEFINE_maybe_bool(name, def) 42 | 43 | #define FLAG_FULL(nam, def, cmt, type) CREATE_function(nam, def, cmt, type, false) 44 | #define FLAG_READONLY(nam, def, cmt, type) CREATE_function(nam, def, cmt, type, true) 45 | 46 | #define S(x) #x 47 | #define CREATE_function(nam, def, cmt, type, conf) \ 48 | NAN_METHOD(nam) { \ 49 | NanScope(); \ 50 | NanCallback *cb = new NanCallback(args[0].As()); \ 51 | v8::Local def_val; \ 52 | if (is_null(def)) \ 53 | def_val = NanUndefined(); \ 54 | else \ 55 | def_val = NanNew(def); \ 56 | \ 57 | v8::Local argv[] = { \ 58 | NanNew(S(nam)) \ 59 | , def_val \ 60 | , NanNew(cmt) \ 61 | , NanNew(S(type)) \ 62 | , NanNew(conf) \ 63 | }; \ 64 | \ 65 | cb->Call(5, argv); \ 66 | NanReturnUndefined(); \ 67 | } \ 68 | \ 69 | NAN_METHOD(implications_##nam) { \ 70 | NanScope(); \ 71 | NanCallback *cb = new NanCallback(args[0].As()); \ 72 | v8::Local argv[MAX_IMPLICATIONS]; \ 73 | int len; \ 74 | get_implications(S(nam), argv, &len); \ 75 | cb->Call(len, argv); \ 76 | NanReturnUndefined(); \ 77 | } \ 78 | \ 79 | NAN_METHOD(neg_implications_##nam) { \ 80 | NanScope(); \ 81 | NanCallback *cb = new NanCallback(args[0].As()); \ 82 | v8::Local argv[MAX_IMPLICATIONS]; \ 83 | int len; \ 84 | get_neg_implications(S(nam), argv, &len); \ 85 | cb->Call(len, argv); \ 86 | NanReturnUndefined(); \ 87 | } 88 | 89 | #include "v8_flag_definitions.h" 90 | 91 | #undef FLAG 92 | #undef CREATE_function 93 | 94 | #define CREATE_function(nam, def, cmt, type, conf) \ 95 | create_implications(S(nam)); \ 96 | create_neg_implications(S(nam)); \ 97 | exports->Set(NanNew(S(nam)), NanNew(nam)->GetFunction()); \ 98 | exports->Set(NanNew("neg_implications_" S(nam)), NanNew(neg_implications_##nam)->GetFunction()); \ 99 | exports->Set(NanNew("implications_" S(nam)), NanNew(implications_##nam)->GetFunction()); 100 | 101 | #undef DEFINE_implication 102 | #undef DEFINE_neg_implication 103 | #define DEFINE_implication(nam, implication) add_implication(S(nam), S(implication)); 104 | #define DEFINE_neg_implication(nam, implication) add_neg_implication(S(nam), S(implication)); 105 | 106 | void init(v8::Handle exports) { 107 | #include "v8_flag_definitions.h" 108 | } 109 | 110 | #undef DEFINE_bool 111 | #undef DEFINE_int 112 | #undef DEFINE_float 113 | #undef DEFINE_string 114 | #undef FLAG_FULL 115 | #undef FLAG_READONLY 116 | #undef S 117 | #undef DEFINE_implication 118 | #undef DEFINE_neg_implication 119 | #undef DEFINE_maybe_bool 120 | 121 | NODE_MODULE(v8_flags_meta, init) 122 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | if [[ -e $TRAVIS ]] 4 | then 5 | DIR=`pwd` 6 | else 7 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 8 | fi 9 | 10 | export PATH=$DIR/node_modules/.bin:$PATH 11 | 12 | set -e; 13 | 14 | if [[ -e $TRAVIS ]] 15 | then 16 | npm install 17 | tap $DIR/test/*.js 18 | else 19 | nave use $1 npm install 20 | for t in $DIR/test/*.js; do nave use $1 node $t; done 21 | fi 22 | -------------------------------------------------------------------------------- /test/debug-only/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | /*jshint asi: true */ 3 | 4 | var test = require('tap').test 5 | var semver = require('semver') 6 | var flags = require('../../'); 7 | // ignore last digit in versions like 3.14.5.9 8 | var v8 = process.versions.v8.split('.').slice(0, 3).join('.') 9 | 10 | function inspect(obj, depth) { 11 | console.error(require('util').inspect(obj, false, depth || 5, true)); 12 | } 13 | 14 | function refresh(p) { 15 | delete require.cache[require.resolve(p)]; 16 | return require(p); 17 | } 18 | 19 | test('\ncode_stats', function (t) { 20 | flags.allow_natives_syntax(true) 21 | 22 | var p = '../fixtures/code_stats' 23 | var code_stats = require(p); 24 | t.ok(!flags.code_stats(), 'not enabled by default') 25 | code_stats() 26 | 27 | flags.code_stats(true) 28 | code_stats() 29 | t.end() 30 | 31 | }) 32 | -------------------------------------------------------------------------------- /test/fixtures/allow_natives_syntax.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function () { 4 | /*jshint ignore: start */ 5 | var before = %GetHeapUsage(); 6 | %CollectGarbage('all'); 7 | var after = %GetHeapUsage(); 8 | return { before: before, after: after }; 9 | /*jshint ignore: end */ 10 | } 11 | -------------------------------------------------------------------------------- /test/fixtures/always_opt.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function toopt(a, b) { 4 | return a + b; 5 | } 6 | 7 | exports = module.exports = function () { 8 | exports.result = toopt(1, 2); 9 | return %GetOptimizationCount(toopt); 10 | } 11 | -------------------------------------------------------------------------------- /test/fixtures/code_stats.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function () { 4 | %CollectGarbage('all') 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/expose_gc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function () { return typeof gc === 'function'; } 4 | -------------------------------------------------------------------------------- /test/fixtures/harmony_collections.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert') 2 | , m = new Map() 3 | , key = { a: 'Test' } 4 | , value = 'a test value' 5 | ; 6 | 7 | m.set(key, value); 8 | 9 | module.exports = m.get(key) === value; 10 | -------------------------------------------------------------------------------- /test/fixtures/harmony_modules-exports.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module "foo" { 4 | export default function() { console.log("hello!") } 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/harmony_modules-imports.js: -------------------------------------------------------------------------------- 1 | import foo from "foo"; 2 | foo() 3 | -------------------------------------------------------------------------------- /test/fixtures/harmony_proxies.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var proxy = new Proxy(); 4 | -------------------------------------------------------------------------------- /test/fixtures/harmony_scoping.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var assert = require('assert'); 3 | 4 | { 5 | let a = 2; 6 | } 7 | let b = 1; 8 | 9 | module.exports = { a_is_undefined: typeof a === 'undefined', b_is_defined: b === 1 } 10 | -------------------------------------------------------------------------------- /test/fixtures/harmony_typeof.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = (function () { 4 | var x = {}; 5 | switch (typeof x) { 6 | case 'object': return true; 7 | default: return false; 8 | } 9 | })() 10 | -------------------------------------------------------------------------------- /test/implications.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var test = require('tap').test 4 | var v8Flags = require('../') 5 | , flags = v8Flags.flags 6 | , enforceImplications = v8Flags.enforceFlagImplications 7 | 8 | 9 | test('\nwhen setting harmony all implied harmony flags get set ONLY after enforcing flag implications, and never when unsetting', function (t) { 10 | t.on('end', function () { 11 | flags.harmony(false) 12 | flags.harmony_scoping(false) 13 | flags.harmony_modules(false) 14 | flags.harmony_proxies(false) 15 | flags.harmony_collections(false) 16 | }) 17 | 18 | flags.harmony(true) 19 | t.ok(!flags.harmony_scoping(), 'harmony_scoping off') 20 | t.ok(!flags.harmony_modules(), 'harmony_modules off') 21 | t.ok(!flags.harmony_proxies(), 'harmony_proxies off') 22 | t.ok(!flags.harmony_collections(), 'harmony_collections off') 23 | 24 | enforceImplications() 25 | 26 | t.ok(flags.harmony_scoping(), 'harmony_scoping on after enforcement') 27 | t.ok(flags.harmony_modules(), 'harmony_modules on after enforcement') 28 | t.ok(flags.harmony_proxies(), 'harmony_proxies on after enforcement') 29 | t.ok(flags.harmony_collections(), 'harmony_collections on after enforcement') 30 | 31 | flags.harmony(false) 32 | enforceImplications() 33 | 34 | t.ok(flags.harmony_scoping(), 'harmony_scoping still on') 35 | t.ok(flags.harmony_modules(), 'harmony_modules still on') 36 | t.ok(flags.harmony_proxies(), 'harmony_proxies still on') 37 | t.ok(flags.harmony_collections(), 'harmony_collections still on') 38 | 39 | t.end() 40 | }) 41 | -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | /*jshint asi: true */ 3 | 4 | var test = require('tap').test 5 | var semver = require('semver') 6 | var flags = require('../').flags; 7 | // ignore last digit in versions like 3.14.5.9 8 | var v8 = process.versions.v8.split('.').slice(0, 3).join('.') 9 | 10 | function inspect(obj, depth) { 11 | console.error(require('util').inspect(obj, false, depth || 5, true)); 12 | } 13 | 14 | function insp(obj, depth) { 15 | return require('util').inspect(obj, false, depth || 5, true); 16 | } 17 | 18 | function refresh(p) { 19 | delete require.cache[require.resolve(p)]; 20 | return require(p); 21 | } 22 | 23 | function exists(t, flag) { 24 | if (typeof flags[flag] !== 'function') { 25 | t.pass(flag + ' does not exist in this version of v8') 26 | return false; 27 | } 28 | return true; 29 | } 30 | 31 | function throwsInitially(t, p, name, message, debug) { 32 | try { 33 | var res = require( p) 34 | if (debug) inspect(res); 35 | t.fail('requiring initially should have thrown') 36 | } catch (err) { 37 | if (debug) return inspect(err); 38 | t.equal(err.name, name, 'throws ' + name) 39 | t.similar(err.message, new RegExp(message), message) 40 | } 41 | } 42 | 43 | 44 | function unverified(flag, enabled) { 45 | test('\n' + flag + ' - NOT VERIFIED', function (t) { 46 | if (!exists(t, flag)) return t.end(); 47 | t.on('end', flags[flag].bind(flags, enabled)) 48 | if (enabled) { 49 | t.ok(flags[flag](), 'enabled by default') 50 | t.doesNotThrow(flags[flag].bind(flags, false), 'can be disabled') 51 | } else { 52 | t.ok(!flags[flag](), 'disabled by default') 53 | t.doesNotThrow(flags[flag].bind(flags, true), 'can be enabled') 54 | } 55 | t.end() 56 | }) 57 | } 58 | 59 | test('\nversions ' + insp(process.versions), function (t) { 60 | t.end() 61 | }) 62 | 63 | test('\nlist flags ' + insp(require('../').listFlags()), function (t) { 64 | t.end() 65 | }) 66 | 67 | test('\nflags meta ' + insp(require('../').meta), function (t) { 68 | t.end() 69 | }) 70 | 71 | test('\nversions ' + insp(process.versions), function (t) { 72 | t.end() 73 | }) 74 | 75 | test('\nexpose_gc -- NOT CONFIGURABLE', function (t) { 76 | var p = './fixtures/expose_gc' 77 | var gc = require(p); 78 | 79 | t.ok(!flags.expose_gc(), 'not enabled by default') 80 | t.ok(!gc(), 'not exposed by default') 81 | 82 | flags.expose_gc(true) 83 | t.ok(!refresh(p)(), 'enabling does NOT expose it') 84 | t.end() 85 | }) 86 | 87 | test('\nallow_natives_syntax', function (t) { 88 | var p = './fixtures/allow_natives_syntax'; 89 | 90 | t.ok(!flags.allow_natives_syntax(), 'not enabled by default') 91 | 92 | throwsInitially(t, p, 'SyntaxError', 'Unexpected token %') 93 | 94 | flags.allow_natives_syntax(true) 95 | 96 | var heap = require(p)(); 97 | t.ok(heap.before > 0 && heap.after < heap.before, 'enabling allows native syntax to get heap and trigger garbage collection') 98 | t.end() 99 | }) 100 | 101 | unverified('always_compact', false) 102 | 103 | test('\nalways_opt', function (t) { 104 | if (!exists(t, 'always_opt')) return t.end(); 105 | 106 | flags.allow_natives_syntax(true) 107 | t.ok(!flags.always_opt(), 'not enabled by default') 108 | 109 | var p = './fixtures/always_opt'; 110 | var optimizations = require(p)(); 111 | t.equal(optimizations, 0, 'does not optimize sample function on first try') 112 | optimizations = refresh(p)(); 113 | t.equal(optimizations, 0, 'does not optimize sample function on second try') 114 | optimizations = refresh(p)(); 115 | t.equal(optimizations, 0, 'does not optimize sample function on third try') 116 | 117 | flags.always_opt(true) 118 | optimizations = refresh(p)(); 119 | if (semver.gte(v8, '3.14.5')) 120 | t.equal(optimizations, 1, 'optimizes function once always_opt is enabled') 121 | t.end() 122 | }) 123 | 124 | unverified('always_osr', false) 125 | unverified('cache_prototype_transitions', true) 126 | unverified('check_elimination', true) 127 | unverified('code_comments', false) 128 | unverified('compilation_cache', true) 129 | unverified('concurrent_sweeping', false) 130 | unverified('crankshaft', true) 131 | unverified('dead_code_elimination', true) 132 | unverified('debug_compile_events', true) 133 | unverified('debug_sim', false) 134 | 135 | test('\nharmony_scoping', function (t) { 136 | t.on('end', flags.harmony_scoping.bind(flags, false)) 137 | 138 | var p = './fixtures/harmony_scoping' 139 | t.ok(!flags.harmony_scoping(), 'not enabled by default') 140 | throwsInitially(t, p, 'SyntaxError', 'Unexpected strict mode reserved word') 141 | 142 | flags.harmony_scoping(true) 143 | var e = require(p) 144 | t.ok(e.a_is_undefined, 'block scoped var is not defined outside its scope') 145 | t.ok(e.b_is_defined, 'script level scoped var is defined') 146 | t.end() 147 | }) 148 | 149 | test('\nharmony_typeof', function (t) { 150 | t.on('end', flags.harmony_typeof.bind(flags, false)) 151 | 152 | var p = './fixtures/harmony_typeof' 153 | t.ok(!flags.harmony_typeof(), 'not enabled by default') 154 | t.ok(require(p), 'works initially') 155 | t.end() 156 | }) 157 | 158 | // not configurable because part of the bootstrapping process 159 | unverified('harmony_proxies', false) 160 | unverified('harmony_collections', false) 161 | 162 | // imports don't work since node wraps file contents on require 163 | unverified('harmony_modules', false) 164 | -------------------------------------------------------------------------------- /test/reset-all-flags.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var test = require('tap').test 4 | var v8Flags = require('../') 5 | , flags = v8Flags.flags 6 | , resetAllFlags= v8Flags.resetAllFlags 7 | 8 | test('\nresetting all flags resets only `false` by default flags to `false`', function (t) { 9 | t.on('end', resetAllFlags) 10 | 11 | flags.use_strict(true) 12 | flags.trap_on_deopt(true) 13 | 14 | t.ok(flags.use_strict(), 'use_strict on') 15 | t.ok(flags.trap_on_deopt(), 'trap_on_deopt on') 16 | t.ok(flags.crankshaft(), 'crankshaft on by default') 17 | 18 | resetAllFlags() 19 | 20 | t.ok(!flags.use_strict(), 'use_strict off') 21 | t.ok(!flags.trap_on_deopt(), 'trap_on_deopt off') 22 | t.ok(flags.crankshaft(), 'crankshaft on by default') 23 | 24 | t.end() 25 | }) 26 | -------------------------------------------------------------------------------- /v8/flag-definitions.3.11.10.h: -------------------------------------------------------------------------------- 1 | // Copyright 2012 the V8 project authors. All rights reserved. 2 | // Redistribution and use in source and binary forms, with or without 3 | // modification, are permitted provided that the following conditions are 4 | // met: 5 | // 6 | // * Redistributions of source code must retain the above copyright 7 | // notice, this list of conditions and the following disclaimer. 8 | // * Redistributions in binary form must reproduce the above 9 | // copyright notice, this list of conditions and the following 10 | // disclaimer in the documentation and/or other materials provided 11 | // with the distribution. 12 | // * Neither the name of Google Inc. nor the names of its 13 | // contributors may be used to endorse or promote products derived 14 | // from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | // This file defines all of the flags. It is separated into different section, 29 | // for Debug, Release, Logging and Profiling, etc. To add a new flag, find the 30 | // correct section, and use one of the DEFINE_ macros, without a trailing ';'. 31 | // 32 | // This include does not have a guard, because it is a template-style include, 33 | // which can be included multiple times in different modes. It expects to have 34 | // a mode defined before it's included. The modes are FLAG_MODE_... below: 35 | 36 | // We want to declare the names of the variables for the header file. Normally 37 | // this will just be an extern declaration, but for a readonly flag we let the 38 | // compiler make better optimizations by giving it the value. 39 | #if defined(FLAG_MODE_DECLARE) 40 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 41 | extern ctype FLAG_##nam; 42 | #define FLAG_READONLY(ftype, ctype, nam, def, cmt) \ 43 | static ctype const FLAG_##nam = def; 44 | #define DEFINE_implication(whenflag, thenflag) 45 | 46 | // We want to supply the actual storage and value for the flag variable in the 47 | // .cc file. We only do this for writable flags. 48 | #elif defined(FLAG_MODE_DEFINE) 49 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 50 | ctype FLAG_##nam = def; 51 | #define FLAG_READONLY(ftype, ctype, nam, def, cmt) 52 | #define DEFINE_implication(whenflag, thenflag) 53 | 54 | // We need to define all of our default values so that the Flag structure can 55 | // access them by pointer. These are just used internally inside of one .cc, 56 | // for MODE_META, so there is no impact on the flags interface. 57 | #elif defined(FLAG_MODE_DEFINE_DEFAULTS) 58 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 59 | static ctype const FLAGDEFAULT_##nam = def; 60 | #define FLAG_READONLY(ftype, ctype, nam, def, cmt) 61 | #define DEFINE_implication(whenflag, thenflag) 62 | 63 | // We want to write entries into our meta data table, for internal parsing and 64 | // printing / etc in the flag parser code. We only do this for writable flags. 65 | #elif defined(FLAG_MODE_META) 66 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 67 | { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false }, 68 | #define FLAG_READONLY(ftype, ctype, nam, def, cmt) 69 | #define DEFINE_implication(whenflag, thenflag) 70 | 71 | // We produce the code to set flags when it is implied by another flag. 72 | #elif defined(FLAG_MODE_DEFINE_IMPLICATIONS) 73 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) 74 | #define FLAG_READONLY(ftype, ctype, nam, def, cmt) 75 | #define DEFINE_implication(whenflag, thenflag) \ 76 | if (FLAG_##whenflag) FLAG_##thenflag = true; 77 | 78 | #else 79 | #error No mode supplied when including flags.defs 80 | #endif 81 | 82 | #ifdef FLAG_MODE_DECLARE 83 | // Structure used to hold a collection of arguments to the JavaScript code. 84 | #define JSARGUMENTS_INIT {{}} 85 | struct JSArguments { 86 | public: 87 | inline int argc() const { 88 | return static_cast(storage_[0]); 89 | } 90 | inline const char** argv() const { 91 | return reinterpret_cast(storage_[1]); 92 | } 93 | inline const char*& operator[] (int idx) const { 94 | return argv()[idx]; 95 | } 96 | inline JSArguments& operator=(JSArguments args) { 97 | set_argc(args.argc()); 98 | set_argv(args.argv()); 99 | return *this; 100 | } 101 | static JSArguments Create(int argc, const char** argv) { 102 | JSArguments args; 103 | args.set_argc(argc); 104 | args.set_argv(argv); 105 | return args; 106 | } 107 | private: 108 | void set_argc(int argc) { 109 | storage_[0] = argc; 110 | } 111 | void set_argv(const char** argv) { 112 | storage_[1] = reinterpret_cast(argv); 113 | } 114 | public: 115 | // Contains argc and argv. Unfortunately we have to store these two fields 116 | // into a single one to avoid making the initialization macro (which would be 117 | // "{ 0, NULL }") contain a coma. 118 | AtomicWord storage_[2]; 119 | }; 120 | #endif 121 | 122 | #define DEFINE_bool(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt) 123 | #define DEFINE_int(nam, def, cmt) FLAG(INT, int, nam, def, cmt) 124 | #define DEFINE_float(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt) 125 | #define DEFINE_string(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt) 126 | #define DEFINE_args(nam, def, cmt) FLAG(ARGS, JSArguments, nam, def, cmt) 127 | 128 | // 129 | // Flags in all modes. 130 | // 131 | #define FLAG FLAG_FULL 132 | 133 | // Flags for language modes and experimental language features. 134 | DEFINE_bool(use_strict, false, "enforce strict mode") 135 | DEFINE_bool(es5_readonly, false, 136 | "activate correct semantics for inheriting readonliness") 137 | DEFINE_bool(es52_globals, false, 138 | "activate new semantics for global var declarations") 139 | 140 | DEFINE_bool(harmony_typeof, false, "enable harmony semantics for typeof") 141 | DEFINE_bool(harmony_scoping, false, "enable harmony block scoping") 142 | DEFINE_bool(harmony_modules, false, 143 | "enable harmony modules (implies block scoping)") 144 | DEFINE_bool(harmony_proxies, false, "enable harmony proxies") 145 | DEFINE_bool(harmony_collections, false, 146 | "enable harmony collections (sets, maps, and weak maps)") 147 | DEFINE_bool(harmony, false, "enable all harmony features (except typeof)") 148 | DEFINE_implication(harmony, harmony_scoping) 149 | DEFINE_implication(harmony, harmony_modules) 150 | DEFINE_implication(harmony, harmony_proxies) 151 | DEFINE_implication(harmony, harmony_collections) 152 | DEFINE_implication(harmony_modules, harmony_scoping) 153 | 154 | // Flags for experimental implementation features. 155 | DEFINE_bool(packed_arrays, false, "optimizes arrays that have no holes") 156 | DEFINE_bool(smi_only_arrays, true, "tracks arrays with only smi values") 157 | DEFINE_bool(clever_optimizations, 158 | true, 159 | "Optimize object size, Array shift, DOM strings and string +") 160 | 161 | // Flags for data representation optimizations 162 | DEFINE_bool(unbox_double_arrays, true, "automatically unbox arrays of doubles") 163 | DEFINE_bool(string_slices, true, "use string slices") 164 | 165 | // Flags for Crankshaft. 166 | DEFINE_bool(crankshaft, true, "use crankshaft") 167 | DEFINE_string(hydrogen_filter, "", "optimization filter") 168 | DEFINE_bool(use_range, true, "use hydrogen range analysis") 169 | DEFINE_bool(eliminate_dead_phis, true, "eliminate dead phis") 170 | DEFINE_bool(use_gvn, true, "use hydrogen global value numbering") 171 | DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing") 172 | DEFINE_bool(use_inlining, true, "use function inlining") 173 | DEFINE_int(max_inlined_source_size, 600, 174 | "maximum source size in bytes considered for a single inlining") 175 | DEFINE_int(max_inlined_nodes, 196, 176 | "maximum number of AST nodes considered for a single inlining") 177 | DEFINE_int(max_inlined_nodes_cumulative, 196, 178 | "maximum cumulative number of AST nodes considered for inlining") 179 | DEFINE_bool(loop_invariant_code_motion, true, "loop invariant code motion") 180 | DEFINE_bool(collect_megamorphic_maps_from_stub_cache, 181 | true, 182 | "crankshaft harvests type feedback from stub cache") 183 | DEFINE_bool(hydrogen_stats, false, "print statistics for hydrogen") 184 | DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file") 185 | DEFINE_string(trace_phase, "Z", "trace generated IR for specified phases") 186 | DEFINE_bool(trace_inlining, false, "trace inlining decisions") 187 | DEFINE_bool(trace_alloc, false, "trace register allocator") 188 | DEFINE_bool(trace_all_uses, false, "trace all use positions") 189 | DEFINE_bool(trace_range, false, "trace range analysis") 190 | DEFINE_bool(trace_gvn, false, "trace global value numbering") 191 | DEFINE_bool(trace_representation, false, "trace representation types") 192 | DEFINE_bool(stress_pointer_maps, false, "pointer map for every instruction") 193 | DEFINE_bool(stress_environments, false, "environment for every instruction") 194 | DEFINE_int(deopt_every_n_times, 195 | 0, 196 | "deoptimize every n times a deopt point is passed") 197 | DEFINE_bool(trap_on_deopt, false, "put a break point before deoptimizing") 198 | DEFINE_bool(deoptimize_uncommon_cases, true, "deoptimize uncommon cases") 199 | DEFINE_bool(polymorphic_inlining, true, "polymorphic inlining") 200 | DEFINE_bool(use_osr, true, "use on-stack replacement") 201 | DEFINE_bool(array_bounds_checks_elimination, false, 202 | "perform array bounds checks elimination") 203 | DEFINE_bool(array_index_dehoisting, false, 204 | "perform array index dehoisting") 205 | 206 | DEFINE_bool(trace_osr, false, "trace on-stack replacement") 207 | DEFINE_int(stress_runs, 0, "number of stress runs") 208 | DEFINE_bool(optimize_closures, true, "optimize closures") 209 | DEFINE_bool(inline_construct, true, "inline constructor calls") 210 | DEFINE_bool(inline_arguments, true, "inline functions with arguments object") 211 | DEFINE_int(loop_weight, 1, "loop weight for representation inference") 212 | 213 | DEFINE_bool(optimize_for_in, true, 214 | "optimize functions containing for-in loops") 215 | 216 | // Experimental profiler changes. 217 | DEFINE_bool(experimental_profiler, true, "enable all profiler experiments") 218 | DEFINE_bool(watch_ic_patching, false, "profiler considers IC stability") 219 | DEFINE_int(frame_count, 1, "number of stack frames inspected by the profiler") 220 | DEFINE_bool(self_optimization, false, 221 | "primitive functions trigger their own optimization") 222 | DEFINE_bool(direct_self_opt, false, 223 | "call recompile stub directly when self-optimizing") 224 | DEFINE_bool(retry_self_opt, false, "re-try self-optimization if it failed") 225 | DEFINE_bool(count_based_interrupts, false, 226 | "trigger profiler ticks based on counting instead of timing") 227 | DEFINE_bool(interrupt_at_exit, false, 228 | "insert an interrupt check at function exit") 229 | DEFINE_bool(weighted_back_edges, false, 230 | "weight back edges by jump distance for interrupt triggering") 231 | DEFINE_int(interrupt_budget, 5900, 232 | "execution budget before interrupt is triggered") 233 | DEFINE_int(type_info_threshold, 15, 234 | "percentage of ICs that must have type info to allow optimization") 235 | DEFINE_int(self_opt_count, 130, "call count before self-optimization") 236 | 237 | DEFINE_implication(experimental_profiler, watch_ic_patching) 238 | DEFINE_implication(experimental_profiler, self_optimization) 239 | // Not implying direct_self_opt here because it seems to be a bad idea. 240 | DEFINE_implication(experimental_profiler, retry_self_opt) 241 | DEFINE_implication(experimental_profiler, count_based_interrupts) 242 | DEFINE_implication(experimental_profiler, interrupt_at_exit) 243 | DEFINE_implication(experimental_profiler, weighted_back_edges) 244 | 245 | DEFINE_bool(trace_opt_verbose, false, "extra verbose compilation tracing") 246 | DEFINE_implication(trace_opt_verbose, trace_opt) 247 | 248 | // assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc 249 | DEFINE_bool(debug_code, false, 250 | "generate extra code (assertions) for debugging") 251 | DEFINE_bool(code_comments, false, "emit comments in code disassembly") 252 | DEFINE_bool(enable_sse2, true, 253 | "enable use of SSE2 instructions if available") 254 | DEFINE_bool(enable_sse3, true, 255 | "enable use of SSE3 instructions if available") 256 | DEFINE_bool(enable_sse4_1, true, 257 | "enable use of SSE4.1 instructions if available") 258 | DEFINE_bool(enable_cmov, true, 259 | "enable use of CMOV instruction if available") 260 | DEFINE_bool(enable_rdtsc, true, 261 | "enable use of RDTSC instruction if available") 262 | DEFINE_bool(enable_sahf, true, 263 | "enable use of SAHF instruction if available (X64 only)") 264 | DEFINE_bool(enable_vfp3, true, 265 | "enable use of VFP3 instructions if available - this implies " 266 | "enabling ARMv7 instructions (ARM only)") 267 | DEFINE_bool(enable_armv7, true, 268 | "enable use of ARMv7 instructions if available (ARM only)") 269 | DEFINE_bool(enable_fpu, true, 270 | "enable use of MIPS FPU instructions if available (MIPS only)") 271 | 272 | // bootstrapper.cc 273 | DEFINE_string(expose_natives_as, NULL, "expose natives in global object") 274 | DEFINE_string(expose_debug_as, NULL, "expose debug in global object") 275 | DEFINE_bool(expose_gc, false, "expose gc extension") 276 | DEFINE_bool(expose_externalize_string, false, 277 | "expose externalize string extension") 278 | DEFINE_int(stack_trace_limit, 10, "number of stack frames to capture") 279 | DEFINE_bool(builtins_in_stack_traces, false, 280 | "show built-in functions in stack traces") 281 | DEFINE_bool(disable_native_files, false, "disable builtin natives files") 282 | 283 | // builtins-ia32.cc 284 | DEFINE_bool(inline_new, true, "use fast inline allocation") 285 | 286 | // checks.cc 287 | DEFINE_bool(stack_trace_on_abort, true, 288 | "print a stack trace if an assertion failure occurs") 289 | 290 | // codegen-ia32.cc / codegen-arm.cc 291 | DEFINE_bool(trace, false, "trace function calls") 292 | DEFINE_bool(mask_constants_with_cookie, 293 | true, 294 | "use random jit cookie to mask large constants") 295 | 296 | // codegen.cc 297 | DEFINE_bool(lazy, true, "use lazy compilation") 298 | DEFINE_bool(trace_opt, false, "trace lazy optimization") 299 | DEFINE_bool(trace_opt_stats, false, "trace lazy optimization statistics") 300 | DEFINE_bool(opt, true, "use adaptive optimizations") 301 | DEFINE_bool(always_opt, false, "always try to optimize functions") 302 | DEFINE_bool(prepare_always_opt, false, "prepare for turning on always opt") 303 | DEFINE_bool(trace_deopt, false, "trace deoptimization") 304 | 305 | // compiler.cc 306 | DEFINE_int(min_preparse_length, 1024, 307 | "minimum length for automatic enable preparsing") 308 | DEFINE_bool(always_full_compiler, false, 309 | "try to use the dedicated run-once backend for all code") 310 | DEFINE_bool(trace_bailout, false, 311 | "print reasons for falling back to using the classic V8 backend") 312 | 313 | // compilation-cache.cc 314 | DEFINE_bool(compilation_cache, true, "enable compilation cache") 315 | 316 | DEFINE_bool(cache_prototype_transitions, true, "cache prototype transitions") 317 | 318 | // debug.cc 319 | DEFINE_bool(trace_debug_json, false, "trace debugging JSON request/response") 320 | DEFINE_bool(debugger_auto_break, true, 321 | "automatically set the debug break flag when debugger commands are " 322 | "in the queue") 323 | DEFINE_bool(enable_liveedit, true, "enable liveedit experimental feature") 324 | DEFINE_bool(break_on_abort, true, "always cause a debug break before aborting") 325 | 326 | // execution.cc 327 | // Slightly less than 1MB on 64-bit, since Windows' default stack size for 328 | // the main execution thread is 1MB for both 32 and 64-bit. 329 | DEFINE_int(stack_size, kPointerSize * 123, 330 | "default size of stack region v8 is allowed to use (in kBytes)") 331 | 332 | // frames.cc 333 | DEFINE_int(max_stack_trace_source_length, 300, 334 | "maximum length of function source code printed in a stack trace.") 335 | 336 | // full-codegen.cc 337 | DEFINE_bool(always_inline_smi_code, false, 338 | "always inline smi code in non-opt code") 339 | 340 | // heap.cc 341 | DEFINE_int(max_new_space_size, 0, "max size of the new generation (in kBytes)") 342 | DEFINE_int(max_old_space_size, 0, "max size of the old generation (in Mbytes)") 343 | DEFINE_int(max_executable_size, 0, "max size of executable memory (in Mbytes)") 344 | DEFINE_bool(gc_global, false, "always perform global GCs") 345 | DEFINE_int(gc_interval, -1, "garbage collect after allocations") 346 | DEFINE_bool(trace_gc, false, 347 | "print one trace line following each garbage collection") 348 | DEFINE_bool(trace_gc_nvp, false, 349 | "print one detailed trace line in name=value format " 350 | "after each garbage collection") 351 | DEFINE_bool(print_cumulative_gc_stat, false, 352 | "print cumulative GC statistics in name=value format on exit") 353 | DEFINE_bool(trace_gc_verbose, false, 354 | "print more details following each garbage collection") 355 | DEFINE_bool(trace_fragmentation, false, 356 | "report fragmentation for old pointer and data pages") 357 | DEFINE_bool(collect_maps, true, 358 | "garbage collect maps from which no objects can be reached") 359 | DEFINE_bool(flush_code, true, 360 | "flush code that we expect not to use again before full gc") 361 | DEFINE_bool(incremental_marking, true, "use incremental marking") 362 | DEFINE_bool(incremental_marking_steps, true, "do incremental marking steps") 363 | DEFINE_bool(trace_incremental_marking, false, 364 | "trace progress of the incremental marking") 365 | 366 | // v8.cc 367 | DEFINE_bool(use_idle_notification, true, 368 | "Use idle notification to reduce memory footprint.") 369 | 370 | DEFINE_bool(send_idle_notification, false, 371 | "Send idle notifcation between stress runs.") 372 | // ic.cc 373 | DEFINE_bool(use_ic, true, "use inline caching") 374 | 375 | #ifdef LIVE_OBJECT_LIST 376 | // liveobjectlist.cc 377 | DEFINE_string(lol_workdir, NULL, "path for lol temp files") 378 | DEFINE_bool(verify_lol, false, "perform debugging verification for lol") 379 | #endif 380 | 381 | // macro-assembler-ia32.cc 382 | DEFINE_bool(native_code_counters, false, 383 | "generate extra code for manipulating stats counters") 384 | 385 | // mark-compact.cc 386 | DEFINE_bool(always_compact, false, "Perform compaction on every full GC") 387 | DEFINE_bool(lazy_sweeping, true, 388 | "Use lazy sweeping for old pointer and data spaces") 389 | DEFINE_bool(never_compact, false, 390 | "Never perform compaction on full GC - testing only") 391 | DEFINE_bool(compact_code_space, true, 392 | "Compact code space on full non-incremental collections") 393 | DEFINE_bool(cleanup_code_caches_at_gc, true, 394 | "Flush inline caches prior to mark compact collection and " 395 | "flush code caches in maps during mark compact cycle.") 396 | DEFINE_int(random_seed, 0, 397 | "Default seed for initializing random generator " 398 | "(0, the default, means to use system random).") 399 | 400 | // objects.cc 401 | DEFINE_bool(use_verbose_printer, true, "allows verbose printing") 402 | 403 | // parser.cc 404 | DEFINE_bool(allow_natives_syntax, false, "allow natives syntax") 405 | 406 | // simulator-arm.cc and simulator-mips.cc 407 | DEFINE_bool(trace_sim, false, "Trace simulator execution") 408 | DEFINE_bool(check_icache, false, 409 | "Check icache flushes in ARM and MIPS simulator") 410 | DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions") 411 | DEFINE_int(sim_stack_alignment, 8, 412 | "Stack alingment in bytes in simulator (4 or 8, 8 is default)") 413 | 414 | // isolate.cc 415 | DEFINE_bool(trace_exception, false, 416 | "print stack trace when throwing exceptions") 417 | DEFINE_bool(preallocate_message_memory, false, 418 | "preallocate some memory to build stack traces.") 419 | DEFINE_bool(randomize_hashes, 420 | true, 421 | "randomize hashes to avoid predictable hash collisions " 422 | "(with snapshots this option cannot override the baked-in seed)") 423 | DEFINE_int(hash_seed, 424 | 0, 425 | "Fixed seed to use to hash property keys (0 means random)" 426 | "(with snapshots this option cannot override the baked-in seed)") 427 | 428 | // v8.cc 429 | DEFINE_bool(preemption, false, 430 | "activate a 100ms timer that switches between V8 threads") 431 | 432 | // Regexp 433 | DEFINE_bool(regexp_optimization, true, "generate optimized regexp code") 434 | 435 | // Testing flags test/cctest/test-{flags,api,serialization}.cc 436 | DEFINE_bool(testing_bool_flag, true, "testing_bool_flag") 437 | DEFINE_int(testing_int_flag, 13, "testing_int_flag") 438 | DEFINE_float(testing_float_flag, 2.5, "float-flag") 439 | DEFINE_string(testing_string_flag, "Hello, world!", "string-flag") 440 | DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness") 441 | #ifdef WIN32 442 | DEFINE_string(testing_serialization_file, "C:\\Windows\\Temp\\serdes", 443 | "file in which to testing_serialize heap") 444 | #else 445 | DEFINE_string(testing_serialization_file, "/tmp/serdes", 446 | "file in which to serialize heap") 447 | #endif 448 | 449 | // 450 | // Dev shell flags 451 | // 452 | 453 | DEFINE_bool(help, false, "Print usage message, including flags, on console") 454 | DEFINE_bool(dump_counters, false, "Dump counters on exit") 455 | 456 | #ifdef ENABLE_DEBUGGER_SUPPORT 457 | DEFINE_bool(debugger, false, "Enable JavaScript debugger") 458 | DEFINE_bool(remote_debugger, false, "Connect JavaScript debugger to the " 459 | "debugger agent in another process") 460 | DEFINE_bool(debugger_agent, false, "Enable debugger agent") 461 | DEFINE_int(debugger_port, 5858, "Port to use for remote debugging") 462 | #endif // ENABLE_DEBUGGER_SUPPORT 463 | 464 | DEFINE_string(map_counters, "", "Map counters to a file") 465 | DEFINE_args(js_arguments, JSARGUMENTS_INIT, 466 | "Pass all remaining arguments to the script. Alias for \"--\".") 467 | 468 | #if defined(WEBOS__) 469 | DEFINE_bool(debug_compile_events, false, "Enable debugger compile events") 470 | DEFINE_bool(debug_script_collected_events, false, 471 | "Enable debugger script collected events") 472 | #else 473 | DEFINE_bool(debug_compile_events, true, "Enable debugger compile events") 474 | DEFINE_bool(debug_script_collected_events, true, 475 | "Enable debugger script collected events") 476 | #endif 477 | 478 | 479 | // 480 | // GDB JIT integration flags. 481 | // 482 | 483 | DEFINE_bool(gdbjit, false, "enable GDBJIT interface (disables compacting GC)") 484 | DEFINE_bool(gdbjit_full, false, "enable GDBJIT interface for all code objects") 485 | DEFINE_bool(gdbjit_dump, false, "dump elf objects with debug info to disk") 486 | DEFINE_string(gdbjit_dump_filter, "", 487 | "dump only objects containing this substring") 488 | 489 | // mark-compact.cc 490 | DEFINE_bool(force_marking_deque_overflows, false, 491 | "force overflows of marking deque by reducing it's size " 492 | "to 64 words") 493 | 494 | DEFINE_bool(stress_compaction, false, 495 | "stress the GC compactor to flush out bugs (implies " 496 | "--force_marking_deque_overflows)") 497 | 498 | // 499 | // Debug only flags 500 | // 501 | #undef FLAG 502 | #ifdef DEBUG 503 | #define FLAG FLAG_FULL 504 | #else 505 | #define FLAG FLAG_READONLY 506 | #endif 507 | 508 | // checks.cc 509 | DEFINE_bool(enable_slow_asserts, false, 510 | "enable asserts that are slow to execute") 511 | 512 | // codegen-ia32.cc / codegen-arm.cc 513 | DEFINE_bool(trace_codegen, false, 514 | "print name of functions for which code is generated") 515 | DEFINE_bool(print_source, false, "pretty print source code") 516 | DEFINE_bool(print_builtin_source, false, 517 | "pretty print source code for builtins") 518 | DEFINE_bool(print_ast, false, "print source AST") 519 | DEFINE_bool(print_builtin_ast, false, "print source AST for builtins") 520 | DEFINE_string(stop_at, "", "function name where to insert a breakpoint") 521 | 522 | // compiler.cc 523 | DEFINE_bool(print_builtin_scopes, false, "print scopes for builtins") 524 | DEFINE_bool(print_scopes, false, "print scopes") 525 | 526 | // contexts.cc 527 | DEFINE_bool(trace_contexts, false, "trace contexts operations") 528 | 529 | // heap.cc 530 | DEFINE_bool(gc_greedy, false, "perform GC prior to some allocations") 531 | DEFINE_bool(gc_verbose, false, "print stuff during garbage collection") 532 | DEFINE_bool(heap_stats, false, "report heap statistics before and after GC") 533 | DEFINE_bool(code_stats, false, "report code statistics after GC") 534 | DEFINE_bool(verify_heap, false, "verify heap pointers before and after GC") 535 | DEFINE_bool(print_handles, false, "report handles after GC") 536 | DEFINE_bool(print_global_handles, false, "report global handles after GC") 537 | 538 | // ic.cc 539 | DEFINE_bool(trace_ic, false, "trace inline cache state transitions") 540 | 541 | // interface.cc 542 | DEFINE_bool(print_interfaces, false, "print interfaces") 543 | DEFINE_bool(print_interface_details, false, "print interface inference details") 544 | DEFINE_int(print_interface_depth, 5, "depth for printing interfaces") 545 | 546 | // objects.cc 547 | DEFINE_bool(trace_normalization, 548 | false, 549 | "prints when objects are turned into dictionaries.") 550 | 551 | // runtime.cc 552 | DEFINE_bool(trace_lazy, false, "trace lazy compilation") 553 | 554 | // spaces.cc 555 | DEFINE_bool(collect_heap_spill_statistics, false, 556 | "report heap spill statistics along with heap_stats " 557 | "(requires heap_stats)") 558 | 559 | DEFINE_bool(trace_isolates, false, "trace isolate state changes") 560 | 561 | // VM state 562 | DEFINE_bool(log_state_changes, false, "Log state changes.") 563 | 564 | // Regexp 565 | DEFINE_bool(regexp_possessive_quantifier, 566 | false, 567 | "enable possessive quantifier syntax for testing") 568 | DEFINE_bool(trace_regexp_bytecodes, false, "trace regexp bytecode execution") 569 | DEFINE_bool(trace_regexp_assembler, 570 | false, 571 | "trace regexp macro assembler calls.") 572 | 573 | // 574 | // Logging and profiling flags 575 | // 576 | #undef FLAG 577 | #define FLAG FLAG_FULL 578 | 579 | // log.cc 580 | DEFINE_bool(log, false, 581 | "Minimal logging (no API, code, GC, suspect, or handles samples).") 582 | DEFINE_bool(log_all, false, "Log all events to the log file.") 583 | DEFINE_bool(log_runtime, false, "Activate runtime system %Log call.") 584 | DEFINE_bool(log_api, false, "Log API events to the log file.") 585 | DEFINE_bool(log_code, false, 586 | "Log code events to the log file without profiling.") 587 | DEFINE_bool(log_gc, false, 588 | "Log heap samples on garbage collection for the hp2ps tool.") 589 | DEFINE_bool(log_handles, false, "Log global handle events.") 590 | DEFINE_bool(log_snapshot_positions, false, 591 | "log positions of (de)serialized objects in the snapshot.") 592 | DEFINE_bool(log_suspect, false, "Log suspect operations.") 593 | DEFINE_bool(prof, false, 594 | "Log statistical profiling information (implies --log-code).") 595 | DEFINE_bool(prof_auto, true, 596 | "Used with --prof, starts profiling automatically") 597 | DEFINE_bool(prof_lazy, false, 598 | "Used with --prof, only does sampling and logging" 599 | " when profiler is active (implies --noprof_auto).") 600 | DEFINE_bool(prof_browser_mode, true, 601 | "Used with --prof, turns on browser-compatible mode for profiling.") 602 | DEFINE_bool(log_regexp, false, "Log regular expression execution.") 603 | DEFINE_bool(sliding_state_window, false, 604 | "Update sliding state window counters.") 605 | DEFINE_string(logfile, "v8.log", "Specify the name of the log file.") 606 | DEFINE_bool(ll_prof, false, "Enable low-level linux profiler.") 607 | 608 | // 609 | // Disassembler only flags 610 | // 611 | #undef FLAG 612 | #ifdef ENABLE_DISASSEMBLER 613 | #define FLAG FLAG_FULL 614 | #else 615 | #define FLAG FLAG_READONLY 616 | #endif 617 | 618 | // elements.cc 619 | DEFINE_bool(trace_elements_transitions, false, "trace elements transitions") 620 | 621 | // code-stubs.cc 622 | DEFINE_bool(print_code_stubs, false, "print code stubs") 623 | DEFINE_bool(test_secondary_stub_cache, 624 | false, 625 | "test secondary stub cache by disabling the primary one") 626 | 627 | DEFINE_bool(test_primary_stub_cache, 628 | false, 629 | "test primary stub cache by disabling the secondary one") 630 | 631 | // codegen-ia32.cc / codegen-arm.cc 632 | DEFINE_bool(print_code, false, "print generated code") 633 | DEFINE_bool(print_opt_code, false, "print optimized code") 634 | DEFINE_bool(print_unopt_code, false, "print unoptimized code before " 635 | "printing optimized code based on it") 636 | DEFINE_bool(print_code_verbose, false, "print more information for code") 637 | DEFINE_bool(print_builtin_code, false, "print generated code for builtins") 638 | 639 | #ifdef ENABLE_DISASSEMBLER 640 | DEFINE_bool(print_all_code, false, "enable all flags related to printing code") 641 | DEFINE_implication(print_all_code, print_code) 642 | DEFINE_implication(print_all_code, print_opt_code) 643 | DEFINE_implication(print_all_code, print_unopt_code) 644 | DEFINE_implication(print_all_code, print_code_verbose) 645 | DEFINE_implication(print_all_code, print_builtin_code) 646 | DEFINE_implication(print_all_code, print_code_stubs) 647 | DEFINE_implication(print_all_code, code_comments) 648 | #ifdef DEBUG 649 | DEFINE_implication(print_all_code, trace_codegen) 650 | #endif 651 | #endif 652 | 653 | // Cleanup... 654 | #undef FLAG_FULL 655 | #undef FLAG_READONLY 656 | #undef FLAG 657 | 658 | #undef DEFINE_bool 659 | #undef DEFINE_int 660 | #undef DEFINE_string 661 | #undef DEFINE_implication 662 | 663 | #undef FLAG_MODE_DECLARE 664 | #undef FLAG_MODE_DEFINE 665 | #undef FLAG_MODE_DEFINE_DEFAULTS 666 | #undef FLAG_MODE_META 667 | #undef FLAG_MODE_DEFINE_IMPLICATIONS 668 | -------------------------------------------------------------------------------- /v8/flag-definitions.3.14.5.h: -------------------------------------------------------------------------------- 1 | // Copyright 2012 the V8 project authors. All rights reserved. 2 | // Redistribution and use in source and binary forms, with or without 3 | // modification, are permitted provided that the following conditions are 4 | // met: 5 | // 6 | // * Redistributions of source code must retain the above copyright 7 | // notice, this list of conditions and the following disclaimer. 8 | // * Redistributions in binary form must reproduce the above 9 | // copyright notice, this list of conditions and the following 10 | // disclaimer in the documentation and/or other materials provided 11 | // with the distribution. 12 | // * Neither the name of Google Inc. nor the names of its 13 | // contributors may be used to endorse or promote products derived 14 | // from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | // This file defines all of the flags. It is separated into different section, 29 | // for Debug, Release, Logging and Profiling, etc. To add a new flag, find the 30 | // correct section, and use one of the DEFINE_ macros, without a trailing ';'. 31 | // 32 | // This include does not have a guard, because it is a template-style include, 33 | // which can be included multiple times in different modes. It expects to have 34 | // a mode defined before it's included. The modes are FLAG_MODE_... below: 35 | 36 | // We want to declare the names of the variables for the header file. Normally 37 | // this will just be an extern declaration, but for a readonly flag we let the 38 | // compiler make better optimizations by giving it the value. 39 | #if defined(FLAG_MODE_DECLARE) 40 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 41 | extern ctype FLAG_##nam; 42 | #define FLAG_READONLY(ftype, ctype, nam, def, cmt) \ 43 | static ctype const FLAG_##nam = def; 44 | #define DEFINE_implication(whenflag, thenflag) 45 | 46 | // We want to supply the actual storage and value for the flag variable in the 47 | // .cc file. We only do this for writable flags. 48 | #elif defined(FLAG_MODE_DEFINE) 49 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 50 | ctype FLAG_##nam = def; 51 | #define FLAG_READONLY(ftype, ctype, nam, def, cmt) 52 | #define DEFINE_implication(whenflag, thenflag) 53 | 54 | // We need to define all of our default values so that the Flag structure can 55 | // access them by pointer. These are just used internally inside of one .cc, 56 | // for MODE_META, so there is no impact on the flags interface. 57 | #elif defined(FLAG_MODE_DEFINE_DEFAULTS) 58 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 59 | static ctype const FLAGDEFAULT_##nam = def; 60 | #define FLAG_READONLY(ftype, ctype, nam, def, cmt) 61 | #define DEFINE_implication(whenflag, thenflag) 62 | 63 | // We want to write entries into our meta data table, for internal parsing and 64 | // printing / etc in the flag parser code. We only do this for writable flags. 65 | #elif defined(FLAG_MODE_META) 66 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 67 | { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false }, 68 | #define FLAG_READONLY(ftype, ctype, nam, def, cmt) 69 | #define DEFINE_implication(whenflag, thenflag) 70 | 71 | // We produce the code to set flags when it is implied by another flag. 72 | #elif defined(FLAG_MODE_DEFINE_IMPLICATIONS) 73 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) 74 | #define FLAG_READONLY(ftype, ctype, nam, def, cmt) 75 | #define DEFINE_implication(whenflag, thenflag) \ 76 | if (FLAG_##whenflag) FLAG_##thenflag = true; 77 | 78 | #else 79 | #error No mode supplied when including flags.defs 80 | #endif 81 | 82 | #ifdef FLAG_MODE_DECLARE 83 | // Structure used to hold a collection of arguments to the JavaScript code. 84 | #define JSARGUMENTS_INIT {{}} 85 | struct JSArguments { 86 | public: 87 | inline int argc() const { 88 | return static_cast(storage_[0]); 89 | } 90 | inline const char** argv() const { 91 | return reinterpret_cast(storage_[1]); 92 | } 93 | inline const char*& operator[] (int idx) const { 94 | return argv()[idx]; 95 | } 96 | inline JSArguments& operator=(JSArguments args) { 97 | set_argc(args.argc()); 98 | set_argv(args.argv()); 99 | return *this; 100 | } 101 | static JSArguments Create(int argc, const char** argv) { 102 | JSArguments args; 103 | args.set_argc(argc); 104 | args.set_argv(argv); 105 | return args; 106 | } 107 | private: 108 | void set_argc(int argc) { 109 | storage_[0] = argc; 110 | } 111 | void set_argv(const char** argv) { 112 | storage_[1] = reinterpret_cast(argv); 113 | } 114 | public: 115 | // Contains argc and argv. Unfortunately we have to store these two fields 116 | // into a single one to avoid making the initialization macro (which would be 117 | // "{ 0, NULL }") contain a coma. 118 | AtomicWord storage_[2]; 119 | }; 120 | #endif 121 | 122 | #define DEFINE_bool(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt) 123 | #define DEFINE_int(nam, def, cmt) FLAG(INT, int, nam, def, cmt) 124 | #define DEFINE_float(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt) 125 | #define DEFINE_string(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt) 126 | #define DEFINE_args(nam, def, cmt) FLAG(ARGS, JSArguments, nam, def, cmt) 127 | 128 | // 129 | // Flags in all modes. 130 | // 131 | #define FLAG FLAG_FULL 132 | 133 | // Flags for language modes and experimental language features. 134 | DEFINE_bool(use_strict, false, "enforce strict mode") 135 | DEFINE_bool(es5_readonly, true, 136 | "activate correct semantics for inheriting readonliness") 137 | DEFINE_bool(es52_globals, true, 138 | "activate new semantics for global var declarations") 139 | 140 | DEFINE_bool(harmony_typeof, false, "enable harmony semantics for typeof") 141 | DEFINE_bool(harmony_scoping, false, "enable harmony block scoping") 142 | DEFINE_bool(harmony_modules, false, 143 | "enable harmony modules (implies block scoping)") 144 | DEFINE_bool(harmony_proxies, false, "enable harmony proxies") 145 | DEFINE_bool(harmony_collections, false, 146 | "enable harmony collections (sets, maps, and weak maps)") 147 | DEFINE_bool(harmony, false, "enable all harmony features (except typeof)") 148 | DEFINE_implication(harmony, harmony_scoping) 149 | DEFINE_implication(harmony, harmony_modules) 150 | DEFINE_implication(harmony, harmony_proxies) 151 | DEFINE_implication(harmony, harmony_collections) 152 | DEFINE_implication(harmony_modules, harmony_scoping) 153 | 154 | // Flags for experimental implementation features. 155 | DEFINE_bool(packed_arrays, true, "optimizes arrays that have no holes") 156 | DEFINE_bool(smi_only_arrays, true, "tracks arrays with only smi values") 157 | DEFINE_bool(clever_optimizations, 158 | true, 159 | "Optimize object size, Array shift, DOM strings and string +") 160 | 161 | // Flags for data representation optimizations 162 | DEFINE_bool(unbox_double_arrays, true, "automatically unbox arrays of doubles") 163 | DEFINE_bool(string_slices, true, "use string slices") 164 | 165 | // Flags for Crankshaft. 166 | DEFINE_bool(crankshaft, true, "use crankshaft") 167 | DEFINE_string(hydrogen_filter, "", "optimization filter") 168 | DEFINE_bool(use_range, true, "use hydrogen range analysis") 169 | DEFINE_bool(eliminate_dead_phis, true, "eliminate dead phis") 170 | DEFINE_bool(use_gvn, true, "use hydrogen global value numbering") 171 | DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing") 172 | DEFINE_bool(use_inlining, true, "use function inlining") 173 | DEFINE_int(max_inlined_source_size, 600, 174 | "maximum source size in bytes considered for a single inlining") 175 | DEFINE_int(max_inlined_nodes, 196, 176 | "maximum number of AST nodes considered for a single inlining") 177 | DEFINE_int(max_inlined_nodes_cumulative, 196, 178 | "maximum cumulative number of AST nodes considered for inlining") 179 | DEFINE_bool(loop_invariant_code_motion, true, "loop invariant code motion") 180 | DEFINE_bool(collect_megamorphic_maps_from_stub_cache, 181 | true, 182 | "crankshaft harvests type feedback from stub cache") 183 | DEFINE_bool(hydrogen_stats, false, "print statistics for hydrogen") 184 | DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file") 185 | DEFINE_string(trace_phase, "Z", "trace generated IR for specified phases") 186 | DEFINE_bool(trace_inlining, false, "trace inlining decisions") 187 | DEFINE_bool(trace_alloc, false, "trace register allocator") 188 | DEFINE_bool(trace_all_uses, false, "trace all use positions") 189 | DEFINE_bool(trace_range, false, "trace range analysis") 190 | DEFINE_bool(trace_gvn, false, "trace global value numbering") 191 | DEFINE_bool(trace_representation, false, "trace representation types") 192 | DEFINE_bool(stress_pointer_maps, false, "pointer map for every instruction") 193 | DEFINE_bool(stress_environments, false, "environment for every instruction") 194 | DEFINE_int(deopt_every_n_times, 195 | 0, 196 | "deoptimize every n times a deopt point is passed") 197 | DEFINE_bool(trap_on_deopt, false, "put a break point before deoptimizing") 198 | DEFINE_bool(deoptimize_uncommon_cases, true, "deoptimize uncommon cases") 199 | DEFINE_bool(polymorphic_inlining, true, "polymorphic inlining") 200 | DEFINE_bool(use_osr, true, "use on-stack replacement") 201 | DEFINE_bool(array_bounds_checks_elimination, true, 202 | "perform array bounds checks elimination") 203 | DEFINE_bool(array_index_dehoisting, true, 204 | "perform array index dehoisting") 205 | DEFINE_bool(dead_code_elimination, true, "use dead code elimination") 206 | DEFINE_bool(trace_dead_code_elimination, false, "trace dead code elimination") 207 | 208 | DEFINE_bool(trace_osr, false, "trace on-stack replacement") 209 | DEFINE_int(stress_runs, 0, "number of stress runs") 210 | DEFINE_bool(optimize_closures, true, "optimize closures") 211 | DEFINE_bool(lookup_sample_by_shared, true, 212 | "when picking a function to optimize, watch for shared function " 213 | "info, not JSFunction itself") 214 | DEFINE_bool(cache_optimized_code, true, 215 | "cache optimized code for closures") 216 | DEFINE_bool(inline_construct, true, "inline constructor calls") 217 | DEFINE_bool(inline_arguments, true, "inline functions with arguments object") 218 | DEFINE_bool(inline_accessors, true, "inline JavaScript accessors") 219 | DEFINE_int(loop_weight, 1, "loop weight for representation inference") 220 | 221 | DEFINE_bool(optimize_for_in, true, 222 | "optimize functions containing for-in loops") 223 | DEFINE_bool(opt_safe_uint32_operations, true, 224 | "allow uint32 values on optimize frames if they are used only in" 225 | "safe operations") 226 | 227 | DEFINE_bool(parallel_recompilation, false, 228 | "optimizing hot functions asynchronously on a separate thread") 229 | DEFINE_bool(trace_parallel_recompilation, false, "track parallel recompilation") 230 | DEFINE_int(parallel_recompilation_queue_length, 2, 231 | "the length of the parallel compilation queue") 232 | 233 | // Experimental profiler changes. 234 | DEFINE_bool(experimental_profiler, true, "enable all profiler experiments") 235 | DEFINE_bool(watch_ic_patching, false, "profiler considers IC stability") 236 | DEFINE_int(frame_count, 1, "number of stack frames inspected by the profiler") 237 | DEFINE_bool(self_optimization, false, 238 | "primitive functions trigger their own optimization") 239 | DEFINE_bool(direct_self_opt, false, 240 | "call recompile stub directly when self-optimizing") 241 | DEFINE_bool(retry_self_opt, false, "re-try self-optimization if it failed") 242 | DEFINE_bool(count_based_interrupts, false, 243 | "trigger profiler ticks based on counting instead of timing") 244 | DEFINE_bool(interrupt_at_exit, false, 245 | "insert an interrupt check at function exit") 246 | DEFINE_bool(weighted_back_edges, false, 247 | "weight back edges by jump distance for interrupt triggering") 248 | // 0x1700 fits in the immediate field of an ARM instruction. 249 | DEFINE_int(interrupt_budget, 0x1700, 250 | "execution budget before interrupt is triggered") 251 | DEFINE_int(type_info_threshold, 15, 252 | "percentage of ICs that must have type info to allow optimization") 253 | DEFINE_int(self_opt_count, 130, "call count before self-optimization") 254 | 255 | DEFINE_implication(experimental_profiler, watch_ic_patching) 256 | DEFINE_implication(experimental_profiler, self_optimization) 257 | // Not implying direct_self_opt here because it seems to be a bad idea. 258 | DEFINE_implication(experimental_profiler, retry_self_opt) 259 | DEFINE_implication(experimental_profiler, count_based_interrupts) 260 | DEFINE_implication(experimental_profiler, interrupt_at_exit) 261 | DEFINE_implication(experimental_profiler, weighted_back_edges) 262 | 263 | DEFINE_bool(trace_opt_verbose, false, "extra verbose compilation tracing") 264 | DEFINE_implication(trace_opt_verbose, trace_opt) 265 | 266 | // assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc 267 | DEFINE_bool(debug_code, false, 268 | "generate extra code (assertions) for debugging") 269 | DEFINE_bool(code_comments, false, "emit comments in code disassembly") 270 | DEFINE_bool(enable_sse2, true, 271 | "enable use of SSE2 instructions if available") 272 | DEFINE_bool(enable_sse3, true, 273 | "enable use of SSE3 instructions if available") 274 | DEFINE_bool(enable_sse4_1, true, 275 | "enable use of SSE4.1 instructions if available") 276 | DEFINE_bool(enable_cmov, true, 277 | "enable use of CMOV instruction if available") 278 | DEFINE_bool(enable_rdtsc, true, 279 | "enable use of RDTSC instruction if available") 280 | DEFINE_bool(enable_sahf, true, 281 | "enable use of SAHF instruction if available (X64 only)") 282 | DEFINE_bool(enable_vfp3, true, 283 | "enable use of VFP3 instructions if available - this implies " 284 | "enabling ARMv7 and VFP2 instructions (ARM only)") 285 | DEFINE_bool(enable_vfp2, true, 286 | "enable use of VFP2 instructions if available") 287 | DEFINE_bool(enable_armv7, true, 288 | "enable use of ARMv7 instructions if available (ARM only)") 289 | DEFINE_bool(enable_sudiv, true, 290 | "enable use of SDIV and UDIV instructions if available (ARM only)") 291 | DEFINE_bool(enable_movw_movt, false, 292 | "enable loading 32-bit constant by means of movw/movt " 293 | "instruction pairs (ARM only)") 294 | DEFINE_bool(enable_unaligned_accesses, true, 295 | "enable unaligned accesses for ARMv7 (ARM only)") 296 | DEFINE_bool(enable_fpu, true, 297 | "enable use of MIPS FPU instructions if available (MIPS only)") 298 | 299 | // bootstrapper.cc 300 | DEFINE_string(expose_natives_as, NULL, "expose natives in global object") 301 | DEFINE_string(expose_debug_as, NULL, "expose debug in global object") 302 | DEFINE_bool(expose_gc, false, "expose gc extension") 303 | DEFINE_bool(expose_externalize_string, false, 304 | "expose externalize string extension") 305 | DEFINE_int(stack_trace_limit, 10, "number of stack frames to capture") 306 | DEFINE_bool(builtins_in_stack_traces, false, 307 | "show built-in functions in stack traces") 308 | DEFINE_bool(disable_native_files, false, "disable builtin natives files") 309 | 310 | // builtins-ia32.cc 311 | DEFINE_bool(inline_new, true, "use fast inline allocation") 312 | 313 | // checks.cc 314 | DEFINE_bool(stack_trace_on_abort, true, 315 | "print a stack trace if an assertion failure occurs") 316 | 317 | // codegen-ia32.cc / codegen-arm.cc 318 | DEFINE_bool(trace, false, "trace function calls") 319 | DEFINE_bool(mask_constants_with_cookie, 320 | true, 321 | "use random jit cookie to mask large constants") 322 | 323 | // codegen.cc 324 | DEFINE_bool(lazy, true, "use lazy compilation") 325 | DEFINE_bool(trace_opt, false, "trace lazy optimization") 326 | DEFINE_bool(trace_opt_stats, false, "trace lazy optimization statistics") 327 | DEFINE_bool(opt, true, "use adaptive optimizations") 328 | DEFINE_bool(always_opt, false, "always try to optimize functions") 329 | DEFINE_bool(prepare_always_opt, false, "prepare for turning on always opt") 330 | DEFINE_bool(trace_deopt, false, "trace deoptimization") 331 | 332 | // compiler.cc 333 | DEFINE_int(min_preparse_length, 1024, 334 | "minimum length for automatic enable preparsing") 335 | DEFINE_bool(always_full_compiler, false, 336 | "try to use the dedicated run-once backend for all code") 337 | DEFINE_int(max_opt_count, 10, 338 | "maximum number of optimization attempts before giving up.") 339 | 340 | // compilation-cache.cc 341 | DEFINE_bool(compilation_cache, true, "enable compilation cache") 342 | 343 | DEFINE_bool(cache_prototype_transitions, true, "cache prototype transitions") 344 | 345 | // debug.cc 346 | DEFINE_bool(trace_debug_json, false, "trace debugging JSON request/response") 347 | DEFINE_bool(debugger_auto_break, true, 348 | "automatically set the debug break flag when debugger commands are " 349 | "in the queue") 350 | DEFINE_bool(enable_liveedit, true, "enable liveedit experimental feature") 351 | DEFINE_bool(break_on_abort, true, "always cause a debug break before aborting") 352 | 353 | // execution.cc 354 | // Slightly less than 1MB on 64-bit, since Windows' default stack size for 355 | // the main execution thread is 1MB for both 32 and 64-bit. 356 | DEFINE_int(stack_size, kPointerSize * 123, 357 | "default size of stack region v8 is allowed to use (in kBytes)") 358 | 359 | // frames.cc 360 | DEFINE_int(max_stack_trace_source_length, 300, 361 | "maximum length of function source code printed in a stack trace.") 362 | 363 | // full-codegen.cc 364 | DEFINE_bool(always_inline_smi_code, false, 365 | "always inline smi code in non-opt code") 366 | 367 | // heap.cc 368 | DEFINE_int(max_new_space_size, 0, "max size of the new generation (in kBytes)") 369 | DEFINE_int(max_old_space_size, 0, "max size of the old generation (in Mbytes)") 370 | DEFINE_int(max_executable_size, 0, "max size of executable memory (in Mbytes)") 371 | DEFINE_bool(gc_global, false, "always perform global GCs") 372 | DEFINE_int(gc_interval, -1, "garbage collect after allocations") 373 | DEFINE_bool(trace_gc, false, 374 | "print one trace line following each garbage collection") 375 | DEFINE_bool(trace_gc_nvp, false, 376 | "print one detailed trace line in name=value format " 377 | "after each garbage collection") 378 | DEFINE_bool(trace_gc_ignore_scavenger, false, 379 | "do not print trace line after scavenger collection") 380 | DEFINE_bool(print_cumulative_gc_stat, false, 381 | "print cumulative GC statistics in name=value format on exit") 382 | DEFINE_bool(trace_gc_verbose, false, 383 | "print more details following each garbage collection") 384 | DEFINE_bool(trace_fragmentation, false, 385 | "report fragmentation for old pointer and data pages") 386 | DEFINE_bool(trace_external_memory, false, 387 | "print amount of external allocated memory after each time " 388 | "it is adjusted.") 389 | DEFINE_bool(collect_maps, true, 390 | "garbage collect maps from which no objects can be reached") 391 | DEFINE_bool(flush_code, true, 392 | "flush code that we expect not to use again before full gc") 393 | DEFINE_bool(incremental_marking, true, "use incremental marking") 394 | DEFINE_bool(incremental_marking_steps, true, "do incremental marking steps") 395 | DEFINE_bool(trace_incremental_marking, false, 396 | "trace progress of the incremental marking") 397 | DEFINE_bool(track_gc_object_stats, false, 398 | "track object counts and memory usage") 399 | #ifdef VERIFY_HEAP 400 | DEFINE_bool(verify_heap, false, "verify heap pointers before and after GC") 401 | #endif 402 | 403 | // v8.cc 404 | DEFINE_bool(use_idle_notification, true, 405 | "Use idle notification to reduce memory footprint.") 406 | // ic.cc 407 | DEFINE_bool(use_ic, true, "use inline caching") 408 | 409 | #ifdef LIVE_OBJECT_LIST 410 | // liveobjectlist.cc 411 | DEFINE_string(lol_workdir, NULL, "path for lol temp files") 412 | DEFINE_bool(verify_lol, false, "perform debugging verification for lol") 413 | #endif 414 | 415 | // macro-assembler-ia32.cc 416 | DEFINE_bool(native_code_counters, false, 417 | "generate extra code for manipulating stats counters") 418 | 419 | // mark-compact.cc 420 | DEFINE_bool(always_compact, false, "Perform compaction on every full GC") 421 | DEFINE_bool(lazy_sweeping, true, 422 | "Use lazy sweeping for old pointer and data spaces") 423 | DEFINE_bool(never_compact, false, 424 | "Never perform compaction on full GC - testing only") 425 | DEFINE_bool(compact_code_space, true, 426 | "Compact code space on full non-incremental collections") 427 | DEFINE_bool(incremental_code_compaction, true, 428 | "Compact code space on full incremental collections") 429 | DEFINE_bool(cleanup_code_caches_at_gc, true, 430 | "Flush inline caches prior to mark compact collection and " 431 | "flush code caches in maps during mark compact cycle.") 432 | DEFINE_int(random_seed, 0, 433 | "Default seed for initializing random generator " 434 | "(0, the default, means to use system random).") 435 | 436 | // objects.cc 437 | DEFINE_bool(use_verbose_printer, true, "allows verbose printing") 438 | 439 | // parser.cc 440 | DEFINE_bool(allow_natives_syntax, false, "allow natives syntax") 441 | DEFINE_bool(trace_parse, false, "trace parsing and preparsing") 442 | 443 | // simulator-arm.cc and simulator-mips.cc 444 | DEFINE_bool(trace_sim, false, "Trace simulator execution") 445 | DEFINE_bool(check_icache, false, 446 | "Check icache flushes in ARM and MIPS simulator") 447 | DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions") 448 | DEFINE_int(sim_stack_alignment, 8, 449 | "Stack alingment in bytes in simulator (4 or 8, 8 is default)") 450 | 451 | // isolate.cc 452 | DEFINE_bool(trace_exception, false, 453 | "print stack trace when throwing exceptions") 454 | DEFINE_bool(preallocate_message_memory, false, 455 | "preallocate some memory to build stack traces.") 456 | DEFINE_bool(randomize_hashes, 457 | true, 458 | "randomize hashes to avoid predictable hash collisions " 459 | "(with snapshots this option cannot override the baked-in seed)") 460 | DEFINE_int(hash_seed, 461 | 0, 462 | "Fixed seed to use to hash property keys (0 means random)" 463 | "(with snapshots this option cannot override the baked-in seed)") 464 | 465 | // v8.cc 466 | DEFINE_bool(preemption, false, 467 | "activate a 100ms timer that switches between V8 threads") 468 | 469 | // Regexp 470 | DEFINE_bool(regexp_optimization, true, "generate optimized regexp code") 471 | 472 | // Testing flags test/cctest/test-{flags,api,serialization}.cc 473 | DEFINE_bool(testing_bool_flag, true, "testing_bool_flag") 474 | DEFINE_int(testing_int_flag, 13, "testing_int_flag") 475 | DEFINE_float(testing_float_flag, 2.5, "float-flag") 476 | DEFINE_string(testing_string_flag, "Hello, world!", "string-flag") 477 | DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness") 478 | #ifdef WIN32 479 | DEFINE_string(testing_serialization_file, "C:\\Windows\\Temp\\serdes", 480 | "file in which to testing_serialize heap") 481 | #else 482 | DEFINE_string(testing_serialization_file, "/tmp/serdes", 483 | "file in which to serialize heap") 484 | #endif 485 | 486 | // mksnapshot.cc 487 | DEFINE_string(extra_code, NULL, "A filename with extra code to be included in" 488 | " the snapshot (mksnapshot only)") 489 | 490 | // 491 | // Dev shell flags 492 | // 493 | 494 | DEFINE_bool(help, false, "Print usage message, including flags, on console") 495 | DEFINE_bool(dump_counters, false, "Dump counters on exit") 496 | 497 | #ifdef ENABLE_DEBUGGER_SUPPORT 498 | DEFINE_bool(debugger, false, "Enable JavaScript debugger") 499 | DEFINE_bool(remote_debugger, false, "Connect JavaScript debugger to the " 500 | "debugger agent in another process") 501 | DEFINE_bool(debugger_agent, false, "Enable debugger agent") 502 | DEFINE_int(debugger_port, 5858, "Port to use for remote debugging") 503 | #endif // ENABLE_DEBUGGER_SUPPORT 504 | 505 | DEFINE_string(map_counters, "", "Map counters to a file") 506 | DEFINE_args(js_arguments, JSARGUMENTS_INIT, 507 | "Pass all remaining arguments to the script. Alias for \"--\".") 508 | 509 | #if defined(WEBOS__) 510 | DEFINE_bool(debug_compile_events, false, "Enable debugger compile events") 511 | DEFINE_bool(debug_script_collected_events, false, 512 | "Enable debugger script collected events") 513 | #else 514 | DEFINE_bool(debug_compile_events, true, "Enable debugger compile events") 515 | DEFINE_bool(debug_script_collected_events, true, 516 | "Enable debugger script collected events") 517 | #endif 518 | 519 | 520 | // 521 | // GDB JIT integration flags. 522 | // 523 | 524 | DEFINE_bool(gdbjit, false, "enable GDBJIT interface (disables compacting GC)") 525 | DEFINE_bool(gdbjit_full, false, "enable GDBJIT interface for all code objects") 526 | DEFINE_bool(gdbjit_dump, false, "dump elf objects with debug info to disk") 527 | DEFINE_string(gdbjit_dump_filter, "", 528 | "dump only objects containing this substring") 529 | 530 | // mark-compact.cc 531 | DEFINE_bool(force_marking_deque_overflows, false, 532 | "force overflows of marking deque by reducing it's size " 533 | "to 64 words") 534 | 535 | DEFINE_bool(stress_compaction, false, 536 | "stress the GC compactor to flush out bugs (implies " 537 | "--force_marking_deque_overflows)") 538 | 539 | // 540 | // Debug only flags 541 | // 542 | #undef FLAG 543 | #ifdef DEBUG 544 | #define FLAG FLAG_FULL 545 | #else 546 | #define FLAG FLAG_READONLY 547 | #endif 548 | 549 | // checks.cc 550 | DEFINE_bool(enable_slow_asserts, false, 551 | "enable asserts that are slow to execute") 552 | 553 | // codegen-ia32.cc / codegen-arm.cc 554 | DEFINE_bool(trace_codegen, false, 555 | "print name of functions for which code is generated") 556 | DEFINE_bool(print_source, false, "pretty print source code") 557 | DEFINE_bool(print_builtin_source, false, 558 | "pretty print source code for builtins") 559 | DEFINE_bool(print_ast, false, "print source AST") 560 | DEFINE_bool(print_builtin_ast, false, "print source AST for builtins") 561 | DEFINE_string(stop_at, "", "function name where to insert a breakpoint") 562 | 563 | // compiler.cc 564 | DEFINE_bool(print_builtin_scopes, false, "print scopes for builtins") 565 | DEFINE_bool(print_scopes, false, "print scopes") 566 | 567 | // contexts.cc 568 | DEFINE_bool(trace_contexts, false, "trace contexts operations") 569 | 570 | // heap.cc 571 | DEFINE_bool(gc_greedy, false, "perform GC prior to some allocations") 572 | DEFINE_bool(gc_verbose, false, "print stuff during garbage collection") 573 | DEFINE_bool(heap_stats, false, "report heap statistics before and after GC") 574 | DEFINE_bool(code_stats, false, "report code statistics after GC") 575 | DEFINE_bool(verify_native_context_separation, false, 576 | "verify that code holds on to at most one native context after GC") 577 | DEFINE_bool(print_handles, false, "report handles after GC") 578 | DEFINE_bool(print_global_handles, false, "report global handles after GC") 579 | 580 | // ic.cc 581 | DEFINE_bool(trace_ic, false, "trace inline cache state transitions") 582 | 583 | // interface.cc 584 | DEFINE_bool(print_interfaces, false, "print interfaces") 585 | DEFINE_bool(print_interface_details, false, "print interface inference details") 586 | DEFINE_int(print_interface_depth, 5, "depth for printing interfaces") 587 | 588 | // objects.cc 589 | DEFINE_bool(trace_normalization, 590 | false, 591 | "prints when objects are turned into dictionaries.") 592 | 593 | // runtime.cc 594 | DEFINE_bool(trace_lazy, false, "trace lazy compilation") 595 | 596 | // spaces.cc 597 | DEFINE_bool(collect_heap_spill_statistics, false, 598 | "report heap spill statistics along with heap_stats " 599 | "(requires heap_stats)") 600 | 601 | DEFINE_bool(trace_isolates, false, "trace isolate state changes") 602 | 603 | // VM state 604 | DEFINE_bool(log_state_changes, false, "Log state changes.") 605 | 606 | // Regexp 607 | DEFINE_bool(regexp_possessive_quantifier, 608 | false, 609 | "enable possessive quantifier syntax for testing") 610 | DEFINE_bool(trace_regexp_bytecodes, false, "trace regexp bytecode execution") 611 | DEFINE_bool(trace_regexp_assembler, 612 | false, 613 | "trace regexp macro assembler calls.") 614 | 615 | // 616 | // Logging and profiling flags 617 | // 618 | #undef FLAG 619 | #define FLAG FLAG_FULL 620 | 621 | // log.cc 622 | DEFINE_bool(log, false, 623 | "Minimal logging (no API, code, GC, suspect, or handles samples).") 624 | DEFINE_bool(log_all, false, "Log all events to the log file.") 625 | DEFINE_bool(log_runtime, false, "Activate runtime system %Log call.") 626 | DEFINE_bool(log_api, false, "Log API events to the log file.") 627 | DEFINE_bool(log_code, false, 628 | "Log code events to the log file without profiling.") 629 | DEFINE_bool(log_gc, false, 630 | "Log heap samples on garbage collection for the hp2ps tool.") 631 | DEFINE_bool(log_handles, false, "Log global handle events.") 632 | DEFINE_bool(log_snapshot_positions, false, 633 | "log positions of (de)serialized objects in the snapshot.") 634 | DEFINE_bool(log_suspect, false, "Log suspect operations.") 635 | DEFINE_bool(prof, false, 636 | "Log statistical profiling information (implies --log-code).") 637 | DEFINE_bool(prof_auto, true, 638 | "Used with --prof, starts profiling automatically") 639 | DEFINE_bool(prof_lazy, false, 640 | "Used with --prof, only does sampling and logging" 641 | " when profiler is active (implies --noprof_auto).") 642 | DEFINE_bool(prof_browser_mode, true, 643 | "Used with --prof, turns on browser-compatible mode for profiling.") 644 | DEFINE_bool(log_regexp, false, "Log regular expression execution.") 645 | DEFINE_bool(sliding_state_window, false, 646 | "Update sliding state window counters.") 647 | DEFINE_string(logfile, "v8.log", "Specify the name of the log file.") 648 | DEFINE_bool(ll_prof, false, "Enable low-level linux profiler.") 649 | DEFINE_string(gc_fake_mmap, "/tmp/__v8_gc__", 650 | "Specify the name of the file for fake gc mmap used in ll_prof") 651 | 652 | // 653 | // Disassembler only flags 654 | // 655 | #undef FLAG 656 | #ifdef ENABLE_DISASSEMBLER 657 | #define FLAG FLAG_FULL 658 | #else 659 | #define FLAG FLAG_READONLY 660 | #endif 661 | 662 | // elements.cc 663 | DEFINE_bool(trace_elements_transitions, false, "trace elements transitions") 664 | 665 | // code-stubs.cc 666 | DEFINE_bool(print_code_stubs, false, "print code stubs") 667 | DEFINE_bool(test_secondary_stub_cache, 668 | false, 669 | "test secondary stub cache by disabling the primary one") 670 | 671 | DEFINE_bool(test_primary_stub_cache, 672 | false, 673 | "test primary stub cache by disabling the secondary one") 674 | 675 | // codegen-ia32.cc / codegen-arm.cc 676 | DEFINE_bool(print_code, false, "print generated code") 677 | DEFINE_bool(print_opt_code, false, "print optimized code") 678 | DEFINE_bool(print_unopt_code, false, "print unoptimized code before " 679 | "printing optimized code based on it") 680 | DEFINE_bool(print_code_verbose, false, "print more information for code") 681 | DEFINE_bool(print_builtin_code, false, "print generated code for builtins") 682 | 683 | #ifdef ENABLE_DISASSEMBLER 684 | DEFINE_bool(print_all_code, false, "enable all flags related to printing code") 685 | DEFINE_implication(print_all_code, print_code) 686 | DEFINE_implication(print_all_code, print_opt_code) 687 | DEFINE_implication(print_all_code, print_unopt_code) 688 | DEFINE_implication(print_all_code, print_code_verbose) 689 | DEFINE_implication(print_all_code, print_builtin_code) 690 | DEFINE_implication(print_all_code, print_code_stubs) 691 | DEFINE_implication(print_all_code, code_comments) 692 | #ifdef DEBUG 693 | DEFINE_implication(print_all_code, trace_codegen) 694 | #endif 695 | #endif 696 | 697 | // Cleanup... 698 | #undef FLAG_FULL 699 | #undef FLAG_READONLY 700 | #undef FLAG 701 | 702 | #undef DEFINE_bool 703 | #undef DEFINE_int 704 | #undef DEFINE_string 705 | #undef DEFINE_implication 706 | 707 | #undef FLAG_MODE_DECLARE 708 | #undef FLAG_MODE_DEFINE 709 | #undef FLAG_MODE_DEFINE_DEFAULTS 710 | #undef FLAG_MODE_META 711 | #undef FLAG_MODE_DEFINE_IMPLICATIONS 712 | -------------------------------------------------------------------------------- /v8/flag-definitions.3.25.30.h: -------------------------------------------------------------------------------- 1 | // Copyright 2012 the V8 project authors. All rights reserved. 2 | // Redistribution and use in source and binary forms, with or without 3 | // modification, are permitted provided that the following conditions are 4 | // met: 5 | // 6 | // * Redistributions of source code must retain the above copyright 7 | // notice, this list of conditions and the following disclaimer. 8 | // * Redistributions in binary form must reproduce the above 9 | // copyright notice, this list of conditions and the following 10 | // disclaimer in the documentation and/or other materials provided 11 | // with the distribution. 12 | // * Neither the name of Google Inc. nor the names of its 13 | // contributors may be used to endorse or promote products derived 14 | // from this software without specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | // This file defines all of the flags. It is separated into different section, 29 | // for Debug, Release, Logging and Profiling, etc. To add a new flag, find the 30 | // correct section, and use one of the DEFINE_ macros, without a trailing ';'. 31 | // 32 | // This include does not have a guard, because it is a template-style include, 33 | // which can be included multiple times in different modes. It expects to have 34 | // a mode defined before it's included. The modes are FLAG_MODE_... below: 35 | 36 | // We want to declare the names of the variables for the header file. Normally 37 | // this will just be an extern declaration, but for a readonly flag we let the 38 | // compiler make better optimizations by giving it the value. 39 | #if defined(FLAG_MODE_DECLARE) 40 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 41 | extern ctype FLAG_##nam; 42 | #define FLAG_READONLY(ftype, ctype, nam, def, cmt) \ 43 | static ctype const FLAG_##nam = def; 44 | 45 | // We want to supply the actual storage and value for the flag variable in the 46 | // .cc file. We only do this for writable flags. 47 | #elif defined(FLAG_MODE_DEFINE) 48 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 49 | ctype FLAG_##nam = def; 50 | 51 | // We need to define all of our default values so that the Flag structure can 52 | // access them by pointer. These are just used internally inside of one .cc, 53 | // for MODE_META, so there is no impact on the flags interface. 54 | #elif defined(FLAG_MODE_DEFINE_DEFAULTS) 55 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 56 | static ctype const FLAGDEFAULT_##nam = def; 57 | 58 | // We want to write entries into our meta data table, for internal parsing and 59 | // printing / etc in the flag parser code. We only do this for writable flags. 60 | #elif defined(FLAG_MODE_META) 61 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ 62 | { Flag::TYPE_##ftype, #nam, &FLAG_##nam, &FLAGDEFAULT_##nam, cmt, false }, 63 | #define FLAG_ALIAS(ftype, ctype, alias, nam) \ 64 | { Flag::TYPE_##ftype, #alias, &FLAG_##nam, &FLAGDEFAULT_##nam, \ 65 | "alias for --"#nam, false }, 66 | 67 | // We produce the code to set flags when it is implied by another flag. 68 | #elif defined(FLAG_MODE_DEFINE_IMPLICATIONS) 69 | #define DEFINE_implication(whenflag, thenflag) \ 70 | if (FLAG_##whenflag) FLAG_##thenflag = true; 71 | 72 | #define DEFINE_neg_implication(whenflag, thenflag) \ 73 | if (FLAG_##whenflag) FLAG_##thenflag = false; 74 | 75 | #else 76 | #error No mode supplied when including flags.defs 77 | #endif 78 | 79 | // Dummy defines for modes where it is not relevant. 80 | #ifndef FLAG_FULL 81 | #define FLAG_FULL(ftype, ctype, nam, def, cmt) 82 | #endif 83 | 84 | #ifndef FLAG_READONLY 85 | #define FLAG_READONLY(ftype, ctype, nam, def, cmt) 86 | #endif 87 | 88 | #ifndef FLAG_ALIAS 89 | #define FLAG_ALIAS(ftype, ctype, alias, nam) 90 | #endif 91 | 92 | #ifndef DEFINE_implication 93 | #define DEFINE_implication(whenflag, thenflag) 94 | #endif 95 | 96 | #ifndef DEFINE_neg_implication 97 | #define DEFINE_neg_implication(whenflag, thenflag) 98 | #endif 99 | 100 | #define COMMA , 101 | 102 | #ifdef FLAG_MODE_DECLARE 103 | // Structure used to hold a collection of arguments to the JavaScript code. 104 | struct JSArguments { 105 | public: 106 | inline const char*& operator[] (int idx) const { 107 | return argv[idx]; 108 | } 109 | static JSArguments Create(int argc, const char** argv) { 110 | JSArguments args; 111 | args.argc = argc; 112 | args.argv = argv; 113 | return args; 114 | } 115 | int argc; 116 | const char** argv; 117 | }; 118 | 119 | struct MaybeBoolFlag { 120 | static MaybeBoolFlag Create(bool has_value, bool value) { 121 | MaybeBoolFlag flag; 122 | flag.has_value = has_value; 123 | flag.value = value; 124 | return flag; 125 | } 126 | bool has_value; 127 | bool value; 128 | }; 129 | #endif 130 | 131 | #if (defined CAN_USE_VFP3_INSTRUCTIONS) || !(defined ARM_TEST) 132 | # define ENABLE_VFP3_DEFAULT true 133 | #else 134 | # define ENABLE_VFP3_DEFAULT false 135 | #endif 136 | #if (defined CAN_USE_ARMV7_INSTRUCTIONS) || !(defined ARM_TEST) 137 | # define ENABLE_ARMV7_DEFAULT true 138 | #else 139 | # define ENABLE_ARMV7_DEFAULT false 140 | #endif 141 | #if (defined CAN_USE_VFP32DREGS) || !(defined ARM_TEST) 142 | # define ENABLE_32DREGS_DEFAULT true 143 | #else 144 | # define ENABLE_32DREGS_DEFAULT false 145 | #endif 146 | 147 | #define DEFINE_bool(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt) 148 | #define DEFINE_maybe_bool(nam, cmt) FLAG(MAYBE_BOOL, MaybeBoolFlag, nam, \ 149 | { false COMMA false }, cmt) 150 | #define DEFINE_int(nam, def, cmt) FLAG(INT, int, nam, def, cmt) 151 | #define DEFINE_float(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt) 152 | #define DEFINE_string(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt) 153 | #define DEFINE_args(nam, cmt) FLAG(ARGS, JSArguments, nam, \ 154 | { 0 COMMA NULL }, cmt) 155 | 156 | #define DEFINE_ALIAS_bool(alias, nam) FLAG_ALIAS(BOOL, bool, alias, nam) 157 | #define DEFINE_ALIAS_int(alias, nam) FLAG_ALIAS(INT, int, alias, nam) 158 | #define DEFINE_ALIAS_float(alias, nam) FLAG_ALIAS(FLOAT, double, alias, nam) 159 | #define DEFINE_ALIAS_string(alias, nam) \ 160 | FLAG_ALIAS(STRING, const char*, alias, nam) 161 | #define DEFINE_ALIAS_args(alias, nam) FLAG_ALIAS(ARGS, JSArguments, alias, nam) 162 | 163 | // 164 | // Flags in all modes. 165 | // 166 | #define FLAG FLAG_FULL 167 | 168 | // Flags for language modes and experimental language features. 169 | DEFINE_bool(use_strict, false, "enforce strict mode") 170 | DEFINE_bool(es_staging, false, "enable upcoming ES6+ features") 171 | 172 | DEFINE_bool(harmony_typeof, false, "enable harmony semantics for typeof") 173 | DEFINE_bool(harmony_scoping, false, "enable harmony block scoping") 174 | DEFINE_bool(harmony_modules, false, 175 | "enable harmony modules (implies block scoping)") 176 | DEFINE_bool(harmony_symbols, false, 177 | "enable harmony symbols (a.k.a. private names)") 178 | DEFINE_bool(harmony_proxies, false, "enable harmony proxies") 179 | DEFINE_bool(harmony_collections, false, 180 | "enable harmony collections (sets, maps)") 181 | DEFINE_bool(harmony_generators, false, "enable harmony generators") 182 | DEFINE_bool(harmony_iteration, false, "enable harmony iteration (for-of)") 183 | DEFINE_bool(harmony_numeric_literals, false, 184 | "enable harmony numeric literals (0o77, 0b11)") 185 | DEFINE_bool(harmony_strings, false, "enable harmony string") 186 | DEFINE_bool(harmony_arrays, false, "enable harmony arrays") 187 | DEFINE_bool(harmony_maths, false, "enable harmony math functions") 188 | DEFINE_bool(harmony, false, "enable all harmony features (except typeof)") 189 | 190 | DEFINE_implication(harmony, harmony_scoping) 191 | DEFINE_implication(harmony, harmony_modules) 192 | DEFINE_implication(harmony, harmony_symbols) 193 | DEFINE_implication(harmony, harmony_proxies) 194 | DEFINE_implication(harmony, harmony_collections) 195 | DEFINE_implication(harmony, harmony_generators) 196 | DEFINE_implication(harmony, harmony_iteration) 197 | DEFINE_implication(harmony, harmony_numeric_literals) 198 | DEFINE_implication(harmony, harmony_strings) 199 | DEFINE_implication(harmony, harmony_arrays) 200 | DEFINE_implication(harmony_modules, harmony_scoping) 201 | 202 | DEFINE_implication(harmony, es_staging) 203 | DEFINE_implication(es_staging, harmony_maths) 204 | 205 | // Flags for experimental implementation features. 206 | DEFINE_bool(packed_arrays, true, "optimizes arrays that have no holes") 207 | DEFINE_bool(smi_only_arrays, true, "tracks arrays with only smi values") 208 | DEFINE_bool(compiled_keyed_dictionary_loads, true, 209 | "use optimizing compiler to generate keyed dictionary load stubs") 210 | DEFINE_bool(clever_optimizations, true, 211 | "Optimize object size, Array shift, DOM strings and string +") 212 | DEFINE_bool(pretenuring, true, "allocate objects in old space") 213 | // TODO(hpayer): We will remove this flag as soon as we have pretenuring 214 | // support for specific allocation sites. 215 | DEFINE_bool(pretenuring_call_new, false, "pretenure call new") 216 | DEFINE_bool(allocation_site_pretenuring, true, 217 | "pretenure with allocation sites") 218 | DEFINE_bool(trace_pretenuring, false, 219 | "trace pretenuring decisions of HAllocate instructions") 220 | DEFINE_bool(trace_pretenuring_statistics, false, 221 | "trace allocation site pretenuring statistics") 222 | DEFINE_bool(track_fields, true, "track fields with only smi values") 223 | DEFINE_bool(track_double_fields, true, "track fields with double values") 224 | DEFINE_bool(track_heap_object_fields, true, "track fields with heap values") 225 | DEFINE_bool(track_computed_fields, true, "track computed boilerplate fields") 226 | DEFINE_implication(track_double_fields, track_fields) 227 | DEFINE_implication(track_heap_object_fields, track_fields) 228 | DEFINE_implication(track_computed_fields, track_fields) 229 | DEFINE_bool(smi_binop, true, "support smi representation in binary operations") 230 | 231 | // Flags for optimization types. 232 | DEFINE_bool(optimize_for_size, false, 233 | "Enables optimizations which favor memory size over execution " 234 | "speed.") 235 | 236 | // Flags for data representation optimizations 237 | DEFINE_bool(unbox_double_arrays, true, "automatically unbox arrays of doubles") 238 | DEFINE_bool(string_slices, true, "use string slices") 239 | 240 | // Flags for Crankshaft. 241 | DEFINE_bool(crankshaft, true, "use crankshaft") 242 | DEFINE_string(hydrogen_filter, "*", "optimization filter") 243 | DEFINE_bool(use_gvn, true, "use hydrogen global value numbering") 244 | DEFINE_int(gvn_iterations, 3, "maximum number of GVN fix-point iterations") 245 | DEFINE_bool(use_canonicalizing, true, "use hydrogen instruction canonicalizing") 246 | DEFINE_bool(use_inlining, true, "use function inlining") 247 | DEFINE_bool(use_escape_analysis, true, "use hydrogen escape analysis") 248 | DEFINE_bool(use_allocation_folding, true, "use allocation folding") 249 | DEFINE_bool(use_local_allocation_folding, false, "only fold in basic blocks") 250 | DEFINE_bool(use_write_barrier_elimination, true, 251 | "eliminate write barriers targeting allocations in optimized code") 252 | DEFINE_int(max_inlining_levels, 5, "maximum number of inlining levels") 253 | DEFINE_int(max_inlined_source_size, 600, 254 | "maximum source size in bytes considered for a single inlining") 255 | DEFINE_int(max_inlined_nodes, 196, 256 | "maximum number of AST nodes considered for a single inlining") 257 | DEFINE_int(max_inlined_nodes_cumulative, 400, 258 | "maximum cumulative number of AST nodes considered for inlining") 259 | DEFINE_bool(loop_invariant_code_motion, true, "loop invariant code motion") 260 | DEFINE_bool(fast_math, true, "faster (but maybe less accurate) math functions") 261 | DEFINE_bool(collect_megamorphic_maps_from_stub_cache, true, 262 | "crankshaft harvests type feedback from stub cache") 263 | DEFINE_bool(hydrogen_stats, false, "print statistics for hydrogen") 264 | DEFINE_bool(trace_check_elimination, false, "trace check elimination phase") 265 | DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file") 266 | DEFINE_string(trace_hydrogen_filter, "*", "hydrogen tracing filter") 267 | DEFINE_bool(trace_hydrogen_stubs, false, "trace generated hydrogen for stubs") 268 | DEFINE_string(trace_hydrogen_file, NULL, "trace hydrogen to given file name") 269 | DEFINE_string(trace_phase, "HLZ", "trace generated IR for specified phases") 270 | DEFINE_bool(trace_inlining, false, "trace inlining decisions") 271 | DEFINE_bool(trace_load_elimination, false, "trace load elimination") 272 | DEFINE_bool(trace_store_elimination, false, "trace store elimination") 273 | DEFINE_bool(trace_alloc, false, "trace register allocator") 274 | DEFINE_bool(trace_all_uses, false, "trace all use positions") 275 | DEFINE_bool(trace_range, false, "trace range analysis") 276 | DEFINE_bool(trace_gvn, false, "trace global value numbering") 277 | DEFINE_bool(trace_representation, false, "trace representation types") 278 | DEFINE_bool(trace_escape_analysis, false, "trace hydrogen escape analysis") 279 | DEFINE_bool(trace_allocation_folding, false, "trace allocation folding") 280 | DEFINE_bool(trace_track_allocation_sites, false, 281 | "trace the tracking of allocation sites") 282 | DEFINE_bool(trace_migration, false, "trace object migration") 283 | DEFINE_bool(trace_generalization, false, "trace map generalization") 284 | DEFINE_bool(stress_pointer_maps, false, "pointer map for every instruction") 285 | DEFINE_bool(stress_environments, false, "environment for every instruction") 286 | DEFINE_int(deopt_every_n_times, 0, 287 | "deoptimize every n times a deopt point is passed") 288 | DEFINE_int(deopt_every_n_garbage_collections, 0, 289 | "deoptimize every n garbage collections") 290 | DEFINE_bool(print_deopt_stress, false, "print number of possible deopt points") 291 | DEFINE_bool(trap_on_deopt, false, "put a break point before deoptimizing") 292 | DEFINE_bool(trap_on_stub_deopt, false, 293 | "put a break point before deoptimizing a stub") 294 | DEFINE_bool(deoptimize_uncommon_cases, true, "deoptimize uncommon cases") 295 | DEFINE_bool(polymorphic_inlining, true, "polymorphic inlining") 296 | DEFINE_bool(use_osr, true, "use on-stack replacement") 297 | DEFINE_bool(array_bounds_checks_elimination, true, 298 | "perform array bounds checks elimination") 299 | DEFINE_bool(trace_bce, false, "trace array bounds check elimination") 300 | DEFINE_bool(array_bounds_checks_hoisting, false, 301 | "perform array bounds checks hoisting") 302 | DEFINE_bool(array_index_dehoisting, true, 303 | "perform array index dehoisting") 304 | DEFINE_bool(analyze_environment_liveness, true, 305 | "analyze liveness of environment slots and zap dead values") 306 | DEFINE_bool(load_elimination, true, "use load elimination") 307 | DEFINE_bool(check_elimination, true, "use check elimination") 308 | DEFINE_bool(store_elimination, false, "use store elimination") 309 | DEFINE_bool(dead_code_elimination, true, "use dead code elimination") 310 | DEFINE_bool(fold_constants, true, "use constant folding") 311 | DEFINE_bool(trace_dead_code_elimination, false, "trace dead code elimination") 312 | DEFINE_bool(unreachable_code_elimination, true, "eliminate unreachable code") 313 | DEFINE_bool(trace_osr, false, "trace on-stack replacement") 314 | DEFINE_int(stress_runs, 0, "number of stress runs") 315 | DEFINE_bool(optimize_closures, true, "optimize closures") 316 | DEFINE_bool(lookup_sample_by_shared, true, 317 | "when picking a function to optimize, watch for shared function " 318 | "info, not JSFunction itself") 319 | DEFINE_bool(cache_optimized_code, true, 320 | "cache optimized code for closures") 321 | DEFINE_bool(flush_optimized_code_cache, true, 322 | "flushes the cache of optimized code for closures on every GC") 323 | DEFINE_bool(inline_construct, true, "inline constructor calls") 324 | DEFINE_bool(inline_arguments, true, "inline functions with arguments object") 325 | DEFINE_bool(inline_accessors, true, "inline JavaScript accessors") 326 | DEFINE_int(escape_analysis_iterations, 2, 327 | "maximum number of escape analysis fix-point iterations") 328 | 329 | DEFINE_bool(optimize_for_in, true, 330 | "optimize functions containing for-in loops") 331 | DEFINE_bool(opt_safe_uint32_operations, true, 332 | "allow uint32 values on optimize frames if they are used only in " 333 | "safe operations") 334 | 335 | DEFINE_bool(concurrent_recompilation, true, 336 | "optimizing hot functions asynchronously on a separate thread") 337 | DEFINE_bool(trace_concurrent_recompilation, false, 338 | "track concurrent recompilation") 339 | DEFINE_int(concurrent_recompilation_queue_length, 8, 340 | "the length of the concurrent compilation queue") 341 | DEFINE_int(concurrent_recompilation_delay, 0, 342 | "artificial compilation delay in ms") 343 | DEFINE_bool(block_concurrent_recompilation, false, 344 | "block queued jobs until released") 345 | DEFINE_bool(concurrent_osr, false, 346 | "concurrent on-stack replacement") 347 | DEFINE_implication(concurrent_osr, concurrent_recompilation) 348 | 349 | DEFINE_bool(omit_map_checks_for_leaf_maps, true, 350 | "do not emit check maps for constant values that have a leaf map, " 351 | "deoptimize the optimized code if the layout of the maps changes.") 352 | 353 | DEFINE_int(typed_array_max_size_in_heap, 64, 354 | "threshold for in-heap typed array") 355 | 356 | // Profiler flags. 357 | DEFINE_int(frame_count, 1, "number of stack frames inspected by the profiler") 358 | // 0x1800 fits in the immediate field of an ARM instruction. 359 | DEFINE_int(interrupt_budget, 0x1800, 360 | "execution budget before interrupt is triggered") 361 | DEFINE_int(type_info_threshold, 25, 362 | "percentage of ICs that must have type info to allow optimization") 363 | DEFINE_int(self_opt_count, 130, "call count before self-optimization") 364 | 365 | DEFINE_bool(trace_opt_verbose, false, "extra verbose compilation tracing") 366 | DEFINE_implication(trace_opt_verbose, trace_opt) 367 | 368 | // assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc 369 | DEFINE_bool(debug_code, false, 370 | "generate extra code (assertions) for debugging") 371 | DEFINE_bool(code_comments, false, "emit comments in code disassembly") 372 | DEFINE_bool(enable_sse2, true, 373 | "enable use of SSE2 instructions if available") 374 | DEFINE_bool(enable_sse3, true, 375 | "enable use of SSE3 instructions if available") 376 | DEFINE_bool(enable_sse4_1, true, 377 | "enable use of SSE4.1 instructions if available") 378 | DEFINE_bool(enable_cmov, true, 379 | "enable use of CMOV instruction if available") 380 | DEFINE_bool(enable_sahf, true, 381 | "enable use of SAHF instruction if available (X64 only)") 382 | DEFINE_bool(enable_vfp3, ENABLE_VFP3_DEFAULT, 383 | "enable use of VFP3 instructions if available") 384 | DEFINE_bool(enable_armv7, ENABLE_ARMV7_DEFAULT, 385 | "enable use of ARMv7 instructions if available (ARM only)") 386 | DEFINE_bool(enable_neon, true, 387 | "enable use of NEON instructions if available (ARM only)") 388 | DEFINE_bool(enable_sudiv, true, 389 | "enable use of SDIV and UDIV instructions if available (ARM only)") 390 | DEFINE_bool(enable_movw_movt, false, 391 | "enable loading 32-bit constant by means of movw/movt " 392 | "instruction pairs (ARM only)") 393 | DEFINE_bool(enable_unaligned_accesses, true, 394 | "enable unaligned accesses for ARMv7 (ARM only)") 395 | DEFINE_bool(enable_32dregs, ENABLE_32DREGS_DEFAULT, 396 | "enable use of d16-d31 registers on ARM - this requires VFP3") 397 | DEFINE_bool(enable_vldr_imm, false, 398 | "enable use of constant pools for double immediate (ARM only)") 399 | DEFINE_bool(force_long_branches, false, 400 | "force all emitted branches to be in long mode (MIPS only)") 401 | 402 | // bootstrapper.cc 403 | DEFINE_string(expose_natives_as, NULL, "expose natives in global object") 404 | DEFINE_string(expose_debug_as, NULL, "expose debug in global object") 405 | DEFINE_bool(expose_free_buffer, false, "expose freeBuffer extension") 406 | DEFINE_bool(expose_gc, false, "expose gc extension") 407 | DEFINE_string(expose_gc_as, NULL, 408 | "expose gc extension under the specified name") 409 | DEFINE_implication(expose_gc_as, expose_gc) 410 | DEFINE_bool(expose_externalize_string, false, 411 | "expose externalize string extension") 412 | DEFINE_bool(expose_trigger_failure, false, "expose trigger-failure extension") 413 | DEFINE_int(stack_trace_limit, 10, "number of stack frames to capture") 414 | DEFINE_bool(builtins_in_stack_traces, false, 415 | "show built-in functions in stack traces") 416 | DEFINE_bool(disable_native_files, false, "disable builtin natives files") 417 | 418 | // builtins-ia32.cc 419 | DEFINE_bool(inline_new, true, "use fast inline allocation") 420 | 421 | // codegen-ia32.cc / codegen-arm.cc 422 | DEFINE_bool(trace_codegen, false, 423 | "print name of functions for which code is generated") 424 | DEFINE_bool(trace, false, "trace function calls") 425 | DEFINE_bool(mask_constants_with_cookie, true, 426 | "use random jit cookie to mask large constants") 427 | 428 | // codegen.cc 429 | DEFINE_bool(lazy, true, "use lazy compilation") 430 | DEFINE_bool(trace_opt, false, "trace lazy optimization") 431 | DEFINE_bool(trace_opt_stats, false, "trace lazy optimization statistics") 432 | DEFINE_bool(opt, true, "use adaptive optimizations") 433 | DEFINE_bool(always_opt, false, "always try to optimize functions") 434 | DEFINE_bool(always_osr, false, "always try to OSR functions") 435 | DEFINE_bool(prepare_always_opt, false, "prepare for turning on always opt") 436 | DEFINE_bool(trace_deopt, false, "trace optimize function deoptimization") 437 | DEFINE_bool(trace_stub_failures, false, 438 | "trace deoptimization of generated code stubs") 439 | 440 | // compiler.cc 441 | DEFINE_int(min_preparse_length, 1024, 442 | "minimum length for automatic enable preparsing") 443 | DEFINE_bool(always_full_compiler, false, 444 | "try to use the dedicated run-once backend for all code") 445 | DEFINE_int(max_opt_count, 10, 446 | "maximum number of optimization attempts before giving up.") 447 | 448 | // compilation-cache.cc 449 | DEFINE_bool(compilation_cache, true, "enable compilation cache") 450 | 451 | DEFINE_bool(cache_prototype_transitions, true, "cache prototype transitions") 452 | 453 | // cpu-profiler.cc 454 | DEFINE_int(cpu_profiler_sampling_interval, 1000, 455 | "CPU profiler sampling interval in microseconds") 456 | 457 | // debug.cc 458 | DEFINE_bool(trace_debug_json, false, "trace debugging JSON request/response") 459 | DEFINE_bool(trace_js_array_abuse, false, 460 | "trace out-of-bounds accesses to JS arrays") 461 | DEFINE_bool(trace_external_array_abuse, false, 462 | "trace out-of-bounds-accesses to external arrays") 463 | DEFINE_bool(trace_array_abuse, false, 464 | "trace out-of-bounds accesses to all arrays") 465 | DEFINE_implication(trace_array_abuse, trace_js_array_abuse) 466 | DEFINE_implication(trace_array_abuse, trace_external_array_abuse) 467 | DEFINE_bool(debugger_auto_break, true, 468 | "automatically set the debug break flag when debugger commands are " 469 | "in the queue") 470 | DEFINE_bool(enable_liveedit, true, "enable liveedit experimental feature") 471 | DEFINE_bool(hard_abort, true, "abort by crashing") 472 | 473 | // execution.cc 474 | // Slightly less than 1MB on 64-bit, since Windows' default stack size for 475 | // the main execution thread is 1MB for both 32 and 64-bit. 476 | DEFINE_int(stack_size, kPointerSize * 123, 477 | "default size of stack region v8 is allowed to use (in kBytes)") 478 | 479 | // frames.cc 480 | DEFINE_int(max_stack_trace_source_length, 300, 481 | "maximum length of function source code printed in a stack trace.") 482 | 483 | // full-codegen.cc 484 | DEFINE_bool(always_inline_smi_code, false, 485 | "always inline smi code in non-opt code") 486 | 487 | // heap.cc 488 | DEFINE_int(max_new_space_size, 0, "max size of the new generation (in kBytes)") 489 | DEFINE_int(max_old_space_size, 0, "max size of the old generation (in Mbytes)") 490 | DEFINE_int(max_executable_size, 0, "max size of executable memory (in Mbytes)") 491 | DEFINE_bool(gc_global, false, "always perform global GCs") 492 | DEFINE_int(gc_interval, -1, "garbage collect after allocations") 493 | DEFINE_bool(trace_gc, false, 494 | "print one trace line following each garbage collection") 495 | DEFINE_bool(trace_gc_nvp, false, 496 | "print one detailed trace line in name=value format " 497 | "after each garbage collection") 498 | DEFINE_bool(trace_gc_ignore_scavenger, false, 499 | "do not print trace line after scavenger collection") 500 | DEFINE_bool(print_cumulative_gc_stat, false, 501 | "print cumulative GC statistics in name=value format on exit") 502 | DEFINE_bool(print_max_heap_committed, false, 503 | "print statistics of the maximum memory committed for the heap " 504 | "in name=value format on exit") 505 | DEFINE_bool(trace_gc_verbose, false, 506 | "print more details following each garbage collection") 507 | DEFINE_bool(trace_fragmentation, false, 508 | "report fragmentation for old pointer and data pages") 509 | DEFINE_bool(trace_external_memory, false, 510 | "print amount of external allocated memory after each time " 511 | "it is adjusted.") 512 | DEFINE_bool(collect_maps, true, 513 | "garbage collect maps from which no objects can be reached") 514 | DEFINE_bool(weak_embedded_maps_in_optimized_code, true, 515 | "make maps embedded in optimized code weak") 516 | DEFINE_bool(weak_embedded_objects_in_optimized_code, true, 517 | "make objects embedded in optimized code weak") 518 | DEFINE_bool(flush_code, true, 519 | "flush code that we expect not to use again (during full gc)") 520 | DEFINE_bool(flush_code_incrementally, true, 521 | "flush code that we expect not to use again (incrementally)") 522 | DEFINE_bool(trace_code_flushing, false, "trace code flushing progress") 523 | DEFINE_bool(age_code, true, 524 | "track un-executed functions to age code and flush only " 525 | "old code (required for code flushing)") 526 | DEFINE_bool(incremental_marking, true, "use incremental marking") 527 | DEFINE_bool(incremental_marking_steps, true, "do incremental marking steps") 528 | DEFINE_bool(trace_incremental_marking, false, 529 | "trace progress of the incremental marking") 530 | DEFINE_bool(track_gc_object_stats, false, 531 | "track object counts and memory usage") 532 | DEFINE_bool(parallel_sweeping, true, "enable parallel sweeping") 533 | DEFINE_bool(concurrent_sweeping, false, "enable concurrent sweeping") 534 | DEFINE_int(sweeper_threads, 0, 535 | "number of parallel and concurrent sweeping threads") 536 | DEFINE_bool(job_based_sweeping, false, "enable job based sweeping") 537 | #ifdef VERIFY_HEAP 538 | DEFINE_bool(verify_heap, false, "verify heap pointers before and after GC") 539 | #endif 540 | 541 | 542 | // heap-snapshot-generator.cc 543 | DEFINE_bool(heap_profiler_trace_objects, false, 544 | "Dump heap object allocations/movements/size_updates") 545 | 546 | 547 | // v8.cc 548 | DEFINE_bool(use_idle_notification, true, 549 | "Use idle notification to reduce memory footprint.") 550 | // ic.cc 551 | DEFINE_bool(use_ic, true, "use inline caching") 552 | 553 | // macro-assembler-ia32.cc 554 | DEFINE_bool(native_code_counters, false, 555 | "generate extra code for manipulating stats counters") 556 | 557 | // mark-compact.cc 558 | DEFINE_bool(always_compact, false, "Perform compaction on every full GC") 559 | DEFINE_bool(lazy_sweeping, true, 560 | "Use lazy sweeping for old pointer and data spaces") 561 | DEFINE_bool(never_compact, false, 562 | "Never perform compaction on full GC - testing only") 563 | DEFINE_bool(compact_code_space, true, 564 | "Compact code space on full non-incremental collections") 565 | DEFINE_bool(incremental_code_compaction, true, 566 | "Compact code space on full incremental collections") 567 | DEFINE_bool(cleanup_code_caches_at_gc, true, 568 | "Flush inline caches prior to mark compact collection and " 569 | "flush code caches in maps during mark compact cycle.") 570 | DEFINE_bool(use_marking_progress_bar, true, 571 | "Use a progress bar to scan large objects in increments when " 572 | "incremental marking is active.") 573 | DEFINE_bool(zap_code_space, true, 574 | "Zap free memory in code space with 0xCC while sweeping.") 575 | DEFINE_int(random_seed, 0, 576 | "Default seed for initializing random generator " 577 | "(0, the default, means to use system random).") 578 | 579 | // objects.cc 580 | DEFINE_bool(use_verbose_printer, true, "allows verbose printing") 581 | 582 | // parser.cc 583 | DEFINE_bool(allow_natives_syntax, false, "allow natives syntax") 584 | DEFINE_bool(trace_parse, false, "trace parsing and preparsing") 585 | 586 | // simulator-arm.cc, simulator-arm64.cc and simulator-mips.cc 587 | DEFINE_bool(trace_sim, false, "Trace simulator execution") 588 | DEFINE_bool(debug_sim, false, "Enable debugging the simulator") 589 | DEFINE_bool(check_icache, false, 590 | "Check icache flushes in ARM and MIPS simulator") 591 | DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions") 592 | #ifdef V8_TARGET_ARCH_ARM64 593 | DEFINE_int(sim_stack_alignment, 16, 594 | "Stack alignment in bytes in simulator. This must be a power of two " 595 | "and it must be at least 16. 16 is default.") 596 | #else 597 | DEFINE_int(sim_stack_alignment, 8, 598 | "Stack alingment in bytes in simulator (4 or 8, 8 is default)") 599 | #endif 600 | DEFINE_int(sim_stack_size, 2 * MB / KB, 601 | "Stack size of the ARM64 simulator in kBytes (default is 2 MB)") 602 | DEFINE_bool(log_regs_modified, true, 603 | "When logging register values, only print modified registers.") 604 | DEFINE_bool(log_colour, true, 605 | "When logging, try to use coloured output.") 606 | DEFINE_bool(ignore_asm_unimplemented_break, false, 607 | "Don't break for ASM_UNIMPLEMENTED_BREAK macros.") 608 | DEFINE_bool(trace_sim_messages, false, 609 | "Trace simulator debug messages. Implied by --trace-sim.") 610 | 611 | // isolate.cc 612 | DEFINE_bool(stack_trace_on_illegal, false, 613 | "print stack trace when an illegal exception is thrown") 614 | DEFINE_bool(abort_on_uncaught_exception, false, 615 | "abort program (dump core) when an uncaught exception is thrown") 616 | DEFINE_bool(randomize_hashes, true, 617 | "randomize hashes to avoid predictable hash collisions " 618 | "(with snapshots this option cannot override the baked-in seed)") 619 | DEFINE_int(hash_seed, 0, 620 | "Fixed seed to use to hash property keys (0 means random)" 621 | "(with snapshots this option cannot override the baked-in seed)") 622 | 623 | // snapshot-common.cc 624 | DEFINE_bool(profile_deserialization, false, 625 | "Print the time it takes to deserialize the snapshot.") 626 | 627 | // Regexp 628 | DEFINE_bool(regexp_optimization, true, "generate optimized regexp code") 629 | 630 | // Testing flags test/cctest/test-{flags,api,serialization}.cc 631 | DEFINE_bool(testing_bool_flag, true, "testing_bool_flag") 632 | DEFINE_maybe_bool(testing_maybe_bool_flag, "testing_maybe_bool_flag") 633 | DEFINE_int(testing_int_flag, 13, "testing_int_flag") 634 | DEFINE_float(testing_float_flag, 2.5, "float-flag") 635 | DEFINE_string(testing_string_flag, "Hello, world!", "string-flag") 636 | DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness") 637 | #ifdef _WIN32 638 | DEFINE_string(testing_serialization_file, "C:\\Windows\\Temp\\serdes", 639 | "file in which to testing_serialize heap") 640 | #else 641 | DEFINE_string(testing_serialization_file, "/tmp/serdes", 642 | "file in which to serialize heap") 643 | #endif 644 | 645 | // mksnapshot.cc 646 | DEFINE_string(extra_code, NULL, "A filename with extra code to be included in" 647 | " the snapshot (mksnapshot only)") 648 | 649 | // code-stubs-hydrogen.cc 650 | DEFINE_bool(profile_hydrogen_code_stub_compilation, false, 651 | "Print the time it takes to lazily compile hydrogen code stubs.") 652 | 653 | DEFINE_bool(predictable, false, "enable predictable mode") 654 | DEFINE_neg_implication(predictable, concurrent_recompilation) 655 | DEFINE_neg_implication(predictable, concurrent_osr) 656 | DEFINE_neg_implication(predictable, concurrent_sweeping) 657 | DEFINE_neg_implication(predictable, parallel_sweeping) 658 | 659 | 660 | // 661 | // Dev shell flags 662 | // 663 | 664 | DEFINE_bool(help, false, "Print usage message, including flags, on console") 665 | DEFINE_bool(dump_counters, false, "Dump counters on exit") 666 | 667 | #ifdef ENABLE_DEBUGGER_SUPPORT 668 | DEFINE_bool(debugger, false, "Enable JavaScript debugger") 669 | DEFINE_bool(remote_debugger, false, "Connect JavaScript debugger to the " 670 | "debugger agent in another process") 671 | DEFINE_bool(debugger_agent, false, "Enable debugger agent") 672 | DEFINE_int(debugger_port, 5858, "Port to use for remote debugging") 673 | #endif // ENABLE_DEBUGGER_SUPPORT 674 | 675 | DEFINE_string(map_counters, "", "Map counters to a file") 676 | DEFINE_args(js_arguments, 677 | "Pass all remaining arguments to the script. Alias for \"--\".") 678 | 679 | #if defined(WEBOS__) 680 | DEFINE_bool(debug_compile_events, false, "Enable debugger compile events") 681 | DEFINE_bool(debug_script_collected_events, false, 682 | "Enable debugger script collected events") 683 | #else 684 | DEFINE_bool(debug_compile_events, true, "Enable debugger compile events") 685 | DEFINE_bool(debug_script_collected_events, true, 686 | "Enable debugger script collected events") 687 | #endif 688 | 689 | 690 | // 691 | // GDB JIT integration flags. 692 | // 693 | 694 | DEFINE_bool(gdbjit, false, "enable GDBJIT interface (disables compacting GC)") 695 | DEFINE_bool(gdbjit_full, false, "enable GDBJIT interface for all code objects") 696 | DEFINE_bool(gdbjit_dump, false, "dump elf objects with debug info to disk") 697 | DEFINE_string(gdbjit_dump_filter, "", 698 | "dump only objects containing this substring") 699 | 700 | // mark-compact.cc 701 | DEFINE_bool(force_marking_deque_overflows, false, 702 | "force overflows of marking deque by reducing it's size " 703 | "to 64 words") 704 | 705 | DEFINE_bool(stress_compaction, false, 706 | "stress the GC compactor to flush out bugs (implies " 707 | "--force_marking_deque_overflows)") 708 | 709 | // 710 | // Debug only flags 711 | // 712 | #undef FLAG 713 | #ifdef DEBUG 714 | #define FLAG FLAG_FULL 715 | #else 716 | #define FLAG FLAG_READONLY 717 | #endif 718 | 719 | // checks.cc 720 | #ifdef ENABLE_SLOW_ASSERTS 721 | DEFINE_bool(enable_slow_asserts, false, 722 | "enable asserts that are slow to execute") 723 | #endif 724 | 725 | // codegen-ia32.cc / codegen-arm.cc / macro-assembler-*.cc 726 | DEFINE_bool(print_source, false, "pretty print source code") 727 | DEFINE_bool(print_builtin_source, false, 728 | "pretty print source code for builtins") 729 | DEFINE_bool(print_ast, false, "print source AST") 730 | DEFINE_bool(print_builtin_ast, false, "print source AST for builtins") 731 | DEFINE_string(stop_at, "", "function name where to insert a breakpoint") 732 | DEFINE_bool(trap_on_abort, false, "replace aborts by breakpoints") 733 | 734 | // compiler.cc 735 | DEFINE_bool(print_builtin_scopes, false, "print scopes for builtins") 736 | DEFINE_bool(print_scopes, false, "print scopes") 737 | 738 | // contexts.cc 739 | DEFINE_bool(trace_contexts, false, "trace contexts operations") 740 | 741 | // heap.cc 742 | DEFINE_bool(gc_greedy, false, "perform GC prior to some allocations") 743 | DEFINE_bool(gc_verbose, false, "print stuff during garbage collection") 744 | DEFINE_bool(heap_stats, false, "report heap statistics before and after GC") 745 | DEFINE_bool(code_stats, false, "report code statistics after GC") 746 | DEFINE_bool(verify_native_context_separation, false, 747 | "verify that code holds on to at most one native context after GC") 748 | DEFINE_bool(print_handles, false, "report handles after GC") 749 | DEFINE_bool(print_global_handles, false, "report global handles after GC") 750 | 751 | // ic.cc 752 | DEFINE_bool(trace_ic, false, "trace inline cache state transitions") 753 | 754 | // interface.cc 755 | DEFINE_bool(print_interfaces, false, "print interfaces") 756 | DEFINE_bool(print_interface_details, false, "print interface inference details") 757 | DEFINE_int(print_interface_depth, 5, "depth for printing interfaces") 758 | 759 | // objects.cc 760 | DEFINE_bool(trace_normalization, false, 761 | "prints when objects are turned into dictionaries.") 762 | 763 | // runtime.cc 764 | DEFINE_bool(trace_lazy, false, "trace lazy compilation") 765 | 766 | // spaces.cc 767 | DEFINE_bool(collect_heap_spill_statistics, false, 768 | "report heap spill statistics along with heap_stats " 769 | "(requires heap_stats)") 770 | 771 | DEFINE_bool(trace_isolates, false, "trace isolate state changes") 772 | 773 | // Regexp 774 | DEFINE_bool(regexp_possessive_quantifier, false, 775 | "enable possessive quantifier syntax for testing") 776 | DEFINE_bool(trace_regexp_bytecodes, false, "trace regexp bytecode execution") 777 | DEFINE_bool(trace_regexp_assembler, false, 778 | "trace regexp macro assembler calls.") 779 | 780 | // 781 | // Logging and profiling flags 782 | // 783 | #undef FLAG 784 | #define FLAG FLAG_FULL 785 | 786 | // log.cc 787 | DEFINE_bool(log, false, 788 | "Minimal logging (no API, code, GC, suspect, or handles samples).") 789 | DEFINE_bool(log_all, false, "Log all events to the log file.") 790 | DEFINE_bool(log_runtime, false, "Activate runtime system %Log call.") 791 | DEFINE_bool(log_api, false, "Log API events to the log file.") 792 | DEFINE_bool(log_code, false, 793 | "Log code events to the log file without profiling.") 794 | DEFINE_bool(log_gc, false, 795 | "Log heap samples on garbage collection for the hp2ps tool.") 796 | DEFINE_bool(log_handles, false, "Log global handle events.") 797 | DEFINE_bool(log_snapshot_positions, false, 798 | "log positions of (de)serialized objects in the snapshot.") 799 | DEFINE_bool(log_suspect, false, "Log suspect operations.") 800 | DEFINE_bool(prof, false, 801 | "Log statistical profiling information (implies --log-code).") 802 | DEFINE_bool(prof_browser_mode, true, 803 | "Used with --prof, turns on browser-compatible mode for profiling.") 804 | DEFINE_bool(log_regexp, false, "Log regular expression execution.") 805 | DEFINE_string(logfile, "v8.log", "Specify the name of the log file.") 806 | DEFINE_bool(logfile_per_isolate, true, "Separate log files for each isolate.") 807 | DEFINE_bool(ll_prof, false, "Enable low-level linux profiler.") 808 | DEFINE_bool(perf_basic_prof, false, 809 | "Enable perf linux profiler (basic support).") 810 | DEFINE_bool(perf_jit_prof, false, 811 | "Enable perf linux profiler (experimental annotate support).") 812 | DEFINE_string(gc_fake_mmap, "/tmp/__v8_gc__", 813 | "Specify the name of the file for fake gc mmap used in ll_prof") 814 | DEFINE_bool(log_internal_timer_events, false, "Time internal events.") 815 | DEFINE_bool(log_timer_events, false, 816 | "Time events including external callbacks.") 817 | DEFINE_implication(log_timer_events, log_internal_timer_events) 818 | DEFINE_implication(log_internal_timer_events, prof) 819 | DEFINE_bool(log_instruction_stats, false, "Log AArch64 instruction statistics.") 820 | DEFINE_string(log_instruction_file, "arm64_inst.csv", 821 | "AArch64 instruction statistics log file.") 822 | DEFINE_int(log_instruction_period, 1 << 22, 823 | "AArch64 instruction statistics logging period.") 824 | 825 | DEFINE_bool(redirect_code_traces, false, 826 | "output deopt information and disassembly into file " 827 | "code--.asm") 828 | DEFINE_string(redirect_code_traces_to, NULL, 829 | "output deopt information and disassembly into the given file") 830 | 831 | DEFINE_bool(hydrogen_track_positions, false, 832 | "track source code positions when building IR") 833 | 834 | // 835 | // Disassembler only flags 836 | // 837 | #undef FLAG 838 | #ifdef ENABLE_DISASSEMBLER 839 | #define FLAG FLAG_FULL 840 | #else 841 | #define FLAG FLAG_READONLY 842 | #endif 843 | 844 | // elements.cc 845 | DEFINE_bool(trace_elements_transitions, false, "trace elements transitions") 846 | 847 | DEFINE_bool(trace_creation_allocation_sites, false, 848 | "trace the creation of allocation sites") 849 | 850 | // code-stubs.cc 851 | DEFINE_bool(print_code_stubs, false, "print code stubs") 852 | DEFINE_bool(test_secondary_stub_cache, false, 853 | "test secondary stub cache by disabling the primary one") 854 | 855 | DEFINE_bool(test_primary_stub_cache, false, 856 | "test primary stub cache by disabling the secondary one") 857 | 858 | 859 | // codegen-ia32.cc / codegen-arm.cc 860 | DEFINE_bool(print_code, false, "print generated code") 861 | DEFINE_bool(print_opt_code, false, "print optimized code") 862 | DEFINE_bool(print_unopt_code, false, "print unoptimized code before " 863 | "printing optimized code based on it") 864 | DEFINE_bool(print_code_verbose, false, "print more information for code") 865 | DEFINE_bool(print_builtin_code, false, "print generated code for builtins") 866 | 867 | #ifdef ENABLE_DISASSEMBLER 868 | DEFINE_bool(sodium, false, "print generated code output suitable for use with " 869 | "the Sodium code viewer") 870 | 871 | DEFINE_implication(sodium, print_code_stubs) 872 | DEFINE_implication(sodium, print_code) 873 | DEFINE_implication(sodium, print_opt_code) 874 | DEFINE_implication(sodium, hydrogen_track_positions) 875 | DEFINE_implication(sodium, code_comments) 876 | 877 | DEFINE_bool(print_all_code, false, "enable all flags related to printing code") 878 | DEFINE_implication(print_all_code, print_code) 879 | DEFINE_implication(print_all_code, print_opt_code) 880 | DEFINE_implication(print_all_code, print_unopt_code) 881 | DEFINE_implication(print_all_code, print_code_verbose) 882 | DEFINE_implication(print_all_code, print_builtin_code) 883 | DEFINE_implication(print_all_code, print_code_stubs) 884 | DEFINE_implication(print_all_code, code_comments) 885 | #ifdef DEBUG 886 | DEFINE_implication(print_all_code, trace_codegen) 887 | #endif 888 | #endif 889 | 890 | // 891 | // Read-only flags 892 | // 893 | #undef FLAG 894 | #define FLAG FLAG_READONLY 895 | 896 | // assembler-arm.h 897 | DEFINE_bool(enable_ool_constant_pool, V8_OOL_CONSTANT_POOL, 898 | "enable use of out-of-line constant pools (ARM only)") 899 | 900 | // Cleanup... 901 | #undef FLAG_FULL 902 | #undef FLAG_READONLY 903 | #undef FLAG 904 | #undef FLAG_ALIAS 905 | 906 | #undef DEFINE_bool 907 | #undef DEFINE_maybe_bool 908 | #undef DEFINE_int 909 | #undef DEFINE_string 910 | #undef DEFINE_float 911 | #undef DEFINE_args 912 | #undef DEFINE_implication 913 | #undef DEFINE_neg_implication 914 | #undef DEFINE_ALIAS_bool 915 | #undef DEFINE_ALIAS_int 916 | #undef DEFINE_ALIAS_string 917 | #undef DEFINE_ALIAS_float 918 | #undef DEFINE_ALIAS_args 919 | 920 | #undef FLAG_MODE_DECLARE 921 | #undef FLAG_MODE_DEFINE 922 | #undef FLAG_MODE_DEFINE_DEFAULTS 923 | #undef FLAG_MODE_META 924 | #undef FLAG_MODE_DEFINE_IMPLICATIONS 925 | 926 | #undef COMMA 927 | --------------------------------------------------------------------------------