Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 281 lines (222 sloc) 9.324 kB
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
1 #ifndef RBX_CONFIGURATION_HPP
2 #define RBX_CONFIGURATION_HPP
3
4 #include "util/configuration.hpp"
d9335a3 @brixen Enable configuring with 1.9 support on by default.
brixen authored
5 #include "vm/config.h"
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
6
7 namespace rubinius {
8 class Configuration : public config::Configuration {
9 public:
10 // GC
b0bf4fc @evanphx Increase the malloc threshold to 100M
evanphx authored
11 config::Bytes gc_bytes;
12 config::Bytes gc_large_object;
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
13 config::Integer gc_lifetime;
f080f9a Add generation lifetime autotuning
Evan Phoenix authored
14 config::Bool gc_autotune;
c1c20f7 Minor reformat
Evan Phoenix authored
15 config::Bool gc_show;
e99908e Add -Xgc.immix.debug and streamline immix marking
Evan Phoenix authored
16 config::Bool gc_immix_debug;
e4daf0a Add -Xgc.honor_start to control if GC.start is honored
Evan Phoenix authored
17 config::Bool gc_honor_start;
b70d0be Add ivar detection and automatic packed ivars
Evan Phoenix authored
18 config::Bool gc_autopack;
b0bf4fc @evanphx Increase the malloc threshold to 100M
evanphx authored
19 config::Bytes gc_marksweep_threshold;
20 config::Bytes gc_malloc_threshold;
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
21
e69322d @brixen Added -X19 for selecting supported language version.
brixen authored
22 // Language
fa7724a @evanphx Switch the version config to a radio button
evanphx authored
23 config::Radio version;
24
442d7db @brixen Configure which language versions are enabled.
brixen authored
25 #ifdef RBX_ENABLED_18
fa7724a @evanphx Switch the version config to a radio button
evanphx authored
26 #define LANGUAGE_18_ENABLED(state) ((state)->shared.config.version >= 18)
442d7db @brixen Configure which language versions are enabled.
brixen authored
27 #else
28 #define LANGUAGE_18_ENABLED(state) (false)
29 #endif
30
31 #ifdef RBX_ENABLED_19
fa7724a @evanphx Switch the version config to a radio button
evanphx authored
32 #define LANGUAGE_19_ENABLED(state) ((state)->shared.config.version >= 19)
442d7db @brixen Configure which language versions are enabled.
brixen authored
33 #else
34 #define LANGUAGE_19_ENABLED(state) (false)
35 #endif
36
37 #ifdef RBX_ENABLED_20
fa7724a @evanphx Switch the version config to a radio button
evanphx authored
38 #define LANGUAGE_20_ENABLED(state) ((state)->shared.config.version >= 20)
442d7db @brixen Configure which language versions are enabled.
brixen authored
39 #else
40 #define LANGUAGE_20_ENABLED(state) (false)
41 #endif
e69322d @brixen Added -X19 for selecting supported language version.
brixen authored
42
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
43 // JIT/Interpreter
44 config::Bool dynamic_interpreter_enabled;
0de71f8 Handle breaking out of a block, enhance rbx.jit.dump_code
Evan Phoenix authored
45 config::Integer jit_dump_code;
e53284c Wire background compiling thread into JIT mode
Evan Phoenix authored
46 config::Integer jit_call_til_compile;
47 config::Integer jit_max_method_size;
c1c20f7 Minor reformat
Evan Phoenix authored
48 config::Bool jit_show_compiling;
94c725b Add flag for enabling profiling of JITd methods
Evan Phoenix authored
49 config::Bool jit_profile;
ca6b0f8 Add generic method inlining support! -Xjit.inline.generic
Evan Phoenix authored
50 config::Bool jit_inline_generic;
51 config::Bool jit_inline_debug;
40bfc03 Add ability to inline blocks into their creation scope
Evan Phoenix authored
52 config::Bool jit_inline_blocks;
449dee7 Add -Xjit.log to control where jit debug info goes
Evan Phoenix authored
53 config::String jit_log;
2ad580f Cleanup some jit config options
Evan Phoenix authored
54 config::Bool jit_disabled;
94817d4 Delete IR after JIT'ing unless -Xjit.debug
Evan Phoenix authored
55 config::Bool jit_debug;
5a39cd0 Add -Xjit.sync, Inliner::fixnum_le, and self recursion cuteness
Evan Phoenix authored
56 config::Bool jit_sync;
8969894 Introduce deoptimization on too many uncommon branches
Evan Phoenix authored
57 config::Bool jit_show_uncommon;
b3ca6bb Add some code to aid in debug JITd code being destroyed
Evan Phoenix authored
58 config::Bool jit_show_remove;
7e97a1c Support switching a method from JIT to debugging interpreter
Evan Phoenix authored
59 config::Bool jit_check_debugging;
97b26a2 Add -XJ flag to enable best JIT settings
Evan Phoenix authored
60
73fb486 Introduce tooling API, convert profiler to it.
Evan Phoenix authored
61 // Tools
62 config::String tool_to_load;
63
7d84029 Flush/update CAPI handles better. Fixes #455.
Evan Phoenix authored
64 // CAPI
65 config::Bool capi_global_flush;
66
ff881b8 Started query agent, mainly just groundwork thus far
Evan Phoenix authored
67 // Query Agent
68 config::Integer qa_port;
69 config::Bool qa_verbose;
0051012 Allow loopback agent to bind to a TCP port
Evan Phoenix authored
70 config::String qa_tmpdir;
ff881b8 Started query agent, mainly just groundwork thus far
Evan Phoenix authored
71
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
72 // Debug
e53284c Wire background compiling thread into JIT mode
Evan Phoenix authored
73 config::Bool gil_debug;
c1c20f7 Minor reformat
Evan Phoenix authored
74 config::Integer print_config;
66c60d8 Fix up IC profiling, add -Xic.stats
Evan Phoenix authored
75 config::Bool ic_stats;
b69787a Introduce -Xprofile to be used instead of -P
Evan Phoenix authored
76 config::Bool profile;
5beb5e3 Switch to memory friendly Node tree for profiler
Evan Phoenix authored
77 config::Integer profiler_threshold;
c92cb3d Add 'rbx report' and support for VM and ruby crashes
Evan Phoenix authored
78 config::String report_path;
7bb1933 Add -Xthread.debug to help pinpoint failures
Evan Phoenix authored
79 config::Bool thread_debug;
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
80
81 // defaults
82 static const int default_gc_bytes = 1048576 * 3;
40f52a5 @evanphx Boost the LO threshold to 50k
evanphx authored
83 static const int default_gc_large_object = 50 * 1024;
f080f9a Add generation lifetime autotuning
Evan Phoenix authored
84 static const int default_gc_lifetime = 3;
05a420e @evanphx Add ability to set the marksweep allocation threshold
evanphx authored
85 static const int default_gc_marksweep_threshold = (10 * 1024 * 1024);
86
0de71f8 Handle breaking out of a block, enhance rbx.jit.dump_code
Evan Phoenix authored
87 static const int default_jit_dump_code = 0;
f0dfede Bump up the call_til_compile to a sane number (found via profiling)
Evan Phoenix authored
88 static const int default_jit_call_til_compile = 4000;
e53284c Wire background compiling thread into JIT mode
Evan Phoenix authored
89 static const int default_jit_max_method_size = 2048;
f080f9a Add generation lifetime autotuning
Evan Phoenix authored
90 static const bool default_jit_on = true;
91 static const bool default_gc_autotune = true;
b0bf4fc @evanphx Increase the malloc threshold to 100M
evanphx authored
92 static const int default_gc_malloc_threshold = 104857600;
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
93
94 Configuration()
c1c20f7 Minor reformat
Evan Phoenix authored
95 : gc_bytes(this, "gc.bytes", default_gc_bytes)
96 , gc_large_object(this, "gc.large_object", default_gc_large_object)
97 , gc_lifetime(this, "gc.lifetime", default_gc_lifetime)
f080f9a Add generation lifetime autotuning
Evan Phoenix authored
98 , gc_autotune(this, "gc.autotune", default_gc_autotune)
c1c20f7 Minor reformat
Evan Phoenix authored
99 , gc_show(this, "gc.show")
e99908e Add -Xgc.immix.debug and streamline immix marking
Evan Phoenix authored
100 , gc_immix_debug(this, "gc.immix.debug")
e4daf0a Add -Xgc.honor_start to control if GC.start is honored
Evan Phoenix authored
101 , gc_honor_start(this, "gc.honor_start", false)
e92fc82 Enable gc.autopack by default
Evan Phoenix authored
102 , gc_autopack(this, "gc.autopack", true)
05a420e @evanphx Add ability to set the marksweep allocation threshold
evanphx authored
103 , gc_marksweep_threshold(this, "gc.marksweep_threshold",
104 default_gc_marksweep_threshold)
6ad6e50 @brixen Fixed initialization order from merge.
brixen authored
105 , gc_malloc_threshold(this, "gc.malloc_threshold",
106 default_gc_malloc_threshold)
e4daf0a Add -Xgc.honor_start to control if GC.start is honored
Evan Phoenix authored
107
fa7724a @evanphx Switch the version config to a radio button
evanphx authored
108 , version(this, "version")
e69322d @brixen Added -X19 for selecting supported language version.
brixen authored
109
e53284c Wire background compiling thread into JIT mode
Evan Phoenix authored
110 , dynamic_interpreter_enabled(this, "interpreter.dynamic")
111 , jit_dump_code(this, "jit.dump_code", default_jit_dump_code)
112 , jit_call_til_compile(this, "jit.call_til_compile",
113 default_jit_call_til_compile)
114 , jit_max_method_size(this, "jit.max_method_size",
115 default_jit_max_method_size)
116 , jit_show_compiling(this, "jit.show")
94c725b Add flag for enabling profiling of JITd methods
Evan Phoenix authored
117 , jit_profile(this, "jit.profile")
18ca548 JIT is now on by default, use -Xint to disable it
Evan Phoenix authored
118 , jit_inline_generic(this, "jit.inline.generic", true)
f997d3f Increase restrictions on block inlining, enable it by default
Evan Phoenix authored
119 , jit_inline_debug(this, "jit.inline.debug", false)
120 , jit_inline_blocks(this, "jit.inline.blocks", true)
449dee7 Add -Xjit.log to control where jit debug info goes
Evan Phoenix authored
121 , jit_log(this, "jit.log")
2ad580f Cleanup some jit config options
Evan Phoenix authored
122 , jit_disabled(this, "int")
94817d4 Delete IR after JIT'ing unless -Xjit.debug
Evan Phoenix authored
123 , jit_debug(this, "jit.debug", false)
5a39cd0 Add -Xjit.sync, Inliner::fixnum_le, and self recursion cuteness
Evan Phoenix authored
124 , jit_sync(this, "jit.sync", false)
8969894 Introduce deoptimization on too many uncommon branches
Evan Phoenix authored
125 , jit_show_uncommon(this, "jit.uncommon.print", false)
b3ca6bb Add some code to aid in debug JITd code being destroyed
Evan Phoenix authored
126 , jit_show_remove(this, "jit.removal.print", false)
7e97a1c Support switching a method from JIT to debugging interpreter
Evan Phoenix authored
127 , jit_check_debugging(this, "jit.check_debugging", false)
128
73fb486 Introduce tooling API, convert profiler to it.
Evan Phoenix authored
129 , tool_to_load(this, "tool")
130
7d84029 Flush/update CAPI handles better. Fixes #455.
Evan Phoenix authored
131 , capi_global_flush(this, "capi.global_flush", false)
132
8a4758c Rename agent.port to agent.start
Evan Phoenix authored
133 , qa_port(this, "agent.start")
ff881b8 Started query agent, mainly just groundwork thus far
Evan Phoenix authored
134 , qa_verbose(this, "agent.verbose")
0051012 Allow loopback agent to bind to a TCP port
Evan Phoenix authored
135 , qa_tmpdir(this, "agent.tmpdir")
e53284c Wire background compiling thread into JIT mode
Evan Phoenix authored
136 , gil_debug(this, "vm.gil.debug")
c1c20f7 Minor reformat
Evan Phoenix authored
137 , print_config(this, "config.print")
66c60d8 Fix up IC profiling, add -Xic.stats
Evan Phoenix authored
138 , ic_stats(this, "ic.stats")
b69787a Introduce -Xprofile to be used instead of -P
Evan Phoenix authored
139 , profile(this, "profile")
5beb5e3 Switch to memory friendly Node tree for profiler
Evan Phoenix authored
140 , profiler_threshold(this, "profiler.threshold", 1000000)
c92cb3d Add 'rbx report' and support for VM and ruby crashes
Evan Phoenix authored
141 , report_path(this, "vm.crash_report_path")
7bb1933 Add -Xthread.debug to help pinpoint failures
Evan Phoenix authored
142 , thread_debug(this, "thread.debug")
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
143 {
144 gc_bytes.set_description(
145 "The number of bytes the young generation of the GC should use");
c1c20f7 Minor reformat
Evan Phoenix authored
146
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
147 gc_large_object.set_description(
148 "The size (in bytes) of the large object threshold");
c1c20f7 Minor reformat
Evan Phoenix authored
149
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
150 gc_lifetime.set_description(
5de0944 @czarneckid Spelling error fix and changed to JITd to be consistent with all othe…
czarneckid authored
151 "How many young GC cycles an object lives before promotion");
c1c20f7 Minor reformat
Evan Phoenix authored
152
f080f9a Add generation lifetime autotuning
Evan Phoenix authored
153 gc_autotune.set_description(
154 "Set whether or not the GC should adjust itself for performance");
155
e4daf0a Add -Xgc.honor_start to control if GC.start is honored
Evan Phoenix authored
156 gc_honor_start.set_description(
157 "Control whether or not GC.start is honored when called");
158
b70d0be Add ivar detection and automatic packed ivars
Evan Phoenix authored
159 gc_autopack.set_description(
160 "Set whether or not objects should be backed tightly in memory");
161
05a420e @evanphx Add ability to set the marksweep allocation threshold
evanphx authored
162 gc_marksweep_threshold.set_description(
163 "The number of bytes allocated before the marksweep GC region is collected");
b0bf4fc @evanphx Increase the malloc threshold to 100M
evanphx authored
164 gc_malloc_threshold.set_description(
165 "How many bytes allocated by C extensions til the GC is run");
05a420e @evanphx Add ability to set the marksweep allocation threshold
evanphx authored
166
442d7db @brixen Configure which language versions are enabled.
brixen authored
167 #ifdef RBX_ENABLED_18
fa7724a @evanphx Switch the version config to a radio button
evanphx authored
168 #if RBX_DEFAULT_18
169 version.add("18", 18, true);
170 #else
171 version.add("18", 18);
172 #endif
442d7db @brixen Configure which language versions are enabled.
brixen authored
173 #endif
174
175 #ifdef RBX_ENABLED_19
fa7724a @evanphx Switch the version config to a radio button
evanphx authored
176 #if RBX_DEFAULT_19
177 version.add("19", 19, true);
178 #else
179 version.add("19", 19);
180 #endif
442d7db @brixen Configure which language versions are enabled.
brixen authored
181 #endif
e69322d @brixen Added -X19 for selecting supported language version.
brixen authored
182
442d7db @brixen Configure which language versions are enabled.
brixen authored
183 #ifdef RBX_ENABLED_20
fa7724a @evanphx Switch the version config to a radio button
evanphx authored
184 #if RBX_DEFAULT_20
185 version.add("20", 20, true);
186 #else
187 version.add("20", 20);
442d7db @brixen Configure which language versions are enabled.
brixen authored
188 #endif
fa7724a @evanphx Switch the version config to a radio button
evanphx authored
189 #endif
190
191 version.set_description(
192 "Which version of ruby should we run");
58a50ec @brixen Added experimental 2.0 support.
brixen authored
193
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
194 jit_dump_code.set_description(
195 "1 == show simple IR, 2 == show optimized IR, 4 == show machine code");
c1c20f7 Minor reformat
Evan Phoenix authored
196
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
197 jit_call_til_compile.set_description(
198 "How many times a method is called before the JIT is run on it");
c1c20f7 Minor reformat
Evan Phoenix authored
199
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
200 jit_max_method_size.set_description(
201 "The max size of a method that will be JIT");
c1c20f7 Minor reformat
Evan Phoenix authored
202
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
203 jit_show_compiling.set_description(
204 "Print out a status message when the JIT is operating");
c1c20f7 Minor reformat
Evan Phoenix authored
205
94c725b Add flag for enabling profiling of JITd methods
Evan Phoenix authored
206 jit_profile.set_description(
207 "The JIT will emit code to be sure JITd methods can be profile");
208
ca6b0f8 Add generic method inlining support! -Xjit.inline.generic
Evan Phoenix authored
209 jit_inline_generic.set_description(
210 "Have the JIT inline generic methods");
211
212 jit_inline_debug.set_description(
213 "Have the JIT print out information about inlining");
214
40bfc03 Add ability to inline blocks into their creation scope
Evan Phoenix authored
215 jit_inline_blocks.set_description(
216 "Have the JIT try and inline methods and their literal blocks");
217
449dee7 Add -Xjit.log to control where jit debug info goes
Evan Phoenix authored
218 jit_log.set_description(
219 "Send JIT debugging output to this file rather than stdout");
220
2ad580f Cleanup some jit config options
Evan Phoenix authored
221 jit_disabled.set_description(
18ca548 JIT is now on by default, use -Xint to disable it
Evan Phoenix authored
222 "Force the JIT to never turn on");
223
5a39cd0 Add -Xjit.sync, Inliner::fixnum_le, and self recursion cuteness
Evan Phoenix authored
224 jit_sync.set_description(
225 "Wait for the JIT to finish compiling each method");
226
b3ca6bb Add some code to aid in debug JITd code being destroyed
Evan Phoenix authored
227 jit_show_uncommon.set_description(
228 "Print out information on when methods are deoptimized due to uncommon traps");
229
230 jit_show_remove.set_description(
231 "Print out whenever the JIT is removing unused code");
232
7e97a1c Support switching a method from JIT to debugging interpreter
Evan Phoenix authored
233 jit_check_debugging.set_description(
5de0944 @czarneckid Spelling error fix and changed to JITd to be consistent with all othe…
czarneckid authored
234 "Allow JITd methods to deoptimize if there is a debugging request");
7e97a1c Support switching a method from JIT to debugging interpreter
Evan Phoenix authored
235
7d84029 Flush/update CAPI handles better. Fixes #455.
Evan Phoenix authored
236 capi_global_flush.set_description(
237 "Flush all CAPI handles at CAPI call boundaries");
238
94c725b Add flag for enabling profiling of JITd methods
Evan Phoenix authored
239 print_config.set_description(
240 "blank or 1 == names and values, 2 == description as well");
241
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
242 gil_debug.set_description(
243 "Print out debugging when the GIL is locked/unlocked");
c1c20f7 Minor reformat
Evan Phoenix authored
244
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
245 gc_show.set_description(
246 "Print out whenever the GC runs");
66c60d8 Fix up IC profiling, add -Xic.stats
Evan Phoenix authored
247
e99908e Add -Xgc.immix.debug and streamline immix marking
Evan Phoenix authored
248 gc_immix_debug.set_description(
249 "Print out collection stats when the Immix collector finishes");
250
66c60d8 Fix up IC profiling, add -Xic.stats
Evan Phoenix authored
251 ic_stats.set_description(
252 "Print out stats about the InlineCaches before exiting");
ff881b8 Started query agent, mainly just groundwork thus far
Evan Phoenix authored
253
254 qa_port.set_description(
8a4758c Rename agent.port to agent.start
Evan Phoenix authored
255 "Start the QueryAgent on a TCP port. Default port is a random port");
ff881b8 Started query agent, mainly just groundwork thus far
Evan Phoenix authored
256
257 qa_verbose.set_description(
258 "Whether or not the query agent should print out status to stderr");
b69787a Introduce -Xprofile to be used instead of -P
Evan Phoenix authored
259
0051012 Allow loopback agent to bind to a TCP port
Evan Phoenix authored
260 qa_tmpdir.set_description(
261 "Where to store files used to discover running query agents");
262
b69787a Introduce -Xprofile to be used instead of -P
Evan Phoenix authored
263 profile.set_description(
264 "Configure the system to profile ruby code");
c92cb3d Add 'rbx report' and support for VM and ruby crashes
Evan Phoenix authored
265
5beb5e3 Switch to memory friendly Node tree for profiler
Evan Phoenix authored
266 profiler_threshold.set_description(
267 "The mininum number of nanoseconds a profiler node must have to be reported");
268
c92cb3d Add 'rbx report' and support for VM and ruby crashes
Evan Phoenix authored
269 report_path.set_description(
270 "Set a custom path to write crash reports");
7bb1933 Add -Xthread.debug to help pinpoint failures
Evan Phoenix authored
271
272 thread_debug.set_description(
273 "Print threading notices when they occur");
b69787a Introduce -Xprofile to be used instead of -P
Evan Phoenix authored
274 }
275
8133e09 Tooling can be enabled anytime, anywhere.
Evan Phoenix authored
276 void finalize() { }
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
277 };
278 }
279
280 #endif
Something went wrong with that request. Please try again.