--- old/make/lib/CompileJvm.gmk 2017-06-16 19:46:42.678590787 -0400 +++ new/make/lib/CompileJvm.gmk 2017-06-16 19:46:42.554584581 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -69,6 +69,7 @@ -DTARGET_ARCH_$(HOTSPOT_TARGET_CPU_ARCH) \ -DINCLUDE_SUFFIX_OS=_$(HOTSPOT_TARGET_OS) \ -DINCLUDE_SUFFIX_CPU=_$(HOTSPOT_TARGET_CPU_ARCH) \ + -DINCLUDE_SUFFIX_TARGET_COMPILER=_$(HOTSPOT_TOOLCHAIN_TYPE) \ -DTARGET_COMPILER_$(HOTSPOT_TOOLCHAIN_TYPE) \ -D$(HOTSPOT_TARGET_CPU_DEFINE) \ -DHOTSPOT_LIB_ARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' \ --- old/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp 2017-06-16 19:46:43.226618204 -0400 +++ new/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp 2017-06-16 19:46:43.098611795 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -38,6 +38,7 @@ #include "opto/compile.hpp" #include "opto/intrinsicnode.hpp" #include "opto/node.hpp" +#include "prims/jvm.h" #include "runtime/biasedLocking.hpp" #include "runtime/icache.hpp" #include "runtime/interfaceSupport.hpp" @@ -2011,6 +2012,12 @@ hlt(0); } +void MacroAssembler::unimplemented(const char* what) { + char* b = new char[1024]; + jio_snprintf(b, 1024, "unimplemented: %s", what); + stop(b); +} + // If a constant does not fit in an immediate field, generate some // number of MOV instructions and then perform the operation. void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, unsigned imm, --- old/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp 2017-06-16 19:46:43.826648229 -0400 +++ new/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp 2017-06-16 19:46:43.698641817 -0400 @@ -941,7 +941,7 @@ void untested() { stop("untested"); } - void unimplemented(const char* what = "") { char* b = new char[1024]; jio_snprintf(b, 1024, "unimplemented: %s", what); stop(b); } + void unimplemented(const char* what = ""); void should_not_reach_here() { stop("should not reach here"); } --- old/src/cpu/arm/vm/methodHandles_arm.cpp 2017-06-16 19:46:44.382676042 -0400 +++ new/src/cpu/arm/vm/methodHandles_arm.cpp 2017-06-16 19:46:44.258669835 -0400 @@ -32,6 +32,7 @@ #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "prims/methodHandles.hpp" #define __ _masm-> --- old/src/cpu/arm/vm/vm_version_arm_32.cpp 2017-06-16 19:46:44.934703664 -0400 +++ new/src/cpu/arm/vm/vm_version_arm_32.cpp 2017-06-16 19:46:44.810697456 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "runtime/java.hpp" #include "runtime/os.inline.hpp" #include "runtime/stubCodeGenerator.hpp" --- old/src/cpu/arm/vm/vm_version_arm_64.cpp 2017-06-16 19:46:45.478730870 -0400 +++ new/src/cpu/arm/vm/vm_version_arm_64.cpp 2017-06-16 19:46:45.354724668 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "runtime/java.hpp" #include "runtime/os.inline.hpp" #include "runtime/stubCodeGenerator.hpp" --- old/src/cpu/ppc/vm/methodHandles_ppc.cpp 2017-06-16 19:46:46.022758098 -0400 +++ new/src/cpu/ppc/vm/methodHandles_ppc.cpp 2017-06-16 19:46:45.898751886 -0400 @@ -29,6 +29,7 @@ #include "interpreter/interpreter.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "prims/methodHandles.hpp" #define __ _masm-> --- old/src/cpu/ppc/vm/vm_version_ppc.cpp 2017-06-16 19:46:46.578785908 -0400 +++ new/src/cpu/ppc/vm/vm_version_ppc.cpp 2017-06-16 19:46:46.450779502 -0400 @@ -28,6 +28,7 @@ #include "asm/macroAssembler.inline.hpp" #include "compiler/disassembler.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "runtime/java.hpp" #include "runtime/os.hpp" #include "runtime/stubCodeGenerator.hpp" --- old/src/cpu/s390/vm/methodHandles_s390.cpp 2017-06-16 19:46:47.126813326 -0400 +++ new/src/cpu/s390/vm/methodHandles_s390.cpp 2017-06-16 19:46:47.002807122 -0400 @@ -29,6 +29,7 @@ #include "interpreter/interpreter.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "prims/methodHandles.hpp" #ifdef PRODUCT --- old/src/cpu/s390/vm/vm_version_s390.cpp 2017-06-16 19:46:47.678840950 -0400 +++ new/src/cpu/s390/vm/vm_version_s390.cpp 2017-06-16 19:46:47.558834940 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,6 +28,7 @@ #include "compiler/disassembler.hpp" #include "code/compiledIC.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "runtime/java.hpp" #include "runtime/stubCodeGenerator.hpp" #include "vm_version_s390.hpp" --- old/src/cpu/sparc/vm/macroAssembler_sparc.cpp 2017-06-16 19:46:48.246869363 -0400 +++ new/src/cpu/sparc/vm/macroAssembler_sparc.cpp 2017-06-16 19:46:48.122863157 -0400 @@ -31,6 +31,7 @@ #include "memory/resourceArea.hpp" #include "memory/universe.hpp" #include "oops/klass.inline.hpp" +#include "prims/jvm.h" #include "prims/methodHandles.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/interfaceSupport.hpp" @@ -1392,6 +1393,13 @@ } +void MacroAssembler::unimplemented(const char* what) { + char* b = new char[1024]; + jio_snprintf(b, 1024, "unimplemented: %s", what); + stop(b); +} + + void MacroAssembler::stop_subroutine() { RegistersForDebugging::save_registers(this); --- old/src/cpu/sparc/vm/macroAssembler_sparc.hpp 2017-06-16 19:46:48.834898782 -0400 +++ new/src/cpu/sparc/vm/macroAssembler_sparc.hpp 2017-06-16 19:46:48.706892377 -0400 @@ -1130,7 +1130,7 @@ void stop(const char* msg); // prints msg, dumps registers and stops execution void warn(const char* msg); // prints msg, but don't stop void untested(const char* what = ""); - void unimplemented(const char* what = "") { char* b = new char[1024]; jio_snprintf(b, 1024, "unimplemented: %s", what); stop(b); } + void unimplemented(const char* what = ""); void should_not_reach_here() { stop("should not reach here"); } void print_CPU_state(); --- old/src/cpu/sparc/vm/methodHandles_sparc.cpp 2017-06-16 19:46:49.394926797 -0400 +++ new/src/cpu/sparc/vm/methodHandles_sparc.cpp 2017-06-16 19:46:49.270920593 -0400 @@ -29,6 +29,7 @@ #include "interpreter/interp_masm.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "prims/methodHandles.hpp" #define __ _masm-> --- old/src/cpu/sparc/vm/vm_version_sparc.cpp 2017-06-16 19:46:49.954954807 -0400 +++ new/src/cpu/sparc/vm/vm_version_sparc.cpp 2017-06-16 19:46:49.830948607 -0400 @@ -26,6 +26,7 @@ #include "asm/macroAssembler.inline.hpp" #include "logging/log.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "runtime/java.hpp" #include "runtime/os.hpp" #include "runtime/stubCodeGenerator.hpp" --- old/src/cpu/x86/vm/macroAssembler_x86.cpp 2017-06-16 19:46:50.502982227 -0400 +++ new/src/cpu/x86/vm/macroAssembler_x86.cpp 2017-06-16 19:46:50.374975823 -0400 @@ -32,6 +32,7 @@ #include "memory/resourceArea.hpp" #include "memory/universe.hpp" #include "oops/klass.inline.hpp" +#include "prims/jvm.h" #include "prims/methodHandles.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/interfaceSupport.hpp" @@ -3640,6 +3641,12 @@ call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint))); } +void MacroAssembler::unimplemented(const char* what) { + char* b = new char[1024]; + jio_snprintf(b, 1024, "unimplemented: %s", what); + stop(b); +} + #ifdef _LP64 #define XSTATE_BV 0x200 #endif --- old/src/cpu/x86/vm/macroAssembler_x86.hpp 2017-06-16 19:46:51.163015248 -0400 +++ new/src/cpu/x86/vm/macroAssembler_x86.hpp 2017-06-16 19:46:51.039009052 -0400 @@ -628,7 +628,7 @@ void untested() { stop("untested"); } - void unimplemented(const char* what = "") { char* b = new char[1024]; jio_snprintf(b, 1024, "unimplemented: %s", what); stop(b); } + void unimplemented(const char* what = ""); void should_not_reach_here() { stop("should not reach here"); } --- old/src/cpu/x86/vm/methodHandles_x86.cpp 2017-06-16 19:46:51.719043074 -0400 +++ new/src/cpu/x86/vm/methodHandles_x86.cpp 2017-06-16 19:46:51.595036863 -0400 @@ -29,6 +29,7 @@ #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "prims/methodHandles.hpp" #define __ _masm-> --- old/src/cpu/x86/vm/vm_version_x86.cpp 2017-06-16 19:46:52.259070083 -0400 +++ new/src/cpu/x86/vm/vm_version_x86.cpp 2017-06-16 19:46:52.135063881 -0400 @@ -27,6 +27,7 @@ #include "asm/macroAssembler.inline.hpp" #include "logging/log.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "runtime/java.hpp" #include "runtime/os.hpp" #include "runtime/stubCodeGenerator.hpp" --- old/src/os/bsd/vm/decoder_machO.cpp 2017-06-16 19:46:52.807097502 -0400 +++ new/src/os/bsd/vm/decoder_machO.cpp 2017-06-16 19:46:52.683091295 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "precompiled.hpp" #ifdef __APPLE__ +#include "prims/jvm.h" #include "decoder_machO.hpp" #include --- old/src/share/vm/aot/aotLoader.cpp 2017-06-16 19:46:53.351124717 -0400 +++ new/src/share/vm/aot/aotLoader.cpp 2017-06-16 19:46:53.223118313 -0400 @@ -27,6 +27,7 @@ #include "aot/aotLoader.inline.hpp" #include "jvmci/jvmciRuntime.hpp" #include "oops/method.hpp" +#include "prims/jvm.h" #include "runtime/os.hpp" GrowableArray* AOTLoader::_heaps = new(ResourceObj::C_HEAP, mtCode) GrowableArray (2, true); --- old/src/share/vm/c1/c1_CFGPrinter.cpp 2017-06-16 19:46:53.891151733 -0400 +++ new/src/share/vm/c1/c1_CFGPrinter.cpp 2017-06-16 19:46:53.767145530 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ #include "c1/c1_LIR.hpp" #include "c1/c1_LinearScan.hpp" #include "c1/c1_ValueStack.hpp" +#include "prims/jvm.h" #ifndef PRODUCT --- old/src/share/vm/ci/ciEnv.cpp 2017-06-16 19:46:54.431178745 -0400 +++ new/src/share/vm/ci/ciEnv.cpp 2017-06-16 19:46:54.303172348 -0400 @@ -49,6 +49,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "prims/jvmtiExport.hpp" #include "runtime/init.hpp" #include "runtime/reflection.hpp" --- old/src/share/vm/ci/ciReplay.cpp 2017-06-16 19:46:55.003207367 -0400 +++ new/src/share/vm/ci/ciReplay.cpp 2017-06-16 19:46:54.871200760 -0400 @@ -33,6 +33,7 @@ #include "memory/oopFactory.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "utilities/copy.hpp" #include "utilities/macros.hpp" --- old/src/share/vm/classfile/classLoader.cpp 2017-06-16 19:46:55.563235385 -0400 +++ new/src/share/vm/classfile/classLoader.cpp 2017-06-16 19:46:55.431228784 -0400 @@ -51,6 +51,7 @@ #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" +#include "prims/jvm.h" #include "prims/jvm_misc.hpp" #include "runtime/arguments.hpp" #include "runtime/compilationPolicy.hpp" --- old/src/share/vm/classfile/modules.cpp 2017-06-16 19:46:56.135264008 -0400 +++ new/src/share/vm/classfile/modules.cpp 2017-06-16 19:46:56.007257605 -0400 @@ -39,6 +39,7 @@ #include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "oops/instanceKlass.hpp" +#include "prims/jvm.h" #include "runtime/arguments.hpp" #include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" --- old/src/share/vm/classfile/systemDictionary.cpp 2017-06-16 19:46:56.699292221 -0400 +++ new/src/share/vm/classfile/systemDictionary.cpp 2017-06-16 19:46:56.563285412 -0400 @@ -58,6 +58,7 @@ #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" #include "oops/typeArrayKlass.hpp" +#include "prims/jvm.h" #include "prims/jvmtiEnvBase.hpp" #include "prims/resolvedMethodTable.hpp" #include "prims/methodHandles.hpp" --- old/src/share/vm/classfile/vmSymbols.cpp 2017-06-16 19:46:57.263320434 -0400 +++ new/src/share/vm/classfile/vmSymbols.cpp 2017-06-16 19:46:57.135314032 -0400 @@ -27,6 +27,7 @@ #include "compiler/compilerDirectives.hpp" #include "memory/oopFactory.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "runtime/handles.inline.hpp" #include "utilities/xmlstream.hpp" --- old/src/share/vm/code/codeBlob.cpp 2017-06-16 19:46:57.819348254 -0400 +++ new/src/share/vm/code/codeBlob.cpp 2017-06-16 19:46:57.691341851 -0400 @@ -33,6 +33,7 @@ #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" #include "prims/forte.hpp" +#include "prims/jvm.h" #include "runtime/handles.inline.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/mutexLocker.hpp" --- old/src/share/vm/code/nmethod.cpp 2017-06-16 19:46:58.379376271 -0400 +++ new/src/share/vm/code/nmethod.cpp 2017-06-16 19:46:58.243369462 -0400 @@ -40,6 +40,7 @@ #include "memory/resourceArea.hpp" #include "oops/methodData.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "prims/jvmtiImpl.hpp" #include "runtime/atomic.hpp" #include "runtime/orderAccess.inline.hpp" --- old/src/share/vm/compiler/compileBroker.cpp 2017-06-16 19:46:58.955405085 -0400 +++ new/src/share/vm/compiler/compileBroker.cpp 2017-06-16 19:46:58.827398681 -0400 @@ -38,6 +38,7 @@ #include "oops/methodData.hpp" #include "oops/method.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "prims/nativeLookup.hpp" #include "prims/whitebox.hpp" #include "runtime/arguments.hpp" @@ -51,8 +52,10 @@ #include "runtime/sweeper.hpp" #include "runtime/timerTrace.hpp" #include "trace/tracing.hpp" +#include "utilities/debug.hpp" #include "utilities/dtrace.hpp" #include "utilities/events.hpp" +#include "utilities/formatBuffer.hpp" #ifdef COMPILER1 #include "c1/c1_Compiler.hpp" #endif --- old/src/share/vm/compiler/compileLog.cpp 2017-06-16 19:46:59.519433308 -0400 +++ new/src/share/vm/compiler/compileLog.cpp 2017-06-16 19:46:59.395427098 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ #include "compiler/compileLog.hpp" #include "memory/allocation.inline.hpp" #include "oops/method.hpp" +#include "prims/jvm.h" #include "runtime/mutexLocker.hpp" #include "runtime/os.hpp" --- old/src/share/vm/compiler/compilerOracle.cpp 2017-06-16 19:47:00.079461325 -0400 +++ new/src/share/vm/compiler/compilerOracle.cpp 2017-06-16 19:46:59.951454914 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * 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 "oops/klass.hpp" #include "oops/method.hpp" #include "oops/symbol.hpp" +#include "prims/jvm.h" #include "runtime/handles.inline.hpp" #include "runtime/jniHandles.hpp" #include "runtime/os.hpp" --- old/src/share/vm/gc/g1/heapRegionRemSet.cpp 2017-06-16 19:47:00.639489335 -0400 +++ new/src/share/vm/gc/g1/heapRegionRemSet.cpp 2017-06-16 19:47:00.511482931 -0400 @@ -35,6 +35,8 @@ #include "oops/oop.inline.hpp" #include "runtime/atomic.hpp" #include "utilities/bitMap.inline.hpp" +#include "utilities/debug.hpp" +#include "utilities/formatBuffer.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/growableArray.hpp" --- old/src/share/vm/gc/g1/satbMarkQueue.cpp 2017-06-16 19:47:01.199517359 -0400 +++ new/src/share/vm/gc/g1/satbMarkQueue.cpp 2017-06-16 19:47:01.067510749 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ #include "gc/shared/collectedHeap.hpp" #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "runtime/mutexLocker.hpp" #include "runtime/safepoint.hpp" #include "runtime/thread.hpp" --- old/src/share/vm/gc/parallel/psParallelCompact.cpp 2017-06-16 19:47:01.743544574 -0400 +++ new/src/share/vm/gc/parallel/psParallelCompact.cpp 2017-06-16 19:47:01.611537969 -0400 @@ -66,7 +66,9 @@ #include "services/management.hpp" #include "services/memTracker.hpp" #include "services/memoryService.hpp" +#include "utilities/debug.hpp" #include "utilities/events.hpp" +#include "utilities/formatBuffer.hpp" #include "utilities/stack.inline.hpp" #include --- old/src/share/vm/gc/shared/ageTable.cpp 2017-06-16 19:47:02.339574382 -0400 +++ new/src/share/vm/gc/shared/ageTable.cpp 2017-06-16 19:47:02.211567982 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 "memory/resourceArea.hpp" #include "logging/log.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "utilities/copy.hpp" /* Copyright (c) 1992, 2016, Oracle and/or its affiliates, and Stanford University. --- old/src/share/vm/gc/shared/collectedHeap.hpp 2017-06-16 19:47:02.879601400 -0400 +++ new/src/share/vm/gc/shared/collectedHeap.hpp 2017-06-16 19:47:02.751595006 -0400 @@ -31,7 +31,9 @@ #include "runtime/handles.hpp" #include "runtime/perfData.hpp" #include "runtime/safepoint.hpp" +#include "utilities/debug.hpp" #include "utilities/events.hpp" +#include "utilities/formatBuffer.hpp" // A "CollectedHeap" is an implementation of a java heap for HotSpot. This // is an abstract class: there may be many different kinds of heaps. This --- old/src/share/vm/gc/shared/gcId.cpp 2017-06-16 19:47:03.435629223 -0400 +++ new/src/share/vm/gc/shared/gcId.cpp 2017-06-16 19:47:03.303622617 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "gc/shared/gcId.hpp" +#include "prims/jvm.h" #include "runtime/safepoint.hpp" #include "runtime/thread.inline.hpp" --- old/src/share/vm/gc/shared/genCollectedHeap.cpp 2017-06-16 19:47:03.975656232 -0400 +++ new/src/share/vm/gc/shared/genCollectedHeap.cpp 2017-06-16 19:47:03.847649835 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 +53,8 @@ #include "runtime/vmThread.hpp" #include "services/management.hpp" #include "services/memoryService.hpp" +#include "utilities/debug.hpp" +#include "utilities/formatBuffer.hpp" #include "utilities/macros.hpp" #include "utilities/stack.inline.hpp" #include "utilities/vmError.hpp" --- old/src/share/vm/interpreter/linkResolver.cpp 2017-06-16 19:47:04.539684443 -0400 +++ new/src/share/vm/interpreter/linkResolver.cpp 2017-06-16 19:47:04.407677845 -0400 @@ -40,6 +40,7 @@ #include "oops/method.hpp" #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "prims/methodHandles.hpp" #include "prims/nativeLookup.hpp" #include "runtime/compilationPolicy.hpp" --- old/src/share/vm/jvmci/jvmciCompiler.cpp 2017-06-16 19:47:05.111713064 -0400 +++ new/src/share/vm/jvmci/jvmciCompiler.cpp 2017-06-16 19:47:04.983706661 -0400 @@ -25,6 +25,7 @@ #include "memory/oopFactory.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "runtime/javaCalls.hpp" #include "runtime/handles.hpp" #include "jvmci/jvmciJavaClasses.hpp" --- old/src/share/vm/jvmci/jvmci_globals.cpp 2017-06-16 19:47:05.647739884 -0400 +++ new/src/share/vm/jvmci/jvmci_globals.cpp 2017-06-16 19:47:05.519733481 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "jvmci/jvmci_globals.hpp" +#include "prims/jvm.h" #include "utilities/defaultStream.hpp" #include "runtime/globals_extension.hpp" --- old/src/share/vm/logging/logConfiguration.cpp 2017-06-16 19:47:06.183766691 -0400 +++ new/src/share/vm/logging/logConfiguration.cpp 2017-06-16 19:47:06.055760296 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 "logging/logTagSet.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "runtime/os.inline.hpp" #include "runtime/semaphore.hpp" #include "utilities/globalDefinitions.hpp" --- old/src/share/vm/logging/logDecorations.cpp 2017-06-16 19:47:06.739794510 -0400 +++ new/src/share/vm/logging/logDecorations.cpp 2017-06-16 19:47:06.607787904 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "logging/logConfiguration.hpp" #include "logging/logDecorations.hpp" +#include "prims/jvm.h" #include "runtime/os.inline.hpp" #include "runtime/thread.inline.hpp" #include "services/management.hpp" --- old/src/share/vm/logging/logFileOutput.cpp 2017-06-16 19:47:07.283821723 -0400 +++ new/src/share/vm/logging/logFileOutput.cpp 2017-06-16 19:47:07.155815320 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 "logging/logConfiguration.hpp" #include "logging/logFileOutput.hpp" #include "memory/allocation.inline.hpp" +#include "prims/jvm.h" #include "runtime/arguments.hpp" #include "runtime/os.inline.hpp" #include "utilities/globalDefinitions.hpp" --- old/src/share/vm/logging/logFileStreamOutput.cpp 2017-06-16 19:47:07.835849337 -0400 +++ new/src/share/vm/logging/logFileStreamOutput.cpp 2017-06-16 19:47:07.703842738 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ #include "logging/logFileStreamOutput.hpp" #include "logging/logMessageBuffer.hpp" #include "memory/allocation.inline.hpp" +#include "prims/jvm.h" static bool initialized; static union { --- old/src/share/vm/logging/logOutput.cpp 2017-06-16 19:47:08.375876356 -0400 +++ new/src/share/vm/logging/logOutput.cpp 2017-06-16 19:47:08.247869961 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 "logging/logOutput.hpp" #include "logging/logTagSet.hpp" #include "memory/allocation.inline.hpp" +#include "prims/jvm.h" #include "runtime/mutexLocker.hpp" #include "runtime/os.inline.hpp" --- old/src/share/vm/logging/logTagSet.cpp 2017-06-16 19:47:08.919903568 -0400 +++ new/src/share/vm/logging/logTagSet.cpp 2017-06-16 19:47:08.791897165 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 "logging/logTagSet.hpp" #include "logging/logTagSetDescriptions.hpp" #include "memory/allocation.inline.hpp" +#include "prims/jvm.h" #include "utilities/ostream.hpp" LogTagSet* LogTagSet::_list = NULL; --- old/src/share/vm/memory/filemap.cpp 2017-06-16 19:47:09.467930985 -0400 +++ new/src/share/vm/memory/filemap.cpp 2017-06-16 19:47:09.335924382 -0400 @@ -38,6 +38,7 @@ #include "memory/metadataFactory.hpp" #include "memory/oopFactory.hpp" #include "oops/objArrayOop.hpp" +#include "prims/jvm.h" #include "prims/jvmtiExport.hpp" #include "runtime/arguments.hpp" #include "runtime/java.hpp" --- old/src/share/vm/memory/metaspaceShared.cpp 2017-06-16 19:47:10.031959199 -0400 +++ new/src/share/vm/memory/metaspaceShared.cpp 2017-06-16 19:47:09.899952594 -0400 @@ -49,6 +49,7 @@ #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" #include "oops/typeArrayKlass.hpp" +#include "prims/jvm.h" #include "runtime/timerTrace.hpp" #include "runtime/os.hpp" #include "runtime/signature.hpp" --- old/src/share/vm/memory/universe.cpp 2017-06-16 19:47:10.591987216 -0400 +++ new/src/share/vm/memory/universe.cpp 2017-06-16 19:47:10.459980612 -0400 @@ -73,7 +73,9 @@ #include "runtime/vm_operations.hpp" #include "services/memoryService.hpp" #include "utilities/copy.hpp" +#include "utilities/debug.hpp" #include "utilities/events.hpp" +#include "utilities/formatBuffer.hpp" #include "utilities/hashtable.inline.hpp" #include "utilities/macros.hpp" #include "utilities/ostream.hpp" --- old/src/share/vm/oops/constantPool.cpp 2017-06-16 19:47:11.152015230 -0400 +++ new/src/share/vm/oops/constantPool.cpp 2017-06-16 19:47:11.020008632 -0400 @@ -39,6 +39,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "runtime/fieldType.hpp" #include "runtime/init.hpp" #include "runtime/javaCalls.hpp" --- old/src/share/vm/oops/generateOopMap.cpp 2017-06-16 19:47:11.716043453 -0400 +++ new/src/share/vm/oops/generateOopMap.cpp 2017-06-16 19:47:11.588037049 -0400 @@ -28,6 +28,7 @@ #include "oops/generateOopMap.hpp" #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" +#include "prims/jvm.h" #include "runtime/handles.inline.hpp" #include "runtime/java.hpp" #include "runtime/relocator.hpp" --- old/src/share/vm/oops/instanceKlass.cpp 2017-06-16 19:47:12.296072468 -0400 +++ new/src/share/vm/oops/instanceKlass.cpp 2017-06-16 19:47:12.160065658 -0400 @@ -57,6 +57,7 @@ #include "oops/method.hpp" #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" +#include "prims/jvm.h" #include "prims/jvmtiExport.hpp" #include "prims/jvmtiRedefineClasses.hpp" #include "prims/jvmtiThreadState.hpp" --- old/src/share/vm/oops/klassVtable.cpp 2017-06-16 19:47:12.880101677 -0400 +++ new/src/share/vm/oops/klassVtable.cpp 2017-06-16 19:47:12.752095273 -0400 @@ -35,6 +35,7 @@ #include "oops/method.hpp" #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "runtime/arguments.hpp" #include "runtime/handles.inline.hpp" #include "utilities/copy.hpp" --- old/src/share/vm/prims/jniCheck.cpp 2017-06-16 19:47:13.432129291 -0400 +++ new/src/share/vm/prims/jniCheck.cpp 2017-06-16 19:47:13.304122895 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. * 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/symbol.hpp" #include "prims/jni.h" #include "prims/jniCheck.hpp" +#include "prims/jvm.h" #include "prims/jvm_misc.hpp" #include "runtime/fieldDescriptor.hpp" #include "runtime/handles.hpp" --- old/src/share/vm/prims/methodHandles.hpp 2017-06-16 19:47:13.996157516 -0400 +++ new/src/share/vm/prims/methodHandles.hpp 2017-06-16 19:47:13.868151107 -0400 @@ -27,6 +27,7 @@ #include "classfile/javaClasses.hpp" #include "classfile/vmSymbols.hpp" +#include "prims/jvm.h" #include "runtime/frame.inline.hpp" #include "runtime/globals.hpp" #include "runtime/interfaceSupport.hpp" --- old/src/share/vm/runtime/arguments.cpp 2017-06-16 19:47:14.536184522 -0400 +++ new/src/share/vm/runtime/arguments.cpp 2017-06-16 19:47:14.404177920 -0400 @@ -39,6 +39,7 @@ #include "memory/allocation.inline.hpp" #include "memory/universe.inline.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "prims/jvmtiExport.hpp" #include "runtime/arguments.hpp" #include "runtime/arguments_ext.hpp" --- old/src/share/vm/runtime/commandLineFlagRangeList.cpp 2017-06-16 19:47:15.136214538 -0400 +++ new/src/share/vm/runtime/commandLineFlagRangeList.cpp 2017-06-16 19:47:15.008208142 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 "classfile/stringTable.hpp" #include "classfile/symbolTable.hpp" #include "gc/shared/referenceProcessor.hpp" +#include "prims/jvm.h" #include "runtime/arguments.hpp" #include "runtime/commandLineFlagConstraintList.hpp" #include "runtime/commandLineFlagRangeList.hpp" --- old/src/share/vm/runtime/deoptimization.cpp 2017-06-16 19:47:15.676241554 -0400 +++ new/src/share/vm/runtime/deoptimization.cpp 2017-06-16 19:47:15.548235151 -0400 @@ -40,6 +40,7 @@ #include "oops/oop.inline.hpp" #include "oops/fieldStreams.hpp" #include "oops/verifyOopClosure.hpp" +#include "prims/jvm.h" #include "prims/jvmtiThreadState.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/compilationPolicy.hpp" --- old/src/share/vm/runtime/frame.cpp 2017-06-16 19:47:16.248270168 -0400 +++ new/src/share/vm/runtime/frame.cpp 2017-06-16 19:47:16.120263772 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,9 @@ #include "runtime/stubCodeGenerator.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/thread.inline.hpp" +#include "utilities/debug.hpp" #include "utilities/decoder.hpp" +#include "utilities/formatBuffer.hpp" RegisterMap::RegisterMap(JavaThread *thread, bool update_map) { _thread = thread; --- old/src/share/vm/runtime/globals.cpp 2017-06-16 19:47:16.804297984 -0400 +++ new/src/share/vm/runtime/globals.cpp 2017-06-16 19:47:16.672291382 -0400 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "runtime/arguments.hpp" #include "runtime/globals.hpp" #include "runtime/globals_extension.hpp" --- old/src/share/vm/runtime/globals.hpp 2017-06-16 19:47:17.432329406 -0400 +++ new/src/share/vm/runtime/globals.hpp 2017-06-16 19:47:17.292322397 -0400 @@ -25,7 +25,7 @@ #ifndef SHARE_VM_RUNTIME_GLOBALS_HPP #define SHARE_VM_RUNTIME_GLOBALS_HPP -#include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" #include // for DBL_MAX --- old/src/share/vm/runtime/java.cpp 2017-06-16 19:47:18.040359822 -0400 +++ new/src/share/vm/runtime/java.cpp 2017-06-16 19:47:17.912353413 -0400 @@ -48,6 +48,7 @@ #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" +#include "prims/jvm.h" #include "prims/jvmtiExport.hpp" #include "runtime/arguments.hpp" #include "runtime/biasedLocking.hpp" --- old/src/share/vm/runtime/perfData.cpp 2017-06-16 19:47:18.592387431 -0400 +++ new/src/share/vm/runtime/perfData.cpp 2017-06-16 19:47:18.460380828 -0400 @@ -26,6 +26,7 @@ #include "classfile/vmSymbols.hpp" #include "logging/log.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "runtime/handles.inline.hpp" #include "runtime/java.hpp" #include "runtime/mutex.hpp" --- old/src/share/vm/runtime/perfMemory.cpp 2017-06-16 19:47:19.140414844 -0400 +++ new/src/share/vm/runtime/perfMemory.cpp 2017-06-16 19:47:19.012408447 -0400 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "logging/log.hpp" #include "memory/allocation.inline.hpp" +#include "prims/jvm.h" #include "runtime/arguments.hpp" #include "runtime/java.hpp" #include "runtime/mutex.hpp" --- old/src/share/vm/runtime/sharedRuntime.cpp 2017-06-16 19:47:19.692442465 -0400 +++ new/src/share/vm/runtime/sharedRuntime.cpp 2017-06-16 19:47:19.556435655 -0400 @@ -45,6 +45,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" #include "prims/forte.hpp" +#include "prims/jvm.h" #include "prims/jvmtiExport.hpp" #include "prims/methodHandles.hpp" #include "prims/nativeLookup.hpp" --- old/src/share/vm/runtime/thread.cpp 2017-06-16 19:47:20.284472080 -0400 +++ new/src/share/vm/runtime/thread.cpp 2017-06-16 19:47:20.148465277 -0400 @@ -50,6 +50,7 @@ #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" #include "oops/verifyOopClosure.hpp" +#include "prims/jvm.h" #include "prims/jvm_misc.hpp" #include "prims/jvmtiExport.hpp" #include "prims/jvmtiThreadState.hpp" --- old/src/share/vm/services/attachListener.cpp 2017-06-16 19:47:20.892502491 -0400 +++ new/src/share/vm/services/attachListener.cpp 2017-06-16 19:47:20.760495892 -0400 @@ -38,6 +38,8 @@ #include "services/diagnosticCommand.hpp" #include "services/heapDumper.hpp" #include "services/writeableFlags.hpp" +#include "utilities/debug.hpp" +#include "utilities/formatBuffer.hpp" volatile bool AttachListener::_initialized; --- old/src/share/vm/services/diagnosticArgument.cpp 2017-06-16 19:47:21.432529503 -0400 +++ new/src/share/vm/services/diagnosticArgument.cpp 2017-06-16 19:47:21.304523099 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "runtime/thread.hpp" #include "services/diagnosticArgument.hpp" --- old/src/share/vm/services/diagnosticCommand.cpp 2017-06-16 19:47:21.980556922 -0400 +++ new/src/share/vm/services/diagnosticCommand.cpp 2017-06-16 19:47:21.848550319 -0400 @@ -30,6 +30,7 @@ #include "gc/shared/vmGCOperations.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "runtime/globals.hpp" #include "runtime/javaCalls.hpp" #include "runtime/os.hpp" @@ -39,6 +40,8 @@ #include "services/heapDumper.hpp" #include "services/management.hpp" #include "services/writeableFlags.hpp" +#include "utilities/debug.hpp" +#include "utilities/formatBuffer.hpp" #include "utilities/macros.hpp" #include "oops/objArrayOop.inline.hpp" --- old/src/share/vm/services/diagnosticFramework.cpp 2017-06-16 19:47:22.532584537 -0400 +++ new/src/share/vm/services/diagnosticFramework.cpp 2017-06-16 19:47:22.404578129 -0400 @@ -26,6 +26,7 @@ #include "memory/oopFactory.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "runtime/javaCalls.hpp" #include "runtime/mutexLocker.hpp" #include "services/diagnosticArgument.hpp" --- old/src/share/vm/services/heapDumper.cpp 2017-06-16 19:47:23.084612150 -0400 +++ new/src/share/vm/services/heapDumper.cpp 2017-06-16 19:47:22.952605541 -0400 @@ -34,6 +34,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "runtime/javaCalls.hpp" #include "runtime/jniHandles.hpp" #include "runtime/os.hpp" --- old/src/share/vm/services/management.cpp 2017-06-16 19:47:23.660640960 -0400 +++ new/src/share/vm/services/management.cpp 2017-06-16 19:47:23.528634357 -0400 @@ -56,6 +56,8 @@ #include "services/memoryService.hpp" #include "services/runtimeService.hpp" #include "services/threadService.hpp" +#include "utilities/debug.hpp" +#include "utilities/formatBuffer.hpp" #include "utilities/macros.hpp" PerfVariable* Management::_begin_vm_creation_time = NULL; --- old/src/share/vm/services/memTracker.cpp 2017-06-16 19:47:24.236669774 -0400 +++ new/src/share/vm/services/memTracker.cpp 2017-06-16 19:47:24.104663171 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "prims/jvm.h" #include "runtime/mutex.hpp" #include "services/memBaseline.hpp" #include "services/memReporter.hpp" --- old/src/share/vm/services/writeableFlags.hpp 2017-06-16 19:47:24.788697388 -0400 +++ new/src/share/vm/services/writeableFlags.hpp 2017-06-16 19:47:24.656690785 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,9 @@ #ifndef SHARE_VM_SERVICES_WRITEABLEFLAG_HPP #define SHARE_VM_SERVICES_WRITEABLEFLAG_HPP +#include "runtime/globals.hpp" +#include "utilities/formatBuffer.hpp" + class WriteableFlags : AllStatic { private: // a writeable flag setter accepting either 'jvalue' or 'char *' values --- old/src/share/vm/utilities/debug.cpp 2017-06-16 19:47:25.348725404 -0400 +++ new/src/share/vm/utilities/debug.cpp 2017-06-16 19:47:25.216718800 -0400 @@ -36,6 +36,7 @@ #include "memory/resourceArea.hpp" #include "memory/universe.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "prims/privilegedStack.hpp" #include "runtime/arguments.hpp" #include "runtime/atomic.hpp" @@ -51,6 +52,7 @@ #include "services/heapDumper.hpp" #include "utilities/defaultStream.hpp" #include "utilities/events.hpp" +#include "utilities/formatBuffer.hpp" #include "utilities/macros.hpp" #include "utilities/vmError.hpp" @@ -80,14 +82,6 @@ # endif #endif // PRODUCT -FormatBufferResource::FormatBufferResource(const char * format, ...) - : FormatBufferBase((char*)resource_allocate_bytes(FormatBufferBase::BufferSize)) { - va_list argp; - va_start(argp, format); - jio_vsnprintf(_buf, FormatBufferBase::BufferSize, format, argp); - va_end(argp); -} - ATTRIBUTE_PRINTF(1, 2) void warning(const char* format, ...) { if (PrintWarnings) { @@ -589,19 +583,17 @@ if (p->has_last_Java_frame()) { // If the last_Java_fp is set we are in C land and // can call the standard stack_trace function. -#ifdef PRODUCT p->print_stack(); } else { +#ifdef PRODUCT tty->print_cr("Cannot find the last Java frame, printing stack disabled."); #else // !PRODUCT - p->trace_stack(); - } else { frame f = os::current_frame(); RegisterMap reg_map(p); f = f.sender(®_map); tty->print("(guessing starting frame id=" PTR_FORMAT " based on current fp)\n", p2i(f.id())); p->trace_stack_from(vframe::new_vframe(&f, ®_map, p)); - pd_ps(f); + pd_ps(f); #endif // PRODUCT } @@ -765,57 +757,13 @@ tty->print_cr(" ndebug() - undo debug"); } -#endif // !PRODUCT - -void print_native_stack(outputStream* st, frame fr, Thread* t, char* buf, int buf_size) { - - // see if it's a valid frame - if (fr.pc()) { - st->print_cr("Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)"); - - int count = 0; - while (count++ < StackPrintLimit) { - fr.print_on_error(st, buf, buf_size); - st->cr(); - // Compiled code may use EBP register on x86 so it looks like - // non-walkable C frame. Use frame.sender() for java frames. - if (t && t->is_Java_thread()) { - // Catch very first native frame by using stack address. - // For JavaThread stack_base and stack_size should be set. - if (!t->on_local_stack((address)(fr.real_fp() + 1))) { - break; - } - if (fr.is_java_frame() || fr.is_native_frame() || fr.is_runtime_frame()) { - RegisterMap map((JavaThread*)t, false); // No update - fr = fr.sender(&map); - } else { - fr = os::get_sender_for_C_frame(&fr); - } - } else { - // is_first_C_frame() does only simple checks for frame pointer, - // it will pass if java compiled code has a pointer in EBP. - if (os::is_first_C_frame(&fr)) break; - fr = os::get_sender_for_C_frame(&fr); - } - } - - if (count > StackPrintLimit) { - st->print_cr("......"); - } - - st->cr(); - } -} - -#ifndef PRODUCT - extern "C" void pns(void* sp, void* fp, void* pc) { // print native stack Command c("pns"); static char buf[O_BUFLEN]; Thread* t = Thread::current_or_null(); // Call generic frame constructor (certain arguments may be ignored) frame fr(sp, fp, pc); - print_native_stack(tty, fr, t, buf, sizeof(buf)); + VMError::print_native_stack(tty, fr, t, buf, sizeof(buf)); } #endif // !PRODUCT --- old/src/share/vm/utilities/debug.hpp 2017-06-16 19:47:25.964756218 -0400 +++ new/src/share/vm/utilities/debug.hpp 2017-06-16 19:47:25.832749615 -0400 @@ -25,97 +25,11 @@ #ifndef SHARE_VM_UTILITIES_DEBUG_HPP #define SHARE_VM_UTILITIES_DEBUG_HPP -#include "utilities/globalDefinitions.hpp" -#include "prims/jvm.h" +#include "utilities/breakpoint.hpp" +#include "utilities/compilerWarnings.hpp" +#include "utilities/macros.hpp" -#include - -// Simple class to format the ctor arguments into a fixed-sized buffer. -class FormatBufferBase { - protected: - char* _buf; - inline FormatBufferBase(char* buf) : _buf(buf) {} - public: - static const int BufferSize = 256; - operator const char *() const { return _buf; } -}; - -// Use resource area for buffer -class FormatBufferResource : public FormatBufferBase { - public: - FormatBufferResource(const char * format, ...) ATTRIBUTE_PRINTF(2, 3); -}; - -class FormatBufferDummy {}; - -// Use stack for buffer -template -class FormatBuffer : public FormatBufferBase { - public: - inline FormatBuffer(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); - // since va_list is unspecified type (can be char*), we use FormatBufferDummy to disambiguate these constructors - inline FormatBuffer(FormatBufferDummy dummy, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0); - 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; } - - private: - FormatBuffer(const FormatBuffer &); // prevent copies - char _buffer[bufsz]; - - protected: - inline FormatBuffer(); -}; - -template -FormatBuffer::FormatBuffer(const char * format, ...) : FormatBufferBase(_buffer) { - va_list argp; - va_start(argp, format); - jio_vsnprintf(_buf, bufsz, format, argp); - va_end(argp); -} - -template -FormatBuffer::FormatBuffer(FormatBufferDummy dummy, const char * format, va_list ap) : FormatBufferBase(_buffer) { - jio_vsnprintf(_buf, bufsz, format, ap); -} - -template -FormatBuffer::FormatBuffer() : FormatBufferBase(_buffer) { - _buf[0] = '\0'; -} - -template -void FormatBuffer::print(const char * format, ...) { - va_list argp; - va_start(argp, format); - jio_vsnprintf(_buf, bufsz, format, argp); - va_end(argp); -} - -template -void FormatBuffer::printv(const char * format, va_list argp) { - jio_vsnprintf(_buf, bufsz, format, argp); -} - -template -void FormatBuffer::append(const char* format, ...) { - // Given that the constructor does a vsnprintf we can assume that - // _buf is already initialized. - size_t len = strlen(_buf); - char* buf_end = _buf + len; - - va_list argp; - va_start(argp, format); - jio_vsnprintf(buf_end, bufsz - len, format, argp); - va_end(argp); -} - -// Used to format messages. -typedef FormatBuffer<> err_msg; +#include // assertions #ifndef ASSERT @@ -311,10 +225,7 @@ // for test purposes, which is not NULL and contains bits in every word NOT_PRODUCT(void* get_segfault_address();) +class frame; void pd_ps(frame f); -void pd_obfuscate_location(char *buf, size_t buflen); - -class outputStream; -void print_native_stack(outputStream* st, frame fr, Thread* t, char* buf, int buf_size); #endif // SHARE_VM_UTILITIES_DEBUG_HPP --- old/src/share/vm/utilities/elfStringTable.cpp 2017-06-16 19:47:26.508783437 -0400 +++ new/src/share/vm/utilities/elfStringTable.cpp 2017-06-16 19:47:26.380777030 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ #if !defined(_WINDOWS) && !defined(__APPLE__) #include "memory/allocation.inline.hpp" +#include "prims/jvm.h" #include "runtime/os.hpp" #include "utilities/elfStringTable.hpp" --- old/src/share/vm/utilities/events.hpp 2017-06-16 19:47:27.052810647 -0400 +++ new/src/share/vm/utilities/events.hpp 2017-06-16 19:47:26.924804242 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ #include "memory/allocation.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/thread.hpp" +#include "utilities/formatBuffer.hpp" #include "utilities/vmError.hpp" // Events and EventMark provide interfaces to log events taking place in the vm. --- old/src/share/vm/utilities/globalDefinitions.hpp 2017-06-16 19:47:27.648840458 -0400 +++ new/src/share/vm/utilities/globalDefinitions.hpp 2017-06-16 19:47:27.520834061 -0400 @@ -25,54 +25,81 @@ #ifndef SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP #define SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP -#ifdef TARGET_COMPILER_gcc -# include "utilities/globalDefinitions_gcc.hpp" -#endif -#ifdef TARGET_COMPILER_visCPP -# include "utilities/globalDefinitions_visCPP.hpp" -#endif -#ifdef TARGET_COMPILER_sparcWorks -# include "utilities/globalDefinitions_sparcWorks.hpp" -#endif -#ifdef TARGET_COMPILER_xlc -# include "utilities/globalDefinitions_xlc.hpp" -#endif +#include "utilities/macros.hpp" +#include "utilities/compilerWarnings.hpp" +#include "utilities/debug.hpp" +#include TARGET_COMPILER_HEADER(utilities/globalDefinitions) +// Defaults for macros that might be defined per compiler. #ifndef NOINLINE #define NOINLINE #endif #ifndef ALWAYSINLINE #define ALWAYSINLINE inline #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 + +// This file holds all globally used constants & types, class (forward) +// declarations and a few frequently used utility functions. + +//---------------------------------------------------------------------------------------------------- +// 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 +// the compiler-specific definitions file (e.g., globalDefinitions_gcc.hpp) + +#define BOOL_TO_STR(_b_) ((_b_) ? "true" : "false") + +// Format 32-bit quantities. +#define INT32_FORMAT "%" PRId32 +#define UINT32_FORMAT "%" PRIu32 +#define INT32_FORMAT_W(width) "%" #width PRId32 +#define UINT32_FORMAT_W(width) "%" #width PRIu32 + +#define PTR32_FORMAT "0x%08" PRIx32 +#define PTR32_FORMAT_W(width) "0x%" #width PRIx32 + +// 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 + +#define PTR64_FORMAT "0x%016" PRIx64 + +// Format jlong, if necessary +#ifndef JLONG_FORMAT +#define JLONG_FORMAT INT64_FORMAT #endif -#ifndef ATTRIBUTE_PRINTF -#define ATTRIBUTE_PRINTF(fmt, vargs) +#ifndef JULONG_FORMAT +#define JULONG_FORMAT UINT64_FORMAT #endif -#ifndef ATTRIBUTE_SCANF -#define ATTRIBUTE_SCANF(fmt, vargs) +#ifndef JULONG_FORMAT_X +#define JULONG_FORMAT_X UINT64_FORMAT_X #endif -#include "utilities/macros.hpp" +// Format pointers which change size between 32- and 64-bit. +#ifdef _LP64 +#define INTPTR_FORMAT "0x%016" PRIxPTR +#define PTR_FORMAT "0x%016" PRIxPTR +#else // !_LP64 +#define INTPTR_FORMAT "0x%08" PRIxPTR +#define PTR_FORMAT "0x%08" PRIxPTR +#endif // _LP64 -// This file holds all globally used constants & types, class (forward) -// declarations and a few frequently used utility functions. +#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 +#define INTX_FORMAT_W(width) "%" #width PRIdPTR +#define UINTX_FORMAT_W(width) "%" #width PRIuPTR //---------------------------------------------------------------------------------------------------- // Constants @@ -950,8 +977,6 @@ class CompiledRFrame; class InterpretedRFrame; -class frame; - class vframe; class javaVFrame; class interpretedVFrame; @@ -1012,11 +1037,9 @@ class methodHandle; class JavaCallArguments; -// Basic support for errors (general debug facilities not defined at this point fo the include phase) - +// Basic support for errors. extern void basic_fatal(const char* msg); - //---------------------------------------------------------------------------------------------------- // Special constants for debugging @@ -1149,35 +1172,27 @@ //* the argument must be exactly a power of 2 inline int exact_log2(intptr_t x) { - #ifdef ASSERT - if (!is_power_of_2(x)) basic_fatal("x must be a power of 2"); - #endif + assert(is_power_of_2(x), "x must be a power of 2: " INTPTR_FORMAT, x); return log2_intptr(x); } //* the argument must be exactly a power of 2 inline int exact_log2_long(jlong x) { - #ifdef ASSERT - if (!is_power_of_2_long(x)) basic_fatal("x must be a power of 2"); - #endif + assert(is_power_of_2_long(x), "x must be a power of 2: " JLONG_FORMAT, x); return log2_long(x); } // returns integer round-up to the nearest multiple of s (s must be a power of two) inline intptr_t round_to(intptr_t x, uintx s) { - #ifdef ASSERT - if (!is_power_of_2(s)) basic_fatal("s must be a power of 2"); - #endif + assert(is_power_of_2(s), "s must be a power of 2: " UINTX_FORMAT, s); const uintx m = s - 1; return mask_bits(x + m, ~m); } // returns integer round-down to the nearest multiple of s (s must be a power of two) inline intptr_t round_down(intptr_t x, uintx s) { - #ifdef ASSERT - if (!is_power_of_2(s)) basic_fatal("s must be a power of 2"); - #endif + assert(is_power_of_2(s), "s must be a power of 2: " UINTX_FORMAT, s); const uintx m = s - 1; return mask_bits(x, ~m); } @@ -1329,66 +1344,6 @@ b = tmp; } -// 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 -// the compiler-specific definitions file (e.g., globalDefinitions_gcc.hpp) - -#define BOOL_TO_STR(_b_) ((_b_) ? "true" : "false") - -// Format 32-bit quantities. -#define INT32_FORMAT "%" PRId32 -#define UINT32_FORMAT "%" PRIu32 -#define INT32_FORMAT_W(width) "%" #width PRId32 -#define UINT32_FORMAT_W(width) "%" #width PRIu32 - -#define PTR32_FORMAT "0x%08" PRIx32 -#define PTR32_FORMAT_W(width) "0x%" #width PRIx32 - -// 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 - -#define PTR64_FORMAT "0x%016" PRIx64 - -// Format jlong, if necessary -#ifndef JLONG_FORMAT -#define JLONG_FORMAT INT64_FORMAT -#endif -#ifndef JULONG_FORMAT -#define JULONG_FORMAT UINT64_FORMAT -#endif -#ifndef JULONG_FORMAT_X -#define JULONG_FORMAT_X UINT64_FORMAT_X -#endif - -// Format pointers which change size between 32- and 64-bit. -#ifdef _LP64 -#define INTPTR_FORMAT "0x%016" PRIxPTR -#define PTR_FORMAT "0x%016" PRIxPTR -#else // !_LP64 -#define INTPTR_FORMAT "0x%08" PRIxPTR -#define PTR_FORMAT "0x%08" PRIxPTR -#endif // _LP64 - -#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 -#define INTX_FORMAT_W(width) "%" #width PRIdPTR -#define UINTX_FORMAT_W(width) "%" #width PRIuPTR - - #define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0])) //---------------------------------------------------------------------------------------------------- --- old/src/share/vm/utilities/globalDefinitions_gcc.hpp 2017-06-16 19:47:28.228869472 -0400 +++ new/src/share/vm/utilities/globalDefinitions_gcc.hpp 2017-06-16 19:47:28.100863070 -0400 @@ -194,12 +194,6 @@ #endif // SOLARIS //---------------------------------------------------------------------------------------------------- -// Debugging - -#define DEBUG_EXCEPTION ::abort(); - -extern "C" void breakpoint(); -#define BREAKPOINT ::breakpoint() // checking for nanness #ifdef SOLARIS @@ -241,40 +235,6 @@ #define PRAGMA_IMPLEMENTATION #pragma implementation #define VALUE_OBJ_CLASS_SPEC -// 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) -#ifndef ATTRIBUTE_PRINTF -#define ATTRIBUTE_PRINTF(fmt,vargs) __attribute__((format(printf, fmt, vargs))) -#endif -#ifndef ATTRIBUTE_SCANF -#define ATTRIBUTE_SCANF(fmt,vargs) __attribute__((format(scanf, 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") - -// 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 -#endif - #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 95) #define TEMPLATE_TABLE_BUG #endif --- old/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp 2017-06-16 19:47:28.772896692 -0400 +++ new/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp 2017-06-16 19:47:28.644890289 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -211,12 +211,6 @@ #endif //---------------------------------------------------------------------------------------------------- -// Debugging - -#define DEBUG_EXCEPTION ::abort(); - -extern "C" void breakpoint(); -#define BREAKPOINT ::breakpoint() // checking for nanness #ifdef SOLARIS --- old/src/share/vm/utilities/globalDefinitions_visCPP.hpp 2017-06-16 19:47:29.316923905 -0400 +++ new/src/share/vm/utilities/globalDefinitions_visCPP.hpp 2017-06-16 19:47:29.188917502 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -126,16 +126,6 @@ //---------------------------------------------------------------------------------------------------- -// Debugging - -#if _WIN64 -extern "C" void breakpoint(); -#define BREAKPOINT ::breakpoint() -#else -#define BREAKPOINT __asm { int 3 } -#endif - -//---------------------------------------------------------------------------------------------------- // Checking for nanness inline int g_isnan(jfloat f) { return _isnan(f); } --- old/src/share/vm/utilities/globalDefinitions_xlc.hpp 2017-06-16 19:47:29.864951312 -0400 +++ new/src/share/vm/utilities/globalDefinitions_xlc.hpp 2017-06-16 19:47:29.732944714 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2017 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -108,12 +108,6 @@ //---------------------------------------------------------------------------------------------------- -// Debugging - -#define DEBUG_EXCEPTION ::abort(); - -extern "C" void breakpoint(); -#define BREAKPOINT ::breakpoint() // checking for nanness #ifdef AIX --- old/src/share/vm/utilities/macros.hpp 2017-06-16 19:47:30.428979527 -0400 +++ new/src/share/vm/utilities/macros.hpp 2017-06-16 19:47:30.300973128 -0400 @@ -490,12 +490,13 @@ #define CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_CPU) #define OS_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_OS) #define OS_CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, PASTE_TOKENS(INCLUDE_SUFFIX_OS, INCLUDE_SUFFIX_CPU)) +#define TARGET_COMPILER_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_TARGET_COMPILER) // Include platform dependent files. // // This macro constructs from basename and INCLUDE_SUFFIX_OS / -// INCLUDE_SUFFIX_CPU, which are set on the command line, the name of -// platform dependent files to be included. +// INCLUDE_SUFFIX_CPU / INCLUDE_SUFFIX_TARGET_COMPILER, which are set on +// the command line, the name of platform dependent files to be included. // Example: INCLUDE_SUFFIX_OS=_linux / INCLUDE_SUFFIX_CPU=_sparc // CPU_HEADER_INLINE(macroAssembler) --> macroAssembler_sparc.inline.hpp // OS_CPU_HEADER(vmStructs) --> vmStructs_linux_sparc.hpp @@ -511,6 +512,9 @@ // basename.hpp / basename.inline.hpp #define OS_CPU_HEADER(basename) XSTR(OS_CPU_HEADER_STEM(basename).hpp) #define OS_CPU_HEADER_INLINE(basename) XSTR(OS_CPU_HEADER_STEM(basename).inline.hpp) +// basename.hpp / basename.inline.hpp +#define TARGET_COMPILER_HEADER(basename) XSTR(TARGET_COMPILER_HEADER_STEM(basename).hpp) +#define TARGET_COMPILER_HEADER_INLINE(basename) XSTR(TARGET_COMPILER_HEADER_STEM(basename).inline.hpp) // To use Atomic::inc(jshort* dest) and Atomic::dec(jshort* dest), the address must be specially // aligned, such that (*dest) occupies the upper 16 bits of an aligned 32-bit word. The best way to --- old/src/share/vm/utilities/ostream.cpp 2017-06-16 19:47:30.985007346 -0400 +++ new/src/share/vm/utilities/ostream.cpp 2017-06-16 19:47:30.853000738 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "compiler/compileLog.hpp" #include "oops/oop.inline.hpp" +#include "prims/jvm.h" #include "runtime/arguments.hpp" #include "runtime/os.hpp" #include "runtime/vm_version.hpp" --- old/src/share/vm/utilities/vmError.cpp 2017-06-16 19:47:31.549035554 -0400 +++ new/src/share/vm/utilities/vmError.cpp 2017-06-16 19:47:31.417028956 -0400 @@ -29,6 +29,7 @@ #include "compiler/disassembler.hpp" #include "gc/shared/collectedHeap.hpp" #include "logging/logConfiguration.hpp" +#include "prims/jvm.h" #include "prims/whitebox.hpp" #include "runtime/arguments.hpp" #include "runtime/atomic.hpp" @@ -203,6 +204,46 @@ #endif // ZERO } +void VMError::print_native_stack(outputStream* st, frame fr, Thread* t, char* buf, int buf_size) { + + // see if it's a valid frame + if (fr.pc()) { + st->print_cr("Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)"); + + int count = 0; + while (count++ < StackPrintLimit) { + fr.print_on_error(st, buf, buf_size); + st->cr(); + // Compiled code may use EBP register on x86 so it looks like + // non-walkable C frame. Use frame.sender() for java frames. + if (t && t->is_Java_thread()) { + // Catch very first native frame by using stack address. + // For JavaThread stack_base and stack_size should be set. + if (!t->on_local_stack((address)(fr.real_fp() + 1))) { + break; + } + if (fr.is_java_frame() || fr.is_native_frame() || fr.is_runtime_frame()) { + RegisterMap map((JavaThread*)t, false); // No update + fr = fr.sender(&map); + } else { + fr = os::get_sender_for_C_frame(&fr); + } + } else { + // is_first_C_frame() does only simple checks for frame pointer, + // it will pass if java compiled code has a pointer in EBP. + if (os::is_first_C_frame(&fr)) break; + fr = os::get_sender_for_C_frame(&fr); + } + } + + if (count > StackPrintLimit) { + st->print_cr("......"); + } + + st->cr(); + } +} + static void print_oom_reasons(outputStream* st) { st->print_cr("# Possible reasons:"); st->print_cr("# The system is out of physical RAM or swap space"); --- old/src/share/vm/utilities/vmError.hpp 2017-06-16 19:47:32.113063768 -0400 +++ new/src/share/vm/utilities/vmError.hpp 2017-06-16 19:47:31.985057365 -0400 @@ -28,6 +28,7 @@ #include "utilities/globalDefinitions.hpp" class Decoder; +class frame; class VM_ReportJavaOutOfMemory; class VMError : public AllStatic { @@ -99,6 +100,12 @@ static void print_stack_trace(outputStream* st, JavaThread* jt, char* buf, int buflen, bool verbose = false); + // public for use by the internal non-product debugger. + NOT_PRODUCT(public:) + static void print_native_stack(outputStream* st, frame fr, Thread* t, + char* buf, int buf_size); + NOT_PRODUCT(private:) + static bool should_report_bug(unsigned int id) { return (id != OOM_MALLOC_ERROR) && (id != OOM_MMAP_ERROR); } --- old/test/native/logging/logTestFixture.cpp 2017-06-16 19:47:32.665091381 -0400 +++ new/test/native/logging/logTestFixture.cpp 2017-06-16 19:47:32.533084783 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 "logTestUtils.inline.hpp" #include "logging/logConfiguration.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "unittest.hpp" #include "utilities/ostream.hpp" --- old/test/native/logging/test_log.cpp 2017-06-16 19:47:33.209118594 -0400 +++ new/test/native/logging/test_log.cpp 2017-06-16 19:47:33.077111996 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 "logTestFixture.hpp" #include "logTestUtils.inline.hpp" #include "logging/log.hpp" +#include "prims/jvm.h" #include "unittest.hpp" class LogTest : public LogTestFixture { --- old/test/native/logging/test_logConfiguration.cpp 2017-06-16 19:47:33.749145608 -0400 +++ new/test/native/logging/test_logConfiguration.cpp 2017-06-16 19:47:33.617139005 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 "logging/logTag.hpp" #include "logging/logTagSet.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "unittest.hpp" #include "utilities/ostream.hpp" --- old/test/native/logging/test_logDecorators.cpp 2017-06-16 19:47:34.297173025 -0400 +++ new/test/native/logging/test_logDecorators.cpp 2017-06-16 19:47:34.169166618 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ #include "precompiled.hpp" #include "logging/logDecorators.hpp" +#include "prims/jvm.h" #include "unittest.hpp" static LogDecorators::Decorator decorator_array[] = { --- old/test/native/logging/test_logFileOutput.cpp 2017-06-16 19:47:34.841200234 -0400 +++ new/test/native/logging/test_logFileOutput.cpp 2017-06-16 19:47:34.709193631 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "logTestUtils.inline.hpp" #include "logging/logFileOutput.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "runtime/os.hpp" #include "unittest.hpp" #include "utilities/globalDefinitions.hpp" --- old/test/native/logging/test_logMessageTest.cpp 2017-06-16 19:47:35.393227845 -0400 +++ new/test/native/logging/test_logMessageTest.cpp 2017-06-16 19:47:35.265221444 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 "logTestUtils.inline.hpp" #include "logging/log.hpp" #include "logging/logMessage.hpp" +#include "prims/jvm.h" #include "unittest.hpp" #include "utilities/globalDefinitions.hpp" --- old/test/native/logging/test_logTagLevelExpression.cpp 2017-06-16 19:47:35.941255259 -0400 +++ new/test/native/logging/test_logTagLevelExpression.cpp 2017-06-16 19:47:35.809248660 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "logging/logLevel.hpp" #include "logging/logTagLevelExpression.hpp" #include "logging/logTagSet.hpp" +#include "prims/jvm.h" #include "unittest.hpp" #include "utilities/globalDefinitions.hpp" --- old/test/native/logging/test_logTagSetDescriptions.cpp 2017-06-16 19:47:36.485282476 -0400 +++ new/test/native/logging/test_logTagSetDescriptions.cpp 2017-06-16 19:47:36.357276072 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ #include "logging/logTagSet.hpp" #include "logging/logTagSetDescriptions.hpp" #include "memory/resourceArea.hpp" +#include "prims/jvm.h" #include "unittest.hpp" #include "utilities/ostream.hpp" --- old/test/native/runtime/test_arguments.cpp 2017-06-16 19:47:37.037310086 -0400 +++ new/test/native/runtime/test_arguments.cpp 2017-06-16 19:47:36.905303479 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ */ #include "precompiled.hpp" +#include "prims/jvm.h" #include "runtime/arguments.hpp" #include "unittest.hpp" #include "utilities/globalDefinitions.hpp" --- /dev/null 2017-05-19 14:48:27.437288209 -0400 +++ new/src/share/vm/utilities/breakpoint.hpp 2017-06-16 19:47:37.449330693 -0400 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +#ifndef SHARE_VM_UTILITIES_BREAKPOINT_HPP +#define SHARE_VM_UTILITIES_BREAKPOINT_HPP + +// Provide BREAKPOINT macro for requesting stop in the debugger. + +// We presently only have one non-default definition, so it's not +// worth going through the TARGET_COMPILER_HEADER() dispatch, with all +// non-visCPP files being empty. +#ifdef TARGET_COMPILER_visCPP +#ifndef _WIN64 +#define BREAKPOINT __asm { int 3 } +#endif // _WIN64 +#endif // TARGET_COMPILER_visCPP + +// If no more specific definition provided, default to calling a +// function that is defined per-platform. See also os::breakpoint(). +#ifndef BREAKPOINT +extern "C" void breakpoint(); +#define BREAKPOINT ::breakpoint() +#endif + +#endif // SHARE_VM_UTILITIES_BREAKPOINT_HPP --- /dev/null 2017-05-19 14:48:27.437288209 -0400 +++ new/src/share/vm/utilities/compilerWarnings.hpp 2017-06-16 19:47:37.953355905 -0400 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +#ifndef SHARE_VM_UTILITIES_COMPILERWARNINGS_HPP +#define SHARE_VM_UTILITIES_COMPILERWARNINGS_HPP + +// Macros related to control of compiler warnings. + +// We presently only have interesting macros here for gcc and variants, +// so it's not worth going through the TARGET_COMPILER_HEADER() dispatch, +// with all the non-gcc files being empty. +#ifdef TARGET_COMPILER_gcc + +// 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) +#ifndef ATTRIBUTE_PRINTF +#define ATTRIBUTE_PRINTF(fmt,vargs) __attribute__((format(printf, fmt, vargs))) +#endif +#ifndef ATTRIBUTE_SCANF +#define ATTRIBUTE_SCANF(fmt,vargs) __attribute__((format(scanf, fmt, vargs))) +#endif +#endif // gcc version check + +#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") + +#endif // clang/gcc version check + +#endif // TARGET_COMPILER_gcc + +// Defaults when not defined for the TARGET_COMPILER_xxx. + +#ifndef ATTRIBUTE_PRINTF +#define ATTRIBUTE_PRINTF(fmt, vargs) +#endif +#ifndef ATTRIBUTE_SCANF +#define ATTRIBUTE_SCANF(fmt, vargs) +#endif + +#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED +#define PRAGMA_FORMAT_NONLITERAL_IGNORED +#endif +#ifndef PRAGMA_FORMAT_IGNORED +#define PRAGMA_FORMAT_IGNORED +#endif + +#ifndef PRAGMA_DIAG_PUSH +#define PRAGMA_DIAG_PUSH +#endif +#ifndef PRAGMA_DIAG_POP +#define PRAGMA_DIAG_POP +#endif + +#endif // SHARE_VM_UTILITIES_COMPILERWARNINGS_HPP --- /dev/null 2017-05-19 14:48:27.437288209 -0400 +++ new/src/share/vm/utilities/formatBuffer.cpp 2017-06-16 19:47:38.465381522 -0400 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +#include "precompiled.hpp" +#include "memory/allocation.hpp" +#include "prims/jvm.h" +#include "utilities/formatBuffer.hpp" + +#include + +FormatBufferResource::FormatBufferResource(const char * format, ...) + : FormatBufferBase((char*)resource_allocate_bytes(FormatBufferBase::BufferSize)) { + va_list argp; + va_start(argp, format); + jio_vsnprintf(_buf, FormatBufferBase::BufferSize, format, argp); + va_end(argp); +} + --- /dev/null 2017-05-19 14:48:27.437288209 -0400 +++ new/src/share/vm/utilities/formatBuffer.hpp 2017-06-16 19:47:38.969406727 -0400 @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +#ifndef SHARE_VM_UTILITIES_FORMATBUFFER_HPP +#define SHARE_VM_UTILITIES_FORMATBUFFER_HPP + +#include "utilities/globalDefinitions.hpp" +#include "prims/jvm.h" +#include + +// Simple class to format the ctor arguments into a fixed-sized buffer. +class FormatBufferBase { + protected: + char* _buf; + inline FormatBufferBase(char* buf) : _buf(buf) {} + public: + static const int BufferSize = 256; + operator const char *() const { return _buf; } +}; + +// Use resource area for buffer +class FormatBufferResource : public FormatBufferBase { + public: + FormatBufferResource(const char * format, ...) ATTRIBUTE_PRINTF(2, 3); +}; + +class FormatBufferDummy {}; + +// Use stack for buffer +template +class FormatBuffer : public FormatBufferBase { + public: + inline FormatBuffer(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); + // since va_list is unspecified type (can be char*), we use FormatBufferDummy to disambiguate these constructors + inline FormatBuffer(FormatBufferDummy dummy, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0); + 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; } + + private: + FormatBuffer(const FormatBuffer &); // prevent copies + char _buffer[bufsz]; + + protected: + inline FormatBuffer(); +}; + +template +FormatBuffer::FormatBuffer(const char * format, ...) : FormatBufferBase(_buffer) { + va_list argp; + va_start(argp, format); + jio_vsnprintf(_buf, bufsz, format, argp); + va_end(argp); +} + +template +FormatBuffer::FormatBuffer(FormatBufferDummy dummy, const char * format, va_list ap) : FormatBufferBase(_buffer) { + jio_vsnprintf(_buf, bufsz, format, ap); +} + +template +FormatBuffer::FormatBuffer() : FormatBufferBase(_buffer) { + _buf[0] = '\0'; +} + +template +void FormatBuffer::print(const char * format, ...) { + va_list argp; + va_start(argp, format); + jio_vsnprintf(_buf, bufsz, format, argp); + va_end(argp); +} + +template +void FormatBuffer::printv(const char * format, va_list argp) { + jio_vsnprintf(_buf, bufsz, format, argp); +} + +template +void FormatBuffer::append(const char* format, ...) { + // Given that the constructor does a vsnprintf we can assume that + // _buf is already initialized. + size_t len = strlen(_buf); + char* buf_end = _buf + len; + + va_list argp; + va_start(argp, format); + jio_vsnprintf(buf_end, bufsz - len, format, argp); + va_end(argp); +} + +// Used to format messages. +typedef FormatBuffer<> err_msg; + +#endif // SHARE_VM_UTILITIES_FORMATBUFFER_HPP