aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramurillo <none@none>2014-05-23 14:12:52 -0700
committeramurillo <none@none>2014-05-23 14:12:52 -0700
commit9754aa07b020ed014725967d0ba36c50dda91523 (patch)
treebbc5b37a340167a5693e390c71f3a241664e3969
parent6093853f56e1ab7dffa75a620a72f33b21bb4b30 (diff)
parent9ec53df2a75ebd681ba299fe505a15a2108ebd5e (diff)
-rw-r--r--agent/src/os/linux/libproc.h14
-rw-r--r--make/hotspot_version2
-rw-r--r--src/cpu/ppc/vm/vm_version_ppc.cpp4
-rw-r--r--src/cpu/sparc/vm/frame_sparc.hpp4
-rw-r--r--src/cpu/sparc/vm/frame_sparc.inline.hpp7
-rw-r--r--src/cpu/sparc/vm/stubGenerator_sparc.cpp10
-rw-r--r--src/cpu/sparc/vm/vm_version_sparc.cpp12
-rw-r--r--src/cpu/x86/vm/assembler_x86.cpp6
-rw-r--r--src/cpu/x86/vm/c1_LinearScan_x86.cpp4
-rw-r--r--src/cpu/x86/vm/compiledIC_x86.cpp4
-rw-r--r--src/cpu/x86/vm/frame_x86.cpp3
-rw-r--r--src/cpu/x86/vm/interpreter_x86_64.cpp3
-rw-r--r--src/cpu/x86/vm/macroAssembler_x86.cpp3
-rw-r--r--src/cpu/x86/vm/methodHandles_x86.cpp4
-rw-r--r--src/cpu/x86/vm/nativeInst_x86.cpp4
-rw-r--r--src/cpu/x86/vm/vm_version_x86.cpp20
-rw-r--r--src/cpu/x86/vm/vtableStubs_x86_32.cpp6
-rw-r--r--src/cpu/x86/vm/vtableStubs_x86_64.cpp4
-rw-r--r--src/os/bsd/vm/decoder_machO.cpp4
-rw-r--r--src/os/bsd/vm/os_bsd.cpp13
-rw-r--r--src/os/bsd/vm/perfMemory_bsd.cpp4
-rw-r--r--src/os/linux/vm/os_linux.cpp17
-rw-r--r--src/os/linux/vm/perfMemory_linux.cpp2
-rw-r--r--src/os/posix/vm/os_posix.cpp16
-rw-r--r--src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp4
-rw-r--r--src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp4
-rw-r--r--src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp33
-rw-r--r--src/os_cpu/linux_x86/vm/os_linux_x86.cpp4
-rw-r--r--src/share/vm/adlc/formssel.cpp6
-rw-r--r--src/share/vm/adlc/output_h.cpp34
-rw-r--r--src/share/vm/asm/codeBuffer.cpp10
-rw-r--r--src/share/vm/asm/codeBuffer.hpp4
-rw-r--r--src/share/vm/asm/register.hpp46
-rw-r--r--src/share/vm/c1/c1_CFGPrinter.cpp6
-rw-r--r--src/share/vm/c1/c1_InstructionPrinter.cpp16
-rw-r--r--src/share/vm/c1/c1_LIR.cpp44
-rw-r--r--src/share/vm/c1/c1_RangeCheckElimination.cpp12
-rw-r--r--src/share/vm/c1/c1_Runtime1.cpp14
-rw-r--r--src/share/vm/c1/c1_ValueType.hpp4
-rw-r--r--src/share/vm/ci/bcEscapeAnalyzer.cpp8
-rw-r--r--src/share/vm/ci/ciConstant.cpp4
-rw-r--r--src/share/vm/ci/ciEnv.cpp7
-rw-r--r--src/share/vm/ci/ciInstanceKlass.cpp10
-rw-r--r--src/share/vm/ci/ciMetadata.cpp4
-rw-r--r--src/share/vm/ci/ciMethodData.cpp6
-rw-r--r--src/share/vm/ci/ciObject.cpp6
-rw-r--r--src/share/vm/ci/ciSignature.cpp4
-rw-r--r--src/share/vm/ci/ciType.cpp4
-rw-r--r--src/share/vm/classfile/classFileError.cpp7
-rw-r--r--src/share/vm/classfile/classFileParser.cpp2
-rw-r--r--src/share/vm/classfile/classFileParser.hpp7
-rw-r--r--src/share/vm/classfile/classLoader.cpp6
-rw-r--r--src/share/vm/classfile/classLoaderData.cpp55
-rw-r--r--src/share/vm/classfile/classLoaderData.hpp13
-rw-r--r--src/share/vm/classfile/defaultMethods.cpp12
-rw-r--r--src/share/vm/classfile/dictionary.cpp1
-rw-r--r--src/share/vm/classfile/dictionary.hpp4
-rw-r--r--src/share/vm/classfile/javaClasses.cpp4
-rw-r--r--src/share/vm/classfile/symbolTable.cpp2
-rw-r--r--src/share/vm/classfile/systemDictionary.cpp2
-rw-r--r--src/share/vm/classfile/verifier.cpp24
-rw-r--r--src/share/vm/classfile/verifier.hpp8
-rw-r--r--src/share/vm/classfile/vmSymbols.cpp4
-rw-r--r--src/share/vm/code/codeBlob.cpp16
-rw-r--r--src/share/vm/code/codeCache.cpp20
-rw-r--r--src/share/vm/code/compiledIC.cpp24
-rw-r--r--src/share/vm/code/compressedStream.cpp5
-rw-r--r--src/share/vm/code/debugInfo.cpp6
-rw-r--r--src/share/vm/code/exceptionHandlerTable.cpp4
-rw-r--r--src/share/vm/code/icBuffer.cpp3
-rw-r--r--src/share/vm/code/nmethod.cpp4
-rw-r--r--src/share/vm/code/pcDesc.cpp4
-rw-r--r--src/share/vm/code/relocInfo.cpp3
-rw-r--r--src/share/vm/code/scopeDesc.cpp3
-rw-r--r--src/share/vm/code/vtableStubs.cpp4
-rw-r--r--src/share/vm/compiler/compileBroker.cpp12
-rw-r--r--src/share/vm/compiler/compileLog.cpp8
-rw-r--r--src/share/vm/compiler/compileLog.hpp6
-rw-r--r--src/share/vm/compiler/compilerOracle.cpp6
-rw-r--r--src/share/vm/compiler/disassembler.cpp5
-rw-r--r--src/share/vm/compiler/methodLiveness.cpp4
-rw-r--r--src/share/vm/compiler/oopMap.cpp10
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp4
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp32
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp4
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp18
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp4
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp6
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp4
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp4
-rw-r--r--src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp3
-rw-r--r--src/share/vm/gc_implementation/g1/concurrentMark.cpp82
-rw-r--r--src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp14
-rw-r--r--src/share/vm/gc_implementation/g1/g1AllocRegion.cpp4
-rw-r--r--src/share/vm/gc_implementation/g1/g1AllocRegion.hpp4
-rw-r--r--src/share/vm/gc_implementation/g1/g1BiasedArray.cpp4
-rw-r--r--src/share/vm/gc_implementation/g1/g1BiasedArray.hpp12
-rw-r--r--src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp4
-rw-r--r--src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp6
-rw-r--r--src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp6
-rw-r--r--src/share/vm/gc_implementation/g1/g1CardCounts.cpp4
-rw-r--r--src/share/vm/gc_implementation/g1/g1CardCounts.hpp6
-rw-r--r--src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp2
-rw-r--r--src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp12
-rw-r--r--src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp4
-rw-r--r--src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp16
-rw-r--r--src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp11
-rw-r--r--src/share/vm/gc_implementation/g1/g1HRPrinter.cpp4
-rw-r--r--src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp4
-rw-r--r--src/share/vm/gc_implementation/g1/g1RemSet.cpp4
-rw-r--r--src/share/vm/gc_implementation/g1/heapRegion.cpp6
-rw-r--r--src/share/vm/gc_implementation/g1/heapRegion.hpp6
-rw-r--r--src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp4
-rw-r--r--src/share/vm/gc_implementation/g1/heapRegionSeq.cpp4
-rw-r--r--src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp4
-rw-r--r--src/share/vm/gc_implementation/g1/heapRegionSet.cpp2
-rw-r--r--src/share/vm/gc_implementation/g1/heapRegionSet.hpp2
-rw-r--r--src/share/vm/gc_implementation/g1/satbQueue.cpp4
-rw-r--r--src/share/vm/gc_implementation/g1/survRateGroup.cpp6
-rw-r--r--src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp38
-rw-r--r--src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp4
-rw-r--r--src/share/vm/gc_implementation/parNew/parNewGeneration.cpp4
-rw-r--r--src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp8
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp6
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp30
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp46
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp18
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp4
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp4
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp8
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp4
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp4
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp4
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp6
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp4
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp4
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp4
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp6
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp4
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp1
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp4
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp4
-rw-r--r--src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp4
-rw-r--r--src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp10
-rw-r--r--src/share/vm/gc_implementation/shared/ageTable.cpp8
-rw-r--r--src/share/vm/gc_implementation/shared/allocationStats.hpp9
-rw-r--r--src/share/vm/gc_implementation/shared/immutableSpace.cpp4
-rw-r--r--src/share/vm/gc_implementation/shared/markSweep.cpp4
-rw-r--r--src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp4
-rw-r--r--src/share/vm/gc_implementation/shared/mutableSpace.cpp4
-rw-r--r--src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp4
-rw-r--r--src/share/vm/gc_implementation/shared/spaceDecorator.cpp4
-rw-r--r--src/share/vm/gc_interface/collectedHeap.cpp4
-rw-r--r--src/share/vm/interpreter/bytecodeTracer.cpp19
-rw-r--r--src/share/vm/interpreter/interpreter.cpp4
-rw-r--r--src/share/vm/interpreter/interpreterRuntime.cpp4
-rw-r--r--src/share/vm/interpreter/linkResolver.cpp2
-rw-r--r--src/share/vm/interpreter/oopMapCache.cpp4
-rw-r--r--src/share/vm/interpreter/templateInterpreter.cpp4
-rw-r--r--src/share/vm/libadt/dict.cpp4
-rw-r--r--src/share/vm/libadt/set.cpp4
-rw-r--r--src/share/vm/memory/allocation.cpp22
-rw-r--r--src/share/vm/memory/binaryTreeDictionary.cpp14
-rw-r--r--src/share/vm/memory/blockOffsetTable.cpp22
-rw-r--r--src/share/vm/memory/cardTableModRefBS.cpp32
-rw-r--r--src/share/vm/memory/cardTableModRefBS.hpp8
-rw-r--r--src/share/vm/memory/cardTableRS.cpp14
-rw-r--r--src/share/vm/memory/collectorPolicy.cpp6
-rw-r--r--src/share/vm/memory/defNewGeneration.cpp4
-rw-r--r--src/share/vm/memory/filemap.cpp3
-rw-r--r--src/share/vm/memory/gcLocker.cpp4
-rw-r--r--src/share/vm/memory/genCollectedHeap.cpp8
-rw-r--r--src/share/vm/memory/genOopClosures.hpp4
-rw-r--r--src/share/vm/memory/generation.cpp4
-rw-r--r--src/share/vm/memory/generation.hpp4
-rw-r--r--src/share/vm/memory/heapInspection.cpp14
-rw-r--r--src/share/vm/memory/heapInspection.hpp6
-rw-r--r--src/share/vm/memory/metachunk.cpp4
-rw-r--r--src/share/vm/memory/metaspace.cpp68
-rw-r--r--src/share/vm/memory/metaspace.hpp5
-rw-r--r--src/share/vm/memory/metaspaceShared.cpp29
-rw-r--r--src/share/vm/memory/referenceProcessor.cpp4
-rw-r--r--src/share/vm/memory/sharedHeap.cpp4
-rw-r--r--src/share/vm/memory/space.cpp4
-rw-r--r--src/share/vm/memory/threadLocalAllocBuffer.cpp4
-rw-r--r--src/share/vm/memory/threadLocalAllocBuffer.inline.hpp4
-rw-r--r--src/share/vm/memory/universe.cpp6
-rw-r--r--src/share/vm/oops/annotations.cpp4
-rw-r--r--src/share/vm/oops/constMethod.cpp6
-rw-r--r--src/share/vm/oops/constantPool.cpp6
-rw-r--r--src/share/vm/oops/cpCache.cpp7
-rw-r--r--src/share/vm/oops/generateOopMap.hpp8
-rw-r--r--src/share/vm/oops/instanceKlass.cpp4
-rw-r--r--src/share/vm/oops/instanceRefKlass.cpp4
-rw-r--r--src/share/vm/oops/klass.cpp2
-rw-r--r--src/share/vm/oops/klass.inline.hpp4
-rw-r--r--src/share/vm/oops/klassVtable.cpp2
-rw-r--r--src/share/vm/oops/markOop.cpp6
-rw-r--r--src/share/vm/oops/method.cpp24
-rw-r--r--src/share/vm/oops/method.hpp1
-rw-r--r--src/share/vm/oops/methodData.cpp8
-rw-r--r--src/share/vm/oops/oop.cpp2
-rw-r--r--src/share/vm/oops/oop.inline.hpp4
-rw-r--r--src/share/vm/opto/block.cpp4
-rw-r--r--src/share/vm/opto/c2_globals.hpp2
-rw-r--r--src/share/vm/opto/callGenerator.cpp2
-rw-r--r--src/share/vm/opto/callnode.cpp24
-rw-r--r--src/share/vm/opto/chaitin.cpp22
-rw-r--r--src/share/vm/opto/compile.cpp15
-rw-r--r--src/share/vm/opto/compile.hpp4
-rw-r--r--src/share/vm/opto/doCall.cpp6
-rw-r--r--src/share/vm/opto/gcm.cpp4
-rw-r--r--src/share/vm/opto/idealGraphPrinter.cpp14
-rw-r--r--src/share/vm/opto/ifg.cpp4
-rw-r--r--src/share/vm/opto/ifnode.cpp2
-rw-r--r--src/share/vm/opto/loopPredicate.cpp4
-rw-r--r--src/share/vm/opto/loopnode.cpp4
-rw-r--r--src/share/vm/opto/matcher.cpp4
-rw-r--r--src/share/vm/opto/memnode.cpp4
-rw-r--r--src/share/vm/opto/node.cpp4
-rw-r--r--src/share/vm/opto/parse1.cpp6
-rw-r--r--src/share/vm/opto/parse2.cpp6
-rw-r--r--src/share/vm/opto/phaseX.cpp15
-rw-r--r--src/share/vm/opto/regmask.cpp4
-rw-r--r--src/share/vm/opto/runtime.cpp2
-rw-r--r--src/share/vm/opto/subnode.cpp91
-rw-r--r--src/share/vm/opto/subnode.hpp2
-rw-r--r--src/share/vm/opto/type.cpp6
-rw-r--r--src/share/vm/prims/jni.cpp4
-rw-r--r--src/share/vm/prims/jniCheck.cpp8
-rw-r--r--src/share/vm/prims/jvm.cpp17
-rw-r--r--src/share/vm/prims/jvmtiEnter.xsl5
-rw-r--r--src/share/vm/prims/jvmtiEnvThreadState.cpp2
-rw-r--r--src/share/vm/prims/jvmtiEventController.cpp4
-rw-r--r--src/share/vm/prims/jvmtiExport.cpp4
-rw-r--r--src/share/vm/prims/jvmtiImpl.cpp4
-rw-r--r--src/share/vm/prims/jvmtiRedefineClasses.cpp6
-rw-r--r--src/share/vm/prims/methodHandles.cpp4
-rw-r--r--src/share/vm/prims/privilegedStack.cpp3
-rw-r--r--src/share/vm/prims/unsafe.cpp4
-rw-r--r--src/share/vm/prims/whitebox.cpp2
-rw-r--r--src/share/vm/runtime/arguments.cpp20
-rw-r--r--src/share/vm/runtime/arguments.hpp4
-rw-r--r--src/share/vm/runtime/biasedLocking.cpp14
-rw-r--r--src/share/vm/runtime/compilationPolicy.cpp14
-rw-r--r--src/share/vm/runtime/deoptimization.cpp4
-rw-r--r--src/share/vm/runtime/fprofiler.cpp6
-rw-r--r--src/share/vm/runtime/frame.cpp4
-rw-r--r--src/share/vm/runtime/globals.cpp10
-rw-r--r--src/share/vm/runtime/globals.hpp7
-rw-r--r--src/share/vm/runtime/handles.cpp4
-rw-r--r--src/share/vm/runtime/interfaceSupport.cpp3
-rw-r--r--src/share/vm/runtime/java.cpp7
-rw-r--r--src/share/vm/runtime/jniHandles.cpp3
-rw-r--r--src/share/vm/runtime/mutex.cpp4
-rw-r--r--src/share/vm/runtime/os.cpp22
-rw-r--r--src/share/vm/runtime/osThread.cpp3
-rw-r--r--src/share/vm/runtime/perfData.cpp4
-rw-r--r--src/share/vm/runtime/perfMemory.cpp2
-rw-r--r--src/share/vm/runtime/safepoint.cpp19
-rw-r--r--src/share/vm/runtime/safepoint.hpp6
-rw-r--r--src/share/vm/runtime/sharedRuntime.cpp4
-rw-r--r--src/share/vm/runtime/signature.cpp3
-rw-r--r--src/share/vm/runtime/stackValue.cpp4
-rw-r--r--src/share/vm/runtime/stackValueCollection.cpp4
-rw-r--r--src/share/vm/runtime/stubCodeGenerator.cpp8
-rw-r--r--src/share/vm/runtime/sweeper.cpp8
-rw-r--r--src/share/vm/runtime/sweeper.hpp4
-rw-r--r--src/share/vm/runtime/synchronizer.cpp4
-rw-r--r--src/share/vm/runtime/thread.cpp6
-rw-r--r--src/share/vm/runtime/thread.hpp4
-rw-r--r--src/share/vm/runtime/timer.cpp4
-rw-r--r--src/share/vm/runtime/unhandledOops.cpp4
-rw-r--r--src/share/vm/runtime/vframe.cpp4
-rw-r--r--src/share/vm/runtime/vframe.hpp4
-rw-r--r--src/share/vm/runtime/vframeArray.cpp3
-rw-r--r--src/share/vm/runtime/virtualspace.cpp3
-rw-r--r--src/share/vm/runtime/vmThread.cpp4
-rw-r--r--src/share/vm/runtime/vm_operations.cpp4
-rw-r--r--src/share/vm/services/attachListener.cpp12
-rw-r--r--src/share/vm/services/classLoadingService.cpp4
-rw-r--r--src/share/vm/services/diagnosticCommand.cpp6
-rw-r--r--src/share/vm/services/diagnosticFramework.cpp8
-rw-r--r--src/share/vm/services/heapDumper.cpp6
-rw-r--r--src/share/vm/services/lowMemoryDetector.cpp4
-rw-r--r--src/share/vm/services/management.cpp8
-rw-r--r--src/share/vm/services/memReporter.cpp4
-rw-r--r--src/share/vm/services/memSnapshot.cpp6
-rw-r--r--src/share/vm/services/memTrackWorker.cpp4
-rw-r--r--src/share/vm/services/nmtDCmd.cpp4
-rw-r--r--src/share/vm/services/threadService.cpp4
-rw-r--r--src/share/vm/trace/traceStream.hpp6
-rw-r--r--src/share/vm/utilities/array.hpp2
-rw-r--r--src/share/vm/utilities/bitMap.cpp6
-rw-r--r--src/share/vm/utilities/constantTag.cpp4
-rw-r--r--src/share/vm/utilities/debug.cpp5
-rw-r--r--src/share/vm/utilities/debug.hpp14
-rw-r--r--src/share/vm/utilities/events.cpp6
-rw-r--r--src/share/vm/utilities/events.hpp17
-rw-r--r--src/share/vm/utilities/exceptions.cpp4
-rw-r--r--src/share/vm/utilities/exceptions.hpp4
-rw-r--r--src/share/vm/utilities/globalDefinitions.hpp49
-rw-r--r--src/share/vm/utilities/globalDefinitions_gcc.hpp43
-rw-r--r--src/share/vm/utilities/numberSeq.cpp4
-rw-r--r--src/share/vm/utilities/ostream.cpp16
-rw-r--r--src/share/vm/utilities/ostream.hpp20
-rw-r--r--src/share/vm/utilities/quickSort.cpp4
-rw-r--r--src/share/vm/utilities/taskqueue.cpp4
-rw-r--r--src/share/vm/utilities/vmError.cpp12
-rw-r--r--src/share/vm/utilities/workgroup.cpp4
-rw-r--r--src/share/vm/utilities/xmlstream.cpp5
-rw-r--r--src/share/vm/utilities/xmlstream.hpp32
-rw-r--r--test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java3
-rw-r--r--test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java75
-rw-r--r--test/runtime/classFileParserBug/emptynumbootstrapmethods.jarbin0 -> 940 bytes
-rw-r--r--test/runtime/classFileParserBug/emptynumbootstrapmethods1.jcod68
-rw-r--r--test/runtime/classFileParserBug/emptynumbootstrapmethods2.jcod89
317 files changed, 1822 insertions, 1103 deletions
diff --git a/agent/src/os/linux/libproc.h b/agent/src/os/linux/libproc.h
index 429e6314f..c917a938c 100644
--- a/agent/src/os/linux/libproc.h
+++ b/agent/src/os/linux/libproc.h
@@ -34,19 +34,7 @@
#include "libproc_md.h"
#endif
-#if defined(sparc) || defined(sparcv9)
-/*
- If _LP64 is defined ptrace.h should be taken from /usr/include/asm-sparc64
- otherwise it should be from /usr/include/asm-sparc
- These two files define pt_regs structure differently
-*/
-#ifdef _LP64
-#include "asm-sparc64/ptrace.h"
-#else
-#include "asm-sparc/ptrace.h"
-#endif
-
-#endif //sparc or sparcv9
+#include <linux/ptrace.h>
/************************************************************************************
diff --git a/make/hotspot_version b/make/hotspot_version
index 7ea38bc09..dc333e867 100644
--- a/make/hotspot_version
+++ b/make/hotspot_version
@@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2014
HS_MAJOR_VER=25
HS_MINOR_VER=20
-HS_BUILD_NUMBER=15
+HS_BUILD_NUMBER=16
JDK_MAJOR_VER=1
JDK_MINOR_VER=8
diff --git a/src/cpu/ppc/vm/vm_version_ppc.cpp b/src/cpu/ppc/vm/vm_version_ppc.cpp
index 0a6261a21..32fb22ce2 100644
--- a/src/cpu/ppc/vm/vm_version_ppc.cpp
+++ b/src/cpu/ppc/vm/vm_version_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2014 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -149,7 +149,7 @@ void VM_Version::initialize() {
}
void VM_Version::print_features() {
- tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), get_cache_line_size());
+ tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), (int) get_cache_line_size());
}
#ifdef COMPILER2
diff --git a/src/cpu/sparc/vm/frame_sparc.hpp b/src/cpu/sparc/vm/frame_sparc.hpp
index 25bfea2a2..51a014872 100644
--- a/src/cpu/sparc/vm/frame_sparc.hpp
+++ b/src/cpu/sparc/vm/frame_sparc.hpp
@@ -259,8 +259,8 @@
// next two fns read and write Lmonitors value,
private:
- BasicObjectLock* interpreter_frame_monitors() const { return *interpreter_frame_monitors_addr(); }
- void interpreter_frame_set_monitors(BasicObjectLock* monitors) { *interpreter_frame_monitors_addr() = monitors; }
+ BasicObjectLock* interpreter_frame_monitors() const;
+ void interpreter_frame_set_monitors(BasicObjectLock* monitors);
#else
public:
inline interpreterState get_interpreterState() const {
diff --git a/src/cpu/sparc/vm/frame_sparc.inline.hpp b/src/cpu/sparc/vm/frame_sparc.inline.hpp
index b87681750..8aa0105bf 100644
--- a/src/cpu/sparc/vm/frame_sparc.inline.hpp
+++ b/src/cpu/sparc/vm/frame_sparc.inline.hpp
@@ -226,6 +226,13 @@ inline Method** frame::interpreter_frame_method_addr() const {
return (Method**)sp_addr_at( Lmethod->sp_offset_in_saved_window());
}
+inline BasicObjectLock* frame::interpreter_frame_monitors() const {
+ return *interpreter_frame_monitors_addr();
+}
+
+inline void frame::interpreter_frame_set_monitors(BasicObjectLock* monitors) {
+ *interpreter_frame_monitors_addr() = monitors;
+}
// Constant pool cache
diff --git a/src/cpu/sparc/vm/stubGenerator_sparc.cpp b/src/cpu/sparc/vm/stubGenerator_sparc.cpp
index aa81f9e4b..7cac116fa 100644
--- a/src/cpu/sparc/vm/stubGenerator_sparc.cpp
+++ b/src/cpu/sparc/vm/stubGenerator_sparc.cpp
@@ -83,7 +83,7 @@ class StubGenerator: public StubCodeGenerator {
private:
#ifdef PRODUCT
-#define inc_counter_np(a,b,c) (0)
+#define inc_counter_np(a,b,c)
#else
#define inc_counter_np(counter, t1, t2) \
BLOCK_COMMENT("inc_counter " #counter); \
@@ -1055,7 +1055,7 @@ class StubGenerator: public StubCodeGenerator {
Label& L_loop, bool use_prefetch, bool use_bis);
void disjoint_copy_core(Register from, Register to, Register count, int log2_elem_size,
- int iter_size, CopyLoopFunc copy_loop_func) {
+ int iter_size, StubGenerator::CopyLoopFunc copy_loop_func) {
Label L_copy;
assert(log2_elem_size <= 3, "the following code should be changed");
@@ -1206,7 +1206,7 @@ class StubGenerator: public StubCodeGenerator {
__ inc(from, 8);
__ sllx(O3, left_shift, O3);
- disjoint_copy_core(from, to, count, log2_elem_size, 16, copy_16_bytes_shift_loop);
+ disjoint_copy_core(from, to, count, log2_elem_size, 16, &StubGenerator::copy_16_bytes_shift_loop);
__ inccc(count, count_dec>>1 ); // + 8 bytes
__ brx(Assembler::negative, true, Assembler::pn, L_copy_last_bytes);
@@ -2085,7 +2085,7 @@ class StubGenerator: public StubCodeGenerator {
__ dec(count, 4); // The cmp at the beginning guaranty count >= 4
__ sllx(O3, 32, O3);
- disjoint_copy_core(from, to, count, 2, 16, copy_16_bytes_loop);
+ disjoint_copy_core(from, to, count, 2, 16, &StubGenerator::copy_16_bytes_loop);
__ br(Assembler::always, false, Assembler::pt, L_copy_4_bytes);
__ delayed()->inc(count, 4); // restore 'count'
@@ -2366,7 +2366,7 @@ class StubGenerator: public StubCodeGenerator {
// count >= 0 (original count - 8)
__ mov(from, from64);
- disjoint_copy_core(from64, to64, count, 3, 64, copy_64_bytes_loop);
+ disjoint_copy_core(from64, to64, count, 3, 64, &StubGenerator::copy_64_bytes_loop);
// Restore O4(offset0), O5(offset8)
__ sub(from64, from, offset0);
diff --git a/src/cpu/sparc/vm/vm_version_sparc.cpp b/src/cpu/sparc/vm/vm_version_sparc.cpp
index 129bcd8b6..1943705a5 100644
--- a/src/cpu/sparc/vm/vm_version_sparc.cpp
+++ b/src/cpu/sparc/vm/vm_version_sparc.cpp
@@ -318,22 +318,22 @@ void VM_Version::initialize() {
tty->print("BIS");
}
if (AllocatePrefetchLines > 1) {
- tty->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize);
+ tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
} else {
- tty->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize);
+ tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
}
}
if (PrefetchCopyIntervalInBytes > 0) {
- tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes);
+ tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
}
if (PrefetchScanIntervalInBytes > 0) {
- tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes);
+ tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
}
if (PrefetchFieldsAhead > 0) {
- tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead);
+ tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
}
if (ContendedPaddingWidth > 0) {
- tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth);
+ tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
}
}
#endif // PRODUCT
diff --git a/src/cpu/x86/vm/assembler_x86.cpp b/src/cpu/x86/vm/assembler_x86.cpp
index a89e50b65..64b8ce731 100644
--- a/src/cpu/x86/vm/assembler_x86.cpp
+++ b/src/cpu/x86/vm/assembler_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -522,11 +522,11 @@ address Assembler::locate_operand(address inst, WhichOperand which) {
// these asserts are somewhat nonsensical
#ifndef _LP64
assert(which == imm_operand || which == disp32_operand,
- err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
+ err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)));
#else
assert((which == call32_operand || which == imm_operand) && is_64bit ||
which == narrow_oop_operand && !is_64bit,
- err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
+ err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)));
#endif // _LP64
return ip;
diff --git a/src/cpu/x86/vm/c1_LinearScan_x86.cpp b/src/cpu/x86/vm/c1_LinearScan_x86.cpp
index 12b01bfab..ba5dc4862 100644
--- a/src/cpu/x86/vm/c1_LinearScan_x86.cpp
+++ b/src/cpu/x86/vm/c1_LinearScan_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -95,7 +95,7 @@ void LinearScan::allocate_fpu_stack() {
#ifndef PRODUCT
if (TraceFPURegisterUsage) {
- tty->print("FPU regs for block %d, LIR instr %d): ", b->block_id(), id); regs.print_on(tty); tty->print_cr("");
+ tty->print("FPU regs for block %d, LIR instr %d): ", b->block_id(), id); regs.print_on(tty); tty->cr();
}
#endif
}
diff --git a/src/cpu/x86/vm/compiledIC_x86.cpp b/src/cpu/x86/vm/compiledIC_x86.cpp
index 957695fdc..26d56b86a 100644
--- a/src/cpu/x86/vm/compiledIC_x86.cpp
+++ b/src/cpu/x86/vm/compiledIC_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@ void CompiledStaticCall::set_to_interpreted(methodHandle callee, address entry)
if (TraceICs) {
ResourceMark rm;
tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
- instruction_address(),
+ p2i(instruction_address()),
callee->name_and_sig_as_C_string());
}
diff --git a/src/cpu/x86/vm/frame_x86.cpp b/src/cpu/x86/vm/frame_x86.cpp
index 4e83863a9..212cdac3d 100644
--- a/src/cpu/x86/vm/frame_x86.cpp
+++ b/src/cpu/x86/vm/frame_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,7 @@ void RegisterMap::check_location_valid() {
}
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// Profiling/safepoint support
diff --git a/src/cpu/x86/vm/interpreter_x86_64.cpp b/src/cpu/x86/vm/interpreter_x86_64.cpp
index bc5229b99..a6190fd98 100644
--- a/src/cpu/x86/vm/interpreter_x86_64.cpp
+++ b/src/cpu/x86/vm/interpreter_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -51,6 +51,7 @@
#define __ _masm->
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
#ifdef _WIN64
address AbstractInterpreterGenerator::generate_slow_signature_handler() {
diff --git a/src/cpu/x86/vm/macroAssembler_x86.cpp b/src/cpu/x86/vm/macroAssembler_x86.cpp
index 8e5bd7949..16ec279f8 100644
--- a/src/cpu/x86/vm/macroAssembler_x86.cpp
+++ b/src/cpu/x86/vm/macroAssembler_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -55,6 +55,7 @@
#define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
#ifdef ASSERT
bool AbstractAssembler::pd_check_instruction_mark() { return true; }
diff --git a/src/cpu/x86/vm/methodHandles_x86.cpp b/src/cpu/x86/vm/methodHandles_x86.cpp
index 3c12385fd..42c690f5e 100644
--- a/src/cpu/x86/vm/methodHandles_x86.cpp
+++ b/src/cpu/x86/vm/methodHandles_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
#include "memory/allocation.inline.hpp"
#include "prims/methodHandles.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#define __ _masm->
#ifdef PRODUCT
diff --git a/src/cpu/x86/vm/nativeInst_x86.cpp b/src/cpu/x86/vm/nativeInst_x86.cpp
index dccd7e0b7..cc1573e72 100644
--- a/src/cpu/x86/vm/nativeInst_x86.cpp
+++ b/src/cpu/x86/vm/nativeInst_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
#include "c1/c1_Runtime1.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
void NativeInstruction::wrote(int offset) {
ICache::invalidate_word(addr_at(offset));
}
diff --git a/src/cpu/x86/vm/vm_version_x86.cpp b/src/cpu/x86/vm/vm_version_x86.cpp
index 1fc0e614b..e09dba38b 100644
--- a/src/cpu/x86/vm/vm_version_x86.cpp
+++ b/src/cpu/x86/vm/vm_version_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -925,16 +925,16 @@ void VM_Version::get_processor_features() {
if (PrintMiscellaneous && Verbose) {
tty->print_cr("Logical CPUs per core: %u",
logical_processors_per_package());
- tty->print("UseSSE=%d",UseSSE);
+ tty->print("UseSSE=%d", (int) UseSSE);
if (UseAVX > 0) {
- tty->print(" UseAVX=%d",UseAVX);
+ tty->print(" UseAVX=%d", (int) UseAVX);
}
if (UseAES) {
tty->print(" UseAES=1");
}
#ifdef COMPILER2
if (MaxVectorSize > 0) {
- tty->print(" MaxVectorSize=%d", MaxVectorSize);
+ tty->print(" MaxVectorSize=%d", (int) MaxVectorSize);
}
#endif
tty->cr();
@@ -957,23 +957,23 @@ void VM_Version::get_processor_features() {
}
}
if (AllocatePrefetchLines > 1) {
- tty->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize);
+ tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
} else {
- tty->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize);
+ tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
}
}
if (PrefetchCopyIntervalInBytes > 0) {
- tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes);
+ tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
}
if (PrefetchScanIntervalInBytes > 0) {
- tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes);
+ tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
}
if (PrefetchFieldsAhead > 0) {
- tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead);
+ tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
}
if (ContendedPaddingWidth > 0) {
- tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth);
+ tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
}
}
#endif // !PRODUCT
diff --git a/src/cpu/x86/vm/vtableStubs_x86_32.cpp b/src/cpu/x86/vm/vtableStubs_x86_32.cpp
index 73c2f3ca2..8d0353eff 100644
--- a/src/cpu/x86/vm/vtableStubs_x86_32.cpp
+++ b/src/cpu/x86/vm/vtableStubs_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -118,7 +118,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
if (PrintMiscellaneous && (WizardMode || Verbose)) {
tty->print_cr("vtable #%d at "PTR_FORMAT"[%d] left over: %d",
- vtable_index, s->entry_point(),
+ vtable_index, p2i(s->entry_point()),
(int)(s->code_end() - s->entry_point()),
(int)(s->code_end() - __ pc()));
}
@@ -199,7 +199,7 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
if (PrintMiscellaneous && (WizardMode || Verbose)) {
tty->print_cr("itable #%d at "PTR_FORMAT"[%d] left over: %d",
- itable_index, s->entry_point(),
+ itable_index, p2i(s->entry_point()),
(int)(s->code_end() - s->entry_point()),
(int)(s->code_end() - __ pc()));
}
diff --git a/src/cpu/x86/vm/vtableStubs_x86_64.cpp b/src/cpu/x86/vm/vtableStubs_x86_64.cpp
index 089b368d0..b6dd1b336 100644
--- a/src/cpu/x86/vm/vtableStubs_x86_64.cpp
+++ b/src/cpu/x86/vm/vtableStubs_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
#include "opto/runtime.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// machine-dependent part of VtableStubs: create VtableStub of correct size and
// initialize its code
diff --git a/src/os/bsd/vm/decoder_machO.cpp b/src/os/bsd/vm/decoder_machO.cpp
index b475f23ff..6ef6314a1 100644
--- a/src/os/bsd/vm/decoder_machO.cpp
+++ b/src/os/bsd/vm/decoder_machO.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@ bool MachODecoder::decode(address addr, char *buf,
struct symtab_command * symt = (struct symtab_command *)
mach_find_command((struct mach_header_64 *)mach_base, LC_SYMTAB);
if (symt == NULL) {
- DEBUG_ONLY(tty->print_cr("no symtab in mach file at 0x%lx", mach_base));
+ DEBUG_ONLY(tty->print_cr("no symtab in mach file at 0x%lx", p2i(mach_base)));
return false;
}
uint32_t off = symt->symoff; /* symbol table offset (within this mach file) */
diff --git a/src/os/bsd/vm/os_bsd.cpp b/src/os/bsd/vm/os_bsd.cpp
index 07d978e14..76a860603 100644
--- a/src/os/bsd/vm/os_bsd.cpp
+++ b/src/os/bsd/vm/os_bsd.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -123,6 +123,9 @@
#define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF)
#define LARGEPAGES_BIT (1 << 6)
+
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
////////////////////////////////////////////////////////////////////////////////
// global variables
julong os::Bsd::_physical_memory = 0;
@@ -2390,7 +2393,6 @@ char* os::reserve_memory_special(size_t bytes, size_t alignment, char* req_addr,
(!FLAG_IS_DEFAULT(UseLargePages) ||
!FLAG_IS_DEFAULT(LargePageSizeInBytes)
);
- char msg[128];
// Create a large shared memory region to attach to based on size.
// Currently, size is the total size of the heap
@@ -2411,8 +2413,7 @@ char* os::reserve_memory_special(size_t bytes, size_t alignment, char* req_addr,
// coalesce into large pages. Try to reserve large pages when
// the system is still "fresh".
if (warn_on_failure) {
- jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno);
- warning(msg);
+ warning("Failed to reserve shared memory (errno = %d).", errno);
}
return NULL;
}
@@ -2429,8 +2430,7 @@ char* os::reserve_memory_special(size_t bytes, size_t alignment, char* req_addr,
if ((intptr_t)addr == -1) {
if (warn_on_failure) {
- jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err);
- warning(msg);
+ warning("Failed to attach shared memory (errno = %d).", err);
}
return NULL;
}
@@ -3929,6 +3929,7 @@ bool os::check_heap(bool force) {
return true;
}
+ATTRIBUTE_PRINTF(3, 0)
int local_vsnprintf(char* buf, size_t count, const char* format, va_list args) {
return ::vsnprintf(buf, count, format, args);
}
diff --git a/src/os/bsd/vm/perfMemory_bsd.cpp b/src/os/bsd/vm/perfMemory_bsd.cpp
index f59b763b3..e812a76f5 100644
--- a/src/os/bsd/vm/perfMemory_bsd.cpp
+++ b/src/os/bsd/vm/perfMemory_bsd.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -925,7 +925,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
if (PerfTraceMemOps) {
tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at "
- INTPTR_FORMAT "\n", size, vmid, (void*)mapAddress);
+ INTPTR_FORMAT "\n", size, vmid, p2i((void*)mapAddress));
}
}
diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp
index 584198491..37cdc1f19 100644
--- a/src/os/linux/vm/os_linux.cpp
+++ b/src/os/linux/vm/os_linux.cpp
@@ -101,6 +101,8 @@
# include <inttypes.h>
# include <sys/ioctl.h>
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// if RUSAGE_THREAD for getrusage() has not been defined, do it here. The code calling
// getrusage() is prepared to handle the associated failure.
#ifndef RUSAGE_THREAD
@@ -2137,7 +2139,7 @@ void os::print_os_info(outputStream* st) {
// Print warning if unsafe chroot environment detected
if (unsafe_chroot_detected) {
st->print("WARNING!! ");
- st->print_cr(unstable_chroot_error);
+ st->print_cr("%s", unstable_chroot_error);
}
os::Linux::print_libversion_info(st);
@@ -2198,8 +2200,8 @@ void os::Linux::print_distro_info(outputStream* st) {
void os::Linux::print_libversion_info(outputStream* st) {
// libc, pthread
st->print("libc:");
- st->print(os::Linux::glibc_version()); st->print(" ");
- st->print(os::Linux::libpthread_version()); st->print(" ");
+ st->print("%s ", os::Linux::glibc_version());
+ st->print("%s ", os::Linux::libpthread_version());
if (os::Linux::is_LinuxThreads()) {
st->print("(%s stack)", os::Linux::is_floating_stack() ? "floating" : "fixed");
}
@@ -3415,7 +3417,7 @@ char* os::Linux::reserve_memory_special_shm(size_t bytes, size_t alignment, char
// the system is still "fresh".
if (warn_on_failure) {
jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno);
- warning(msg);
+ warning("%s", msg);
}
return NULL;
}
@@ -3433,7 +3435,7 @@ char* os::Linux::reserve_memory_special_shm(size_t bytes, size_t alignment, char
if ((intptr_t)addr == -1) {
if (warn_on_failure) {
jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err);
- warning(msg);
+ warning("%s", msg);
}
return NULL;
}
@@ -3453,7 +3455,7 @@ static void warn_on_large_pages_failure(char* req_addr, size_t bytes, int error)
char msg[128];
jio_snprintf(msg, sizeof(msg), "Failed to reserve large pages memory req_addr: "
PTR_FORMAT " bytes: " SIZE_FORMAT " (errno = %d).", req_addr, bytes, error);
- warning(msg);
+ warning("%s", msg);
}
}
@@ -5392,6 +5394,8 @@ jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
// -1 on error.
//
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED
static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
static bool proc_task_unchecked = true;
static const char *proc_stat_path = "/proc/%d/stat";
@@ -5453,6 +5457,7 @@ static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
return (jlong)user_time * (1000000000 / clock_tics_per_sec);
}
}
+PRAGMA_DIAG_POP
void os::current_thread_cpu_time_info(jvmtiTimerInfo *info_ptr) {
info_ptr->max_value = ALL_64_BITS; // will not wrap in less than 64 bits
diff --git a/src/os/linux/vm/perfMemory_linux.cpp b/src/os/linux/vm/perfMemory_linux.cpp
index d95d33107..970873429 100644
--- a/src/os/linux/vm/perfMemory_linux.cpp
+++ b/src/os/linux/vm/perfMemory_linux.cpp
@@ -931,7 +931,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
if (PerfTraceMemOps) {
tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at "
- INTPTR_FORMAT "\n", size, vmid, (void*)mapAddress);
+ INTPTR_FORMAT "\n", size, vmid, p2i((void*)mapAddress));
}
}
diff --git a/src/os/posix/vm/os_posix.cpp b/src/os/posix/vm/os_posix.cpp
index 57bdf08d9..4696c4ca7 100644
--- a/src/os/posix/vm/os_posix.cpp
+++ b/src/os/posix/vm/os_posix.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
#include <pthread.h>
#include <signal.h>
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// Todo: provide a os::get_max_process_id() or similar. Number of processes
// may have been configured, can be read more accurately from proc fs etc.
#ifndef MAX_PID
@@ -191,10 +193,10 @@ void os::Posix::print_uname_info(outputStream* st) {
st->print("uname:");
struct utsname name;
uname(&name);
- st->print(name.sysname); st->print(" ");
- st->print(name.release); st->print(" ");
- st->print(name.version); st->print(" ");
- st->print(name.machine);
+ st->print("%s ", name.sysname);
+ st->print("%s ", name.release);
+ st->print("%s ", name.version);
+ st->print("%s", name.machine);
st->cr();
}
@@ -552,7 +554,7 @@ const char* os::Posix::describe_signal_set_short(const sigset_t* set, char* buff
void os::Posix::print_signal_set_short(outputStream* st, const sigset_t* set) {
char buf[NUM_IMPORTANT_SIGS + 1];
os::Posix::describe_signal_set_short(set, buf, sizeof(buf));
- st->print(buf);
+ st->print("%s", buf);
}
// Writes one-line description of a combination of sigaction.sa_flags into a user
@@ -612,7 +614,7 @@ const char* os::Posix::describe_sa_flags(int flags, char* buffer, size_t size) {
void os::Posix::print_sa_flags(outputStream* st, int flags) {
char buffer[0x100];
os::Posix::describe_sa_flags(flags, buffer, sizeof(buffer));
- st->print(buffer);
+ st->print("%s", buffer);
}
// Helper function for os::Posix::print_siginfo_...():
diff --git a/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp b/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
index 5718a7919..50051d7c6 100644
--- a/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
+++ b/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -276,6 +276,8 @@
# endif
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
address os::current_stack_pointer() {
#if defined(__clang__) || defined(__llvm__)
register void *esp;
diff --git a/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp b/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp
index 9de203c11..331eed7a6 100644
--- a/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp
+++ b/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp
@@ -78,12 +78,12 @@ inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) {
__asm__ volatile(
"1: \n\t"
" ldx [%2], %%o2\n\t"
- " add %0, %%o2, %%o3\n\t"
+ " add %1, %%o2, %%o3\n\t"
" casx [%2], %%o2, %%o3\n\t"
" cmp %%o2, %%o3\n\t"
" bne %%xcc, 1b\n\t"
" nop\n\t"
- " add %0, %%o2, %0\n\t"
+ " add %1, %%o2, %0\n\t"
: "=r" (rv)
: "r" (add_value), "r" (dest)
: "memory", "o2", "o3");
diff --git a/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp b/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
index 5eaab2d52..f8f23122d 100644
--- a/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
+++ b/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
@@ -302,29 +302,30 @@ void os::print_register_info(outputStream *st, void *context) {
if (context == NULL) return;
ucontext_t *uc = (ucontext_t*)context;
+ sigcontext* sc = (sigcontext*)context;
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
st->print_cr("Register to memory mapping:");
st->cr();
// this is only for the "general purpose" registers
- st->print("G1="); print_location(st, SIG_REGS(sc).u_regs[CON__G1]);
- st->print("G2="); print_location(st, SIG_REGS(sc).u_regs[CON__G2]);
- st->print("G3="); print_location(st, SIG_REGS(sc).u_regs[CON__G3]);
- st->print("G4="); print_location(st, SIG_REGS(sc).u_regs[CON__G4]);
- st->print("G5="); print_location(st, SIG_REGS(sc).u_regs[CON__G5]);
- st->print("G6="); print_location(st, SIG_REGS(sc).u_regs[CON__G6]);
- st->print("G7="); print_location(st, SIG_REGS(sc).u_regs[CON__G7]);
+ st->print("G1="); print_location(st, SIG_REGS(sc).u_regs[CON_G1]);
+ st->print("G2="); print_location(st, SIG_REGS(sc).u_regs[CON_G2]);
+ st->print("G3="); print_location(st, SIG_REGS(sc).u_regs[CON_G3]);
+ st->print("G4="); print_location(st, SIG_REGS(sc).u_regs[CON_G4]);
+ st->print("G5="); print_location(st, SIG_REGS(sc).u_regs[CON_G5]);
+ st->print("G6="); print_location(st, SIG_REGS(sc).u_regs[CON_G6]);
+ st->print("G7="); print_location(st, SIG_REGS(sc).u_regs[CON_G7]);
st->cr();
- st->print("O0="); print_location(st, SIG_REGS(sc).u_regs[CON__O0]);
- st->print("O1="); print_location(st, SIG_REGS(sc).u_regs[CON__O1]);
- st->print("O2="); print_location(st, SIG_REGS(sc).u_regs[CON__O2]);
- st->print("O3="); print_location(st, SIG_REGS(sc).u_regs[CON__O3]);
- st->print("O4="); print_location(st, SIG_REGS(sc).u_regs[CON__O4]);
- st->print("O5="); print_location(st, SIG_REGS(sc).u_regs[CON__O5]);
- st->print("O6="); print_location(st, SIG_REGS(sc).u_regs[CON__O6]);
- st->print("O7="); print_location(st, SIG_REGS(sc).u_regs[CON__O7]);
+ st->print("O0="); print_location(st, SIG_REGS(sc).u_regs[CON_O0]);
+ st->print("O1="); print_location(st, SIG_REGS(sc).u_regs[CON_O1]);
+ st->print("O2="); print_location(st, SIG_REGS(sc).u_regs[CON_O2]);
+ st->print("O3="); print_location(st, SIG_REGS(sc).u_regs[CON_O3]);
+ st->print("O4="); print_location(st, SIG_REGS(sc).u_regs[CON_O4]);
+ st->print("O5="); print_location(st, SIG_REGS(sc).u_regs[CON_O5]);
+ st->print("O6="); print_location(st, SIG_REGS(sc).u_regs[CON_O6]);
+ st->print("O7="); print_location(st, SIG_REGS(sc).u_regs[CON_O7]);
st->cr();
st->print("L0="); print_location(st, sp[L0->sp_offset_in_saved_window()]);
@@ -516,7 +517,7 @@ inline static bool checkICMiss(sigcontext* uc, address* pc, address* stub) {
if (nativeInstruction_at(*pc)->is_ic_miss_trap()) {
#ifdef ASSERT
#ifdef TIERED
- CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
+ CodeBlob* cb = CodeCache::find_blob_unsafe(*pc);
assert(cb->is_compiled_by_c2(), "Wrong compiler");
#endif // TIERED
#endif // ASSERT
diff --git a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
index 9acde125e..9a4a74160 100644
--- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
+++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -88,6 +88,8 @@
#define SPELL_REG_FP "ebp"
#endif // AMD64
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
address os::current_stack_pointer() {
#ifdef SPARC_WORKS
register void *esp;
diff --git a/src/share/vm/adlc/formssel.cpp b/src/share/vm/adlc/formssel.cpp
index df58c5746..ffb13e759 100644
--- a/src/share/vm/adlc/formssel.cpp
+++ b/src/share/vm/adlc/formssel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1322,7 +1322,7 @@ void InstructForm::rep_var_format(FILE *fp, const char *rep_var) {
OperandForm* oper = form->is_operand();
if (oper != NULL && oper->is_bound_register()) {
const RegDef* first = oper->get_RegClass()->find_first_elem();
- fprintf(fp, " st->print(\"%s\");\n", first->_regname);
+ fprintf(fp, " st->print_raw(\"%s\");\n", first->_regname);
} else {
globalAD->syntax_err(_linenum, "In %s can't find format for %s %s", _ident, opc->_ident, rep_var);
}
@@ -2530,7 +2530,7 @@ void OperandForm::format_constant(FILE *fp, uint const_index, uint const_type) {
case Form::idealP: fprintf(fp," if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
case Form::idealNKlass:
case Form::idealN: fprintf(fp," if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
- case Form::idealL: fprintf(fp," st->print(\"#%%lld\", _c%d);\n", const_index); break;
+ case Form::idealL: fprintf(fp," st->print(\"#\" INT64_FORMAT, (int64_t)_c%d);\n", const_index); break;
case Form::idealF: fprintf(fp," st->print(\"#%%f\", _c%d);\n", const_index); break;
case Form::idealD: fprintf(fp," st->print(\"#%%f\", _c%d);\n", const_index); break;
default:
diff --git a/src/share/vm/adlc/output_h.cpp b/src/share/vm/adlc/output_h.cpp
index 2279e75ec..4a5b54676 100644
--- a/src/share/vm/adlc/output_h.cpp
+++ b/src/share/vm/adlc/output_h.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -386,14 +386,14 @@ static void defineConstructor(FILE *fp, const char *name, uint num_consts,
static void defineCCodeDump(OperandForm* oper, FILE *fp, int i) {
assert(oper != NULL, "what");
CondInterface* cond = oper->_interface->is_CondInterface();
- fprintf(fp, " if( _c%d == BoolTest::eq ) st->print(\"%s\");\n",i,cond->_equal_format);
- fprintf(fp, " else if( _c%d == BoolTest::ne ) st->print(\"%s\");\n",i,cond->_not_equal_format);
- fprintf(fp, " else if( _c%d == BoolTest::le ) st->print(\"%s\");\n",i,cond->_less_equal_format);
- fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print(\"%s\");\n",i,cond->_greater_equal_format);
- fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print(\"%s\");\n",i,cond->_less_format);
- fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print(\"%s\");\n",i,cond->_greater_format);
- fprintf(fp, " else if( _c%d == BoolTest::overflow ) st->print(\"%s\");\n",i,cond->_overflow_format);
- fprintf(fp, " else if( _c%d == BoolTest::no_overflow ) st->print(\"%s\");\n",i,cond->_no_overflow_format);
+ fprintf(fp, " if( _c%d == BoolTest::eq ) st->print_raw(\"%s\");\n",i,cond->_equal_format);
+ fprintf(fp, " else if( _c%d == BoolTest::ne ) st->print_raw(\"%s\");\n",i,cond->_not_equal_format);
+ fprintf(fp, " else if( _c%d == BoolTest::le ) st->print_raw(\"%s\");\n",i,cond->_less_equal_format);
+ fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print_raw(\"%s\");\n",i,cond->_greater_equal_format);
+ fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print_raw(\"%s\");\n",i,cond->_less_format);
+ fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print_raw(\"%s\");\n",i,cond->_greater_format);
+ fprintf(fp, " else if( _c%d == BoolTest::overflow ) st->print_raw(\"%s\");\n",i,cond->_overflow_format);
+ fprintf(fp, " else if( _c%d == BoolTest::no_overflow ) st->print_raw(\"%s\");\n",i,cond->_no_overflow_format);
}
// Output code that dumps constant values, increment "i" if type is constant
@@ -416,8 +416,8 @@ static uint dump_spec_constant(FILE *fp, const char *ideal_type, uint i, Operand
++i;
}
else if (!strcmp(ideal_type, "ConL")) {
- fprintf(fp," st->print(\"#\" INT64_FORMAT, _c%d);\n", i);
- fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%d);\n", i);
+ fprintf(fp," st->print(\"#\" INT64_FORMAT, (int64_t)_c%d);\n", i);
+ fprintf(fp," st->print(\"/\" PTR64_FORMAT, (uint64_t)_c%d);\n", i);
++i;
}
else if (!strcmp(ideal_type, "ConF")) {
@@ -429,7 +429,7 @@ static uint dump_spec_constant(FILE *fp, const char *ideal_type, uint i, Operand
else if (!strcmp(ideal_type, "ConD")) {
fprintf(fp," st->print(\"#%%f\", _c%d);\n", i);
fprintf(fp," jlong _c%dl = JavaValue(_c%d).get_jlong();\n", i, i);
- fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%dl);\n", i);
+ fprintf(fp," st->print(\"/\" PTR64_FORMAT, (uint64_t)_c%dl);\n", i);
++i;
}
else if (!strcmp(ideal_type, "Bool")) {
@@ -471,7 +471,7 @@ void gen_oper_format(FILE *fp, FormDict &globals, OperandForm &oper, bool for_c_
if ( string != NameList::_signal ) {
// Normal string
// Pass through to st->print
- fprintf(fp," st->print(\"%s\");\n", string);
+ fprintf(fp," st->print_raw(\"%s\");\n", string);
} else {
// Replacement variable
const char *rep_var = oper._format->_rep_vars.iter();
@@ -542,7 +542,7 @@ void gen_oper_format(FILE *fp, FormDict &globals, OperandForm &oper, bool for_c_
if ( string != NameList::_signal ) {
// Normal string
// Pass through to st->print
- fprintf(fp," st->print(\"%s\");\n", string);
+ fprintf(fp," st->print_raw(\"%s\");\n", string);
} else {
// Replacement variable
const char *rep_var = oper._format->_rep_vars.iter();
@@ -669,7 +669,7 @@ void gen_inst_format(FILE *fp, FormDict &globals, InstructForm &inst, bool for_c
} else if( string == NameList::_signal2 ) // Raw program text
fputs(inst._format->_strings.iter(), fp);
else
- fprintf(fp,"st->print(\"%s\");\n", string);
+ fprintf(fp,"st->print_raw(\"%s\");\n", string);
} // Done with all format strings
} // Done generating the user-defined portion of the format
@@ -696,13 +696,13 @@ void gen_inst_format(FILE *fp, FormDict &globals, InstructForm &inst, bool for_c
default:
assert(0,"ShouldNotReachHere");
}
- fprintf(fp, " st->print_cr(\"\");\n" );
+ fprintf(fp, " st->cr();\n" );
fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
fprintf(fp, " st->print(\" # \");\n" );
fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
}
else if(inst.is_ideal_safepoint()) {
- fprintf(fp, " st->print(\"\");\n" );
+ fprintf(fp, " st->print_raw(\"\");\n" );
fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
fprintf(fp, " st->print(\" # \");\n" );
fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
diff --git a/src/share/vm/asm/codeBuffer.cpp b/src/share/vm/asm/codeBuffer.cpp
index 7e5859900..f05b5020a 100644
--- a/src/share/vm/asm/codeBuffer.cpp
+++ b/src/share/vm/asm/codeBuffer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -987,7 +987,7 @@ void CodeSection::dump() {
for (csize_t step; ptr < end(); ptr += step) {
step = end() - ptr;
if (step > jintSize * 4) step = jintSize * 4;
- tty->print(PTR_FORMAT ": ", ptr);
+ tty->print(INTPTR_FORMAT ": ", p2i(ptr));
while (step > 0) {
tty->print(" " PTR32_FORMAT, *(jint*)ptr);
ptr += jintSize;
@@ -1097,7 +1097,7 @@ void CodeStrings::print_block_comment(outputStream* stream, intptr_t offset) con
while (c && c->offset() == offset) {
stream->bol();
stream->print(" ;; ");
- stream->print_cr(c->string());
+ stream->print_cr("%s", c->string());
c = c->next_comment();
}
}
@@ -1153,10 +1153,10 @@ void CodeBuffer::decode_all() {
void CodeSection::print(const char* name) {
csize_t locs_size = locs_end() - locs_start();
tty->print_cr(" %7s.code = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d)%s",
- name, start(), end(), limit(), size(), capacity(),
+ name, p2i(start()), p2i(end()), p2i(limit()), size(), capacity(),
is_frozen()? " [frozen]": "");
tty->print_cr(" %7s.locs = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d) point=%d",
- name, locs_start(), locs_end(), locs_limit(), locs_size, locs_capacity(), locs_point_off());
+ name, p2i(locs_start()), p2i(locs_end()), p2i(locs_limit()), locs_size, locs_capacity(), locs_point_off());
if (PrintRelocations) {
RelocIterator iter(this);
iter.print();
diff --git a/src/share/vm/asm/codeBuffer.hpp b/src/share/vm/asm/codeBuffer.hpp
index bcc5d51e7..1c3761baa 100644
--- a/src/share/vm/asm/codeBuffer.hpp
+++ b/src/share/vm/asm/codeBuffer.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -173,7 +173,7 @@ class CodeSection VALUE_OBJ_CLASS_SPEC {
bool allocates(address pc) const { return pc >= _start && pc < _limit; }
bool allocates2(address pc) const { return pc >= _start && pc <= _limit; }
- void set_end(address pc) { assert(allocates2(pc), err_msg("not in CodeBuffer memory: " PTR_FORMAT " <= " PTR_FORMAT " <= " PTR_FORMAT, _start, pc, _limit)); _end = pc; }
+ void set_end(address pc) { assert(allocates2(pc), err_msg("not in CodeBuffer memory: " PTR_FORMAT " <= " PTR_FORMAT " <= " INTPTR_FORMAT, p2i(_start), p2i(pc), p2i(_limit))); _end = pc; }
void set_mark(address pc) { assert(contains2(pc), "not in codeBuffer");
_mark = pc; }
void set_mark_off(int offset) { assert(contains2(offset+_start),"not in codeBuffer");
diff --git a/src/share/vm/asm/register.hpp b/src/share/vm/asm/register.hpp
index 5afecdeb1..d9918517d 100644
--- a/src/share/vm/asm/register.hpp
+++ b/src/share/vm/asm/register.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -118,8 +118,8 @@ inline void assert_different_registers(
) {
assert(
a != b,
- err_msg_res("registers must be different: a=%d, b=%d",
- a, b)
+ err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT "",
+ p2i(a), p2i(b))
);
}
@@ -132,8 +132,9 @@ inline void assert_different_registers(
assert(
a != b && a != c
&& b != c,
- err_msg_res("registers must be different: a=%d, b=%d, c=%d",
- a, b, c)
+ err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+ ", c=" INTPTR_FORMAT "",
+ p2i(a), p2i(b), p2i(c))
);
}
@@ -148,8 +149,9 @@ inline void assert_different_registers(
a != b && a != c && a != d
&& b != c && b != d
&& c != d,
- err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d",
- a, b, c, d)
+ err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+ ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT "",
+ p2i(a), p2i(b), p2i(c), p2i(d))
);
}
@@ -166,8 +168,9 @@ inline void assert_different_registers(
&& b != c && b != d && b != e
&& c != d && c != e
&& d != e,
- err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d",
- a, b, c, d, e)
+ err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+ ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT "",
+ p2i(a), p2i(b), p2i(c), p2i(d), p2i(e))
);
}
@@ -186,8 +189,10 @@ inline void assert_different_registers(
&& c != d && c != e && c != f
&& d != e && d != f
&& e != f,
- err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d",
- a, b, c, d, e, f)
+ err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+ ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+ ", f=" INTPTR_FORMAT "",
+ p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f))
);
}
@@ -208,8 +213,10 @@ inline void assert_different_registers(
&& d != e && d != f && d != g
&& e != f && e != g
&& f != g,
- err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d",
- a, b, c, d, e, f, g)
+ err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+ ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+ ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT "",
+ p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g))
);
}
@@ -232,8 +239,10 @@ inline void assert_different_registers(
&& e != f && e != g && e != h
&& f != g && f != h
&& g != h,
- err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d",
- a, b, c, d, e, f, g, h)
+ err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+ ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+ ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT "",
+ p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h))
);
}
@@ -258,8 +267,11 @@ inline void assert_different_registers(
&& f != g && f != h && f != i
&& g != h && g != i
&& h != i,
- err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d",
- a, b, c, d, e, f, g, h, i)
+ err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+ ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+ ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT
+ ", i=" INTPTR_FORMAT "",
+ p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i))
);
}
diff --git a/src/share/vm/c1/c1_CFGPrinter.cpp b/src/share/vm/c1/c1_CFGPrinter.cpp
index 4eaa7d27f..b0cb94629 100644
--- a/src/share/vm/c1/c1_CFGPrinter.cpp
+++ b/src/share/vm/c1/c1_CFGPrinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@ class CFGPrinterOutput : public CHeapObj<mtCompiler> {
void inc_indent();
void dec_indent();
- void print(const char* format, ...);
+ void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
void print_begin(const char* tag);
void print_end(const char* tag);
@@ -161,7 +161,7 @@ void CFGPrinterOutput::print_compilation() {
print("name \"%s\"", method_name(_compilation->method(), true));
print("method \"%s\"", method_name(_compilation->method()));
- print("date "INT64_FORMAT, os::javaTimeMillis());
+ print("date "INT64_FORMAT, (int64_t) os::javaTimeMillis());
print_end("compilation");
}
diff --git a/src/share/vm/c1/c1_InstructionPrinter.cpp b/src/share/vm/c1/c1_InstructionPrinter.cpp
index 7f87e1183..842acec5b 100644
--- a/src/share/vm/c1/c1_InstructionPrinter.cpp
+++ b/src/share/vm/c1/c1_InstructionPrinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -134,23 +134,23 @@ void InstructionPrinter::print_object(Value obj) {
if (value->is_null_object()) {
output()->print("null");
} else if (!value->is_loaded()) {
- output()->print("<unloaded object " PTR_FORMAT ">", value);
+ output()->print("<unloaded object " INTPTR_FORMAT ">", p2i(value));
} else {
- output()->print("<object " PTR_FORMAT " klass=", value->constant_encoding());
+ output()->print("<object " INTPTR_FORMAT " klass=", p2i(value->constant_encoding()));
print_klass(value->klass());
output()->print(">");
}
} else if (type->as_InstanceConstant() != NULL) {
ciInstance* value = type->as_InstanceConstant()->value();
if (value->is_loaded()) {
- output()->print("<instance " PTR_FORMAT " klass=", value->constant_encoding());
+ output()->print("<instance " INTPTR_FORMAT " klass=", p2i(value->constant_encoding()));
print_klass(value->klass());
output()->print(">");
} else {
- output()->print("<unloaded instance " PTR_FORMAT ">", value);
+ output()->print("<unloaded instance " INTPTR_FORMAT ">", p2i(value));
}
} else if (type->as_ArrayConstant() != NULL) {
- output()->print("<array " PTR_FORMAT ">", type->as_ArrayConstant()->value()->constant_encoding());
+ output()->print("<array " INTPTR_FORMAT ">", p2i(type->as_ArrayConstant()->value()->constant_encoding()));
} else if (type->as_ClassConstant() != NULL) {
ciInstanceKlass* klass = type->as_ClassConstant()->value();
if (!klass->is_loaded()) {
@@ -268,7 +268,7 @@ void InstructionPrinter::print_inline_level(BlockBegin* block) {
void InstructionPrinter::print_unsafe_op(UnsafeOp* op, const char* name) {
- output()->print(name);
+ output()->print("%s", name);
output()->print(".(");
}
@@ -479,7 +479,7 @@ void InstructionPrinter::do_TypeCast(TypeCast* x) {
if (x->declared_type()->is_klass())
print_klass(x->declared_type()->as_klass());
else
- output()->print(type2name(x->declared_type()->basic_type()));
+ output()->print("%s", type2name(x->declared_type()->basic_type()));
}
diff --git a/src/share/vm/c1/c1_LIR.cpp b/src/share/vm/c1/c1_LIR.cpp
index 2634f5f41..fc176943e 100644
--- a/src/share/vm/c1/c1_LIR.cpp
+++ b/src/share/vm/c1/c1_LIR.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1563,15 +1563,15 @@ void LIR_OprDesc::print(outputStream* out) const {
} else if (is_virtual()) {
out->print("R%d", vreg_number());
} else if (is_single_cpu()) {
- out->print(as_register()->name());
+ out->print("%s", as_register()->name());
} else if (is_double_cpu()) {
- out->print(as_register_hi()->name());
- out->print(as_register_lo()->name());
+ out->print("%s", as_register_hi()->name());
+ out->print("%s", as_register_lo()->name());
#if defined(X86)
} else if (is_single_xmm()) {
- out->print(as_xmm_float_reg()->name());
+ out->print("%s", as_xmm_float_reg()->name());
} else if (is_double_xmm()) {
- out->print(as_xmm_double_reg()->name());
+ out->print("%s", as_xmm_double_reg()->name());
} else if (is_single_fpu()) {
out->print("fpu%d", fpu_regnr());
} else if (is_double_fpu()) {
@@ -1583,9 +1583,9 @@ void LIR_OprDesc::print(outputStream* out) const {
out->print("d%d", fpu_regnrLo() >> 1);
#else
} else if (is_single_fpu()) {
- out->print(as_float_reg()->name());
+ out->print("%s", as_float_reg()->name());
} else if (is_double_fpu()) {
- out->print(as_double_reg()->name());
+ out->print("%s", as_double_reg()->name());
#endif
} else if (is_illegal()) {
@@ -1611,9 +1611,9 @@ void LIR_Const::print_value_on(outputStream* out) const {
case T_LONG: out->print("lng:" JLONG_FORMAT, as_jlong()); break;
case T_FLOAT: out->print("flt:%f", as_jfloat()); break;
case T_DOUBLE: out->print("dbl:%f", as_jdouble()); break;
- case T_OBJECT: out->print("obj:0x%x", as_jobject()); break;
- case T_METADATA: out->print("metadata:0x%x", as_metadata());break;
- default: out->print("%3d:0x%x",type(), as_jdouble()); break;
+ case T_OBJECT: out->print("obj:" INTPTR_FORMAT, p2i(as_jobject())); break;
+ case T_METADATA: out->print("metadata:" INTPTR_FORMAT, p2i(as_metadata()));break;
+ default: out->print("%3d:0x" UINT64_FORMAT_X, type(), (uint64_t)as_jlong()); break;
}
}
@@ -1629,7 +1629,7 @@ void LIR_Address::print_value_on(outputStream* out) const {
case times_8: out->print(" * 8"); break;
}
}
- out->print(" Disp: %d", _disp);
+ out->print(" Disp: " INTX_FORMAT, _disp);
}
// debug output of block header without InstructionPrinter
@@ -1703,7 +1703,7 @@ void LIR_Op::print_on(outputStream* out) const {
} else {
out->print(" ");
}
- out->print(name()); out->print(" ");
+ out->print("%s ", name());
print_instr(out);
if (info() != NULL) out->print(" [bci:%d]", info()->stack()->bci());
#ifdef ASSERT
@@ -1833,7 +1833,7 @@ const char * LIR_Op::name() const {
// LIR_OpJavaCall
void LIR_OpJavaCall::print_instr(outputStream* out) const {
out->print("call: ");
- out->print("[addr: 0x%x]", address());
+ out->print("[addr: " INTPTR_FORMAT "]", p2i(address()));
if (receiver()->is_valid()) {
out->print(" [recv: "); receiver()->print(out); out->print("]");
}
@@ -1844,7 +1844,7 @@ void LIR_OpJavaCall::print_instr(outputStream* out) const {
// LIR_OpLabel
void LIR_OpLabel::print_instr(outputStream* out) const {
- out->print("[label:0x%x]", _label);
+ out->print("[label:" INTPTR_FORMAT "]", p2i(_label));
}
// LIR_OpArrayCopy
@@ -1911,7 +1911,7 @@ void LIR_Op1::print_instr(outputStream* out) const {
// LIR_Op1
void LIR_OpRTCall::print_instr(outputStream* out) const {
intx a = (intx)addr();
- out->print(Runtime1::name_for_address(addr()));
+ out->print("%s", Runtime1::name_for_address(addr()));
out->print(" ");
tmp()->print(out);
}
@@ -1934,10 +1934,10 @@ void LIR_OpBranch::print_instr(outputStream* out) const {
} else if (stub() != NULL) {
out->print("[");
stub()->print_name(out);
- out->print(": 0x%x]", stub());
+ out->print(": " INTPTR_FORMAT "]", p2i(stub()));
if (stub()->info() != NULL) out->print(" [bci:%d]", stub()->info()->stack()->bci());
} else {
- out->print("[label:0x%x] ", label());
+ out->print("[label:" INTPTR_FORMAT "] ", p2i(label()));
}
if (ublock() != NULL) {
out->print("unordered: [B%d] ", ublock()->block_id());
@@ -2004,7 +2004,7 @@ void LIR_OpAllocObj::print_instr(outputStream* out) const {
tmp4()->print(out); out->print(" ");
out->print("[hdr:%d]", header_size()); out->print(" ");
out->print("[obj:%d]", object_size()); out->print(" ");
- out->print("[lbl:0x%x]", stub()->entry());
+ out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry()));
}
void LIR_OpRoundFP::print_instr(outputStream* out) const {
@@ -2037,7 +2037,7 @@ void LIR_OpAllocArray::print_instr(outputStream* out) const {
tmp3()->print(out); out->print(" ");
tmp4()->print(out); out->print(" ");
out->print("[type:0x%x]", type()); out->print(" ");
- out->print("[label:0x%x]", stub()->entry());
+ out->print("[label:" INTPTR_FORMAT "]", p2i(stub()->entry()));
}
@@ -2074,7 +2074,7 @@ void LIR_OpLock::print_instr(outputStream* out) const {
if (_scratch->is_valid()) {
_scratch->print(out); out->print(" ");
}
- out->print("[lbl:0x%x]", stub()->entry());
+ out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry()));
}
#ifdef ASSERT
@@ -2082,7 +2082,7 @@ void LIR_OpAssert::print_instr(outputStream* out) const {
print_condition(out, condition()); out->print(" ");
in_opr1()->print(out); out->print(" ");
in_opr2()->print(out); out->print(", \"");
- out->print(msg()); out->print("\"");
+ out->print("%s", msg()); out->print("\"");
}
#endif
diff --git a/src/share/vm/c1/c1_RangeCheckElimination.cpp b/src/share/vm/c1/c1_RangeCheckElimination.cpp
index 599cedb99..71e9de00b 100644
--- a/src/share/vm/c1/c1_RangeCheckElimination.cpp
+++ b/src/share/vm/c1/c1_RangeCheckElimination.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -62,10 +62,10 @@ RangeCheckEliminator::RangeCheckEliminator(IR *ir) :
_optimistic = ir->compilation()->is_optimistic();
TRACE_RANGE_CHECK_ELIMINATION(
- tty->print_cr("");
+ tty->cr();
tty->print_cr("Range check elimination");
ir->method()->print_name(tty);
- tty->print_cr("");
+ tty->cr();
);
TRACE_RANGE_CHECK_ELIMINATION(
@@ -1024,7 +1024,7 @@ void RangeCheckEliminator::dump_condition_stack(BlockBegin *block) {
tty->print("i%d", phi->id());
tty->print(": ");
bound->print();
- tty->print_cr("");
+ tty->cr();
);
}
});
@@ -1039,7 +1039,7 @@ void RangeCheckEliminator::dump_condition_stack(BlockBegin *block) {
tty->print("i%d", instr->id());
tty->print(": ");
bound->print();
- tty->print_cr("");
+ tty->cr();
);
}
}
@@ -1400,7 +1400,7 @@ Value RangeCheckEliminator::Bound::lower_instr() {
// print
void RangeCheckEliminator::Bound::print() {
- tty->print("");
+ tty->print("%s", "");
if (this->_lower_instr || this->_lower != min_jint) {
if (this->_lower_instr) {
tty->print("i%d", this->_lower_instr->id());
diff --git a/src/share/vm/c1/c1_Runtime1.cpp b/src/share/vm/c1/c1_Runtime1.cpp
index e3bac09c5..b6a93c8ec 100644
--- a/src/share/vm/c1/c1_Runtime1.cpp
+++ b/src/share/vm/c1/c1_Runtime1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -532,8 +532,8 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
if (TraceExceptions) {
ttyLocker ttyl;
ResourceMark rm;
- tty->print_cr("Exception <%s> (0x%x) thrown in compiled method <%s> at PC " PTR_FORMAT " for thread 0x%x",
- exception->print_value_string(), (address)exception(), nm->method()->print_value_string(), pc, thread);
+ tty->print_cr("Exception <%s> (" INTPTR_FORMAT ") thrown in compiled method <%s> at PC " INTPTR_FORMAT " for thread " INTPTR_FORMAT "",
+ exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread));
}
// for AbortVMOnException flag
NOT_PRODUCT(Exceptions::debug_check_abort(exception));
@@ -563,7 +563,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
ttyLocker ttyl;
ResourceMark rm;
tty->print_cr("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT " for exception thrown at PC " PTR_FORMAT,
- thread, continuation, pc);
+ p2i(thread), p2i(continuation), p2i(pc));
}
return continuation;
@@ -970,8 +970,8 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
address copy_buff = stub_location - *byte_skip - *byte_count;
address being_initialized_entry = stub_location - *being_initialized_entry_offset;
if (TracePatching) {
- tty->print_cr(" Patching %s at bci %d at address 0x%x (%s)", Bytecodes::name(code), bci,
- instr_pc, (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass");
+ tty->print_cr(" Patching %s at bci %d at address " INTPTR_FORMAT " (%s)", Bytecodes::name(code), bci,
+ p2i(instr_pc), (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass");
nmethod* caller_code = CodeCache::find_nmethod(caller_frame.pc());
assert(caller_code != NULL, "nmethod not found");
@@ -1430,7 +1430,7 @@ JRT_ENTRY(void, Runtime1::predicate_failed_trap(JavaThread* thread))
methodHandle inlinee = methodHandle(vfst.method());
inlinee->print_short_name(&ss1);
m->print_short_name(&ss2);
- tty->print_cr("Predicate failed trap in method %s at bci %d inlined in %s at pc %x", ss1.as_string(), vfst.bci(), ss2.as_string(), caller_frame.pc());
+ tty->print_cr("Predicate failed trap in method %s at bci %d inlined in %s at pc " INTPTR_FORMAT, ss1.as_string(), vfst.bci(), ss2.as_string(), p2i(caller_frame.pc()));
}
diff --git a/src/share/vm/c1/c1_ValueType.hpp b/src/share/vm/c1/c1_ValueType.hpp
index a0bb5647d..291dd2386 100644
--- a/src/share/vm/c1/c1_ValueType.hpp
+++ b/src/share/vm/c1/c1_ValueType.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -175,7 +175,7 @@ class ValueType: public CompilationResourceObj {
ValueType* join(ValueType* y) const;
// debugging
- void print(outputStream* s = tty) { s->print(name()); }
+ void print(outputStream* s = tty) { s->print("%s", name()); }
};
diff --git a/src/share/vm/ci/bcEscapeAnalyzer.cpp b/src/share/vm/ci/bcEscapeAnalyzer.cpp
index 24b2830ed..c2943e98e 100644
--- a/src/share/vm/ci/bcEscapeAnalyzer.cpp
+++ b/src/share/vm/ci/bcEscapeAnalyzer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1287,10 +1287,10 @@ void BCEscapeAnalyzer::compute_escape_info() {
tty->print_cr("class of method is not initialized.");
else if (_level > MaxBCEAEstimateLevel)
tty->print_cr("level (%d) exceeds MaxBCEAEstimateLevel (%d).",
- _level, MaxBCEAEstimateLevel);
+ _level, (int) MaxBCEAEstimateLevel);
else if (method()->code_size() > MaxBCEAEstimateSize)
- tty->print_cr("code size (%d) exceeds MaxBCEAEstimateSize.",
- method()->code_size(), MaxBCEAEstimateSize);
+ tty->print_cr("code size (%d) exceeds MaxBCEAEstimateSize (%d).",
+ method()->code_size(), (int) MaxBCEAEstimateSize);
else
ShouldNotReachHere();
}
diff --git a/src/share/vm/ci/ciConstant.cpp b/src/share/vm/ci/ciConstant.cpp
index 4955a088f..a059f2c8a 100644
--- a/src/share/vm/ci/ciConstant.cpp
+++ b/src/share/vm/ci/ciConstant.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@ void ciConstant::print() {
tty->print("%d", _value._int);
break;
case T_LONG:
- tty->print(INT64_FORMAT, _value._long);
+ tty->print(INT64_FORMAT, (int64_t)(_value._long));
break;
case T_FLOAT:
tty->print("%f", _value._float);
diff --git a/src/share/vm/ci/ciEnv.cpp b/src/share/vm/ci/ciEnv.cpp
index c0838466c..81f26b4bd 100644
--- a/src/share/vm/ci/ciEnv.cpp
+++ b/src/share/vm/ci/ciEnv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1220,8 +1220,7 @@ void ciEnv::dump_replay_data(int compile_id) {
if (replay_data_file != NULL) {
fileStream replay_data_stream(replay_data_file, /*need_close=*/true);
dump_replay_data(&replay_data_stream);
- tty->print("# Compiler replay data is saved as: ");
- tty->print_cr(buffer);
+ tty->print_cr("# Compiler replay data is saved as: %s", buffer);
} else {
tty->print_cr("# Can't open file to dump replay data.");
}
@@ -1244,7 +1243,7 @@ void ciEnv::dump_inline_data(int compile_id) {
)
replay_data_stream.flush();
tty->print("# Compiler inline data is saved as: ");
- tty->print_cr(buffer);
+ tty->print_cr("%s", buffer);
} else {
tty->print_cr("# Can't open file to dump inline data.");
}
diff --git a/src/share/vm/ci/ciInstanceKlass.cpp b/src/share/vm/ci/ciInstanceKlass.cpp
index f4389da46..f8b39ed79 100644
--- a/src/share/vm/ci/ciInstanceKlass.cpp
+++ b/src/share/vm/ci/ciInstanceKlass.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -292,7 +292,7 @@ bool ciInstanceKlass::is_in_package_impl(const char* packagename, int len) {
// Implementation of the print method.
void ciInstanceKlass::print_impl(outputStream* st) {
ciKlass::print_impl(st);
- GUARDED_VM_ENTRY(st->print(" loader=0x%x", (address)loader());)
+ GUARDED_VM_ENTRY(st->print(" loader=" INTPTR_FORMAT, p2i((address)loader()));)
if (is_loaded()) {
st->print(" loaded=true initialized=%s finalized=%s subklass=%s size=%d flags=",
bool_to_str(is_initialized()),
@@ -618,7 +618,7 @@ class StaticFinalFieldPrinter : public FieldClosure {
case T_SHORT: _out->print_cr("%d", mirror->short_field(fd->offset())); break;
case T_CHAR: _out->print_cr("%d", mirror->char_field(fd->offset())); break;
case T_INT: _out->print_cr("%d", mirror->int_field(fd->offset())); break;
- case T_LONG: _out->print_cr(INT64_FORMAT, mirror->long_field(fd->offset())); break;
+ case T_LONG: _out->print_cr(INT64_FORMAT, (int64_t)(mirror->long_field(fd->offset()))); break;
case T_FLOAT: {
float f = mirror->float_field(fd->offset());
_out->print_cr("%d", *(int*)&f);
@@ -626,7 +626,7 @@ class StaticFinalFieldPrinter : public FieldClosure {
}
case T_DOUBLE: {
double d = mirror->double_field(fd->offset());
- _out->print_cr(INT64_FORMAT, *(jlong*)&d);
+ _out->print_cr(INT64_FORMAT, *(int64_t*)&d);
break;
}
case T_ARRAY: {
@@ -656,7 +656,7 @@ class StaticFinalFieldPrinter : public FieldClosure {
_out->print_cr("\"");
} else {
const char* klass_name = value->klass()->name()->as_quoted_ascii();
- _out->print_cr(klass_name);
+ _out->print_cr("%s", klass_name);
}
} else {
ShouldNotReachHere();
diff --git a/src/share/vm/ci/ciMetadata.cpp b/src/share/vm/ci/ciMetadata.cpp
index fb7387985..efb4f58ae 100644
--- a/src/share/vm/ci/ciMetadata.cpp
+++ b/src/share/vm/ci/ciMetadata.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
void ciMetadata::print(outputStream* st) {
st->print("<%s", type_string());
GUARDED_VM_ENTRY(print_impl(st);)
- st->print(" ident=%d address=0x%x>", ident(), (address)this);
+ st->print(" ident=%d address=" INTPTR_FORMAT ">", ident(), p2i((address)this));
}
diff --git a/src/share/vm/ci/ciMethodData.cpp b/src/share/vm/ci/ciMethodData.cpp
index bc8794063..1b604ba4e 100644
--- a/src/share/vm/ci/ciMethodData.cpp
+++ b/src/share/vm/ci/ciMethodData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -557,7 +557,7 @@ void ciMethodData::dump_replay_data(outputStream* out) {
if (round == 0) {
count++;
} else {
- out->print(" %d %s", dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t), k->name()->as_quoted_ascii());
+ out->print(" %d %s", (int)(dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t)), k->name()->as_quoted_ascii());
}
}
}
@@ -569,7 +569,7 @@ void ciMethodData::dump_replay_data(outputStream* out) {
if (round == 0) {
count++;
} else {
- out->print(" %d %s", dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t), k->name()->as_quoted_ascii());
+ out->print(" %d %s", (int)(dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t)), k->name()->as_quoted_ascii());
}
}
}
diff --git a/src/share/vm/ci/ciObject.cpp b/src/share/vm/ci/ciObject.cpp
index 71aa4302f..c619c3560 100644
--- a/src/share/vm/ci/ciObject.cpp
+++ b/src/share/vm/ci/ciObject.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -214,9 +214,9 @@ void ciObject::init_flags_from(oop x) {
void ciObject::print(outputStream* st) {
st->print("<%s", type_string());
GUARDED_VM_ENTRY(print_impl(st);)
- st->print(" ident=%d %s address=0x%x>", ident(),
+ st->print(" ident=%d %s address=" INTPTR_FORMAT ">", ident(),
is_scavengable() ? "SCAVENGABLE" : "",
- (address)this);
+ p2i((address)this));
}
// ------------------------------------------------------------------
diff --git a/src/share/vm/ci/ciSignature.cpp b/src/share/vm/ci/ciSignature.cpp
index d09cc2fd2..634ca4798 100644
--- a/src/share/vm/ci/ciSignature.cpp
+++ b/src/share/vm/ci/ciSignature.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -148,5 +148,5 @@ void ciSignature::print() {
print_signature();
tty->print(" accessing_klass=");
_accessing_klass->print();
- tty->print(" address=0x%x>", (address)this);
+ tty->print(" address=" INTPTR_FORMAT ">", p2i((address)this));
}
diff --git a/src/share/vm/ci/ciType.cpp b/src/share/vm/ci/ciType.cpp
index 15c884213..43df753cb 100644
--- a/src/share/vm/ci/ciType.cpp
+++ b/src/share/vm/ci/ciType.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -87,7 +87,7 @@ void ciType::print_impl(outputStream* st) {
// Print the name of this type
void ciType::print_name_on(outputStream* st) {
ResourceMark rm;
- st->print(name());
+ st->print("%s", name());
}
diff --git a/src/share/vm/classfile/classFileError.cpp b/src/share/vm/classfile/classFileError.cpp
index a9c55fb73..3c3302fb2 100644
--- a/src/share/vm/classfile/classFileError.cpp
+++ b/src/share/vm/classfile/classFileError.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,9 @@
// Keep these in a separate file to prevent inlining
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED
+
void ClassFileParser::classfile_parse_error(const char* msg, TRAPS) {
ResourceMark rm(THREAD);
Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::java_lang_ClassFormatError(),
@@ -53,6 +56,8 @@ void ClassFileParser::classfile_parse_error(const char* msg, int index, const ch
msg, index, name, _class_name->as_C_string());
}
+PRAGMA_DIAG_POP
+
void StackMapStream::stackmap_format_error(const char* msg, TRAPS) {
ResourceMark rm(THREAD);
Exceptions::fthrow(
diff --git a/src/share/vm/classfile/classFileParser.cpp b/src/share/vm/classfile/classFileParser.cpp
index 4aa7c4fa5..87eca8ea6 100644
--- a/src/share/vm/classfile/classFileParser.cpp
+++ b/src/share/vm/classfile/classFileParser.cpp
@@ -2777,7 +2777,7 @@ void ClassFileParser::parse_classfile_bootstrap_methods_attribute(u4 attribute_b
"Short length on BootstrapMethods in class file %s",
CHECK);
- guarantee_property(attribute_byte_length > sizeof(u2),
+ guarantee_property(attribute_byte_length >= sizeof(u2),
"Invalid BootstrapMethods attribute length %u in class file %s",
attribute_byte_length,
CHECK);
diff --git a/src/share/vm/classfile/classFileParser.hpp b/src/share/vm/classfile/classFileParser.hpp
index 02a4ce20d..8421bb533 100644
--- a/src/share/vm/classfile/classFileParser.hpp
+++ b/src/share/vm/classfile/classFileParser.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -312,7 +312,9 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
if (!b) { classfile_parse_error(msg, CHECK); }
}
- inline void assert_property(bool b, const char* msg, TRAPS) {
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED
+inline void assert_property(bool b, const char* msg, TRAPS) {
#ifdef ASSERT
if (!b) {
ResourceMark rm(THREAD);
@@ -329,6 +331,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
}
#endif
}
+PRAGMA_DIAG_POP
inline void check_property(bool property, const char* msg, int index, TRAPS) {
if (_need_verify) {
diff --git a/src/share/vm/classfile/classLoader.cpp b/src/share/vm/classfile/classLoader.cpp
index c1dcb36db..8366c8fc4 100644
--- a/src/share/vm/classfile/classLoader.cpp
+++ b/src/share/vm/classfile/classLoader.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -343,7 +343,7 @@ static void print_meta_index(LazyClassPathEntry* entry,
tty->print("[Meta index for %s=", entry->name());
for (int i = 0; i < meta_packages.length(); i++) {
if (i > 0) tty->print(" ");
- tty->print(meta_packages.at(i));
+ tty->print("%s", meta_packages.at(i));
}
tty->print_cr("]");
}
@@ -1299,7 +1299,7 @@ void ClassLoader::compile_the_world() {
e = e->next();
}
jlong end = os::javaTimeMillis();
- tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, %d ms)",
+ tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, " JLONG_FORMAT " ms)",
_compile_the_world_class_counter, _compile_the_world_method_counter, (end - start));
{
// Print statistics as if before normal exit:
diff --git a/src/share/vm/classfile/classLoaderData.cpp b/src/share/vm/classfile/classLoaderData.cpp
index 6b34e0150..033a8257d 100644
--- a/src/share/vm/classfile/classLoaderData.cpp
+++ b/src/share/vm/classfile/classLoaderData.cpp
@@ -269,10 +269,10 @@ void ClassLoaderData::add_class(Klass* k) {
ResourceMark rm;
tty->print_cr("[TraceClassLoaderData] Adding k: " PTR_FORMAT " %s to CLD: "
PTR_FORMAT " loader: " PTR_FORMAT " %s",
- k,
+ p2i(k),
k->external_name(),
- k->class_loader_data(),
- (void *)k->class_loader(),
+ p2i(k->class_loader_data()),
+ p2i((void *)k->class_loader()),
loader_name());
}
}
@@ -307,11 +307,11 @@ void ClassLoaderData::unload() {
if (TraceClassLoaderData) {
ResourceMark rm;
- tty->print("[ClassLoaderData: unload loader data "PTR_FORMAT, this);
- tty->print(" for instance "PTR_FORMAT" of %s", (void *)class_loader(),
+ tty->print("[ClassLoaderData: unload loader data " INTPTR_FORMAT, p2i(this));
+ tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()),
loader_name());
if (is_anonymous()) {
- tty->print(" for anonymous class "PTR_FORMAT " ", _klasses);
+ tty->print(" for anonymous class " INTPTR_FORMAT " ", p2i(_klasses));
}
tty->print_cr("]");
}
@@ -469,14 +469,14 @@ const char* ClassLoaderData::loader_name() {
void ClassLoaderData::dump(outputStream * const out) {
ResourceMark rm;
out->print("ClassLoaderData CLD: "PTR_FORMAT", loader: "PTR_FORMAT", loader_klass: "PTR_FORMAT" %s {",
- this, (void *)class_loader(),
- class_loader() != NULL ? class_loader()->klass() : NULL, loader_name());
+ p2i(this), p2i((void *)class_loader()),
+ p2i(class_loader() != NULL ? class_loader()->klass() : NULL), loader_name());
if (claimed()) out->print(" claimed ");
if (is_unloading()) out->print(" unloading ");
- out->print(" handles " INTPTR_FORMAT, handles());
+ out->print(" handles " INTPTR_FORMAT, p2i(handles()));
out->cr();
if (metaspace_or_null() != NULL) {
- out->print_cr("metaspace: " PTR_FORMAT, metaspace_or_null());
+ out->print_cr("metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null()));
metaspace_or_null()->dump(out);
} else {
out->print_cr("metaspace: NULL");
@@ -533,6 +533,8 @@ ClassLoaderData* ClassLoaderDataGraph::_head = NULL;
ClassLoaderData* ClassLoaderDataGraph::_unloading = NULL;
ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL;
+bool ClassLoaderDataGraph::_should_purge = false;
+
// Add a new class loader data node to the list. Assign the newly created
// ClassLoaderData into the java/lang/ClassLoader object as a hidden field
ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRAPS) {
@@ -570,8 +572,8 @@ ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRA
if (TraceClassLoaderData) {
ResourceMark rm;
tty->print("[ClassLoaderData: ");
- tty->print("create class loader data "PTR_FORMAT, cld);
- tty->print(" for instance "PTR_FORMAT" of %s", (void *)cld->class_loader(),
+ tty->print("create class loader data " INTPTR_FORMAT, p2i(cld));
+ tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)cld->class_loader()),
cld->loader_name());
tty->print_cr("]");
}
@@ -655,32 +657,6 @@ GrowableArray<ClassLoaderData*>* ClassLoaderDataGraph::new_clds() {
return array;
}
-// For profiling and hsfind() only. Otherwise, this is unsafe (and slow). This
-// is done lock free to avoid lock inversion problems. It is safe because
-// new ClassLoaderData are added to the end of the CLDG, and only removed at
-// safepoint. The _unloading list can be deallocated concurrently with CMS so
-// this doesn't look in metaspace for classes that have been unloaded.
-bool ClassLoaderDataGraph::contains(const void* x) {
- if (DumpSharedSpaces) {
- // There are only two metaspaces to worry about.
- ClassLoaderData* ncld = ClassLoaderData::the_null_class_loader_data();
- return (ncld->ro_metaspace()->contains(x) || ncld->rw_metaspace()->contains(x));
- }
-
- if (UseSharedSpaces && MetaspaceShared::is_in_shared_space(x)) {
- return true;
- }
-
- for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
- if (cld->metaspace_or_null() != NULL && cld->metaspace_or_null()->contains(x)) {
- return true;
- }
- }
-
- // Do not check unloading list because deallocation can be concurrent.
- return false;
-}
-
#ifndef PRODUCT
bool ClassLoaderDataGraph::contains_loader_data(ClassLoaderData* loader_data) {
for (ClassLoaderData* data = _head; data != NULL; data = data->next()) {
@@ -739,6 +715,7 @@ bool ClassLoaderDataGraph::do_unloading(BoolObjectClosure* is_alive_closure) {
}
void ClassLoaderDataGraph::purge() {
+ assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
ClassLoaderData* list = _unloading;
_unloading = NULL;
ClassLoaderData* next = list;
@@ -827,7 +804,7 @@ void ClassLoaderData::print_value_on(outputStream* out) const {
if (class_loader() == NULL) {
out->print("NULL class_loader");
} else {
- out->print("class loader "PTR_FORMAT, this);
+ out->print("class loader " INTPTR_FORMAT, p2i(this));
class_loader()->print_value_on(out);
}
}
diff --git a/src/share/vm/classfile/classLoaderData.hpp b/src/share/vm/classfile/classLoaderData.hpp
index 3fcbb6b7d..adb8e95bd 100644
--- a/src/share/vm/classfile/classLoaderData.hpp
+++ b/src/share/vm/classfile/classLoaderData.hpp
@@ -66,6 +66,7 @@ class ClassLoaderDataGraph : public AllStatic {
static ClassLoaderData* _unloading;
// CMS support.
static ClassLoaderData* _saved_head;
+ static bool _should_purge;
static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS);
static void post_class_unload_events(void);
@@ -86,12 +87,20 @@ class ClassLoaderDataGraph : public AllStatic {
static void remember_new_clds(bool remember) { _saved_head = (remember ? _head : NULL); }
static GrowableArray<ClassLoaderData*>* new_clds();
+ static void set_should_purge(bool b) { _should_purge = b; }
+ static void purge_if_needed() {
+ // Only purge the CLDG for CMS if concurrent sweep is complete.
+ if (_should_purge) {
+ purge();
+ // reset for next time.
+ set_should_purge(false);
+ }
+ }
+
static void dump_on(outputStream * const out) PRODUCT_RETURN;
static void dump() { dump_on(tty); }
static void verify();
- // expensive test for pointer in metaspace for debugging
- static bool contains(const void* x);
#ifndef PRODUCT
static bool contains_loader_data(ClassLoaderData* loader_data);
#endif
diff --git a/src/share/vm/classfile/defaultMethods.cpp b/src/share/vm/classfile/defaultMethods.cpp
index b5e4da63f..1b56ff2fb 100644
--- a/src/share/vm/classfile/defaultMethods.cpp
+++ b/src/share/vm/classfile/defaultMethods.cpp
@@ -436,7 +436,7 @@ class MethodFamily : public ResourceObj {
_exception_name = vmSymbols::java_lang_IncompatibleClassChangeError();
if (TraceDefaultMethods) {
_exception_message->print_value_on(tty);
- tty->print_cr("");
+ tty->cr();
}
}
}
@@ -463,7 +463,7 @@ class MethodFamily : public ResourceObj {
if (_members.at(i).second == DISQUALIFIED) {
str->print(" (disqualified)");
}
- str->print_cr("");
+ str->cr();
}
if (_selected_target != NULL) {
@@ -480,7 +480,7 @@ class MethodFamily : public ResourceObj {
if (!method_holder->is_interface()) {
tty->print(" : in superclass");
}
- str->print_cr("");
+ str->cr();
}
void print_exception(outputStream* str, int indent) {
@@ -688,7 +688,7 @@ static GrowableArray<EmptyVtableSlot*>* find_empty_vtable_slots(
for (int i = 0; i < slots->length(); ++i) {
tty->indent();
slots->at(i)->print_on(tty);
- tty->print_cr("");
+ tty->cr();
}
}
#endif // ndef PRODUCT
@@ -828,7 +828,7 @@ void DefaultMethods::generate_default_methods(
streamIndentor si(tty, 2);
tty->indent().print("Looking for default methods for slot ");
slot->print_on(tty);
- tty->print_cr("");
+ tty->cr();
}
#endif // ndef PRODUCT
@@ -946,7 +946,7 @@ static void create_defaults_and_exceptions(
if (TraceDefaultMethods) {
tty->print("for slot: ");
slot->print_on(tty);
- tty->print_cr("");
+ tty->cr();
if (method->has_target()) {
method->print_selected(tty, 1);
} else if (method->throws_exception()) {
diff --git a/src/share/vm/classfile/dictionary.cpp b/src/share/vm/classfile/dictionary.cpp
index 9a2bb74f8..b7b4f359f 100644
--- a/src/share/vm/classfile/dictionary.cpp
+++ b/src/share/vm/classfile/dictionary.cpp
@@ -30,6 +30,7 @@
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "utilities/hashtable.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
DictionaryEntry* Dictionary::_current_class_entry = NULL;
int Dictionary::_current_class_index = 0;
diff --git a/src/share/vm/classfile/dictionary.hpp b/src/share/vm/classfile/dictionary.hpp
index 17d916f06..bc25c811c 100644
--- a/src/share/vm/classfile/dictionary.hpp
+++ b/src/share/vm/classfile/dictionary.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -379,7 +379,7 @@ class SymbolPropertyEntry : public HashtableEntry<Symbol*, mtSymbol> {
}
if (method_type() != NULL) {
if (printed) st->print(" and ");
- st->print(INTPTR_FORMAT, (void *)method_type());
+ st->print(INTPTR_FORMAT, p2i((void *)method_type()));
printed = true;
}
st->print_cr(printed ? "" : "(empty)");
diff --git a/src/share/vm/classfile/javaClasses.cpp b/src/share/vm/classfile/javaClasses.cpp
index 29339c375..4a84c5fba 100644
--- a/src/share/vm/classfile/javaClasses.cpp
+++ b/src/share/vm/classfile/javaClasses.cpp
@@ -51,6 +51,8 @@
#include "runtime/vframe.hpp"
#include "utilities/preserveException.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#define INJECTED_FIELD_COMPUTE_OFFSET(klass, name, signature, may_be_java) \
klass::_##name##_offset = JavaClasses::compute_injected_offset(JavaClasses::klass##_##name##_enum);
@@ -1481,7 +1483,7 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) {
while (h_throwable.not_null()) {
objArrayHandle result (THREAD, objArrayOop(backtrace(h_throwable())));
if (result.is_null()) {
- st->print_cr(no_stack_trace_message());
+ st->print_cr("%s", no_stack_trace_message());
return;
}
diff --git a/src/share/vm/classfile/symbolTable.cpp b/src/share/vm/classfile/symbolTable.cpp
index e7c1a73e0..748a82e04 100644
--- a/src/share/vm/classfile/symbolTable.cpp
+++ b/src/share/vm/classfile/symbolTable.cpp
@@ -39,6 +39,8 @@
#include "gc_implementation/g1/g1StringDedup.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// --------------------------------------------------------------------------
// the number of buckets a thread claims
diff --git a/src/share/vm/classfile/systemDictionary.cpp b/src/share/vm/classfile/systemDictionary.cpp
index aa8121595..b2754ed35 100644
--- a/src/share/vm/classfile/systemDictionary.cpp
+++ b/src/share/vm/classfile/systemDictionary.cpp
@@ -2268,7 +2268,7 @@ static methodHandle unpack_method_and_appendix(Handle mname,
oop appendix = appendix_box->obj_at(0);
if (TraceMethodHandles) {
#ifndef PRODUCT
- tty->print("Linked method="INTPTR_FORMAT": ", m);
+ tty->print("Linked method=" INTPTR_FORMAT ": ", p2i(m));
m->print();
if (appendix != NULL) { tty->print("appendix = "); appendix->print(); }
tty->cr();
diff --git a/src/share/vm/classfile/verifier.cpp b/src/share/vm/classfile/verifier.cpp
index c75a29d0f..6ddf93651 100644
--- a/src/share/vm/classfile/verifier.cpp
+++ b/src/share/vm/classfile/verifier.cpp
@@ -364,7 +364,7 @@ void TypeOrigin::print_on(outputStream* str) const {
void ErrorContext::details(outputStream* ss, const Method* method) const {
if (is_valid()) {
- ss->print_cr("");
+ ss->cr();
ss->print_cr("Exception Details:");
location_details(ss, method);
reason_details(ss);
@@ -379,7 +379,7 @@ void ErrorContext::reason_details(outputStream* ss) const {
streamIndentor si(ss);
ss->indent().print_cr("Reason:");
streamIndentor si2(ss);
- ss->indent().print("");
+ ss->indent().print("%s", "");
switch (_fault) {
case INVALID_BYTECODE:
ss->print("Error exists in the bytecode");
@@ -432,7 +432,7 @@ void ErrorContext::reason_details(outputStream* ss) const {
ShouldNotReachHere();
ss->print_cr("Unknown");
}
- ss->print_cr("");
+ ss->cr();
}
void ErrorContext::location_details(outputStream* ss, const Method* method) const {
@@ -507,7 +507,7 @@ void ErrorContext::stackmap_details(outputStream* ss, const Method* method) cons
for (u2 i = 0; i < sm_table->number_of_entries(); ++i) {
ss->indent();
sm_frame->print_on(ss, current_offset);
- ss->print_cr("");
+ ss->cr();
current_offset += sm_frame->offset_delta();
sm_frame = sm_frame->next();
}
@@ -579,7 +579,8 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) {
tty->print_cr("Verifying method %s", m->name_and_sig_as_C_string());
}
- const char* bad_type_msg = "Bad type on operand stack in %s";
+// For clang, the only good constant format string is a literal constant format string.
+#define bad_type_msg "Bad type on operand stack in %s"
int32_t max_stack = m->verifier_max_stack();
int32_t max_locals = m->max_locals();
@@ -1676,6 +1677,8 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) {
}
}
+#undef bad_type_message
+
char* ClassVerifier::generate_code_data(methodHandle m, u4 code_length, TRAPS) {
char* code_data = NEW_RESOURCE_ARRAY(char, code_length);
memset(code_data, 0, sizeof(char) * code_length);
@@ -2363,11 +2366,12 @@ void ClassVerifier::verify_invoke_instructions(
if (opcode == Bytecodes::_invokedynamic) {
if (!EnableInvokeDynamic ||
_klass->major_version() < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
- class_format_error(
- (!EnableInvokeDynamic ?
- "invokedynamic instructions not enabled in this JVM" :
- "invokedynamic instructions not supported by this class file version"),
- _klass->external_name());
+ if (!EnableInvokeDynamic) {
+ class_format_error("invokedynamic instructions not enabled in this JVM");
+ } else {
+ class_format_error("invokedynamic instructions not supported by this class file version (%d), class %s",
+ _klass->major_version(), _klass->external_name());
+ }
return;
}
} else {
diff --git a/src/share/vm/classfile/verifier.hpp b/src/share/vm/classfile/verifier.hpp
index 74143a6e7..557f567bf 100644
--- a/src/share/vm/classfile/verifier.hpp
+++ b/src/share/vm/classfile/verifier.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -375,15 +375,15 @@ class ClassVerifier : public StackObj {
bool has_error() const { return result() != NULL; }
char* exception_message() {
stringStream ss;
- ss.print(_message);
+ ss.print("%s", _message);
_error_context.details(&ss, _method());
return ss.as_string();
}
// Called when verify or class format errors are encountered.
// May throw an exception based upon the mode.
- void verify_error(ErrorContext ctx, const char* fmt, ...);
- void class_format_error(const char* fmt, ...);
+ void verify_error(ErrorContext ctx, const char* fmt, ...) ATTRIBUTE_PRINTF(3, 4);
+ void class_format_error(const char* fmt, ...) ATTRIBUTE_PRINTF(2, 3);
Klass* load_class(Symbol* name, TRAPS);
diff --git a/src/share/vm/classfile/vmSymbols.cpp b/src/share/vm/classfile/vmSymbols.cpp
index 855c6bdd7..6d13995c5 100644
--- a/src/share/vm/classfile/vmSymbols.cpp
+++ b/src/share/vm/classfile/vmSymbols.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -533,7 +533,7 @@ void vmIntrinsics::verify_method(ID actual_id, Method* m) {
xtty->begin_elem("intrinsic_misdeclared actual='%s' declared='%s'",
actual_name, declared_name);
xtty->method(mh);
- xtty->end_elem("");
+ xtty->end_elem("%s", "");
}
if (PrintMiscellaneous && (WizardMode || Verbose)) {
tty->print_cr("*** misidentified method; %s(%d) should be %s(%d):",
diff --git a/src/share/vm/code/codeBlob.cpp b/src/share/vm/code/codeBlob.cpp
index 141bbae00..f9e78bfb9 100644
--- a/src/share/vm/code/codeBlob.cpp
+++ b/src/share/vm/code/codeBlob.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -530,7 +530,7 @@ void CodeBlob::verify() {
}
void CodeBlob::print_on(outputStream* st) const {
- st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", this);
+ st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", p2i(this));
st->print_cr("Framesize: %d", _frame_size);
}
@@ -548,7 +548,7 @@ void BufferBlob::print_on(outputStream* st) const {
}
void BufferBlob::print_value_on(outputStream* st) const {
- st->print_cr("BufferBlob (" INTPTR_FORMAT ") used for %s", this, name());
+ st->print_cr("BufferBlob (" INTPTR_FORMAT ") used for %s", p2i(this), name());
}
void RuntimeStub::verify() {
@@ -558,13 +558,13 @@ void RuntimeStub::verify() {
void RuntimeStub::print_on(outputStream* st) const {
ttyLocker ttyl;
CodeBlob::print_on(st);
- st->print("Runtime Stub (" INTPTR_FORMAT "): ", this);
- st->print_cr(name());
+ st->print("Runtime Stub (" INTPTR_FORMAT "): ", p2i(this));
+ st->print_cr("%s", name());
Disassembler::decode((CodeBlob*)this, st);
}
void RuntimeStub::print_value_on(outputStream* st) const {
- st->print("RuntimeStub (" INTPTR_FORMAT "): ", this); st->print(name());
+ st->print("RuntimeStub (" INTPTR_FORMAT "): ", p2i(this)); st->print("%s", name());
}
void SingletonBlob::verify() {
@@ -574,12 +574,12 @@ void SingletonBlob::verify() {
void SingletonBlob::print_on(outputStream* st) const {
ttyLocker ttyl;
CodeBlob::print_on(st);
- st->print_cr(name());
+ st->print_cr("%s", name());
Disassembler::decode((CodeBlob*)this, st);
}
void SingletonBlob::print_value_on(outputStream* st) const {
- st->print_cr(name());
+ st->print_cr("%s", name());
}
void DeoptimizationBlob::print_value_on(outputStream* st) const {
diff --git a/src/share/vm/code/codeCache.cpp b/src/share/vm/code/codeCache.cpp
index fcdab3d5a..9ba6ef02a 100644
--- a/src/share/vm/code/codeCache.cpp
+++ b/src/share/vm/code/codeCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -81,10 +81,10 @@ class CodeBlob_sizes {
bool is_empty() { return count == 0; }
void print(const char* title) {
- tty->print_cr(" #%d %s = %dK (hdr %d%%, loc %d%%, code %d%%, stub %d%%, [oops %d%%, data %d%%, pcs %d%%])",
+ tty->print_cr(" #%d %s = %dK (hdr %d%%, loc %d%%, code %d%%, stub %d%%, [oops %d%%, metadata %d%%, data %d%%, pcs %d%%])",
count,
title,
- total() / K,
+ (int)(total() / K),
header_size * 100 / total_size,
relocation_size * 100 / total_size,
code_size * 100 / total_size,
@@ -191,7 +191,7 @@ CodeBlob* CodeCache::allocate(int size, bool is_critical) {
}
if (PrintCodeCacheExtension) {
ResourceMark rm;
- tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (%d bytes)",
+ tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" SSIZE_FORMAT " bytes)",
(intptr_t)_heap->low_boundary(), (intptr_t)_heap->high(),
(address)_heap->high() - (address)_heap->low_boundary());
}
@@ -496,7 +496,7 @@ void CodeCache::gc_epilogue() {
if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc())) {
CompiledIC *ic = CompiledIC_at(iter.reloc());
if (TraceCompiledIC) {
- tty->print("noticed icholder " INTPTR_FORMAT " ", ic->cached_icholder());
+ tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder()));
ic->print();
}
assert(ic->cached_icholder() != NULL, "must be non-NULL");
@@ -775,7 +775,7 @@ void CodeCache::print_trace(const char* event, CodeBlob* cb, int size) {
if (PrintCodeCache2) { // Need to add a new flag
ResourceMark rm;
if (size == 0) size = cb->size();
- tty->print_cr("CodeCache %s: addr: " INTPTR_FORMAT ", size: 0x%x", event, cb, size);
+ tty->print_cr("CodeCache %s: addr: " INTPTR_FORMAT ", size: 0x%x", event, p2i(cb), size);
}
}
@@ -900,7 +900,7 @@ void CodeCache::print() {
tty->print_cr("CodeCache:");
- tty->print_cr("nmethod dependency checking time %f", dependentCheckTime.seconds(),
+ tty->print_cr("nmethod dependency checking time %f, per dependent %f", dependentCheckTime.seconds(),
dependentCheckTime.seconds() / dependentCheckCount);
if (!live.is_empty()) {
@@ -947,9 +947,9 @@ void CodeCache::print_summary(outputStream* st, bool detailed) {
if (detailed) {
st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]",
- _heap->low_boundary(),
- _heap->high(),
- _heap->high_boundary());
+ p2i(_heap->low_boundary()),
+ p2i(_heap->high()),
+ p2i(_heap->high_boundary()));
st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT
" adapters=" UINT32_FORMAT,
nof_blobs(), nof_nmethods(), nof_adapters());
diff --git a/src/share/vm/code/compiledIC.cpp b/src/share/vm/code/compiledIC.cpp
index 251a4c79c..9a0381646 100644
--- a/src/share/vm/code/compiledIC.cpp
+++ b/src/share/vm/code/compiledIC.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -88,9 +88,9 @@ void CompiledIC::internal_set_ic_destination(address entry_point, bool is_icstub
if (TraceCompiledIC) {
tty->print(" ");
print_compiled_ic();
- tty->print(" changing destination to " INTPTR_FORMAT, entry_point);
+ tty->print(" changing destination to " INTPTR_FORMAT, p2i(entry_point));
if (!is_optimized()) {
- tty->print(" changing cached %s to " INTPTR_FORMAT, is_icholder ? "icholder" : "metadata", (address)cache);
+ tty->print(" changing cached %s to " INTPTR_FORMAT, is_icholder ? "icholder" : "metadata", p2i((address)cache));
}
if (is_icstub) {
tty->print(" (icstub)");
@@ -195,7 +195,7 @@ bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod
if (TraceICs) {
ResourceMark rm;
tty->print_cr ("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT,
- instruction_address(), call_info->selected_method()->print_value_string(), entry);
+ p2i(instruction_address()), call_info->selected_method()->print_value_string(), p2i(entry));
}
// We can't check this anymore. With lazy deopt we could have already
@@ -272,7 +272,7 @@ bool CompiledIC::is_call_to_interpreted() const {
void CompiledIC::set_to_clean() {
assert(SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->is_locked() , "MT-unsafe call");
if (TraceInlineCacheClearing || TraceICs) {
- tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", instruction_address());
+ tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", p2i(instruction_address()));
print();
}
@@ -354,7 +354,7 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
if (TraceICs) {
ResourceMark rm(thread);
tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter: %s",
- instruction_address(),
+ p2i(instruction_address()),
method->print_value_string());
}
} else {
@@ -362,7 +362,7 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
InlineCacheBuffer::create_transition_stub(this, info.claim_cached_icholder(), info.entry());
if (TraceICs) {
ResourceMark rm(thread);
- tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", instruction_address());
+ tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", p2i(instruction_address()));
}
}
} else {
@@ -392,7 +392,7 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
ResourceMark rm(thread);
assert(info.cached_metadata() == NULL || info.cached_metadata()->is_klass(), "must be");
tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to compiled (rcvr klass) %s: %s",
- instruction_address(),
+ p2i(instruction_address()),
((Klass*)info.cached_metadata())->print_value_string(),
(safe) ? "" : "via stub");
}
@@ -530,8 +530,8 @@ void CompiledStaticCall::set(const StaticCallInfo& info) {
if (TraceICs) {
ResourceMark rm;
tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_compiled " INTPTR_FORMAT,
- instruction_address(),
- info.entry());
+ p2i(instruction_address()),
+ p2i(info.entry()));
}
// Call to compiled code
assert (CodeCache::contains(info.entry()), "wrong entry point");
@@ -600,11 +600,11 @@ void CompiledIC::print() {
void CompiledIC::print_compiled_ic() {
tty->print("Inline cache at " INTPTR_FORMAT ", calling %s " INTPTR_FORMAT " cached_value " INTPTR_FORMAT,
- instruction_address(), is_call_to_interpreted() ? "interpreted " : "", ic_destination(), is_optimized() ? NULL : cached_value());
+ p2i(instruction_address()), is_call_to_interpreted() ? "interpreted " : "", p2i(ic_destination()), p2i(is_optimized() ? NULL : cached_value()));
}
void CompiledStaticCall::print() {
- tty->print("static call at " INTPTR_FORMAT " -> ", instruction_address());
+ tty->print("static call at " INTPTR_FORMAT " -> ", p2i(instruction_address()));
if (is_clean()) {
tty->print("clean");
} else if (is_call_to_compiled()) {
diff --git a/src/share/vm/code/compressedStream.cpp b/src/share/vm/code/compressedStream.cpp
index 1716ffac6..4687372f8 100644
--- a/src/share/vm/code/compressedStream.cpp
+++ b/src/share/vm/code/compressedStream.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -212,6 +212,8 @@ static jlong stretch(jint x, int bits) {
return h ^ l;
}
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_IGNORED // Someone needs to deal with this.
void test_compressed_stream(int trace) {
CompressedWriteStream bytes(stretch_limit * 100);
jint n;
@@ -275,6 +277,7 @@ void test_compressed_stream(int trace) {
guarantee(length == length2, "bad length");
guarantee(fails == 0, "test failures");
}
+PRAGMA_DIAG_POP
#if defined(_MSC_VER) &&_MSC_VER >=1400 && !defined(_WIN64)
#pragma warning(default: 4748)
diff --git a/src/share/vm/code/debugInfo.cpp b/src/share/vm/code/debugInfo.cpp
index ecdae4610..3b01884c6 100644
--- a/src/share/vm/code/debugInfo.cpp
+++ b/src/share/vm/code/debugInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,9 @@
#include "code/nmethod.hpp"
#include "runtime/handles.inline.hpp"
-// Comstructors
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
+// Constructors
DebugInfoWriteStream::DebugInfoWriteStream(DebugInformationRecorder* recorder, int initial_size)
: CompressedWriteStream(initial_size) {
diff --git a/src/share/vm/code/exceptionHandlerTable.cpp b/src/share/vm/code/exceptionHandlerTable.cpp
index 9e2590082..511b84d22 100644
--- a/src/share/vm/code/exceptionHandlerTable.cpp
+++ b/src/share/vm/code/exceptionHandlerTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
#include "code/nmethod.hpp"
#include "memory/allocation.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
void ExceptionHandlerTable::add_entry(HandlerTableEntry entry) {
_nesting.check();
if (_length >= _size) {
diff --git a/src/share/vm/code/icBuffer.cpp b/src/share/vm/code/icBuffer.cpp
index 81ef87ce2..0fe6e0d11 100644
--- a/src/share/vm/code/icBuffer.cpp
+++ b/src/share/vm/code/icBuffer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
#include "runtime/mutexLocker.hpp"
#include "runtime/stubRoutines.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
DEF_STUB_INTERFACE(ICStub);
diff --git a/src/share/vm/code/nmethod.cpp b/src/share/vm/code/nmethod.cpp
index 8d7ae402c..003bb301e 100644
--- a/src/share/vm/code/nmethod.cpp
+++ b/src/share/vm/code/nmethod.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,8 @@
#include "shark/sharkCompiler.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#ifdef DTRACE_ENABLED
// Only bother with this argument setup if dtrace is available
diff --git a/src/share/vm/code/pcDesc.cpp b/src/share/vm/code/pcDesc.cpp
index 7ba25464f..7f27cc0c0 100644
--- a/src/share/vm/code/pcDesc.cpp
+++ b/src/share/vm/code/pcDesc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
#include "code/scopeDesc.hpp"
#include "memory/resourceArea.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
PcDesc::PcDesc(int pc_offset, int scope_decode_offset, int obj_decode_offset) {
_pc_offset = pc_offset;
_scope_decode_offset = scope_decode_offset;
diff --git a/src/share/vm/code/relocInfo.cpp b/src/share/vm/code/relocInfo.cpp
index 7cff27f08..aa0ef6b10 100644
--- a/src/share/vm/code/relocInfo.cpp
+++ b/src/share/vm/code/relocInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
#include "runtime/stubCodeGenerator.hpp"
#include "utilities/copy.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
const RelocationHolder RelocationHolder::none; // its type is relocInfo::none
diff --git a/src/share/vm/code/scopeDesc.cpp b/src/share/vm/code/scopeDesc.cpp
index b1c3ccef7..7e557afcd 100644
--- a/src/share/vm/code/scopeDesc.cpp
+++ b/src/share/vm/code/scopeDesc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
#include "oops/oop.inline.hpp"
#include "runtime/handles.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool return_oop) {
_code = code;
diff --git a/src/share/vm/code/vtableStubs.cpp b/src/share/vm/code/vtableStubs.cpp
index b3bfc258f..ac99da40e 100644
--- a/src/share/vm/code/vtableStubs.cpp
+++ b/src/share/vm/code/vtableStubs.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
#include "opto/matcher.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// -----------------------------------------------------------------------------------------
// Implementation of VtableStub
diff --git a/src/share/vm/compiler/compileBroker.cpp b/src/share/vm/compiler/compileBroker.cpp
index a6c9117e9..c5d1f8ff2 100644
--- a/src/share/vm/compiler/compileBroker.cpp
+++ b/src/share/vm/compiler/compileBroker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -206,7 +206,7 @@ class CompilationLog : public StringEventLog {
void log_nmethod(JavaThread* thread, nmethod* nm) {
log(thread, "nmethod %d%s " INTPTR_FORMAT " code ["INTPTR_FORMAT ", " INTPTR_FORMAT "]",
nm->compile_id(), nm->is_osr_method() ? "%" : "",
- nm, nm->code_begin(), nm->code_end());
+ p2i(nm), p2i(nm->code_begin()), p2i(nm->code_end()));
}
void log_failure(JavaThread* thread, CompileTask* task, const char* reason, const char* retry_message) {
@@ -1791,7 +1791,7 @@ void CompileBroker::init_compiler_thread_log() {
if (xtty != NULL) {
ttyLocker ttyl;
// Record any per thread log files
- xtty->elem("thread_logfile thread='%d' filename='%s'", thread_id, file_name);
+ xtty->elem("thread_logfile thread='" INTX_FORMAT "' filename='%s'", thread_id, file_name);
}
return;
}
@@ -1822,7 +1822,7 @@ void CompileBroker::maybe_block() {
if (_should_block) {
#ifndef PRODUCT
if (PrintCompilation && (Verbose || WizardMode))
- tty->print_cr("compiler thread " INTPTR_FORMAT " poll detects block request", Thread::current());
+ tty->print_cr("compiler thread " INTPTR_FORMAT " poll detects block request", p2i(Thread::current()));
#endif
ThreadInVMfromNative tivfn(JavaThread::current());
}
@@ -1839,7 +1839,7 @@ static void codecache_print(bool detailed)
CodeCache::print_summary(&s, detailed);
}
ttyLocker ttyl;
- tty->print(s.as_string());
+ tty->print("%s", s.as_string());
}
// ------------------------------------------------------------------
@@ -2044,7 +2044,7 @@ void CompileBroker::handle_full_code_cache() {
// Lock to prevent tearing
ttyLocker ttyl;
xtty->begin_elem("code_cache_full");
- xtty->print(s.as_string());
+ xtty->print("%s", s.as_string());
xtty->stamp();
xtty->end_elem();
}
diff --git a/src/share/vm/compiler/compileLog.cpp b/src/share/vm/compiler/compileLog.cpp
index bff35b173..9def25c08 100644
--- a/src/share/vm/compiler/compileLog.cpp
+++ b/src/share/vm/compiler/compileLog.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -294,7 +294,7 @@ void CompileLog::finish_log(outputStream* file) {
// Print about successful method inlining.
void CompileLog::inline_success(const char* reason) {
begin_elem("inline_success reason='");
- text(reason);
+ text("%s", reason);
end_elem("'");
}
@@ -304,7 +304,7 @@ void CompileLog::inline_success(const char* reason) {
// Print about failed method inlining.
void CompileLog::inline_fail(const char* reason) {
begin_elem("inline_fail reason='");
- text(reason);
+ text("%s", reason);
end_elem("'");
}
@@ -330,5 +330,5 @@ void CompileLog::set_context(const char* format, ...) {
void CompileLog::code_cache_state() {
begin_elem("code_cache");
CodeCache::log_state(this);
- end_elem("");
+ end_elem("%s", "");
}
diff --git a/src/share/vm/compiler/compileLog.hpp b/src/share/vm/compiler/compileLog.hpp
index d0fe07be9..4364ccf7f 100644
--- a/src/share/vm/compiler/compileLog.hpp
+++ b/src/share/vm/compiler/compileLog.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@ class CompileLog : public xmlStream {
static CompileLog* _first; // head of static chain
- void va_tag(bool push, const char* format, va_list ap);
+ void va_tag(bool push, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0);
public:
CompileLog(const char* file_name, FILE* fp, intx thread_id);
@@ -68,7 +68,7 @@ class CompileLog : public xmlStream {
// or reset, context string will be silently ignored
stringStream* context() { return &_context; }
void clear_context() { context()->reset(); }
- void set_context(const char* format, ...);
+ void set_context(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
void name(ciSymbol* s); // name='s'
void name(Symbol* s) { xmlStream::name(s); }
diff --git a/src/share/vm/compiler/compilerOracle.cpp b/src/share/vm/compiler/compilerOracle.cpp
index cb5068dc4..4249fa1f6 100644
--- a/src/share/vm/compiler/compilerOracle.cpp
+++ b/src/share/vm/compiler/compilerOracle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -539,7 +539,7 @@ void CompilerOracle::parse_from_line(char* line) {
tty->print_cr("CompilerOracle: unrecognized line");
tty->print_cr(" \"%s\"", original_line);
if (error_msg != NULL) {
- tty->print_cr(error_msg);
+ tty->print_cr("%s", error_msg);
}
}
}
@@ -661,7 +661,7 @@ void CompilerOracle::parse_compile_only(char * line) {
char method_sep = have_colon ? ':' : '.';
if (Verbose) {
- tty->print_cr(line);
+ tty->print_cr("%s", line);
}
ResourceMark rm;
diff --git a/src/share/vm/compiler/disassembler.cpp b/src/share/vm/compiler/disassembler.cpp
index 8495210c3..0e9c14c15 100644
--- a/src/share/vm/compiler/disassembler.cpp
+++ b/src/share/vm/compiler/disassembler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -51,6 +51,8 @@
#include "shark/sharkEntry.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
void* Disassembler::_library = NULL;
bool Disassembler::_tried_to_load_library = false;
@@ -411,6 +413,7 @@ static void* event_to_env(void* env_pv, const char* event, void* arg) {
return env->handle_event(event, (address) arg);
}
+ATTRIBUTE_PRINTF(2, 3)
static int printf_to_env(void* env_pv, const char* format, ...) {
decode_env* env = (decode_env*) env_pv;
outputStream* st = env->output();
diff --git a/src/share/vm/compiler/methodLiveness.cpp b/src/share/vm/compiler/methodLiveness.cpp
index 4fcc56133..0c1d9b092 100644
--- a/src/share/vm/compiler/methodLiveness.cpp
+++ b/src/share/vm/compiler/methodLiveness.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,8 @@
#include "memory/allocation.inline.hpp"
#include "utilities/bitMap.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// The MethodLiveness class performs a simple liveness analysis on a method
// in order to decide which locals are live (that is, will be used again) at
// a particular bytecode index (bci).
diff --git a/src/share/vm/compiler/oopMap.cpp b/src/share/vm/compiler/oopMap.cpp
index 617909960..0989ac55d 100644
--- a/src/share/vm/compiler/oopMap.cpp
+++ b/src/share/vm/compiler/oopMap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -646,8 +646,8 @@ void DerivedPointerTable::add(oop *derived_loc, oop *base_loc) {
tty->print_cr(
"Add derived pointer@" INTPTR_FORMAT
" - Derived: " INTPTR_FORMAT
- " Base: " INTPTR_FORMAT " (@" INTPTR_FORMAT ") (Offset: %d)",
- derived_loc, (address)*derived_loc, (address)*base_loc, base_loc, offset
+ " Base: " INTPTR_FORMAT " (@" INTPTR_FORMAT ") (Offset: " INTX_FORMAT ")",
+ p2i(derived_loc), p2i((address)*derived_loc), p2i((address)*base_loc), p2i(base_loc), offset
);
}
// Set derived oop location to point to base.
@@ -674,8 +674,8 @@ void DerivedPointerTable::update_pointers() {
if (TraceDerivedPointers) {
tty->print_cr("Updating derived pointer@" INTPTR_FORMAT
- " - Derived: " INTPTR_FORMAT " Base: " INTPTR_FORMAT " (Offset: %d)",
- derived_loc, (address)*derived_loc, (address)base, offset);
+ " - Derived: " INTPTR_FORMAT " Base: " INTPTR_FORMAT " (Offset: " INTX_FORMAT ")",
+ p2i(derived_loc), p2i((address)*derived_loc), p2i((address)base), offset);
}
// Delete entry
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp
index 2e5b6caa7..a1627a3a0 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -157,7 +157,7 @@ void AdaptiveFreeList<Chunk>::verify_stats() const {
" split_deaths(" SIZE_FORMAT ")"
" coal_deaths(" SIZE_FORMAT ")"
" + count(" SSIZE_FORMAT ")",
- this, size(), _allocation_stats.prev_sweep(), _allocation_stats.split_births(),
+ p2i(this), size(), _allocation_stats.prev_sweep(), _allocation_stats.split_births(),
_allocation_stats.split_births(), _allocation_stats.split_deaths(),
_allocation_stats.coal_deaths(), count()));
}
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
index 255d0f236..61afb75fc 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -427,7 +427,7 @@ size_t CompactibleFreeListSpace::max_alloc_in_words() const {
void LinearAllocBlock::print_on(outputStream* st) const {
st->print_cr(" LinearAllocBlock: ptr = " PTR_FORMAT ", word_size = " SIZE_FORMAT
", refillsize = " SIZE_FORMAT ", allocation_size_limit = " SIZE_FORMAT,
- _ptr, _word_size, _refillSize, _allocation_size_limit);
+ p2i(_ptr), _word_size, _refillSize, _allocation_size_limit);
}
void CompactibleFreeListSpace::print_on(outputStream* st) const {
@@ -458,7 +458,7 @@ const {
for (FreeChunk* fc = _indexedFreeList[i].head(); fc != NULL;
fc = fc->next()) {
gclog_or_tty->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ") %s",
- fc, (HeapWord*)fc + i,
+ p2i(fc), p2i((HeapWord*)fc + i),
fc->cantCoalesce() ? "\t CC" : "");
}
}
@@ -502,7 +502,7 @@ size_t BlkPrintingClosure::do_blk(HeapWord* addr) {
if (_sp->block_is_obj(addr)) {
const bool dead = _post_remark && !_live_bit_map->isMarked(addr);
_st->print_cr(PTR_FORMAT ": %s object of size " SIZE_FORMAT "%s",
- addr,
+ p2i(addr),
dead ? "dead" : "live",
sz,
(!dead && CMSPrintObjectsInDump) ? ":" : ".");
@@ -512,7 +512,7 @@ size_t BlkPrintingClosure::do_blk(HeapWord* addr) {
}
} else { // free block
_st->print_cr(PTR_FORMAT ": free block of size " SIZE_FORMAT "%s",
- addr, sz, CMSPrintChunksInDump ? ":" : ".");
+ p2i(addr), sz, CMSPrintChunksInDump ? ":" : ".");
if (CMSPrintChunksInDump) {
((FreeChunk*)addr)->print_on(_st);
_st->print_cr("--------------------------------------");
@@ -564,11 +564,11 @@ void CompactibleFreeListSpace::reportIndexedFreeListStatistics() const {
"--------------------------------\n");
size_t total_size = totalSizeInIndexedFreeLists();
size_t free_blocks = numFreeBlocksInIndexedFreeLists();
- gclog_or_tty->print("Total Free Space: %d\n", total_size);
- gclog_or_tty->print("Max Chunk Size: %d\n", maxChunkSizeInIndexedFreeLists());
- gclog_or_tty->print("Number of Blocks: %d\n", free_blocks);
+ gclog_or_tty->print("Total Free Space: " SIZE_FORMAT "\n", total_size);
+ gclog_or_tty->print("Max Chunk Size: " SIZE_FORMAT "\n", maxChunkSizeInIndexedFreeLists());
+ gclog_or_tty->print("Number of Blocks: " SIZE_FORMAT "\n", free_blocks);
if (free_blocks != 0) {
- gclog_or_tty->print("Av. Block Size: %d\n", total_size/free_blocks);
+ gclog_or_tty->print("Av. Block Size: " SIZE_FORMAT "\n", total_size/free_blocks);
}
}
@@ -2011,7 +2011,7 @@ void CompactibleFreeListSpace::save_marks() {
assert(ur.contains(urasm),
err_msg(" Error at save_marks(): [" PTR_FORMAT "," PTR_FORMAT ")"
" should contain [" PTR_FORMAT "," PTR_FORMAT ")",
- ur.start(), ur.end(), urasm.start(), urasm.end()));
+ p2i(ur.start()), p2i(ur.end()), p2i(urasm.start()), p2i(urasm.end())));
#endif
// inform allocator that promotions should be tracked.
assert(_promoInfo.noPromotions(), "_promoInfo inconsistency");
@@ -2181,7 +2181,7 @@ void CompactibleFreeListSpace::beginSweepFLCensus(
for (i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) {
AdaptiveFreeList<FreeChunk>* fl = &_indexedFreeList[i];
if (PrintFLSStatistics > 1) {
- gclog_or_tty->print("size[%d] : ", i);
+ gclog_or_tty->print("size[" SIZE_FORMAT "] : ", i);
}
fl->compute_desired(inter_sweep_current, inter_sweep_estimate, intra_sweep_estimate);
fl->set_coal_desired((ssize_t)((double)fl->desired() * CMSSmallCoalSurplusPercent));
@@ -2234,7 +2234,7 @@ void CompactibleFreeListSpace::endSweepFLCensus(size_t sweep_count) {
if (PrintFLSStatistics > 0) {
HeapWord* largestAddr = (HeapWord*) dictionary()->find_largest_dict();
gclog_or_tty->print_cr("CMS: Large block " PTR_FORMAT,
- largestAddr);
+ p2i(largestAddr));
}
setFLSurplus();
setFLHints();
@@ -2383,8 +2383,8 @@ class VerifyAllBlksClosure: public BlkClosure {
gclog_or_tty->print_cr(
" Current: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n"
" Previous: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n",
- addr, res, was_obj ?"true":"false", was_live ?"true":"false",
- _last_addr, _last_size, _last_was_obj?"true":"false", _last_was_live?"true":"false");
+ p2i(addr), res, was_obj ?"true":"false", was_live ?"true":"false",
+ p2i(_last_addr), _last_size, _last_was_obj?"true":"false", _last_was_live?"true":"false");
_sp->print_on(gclog_or_tty);
guarantee(false, "Seppuku!");
}
@@ -2712,7 +2712,7 @@ void CFLS_LAB::compute_desired_plab_size() {
_global_num_workers[i] = 0;
_global_num_blocks[i] = 0;
if (PrintOldPLAB) {
- gclog_or_tty->print_cr("[%d]: %d", i, (size_t)_blocks_to_claim[i].average());
+ gclog_or_tty->print_cr("[" SIZE_FORMAT "]: " SIZE_FORMAT, i, (size_t)_blocks_to_claim[i].average());
}
}
}
@@ -2751,7 +2751,7 @@ void CFLS_LAB::retire(int tid) {
}
}
if (PrintOldPLAB) {
- gclog_or_tty->print_cr("%d[%d]: %d/%d/%d",
+ gclog_or_tty->print_cr("%d[" SIZE_FORMAT "]: " SIZE_FORMAT "/" SIZE_FORMAT "/" SIZE_FORMAT,
tid, i, num_retire, _num_blocks[i], (size_t)_blocks_to_claim[i].average());
}
// Reset stats for next round
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
index e625d3a18..35b8e7255 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -404,7 +404,7 @@ class CompactibleFreeListSpace: public CompactibleSpace {
if (CMSTraceSweeper) {
gclog_or_tty->print_cr(">>>>> Saving sweep limit " PTR_FORMAT
" for space [" PTR_FORMAT "," PTR_FORMAT ") <<<<<<",
- _sweep_limit, bottom(), end());
+ p2i(_sweep_limit), p2i(bottom()), p2i(end()));
}
}
NOT_PRODUCT(
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
index 14046d32c..b1b52fd8f 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -63,6 +63,8 @@
#include "services/memoryService.hpp"
#include "services/runtimeService.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// statics
CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL;
bool CMSCollector::_full_gc_requested = false;
@@ -1181,7 +1183,7 @@ void CMSCollector::icms_update_allocation_limits()
gclog_or_tty->print(" icms alloc limits: "
PTR_FORMAT "," PTR_FORMAT
" (" SIZE_FORMAT "%%," SIZE_FORMAT "%%) ",
- _icms_start_limit, _icms_stop_limit,
+ p2i(_icms_start_limit), p2i(_icms_stop_limit),
percent_of_space(eden, _icms_start_limit),
percent_of_space(eden, _icms_stop_limit));
if (Verbose) {
@@ -1209,7 +1211,7 @@ CMSCollector::allocation_limit_reached(Space* space, HeapWord* top,
gclog_or_tty->print_cr(" start limit top=" PTR_FORMAT
", new limit=" PTR_FORMAT
" (" SIZE_FORMAT "%%)",
- top, _icms_stop_limit,
+ p2i(top), p2i(_icms_stop_limit),
percent_of_space(space, _icms_stop_limit));
}
ConcurrentMarkSweepThread::start_icms();
@@ -1226,7 +1228,7 @@ CMSCollector::allocation_limit_reached(Space* space, HeapWord* top,
gclog_or_tty->print_cr(" +stop limit top=" PTR_FORMAT
", new limit=" PTR_FORMAT
" (" SIZE_FORMAT "%%)",
- top, space->end(),
+ p2i(top), p2i(space->end()),
percent_of_space(space, space->end()));
}
ConcurrentMarkSweepThread::stop_icms();
@@ -1501,7 +1503,7 @@ bool CMSCollector::shouldConcurrentCollect() {
if (PrintCMSInitiationStatistics && stats().valid()) {
gclog_or_tty->print("CMSCollector shouldConcurrentCollect: ");
gclog_or_tty->stamp();
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
stats().print_on(gclog_or_tty);
gclog_or_tty->print_cr("time_until_cms_gen_full %3.7f",
stats().time_until_cms_gen_full());
@@ -3577,7 +3579,7 @@ CMSPhaseAccounting::~CMSPhaseAccounting() {
_collector->cmsGen()->short_name(),
_phase, _collector->timerValue(), _wallclock.seconds());
if (_print_cr) {
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
}
if (PrintCMSStatistics != 0) {
gclog_or_tty->print_cr(" (CMS-concurrent-%s yielded %d times)", _phase,
@@ -6363,7 +6365,9 @@ void CMSCollector::sweep(bool asynch) {
verify_overflow_empty();
if (should_unload_classes()) {
- ClassLoaderDataGraph::purge();
+ // Delay purge to the beginning of the next safepoint. Metaspace::contains
+ // requires that the virtual spaces are stable and not deleted.
+ ClassLoaderDataGraph::set_should_purge(true);
}
_intra_sweep_timer.stop();
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp
index 29939dd86..86f1ca0a5 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -111,7 +111,7 @@ void ConcurrentMarkSweepThread::run() {
// From this time Thread::current() should be working.
assert(this == Thread::current(), "just checking");
if (BindCMSThreadToCPU && !os::bind_to_processor(CPUForCMSThread)) {
- warning("Couldn't bind CMS thread to processor %u", CPUForCMSThread);
+ warning("Couldn't bind CMS thread to processor " UINTX_FORMAT, CPUForCMSThread);
}
// Wait until Universe::is_fully_initialized()
{
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp
index cbb59df0e..62a70a5f6 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -241,7 +241,7 @@ inline void ConcurrentMarkSweepThread::trace_state(const char* desc) {
jio_snprintf(buf, sizeof(buf), " [%.3f: CMSThread %s] ",
ts.seconds(), desc);
buf[sizeof(buf) - 1] = '\0';
- gclog_or_tty->print(buf);
+ gclog_or_tty->print("%s", buf);
}
}
@@ -273,7 +273,7 @@ class CMSLoopCountWarn: public StackObj {
inline void tick() {
_ticks++;
if (CMSLoopWarn && _ticks % _threshold == 0) {
- warning("%s has looped %d times %s", _src, _ticks, _msg);
+ warning("%s has looped " INTX_FORMAT " times %s", _src, _ticks, _msg);
}
}
};
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp
index 34ee7d67b..133ed3c59 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
#include "memory/freeBlockDictionary.hpp"
#include "utilities/copy.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#ifndef PRODUCT
#define baadbabeHeapWord badHeapWordVal
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp
index 062974edb..af5f44f83 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
#include "oops/markOop.inline.hpp"
#include "oops/oop.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
/////////////////////////////////////////////////////////////////////////
//// PromotionInfo
/////////////////////////////////////////////////////////////////////////
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp
index 24ca71c03..c5ae1d498 100644
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
#include "runtime/os.hpp"
#include "utilities/dtrace.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
#ifndef USDT2
HS_DTRACE_PROBE_DECL(hs_private, cms__initmark__begin);
diff --git a/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/src/share/vm/gc_implementation/g1/concurrentMark.cpp
index bc46fee45..977629de0 100644
--- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp
+++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -537,7 +537,7 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) :
if (verbose_low()) {
gclog_or_tty->print_cr("[global] init, heap start = "PTR_FORMAT", "
- "heap end = "PTR_FORMAT, _heap_start, _heap_end);
+ "heap end = " INTPTR_FORMAT, p2i(_heap_start), p2i(_heap_end));
}
if (!_markBitMap1.allocate(heap_rs)) {
@@ -567,8 +567,8 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) :
_root_regions.init(_g1h, this);
if (ConcGCThreads > ParallelGCThreads) {
- warning("Can't have more ConcGCThreads (" UINT32_FORMAT ") "
- "than ParallelGCThreads (" UINT32_FORMAT ").",
+ warning("Can't have more ConcGCThreads (" UINTX_FORMAT ") "
+ "than ParallelGCThreads (" UINTX_FORMAT ").",
ConcGCThreads, ParallelGCThreads);
return;
}
@@ -651,7 +651,7 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) :
if (!(mark_stack_size >= 1 && mark_stack_size <= MarkStackSizeMax)) {
warning("Invalid value calculated for MarkStackSize (" UINTX_FORMAT "): "
"must be between " UINTX_FORMAT " and " UINTX_FORMAT,
- mark_stack_size, 1, MarkStackSizeMax);
+ mark_stack_size, (uintx) 1, MarkStackSizeMax);
return;
}
FLAG_SET_ERGO(uintx, MarkStackSize, mark_stack_size);
@@ -662,7 +662,7 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) :
if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT "): "
"must be between " UINTX_FORMAT " and " UINTX_FORMAT,
- MarkStackSize, 1, MarkStackSizeMax);
+ MarkStackSize, (uintx) 1, MarkStackSizeMax);
return;
}
} else if (FLAG_IS_CMDLINE(MarkStackSizeMax)) {
@@ -821,7 +821,7 @@ void ConcurrentMark::set_concurrency_and_phase(uint active_tasks, bool concurren
assert(!concurrent_marking_in_progress(), "invariant");
assert(_finger == _heap_end,
err_msg("only way to get here: _finger: "PTR_FORMAT", _heap_end: "PTR_FORMAT,
- _finger, _heap_end));
+ p2i(_finger), p2i(_heap_end)));
update_g1_committed(true);
}
}
@@ -1422,7 +1422,7 @@ public:
assert(start <= hr->end() && start <= ntams && ntams <= hr->end(),
err_msg("Preconditions not met - "
"start: "PTR_FORMAT", ntams: "PTR_FORMAT", end: "PTR_FORMAT,
- start, ntams, hr->end()));
+ p2i(start), p2i(ntams), p2i(hr->end())));
// Find the first marked object at or after "start".
start = _bm->getNextMarkedWordAddress(start, ntams);
@@ -1607,7 +1607,7 @@ public:
if (failures > 0 && _verbose) {
gclog_or_tty->print_cr("Region " HR_FORMAT ", ntams: " PTR_FORMAT ", "
"marked_bytes: calc/actual " SIZE_FORMAT "/" SIZE_FORMAT,
- HR_FORMAT_PARAMS(hr), hr->next_top_at_mark_start(),
+ HR_FORMAT_PARAMS(hr), p2i(hr->next_top_at_mark_start()),
_calc_cl.region_marked_bytes(), hr->next_marked_bytes());
}
@@ -2237,7 +2237,7 @@ class G1CMKeepAliveAndDrainClosure: public OopClosure {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("\t[%u] we're looking at location "
"*"PTR_FORMAT" = "PTR_FORMAT,
- _task->worker_id(), p, (void*) obj);
+ _task->worker_id(), p2i(p), p2i((void*) obj));
}
_task->deal_with_reference(obj);
@@ -2672,7 +2672,7 @@ public:
}
_out->print_cr(" "PTR_FORMAT": "PTR_FORMAT"%s%s",
- p, (void*) obj, str, str2);
+ p2i(p), p2i((void*) obj), str, str2);
}
};
@@ -2699,7 +2699,7 @@ public:
if (print_it) {
_out->print_cr(" "PTR_FORMAT"%s",
- (void *)o, (over_tams) ? " >" : (marked) ? " M" : "");
+ p2i((void *)o), (over_tams) ? " >" : (marked) ? " M" : "");
PrintReachableOopClosure oopCl(_out, _vo, _all);
o->oop_iterate_no_header(&oopCl);
}
@@ -2720,14 +2720,14 @@ public:
HeapWord* t = hr->top();
HeapWord* p = _g1h->top_at_mark_start(hr, _vo);
_out->print_cr("** ["PTR_FORMAT", "PTR_FORMAT"] top: "PTR_FORMAT" "
- "TAMS: "PTR_FORMAT, b, e, t, p);
+ "TAMS: " PTR_FORMAT, p2i(b), p2i(e), p2i(t), p2i(p));
_out->cr();
HeapWord* from = b;
HeapWord* to = t;
if (to > from) {
- _out->print_cr("Objects in ["PTR_FORMAT", "PTR_FORMAT"]", from, to);
+ _out->print_cr("Objects in [" PTR_FORMAT ", " PTR_FORMAT "]", p2i(from), p2i(to));
_out->cr();
PrintReachableObjectClosure ocl(_out, _vo, _all, hr);
hr->object_iterate_mem_careful(MemRegion(from, to), &ocl);
@@ -2843,7 +2843,7 @@ ConcurrentMark::claim_region(uint worker_id) {
gclog_or_tty->print_cr("[%u] curr_region = "PTR_FORMAT" "
"["PTR_FORMAT", "PTR_FORMAT"), "
"limit = "PTR_FORMAT,
- worker_id, curr_region, bottom, end, limit);
+ worker_id, p2i(curr_region), p2i(bottom), p2i(end), p2i(limit));
}
// Is the gap between reading the finger and doing the CAS too long?
@@ -2857,13 +2857,13 @@ ConcurrentMark::claim_region(uint worker_id) {
if (verbose_low()) {
gclog_or_tty->print_cr("[%u] we were successful with region = "
- PTR_FORMAT, worker_id, curr_region);
+ PTR_FORMAT, worker_id, p2i(curr_region));
}
if (limit > bottom) {
if (verbose_low()) {
gclog_or_tty->print_cr("[%u] region "PTR_FORMAT" is not empty, "
- "returning it ", worker_id, curr_region);
+ "returning it ", worker_id, p2i(curr_region));
}
return curr_region;
} else {
@@ -2871,7 +2871,7 @@ ConcurrentMark::claim_region(uint worker_id) {
"the region limit should be at bottom");
if (verbose_low()) {
gclog_or_tty->print_cr("[%u] region "PTR_FORMAT" is empty, "
- "returning NULL", worker_id, curr_region);
+ "returning NULL", worker_id, p2i(curr_region));
}
// we return NULL and the caller should try calling
// claim_region() again.
@@ -2883,7 +2883,7 @@ ConcurrentMark::claim_region(uint worker_id) {
gclog_or_tty->print_cr("[%u] somebody else moved the finger, "
"global finger = "PTR_FORMAT", "
"our finger = "PTR_FORMAT,
- worker_id, _finger, finger);
+ worker_id, p2i(_finger), p2i(finger));
}
// read it again
@@ -2922,7 +2922,7 @@ private:
void do_object_work(oop obj) {
guarantee(!_g1h->obj_in_cs(obj),
err_msg("obj: "PTR_FORMAT" in CSet, phase: %s, info: %d",
- (void*) obj, phase_str(), _info));
+ p2i((void*) obj), phase_str(), _info));
}
public:
@@ -3001,7 +3001,7 @@ void ConcurrentMark::verify_no_cset_oops(bool verify_stacks,
HeapRegion* global_hr = _g1h->heap_region_containing_raw(global_finger);
guarantee(global_finger == global_hr->bottom(),
err_msg("global finger: "PTR_FORMAT" region: "HR_FORMAT,
- global_finger, HR_FORMAT_PARAMS(global_hr)));
+ p2i(global_finger), HR_FORMAT_PARAMS(global_hr)));
}
// Verify the task fingers
@@ -3015,7 +3015,7 @@ void ConcurrentMark::verify_no_cset_oops(bool verify_stacks,
guarantee(task_finger == task_hr->bottom() ||
!task_hr->in_collection_set(),
err_msg("task finger: "PTR_FORMAT" region: "HR_FORMAT,
- task_finger, HR_FORMAT_PARAMS(task_hr)));
+ p2i(task_finger), HR_FORMAT_PARAMS(task_hr)));
}
}
}
@@ -3059,7 +3059,7 @@ class AggregateCountDataHRClosure: public HeapRegionClosure {
err_msg("Preconditions not met - "
"start: "PTR_FORMAT", limit: "PTR_FORMAT", "
"top: "PTR_FORMAT", end: "PTR_FORMAT,
- start, limit, hr->top(), hr->end()));
+ p2i(start), p2i(limit), p2i(hr->top()), p2i(hr->end())));
assert(hr->next_marked_bytes() == 0, "Precondition");
@@ -3295,7 +3295,7 @@ void ConcurrentMark::print_worker_threads_on(outputStream* st) const {
void ConcurrentMark::print_on_error(outputStream* st) const {
st->print_cr("Marking Bits (Prev, Next): (CMBitMap*) " PTR_FORMAT ", (CMBitMap*) " PTR_FORMAT,
- _prevMarkBitMap, _nextMarkBitMap);
+ p2i(_prevMarkBitMap), p2i(_nextMarkBitMap));
_prevMarkBitMap->print_on_error(st, " Prev Bits: ");
_nextMarkBitMap->print_on_error(st, " Next Bits: ");
}
@@ -3332,11 +3332,11 @@ bool ConcurrentMark::containing_cards_are_marked(void* start,
// for debugging purposes
void ConcurrentMark::print_finger() {
gclog_or_tty->print_cr("heap ["PTR_FORMAT", "PTR_FORMAT"), global finger = "PTR_FORMAT,
- _heap_start, _heap_end, _finger);
+ p2i(_heap_start), p2i(_heap_end), p2i(_finger));
for (uint i = 0; i < _max_worker_id; ++i) {
- gclog_or_tty->print(" %u: "PTR_FORMAT, i, _tasks[i]->finger());
+ gclog_or_tty->print(" %u: " PTR_FORMAT, i, p2i(_tasks[i]->finger()));
}
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
}
#endif
@@ -3345,7 +3345,7 @@ void CMTask::scan_object(oop obj) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] we're scanning object "PTR_FORMAT,
- _worker_id, (void*) obj);
+ _worker_id, p2i((void*) obj));
}
size_t obj_size = obj->size();
@@ -3425,7 +3425,7 @@ void CMTask::setup_for_region(HeapRegion* hr) {
if (_cm->verbose_low()) {
gclog_or_tty->print_cr("[%u] setting up for region "PTR_FORMAT,
- _worker_id, hr);
+ _worker_id, p2i(hr));
}
_curr_region = hr;
@@ -3442,7 +3442,7 @@ void CMTask::update_region_limit() {
if (_cm->verbose_low()) {
gclog_or_tty->print_cr("[%u] found an empty region "
"["PTR_FORMAT", "PTR_FORMAT")",
- _worker_id, bottom, limit);
+ _worker_id, p2i(bottom), p2i(limit));
}
// The region was collected underneath our feet.
// We set the finger to bottom to ensure that the bitmap
@@ -3474,7 +3474,7 @@ void CMTask::giveup_current_region() {
assert(_curr_region != NULL, "invariant");
if (_cm->verbose_low()) {
gclog_or_tty->print_cr("[%u] giving up region "PTR_FORMAT,
- _worker_id, _curr_region);
+ _worker_id, p2i(_curr_region));
}
clear_region_fields();
}
@@ -3754,7 +3754,7 @@ void CMTask::drain_local_queue(bool partially) {
if (_task_queue->size() > target_size) {
if (_cm->verbose_high()) {
- gclog_or_tty->print_cr("[%u] draining local queue, target size = %d",
+ gclog_or_tty->print_cr("[%u] draining local queue, target size = " SIZE_FORMAT,
_worker_id, target_size);
}
@@ -3765,7 +3765,7 @@ void CMTask::drain_local_queue(bool partially) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] popped "PTR_FORMAT, _worker_id,
- (void*) obj);
+ p2i((void*) obj));
}
assert(_g1h->is_in_g1_reserved((HeapWord*) obj), "invariant" );
@@ -3810,7 +3810,7 @@ void CMTask::drain_global_stack(bool partially) {
if (_cm->mark_stack_size() > target_size) {
if (_cm->verbose_low()) {
- gclog_or_tty->print_cr("[%u] draining global_stack, target size %d",
+ gclog_or_tty->print_cr("[%u] draining global_stack, target size " SIZE_FORMAT,
_worker_id, target_size);
}
@@ -3820,7 +3820,7 @@ void CMTask::drain_global_stack(bool partially) {
}
if (_cm->verbose_low()) {
- gclog_or_tty->print_cr("[%u] drained global stack, size = %d",
+ gclog_or_tty->print_cr("[%u] drained global stack, size = " SIZE_FORMAT,
_worker_id, _cm->mark_stack_size());
}
}
@@ -4150,7 +4150,7 @@ void CMTask::do_marking_step(double time_target_ms,
gclog_or_tty->print_cr("[%u] we're scanning part "
"["PTR_FORMAT", "PTR_FORMAT") "
"of region "HR_FORMAT,
- _worker_id, _finger, _region_limit,
+ _worker_id, p2i(_finger), p2i(_region_limit),
HR_FORMAT_PARAMS(_curr_region));
}
@@ -4237,7 +4237,7 @@ void CMTask::do_marking_step(double time_target_ms,
if (_cm->verbose_low()) {
gclog_or_tty->print_cr("[%u] we successfully claimed "
"region "PTR_FORMAT,
- _worker_id, claimed_region);
+ _worker_id, p2i(claimed_region));
}
setup_for_region(claimed_region);
@@ -4298,7 +4298,7 @@ void CMTask::do_marking_step(double time_target_ms,
if (_cm->try_stealing(_worker_id, &_hash_seed, obj)) {
if (_cm->verbose_medium()) {
gclog_or_tty->print_cr("[%u] stolen "PTR_FORMAT" successfully",
- _worker_id, (void*) obj);
+ _worker_id, p2i((void*) obj));
}
statsOnly( ++_steals );
@@ -4546,8 +4546,8 @@ G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name)
G1PPRL_SUM_ADDR_FORMAT("committed")
G1PPRL_SUM_ADDR_FORMAT("reserved")
G1PPRL_SUM_BYTE_FORMAT("region-size"),
- g1_committed.start(), g1_committed.end(),
- g1_reserved.start(), g1_reserved.end(),
+ p2i(g1_committed.start()), p2i(g1_committed.end()),
+ p2i(g1_reserved.start()), p2i(g1_reserved.end()),
HeapRegion::GrainBytes);
_out->print_cr(G1PPRL_LINE_PREFIX);
_out->print_cr(G1PPRL_LINE_PREFIX
@@ -4664,7 +4664,7 @@ bool G1PrintRegionLivenessInfoClosure::doHeapRegion(HeapRegion* r) {
G1PPRL_DOUBLE_FORMAT
G1PPRL_BYTE_FORMAT
G1PPRL_BYTE_FORMAT,
- type, bottom, end,
+ type, p2i(bottom), p2i(end),
used_bytes, prev_live_bytes, next_live_bytes, gc_eff,
remset_bytes, strong_code_roots_bytes);
diff --git a/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp b/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp
index ea45f2d64..06272450d 100644
--- a/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp
+++ b/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -277,7 +277,7 @@ inline void CMTask::push(oop obj) {
assert(_nextMarkBitMap->isMarked(objAddr), "invariant");
if (_cm->verbose_high()) {
- gclog_or_tty->print_cr("[%u] pushing "PTR_FORMAT, _worker_id, (void*) obj);
+ gclog_or_tty->print_cr("[%u] pushing " PTR_FORMAT, _worker_id, p2i((void*) obj));
}
if (!_task_queue->push(obj)) {
@@ -317,7 +317,7 @@ inline void CMTask::push(oop obj) {
inline void CMTask::deal_with_reference(oop obj) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] we're dealing with reference = "PTR_FORMAT,
- _worker_id, (void*) obj);
+ _worker_id, p2i((void*) obj));
}
++_refs_reached;
@@ -334,7 +334,7 @@ inline void CMTask::deal_with_reference(oop obj) {
if (!hr->obj_allocated_since_next_marking(obj)) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] "PTR_FORMAT" is not considered marked",
- _worker_id, (void*) obj);
+ _worker_id, p2i((void*) obj));
}
// we need to mark it first
@@ -349,7 +349,7 @@ inline void CMTask::deal_with_reference(oop obj) {
if (_finger != NULL && objAddr < _finger) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] below the local finger ("PTR_FORMAT"), "
- "pushing it", _worker_id, _finger);
+ "pushing it", _worker_id, p2i(_finger));
}
push(obj);
} else if (_curr_region != NULL && objAddr < _region_limit) {
@@ -367,7 +367,7 @@ inline void CMTask::deal_with_reference(oop obj) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] below the global finger "
"("PTR_FORMAT"), pushing it",
- _worker_id, global_finger);
+ _worker_id, p2i(global_finger));
}
push(obj);
} else {
@@ -382,7 +382,7 @@ inline void CMTask::deal_with_reference(oop obj) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] below the global finger "
"("PTR_FORMAT"), pushing it",
- _worker_id, global_finger);
+ _worker_id, p2i(global_finger));
}
push(obj);
}
diff --git a/src/share/vm/gc_implementation/g1/g1AllocRegion.cpp b/src/share/vm/gc_implementation/g1/g1AllocRegion.cpp
index bb02d6ace..fdb1a78f6 100644
--- a/src/share/vm/gc_implementation/g1/g1AllocRegion.cpp
+++ b/src/share/vm/gc_implementation/g1/g1AllocRegion.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -142,7 +142,7 @@ HeapWord* G1AllocRegion::new_alloc_region_and_allocate(size_t word_size,
void G1AllocRegion::fill_in_ext_msg(ar_ext_msg* msg, const char* message) {
msg->append("[%s] %s c: %u b: %s r: "PTR_FORMAT" u: "SIZE_FORMAT,
_name, message, _count, BOOL_TO_STR(_bot_updates),
- _alloc_region, _used_bytes_before);
+ p2i(_alloc_region), _used_bytes_before);
}
void G1AllocRegion::init() {
diff --git a/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp b/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp
index 3f6e040bf..050490dbb 100644
--- a/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp
+++ b/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -184,7 +184,7 @@ public:
class ar_ext_msg : public err_msg {
public:
- ar_ext_msg(G1AllocRegion* alloc_region, const char *message) : err_msg("") {
+ ar_ext_msg(G1AllocRegion* alloc_region, const char *message) : err_msg("%s", "") {
alloc_region->fill_in_ext_msg(this, message);
}
};
diff --git a/src/share/vm/gc_implementation/g1/g1BiasedArray.cpp b/src/share/vm/gc_implementation/g1/g1BiasedArray.cpp
index d5851a6d4..8c5bef771 100644
--- a/src/share/vm/gc_implementation/g1/g1BiasedArray.cpp
+++ b/src/share/vm/gc_implementation/g1/g1BiasedArray.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -65,7 +65,7 @@ public:
REGION_SIZE_IN_WORDS * HeapWordSize);
// Check address calculation (bounds)
assert(array.bottom_address_mapped() == fake_heap,
- err_msg("bottom mapped address should be "PTR_FORMAT", but is "PTR_FORMAT, fake_heap, array.bottom_address_mapped()));
+ err_msg("bottom mapped address should be " PTR_FORMAT ", but is " PTR_FORMAT, p2i(fake_heap), p2i(array.bottom_address_mapped())));
assert(array.end_address_mapped() == (fake_heap + REGION_SIZE_IN_WORDS * NUM_REGIONS), "must be");
int* bottom = array.address_mapped_to(fake_heap);
diff --git a/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp b/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp
index 92b1e2782..955e0487e 100644
--- a/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp
+++ b/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,7 @@ protected:
void initialize_base(address base, size_t length, size_t bias, size_t elem_size, uint shift_by) {
assert(base != NULL, "just checking");
assert(length > 0, "just checking");
- assert(shift_by < sizeof(uintptr_t) * 8, err_msg("Shifting by %zd, larger than word size?", shift_by));
+ assert(shift_by < sizeof(uintptr_t) * 8, err_msg("Shifting by " SSIZE_FORMAT ", larger than word size?", (size_t) shift_by));
_base = base;
_length = length;
_biased_base = base - (bias * elem_size);
@@ -70,11 +70,11 @@ protected:
assert(is_power_of_2(mapping_granularity_in_bytes),
err_msg("mapping granularity must be power of 2, is %zd", mapping_granularity_in_bytes));
assert((uintptr_t)bottom % mapping_granularity_in_bytes == 0,
- err_msg("bottom mapping area address must be a multiple of mapping granularity %zd, is "PTR_FORMAT,
- mapping_granularity_in_bytes, bottom));
+ err_msg("bottom mapping area address must be a multiple of mapping granularity %zd, is " PTR_FORMAT,
+ mapping_granularity_in_bytes, p2i(bottom)));
assert((uintptr_t)end % mapping_granularity_in_bytes == 0,
- err_msg("end mapping area address must be a multiple of mapping granularity %zd, is "PTR_FORMAT,
- mapping_granularity_in_bytes, end));
+ err_msg("end mapping area address must be a multiple of mapping granularity %zd, is " PTR_FORMAT,
+ mapping_granularity_in_bytes, p2i(end)));
size_t num_target_elems = (end - bottom) / (mapping_granularity_in_bytes / HeapWordSize);
idx_t bias = (uintptr_t)bottom / mapping_granularity_in_bytes;
address base = create_new_base_array(num_target_elems, target_elem_size_in_bytes);
diff --git a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
index c35681f95..ee8969d66 100644
--- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
+++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
#include "runtime/java.hpp"
#include "services/memTracker.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
//////////////////////////////////////////////////////////////////////
// G1BlockOffsetSharedArray
//////////////////////////////////////////////////////////////////////
diff --git a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp
index 655ab698d..99f3da6e5 100644
--- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp
+++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -80,7 +80,7 @@ public:
virtual void set_bottom(HeapWord* new_bottom) {
assert(new_bottom <= _end,
err_msg("new_bottom (" PTR_FORMAT ") > _end (" PTR_FORMAT ")",
- new_bottom, _end));
+ p2i(new_bottom), p2i(_end)));
_bottom = new_bottom;
resize(pointer_delta(_end, _bottom));
}
@@ -146,7 +146,7 @@ private:
void check_offset(size_t offset, const char* msg) const {
assert(offset <= N_words,
err_msg("%s - "
- "offset: " UINT32_FORMAT", N_words: " UINT32_FORMAT,
+ "offset: " SIZE_FORMAT ", N_words: " UINT32_FORMAT,
msg, offset, N_words));
}
diff --git a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp
index d300f5625..5ae3bc1cd 100644
--- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp
+++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@ inline size_t G1BlockOffsetSharedArray::index_for(const void* p) const {
assert(pc >= (char*)_reserved.start() &&
pc < (char*)_reserved.end(),
err_msg("p (" PTR_FORMAT ") not in reserved [" PTR_FORMAT ", " PTR_FORMAT ")",
- p, (char*)_reserved.start(), (char*)_reserved.end()));
+ p2i(p), p2i(_reserved.start()), p2i(_reserved.end())));
size_t delta = pointer_delta(pc, _reserved.start(), sizeof(char));
size_t result = delta >> LogN;
check_index(result, "bad index from address");
@@ -65,7 +65,7 @@ G1BlockOffsetSharedArray::address_for_index(size_t index) const {
err_msg("bad address from index result " PTR_FORMAT
" _reserved.start() " PTR_FORMAT " _reserved.end() "
PTR_FORMAT,
- result, _reserved.start(), _reserved.end()));
+ p2i(result), p2i(_reserved.start()), p2i(_reserved.end())));
return result;
}
diff --git a/src/share/vm/gc_implementation/g1/g1CardCounts.cpp b/src/share/vm/gc_implementation/g1/g1CardCounts.cpp
index 59041d34a..5e8cfb5de 100644
--- a/src/share/vm/gc_implementation/g1/g1CardCounts.cpp
+++ b/src/share/vm/gc_implementation/g1/g1CardCounts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
#include "services/memTracker.hpp"
#include "utilities/copy.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
void G1CardCounts::clear_range(size_t from_card_num, size_t to_card_num) {
if (has_count_table()) {
assert(from_card_num >= 0 && from_card_num < _committed_max_card_num,
diff --git a/src/share/vm/gc_implementation/g1/g1CardCounts.hpp b/src/share/vm/gc_implementation/g1/g1CardCounts.hpp
index 129b3b0d2..ef08479f6 100644
--- a/src/share/vm/gc_implementation/g1/g1CardCounts.hpp
+++ b/src/share/vm/gc_implementation/g1/g1CardCounts.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -77,10 +77,10 @@ class G1CardCounts: public CHeapObj<mtGC> {
err_msg("Invalid card pointer: "
"card_ptr: " PTR_FORMAT ", "
"_ct_bot: " PTR_FORMAT,
- card_ptr, _ct_bot));
+ p2i(card_ptr), p2i(_ct_bot)));
size_t card_num = pointer_delta(card_ptr, _ct_bot, sizeof(jbyte));
assert(card_num >= 0 && card_num < _committed_max_card_num,
- err_msg("card pointer out of range: " PTR_FORMAT, card_ptr));
+ err_msg("card pointer out of range: " PTR_FORMAT, p2i(card_ptr)));
return card_num;
}
diff --git a/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp b/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp
index 7b2302277..fb909d883 100644
--- a/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp
+++ b/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp
@@ -28,6 +28,8 @@
#include "gc_implementation/g1/g1CodeCacheRemSet.hpp"
#include "memory/iterator.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
G1CodeRootChunk::G1CodeRootChunk() : _top(NULL), _next(NULL), _prev(NULL) {
_top = bottom();
}
diff --git a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
index ff93b41b8..bd0577d70 100644
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -22,6 +22,10 @@
*
*/
+#if !defined(__clang_major__) && defined(__GNUC__)
+#define ATTRIBUTE_PRINTF(x,y) // FIXME, formats are a mess.
+#endif
+
#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/icBuffer.hpp"
@@ -372,7 +376,7 @@ void YoungList::print() {
}
}
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
}
void G1CollectedHeap::push_dirty_cards_region(HeapRegion* hr)
@@ -3488,7 +3492,7 @@ void G1CollectedHeap::verify(bool silent, VerifyOption vo) {
// help us track down what went wrong. This is why we call
// print_extended_on() instead of print_on().
print_extended_on(gclog_or_tty);
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
#ifndef PRODUCT
if (VerifyDuringGC && G1VerifyDuringGCPrintReachable) {
concurrent_mark()->print_reachable("at-verification-failure",
@@ -3682,7 +3686,7 @@ public:
PrintRSetsClosure(const char* msg) : _msg(msg), _occupied_sum(0) {
gclog_or_tty->cr();
gclog_or_tty->print_cr("========================================");
- gclog_or_tty->print_cr(msg);
+ gclog_or_tty->print_cr("%s", msg);
gclog_or_tty->cr();
}
@@ -5416,7 +5420,7 @@ public:
if (_g1h->is_in_g1_reserved(p)) {
_par_scan_state->push_on_queue(p);
} else {
- assert(!ClassLoaderDataGraph::contains((address)p),
+ assert(!Metaspace::contains((const void*)p),
err_msg("Otherwise need to call _copy_metadata_obj_cl->do_oop(p) "
PTR_FORMAT, p));
_copy_non_heap_obj_cl->do_oop(p);
diff --git a/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp b/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp
index e3b8fd061..d731e9b90 100644
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -165,7 +165,7 @@ inline bool G1CollectedHeap::isMarkedNext(oop obj) const {
// points into the heap.
inline bool G1CollectedHeap::in_cset_fast_test(oop obj) {
assert(_in_cset_fast_test != NULL, "sanity");
- assert(_g1_committed.contains((HeapWord*) obj), err_msg("Given reference outside of heap, is "PTR_FORMAT, (HeapWord*)obj));
+ assert(_g1_committed.contains((HeapWord*) obj), err_msg("Given reference outside of heap, is "PTR_FORMAT, p2i((HeapWord*)obj)));
// no need to subtract the bottom of the heap from obj,
// _in_cset_fast_test is biased
uintx index = cast_from_oop<uintx>(obj) >> HeapRegion::LogOfHRGrainBytes;
diff --git a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
index 76021adf1..02c91e969 100644
--- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
+++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,10 @@
*
*/
+#ifndef __clang_major__
+#define ATTRIBUTE_PRINTF(x,y) // FIXME, formats are a mess.
+#endif
+
#include "precompiled.hpp"
#include "gc_implementation/g1/concurrentG1Refine.hpp"
#include "gc_implementation/g1/concurrentMark.hpp"
@@ -965,7 +969,7 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, Evacua
#ifndef PRODUCT
if (G1YoungSurvRateVerbose) {
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
_short_lived_surv_rate_group->print();
// do that for any other surv rate groups too
}
@@ -2222,11 +2226,11 @@ void TraceGen0TimeData::print() const {
gclog_or_tty->print_cr("ALL PAUSES");
print_summary_sd(" Total", &_total);
- gclog_or_tty->print_cr("");
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
+ gclog_or_tty->cr();
gclog_or_tty->print_cr(" Young GC Pauses: %8d", _young_pause_num);
gclog_or_tty->print_cr(" Mixed GC Pauses: %8d", _mixed_pause_num);
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
gclog_or_tty->print_cr("EVACUATION PAUSES");
@@ -2246,7 +2250,7 @@ void TraceGen0TimeData::print() const {
print_summary(" Clear CT", &_clear_ct);
print_summary(" Other", &_other);
}
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
gclog_or_tty->print_cr("MISC");
print_summary_sd(" Stop World", &_all_stop_world_times_ms);
diff --git a/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp b/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
index 4ff49d3ed..e5729bc1a 100644
--- a/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
+++ b/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
@@ -39,7 +39,7 @@ private:
int _indent_level;
int _cur;
- void vappend(const char* format, va_list ap) {
+ void vappend(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0) {
int res = vsnprintf(&_buffer[_cur], BUFFER_LEN - _cur, format, ap);
if (res != -1) {
_cur += res;
@@ -63,14 +63,14 @@ public:
}
#endif
- void append(const char* format, ...) {
+ void append(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
va_list ap;
va_start(ap, format);
vappend(format, ap);
va_end(ap);
}
- void append_and_print_cr(const char* format, ...) {
+ void append_and_print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
va_list ap;
va_start(ap, format);
vappend(format, ap);
@@ -80,6 +80,8 @@ public:
}
};
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED
template <class T>
void WorkerDataArray<T>::print(int level, const char* title) {
if (_length == 1) {
@@ -109,7 +111,7 @@ void WorkerDataArray<T>::print(int level, const char* title) {
}
if (G1Log::finest()) {
- buf.append_and_print_cr("");
+ buf.append_and_print_cr("%s", "");
}
double avg = (double)sum / (double)_length;
@@ -129,6 +131,7 @@ void WorkerDataArray<T>::print(int level, const char* title) {
}
buf.append_and_print_cr("]");
}
+PRAGMA_DIAG_POP
#ifndef PRODUCT
diff --git a/src/share/vm/gc_implementation/g1/g1HRPrinter.cpp b/src/share/vm/gc_implementation/g1/g1HRPrinter.cpp
index 56a1a3be8..8139048ef 100644
--- a/src/share/vm/gc_implementation/g1/g1HRPrinter.cpp
+++ b/src/share/vm/gc_implementation/g1/g1HRPrinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
#include "gc_implementation/g1/heapRegion.hpp"
#include "utilities/ostream.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
const char* G1HRPrinter::action_name(ActionType action) {
switch(action) {
case Alloc: return "ALLOC";
diff --git a/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp b/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp
index e9f018fb3..25a0d0574 100644
--- a/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp
+++ b/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -114,7 +114,7 @@ inline void G1CMOopClosure::do_oop_nv(T* p) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] we're looking at location "
"*"PTR_FORMAT" = "PTR_FORMAT,
- _task->worker_id(), p, (void*) obj);
+ _task->worker_id(), p2i(p), p2i((void*) obj));
}
_task->deal_with_reference(obj);
}
diff --git a/src/share/vm/gc_implementation/g1/g1RemSet.cpp b/src/share/vm/gc_implementation/g1/g1RemSet.cpp
index aa1c0077f..5877f0ace 100644
--- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp
+++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
#include "oops/oop.inline.hpp"
#include "utilities/intHisto.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#define CARD_REPEAT_HISTO 0
#if CARD_REPEAT_HISTO
diff --git a/src/share/vm/gc_implementation/g1/heapRegion.cpp b/src/share/vm/gc_implementation/g1/heapRegion.cpp
index 04845778f..d06b27be8 100644
--- a/src/share/vm/gc_implementation/g1/heapRegion.cpp
+++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp
@@ -34,6 +34,8 @@
#include "memory/iterator.hpp"
#include "oops/oop.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
int HeapRegion::LogOfHRGrainBytes = 0;
int HeapRegion::LogOfHRGrainWords = 0;
size_t HeapRegion::GrainBytes = 0;
@@ -829,7 +831,7 @@ public:
Mutex::_no_safepoint_check_flag);
if (!_failures) {
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
gclog_or_tty->print_cr("----------");
}
if (!_g1h->is_in_closed_subset(obj)) {
@@ -884,7 +886,7 @@ public:
Mutex::_no_safepoint_check_flag);
if (!_failures) {
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
gclog_or_tty->print_cr("----------");
}
gclog_or_tty->print_cr("Missing rem set entry:");
diff --git a/src/share/vm/gc_implementation/g1/heapRegion.hpp b/src/share/vm/gc_implementation/g1/heapRegion.hpp
index b10f32674..25ffe1c82 100644
--- a/src/share/vm/gc_implementation/g1/heapRegion.hpp
+++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@ class nmethod;
(_hr_)->startsHumongous() ? "HS" : \
(_hr_)->continuesHumongous() ? "HC" : \
!(_hr_)->is_empty() ? "O" : "F", \
- (_hr_)->bottom(), (_hr_)->top(), (_hr_)->end()
+ p2i((_hr_)->bottom()), p2i((_hr_)->top()), p2i((_hr_)->end())
// sentinel value for hrs_index
#define G1_NULL_HRS_INDEX ((uint) -1)
@@ -550,7 +550,7 @@ class HeapRegion: public G1OffsetTableContigSpace {
(containing_set != NULL && _containing_set == NULL),
err_msg("containing_set: "PTR_FORMAT" "
"_containing_set: "PTR_FORMAT,
- containing_set, _containing_set));
+ p2i(containing_set), p2i(_containing_set)));
_containing_set = containing_set;
}
diff --git a/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp b/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
index 75a5b37b9..be46ca448 100644
--- a/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
+++ b/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
@@ -36,6 +36,8 @@
#include "utilities/globalDefinitions.hpp"
#include "utilities/growableArray.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
class PerRegionTable: public CHeapObj<mtGC> {
friend class OtherRegionsTable;
friend class HeapRegionRemSetIterator;
@@ -1244,7 +1246,7 @@ void HeapRegionRemSet::print_recorded() {
while (cur_evnt < _n_recorded_events && i == cur_evnt_ind) {
gclog_or_tty->print("Event: ");
print_event(gclog_or_tty, cur_evnt_kind);
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
cur_evnt++;
if (cur_evnt < MaxRecordedEvents) {
cur_evnt_kind = _recorded_events[cur_evnt];
diff --git a/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp b/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp
index c047dccab..bb34dd07b 100644
--- a/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp
+++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -233,7 +233,7 @@ void HeapRegionSeq::verify_optional() {
guarantee(hr != NULL, err_msg("invariant: i: %u", i));
guarantee(hr->bottom() == prev_end,
err_msg("invariant i: %u "HR_FORMAT" prev_end: "PTR_FORMAT,
- i, HR_FORMAT_PARAMS(hr), prev_end));
+ i, HR_FORMAT_PARAMS(hr), p2i(prev_end)));
guarantee(hr->hrs_index() == i,
err_msg("invariant: i: %u hrs_index(): %u", i, hr->hrs_index()));
if (i < length()) {
diff --git a/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp b/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp
index 0ee93e45b..e01c819ea 100644
--- a/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp
+++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@ inline HeapRegion* HeapRegionSeq::addr_to_region_unsafe(HeapWord* addr) const {
inline HeapRegion* HeapRegionSeq::addr_to_region(HeapWord* addr) const {
if (addr != NULL && addr < heap_end()) {
assert(addr >= heap_bottom(),
- err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT, addr, heap_bottom()));
+ err_msg("addr: " PTR_FORMAT " bottom: " PTR_FORMAT, p2i(addr), p2i(heap_bottom())));
return addr_to_region_unsafe(addr);
}
return NULL;
diff --git a/src/share/vm/gc_implementation/g1/heapRegionSet.cpp b/src/share/vm/gc_implementation/g1/heapRegionSet.cpp
index 6ec03d5ce..fa5ab1428 100644
--- a/src/share/vm/gc_implementation/g1/heapRegionSet.cpp
+++ b/src/share/vm/gc_implementation/g1/heapRegionSet.cpp
@@ -26,6 +26,8 @@
#include "gc_implementation/g1/heapRegionRemSet.hpp"
#include "gc_implementation/g1/heapRegionSet.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
uint FreeRegionList::_unrealistically_long_length = 0;
void HeapRegionSetBase::fill_in_ext_msg(hrs_ext_msg* msg, const char* message) {
diff --git a/src/share/vm/gc_implementation/g1/heapRegionSet.hpp b/src/share/vm/gc_implementation/g1/heapRegionSet.hpp
index c54fc7847..222fc694f 100644
--- a/src/share/vm/gc_implementation/g1/heapRegionSet.hpp
+++ b/src/share/vm/gc_implementation/g1/heapRegionSet.hpp
@@ -162,7 +162,7 @@ public:
// diagnosing failures.
class hrs_ext_msg : public hrs_err_msg {
public:
- hrs_ext_msg(HeapRegionSetBase* set, const char* message) : hrs_err_msg("") {
+ hrs_ext_msg(HeapRegionSetBase* set, const char* message) : hrs_err_msg("%s","") {
set->fill_in_ext_msg(this, message);
}
};
diff --git a/src/share/vm/gc_implementation/g1/satbQueue.cpp b/src/share/vm/gc_implementation/g1/satbQueue.cpp
index 49a0e894e..3e0c56842 100644
--- a/src/share/vm/gc_implementation/g1/satbQueue.cpp
+++ b/src/share/vm/gc_implementation/g1/satbQueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,8 @@
#include "runtime/thread.hpp"
#include "runtime/vmThread.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
void ObjPtrQueue::flush() {
// The buffer might contain refs into the CSet. We have to filter it
// first before we flush it, otherwise we might end up with an
diff --git a/src/share/vm/gc_implementation/g1/survRateGroup.cpp b/src/share/vm/gc_implementation/g1/survRateGroup.cpp
index 1232cf390..d2868c226 100644
--- a/src/share/vm/gc_implementation/g1/survRateGroup.cpp
+++ b/src/share/vm/gc_implementation/g1/survRateGroup.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
#include "gc_implementation/g1/survRateGroup.hpp"
#include "memory/allocation.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
SurvRateGroup::SurvRateGroup(G1CollectorPolicy* g1p,
const char* name,
size_t summary_surv_rates_len) :
@@ -202,7 +204,7 @@ SurvRateGroup::print_surv_rate_summary() {
if (length == 0)
return;
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
gclog_or_tty->print_cr("%s Rate Summary (for up to age %d)", _name, length-1);
gclog_or_tty->print_cr(" age range survival rate (avg) samples (avg)");
gclog_or_tty->print_cr(" ---------------------------------------------------------");
diff --git a/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp b/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp
index 2925b9d43..84d234f9d 100644
--- a/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp
+++ b/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -259,22 +259,22 @@ void ASParNewGeneration::resize_spaces(size_t requested_eden_size,
requested_eden_size, requested_survivor_size);
gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") "
SIZE_FORMAT,
- eden()->bottom(),
- eden()->end(),
+ p2i(eden()->bottom()),
+ p2i(eden()->end()),
pointer_delta(eden()->end(),
eden()->bottom(),
sizeof(char)));
gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") "
SIZE_FORMAT,
- from()->bottom(),
- from()->end(),
+ p2i(from()->bottom()),
+ p2i(from()->end()),
pointer_delta(from()->end(),
from()->bottom(),
sizeof(char)));
gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") "
SIZE_FORMAT,
- to()->bottom(),
- to()->end(),
+ p2i(to()->bottom()),
+ p2i(to()->end()),
pointer_delta( to()->end(),
to()->bottom(),
sizeof(char)));
@@ -382,18 +382,18 @@ void ASParNewGeneration::resize_spaces(size_t requested_eden_size,
if (PrintAdaptiveSizePolicy && Verbose) {
gclog_or_tty->print_cr(" [eden_start .. eden_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- eden_start,
- eden_end,
+ p2i(eden_start),
+ p2i(eden_end),
pointer_delta(eden_end, eden_start, sizeof(char)));
gclog_or_tty->print_cr(" [from_start .. from_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- from_start,
- from_end,
+ p2i(from_start),
+ p2i(from_end),
pointer_delta(from_end, from_start, sizeof(char)));
gclog_or_tty->print_cr(" [ to_start .. to_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- to_start,
- to_end,
+ p2i(to_start),
+ p2i(to_end),
pointer_delta( to_end, to_start, sizeof(char)));
}
} else {
@@ -473,18 +473,18 @@ void ASParNewGeneration::resize_spaces(size_t requested_eden_size,
if (PrintAdaptiveSizePolicy && Verbose) {
gclog_or_tty->print_cr(" [eden_start .. eden_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- eden_start,
- eden_end,
+ p2i(eden_start),
+ p2i(eden_end),
pointer_delta(eden_end, eden_start, sizeof(char)));
gclog_or_tty->print_cr(" [ to_start .. to_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- to_start,
- to_end,
+ p2i(to_start),
+ p2i(to_end),
pointer_delta( to_end, to_start, sizeof(char)));
gclog_or_tty->print_cr(" [from_start .. from_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- from_start,
- from_end,
+ p2i(from_start),
+ p2i(from_end),
pointer_delta(from_end, from_start, sizeof(char)));
}
}
diff --git a/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp b/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp
index dd9754400..897866dbe 100644
--- a/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp
+++ b/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
#include "runtime/virtualspace.hpp"
#include "runtime/vmThread.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
void CardTableModRefBS::non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
OopsInGenClosure* cl,
CardTableRS* ct,
diff --git a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
index 5ecb60c32..6a8ab8a25 100644
--- a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+++ b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -55,6 +55,8 @@
#include "utilities/globalDefinitions.hpp"
#include "utilities/workgroup.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable:4355 ) // 'this' : used in base member initializer list
diff --git a/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp b/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp
index 383a579be..2a3e32071 100644
--- a/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp
+++ b/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -79,12 +79,12 @@ inline void ParScanClosure::do_oop_work(T* p,
if ((HeapWord*)obj < _boundary) {
#ifndef PRODUCT
if (_g->to()->is_in_reserved(obj)) {
- tty->print_cr("Scanning field (" PTR_FORMAT ") twice?", p);
+ tty->print_cr("Scanning field (" PTR_FORMAT ") twice?", p2i(p));
GenCollectedHeap* gch = (GenCollectedHeap*)Universe::heap();
Space* sp = gch->space_containing(p);
oop obj = oop(sp->block_start(p));
assert((HeapWord*)obj < (HeapWord*)p, "Error");
- tty->print_cr("Object: " PTR_FORMAT, (void *)obj);
+ tty->print_cr("Object: " PTR_FORMAT, p2i((void *)obj));
tty->print_cr("-------");
obj->print();
tty->print_cr("-----");
@@ -110,7 +110,7 @@ inline void ParScanClosure::do_oop_work(T* p,
if (TraceScavenge) {
gclog_or_tty->print_cr("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
"forwarded ",
- new_obj->klass()->internal_name(), p, (void *)obj, (void *)new_obj, new_obj->size());
+ new_obj->klass()->internal_name(), p2i(p), p2i((void *)obj), p2i((void *)new_obj), new_obj->size());
}
#endif
diff --git a/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp b/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp
index ee9ce8b89..5dafc1d34 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -143,7 +143,7 @@ void AdjoiningGenerations::request_old_gen_expansion(size_t expand_in_bytes) {
if (TraceAdaptiveGCBoundary) {
gclog_or_tty->print_cr("Before expansion of old gen with boundary move");
- gclog_or_tty->print_cr(" Requested change: 0x%x Attempted change: 0x%x",
+ gclog_or_tty->print_cr(" Requested change: " SIZE_FORMAT_HEX " Attempted change: " SIZE_FORMAT_HEX,
expand_in_bytes, change_in_bytes);
if (!PrintHeapAtGC) {
Universe::print_on(gclog_or_tty);
@@ -201,7 +201,7 @@ bool AdjoiningGenerations::request_young_gen_expansion(size_t expand_in_bytes) {
if (TraceAdaptiveGCBoundary) {
gclog_or_tty->print_cr("Before expansion of young gen with boundary move");
- gclog_or_tty->print_cr(" Requested change: 0x%x Attempted change: 0x%x",
+ gclog_or_tty->print_cr(" Requested change: " SIZE_FORMAT_HEX " Attempted change: " SIZE_FORMAT_HEX,
expand_in_bytes, change_in_bytes);
if (!PrintHeapAtGC) {
Universe::print_on(gclog_or_tty);
diff --git a/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp b/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp
index 829cb3cfe..949df7245 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -127,22 +127,22 @@ size_t ASPSOldGen::available_for_contraction() {
size_t result_aligned = align_size_down(result, gen_alignment);
if (PrintAdaptiveSizePolicy && Verbose) {
gclog_or_tty->print_cr("\nASPSOldGen::available_for_contraction:"
- " %d K / 0x%x", result_aligned/K, result_aligned);
- gclog_or_tty->print_cr(" reserved().byte_size() %d K / 0x%x ",
- reserved().byte_size()/K, reserved().byte_size());
+ " " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX, (result_aligned/K), result_aligned);
+ gclog_or_tty->print_cr(" reserved().byte_size() " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX " ",
+ (reserved().byte_size()/K), reserved().byte_size());
size_t working_promoted = (size_t) policy->avg_promoted()->padded_average();
- gclog_or_tty->print_cr(" padded promoted %d K / 0x%x",
- working_promoted/K, working_promoted);
- gclog_or_tty->print_cr(" used %d K / 0x%x",
- used_in_bytes()/K, used_in_bytes());
- gclog_or_tty->print_cr(" min_gen_size() %d K / 0x%x",
- min_gen_size()/K, min_gen_size());
- gclog_or_tty->print_cr(" max_contraction %d K / 0x%x",
- max_contraction/K, max_contraction);
- gclog_or_tty->print_cr(" without alignment %d K / 0x%x",
- policy->promo_increment(max_contraction)/K,
+ gclog_or_tty->print_cr(" padded promoted " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX,
+ (working_promoted/K), working_promoted);
+ gclog_or_tty->print_cr(" used " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX,
+ (used_in_bytes()/K), used_in_bytes());
+ gclog_or_tty->print_cr(" min_gen_size() " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX,
+ (min_gen_size()/K), min_gen_size());
+ gclog_or_tty->print_cr(" max_contraction " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX,
+ (max_contraction/K), max_contraction);
+ gclog_or_tty->print_cr(" without alignment " SSIZE_FORMAT " K / " SIZE_FORMAT_HEX,
+ (policy->promo_increment(max_contraction)/K),
policy->promo_increment(max_contraction));
- gclog_or_tty->print_cr(" alignment 0x%x", gen_alignment);
+ gclog_or_tty->print_cr(" alignment " SIZE_FORMAT_HEX, gen_alignment);
}
assert(result_aligned <= max_contraction, "arithmetic is wrong");
return result_aligned;
diff --git a/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp b/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp
index af5893bcc..d711104e4 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -112,11 +112,11 @@ size_t ASPSYoungGen::available_for_contraction() {
size_t result = policy->eden_increment_aligned_down(max_contraction);
size_t result_aligned = align_size_down(result, gen_alignment);
if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("ASPSYoungGen::available_for_contraction: %d K",
+ gclog_or_tty->print_cr("ASPSYoungGen::available_for_contraction: " SIZE_FORMAT " K",
result_aligned/K);
- gclog_or_tty->print_cr(" max_contraction %d K", max_contraction/K);
- gclog_or_tty->print_cr(" eden_avail %d K", eden_avail/K);
- gclog_or_tty->print_cr(" gen_avail %d K", gen_avail/K);
+ gclog_or_tty->print_cr(" max_contraction " SIZE_FORMAT " K", max_contraction/K);
+ gclog_or_tty->print_cr(" eden_avail " SIZE_FORMAT " K", eden_avail/K);
+ gclog_or_tty->print_cr(" gen_avail " SIZE_FORMAT " K", gen_avail/K);
}
return result_aligned;
}
@@ -252,22 +252,22 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size,
requested_eden_size, requested_survivor_size);
gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") "
SIZE_FORMAT,
- eden_space()->bottom(),
- eden_space()->end(),
+ p2i(eden_space()->bottom()),
+ p2i(eden_space()->end()),
pointer_delta(eden_space()->end(),
eden_space()->bottom(),
sizeof(char)));
gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") "
SIZE_FORMAT,
- from_space()->bottom(),
- from_space()->end(),
+ p2i(from_space()->bottom()),
+ p2i(from_space()->end()),
pointer_delta(from_space()->end(),
from_space()->bottom(),
sizeof(char)));
gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") "
SIZE_FORMAT,
- to_space()->bottom(),
- to_space()->end(),
+ p2i(to_space()->bottom()),
+ p2i(to_space()->end()),
pointer_delta( to_space()->end(),
to_space()->bottom(),
sizeof(char)));
@@ -373,18 +373,18 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size,
if (PrintAdaptiveSizePolicy && Verbose) {
gclog_or_tty->print_cr(" [eden_start .. eden_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- eden_start,
- eden_end,
+ p2i(eden_start),
+ p2i(eden_end),
pointer_delta(eden_end, eden_start, sizeof(char)));
gclog_or_tty->print_cr(" [from_start .. from_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- from_start,
- from_end,
+ p2i(from_start),
+ p2i(from_end),
pointer_delta(from_end, from_start, sizeof(char)));
gclog_or_tty->print_cr(" [ to_start .. to_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- to_start,
- to_end,
+ p2i(to_start),
+ p2i(to_end),
pointer_delta( to_end, to_start, sizeof(char)));
}
} else {
@@ -427,18 +427,18 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size,
if (PrintAdaptiveSizePolicy && Verbose) {
gclog_or_tty->print_cr(" [eden_start .. eden_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- eden_start,
- eden_end,
+ p2i(eden_start),
+ p2i(eden_end),
pointer_delta(eden_end, eden_start, sizeof(char)));
gclog_or_tty->print_cr(" [ to_start .. to_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- to_start,
- to_end,
+ p2i(to_start),
+ p2i(to_end),
pointer_delta( to_end, to_start, sizeof(char)));
gclog_or_tty->print_cr(" [from_start .. from_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- from_start,
- from_end,
+ p2i(from_start),
+ p2i(from_end),
pointer_delta(from_end, from_start, sizeof(char)));
}
}
diff --git a/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp b/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp
index 82ea39b52..923a62d0f 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -478,23 +478,23 @@ void CardTableExtension::resize_covered_region_by_end(int changed_region,
gclog_or_tty->print_cr(" "
" _covered[%d].start(): " INTPTR_FORMAT
" _covered[%d].last(): " INTPTR_FORMAT,
- ind, _covered[ind].start(),
- ind, _covered[ind].last());
+ ind, p2i(_covered[ind].start()),
+ ind, p2i(_covered[ind].last()));
gclog_or_tty->print_cr(" "
" _committed[%d].start(): " INTPTR_FORMAT
" _committed[%d].last(): " INTPTR_FORMAT,
- ind, _committed[ind].start(),
- ind, _committed[ind].last());
+ ind, p2i(_committed[ind].start()),
+ ind, p2i(_committed[ind].last()));
gclog_or_tty->print_cr(" "
" byte_for(start): " INTPTR_FORMAT
" byte_for(last): " INTPTR_FORMAT,
- byte_for(_covered[ind].start()),
- byte_for(_covered[ind].last()));
+ p2i(byte_for(_covered[ind].start())),
+ p2i(byte_for(_covered[ind].last())));
gclog_or_tty->print_cr(" "
" addr_for(start): " INTPTR_FORMAT
" addr_for(last): " INTPTR_FORMAT,
- addr_for((jbyte*) _committed[ind].start()),
- addr_for((jbyte*) _committed[ind].last()));
+ p2i(addr_for((jbyte*) _committed[ind].start())),
+ p2i(addr_for((jbyte*) _committed[ind].last())));
}
debug_only(verify_guard();)
}
diff --git a/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp b/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp
index 08c75e146..ad7391e80 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
#include "runtime/mutex.hpp"
#include "runtime/mutexLocker.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
//
// GCTask
//
diff --git a/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp b/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp
index d8ee14c28..4454cd18d 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,8 @@
#include "runtime/os.hpp"
#include "runtime/thread.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
GCTaskThread::GCTaskThread(GCTaskManager* manager,
uint which,
uint processor_id) :
diff --git a/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp b/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp
index 32f7eed82..8d0153d48 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -155,7 +155,7 @@ public:
static inline idx_t bits_required(MemRegion covered_region);
void print_on_error(outputStream* st) const {
- st->print_cr("Marking Bits: (ParMarkBitMap*) " PTR_FORMAT, this);
+ st->print_cr("Marking Bits: (ParMarkBitMap*) " PTR_FORMAT, p2i(this));
_beg_bits.print_on_error(st, " Begin Bits: ");
_end_bits.print_on_error(st, " End Bits: ");
}
@@ -390,9 +390,9 @@ inline void ParMarkBitMap::verify_bit(idx_t bit) const {
inline void ParMarkBitMap::verify_addr(HeapWord* addr) const {
// Allow one past the last valid address; useful for loop bounds.
assert(addr >= region_start(),
- err_msg("addr too small, addr: " PTR_FORMAT " region start: " PTR_FORMAT, addr, region_start()));
+ err_msg("addr too small, addr: " PTR_FORMAT " region start: " PTR_FORMAT, p2i(addr), p2i(region_start())));
assert(addr <= region_end(),
- err_msg("addr too big, addr: " PTR_FORMAT " region end: " PTR_FORMAT, addr, region_end()));
+ err_msg("addr too big, addr: " PTR_FORMAT " region end: " PTR_FORMAT, p2i(addr), p2i(region_end())));
}
#endif // #ifdef ASSERT
diff --git a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp
index 8f6fb2242..55e85aa51 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -373,7 +373,7 @@ HeapWord* ParallelScavengeHeap::mem_allocate(
if ((result == NULL) && (QueuedAllocationWarningCount > 0) &&
(loop_count % QueuedAllocationWarningCount == 0)) {
warning("ParallelScavengeHeap::mem_allocate retries %d times \n\t"
- " size=%d", loop_count, size);
+ " size=" SIZE_FORMAT, loop_count, size);
}
}
diff --git a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp
index 47a7b90d9..1c646fe3e 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@ inline bool ParallelScavengeHeap::is_in_young(oop p) {
const void* loc = (void*) p;
bool result = ((HeapWord*)p) >= young_gen()->reserved().start();
assert(result == young_gen()->is_in_reserved(p),
- err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, (void*)p));
+ err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, p2i((void*)p)));
return result;
}
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_INLINE_HPP
diff --git a/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp b/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
index 14be13a26..e062b5c12 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,8 @@
#include "runtime/vmThread.hpp"
#include "services/management.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
//
// ThreadRootsMarkingTask
//
diff --git a/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp b/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp
index 0fb87664e..6c10acf5a 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
#include <math.h>
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
PSAdaptiveSizePolicy::PSAdaptiveSizePolicy(size_t init_eden_size,
size_t init_promo_size,
size_t init_survivor_size,
@@ -1033,7 +1035,7 @@ size_t PSAdaptiveSizePolicy::adjust_promo_for_footprint(
"AdaptiveSizePolicy::adjust_promo_for_footprint "
"adjusting tenured gen for footprint. "
"starting promo size " SIZE_FORMAT
- " reduced promo size " SIZE_FORMAT,
+ " reduced promo size " SIZE_FORMAT
" promo delta " SIZE_FORMAT,
desired_promo_size, reduced_size, change );
}
diff --git a/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp b/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
index bcb1cf4d2..8d3bd7e80 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -54,6 +54,8 @@
#include "utilities/events.hpp"
#include "utilities/stack.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
elapsedTimer PSMarkSweep::_accumulated_time;
jlong PSMarkSweep::_time_of_last_gc = 0;
CollectorCounters* PSMarkSweep::_counters = NULL;
diff --git a/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp b/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp
index 5e970eed4..12d0d450b 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@
#include "oops/oop.inline.hpp"
#include "runtime/java.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
inline const char* PSOldGen::select_name() {
return UseParallelOldGC ? "ParOldGen" : "PSOldGen";
}
diff --git a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
index 393629439..af2e9c8a3 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -61,6 +61,8 @@
#include <math.h>
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// All sizes are in HeapWords.
const size_t ParallelCompactData::Log2RegionSize = 16; // 64K words
const size_t ParallelCompactData::RegionSize = (size_t)1 << Log2RegionSize;
diff --git a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp
index e8a88cb35..1dc29d265 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
#include "oops/oop.inline.hpp"
#include "oops/oop.psgc.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
PaddedEnd<PSPromotionManager>* PSPromotionManager::_manager_array = NULL;
OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL;
PSOldGen* PSPromotionManager::_old_gen = NULL;
@@ -136,7 +138,7 @@ PSPromotionManager::print_stats() {
}
const uint hlines = sizeof(pm_stats_hdr) / sizeof(pm_stats_hdr[0]);
- for (uint i = 0; i < hlines; ++i) tty->print_cr(pm_stats_hdr[i]);
+ for (uint i = 0; i < hlines; ++i) tty->print_cr("%s", pm_stats_hdr[i]);
for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
manager_array(i)->print_local_stats(i);
}
diff --git a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
index 2a45c240c..356c25851 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -226,7 +226,7 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) {
if (TraceScavenge) {
gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
PSScavenge::should_scavenge(&new_obj) ? "copying" : "tenuring",
- new_obj->klass()->internal_name(), (void *)o, (void *)new_obj, new_obj->size());
+ new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size());
}
#endif
diff --git a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
index 1bc0cd5f8..f2a487615 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
@@ -56,6 +56,7 @@
#include "services/memoryService.hpp"
#include "utilities/stack.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
HeapWord* PSScavenge::_to_space_top_before_gc = NULL;
int PSScavenge::_consecutive_skipped_scavenges = 0;
diff --git a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp
index 0835f4f1f..1a722a7ca 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -81,7 +81,7 @@ inline void PSScavenge::copy_and_push_safe_barrier(PSPromotionManager* pm,
if (TraceScavenge && o->is_forwarded()) {
gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
"forwarding",
- new_obj->klass()->internal_name(), (void *)o, (void *)new_obj, new_obj->size());
+ new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size());
}
#endif
diff --git a/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp b/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp
index 90672fba0..910a29c52 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,8 @@
# include "os_bsd.inline.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// PSVirtualSpace
PSVirtualSpace::PSVirtualSpace(ReservedSpace rs, size_t alignment) :
diff --git a/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp b/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp
index 74ac4477c..a1a81c54a 100644
--- a/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp
+++ b/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@
#include "oops/oop.inline.hpp"
#include "runtime/java.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
PSYoungGen::PSYoungGen(size_t initial_size,
size_t min_size,
size_t max_size) :
diff --git a/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp b/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp
index 3e7c716d4..72cda5e31 100644
--- a/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp
+++ b/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -171,8 +171,8 @@ int AdaptiveSizePolicy::calc_default_active_workers(uintx total_workers,
"active_workers(): %d new_acitve_workers: %d "
"prev_active_workers: %d\n"
" active_workers_by_JT: %d active_workers_by_heap_size: %d",
- active_workers, new_active_workers, prev_active_workers,
- active_workers_by_JT, active_workers_by_heap_size);
+ (int) active_workers, (int) new_active_workers, (int) prev_active_workers,
+ (int) active_workers_by_JT, (int) active_workers_by_heap_size);
}
assert(new_active_workers > 0, "Always need at least 1");
return new_active_workers;
@@ -545,13 +545,13 @@ void AdaptiveSizePolicy::check_gc_overhead_limit(
if (UseGCOverheadLimit && PrintGCDetails && Verbose) {
if (gc_overhead_limit_exceeded()) {
gclog_or_tty->print_cr(" GC is exceeding overhead limit "
- "of %d%%", GCTimeLimit);
+ "of %d%%", (int) GCTimeLimit);
reset_gc_overhead_limit_count();
} else if (print_gc_overhead_limit_would_be_exceeded) {
assert(gc_overhead_limit_count() > 0, "Should not be printing");
gclog_or_tty->print_cr(" GC would exceed overhead limit "
"of %d%% %d consecutive time(s)",
- GCTimeLimit, gc_overhead_limit_count());
+ (int) GCTimeLimit, gc_overhead_limit_count());
}
}
}
diff --git a/src/share/vm/gc_implementation/shared/ageTable.cpp b/src/share/vm/gc_implementation/shared/ageTable.cpp
index 311fd7771..d148cd4d3 100644
--- a/src/share/vm/gc_implementation/shared/ageTable.cpp
+++ b/src/share/vm/gc_implementation/shared/ageTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -97,7 +97,7 @@ uint ageTable::compute_tenuring_threshold(size_t survivor_capacity) {
if (PrintTenuringDistribution) {
gclog_or_tty->cr();
gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold %u (max %u)",
- desired_survivor_size*oopSize, result, MaxTenuringThreshold);
+ desired_survivor_size*oopSize, result, (int) MaxTenuringThreshold);
}
total = 0;
@@ -106,8 +106,8 @@ uint ageTable::compute_tenuring_threshold(size_t survivor_capacity) {
total += sizes[age];
if (sizes[age] > 0) {
if (PrintTenuringDistribution) {
- gclog_or_tty->print_cr("- age %3u: %10ld bytes, %10ld total",
- age, sizes[age]*oopSize, total*oopSize);
+ gclog_or_tty->print_cr("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total",
+ age, sizes[age]*oopSize, total*oopSize);
}
}
if (UsePerfData) {
diff --git a/src/share/vm/gc_implementation/shared/allocationStats.hpp b/src/share/vm/gc_implementation/shared/allocationStats.hpp
index 0fb6d7fa2..0ac9d361c 100644
--- a/src/share/vm/gc_implementation/shared/allocationStats.hpp
+++ b/src/share/vm/gc_implementation/shared/allocationStats.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -107,7 +107,7 @@ class AllocationStats VALUE_OBJ_CLASS_SPEC {
assert(demand >= 0,
err_msg("Demand (" SSIZE_FORMAT ") should be non-negative for "
PTR_FORMAT " (size=" SIZE_FORMAT ")",
- demand, this, count));
+ demand, p2i(this), count));
// Defensive: adjust for imprecision in event counting
if (demand < 0) {
demand = 0;
@@ -120,8 +120,9 @@ class AllocationStats VALUE_OBJ_CLASS_SPEC {
float delta_ise = (CMSExtrapolateSweep ? intra_sweep_estimate : 0.0);
_desired = (ssize_t)(new_rate * (inter_sweep_estimate + delta_ise));
if (PrintFLSStatistics > 1) {
- gclog_or_tty->print_cr("demand: %d, old_rate: %f, current_rate: %f, new_rate: %f, old_desired: %d, new_desired: %d",
- demand, old_rate, rate, new_rate, old_desired, _desired);
+ gclog_or_tty->print_cr(
+ "demand: " SSIZE_FORMAT ", old_rate: %f, current_rate: %f, new_rate: %f, old_desired: " SSIZE_FORMAT ", new_desired: " SSIZE_FORMAT,
+ demand, old_rate, rate, new_rate, old_desired, _desired);
}
}
}
diff --git a/src/share/vm/gc_implementation/shared/immutableSpace.cpp b/src/share/vm/gc_implementation/shared/immutableSpace.cpp
index b1563ac86..477680727 100644
--- a/src/share/vm/gc_implementation/shared/immutableSpace.cpp
+++ b/src/share/vm/gc_implementation/shared/immutableSpace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@ void ImmutableSpace::print_short() const {
void ImmutableSpace::print() const {
print_short();
- tty->print_cr(" [%#-6lx,%#-6lx)", bottom(), end());
+ tty->print_cr(" [" INTPTR_FORMAT_W(#-6) "," INTPTR_FORMAT_W(#-6) ")", p2i(bottom()), p2i(end()));
}
#endif
diff --git a/src/share/vm/gc_implementation/shared/markSweep.cpp b/src/share/vm/gc_implementation/shared/markSweep.cpp
index 1bc3ea46a..d26269561 100644
--- a/src/share/vm/gc_implementation/shared/markSweep.cpp
+++ b/src/share/vm/gc_implementation/shared/markSweep.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,8 @@
#include "oops/objArrayKlass.inline.hpp"
#include "oops/oop.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
uint MarkSweep::_total_invocations = 0;
Stack<oop, mtGC> MarkSweep::_marking_stack;
diff --git a/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp b/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp
index 17645ca20..9a9ed0575 100644
--- a/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp
+++ b/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,8 @@
#include "oops/oop.inline.hpp"
#include "runtime/thread.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
MutableNUMASpace::MutableNUMASpace(size_t alignment) : MutableSpace(alignment) {
_lgrp_spaces = new (ResourceObj::C_HEAP, mtGC) GrowableArray<LGRPSpace*>(0, true);
_page_size = os::vm_page_size();
diff --git a/src/share/vm/gc_implementation/shared/mutableSpace.cpp b/src/share/vm/gc_implementation/shared/mutableSpace.cpp
index 7e5b5a811..17a3ecbc1 100644
--- a/src/share/vm/gc_implementation/shared/mutableSpace.cpp
+++ b/src/share/vm/gc_implementation/shared/mutableSpace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,8 @@
#include "runtime/thread.hpp"
#endif // INCLUDE_ALL_GCS
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
MutableSpace::MutableSpace(size_t alignment): ImmutableSpace(), _top(NULL), _alignment(alignment) {
assert(MutableSpace::alignment() >= 0 &&
MutableSpace::alignment() % os::vm_page_size() == 0,
diff --git a/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp b/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp
index 7a73cdfea..bddf14b6f 100644
--- a/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp
+++ b/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
#include "oops/arrayOop.hpp"
#include "oops/oop.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
ParGCAllocBuffer::ParGCAllocBuffer(size_t desired_plab_sz_) :
_word_sz(desired_plab_sz_), _bottom(NULL), _top(NULL),
_end(NULL), _hard_end(NULL),
diff --git a/src/share/vm/gc_implementation/shared/spaceDecorator.cpp b/src/share/vm/gc_implementation/shared/spaceDecorator.cpp
index 2de5846ab..5f7f95720 100644
--- a/src/share/vm/gc_implementation/shared/spaceDecorator.cpp
+++ b/src/share/vm/gc_implementation/shared/spaceDecorator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
#include "memory/space.inline.hpp"
#include "utilities/copy.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// Catch-all file for utility classes
#ifndef PRODUCT
diff --git a/src/share/vm/gc_interface/collectedHeap.cpp b/src/share/vm/gc_interface/collectedHeap.cpp
index 4b33afd66..130409200 100644
--- a/src/share/vm/gc_interface/collectedHeap.cpp
+++ b/src/share/vm/gc_interface/collectedHeap.cpp
@@ -599,12 +599,12 @@ void CollectedHeap::test_is_in() {
assert(heap_start >= ((uintptr_t)NULL + epsilon), "sanity");
void* before_heap = (void*)(heap_start - epsilon);
assert(!heap->is_in(before_heap),
- err_msg("before_heap: " PTR_FORMAT " is unexpectedly in the heap", before_heap));
+ err_msg("before_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(before_heap)));
// Test that a pointer to after the heap end is reported as outside the heap.
assert(heap_end <= ((uintptr_t)-1 - epsilon), "sanity");
void* after_heap = (void*)(heap_end + epsilon);
assert(!heap->is_in(after_heap),
- err_msg("after_heap: " PTR_FORMAT " is unexpectedly in the heap", after_heap));
+ err_msg("after_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(after_heap)));
}
#endif
diff --git a/src/share/vm/interpreter/bytecodeTracer.cpp b/src/share/vm/interpreter/bytecodeTracer.cpp
index 1892940f2..50f8ac6c7 100644
--- a/src/share/vm/interpreter/bytecodeTracer.cpp
+++ b/src/share/vm/interpreter/bytecodeTracer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -215,7 +215,7 @@ void print_oop(oop value, outputStream* st) {
st->print_cr(" %s", buf);
}
} else {
- st->print_cr(" " PTR_FORMAT, (void *)value);
+ st->print_cr(" " PTR_FORMAT, p2i((void *)value));
}
}
@@ -284,7 +284,7 @@ bool BytecodePrinter::check_cp_cache_index(int i, int& cp_index, outputStream* s
if (i >= 0 && i < climit) {
cp_index = cache->entry_at(i)->constant_pool_index();
} else {
- st->print_cr(" not in CP[*]?", i);
+ st->print_cr("%d not in CP[*]?", i);
return false;
}
return true;
@@ -299,7 +299,7 @@ bool BytecodePrinter::check_obj_index(int i, int& cp_index, outputStream* st) {
cp_index = constants->object_to_cp_index(i);
return true;
} else {
- st->print_cr(" not in OBJ[*]?", i);
+ st->print_cr("%d not in OBJ[*]?", i);
return false;
}
}
@@ -323,7 +323,7 @@ void BytecodePrinter::print_constant(int i, outputStream* st) {
if (tag.is_int()) {
st->print_cr(" " INT32_FORMAT, constants->int_at(i));
} else if (tag.is_long()) {
- st->print_cr(" " INT64_FORMAT, constants->long_at(i));
+ st->print_cr(" " INT64_FORMAT, (int64_t)(constants->long_at(i)));
} else if (tag.is_float()) {
st->print_cr(" %f", constants->float_at(i));
} else if (tag.is_double()) {
@@ -342,7 +342,7 @@ void BytecodePrinter::print_constant(int i, outputStream* st) {
} else if (tag.is_method_handle()) {
int kind = constants->method_handle_ref_kind_at(i);
int i2 = constants->method_handle_index_at(i);
- st->print(" <MethodHandle of kind %d>", kind, i2);
+ st->print(" <MethodHandle of kind %d index at %d>", kind, i2);
print_field_or_method(-i, i2, st);
} else {
st->print_cr(" bad tag=%d at %d", tag.value(), i);
@@ -391,6 +391,7 @@ void BytecodePrinter::print_field_or_method(int orig_i, int i, outputStream* st)
}
+PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
void BytecodePrinter::print_attributes(int bci, outputStream* st) {
// Show attributes of pre-rewritten codes
Bytecodes::Code code = Bytecodes::java_code(raw_code());
@@ -517,7 +518,10 @@ void BytecodePrinter::print_attributes(int bci, outputStream* st) {
int idx = ll - lo;
const char *format = first ? " %d:" INT32_FORMAT " (delta: %d)" :
", %d:" INT32_FORMAT " (delta: %d)";
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
st->print(format, ll, dest[idx], dest[idx]-bci);
+PRAGMA_DIAG_POP
}
st->cr();
}
@@ -537,7 +541,10 @@ void BytecodePrinter::print_attributes(int bci, outputStream* st) {
for (int ll = 0; ll < len; ll++, first = false) {
const char *format = first ? " " INT32_FORMAT ":" INT32_FORMAT :
", " INT32_FORMAT ":" INT32_FORMAT ;
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
st->print(format, key[ll], dest[ll]);
+PRAGMA_DIAG_POP
}
st->cr();
}
diff --git a/src/share/vm/interpreter/interpreter.cpp b/src/share/vm/interpreter/interpreter.cpp
index 60246e901..7ce4bdbb3 100644
--- a/src/share/vm/interpreter/interpreter.cpp
+++ b/src/share/vm/interpreter/interpreter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -72,7 +72,7 @@ void InterpreterCodelet::print_on(outputStream* st) const {
if (description() != NULL) st->print("%s ", description());
if (bytecode() >= 0 ) st->print("%d %s ", bytecode(), Bytecodes::name(bytecode()));
st->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "] %d bytes",
- code_begin(), code_end(), code_size());
+ p2i(code_begin()), p2i(code_end()), code_size());
if (PrintInterpreter) {
st->cr();
diff --git a/src/share/vm/interpreter/interpreterRuntime.cpp b/src/share/vm/interpreter/interpreterRuntime.cpp
index 22ffec430..9d28c16ca 100644
--- a/src/share/vm/interpreter/interpreterRuntime.cpp
+++ b/src/share/vm/interpreter/interpreterRuntime.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -75,6 +75,8 @@
#include "opto/runtime.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
class UnlockFlagSaver {
private:
JavaThread* _thread;
diff --git a/src/share/vm/interpreter/linkResolver.cpp b/src/share/vm/interpreter/linkResolver.cpp
index 8bcfc1f1e..ef7e4280b 100644
--- a/src/share/vm/interpreter/linkResolver.cpp
+++ b/src/share/vm/interpreter/linkResolver.cpp
@@ -1630,7 +1630,7 @@ void LinkResolver::resolve_dynamic_call(CallInfo& result,
THREAD);
if (HAS_PENDING_EXCEPTION) {
if (TraceMethodHandles) {
- tty->print_cr("invokedynamic throws BSME for "INTPTR_FORMAT, (void *)PENDING_EXCEPTION);
+ tty->print_cr("invokedynamic throws BSME for " INTPTR_FORMAT, p2i((void *)PENDING_EXCEPTION));
PENDING_EXCEPTION->print();
}
if (PENDING_EXCEPTION->is_a(SystemDictionary::BootstrapMethodError_klass())) {
diff --git a/src/share/vm/interpreter/oopMapCache.cpp b/src/share/vm/interpreter/oopMapCache.cpp
index 34f3edc17..79e2bba8b 100644
--- a/src/share/vm/interpreter/oopMapCache.cpp
+++ b/src/share/vm/interpreter/oopMapCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
#include "runtime/handles.inline.hpp"
#include "runtime/signature.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
class OopMapCacheEntry: private InterpreterOopMap {
friend class InterpreterOopMap;
friend class OopMapForCacheEntry;
diff --git a/src/share/vm/interpreter/templateInterpreter.cpp b/src/share/vm/interpreter/templateInterpreter.cpp
index e3e89e8ee..66eb63eaf 100644
--- a/src/share/vm/interpreter/templateInterpreter.cpp
+++ b/src/share/vm/interpreter/templateInterpreter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -104,7 +104,7 @@ void EntryPoint::print() {
tty->print("[");
for (int i = 0; i < number_of_states; i++) {
if (i > 0) tty->print(", ");
- tty->print(INTPTR_FORMAT, _entry[i]);
+ tty->print(INTPTR_FORMAT, p2i(_entry[i]));
}
tty->print("]");
}
diff --git a/src/share/vm/libadt/dict.cpp b/src/share/vm/libadt/dict.cpp
index 29c16bb41..37559a097 100644
--- a/src/share/vm/libadt/dict.cpp
+++ b/src/share/vm/libadt/dict.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,8 @@
#include <assert.h>
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// The iostream is not needed and it gets confused for gcc by the
// define of bool.
//
diff --git a/src/share/vm/libadt/set.cpp b/src/share/vm/libadt/set.cpp
index 7364795ed..f91acd80c 100644
--- a/src/share/vm/libadt/set.cpp
+++ b/src/share/vm/libadt/set.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -116,7 +116,7 @@ char *Set::setstr() const
void Set::print() const
{
char *printable_set = setstr();
- tty->print_cr(printable_set);
+ tty->print_cr("%s", printable_set);
FreeHeap(printable_set);
}
diff --git a/src/share/vm/memory/allocation.cpp b/src/share/vm/memory/allocation.cpp
index 8e382ba85..abba20bcd 100644
--- a/src/share/vm/memory/allocation.cpp
+++ b/src/share/vm/memory/allocation.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -75,11 +75,11 @@ bool MetaspaceObj::is_shared() const {
}
bool MetaspaceObj::is_metaspace_object() const {
- return ClassLoaderDataGraph::contains((void*)this);
+ return Metaspace::contains((void*)this);
}
void MetaspaceObj::print_address_on(outputStream* st) const {
- st->print(" {"INTPTR_FORMAT"}", this);
+ st->print(" {" INTPTR_FORMAT "}", p2i(this));
}
void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) throw() {
@@ -142,7 +142,7 @@ void ResourceObj::operator delete [](void* p) {
void ResourceObj::set_allocation_type(address res, allocation_type type) {
// Set allocation type in the resource object
uintptr_t allocation = (uintptr_t)res;
- assert((allocation & allocation_mask) == 0, err_msg("address should be aligned to 4 bytes at least: " PTR_FORMAT, res));
+ assert((allocation & allocation_mask) == 0, err_msg("address should be aligned to 4 bytes at least: " INTPTR_FORMAT, p2i(res)));
assert(type <= allocation_mask, "incorrect allocation type");
ResourceObj* resobj = (ResourceObj *)res;
resobj->_allocation_t[0] = ~(allocation + type);
@@ -179,7 +179,7 @@ ResourceObj::ResourceObj() { // default constructor
// Operator new() was called and type was set.
assert(!allocated_on_stack(),
err_msg("not embedded or stack, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
- this, get_allocation_type(), _allocation_t[0], _allocation_t[1]));
+ p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]));
} else {
// Operator new() was not called.
// Assume that it is embedded or stack object.
@@ -193,7 +193,7 @@ ResourceObj::ResourceObj(const ResourceObj& r) { // default copy constructor
// Note: garbage may resembles valid value.
assert(~(_allocation_t[0] | allocation_mask) != (uintptr_t)this || !is_type_set(),
err_msg("embedded or stack only, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
- this, get_allocation_type(), _allocation_t[0], _allocation_t[1]));
+ p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]));
set_allocation_type((address)this, STACK_OR_EMBEDDED);
_allocation_t[1] = 0; // Zap verification value
}
@@ -202,7 +202,7 @@ ResourceObj& ResourceObj::operator=(const ResourceObj& r) { // default copy assi
// Used in InlineTree::ok_to_inline() for WarmCallInfo.
assert(allocated_on_stack(),
err_msg("copy only into local, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")",
- this, get_allocation_type(), _allocation_t[0], _allocation_t[1]));
+ p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]));
// Keep current _allocation_t value;
return *this;
}
@@ -218,13 +218,13 @@ ResourceObj::~ResourceObj() {
void trace_heap_malloc(size_t size, const char* name, void* p) {
// A lock is not needed here - tty uses a lock internally
- tty->print_cr("Heap malloc " INTPTR_FORMAT " " SIZE_FORMAT " %s", p, size, name == NULL ? "" : name);
+ tty->print_cr("Heap malloc " INTPTR_FORMAT " " SIZE_FORMAT " %s", p2i(p), size, name == NULL ? "" : name);
}
void trace_heap_free(void* p) {
// A lock is not needed here - tty uses a lock internally
- tty->print_cr("Heap free " INTPTR_FORMAT, p);
+ tty->print_cr("Heap free " INTPTR_FORMAT, p2i(p));
}
//--------------------------------------------------------------------------------------
@@ -723,11 +723,11 @@ void AllocatedObj::print() const { print_on(tty); }
void AllocatedObj::print_value() const { print_value_on(tty); }
void AllocatedObj::print_on(outputStream* st) const {
- st->print_cr("AllocatedObj(" INTPTR_FORMAT ")", this);
+ st->print_cr("AllocatedObj(" INTPTR_FORMAT ")", p2i(this));
}
void AllocatedObj::print_value_on(outputStream* st) const {
- st->print("AllocatedObj(" INTPTR_FORMAT ")", this);
+ st->print("AllocatedObj(" INTPTR_FORMAT ")", p2i(this));
}
julong Arena::_bytes_allocated = 0;
diff --git a/src/share/vm/memory/binaryTreeDictionary.cpp b/src/share/vm/memory/binaryTreeDictionary.cpp
index 0ad161ab1..ab094c523 100644
--- a/src/share/vm/memory/binaryTreeDictionary.cpp
+++ b/src/share/vm/memory/binaryTreeDictionary.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1205,13 +1205,13 @@ void BinaryTreeDictionary<Chunk_t, FreeList_t>::report_statistics() const {
"------------------------------------\n");
size_t total_size = total_chunk_size(debug_only(NULL));
size_t free_blocks = num_free_blocks();
- gclog_or_tty->print("Total Free Space: %d\n", total_size);
- gclog_or_tty->print("Max Chunk Size: %d\n", max_chunk_size());
- gclog_or_tty->print("Number of Blocks: %d\n", free_blocks);
+ gclog_or_tty->print("Total Free Space: " SIZE_FORMAT "\n", total_size);
+ gclog_or_tty->print("Max Chunk Size: " SIZE_FORMAT "\n", max_chunk_size());
+ gclog_or_tty->print("Number of Blocks: " SIZE_FORMAT "\n", free_blocks);
if (free_blocks > 0) {
- gclog_or_tty->print("Av. Block Size: %d\n", total_size/free_blocks);
+ gclog_or_tty->print("Av. Block Size: " SIZE_FORMAT "\n", total_size/free_blocks);
}
- gclog_or_tty->print("Tree Height: %d\n", tree_height());
+ gclog_or_tty->print("Tree Height: " SIZE_FORMAT "\n", tree_height());
}
// Print census information - counts, births, deaths, etc.
@@ -1318,7 +1318,7 @@ class PrintFreeListsClosure : public AscendTreeCensusClosure<Chunk_t, FreeList_t
for (Chunk_t* fc = fl->head(); fc != NULL;
fc = fc->next()) {
_st->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ") %s",
- fc, (HeapWord*)fc + sz,
+ p2i(fc), p2i((HeapWord*)fc + sz),
fc->cantCoalesce() ? "\t CC" : "");
}
}
diff --git a/src/share/vm/memory/blockOffsetTable.cpp b/src/share/vm/memory/blockOffsetTable.cpp
index c0b35cdde..1275b17b1 100644
--- a/src/share/vm/memory/blockOffsetTable.cpp
+++ b/src/share/vm/memory/blockOffsetTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,12 +59,12 @@ BlockOffsetSharedArray::BlockOffsetSharedArray(MemRegion reserved,
" rs.base(): " INTPTR_FORMAT
" rs.size(): " INTPTR_FORMAT
" rs end(): " INTPTR_FORMAT,
- rs.base(), rs.size(), rs.base() + rs.size());
+ p2i(rs.base()), rs.size(), p2i(rs.base() + rs.size()));
gclog_or_tty->print_cr(" "
" _vs.low_boundary(): " INTPTR_FORMAT
" _vs.high_boundary(): " INTPTR_FORMAT,
- _vs.low_boundary(),
- _vs.high_boundary());
+ p2i(_vs.low_boundary()),
+ p2i(_vs.high_boundary()));
}
}
@@ -537,10 +537,10 @@ HeapWord* BlockOffsetArrayNonContigSpace::block_start_unsafe(
q -= (N_words * n_cards_back);
assert(q >= _sp->bottom(),
err_msg("q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT,
- q, _sp->bottom()));
+ p2i(q), p2i(_sp->bottom())));
assert(q < _sp->end(),
err_msg("q = " PTR_FORMAT " crossed above end = " PTR_FORMAT,
- q, _sp->end()));
+ p2i(q), p2i(_sp->end())));
index -= n_cards_back;
offset = _array->offset_array(index);
}
@@ -549,10 +549,10 @@ HeapWord* BlockOffsetArrayNonContigSpace::block_start_unsafe(
q -= offset;
assert(q >= _sp->bottom(),
err_msg("q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT,
- q, _sp->bottom()));
+ p2i(q), p2i(_sp->bottom())));
assert(q < _sp->end(),
err_msg("q = " PTR_FORMAT " crossed above end = " PTR_FORMAT,
- q, _sp->end()));
+ p2i(q), p2i(_sp->end())));
HeapWord* n = q;
while (n <= addr) {
@@ -563,14 +563,14 @@ HeapWord* BlockOffsetArrayNonContigSpace::block_start_unsafe(
err_msg("Looping at n = " PTR_FORMAT " with last = " PTR_FORMAT","
" while querying blk_start(" PTR_FORMAT ")"
" on _sp = [" PTR_FORMAT "," PTR_FORMAT ")",
- n, last, addr, _sp->bottom(), _sp->end()));
+ p2i(n), p2i(last), p2i(addr), p2i(_sp->bottom()), p2i(_sp->end())));
}
assert(q <= addr,
err_msg("wrong order for current (" INTPTR_FORMAT ")" " <= arg (" INTPTR_FORMAT ")",
- q, addr));
+ p2i(q), p2i(addr)));
assert(addr <= n,
err_msg("wrong order for arg (" INTPTR_FORMAT ") <= next (" INTPTR_FORMAT ")",
- addr, n));
+ p2i(addr), p2i(n)));
return q;
}
diff --git a/src/share/vm/memory/cardTableModRefBS.cpp b/src/share/vm/memory/cardTableModRefBS.cpp
index 9c53a8806..626c4c108 100644
--- a/src/share/vm/memory/cardTableModRefBS.cpp
+++ b/src/share/vm/memory/cardTableModRefBS.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -138,11 +138,11 @@ CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap,
gclog_or_tty->print_cr(" "
" &_byte_map[0]: " INTPTR_FORMAT
" &_byte_map[_last_valid_index]: " INTPTR_FORMAT,
- &_byte_map[0],
- &_byte_map[_last_valid_index]);
+ p2i(&_byte_map[0]),
+ p2i(&_byte_map[_last_valid_index]));
gclog_or_tty->print_cr(" "
" byte_map_base: " INTPTR_FORMAT,
- byte_map_base);
+ p2i(byte_map_base));
}
}
@@ -392,23 +392,23 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) {
gclog_or_tty->print_cr(" "
" _covered[%d].start(): " INTPTR_FORMAT
" _covered[%d].last(): " INTPTR_FORMAT,
- ind, _covered[ind].start(),
- ind, _covered[ind].last());
+ ind, p2i(_covered[ind].start()),
+ ind, p2i(_covered[ind].last()));
gclog_or_tty->print_cr(" "
" _committed[%d].start(): " INTPTR_FORMAT
" _committed[%d].last(): " INTPTR_FORMAT,
- ind, _committed[ind].start(),
- ind, _committed[ind].last());
+ ind, p2i(_committed[ind].start()),
+ ind, p2i(_committed[ind].last()));
gclog_or_tty->print_cr(" "
" byte_for(start): " INTPTR_FORMAT
" byte_for(last): " INTPTR_FORMAT,
- byte_for(_covered[ind].start()),
- byte_for(_covered[ind].last()));
+ p2i(byte_for(_covered[ind].start())),
+ p2i(byte_for(_covered[ind].last())));
gclog_or_tty->print_cr(" "
" addr_for(start): " INTPTR_FORMAT
" addr_for(last): " INTPTR_FORMAT,
- addr_for((jbyte*) _committed[ind].start()),
- addr_for((jbyte*) _committed[ind].last()));
+ p2i(addr_for((jbyte*) _committed[ind].start())),
+ p2i(addr_for((jbyte*) _committed[ind].last())));
}
// Touch the last card of the covered region to show that it
// is committed (or SEGV).
@@ -657,14 +657,14 @@ void CardTableModRefBS::verify_region(MemRegion mr,
if (failed) {
if (!failures) {
tty->cr();
- tty->print_cr("== CT verification failed: ["PTR_FORMAT","PTR_FORMAT"]", start, end);
+ tty->print_cr("== CT verification failed: [" INTPTR_FORMAT "," INTPTR_FORMAT "]", p2i(start), p2i(end));
tty->print_cr("== %sexpecting value: %d",
(val_equals) ? "" : "not ", val);
failures = true;
}
tty->print_cr("== card "PTR_FORMAT" ["PTR_FORMAT","PTR_FORMAT"], "
- "val: %d", curr, addr_for(curr),
- (HeapWord*) (((size_t) addr_for(curr)) + card_size),
+ "val: %d", p2i(curr), p2i(addr_for(curr)),
+ p2i((HeapWord*) (((size_t) addr_for(curr)) + card_size)),
(int) curr_val);
}
}
@@ -682,7 +682,7 @@ void CardTableModRefBS::verify_dirty_region(MemRegion mr) {
void CardTableModRefBS::print_on(outputStream* st) const {
st->print_cr("Card table byte_map: [" INTPTR_FORMAT "," INTPTR_FORMAT "] byte_map_base: " INTPTR_FORMAT,
- _byte_map, _byte_map + _byte_map_size, byte_map_base);
+ p2i(_byte_map), p2i(_byte_map + _byte_map_size), p2i(byte_map_base));
}
bool CardTableModRefBSForCTRS::card_will_be_scanned(jbyte cv) {
diff --git a/src/share/vm/memory/cardTableModRefBS.hpp b/src/share/vm/memory/cardTableModRefBS.hpp
index 1aa5b41ab..5e72b4640 100644
--- a/src/share/vm/memory/cardTableModRefBS.hpp
+++ b/src/share/vm/memory/cardTableModRefBS.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -155,7 +155,7 @@ class CardTableModRefBS: public ModRefBarrierSet {
assert(_whole_heap.contains(p),
err_msg("Attempt to access p = "PTR_FORMAT" out of bounds of "
" card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")",
- p, _whole_heap.start(), _whole_heap.end()));
+ p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end())));
jbyte* result = &byte_map_base[uintptr_t(p) >> card_shift];
assert(result >= _byte_map && result < _byte_map + _byte_map_size,
"out of bounds accessor for card marking array");
@@ -431,7 +431,7 @@ public:
assert(_whole_heap.contains(result),
err_msg("Returning result = "PTR_FORMAT" out of bounds of "
" card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")",
- result, _whole_heap.start(), _whole_heap.end()));
+ p2i(result), p2i(_whole_heap.start()), p2i(_whole_heap.end())));
return result;
}
@@ -440,7 +440,7 @@ public:
assert(_whole_heap.contains(p),
err_msg("Attempt to access p = "PTR_FORMAT" out of bounds of "
" card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")",
- p, _whole_heap.start(), _whole_heap.end()));
+ p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end())));
return byte_for(p) - _byte_map;
}
diff --git a/src/share/vm/memory/cardTableRS.cpp b/src/share/vm/memory/cardTableRS.cpp
index ddd65d420..953643c3f 100644
--- a/src/share/vm/memory/cardTableRS.cpp
+++ b/src/share/vm/memory/cardTableRS.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -288,14 +288,14 @@ void CardTableRS::younger_refs_in_space_iterate(Space* sp,
err_msg("Did you forget to call save_marks()? "
"[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in "
"[" PTR_FORMAT ", " PTR_FORMAT ")",
- urasm.start(), urasm.end(), ur.start(), ur.end()));
+ p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end())));
// In the case of CMS+ParNew, issue a warning
if (!ur.contains(urasm)) {
assert(UseConcMarkSweepGC && UseParNewGC, "Tautology: see assert above");
warning("CMS+ParNew: Did you forget to call save_marks()? "
"[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in "
"[" PTR_FORMAT ", " PTR_FORMAT ")",
- urasm.start(), urasm.end(), ur.start(), ur.end());
+ p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end()));
MemRegion ur2 = sp->used_region();
MemRegion urasm2 = sp->used_region_at_save_marks();
if (!ur.equals(ur2)) {
@@ -349,12 +349,12 @@ protected:
assert(jp >= _begin && jp < _end,
err_msg("Error: jp " PTR_FORMAT " should be within "
"[_begin, _end) = [" PTR_FORMAT "," PTR_FORMAT ")",
- jp, _begin, _end));
+ p2i(jp), p2i(_begin), p2i(_end)));
oop obj = oopDesc::load_decode_heap_oop(p);
guarantee(obj == NULL || (HeapWord*)obj >= _boundary,
err_msg("pointer " PTR_FORMAT " at " PTR_FORMAT " on "
"clean card crosses boundary" PTR_FORMAT,
- (HeapWord*)obj, jp, _boundary));
+ p2i((HeapWord*)obj), p2i(jp), p2i(_boundary)));
}
public:
@@ -362,10 +362,10 @@ public:
_boundary(b), _begin(begin), _end(end) {
assert(b <= begin,
err_msg("Error: boundary " PTR_FORMAT " should be at or below begin " PTR_FORMAT,
- b, begin));
+ p2i(b), p2i(begin)));
assert(begin <= end,
err_msg("Error: begin " PTR_FORMAT " should be strictly below end " PTR_FORMAT,
- begin, end));
+ p2i(begin), p2i(end)));
}
virtual void do_oop(oop* p) { VerifyCleanCardClosure::do_oop_work(p); }
diff --git a/src/share/vm/memory/collectorPolicy.cpp b/src/share/vm/memory/collectorPolicy.cpp
index ac9cb7b62..7c25b92e0 100644
--- a/src/share/vm/memory/collectorPolicy.cpp
+++ b/src/share/vm/memory/collectorPolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -769,7 +769,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size,
if ((QueuedAllocationWarningCount > 0) &&
(try_count % QueuedAllocationWarningCount == 0)) {
warning("TwoGenerationCollectorPolicy::mem_allocate_work retries %d times \n\t"
- " size=%d %s", try_count, size, is_tlab ? "(TLAB)" : "");
+ " size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : "");
}
}
}
@@ -938,7 +938,7 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation(
if ((QueuedAllocationWarningCount > 0) &&
(loop_count % QueuedAllocationWarningCount == 0)) {
warning("satisfy_failed_metadata_allocation() retries %d times \n\t"
- " size=%d", loop_count, word_size);
+ " size=" SIZE_FORMAT, loop_count, word_size);
}
} while (true); // Until a GC is done
}
diff --git a/src/share/vm/memory/defNewGeneration.cpp b/src/share/vm/memory/defNewGeneration.cpp
index 48d040388..b38f7800b 100644
--- a/src/share/vm/memory/defNewGeneration.cpp
+++ b/src/share/vm/memory/defNewGeneration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,8 @@
#include "utilities/copy.hpp"
#include "utilities/stack.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
//
// DefNewGeneration functions.
diff --git a/src/share/vm/memory/filemap.cpp b/src/share/vm/memory/filemap.cpp
index 8eb5f4524..2c0f8de80 100644
--- a/src/share/vm/memory/filemap.cpp
+++ b/src/share/vm/memory/filemap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@
#define O_BINARY 0 // otherwise do nothing.
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
extern address JVM_FunctionAtStart();
extern address JVM_FunctionAtEnd();
diff --git a/src/share/vm/memory/gcLocker.cpp b/src/share/vm/memory/gcLocker.cpp
index 3b208dfff..06fc05c9d 100644
--- a/src/share/vm/memory/gcLocker.cpp
+++ b/src/share/vm/memory/gcLocker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@ void GC_locker::verify_critical_count() {
tty->print_cr("critical counts don't match: %d != %d", _jni_lock_count, count);
for (JavaThread* thr = Threads::first(); thr; thr = thr->next()) {
if (thr->in_critical()) {
- tty->print_cr(INTPTR_FORMAT " in_critical %d", thr, thr->in_critical());
+ tty->print_cr(INTPTR_FORMAT " in_critical %d", p2i(thr), thr->in_critical());
}
}
}
diff --git a/src/share/vm/memory/genCollectedHeap.cpp b/src/share/vm/memory/genCollectedHeap.cpp
index ed8ed2446..d9b6f5094 100644
--- a/src/share/vm/memory/genCollectedHeap.cpp
+++ b/src/share/vm/memory/genCollectedHeap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -809,7 +809,7 @@ void GenCollectedHeap::do_full_collection(bool clear_all_soft_refs,
bool GenCollectedHeap::is_in_young(oop p) {
bool result = ((HeapWord*)p) < _gens[_n_gens - 1]->reserved().start();
assert(result == _gens[0]->is_in_reserved(p),
- err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, (void*)p));
+ err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, p2i((void*)p)));
return result;
}
@@ -1088,7 +1088,7 @@ void GenCollectedHeap::verify(bool silent, VerifyOption option /* ignored */) {
for (int i = _n_gens-1; i >= 0; i--) {
Generation* g = _gens[i];
if (!silent) {
- gclog_or_tty->print(g->name());
+ gclog_or_tty->print("%s", g->name());
gclog_or_tty->print(" ");
}
g->verify();
@@ -1291,7 +1291,7 @@ jlong GenCollectedHeap::millis_since_last_gc() {
// back a time later than 'now'.
jlong retVal = now - tolgc_cl.time();
if (retVal < 0) {
- NOT_PRODUCT(warning("time warp: "INT64_FORMAT, retVal);)
+ NOT_PRODUCT(warning("time warp: "INT64_FORMAT, (int64_t) retVal);)
return 0;
}
return retVal;
diff --git a/src/share/vm/memory/genOopClosures.hpp b/src/share/vm/memory/genOopClosures.hpp
index aa9f4366f..4f073dcff 100644
--- a/src/share/vm/memory/genOopClosures.hpp
+++ b/src/share/vm/memory/genOopClosures.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -199,7 +199,7 @@ class VerifyOopClosure: public OopClosure {
protected:
template <class T> inline void do_oop_work(T* p) {
oop obj = oopDesc::load_decode_heap_oop(p);
- guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, (oopDesc*) obj));
+ guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, p2i((oopDesc*) obj)));
}
public:
virtual void do_oop(oop* p);
diff --git a/src/share/vm/memory/generation.cpp b/src/share/vm/memory/generation.cpp
index 5ea44867d..ef3bf7e3c 100644
--- a/src/share/vm/memory/generation.cpp
+++ b/src/share/vm/memory/generation.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,8 @@
#include "utilities/copy.hpp"
#include "utilities/events.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
_level(level),
_ref_processor(NULL) {
diff --git a/src/share/vm/memory/generation.hpp b/src/share/vm/memory/generation.hpp
index 179bd01fa..a0c6d7886 100644
--- a/src/share/vm/memory/generation.hpp
+++ b/src/share/vm/memory/generation.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -422,7 +422,7 @@ class Generation: public CHeapObj<mtGC> {
// have to guard against non-monotonicity.
NOT_PRODUCT(
if (now < _time_of_last_gc) {
- warning("time warp: "INT64_FORMAT" to "INT64_FORMAT, _time_of_last_gc, now);
+ warning("time warp: "INT64_FORMAT" to "INT64_FORMAT, (int64_t)_time_of_last_gc, (int64_t)now);
}
)
return _time_of_last_gc;
diff --git a/src/share/vm/memory/heapInspection.cpp b/src/share/vm/memory/heapInspection.cpp
index bf65c882c..7a4c6fc87 100644
--- a/src/share/vm/memory/heapInspection.cpp
+++ b/src/share/vm/memory/heapInspection.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
#endif // INCLUDE_ALL_GCS
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// HeapInspection
int KlassInfoEntry::compare(KlassInfoEntry* e1, KlassInfoEntry* e2) {
@@ -270,6 +272,7 @@ bool KlassInfoHisto::is_selected(const char *col_name) {
return true;
}
+PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
void KlassInfoHisto::print_title(outputStream* st, bool csv_format,
bool selected[], int width_table[],
const char *name_table[]) {
@@ -282,7 +285,10 @@ void KlassInfoHisto::print_title(outputStream* st, bool csv_format,
} else {
st->print("Index Super");
for (int c=0; c<KlassSizeStats::_num_columns; c++) {
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
if (selected[c]) {st->print(str_fmt(width_table[c]), name_table[c]);}
+PRAGMA_DIAG_POP
}
st->print(" ClassName");
}
@@ -395,12 +401,18 @@ void KlassInfoHisto::print_class_stats(outputStream* st,
case KlassSizeStats::_index_inst_size:
case KlassSizeStats::_index_inst_count:
case KlassSizeStats::_index_method_count:
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
st->print(str_fmt(width_table[c]), "-");
+PRAGMA_DIAG_POP
break;
default:
{
double perc = (double)(100) * (double)(colsum_table[c]) / (double)sz_sum._total_bytes;
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
st->print(perc_fmt(width_table[c]), perc);
+PRAGMA_DIAG_POP
}
}
}
diff --git a/src/share/vm/memory/heapInspection.hpp b/src/share/vm/memory/heapInspection.hpp
index 25e438981..09ee6602e 100644
--- a/src/share/vm/memory/heapInspection.hpp
+++ b/src/share/vm/memory/heapInspection.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -295,6 +295,9 @@ class KlassInfoHisto : public StackObj {
// returns a format string to print a julong with the given width. E.g,
// printf(num_fmt(6), julong(10)) would print out the number 10 with 4
// leading spaces.
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED
+
static void print_julong(outputStream* st, int width, julong n) {
int num_spaces = width - julong_width(n);
if (num_spaces > 0) {
@@ -302,6 +305,7 @@ class KlassInfoHisto : public StackObj {
}
st->print(JULONG_FORMAT, n);
}
+PRAGMA_DIAG_POP
static char* perc_fmt(int width) {
static char buf[32];
diff --git a/src/share/vm/memory/metachunk.cpp b/src/share/vm/memory/metachunk.cpp
index 81a1f8f82..6cb6625b1 100644
--- a/src/share/vm/memory/metachunk.cpp
+++ b/src/share/vm/memory/metachunk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
#include "utilities/copy.hpp"
#include "utilities/debug.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
class VirtualSpaceNode;
const size_t metadata_chunk_initialize = 0xf7f7f7f7;
diff --git a/src/share/vm/memory/metaspace.cpp b/src/share/vm/memory/metaspace.cpp
index 4d25fe8c7..169557399 100644
--- a/src/share/vm/memory/metaspace.cpp
+++ b/src/share/vm/memory/metaspace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,8 @@
#include "utilities/copy.hpp"
#include "utilities/debug.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
typedef BinaryTreeDictionary<Metablock, FreeList<Metablock> > BlockTreeDictionary;
typedef BinaryTreeDictionary<Metachunk, FreeList<Metachunk> > ChunkTreeDictionary;
@@ -314,6 +316,8 @@ class VirtualSpaceNode : public CHeapObj<mtClass> {
MetaWord* bottom() const { return (MetaWord*) _virtual_space.low(); }
MetaWord* end() const { return (MetaWord*) _virtual_space.high(); }
+ bool contains(const void* ptr) { return ptr >= low() && ptr < high(); }
+
size_t reserved_words() const { return _virtual_space.reserved_size() / BytesPerWord; }
size_t committed_words() const { return _virtual_space.actual_committed_size() / BytesPerWord; }
@@ -555,6 +559,8 @@ class VirtualSpaceList : public CHeapObj<mtClass> {
void inc_virtual_space_count();
void dec_virtual_space_count();
+ bool contains(const void* ptr);
+
// Unlink empty VirtualSpaceNodes and free it.
void purge(ChunkManager* chunk_manager);
@@ -639,8 +645,6 @@ class SpaceManager : public CHeapObj<mtClass> {
// Accessors
Metachunk* chunks_in_use(ChunkIndex index) const { return _chunks_in_use[index]; }
void set_chunks_in_use(ChunkIndex index, Metachunk* v) {
- // ensure lock-free iteration sees fully initialized node
- OrderAccess::storestore();
_chunks_in_use[index] = v;
}
@@ -755,8 +759,6 @@ class SpaceManager : public CHeapObj<mtClass> {
void print_on(outputStream* st) const;
void locked_print_chunks_in_use_on(outputStream* st) const;
- bool contains(const void *ptr);
-
void verify();
void verify_chunk_size(Metachunk* chunk);
NOT_PRODUCT(void mangle_freed_chunks();)
@@ -1076,6 +1078,7 @@ void ChunkManager::remove_chunk(Metachunk* chunk) {
// nodes with a 0 container_count. Remove Metachunks in
// the node from their respective freelists.
void VirtualSpaceList::purge(ChunkManager* chunk_manager) {
+ assert(SafepointSynchronize::is_at_safepoint(), "must be called at safepoint for contains to work");
assert_lock_strong(SpaceManager::expand_lock());
// Don't use a VirtualSpaceListIterator because this
// list is being changed and a straightforward use of an iterator is not safe.
@@ -1109,8 +1112,8 @@ void VirtualSpaceList::purge(ChunkManager* chunk_manager) {
}
#ifdef ASSERT
if (purged_vsl != NULL) {
- // List should be stable enough to use an iterator here.
- VirtualSpaceListIterator iter(virtual_space_list());
+ // List should be stable enough to use an iterator here.
+ VirtualSpaceListIterator iter(virtual_space_list());
while (iter.repeat()) {
VirtualSpaceNode* vsl = iter.get_next();
assert(vsl != purged_vsl, "Purge of vsl failed");
@@ -1119,6 +1122,23 @@ void VirtualSpaceList::purge(ChunkManager* chunk_manager) {
#endif
}
+
+// This function looks at the mmap regions in the metaspace without locking.
+// The chunks are added with store ordering and not deleted except for at
+// unloading time during a safepoint.
+bool VirtualSpaceList::contains(const void* ptr) {
+ // List should be stable enough to use an iterator here because removing virtual
+ // space nodes is only allowed at a safepoint.
+ VirtualSpaceListIterator iter(virtual_space_list());
+ while (iter.repeat()) {
+ VirtualSpaceNode* vsn = iter.get_next();
+ if (vsn->contains(ptr)) {
+ return true;
+ }
+ }
+ return false;
+}
+
void VirtualSpaceList::retire_current_virtual_space() {
assert_lock_strong(SpaceManager::expand_lock());
@@ -1208,6 +1228,8 @@ bool VirtualSpaceList::create_new_virtual_space(size_t vs_word_size) {
} else {
assert(new_entry->reserved_words() == vs_word_size,
"Reserved memory size differs from requested memory size");
+ // ensure lock-free iteration sees fully initialized node
+ OrderAccess::storestore();
link_vs(new_entry);
return true;
}
@@ -1960,7 +1982,7 @@ void SpaceManager::locked_print_chunks_in_use_on(outputStream* st) const {
st->print_cr(" free " SIZE_FORMAT,
chunk->free_word_size());
} else {
- st->print_cr("");
+ st->cr();
}
}
@@ -2244,7 +2266,7 @@ SpaceManager::~SpaceManager() {
humongous_chunks = next_humongous_chunks;
}
if (TraceMetadataChunkAllocation && Verbose) {
- gclog_or_tty->print_cr("");
+ gclog_or_tty->cr();
gclog_or_tty->print_cr("updated dictionary count %d %s",
chunk_manager()->humongous_dictionary()->total_count(),
chunk_size_name(HumongousIndex));
@@ -2431,21 +2453,6 @@ MetaWord* SpaceManager::allocate_work(size_t word_size) {
return result;
}
-// This function looks at the chunks in the metaspace without locking.
-// The chunks are added with store ordering and not deleted except for at
-// unloading time.
-bool SpaceManager::contains(const void *ptr) {
- for (ChunkIndex i = ZeroIndex; i < NumberOfInUseLists; i = next_chunk_index(i))
- {
- Metachunk* curr = chunks_in_use(i);
- while (curr != NULL) {
- if (curr->contains(ptr)) return true;
- curr = curr->next();
- }
- }
- return false;
-}
-
void SpaceManager::verify() {
// If there are blocks in the dictionary, then
// verfication of chunks does not work since
@@ -3550,11 +3557,15 @@ void Metaspace::print_on(outputStream* out) const {
}
bool Metaspace::contains(const void* ptr) {
- if (vsm()->contains(ptr)) return true;
- if (using_class_space()) {
- return class_vsm()->contains(ptr);
+ if (UseSharedSpaces && MetaspaceShared::is_in_shared_space(ptr)) {
+ return true;
}
- return false;
+
+ if (using_class_space() && get_space_list(ClassType)->contains(ptr)) {
+ return true;
+ }
+
+ return get_space_list(NonClassType)->contains(ptr);
}
void Metaspace::verify() {
@@ -3799,5 +3810,4 @@ void TestVirtualSpaceNode_test() {
TestVirtualSpaceNodeTest::test();
TestVirtualSpaceNodeTest::test_is_available();
}
-
#endif
diff --git a/src/share/vm/memory/metaspace.hpp b/src/share/vm/memory/metaspace.hpp
index 1beddef8e..22e21b80d 100644
--- a/src/share/vm/memory/metaspace.hpp
+++ b/src/share/vm/memory/metaspace.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -232,7 +232,8 @@ class Metaspace : public CHeapObj<mtClass> {
MetaWord* expand_and_allocate(size_t size,
MetadataType mdtype);
- bool contains(const void* ptr);
+ static bool contains(const void* ptr);
+
void dump(outputStream* const out) const;
// Free empty virtualspaces
diff --git a/src/share/vm/memory/metaspaceShared.cpp b/src/share/vm/memory/metaspaceShared.cpp
index c8c6b236e..d0a875494 100644
--- a/src/share/vm/memory/metaspaceShared.cpp
+++ b/src/share/vm/memory/metaspaceShared.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@
#include "runtime/vmThread.hpp"
#include "utilities/hashtable.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
int MetaspaceShared::_max_alignment = 0;
@@ -337,13 +338,14 @@ void DumpAllocClosure::dump_stats(int ro_all, int rw_all, int md_all, int mc_all
int all_rw_count = 0;
int all_rw_bytes = 0;
- const char *fmt = "%-20s: %8d %10d %5.1f | %8d %10d %5.1f | %8d %10d %5.1f";
+// To make fmt_stats be a syntactic constant (for format warnings), use #define.
+#define fmt_stats "%-20s: %8d %10d %5.1f | %8d %10d %5.1f | %8d %10d %5.1f"
const char *sep = "--------------------+---------------------------+---------------------------+--------------------------";
const char *hdr = " ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %";
tty->print_cr("Detailed metadata info (rw includes md and mc):");
- tty->print_cr(hdr);
- tty->print_cr(sep);
+ tty->print_cr("%s", hdr);
+ tty->print_cr("%s", sep);
for (int type = 0; type < int(_number_of_types); type ++) {
const char *name = type_name((Type)type);
int ro_count = _counts[RO][type];
@@ -357,7 +359,7 @@ void DumpAllocClosure::dump_stats(int ro_all, int rw_all, int md_all, int mc_all
double rw_perc = 100.0 * double(rw_bytes) / double(rw_all);
double perc = 100.0 * double(bytes) / double(ro_all + rw_all);
- tty->print_cr(fmt, name,
+ tty->print_cr(fmt_stats, name,
ro_count, ro_bytes, ro_perc,
rw_count, rw_bytes, rw_perc,
count, bytes, perc);
@@ -375,14 +377,15 @@ void DumpAllocClosure::dump_stats(int ro_all, int rw_all, int md_all, int mc_all
double all_rw_perc = 100.0 * double(all_rw_bytes) / double(rw_all);
double all_perc = 100.0 * double(all_bytes) / double(ro_all + rw_all);
- tty->print_cr(sep);
- tty->print_cr(fmt, "Total",
+ tty->print_cr("%s", sep);
+ tty->print_cr(fmt_stats, "Total",
all_ro_count, all_ro_bytes, all_ro_perc,
all_rw_count, all_rw_bytes, all_rw_perc,
all_count, all_bytes, all_perc);
assert(all_ro_bytes == ro_all, "everything should have been counted");
assert(all_rw_bytes == rw_all, "everything should have been counted");
+#undef fmt_stats
}
// Populate the shared space.
@@ -514,7 +517,8 @@ void VM_PopulateDumpSharedSpace::doit() {
md_top = wc.get_top();
// Print shared spaces all the time
- const char* fmt = "%s space: %9d [ %4.1f%% of total] out of %9d bytes [%4.1f%% used] at " PTR_FORMAT;
+// To make fmt_space be a syntactic constant (for format warnings), use #define.
+#define fmt_space "%s space: %9d [ %4.1f%% of total] out of %9d bytes [%4.1f%% used] at " PTR_FORMAT
Metaspace* ro_space = _loader_data->ro_metaspace();
Metaspace* rw_space = _loader_data->rw_metaspace();
@@ -545,10 +549,10 @@ void VM_PopulateDumpSharedSpace::doit() {
const double mc_u_perc = mc_bytes / double(mc_alloced) * 100.0;
const double total_u_perc = total_bytes / double(total_alloced) * 100.0;
- tty->print_cr(fmt, "ro", ro_bytes, ro_t_perc, ro_alloced, ro_u_perc, ro_space->bottom());
- tty->print_cr(fmt, "rw", rw_bytes, rw_t_perc, rw_alloced, rw_u_perc, rw_space->bottom());
- tty->print_cr(fmt, "md", md_bytes, md_t_perc, md_alloced, md_u_perc, md_low);
- tty->print_cr(fmt, "mc", mc_bytes, mc_t_perc, mc_alloced, mc_u_perc, mc_low);
+ tty->print_cr(fmt_space, "ro", ro_bytes, ro_t_perc, ro_alloced, ro_u_perc, ro_space->bottom());
+ tty->print_cr(fmt_space, "rw", rw_bytes, rw_t_perc, rw_alloced, rw_u_perc, rw_space->bottom());
+ tty->print_cr(fmt_space, "md", md_bytes, md_t_perc, md_alloced, md_u_perc, md_low);
+ tty->print_cr(fmt_space, "mc", mc_bytes, mc_t_perc, mc_alloced, mc_u_perc, mc_low);
tty->print_cr("total : %9d [100.0%% of total] out of %9d bytes [%4.1f%% used]",
total_bytes, total_alloced, total_u_perc);
@@ -603,6 +607,7 @@ void VM_PopulateDumpSharedSpace::doit() {
dac.dump_stats(int(ro_bytes), int(rw_bytes), int(md_bytes), int(mc_bytes));
}
+#undef fmt_space
}
static void link_shared_classes(Klass* obj, TRAPS) {
diff --git a/src/share/vm/memory/referenceProcessor.cpp b/src/share/vm/memory/referenceProcessor.cpp
index 27344651d..629d2ba58 100644
--- a/src/share/vm/memory/referenceProcessor.cpp
+++ b/src/share/vm/memory/referenceProcessor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
#include "runtime/java.hpp"
#include "runtime/jniHandles.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL;
ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy = NULL;
bool ReferenceProcessor::_pending_list_uses_discovered_field = false;
diff --git a/src/share/vm/memory/sharedHeap.cpp b/src/share/vm/memory/sharedHeap.cpp
index 47ebc180c..56683feeb 100644
--- a/src/share/vm/memory/sharedHeap.cpp
+++ b/src/share/vm/memory/sharedHeap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
#include "utilities/copy.hpp"
#include "utilities/workgroup.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
SharedHeap* SharedHeap::_sh;
// The set of potentially parallel tasks in strong root scanning.
diff --git a/src/share/vm/memory/space.cpp b/src/share/vm/memory/space.cpp
index 8f844df81..0c3b46c15 100644
--- a/src/share/vm/memory/space.cpp
+++ b/src/share/vm/memory/space.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,8 @@
void SpaceMemRegionOopsIterClosure::do_oop(oop* p) { SpaceMemRegionOopsIterClosure::do_oop_work(p); }
void SpaceMemRegionOopsIterClosure::do_oop(narrowOop* p) { SpaceMemRegionOopsIterClosure::do_oop_work(p); }
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
HeapWord* DirtyCardToOopClosure::get_actual_top(HeapWord* top,
HeapWord* top_obj) {
if (top_obj != NULL) {
diff --git a/src/share/vm/memory/threadLocalAllocBuffer.cpp b/src/share/vm/memory/threadLocalAllocBuffer.cpp
index 715e6214c..b59cfd80d 100644
--- a/src/share/vm/memory/threadLocalAllocBuffer.cpp
+++ b/src/share/vm/memory/threadLocalAllocBuffer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
#include "runtime/thread.inline.hpp"
#include "utilities/copy.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// Thread-Local Edens support
// static member initialization
diff --git a/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp b/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp
index ea8031573..cf3fefbfe 100644
--- a/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp
+++ b/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -98,7 +98,7 @@ void ThreadLocalAllocBuffer::record_slow_allocation(size_t obj_size) {
" obj: "SIZE_FORMAT
" free: "SIZE_FORMAT
" waste: "SIZE_FORMAT"\n",
- "slow", thrd, thrd->osthread()->thread_id(),
+ "slow", p2i(thrd), thrd->osthread()->thread_id(),
obj_size, free(), refill_waste_limit());
}
}
diff --git a/src/share/vm/memory/universe.cpp b/src/share/vm/memory/universe.cpp
index 216e8aca5..a38cd006c 100644
--- a/src/share/vm/memory/universe.cpp
+++ b/src/share/vm/memory/universe.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -78,6 +78,8 @@
#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
#endif // INCLUDE_ALL_GCS
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// Known objects
Klass* Universe::_boolArrayKlassObj = NULL;
Klass* Universe::_byteArrayKlassObj = NULL;
@@ -1348,7 +1350,7 @@ void Universe::verify(VerifyOption option, const char* prefix, bool silent) {
HandleMark hm; // Handles created during verification can be zapped
_verify_count++;
- if (!silent) gclog_or_tty->print(prefix);
+ if (!silent) gclog_or_tty->print("%s", prefix);
if (!silent) gclog_or_tty->print("[Verifying ");
if (!silent) gclog_or_tty->print("threads ");
Threads::verify();
diff --git a/src/share/vm/oops/annotations.cpp b/src/share/vm/oops/annotations.cpp
index 1eb3afbb7..776b8606b 100644
--- a/src/share/vm/oops/annotations.cpp
+++ b/src/share/vm/oops/annotations.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -76,7 +76,7 @@ typeArrayOop Annotations::make_java_array(AnnotationArray* annotations, TRAPS) {
void Annotations::print_value_on(outputStream* st) const {
- st->print("Anotations(" INTPTR_FORMAT ")", this);
+ st->print("Anotations(" INTPTR_FORMAT ")", p2i(this));
}
#if INCLUDE_SERVICES
diff --git a/src/share/vm/oops/constMethod.cpp b/src/share/vm/oops/constMethod.cpp
index 4c0720908..ea51a2c02 100644
--- a/src/share/vm/oops/constMethod.cpp
+++ b/src/share/vm/oops/constMethod.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -388,8 +388,8 @@ void ConstMethod::copy_annotations_from(ConstMethod* cm) {
void ConstMethod::print_on(outputStream* st) const {
ResourceMark rm;
assert(is_constMethod(), "must be constMethod");
- st->print_cr(internal_name());
- st->print(" - method: " INTPTR_FORMAT " ", (address)method());
+ st->print_cr("%s", internal_name());
+ st->print(" - method: " INTPTR_FORMAT " ", p2i((address)method()));
method()->print_value_on(st); st->cr();
if (has_stackmap_table()) {
st->print(" - stackmap data: ");
diff --git a/src/share/vm/oops/constantPool.cpp b/src/share/vm/oops/constantPool.cpp
index 0f98ceb05..4fdd32731 100644
--- a/src/share/vm/oops/constantPool.cpp
+++ b/src/share/vm/oops/constantPool.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,8 @@
#include "runtime/signature.hpp"
#include "runtime/vframe.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
ConstantPool* ConstantPool::allocate(ClassLoaderData* loader_data, int length, TRAPS) {
// Tags are RW but comment below applies to tags also.
Array<u1>* tags = MetadataFactory::new_writeable_array<u1>(loader_data, length, 0, CHECK_NULL);
@@ -1884,7 +1886,7 @@ void ConstantPool::preload_and_initialize_all_classes(ConstantPool* obj, TRAPS)
void ConstantPool::print_on(outputStream* st) const {
EXCEPTION_MARK;
assert(is_constantPool(), "must be constantPool");
- st->print_cr(internal_name());
+ st->print_cr("%s", internal_name());
if (flags() != 0) {
st->print(" - flags: 0x%x", flags());
if (has_preresolution()) st->print(" has_preresolution");
diff --git a/src/share/vm/oops/cpCache.cpp b/src/share/vm/oops/cpCache.cpp
index 5e93cd6c8..1a8fdcca5 100644
--- a/src/share/vm/oops/cpCache.cpp
+++ b/src/share/vm/oops/cpCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,8 +38,9 @@
# include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
#endif // INCLUDE_ALL_GCS
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-// Implememtation of ConstantPoolCacheEntry
+// Implementation of ConstantPoolCacheEntry
void ConstantPoolCacheEntry::initialize_entry(int index) {
assert(0 < index && index < 0x10000, "sanity check");
@@ -667,7 +668,7 @@ void ConstantPoolCache::dump_cache() {
void ConstantPoolCache::print_on(outputStream* st) const {
assert(is_constantPoolCache(), "obj must be constant pool cache");
- st->print_cr(internal_name());
+ st->print_cr("%s", internal_name());
// print constant pool cache entries
for (int i = 0; i < length(); i++) entry_at(i)->print(st, i);
}
diff --git a/src/share/vm/oops/generateOopMap.hpp b/src/share/vm/oops/generateOopMap.hpp
index ad0578c32..48c49f443 100644
--- a/src/share/vm/oops/generateOopMap.hpp
+++ b/src/share/vm/oops/generateOopMap.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -412,9 +412,9 @@ class GenerateOopMap VALUE_OBJ_CLASS_SPEC {
int copy_cts (CellTypeState *dst, CellTypeState *src);
// Error handling
- void error_work (const char *format, va_list ap);
- void report_error (const char *format, ...);
- void verify_error (const char *format, ...);
+ void error_work (const char *format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
+ void report_error (const char *format, ...) ATTRIBUTE_PRINTF(2, 3);
+ void verify_error (const char *format, ...) ATTRIBUTE_PRINTF(2, 3);
bool got_error() { return _got_error; }
// Create result set
diff --git a/src/share/vm/oops/instanceKlass.cpp b/src/share/vm/oops/instanceKlass.cpp
index 4785462a4..06a1324e8 100644
--- a/src/share/vm/oops/instanceKlass.cpp
+++ b/src/share/vm/oops/instanceKlass.cpp
@@ -75,6 +75,8 @@
#include "c1/c1_Compiler.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#ifdef DTRACE_ENABLED
#ifndef USDT2
@@ -2895,7 +2897,7 @@ void InstanceKlass::print_on(outputStream* st) const {
st->print(BULLET"instance size: %d", size_helper()); st->cr();
st->print(BULLET"klass size: %d", size()); st->cr();
st->print(BULLET"access: "); access_flags().print_on(st); st->cr();
- st->print(BULLET"state: "); st->print_cr(state_names[_init_state]);
+ st->print(BULLET"state: "); st->print_cr("%s", state_names[_init_state]);
st->print(BULLET"name: "); name()->print_value_on(st); st->cr();
st->print(BULLET"super: "); super()->print_value_on_maybe_null(st); st->cr();
st->print(BULLET"sub: ");
diff --git a/src/share/vm/oops/instanceRefKlass.cpp b/src/share/vm/oops/instanceRefKlass.cpp
index f388980ad..7340e5adc 100644
--- a/src/share/vm/oops/instanceRefKlass.cpp
+++ b/src/share/vm/oops/instanceRefKlass.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,8 @@
#include "oops/oop.pcgc.inline.hpp"
#endif // INCLUDE_ALL_GCS
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
template <class T>
void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) {
T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
diff --git a/src/share/vm/oops/klass.cpp b/src/share/vm/oops/klass.cpp
index 007bb1e81..27dc20c29 100644
--- a/src/share/vm/oops/klass.cpp
+++ b/src/share/vm/oops/klass.cpp
@@ -648,7 +648,7 @@ void Klass::verify_on(outputStream* st) {
// This can be expensive, but it is worth checking that this klass is actually
// in the CLD graph but not in production.
- assert(ClassLoaderDataGraph::contains((address)this), "Should be");
+ assert(Metaspace::contains((address)this), "Should be");
guarantee(this->is_klass(),"should be klass");
diff --git a/src/share/vm/oops/klass.inline.hpp b/src/share/vm/oops/klass.inline.hpp
index 841a4873a..8b05c3c29 100644
--- a/src/share/vm/oops/klass.inline.hpp
+++ b/src/share/vm/oops/klass.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -63,7 +63,7 @@ inline Klass* Klass::decode_klass_not_null(narrowKlass v) {
assert(!is_null(v), "narrow klass value can never be zero");
int shift = Universe::narrow_klass_shift();
Klass* result = (Klass*)(void*)((uintptr_t)Universe::narrow_klass_base() + ((uintptr_t)v << shift));
- assert(check_klass_alignment(result), err_msg("address not aligned: " PTR_FORMAT, (void*) result));
+ assert(check_klass_alignment(result), err_msg("address not aligned: " INTPTR_FORMAT, p2i((void*) result)));
return result;
}
diff --git a/src/share/vm/oops/klassVtable.cpp b/src/share/vm/oops/klassVtable.cpp
index ad185c7f1..6d122de68 100644
--- a/src/share/vm/oops/klassVtable.cpp
+++ b/src/share/vm/oops/klassVtable.cpp
@@ -39,6 +39,8 @@
#include "runtime/handles.inline.hpp"
#include "utilities/copy.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
inline InstanceKlass* klassVtable::ik() const {
Klass* k = _klass();
assert(k->oop_is_instance(), "not an InstanceKlass");
diff --git a/src/share/vm/oops/markOop.cpp b/src/share/vm/oops/markOop.cpp
index af722e7cf..85dd5a06a 100644
--- a/src/share/vm/oops/markOop.cpp
+++ b/src/share/vm/oops/markOop.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,9 +26,11 @@
#include "oops/markOop.hpp"
#include "runtime/thread.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
void markOopDesc::print_on(outputStream* st) const {
if (is_locked()) {
- st->print("locked(0x%lx)->", value());
+ st->print("locked(" INTPTR_FORMAT ")->", value());
markOop(*(markOop*)value())->print_on(st);
} else {
assert(is_unlocked() || has_bias_pattern(), "just checking");
diff --git a/src/share/vm/oops/method.cpp b/src/share/vm/oops/method.cpp
index 69adbea3d..15aeae7b8 100644
--- a/src/share/vm/oops/method.cpp
+++ b/src/share/vm/oops/method.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -55,6 +55,7 @@
#include "utilities/quickSort.hpp"
#include "utilities/xmlstream.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// Implementation of Method
@@ -1426,7 +1427,7 @@ class SignatureTypePrinter : public SignatureTypeNames {
void type_name(const char* name) {
if (_use_separator) _st->print(", ");
- _st->print(name);
+ _st->print("%s", name);
_use_separator = true;
}
@@ -1873,6 +1874,14 @@ void Method::clear_jmethod_ids(ClassLoaderData* loader_data) {
loader_data->jmethod_ids()->clear_all_methods();
}
+bool Method::has_method_vptr(const void* ptr) {
+ Method m;
+ // This assumes that the vtbl pointer is the first word of a C++ object.
+ // This assumption is also in universe.cpp patch_klass_vtble
+ void* vtbl2 = dereference_vptr((const void*)&m);
+ void* this_vtbl = dereference_vptr(ptr);
+ return vtbl2 == this_vtbl;
+}
// Check that this pointer is valid by checking that the vtbl pointer matches
bool Method::is_valid_method() const {
@@ -1881,12 +1890,7 @@ bool Method::is_valid_method() const {
} else if (!is_metaspace_object()) {
return false;
} else {
- Method m;
- // This assumes that the vtbl pointer is the first word of a C++ object.
- // This assumption is also in universe.cpp patch_klass_vtble
- void* vtbl2 = dereference_vptr((void*)&m);
- void* this_vtbl = dereference_vptr((void*)this);
- return vtbl2 == this_vtbl;
+ return has_method_vptr((const void*)this);
}
}
@@ -1904,7 +1908,7 @@ void Method::print_jmethod_ids(ClassLoaderData* loader_data, outputStream* out)
void Method::print_on(outputStream* st) const {
ResourceMark rm;
assert(is_method(), "must be method");
- st->print_cr(internal_name());
+ st->print_cr("%s", internal_name());
// get the effect of PrintOopAddress, always, for methods:
st->print_cr(" - this oop: "INTPTR_FORMAT, (intptr_t)this);
st->print (" - method holder: "); method_holder()->print_value_on(st); st->cr();
@@ -1987,7 +1991,7 @@ void Method::print_on(outputStream* st) const {
void Method::print_value_on(outputStream* st) const {
assert(is_method(), "must be method");
- st->print(internal_name());
+ st->print("%s", internal_name());
print_address_on(st);
st->print(" ");
name()->print_value_on(st);
diff --git a/src/share/vm/oops/method.hpp b/src/share/vm/oops/method.hpp
index 93495524b..a23176e1f 100644
--- a/src/share/vm/oops/method.hpp
+++ b/src/share/vm/oops/method.hpp
@@ -868,6 +868,7 @@ class Method : public Metadata {
const char* internal_name() const { return "{method}"; }
// Check for valid method pointer
+ static bool has_method_vptr(const void* ptr);
bool is_valid_method() const;
// Verify
diff --git a/src/share/vm/oops/methodData.cpp b/src/share/vm/oops/methodData.cpp
index 20b36e951..1138b3593 100644
--- a/src/share/vm/oops/methodData.cpp
+++ b/src/share/vm/oops/methodData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
#include "runtime/deoptimization.hpp"
#include "runtime/handles.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// ==================================================================
// DataLayout
//
@@ -127,7 +129,7 @@ void ProfileData::print_shared(outputStream* st, const char* name, const char* e
st->print("trap(%s) ", Deoptimization::format_trap_state(buf, sizeof(buf), trap));
}
if (extra != NULL) {
- st->print(extra);
+ st->print("%s", extra);
}
int flags = data()->flags();
if (flags != 0) {
@@ -656,7 +658,7 @@ bool ParametersTypeData::profiling_enabled() {
#ifndef PRODUCT
void ParametersTypeData::print_data_on(outputStream* st, const char* extra) const {
- st->print("parameter types", extra);
+ st->print("parameter types"); // FIXME extra ignored?
_parameters.print_data_on(st);
}
diff --git a/src/share/vm/oops/oop.cpp b/src/share/vm/oops/oop.cpp
index 281188354..1be57811e 100644
--- a/src/share/vm/oops/oop.cpp
+++ b/src/share/vm/oops/oop.cpp
@@ -30,6 +30,8 @@
#include "runtime/thread.inline.hpp"
#include "utilities/copy.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
bool always_do_update_barrier = false;
BarrierSet* oopDesc::_bs = NULL;
diff --git a/src/share/vm/oops/oop.inline.hpp b/src/share/vm/oops/oop.inline.hpp
index 4e81252b5..0a081437f 100644
--- a/src/share/vm/oops/oop.inline.hpp
+++ b/src/share/vm/oops/oop.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -209,7 +209,7 @@ inline oop oopDesc::decode_heap_oop_not_null(narrowOop v) {
address base = Universe::narrow_oop_base();
int shift = Universe::narrow_oop_shift();
oop result = (oop)(void*)((uintptr_t)base + ((uintptr_t)v << shift));
- assert(check_obj_alignment(result), err_msg("address not aligned: " PTR_FORMAT, (void*) result));
+ assert(check_obj_alignment(result), err_msg("address not aligned: " INTPTR_FORMAT, p2i((void*) result)));
return result;
}
diff --git a/src/share/vm/opto/block.cpp b/src/share/vm/opto/block.cpp
index 3eaa2abcb..f9fec2935 100644
--- a/src/share/vm/opto/block.cpp
+++ b/src/share/vm/opto/block.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -339,7 +339,7 @@ void Block::dump_head(const PhaseCFG* cfg, outputStream* st) const {
st->print(" FRegPressure: %d",_freg_pressure);
st->print(" FHRP Index: %d",_fhrp_index);
}
- st->print_cr("");
+ st->cr();
}
void Block::dump() const {
diff --git a/src/share/vm/opto/c2_globals.hpp b/src/share/vm/opto/c2_globals.hpp
index e9c55b720..0e039dc56 100644
--- a/src/share/vm/opto/c2_globals.hpp
+++ b/src/share/vm/opto/c2_globals.hpp
@@ -455,7 +455,7 @@
notproduct(bool, PrintEliminateLocks, false, \
"Print out when locks are eliminated") \
\
- product(bool, EliminateAutoBox, false, \
+ product(bool, EliminateAutoBox, true, \
"Control optimizations for autobox elimination") \
\
diagnostic(bool, UseImplicitStableValues, true, \
diff --git a/src/share/vm/opto/callGenerator.cpp b/src/share/vm/opto/callGenerator.cpp
index a655f27b5..aaeb70388 100644
--- a/src/share/vm/opto/callGenerator.cpp
+++ b/src/share/vm/opto/callGenerator.cpp
@@ -381,7 +381,7 @@ void LateInlineCallGenerator::do_late_inline() {
}
// Setup default node notes to be picked up by the inlining
- Node_Notes* old_nn = C->default_node_notes();
+ Node_Notes* old_nn = C->node_notes_at(call->_idx);
if (old_nn != NULL) {
Node_Notes* entry_nn = old_nn->clone(C);
entry_nn->set_jvms(jvms);
diff --git a/src/share/vm/opto/callnode.cpp b/src/share/vm/opto/callnode.cpp
index 31c004cd8..21efc42d2 100644
--- a/src/share/vm/opto/callnode.cpp
+++ b/src/share/vm/opto/callnode.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -111,7 +111,7 @@ const char * const ParmNode::names[TypeFunc::Parms+1] = {
#ifndef PRODUCT
void ParmNode::dump_spec(outputStream *st) const {
if( _con < TypeFunc::Parms ) {
- st->print(names[_con]);
+ st->print("%s", names[_con]);
} else {
st->print("Parm%d: ",_con-TypeFunc::Parms);
// Verbose and WizardMode dump bottom_type for all nodes
@@ -347,19 +347,19 @@ static void format_helper( PhaseRegAlloc *regalloc, outputStream* st, Node *n, c
break;
case Type::AryPtr:
case Type::InstPtr:
- st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->isa_oopptr()->const_oop());
+ st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->isa_oopptr()->const_oop()));
break;
case Type::KlassPtr:
- st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_klassptr()->klass());
+ st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_klassptr()->klass()));
break;
case Type::MetadataPtr:
- st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_metadataptr()->metadata());
+ st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_metadataptr()->metadata()));
break;
case Type::NarrowOop:
- st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,t->make_ptr()->isa_oopptr()->const_oop());
+ st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_oopptr()->const_oop()));
break;
case Type::RawPtr:
- st->print(" %s%d]=#Raw" INTPTR_FORMAT,msg,i,t->is_rawptr());
+ st->print(" %s%d]=#Raw" INTPTR_FORMAT,msg,i,p2i(t->is_rawptr()));
break;
case Type::DoubleCon:
st->print(" %s%d]=#%fD",msg,i,t->is_double_constant()->_d);
@@ -368,7 +368,7 @@ static void format_helper( PhaseRegAlloc *regalloc, outputStream* st, Node *n, c
st->print(" %s%d]=#%fF",msg,i,t->is_float_constant()->_f);
break;
case Type::Long:
- st->print(" %s%d]=#"INT64_FORMAT,msg,i,t->is_long()->get_con());
+ st->print(" %s%d]=#"INT64_FORMAT,msg,i,(int64_t)(t->is_long()->get_con()));
break;
case Type::Half:
case Type::Top:
@@ -427,7 +427,7 @@ void JVMState::format(PhaseRegAlloc *regalloc, const Node *n, outputStream* st)
for (i = 0; i < (uint)scobjs.length(); i++) {
// Scalar replaced objects.
- st->print_cr("");
+ st->cr();
st->print(" # ScObj" INT32_FORMAT " ", i);
SafePointScalarObjectNode* spobj = scobjs.at(i);
ciKlass* cik = spobj->bottom_type()->is_oopptr()->klass();
@@ -484,7 +484,7 @@ void JVMState::format(PhaseRegAlloc *regalloc, const Node *n, outputStream* st)
st->print(" }");
}
}
- st->print_cr("");
+ st->cr();
if (caller() != NULL) caller()->format(regalloc, n, st);
}
@@ -947,7 +947,7 @@ uint CallRuntimeNode::cmp( const Node &n ) const {
#ifndef PRODUCT
void CallRuntimeNode::dump_spec(outputStream *st) const {
st->print("# ");
- st->print(_name);
+ st->print("%s", _name);
CallNode::dump_spec(st);
}
#endif
@@ -965,7 +965,7 @@ void CallRuntimeNode::calling_convention( BasicType* sig_bt, VMRegPair *parm_reg
#ifndef PRODUCT
void CallLeafNode::dump_spec(outputStream *st) const {
st->print("# ");
- st->print(_name);
+ st->print("%s", _name);
CallNode::dump_spec(st);
}
#endif
diff --git a/src/share/vm/opto/chaitin.cpp b/src/share/vm/opto/chaitin.cpp
index d79b62694..e54d5b674 100644
--- a/src/share/vm/opto/chaitin.cpp
+++ b/src/share/vm/opto/chaitin.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -2019,25 +2019,25 @@ void PhaseChaitin::dump() const {
tty->print_cr("new LRG");
}
}
- tty->print_cr("");
+ tty->cr();
// Dump lo-degree list
tty->print("Lo degree: ");
for(uint i3 = _lo_degree; i3; i3 = lrgs(i3)._next )
tty->print("L%d ",i3);
- tty->print_cr("");
+ tty->cr();
// Dump lo-stk-degree list
tty->print("Lo stk degree: ");
for(uint i4 = _lo_stk_degree; i4; i4 = lrgs(i4)._next )
tty->print("L%d ",i4);
- tty->print_cr("");
+ tty->cr();
// Dump lo-degree list
tty->print("Hi degree: ");
for(uint i5 = _hi_degree; i5; i5 = lrgs(i5)._next )
tty->print("L%d ",i5);
- tty->print_cr("");
+ tty->cr();
}
void PhaseChaitin::dump_degree_lists() const {
@@ -2045,26 +2045,26 @@ void PhaseChaitin::dump_degree_lists() const {
tty->print("Lo degree: ");
for( uint i = _lo_degree; i; i = lrgs(i)._next )
tty->print("L%d ",i);
- tty->print_cr("");
+ tty->cr();
// Dump lo-stk-degree list
tty->print("Lo stk degree: ");
for(uint i2 = _lo_stk_degree; i2; i2 = lrgs(i2)._next )
tty->print("L%d ",i2);
- tty->print_cr("");
+ tty->cr();
// Dump lo-degree list
tty->print("Hi degree: ");
for(uint i3 = _hi_degree; i3; i3 = lrgs(i3)._next )
tty->print("L%d ",i3);
- tty->print_cr("");
+ tty->cr();
}
void PhaseChaitin::dump_simplified() const {
tty->print("Simplified: ");
for( uint i = _simplified; i; i = lrgs(i)._next )
tty->print("L%d ",i);
- tty->print_cr("");
+ tty->cr();
}
static char *print_reg( OptoReg::Name reg, const PhaseChaitin *pc, char *buf ) {
@@ -2143,7 +2143,7 @@ void PhaseChaitin::dump_frame() const {
}
tty->print(" : parm %d: ", k);
domain->field_at(k + TypeFunc::Parms)->dump();
- tty->print_cr("");
+ tty->cr();
}
}
@@ -2165,7 +2165,7 @@ void PhaseChaitin::dump_frame() const {
_matcher._parm_regs[j].second() == reg ) {
tty->print("parm %d: ",j);
domain->field_at(j + TypeFunc::Parms)->dump();
- tty->print_cr("");
+ tty->cr();
break;
}
}
diff --git a/src/share/vm/opto/compile.cpp b/src/share/vm/opto/compile.cpp
index 651adc137..61ddf3978 100644
--- a/src/share/vm/opto/compile.cpp
+++ b/src/share/vm/opto/compile.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -2411,7 +2411,7 @@ void Compile::dump_asm(int *pcs, uint pc_limit) {
starts_bundle = ' ';
tty->print("\t");
delay->format(_regalloc, tty);
- tty->print_cr("");
+ tty->cr();
delay = NULL;
}
@@ -2425,12 +2425,12 @@ void Compile::dump_asm(int *pcs, uint pc_limit) {
if (pcs && n->_idx < pc_limit)
tty->print_cr("%3.3x", pcs[n->_idx]);
else
- tty->print_cr("");
+ tty->cr();
assert(cut_short || delay == NULL, "no unconditional delay branch");
} // End of per-block dump
- tty->print_cr("");
+ tty->cr();
if (cut_short) tty->print_cr("*** disassembly is cut short ***");
}
@@ -3671,7 +3671,8 @@ void Compile::ConstantTable::emit(CodeBuffer& cb) {
default: ShouldNotReachHere();
}
assert(constant_addr, "consts section too small");
- assert((constant_addr - _masm.code()->consts()->start()) == con.offset(), err_msg_res("must be: %d == %d", constant_addr - _masm.code()->consts()->start(), con.offset()));
+ assert((constant_addr - _masm.code()->consts()->start()) == con.offset(),
+ err_msg_res("must be: %d == %d", (int) (constant_addr - _masm.code()->consts()->start()), (int)(con.offset())));
}
}
@@ -3751,7 +3752,7 @@ void Compile::ConstantTable::fill_jump_table(CodeBuffer& cb, MachConstantNode* n
for (uint i = 0; i < n->outcnt(); i++) {
address* constant_addr = &jump_table_base[i];
- assert(*constant_addr == (((address) n) + i), err_msg_res("all jump-table entries must contain adjusted node pointer: " INTPTR_FORMAT " == " INTPTR_FORMAT, *constant_addr, (((address) n) + i)));
+ assert(*constant_addr == (((address) n) + i), err_msg_res("all jump-table entries must contain adjusted node pointer: " INTPTR_FORMAT " == " INTPTR_FORMAT, p2i(*constant_addr), p2i(((address) n) + i)));
*constant_addr = cb.consts()->target(*labels.at(i), (address) constant_addr);
cb.consts()->relocate((address) constant_addr, relocInfo::internal_word_type);
}
@@ -3782,7 +3783,7 @@ void Compile::dump_inlining() {
}
}
for (int i = 0; i < _print_inlining_list->length(); i++) {
- tty->print(_print_inlining_list->adr_at(i)->ss()->as_string());
+ tty->print("%s", _print_inlining_list->adr_at(i)->ss()->as_string());
}
}
}
diff --git a/src/share/vm/opto/compile.hpp b/src/share/vm/opto/compile.hpp
index a496c8825..c66a5bc4f 100644
--- a/src/share/vm/opto/compile.hpp
+++ b/src/share/vm/opto/compile.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -465,7 +465,7 @@ class Compile : public Phase {
void print_inlining(ciMethod* method, int inline_level, int bci, const char* msg = NULL) {
stringStream ss;
CompileTask::print_inlining(&ss, method, inline_level, bci, msg);
- print_inlining_stream()->print(ss.as_string());
+ print_inlining_stream()->print("%s", ss.as_string());
}
void* replay_inline_data() const { return _replay_inline_data; }
diff --git a/src/share/vm/opto/doCall.cpp b/src/share/vm/opto/doCall.cpp
index d56f460ea..cd077753b 100644
--- a/src/share/vm/opto/doCall.cpp
+++ b/src/share/vm/opto/doCall.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@ void trace_type_profile(Compile* C, ciMethod *method, int depth, int bci, ciMeth
out->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count);
stringStream ss;
prof_klass->name()->print_symbol_on(&ss);
- out->print(ss.as_string());
+ out->print("%s", ss.as_string());
out->cr();
}
}
@@ -358,7 +358,7 @@ bool Compile::should_delay_string_inlining(ciMethod* call_method, JVMState* jvms
bool Compile::should_delay_boxing_inlining(ciMethod* call_method, JVMState* jvms) {
if (eliminate_boxing() && call_method->is_boxing_method()) {
set_has_boxed_value(true);
- return true;
+ return aggressive_unboxing();
}
return false;
}
diff --git a/src/share/vm/opto/gcm.cpp b/src/share/vm/opto/gcm.cpp
index bd9a03041..8c55b6520 100644
--- a/src/share/vm/opto/gcm.cpp
+++ b/src/share/vm/opto/gcm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -2014,7 +2014,7 @@ void CFGLoop::dump() const {
tty->print("%s: %d trip_count: %6.0f freq: %6.0f\n",
_depth == 0 ? "Method" : "Loop", _id, trip_count(), _freq);
for (int i = 0; i < _depth; i++) tty->print(" ");
- tty->print(" members:", _id);
+ tty->print(" members:");
int k = 0;
for (int i = 0; i < _members.length(); i++) {
if (k++ >= 6) {
diff --git a/src/share/vm/opto/idealGraphPrinter.cpp b/src/share/vm/opto/idealGraphPrinter.cpp
index 851b70d3f..b222526c6 100644
--- a/src/share/vm/opto/idealGraphPrinter.cpp
+++ b/src/share/vm/opto/idealGraphPrinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -155,7 +155,7 @@ IdealGraphPrinter::IdealGraphPrinter() {
} else {
// It would be nice if we could shut down cleanly but it should
// be an error if we can't connect to the visualizer.
- fatal(err_msg_res("Couldn't connect to visualizer at %s:%d",
+ fatal(err_msg_res("Couldn't connect to visualizer at %s:" INTX_FORMAT,
PrintIdealGraphAddress, PrintIdealGraphPort));
}
}
@@ -195,7 +195,7 @@ IdealGraphPrinter::~IdealGraphPrinter() {
void IdealGraphPrinter::begin_elem(const char *s) {
- _xml->begin_elem(s);
+ _xml->begin_elem("%s", s);
}
void IdealGraphPrinter::end_elem() {
@@ -203,7 +203,7 @@ void IdealGraphPrinter::end_elem() {
}
void IdealGraphPrinter::begin_head(const char *s) {
- _xml->begin_head(s);
+ _xml->begin_head("%s", s);
}
void IdealGraphPrinter::end_head() {
@@ -223,7 +223,7 @@ void IdealGraphPrinter::print_attr(const char *name, const char *val) {
}
void IdealGraphPrinter::head(const char *name) {
- _xml->head(name);
+ _xml->head("%s", name);
}
void IdealGraphPrinter::tail(const char *name) {
@@ -231,7 +231,7 @@ void IdealGraphPrinter::tail(const char *name) {
}
void IdealGraphPrinter::text(const char *s) {
- _xml->text(s);
+ _xml->text("%s", s);
}
void IdealGraphPrinter::print_prop(const char *name, int val) {
@@ -359,7 +359,7 @@ void IdealGraphPrinter::end_method() {
void IdealGraphPrinter::print_indent() {
tty->print_cr("printing ident %d", _depth);
for (int i = 0; i < _depth; i++) {
- _xml->print(INDENT);
+ _xml->print("%s", INDENT);
}
}
diff --git a/src/share/vm/opto/ifg.cpp b/src/share/vm/opto/ifg.cpp
index 52a6cecce..5523400df 100644
--- a/src/share/vm/opto/ifg.cpp
+++ b/src/share/vm/opto/ifg.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -257,7 +257,7 @@ void PhaseIFG::stats() const {
for( i = 0; i < _maxlrg*2; i++ )
if( h_cnt[i] )
tty->print("%d/%d ",i,h_cnt[i]);
- tty->print_cr("");
+ tty->cr();
}
void PhaseIFG::verify( const PhaseChaitin *pc ) const {
diff --git a/src/share/vm/opto/ifnode.cpp b/src/share/vm/opto/ifnode.cpp
index 1c9dbb708..587c3b8c8 100644
--- a/src/share/vm/opto/ifnode.cpp
+++ b/src/share/vm/opto/ifnode.cpp
@@ -673,7 +673,7 @@ const TypeInt* IfNode::filtered_int_type(PhaseGVN* gvn, Node *val, Node* if_proj
// / Region
//
Node* IfNode::fold_compares(PhaseGVN* phase) {
- if (!phase->C->eliminate_boxing() || Opcode() != Op_If) return NULL;
+ if (Opcode() != Op_If) return NULL;
Node* this_cmp = in(1)->in(1);
if (this_cmp != NULL && this_cmp->Opcode() == Op_CmpI &&
diff --git a/src/share/vm/opto/loopPredicate.cpp b/src/share/vm/opto/loopPredicate.cpp
index 2fbfba0f4..c9245b06a 100644
--- a/src/share/vm/opto/loopPredicate.cpp
+++ b/src/share/vm/opto/loopPredicate.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -637,7 +637,7 @@ BoolNode* PhaseIdealLoop::rc_predicate(IdealLoopTree *loop, Node* ctrl,
if (TraceLoopPredicate) {
predString->print_cr("<u range");
- tty->print(predString->as_string());
+ tty->print("%s", predString->as_string());
}
return bol;
}
diff --git a/src/share/vm/opto/loopnode.cpp b/src/share/vm/opto/loopnode.cpp
index 093fcf81b..d858012d2 100644
--- a/src/share/vm/opto/loopnode.cpp
+++ b/src/share/vm/opto/loopnode.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -3568,7 +3568,7 @@ void PhaseIdealLoop::build_loop_late_post( Node *n ) {
#ifdef ASSERT
void PhaseIdealLoop::dump_bad_graph(const char* msg, Node* n, Node* early, Node* LCA) {
- tty->print_cr(msg);
+ tty->print_cr("%s", msg);
tty->print("n: "); n->dump();
tty->print("early(n): "); early->dump();
if (n->in(0) != NULL && !n->in(0)->is_top() &&
diff --git a/src/share/vm/opto/matcher.cpp b/src/share/vm/opto/matcher.cpp
index f263a3c50..c7fa72c94 100644
--- a/src/share/vm/opto/matcher.cpp
+++ b/src/share/vm/opto/matcher.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -2622,7 +2622,7 @@ void State::dump(int depth) {
tty->print_cr("%s %d %s",
ruleName[i], _cost[i], ruleName[_rule[i]] );
}
- tty->print_cr("");
+ tty->cr();
for( i=0; i<2; i++ )
if( _kids[i] )
diff --git a/src/share/vm/opto/memnode.cpp b/src/share/vm/opto/memnode.cpp
index 7330f77ff..2bf9438a2 100644
--- a/src/share/vm/opto/memnode.cpp
+++ b/src/share/vm/opto/memnode.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -4023,7 +4023,7 @@ bool InitializeNode::stores_are_sane(PhaseTransform* phase) {
intptr_t st_off = get_store_offset(st, phase);
if (st_off < 0) continue; // ignore dead garbage
if (last_off > st_off) {
- tty->print_cr("*** bad store offset at %d: %d > %d", i, last_off, st_off);
+ tty->print_cr("*** bad store offset at %d: " INTX_FORMAT " > " INTX_FORMAT, i, last_off, st_off);
this->dump(2);
assert(false, "ascending store offsets");
return false;
diff --git a/src/share/vm/opto/node.cpp b/src/share/vm/opto/node.cpp
index f110b0e23..a05c5d205 100644
--- a/src/share/vm/opto/node.cpp
+++ b/src/share/vm/opto/node.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1680,7 +1680,7 @@ void Node::dump(const char* suffix, outputStream *st) const {
}
}
}
- if (suffix) st->print(suffix);
+ if (suffix) st->print("%s", suffix);
C->_in_dump_cnt--;
}
diff --git a/src/share/vm/opto/parse1.cpp b/src/share/vm/opto/parse1.cpp
index 6e2d32ba7..52e76c4ef 100644
--- a/src/share/vm/opto/parse1.cpp
+++ b/src/share/vm/opto/parse1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -607,7 +607,7 @@ Parse::Parse(JVMState* caller, ciMethod* parse_method, float expected_uses, Pars
set_map(entry_map);
do_exits();
- if (log) log->done("parse nodes='%d' live='%d' memory='%d'",
+ if (log) log->done("parse nodes='%d' live='%d' memory='" SIZE_FORMAT "'",
C->unique(), C->live_nodes(), C->node_arena()->used());
}
@@ -1369,7 +1369,7 @@ void Parse::do_one_block() {
tty->print((( i < ns) ? " %d" : " %d(e)"), b->successor_at(i)->rpo());
}
if (b->is_loop_head()) tty->print(" lphd");
- tty->print_cr("");
+ tty->cr();
}
assert(block()->is_merged(), "must be merged before being parsed");
diff --git a/src/share/vm/opto/parse2.cpp b/src/share/vm/opto/parse2.cpp
index f82d246c3..36c118214 100644
--- a/src/share/vm/opto/parse2.cpp
+++ b/src/share/vm/opto/parse2.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -626,7 +626,7 @@ void Parse::jump_switch_ranges(Node* key_val, SwitchRange *lo, SwitchRange *hi,
_method->print_short_name();
tty->print_cr(" switch decision tree");
tty->print_cr(" %d ranges (%d singletons), max_depth=%d, est_depth=%d",
- hi-lo+1, nsing, _max_switch_depth, _est_switch_depth);
+ (int) (hi-lo+1), nsing, _max_switch_depth, _est_switch_depth);
if (_max_switch_depth > _est_switch_depth) {
tty->print_cr("******** BAD SWITCH DEPTH ********");
}
@@ -634,7 +634,7 @@ void Parse::jump_switch_ranges(Node* key_val, SwitchRange *lo, SwitchRange *hi,
for( r = lo; r <= hi; r++ ) {
r->print();
}
- tty->print_cr("");
+ tty->cr();
}
#endif
}
diff --git a/src/share/vm/opto/phaseX.cpp b/src/share/vm/opto/phaseX.cpp
index fd08b065c..77a890c8d 100644
--- a/src/share/vm/opto/phaseX.cpp
+++ b/src/share/vm/opto/phaseX.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1002,10 +1002,10 @@ void PhaseIterGVN::optimize() {
if ( VerifyIterativeGVN && PrintOpto ) {
if ( _verify_counter == _verify_full_passes )
tty->print_cr("VerifyIterativeGVN: %d transforms and verify passes",
- _verify_full_passes);
+ (int) _verify_full_passes);
else
tty->print_cr("VerifyIterativeGVN: %d transforms, %d full verify passes",
- _verify_counter, _verify_full_passes);
+ (int) _verify_counter, (int) _verify_full_passes);
}
#endif
}
@@ -1379,6 +1379,15 @@ void PhaseIterGVN::add_users_to_worklist( Node *n ) {
_worklist.push(u);
}
}
+ // If changed AddI/SubI inputs, check CmpU for range check optimization.
+ if (use_op == Op_AddI || use_op == Op_SubI) {
+ for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
+ Node* u = use->fast_out(i2);
+ if (u->is_Cmp() && (u->Opcode() == Op_CmpU)) {
+ _worklist.push(u);
+ }
+ }
+ }
// If changed AddP inputs, check Stores for loop invariant
if( use_op == Op_AddP ) {
for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
diff --git a/src/share/vm/opto/regmask.cpp b/src/share/vm/opto/regmask.cpp
index 07fddd151..4b367117e 100644
--- a/src/share/vm/opto/regmask.cpp
+++ b/src/share/vm/opto/regmask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -116,7 +116,7 @@ void OptoReg::dump(int r, outputStream *st) {
case Special: st->print("r---"); break;
case Bad: st->print("rBAD"); break;
default:
- if (r < _last_Mach_Reg) st->print(Matcher::regName[r]);
+ if (r < _last_Mach_Reg) st->print("%s", Matcher::regName[r]);
else st->print("rS%d",r);
break;
}
diff --git a/src/share/vm/opto/runtime.cpp b/src/share/vm/opto/runtime.cpp
index 1f5c964fc..8ac04d80b 100644
--- a/src/share/vm/opto/runtime.cpp
+++ b/src/share/vm/opto/runtime.cpp
@@ -1395,7 +1395,7 @@ static void trace_exception(oop exception_oop, address exception_pc, const char*
} else {
tty->print("<unknown>");
}
- tty->print(" at " INTPTR_FORMAT, exception_pc);
+ tty->print(" at " INTPTR_FORMAT, p2i(exception_pc));
tty->print_cr("]");
}
diff --git a/src/share/vm/opto/subnode.cpp b/src/share/vm/opto/subnode.cpp
index 71ffed866..ba8a00590 100644
--- a/src/share/vm/opto/subnode.cpp
+++ b/src/share/vm/opto/subnode.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -80,7 +80,7 @@ Node *SubNode::Identity( PhaseTransform *phase ) {
//------------------------------Value------------------------------------------
// A subtract node differences it's two inputs.
-const Type *SubNode::Value( PhaseTransform *phase ) const {
+const Type* SubNode::Value_common(PhaseTransform *phase) const {
const Node* in1 = in(1);
const Node* in2 = in(2);
// Either input is TOP ==> the result is TOP
@@ -97,6 +97,16 @@ const Type *SubNode::Value( PhaseTransform *phase ) const {
if( t1 == Type::BOTTOM || t2 == Type::BOTTOM )
return bottom_type();
+ return NULL;
+}
+
+const Type* SubNode::Value(PhaseTransform *phase) const {
+ const Type* t = Value_common(phase);
+ if (t != NULL) {
+ return t;
+ }
+ const Type* t1 = phase->type(in(1));
+ const Type* t2 = phase->type(in(2));
return sub(t1,t2); // Local flavor of type subtraction
}
@@ -570,6 +580,81 @@ const Type *CmpUNode::sub( const Type *t1, const Type *t2 ) const {
return TypeInt::CC; // else use worst case results
}
+const Type* CmpUNode::Value(PhaseTransform *phase) const {
+ const Type* t = SubNode::Value_common(phase);
+ if (t != NULL) {
+ return t;
+ }
+ const Node* in1 = in(1);
+ const Node* in2 = in(2);
+ const Type* t1 = phase->type(in1);
+ const Type* t2 = phase->type(in2);
+ assert(t1->isa_int(), "CmpU has only Int type inputs");
+ if (t2 == TypeInt::INT) { // Compare to bottom?
+ return bottom_type();
+ }
+ uint in1_op = in1->Opcode();
+ if (in1_op == Op_AddI || in1_op == Op_SubI) {
+ // The problem rise when result of AddI(SubI) may overflow
+ // signed integer value. Let say the input type is
+ // [256, maxint] then +128 will create 2 ranges due to
+ // overflow: [minint, minint+127] and [384, maxint].
+ // But C2 type system keep only 1 type range and as result
+ // it use general [minint, maxint] for this case which we
+ // can't optimize.
+ //
+ // Make 2 separate type ranges based on types of AddI(SubI) inputs
+ // and compare results of their compare. If results are the same
+ // CmpU node can be optimized.
+ const Node* in11 = in1->in(1);
+ const Node* in12 = in1->in(2);
+ const Type* t11 = (in11 == in1) ? Type::TOP : phase->type(in11);
+ const Type* t12 = (in12 == in1) ? Type::TOP : phase->type(in12);
+ // Skip cases when input types are top or bottom.
+ if ((t11 != Type::TOP) && (t11 != TypeInt::INT) &&
+ (t12 != Type::TOP) && (t12 != TypeInt::INT)) {
+ const TypeInt *r0 = t11->is_int();
+ const TypeInt *r1 = t12->is_int();
+ jlong lo_r0 = r0->_lo;
+ jlong hi_r0 = r0->_hi;
+ jlong lo_r1 = r1->_lo;
+ jlong hi_r1 = r1->_hi;
+ if (in1_op == Op_SubI) {
+ jlong tmp = hi_r1;
+ hi_r1 = -lo_r1;
+ lo_r1 = -tmp;
+ // Note, for substructing [minint,x] type range
+ // long arithmetic provides correct overflow answer.
+ // The confusion come from the fact that in 32-bit
+ // -minint == minint but in 64-bit -minint == maxint+1.
+ }
+ jlong lo_long = lo_r0 + lo_r1;
+ jlong hi_long = hi_r0 + hi_r1;
+ int lo_tr1 = min_jint;
+ int hi_tr1 = (int)hi_long;
+ int lo_tr2 = (int)lo_long;
+ int hi_tr2 = max_jint;
+ bool underflow = lo_long != (jlong)lo_tr2;
+ bool overflow = hi_long != (jlong)hi_tr1;
+ // Use sub(t1, t2) when there is no overflow (one type range)
+ // or when both overflow and underflow (too complex).
+ if ((underflow != overflow) && (hi_tr1 < lo_tr2)) {
+ // Overflow only on one boundary, compare 2 separate type ranges.
+ int w = MAX2(r0->_widen, r1->_widen); // _widen does not matter here
+ const TypeInt* tr1 = TypeInt::make(lo_tr1, hi_tr1, w);
+ const TypeInt* tr2 = TypeInt::make(lo_tr2, hi_tr2, w);
+ const Type* cmp1 = sub(tr1, t2);
+ const Type* cmp2 = sub(tr2, t2);
+ if (cmp1 == cmp2) {
+ return cmp1; // Hit!
+ }
+ }
+ }
+ }
+
+ return sub(t1, t2); // Local flavor of type subtraction
+}
+
bool CmpUNode::is_index_range_check() const {
// Check for the "(X ModI Y) CmpU Y" shape
return (in(1)->Opcode() == Op_ModI &&
@@ -1065,7 +1150,7 @@ const Type *BoolTest::cc2logical( const Type *CC ) const {
#ifndef PRODUCT
void BoolTest::dump_on(outputStream *st) const {
const char *msg[] = {"eq","gt","of","lt","ne","le","nof","ge"};
- st->print(msg[_test]);
+ st->print("%s", msg[_test]);
}
#endif
diff --git a/src/share/vm/opto/subnode.hpp b/src/share/vm/opto/subnode.hpp
index 56ee308d9..da5d7e378 100644
--- a/src/share/vm/opto/subnode.hpp
+++ b/src/share/vm/opto/subnode.hpp
@@ -50,6 +50,7 @@ public:
// Compute a new Type for this node. Basically we just do the pre-check,
// then call the virtual add() to set the type.
virtual const Type *Value( PhaseTransform *phase ) const;
+ const Type* Value_common( PhaseTransform *phase ) const;
// Supplied function returns the subtractend of the inputs.
// This also type-checks the inputs for sanity. Guaranteed never to
@@ -158,6 +159,7 @@ public:
CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
virtual int Opcode() const;
virtual const Type *sub( const Type *, const Type * ) const;
+ const Type *Value( PhaseTransform *phase ) const;
bool is_index_range_check() const;
};
diff --git a/src/share/vm/opto/type.cpp b/src/share/vm/opto/type.cpp
index 4a7ad22b2..17ebee731 100644
--- a/src/share/vm/opto/type.cpp
+++ b/src/share/vm/opto/type.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,8 @@
#include "opto/opcodes.hpp"
#include "opto/type.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// Portions of code courtesy of Clifford Click
// Optimization - Graph Style
@@ -842,7 +844,7 @@ bool Type::has_memory() const {
#ifndef PRODUCT
//------------------------------dump2------------------------------------------
void Type::dump2( Dict &d, uint depth, outputStream *st ) const {
- st->print(_type_info[_base].msg);
+ st->print("%s", _type_info[_base].msg);
}
//------------------------------dump-------------------------------------------
diff --git a/src/share/vm/prims/jni.cpp b/src/share/vm/prims/jni.cpp
index 3bb8be766..60a6c46f6 100644
--- a/src/share/vm/prims/jni.cpp
+++ b/src/share/vm/prims/jni.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -308,7 +308,7 @@ const int MAX_REASONABLE_LOCAL_CAPACITY = 4*K;
class JNITraceWrapper : public StackObj {
public:
- JNITraceWrapper(const char* format, ...) {
+ JNITraceWrapper(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
if (TraceJNICalls) {
va_list ap;
va_start(ap, format);
diff --git a/src/share/vm/prims/jniCheck.cpp b/src/share/vm/prims/jniCheck.cpp
index 4313b4bf0..5c2fa12e6 100644
--- a/src/share/vm/prims/jniCheck.cpp
+++ b/src/share/vm/prims/jniCheck.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -100,7 +100,7 @@ extern "C" { \
result_type JNICALL header { \
JavaThread* thr = (JavaThread*)ThreadLocalStorage::get_thread_slow();\
if (thr == NULL || !thr->is_Java_thread()) { \
- tty->print_cr(fatal_using_jnienv_in_nonjava); \
+ tty->print_cr("%s", fatal_using_jnienv_in_nonjava); \
os::abort(true); \
} \
JNIEnv* xenv = thr->jni_environment(); \
@@ -184,7 +184,7 @@ static inline void
functionEnter(JavaThread* thr)
{
if (thr->in_critical()) {
- tty->print_cr(warn_other_function_in_critical);
+ tty->print_cr("%s", warn_other_function_in_critical);
}
if (thr->has_pending_exception()) {
NativeReportJNIWarning(thr, "JNI call made with exception pending");
@@ -195,7 +195,7 @@ static inline void
functionEnterExceptionAllowed(JavaThread* thr)
{
if (thr->in_critical()) {
- tty->print_cr(warn_other_function_in_critical);
+ tty->print_cr("%s", warn_other_function_in_critical);
}
}
diff --git a/src/share/vm/prims/jvm.cpp b/src/share/vm/prims/jvm.cpp
index b7706304b..e8c04ab9b 100644
--- a/src/share/vm/prims/jvm.cpp
+++ b/src/share/vm/prims/jvm.cpp
@@ -220,7 +220,7 @@ void trace_class_resolution(Klass* to_class) {
#ifdef ASSERT
class JVMTraceWrapper : public StackObj {
public:
- JVMTraceWrapper(const char* format, ...) {
+ JVMTraceWrapper(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
if (TraceJVMCalls) {
va_list ap;
va_start(ap, format);
@@ -2716,14 +2716,14 @@ JVM_END
JVM_LEAF(jlong, JVM_Lseek(jint fd, jlong offset, jint whence))
- JVMWrapper4("JVM_Lseek (0x%x, %Ld, %d)", fd, offset, whence);
+ JVMWrapper4("JVM_Lseek (0x%x, " INT64_FORMAT ", %d)", fd, (int64_t) offset, whence);
//%note jvm_r6
return os::lseek(fd, offset, whence);
JVM_END
JVM_LEAF(jint, JVM_SetLength(jint fd, jlong length))
- JVMWrapper3("JVM_SetLength (0x%x, %Ld)", fd, length);
+ JVMWrapper3("JVM_SetLength (0x%x, " INT64_FORMAT ")", fd, (int64_t) length);
return os::ftruncate(fd, length);
JVM_END
@@ -2738,13 +2738,14 @@ JVM_END
// Printing support //////////////////////////////////////////////////
extern "C" {
+ATTRIBUTE_PRINTF(3, 0)
int jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args) {
// see bug 4399518, 4417214
if ((intptr_t)count <= 0) return -1;
return vsnprintf(str, count, fmt, args);
}
-
+ATTRIBUTE_PRINTF(3, 0)
int jio_snprintf(char *str, size_t count, const char *fmt, ...) {
va_list args;
int len;
@@ -2754,7 +2755,7 @@ int jio_snprintf(char *str, size_t count, const char *fmt, ...) {
return len;
}
-
+ATTRIBUTE_PRINTF(2,3)
int jio_fprintf(FILE* f, const char *fmt, ...) {
int len;
va_list args;
@@ -2764,7 +2765,7 @@ int jio_fprintf(FILE* f, const char *fmt, ...) {
return len;
}
-
+ATTRIBUTE_PRINTF(2, 0)
int jio_vfprintf(FILE* f, const char *fmt, va_list args) {
if (Arguments::vfprintf_hook() != NULL) {
return Arguments::vfprintf_hook()(f, fmt, args);
@@ -2773,7 +2774,7 @@ int jio_vfprintf(FILE* f, const char *fmt, va_list args) {
}
}
-
+ATTRIBUTE_PRINTF(1, 2)
JNIEXPORT int jio_printf(const char *fmt, ...) {
int len;
va_list args;
@@ -2910,7 +2911,7 @@ JVM_ENTRY(void, JVM_StopThread(JNIEnv* env, jobject jthread, jobject throwable))
JavaThread* receiver = java_lang_Thread::thread(java_thread);
Events::log_exception(JavaThread::current(),
"JVM_StopThread thread JavaThread " INTPTR_FORMAT " as oop " INTPTR_FORMAT " [exception " INTPTR_FORMAT "]",
- receiver, (address)java_thread, throwable);
+ p2i(receiver), p2i((address)java_thread), p2i(throwable));
// First check if thread is alive
if (receiver != NULL) {
// Check if exception is getting thrown at self (use oop equality, since the
diff --git a/src/share/vm/prims/jvmtiEnter.xsl b/src/share/vm/prims/jvmtiEnter.xsl
index ff609eee2..e855d21dd 100644
--- a/src/share/vm/prims/jvmtiEnter.xsl
+++ b/src/share/vm/prims/jvmtiEnter.xsl
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,9 @@
# include "prims/jvmtiRawMonitor.hpp"
# include "prims/jvmtiUtil.hpp"
+// There are known-bad format/arg pairings in the code generated by this file.
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
</xsl:text>
<xsl:if test="$trace = 'Trace'">
diff --git a/src/share/vm/prims/jvmtiEnvThreadState.cpp b/src/share/vm/prims/jvmtiEnvThreadState.cpp
index ab3c5f445..7124e3a6a 100644
--- a/src/share/vm/prims/jvmtiEnvThreadState.cpp
+++ b/src/share/vm/prims/jvmtiEnvThreadState.cpp
@@ -113,7 +113,7 @@ void JvmtiFramePops::print() {
JvmtiFramePop fp = JvmtiFramePop(_pops->at(i));
tty->print("%d: ", i);
fp.print();
- tty->print_cr("");
+ tty->cr();
}
}
#endif
diff --git a/src/share/vm/prims/jvmtiEventController.cpp b/src/share/vm/prims/jvmtiEventController.cpp
index 52bfb1f76..83761d96a 100644
--- a/src/share/vm/prims/jvmtiEventController.cpp
+++ b/src/share/vm/prims/jvmtiEventController.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,8 @@
#include "runtime/vmThread.hpp"
#include "runtime/vm_operations.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#ifdef JVMTI_TRACE
#define EC_TRACE(out) do { \
if (JvmtiTrace::trace_event_controller()) { \
diff --git a/src/share/vm/prims/jvmtiExport.cpp b/src/share/vm/prims/jvmtiExport.cpp
index 65039188c..9af17df2e 100644
--- a/src/share/vm/prims/jvmtiExport.cpp
+++ b/src/share/vm/prims/jvmtiExport.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,8 @@
#include "gc_implementation/parallelScavenge/psMarkSweep.hpp"
#endif // INCLUDE_ALL_GCS
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#ifdef JVMTI_TRACE
#define EVT_TRACE(evt,out) if ((JvmtiTrace::event_trace_flags(evt) & JvmtiTrace::SHOW_EVENT_SENT) != 0) { SafeResourceMark rm; tty->print_cr out; }
#define EVT_TRIG_TRACE(evt,out) if ((JvmtiTrace::event_trace_flags(evt) & JvmtiTrace::SHOW_EVENT_TRIGGER) != 0) { SafeResourceMark rm; tty->print_cr out; }
diff --git a/src/share/vm/prims/jvmtiImpl.cpp b/src/share/vm/prims/jvmtiImpl.cpp
index ad90eeb94..0d6d00d4e 100644
--- a/src/share/vm/prims/jvmtiImpl.cpp
+++ b/src/share/vm/prims/jvmtiImpl.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -413,7 +413,7 @@ void JvmtiBreakpoints::print() {
JvmtiBreakpoint& bp = _bps.at(i);
tty->print("%d: ", i);
bp.print();
- tty->print_cr("");
+ tty->cr();
}
#endif
}
diff --git a/src/share/vm/prims/jvmtiRedefineClasses.cpp b/src/share/vm/prims/jvmtiRedefineClasses.cpp
index 1c3bbbfee..5f3d05478 100644
--- a/src/share/vm/prims/jvmtiRedefineClasses.cpp
+++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
#include "runtime/relocator.hpp"
#include "utilities/bitMap.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
Array<Method*>* VM_RedefineClasses::_old_methods = NULL;
Array<Method*>* VM_RedefineClasses::_new_methods = NULL;
@@ -1904,6 +1905,8 @@ bool VM_RedefineClasses::rewrite_cp_refs_in_annotation_struct(
// annotations_typeArray if needed. Returns the original constant
// pool reference if a rewrite was not needed or the new constant
// pool reference if a rewrite was needed.
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED
u2 VM_RedefineClasses::rewrite_cp_ref_in_annotation_data(
AnnotationArray* annotations_typeArray, int &byte_i_ref,
const char * trace_mesg, TRAPS) {
@@ -1920,6 +1923,7 @@ u2 VM_RedefineClasses::rewrite_cp_ref_in_annotation_data(
byte_i_ref += 2;
return old_cp_index;
}
+PRAGMA_DIAG_POP
// Rewrite constant pool references in the element_value portion of an
diff --git a/src/share/vm/prims/methodHandles.cpp b/src/share/vm/prims/methodHandles.cpp
index e1fafabf5..0fa73313f 100644
--- a/src/share/vm/prims/methodHandles.cpp
+++ b/src/share/vm/prims/methodHandles.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -536,7 +536,7 @@ void MethodHandles::print_as_basic_type_signature_on(outputStream* st,
// unknown letter, or we don't want to know its name
st->put(ch);
} else {
- st->print(n);
+ st->print("%s", n);
prev_type = true;
}
break;
diff --git a/src/share/vm/prims/privilegedStack.cpp b/src/share/vm/prims/privilegedStack.cpp
index 7ffc2ea5f..b214d4bde 100644
--- a/src/share/vm/prims/privilegedStack.cpp
+++ b/src/share/vm/prims/privilegedStack.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
#include "prims/privilegedStack.hpp"
#include "runtime/vframe.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
void PrivilegedElement::initialize(vframeStream* vfst, oop context, PrivilegedElement* next, TRAPS) {
Method* method = vfst->method();
diff --git a/src/share/vm/prims/unsafe.cpp b/src/share/vm/prims/unsafe.cpp
index fdec61953..3fe2fb0b5 100644
--- a/src/share/vm/prims/unsafe.cpp
+++ b/src/share/vm/prims/unsafe.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,8 @@
#include "utilities/copy.hpp"
#include "utilities/dtrace.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
/*
* Implementation of class sun.misc.Unsafe
*/
diff --git a/src/share/vm/prims/whitebox.cpp b/src/share/vm/prims/whitebox.cpp
index 80cb0dfa5..8fdb67675 100644
--- a/src/share/vm/prims/whitebox.cpp
+++ b/src/share/vm/prims/whitebox.cpp
@@ -53,6 +53,8 @@
#include "compiler/compileBroker.hpp"
#include "runtime/compilationPolicy.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#define SIZE_T_MAX_VALUE ((size_t) -1)
bool WhiteBox::_used = false;
diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp
index b859c15af..e6cbc2ee8 100644
--- a/src/share/vm/runtime/arguments.cpp
+++ b/src/share/vm/runtime/arguments.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -840,7 +840,7 @@ void Arguments::print_jvm_flags_on(outputStream* st) {
for (int i=0; i < _num_jvm_flags; i++) {
st->print("%s ", _jvm_flags_array[i]);
}
- st->print_cr("");
+ st->cr();
}
}
@@ -849,7 +849,7 @@ void Arguments::print_jvm_args_on(outputStream* st) {
for (int i=0; i < _num_jvm_args; i++) {
st->print("%s ", _jvm_args_array[i]);
}
- st->print_cr("");
+ st->cr();
}
}
@@ -1341,8 +1341,8 @@ void Arguments::set_cms_and_parnew_gc_flags() {
}
if (PrintGCDetails && Verbose) {
tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
- MarkStackSize / K, MarkStackSizeMax / K);
- tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
+ (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
+ tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads);
}
}
#endif // INCLUDE_ALL_GCS
@@ -1422,7 +1422,7 @@ bool Arguments::should_auto_select_low_pause_collector() {
if (PrintGCDetails) {
// Cannot use gclog_or_tty yet.
tty->print_cr("Automatic selection of the low pause collector"
- " based on pause goal of %d (ms)", MaxGCPauseMillis);
+ " based on pause goal of %d (ms)", (int) MaxGCPauseMillis);
}
return true;
}
@@ -1639,8 +1639,8 @@ void Arguments::set_g1_gc_flags() {
if (PrintGCDetails && Verbose) {
tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
- MarkStackSize / K, MarkStackSizeMax / K);
- tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
+ (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
+ tty->print_cr("ConcGCThreads: %u", (uint) ConcGCThreads);
}
}
@@ -1703,7 +1703,7 @@ void Arguments::set_heap_size() {
if (PrintGCDetails && Verbose) {
// Cannot use gclog_or_tty yet.
- tty->print_cr(" Maximum heap size " SIZE_FORMAT, reasonable_max);
+ tty->print_cr(" Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max);
}
FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx)reasonable_max);
}
@@ -2090,7 +2090,7 @@ bool Arguments::check_vm_args_consistency() {
// Using "else if" below to avoid printing two error messages if min > max.
// This will also prevent us from reporting both min>100 and max>100 at the
// same time, but that is less annoying than printing two identical errors IMHO.
- FormatBuffer<80> err_msg("");
+ FormatBuffer<80> err_msg("%s","");
if (!verify_MinHeapFreeRatio(err_msg, MinHeapFreeRatio)) {
jio_fprintf(defaultStream::error_stream(), "%s\n", err_msg.buffer());
status = false;
diff --git a/src/share/vm/runtime/arguments.hpp b/src/share/vm/runtime/arguments.hpp
index ec4b1f630..8101cb5eb 100644
--- a/src/share/vm/runtime/arguments.hpp
+++ b/src/share/vm/runtime/arguments.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
extern "C" {
typedef void (JNICALL *abort_hook_t)(void);
typedef void (JNICALL *exit_hook_t)(jint code);
- typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args);
+ typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args) ATTRIBUTE_PRINTF(2, 0);
}
// Forward declarations
diff --git a/src/share/vm/runtime/biasedLocking.cpp b/src/share/vm/runtime/biasedLocking.cpp
index f4ba0328b..c8c2acf37 100644
--- a/src/share/vm/runtime/biasedLocking.cpp
+++ b/src/share/vm/runtime/biasedLocking.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -161,7 +161,7 @@ static BiasedLocking::Condition revoke_bias(oop obj, bool allow_rebias, bool is_
if (TraceBiasedLocking && (Verbose || !is_bulk)) {
ResourceMark rm;
tty->print_cr("Revoking bias of object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s , prototype header " INTPTR_FORMAT " , allow rebias %d , requesting thread " INTPTR_FORMAT,
- (void *)obj, (intptr_t) mark, obj->klass()->external_name(), (intptr_t) obj->klass()->prototype_header(), (allow_rebias ? 1 : 0), (intptr_t) requesting_thread);
+ p2i((void *)obj), (intptr_t) mark, obj->klass()->external_name(), (intptr_t) obj->klass()->prototype_header(), (allow_rebias ? 1 : 0), (intptr_t) requesting_thread);
}
JavaThread* biased_thread = mark->biased_locker();
@@ -214,8 +214,8 @@ static BiasedLocking::Condition revoke_bias(oop obj, bool allow_rebias, bool is_
if (mon_info->owner() == obj) {
if (TraceBiasedLocking && Verbose) {
tty->print_cr(" mon_info->owner (" PTR_FORMAT ") == obj (" PTR_FORMAT ")",
- (void *) mon_info->owner(),
- (void *) obj);
+ p2i((void *) mon_info->owner()),
+ p2i((void *) obj));
}
// Assume recursive case and fix up highest lock later
markOop mark = markOopDesc::encode((BasicLock*) NULL);
@@ -224,8 +224,8 @@ static BiasedLocking::Condition revoke_bias(oop obj, bool allow_rebias, bool is_
} else {
if (TraceBiasedLocking && Verbose) {
tty->print_cr(" mon_info->owner (" PTR_FORMAT ") != obj (" PTR_FORMAT ")",
- (void *) mon_info->owner(),
- (void *) obj);
+ p2i((void *) mon_info->owner()),
+ p2i((void *) obj));
}
}
}
@@ -328,7 +328,7 @@ static BiasedLocking::Condition bulk_revoke_or_rebias_at_safepoint(oop o,
tty->print_cr("* Beginning bulk revocation (kind == %s) because of object "
INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s",
(bulk_rebias ? "rebias" : "revoke"),
- (void *) o, (intptr_t) o->mark(), o->klass()->external_name());
+ p2i((void *) o), (intptr_t) o->mark(), o->klass()->external_name());
}
jlong cur_time = os::javaTimeMillis();
diff --git a/src/share/vm/runtime/compilationPolicy.cpp b/src/share/vm/runtime/compilationPolicy.cpp
index 3431f3cc3..a0af68671 100644
--- a/src/share/vm/runtime/compilationPolicy.cpp
+++ b/src/share/vm/runtime/compilationPolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -170,7 +170,7 @@ void CompilationPolicy::print_time() {
void NonTieredCompPolicy::trace_osr_completion(nmethod* osr_nm) {
if (TraceOnStackReplacement) {
if (osr_nm == NULL) tty->print_cr("compilation failed");
- else tty->print_cr("nmethod " INTPTR_FORMAT, osr_nm);
+ else tty->print_cr("nmethod " INTPTR_FORMAT, p2i(osr_nm));
}
}
#endif // !PRODUCT
@@ -417,6 +417,7 @@ nmethod* NonTieredCompPolicy::event(methodHandle method, methodHandle inlinee, i
}
#ifndef PRODUCT
+PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
void NonTieredCompPolicy::trace_frequency_counter_overflow(methodHandle m, int branch_bci, int bci) {
if (TraceInvocationCounterOverflow) {
MethodCounters* mcs = m->method_counters();
@@ -428,7 +429,10 @@ void NonTieredCompPolicy::trace_frequency_counter_overflow(methodHandle m, int b
bci == InvocationEntryBci
? "comp-policy cntr ovfl @ %d in entry of "
: "comp-policy cntr ovfl @ %d in loop of ";
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
tty->print(msg, bci);
+PRAGMA_DIAG_POP
m->print_value();
tty->cr();
ic->print();
@@ -503,7 +507,7 @@ void StackWalkCompPolicy::method_invocation_event(methodHandle m, JavaThread* th
if (TraceCompilationPolicy) {
tty->print("method invocation trigger: ");
m->print_short_name(tty);
- tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", (address)m(), m->code_size());
+ tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)m()), m->code_size());
}
RegisterMap reg_map(thread, false);
javaVFrame* triggerVF = thread->last_java_vframe(&reg_map);
@@ -512,7 +516,7 @@ void StackWalkCompPolicy::method_invocation_event(methodHandle m, JavaThread* th
if (first->top_method()->code() != NULL) {
// called obsolete method/nmethod -- no need to recompile
- if (TraceCompilationPolicy) tty->print_cr(" --> " INTPTR_FORMAT, first->top_method()->code());
+ if (TraceCompilationPolicy) tty->print_cr(" --> " INTPTR_FORMAT, p2i(first->top_method()->code()));
} else {
if (TimeCompilationPolicy) accumulated_time()->start();
GrowableArray<RFrame*>* stack = new GrowableArray<RFrame*>(50);
@@ -640,7 +644,7 @@ RFrame* StackWalkCompPolicy::findTopInlinableFrame(GrowableArray<RFrame*>* stack
if (TraceCompilationPolicy && Verbose) {
tty->print("\n\t check caller: ");
next_m->print_short_name(tty);
- tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", (address)next_m(), next_m->code_size());
+ tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)next_m()), next_m->code_size());
}
current = next;
diff --git a/src/share/vm/runtime/deoptimization.cpp b/src/share/vm/runtime/deoptimization.cpp
index 5e85feb24..3b2a2519e 100644
--- a/src/share/vm/runtime/deoptimization.cpp
+++ b/src/share/vm/runtime/deoptimization.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -89,6 +89,8 @@
#endif
#endif // COMPILER2
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
bool DeoptimizationMarker::_is_active = false;
Deoptimization::UnrollBlock::UnrollBlock(int size_of_deoptimized_frame,
diff --git a/src/share/vm/runtime/fprofiler.cpp b/src/share/vm/runtime/fprofiler.cpp
index 3ddf1a191..0527238f8 100644
--- a/src/share/vm/runtime/fprofiler.cpp
+++ b/src/share/vm/runtime/fprofiler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,8 @@
#include "runtime/vframe.hpp"
#include "utilities/macros.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// Static fields of FlatProfiler
int FlatProfiler::received_gc_ticks = 0;
int FlatProfiler::vm_operation_ticks = 0;
@@ -308,7 +310,7 @@ class ProfilerNode {
st->fill_to(col2);
t->print_native(st);
st->fill_to(col3);
- st->print(msg);
+ st->print("%s", msg);
st->cr();
}
diff --git a/src/share/vm/runtime/frame.cpp b/src/share/vm/runtime/frame.cpp
index 11cc75213..2d06c835e 100644
--- a/src/share/vm/runtime/frame.cpp
+++ b/src/share/vm/runtime/frame.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -62,6 +62,8 @@
# include "nativeInst_ppc.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
RegisterMap::RegisterMap(JavaThread *thread, bool update_map) {
_thread = thread;
_update_map = update_map;
diff --git a/src/share/vm/runtime/globals.cpp b/src/share/vm/runtime/globals.cpp
index 801f7b89a..c57cc130c 100644
--- a/src/share/vm/runtime/globals.cpp
+++ b/src/share/vm/runtime/globals.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,8 @@
#include "shark/shark_globals.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
RUNTIME_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, \
MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, \
MATERIALIZE_DIAGNOSTIC_FLAG, MATERIALIZE_EXPERIMENTAL_FLAG, \
@@ -283,6 +285,7 @@ bool Flag::is_external() const {
// Length of format string (e.g. "%.1234s") for printing ccstr below
#define FORMAT_BUFFER_LEN 16
+PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
void Flag::print_on(outputStream* st, bool withComments) {
// Don't print notproduct and develop flags in a product build.
if (is_constant_in_binary()) {
@@ -315,7 +318,10 @@ void Flag::print_on(outputStream* st, bool withComments) {
size_t llen = pointer_delta(eol, cp, sizeof(char));
jio_snprintf(format_buffer, FORMAT_BUFFER_LEN,
"%%." SIZE_FORMAT "s", llen);
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
st->print(format_buffer, cp);
+PRAGMA_DIAG_POP
st->cr();
cp = eol+1;
st->print("%5s %-35s += ", "", _name);
@@ -372,7 +378,7 @@ void Flag::print_kind(outputStream* st) {
} else {
st->print(" ");
}
- st->print(d.name);
+ st->print("%s", d.name);
}
}
diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp
index 9927eb79f..fdd6db5b1 100644
--- a/src/share/vm/runtime/globals.hpp
+++ b/src/share/vm/runtime/globals.hpp
@@ -523,13 +523,6 @@ class CommandLineFlags {
product_pd(bool, UseMembar, \
"(Unstable) Issues membars on thread state transitions") \
\
- /* Temp PPC Flag to allow disabling the use of lwsync on ppc platforms \
- * that don't support it. This will be replaced by processor detection \
- * logic. \
- */ \
- product(bool, UsePPCLWSYNC, true, \
- "Use lwsync instruction if true, else use slower sync") \
- \
develop(bool, CleanChunkPoolAsync, falseInEmbedded, \
"Clean the chunk pool asynchronously") \
\
diff --git a/src/share/vm/runtime/handles.cpp b/src/share/vm/runtime/handles.cpp
index ca73f86ba..e80b6d798 100644
--- a/src/share/vm/runtime/handles.cpp
+++ b/src/share/vm/runtime/handles.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,8 @@
# include "os_bsd.inline.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#ifdef ASSERT
oop* HandleArea::allocate_handle(oop obj) {
assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark");
diff --git a/src/share/vm/runtime/interfaceSupport.cpp b/src/share/vm/runtime/interfaceSupport.cpp
index cec374fa6..b30d2f85a 100644
--- a/src/share/vm/runtime/interfaceSupport.cpp
+++ b/src/share/vm/runtime/interfaceSupport.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
#include "runtime/vframe.hpp"
#include "utilities/preserveException.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// Implementation of InterfaceSupport
diff --git a/src/share/vm/runtime/java.cpp b/src/share/vm/runtime/java.cpp
index f416ba336..2607688f3 100644
--- a/src/share/vm/runtime/java.cpp
+++ b/src/share/vm/runtime/java.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -113,6 +113,7 @@ void collect_invoked_methods(Method* m) {
}
}
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
GrowableArray<Method*>* collected_profiled_methods;
@@ -367,7 +368,7 @@ void print_statistics() {
BaselineTTYOutputer outputer(tty);
MemTracker::print_memory_usage(outputer, K, false);
} else {
- tty->print_cr(MemTracker::reason());
+ tty->print_cr("%s", MemTracker::reason());
}
}
}
@@ -404,7 +405,7 @@ void print_statistics() {
BaselineTTYOutputer outputer(tty);
MemTracker::print_memory_usage(outputer, K, false);
} else {
- tty->print_cr(MemTracker::reason());
+ tty->print_cr("%s", MemTracker::reason());
}
}
}
diff --git a/src/share/vm/runtime/jniHandles.cpp b/src/share/vm/runtime/jniHandles.cpp
index 7a3fb8b4c..4acf50b0d 100644
--- a/src/share/vm/runtime/jniHandles.cpp
+++ b/src/share/vm/runtime/jniHandles.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
#include "runtime/mutexLocker.hpp"
#include "runtime/thread.inline.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
JNIHandleBlock* JNIHandles::_global_handles = NULL;
JNIHandleBlock* JNIHandles::_weak_global_handles = NULL;
diff --git a/src/share/vm/runtime/mutex.cpp b/src/share/vm/runtime/mutex.cpp
index 91d9de9dd..19be8e824 100644
--- a/src/share/vm/runtime/mutex.cpp
+++ b/src/share/vm/runtime/mutex.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,8 @@
# include "mutex_bsd.inline.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
//
// Native Monitor-Mutex locking - theory of operations
diff --git a/src/share/vm/runtime/os.cpp b/src/share/vm/runtime/os.cpp
index e8631092a..c1f9b5a85 100644
--- a/src/share/vm/runtime/os.cpp
+++ b/src/share/vm/runtime/os.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -65,6 +65,8 @@
# include <signal.h>
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
OSThread* os::_starting_thread = NULL;
address os::_polling_page = NULL;
volatile int32_t* os::_mem_serialize_page = NULL;
@@ -909,9 +911,9 @@ void os::print_environment_variables(outputStream* st, const char** env_list,
for (int i = 0; env_list[i] != NULL; i++) {
if (getenv(env_list[i], buffer, len)) {
- st->print(env_list[i]);
+ st->print("%s", env_list[i]);
st->print("=");
- st->print_cr(buffer);
+ st->print_cr("%s", buffer);
}
}
}
@@ -1095,11 +1097,15 @@ void os::print_location(outputStream* st, intptr_t x, bool verbose) {
}
- // Check if in metaspace.
- if (ClassLoaderDataGraph::contains((address)addr)) {
- // Use addr->print() from the debugger instead (not here)
- st->print_cr(INTPTR_FORMAT
- " is pointing into metadata", addr);
+ // Check if in metaspace and print types that have vptrs (only method now)
+ if (Metaspace::contains(addr)) {
+ if (Method::has_method_vptr((const void*)addr)) {
+ ((Method*)addr)->print_value_on(st);
+ st->cr();
+ } else {
+ // Use addr->print() from the debugger instead (not here)
+ st->print_cr(INTPTR_FORMAT " is pointing into metadata", addr);
+ }
return;
}
diff --git a/src/share/vm/runtime/osThread.cpp b/src/share/vm/runtime/osThread.cpp
index 8c7b5e61c..57bf1f524 100644
--- a/src/share/vm/runtime/osThread.cpp
+++ b/src/share/vm/runtime/osThread.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
#include "oops/oop.inline.hpp"
#include "runtime/osThread.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
OSThread::OSThread(OSThreadStartFunc start_proc, void* start_parm) {
pd_initialize();
diff --git a/src/share/vm/runtime/perfData.cpp b/src/share/vm/runtime/perfData.cpp
index 60b71fde1..8dee999bf 100644
--- a/src/share/vm/runtime/perfData.cpp
+++ b/src/share/vm/runtime/perfData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,8 @@
#include "utilities/exceptions.hpp"
#include "utilities/globalDefinitions.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
PerfDataList* PerfDataManager::_all = NULL;
PerfDataList* PerfDataManager::_sampled = NULL;
PerfDataList* PerfDataManager::_constants = NULL;
diff --git a/src/share/vm/runtime/perfMemory.cpp b/src/share/vm/runtime/perfMemory.cpp
index cf5216582..51c932214 100644
--- a/src/share/vm/runtime/perfMemory.cpp
+++ b/src/share/vm/runtime/perfMemory.cpp
@@ -34,6 +34,8 @@
#include "runtime/statSampler.hpp"
#include "utilities/globalDefinitions.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// Prefix of performance data file.
const char PERFDATA_NAME[] = "hsperfdata";
diff --git a/src/share/vm/runtime/safepoint.cpp b/src/share/vm/runtime/safepoint.cpp
index cac23e97e..6b588f15d 100644
--- a/src/share/vm/runtime/safepoint.cpp
+++ b/src/share/vm/runtime/safepoint.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -81,6 +81,8 @@
#include "c1/c1_globals.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// --------------------------------------------------------------------------------------------------
// Implementation of Safepoint begin/end
@@ -538,6 +540,13 @@ void SafepointSynchronize::do_cleanup_tasks() {
gclog_or_tty->rotate_log(false);
}
+ {
+ // CMS delays purging the CLDG until the beginning of the next safepoint and to
+ // make sure concurrent sweep is done
+ TraceTime t7("purging class loader data graph", TraceSafepointCleanupTime);
+ ClassLoaderDataGraph::purge_if_needed();
+ }
+
if (MemTracker::is_on()) {
MemTracker::sync();
}
@@ -786,7 +795,7 @@ static void print_me(intptr_t *new_sp, intptr_t *old_sp, bool *was_oops) {
old_sp += incr*32; new_sp += incr*32; was_oops += incr*32;
for( int i2=0; i2<16; i2++ ) {
tty->print("call %c%d |"PTR_FORMAT" ","LI"[i2>>3],i2&7,new_sp); print_ptrs(*old_sp++,*new_sp++,*was_oops++); }
- tty->print_cr("");
+ tty->cr();
}
#endif // SPARC
#endif // PRODUCT
@@ -828,7 +837,7 @@ void SafepointSynchronize::print_safepoint_timeout(SafepointTimeoutReason reason
timeout_error_printed = true;
// Print out the thread infor which didn't reach the safepoint for debugging
// purposes (useful when there are lots of threads in the debugger).
- tty->print_cr("");
+ tty->cr();
tty->print_cr("# SafepointSynchronize::begin: Timeout detected:");
if (reason == _spinning_timeout) {
tty->print_cr("# SafepointSynchronize::begin: Timed out while spinning to reach a safepoint.");
@@ -848,7 +857,7 @@ void SafepointSynchronize::print_safepoint_timeout(SafepointTimeoutReason reason
(reason == _blocking_timeout && !cur_state->has_called_back()))) {
tty->print("# ");
cur_thread->print();
- tty->print_cr("");
+ tty->cr();
}
}
tty->print_cr("# SafepointSynchronize::begin: (End of list)");
@@ -1321,7 +1330,7 @@ void SafepointSynchronize::print_stat_on_exit() {
spstat->_time_to_sync > PrintSafepointStatisticsTimeout * MICROUNITS) {
print_statistics();
}
- tty->print_cr("");
+ tty->cr();
// Print out polling page sampling status.
if (!need_to_track_page_armed_status) {
diff --git a/src/share/vm/runtime/safepoint.hpp b/src/share/vm/runtime/safepoint.hpp
index 005ea4d03..188ea32f4 100644
--- a/src/share/vm/runtime/safepoint.hpp
+++ b/src/share/vm/runtime/safepoint.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -174,7 +174,7 @@ public:
// debugging
static void print_state() PRODUCT_RETURN;
- static void safepoint_msg(const char* format, ...) PRODUCT_RETURN;
+ static void safepoint_msg(const char* format, ...) ATTRIBUTE_PRINTF(1, 2) PRODUCT_RETURN;
static void deferred_initialize_stat();
static void print_stat_on_exit();
@@ -240,7 +240,7 @@ class ThreadSafepointState: public CHeapObj<mtInternal> {
static void create(JavaThread *thread);
static void destroy(JavaThread *thread);
- void safepoint_msg(const char* format, ...) {
+ void safepoint_msg(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
if (ShowSafepointMsgs) {
va_list ap;
va_start(ap, format);
diff --git a/src/share/vm/runtime/sharedRuntime.cpp b/src/share/vm/runtime/sharedRuntime.cpp
index b41df9f48..25e075c0d 100644
--- a/src/share/vm/runtime/sharedRuntime.cpp
+++ b/src/share/vm/runtime/sharedRuntime.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -82,6 +82,8 @@
#include "c1/c1_Runtime1.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// Shared stub locations
RuntimeStub* SharedRuntime::_wrong_method_blob;
RuntimeStub* SharedRuntime::_wrong_method_abstract_blob;
diff --git a/src/share/vm/runtime/signature.cpp b/src/share/vm/runtime/signature.cpp
index ceaef3f56..dd3ed8bfc 100644
--- a/src/share/vm/runtime/signature.cpp
+++ b/src/share/vm/runtime/signature.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
#include "oops/typeArrayKlass.hpp"
#include "runtime/signature.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// Implementation of SignatureIterator
diff --git a/src/share/vm/runtime/stackValue.cpp b/src/share/vm/runtime/stackValue.cpp
index ce274103d..a0e6f5104 100644
--- a/src/share/vm/runtime/stackValue.cpp
+++ b/src/share/vm/runtime/stackValue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -196,7 +196,7 @@ void StackValue::print_on(outputStream* st) const {
case T_OBJECT:
_o()->print_value_on(st);
- st->print(" <" INTPTR_FORMAT ">", (address)_o());
+ st->print(" <" INTPTR_FORMAT ">", p2i((address)_o()));
break;
case T_CONFLICT:
diff --git a/src/share/vm/runtime/stackValueCollection.cpp b/src/share/vm/runtime/stackValueCollection.cpp
index 110f7120d..3794f64d7 100644
--- a/src/share/vm/runtime/stackValueCollection.cpp
+++ b/src/share/vm/runtime/stackValueCollection.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,8 @@
# include "jniTypes_ppc.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
jint StackValueCollection::int_at(int slot) const {
intptr_t val = at(slot)->get_int();
jint ival = *((jint*) (&val));
diff --git a/src/share/vm/runtime/stubCodeGenerator.cpp b/src/share/vm/runtime/stubCodeGenerator.cpp
index 92f3d0be1..5ecbe0287 100644
--- a/src/share/vm/runtime/stubCodeGenerator.cpp
+++ b/src/share/vm/runtime/stubCodeGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -60,10 +60,10 @@ const char* StubCodeDesc::name_for(address pc) {
void StubCodeDesc::print_on(outputStream* st) const {
- st->print(group());
+ st->print("%s", group());
st->print("::");
- st->print(name());
- st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT "[ (%d bytes)", begin(), end(), size_in_bytes());
+ st->print("%s", name());
+ st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT "[ (%d bytes)", p2i(begin()), p2i(end()), size_in_bytes());
}
// Implementation of StubCodeGenerator
diff --git a/src/share/vm/runtime/sweeper.cpp b/src/share/vm/runtime/sweeper.cpp
index 115f1094e..bb5ebaf52 100644
--- a/src/share/vm/runtime/sweeper.cpp
+++ b/src/share/vm/runtime/sweeper.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,8 @@
#include "utilities/ticks.inline.hpp"
#include "utilities/xmlstream.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#ifdef ASSERT
#define SWEEP(nm) record_sweep(nm, __LINE__)
@@ -625,7 +627,7 @@ void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) {
tty->vprint(format, ap);
va_end(ap);
}
- tty->print_cr(s.as_string());
+ tty->print_cr("%s", s.as_string());
}
if (LogCompilation && (xtty != NULL)) {
@@ -642,7 +644,7 @@ void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) {
xtty->vprint(format, ap);
va_end(ap);
}
- xtty->print(s.as_string());
+ xtty->print("%s", s.as_string());
xtty->stamp();
xtty->end_elem();
}
diff --git a/src/share/vm/runtime/sweeper.hpp b/src/share/vm/runtime/sweeper.hpp
index abee1ec77..f7482d819 100644
--- a/src/share/vm/runtime/sweeper.hpp
+++ b/src/share/vm/runtime/sweeper.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -94,7 +94,7 @@ class NMethodSweeper : public AllStatic {
static const Tickspan total_time_sweeping() { return _total_time_sweeping; }
static const Tickspan peak_sweep_time() { return _peak_sweep_time; }
static const Tickspan peak_sweep_fraction_time() { return _peak_sweep_fraction_time; }
- static void log_sweep(const char* msg, const char* format = NULL, ...);
+ static void log_sweep(const char* msg, const char* format = NULL, ...) ATTRIBUTE_PRINTF(2, 3);
#ifdef ASSERT
diff --git a/src/share/vm/runtime/synchronizer.cpp b/src/share/vm/runtime/synchronizer.cpp
index 4f9b0df1d..33dfbb205 100644
--- a/src/share/vm/runtime/synchronizer.cpp
+++ b/src/share/vm/runtime/synchronizer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -60,6 +60,8 @@
#define ATTR
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// The "core" versions of monitor enter and exit reside in this file.
// The interpreter and compilers contain specialized transliterated
// variants of the enter-exit fast-path operations. See i486.ad fast_lock(),
diff --git a/src/share/vm/runtime/thread.cpp b/src/share/vm/runtime/thread.cpp
index 37fba0986..39f12a5b0 100644
--- a/src/share/vm/runtime/thread.cpp
+++ b/src/share/vm/runtime/thread.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -111,6 +111,8 @@
#include "runtime/rtmLocking.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#ifdef DTRACE_ENABLED
// Only bother with this argument setup if dtrace is available
@@ -4318,7 +4320,7 @@ JavaThread *Threads::owning_thread_from_monitor_owner(address owner, bool doLock
// Threads::print_on() is called at safepoint by VM_PrintThreads operation.
void Threads::print_on(outputStream* st, bool print_stacks, bool internal_format, bool print_concurrent_locks) {
char buf[32];
- st->print_cr(os::local_time_string(buf, sizeof(buf)));
+ st->print_cr("%s", os::local_time_string(buf, sizeof(buf)));
st->print_cr("Full thread dump %s (%s %s):",
Abstract_VM_Version::vm_name(),
diff --git a/src/share/vm/runtime/thread.hpp b/src/share/vm/runtime/thread.hpp
index eb6247908..082629aec 100644
--- a/src/share/vm/runtime/thread.hpp
+++ b/src/share/vm/runtime/thread.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -695,7 +695,7 @@ class NamedThread: public Thread {
NamedThread();
~NamedThread();
// May only be called once per thread.
- void set_name(const char* format, ...);
+ void set_name(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
virtual bool is_Named_thread() const { return true; }
virtual char* name() const { return _name == NULL ? (char*)"Unknown Thread" : _name; }
JavaThread *processed_thread() { return _processed_thread; }
diff --git a/src/share/vm/runtime/timer.cpp b/src/share/vm/runtime/timer.cpp
index ccb3322ce..5fb316934 100644
--- a/src/share/vm/runtime/timer.cpp
+++ b/src/share/vm/runtime/timer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -204,7 +204,7 @@ TraceCPUTime::~TraceCPUTime() {
_logfile->print("[Error in TraceCPUTime]");
}
if (_print_cr) {
- _logfile->print_cr("");
+ _logfile->cr();
}
_logfile->flush();
}
diff --git a/src/share/vm/runtime/unhandledOops.cpp b/src/share/vm/runtime/unhandledOops.cpp
index cc0002d42..d27b1fb2f 100644
--- a/src/share/vm/runtime/unhandledOops.cpp
+++ b/src/share/vm/runtime/unhandledOops.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
#include "runtime/unhandledOops.hpp"
#include "utilities/globalDefinitions.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#ifdef CHECK_UNHANDLED_OOPS
const int free_list_size = 256;
diff --git a/src/share/vm/runtime/vframe.cpp b/src/share/vm/runtime/vframe.cpp
index 085e6f976..4231febef 100644
--- a/src/share/vm/runtime/vframe.cpp
+++ b/src/share/vm/runtime/vframe.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,8 @@
#include "runtime/vframeArray.hpp"
#include "runtime/vframe_hp.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
vframe::vframe(const frame* fr, const RegisterMap* reg_map, JavaThread* thread)
: _reg_map(reg_map), _thread(thread) {
assert(fr != NULL, "must have frame");
diff --git a/src/share/vm/runtime/vframe.hpp b/src/share/vm/runtime/vframe.hpp
index 27966b1a7..a284b13de 100644
--- a/src/share/vm/runtime/vframe.hpp
+++ b/src/share/vm/runtime/vframe.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -399,7 +399,7 @@ inline void vframeStreamCommon::fill_from_compiled_frame(int decode_offset) {
if (WizardMode) {
tty->print_cr("Error in fill_from_frame: pc_desc for "
INTPTR_FORMAT " not found or invalid at %d",
- _frame.pc(), decode_offset);
+ p2i(_frame.pc()), decode_offset);
nm()->print();
nm()->method()->print_codes();
nm()->print_code();
diff --git a/src/share/vm/runtime/vframeArray.cpp b/src/share/vm/runtime/vframeArray.cpp
index b13d56037..3aecd59ba 100644
--- a/src/share/vm/runtime/vframeArray.cpp
+++ b/src/share/vm/runtime/vframeArray.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
#include "opto/runtime.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
int vframeArrayElement:: bci(void) const { return (_bci == SynchronizationEntryBCI ? 0 : _bci); }
diff --git a/src/share/vm/runtime/virtualspace.cpp b/src/share/vm/runtime/virtualspace.cpp
index e052b20e6..c3c4ba632 100644
--- a/src/share/vm/runtime/virtualspace.cpp
+++ b/src/share/vm/runtime/virtualspace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
# include "os_bsd.inline.hpp"
#endif
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// ReservedSpace
diff --git a/src/share/vm/runtime/vmThread.cpp b/src/share/vm/runtime/vmThread.cpp
index a0a27d3ff..daf9c4e70 100644
--- a/src/share/vm/runtime/vmThread.cpp
+++ b/src/share/vm/runtime/vmThread.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,8 @@ HS_DTRACE_PROBE_DECL3(hotspot, vmops__begin, char *, uintptr_t, int);
HS_DTRACE_PROBE_DECL3(hotspot, vmops__end, char *, uintptr_t, int);
#endif /* !USDT2 */
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// Dummy VM operation to act as first element in our circular double-linked list
class VM_Dummy: public VM_Operation {
VMOp_Type type() const { return VMOp_Dummy; }
diff --git a/src/share/vm/runtime/vm_operations.cpp b/src/share/vm/runtime/vm_operations.cpp
index e26c3938b..d46e1f775 100644
--- a/src/share/vm/runtime/vm_operations.cpp
+++ b/src/share/vm/runtime/vm_operations.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
#include "services/threadService.hpp"
#include "trace/tracing.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#define VM_OP_NAME_INITIALIZE(name) #name,
const char* VM_Operation::_names[VM_Operation::VMOp_Terminating] = \
diff --git a/src/share/vm/services/attachListener.cpp b/src/share/vm/services/attachListener.cpp
index 6ab6c8f9e..1df0eca82 100644
--- a/src/share/vm/services/attachListener.cpp
+++ b/src/share/vm/services/attachListener.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -284,15 +284,15 @@ static jint set_uintx_flag(const char* name, AttachOperation* op, outputStream*
}
if (strncmp(name, "MaxHeapFreeRatio", 17) == 0) {
- FormatBuffer<80> err_msg("");
+ FormatBuffer<80> err_msg("%s", "");
if (!Arguments::verify_MaxHeapFreeRatio(err_msg, value)) {
- out->print_cr(err_msg.buffer());
+ out->print_cr("%s", err_msg.buffer());
return JNI_ERR;
}
} else if (strncmp(name, "MinHeapFreeRatio", 17) == 0) {
- FormatBuffer<80> err_msg("");
+ FormatBuffer<80> err_msg("%s", "");
if (!Arguments::verify_MinHeapFreeRatio(err_msg, value)) {
- out->print_cr(err_msg.buffer());
+ out->print_cr("%s", err_msg.buffer());
return JNI_ERR;
}
}
@@ -381,7 +381,7 @@ static jint print_flag(AttachOperation* op, outputStream* out) {
Flag* f = Flag::find_flag((char*)name, strlen(name));
if (f) {
f->print_as_flag(out);
- out->print_cr("");
+ out->cr();
} else {
out->print_cr("no such flag '%s'", name);
}
diff --git a/src/share/vm/services/classLoadingService.cpp b/src/share/vm/services/classLoadingService.cpp
index aa2299fca..51dfa9b1b 100644
--- a/src/share/vm/services/classLoadingService.cpp
+++ b/src/share/vm/services/classLoadingService.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -157,7 +157,7 @@ void ClassLoadingService::notify_class_unloaded(InstanceKlass* k) {
if (TraceClassUnloading) {
ResourceMark rm;
- tty->print_cr("[Unloading class %s " INTPTR_FORMAT "]", k->external_name(), k);
+ tty->print_cr("[Unloading class %s " INTPTR_FORMAT "]", k->external_name(), p2i(k));
}
}
diff --git a/src/share/vm/services/diagnosticCommand.cpp b/src/share/vm/services/diagnosticCommand.cpp
index 1245b5aaf..b38da2eda 100644
--- a/src/share/vm/services/diagnosticCommand.cpp
+++ b/src/share/vm/services/diagnosticCommand.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,8 @@
#include "services/management.hpp"
#include "utilities/macros.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
void DCmdRegistrant::register_dcmds(){
// Registration of the diagnostic commands
// First argument specifies which interfaces will export the command
@@ -99,7 +101,7 @@ void HelpDCmd::execute(DCmdSource source, TRAPS) {
if (factory != NULL) {
output()->print_cr("%s%s", factory->name(),
factory->is_enabled() ? "" : " [disabled]");
- output()->print_cr(factory->description());
+ output()->print_cr("%s", factory->description());
output()->print_cr("\nImpact: %s", factory->impact());
JavaPermission p = factory->permission();
if(p._class != NULL) {
diff --git a/src/share/vm/services/diagnosticFramework.cpp b/src/share/vm/services/diagnosticFramework.cpp
index dcc2a21e4..dcb67d36c 100644
--- a/src/share/vm/services/diagnosticFramework.cpp
+++ b/src/share/vm/services/diagnosticFramework.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -259,7 +259,7 @@ void DCmdParser::print_help(outputStream* out, const char* cmd_name) {
}
arg = arg->next();
}
- out->print_cr("");
+ out->cr();
if (_arguments_list != NULL) {
out->print_cr("\nArguments:");
arg = _arguments_list;
@@ -268,7 +268,7 @@ void DCmdParser::print_help(outputStream* out, const char* cmd_name) {
arg->is_mandatory() ? "" : "[optional]",
arg->description(), arg->type());
if (arg->has_default()) {
- out->print(arg->default_string());
+ out->print("%s", arg->default_string());
} else {
out->print("no default value");
}
@@ -284,7 +284,7 @@ void DCmdParser::print_help(outputStream* out, const char* cmd_name) {
arg->is_mandatory() ? "" : "[optional]",
arg->description(), arg->type());
if (arg->has_default()) {
- out->print(arg->default_string());
+ out->print("%s", arg->default_string());
} else {
out->print("no default value");
}
diff --git a/src/share/vm/services/heapDumper.cpp b/src/share/vm/services/heapDumper.cpp
index c0d010489..3b81e7269 100644
--- a/src/share/vm/services/heapDumper.cpp
+++ b/src/share/vm/services/heapDumper.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1830,6 +1830,7 @@ void VM_HeapDumper::dump_stack_traces() {
}
// dump the heap to given path.
+PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
int HeapDumper::dump(const char* path) {
assert(path != NULL && strlen(path) > 0, "path missing");
@@ -1870,7 +1871,10 @@ int HeapDumper::dump(const char* path) {
char msg[256];
sprintf(msg, "Heap dump file created [%s bytes in %3.3f secs]",
JLONG_FORMAT, timer()->seconds());
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
tty->print_cr(msg, writer.bytes_written());
+PRAGMA_DIAG_POP
} else {
tty->print_cr("Dump file is incomplete: %s", writer.error());
}
diff --git a/src/share/vm/services/lowMemoryDetector.cpp b/src/share/vm/services/lowMemoryDetector.cpp
index 199a342dd..b68be23df 100644
--- a/src/share/vm/services/lowMemoryDetector.cpp
+++ b/src/share/vm/services/lowMemoryDetector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -353,7 +353,7 @@ void SensorInfo::clear(int count, TRAPS) {
#ifndef PRODUCT
void SensorInfo::print() {
- tty->print_cr("%s count = " SIZE_FORMAT " pending_triggers = %ld pending_clears = %ld",
+ tty->print_cr("%s count = " SIZE_FORMAT " pending_triggers = %d pending_clears = %d",
(_sensor_on ? "on" : "off"),
_sensor_count, _pending_trigger_count, _pending_clear_count);
}
diff --git a/src/share/vm/services/management.cpp b/src/share/vm/services/management.cpp
index 7d39a2e04..ef18b46e0 100644
--- a/src/share/vm/services/management.cpp
+++ b/src/share/vm/services/management.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -55,6 +55,8 @@
#include "services/threadService.hpp"
#include "utilities/macros.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
PerfVariable* Management::_begin_vm_creation_time = NULL;
PerfVariable* Management::_end_vm_creation_time = NULL;
PerfVariable* Management::_vm_init_done_time = NULL;
@@ -1832,12 +1834,12 @@ JVM_ENTRY(void, jmm_SetVMGlobal(JNIEnv *env, jstring flag_name, jvalue new_value
uintx uvalue = (uintx)new_value.j;
if (strncmp(name, "MaxHeapFreeRatio", 17) == 0) {
- FormatBuffer<80> err_msg("");
+ FormatBuffer<80> err_msg("%s", "");
if (!Arguments::verify_MaxHeapFreeRatio(err_msg, uvalue)) {
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), err_msg.buffer());
}
} else if (strncmp(name, "MinHeapFreeRatio", 17) == 0) {
- FormatBuffer<80> err_msg("");
+ FormatBuffer<80> err_msg("%s", "");
if (!Arguments::verify_MinHeapFreeRatio(err_msg, uvalue)) {
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), err_msg.buffer());
}
diff --git a/src/share/vm/services/memReporter.cpp b/src/share/vm/services/memReporter.cpp
index c9cbc0804..305693dad 100644
--- a/src/share/vm/services/memReporter.cpp
+++ b/src/share/vm/services/memReporter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
#include "services/memPtrArray.hpp"
#include "services/memTracker.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
const char* BaselineOutputer::memory_unit(size_t scale) {
switch(scale) {
case K: return "KB";
diff --git a/src/share/vm/services/memSnapshot.cpp b/src/share/vm/services/memSnapshot.cpp
index 3bfd19324..8f5ca4f41 100644
--- a/src/share/vm/services/memSnapshot.cpp
+++ b/src/share/vm/services/memSnapshot.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
#include "services/memSnapshot.hpp"
#include "services/memTracker.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#ifdef ASSERT
void decode_pointer_record(MemPointerRecord* rec) {
@@ -733,7 +735,7 @@ void MemSnapshot::dump_all_vm_pointers() {
if (os::dll_address_to_function_name(ex->pc(), buf, sizeof(buf), NULL)) {
tty->print_cr("\t%s", buf);
} else {
- tty->print_cr("");
+ tty->cr();
}
}
}
diff --git a/src/share/vm/services/memTrackWorker.cpp b/src/share/vm/services/memTrackWorker.cpp
index e1382dd1a..7bf18eb27 100644
--- a/src/share/vm/services/memTrackWorker.cpp
+++ b/src/share/vm/services/memTrackWorker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,7 +43,7 @@ MemTrackWorker::MemTrackWorker(MemSnapshot* snapshot): _snapshot(snapshot) {
// create thread uses cgc thread type for now. We should revisit
// the option, or create new thread type.
_has_error = !os::create_thread(this, os::cgc_thread);
- set_name("MemTrackWorker", 0);
+ set_name("MemTrackWorker");
// initial generation circuit buffer
if (!has_error()) {
diff --git a/src/share/vm/services/nmtDCmd.cpp b/src/share/vm/services/nmtDCmd.cpp
index 823e3c443..8ced28772 100644
--- a/src/share/vm/services/nmtDCmd.cpp
+++ b/src/share/vm/services/nmtDCmd.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@ void NMTDCmd::execute(DCmdSource source, TRAPS) {
// native memory tracking has to be on
if (!MemTracker::is_on() || MemTracker::shutdown_in_progress()) {
// if it is not on, what's the reason?
- output()->print_cr(MemTracker::reason());
+ output()->print_cr("%s", MemTracker::reason());
return;
}
diff --git a/src/share/vm/services/threadService.cpp b/src/share/vm/services/threadService.cpp
index 3295580bd..3376aba71 100644
--- a/src/share/vm/services/threadService.cpp
+++ b/src/share/vm/services/threadService.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,8 @@
#include "runtime/vm_operations.hpp"
#include "services/threadService.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// TODO: we need to define a naming convention for perf counters
// to distinguish counters for:
// - standard JSR174 use
diff --git a/src/share/vm/trace/traceStream.hpp b/src/share/vm/trace/traceStream.hpp
index 4acbbb884..14bc42111 100644
--- a/src/share/vm/trace/traceStream.hpp
+++ b/src/share/vm/trace/traceStream.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@ class TraceStream : public StackObj {
}
void print_val(const char* label, s8 val) {
- _st.print("%s = "INT64_FORMAT, label, val);
+ _st.print("%s = "INT64_FORMAT, label, (int64_t) val);
}
void print_val(const char* label, bool val) {
@@ -113,7 +113,7 @@ class TraceStream : public StackObj {
}
void print(const char* val) {
- _st.print(val);
+ _st.print("%s", val);
}
};
diff --git a/src/share/vm/utilities/array.hpp b/src/share/vm/utilities/array.hpp
index 0fbcd94d2..40b3b0185 100644
--- a/src/share/vm/utilities/array.hpp
+++ b/src/share/vm/utilities/array.hpp
@@ -375,7 +375,7 @@ protected:
// FIXME: How to handle this?
void print_value_on(outputStream* st) const {
- st->print("Array<T>(" INTPTR_FORMAT ")", this);
+ st->print("Array<T>(" INTPTR_FORMAT ")", p2i(this));
}
#ifndef PRODUCT
diff --git a/src/share/vm/utilities/bitMap.cpp b/src/share/vm/utilities/bitMap.cpp
index b2a2ab7b2..4627a5321 100644
--- a/src/share/vm/utilities/bitMap.cpp
+++ b/src/share/vm/utilities/bitMap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -523,13 +523,13 @@ BitMap::idx_t BitMap::count_one_bits() const {
void BitMap::print_on_error(outputStream* st, const char* prefix) const {
st->print_cr("%s[" PTR_FORMAT ", " PTR_FORMAT ")",
- prefix, map(), (char*)map() + (size() >> LogBitsPerByte));
+ prefix, p2i(map()), p2i((char*)map() + (size() >> LogBitsPerByte)));
}
#ifndef PRODUCT
void BitMap::print_on(outputStream* st) const {
- tty->print("Bitmap(%d):", size());
+ tty->print("Bitmap(" SIZE_FORMAT "):", size());
for (idx_t index = 0; index < size(); index++) {
tty->print("%c", at(index) ? '1' : '0');
}
diff --git a/src/share/vm/utilities/constantTag.cpp b/src/share/vm/utilities/constantTag.cpp
index 7bc55690a..35aa1d0c6 100644
--- a/src/share/vm/utilities/constantTag.cpp
+++ b/src/share/vm/utilities/constantTag.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
#ifndef PRODUCT
void constantTag::print_on(outputStream* st) const {
- st->print(internal_name());
+ st->print("%s", internal_name());
}
#endif // PRODUCT
diff --git a/src/share/vm/utilities/debug.cpp b/src/share/vm/utilities/debug.cpp
index 31d13f794..604018f8d 100644
--- a/src/share/vm/utilities/debug.cpp
+++ b/src/share/vm/utilities/debug.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -88,6 +88,8 @@
# endif
#endif // PRODUCT
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
FormatBufferResource::FormatBufferResource(const char * format, ...)
: FormatBufferBase((char*)resource_allocate_bytes(RES_BUFSZ)) {
va_list argp;
@@ -96,6 +98,7 @@ FormatBufferResource::FormatBufferResource(const char * format, ...)
va_end(argp);
}
+ATTRIBUTE_PRINTF(1, 2)
void warning(const char* format, ...) {
if (PrintWarnings) {
FILE* const err = defaultStream::error_stream();
diff --git a/src/share/vm/utilities/debug.hpp b/src/share/vm/utilities/debug.hpp
index ccadc0772..fec927d91 100644
--- a/src/share/vm/utilities/debug.hpp
+++ b/src/share/vm/utilities/debug.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,17 +43,17 @@ class FormatBufferBase {
#define RES_BUFSZ 256
class FormatBufferResource : public FormatBufferBase {
public:
- FormatBufferResource(const char * format, ...);
+ FormatBufferResource(const char * format, ...) ATTRIBUTE_PRINTF(2, 3);
};
// Use stack for buffer
template <size_t bufsz = 256>
class FormatBuffer : public FormatBufferBase {
public:
- inline FormatBuffer(const char * format, ...);
- inline void append(const char* format, ...);
- inline void print(const char* format, ...);
- inline void printv(const char* format, va_list ap);
+ inline FormatBuffer(const char * format, ...) ATTRIBUTE_PRINTF(2, 3);
+ inline void append(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ inline void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ inline void printv(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
char* buffer() { return _buf; }
int size() { return bufsz; }
@@ -223,7 +223,7 @@ void report_should_not_reach_here(const char* file, int line);
void report_unimplemented(const char* file, int line);
void report_untested(const char* file, int line, const char* message);
-void warning(const char* format, ...);
+void warning(const char* format, ...) ATTRIBUTE_PRINTF(1, 2);
#ifdef ASSERT
// Compile-time asserts.
diff --git a/src/share/vm/utilities/events.cpp b/src/share/vm/utilities/events.cpp
index 8ccd65095..4d17c9bba 100644
--- a/src/share/vm/utilities/events.cpp
+++ b/src/share/vm/utilities/events.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -82,7 +82,7 @@ EventMark::EventMark(const char* format, ...) {
va_start(ap, format);
// Save a copy of begin message and log it.
_buffer.printv(format, ap);
- Events::log(NULL, _buffer);
+ Events::log(NULL, "%s", _buffer.buffer());
va_end(ap);
}
}
@@ -91,6 +91,6 @@ EventMark::~EventMark() {
if (LogEvents) {
// Append " done" to the begin message and log it
_buffer.append(" done");
- Events::log(NULL, _buffer);
+ Events::log(NULL, "%s", _buffer.buffer());
}
}
diff --git a/src/share/vm/utilities/events.hpp b/src/share/vm/utilities/events.hpp
index 804fe77df..71a4a4366 100644
--- a/src/share/vm/utilities/events.hpp
+++ b/src/share/vm/utilities/events.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@ template <class T> class EventLogBase : public EventLog {
void print(outputStream* out, EventRecord<T>& e) {
out->print("Event: %.3f ", e.timestamp);
if (e.thread != NULL) {
- out->print("Thread " INTPTR_FORMAT " ", e.thread);
+ out->print("Thread " INTPTR_FORMAT " ", p2i(e.thread));
}
print(out, e.data);
}
@@ -148,7 +148,7 @@ class StringEventLog : public EventLogBase<StringLogMessage> {
public:
StringEventLog(const char* name, int count = LogEventsBufferEntries) : EventLogBase<StringLogMessage>(name, count) {}
- void logv(Thread* thread, const char* format, va_list ap) {
+ void logv(Thread* thread, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0) {
if (!should_log()) return;
double timestamp = fetch_timestamp();
@@ -159,7 +159,7 @@ class StringEventLog : public EventLogBase<StringLogMessage> {
_records[index].data.printv(format, ap);
}
- void log(Thread* thread, const char* format, ...) {
+ void log(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(3, 4) {
va_list ap;
va_start(ap, format);
logv(thread, format, ap);
@@ -193,18 +193,17 @@ class Events : AllStatic {
static void print();
// Logs a generic message with timestamp and format as printf.
- static void log(Thread* thread, const char* format, ...);
+ static void log(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
// Log exception related message
- static void log_exception(Thread* thread, const char* format, ...);
+ static void log_exception(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
- static void log_deopt_message(Thread* thread, const char* format, ...);
+ static void log_deopt_message(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
// Register default loggers
static void init();
};
-
inline void Events::log(Thread* thread, const char* format, ...) {
if (LogEvents) {
va_list ap;
@@ -283,7 +282,7 @@ class EventMark : public StackObj {
public:
// log a begin event, format as printf
- EventMark(const char* format, ...);
+ EventMark(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
// log an end event
~EventMark();
};
diff --git a/src/share/vm/utilities/exceptions.cpp b/src/share/vm/utilities/exceptions.cpp
index e3d08d594..0759eda37 100644
--- a/src/share/vm/utilities/exceptions.cpp
+++ b/src/share/vm/utilities/exceptions.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
#include "utilities/events.hpp"
#include "utilities/exceptions.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// Implementation of ThreadShadow
void check_ThreadShadow() {
@@ -237,6 +238,7 @@ void Exceptions::fthrow(Thread* thread, const char* file, int line, Symbol* h_na
_throw_msg(thread, file, line, h_name, msg);
}
+
// Creates an exception oop, calls the <init> method with the given signature.
// and returns a Handle
Handle Exceptions::new_exception(Thread *thread, Symbol* name,
diff --git a/src/share/vm/utilities/exceptions.hpp b/src/share/vm/utilities/exceptions.hpp
index beaabf8dc..3dfe338ea 100644
--- a/src/share/vm/utilities/exceptions.hpp
+++ b/src/share/vm/utilities/exceptions.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -132,7 +132,7 @@ class Exceptions {
// There is no THROW... macro for this method. Caller should remember
// to do a return after calling it.
static void fthrow(Thread* thread, const char* file, int line, Symbol* name,
- const char* format, ...);
+ const char* format, ...) ATTRIBUTE_PRINTF(5, 6);
// Create and initialize a new exception
static Handle new_exception(Thread* thread, Symbol* name,
diff --git a/src/share/vm/utilities/globalDefinitions.hpp b/src/share/vm/utilities/globalDefinitions.hpp
index d65990e47..5a4bd199d 100644
--- a/src/share/vm/utilities/globalDefinitions.hpp
+++ b/src/share/vm/utilities/globalDefinitions.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,32 @@
# include "utilities/globalDefinitions_xlc.hpp"
#endif
+#ifndef PRAGMA_DIAG_PUSH
+#define PRAGMA_DIAG_PUSH
+#endif
+#ifndef PRAGMA_DIAG_POP
+#define PRAGMA_DIAG_POP
+#endif
+#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED
+#define PRAGMA_FORMAT_NONLITERAL_IGNORED
+#endif
+#ifndef PRAGMA_FORMAT_IGNORED
+#define PRAGMA_FORMAT_IGNORED
+#endif
+#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
+#define PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
+#endif
+#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
+#define PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
+#endif
+#ifndef PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+#define PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+#endif
+#ifndef ATTRIBUTE_PRINTF
+#define ATTRIBUTE_PRINTF(fmt, vargs)
+#endif
+
+
#include "utilities/macros.hpp"
// This file holds all globally used constants & types, class (forward)
@@ -1284,6 +1310,11 @@ inline int build_int_from_shorts( jushort low, jushort high ) {
return ((int)((unsigned int)high << 16) | (unsigned int)low);
}
+// Convert pointer to intptr_t, for use in printing pointers.
+inline intptr_t p2i(const void * p) {
+ return (intptr_t) p;
+}
+
// Printf-style formatters for fixed- and variable-width types as pointers and
// integers. These are derived from the definitions in inttypes.h. If the platform
// doesn't provide appropriate definitions, they should be provided in
@@ -1302,6 +1333,7 @@ inline int build_int_from_shorts( jushort low, jushort high ) {
// Format 64-bit quantities.
#define INT64_FORMAT "%" PRId64
#define UINT64_FORMAT "%" PRIu64
+#define UINT64_FORMAT_X "%" PRIx64
#define INT64_FORMAT_W(width) "%" #width PRId64
#define UINT64_FORMAT_W(width) "%" #width PRIu64
@@ -1324,10 +1356,14 @@ inline int build_int_from_shorts( jushort low, jushort high ) {
#define PTR_FORMAT "0x%08" PRIxPTR
#endif // _LP64
-#define SSIZE_FORMAT "%" PRIdPTR
-#define SIZE_FORMAT "%" PRIuPTR
-#define SSIZE_FORMAT_W(width) "%" #width PRIdPTR
-#define SIZE_FORMAT_W(width) "%" #width PRIuPTR
+#define INTPTR_FORMAT_W(width) "%" #width PRIxPTR
+
+#define SSIZE_FORMAT "%" PRIdPTR
+#define SIZE_FORMAT "%" PRIuPTR
+#define SIZE_FORMAT_HEX "0x%" PRIxPTR
+#define SSIZE_FORMAT_W(width) "%" #width PRIdPTR
+#define SIZE_FORMAT_W(width) "%" #width PRIuPTR
+#define SIZE_FORMAT_HEX_W(width) "0x%" #width PRIxPTR
#define INTX_FORMAT "%" PRIdPTR
#define UINTX_FORMAT "%" PRIuPTR
@@ -1349,11 +1385,10 @@ inline int build_int_from_shorts( jushort low, jushort high ) {
// All C++ compilers that we know of have the vtbl pointer in the first
// word. If there are exceptions, this function needs to be made compiler
// specific.
-static inline void* dereference_vptr(void* addr) {
+static inline void* dereference_vptr(const void* addr) {
return *(void**)addr;
}
-
#ifndef PRODUCT
// For unit testing only
diff --git a/src/share/vm/utilities/globalDefinitions_gcc.hpp b/src/share/vm/utilities/globalDefinitions_gcc.hpp
index f66fb721e..22e5d277c 100644
--- a/src/share/vm/utilities/globalDefinitions_gcc.hpp
+++ b/src/share/vm/utilities/globalDefinitions_gcc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -282,6 +282,47 @@ inline int wcslen(const jchar* x) { return wcslen((const wchar_t*)x); }
#define PRAGMA_IMPLEMENTATION #pragma implementation
#define VALUE_OBJ_CLASS_SPEC
+#ifndef ATTRIBUTE_PRINTF
+// Diagnostic pragmas like the ones defined below in PRAGMA_FORMAT_NONLITERAL_IGNORED
+// were only introduced in GCC 4.2. Because we have no other possibility to ignore
+// these warnings for older versions of GCC, we simply don't decorate our printf-style
+// functions with __attribute__(format) in that case.
+#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || (__GNUC__ > 4)
+#define ATTRIBUTE_PRINTF(fmt,vargs) __attribute__((format(printf, fmt, vargs)))
+#else
+#define ATTRIBUTE_PRINTF(fmt,vargs)
+#endif
+#endif
+
+#define PRAGMA_FORMAT_NONLITERAL_IGNORED _Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"") \
+ _Pragma("GCC diagnostic ignored \"-Wformat-security\"")
+#define PRAGMA_FORMAT_IGNORED _Pragma("GCC diagnostic ignored \"-Wformat\"")
+
+#if defined(__clang_major__) && \
+ (__clang_major__ >= 4 || \
+ (__clang_major__ >= 3 && __clang_minor__ >= 1)) || \
+ ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
+// Tested to work with clang version 3.1 and better.
+#define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push")
+#define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop")
+#define PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
+#define PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL PRAGMA_FORMAT_NONLITERAL_IGNORED
+
+// Hack to deal with gcc yammering about non-security format stuff
+#else
+// Old versions of gcc don't do push/pop, also do not cope with this pragma within a function
+// One method does so much varied printing that it is decorated with both internal and external
+// versions of the macro-pragma to obtain better checking with newer compilers.
+#define PRAGMA_DIAG_PUSH
+#define PRAGMA_DIAG_POP
+#define PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL PRAGMA_FORMAT_NONLITERAL_IGNORED
+#define PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
+#endif
+
+#ifndef __clang_major__
+#define PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC _Pragma("GCC diagnostic ignored \"-Wformat\"") _Pragma("GCC diagnostic error \"-Wformat-nonliteral\"") _Pragma("GCC diagnostic error \"-Wformat-security\"")
+#endif
+
#if (__GNUC__ == 2) && (__GNUC_MINOR__ < 95)
#define TEMPLATE_TABLE_BUG
#endif
diff --git a/src/share/vm/utilities/numberSeq.cpp b/src/share/vm/utilities/numberSeq.cpp
index 06fcf40b7..230447b21 100644
--- a/src/share/vm/utilities/numberSeq.cpp
+++ b/src/share/vm/utilities/numberSeq.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -258,5 +258,5 @@ void TruncatedSeq::dump_on(outputStream* s) {
}
s->print("\t[%d]=%7.3f", i, _sequence[i]);
}
- s->print_cr("");
+ s->cr();
}
diff --git a/src/share/vm/utilities/ostream.cpp b/src/share/vm/utilities/ostream.cpp
index e09dfccf1..0143e3f5a 100644
--- a/src/share/vm/utilities/ostream.cpp
+++ b/src/share/vm/utilities/ostream.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -268,7 +268,7 @@ void outputStream::print_data(void* data, size_t len, bool with_ascii) {
size_t limit = (len + 16) / 16 * 16;
for (size_t i = 0; i < limit; ++i) {
if (i % 16 == 0) {
- indent().print("%07x:", i);
+ indent().print(SIZE_FORMAT_HEX_W(07)":", i);
}
if (i % 2 == 0) {
print(" ");
@@ -289,7 +289,7 @@ void outputStream::print_data(void* data, size_t len, bool with_ascii) {
}
}
}
- print_cr("");
+ cr();
}
}
}
@@ -606,7 +606,7 @@ void fdStream::write(const char* s, size_t len) {
// memory usage and command line flags into header
void gcLogFileStream::dump_loggc_header() {
if (is_open()) {
- print_cr(Abstract_VM_Version::internal_vm_info_string());
+ print_cr("%s", Abstract_VM_Version::internal_vm_info_string());
os::print_memory_info(this);
print("CommandLine flags: ");
CommandLineFlags::printSetFlags(this);
@@ -687,7 +687,7 @@ void gcLogFileStream::rotate_log(bool force, outputStream* out) {
write(time_msg, strlen(time_msg));
if (out != NULL) {
- out->print(time_msg);
+ out->print("%s", time_msg);
}
dump_loggc_header();
@@ -720,7 +720,7 @@ void gcLogFileStream::rotate_log(bool force, outputStream* out) {
write(time_msg, strlen(time_msg));
if (out != NULL) {
- out->print(time_msg);
+ out->print("%s", time_msg);
}
fclose(_file);
@@ -765,7 +765,7 @@ void gcLogFileStream::rotate_log(bool force, outputStream* out) {
write(time_msg, strlen(time_msg));
if (out != NULL) {
- out->print(time_msg);
+ out->print("%s", time_msg);
}
dump_loggc_header();
@@ -845,7 +845,7 @@ void defaultStream::init_log() {
xs->head("hotspot_log version='%d %d'"
" process='%d' time_ms='"INT64_FORMAT"'",
LOG_MAJOR_VERSION, LOG_MINOR_VERSION,
- os::current_process_id(), time_ms);
+ os::current_process_id(), (int64_t)time_ms);
// Write VM version header immediately.
xs->head("vm_version");
xs->head("name"); xs->text("%s", VM_Version::vm_name()); xs->cr();
diff --git a/src/share/vm/utilities/ostream.hpp b/src/share/vm/utilities/ostream.hpp
index b783787e0..0ad5c20d3 100644
--- a/src/share/vm/utilities/ostream.hpp
+++ b/src/share/vm/utilities/ostream.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@ class outputStream : public ResourceObj {
static const char* do_vsnprintf(char* buffer, size_t buflen,
const char* format, va_list ap,
bool add_cr,
- size_t& result_len);
+ size_t& result_len) ATTRIBUTE_PRINTF(3, 0);
public:
// creation
@@ -80,10 +80,10 @@ class outputStream : public ResourceObj {
void set_position(int pos) { _position = pos; }
// printing
- void print(const char* format, ...);
- void print_cr(const char* format, ...);
- void vprint(const char *format, va_list argptr);
- void vprint_cr(const char* format, va_list argptr);
+ void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ void print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ void vprint(const char *format, va_list argptr) ATTRIBUTE_PRINTF(2, 0);
+ void vprint_cr(const char* format, va_list argptr) ATTRIBUTE_PRINTF(2, 0);
void print_raw(const char* str) { write(str, strlen(str)); }
void print_raw(const char* str, int len) { write(str, len); }
void print_raw_cr(const char* str) { write(str, strlen(str)); cr(); }
@@ -275,10 +275,10 @@ class staticBufferStream : public outputStream {
~staticBufferStream() {};
virtual void write(const char* c, size_t len);
void flush();
- void print(const char* format, ...);
- void print_cr(const char* format, ...);
- void vprint(const char *format, va_list argptr);
- void vprint_cr(const char* format, va_list argptr);
+ void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ void print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ void vprint(const char *format, va_list argptr) ATTRIBUTE_PRINTF(2, 0);
+ void vprint_cr(const char* format, va_list argptr) ATTRIBUTE_PRINTF(2, 0);
};
// In the non-fixed buffer case an underlying buffer will be created and
diff --git a/src/share/vm/utilities/quickSort.cpp b/src/share/vm/utilities/quickSort.cpp
index 0cb7f6ef8..de0088779 100644
--- a/src/share/vm/utilities/quickSort.cpp
+++ b/src/share/vm/utilities/quickSort.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,7 @@ void QuickSort::print_array(const char* prefix, int* array, int length) {
for (int i = 0; i < length; i++) {
tty->print(" %d", array[i]);
}
- tty->print_cr("");
+ tty->cr();
}
bool QuickSort::compare_arrays(int* actual, int* expected, int length) {
diff --git a/src/share/vm/utilities/taskqueue.cpp b/src/share/vm/utilities/taskqueue.cpp
index 862c9b304..da2e928b8 100644
--- a/src/share/vm/utilities/taskqueue.cpp
+++ b/src/share/vm/utilities/taskqueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,8 @@
#include "utilities/stack.inline.hpp"
#include "utilities/taskqueue.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
#ifdef TRACESPINNING
uint ParallelTaskTerminator::_total_yields = 0;
uint ParallelTaskTerminator::_total_spins = 0;
diff --git a/src/share/vm/utilities/vmError.cpp b/src/share/vm/utilities/vmError.cpp
index e950d3386..6947564c4 100644
--- a/src/share/vm/utilities/vmError.cpp
+++ b/src/share/vm/utilities/vmError.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,8 @@
#include "utilities/top.hpp"
#include "utilities/vmError.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// List of environment variables that should be reported in error log file.
const char *env_list[] = {
// All platforms
@@ -358,17 +360,17 @@ void VMError::report(outputStream* st) {
st->print((_id == (int)OOM_MALLOC_ERROR) ? "(malloc) failed to allocate " :
"(mmap) failed to map ");
jio_snprintf(buf, sizeof(buf), SIZE_FORMAT, _size);
- st->print(buf);
+ st->print("%s", buf);
st->print(" bytes");
if (_message != NULL) {
st->print(" for ");
- st->print(_message);
+ st->print("%s", _message);
}
st->cr();
} else {
if (_message != NULL)
st->print("# ");
- st->print_cr(_message);
+ st->print_cr("%s", _message);
}
// In error file give some solutions
if (_verbose) {
@@ -485,7 +487,7 @@ void VMError::report(outputStream* st) {
} else {
st->print("Failed to write core dump. %s", coredump_message);
}
- st->print_cr("");
+ st->cr();
st->print_cr("#");
STEP(65, "(printing bug submit message)")
diff --git a/src/share/vm/utilities/workgroup.cpp b/src/share/vm/utilities/workgroup.cpp
index 479cd0402..beab5906f 100644
--- a/src/share/vm/utilities/workgroup.cpp
+++ b/src/share/vm/utilities/workgroup.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
#include "runtime/os.hpp"
#include "utilities/workgroup.hpp"
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
// Definitions of WorkGang methods.
AbstractWorkGang::AbstractWorkGang(const char* name,
diff --git a/src/share/vm/utilities/xmlstream.cpp b/src/share/vm/utilities/xmlstream.cpp
index 3a386a737..744a69468 100644
--- a/src/share/vm/utilities/xmlstream.cpp
+++ b/src/share/vm/utilities/xmlstream.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -336,6 +336,8 @@ void xmlStream::done_raw(const char* kind) {
print_raw_cr(">");
}
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED
// ------------------------------------------------------------------
void xmlStream::va_done(const char* format, va_list ap) {
char buffer[200];
@@ -354,6 +356,7 @@ void xmlStream::va_done(const char* format, va_list ap) {
buffer[kind_len] = 0;
tail(buffer);
}
+PRAGMA_DIAG_POP
// Output a timestamp attribute.
void xmlStream::stamp() {
diff --git a/src/share/vm/utilities/xmlstream.hpp b/src/share/vm/utilities/xmlstream.hpp
index 7ab93744b..22a12cacd 100644
--- a/src/share/vm/utilities/xmlstream.hpp
+++ b/src/share/vm/utilities/xmlstream.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -80,7 +80,7 @@ class xmlStream : public outputStream {
outputStream* out() { return _out; }
// helpers for writing XML elements
- void va_tag(bool push, const char* format, va_list ap);
+ void va_tag(bool push, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0);
virtual void see_tag(const char* tag, bool push) NOT_DEBUG({});
virtual void pop_tag(const char* tag) NOT_DEBUG({});
@@ -109,29 +109,29 @@ class xmlStream : public outputStream {
int unflushed_count() { return (int)(out()->count() - _last_flush); }
// writing complete XML elements
- void elem(const char* format, ...);
- void begin_elem(const char* format, ...);
- void end_elem(const char* format, ...);
+ void elem(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ void begin_elem(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ void end_elem(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
void end_elem();
- void head(const char* format, ...);
- void begin_head(const char* format, ...);
- void end_head(const char* format, ...);
+ void head(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ void begin_head(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ void end_head(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
void end_head();
- void done(const char* format, ...); // xxx_done event, plus tail
+ void done(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); // xxx_done event, plus tail
void done_raw(const char * kind);
void tail(const char* kind);
// va_list versions
- void va_elem(const char* format, va_list ap);
- void va_begin_elem(const char* format, va_list ap);
- void va_head(const char* format, va_list ap);
- void va_begin_head(const char* format, va_list ap);
- void va_done(const char* format, va_list ap);
+ void va_elem(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
+ void va_begin_elem(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
+ void va_head(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
+ void va_begin_head(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
+ void va_done(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
// write text (with quoting of special XML characters <>&'" etc.)
outputStream* text() { return _text; }
- void text(const char* format, ...);
- void va_text(const char* format, va_list ap) {
+ void text(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ void va_text(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0) {
text()->vprint(format, ap);
}
diff --git a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java
index 07c6f936f..ad6e29f9b 100644
--- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java
+++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java
@@ -72,7 +72,8 @@ public class TestUseRTMLockingOptionOnUnsupportedVM
"-XX:-UseRTMLocking");
// verify that it is off by default
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
- TestUseRTMLockingOptionOnUnsupportedVM.DEFAULT_VALUE);
+ TestUseRTMLockingOptionOnUnsupportedVM.DEFAULT_VALUE,
+ CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
}
public static void main(String args[]) throws Throwable {
diff --git a/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java b/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java
new file mode 100644
index 000000000..fa33c1e3c
--- /dev/null
+++ b/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test TestEmptyBootstrapMethodsAttr
+ * @bug 8041918
+ * @library /testlibrary
+ * @summary Test empty bootstrap_methods table within BootstrapMethods attribute
+ * @compile TestEmptyBootstrapMethodsAttr.java
+ * @run main TestEmptyBootstrapMethodsAttr
+ */
+
+import java.io.File;
+import com.oracle.java.testlibrary.*;
+
+public class TestEmptyBootstrapMethodsAttr {
+
+ public static void main(String args[]) throws Throwable {
+ System.out.println("Regression test for bug 8041918");
+ String jarFile = System.getProperty("test.src") + File.separator + "emptynumbootstrapmethods.jar";
+
+ // ====== extract the test case
+ ProcessBuilder pb = new ProcessBuilder(new String[] { JDKToolFinder.getJDKTool("jar"), "xvf", jarFile } );
+ OutputAnalyzer output = new OutputAnalyzer(pb.start());
+ output.shouldHaveExitValue(0);
+
+ // Test case #1:
+ // Try loading class with empty bootstrap_methods table where no
+ // other attributes are following BootstrapMethods in attribute table.
+ String className = "emptynumbootstrapmethods1";
+
+ // ======= execute test case #1
+ // Expect a lack of main method, this implies that the class loaded correctly
+ // with an empty bootstrap_methods and did not generate a ClassFormatError.
+ pb = ProcessTools.createJavaProcessBuilder("-cp", ".", className);
+ output = new OutputAnalyzer(pb.start());
+ output.shouldNotContain("java.lang.ClassFormatError");
+ output.shouldContain("Main method not found in class " + className);
+ output.shouldHaveExitValue(1);
+
+ // Test case #2:
+ // Try loading class with empty bootstrap_methods table where an
+ // AnnotationDefault attribute follows the BootstrapMethods in the attribute table.
+ className = "emptynumbootstrapmethods2";
+
+ // ======= execute test case #2
+ // Expect a lack of main method, this implies that the class loaded correctly
+ // with an empty bootstrap_methods and did not generate ClassFormatError.
+ pb = ProcessTools.createJavaProcessBuilder("-cp", ".", className);
+ output = new OutputAnalyzer(pb.start());
+ output.shouldNotContain("java.lang.ClassFormatError");
+ output.shouldContain("Main method not found in class " + className);
+ output.shouldHaveExitValue(1);
+ }
+}
diff --git a/test/runtime/classFileParserBug/emptynumbootstrapmethods.jar b/test/runtime/classFileParserBug/emptynumbootstrapmethods.jar
new file mode 100644
index 000000000..6ea40b970
--- /dev/null
+++ b/test/runtime/classFileParserBug/emptynumbootstrapmethods.jar
Binary files differ
diff --git a/test/runtime/classFileParserBug/emptynumbootstrapmethods1.jcod b/test/runtime/classFileParserBug/emptynumbootstrapmethods1.jcod
new file mode 100644
index 000000000..df1c210be
--- /dev/null
+++ b/test/runtime/classFileParserBug/emptynumbootstrapmethods1.jcod
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This test contains a BootstrapMethods attribute with an empty
+ * bootstrap_methods table. This yields a BootstrapMethods
+ * attribute length of 2 and should not cause a
+ * java.lang.ClassFormatError to be thrown.
+ */
+class emptynumbootstrapmethods1 {
+ 0xCAFEBABE;
+ 0; // minor version
+ 51; // version
+ [12] { // Constant Pool
+ ; // first element is empty
+ class #2; // #1 at 0x0A
+ Utf8 "emptynumbootstrapmethods1"; // #2 at 0x0D
+ class #4; // #3 at 0x1F
+ Utf8 "java/lang/Object"; // #4 at 0x22
+ MethodHandle 5b #9; // #5 at 0x35
+ NameAndType #7 #8; // #6 at 0x39
+ Utf8 "equals"; // #7 at 0x3E
+ Utf8 "(Ljava/lang/Object;)Z"; // #8 at 0x47
+ Method #3 #6; // #9 at 0x5F
+ Utf8 "equalsx"; // #10 at 0x3E
+ Utf8 "BootstrapMethods"; // #11 at 0x69
+ } // Constant Pool
+
+ 0x0001; // access
+ #1;// this_cpx
+ #3;// super_cpx
+
+ [0] { // Interfaces
+ } // Interfaces
+
+ [0] { // fields
+ } // fields
+
+ [0] { // methods
+ } // methods
+
+ [1] { // Attributes
+ Attr(#11, 2) { // BootstrapMethods at 0x8A
+ [0] { // bootstrap_methods
+ }
+ } // end BootstrapMethods
+ } // Attributes
+} // end class atrbsm00101m10p
diff --git a/test/runtime/classFileParserBug/emptynumbootstrapmethods2.jcod b/test/runtime/classFileParserBug/emptynumbootstrapmethods2.jcod
new file mode 100644
index 000000000..428fad98a
--- /dev/null
+++ b/test/runtime/classFileParserBug/emptynumbootstrapmethods2.jcod
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This test contains a BootstrapMethods attribute with an empty
+ * bootstrap_methods table. This yields a BootstrapMethods
+ * attribute length of 2 and should not cause a
+ * java.lang.ClassFormatError to be thrown. To ensure that an empty
+ * bootstrap_methods table is parsed correctly, another attribute,
+ * AnnotationDefault, follows the BootstrapMethods attribute in
+ * the attribute table.
+ */
+
+class emptynumbootstrapmethods2 {
+ 0xCAFEBABE;
+ 0; // minor version
+ 51; // version
+ [14] { // Constant Pool
+ ; // first element is empty
+ class #2; // #1 at 0x0A
+ Utf8 "emptynumbootstrapmethods2"; // #2 at 0x0D
+ class #4; // #3 at 0x1F
+ Utf8 "java/lang/Object"; // #4 at 0x22
+ MethodHandle 5b #9; // #5 at 0x35
+ NameAndType #7 #8; // #6 at 0x39
+ Utf8 "equals"; // #7 at 0x3E
+ Utf8 "(Ljava/lang/Object;)Z"; // #8 at 0x47
+ Method #3 #6; // #9 at 0x5F
+ Utf8 "equalsx"; // #10 at 0x3E
+ Utf8 "BootstrapMethods"; // #11 at 0x69
+ Utf8 "AnnotationDefault"; // #12
+ Utf8 "LAnnotationDefaultI;"; // #13
+ } // Constant Pool
+
+ 0x0001; // access
+ #1;// this_cpx
+ #3;// super_cpx
+
+ [0] { // Interfaces
+ } // Interfaces
+
+ [0] { // fields
+ } // fields
+
+ [0] { // methods
+ } // methods
+
+ [2] { // Attributes
+ Attr(#11, 2) { // BootstrapMethods at 0x8A
+ [0] { // bootstrap_methods
+ }
+ } // end BootstrapMethods
+ ;
+ Attr(#12) { // AnnotationDefault
+ [] { // type annotations
+ { // type annotation
+ 0x00; // target_type
+ 0x00; // type_parameter_index
+ []b { // type_path
+ }
+
+ #13; // type_index
+ [] { // element_value_pairs
+ } // element_value_pairs
+ } // type annotation
+ } // type annotations
+ } // end AnnotationDefault
+ } // Attributes
+} // end class atrbsm00101m10p