@@ -162,6 +162,37 @@ class CloneMap {
162
162
bool same_gen (node_idx_t k1, node_idx_t k2) const { return gen (k1) == gen (k2); }
163
163
};
164
164
165
+ class Options {
166
+ friend class Compile ;
167
+ friend class VMStructs ;
168
+ private:
169
+ const bool _subsume_loads; // Load can be matched as part of a larger op.
170
+ const bool _do_escape_analysis; // Do escape analysis.
171
+ const bool _eliminate_boxing; // Do boxing elimination.
172
+ const bool _do_locks_coarsening; // Do locks coarsening
173
+ const bool _install_code; // Install the code that was compiled
174
+ public:
175
+ Options (bool subsume_loads, bool do_escape_analysis,
176
+ bool eliminate_boxing, bool do_locks_coarsening,
177
+ bool install_code) :
178
+ _subsume_loads (subsume_loads),
179
+ _do_escape_analysis (do_escape_analysis),
180
+ _eliminate_boxing (eliminate_boxing),
181
+ _do_locks_coarsening (do_locks_coarsening),
182
+ _install_code (install_code) {
183
+ }
184
+
185
+ static Options for_runtime_stub () {
186
+ return Options (
187
+ /* subsume_loads = */ true ,
188
+ /* do_escape_analysis = */ false ,
189
+ /* eliminate_boxing = */ false ,
190
+ /* do_lock_coarsening = */ false ,
191
+ /* install_code = */ true
192
+ );
193
+ }
194
+ };
195
+
165
196
// ------------------------------Compile----------------------------------------
166
197
// This class defines a top-level Compiler invocation.
167
198
@@ -246,11 +277,7 @@ class Compile : public Phase {
246
277
private:
247
278
// Fixed parameters to this compilation.
248
279
const int _compile_id;
249
- const bool _subsume_loads; // Load can be matched as part of a larger op.
250
- const bool _do_escape_analysis; // Do escape analysis.
251
- const bool _install_code; // Install the code that was compiled
252
- const bool _eliminate_boxing; // Do boxing elimination.
253
- const bool _do_locks_coarsening; // Do locks coarsening
280
+ const Options _options; // Compilation options
254
281
ciMethod* _method; // The method being compiled.
255
282
int _entry_bci; // entry bci for osr methods.
256
283
const TypeFunc* _tf; // My kind of signature
@@ -504,16 +531,16 @@ class Compile : public Phase {
504
531
// Does this compilation allow instructions to subsume loads? User
505
532
// instructions that subsume a load may result in an unschedulable
506
533
// instruction sequence.
507
- bool subsume_loads () const { return _subsume_loads; }
534
+ bool subsume_loads () const { return _options. _subsume_loads ; }
508
535
/* * Do escape analysis. */
509
- bool do_escape_analysis () const { return _do_escape_analysis; }
536
+ bool do_escape_analysis () const { return _options. _do_escape_analysis ; }
510
537
/* * Do boxing elimination. */
511
- bool eliminate_boxing () const { return _eliminate_boxing; }
538
+ bool eliminate_boxing () const { return _options. _eliminate_boxing ; }
512
539
/* * Do aggressive boxing elimination. */
513
- bool aggressive_unboxing () const { return _eliminate_boxing && AggressiveUnboxing; }
514
- bool should_install_code () const { return _install_code; }
540
+ bool aggressive_unboxing () const { return _options. _eliminate_boxing && AggressiveUnboxing; }
541
+ bool should_install_code () const { return _options. _install_code ; }
515
542
/* * Do locks coarsening. */
516
- bool do_locks_coarsening () const { return _do_locks_coarsening; }
543
+ bool do_locks_coarsening () const { return _options. _do_locks_coarsening ; }
517
544
518
545
// Other fixed compilation parameters.
519
546
ciMethod* method () const { return _method; }
@@ -1034,9 +1061,7 @@ class Compile : public Phase {
1034
1061
// replacement, entry_bci indicates the bytecode for which to compile a
1035
1062
// continuation.
1036
1063
Compile (ciEnv* ci_env, ciMethod* target,
1037
- int entry_bci, bool subsume_loads, bool do_escape_analysis,
1038
- bool eliminate_boxing, bool do_locks_coarsening,
1039
- bool install_code, DirectiveSet* directive);
1064
+ int entry_bci, Options options, DirectiveSet* directive);
1040
1065
1041
1066
// Second major entry point. From the TypeFunc signature, generate code
1042
1067
// to pass arguments from the Java calling convention to the C calling
0 commit comments