Wed, 13 Apr 2011 14:33:03 -0700
6988308: assert((cnt > 0.0f) && (prob > 0.0f)) failed: Bad frequency assignment in if
Summary: Make sure cnt doesn't become negative and integer overflow doesn't happen.
Reviewed-by: kvn, twisti
1 /*
2 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
25 #ifndef SHARE_VM_OPTO_C2_GLOBALS_HPP
26 #define SHARE_VM_OPTO_C2_GLOBALS_HPP
28 #include "runtime/globals.hpp"
29 #ifdef TARGET_ARCH_x86
30 # include "c2_globals_x86.hpp"
31 #endif
32 #ifdef TARGET_ARCH_sparc
33 # include "c2_globals_sparc.hpp"
34 #endif
35 #ifdef TARGET_ARCH_arm
36 # include "c2_globals_arm.hpp"
37 #endif
38 #ifdef TARGET_OS_FAMILY_linux
39 # include "c2_globals_linux.hpp"
40 #endif
41 #ifdef TARGET_OS_FAMILY_solaris
42 # include "c2_globals_solaris.hpp"
43 #endif
44 #ifdef TARGET_OS_FAMILY_windows
45 # include "c2_globals_windows.hpp"
46 #endif
48 //
49 // Defines all globals flags used by the server compiler.
50 //
52 #define C2_FLAGS(develop, develop_pd, product, product_pd, diagnostic, experimental, notproduct) \
53 \
54 notproduct(intx, CompileZapFirst, 0, \
55 "If +ZapDeadCompiledLocals, " \
56 "skip this many before compiling in zap calls") \
57 \
58 notproduct(intx, CompileZapLast, -1, \
59 "If +ZapDeadCompiledLocals, " \
60 "compile this many after skipping (incl. skip count, -1 = all)") \
61 \
62 notproduct(intx, ZapDeadCompiledLocalsFirst, 0, \
63 "If +ZapDeadCompiledLocals, " \
64 "skip this many before really doing it") \
65 \
66 notproduct(intx, ZapDeadCompiledLocalsLast, -1, \
67 "If +ZapDeadCompiledLocals, " \
68 "do this many after skipping (incl. skip count, -1 = all)") \
69 \
70 develop(intx, OptoPrologueNops, 0, \
71 "Insert this many extra nop instructions " \
72 "in the prologue of every nmethod") \
73 \
74 product_pd(intx, InteriorEntryAlignment, \
75 "Code alignment for interior entry points " \
76 "in generated code (in bytes)") \
77 \
78 product(intx, MaxLoopPad, (OptoLoopAlignment-1), \
79 "Align a loop if padding size in bytes is less or equal to this value") \
80 \
81 product(intx, NumberOfLoopInstrToAlign, 4, \
82 "Number of first instructions in a loop to align") \
83 \
84 notproduct(intx, IndexSetWatch, 0, \
85 "Trace all operations on this IndexSet (-1 means all, 0 none)") \
86 \
87 develop(intx, OptoNodeListSize, 4, \
88 "Starting allocation size of Node_List data structures") \
89 \
90 develop(intx, OptoBlockListSize, 8, \
91 "Starting allocation size of Block_List data structures") \
92 \
93 develop(intx, OptoPeepholeAt, -1, \
94 "Apply peephole optimizations to this peephole rule") \
95 \
96 notproduct(bool, PrintIdeal, false, \
97 "Print ideal graph before code generation") \
98 \
99 notproduct(bool, PrintOpto, false, \
100 "Print compiler2 attempts") \
101 \
102 notproduct(bool, PrintOptoInlining, false, \
103 "Print compiler2 inlining decisions") \
104 \
105 notproduct(bool, VerifyOpto, false, \
106 "Apply more time consuming verification during compilation") \
107 \
108 notproduct(bool, VerifyOptoOopOffsets, false, \
109 "Check types of base addresses in field references") \
110 \
111 develop(bool, IdealizedNumerics, false, \
112 "Check performance difference allowing FP " \
113 "associativity and commutativity...") \
114 \
115 develop(bool, OptoBreakpoint, false, \
116 "insert breakpoint at method entry") \
117 \
118 notproduct(bool, OptoBreakpointOSR, false, \
119 "insert breakpoint at osr method entry") \
120 \
121 notproduct(intx, BreakAtNode, 0, \
122 "Break at construction of this Node (either _idx or _debug_idx)") \
123 \
124 notproduct(bool, OptoBreakpointC2R, false, \
125 "insert breakpoint at runtime stub entry") \
126 \
127 notproduct(bool, OptoNoExecute, false, \
128 "Attempt to parse and compile but do not execute generated code") \
129 \
130 notproduct(bool, PrintOptoStatistics, false, \
131 "Print New compiler statistics") \
132 \
133 notproduct(bool, PrintOptoAssembly, false, \
134 "Print New compiler assembly output") \
135 \
136 develop_pd(bool, OptoPeephole, \
137 "Apply peephole optimizations after register allocation") \
138 \
139 develop(bool, OptoRemoveUseless, true, \
140 "Remove useless nodes after parsing") \
141 \
142 notproduct(bool, PrintFrameConverterAssembly, false, \
143 "Print New compiler assembly output for frame converters") \
144 \
145 notproduct(bool, PrintParseStatistics, false, \
146 "Print nodes, transforms and new values made per bytecode parsed")\
147 \
148 notproduct(bool, PrintOptoPeephole, false, \
149 "Print New compiler peephole replacements") \
150 \
151 develop(bool, PrintCFGBlockFreq, false, \
152 "Print CFG block freqencies") \
153 \
154 develop(bool, TraceOptoParse, false, \
155 "Trace bytecode parse and control-flow merge") \
156 \
157 product_pd(intx, LoopUnrollLimit, \
158 "Unroll loop bodies with node count less than this") \
159 \
160 product(intx, LoopUnrollMin, 4, \
161 "Minimum number of unroll loop bodies before checking progress" \
162 "of rounds of unroll,optimize,..") \
163 \
164 develop(intx, UnrollLimitForProfileCheck, 1, \
165 "Don't use profile_trip_cnt() to restrict unrolling until " \
166 "unrolling would push the number of unrolled iterations above " \
167 "UnrollLimitForProfileCheck. A higher value allows more " \
168 "unrolling. Zero acts as a very large value." ) \
169 \
170 product(intx, MultiArrayExpandLimit, 6, \
171 "Maximum number of individual allocations in an inline-expanded " \
172 "multianewarray instruction") \
173 \
174 notproduct(bool, TraceProfileTripCount, false, \
175 "Trace profile loop trip count information") \
176 \
177 product(bool, UseLoopPredicate, true, \
178 "Generate a predicate to select fast/slow loop versions") \
179 \
180 develop(bool, TraceLoopPredicate, false, \
181 "Trace generation of loop predicates") \
182 \
183 develop(bool, TraceLoopOpts, false, \
184 "Trace executed loop optimizations") \
185 \
186 product(bool, OptimizeFill, false, \
187 "convert fill/copy loops into intrinsic") \
188 \
189 develop(bool, TraceOptimizeFill, false, \
190 "print detailed information about fill conversion") \
191 \
192 develop(bool, OptoCoalesce, true, \
193 "Use Conservative Copy Coalescing in the Register Allocator") \
194 \
195 develop(bool, UseUniqueSubclasses, true, \
196 "Narrow an abstract reference to the unique concrete subclass") \
197 \
198 develop(bool, UseExactTypes, true, \
199 "Use exact types to eliminate array store checks and v-calls") \
200 \
201 product(intx, TrackedInitializationLimit, 50, \
202 "When initializing fields, track up to this many words") \
203 \
204 product(bool, ReduceFieldZeroing, true, \
205 "When initializing fields, try to avoid needless zeroing") \
206 \
207 product(bool, ReduceInitialCardMarks, true, \
208 "When initializing fields, try to avoid needless card marks") \
209 \
210 product(bool, ReduceBulkZeroing, true, \
211 "When bulk-initializing, try to avoid needless zeroing") \
212 \
213 product(bool, UseFPUForSpilling, false, \
214 "Spill integer registers to FPU instead of stack when possible") \
215 \
216 develop_pd(intx, RegisterCostAreaRatio, \
217 "Spill selection in reg allocator: scale area by (X/64K) before " \
218 "adding cost") \
219 \
220 develop_pd(bool, UseCISCSpill, \
221 "Use ADLC supplied cisc instructions during allocation") \
222 \
223 notproduct(bool, VerifyGraphEdges , false, \
224 "Verify Bi-directional Edges") \
225 \
226 notproduct(bool, VerifyDUIterators, true, \
227 "Verify the safety of all iterations of Bi-directional Edges") \
228 \
229 notproduct(bool, VerifyHashTableKeys, true, \
230 "Verify the immutability of keys in the VN hash tables") \
231 \
232 notproduct(bool, VerifyRegisterAllocator , false, \
233 "Verify Register Allocator") \
234 \
235 develop_pd(intx, FLOATPRESSURE, \
236 "Number of float LRG's that constitute high register pressure") \
237 \
238 develop_pd(intx, INTPRESSURE, \
239 "Number of integer LRG's that constitute high register pressure") \
240 \
241 notproduct(bool, TraceOptoPipelining, false, \
242 "Trace pipelining information") \
243 \
244 notproduct(bool, TraceOptoOutput, false, \
245 "Trace pipelining information") \
246 \
247 product_pd(bool, OptoScheduling, \
248 "Instruction Scheduling after register allocation") \
249 \
250 product(bool, PartialPeelLoop, true, \
251 "Partial peel (rotate) loops") \
252 \
253 product(intx, PartialPeelNewPhiDelta, 0, \
254 "Additional phis that can be created by partial peeling") \
255 \
256 notproduct(bool, TracePartialPeeling, false, \
257 "Trace partial peeling (loop rotation) information") \
258 \
259 product(bool, PartialPeelAtUnsignedTests, true, \
260 "Partial peel at unsigned tests if no signed test exists") \
261 \
262 product(bool, ReassociateInvariants, true, \
263 "Enable reassociation of expressions with loop invariants.") \
264 \
265 product(bool, LoopUnswitching, true, \
266 "Enable loop unswitching (a form of invariant test hoisting)") \
267 \
268 notproduct(bool, TraceLoopUnswitching, false, \
269 "Trace loop unswitching") \
270 \
271 product(bool, UseSuperWord, true, \
272 "Transform scalar operations into superword operations") \
273 \
274 develop(bool, SuperWordRTDepCheck, false, \
275 "Enable runtime dependency checks.") \
276 \
277 product(bool, TraceSuperWord, false, \
278 "Trace superword transforms") \
279 \
280 product_pd(bool, OptoBundling, \
281 "Generate nops to fill i-cache lines") \
282 \
283 product_pd(intx, ConditionalMoveLimit, \
284 "Limit of ops to make speculative when using CMOVE") \
285 \
286 /* Set BranchOnRegister == false. See 4965987. */ \
287 product(bool, BranchOnRegister, false, \
288 "Use Sparc V9 branch-on-register opcodes") \
289 \
290 develop(bool, SparcV9RegsHiBitsZero, true, \
291 "Assume Sparc V9 I&L registers on V8+ systems are zero-extended") \
292 \
293 product(bool, UseRDPCForConstantTableBase, false, \
294 "Use Sparc RDPC instruction for the constant table base.") \
295 \
296 develop(intx, PrintIdealGraphLevel, 0, \
297 "Print ideal graph to XML file / network interface. " \
298 "By default attempts to connect to the visualizer on a socket.") \
299 \
300 develop(intx, PrintIdealGraphPort, 4444, \
301 "Ideal graph printer to network port") \
302 \
303 notproduct(ccstr, PrintIdealGraphAddress, "127.0.0.1", \
304 "IP address to connect to visualizer") \
305 \
306 notproduct(ccstr, PrintIdealGraphFile, NULL, \
307 "File to dump ideal graph to. If set overrides the " \
308 "use of the network") \
309 \
310 product(bool, UseOldInlining, true, \
311 "Enable the 1.3 inlining strategy") \
312 \
313 product(bool, UseBimorphicInlining, true, \
314 "Profiling based inlining for two receivers") \
315 \
316 product(bool, UseOnlyInlinedBimorphic, true, \
317 "Don't use BimorphicInlining if can't inline a second method") \
318 \
319 product(bool, InsertMemBarAfterArraycopy, true, \
320 "Insert memory barrier after arraycopy call") \
321 \
322 develop(bool, SubsumeLoads, true, \
323 "Attempt to compile while subsuming loads into machine instructions.") \
324 \
325 develop(bool, StressRecompilation, false, \
326 "Recompile each compiled method without subsuming loads or escape analysis.") \
327 \
328 /* controls for tier 1 compilations */ \
329 \
330 develop(bool, Tier1CountInvocations, true, \
331 "Generate code, during tier 1, to update invocation counter") \
332 \
333 product(intx, Tier1Inline, false, \
334 "enable inlining during tier 1") \
335 \
336 product(intx, Tier1MaxInlineSize, 8, \
337 "maximum bytecode size of a method to be inlined, during tier 1") \
338 \
339 product(intx, Tier1FreqInlineSize, 35, \
340 "max bytecode size of a frequent method to be inlined, tier 1") \
341 \
342 develop(intx, ImplicitNullCheckThreshold, 3, \
343 "Don't do implicit null checks if NPE's in a method exceeds limit") \
344 \
345 /* controls for loop optimization */ \
346 product(intx, Tier1LoopOptsCount, 0, \
347 "Set level of loop optimization for tier 1 compiles") \
348 \
349 product(intx, LoopOptsCount, 43, \
350 "Set level of loop optimization for tier 1 compiles") \
351 \
352 /* controls for heat-based inlining */ \
353 \
354 develop(intx, NodeCountInliningCutoff, 18000, \
355 "If parser node generation exceeds limit stop inlining") \
356 \
357 develop(intx, NodeCountInliningStep, 1000, \
358 "Target size of warm calls inlined between optimization passes") \
359 \
360 develop(bool, InlineWarmCalls, false, \
361 "Use a heat-based priority queue to govern inlining") \
362 \
363 develop(intx, HotCallCountThreshold, 999999, \
364 "large numbers of calls (per method invocation) force hotness") \
365 \
366 develop(intx, HotCallProfitThreshold, 999999, \
367 "highly profitable inlining opportunities force hotness") \
368 \
369 develop(intx, HotCallTrivialWork, -1, \
370 "trivial execution time (no larger than this) forces hotness") \
371 \
372 develop(intx, HotCallTrivialSize, -1, \
373 "trivial methods (no larger than this) force calls to be hot") \
374 \
375 develop(intx, WarmCallMinCount, -1, \
376 "number of calls (per method invocation) to enable inlining") \
377 \
378 develop(intx, WarmCallMinProfit, -1, \
379 "number of calls (per method invocation) to enable inlining") \
380 \
381 develop(intx, WarmCallMaxWork, 999999, \
382 "execution time of the largest inlinable method") \
383 \
384 develop(intx, WarmCallMaxSize, 999999, \
385 "size of the largest inlinable method") \
386 \
387 product(intx, MaxNodeLimit, 65000, \
388 "Maximum number of nodes") \
389 \
390 product(intx, NodeLimitFudgeFactor, 1000, \
391 "Fudge Factor for certain optimizations") \
392 \
393 product(bool, UseJumpTables, true, \
394 "Use JumpTables instead of a binary search tree for switches") \
395 \
396 product(bool, UseDivMod, true, \
397 "Use combined DivMod instruction if available") \
398 \
399 product(intx, MinJumpTableSize, 18, \
400 "Minimum number of targets in a generated jump table") \
401 \
402 product(intx, MaxJumpTableSize, 65000, \
403 "Maximum number of targets in a generated jump table") \
404 \
405 product(intx, MaxJumpTableSparseness, 5, \
406 "Maximum sparseness for jumptables") \
407 \
408 product(bool, EliminateLocks, true, \
409 "Coarsen locks when possible") \
410 \
411 notproduct(bool, PrintLockStatistics, false, \
412 "Print precise statistics on the dynamic lock usage") \
413 \
414 diagnostic(bool, PrintPreciseBiasedLockingStatistics, false, \
415 "Print per-lock-site statistics of biased locking in JVM") \
416 \
417 notproduct(bool, PrintEliminateLocks, false, \
418 "Print out when locks are eliminated") \
419 \
420 diagnostic(bool, EliminateAutoBox, false, \
421 "Private flag to control optimizations for autobox elimination") \
422 \
423 product(intx, AutoBoxCacheMax, 128, \
424 "Sets max value cached by the java.lang.Integer autobox cache") \
425 \
426 product(bool, DoEscapeAnalysis, true, \
427 "Perform escape analysis") \
428 \
429 notproduct(bool, PrintEscapeAnalysis, false, \
430 "Print the results of escape analysis") \
431 \
432 product(bool, EliminateAllocations, true, \
433 "Use escape analysis to eliminate allocations") \
434 \
435 notproduct(bool, PrintEliminateAllocations, false, \
436 "Print out when allocations are eliminated") \
437 \
438 product(intx, EliminateAllocationArraySizeLimit, 64, \
439 "Array size (number of elements) limit for scalar replacement") \
440 \
441 product(bool, UseOptoBiasInlining, true, \
442 "Generate biased locking code in C2 ideal graph") \
443 \
444 product(bool, OptimizeStringConcat, false, \
445 "Optimize the construction of Strings by StringBuilder") \
446 \
447 notproduct(bool, PrintOptimizeStringConcat, false, \
448 "Print information about transformations performed on Strings") \
449 \
450 product(intx, ValueSearchLimit, 1000, \
451 "Recursion limit in PhaseMacroExpand::value_from_mem_phi") \
452 \
453 product(intx, MaxLabelRootDepth, 1100, \
454 "Maximum times call Label_Root to prevent stack overflow") \
455 \
456 diagnostic(intx, DominatorSearchLimit, 1000, \
457 "Iterations limit in Node::dominates") \
458 \
459 product(bool, BlockLayoutByFrequency, true, \
460 "Use edge frequencies to drive block ordering") \
461 \
462 product(intx, BlockLayoutMinDiamondPercentage, 20, \
463 "Miniumum %% of a successor (predecessor) for which block layout "\
464 "a will allow a fork (join) in a single chain") \
465 \
466 product(bool, BlockLayoutRotateLoops, true, \
467 "Allow back branches to be fall throughs in the block layour") \
469 C2_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG)
471 #endif // SHARE_VM_OPTO_C2_GLOBALS_HPP