Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 214 lines (167 sloc) 7.366 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 Brian Shirai 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
11 config::Integer gc_bytes;
12 config::Integer gc_large_object;
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;
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
19
e69322d Brian Shirai Added -X19 for selecting supported language version.
brixen authored
20 // Language
21 config::Bool version_19;
22
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
23 // JIT/Interpreter
24 config::Bool dynamic_interpreter_enabled;
0de71f8 Handle breaking out of a block, enhance rbx.jit.dump_code
Evan Phoenix authored
25 config::Integer jit_dump_code;
e53284c Wire background compiling thread into JIT mode
Evan Phoenix authored
26 config::Integer jit_call_til_compile;
27 config::Integer jit_max_method_size;
c1c20f7 Minor reformat
Evan Phoenix authored
28 config::Bool jit_show_compiling;
94c725b Add flag for enabling profiling of JITd methods
Evan Phoenix authored
29 config::Bool jit_profile;
ca6b0f8 Add generic method inlining support! -Xjit.inline.generic
Evan Phoenix authored
30 config::Bool jit_inline_generic;
31 config::Bool jit_inline_debug;
40bfc03 Add ability to inline blocks into their creation scope
Evan Phoenix authored
32 config::Bool jit_inline_blocks;
449dee7 Add -Xjit.log to control where jit debug info goes
Evan Phoenix authored
33 config::String jit_log;
2ad580f Cleanup some jit config options
Evan Phoenix authored
34 config::Bool jit_disabled;
94817d4 Delete IR after JIT'ing unless -Xjit.debug
Evan Phoenix authored
35 config::Bool jit_debug;
5a39cd0 Add -Xjit.sync, Inliner::fixnum_le, and self recursion cuteness
Evan Phoenix authored
36 config::Bool jit_sync;
8969894 Introduce deoptimization on too many uncommon branches
Evan Phoenix authored
37 config::Bool jit_show_uncommon;
b3ca6bb Add some code to aid in debug JITd code being destroyed
Evan Phoenix authored
38 config::Bool jit_show_remove;
7e97a1c Support switching a method from JIT to debugging interpreter
Evan Phoenix authored
39 config::Bool jit_check_debugging;
97b26a2 Add -XJ flag to enable best JIT settings
Evan Phoenix authored
40
7d84029 Flush/update CAPI handles better. Fixes #455.
Evan Phoenix authored
41 // CAPI
42 config::Bool capi_global_flush;
43
ff881b8 Started query agent, mainly just groundwork thus far
Evan Phoenix authored
44 // Query Agent
45 config::Integer qa_port;
46 config::Bool qa_verbose;
0051012 Allow loopback agent to bind to a TCP port
Evan Phoenix authored
47 config::String qa_tmpdir;
ff881b8 Started query agent, mainly just groundwork thus far
Evan Phoenix authored
48
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
49 // Debug
e53284c Wire background compiling thread into JIT mode
Evan Phoenix authored
50 config::Bool gil_debug;
c1c20f7 Minor reformat
Evan Phoenix authored
51 config::Integer print_config;
66c60d8 Fix up IC profiling, add -Xic.stats
Evan Phoenix authored
52 config::Bool ic_stats;
b69787a Introduce -Xprofile to be used instead of -P
Evan Phoenix authored
53 config::Bool profile;
c92cb3d Add 'rbx report' and support for VM and ruby crashes
Evan Phoenix authored
54 config::String report_path;
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
55
56 // defaults
57 static const int default_gc_bytes = 1048576 * 3;
58 static const int default_gc_large_object = 2700;
f080f9a Add generation lifetime autotuning
Evan Phoenix authored
59 static const int default_gc_lifetime = 3;
0de71f8 Handle breaking out of a block, enhance rbx.jit.dump_code
Evan Phoenix authored
60 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
61 static const int default_jit_call_til_compile = 4000;
e53284c Wire background compiling thread into JIT mode
Evan Phoenix authored
62 static const int default_jit_max_method_size = 2048;
f080f9a Add generation lifetime autotuning
Evan Phoenix authored
63 static const bool default_jit_on = true;
64 static const bool default_gc_autotune = true;
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
65
66 Configuration()
c1c20f7 Minor reformat
Evan Phoenix authored
67 : gc_bytes(this, "gc.bytes", default_gc_bytes)
68 , gc_large_object(this, "gc.large_object", default_gc_large_object)
69 , gc_lifetime(this, "gc.lifetime", default_gc_lifetime)
f080f9a Add generation lifetime autotuning
Evan Phoenix authored
70 , gc_autotune(this, "gc.autotune", default_gc_autotune)
c1c20f7 Minor reformat
Evan Phoenix authored
71 , gc_show(this, "gc.show")
e99908e Add -Xgc.immix.debug and streamline immix marking
Evan Phoenix authored
72 , gc_immix_debug(this, "gc.immix.debug")
e4daf0a Add -Xgc.honor_start to control if GC.start is honored
Evan Phoenix authored
73 , gc_honor_start(this, "gc.honor_start", false)
e92fc82 Enable gc.autopack by default
Evan Phoenix authored
74 , gc_autopack(this, "gc.autopack", true)
e4daf0a Add -Xgc.honor_start to control if GC.start is honored
Evan Phoenix authored
75
d9335a3 Brian Shirai Enable configuring with 1.9 support on by default.
brixen authored
76 , version_19(this, "19", RBX_DEFAULT_19)
e69322d Brian Shirai Added -X19 for selecting supported language version.
brixen authored
77
e53284c Wire background compiling thread into JIT mode
Evan Phoenix authored
78 , dynamic_interpreter_enabled(this, "interpreter.dynamic")
79 , jit_dump_code(this, "jit.dump_code", default_jit_dump_code)
80 , jit_call_til_compile(this, "jit.call_til_compile",
81 default_jit_call_til_compile)
82 , jit_max_method_size(this, "jit.max_method_size",
83 default_jit_max_method_size)
84 , jit_show_compiling(this, "jit.show")
94c725b Add flag for enabling profiling of JITd methods
Evan Phoenix authored
85 , jit_profile(this, "jit.profile")
18ca548 JIT is now on by default, use -Xint to disable it
Evan Phoenix authored
86 , jit_inline_generic(this, "jit.inline.generic", true)
f997d3f Increase restrictions on block inlining, enable it by default
Evan Phoenix authored
87 , jit_inline_debug(this, "jit.inline.debug", false)
88 , jit_inline_blocks(this, "jit.inline.blocks", true)
449dee7 Add -Xjit.log to control where jit debug info goes
Evan Phoenix authored
89 , jit_log(this, "jit.log")
2ad580f Cleanup some jit config options
Evan Phoenix authored
90 , jit_disabled(this, "int")
94817d4 Delete IR after JIT'ing unless -Xjit.debug
Evan Phoenix authored
91 , jit_debug(this, "jit.debug", false)
5a39cd0 Add -Xjit.sync, Inliner::fixnum_le, and self recursion cuteness
Evan Phoenix authored
92 , jit_sync(this, "jit.sync", false)
8969894 Introduce deoptimization on too many uncommon branches
Evan Phoenix authored
93 , jit_show_uncommon(this, "jit.uncommon.print", false)
b3ca6bb Add some code to aid in debug JITd code being destroyed
Evan Phoenix authored
94 , jit_show_remove(this, "jit.removal.print", false)
7e97a1c Support switching a method from JIT to debugging interpreter
Evan Phoenix authored
95 , jit_check_debugging(this, "jit.check_debugging", false)
96
7d84029 Flush/update CAPI handles better. Fixes #455.
Evan Phoenix authored
97 , capi_global_flush(this, "capi.global_flush", false)
98
8a4758c Rename agent.port to agent.start
Evan Phoenix authored
99 , qa_port(this, "agent.start")
ff881b8 Started query agent, mainly just groundwork thus far
Evan Phoenix authored
100 , qa_verbose(this, "agent.verbose")
0051012 Allow loopback agent to bind to a TCP port
Evan Phoenix authored
101 , qa_tmpdir(this, "agent.tmpdir")
e53284c Wire background compiling thread into JIT mode
Evan Phoenix authored
102 , gil_debug(this, "vm.gil.debug")
c1c20f7 Minor reformat
Evan Phoenix authored
103 , print_config(this, "config.print")
66c60d8 Fix up IC profiling, add -Xic.stats
Evan Phoenix authored
104 , ic_stats(this, "ic.stats")
b69787a Introduce -Xprofile to be used instead of -P
Evan Phoenix authored
105 , profile(this, "profile")
c92cb3d Add 'rbx report' and support for VM and ruby crashes
Evan Phoenix authored
106 , report_path(this, "vm.crash_report_path")
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
107 {
108 gc_bytes.set_description(
109 "The number of bytes the young generation of the GC should use");
c1c20f7 Minor reformat
Evan Phoenix authored
110
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
111 gc_large_object.set_description(
112 "The size (in bytes) of the large object threshold");
c1c20f7 Minor reformat
Evan Phoenix authored
113
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
114 gc_lifetime.set_description(
115 "How many young GC cycles an object lives before promoption");
c1c20f7 Minor reformat
Evan Phoenix authored
116
f080f9a Add generation lifetime autotuning
Evan Phoenix authored
117 gc_autotune.set_description(
118 "Set whether or not the GC should adjust itself for performance");
119
e4daf0a Add -Xgc.honor_start to control if GC.start is honored
Evan Phoenix authored
120 gc_honor_start.set_description(
121 "Control whether or not GC.start is honored when called");
122
b70d0be Add ivar detection and automatic packed ivars
Evan Phoenix authored
123 gc_autopack.set_description(
124 "Set whether or not objects should be backed tightly in memory");
125
e69322d Brian Shirai Added -X19 for selecting supported language version.
brixen authored
126 version_19.set_description(
127 "Set the supported language version to 1.9");
128
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
129 jit_dump_code.set_description(
130 "1 == show simple IR, 2 == show optimized IR, 4 == show machine code");
c1c20f7 Minor reformat
Evan Phoenix authored
131
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
132 jit_call_til_compile.set_description(
133 "How many times a method is called before the JIT is run on it");
c1c20f7 Minor reformat
Evan Phoenix authored
134
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
135 jit_max_method_size.set_description(
136 "The max size of a method that will be JIT");
c1c20f7 Minor reformat
Evan Phoenix authored
137
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
138 jit_show_compiling.set_description(
139 "Print out a status message when the JIT is operating");
c1c20f7 Minor reformat
Evan Phoenix authored
140
94c725b Add flag for enabling profiling of JITd methods
Evan Phoenix authored
141 jit_profile.set_description(
142 "The JIT will emit code to be sure JITd methods can be profile");
143
ca6b0f8 Add generic method inlining support! -Xjit.inline.generic
Evan Phoenix authored
144 jit_inline_generic.set_description(
145 "Have the JIT inline generic methods");
146
147 jit_inline_debug.set_description(
148 "Have the JIT print out information about inlining");
149
40bfc03 Add ability to inline blocks into their creation scope
Evan Phoenix authored
150 jit_inline_blocks.set_description(
151 "Have the JIT try and inline methods and their literal blocks");
152
449dee7 Add -Xjit.log to control where jit debug info goes
Evan Phoenix authored
153 jit_log.set_description(
154 "Send JIT debugging output to this file rather than stdout");
155
2ad580f Cleanup some jit config options
Evan Phoenix authored
156 jit_disabled.set_description(
18ca548 JIT is now on by default, use -Xint to disable it
Evan Phoenix authored
157 "Force the JIT to never turn on");
158
5a39cd0 Add -Xjit.sync, Inliner::fixnum_le, and self recursion cuteness
Evan Phoenix authored
159 jit_sync.set_description(
160 "Wait for the JIT to finish compiling each method");
161
b3ca6bb Add some code to aid in debug JITd code being destroyed
Evan Phoenix authored
162 jit_show_uncommon.set_description(
163 "Print out information on when methods are deoptimized due to uncommon traps");
164
165 jit_show_remove.set_description(
166 "Print out whenever the JIT is removing unused code");
167
7e97a1c Support switching a method from JIT to debugging interpreter
Evan Phoenix authored
168 jit_check_debugging.set_description(
169 "Allow JIT'd methods to deoptimize if there is a debugging request");
170
7d84029 Flush/update CAPI handles better. Fixes #455.
Evan Phoenix authored
171 capi_global_flush.set_description(
172 "Flush all CAPI handles at CAPI call boundaries");
173
94c725b Add flag for enabling profiling of JITd methods
Evan Phoenix authored
174 print_config.set_description(
175 "blank or 1 == names and values, 2 == description as well");
176
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
177 gil_debug.set_description(
178 "Print out debugging when the GIL is locked/unlocked");
c1c20f7 Minor reformat
Evan Phoenix authored
179
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
180 gc_show.set_description(
181 "Print out whenever the GC runs");
66c60d8 Fix up IC profiling, add -Xic.stats
Evan Phoenix authored
182
e99908e Add -Xgc.immix.debug and streamline immix marking
Evan Phoenix authored
183 gc_immix_debug.set_description(
184 "Print out collection stats when the Immix collector finishes");
185
66c60d8 Fix up IC profiling, add -Xic.stats
Evan Phoenix authored
186 ic_stats.set_description(
187 "Print out stats about the InlineCaches before exiting");
ff881b8 Started query agent, mainly just groundwork thus far
Evan Phoenix authored
188
189 qa_port.set_description(
8a4758c Rename agent.port to agent.start
Evan Phoenix authored
190 "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
191
192 qa_verbose.set_description(
193 "Whether or not the query agent should print out status to stderr");
b69787a Introduce -Xprofile to be used instead of -P
Evan Phoenix authored
194
0051012 Allow loopback agent to bind to a TCP port
Evan Phoenix authored
195 qa_tmpdir.set_description(
196 "Where to store files used to discover running query agents");
197
b69787a Introduce -Xprofile to be used instead of -P
Evan Phoenix authored
198 profile.set_description(
199 "Configure the system to profile ruby code");
c92cb3d Add 'rbx report' and support for VM and ruby crashes
Evan Phoenix authored
200
201 report_path.set_description(
202 "Set a custom path to write crash reports");
b69787a Introduce -Xprofile to be used instead of -P
Evan Phoenix authored
203 }
204
205 void finalize() {
206 if(profile) {
207 jit_disabled.value = true;
208 }
2bc8d00 Add descriptions to config variables
Evan Phoenix authored
209 }
37dc489 Add real Configuration infrastructure
Evan Phoenix authored
210 };
211 }
212
213 #endif
Something went wrong with that request. Please try again.