00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 class FlagSetting {
00031 bool val;
00032 bool* flag;
00033 public:
00034 FlagSetting(bool& fl, bool newValue) { flag = &fl; val = fl; fl = newValue; }
00035 ~FlagSetting() { *flag = val; }
00036 };
00037
00038
00039 class debugFlags {
00040 public:
00041 static bool boolAt(char* name, int len, bool* value);
00042 static bool boolAt(char* name, bool* value) { return boolAt(name, strlen(name), value); }
00043
00044 static bool boolAtPut(char* name, int len, bool* value);
00045 static bool boolAtPut(char* name, bool* value) { return boolAtPut(name, strlen(name), value); }
00046
00047 static bool intAt(char* name, int len, int* value);
00048 static bool intAt(char* name, int* value) { return intAt(name, strlen(name), value); }
00049
00050 static bool intAtPut(char* name, int len, int* value);
00051 static bool intAtPut(char* name, int* value) {return intAtPut(name, strlen(name), value); }
00052
00053 static void printFlags();
00054 static void print_on(outputStream* st);
00055 static void print_diff_on(outputStream* st);
00056 };
00057
00058
00059
00060
00061
00062 #define APPLY_TO_BOOLEAN_FLAGS(develop,product) \
00063 \
00064 \
00065 develop(ZapResourceArea , false, "Zap the resource area when deallocated" ) \
00066 develop(PrintResourceAllocation , false, "Print each resource area allocation" ) \
00067 develop(PrintResourceChunkAllocation , false, "Print each resource area chunk allocation" ) \
00068 develop(PrintHeapAllocation , false, "Print heap alloction" ) \
00069 develop(PrintOopAddress , false, "Always print the location of the oop" ) \
00070 develop(PrintObjectID , true , "Always prepend object ID when printing" ) \
00071 develop(PrintLongFrames , false, "Print tons of details in VM stack traces" ) \
00072 develop(LogVMMessages , true , "Log all vm messages to a file" ) \
00073 develop(AlwaysFlushVMMessages , true , "Flush VM message log after every line" ) \
00074 develop(VerifyBeforeScavenge , false, "Verify system before scavenge" ) \
00075 develop(VerifyAfterScavenge , false, "Verify system after scavenge" ) \
00076 product(PrintScavenge , false, "Print message at scavenge" ) \
00077 product(PrintGC , true , "Print message at garbage collect" ) \
00078 develop(WizardMode , false, "Wizard debugging mode" ) \
00079 develop(VerifyBeforeGC , false, "Verify system before garbage collect" ) \
00080 develop(VerifyAfterGC , false, "Verify system after garbage collect" ) \
00081 develop(VerifyZoneOften , false, "Verify compiled-code zone often" ) \
00082 develop(PrintVMMessages , true , "Print vm messages on console" ) \
00083 develop(CompiledCodeOnly , false, "Use compiled code only" ) \
00084 product(UseRecompilation , true , "Automatically (re-)compile frequently-used methods" ) \
00085 develop(UseNMethodAging , true , "Age nmethods before recompiling them" ) \
00086 develop(UseInlineCaching , true , "Use inline caching in compiled code" ) \
00087 develop(EnableTasks , true , "Enable periodic tasks to be performed" ) \
00088 develop(CompressPcDescs , true , "ScopeDescRecorder: Compress PcDescs by ignoring multiple entries at same offset") \
00089 develop(UseAccessMethods , true , "Use access methods" ) \
00090 develop(UsePredictedMethods , true , "Use predicted methods" ) \
00091 develop(UsePrimitiveMethods , false, "Use primitive methods" ) \
00092 develop(PrintStackAtScavenge , false, "Print stack at Scavenge" ) \
00093 develop(PrintInterpreter , false, "Prints the generated interpreter's code" ) \
00094 develop(PrintStubRoutines , false, "Prints the stub routine's code" ) \
00095 product(UseInliningDatabase , false, "Use the inlining database for recompilation" ) \
00096 product(UseInliningDatabaseEagerly , false, "Use the inlining database eagerly at lookup" ) \
00097 develop(UseSlidingSystemAverage , true , "Compute sliding system average on the fly" ) \
00098 develop(UseGlobalFlatProfiling , true , "Include all processes when flat-profiling" ) \
00099 develop(EnableOptimizedCodeRecompilation , true , "Enable recompilation of optimized code" ) \
00100 develop(CountParentLinksAsOne , true , "Count going up to parent frame as 1 when checking MaxInterpretedSearchLength during recompilee search" ) \
00101 \
00102 develop(GenerateSmalltalk , false, "Generate Smalltalk output for file_in" ) \
00103 develop(GenerateHTML , false, "Generate HTML output for documentation" ) \
00104 \
00105 develop(UseTimers , true , "Tells whether the VM should use timers (only used at startup)" ) \
00106 develop(SweeperUseTimer , true , "Tells whether the sweeper should use timer interrupts or compile events" ) \
00107 \
00108 \
00109 develop(HasActivationClass , true, "Transition variable: tell whether the system has an activation class" ) \
00110 \
00111 \
00112 develop(TraceOopPrims , false, "Trace Oop primitives" ) \
00113 develop(TraceDoublePrims , false, "Trace Double primitives" ) \
00114 develop(TraceByteArrayPrims , false, "Trace ByteArray primitives" ) \
00115 develop(TraceDoubleByteArrayPrims , false, "Trace DoubleByteArray primitives" ) \
00116 develop(TraceDoubleValueArrayPrims , false, "Trace DoubleByteArray primitives" ) \
00117 develop(TraceObjArrayPrims , false, "Trace objArray primitives" ) \
00118 develop(TraceSmiPrims , false, "Trace SmallInteger primitives" ) \
00119 develop(TraceProxyPrims , false, "Trace Proxy primitives" ) \
00120 develop(TraceBehaviorPrims , false, "Trace behavior primitives" ) \
00121 develop(TraceBlockPrims , false, "Trace block primitives" ) \
00122 develop(TraceDebugPrims , false, "Trace debug primitives" ) \
00123 develop(TraceSystemPrims , false, "Trace system primitives" ) \
00124 develop(TraceProcessPrims , false, "Trace process primitives" ) \
00125 develop(TraceVframePrims , false, "Trace vframe primitives" ) \
00126 develop(TraceCallBackPrims , false, "Trace callBack primitives" ) \
00127 develop(TraceLookup , false, "Trace lookups" ) \
00128 develop(TraceLookup2 , false, "Trace lookups in excruciating detail" ) \
00129 develop(TraceLookupAtMiss , false, "Trace lookups at lookup cache miss" ) \
00130 develop(TraceBytecodes , false, "Trace byte code execution" ) \
00131 develop(TraceAllocation , false, "Trace allocation" ) \
00132 develop(TraceBootstrap , false, "Trace the bootstrap readin" ) \
00133 develop(TraceMethodPrims , false, "Trace method prims" ) \
00134 develop(TraceMixinPrims , false, "Trace mixin prims" ) \
00135 develop(TraceVMOperation , false, "Trace vm operations" ) \
00136 develop(TraceDLLLookup , false, "Trace DLL function lookup" ) \
00137 develop(TraceDLLCalls , false, "Trace DLL function calls" ) \
00138 product(TraceGC , true , "Trace Garbage Collection" ) \
00139 develop(TraceMessageSend , false, "Trace all message sends" ) \
00140 develop(TraceProcessEvents , false, "Trace all process events" ) \
00141 develop(TraceDeoptimization , false, "Trace deoptimizion" ) \
00142 develop(TraceZombieCreation , false, "Trace nmethod zombie creation" ) \
00143 develop(TraceResults , false, "Trace nmethod results" ) \
00144 develop(TraceApplyChange , false, "Trace reflective operation" ) \
00145 develop(TraceInliningDatabase , false, "Trace inlining database" ) \
00146 \
00147 \
00148 develop(ActivationShowExpressionStack , false, "Show expression stack for activation" ) \
00149 develop(ActivationShowBCI , false, "Show current bci for activation" ) \
00150 develop(ActivationShowFrame , false, "Show frame for activation" ) \
00151 develop(ActivationShowContext , false, "Show context if any for activation" ) \
00152 develop(ActivationShowCode , false, "Show pretty printed code for activation" ) \
00153 develop(ActivationShowNameDescs , false, "Show name desc in the printed code" ) \
00154 \
00155 \
00156 develop(ShowMessageBoxOnError , false, "Show a message box on error" ) \
00157 develop(BreakAtWarning , false, "Interrupt execution at warning?" ) \
00158 develop(PrintCompilerWarnings , true , "Print compiler warning?" ) \
00159 develop(PrintInliningDatabaseCompilation , false, "Print inlining database compilions?" ) \
00160 \
00161 \
00162 develop(CountBytecodes , false, "Count nof. bytecodes executed" ) \
00163 \
00164 \
00165 develop(ProfilerShowMethodHolder , true , "Show method holder for method" ) \
00166 \
00167 \
00168 develop(UseMICs , true , "Use megamorphic PICs (MICs)" ) \
00169 develop(UseLRUInterrupts , true , "User timers for zone LRU info" ) \
00170 develop(UseNewBackend , false, "Use new backend" ) \
00171 develop(TryNewBackend , false, "Use new backend & set additional flags as needed for compilation" ) \
00172 develop(UseFPUStack , false, "Use FPU stack for floats (unsafe)" ) \
00173 develop(ReorderBBs , true , "Reorder BBs" ) \
00174 product(CodeForP6 , false, "Minimize use of byte registers in code generation for P6" ) \
00175 develop(PrintInlineCacheInvalidation , false, "Print ic invalidation" ) \
00176 develop(PrintCodeReclamation , false, "Print code reclamation" ) \
00177 develop(PrintCodeSweep , false, "Print sweeps through zone/methods" ) \
00178 develop(PrintCodeCompaction , false, "Print code compaction" ) \
00179 develop(PrintMethodFlushing , false, "Print method flushing" ) \
00180 develop(MakeBlockMethodZombies , false, "Make block nmethod zombies if needed" ) \
00181 \
00182 \
00183 develop(CompilerDebug , false, "Make compiler debugging easier" ) \
00184 develop(EnableInt3 , true , "Enables/disables code generation for int3 instructions" ) \
00185 develop(VerifyCode , false, "Generates verification code in compiled code" ) \
00186 develop(VerifyDebugInfo , false, "Verify compiled-code debug info at each call (very slow)" ) \
00187 develop(GenTraceCalls , false, "Generate code for TraceCalls" ) \
00188 develop(TraceCalls , false, "Print non-inlined calls/returns (must compile with VerifyCode or GenTraceCalls)") \
00189 develop(MaterializeEliminatedBlocks , true , "Create fake blocks for eliminated blocks when printing stack" ) \
00190 develop(Inline , true , "Inline message sends" ) \
00191 develop(InlinePrims , true , "Inline some primitive calls" ) \
00192 develop(ConstantFoldPrims , true , "Constant-fold primitive calls" ) \
00193 develop(TypePredict , true , "Predict smi/bool/array message sends" ) \
00194 develop(TypePredictArrays , false, "Predict at:/at:Put: message sends" ) \
00195 develop(TypeFeedback , true , "use type feedback data" ) \
00196 develop(CodeSizeImpactsInlining , true , "code size is used as parameter to guide inlining" ) \
00197 develop(OptimizeIntegerLoops , true, "optimize integer loops" ) \
00198 develop(OptimizeLoops , true, "optimize loops (hoist type tests" ) \
00199 develop(EliminateJumpsToJumps , true , "Eliminate jumps to jumps" ) \
00200 develop(EliminateContexts , true , "Eliminate context allocations" ) \
00201 develop(LocalCopyPropagate , true , "Perform local copy propagation" ) \
00202 develop(GlobalCopyPropagate , true , "Perform global copy propagation" ) \
00203 develop(BruteForcePropagate , false, "Perform brute-force global copy propagation (UNSAFE -Urs 5/3/96)" ) \
00204 develop(Splitting , true , "Perform message splitting" ) \
00205 develop(EliminateUnneededNodes , true , "Eliminate dead code" ) \
00206 develop(DeferUncommonBranches , true , "Don't generate code for uncommon cases" ) \
00207 develop(MemoizeBlocks , true , "memoize (delay creation of) blocks" ) \
00208 develop(DebugPerformance , false, "Print info useful for performance debugging" ) \
00209 develop(PrintInlining , false, "Print info about inlining" ) \
00210 develop(PrintSplitting , false, "Print info about boolean splitting" ) \
00211 develop(PrintLocalAllocation , false, "Print info about local register allocation" ) \
00212 develop(PrintGlobalAllocation , false, "Print info about global register allocation" ) \
00213 develop(PrintEliminateContexts , false, "Print info about eliminating context allocations" ) \
00214 product(PrintCompilation , false, "Print each compilation" ) \
00215 develop(PrintRecompilation , false, "Print each recompilation" ) \
00216 develop(PrintRecompilation2 , false, "Print details about each recompilation" ) \
00217 develop(PrintCode , false, "Print intermediate code" ) \
00218 develop(PrintAssemblyCode , false, "Print assembly code" ) \
00219 develop(PrintJumpElimination , false, "Print eliminated jumps" ) \
00220 develop(PrintRegAlloc , false, "Print register allocation" ) \
00221 develop(PrintCopyPropagation , false, "Print info about copy propagation" ) \
00222 develop(PrintUncommonBranches , false, "Print message upon encountering uncommon case" ) \
00223 develop(PrintRegTargeting , false, "Print info about register targeting" ) \
00224 develop(PrintExposed , false, "Print info about exposed-block analysis" ) \
00225 develop(PrintEliminateUnnededNodes , false, "Print info about dead code elimination" ) \
00226 develop(PrintHexAddresses , true , "Print hex addresses in print outs (otherwise print 0)" ) \
00227 develop(GenerateLiteScopeDescs , false ,"generate lite scope descs" ) \
00228 develop(PrintRScopes , false, "Print info about RScopes (type feedback sources)" ) \
00229 develop(PrintLoopOpts , false, "Print info about loop optimizations" ) \
00230 develop(PrintStackAfterUnpacking , false, "Print stack after unpacking deoptimized frames" ) \
00231 develop(PrintDebugInfo , false, "Print debugging info of ScopeDescs generated for nmethod" ) \
00232 develop(PrintDebugInfoGeneration , false, "Print debugging info generation" ) \
00233 \
00234 \
00235 develop(PrintCodeGeneration , false, "Print code generation with new backend" ) \
00236 develop(PrintPRegMapping , false, "Print PRegMapping during code generation" ) \
00237 develop(PrintMakeConformantCode , false, "Print code generated by makeConformant" ) \
00238 develop(CreateScopeDescInfo , true , "Create ScopeDesc info for new backend code" ) \
00239 develop(GenerateFullDebugInfo , false, "Generate debugging info for each byte code and not only for sends/traps" ) \
00240 develop(UseNewMakeConformant , true , "Use new makeConformant function" ) \
00241
00242
00243 #define APPLY_TO_INTEGER_FLAGS(develop,product) \
00244 \
00245 \
00246 develop(EventLogLength , 1000, "Length of internal event log" ) \
00247 develop(StackPrintLimit , 100, "Number of stack frames to print in VM-level stack dump" ) \
00248 develop(MaxElementPrintSize , 10, "Maximum number of elements to print" ) \
00249 \
00250 \
00251 product(ReservedHeapSize , 50*K, "Maximum size for object heap in Kbytes" ) \
00252 product(ObjectHeapExpandSize , 512, "Chunk size (in Kbytes) by which the object heap grows" ) \
00253 product(EdenSize , 512, "size of eden (in Kbytes)" ) \
00254 product(SurvivorSize , 64, "size of survivor spaces (in Kbytes)" ) \
00255 product(OldSize , 3*K, "initial size of oldspace (in Kbytes)" ) \
00256 product(ReservedCodeSize , 10*K, "Maximum size of code cache (in Kbytes)" ) \
00257 product(CodeSize , 20*K, "size of code cache (in Kbytes)" ) \
00258 product(ReservedPICSize , 4*K, "Maximum size of PIC cache (in Kbytes)" ) \
00259 product(PICSize , 128, "size of PIC cache (in Kbytes)" ) \
00260 product(JumpTableSize , 8*K, "size of jump table" ) \
00261 \
00262 \
00263 product(CompilerInstrsSize , 50*K, "max. size of nmethod instrs" ) \
00264 product(CompilerScopesSize , 50*K, "max. size of debugging info per nmethod" ) \
00265 product(CompilerPCsSize , 15*K, "max. size of relocation info info per nmethod" ) \
00266 \
00267 \
00268 develop(MaxFnInlineCost , 40, "max. cost of normal inlined method" ) \
00269 develop(MaxBlockInlineCost , 70, "max. cost of block method" ) \
00270 develop(MinBlockCostFraction , 50, "(in %) inline block if makes up more than this fraction of parent's cost" ) \
00271 develop(BlockArgAdditionalAllowedInlineCost, 35, "additional allowed cost for each block arg" ) \
00272 \
00273 product(InvocationCounterLimit , 10000, "max. number of method invocations before (re-)compiling" ) \
00274 product(LoopCounterLimit , 10000, "max. number of loop iterations before (re-)compiling" ) \
00275 \
00276 product(MaxNmInstrSize , 12000, "max. desired size (in instr bytes) of an method" ) \
00277 product(MinSendsBeforeRecompile , 2000, "min # sends a method must have performed before being recompiled" ) \
00278 product(MaxFnInstrSize , 300, "max. inline size (in instr bytes) of normal method" ) \
00279 product(BlockArgAdditionalInstrSize , 150, "extra allowance (in instr bytes) for each block arg" ) \
00280 product(MaxBlockInstrSize , 450, "max. inline size (in instr bytes) of block method" ) \
00281 product(MaxRecursionUnroll , 2, "max. unrolling depth of recursive methods" ) \
00282 product(MaxTypeCaseSize , 3, "max. number of types in typecase-based inlining" ) \
00283 product(UncommonRecompileLimit , 5, "min. number of uncommon traps before recompiling" ) \
00284 product(UncommonInvocationLimit , 10000, "min. #invocations of uncommon nmethod before recompiling it again" ) \
00285 product(UncommonAgeBackoffFactor , 4, "for exponential back-off of UncommonAgeLimit based on nmethod version" ) \
00286 product(MinInvocationsBeforeTrust , 100, "min. # invocations required before trusting nmethod's PICs" ) \
00287 product(NMethodAgeLimit , 2, "min. # sweeps before nmethod becomes old" ) \
00288 product(MaxRecompilationSearchLength , 10, "max. # of real stack frames to traverse searching for recompilee" ) \
00289 product(MaxInterpretedSearchLength , 10, "max. # of intrepreted stack frames to traverse searching for recompilee" ) \
00290 product(CounterHalfLifeTime , 30, "time (in seconds) in which invocation counters decay by half" ) \
00291 product(MaxCustomization , 10, "max. # customized method copies to create" ) \
00292 \
00293 \
00294 develop(StopInterpreterAt , 0, "Stops interpreter execution at specified bytecode number" ) \
00295 \
00296 \
00297 develop(NumberOfContextAllocations , 0, "Number of allocated block contexts" ) \
00298 develop(NumberOfBlockAllocations , 0, "Number of allocated blocks" ) \
00299 develop(NumberOfBytecodesExecuted , 0, "Number of bytecodes executed by interpreter (if tracing)" ) \
00300 \
00301 \
00302 develop(ProfilerNumberOfInterpreterMethods , 10, "Max. number of interpreter methods to print" ) \
00303 develop(ProfilerNumberOfCompiledMethods , 10, "Max. number of compiled methods to print" ) \
00304 \
00305 \
00306 develop(HeapSweeperInterval , 120, "Time interval (sec) between starting heap sweep" ) \
00307 develop(PrintProgress , 0, "No. of compilations that cause a . to be printed out (0 means turned off)" ) \
00308 \
00309 \
00310 develop(InliningDatabasePruningLimit , 3, "Min. number of nodes in inlining structure to qualify for database" ) \
00311 \
00312
00313
00314
00315 #define DECLARE_BOOLEAN_FLAG(name,value,doc) \
00316 extern "C" bool name;
00317
00318 APPLY_TO_BOOLEAN_FLAGS(DECLARE_BOOLEAN_FLAG,DECLARE_BOOLEAN_FLAG)
00319
00320
00321
00322
00323 #define DECLARE_INTEGER_FLAG(name,value,doc) \
00324 extern "C" int name;
00325
00326 APPLY_TO_INTEGER_FLAGS(DECLARE_INTEGER_FLAG,DECLARE_INTEGER_FLAG)
00327
00328
00329 extern "C" char* vmDate;
00330
00331
00332
00333 extern "C" void debug();