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