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     */
013    package org.jikesrvm.adaptive.util;
014    
015    import org.jikesrvm.VM;
016    import org.jikesrvm.CommandLineArgs;
017    
018    /**
019     * Class to handle command-line arguments and options for the
020     * adaptive system.
021     * <p>
022     * Note: This file is mechanically generated from AOSOptions.template
023     *       and MasterOptions.template
024     * <p>
025     * Note: Boolean options are defined in /home/dgrove/rvm-trunk/rvm/src-generated/options/BooleanOptions.aos.dat
026     *       All other options are defined in /home/dgrove/rvm-trunk/rvm/src-generated/options/ValueOptions.aos.dat
027     *       (value, enumeration, bitmask)
028     *
029     **/
030    public class AOSExternalOptions implements Cloneable {
031    
032      private void printOptionsHeader() {
033        VM.sysWriteln("Current value of options:");
034      }
035    
036    // BEGIN CODE GENERATED FROM MasterOptions.template
037    /*
038     *  This file is part of the Jikes RVM project (http://jikesrvm.org).
039     *
040     *  This file is licensed to You under the Eclipse Public License (EPL);
041     *  You may not use this file except in compliance with the License. You
042     *  may obtain a copy of the License at
043     *
044     *      http://www.opensource.org/licenses/eclipse-1.0.php
045     *
046     *  See the COPYRIGHT.txt file distributed with this work for information
047     *  regarding copyright ownership.
048     */
049       // Begin template-specified options
050       /** Should the adaptive system recompile hot methods? */
051       public boolean ENABLE_RECOMPILATION          = true;
052       /** Do we need to generate advice files? */
053       public boolean ENABLE_ADVICE_GENERATION      = false;
054       /** Should the adaptive system be disabled, and methods given in the advice file compiled when BulkCompile.compileAllMethods() is called? */
055       public boolean ENABLE_BULK_COMPILE           = false;
056       /** Should bulk compilation be triggered before the user thread is started? */
057       public boolean ENABLE_PRECOMPILE             = false;
058       /** Should profile data be gathered and reported at the end of the run? */
059       public boolean GATHER_PROFILE_DATA           = false;
060       /** Should we use adaptive feedback-directed inlining? */
061       public boolean ADAPTIVE_INLINING             = true;
062       /** Should AOS exit when the controller clock reaches EARLY_EXIT_VALUE? */
063       public boolean EARLY_EXIT                    = false;
064       /** Should AOS promote baseline-compiled methods to opt? */
065       public boolean OSR_PROMOTION                 = true;
066       /** Should recompilation be done on a background thread or on next invocation? */
067       public boolean BACKGROUND_RECOMPILATION      = true;
068       /** Insert instrumentation in opt recompiled code to count yieldpoints executed? */
069       public boolean INSERT_YIELDPOINT_COUNTERS    = false;
070       /** Insert intrusive method counters in opt recompiled code? */
071       public boolean INSERT_METHOD_COUNTERS_OPT    = false;
072       /** Insert counters on all instructions in opt recompiled code? */
073       public boolean INSERT_INSTRUCTION_COUNTERS   = false;
074       /** Enable easy insertion of (debugging) counters in opt recompiled code. */
075       public boolean INSERT_DEBUGGING_COUNTERS     = false;
076       /** Report stats related to timer interrupts and AOS listeners on exit */
077       public boolean REPORT_INTERRUPT_STATS        = false;
078       /** Disable the ability for an app to request all methods to be recompiled */
079       public boolean DISABLE_RECOMPILE_ALL_METHODS = false;
080        /** How many timer ticks of method samples to take before reporting method hotness to controller */
081        public int METHOD_SAMPLE_SIZE                = 3;
082        /** Selection of initial compiler */
083        public byte INITIAL_COMPILER                 = IRC_BASE;
084        /** Selection of mechanism for identifying methods for optimizing recompilation */
085        public byte RECOMPILATION_STRATEGY           = RS_SAMPLING;
086        /** What triggers us to take a method sample? */
087        public byte METHOD_LISTENER_TRIGGER          = ML_TIMER;
088        /** What triggers us to take a method sample? */
089        public byte CALL_GRAPH_LISTENER_TRIGGER      = CGL_CBS;
090        /** Name of log file */
091        public String LOGFILE_NAME                   = "AOSLog.txt";
092        /** Name of advice file */
093        public String COMPILATION_ADVICE_FILE_OUTPUT = "aosadvice.ca";
094        /** Name of dynamic call graph file */
095        public String DYNAMIC_CALL_FILE_OUTPUT       = "aosadvice.dc";
096        /** Name of compiler DNA file (no name ==> use default DNA).  Discussed in a comment at the head of CompilerDNA.java */
097        public String COMPILER_DNA_FILE_NAME         = "";
098        /** File containing information about the methods to Opt compile */
099        public String COMPILER_ADVICE_FILE_INPUT     = null;
100        /** File containing information about the hot call sites */
101        public String DYNAMIC_CALL_FILE_INPUT        = null;
102        /** Control amount of verbosity for bulk compilation (larger ==> more) */
103        public int BULK_COMPILATION_VERBOSITY        = 0;
104        /** Control amount of event logging (larger ==> more) */
105        public int LOGGING_LEVEL                     = 0;
106        /** Control amount of info reported on exit (larger ==> more) */
107        public int FINAL_REPORT_LEVEL                = 0;
108        /** After how many clock ticks should we decay */
109        public int DECAY_FREQUENCY                   = 100;
110        /** What factor should we decay call graph edges hotness by */
111        public double DCG_DECAY_RATE                 = 1.1;
112        /** After how many timer interrupts do we update the weights in the dynamic call graph? */
113        public int DCG_SAMPLE_SIZE                   = 20;
114        /** Initial edge weight of call graph is set to AI_SEED_MULTIPLER * (1/AI_CONTROL_POINT) */
115        public double INLINE_AI_SEED_MULTIPLIER      = 3;
116        /** What percentage of the total weight of the dcg demarcates warm/hot edges  */
117        public double INLINE_AI_HOT_CALLSITE_THRESHOLD= 0.01;
118        /** Name of offline inline plan to be read and used for inlining */
119        public String OFFLINE_INLINE_PLAN_NAME       = "AI_plan";
120        /** Value of controller clock at which AOS should exit if EARLY_EXIT is true */
121        public int EARLY_EXIT_TIME                   = 1000;
122        /** Invocation count at which a baseline compiled method should be recompiled */
123        public int INVOCATION_COUNT_THRESHOLD        = 1000;
124        /** Opt level for recompilation in invocation count based system */
125        public int INVOCATION_COUNT_OPT_LEVEL        = 1;
126        /** What is the sample interval for counter-based sampling */
127        public int COUNTER_BASED_SAMPLE_INTERVAL     = 1000;
128        /** The maximum optimization level to enable. */
129        public int MAX_OPT_LEVEL                     = 2;
130       // End template-specified options
131    
132       // Begin generated support for "Enumeration" options
133       // INITIAL_COMPILER
134       public static final byte IRC_BASE = 0;
135       /**
136        * Is INITIAL_COMPILER set to IRC_BASE?
137        */
138       public final boolean baseIRC() {
139         return INITIAL_COMPILER == IRC_BASE;
140       }
141       public static final byte IRC_OPT = 1;
142       /**
143        * Is INITIAL_COMPILER set to IRC_OPT?
144        */
145       public final boolean optIRC() {
146         return INITIAL_COMPILER == IRC_OPT;
147       }
148    
149       // RECOMPILATION_STRATEGY
150       public static final byte RS_SAMPLING = 0;
151       /**
152        * Is RECOMPILATION_STRATEGY set to RS_SAMPLING?
153        */
154       public final boolean sampling() {
155         return RECOMPILATION_STRATEGY == RS_SAMPLING;
156       }
157       public static final byte RS_COUNTERS = 1;
158       /**
159        * Is RECOMPILATION_STRATEGY set to RS_COUNTERS?
160        */
161       public final boolean counters() {
162         return RECOMPILATION_STRATEGY == RS_COUNTERS;
163       }
164    
165       // METHOD_LISTENER_TRIGGER
166       public static final byte ML_TIMER = 0;
167       /**
168        * Is METHOD_LISTENER_TRIGGER set to ML_TIMER?
169        */
170       public final boolean mlTimer() {
171         return METHOD_LISTENER_TRIGGER == ML_TIMER;
172       }
173       public static final byte ML_CBS = 1;
174       /**
175        * Is METHOD_LISTENER_TRIGGER set to ML_CBS?
176        */
177       public final boolean mlCBS() {
178         return METHOD_LISTENER_TRIGGER == ML_CBS;
179       }
180    
181       // CALL_GRAPH_LISTENER_TRIGGER
182       public static final byte CGL_TIMER = 0;
183       /**
184        * Is CALL_GRAPH_LISTENER_TRIGGER set to CGL_TIMER?
185        */
186       public final boolean cgTimer() {
187         return CALL_GRAPH_LISTENER_TRIGGER == CGL_TIMER;
188       }
189       public static final byte CGL_CBS = 1;
190       /**
191        * Is CALL_GRAPH_LISTENER_TRIGGER set to CGL_CBS?
192        */
193       public final boolean cgCBS() {
194         return CALL_GRAPH_LISTENER_TRIGGER == CGL_CBS;
195       }
196    
197       // End generated support for "Enumeration" options
198    
199       // Begin generated support for "Set" options
200       // End generated support for "Set" options
201    
202       @Override
203       @SuppressWarnings("unchecked")
204       public Object clone() throws CloneNotSupportedException {
205         AOSExternalOptions clone = (AOSExternalOptions)super.clone();
206         return clone;
207       }
208    
209      public AOSExternalOptions dup() {
210        try {
211          return (AOSExternalOptions) clone();
212        }
213        catch (CloneNotSupportedException e) {
214          final InternalError error = new InternalError("Unexpected CloneNotSupportedException.");
215          error.initCause(e);
216          throw error;
217        }
218      }
219    
220      /**
221       * Take a string (most likely a command-line argument) and try to proccess it
222       * as an option command.  Return true if the string was understood, false
223       * otherwise.
224       *
225       * @param prefix a Sring to use as a command prefix when printing help.
226       * @param arg a String to try to process as an option command
227       * @return true if successful, false otherwise
228       */
229      @org.vmmagic.pragma.NoOptCompile
230      public boolean processAsOption(String prefix, String arg) {
231    
232        // First handle the "option commands"
233        if (arg.equals("help")) {
234           printHelp(prefix);
235           return true;
236        }
237        if (arg.equals("printOptions")) {
238           printOptions();
239           return true;
240        }
241        if (arg.length() == 0) {
242          printHelp(prefix);
243          return true;
244        }
245        // Make sure only process O? option if initial runtime compiler!
246        if ((prefix.indexOf("irc")!=-1 ||
247             prefix.indexOf("bc")!=-1 ||
248             prefix.indexOf("eoc")!=-1) &&
249            instanceProcessAsOption(arg)) {
250          return true;
251        }
252    
253        // Required format of arg is 'name=value'
254        // Split into 'name' and 'value' strings
255        int split = arg.indexOf('=');
256        if (split == -1) {
257          if (!(arg.equals("O0") || arg.equals("O1") || arg.equals("O2") || arg.equals("O3"))) {
258            VM.sysWrite("  Illegal option specification!\n  \""+arg+
259                          "\" must be specified as a name-value pair in the form of option=value\n");
260          }
261          return false;
262        }
263        String name = arg.substring(0,split);
264        String value = arg.substring(split+1);
265    
266        //Begin generated command-line processing
267        if (name.equals("enable_recompilation")) {
268          if (value.equals("true")) {
269            ENABLE_RECOMPILATION = true;
270            return true;
271          } else if (value.equals("false")) {
272            ENABLE_RECOMPILATION = false;
273            return true;
274          } else
275            return false;
276        }
277        if (name.equals("enable_advice_generation")) {
278          if (value.equals("true")) {
279            ENABLE_ADVICE_GENERATION = true;
280            return true;
281          } else if (value.equals("false")) {
282            ENABLE_ADVICE_GENERATION = false;
283            return true;
284          } else
285            return false;
286        }
287        if (name.equals("enable_bulk_compile")) {
288          if (value.equals("true")) {
289            ENABLE_BULK_COMPILE = true;
290            return true;
291          } else if (value.equals("false")) {
292            ENABLE_BULK_COMPILE = false;
293            return true;
294          } else
295            return false;
296        }
297        if (name.equals("enable_precompile")) {
298          if (value.equals("true")) {
299            ENABLE_PRECOMPILE = true;
300            return true;
301          } else if (value.equals("false")) {
302            ENABLE_PRECOMPILE = false;
303            return true;
304          } else
305            return false;
306        }
307        if (name.equals("gather_profile_data")) {
308          if (value.equals("true")) {
309            GATHER_PROFILE_DATA = true;
310            return true;
311          } else if (value.equals("false")) {
312            GATHER_PROFILE_DATA = false;
313            return true;
314          } else
315            return false;
316        }
317        if (name.equals("adaptive_inlining")) {
318          if (value.equals("true")) {
319            ADAPTIVE_INLINING = true;
320            return true;
321          } else if (value.equals("false")) {
322            ADAPTIVE_INLINING = false;
323            return true;
324          } else
325            return false;
326        }
327        if (name.equals("early_exit")) {
328          if (value.equals("true")) {
329            EARLY_EXIT = true;
330            return true;
331          } else if (value.equals("false")) {
332            EARLY_EXIT = false;
333            return true;
334          } else
335            return false;
336        }
337        if (name.equals("osr_promotion")) {
338          if (value.equals("true")) {
339            OSR_PROMOTION = true;
340            return true;
341          } else if (value.equals("false")) {
342            OSR_PROMOTION = false;
343            return true;
344          } else
345            return false;
346        }
347        if (name.equals("background_recompilation")) {
348          if (value.equals("true")) {
349            BACKGROUND_RECOMPILATION = true;
350            return true;
351          } else if (value.equals("false")) {
352            BACKGROUND_RECOMPILATION = false;
353            return true;
354          } else
355            return false;
356        }
357        if (name.equals("insert_yieldpoint_counters")) {
358          if (value.equals("true")) {
359            INSERT_YIELDPOINT_COUNTERS = true;
360            return true;
361          } else if (value.equals("false")) {
362            INSERT_YIELDPOINT_COUNTERS = false;
363            return true;
364          } else
365            return false;
366        }
367        if (name.equals("insert_method_counters_opt")) {
368          if (value.equals("true")) {
369            INSERT_METHOD_COUNTERS_OPT = true;
370            return true;
371          } else if (value.equals("false")) {
372            INSERT_METHOD_COUNTERS_OPT = false;
373            return true;
374          } else
375            return false;
376        }
377        if (name.equals("insert_instruction_counters")) {
378          if (value.equals("true")) {
379            INSERT_INSTRUCTION_COUNTERS = true;
380            return true;
381          } else if (value.equals("false")) {
382            INSERT_INSTRUCTION_COUNTERS = false;
383            return true;
384          } else
385            return false;
386        }
387        if (name.equals("insert_debugging_counters")) {
388          if (value.equals("true")) {
389            INSERT_DEBUGGING_COUNTERS = true;
390            return true;
391          } else if (value.equals("false")) {
392            INSERT_DEBUGGING_COUNTERS = false;
393            return true;
394          } else
395            return false;
396        }
397        if (name.equals("report_interrupt_stats")) {
398          if (value.equals("true")) {
399            REPORT_INTERRUPT_STATS = true;
400            return true;
401          } else if (value.equals("false")) {
402            REPORT_INTERRUPT_STATS = false;
403            return true;
404          } else
405            return false;
406        }
407        if (name.equals("disable_recompile_all_methods")) {
408          if (value.equals("true")) {
409            DISABLE_RECOMPILE_ALL_METHODS = true;
410            return true;
411          } else if (value.equals("false")) {
412            DISABLE_RECOMPILE_ALL_METHODS = false;
413            return true;
414          } else
415            return false;
416        }
417        if (name.equals("method_sample_size")) {
418           METHOD_SAMPLE_SIZE = CommandLineArgs.primitiveParseInt(value);
419           return true;
420         }
421        if (name.equals("initial_compiler")) {
422           if (value.equals("base")) {
423             INITIAL_COMPILER = IRC_BASE;
424             return true;
425           }
426           if (value.equals("opt")) {
427             INITIAL_COMPILER = IRC_OPT;
428             return true;
429           }
430           return false;
431         }
432        if (name.equals("recompilation_strategy")) {
433           if (value.equals("sampling")) {
434             RECOMPILATION_STRATEGY = RS_SAMPLING;
435             return true;
436           }
437           if (value.equals("counters")) {
438             RECOMPILATION_STRATEGY = RS_COUNTERS;
439             return true;
440           }
441           return false;
442         }
443        if (name.equals("method_listener_trigger")) {
444           if (value.equals("timer")) {
445             METHOD_LISTENER_TRIGGER = ML_TIMER;
446             return true;
447           }
448           if (value.equals("cbs")) {
449             METHOD_LISTENER_TRIGGER = ML_CBS;
450             return true;
451           }
452           return false;
453         }
454        if (name.equals("call_graph_listener_trigger")) {
455           if (value.equals("timer")) {
456             CALL_GRAPH_LISTENER_TRIGGER = CGL_TIMER;
457             return true;
458           }
459           if (value.equals("cbs")) {
460             CALL_GRAPH_LISTENER_TRIGGER = CGL_CBS;
461             return true;
462           }
463           return false;
464         }
465        if (name.equals("lf")) {
466           LOGFILE_NAME = value;
467           return true;
468         }
469        if (name.equals("cafo")) {
470           COMPILATION_ADVICE_FILE_OUTPUT = value;
471           return true;
472         }
473        if (name.equals("dcfo")) {
474           DYNAMIC_CALL_FILE_OUTPUT = value;
475           return true;
476         }
477        if (name.equals("dna")) {
478           COMPILER_DNA_FILE_NAME = value;
479           return true;
480         }
481        if (name.equals("cafi")) {
482           COMPILER_ADVICE_FILE_INPUT = value;
483           return true;
484         }
485        if (name.equals("dcfi")) {
486           DYNAMIC_CALL_FILE_INPUT = value;
487           return true;
488         }
489        if (name.equals("bulk_compilation_verbosity")) {
490           BULK_COMPILATION_VERBOSITY = CommandLineArgs.primitiveParseInt(value);
491           return true;
492         }
493        if (name.equals("logging_level")) {
494           LOGGING_LEVEL = CommandLineArgs.primitiveParseInt(value);
495           return true;
496         }
497        if (name.equals("final_report_level")) {
498           FINAL_REPORT_LEVEL = CommandLineArgs.primitiveParseInt(value);
499           return true;
500         }
501        if (name.equals("decay_frequency")) {
502           DECAY_FREQUENCY = CommandLineArgs.primitiveParseInt(value);
503           return true;
504         }
505        if (name.equals("dcg_decay_rate")) {
506           DCG_DECAY_RATE = CommandLineArgs.primitiveParseFloat(value);
507           return true;
508         }
509        if (name.equals("dcg_sample_size")) {
510           DCG_SAMPLE_SIZE = CommandLineArgs.primitiveParseInt(value);
511           return true;
512         }
513        if (name.equals("inline_ai_seed_multiplier")) {
514           INLINE_AI_SEED_MULTIPLIER = CommandLineArgs.primitiveParseFloat(value);
515           return true;
516         }
517        if (name.equals("inline_ai_hot_callsite_threshold")) {
518           INLINE_AI_HOT_CALLSITE_THRESHOLD = CommandLineArgs.primitiveParseFloat(value);
519           return true;
520         }
521        if (name.equals("offlinePlan")) {
522           OFFLINE_INLINE_PLAN_NAME = value;
523           return true;
524         }
525        if (name.equals("early_exit_time")) {
526           EARLY_EXIT_TIME = CommandLineArgs.primitiveParseInt(value);
527           return true;
528         }
529        if (name.equals("invocation_count_threshold")) {
530           INVOCATION_COUNT_THRESHOLD = CommandLineArgs.primitiveParseInt(value);
531           return true;
532         }
533        if (name.equals("invocation_count_opt_level")) {
534           INVOCATION_COUNT_OPT_LEVEL = CommandLineArgs.primitiveParseInt(value);
535           return true;
536         }
537        if (name.equals("counter_based_sample_interval")) {
538           COUNTER_BASED_SAMPLE_INTERVAL = CommandLineArgs.primitiveParseInt(value);
539           return true;
540         }
541        if (name.equals("max_opt_level")) {
542           MAX_OPT_LEVEL = CommandLineArgs.primitiveParseInt(value);
543           return true;
544         }
545           //End generated command-line processing
546    
547        // None of the above tests matched, so this wasn't an option
548        return false;
549      }
550    
551      /** Print a short description of every option */
552      public static void printHelp(String prefix) {
553    
554        instancePrintHelpHeader(prefix);
555    
556        //Begin generated help messages
557        VM.sysWrite("Boolean Options ("+prefix+"<option>=true or "+prefix+":<option>=false)\n");
558        VM.sysWrite("Option                                 Description\n");
559        VM.sysWrite("enable_recompilation                   Should the adaptive system recompile hot methods?\n");
560        VM.sysWrite("enable_advice_generation               Do we need to generate advice files?\n");
561        VM.sysWrite("enable_bulk_compile                    Should the adaptive system be disabled, and methods given in the advice file compiled when BulkCompile.compileAllMethods() is called?\n");
562        VM.sysWrite("enable_precompile                      Should bulk compilation be triggered before the user thread is started?\n");
563        VM.sysWrite("gather_profile_data                    Should profile data be gathered and reported at the end of the run?\n");
564        VM.sysWrite("adaptive_inlining                      Should we use adaptive feedback-directed inlining?\n");
565        VM.sysWrite("early_exit                             Should AOS exit when the controller clock reaches EARLY_EXIT_VALUE?\n");
566        VM.sysWrite("osr_promotion                          Should AOS promote baseline-compiled methods to opt?\n");
567        VM.sysWrite("background_recompilation               Should recompilation be done on a background thread or on next invocation?\n");
568        VM.sysWrite("insert_yieldpoint_counters             Insert instrumentation in opt recompiled code to count yieldpoints executed?\n");
569        VM.sysWrite("insert_method_counters_opt             Insert intrusive method counters in opt recompiled code?\n");
570        VM.sysWrite("insert_instruction_counters            Insert counters on all instructions in opt recompiled code?\n");
571        VM.sysWrite("insert_debugging_counters              Enable easy insertion of (debugging) counters in opt recompiled code.\n");
572        VM.sysWrite("report_interrupt_stats                 Report stats related to timer interrupts and AOS listeners on exit\n");
573        VM.sysWrite("disable_recompile_all_methods          Disable the ability for an app to request all methods to be recompiled\n");
574        VM.sysWrite("\nValue Options ("+prefix+"<option>=<value>)\n");
575        VM.sysWrite("Option                         Type    Description\n");
576        VM.sysWrite("method_sample_size             int     How many timer ticks of method samples to take before reporting method hotness to controller\n");
577        VM.sysWrite("lf                             String  Name of log file\n");
578        VM.sysWrite("cafo                           String  Name of advice file\n");
579        VM.sysWrite("dcfo                           String  Name of dynamic call graph file\n");
580        VM.sysWrite("dna                            String  Name of compiler DNA file (no name ==> use default DNA).  Discussed in a comment at the head of CompilerDNA.java\n");
581        VM.sysWrite("cafi                           String  File containing information about the methods to Opt compile\n");
582        VM.sysWrite("dcfi                           String  File containing information about the hot call sites\n");
583        VM.sysWrite("bulk_compilation_verbosity     int     Control amount of verbosity for bulk compilation (larger ==> more)\n");
584        VM.sysWrite("logging_level                  int     Control amount of event logging (larger ==> more)\n");
585        VM.sysWrite("final_report_level             int     Control amount of info reported on exit (larger ==> more)\n");
586        VM.sysWrite("decay_frequency                int     After how many clock ticks should we decay\n");
587        VM.sysWrite("dcg_decay_rate                 double  What factor should we decay call graph edges hotness by\n");
588        VM.sysWrite("dcg_sample_size                int     After how many timer interrupts do we update the weights in the dynamic call graph?\n");
589        VM.sysWrite("inline_ai_seed_multiplier      double  Initial edge weight of call graph is set to AI_SEED_MULTIPLER * (1/AI_CONTROL_POINT)\n");
590        VM.sysWrite("inline_ai_hot_callsite_threshold double  What percentage of the total weight of the dcg demarcates warm/hot edges \n");
591        VM.sysWrite("offlinePlan                    String  Name of offline inline plan to be read and used for inlining\n");
592        VM.sysWrite("early_exit_time                int     Value of controller clock at which AOS should exit if EARLY_EXIT is true\n");
593        VM.sysWrite("invocation_count_threshold     int     Invocation count at which a baseline compiled method should be recompiled\n");
594        VM.sysWrite("invocation_count_opt_level     int     Opt level for recompilation in invocation count based system\n");
595        VM.sysWrite("counter_based_sample_interval  int     What is the sample interval for counter-based sampling\n");
596        VM.sysWrite("max_opt_level                  int     The maximum optimization level to enable.\n");
597        VM.sysWrite("\nSelection Options (set option to one of an enumeration of possible values)\n");
598        VM.sysWrite("\t\tSelection of initial compiler\n");
599        VM.sysWrite("initial_compiler              ");
600        VM.sysWrite("base ");
601        VM.sysWrite("opt ");
602        VM.sysWrite("\n");
603        VM.sysWrite("\t\tSelection of mechanism for identifying methods for optimizing recompilation\n");
604        VM.sysWrite("recompilation_strategy        ");
605        VM.sysWrite("sampling ");
606        VM.sysWrite("counters ");
607        VM.sysWrite("\n");
608        VM.sysWrite("\t\tWhat triggers us to take a method sample?\n");
609        VM.sysWrite("method_listener_trigger       ");
610        VM.sysWrite("timer ");
611        VM.sysWrite("cbs ");
612        VM.sysWrite("\n");
613        VM.sysWrite("\t\tWhat triggers us to take a method sample?\n");
614        VM.sysWrite("call_graph_listener_trigger   ");
615        VM.sysWrite("timer ");
616        VM.sysWrite("cbs ");
617        VM.sysWrite("\n");
618        VM.sysWrite("\nSet Options (option is a set of values)\n");
619        instancePrintHelpFooter(prefix);
620    
621        VM.sysExit(VM.EXIT_STATUS_PRINTED_HELP_MESSAGE);
622      }
623    
624      /** @return a String representing the options values */
625      @Override
626      @org.vmmagic.pragma.NoOptCompile
627      public String toString() {
628        StringBuilder result = new StringBuilder();
629    
630        // Begin generated option value printing
631        result.append("\tenable_recompilation           = ").append(ENABLE_RECOMPILATION).append("\n");
632        result.append("\tenable_advice_generation       = ").append(ENABLE_ADVICE_GENERATION).append("\n");
633        result.append("\tenable_bulk_compile            = ").append(ENABLE_BULK_COMPILE).append("\n");
634        result.append("\tenable_precompile              = ").append(ENABLE_PRECOMPILE).append("\n");
635        result.append("\tgather_profile_data            = ").append(GATHER_PROFILE_DATA).append("\n");
636        result.append("\tadaptive_inlining              = ").append(ADAPTIVE_INLINING).append("\n");
637        result.append("\tearly_exit                     = ").append(EARLY_EXIT).append("\n");
638        result.append("\tosr_promotion                  = ").append(OSR_PROMOTION).append("\n");
639        result.append("\tbackground_recompilation       = ").append(BACKGROUND_RECOMPILATION).append("\n");
640        result.append("\tinsert_yieldpoint_counters     = ").append(INSERT_YIELDPOINT_COUNTERS).append("\n");
641        result.append("\tinsert_method_counters_opt     = ").append(INSERT_METHOD_COUNTERS_OPT).append("\n");
642        result.append("\tinsert_instruction_counters    = ").append(INSERT_INSTRUCTION_COUNTERS).append("\n");
643        result.append("\tinsert_debugging_counters      = ").append(INSERT_DEBUGGING_COUNTERS).append("\n");
644        result.append("\treport_interrupt_stats         = ").append(REPORT_INTERRUPT_STATS).append("\n");
645        result.append("\tdisable_recompile_all_methods  = ").append(DISABLE_RECOMPILE_ALL_METHODS).append("\n");
646        result.append("\tmethod_sample_size             = ").append(METHOD_SAMPLE_SIZE).append("\n");
647        result.append("\tlf                             = ").append(LOGFILE_NAME).append("\n");
648        result.append("\tcafo                           = ").append(COMPILATION_ADVICE_FILE_OUTPUT).append("\n");
649        result.append("\tdcfo                           = ").append(DYNAMIC_CALL_FILE_OUTPUT).append("\n");
650        result.append("\tdna                            = ").append(COMPILER_DNA_FILE_NAME).append("\n");
651        result.append("\tcafi                           = ").append(COMPILER_ADVICE_FILE_INPUT).append("\n");
652        result.append("\tdcfi                           = ").append(DYNAMIC_CALL_FILE_INPUT).append("\n");
653        result.append("\tbulk_compilation_verbosity     = ").append(BULK_COMPILATION_VERBOSITY).append("\n");
654        result.append("\tlogging_level                  = ").append(LOGGING_LEVEL).append("\n");
655        result.append("\tfinal_report_level             = ").append(FINAL_REPORT_LEVEL).append("\n");
656        result.append("\tdecay_frequency                = ").append(DECAY_FREQUENCY).append("\n");
657        result.append("\tdcg_decay_rate                 = ").append(DCG_DECAY_RATE).append("\n");
658        result.append("\tdcg_sample_size                = ").append(DCG_SAMPLE_SIZE).append("\n");
659        result.append("\tinline_ai_seed_multiplier      = ").append(INLINE_AI_SEED_MULTIPLIER).append("\n");
660        result.append("\tinline_ai_hot_callsite_threshold = ").append(INLINE_AI_HOT_CALLSITE_THRESHOLD).append("\n");
661        result.append("\tofflinePlan                    = ").append(OFFLINE_INLINE_PLAN_NAME).append("\n");
662        result.append("\tearly_exit_time                = ").append(EARLY_EXIT_TIME).append("\n");
663        result.append("\tinvocation_count_threshold     = ").append(INVOCATION_COUNT_THRESHOLD).append("\n");
664        result.append("\tinvocation_count_opt_level     = ").append(INVOCATION_COUNT_OPT_LEVEL).append("\n");
665        result.append("\tcounter_based_sample_interval  = ").append(COUNTER_BASED_SAMPLE_INTERVAL).append("\n");
666        result.append("\tmax_opt_level                  = ").append(MAX_OPT_LEVEL).append("\n");
667        if (INITIAL_COMPILER == IRC_BASE)
668           result.append("\tinitial_compiler               = IRC_BASE").append("\n");
669        if (INITIAL_COMPILER == IRC_OPT)
670           result.append("\tinitial_compiler               = IRC_OPT").append("\n");
671        if (RECOMPILATION_STRATEGY == RS_SAMPLING)
672           result.append("\trecompilation_strategy         = RS_SAMPLING").append("\n");
673        if (RECOMPILATION_STRATEGY == RS_COUNTERS)
674           result.append("\trecompilation_strategy         = RS_COUNTERS").append("\n");
675        if (METHOD_LISTENER_TRIGGER == ML_TIMER)
676           result.append("\tmethod_listener_trigger        = ML_TIMER").append("\n");
677        if (METHOD_LISTENER_TRIGGER == ML_CBS)
678           result.append("\tmethod_listener_trigger        = ML_CBS").append("\n");
679        if (CALL_GRAPH_LISTENER_TRIGGER == CGL_TIMER)
680           result.append("\tcall_graph_listener_trigger    = CGL_TIMER").append("\n");
681        if (CALL_GRAPH_LISTENER_TRIGGER == CGL_CBS)
682           result.append("\tcall_graph_listener_trigger    = CGL_CBS").append("\n");
683        return result.toString();
684        //End generated toString()
685      }
686    
687      /** print a String value of this options object */
688      @org.vmmagic.pragma.NoOptCompile
689      public void printOptions() {
690        printOptionsHeader();
691    
692        // Begin generated option value printing
693        VM.sysWriteln("\tenable_recompilation           = ",ENABLE_RECOMPILATION);
694        VM.sysWriteln("\tenable_advice_generation       = ",ENABLE_ADVICE_GENERATION);
695        VM.sysWriteln("\tenable_bulk_compile            = ",ENABLE_BULK_COMPILE);
696        VM.sysWriteln("\tenable_precompile              = ",ENABLE_PRECOMPILE);
697        VM.sysWriteln("\tgather_profile_data            = ",GATHER_PROFILE_DATA);
698        VM.sysWriteln("\tadaptive_inlining              = ",ADAPTIVE_INLINING);
699        VM.sysWriteln("\tearly_exit                     = ",EARLY_EXIT);
700        VM.sysWriteln("\tosr_promotion                  = ",OSR_PROMOTION);
701        VM.sysWriteln("\tbackground_recompilation       = ",BACKGROUND_RECOMPILATION);
702        VM.sysWriteln("\tinsert_yieldpoint_counters     = ",INSERT_YIELDPOINT_COUNTERS);
703        VM.sysWriteln("\tinsert_method_counters_opt     = ",INSERT_METHOD_COUNTERS_OPT);
704        VM.sysWriteln("\tinsert_instruction_counters    = ",INSERT_INSTRUCTION_COUNTERS);
705        VM.sysWriteln("\tinsert_debugging_counters      = ",INSERT_DEBUGGING_COUNTERS);
706        VM.sysWriteln("\treport_interrupt_stats         = ",REPORT_INTERRUPT_STATS);
707        VM.sysWriteln("\tdisable_recompile_all_methods  = ",DISABLE_RECOMPILE_ALL_METHODS);
708        VM.sysWriteln("\tmethod_sample_size             = ",METHOD_SAMPLE_SIZE);
709        VM.sysWriteln("\tlf                             = ",LOGFILE_NAME);
710        VM.sysWriteln("\tcafo                           = ",COMPILATION_ADVICE_FILE_OUTPUT);
711        VM.sysWriteln("\tdcfo                           = ",DYNAMIC_CALL_FILE_OUTPUT);
712        VM.sysWriteln("\tdna                            = ",COMPILER_DNA_FILE_NAME);
713        VM.sysWriteln("\tcafi                           = ",COMPILER_ADVICE_FILE_INPUT);
714        VM.sysWriteln("\tdcfi                           = ",DYNAMIC_CALL_FILE_INPUT);
715        VM.sysWriteln("\tbulk_compilation_verbosity     = ",BULK_COMPILATION_VERBOSITY);
716        VM.sysWriteln("\tlogging_level                  = ",LOGGING_LEVEL);
717        VM.sysWriteln("\tfinal_report_level             = ",FINAL_REPORT_LEVEL);
718        VM.sysWriteln("\tdecay_frequency                = ",DECAY_FREQUENCY);
719        VM.sysWriteln("\tdcg_decay_rate                 = ",DCG_DECAY_RATE);
720        VM.sysWriteln("\tdcg_sample_size                = ",DCG_SAMPLE_SIZE);
721        VM.sysWriteln("\tinline_ai_seed_multiplier      = ",INLINE_AI_SEED_MULTIPLIER);
722        VM.sysWriteln("\tinline_ai_hot_callsite_threshold = ",INLINE_AI_HOT_CALLSITE_THRESHOLD);
723        VM.sysWriteln("\tofflinePlan                    = ",OFFLINE_INLINE_PLAN_NAME);
724        VM.sysWriteln("\tearly_exit_time                = ",EARLY_EXIT_TIME);
725        VM.sysWriteln("\tinvocation_count_threshold     = ",INVOCATION_COUNT_THRESHOLD);
726        VM.sysWriteln("\tinvocation_count_opt_level     = ",INVOCATION_COUNT_OPT_LEVEL);
727        VM.sysWriteln("\tcounter_based_sample_interval  = ",COUNTER_BASED_SAMPLE_INTERVAL);
728        VM.sysWriteln("\tmax_opt_level                  = ",MAX_OPT_LEVEL);
729        if (INITIAL_COMPILER == IRC_BASE)
730           VM.sysWriteln("\tinitial_compiler               = IRC_BASE");
731        if (INITIAL_COMPILER == IRC_OPT)
732           VM.sysWriteln("\tinitial_compiler               = IRC_OPT");
733        if (RECOMPILATION_STRATEGY == RS_SAMPLING)
734           VM.sysWriteln("\trecompilation_strategy         = RS_SAMPLING");
735        if (RECOMPILATION_STRATEGY == RS_COUNTERS)
736           VM.sysWriteln("\trecompilation_strategy         = RS_COUNTERS");
737        if (METHOD_LISTENER_TRIGGER == ML_TIMER)
738           VM.sysWriteln("\tmethod_listener_trigger        = ML_TIMER");
739        if (METHOD_LISTENER_TRIGGER == ML_CBS)
740           VM.sysWriteln("\tmethod_listener_trigger        = ML_CBS");
741        if (CALL_GRAPH_LISTENER_TRIGGER == CGL_TIMER)
742           VM.sysWriteln("\tcall_graph_listener_trigger    = CGL_TIMER");
743        if (CALL_GRAPH_LISTENER_TRIGGER == CGL_CBS)
744           VM.sysWriteln("\tcall_graph_listener_trigger    = CGL_CBS");
745        //End generated option value printing
746      }
747    // END CODE GENERATED FROM MasterOptions.template
748    
749      private boolean instanceProcessAsOption(String arg) {
750        return false;
751      }
752    
753      private static void instancePrintHelpHeader(String prefix) {
754        VM.sysWrite("Commands\n");
755        VM.sysWrite(prefix+"[:help]       Print a brief description of AOS command-line options\n");
756        VM.sysWrite(prefix+":printOptions Print the current option values of AOS\n");
757        VM.sysWrite(prefix+":o=v          Pass the option-value pair, o=v, to AOS\n");
758        VM.sysWrite("\n");
759      }
760    
761      private static void instancePrintHelpFooter(String prefix) {
762      }
763    }