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.bc2ir; 014 015 016 /** 017 * This interface contains flags to control IR generation. 018 * 019 * @see BC2IR 020 */ 021 public interface IRGenOptions { 022 ////////////////////////////////////////// 023 // Flags that control IR generation policies 024 ////////////////////////////////////////// 025 /** 026 * Do we allow locals to live on the stack? 027 */ 028 boolean LOCALS_ON_STACK = true; 029 030 /** 031 * Do we eliminate copies to local variables? 032 */ 033 boolean ELIM_COPY_LOCALS = true; 034 035 /** 036 * Do we allow constants to live in local variables? 037 */ 038 boolean CP_IN_LOCALS = true; 039 040 /** 041 * How many return addresses will we allow in the local variables of 042 * a basic block before we decide that we should bail out to prevent 043 * exponential blowup in code space & compile time? 044 */ 045 int MAX_RETURN_ADDRESSES = 3; 046 047 /** Control on constant folding during IR generation */ 048 boolean CF_TABLESWITCH = true; 049 /** Control on constant folding during IR generation */ 050 boolean CF_LOOKUPSWITCH = true; 051 /** Control on constant folding during IR generation */ 052 boolean CF_CHECKCAST = true; 053 /** Control on constant folding during IR generation */ 054 boolean CF_CHECKSTORE = true; 055 /** Control on constant folding during IR generation */ 056 boolean CF_INSTANCEOF = true; 057 /** Control on constant folding during IR generation */ 058 boolean CF_INTIF = true; 059 /** Control on constant folding during IR generation */ 060 boolean CF_INTIFCMP = true; 061 /** Control on constant folding during IR generation */ 062 boolean CF_REFIF = true; 063 /** Control on constant folding during IR generation */ 064 boolean CF_REFIFCMP = true; 065 /** Control on constant folding during IR generation */ 066 boolean CF_LONGCMP = true; 067 /** Control on constant folding during IR generation */ 068 boolean CF_FLOATCMP = true; 069 /** Control on constant folding during IR generation */ 070 boolean CF_DOUBLECMP = true; 071 072 ////////////////////////////////////////// 073 // Debugging support (messaging controls) 074 ////////////////////////////////////////// 075 /** 076 * Master debug flag for IR gen. Turns on all other IR gen debug flags. 077 */ 078 boolean DBG_ALL = false; 079 080 /** 081 * Debug flag: basic blocks 082 */ 083 boolean DBG_BB = DBG_ALL || false; 084 085 /** 086 * Debug flag: bytecode parsing 087 */ 088 boolean DBG_BCPARSE = DBG_ALL || false; 089 090 /** 091 * Debug flag: control flow 092 */ 093 boolean DBG_CF = DBG_ALL || false; 094 095 /** 096 * Debug flag: print instructions as they are generated 097 */ 098 boolean DBG_INSTR = DBG_ALL || false; 099 100 /** 101 * Debug flag: elim copy to locals 102 */ 103 boolean DBG_ELIMCOPY = DBG_ALL || false; 104 105 /** 106 * Debug flag: elim null checks 107 */ 108 boolean DBG_ELIMNULL = DBG_ALL || false; 109 110 /** 111 * Debug flag: stack rectification 112 */ 113 boolean DBG_STACK = DBG_ALL || false; 114 115 /** 116 * Debug flag: local var rectification 117 */ 118 boolean DBG_LOCAL = DBG_ALL || false; 119 120 /** 121 * Debug flag: block regeneration 122 */ 123 boolean DBG_REGEN = DBG_ALL || false; 124 125 /** 126 * Debug flag: operand lattice functions 127 */ 128 boolean DBG_OPERAND_LATTICE = DBG_ALL || false; 129 130 /** 131 * Debug flag: cfg 132 */ 133 boolean DBG_CFG = DBG_ALL || false; 134 135 /** 136 * Debug flag: flattening 137 */ 138 boolean DBG_FLATTEN = DBG_ALL || false; 139 140 /** 141 * Debug flag: exception handlers 142 */ 143 boolean DBG_EX = DBG_ALL || false; 144 145 /** 146 * Debug flag: basic block set operations 147 */ 148 boolean DBG_BBSET = DBG_ALL || false; 149 150 /** 151 * Debug flag: type analysis 152 */ 153 boolean DBG_TYPE = DBG_ALL || false; 154 155 /** 156 * Debug flag: jsr inlining 157 */ 158 boolean DBG_INLINE_JSR = DBG_ALL || false; 159 }