001/*
002 *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003 *
004 *  This file is licensed to You under the Eclipse Public License (EPL);
005 *  You may not use this file except in compliance with the License. You
006 *  may obtain a copy of the License at
007 *
008 *      http://www.opensource.org/licenses/eclipse-1.0.php
009 *
010 *  See the COPYRIGHT.txt file distributed with this work for information
011 *  regarding copyright ownership.
012 */
013package org.jikesrvm.compilers.opt;
014
015import static org.jikesrvm.runtime.ExitStatus.*;
016
017import org.jikesrvm.*;
018import org.jikesrvm.runtime.CommandLineArgs;
019
020/**
021 * Class to handle command-line arguments and options for the
022 * optimizng compiler.
023 * <p>
024 * Note: This file is mechanically generated from OptOptions.template
025 *       and MasterOptions.template
026 * <p>
027 * Note: Boolean options are defined in /home/vagrant/rvm-trunk/rvm/src-generated/options/BooleanOptions.opt.dat /home/vagrant/rvm-trunk/rvm/src-generated/options/SharedBooleanOptions.dat
028 *       All other options are defined in /home/vagrant/rvm-trunk/rvm/src-generated/options/ValueOptions.opt.dat /home/vagrant/rvm-trunk/rvm/src-generated/options/SharedValueOptions.dat
029 *       (value, enumeration, bitmask)
030 *
031 **/
032public class OptOptions implements Cloneable {
033
034  // Non-template instance fields that we don't want
035  //  available on the command-line)
036  private int OPTIMIZATION_LEVEL = 1;    // The OPT level
037
038  private void printOptionsHeader() {
039    VM.sysWrite("Current value of options at optimization level ",OPTIMIZATION_LEVEL, ":\n");
040  }
041
042// BEGIN CODE GENERATED FROM MasterOptions.template
043/*
044 *  This file is part of the Jikes RVM project (http://jikesrvm.org).
045 *
046 *  This file is licensed to You under the Eclipse Public License (EPL);
047 *  You may not use this file except in compliance with the License. You
048 *  may obtain a copy of the License at
049 *
050 *      http://www.opensource.org/licenses/eclipse-1.0.php
051 *
052 *  See the COPYRIGHT.txt file distributed with this work for information
053 *  regarding copyright ownership.
054 */
055   // Begin template-specified options
056   /** Focus compilation effort based on frequency profile data */
057   public boolean FREQ_FOCUS_EFFORT             = false;
058   /** Should we constrain optimizations by enforcing reads-kill? */
059   public boolean READS_KILL                    = false;
060   /** Eagerly compute method summaries for flow-insensitive field analysis */
061   public boolean FIELD_ANALYSIS                = true;
062   /** Inline statically resolvable calls */
063   public boolean INLINE                        = true;
064   /** Guarded inlining of non-final virtual calls */
065   public boolean INLINE_GUARDED                = true;
066   /** Speculatively inline non-final interface calls */
067   public boolean INLINE_GUARDED_INTERFACES     = true;
068   /** Pre-existence based inlining */
069   public boolean INLINE_PREEX                  = true;
070   /** Simplify operations on integers */
071   public boolean SIMPLIFY_INTEGER_OPS          = true;
072   /** Simplify operations on longs */
073   public boolean SIMPLIFY_LONG_OPS             = true;
074   /** Simplify operations on floats */
075   public boolean SIMPLIFY_FLOAT_OPS            = true;
076   /** Simplify operations on floats */
077   public boolean SIMPLIFY_DOUBLE_OPS           = true;
078   /** Simplify operations on references */
079   public boolean SIMPLIFY_REF_OPS              = true;
080   /** Simplify operations on TIBs */
081   public boolean SIMPLIFY_TIB_OPS              = true;
082   /** Simplify operations on fields */
083   public boolean SIMPLIFY_FIELD_OPS            = true;
084   /** Chase final fields avoiding loads at runtime */
085   public boolean SIMPLIFY_CHASE_FINAL_FIELDS   = true;
086   /** Perform local constant propagation */
087   public boolean LOCAL_CONSTANT_PROP           = true;
088   /** Perform local copy propagation */
089   public boolean LOCAL_COPY_PROP               = true;
090   /** Perform local common subexpression elimination */
091   public boolean LOCAL_CSE                     = true;
092   /** Should we try to fold expressions with constants locally? */
093   public boolean LOCAL_EXPRESSION_FOLDING      = false;
094   /** CFG splitting to create hot traces based on static heuristics */
095   public boolean CONTROL_STATIC_SPLITTING      = true;
096   /** Turn whiles into untils */
097   public boolean CONTROL_TURN_WHILES_INTO_UNTILS= false;
098   /** Eagerly compute method summaries for simple escape analysis */
099   public boolean ESCAPE_SIMPLE_IPA             = false;
100   /** If possible turn aggregates (objects) into variable definition/uses */
101   public boolean ESCAPE_SCALAR_REPLACE_AGGREGATES= true;
102   /** Try to remove unnecessary monitor operations */
103   public boolean ESCAPE_MONITOR_REMOVAL        = true;
104   /** Compile the method assuming the invokee is thread-local. Cannot be properly set on command line. */
105   public boolean ESCAPE_INVOKEE_THREAD_LOCAL   = false;
106   /** Should SSA form be constructed on the HIR? */
107   public boolean SSA                           = false;
108   /** Should we try to fold expressions with constants in SSA form? */
109   public boolean SSA_EXPRESSION_FOLDING        = false;
110   /** Eliminate redundant conditional branches */
111   public boolean SSA_REDUNDANT_BRANCH_ELIMINATION= true;
112   /** Assume PEIs do not throw or state is not observable */
113   public boolean SSA_LICM_IGNORE_PEI           = false;
114   /** Should we perform redundant load elimination during SSA pass? */
115   public boolean SSA_LOAD_ELIMINATION          = false;
116   /** Should we coalesce move instructions after leaving SSA? */
117   public boolean SSA_COALESCE_AFTER            = false;
118   /** Create copies of loops where runtime exceptions are checked prior to entry */
119   public boolean SSA_LOOP_VERSIONING           = false;
120   /** Split live ranges using LIR SSA pass? */
121   public boolean SSA_LIVE_RANGE_SPLITTING      = false;
122   /** Perform global code placement */
123   public boolean SSA_GCP                       = false;
124   /** Perform global code placement */
125   public boolean SSA_GCSE                      = false;
126   /** When leaving SSA create blocks to avoid renaming variables */
127   public boolean SSA_SPLITBLOCK_TO_AVOID_RENAME= false;
128   /** When leaving SSA create blocks for local liveness */
129   public boolean SSA_SPLITBLOCK_FOR_LOCAL_LIVE = true;
130   /** When leaving SSA create blocks to avoid adding code to frequently executed blocks */
131   public boolean SSA_SPLITBLOCK_INTO_INFREQUENT= true;
132   /** Reorder basic blocks for improved locality and branch prediction */
133   public boolean REORDER_CODE                  = true;
134   /** Reorder basic blocks using Pettis and Hansen Algo2 */
135   public boolean REORDER_CODE_PH               = true;
136   /** Inline allocation of scalars and arrays */
137   public boolean H2L_INLINE_NEW                = true;
138   /** Inline write barriers for generational collectors */
139   public boolean H2L_INLINE_WRITE_BARRIER      = true;
140   /** Inline primitive write barriers for certain collectors */
141   public boolean H2L_INLINE_PRIMITIVE_WRITE_BARRIER= true;
142   /** Assert that any callee of this compiled method will not throw exceptions. Cannot be properly set on command line. */
143   public boolean H2L_NO_CALLEE_EXCEPTIONS      = false;
144   /** Plant virtual calls via the JTOC rather than from the tib of anobject when possible */
145   public boolean H2L_CALL_VIA_JTOC             = false;
146   /** Store liveness for handlers to improve dependence graph at PEIs */
147   public boolean L2M_HANDLER_LIVENESS          = false;
148   /** Attempt to coalesce to eliminate register moves? */
149   public boolean REGALLOC_COALESCE_MOVES       = true;
150   /** Attempt to coalesce stack locations? */
151   public boolean REGALLOC_COALESCE_SPILLS      = true;
152   /** Perform code transformation to sample instrumentation code. */
153   public boolean ADAPTIVE_INSTRUMENTATION_SAMPLING= false;
154   /** When performing inst. sampling, should it be done without duplicating code? */
155   public boolean ADAPTIVE_NO_DUPLICATION       = false;
156   /** Should there be one CBS counter per processor for SMP performance? */
157   public boolean ADAPTIVE_PROCESSOR_SPECIFIC_COUNTER= true;
158   /** Should yieldpoints be removed from the checking code (requires finite sample interval) */
159   public boolean ADAPTIVE_REMOVE_YP_FROM_CHECKING= false;
160   /** Insert OSR point at off branch of guarded inlining? */
161   public boolean OSR_GUARDED_INLINING          = true;
162   /** Use OSR knowledge to drive more aggressive inlining? */
163   public boolean OSR_INLINE_POLICY             = true;
164   /** Print out compile-time statistics for basic blocks? */
165   public boolean PRINT_STATIC_STATS            = false;
166   /** Print short message for each compilation phase */
167   public boolean PRINT_PHASES                  = false;
168   /** Dump the IR after each compiler phase */
169   public boolean PRINT_ALL_IR                  = false;
170   /** Print detailed report of compile-time inlining decisions */
171   public boolean PRINT_DETAILED_INLINE_REPORT  = false;
172   /** Print detailed report of compile-time inlining decisions */
173   public boolean PRINT_INLINE_REPORT           = false;
174   /** Print dominators */
175   public boolean PRINT_DOMINATORS              = false;
176   /** Print post-dominators */
177   public boolean PRINT_POST_DOMINATORS         = false;
178   /** Print SSA form */
179   public boolean PRINT_SSA                     = false;
180   /** Print dependence graph before burs */
181   public boolean PRINT_DG_BURS                 = false;
182   /** When dumping the IR, generate a visualization in a file instead */
183   public boolean PRINT_VISUALIZATION           = false;
184   /** Print IR after initial generation */
185   public boolean PRINT_HIGH                    = false;
186   /** Print IR just before conversion to LIR */
187   public boolean PRINT_FINAL_HIR               = false;
188   /** Print IR after conversion to LIR */
189   public boolean PRINT_LOW                     = false;
190   /** Print IR just before conversion to MIR */
191   public boolean PRINT_FINAL_LIR               = false;
192   /** Print IR after conversion to MIR */
193   public boolean PRINT_MIR                     = false;
194   /** Print IR just before conversion to machine code */
195   public boolean PRINT_FINAL_MIR               = false;
196   /** Print control flow graph too when IR is printed */
197   public boolean PRINT_CFG                     = false;
198   /** Print IR before and after register allocation */
199   public boolean PRINT_REGALLOC                = false;
200   /** Print IR after expanding calling conventions */
201   public boolean PRINT_CALLING_CONVENTIONS     = false;
202   /** Print the garbage collection maps */
203   public boolean PRINT_GC_MAPS                 = false;
204   /** Enable debugging support for final assembly */
205   public boolean DEBUG_CODEGEN                 = false;
206   /** Enable debugging statements for instrumentation sampling */
207   public boolean DEBUG_INSTRU_SAMPLING         = false;
208   /** Enable detailed debugging statements for instrumentation sampling */
209   public boolean DEBUG_INSTRU_SAMPLING_DETAIL  = false;
210   /** Perform noisy global code placement */
211   public boolean DEBUG_GCP                     = false;
212   /** Print method name at start of compilation */
213   public boolean PRINT_METHOD                  = false;
214   /** Print final machine code */
215   public boolean PRINT_MACHINECODE             = false;
216    /** Exclude methods from being opt compiled */
217    private java.util.HashSet<String> DRIVER_EXCLUDE   = null;
218    /** Only print IR compiled above this level */
219    public int PRINT_IR_LEVEL                    = 0;
220    /** If visualization is enabled, the directory to write visualization files to */
221    public String VISUALIZE_IR_DIRECTORY         = "";
222    /** Input file of edge counter profile data */
223    public String PROFILE_EDGE_COUNT_INPUT_FILE  = null;
224    /** How to compute block and edge frequencies? */
225    public byte PROFILE_FREQUENCY_STRATEGY       = PROFILE_COUNTERS_FREQ;
226    /** Cumulative threshold which defines the set of infrequent basic blocks */
227    public float PROFILE_INFREQUENT_THRESHOLD    = 0.01f;
228    /** Threshold at which a conditional branch is considered to be skewed */
229    public double PROFILE_CBS_HOTNESS            = 0.98;
230    /** Maximum size of array to replaced with registers by simple escape analysis */
231    public int ESCAPE_MAX_ARRAY_SIZE             = 5;
232    /** How many rounds of redundant load elimination will we attempt? */
233    public int SSA_LOAD_ELIMINATION_ROUNDS       = 3;
234    /** Maximum size of block for BURS in real instructions, larger blocks are split. */
235    public int L2M_MAX_BLOCK_SIZE                = 300;
236    /** Selection of spilling heuristic */
237    public byte REGALLOC_SPILL_COST_ESTIMATE     = REGALLOC_BLOCK_COUNT_SPILL_COST;
238    /** spill penalty for move instructions */
239    public double REGALLOC_SIMPLE_SPILL_COST_MOVE_FACTOR= 1.0;
240    /** spill penalty for registers used in memory operands */
241    public double REGALLOC_SIMPLE_SPILL_COST_MEMORY_OPERAND_FACTOR= 5.0;
242    /** If a tableswitch comprises this many or fewer comparisons convert it into multiple if-then-else style branches */
243    public int CONTROL_TABLESWITCH_CUTOFF        = 8;
244    /** How many extra instructions will we insert in order to remove a conditional branch? */
245    public int CONTROL_COND_MOVE_CUTOFF          = 5;
246    /** Unroll loops. Duplicates the loop body 2^n times. */
247    public int CONTROL_UNROLL_LOG                = 2;
248    /** Upper bound on the number of instructions duplicated per block when trying to create hot traces with static splitting */
249    public int CONTROL_STATIC_SPLITTING_MAX_COST = 10;
250    /** Don't replace branches with conditional moves if they are outside of the range of 0.5 +- this value */
251    public double CONTROL_WELL_PREDICTED_CUTOFF  = 1/6;
252    /** Static inlining heuristic: Upper bound on callee size */
253    public int INLINE_MAX_TARGET_SIZE            = (4*org.jikesrvm.classloader.NormalMethod.CALL_COST-org.jikesrvm.classloader.NormalMethod.SIMPLE_OPERATION_COST);
254    /** Static inlining heuristic: Upper bound on depth of inlining */
255    public int INLINE_MAX_INLINE_DEPTH           = 5;
256    /** Static inlining heuristic: Always inline callees of this size or smaller */
257    public int INLINE_MAX_ALWAYS_INLINE_TARGET_SIZE= (2*org.jikesrvm.classloader.NormalMethod.CALL_COST-org.jikesrvm.classloader.NormalMethod.SIMPLE_OPERATION_COST);
258    /** Static inlining heuristic: If root method is already this big, then only inline trivial methods */
259    public int INLINE_MASSIVE_METHOD_SIZE        = 2048;
260    /** Maximum bonus for reducing the perceived size of a method during inlining. */
261    public double INLINE_MAX_ARG_BONUS           = 0.40;
262    /** Bonus given to inlining methods that are passed a register of a known precise type. */
263    public double INLINE_PRECISE_REG_ARRAY_ARG_BONUS= 0.05;
264    /** Bonus given when there's potential to optimize checkstore portion of aastore bytecode on parameter */
265    public double INLINE_DECLARED_AASTORED_ARRAY_ARG_BONUS= 0.02;
266    /** Bonus given to inlining methods that are passed a register of a known precise type. */
267    public double INLINE_PRECISE_REG_CLASS_ARG_BONUS= 0.15;
268    /** Bonus given to inlining methods that are passed a register that's known not to be null. */
269    public double INLINE_EXTANT_REG_CLASS_ARG_BONUS= 0.05;
270    /** Bonus given to inlining methods that are passed an int constant argument */
271    public double INLINE_INT_CONST_ARG_BONUS     = 0.05;
272    /** Bonus given to inlining methods that are passed a null constant argument */
273    public double INLINE_NULL_CONST_ARG_BONUS    = 0.10;
274    /** Bonus given to inlining methods that are passed an object constant argument */
275    public double INLINE_OBJECT_CONST_ARG_BONUS  = 0.10;
276    /** As we inline deeper nested methods what cost (or bonus) do we wish to give to deter (or encourage) nesting of deeper methods? */
277    public double INLINE_CALL_DEPTH_COST         = 0.00;
278    /** Adaptive inlining heuristic: Upper bound on callee size */
279    public int INLINE_AI_MAX_TARGET_SIZE         = (20*org.jikesrvm.classloader.NormalMethod.CALL_COST-org.jikesrvm.classloader.NormalMethod.SIMPLE_OPERATION_COST);
280    /** Adaptive inlining heuristc: Minimum fraction of callsite distribution for guarded inlining of a callee */
281    public double INLINE_AI_MIN_CALLSITE_FRACTION= 0.4;
282    /** Selection of guard mechanism for inlined virtual calls that cannot be statically bound */
283    public byte INLINE_GUARD_KIND                = INLINE_GUARD_CODE_PATCH;
284    /** Only apply print options against methods whose name contains this string */
285    private java.util.HashSet<String> METHOD_TO_PRINT  = null;
286   // End template-specified options
287
288   // Begin generated support for "Enumeration" options
289   // PROFILE_FREQUENCY_STRATEGY
290   public static final byte PROFILE_COUNTERS_FREQ = 0;
291   /**
292    * Is PROFILE_FREQUENCY_STRATEGY set to PROFILE_COUNTERS_FREQ?
293    *
294    * @return {@code true} when PROFILE_COUNTERS_FREQ is set to PROFILE_FREQUENCY_STRATEGY,
295    *   {@code false} otherwise
296    */
297   public final boolean frequencyCounters() {
298     return PROFILE_FREQUENCY_STRATEGY == PROFILE_COUNTERS_FREQ;
299   }
300   public static final byte PROFILE_STATIC_FREQ = 1;
301   /**
302    * Is PROFILE_FREQUENCY_STRATEGY set to PROFILE_STATIC_FREQ?
303    *
304    * @return {@code true} when PROFILE_STATIC_FREQ is set to PROFILE_FREQUENCY_STRATEGY,
305    *   {@code false} otherwise
306    */
307   public final boolean staticFrequencyEstimates() {
308     return PROFILE_FREQUENCY_STRATEGY == PROFILE_STATIC_FREQ;
309   }
310   public static final byte PROFILE_DUMB_FREQ = 2;
311   /**
312    * Is PROFILE_FREQUENCY_STRATEGY set to PROFILE_DUMB_FREQ?
313    *
314    * @return {@code true} when PROFILE_DUMB_FREQ is set to PROFILE_FREQUENCY_STRATEGY,
315    *   {@code false} otherwise
316    */
317   public final boolean dumbFrequency() {
318     return PROFILE_FREQUENCY_STRATEGY == PROFILE_DUMB_FREQ;
319   }
320   public static final byte PROFILE_INVERSE_COUNTERS_FREQ = 3;
321   /**
322    * Is PROFILE_FREQUENCY_STRATEGY set to PROFILE_INVERSE_COUNTERS_FREQ?
323    *
324    * @return {@code true} when PROFILE_INVERSE_COUNTERS_FREQ is set to PROFILE_FREQUENCY_STRATEGY,
325    *   {@code false} otherwise
326    */
327   public final boolean inverseFrequencyCounters() {
328     return PROFILE_FREQUENCY_STRATEGY == PROFILE_INVERSE_COUNTERS_FREQ;
329   }
330
331   // REGALLOC_SPILL_COST_ESTIMATE
332   public static final byte REGALLOC_SIMPLE_SPILL_COST = 0;
333   /**
334    * Is REGALLOC_SPILL_COST_ESTIMATE set to REGALLOC_SIMPLE_SPILL_COST?
335    *
336    * @return {@code true} when REGALLOC_SIMPLE_SPILL_COST is set to REGALLOC_SPILL_COST_ESTIMATE,
337    *   {@code false} otherwise
338    */
339   public final boolean simpleSpillCost() {
340     return REGALLOC_SPILL_COST_ESTIMATE == REGALLOC_SIMPLE_SPILL_COST;
341   }
342   public static final byte REGALLOC_BRAINDEAD_SPILL_COST = 1;
343   /**
344    * Is REGALLOC_SPILL_COST_ESTIMATE set to REGALLOC_BRAINDEAD_SPILL_COST?
345    *
346    * @return {@code true} when REGALLOC_BRAINDEAD_SPILL_COST is set to REGALLOC_SPILL_COST_ESTIMATE,
347    *   {@code false} otherwise
348    */
349   public final boolean brainDeadSpillCost() {
350     return REGALLOC_SPILL_COST_ESTIMATE == REGALLOC_BRAINDEAD_SPILL_COST;
351   }
352   public static final byte REGALLOC_BLOCK_COUNT_SPILL_COST = 2;
353   /**
354    * Is REGALLOC_SPILL_COST_ESTIMATE set to REGALLOC_BLOCK_COUNT_SPILL_COST?
355    *
356    * @return {@code true} when REGALLOC_BLOCK_COUNT_SPILL_COST is set to REGALLOC_SPILL_COST_ESTIMATE,
357    *   {@code false} otherwise
358    */
359   public final boolean blockCountSpillCost() {
360     return REGALLOC_SPILL_COST_ESTIMATE == REGALLOC_BLOCK_COUNT_SPILL_COST;
361   }
362
363   // INLINE_GUARD_KIND
364   public static final byte INLINE_GUARD_METHOD_TEST = 0;
365   /**
366    * Is INLINE_GUARD_KIND set to INLINE_GUARD_METHOD_TEST?
367    *
368    * @return {@code true} when INLINE_GUARD_METHOD_TEST is set to INLINE_GUARD_KIND,
369    *   {@code false} otherwise
370    */
371   public final boolean guardWithMethodTest() {
372     return INLINE_GUARD_KIND == INLINE_GUARD_METHOD_TEST;
373   }
374   public static final byte INLINE_GUARD_CLASS_TEST = 1;
375   /**
376    * Is INLINE_GUARD_KIND set to INLINE_GUARD_CLASS_TEST?
377    *
378    * @return {@code true} when INLINE_GUARD_CLASS_TEST is set to INLINE_GUARD_KIND,
379    *   {@code false} otherwise
380    */
381   public final boolean guardWithClassTest() {
382     return INLINE_GUARD_KIND == INLINE_GUARD_CLASS_TEST;
383   }
384   public static final byte INLINE_GUARD_CODE_PATCH = 2;
385   /**
386    * Is INLINE_GUARD_KIND set to INLINE_GUARD_CODE_PATCH?
387    *
388    * @return {@code true} when INLINE_GUARD_CODE_PATCH is set to INLINE_GUARD_KIND,
389    *   {@code false} otherwise
390    */
391   public final boolean guardWithCodePatch() {
392     return INLINE_GUARD_KIND == INLINE_GUARD_CODE_PATCH;
393   }
394
395   // End generated support for "Enumeration" options
396
397   // Begin generated support for "Set" options
398   // DRIVER_EXCLUDE
399   /**
400    * Has the given parameter been added to DRIVER_EXCLUDE set of options?
401    *
402    * @param q the parameter
403    * @return {@code true} when the parameter has been added,
404    *   {@code false} otherwise
405    */
406   public boolean isDRIVER_EXCLUDE(String q) {
407     return DRIVER_EXCLUDE != null && DRIVER_EXCLUDE.contains(q);
408   }
409   /**
410    * Does the given parameter appear within a set the String of one of the options?
411    *
412    * @param q the parameter to search for
413    * @return {@code true} when it does appear, {@code false} otherwise
414    */
415   public boolean fuzzyMatchDRIVER_EXCLUDE(String q) {
416     if (DRIVER_EXCLUDE != null) {
417       for (final String s : DRIVER_EXCLUDE) {
418         if (q.indexOf(s) > -1)
419           return true;
420       }
421     }
422     return false;
423   }
424   /**
425    * Have any items been placed in the set DRIVER_EXCLUDE?
426    *
427    * @return {@code true} if the set exists and is not empty
428    */
429   public boolean hasDRIVER_EXCLUDE() {
430     return DRIVER_EXCLUDE != null && !DRIVER_EXCLUDE.isEmpty();
431   }
432   /**
433    * Return an iterator over the items in DRIVER_EXCLUDE
434    *
435    * @return an iterator over the items in DRIVER_EXCLUDE. The iterator
436    *   may be empty.
437    */
438   public java.util.Iterator<String> getDRIVER_EXCLUDEs() {
439     if (DRIVER_EXCLUDE == null) {
440       return org.jikesrvm.util.EmptyIterator.<String>getInstance();
441     } else {
442       return DRIVER_EXCLUDE.iterator();
443     }
444   }
445   // METHOD_TO_PRINT
446   /**
447    * Has the given parameter been added to METHOD_TO_PRINT set of options?
448    *
449    * @param q the parameter
450    * @return {@code true} when the parameter has been added,
451    *   {@code false} otherwise
452    */
453   public boolean isMETHOD_TO_PRINT(String q) {
454     return METHOD_TO_PRINT != null && METHOD_TO_PRINT.contains(q);
455   }
456   /**
457    * Does the given parameter appear within a set the String of one of the options?
458    *
459    * @param q the parameter to search for
460    * @return {@code true} when it does appear, {@code false} otherwise
461    */
462   public boolean fuzzyMatchMETHOD_TO_PRINT(String q) {
463     if (METHOD_TO_PRINT != null) {
464       for (final String s : METHOD_TO_PRINT) {
465         if (q.indexOf(s) > -1)
466           return true;
467       }
468     }
469     return false;
470   }
471   /**
472    * Have any items been placed in the set METHOD_TO_PRINT?
473    *
474    * @return {@code true} if the set exists and is not empty
475    */
476   public boolean hasMETHOD_TO_PRINT() {
477     return METHOD_TO_PRINT != null && !METHOD_TO_PRINT.isEmpty();
478   }
479   /**
480    * Return an iterator over the items in METHOD_TO_PRINT
481    *
482    * @return an iterator over the items in METHOD_TO_PRINT. The iterator
483    *   may be empty.
484    */
485   public java.util.Iterator<String> getMETHOD_TO_PRINTs() {
486     if (METHOD_TO_PRINT == null) {
487       return org.jikesrvm.util.EmptyIterator.<String>getInstance();
488     } else {
489       return METHOD_TO_PRINT.iterator();
490     }
491   }
492   // End generated support for "Set" options
493
494   @Override
495   @SuppressWarnings("unchecked")
496   public Object clone() throws CloneNotSupportedException {
497     OptOptions clone = (OptOptions)super.clone();
498     if (DRIVER_EXCLUDE != null) {
499       clone.DRIVER_EXCLUDE = (java.util.HashSet<String>)this.DRIVER_EXCLUDE.clone();
500     }
501     if (METHOD_TO_PRINT != null) {
502       clone.METHOD_TO_PRINT = (java.util.HashSet<String>)this.METHOD_TO_PRINT.clone();
503     }
504     return clone;
505   }
506
507  public OptOptions dup() {
508    try {
509      return (OptOptions) clone();
510    }
511    catch (CloneNotSupportedException e) {
512      final InternalError error = new InternalError("Unexpected CloneNotSupportedException.");
513      error.initCause(e);
514      throw error;
515    }
516  }
517
518  /**
519   * Take a string (most likely a command-line argument) and try to proccess it
520   * as an option command.  Return true if the string was understood, false
521   * otherwise.
522   *
523   * @param prefix a Sring to use as a command prefix when printing help.
524   * @param arg a String to try to process as an option command
525   * @return true if successful, false otherwise
526   */
527  @org.vmmagic.pragma.NoOptCompile
528  public boolean processAsOption(String prefix, String arg) {
529
530    // First handle the "option commands"
531    if (arg.equals("help")) {
532       printHelp(prefix);
533       return true;
534    }
535    if (arg.equals("printOptions")) {
536       printOptions();
537       return true;
538    }
539    if (arg.length() == 0) {
540      printHelp(prefix);
541      return true;
542    }
543    // Make sure only process O? option if initial runtime compiler!
544    if ((prefix.indexOf("irc")!=-1 ||
545         prefix.indexOf("bc")!=-1 ||
546         prefix.indexOf("eoc")!=-1) &&
547        instanceProcessAsOption(arg)) {
548      return true;
549    }
550
551    // Required format of arg is 'name=value'
552    // Split into 'name' and 'value' strings
553    int split = arg.indexOf('=');
554    if (split == -1) {
555      if (!(arg.equals("O0") || arg.equals("O1") || arg.equals("O2") || arg.equals("O3"))) {
556        VM.sysWrite("  Illegal option specification!\n  \""+arg+
557                      "\" must be specified as a name-value pair in the form of option=value\n");
558      }
559      return false;
560    }
561    String name = arg.substring(0,split);
562    String value = arg.substring(split+1);
563
564    //Begin generated command-line processing
565    if (name.equals("focus_effort")) {
566      if (value.equals("true")) {
567        FREQ_FOCUS_EFFORT = true;
568        return true;
569      } else if (value.equals("false")) {
570        FREQ_FOCUS_EFFORT = false;
571        return true;
572      } else
573        return false;
574    }
575    if (name.equals("reads_kill")) {
576      if (value.equals("true")) {
577        READS_KILL = true;
578        return true;
579      } else if (value.equals("false")) {
580        READS_KILL = false;
581        return true;
582      } else
583        return false;
584    }
585    if (name.equals("field_analysis")) {
586      if (value.equals("true")) {
587        FIELD_ANALYSIS = true;
588        return true;
589      } else if (value.equals("false")) {
590        FIELD_ANALYSIS = false;
591        return true;
592      } else
593        return false;
594    }
595    if (name.equals("inline")) {
596      if (value.equals("true")) {
597        INLINE = true;
598        return true;
599      } else if (value.equals("false")) {
600        INLINE = false;
601        return true;
602      } else
603        return false;
604    }
605    if (name.equals("inline_guarded")) {
606      if (value.equals("true")) {
607        INLINE_GUARDED = true;
608        return true;
609      } else if (value.equals("false")) {
610        INLINE_GUARDED = false;
611        return true;
612      } else
613        return false;
614    }
615    if (name.equals("inline_guarded_interfaces")) {
616      if (value.equals("true")) {
617        INLINE_GUARDED_INTERFACES = true;
618        return true;
619      } else if (value.equals("false")) {
620        INLINE_GUARDED_INTERFACES = false;
621        return true;
622      } else
623        return false;
624    }
625    if (name.equals("inline_preex")) {
626      if (value.equals("true")) {
627        INLINE_PREEX = true;
628        return true;
629      } else if (value.equals("false")) {
630        INLINE_PREEX = false;
631        return true;
632      } else
633        return false;
634    }
635    if (name.equals("simplify_integer_ops")) {
636      if (value.equals("true")) {
637        SIMPLIFY_INTEGER_OPS = true;
638        return true;
639      } else if (value.equals("false")) {
640        SIMPLIFY_INTEGER_OPS = false;
641        return true;
642      } else
643        return false;
644    }
645    if (name.equals("simplify_long_ops")) {
646      if (value.equals("true")) {
647        SIMPLIFY_LONG_OPS = true;
648        return true;
649      } else if (value.equals("false")) {
650        SIMPLIFY_LONG_OPS = false;
651        return true;
652      } else
653        return false;
654    }
655    if (name.equals("simplify_float_ops")) {
656      if (value.equals("true")) {
657        SIMPLIFY_FLOAT_OPS = true;
658        return true;
659      } else if (value.equals("false")) {
660        SIMPLIFY_FLOAT_OPS = false;
661        return true;
662      } else
663        return false;
664    }
665    if (name.equals("simplify_double_ops")) {
666      if (value.equals("true")) {
667        SIMPLIFY_DOUBLE_OPS = true;
668        return true;
669      } else if (value.equals("false")) {
670        SIMPLIFY_DOUBLE_OPS = false;
671        return true;
672      } else
673        return false;
674    }
675    if (name.equals("simplify_ref_ops")) {
676      if (value.equals("true")) {
677        SIMPLIFY_REF_OPS = true;
678        return true;
679      } else if (value.equals("false")) {
680        SIMPLIFY_REF_OPS = false;
681        return true;
682      } else
683        return false;
684    }
685    if (name.equals("simplify_tib_ops")) {
686      if (value.equals("true")) {
687        SIMPLIFY_TIB_OPS = true;
688        return true;
689      } else if (value.equals("false")) {
690        SIMPLIFY_TIB_OPS = false;
691        return true;
692      } else
693        return false;
694    }
695    if (name.equals("simplify_field_ops")) {
696      if (value.equals("true")) {
697        SIMPLIFY_FIELD_OPS = true;
698        return true;
699      } else if (value.equals("false")) {
700        SIMPLIFY_FIELD_OPS = false;
701        return true;
702      } else
703        return false;
704    }
705    if (name.equals("simplify_chase_final_fields")) {
706      if (value.equals("true")) {
707        SIMPLIFY_CHASE_FINAL_FIELDS = true;
708        return true;
709      } else if (value.equals("false")) {
710        SIMPLIFY_CHASE_FINAL_FIELDS = false;
711        return true;
712      } else
713        return false;
714    }
715    if (name.equals("local_constant_prop")) {
716      if (value.equals("true")) {
717        LOCAL_CONSTANT_PROP = true;
718        return true;
719      } else if (value.equals("false")) {
720        LOCAL_CONSTANT_PROP = false;
721        return true;
722      } else
723        return false;
724    }
725    if (name.equals("local_copy_prop")) {
726      if (value.equals("true")) {
727        LOCAL_COPY_PROP = true;
728        return true;
729      } else if (value.equals("false")) {
730        LOCAL_COPY_PROP = false;
731        return true;
732      } else
733        return false;
734    }
735    if (name.equals("local_cse")) {
736      if (value.equals("true")) {
737        LOCAL_CSE = true;
738        return true;
739      } else if (value.equals("false")) {
740        LOCAL_CSE = false;
741        return true;
742      } else
743        return false;
744    }
745    if (name.equals("local_expression_folding")) {
746      if (value.equals("true")) {
747        LOCAL_EXPRESSION_FOLDING = true;
748        return true;
749      } else if (value.equals("false")) {
750        LOCAL_EXPRESSION_FOLDING = false;
751        return true;
752      } else
753        return false;
754    }
755    if (name.equals("control_static_splitting")) {
756      if (value.equals("true")) {
757        CONTROL_STATIC_SPLITTING = true;
758        return true;
759      } else if (value.equals("false")) {
760        CONTROL_STATIC_SPLITTING = false;
761        return true;
762      } else
763        return false;
764    }
765    if (name.equals("control_unwhile")) {
766      if (value.equals("true")) {
767        CONTROL_TURN_WHILES_INTO_UNTILS = true;
768        return true;
769      } else if (value.equals("false")) {
770        CONTROL_TURN_WHILES_INTO_UNTILS = false;
771        return true;
772      } else
773        return false;
774    }
775    if (name.equals("escape_simple_ipa")) {
776      if (value.equals("true")) {
777        ESCAPE_SIMPLE_IPA = true;
778        return true;
779      } else if (value.equals("false")) {
780        ESCAPE_SIMPLE_IPA = false;
781        return true;
782      } else
783        return false;
784    }
785    if (name.equals("escape_scalar_replace_aggregates")) {
786      if (value.equals("true")) {
787        ESCAPE_SCALAR_REPLACE_AGGREGATES = true;
788        return true;
789      } else if (value.equals("false")) {
790        ESCAPE_SCALAR_REPLACE_AGGREGATES = false;
791        return true;
792      } else
793        return false;
794    }
795    if (name.equals("escape_monitor_removal")) {
796      if (value.equals("true")) {
797        ESCAPE_MONITOR_REMOVAL = true;
798        return true;
799      } else if (value.equals("false")) {
800        ESCAPE_MONITOR_REMOVAL = false;
801        return true;
802      } else
803        return false;
804    }
805    if (name.equals("escape_invokee_thread_local")) {
806      if (value.equals("true")) {
807        ESCAPE_INVOKEE_THREAD_LOCAL = true;
808        return true;
809      } else if (value.equals("false")) {
810        ESCAPE_INVOKEE_THREAD_LOCAL = false;
811        return true;
812      } else
813        return false;
814    }
815    if (name.equals("ssa")) {
816      if (value.equals("true")) {
817        SSA = true;
818        return true;
819      } else if (value.equals("false")) {
820        SSA = false;
821        return true;
822      } else
823        return false;
824    }
825    if (name.equals("ssa_expression_folding")) {
826      if (value.equals("true")) {
827        SSA_EXPRESSION_FOLDING = true;
828        return true;
829      } else if (value.equals("false")) {
830        SSA_EXPRESSION_FOLDING = false;
831        return true;
832      } else
833        return false;
834    }
835    if (name.equals("ssa_redundant_branch_elimination")) {
836      if (value.equals("true")) {
837        SSA_REDUNDANT_BRANCH_ELIMINATION = true;
838        return true;
839      } else if (value.equals("false")) {
840        SSA_REDUNDANT_BRANCH_ELIMINATION = false;
841        return true;
842      } else
843        return false;
844    }
845    if (name.equals("ssa_licm_ignore_pei")) {
846      if (value.equals("true")) {
847        SSA_LICM_IGNORE_PEI = true;
848        return true;
849      } else if (value.equals("false")) {
850        SSA_LICM_IGNORE_PEI = false;
851        return true;
852      } else
853        return false;
854    }
855    if (name.equals("ssa_load_elimination")) {
856      if (value.equals("true")) {
857        SSA_LOAD_ELIMINATION = true;
858        return true;
859      } else if (value.equals("false")) {
860        SSA_LOAD_ELIMINATION = false;
861        return true;
862      } else
863        return false;
864    }
865    if (name.equals("ssa_coalesce_after")) {
866      if (value.equals("true")) {
867        SSA_COALESCE_AFTER = true;
868        return true;
869      } else if (value.equals("false")) {
870        SSA_COALESCE_AFTER = false;
871        return true;
872      } else
873        return false;
874    }
875    if (name.equals("ssa_loop_versioning")) {
876      if (value.equals("true")) {
877        SSA_LOOP_VERSIONING = true;
878        return true;
879      } else if (value.equals("false")) {
880        SSA_LOOP_VERSIONING = false;
881        return true;
882      } else
883        return false;
884    }
885    if (name.equals("ssa_live_range_splitting")) {
886      if (value.equals("true")) {
887        SSA_LIVE_RANGE_SPLITTING = true;
888        return true;
889      } else if (value.equals("false")) {
890        SSA_LIVE_RANGE_SPLITTING = false;
891        return true;
892      } else
893        return false;
894    }
895    if (name.equals("ssa_gcp")) {
896      if (value.equals("true")) {
897        SSA_GCP = true;
898        return true;
899      } else if (value.equals("false")) {
900        SSA_GCP = false;
901        return true;
902      } else
903        return false;
904    }
905    if (name.equals("ssa_gcse")) {
906      if (value.equals("true")) {
907        SSA_GCSE = true;
908        return true;
909      } else if (value.equals("false")) {
910        SSA_GCSE = false;
911        return true;
912      } else
913        return false;
914    }
915    if (name.equals("ssa_splitblock_to_avoid_rename")) {
916      if (value.equals("true")) {
917        SSA_SPLITBLOCK_TO_AVOID_RENAME = true;
918        return true;
919      } else if (value.equals("false")) {
920        SSA_SPLITBLOCK_TO_AVOID_RENAME = false;
921        return true;
922      } else
923        return false;
924    }
925    if (name.equals("ssa_splitblock_for_local_live")) {
926      if (value.equals("true")) {
927        SSA_SPLITBLOCK_FOR_LOCAL_LIVE = true;
928        return true;
929      } else if (value.equals("false")) {
930        SSA_SPLITBLOCK_FOR_LOCAL_LIVE = false;
931        return true;
932      } else
933        return false;
934    }
935    if (name.equals("ssa_splitblock_into_infrequent")) {
936      if (value.equals("true")) {
937        SSA_SPLITBLOCK_INTO_INFREQUENT = true;
938        return true;
939      } else if (value.equals("false")) {
940        SSA_SPLITBLOCK_INTO_INFREQUENT = false;
941        return true;
942      } else
943        return false;
944    }
945    if (name.equals("reorder_code")) {
946      if (value.equals("true")) {
947        REORDER_CODE = true;
948        return true;
949      } else if (value.equals("false")) {
950        REORDER_CODE = false;
951        return true;
952      } else
953        return false;
954    }
955    if (name.equals("reorder_code_ph")) {
956      if (value.equals("true")) {
957        REORDER_CODE_PH = true;
958        return true;
959      } else if (value.equals("false")) {
960        REORDER_CODE_PH = false;
961        return true;
962      } else
963        return false;
964    }
965    if (name.equals("h2l_inline_new")) {
966      if (value.equals("true")) {
967        H2L_INLINE_NEW = true;
968        return true;
969      } else if (value.equals("false")) {
970        H2L_INLINE_NEW = false;
971        return true;
972      } else
973        return false;
974    }
975    if (name.equals("h2l_inline_write_barrier")) {
976      if (value.equals("true")) {
977        H2L_INLINE_WRITE_BARRIER = true;
978        return true;
979      } else if (value.equals("false")) {
980        H2L_INLINE_WRITE_BARRIER = false;
981        return true;
982      } else
983        return false;
984    }
985    if (name.equals("h2l_inline_primitive_write_barrier")) {
986      if (value.equals("true")) {
987        H2L_INLINE_PRIMITIVE_WRITE_BARRIER = true;
988        return true;
989      } else if (value.equals("false")) {
990        H2L_INLINE_PRIMITIVE_WRITE_BARRIER = false;
991        return true;
992      } else
993        return false;
994    }
995    if (name.equals("h2l_no_callee_exceptions")) {
996      if (value.equals("true")) {
997        H2L_NO_CALLEE_EXCEPTIONS = true;
998        return true;
999      } else if (value.equals("false")) {
1000        H2L_NO_CALLEE_EXCEPTIONS = false;
1001        return true;
1002      } else
1003        return false;
1004    }
1005    if (name.equals("h2l_call_via_jtoc")) {
1006      if (value.equals("true")) {
1007        H2L_CALL_VIA_JTOC = true;
1008        return true;
1009      } else if (value.equals("false")) {
1010        H2L_CALL_VIA_JTOC = false;
1011        return true;
1012      } else
1013        return false;
1014    }
1015    if (name.equals("l2m_handler_liveness")) {
1016      if (value.equals("true")) {
1017        L2M_HANDLER_LIVENESS = true;
1018        return true;
1019      } else if (value.equals("false")) {
1020        L2M_HANDLER_LIVENESS = false;
1021        return true;
1022      } else
1023        return false;
1024    }
1025    if (name.equals("regalloc_coalesce_moves")) {
1026      if (value.equals("true")) {
1027        REGALLOC_COALESCE_MOVES = true;
1028        return true;
1029      } else if (value.equals("false")) {
1030        REGALLOC_COALESCE_MOVES = false;
1031        return true;
1032      } else
1033        return false;
1034    }
1035    if (name.equals("regalloc_coalesce_spills")) {
1036      if (value.equals("true")) {
1037        REGALLOC_COALESCE_SPILLS = true;
1038        return true;
1039      } else if (value.equals("false")) {
1040        REGALLOC_COALESCE_SPILLS = false;
1041        return true;
1042      } else
1043        return false;
1044    }
1045    if (name.equals("adaptive_instrumentation_sampling")) {
1046      if (value.equals("true")) {
1047        ADAPTIVE_INSTRUMENTATION_SAMPLING = true;
1048        return true;
1049      } else if (value.equals("false")) {
1050        ADAPTIVE_INSTRUMENTATION_SAMPLING = false;
1051        return true;
1052      } else
1053        return false;
1054    }
1055    if (name.equals("adaptive_no_duplication")) {
1056      if (value.equals("true")) {
1057        ADAPTIVE_NO_DUPLICATION = true;
1058        return true;
1059      } else if (value.equals("false")) {
1060        ADAPTIVE_NO_DUPLICATION = false;
1061        return true;
1062      } else
1063        return false;
1064    }
1065    if (name.equals("adaptive_processor_specific_counter")) {
1066      if (value.equals("true")) {
1067        ADAPTIVE_PROCESSOR_SPECIFIC_COUNTER = true;
1068        return true;
1069      } else if (value.equals("false")) {
1070        ADAPTIVE_PROCESSOR_SPECIFIC_COUNTER = false;
1071        return true;
1072      } else
1073        return false;
1074    }
1075    if (name.equals("adaptive_remove_yp_from_checking")) {
1076      if (value.equals("true")) {
1077        ADAPTIVE_REMOVE_YP_FROM_CHECKING = true;
1078        return true;
1079      } else if (value.equals("false")) {
1080        ADAPTIVE_REMOVE_YP_FROM_CHECKING = false;
1081        return true;
1082      } else
1083        return false;
1084    }
1085    if (name.equals("osr_guarded_inlining")) {
1086      if (value.equals("true")) {
1087        OSR_GUARDED_INLINING = true;
1088        return true;
1089      } else if (value.equals("false")) {
1090        OSR_GUARDED_INLINING = false;
1091        return true;
1092      } else
1093        return false;
1094    }
1095    if (name.equals("osr_inline_policy")) {
1096      if (value.equals("true")) {
1097        OSR_INLINE_POLICY = true;
1098        return true;
1099      } else if (value.equals("false")) {
1100        OSR_INLINE_POLICY = false;
1101        return true;
1102      } else
1103        return false;
1104    }
1105    if (name.equals("print_static_stats")) {
1106      if (value.equals("true")) {
1107        PRINT_STATIC_STATS = true;
1108        return true;
1109      } else if (value.equals("false")) {
1110        PRINT_STATIC_STATS = false;
1111        return true;
1112      } else
1113        return false;
1114    }
1115    if (name.equals("print_phases")) {
1116      if (value.equals("true")) {
1117        PRINT_PHASES = true;
1118        return true;
1119      } else if (value.equals("false")) {
1120        PRINT_PHASES = false;
1121        return true;
1122      } else
1123        return false;
1124    }
1125    if (name.equals("print_all_ir")) {
1126      if (value.equals("true")) {
1127        PRINT_ALL_IR = true;
1128        return true;
1129      } else if (value.equals("false")) {
1130        PRINT_ALL_IR = false;
1131        return true;
1132      } else
1133        return false;
1134    }
1135    if (name.equals("print_detailed_inline_report")) {
1136      if (value.equals("true")) {
1137        PRINT_DETAILED_INLINE_REPORT = true;
1138        return true;
1139      } else if (value.equals("false")) {
1140        PRINT_DETAILED_INLINE_REPORT = false;
1141        return true;
1142      } else
1143        return false;
1144    }
1145    if (name.equals("print_inline_report")) {
1146      if (value.equals("true")) {
1147        PRINT_INLINE_REPORT = true;
1148        return true;
1149      } else if (value.equals("false")) {
1150        PRINT_INLINE_REPORT = false;
1151        return true;
1152      } else
1153        return false;
1154    }
1155    if (name.equals("print_dom")) {
1156      if (value.equals("true")) {
1157        PRINT_DOMINATORS = true;
1158        return true;
1159      } else if (value.equals("false")) {
1160        PRINT_DOMINATORS = false;
1161        return true;
1162      } else
1163        return false;
1164    }
1165    if (name.equals("print_pdom")) {
1166      if (value.equals("true")) {
1167        PRINT_POST_DOMINATORS = true;
1168        return true;
1169      } else if (value.equals("false")) {
1170        PRINT_POST_DOMINATORS = false;
1171        return true;
1172      } else
1173        return false;
1174    }
1175    if (name.equals("print_ssa")) {
1176      if (value.equals("true")) {
1177        PRINT_SSA = true;
1178        return true;
1179      } else if (value.equals("false")) {
1180        PRINT_SSA = false;
1181        return true;
1182      } else
1183        return false;
1184    }
1185    if (name.equals("print_dg_burs")) {
1186      if (value.equals("true")) {
1187        PRINT_DG_BURS = true;
1188        return true;
1189      } else if (value.equals("false")) {
1190        PRINT_DG_BURS = false;
1191        return true;
1192      } else
1193        return false;
1194    }
1195    if (name.equals("print_visualization")) {
1196      if (value.equals("true")) {
1197        PRINT_VISUALIZATION = true;
1198        return true;
1199      } else if (value.equals("false")) {
1200        PRINT_VISUALIZATION = false;
1201        return true;
1202      } else
1203        return false;
1204    }
1205    if (name.equals("print_high")) {
1206      if (value.equals("true")) {
1207        PRINT_HIGH = true;
1208        return true;
1209      } else if (value.equals("false")) {
1210        PRINT_HIGH = false;
1211        return true;
1212      } else
1213        return false;
1214    }
1215    if (name.equals("print_final_hir")) {
1216      if (value.equals("true")) {
1217        PRINT_FINAL_HIR = true;
1218        return true;
1219      } else if (value.equals("false")) {
1220        PRINT_FINAL_HIR = false;
1221        return true;
1222      } else
1223        return false;
1224    }
1225    if (name.equals("print_low")) {
1226      if (value.equals("true")) {
1227        PRINT_LOW = true;
1228        return true;
1229      } else if (value.equals("false")) {
1230        PRINT_LOW = false;
1231        return true;
1232      } else
1233        return false;
1234    }
1235    if (name.equals("print_final_lir")) {
1236      if (value.equals("true")) {
1237        PRINT_FINAL_LIR = true;
1238        return true;
1239      } else if (value.equals("false")) {
1240        PRINT_FINAL_LIR = false;
1241        return true;
1242      } else
1243        return false;
1244    }
1245    if (name.equals("print_mir")) {
1246      if (value.equals("true")) {
1247        PRINT_MIR = true;
1248        return true;
1249      } else if (value.equals("false")) {
1250        PRINT_MIR = false;
1251        return true;
1252      } else
1253        return false;
1254    }
1255    if (name.equals("print_final_mir")) {
1256      if (value.equals("true")) {
1257        PRINT_FINAL_MIR = true;
1258        return true;
1259      } else if (value.equals("false")) {
1260        PRINT_FINAL_MIR = false;
1261        return true;
1262      } else
1263        return false;
1264    }
1265    if (name.equals("print_cfg")) {
1266      if (value.equals("true")) {
1267        PRINT_CFG = true;
1268        return true;
1269      } else if (value.equals("false")) {
1270        PRINT_CFG = false;
1271        return true;
1272      } else
1273        return false;
1274    }
1275    if (name.equals("print_regalloc")) {
1276      if (value.equals("true")) {
1277        PRINT_REGALLOC = true;
1278        return true;
1279      } else if (value.equals("false")) {
1280        PRINT_REGALLOC = false;
1281        return true;
1282      } else
1283        return false;
1284    }
1285    if (name.equals("print_calling_conventions")) {
1286      if (value.equals("true")) {
1287        PRINT_CALLING_CONVENTIONS = true;
1288        return true;
1289      } else if (value.equals("false")) {
1290        PRINT_CALLING_CONVENTIONS = false;
1291        return true;
1292      } else
1293        return false;
1294    }
1295    if (name.equals("print_gc_maps")) {
1296      if (value.equals("true")) {
1297        PRINT_GC_MAPS = true;
1298        return true;
1299      } else if (value.equals("false")) {
1300        PRINT_GC_MAPS = false;
1301        return true;
1302      } else
1303        return false;
1304    }
1305    if (name.equals("debug_cgd")) {
1306      if (value.equals("true")) {
1307        DEBUG_CODEGEN = true;
1308        return true;
1309      } else if (value.equals("false")) {
1310        DEBUG_CODEGEN = false;
1311        return true;
1312      } else
1313        return false;
1314    }
1315    if (name.equals("debug_instru_sampling")) {
1316      if (value.equals("true")) {
1317        DEBUG_INSTRU_SAMPLING = true;
1318        return true;
1319      } else if (value.equals("false")) {
1320        DEBUG_INSTRU_SAMPLING = false;
1321        return true;
1322      } else
1323        return false;
1324    }
1325    if (name.equals("debug_instru_sampling_detail")) {
1326      if (value.equals("true")) {
1327        DEBUG_INSTRU_SAMPLING_DETAIL = true;
1328        return true;
1329      } else if (value.equals("false")) {
1330        DEBUG_INSTRU_SAMPLING_DETAIL = false;
1331        return true;
1332      } else
1333        return false;
1334    }
1335    if (name.equals("debug_gcp")) {
1336      if (value.equals("true")) {
1337        DEBUG_GCP = true;
1338        return true;
1339      } else if (value.equals("false")) {
1340        DEBUG_GCP = false;
1341        return true;
1342      } else
1343        return false;
1344    }
1345    if (name.equals("verbose")) {
1346      if (value.equals("true")) {
1347        PRINT_METHOD = true;
1348        return true;
1349      } else if (value.equals("false")) {
1350        PRINT_METHOD = false;
1351        return true;
1352      } else
1353        return false;
1354    }
1355    if (name.equals("mc")) {
1356      if (value.equals("true")) {
1357        PRINT_MACHINECODE = true;
1358        return true;
1359      } else if (value.equals("false")) {
1360        PRINT_MACHINECODE = false;
1361        return true;
1362      } else
1363        return false;
1364    }
1365    if (name.equals("driver_exclude")) {
1366       if (DRIVER_EXCLUDE == null) {
1367         DRIVER_EXCLUDE = new java.util.HashSet<String>();
1368       }
1369       DRIVER_EXCLUDE.add(value);
1370       return true;
1371     }
1372    if (name.equals("print_ir_level")) {
1373       PRINT_IR_LEVEL = CommandLineArgs.primitiveParseInt(value);
1374       return true;
1375     }
1376    if (name.equals("visualize_ir_directory")) {
1377       VISUALIZE_IR_DIRECTORY = value;
1378       return true;
1379     }
1380    if (name.equals("profile_edge_count_input_file")) {
1381       PROFILE_EDGE_COUNT_INPUT_FILE = value;
1382       return true;
1383     }
1384    if (name.equals("profile_frequency_strategy")) {
1385       if (value.equals("counters")) {
1386         PROFILE_FREQUENCY_STRATEGY = PROFILE_COUNTERS_FREQ;
1387         return true;
1388       }
1389       if (value.equals("static")) {
1390         PROFILE_FREQUENCY_STRATEGY = PROFILE_STATIC_FREQ;
1391         return true;
1392       }
1393       if (value.equals("dumb")) {
1394         PROFILE_FREQUENCY_STRATEGY = PROFILE_DUMB_FREQ;
1395         return true;
1396       }
1397       if (value.equals("inverse")) {
1398         PROFILE_FREQUENCY_STRATEGY = PROFILE_INVERSE_COUNTERS_FREQ;
1399         return true;
1400       }
1401       return false;
1402     }
1403    if (name.equals("profile_infrequent_threshold")) {
1404       PROFILE_INFREQUENT_THRESHOLD = CommandLineArgs.primitiveParseFloat(value);
1405       return true;
1406     }
1407    if (name.equals("profile_cbs_hotness")) {
1408       PROFILE_CBS_HOTNESS = CommandLineArgs.primitiveParseFloat(value);
1409       return true;
1410     }
1411    if (name.equals("escape_max_array_size")) {
1412       ESCAPE_MAX_ARRAY_SIZE = CommandLineArgs.primitiveParseInt(value);
1413       return true;
1414     }
1415    if (name.equals("ssa_load_elimination_rounds")) {
1416       SSA_LOAD_ELIMINATION_ROUNDS = CommandLineArgs.primitiveParseInt(value);
1417       return true;
1418     }
1419    if (name.equals("l2m_max_block_size")) {
1420       L2M_MAX_BLOCK_SIZE = CommandLineArgs.primitiveParseInt(value);
1421       return true;
1422     }
1423    if (name.equals("regalloc_spill_cost_estimate")) {
1424       if (value.equals("simple")) {
1425         REGALLOC_SPILL_COST_ESTIMATE = REGALLOC_SIMPLE_SPILL_COST;
1426         return true;
1427       }
1428       if (value.equals("brainDead")) {
1429         REGALLOC_SPILL_COST_ESTIMATE = REGALLOC_BRAINDEAD_SPILL_COST;
1430         return true;
1431       }
1432       if (value.equals("blockCount")) {
1433         REGALLOC_SPILL_COST_ESTIMATE = REGALLOC_BLOCK_COUNT_SPILL_COST;
1434         return true;
1435       }
1436       return false;
1437     }
1438    if (name.equals("regalloc_simple_spill_cost_move_factor")) {
1439       REGALLOC_SIMPLE_SPILL_COST_MOVE_FACTOR = CommandLineArgs.primitiveParseFloat(value);
1440       return true;
1441     }
1442    if (name.equals("regalloc_simple_spill_cost_memory_operand_factor")) {
1443       REGALLOC_SIMPLE_SPILL_COST_MEMORY_OPERAND_FACTOR = CommandLineArgs.primitiveParseFloat(value);
1444       return true;
1445     }
1446    if (name.equals("control_tableswitch_cutoff")) {
1447       CONTROL_TABLESWITCH_CUTOFF = CommandLineArgs.primitiveParseInt(value);
1448       return true;
1449     }
1450    if (name.equals("control_cond_move_cutoff")) {
1451       CONTROL_COND_MOVE_CUTOFF = CommandLineArgs.primitiveParseInt(value);
1452       return true;
1453     }
1454    if (name.equals("control_unroll_log")) {
1455       CONTROL_UNROLL_LOG = CommandLineArgs.primitiveParseInt(value);
1456       return true;
1457     }
1458    if (name.equals("control_static_splitting_max_cost")) {
1459       CONTROL_STATIC_SPLITTING_MAX_COST = CommandLineArgs.primitiveParseInt(value);
1460       return true;
1461     }
1462    if (name.equals("control_well_predicted_cutoff")) {
1463       CONTROL_WELL_PREDICTED_CUTOFF = CommandLineArgs.primitiveParseFloat(value);
1464       return true;
1465     }
1466    if (name.equals("inline_max_target_size")) {
1467       INLINE_MAX_TARGET_SIZE = CommandLineArgs.primitiveParseInt(value);
1468       return true;
1469     }
1470    if (name.equals("inline_max_inline_depth")) {
1471       INLINE_MAX_INLINE_DEPTH = CommandLineArgs.primitiveParseInt(value);
1472       return true;
1473     }
1474    if (name.equals("inline_max_always_inline_target_size")) {
1475       INLINE_MAX_ALWAYS_INLINE_TARGET_SIZE = CommandLineArgs.primitiveParseInt(value);
1476       return true;
1477     }
1478    if (name.equals("inline_massive_method_size")) {
1479       INLINE_MASSIVE_METHOD_SIZE = CommandLineArgs.primitiveParseInt(value);
1480       return true;
1481     }
1482    if (name.equals("inline_max_arg_bonus")) {
1483       INLINE_MAX_ARG_BONUS = CommandLineArgs.primitiveParseFloat(value);
1484       return true;
1485     }
1486    if (name.equals("inline_precise_reg_array_arg_bonus")) {
1487       INLINE_PRECISE_REG_ARRAY_ARG_BONUS = CommandLineArgs.primitiveParseFloat(value);
1488       return true;
1489     }
1490    if (name.equals("inline_declared_aastored_array_arg_bonus")) {
1491       INLINE_DECLARED_AASTORED_ARRAY_ARG_BONUS = CommandLineArgs.primitiveParseFloat(value);
1492       return true;
1493     }
1494    if (name.equals("inline_precise_reg_class_arg_bonus")) {
1495       INLINE_PRECISE_REG_CLASS_ARG_BONUS = CommandLineArgs.primitiveParseFloat(value);
1496       return true;
1497     }
1498    if (name.equals("inline_extant_reg_class_arg_bonus")) {
1499       INLINE_EXTANT_REG_CLASS_ARG_BONUS = CommandLineArgs.primitiveParseFloat(value);
1500       return true;
1501     }
1502    if (name.equals("inline_int_const_arg_bonus")) {
1503       INLINE_INT_CONST_ARG_BONUS = CommandLineArgs.primitiveParseFloat(value);
1504       return true;
1505     }
1506    if (name.equals("inline_null_const_arg_bonus")) {
1507       INLINE_NULL_CONST_ARG_BONUS = CommandLineArgs.primitiveParseFloat(value);
1508       return true;
1509     }
1510    if (name.equals("inline_object_const_arg_bonus")) {
1511       INLINE_OBJECT_CONST_ARG_BONUS = CommandLineArgs.primitiveParseFloat(value);
1512       return true;
1513     }
1514    if (name.equals("inline_call_depth_cost")) {
1515       INLINE_CALL_DEPTH_COST = CommandLineArgs.primitiveParseFloat(value);
1516       return true;
1517     }
1518    if (name.equals("inline_ai_max_target_size")) {
1519       INLINE_AI_MAX_TARGET_SIZE = CommandLineArgs.primitiveParseInt(value);
1520       return true;
1521     }
1522    if (name.equals("inline_ai_min_callsite_fraction")) {
1523       INLINE_AI_MIN_CALLSITE_FRACTION = CommandLineArgs.primitiveParseFloat(value);
1524       return true;
1525     }
1526    if (name.equals("inline_guard_kind")) {
1527       if (value.equals("inline_guard_method_test")) {
1528         INLINE_GUARD_KIND = INLINE_GUARD_METHOD_TEST;
1529         return true;
1530       }
1531       if (value.equals("inline_guard_class_test")) {
1532         INLINE_GUARD_KIND = INLINE_GUARD_CLASS_TEST;
1533         return true;
1534       }
1535       if (value.equals("inline_guard_code_patch")) {
1536         INLINE_GUARD_KIND = INLINE_GUARD_CODE_PATCH;
1537         return true;
1538       }
1539       return false;
1540     }
1541    if (name.equals("method_to_print")) {
1542       if (METHOD_TO_PRINT == null) {
1543         METHOD_TO_PRINT = new java.util.HashSet<String>();
1544       }
1545       METHOD_TO_PRINT.add(value);
1546       return true;
1547     }
1548       //End generated command-line processing
1549
1550    // None of the above tests matched, so this wasn't an option
1551    return false;
1552  }
1553
1554  /**
1555   * Prints a short description of every option
1556   *
1557   * @param prefix the prefix for the option
1558   */
1559  public static void printHelp(String prefix) {
1560
1561    instancePrintHelpHeader(prefix);
1562
1563    //Begin generated help messages
1564    VM.sysWrite("Boolean Options ("+prefix+"<option>=true or "+prefix+":<option>=false)\n");
1565    VM.sysWrite("Option                        OptLevel Description\n");
1566    VM.sysWrite("focus_effort                           Focus compilation effort based on frequency profile data\n");
1567    VM.sysWrite("reads_kill                             Should we constrain optimizations by enforcing reads-kill?\n");
1568    VM.sysWrite("field_analysis                 0       Eagerly compute method summaries for flow-insensitive field analysis\n");
1569    VM.sysWrite("inline                         0       Inline statically resolvable calls\n");
1570    VM.sysWrite("inline_guarded                 0       Guarded inlining of non-final virtual calls\n");
1571    VM.sysWrite("inline_guarded_interfaces      0       Speculatively inline non-final interface calls\n");
1572    VM.sysWrite("inline_preex                   0       Pre-existence based inlining\n");
1573    VM.sysWrite("simplify_integer_ops                   Simplify operations on integers\n");
1574    VM.sysWrite("simplify_long_ops                      Simplify operations on longs\n");
1575    VM.sysWrite("simplify_float_ops                     Simplify operations on floats\n");
1576    VM.sysWrite("simplify_double_ops                    Simplify operations on floats\n");
1577    VM.sysWrite("simplify_ref_ops                       Simplify operations on references\n");
1578    VM.sysWrite("simplify_tib_ops                       Simplify operations on TIBs\n");
1579    VM.sysWrite("simplify_field_ops                     Simplify operations on fields\n");
1580    VM.sysWrite("simplify_chase_final_fields            Chase final fields avoiding loads at runtime\n");
1581    VM.sysWrite("local_constant_prop            0       Perform local constant propagation\n");
1582    VM.sysWrite("local_copy_prop                0       Perform local copy propagation\n");
1583    VM.sysWrite("local_cse                      0       Perform local common subexpression elimination\n");
1584    VM.sysWrite("local_expression_folding       3       Should we try to fold expressions with constants locally?\n");
1585    VM.sysWrite("control_static_splitting       1       CFG splitting to create hot traces based on static heuristics\n");
1586    VM.sysWrite("control_unwhile                3       Turn whiles into untils\n");
1587    VM.sysWrite("escape_simple_ipa                      Eagerly compute method summaries for simple escape analysis\n");
1588    VM.sysWrite("escape_scalar_replace_aggregates 1       If possible turn aggregates (objects) into variable definition/uses\n");
1589    VM.sysWrite("escape_monitor_removal         1       Try to remove unnecessary monitor operations\n");
1590    VM.sysWrite("escape_invokee_thread_local            Compile the method assuming the invokee is thread-local. Cannot be properly set on command line.\n");
1591    VM.sysWrite("ssa                            3       Should SSA form be constructed on the HIR?\n");
1592    VM.sysWrite("ssa_expression_folding         3       Should we try to fold expressions with constants in SSA form?\n");
1593    VM.sysWrite("ssa_redundant_branch_elimination 3       Eliminate redundant conditional branches\n");
1594    VM.sysWrite("ssa_licm_ignore_pei                    Assume PEIs do not throw or state is not observable\n");
1595    VM.sysWrite("ssa_load_elimination           3       Should we perform redundant load elimination during SSA pass?\n");
1596    VM.sysWrite("ssa_coalesce_after             3       Should we coalesce move instructions after leaving SSA?\n");
1597    VM.sysWrite("ssa_loop_versioning                    Create copies of loops where runtime exceptions are checked prior to entry\n");
1598    VM.sysWrite("ssa_live_range_splitting               Split live ranges using LIR SSA pass?\n");
1599    VM.sysWrite("ssa_gcp                        3       Perform global code placement\n");
1600    VM.sysWrite("ssa_gcse                       3       Perform global code placement\n");
1601    VM.sysWrite("ssa_splitblock_to_avoid_rename         When leaving SSA create blocks to avoid renaming variables\n");
1602    VM.sysWrite("ssa_splitblock_for_local_live          When leaving SSA create blocks for local liveness\n");
1603    VM.sysWrite("ssa_splitblock_into_infrequent         When leaving SSA create blocks to avoid adding code to frequently executed blocks\n");
1604    VM.sysWrite("reorder_code                   0       Reorder basic blocks for improved locality and branch prediction\n");
1605    VM.sysWrite("reorder_code_ph                1       Reorder basic blocks using Pettis and Hansen Algo2\n");
1606    VM.sysWrite("h2l_inline_new                 0       Inline allocation of scalars and arrays\n");
1607    VM.sysWrite("h2l_inline_write_barrier       1       Inline write barriers for generational collectors\n");
1608    VM.sysWrite("h2l_inline_primitive_write_barrier 1       Inline primitive write barriers for certain collectors\n");
1609    VM.sysWrite("h2l_no_callee_exceptions               Assert that any callee of this compiled method will not throw exceptions. Cannot be properly set on command line.\n");
1610    VM.sysWrite("h2l_call_via_jtoc                      Plant virtual calls via the JTOC rather than from the tib of anobject when possible\n");
1611    VM.sysWrite("l2m_handler_liveness           2       Store liveness for handlers to improve dependence graph at PEIs\n");
1612    VM.sysWrite("regalloc_coalesce_moves        0       Attempt to coalesce to eliminate register moves?\n");
1613    VM.sysWrite("regalloc_coalesce_spills       0       Attempt to coalesce stack locations?\n");
1614    VM.sysWrite("adaptive_instrumentation_sampling         Perform code transformation to sample instrumentation code.\n");
1615    VM.sysWrite("adaptive_no_duplication                When performing inst. sampling, should it be done without duplicating code?\n");
1616    VM.sysWrite("adaptive_processor_specific_counter         Should there be one CBS counter per processor for SMP performance?\n");
1617    VM.sysWrite("adaptive_remove_yp_from_checking         Should yieldpoints be removed from the checking code (requires finite sample interval)\n");
1618    VM.sysWrite("osr_guarded_inlining           1       Insert OSR point at off branch of guarded inlining?\n");
1619    VM.sysWrite("osr_inline_policy              1       Use OSR knowledge to drive more aggressive inlining?\n");
1620    VM.sysWrite("print_static_stats                     Print out compile-time statistics for basic blocks?\n");
1621    VM.sysWrite("print_phases                           Print short message for each compilation phase\n");
1622    VM.sysWrite("print_all_ir                           Dump the IR after each compiler phase\n");
1623    VM.sysWrite("print_detailed_inline_report           Print detailed report of compile-time inlining decisions\n");
1624    VM.sysWrite("print_inline_report                    Print detailed report of compile-time inlining decisions\n");
1625    VM.sysWrite("print_dom                              Print dominators\n");
1626    VM.sysWrite("print_pdom                             Print post-dominators\n");
1627    VM.sysWrite("print_ssa                              Print SSA form\n");
1628    VM.sysWrite("print_dg_burs                          Print dependence graph before burs\n");
1629    VM.sysWrite("print_visualization                    When dumping the IR, generate a visualization in a file instead\n");
1630    VM.sysWrite("print_high                             Print IR after initial generation\n");
1631    VM.sysWrite("print_final_hir                        Print IR just before conversion to LIR\n");
1632    VM.sysWrite("print_low                              Print IR after conversion to LIR\n");
1633    VM.sysWrite("print_final_lir                        Print IR just before conversion to MIR\n");
1634    VM.sysWrite("print_mir                              Print IR after conversion to MIR\n");
1635    VM.sysWrite("print_final_mir                        Print IR just before conversion to machine code\n");
1636    VM.sysWrite("print_cfg                              Print control flow graph too when IR is printed\n");
1637    VM.sysWrite("print_regalloc                         Print IR before and after register allocation\n");
1638    VM.sysWrite("print_calling_conventions              Print IR after expanding calling conventions\n");
1639    VM.sysWrite("print_gc_maps                          Print the garbage collection maps\n");
1640    VM.sysWrite("debug_cgd                              Enable debugging support for final assembly\n");
1641    VM.sysWrite("debug_instru_sampling                  Enable debugging statements for instrumentation sampling\n");
1642    VM.sysWrite("debug_instru_sampling_detail           Enable detailed debugging statements for instrumentation sampling\n");
1643    VM.sysWrite("debug_gcp                              Perform noisy global code placement\n");
1644    VM.sysWrite("verbose                                Print method name at start of compilation\n");
1645    VM.sysWrite("mc                                     Print final machine code\n");
1646    VM.sysWrite("\nValue Options ("+prefix+"<option>=<value>)\n");
1647    VM.sysWrite("Option                         Type    Description\n");
1648    VM.sysWrite("print_ir_level                 int     Only print IR compiled above this level\n");
1649    VM.sysWrite("visualize_ir_directory         String  If visualization is enabled, the directory to write visualization files to\n");
1650    VM.sysWrite("profile_edge_count_input_file  String  Input file of edge counter profile data\n");
1651    VM.sysWrite("profile_infrequent_threshold   float   Cumulative threshold which defines the set of infrequent basic blocks\n");
1652    VM.sysWrite("profile_cbs_hotness            double  Threshold at which a conditional branch is considered to be skewed\n");
1653    VM.sysWrite("escape_max_array_size          int     Maximum size of array to replaced with registers by simple escape analysis\n");
1654    VM.sysWrite("ssa_load_elimination_rounds    int     How many rounds of redundant load elimination will we attempt?\n");
1655    VM.sysWrite("l2m_max_block_size             int     Maximum size of block for BURS in real instructions, larger blocks are split.\n");
1656    VM.sysWrite("regalloc_simple_spill_cost_move_factor double  spill penalty for move instructions\n");
1657    VM.sysWrite("regalloc_simple_spill_cost_memory_operand_factor double  spill penalty for registers used in memory operands\n");
1658    VM.sysWrite("control_tableswitch_cutoff     int     If a tableswitch comprises this many or fewer comparisons convert it into multiple if-then-else style branches\n");
1659    VM.sysWrite("control_cond_move_cutoff       int     How many extra instructions will we insert in order to remove a conditional branch?\n");
1660    VM.sysWrite("control_unroll_log             int     Unroll loops. Duplicates the loop body 2^n times.\n");
1661    VM.sysWrite("control_static_splitting_max_cost int     Upper bound on the number of instructions duplicated per block when trying to create hot traces with static splitting\n");
1662    VM.sysWrite("control_well_predicted_cutoff  double  Don't replace branches with conditional moves if they are outside of the range of 0.5 +- this value\n");
1663    VM.sysWrite("inline_max_target_size         int     Static inlining heuristic: Upper bound on callee size\n");
1664    VM.sysWrite("inline_max_inline_depth        int     Static inlining heuristic: Upper bound on depth of inlining\n");
1665    VM.sysWrite("inline_max_always_inline_target_size int     Static inlining heuristic: Always inline callees of this size or smaller\n");
1666    VM.sysWrite("inline_massive_method_size     int     Static inlining heuristic: If root method is already this big, then only inline trivial methods\n");
1667    VM.sysWrite("inline_max_arg_bonus           double  Maximum bonus for reducing the perceived size of a method during inlining.\n");
1668    VM.sysWrite("inline_precise_reg_array_arg_bonus double  Bonus given to inlining methods that are passed a register of a known precise type.\n");
1669    VM.sysWrite("inline_declared_aastored_array_arg_bonus double  Bonus given when there's potential to optimize checkstore portion of aastore bytecode on parameter\n");
1670    VM.sysWrite("inline_precise_reg_class_arg_bonus double  Bonus given to inlining methods that are passed a register of a known precise type.\n");
1671    VM.sysWrite("inline_extant_reg_class_arg_bonus double  Bonus given to inlining methods that are passed a register that's known not to be null.\n");
1672    VM.sysWrite("inline_int_const_arg_bonus     double  Bonus given to inlining methods that are passed an int constant argument\n");
1673    VM.sysWrite("inline_null_const_arg_bonus    double  Bonus given to inlining methods that are passed a null constant argument\n");
1674    VM.sysWrite("inline_object_const_arg_bonus  double  Bonus given to inlining methods that are passed an object constant argument\n");
1675    VM.sysWrite("inline_call_depth_cost         double  As we inline deeper nested methods what cost (or bonus) do we wish to give to deter (or encourage) nesting of deeper methods?\n");
1676    VM.sysWrite("inline_ai_max_target_size      int     Adaptive inlining heuristic: Upper bound on callee size\n");
1677    VM.sysWrite("inline_ai_min_callsite_fraction double  Adaptive inlining heuristc: Minimum fraction of callsite distribution for guarded inlining of a callee\n");
1678    VM.sysWrite("\nSelection Options (set option to one of an enumeration of possible values)\n");
1679    VM.sysWrite("\t\tHow to compute block and edge frequencies?\n");
1680    VM.sysWrite("profile_frequency_strategy    ");
1681    VM.sysWrite("counters ");
1682    VM.sysWrite("static ");
1683    VM.sysWrite("dumb ");
1684    VM.sysWrite("inverse ");
1685    VM.sysWrite("\n");
1686    VM.sysWrite("\t\tSelection of spilling heuristic\n");
1687    VM.sysWrite("regalloc_spill_cost_estimate  ");
1688    VM.sysWrite("simple ");
1689    VM.sysWrite("brainDead ");
1690    VM.sysWrite("blockCount ");
1691    VM.sysWrite("\n");
1692    VM.sysWrite("\t\tSelection of guard mechanism for inlined virtual calls that cannot be statically bound\n");
1693    VM.sysWrite("inline_guard_kind             ");
1694    VM.sysWrite("inline_guard_method_test ");
1695    VM.sysWrite("inline_guard_class_test ");
1696    VM.sysWrite("inline_guard_code_patch ");
1697    VM.sysWrite("\n");
1698    VM.sysWrite("\nSet Options (option is a set of values)\n");
1699    VM.sysWrite("driver_exclude                 Exclude methods from being opt compiled\n");
1700    VM.sysWrite("method_to_print                Only apply print options against methods whose name contains this string\n");
1701    instancePrintHelpFooter(prefix);
1702
1703    VM.sysExit(EXIT_STATUS_PRINTED_HELP_MESSAGE);
1704  }
1705
1706  /** @return a String representing the options values */
1707  @Override
1708  @org.vmmagic.pragma.NoOptCompile
1709  public String toString() {
1710    StringBuilder result = new StringBuilder();
1711
1712    // Begin generated option value printing
1713    result.append("\tfocus_effort                   = ").append(FREQ_FOCUS_EFFORT).append("\n");
1714    result.append("\treads_kill                     = ").append(READS_KILL).append("\n");
1715    result.append("\tfield_analysis                 = ").append(FIELD_ANALYSIS).append("\n");
1716    result.append("\tinline                         = ").append(INLINE).append("\n");
1717    result.append("\tinline_guarded                 = ").append(INLINE_GUARDED).append("\n");
1718    result.append("\tinline_guarded_interfaces      = ").append(INLINE_GUARDED_INTERFACES).append("\n");
1719    result.append("\tinline_preex                   = ").append(INLINE_PREEX).append("\n");
1720    result.append("\tsimplify_integer_ops           = ").append(SIMPLIFY_INTEGER_OPS).append("\n");
1721    result.append("\tsimplify_long_ops              = ").append(SIMPLIFY_LONG_OPS).append("\n");
1722    result.append("\tsimplify_float_ops             = ").append(SIMPLIFY_FLOAT_OPS).append("\n");
1723    result.append("\tsimplify_double_ops            = ").append(SIMPLIFY_DOUBLE_OPS).append("\n");
1724    result.append("\tsimplify_ref_ops               = ").append(SIMPLIFY_REF_OPS).append("\n");
1725    result.append("\tsimplify_tib_ops               = ").append(SIMPLIFY_TIB_OPS).append("\n");
1726    result.append("\tsimplify_field_ops             = ").append(SIMPLIFY_FIELD_OPS).append("\n");
1727    result.append("\tsimplify_chase_final_fields    = ").append(SIMPLIFY_CHASE_FINAL_FIELDS).append("\n");
1728    result.append("\tlocal_constant_prop            = ").append(LOCAL_CONSTANT_PROP).append("\n");
1729    result.append("\tlocal_copy_prop                = ").append(LOCAL_COPY_PROP).append("\n");
1730    result.append("\tlocal_cse                      = ").append(LOCAL_CSE).append("\n");
1731    result.append("\tlocal_expression_folding       = ").append(LOCAL_EXPRESSION_FOLDING).append("\n");
1732    result.append("\tcontrol_static_splitting       = ").append(CONTROL_STATIC_SPLITTING).append("\n");
1733    result.append("\tcontrol_unwhile                = ").append(CONTROL_TURN_WHILES_INTO_UNTILS).append("\n");
1734    result.append("\tescape_simple_ipa              = ").append(ESCAPE_SIMPLE_IPA).append("\n");
1735    result.append("\tescape_scalar_replace_aggregates = ").append(ESCAPE_SCALAR_REPLACE_AGGREGATES).append("\n");
1736    result.append("\tescape_monitor_removal         = ").append(ESCAPE_MONITOR_REMOVAL).append("\n");
1737    result.append("\tescape_invokee_thread_local    = ").append(ESCAPE_INVOKEE_THREAD_LOCAL).append("\n");
1738    result.append("\tssa                            = ").append(SSA).append("\n");
1739    result.append("\tssa_expression_folding         = ").append(SSA_EXPRESSION_FOLDING).append("\n");
1740    result.append("\tssa_redundant_branch_elimination = ").append(SSA_REDUNDANT_BRANCH_ELIMINATION).append("\n");
1741    result.append("\tssa_licm_ignore_pei            = ").append(SSA_LICM_IGNORE_PEI).append("\n");
1742    result.append("\tssa_load_elimination           = ").append(SSA_LOAD_ELIMINATION).append("\n");
1743    result.append("\tssa_coalesce_after             = ").append(SSA_COALESCE_AFTER).append("\n");
1744    result.append("\tssa_loop_versioning            = ").append(SSA_LOOP_VERSIONING).append("\n");
1745    result.append("\tssa_live_range_splitting       = ").append(SSA_LIVE_RANGE_SPLITTING).append("\n");
1746    result.append("\tssa_gcp                        = ").append(SSA_GCP).append("\n");
1747    result.append("\tssa_gcse                       = ").append(SSA_GCSE).append("\n");
1748    result.append("\tssa_splitblock_to_avoid_rename = ").append(SSA_SPLITBLOCK_TO_AVOID_RENAME).append("\n");
1749    result.append("\tssa_splitblock_for_local_live  = ").append(SSA_SPLITBLOCK_FOR_LOCAL_LIVE).append("\n");
1750    result.append("\tssa_splitblock_into_infrequent = ").append(SSA_SPLITBLOCK_INTO_INFREQUENT).append("\n");
1751    result.append("\treorder_code                   = ").append(REORDER_CODE).append("\n");
1752    result.append("\treorder_code_ph                = ").append(REORDER_CODE_PH).append("\n");
1753    result.append("\th2l_inline_new                 = ").append(H2L_INLINE_NEW).append("\n");
1754    result.append("\th2l_inline_write_barrier       = ").append(H2L_INLINE_WRITE_BARRIER).append("\n");
1755    result.append("\th2l_inline_primitive_write_barrier = ").append(H2L_INLINE_PRIMITIVE_WRITE_BARRIER).append("\n");
1756    result.append("\th2l_no_callee_exceptions       = ").append(H2L_NO_CALLEE_EXCEPTIONS).append("\n");
1757    result.append("\th2l_call_via_jtoc              = ").append(H2L_CALL_VIA_JTOC).append("\n");
1758    result.append("\tl2m_handler_liveness           = ").append(L2M_HANDLER_LIVENESS).append("\n");
1759    result.append("\tregalloc_coalesce_moves        = ").append(REGALLOC_COALESCE_MOVES).append("\n");
1760    result.append("\tregalloc_coalesce_spills       = ").append(REGALLOC_COALESCE_SPILLS).append("\n");
1761    result.append("\tadaptive_instrumentation_sampling = ").append(ADAPTIVE_INSTRUMENTATION_SAMPLING).append("\n");
1762    result.append("\tadaptive_no_duplication        = ").append(ADAPTIVE_NO_DUPLICATION).append("\n");
1763    result.append("\tadaptive_processor_specific_counter = ").append(ADAPTIVE_PROCESSOR_SPECIFIC_COUNTER).append("\n");
1764    result.append("\tadaptive_remove_yp_from_checking = ").append(ADAPTIVE_REMOVE_YP_FROM_CHECKING).append("\n");
1765    result.append("\tosr_guarded_inlining           = ").append(OSR_GUARDED_INLINING).append("\n");
1766    result.append("\tosr_inline_policy              = ").append(OSR_INLINE_POLICY).append("\n");
1767    result.append("\tprint_static_stats             = ").append(PRINT_STATIC_STATS).append("\n");
1768    result.append("\tprint_phases                   = ").append(PRINT_PHASES).append("\n");
1769    result.append("\tprint_all_ir                   = ").append(PRINT_ALL_IR).append("\n");
1770    result.append("\tprint_detailed_inline_report   = ").append(PRINT_DETAILED_INLINE_REPORT).append("\n");
1771    result.append("\tprint_inline_report            = ").append(PRINT_INLINE_REPORT).append("\n");
1772    result.append("\tprint_dom                      = ").append(PRINT_DOMINATORS).append("\n");
1773    result.append("\tprint_pdom                     = ").append(PRINT_POST_DOMINATORS).append("\n");
1774    result.append("\tprint_ssa                      = ").append(PRINT_SSA).append("\n");
1775    result.append("\tprint_dg_burs                  = ").append(PRINT_DG_BURS).append("\n");
1776    result.append("\tprint_visualization            = ").append(PRINT_VISUALIZATION).append("\n");
1777    result.append("\tprint_high                     = ").append(PRINT_HIGH).append("\n");
1778    result.append("\tprint_final_hir                = ").append(PRINT_FINAL_HIR).append("\n");
1779    result.append("\tprint_low                      = ").append(PRINT_LOW).append("\n");
1780    result.append("\tprint_final_lir                = ").append(PRINT_FINAL_LIR).append("\n");
1781    result.append("\tprint_mir                      = ").append(PRINT_MIR).append("\n");
1782    result.append("\tprint_final_mir                = ").append(PRINT_FINAL_MIR).append("\n");
1783    result.append("\tprint_cfg                      = ").append(PRINT_CFG).append("\n");
1784    result.append("\tprint_regalloc                 = ").append(PRINT_REGALLOC).append("\n");
1785    result.append("\tprint_calling_conventions      = ").append(PRINT_CALLING_CONVENTIONS).append("\n");
1786    result.append("\tprint_gc_maps                  = ").append(PRINT_GC_MAPS).append("\n");
1787    result.append("\tdebug_cgd                      = ").append(DEBUG_CODEGEN).append("\n");
1788    result.append("\tdebug_instru_sampling          = ").append(DEBUG_INSTRU_SAMPLING).append("\n");
1789    result.append("\tdebug_instru_sampling_detail   = ").append(DEBUG_INSTRU_SAMPLING_DETAIL).append("\n");
1790    result.append("\tdebug_gcp                      = ").append(DEBUG_GCP).append("\n");
1791    result.append("\tverbose                        = ").append(PRINT_METHOD).append("\n");
1792    result.append("\tmc                             = ").append(PRINT_MACHINECODE).append("\n");
1793    result.append("\tprint_ir_level                 = ").append(PRINT_IR_LEVEL).append("\n");
1794    result.append("\tvisualize_ir_directory         = ").append(VISUALIZE_IR_DIRECTORY).append("\n");
1795    result.append("\tprofile_edge_count_input_file  = ").append(PROFILE_EDGE_COUNT_INPUT_FILE).append("\n");
1796    result.append("\tprofile_infrequent_threshold   = ").append(PROFILE_INFREQUENT_THRESHOLD).append("\n");
1797    result.append("\tprofile_cbs_hotness            = ").append(PROFILE_CBS_HOTNESS).append("\n");
1798    result.append("\tescape_max_array_size          = ").append(ESCAPE_MAX_ARRAY_SIZE).append("\n");
1799    result.append("\tssa_load_elimination_rounds    = ").append(SSA_LOAD_ELIMINATION_ROUNDS).append("\n");
1800    result.append("\tl2m_max_block_size             = ").append(L2M_MAX_BLOCK_SIZE).append("\n");
1801    result.append("\tregalloc_simple_spill_cost_move_factor = ").append(REGALLOC_SIMPLE_SPILL_COST_MOVE_FACTOR).append("\n");
1802    result.append("\tregalloc_simple_spill_cost_memory_operand_factor = ").append(REGALLOC_SIMPLE_SPILL_COST_MEMORY_OPERAND_FACTOR).append("\n");
1803    result.append("\tcontrol_tableswitch_cutoff     = ").append(CONTROL_TABLESWITCH_CUTOFF).append("\n");
1804    result.append("\tcontrol_cond_move_cutoff       = ").append(CONTROL_COND_MOVE_CUTOFF).append("\n");
1805    result.append("\tcontrol_unroll_log             = ").append(CONTROL_UNROLL_LOG).append("\n");
1806    result.append("\tcontrol_static_splitting_max_cost = ").append(CONTROL_STATIC_SPLITTING_MAX_COST).append("\n");
1807    result.append("\tcontrol_well_predicted_cutoff  = ").append(CONTROL_WELL_PREDICTED_CUTOFF).append("\n");
1808    result.append("\tinline_max_target_size         = ").append(INLINE_MAX_TARGET_SIZE).append("\n");
1809    result.append("\tinline_max_inline_depth        = ").append(INLINE_MAX_INLINE_DEPTH).append("\n");
1810    result.append("\tinline_max_always_inline_target_size = ").append(INLINE_MAX_ALWAYS_INLINE_TARGET_SIZE).append("\n");
1811    result.append("\tinline_massive_method_size     = ").append(INLINE_MASSIVE_METHOD_SIZE).append("\n");
1812    result.append("\tinline_max_arg_bonus           = ").append(INLINE_MAX_ARG_BONUS).append("\n");
1813    result.append("\tinline_precise_reg_array_arg_bonus = ").append(INLINE_PRECISE_REG_ARRAY_ARG_BONUS).append("\n");
1814    result.append("\tinline_declared_aastored_array_arg_bonus = ").append(INLINE_DECLARED_AASTORED_ARRAY_ARG_BONUS).append("\n");
1815    result.append("\tinline_precise_reg_class_arg_bonus = ").append(INLINE_PRECISE_REG_CLASS_ARG_BONUS).append("\n");
1816    result.append("\tinline_extant_reg_class_arg_bonus = ").append(INLINE_EXTANT_REG_CLASS_ARG_BONUS).append("\n");
1817    result.append("\tinline_int_const_arg_bonus     = ").append(INLINE_INT_CONST_ARG_BONUS).append("\n");
1818    result.append("\tinline_null_const_arg_bonus    = ").append(INLINE_NULL_CONST_ARG_BONUS).append("\n");
1819    result.append("\tinline_object_const_arg_bonus  = ").append(INLINE_OBJECT_CONST_ARG_BONUS).append("\n");
1820    result.append("\tinline_call_depth_cost         = ").append(INLINE_CALL_DEPTH_COST).append("\n");
1821    result.append("\tinline_ai_max_target_size      = ").append(INLINE_AI_MAX_TARGET_SIZE).append("\n");
1822    result.append("\tinline_ai_min_callsite_fraction = ").append(INLINE_AI_MIN_CALLSITE_FRACTION).append("\n");
1823    if (PROFILE_FREQUENCY_STRATEGY == PROFILE_COUNTERS_FREQ)
1824       result.append("\tprofile_frequency_strategy     = PROFILE_COUNTERS_FREQ\n");
1825    if (PROFILE_FREQUENCY_STRATEGY == PROFILE_STATIC_FREQ)
1826       result.append("\tprofile_frequency_strategy     = PROFILE_STATIC_FREQ\n");
1827    if (PROFILE_FREQUENCY_STRATEGY == PROFILE_DUMB_FREQ)
1828       result.append("\tprofile_frequency_strategy     = PROFILE_DUMB_FREQ\n");
1829    if (PROFILE_FREQUENCY_STRATEGY == PROFILE_INVERSE_COUNTERS_FREQ)
1830       result.append("\tprofile_frequency_strategy     = PROFILE_INVERSE_COUNTERS_FREQ\n");
1831    if (REGALLOC_SPILL_COST_ESTIMATE == REGALLOC_SIMPLE_SPILL_COST)
1832       result.append("\tregalloc_spill_cost_estimate   = REGALLOC_SIMPLE_SPILL_COST\n");
1833    if (REGALLOC_SPILL_COST_ESTIMATE == REGALLOC_BRAINDEAD_SPILL_COST)
1834       result.append("\tregalloc_spill_cost_estimate   = REGALLOC_BRAINDEAD_SPILL_COST\n");
1835    if (REGALLOC_SPILL_COST_ESTIMATE == REGALLOC_BLOCK_COUNT_SPILL_COST)
1836       result.append("\tregalloc_spill_cost_estimate   = REGALLOC_BLOCK_COUNT_SPILL_COST\n");
1837    if (INLINE_GUARD_KIND == INLINE_GUARD_METHOD_TEST)
1838       result.append("\tinline_guard_kind              = INLINE_GUARD_METHOD_TEST\n");
1839    if (INLINE_GUARD_KIND == INLINE_GUARD_CLASS_TEST)
1840       result.append("\tinline_guard_kind              = INLINE_GUARD_CLASS_TEST\n");
1841    if (INLINE_GUARD_KIND == INLINE_GUARD_CODE_PATCH)
1842       result.append("\tinline_guard_kind              = INLINE_GUARD_CODE_PATCH\n");
1843    {
1844      String val = (DRIVER_EXCLUDE==null)?"[]":DRIVER_EXCLUDE.toString();
1845      result.append("\tdriver_exclude                 = ").append(val).append("\n");
1846    }
1847    {
1848      String val = (METHOD_TO_PRINT==null)?"[]":METHOD_TO_PRINT.toString();
1849      result.append("\tmethod_to_print                = ").append(val).append("\n");
1850    }
1851    return result.toString();
1852    //End generated toString()
1853  }
1854
1855  /** print a String value of this options object */
1856  @org.vmmagic.pragma.NoOptCompile
1857  public void printOptions() {
1858    printOptionsHeader();
1859
1860    // Begin generated option value printing
1861    VM.sysWriteln("\tfocus_effort                   = ",FREQ_FOCUS_EFFORT);
1862    VM.sysWriteln("\treads_kill                     = ",READS_KILL);
1863    VM.sysWriteln("\tfield_analysis                 = ",FIELD_ANALYSIS);
1864    VM.sysWriteln("\tinline                         = ",INLINE);
1865    VM.sysWriteln("\tinline_guarded                 = ",INLINE_GUARDED);
1866    VM.sysWriteln("\tinline_guarded_interfaces      = ",INLINE_GUARDED_INTERFACES);
1867    VM.sysWriteln("\tinline_preex                   = ",INLINE_PREEX);
1868    VM.sysWriteln("\tsimplify_integer_ops           = ",SIMPLIFY_INTEGER_OPS);
1869    VM.sysWriteln("\tsimplify_long_ops              = ",SIMPLIFY_LONG_OPS);
1870    VM.sysWriteln("\tsimplify_float_ops             = ",SIMPLIFY_FLOAT_OPS);
1871    VM.sysWriteln("\tsimplify_double_ops            = ",SIMPLIFY_DOUBLE_OPS);
1872    VM.sysWriteln("\tsimplify_ref_ops               = ",SIMPLIFY_REF_OPS);
1873    VM.sysWriteln("\tsimplify_tib_ops               = ",SIMPLIFY_TIB_OPS);
1874    VM.sysWriteln("\tsimplify_field_ops             = ",SIMPLIFY_FIELD_OPS);
1875    VM.sysWriteln("\tsimplify_chase_final_fields    = ",SIMPLIFY_CHASE_FINAL_FIELDS);
1876    VM.sysWriteln("\tlocal_constant_prop            = ",LOCAL_CONSTANT_PROP);
1877    VM.sysWriteln("\tlocal_copy_prop                = ",LOCAL_COPY_PROP);
1878    VM.sysWriteln("\tlocal_cse                      = ",LOCAL_CSE);
1879    VM.sysWriteln("\tlocal_expression_folding       = ",LOCAL_EXPRESSION_FOLDING);
1880    VM.sysWriteln("\tcontrol_static_splitting       = ",CONTROL_STATIC_SPLITTING);
1881    VM.sysWriteln("\tcontrol_unwhile                = ",CONTROL_TURN_WHILES_INTO_UNTILS);
1882    VM.sysWriteln("\tescape_simple_ipa              = ",ESCAPE_SIMPLE_IPA);
1883    VM.sysWriteln("\tescape_scalar_replace_aggregates = ",ESCAPE_SCALAR_REPLACE_AGGREGATES);
1884    VM.sysWriteln("\tescape_monitor_removal         = ",ESCAPE_MONITOR_REMOVAL);
1885    VM.sysWriteln("\tescape_invokee_thread_local    = ",ESCAPE_INVOKEE_THREAD_LOCAL);
1886    VM.sysWriteln("\tssa                            = ",SSA);
1887    VM.sysWriteln("\tssa_expression_folding         = ",SSA_EXPRESSION_FOLDING);
1888    VM.sysWriteln("\tssa_redundant_branch_elimination = ",SSA_REDUNDANT_BRANCH_ELIMINATION);
1889    VM.sysWriteln("\tssa_licm_ignore_pei            = ",SSA_LICM_IGNORE_PEI);
1890    VM.sysWriteln("\tssa_load_elimination           = ",SSA_LOAD_ELIMINATION);
1891    VM.sysWriteln("\tssa_coalesce_after             = ",SSA_COALESCE_AFTER);
1892    VM.sysWriteln("\tssa_loop_versioning            = ",SSA_LOOP_VERSIONING);
1893    VM.sysWriteln("\tssa_live_range_splitting       = ",SSA_LIVE_RANGE_SPLITTING);
1894    VM.sysWriteln("\tssa_gcp                        = ",SSA_GCP);
1895    VM.sysWriteln("\tssa_gcse                       = ",SSA_GCSE);
1896    VM.sysWriteln("\tssa_splitblock_to_avoid_rename = ",SSA_SPLITBLOCK_TO_AVOID_RENAME);
1897    VM.sysWriteln("\tssa_splitblock_for_local_live  = ",SSA_SPLITBLOCK_FOR_LOCAL_LIVE);
1898    VM.sysWriteln("\tssa_splitblock_into_infrequent = ",SSA_SPLITBLOCK_INTO_INFREQUENT);
1899    VM.sysWriteln("\treorder_code                   = ",REORDER_CODE);
1900    VM.sysWriteln("\treorder_code_ph                = ",REORDER_CODE_PH);
1901    VM.sysWriteln("\th2l_inline_new                 = ",H2L_INLINE_NEW);
1902    VM.sysWriteln("\th2l_inline_write_barrier       = ",H2L_INLINE_WRITE_BARRIER);
1903    VM.sysWriteln("\th2l_inline_primitive_write_barrier = ",H2L_INLINE_PRIMITIVE_WRITE_BARRIER);
1904    VM.sysWriteln("\th2l_no_callee_exceptions       = ",H2L_NO_CALLEE_EXCEPTIONS);
1905    VM.sysWriteln("\th2l_call_via_jtoc              = ",H2L_CALL_VIA_JTOC);
1906    VM.sysWriteln("\tl2m_handler_liveness           = ",L2M_HANDLER_LIVENESS);
1907    VM.sysWriteln("\tregalloc_coalesce_moves        = ",REGALLOC_COALESCE_MOVES);
1908    VM.sysWriteln("\tregalloc_coalesce_spills       = ",REGALLOC_COALESCE_SPILLS);
1909    VM.sysWriteln("\tadaptive_instrumentation_sampling = ",ADAPTIVE_INSTRUMENTATION_SAMPLING);
1910    VM.sysWriteln("\tadaptive_no_duplication        = ",ADAPTIVE_NO_DUPLICATION);
1911    VM.sysWriteln("\tadaptive_processor_specific_counter = ",ADAPTIVE_PROCESSOR_SPECIFIC_COUNTER);
1912    VM.sysWriteln("\tadaptive_remove_yp_from_checking = ",ADAPTIVE_REMOVE_YP_FROM_CHECKING);
1913    VM.sysWriteln("\tosr_guarded_inlining           = ",OSR_GUARDED_INLINING);
1914    VM.sysWriteln("\tosr_inline_policy              = ",OSR_INLINE_POLICY);
1915    VM.sysWriteln("\tprint_static_stats             = ",PRINT_STATIC_STATS);
1916    VM.sysWriteln("\tprint_phases                   = ",PRINT_PHASES);
1917    VM.sysWriteln("\tprint_all_ir                   = ",PRINT_ALL_IR);
1918    VM.sysWriteln("\tprint_detailed_inline_report   = ",PRINT_DETAILED_INLINE_REPORT);
1919    VM.sysWriteln("\tprint_inline_report            = ",PRINT_INLINE_REPORT);
1920    VM.sysWriteln("\tprint_dom                      = ",PRINT_DOMINATORS);
1921    VM.sysWriteln("\tprint_pdom                     = ",PRINT_POST_DOMINATORS);
1922    VM.sysWriteln("\tprint_ssa                      = ",PRINT_SSA);
1923    VM.sysWriteln("\tprint_dg_burs                  = ",PRINT_DG_BURS);
1924    VM.sysWriteln("\tprint_visualization            = ",PRINT_VISUALIZATION);
1925    VM.sysWriteln("\tprint_high                     = ",PRINT_HIGH);
1926    VM.sysWriteln("\tprint_final_hir                = ",PRINT_FINAL_HIR);
1927    VM.sysWriteln("\tprint_low                      = ",PRINT_LOW);
1928    VM.sysWriteln("\tprint_final_lir                = ",PRINT_FINAL_LIR);
1929    VM.sysWriteln("\tprint_mir                      = ",PRINT_MIR);
1930    VM.sysWriteln("\tprint_final_mir                = ",PRINT_FINAL_MIR);
1931    VM.sysWriteln("\tprint_cfg                      = ",PRINT_CFG);
1932    VM.sysWriteln("\tprint_regalloc                 = ",PRINT_REGALLOC);
1933    VM.sysWriteln("\tprint_calling_conventions      = ",PRINT_CALLING_CONVENTIONS);
1934    VM.sysWriteln("\tprint_gc_maps                  = ",PRINT_GC_MAPS);
1935    VM.sysWriteln("\tdebug_cgd                      = ",DEBUG_CODEGEN);
1936    VM.sysWriteln("\tdebug_instru_sampling          = ",DEBUG_INSTRU_SAMPLING);
1937    VM.sysWriteln("\tdebug_instru_sampling_detail   = ",DEBUG_INSTRU_SAMPLING_DETAIL);
1938    VM.sysWriteln("\tdebug_gcp                      = ",DEBUG_GCP);
1939    VM.sysWriteln("\tverbose                        = ",PRINT_METHOD);
1940    VM.sysWriteln("\tmc                             = ",PRINT_MACHINECODE);
1941    VM.sysWriteln("\tprint_ir_level                 = ",PRINT_IR_LEVEL);
1942    VM.sysWriteln("\tvisualize_ir_directory         = ",VISUALIZE_IR_DIRECTORY);
1943    VM.sysWriteln("\tprofile_edge_count_input_file  = ",PROFILE_EDGE_COUNT_INPUT_FILE);
1944    VM.sysWriteln("\tprofile_infrequent_threshold   = ",PROFILE_INFREQUENT_THRESHOLD);
1945    VM.sysWriteln("\tprofile_cbs_hotness            = ",PROFILE_CBS_HOTNESS);
1946    VM.sysWriteln("\tescape_max_array_size          = ",ESCAPE_MAX_ARRAY_SIZE);
1947    VM.sysWriteln("\tssa_load_elimination_rounds    = ",SSA_LOAD_ELIMINATION_ROUNDS);
1948    VM.sysWriteln("\tl2m_max_block_size             = ",L2M_MAX_BLOCK_SIZE);
1949    VM.sysWriteln("\tregalloc_simple_spill_cost_move_factor = ",REGALLOC_SIMPLE_SPILL_COST_MOVE_FACTOR);
1950    VM.sysWriteln("\tregalloc_simple_spill_cost_memory_operand_factor = ",REGALLOC_SIMPLE_SPILL_COST_MEMORY_OPERAND_FACTOR);
1951    VM.sysWriteln("\tcontrol_tableswitch_cutoff     = ",CONTROL_TABLESWITCH_CUTOFF);
1952    VM.sysWriteln("\tcontrol_cond_move_cutoff       = ",CONTROL_COND_MOVE_CUTOFF);
1953    VM.sysWriteln("\tcontrol_unroll_log             = ",CONTROL_UNROLL_LOG);
1954    VM.sysWriteln("\tcontrol_static_splitting_max_cost = ",CONTROL_STATIC_SPLITTING_MAX_COST);
1955    VM.sysWriteln("\tcontrol_well_predicted_cutoff  = ",CONTROL_WELL_PREDICTED_CUTOFF);
1956    VM.sysWriteln("\tinline_max_target_size         = ",INLINE_MAX_TARGET_SIZE);
1957    VM.sysWriteln("\tinline_max_inline_depth        = ",INLINE_MAX_INLINE_DEPTH);
1958    VM.sysWriteln("\tinline_max_always_inline_target_size = ",INLINE_MAX_ALWAYS_INLINE_TARGET_SIZE);
1959    VM.sysWriteln("\tinline_massive_method_size     = ",INLINE_MASSIVE_METHOD_SIZE);
1960    VM.sysWriteln("\tinline_max_arg_bonus           = ",INLINE_MAX_ARG_BONUS);
1961    VM.sysWriteln("\tinline_precise_reg_array_arg_bonus = ",INLINE_PRECISE_REG_ARRAY_ARG_BONUS);
1962    VM.sysWriteln("\tinline_declared_aastored_array_arg_bonus = ",INLINE_DECLARED_AASTORED_ARRAY_ARG_BONUS);
1963    VM.sysWriteln("\tinline_precise_reg_class_arg_bonus = ",INLINE_PRECISE_REG_CLASS_ARG_BONUS);
1964    VM.sysWriteln("\tinline_extant_reg_class_arg_bonus = ",INLINE_EXTANT_REG_CLASS_ARG_BONUS);
1965    VM.sysWriteln("\tinline_int_const_arg_bonus     = ",INLINE_INT_CONST_ARG_BONUS);
1966    VM.sysWriteln("\tinline_null_const_arg_bonus    = ",INLINE_NULL_CONST_ARG_BONUS);
1967    VM.sysWriteln("\tinline_object_const_arg_bonus  = ",INLINE_OBJECT_CONST_ARG_BONUS);
1968    VM.sysWriteln("\tinline_call_depth_cost         = ",INLINE_CALL_DEPTH_COST);
1969    VM.sysWriteln("\tinline_ai_max_target_size      = ",INLINE_AI_MAX_TARGET_SIZE);
1970    VM.sysWriteln("\tinline_ai_min_callsite_fraction = ",INLINE_AI_MIN_CALLSITE_FRACTION);
1971    if (PROFILE_FREQUENCY_STRATEGY == PROFILE_COUNTERS_FREQ)
1972       VM.sysWriteln("\tprofile_frequency_strategy     = PROFILE_COUNTERS_FREQ");
1973    if (PROFILE_FREQUENCY_STRATEGY == PROFILE_STATIC_FREQ)
1974       VM.sysWriteln("\tprofile_frequency_strategy     = PROFILE_STATIC_FREQ");
1975    if (PROFILE_FREQUENCY_STRATEGY == PROFILE_DUMB_FREQ)
1976       VM.sysWriteln("\tprofile_frequency_strategy     = PROFILE_DUMB_FREQ");
1977    if (PROFILE_FREQUENCY_STRATEGY == PROFILE_INVERSE_COUNTERS_FREQ)
1978       VM.sysWriteln("\tprofile_frequency_strategy     = PROFILE_INVERSE_COUNTERS_FREQ");
1979    if (REGALLOC_SPILL_COST_ESTIMATE == REGALLOC_SIMPLE_SPILL_COST)
1980       VM.sysWriteln("\tregalloc_spill_cost_estimate   = REGALLOC_SIMPLE_SPILL_COST");
1981    if (REGALLOC_SPILL_COST_ESTIMATE == REGALLOC_BRAINDEAD_SPILL_COST)
1982       VM.sysWriteln("\tregalloc_spill_cost_estimate   = REGALLOC_BRAINDEAD_SPILL_COST");
1983    if (REGALLOC_SPILL_COST_ESTIMATE == REGALLOC_BLOCK_COUNT_SPILL_COST)
1984       VM.sysWriteln("\tregalloc_spill_cost_estimate   = REGALLOC_BLOCK_COUNT_SPILL_COST");
1985    if (INLINE_GUARD_KIND == INLINE_GUARD_METHOD_TEST)
1986       VM.sysWriteln("\tinline_guard_kind              = INLINE_GUARD_METHOD_TEST");
1987    if (INLINE_GUARD_KIND == INLINE_GUARD_CLASS_TEST)
1988       VM.sysWriteln("\tinline_guard_kind              = INLINE_GUARD_CLASS_TEST");
1989    if (INLINE_GUARD_KIND == INLINE_GUARD_CODE_PATCH)
1990       VM.sysWriteln("\tinline_guard_kind              = INLINE_GUARD_CODE_PATCH");
1991    {
1992      String val = (DRIVER_EXCLUDE==null)?"[]":DRIVER_EXCLUDE.toString();
1993      VM.sysWriteln("\tdriver_exclude                 = ", val);
1994    }
1995    {
1996      String val = (METHOD_TO_PRINT==null)?"[]":METHOD_TO_PRINT.toString();
1997      VM.sysWriteln("\tmethod_to_print                = ", val);
1998    }
1999    //End generated option value printing
2000  }
2001// END CODE GENERATED FROM MasterOptions.template
2002
2003  private boolean instanceProcessAsOption(String arg) {
2004    if (arg.startsWith("O")) {
2005      try {
2006        setOptLevel(Integer.parseInt(arg.substring(1)));
2007      } catch (NumberFormatException e) {
2008        return false;
2009      }
2010      return true;
2011    }
2012    return false;
2013  }
2014
2015  private static void instancePrintHelpHeader(String prefix) {
2016    VM.sysWrite("Commands\n");
2017    VM.sysWrite(prefix+"[help]\t\t\tPrint brief description of opt compiler's command-line arguments\n");
2018    VM.sysWrite(prefix+"printOptions\t\tPrint the current values of opt compiler options\n");
2019    if (prefix.indexOf("irc")!=-1 || prefix.indexOf("bc")!=-1 || prefix.indexOf("eoc")!=-1) {
2020      VM.sysWrite(prefix+"O0\t\t\tSelect optimization level 0, minimal optimizations\n");
2021      VM.sysWrite(prefix+"O1\t\t\tSelect optimization level 1, modest optimizations\n");
2022      VM.sysWrite(prefix+"O2\t\t\tSelect optimization level 2\n");
2023    }
2024    VM.sysWrite("\n");
2025  }
2026
2027
2028  private static void instancePrintHelpFooter(String prefix) {
2029  }
2030
2031
2032  /**
2033   * Gets the current opt level.
2034   *
2035   * @return the current opt level
2036   */
2037  public int getOptLevel() {
2038    return OPTIMIZATION_LEVEL;
2039  }
2040
2041  /**
2042   * Set the options to encode the optimizations enabled at the given opt label
2043   * and disabled all optimizations that are not enabled at the given opt label
2044   *
2045   * @param level optimization level, must be at least 0
2046   */
2047  public void setOptLevel(int level) {
2048     OPTIMIZATION_LEVEL = level;
2049     // Begin generated opt-level logic
2050     if (level >= 0)
2051        FIELD_ANALYSIS = true;
2052     else
2053        FIELD_ANALYSIS = false;
2054     if (level >= 0)
2055        INLINE = true;
2056     else
2057        INLINE = false;
2058     if (level >= 0)
2059        INLINE_GUARDED = true;
2060     else
2061        INLINE_GUARDED = false;
2062     if (level >= 0)
2063        INLINE_GUARDED_INTERFACES = true;
2064     else
2065        INLINE_GUARDED_INTERFACES = false;
2066     if (level >= 0)
2067        INLINE_PREEX = true;
2068     else
2069        INLINE_PREEX = false;
2070     if (level >= 0)
2071        LOCAL_CONSTANT_PROP = true;
2072     else
2073        LOCAL_CONSTANT_PROP = false;
2074     if (level >= 0)
2075        LOCAL_COPY_PROP = true;
2076     else
2077        LOCAL_COPY_PROP = false;
2078     if (level >= 0)
2079        LOCAL_CSE = true;
2080     else
2081        LOCAL_CSE = false;
2082     if (level >= 3)
2083        LOCAL_EXPRESSION_FOLDING = true;
2084     else
2085        LOCAL_EXPRESSION_FOLDING = false;
2086     if (level >= 1)
2087        CONTROL_STATIC_SPLITTING = true;
2088     else
2089        CONTROL_STATIC_SPLITTING = false;
2090     if (level >= 3)
2091        CONTROL_TURN_WHILES_INTO_UNTILS = true;
2092     else
2093        CONTROL_TURN_WHILES_INTO_UNTILS = false;
2094     if (level >= 1)
2095        ESCAPE_SCALAR_REPLACE_AGGREGATES = true;
2096     else
2097        ESCAPE_SCALAR_REPLACE_AGGREGATES = false;
2098     if (level >= 1)
2099        ESCAPE_MONITOR_REMOVAL = true;
2100     else
2101        ESCAPE_MONITOR_REMOVAL = false;
2102     if (level >= 3)
2103        SSA = true;
2104     else
2105        SSA = false;
2106     if (level >= 3)
2107        SSA_EXPRESSION_FOLDING = true;
2108     else
2109        SSA_EXPRESSION_FOLDING = false;
2110     if (level >= 3)
2111        SSA_REDUNDANT_BRANCH_ELIMINATION = true;
2112     else
2113        SSA_REDUNDANT_BRANCH_ELIMINATION = false;
2114     if (level >= 3)
2115        SSA_LOAD_ELIMINATION = true;
2116     else
2117        SSA_LOAD_ELIMINATION = false;
2118     if (level >= 3)
2119        SSA_COALESCE_AFTER = true;
2120     else
2121        SSA_COALESCE_AFTER = false;
2122     if (level >= 3)
2123        SSA_GCP = true;
2124     else
2125        SSA_GCP = false;
2126     if (level >= 3)
2127        SSA_GCSE = true;
2128     else
2129        SSA_GCSE = false;
2130     if (level >= 0)
2131        REORDER_CODE = true;
2132     else
2133        REORDER_CODE = false;
2134     if (level >= 1)
2135        REORDER_CODE_PH = true;
2136     else
2137        REORDER_CODE_PH = false;
2138     if (level >= 0)
2139        H2L_INLINE_NEW = true;
2140     else
2141        H2L_INLINE_NEW = false;
2142     if (level >= 1)
2143        H2L_INLINE_WRITE_BARRIER = true;
2144     else
2145        H2L_INLINE_WRITE_BARRIER = false;
2146     if (level >= 1)
2147        H2L_INLINE_PRIMITIVE_WRITE_BARRIER = true;
2148     else
2149        H2L_INLINE_PRIMITIVE_WRITE_BARRIER = false;
2150     if (level >= 2)
2151        L2M_HANDLER_LIVENESS = true;
2152     else
2153        L2M_HANDLER_LIVENESS = false;
2154     if (level >= 0)
2155        REGALLOC_COALESCE_MOVES = true;
2156     else
2157        REGALLOC_COALESCE_MOVES = false;
2158     if (level >= 0)
2159        REGALLOC_COALESCE_SPILLS = true;
2160     else
2161        REGALLOC_COALESCE_SPILLS = false;
2162     if (level >= 1)
2163        OSR_GUARDED_INLINING = true;
2164     else
2165        OSR_GUARDED_INLINING = false;
2166     if (level >= 1)
2167        OSR_INLINE_POLICY = true;
2168     else
2169        OSR_INLINE_POLICY = false;
2170     // End generated opt-level logic
2171  }
2172}