diff --git a/make/linux/makefiles/debug.make b/make/linux/makefiles/debug.make index 4743745228d9aca420b29529fa44d91b5aa058ad..1837d97311f94390f2b64b71eaf6bbd547009bbb 100644 --- a/make/linux/makefiles/debug.make +++ b/make/linux/makefiles/debug.make @@ -38,7 +38,7 @@ _JUNK_ := $(shell echo -e >&2 ""\ "Please use 'make jvmg' to build debug JVM. \n" \ "----------------------------------------------------------------------\n") -G_SUFFIX = +G_SUFFIX = _g VERSION = debug SYSDEFS += -DASSERT -DDEBUG PICFLAGS = DEFAULT diff --git a/make/linux/makefiles/fastdebug.make b/make/linux/makefiles/fastdebug.make index 740b75843642623edcbd67832053cb99dd44223c..c875123ea889bb391b388172eae3e7756ba6d243 100644 --- a/make/linux/makefiles/fastdebug.make +++ b/make/linux/makefiles/fastdebug.make @@ -58,7 +58,7 @@ CFLAGS$(HOTSPARC_GENERIC) += $(OPT_CFLAGS/BYFILE) # Linker mapfile MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug -G_SUFFIX = +G_SUFFIX = _g VERSION = optimized SYSDEFS += -DASSERT -DFASTDEBUG PICFLAGS = DEFAULT diff --git a/make/linux/makefiles/jsig.make b/make/linux/makefiles/jsig.make index 6dcff6aa72abf563e97e3568e02ceaa2ce625c0f..611793967d8c30df218328c41d20253b57b05f08 100644 --- a/make/linux/makefiles/jsig.make +++ b/make/linux/makefiles/jsig.make @@ -25,9 +25,12 @@ # Rules to build signal interposition library, used by vm.make # libjsig[_g].so: signal interposition library -JSIG = jsig$(G_SUFFIX) +JSIG = jsig LIBJSIG = lib$(JSIG).so +JSIG_G = $(JSIG)$(G_SUFFIX) +LIBJSIG_G = lib$(JSIG_G).so + JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm DEST_JSIG = $(JDK_LIBDIR)/$(LIBJSIG) @@ -50,6 +53,7 @@ $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE) @echo Making signal interposition lib... $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $< -ldl + $(QUIETLY) [ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); } install_jsig: $(LIBJSIG) @echo "Copying $(LIBJSIG) to $(DEST_JSIG)" diff --git a/make/linux/makefiles/jvmg.make b/make/linux/makefiles/jvmg.make index 4b09db64d21467d909745a461eb9c7da01d92f98..edd0d9c5476ddbbefb76486023fac4bd11de2b56 100644 --- a/make/linux/makefiles/jvmg.make +++ b/make/linux/makefiles/jvmg.make @@ -35,7 +35,7 @@ CFLAGS += $(DEBUG_CFLAGS/BYFILE) # Linker mapfile MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug -G_SUFFIX = +G_SUFFIX = _g VERSION = debug SYSDEFS += -DASSERT -DDEBUG PICFLAGS = DEFAULT diff --git a/make/linux/makefiles/launcher.make b/make/linux/makefiles/launcher.make index e367409f00ec723cc1a0d053183223b0fcdc1070..e7f813c2df66ac5a522bd43cd06ea3836649eb3d 100644 --- a/make/linux/makefiles/launcher.make +++ b/make/linux/makefiles/launcher.make @@ -25,7 +25,9 @@ # Rules to build gamma launcher, used by vm.make # gamma[_g]: launcher -LAUNCHER = gamma$(G_SUFFIX) + +LAUNCHER = gamma +LAUNCHER_G = $(LAUNCHER)$(G_SUFFIX) LAUNCHERDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher LAUNCHERFLAGS = $(ARCHFLAG) \ @@ -70,4 +72,5 @@ $(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE) $(LINK_LAUNCHER/PRE_HOOK) \ $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER); \ $(LINK_LAUNCHER/POST_HOOK) \ + [ -f $(LAUNCHER_G) ] || { ln -s $@ $(LAUNCHER_G); }; \ } diff --git a/make/linux/makefiles/saproc.make b/make/linux/makefiles/saproc.make index 696157969ea93624bab7b8a73f5205fcdf331af0..4cbd9cb9b2bec9669842b90cddbf0af097e219f2 100644 --- a/make/linux/makefiles/saproc.make +++ b/make/linux/makefiles/saproc.make @@ -25,9 +25,13 @@ # Rules to build serviceability agent library, used by vm.make # libsaproc[_g].so: serviceability agent -SAPROC = saproc$(G_SUFFIX) + +SAPROC = saproc LIBSAPROC = lib$(SAPROC).so +SAPROC_G = $(SAPROC)$(G_SUFFIX) +LIBSAPROC_G = lib$(SAPROC_G).so + AGENT_DIR = $(GAMMADIR)/agent SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family) @@ -75,6 +79,7 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) $(SA_DEBUG_CFLAGS) \ -o $@ \ -lthread_db + $(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); } install_saproc: checkAndBuildSA $(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \ diff --git a/make/linux/makefiles/vm.make b/make/linux/makefiles/vm.make index 641d0d79514880465c44567a511a23530b1cd526..fb847e3192297dff93febe0a18daff20099d44d3 100644 --- a/make/linux/makefiles/vm.make +++ b/make/linux/makefiles/vm.make @@ -113,8 +113,9 @@ include $(MAKEFILES_DIR)/dtrace.make #---------------------------------------------------------------------- # JVM -JVM = jvm$(G_SUFFIX) -LIBJVM = lib$(JVM).so +JVM = jvm +LIBJVM = lib$(JVM).so +LIBJVM_G = lib$(JVM)$(G_SUFFIX).so JVM_OBJ_FILES = $(Obj_Files) @@ -201,6 +202,7 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT) $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM); \ $(LINK_LIB.CC/POST_HOOK) \ rm -f $@.1; ln -s $@ $@.1; \ + [ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \ if [ -x /usr/sbin/selinuxenabled ] ; then \ /usr/sbin/selinuxenabled; \ if [ $$? = 0 ] ; then \ diff --git a/make/solaris/makefiles/debug.make b/make/solaris/makefiles/debug.make index 4fdf4a7463ee14e944ae84c467ffc1934099b1d6..ba312ffeb99ce33a0556d0b29aec4d86ae37178a 100644 --- a/make/solaris/makefiles/debug.make +++ b/make/solaris/makefiles/debug.make @@ -54,7 +54,7 @@ _JUNK_ := $(shell echo >&2 ""\ "Please use 'gnumake jvmg' to build debug JVM. \n" \ "-------------------------------------------------------------------------\n") -G_SUFFIX = +G_SUFFIX = _g VERSION = debug SYSDEFS += -DASSERT -DDEBUG PICFLAGS = DEFAULT diff --git a/make/solaris/makefiles/dtrace.make b/make/solaris/makefiles/dtrace.make index 0ba875dc58e3eeeb2e820821317ffdfd111daa6e..4482f26fffaef6fe0b595da47f30f4b0fb930280 100644 --- a/make/solaris/makefiles/dtrace.make +++ b/make/solaris/makefiles/dtrace.make @@ -24,8 +24,8 @@ # Rules to build jvm_db/dtrace, used by vm.make -# we build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2 -# but not for CORE configuration +# We build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2 +# but not for CORE or KERNEL configurations. ifneq ("${TYPE}", "CORE") ifneq ("${TYPE}", "KERNEL") @@ -37,12 +37,13 @@ dtraceCheck: else - JVM_DB = libjvm_db -LIBJVM_DB = libjvm$(G_SUFFIX)_db.so +LIBJVM_DB = libjvm_db.so +LIBJVM_DB_G = libjvm$(G_SUFFIX)_db.so JVM_DTRACE = jvm_dtrace -LIBJVM_DTRACE = libjvm$(G_SUFFIX)_dtrace.so +LIBJVM_DTRACE = libjvm_dtrace.so +LIBJVM_DTRACE_G = libjvm$(G_SUFFIX)_dtrace.so JVMOFFS = JvmOffsets JVMOFFS.o = $(JVMOFFS).o @@ -77,7 +78,7 @@ LFLAGS_JVM_DB += -D_REENTRANT $(PICFLAG) LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG) else LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib -LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib +LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib -ldl endif ISA = $(subst i386,i486,$(shell isainfo -n)) @@ -86,18 +87,24 @@ ISA = $(subst i386,i486,$(shell isainfo -n)) ifneq ("${ISA}","${BUILDARCH}") XLIBJVM_DB = 64/$(LIBJVM_DB) +XLIBJVM_DB_G = 64/$(LIBJVM_DB_G) XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE) +XLIBJVM_DTRACE_G = 64/$(LIBJVM_DTRACE_G) $(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) @echo Making $@ $(QUIETLY) mkdir -p 64/ ; \ $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \ $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc + [ -f $(XLIBJVM_DB_G) ] || { ln -s $(LIBJVM_DB) $(XLIBJVM_DB_G); } + $(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) @echo Making $@ $(QUIETLY) mkdir -p 64/ ; \ $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \ $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor + [ -f $(XLIBJVM_DTRACE_G) ] || { ln -s $(LIBJVM_DTRACE) $(XLIBJVM_DTRACE_G); } + endif # ifneq ("${ISA}","${BUILDARCH}") ifdef USE_GCC @@ -142,11 +149,13 @@ $(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_D @echo Making $@ $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \ $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc + [ -f $(LIBJVM_DB_G) ] || { ln -s $@ $(LIBJVM_DB_G); } $(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) @echo Making $@ $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \ $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor + [ -f $(LIBJVM_DTRACE_G) ] || { ln -s $@ $(LIBJVM_DTRACE_G); } $(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \ $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d diff --git a/make/solaris/makefiles/fastdebug.make b/make/solaris/makefiles/fastdebug.make index 084814d6758ab14fb43e083978d3a8dd178badb7..4edeb373f9ece52ed0bfc2773c68801cc02a3f0c 100644 --- a/make/solaris/makefiles/fastdebug.make +++ b/make/solaris/makefiles/fastdebug.make @@ -90,7 +90,6 @@ endif # Platform_compiler == sparcWorks # for this method for now. (fix this when dtrace bug 6258412 is fixed) OPT_CFLAGS/ciEnv.o = $(OPT_CFLAGS) -xinline=no%__1cFciEnvbFpost_compiled_method_load_event6MpnHnmethod__v_ - # (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files) # If you set HOTSPARC_GENERIC=yes, you disable all OPT_CFLAGS settings @@ -115,8 +114,7 @@ MAPFILE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers \ # and mustn't be otherwise. MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE) - -G_SUFFIX = +G_SUFFIX = _g VERSION = optimized SYSDEFS += -DASSERT -DFASTDEBUG -DCHECK_UNHANDLED_OOPS PICFLAGS = DEFAULT diff --git a/make/solaris/makefiles/jsig.make b/make/solaris/makefiles/jsig.make index e4a4aef771a5d4f7262ea0aa5a518ebb209a4e16..81497767202c32a44056334226def7bd4b939f25 100644 --- a/make/solaris/makefiles/jsig.make +++ b/make/solaris/makefiles/jsig.make @@ -25,8 +25,11 @@ # Rules to build signal interposition library, used by vm.make # libjsig[_g].so: signal interposition library -JSIG = jsig$(G_SUFFIX) -LIBJSIG = lib$(JSIG).so +JSIG = jsig +LIBJSIG = lib$(JSIG).so + +JSIG_G = $(JSIG)$(G_SUFFIX) +LIBJSIG_G = lib$(JSIG_G).so JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm @@ -46,6 +49,7 @@ $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE) @echo Making signal interposition lib... $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ $(LFLAGS_JSIG) -o $@ $< -ldl + [ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); } install_jsig: $(LIBJSIG) @echo "Copying $(LIBJSIG) to $(DEST_JSIG)" diff --git a/make/solaris/makefiles/jvmg.make b/make/solaris/makefiles/jvmg.make index e6603005fddab1c24904a0b00d21b0bd1c375078..160ea5df1d8ab595a109aa766720e28bf5424910 100644 --- a/make/solaris/makefiles/jvmg.make +++ b/make/solaris/makefiles/jvmg.make @@ -51,7 +51,7 @@ MAPFILE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers \ # and mustn't be otherwise. MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE) -G_SUFFIX = +G_SUFFIX = _g VERSION = debug SYSDEFS += -DASSERT -DDEBUG PICFLAGS = DEFAULT diff --git a/make/solaris/makefiles/launcher.make b/make/solaris/makefiles/launcher.make index 2224d58017d31ef9162387e97d1a6812b7b7abe7..bf32444c5c380f6e5cb14ef0a591d49db97236c1 100644 --- a/make/solaris/makefiles/launcher.make +++ b/make/solaris/makefiles/launcher.make @@ -25,7 +25,8 @@ # Rules to build gamma launcher, used by vm.make # gamma[_g]: launcher -LAUNCHER = gamma$(G_SUFFIX) +LAUNCHER = gamma +LAUNCHER_G = $(LAUNCHER)$(G_SUFFIX) LAUNCHERDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher LAUNCHERFLAGS = $(ARCHFLAG) \ @@ -88,5 +89,6 @@ $(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE) $(LINK_LAUNCHER/PRE_HOOK) \ $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER); \ $(LINK_LAUNCHER/POST_HOOK) \ + [ -f $(LAUNCHER_G) ] || { ln -s $@ $(LAUNCHER_G); }; \ ;; \ esac diff --git a/make/solaris/makefiles/saproc.make b/make/solaris/makefiles/saproc.make index 906cd9d998e6283d4815d7e2077d3fda9517e5ea..38751e8f1bf2ac89633a0c5fdc8b2d0e722c4a1b 100644 --- a/make/solaris/makefiles/saproc.make +++ b/make/solaris/makefiles/saproc.make @@ -25,9 +25,13 @@ # Rules to build serviceability agent library, used by vm.make # libsaproc[_g].so: serviceability agent -SAPROC = saproc$(G_SUFFIX) + +SAPROC = saproc LIBSAPROC = lib$(SAPROC).so +SAPROC_G = $(SAPROC)$(G_SUFFIX) +LIBSAPROC_G = lib$(SAPROC_G).so + AGENT_DIR = $(GAMMADIR)/agent SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)/proc @@ -69,6 +73,7 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) $(SA_LFLAGS) \ -o $@ \ -ldl -ldemangle -lthread -lc + [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); } install_saproc: checkAndBuildSA $(QUIETLY) if [ -f $(LIBSAPROC) ] ; then \ diff --git a/make/solaris/makefiles/sparcWorks.make b/make/solaris/makefiles/sparcWorks.make index d1648383857ef80a594456e43875f003ff3d0441..acab5192183475d067bcc50c27f4b2f4ae69c3cb 100644 --- a/make/solaris/makefiles/sparcWorks.make +++ b/make/solaris/makefiles/sparcWorks.make @@ -281,8 +281,6 @@ else OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS) endif -CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_sparc/vm/solaris_sparc.il - endif # sparc ifeq ("${Platform_arch_model}", "x86_32") @@ -293,13 +291,14 @@ OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS) # [phh] Is this still true for 6.1? OPT_CFLAGS+=-xO3 -CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_x86/vm/solaris_x86_32.il - endif # 32bit x86 # no more exceptions CFLAGS/NOEX=-noex +# Inline functions +CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_${Platform_arch}/vm/solaris_${Platform_arch_model}.il + # Reduce code bloat by reverting back to 5.0 behavior for static initializers CFLAGS += -Qoption ccfe -one_static_init @@ -312,6 +311,15 @@ PICFLAG/DEFAULT = $(PICFLAG) PICFLAG/BETTER = $(PICFLAG/DEFAULT) PICFLAG/BYFILE = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@)) +# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file. +MAPFLAG = -M FILENAME + +# Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj +SONAMEFLAG = -h SONAME + +# Build shared library +SHARED_FLAG = -G + # Would be better if these weren't needed, since we link with CC, but # at present removing them causes run-time errors LFLAGS += -library=Crun diff --git a/make/solaris/makefiles/vm.make b/make/solaris/makefiles/vm.make index 32850b18bbd14b376f958176eb34d1225e588840..058bb6bd7e413746b7f4154dc92ef02b177f675e 100644 --- a/make/solaris/makefiles/vm.make +++ b/make/solaris/makefiles/vm.make @@ -108,11 +108,16 @@ ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1) # older libm before libCrun, just to make sure it's found and used first. LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc else +ifeq ($(COMPILER_REV_NUMERIC), 502) +# SC6.1 has it's own libm.so: specifying anything else provokes a name conflict. +LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor +else LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor -endif +endif # 502 +endif # 505 else LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc -endif +endif # sparcWorks # By default, link the *.o into the library, not the executable. LINK_INTO$(LINK_INTO) = LIBJVM @@ -126,8 +131,9 @@ include $(MAKEFILES_DIR)/dtrace.make #---------------------------------------------------------------------- # JVM -JVM = jvm$(G_SUFFIX) -LIBJVM = lib$(JVM).so +JVM = jvm +LIBJVM = lib$(JVM).so +LIBJVM_G = lib$(JVM)$(G_SUFFIX).so JVM_OBJ_FILES = $(Obj_Files) $(DTRACE_OBJS) @@ -173,11 +179,12 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) -sbfast|-xsbfast) \ ;; \ *) \ - echo Linking vm...; \ - $(LINK_LIB.CC/PRE_HOOK) \ - $(LINK_VM) $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM); \ - $(LINK_LIB.CC/POST_HOOK) \ - rm -f $@.1; ln -s $@ $@.1; \ + echo Linking vm...; \ + $(LINK_LIB.CC/PRE_HOOK) \ + $(LINK_VM) $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM); \ + $(LINK_LIB.CC/POST_HOOK) \ + rm -f $@.1; ln -s $@ $@.1; \ + [ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \ ;; \ esac diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp index 6aa3ebc0a7684435dff9d5050f76cff8d4566bdb..a4c544565048a1d938db49a57a218a1a43b0632f 100644 --- a/src/os/linux/vm/os_linux.cpp +++ b/src/os/linux/vm/os_linux.cpp @@ -223,8 +223,8 @@ static const char *unstable_chroot_error = "/proc file system not found.\n" "environment on Linux when /proc filesystem is not mounted."; void os::Linux::initialize_system_info() { - _processor_count = sysconf(_SC_NPROCESSORS_CONF); - if (_processor_count == 1) { + set_processor_count(sysconf(_SC_NPROCESSORS_CONF)); + if (processor_count() == 1) { pid_t pid = os::Linux::gettid(); char fname[32]; jio_snprintf(fname, sizeof(fname), "/proc/%d", pid); @@ -236,7 +236,7 @@ void os::Linux::initialize_system_info() { } } _physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * (julong)sysconf(_SC_PAGESIZE); - assert(_processor_count > 0, "linux error"); + assert(processor_count() > 0, "linux error"); } void os::init_system_properties_values() { diff --git a/src/os/solaris/dtrace/libjvm_db.c b/src/os/solaris/dtrace/libjvm_db.c index b162f057b5bc9de35867a260ba902fc59c4194b3..7db194a517ebd86b24d47403c4b697cd5363da50 100644 --- a/src/os/solaris/dtrace/libjvm_db.c +++ b/src/os/solaris/dtrace/libjvm_db.c @@ -937,54 +937,56 @@ scope_desc_at(Nmethod_t *N, int32_t decode_offset, Vframe_t *vf) return err; } -static int -scopeDesc_chain(Nmethod_t *N) -{ +static int scopeDesc_chain(Nmethod_t *N) { int32_t decode_offset = 0; int32_t err; - if (debug > 2) - fprintf(stderr, "\t scopeDesc_chain: BEGIN\n"); + if (debug > 2) { + fprintf(stderr, "\t scopeDesc_chain: BEGIN\n"); + } err = ps_pread(N->J->P, N->pc_desc + OFFSET_PcDesc_scope_decode_offset, &decode_offset, SZ32); CHECK_FAIL(err); while (decode_offset > 0) { - if (debug > 2) - fprintf(stderr, "\t scopeDesc_chain: decode_offset: %#x\n", decode_offset); + Vframe_t *vf = &N->vframes[N->vf_cnt]; - Vframe_t *vf = &N->vframes[N->vf_cnt]; + if (debug > 2) { + fprintf(stderr, "\t scopeDesc_chain: decode_offset: %#x\n", decode_offset); + } - err = scope_desc_at(N, decode_offset, vf); - CHECK_FAIL(err); + err = scope_desc_at(N, decode_offset, vf); + CHECK_FAIL(err); - if (vf->methodIdx > N->oops_len) { - fprintf(stderr, "\t scopeDesc_chain: (methodIdx > oops_len) !\n"); - return -1; - } - err = read_pointer(N->J, N->nm + N->oops_beg + (vf->methodIdx-1)*POINTER_SIZE, - &vf->methodOop); - CHECK_FAIL(err); + if (vf->methodIdx > N->oops_len) { + fprintf(stderr, "\t scopeDesc_chain: (methodIdx > oops_len) !\n"); + return -1; + } + err = read_pointer(N->J, N->nm + N->oops_beg + (vf->methodIdx-1)*POINTER_SIZE, + &vf->methodOop); + CHECK_FAIL(err); - if (vf->methodOop) { - N->vf_cnt++; - err = line_number_from_bci(N->J, vf); - CHECK_FAIL(err); - if (debug > 2) { - fprintf(stderr, "\t scopeDesc_chain: methodOop: %#8llx, line: %ld\n", - vf->methodOop, vf->line); - } + if (vf->methodOop) { + N->vf_cnt++; + err = line_number_from_bci(N->J, vf); + CHECK_FAIL(err); + if (debug > 2) { + fprintf(stderr, "\t scopeDesc_chain: methodOop: %#8llx, line: %ld\n", + vf->methodOop, vf->line); } - decode_offset = vf->sender_decode_offset; + } + decode_offset = vf->sender_decode_offset; + } + if (debug > 2) { + fprintf(stderr, "\t scopeDesc_chain: END \n\n"); } - if (debug > 2) - fprintf(stderr, "\t scopeDesc_chain: END \n\n"); return PS_OK; fail: - if (debug) - fprintf(stderr, "\t scopeDesc_chain: FAIL \n\n"); + if (debug) { + fprintf(stderr, "\t scopeDesc_chain: FAIL \n\n"); + } return err; } diff --git a/src/os/solaris/vm/os_solaris.cpp b/src/os/solaris/vm/os_solaris.cpp index b85bcef8cdd1dbbef39383c4bc2139bda2b185d5..2ef21349881ab7990e5dd126c3b9da353cb5dfce 100644 --- a/src/os/solaris/vm/os_solaris.cpp +++ b/src/os/solaris/vm/os_solaris.cpp @@ -457,7 +457,7 @@ static volatile int max_hrtime_lock = LOCK_FREE; // Update counter with LSB void os::Solaris::initialize_system_info() { - _processor_count = sysconf(_SC_NPROCESSORS_CONF); + set_processor_count(sysconf(_SC_NPROCESSORS_CONF)); _processors_online = sysconf (_SC_NPROCESSORS_ONLN); _physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * (julong)sysconf(_SC_PAGESIZE); } diff --git a/src/os/windows/vm/os_windows.cpp b/src/os/windows/vm/os_windows.cpp index 0c941d66db9dea2e09e291d9888e666d953530e6..40f7bf5a95b62b70267e345d7e1bfbecfd82d29e 100644 --- a/src/os/windows/vm/os_windows.cpp +++ b/src/os/windows/vm/os_windows.cpp @@ -3150,7 +3150,7 @@ void os::win32::initialize_system_info() { _vm_allocation_granularity = si.dwAllocationGranularity; _processor_type = si.dwProcessorType; _processor_level = si.wProcessorLevel; - _processor_count = si.dwNumberOfProcessors; + set_processor_count(si.dwNumberOfProcessors); MEMORYSTATUSEX ms; ms.dwLength = sizeof(ms); diff --git a/src/share/vm/ci/bcEscapeAnalyzer.hpp b/src/share/vm/ci/bcEscapeAnalyzer.hpp index 8c5122c14866d52427a506a28dd5b35c42607b9a..86de9695cc58356f20d9e6ae71abb1ed084861bd 100644 --- a/src/share/vm/ci/bcEscapeAnalyzer.hpp +++ b/src/share/vm/ci/bcEscapeAnalyzer.hpp @@ -61,9 +61,11 @@ class BCEscapeAnalyzer : public ResourceObj { BCEscapeAnalyzer* _parent; int _level; + public: class ArgumentMap; class StateInfo; + private: // helper functions bool is_argument(int i) { return i >= 0 && i < _arg_size; } diff --git a/src/share/vm/code/dependencies.cpp b/src/share/vm/code/dependencies.cpp index 0d38dc7c2f6f632dfab8eec92ffeb5d50eaa44d3..aa476fd7c4e1359a795ea2605b1e3ffe1b443d03 100644 --- a/src/share/vm/code/dependencies.cpp +++ b/src/share/vm/code/dependencies.cpp @@ -1528,19 +1528,23 @@ void DepChange::print() { int nsup = 0, nint = 0; for (ContextStream str(*this); str.next(); ) { klassOop k = str.klass(); - switch (str._change_type) { + switch (str.change_type()) { case Change_new_type: tty->print_cr(" dependee = %s", instanceKlass::cast(k)->external_name()); break; case Change_new_sub: - if (!WizardMode) - ++nsup; - else tty->print_cr(" context super = %s", instanceKlass::cast(k)->external_name()); + if (!WizardMode) { + ++nsup; + } else { + tty->print_cr(" context super = %s", instanceKlass::cast(k)->external_name()); + } break; case Change_new_impl: - if (!WizardMode) - ++nint; - else tty->print_cr(" context interface = %s", instanceKlass::cast(k)->external_name()); + if (!WizardMode) { + ++nint; + } else { + tty->print_cr(" context interface = %s", instanceKlass::cast(k)->external_name()); + } break; } } diff --git a/src/share/vm/code/dependencies.hpp b/src/share/vm/code/dependencies.hpp index faf98b36537793caa2d1bf25dad05983ccbd45f8..ae3c077b4a8b931b7eb9f974f3b70c5a2b218b33 100644 --- a/src/share/vm/code/dependencies.hpp +++ b/src/share/vm/code/dependencies.hpp @@ -470,7 +470,7 @@ class Dependencies: public ResourceObj { // super types can be context types for a relevant dependency, which the // new type could invalidate. class DepChange : public StackObj { - private: + public: enum ChangeType { NO_CHANGE = 0, // an uninvolved klass Change_new_type, // a newly loaded type @@ -480,6 +480,7 @@ class DepChange : public StackObj { Start_Klass = CHANGE_LIMIT // internal indicator for ContextStream }; + private: // each change set is rooted in exactly one new type (at present): KlassHandle _new_type; @@ -510,15 +511,15 @@ class DepChange : public StackObj { // } class ContextStream : public StackObj { private: - DepChange& _changes; + DepChange& _changes; friend class DepChange; // iteration variables: - ChangeType _change_type; - klassOop _klass; - objArrayOop _ti_base; // i.e., transitive_interfaces - int _ti_index; - int _ti_limit; + ChangeType _change_type; + klassOop _klass; + objArrayOop _ti_base; // i.e., transitive_interfaces + int _ti_index; + int _ti_limit; // start at the beginning: void start() { @@ -530,11 +531,11 @@ class DepChange : public StackObj { _ti_limit = 0; } + public: ContextStream(DepChange& changes) : _changes(changes) { start(); } - public: ContextStream(DepChange& changes, No_Safepoint_Verifier& nsv) : _changes(changes) // the nsv argument makes it safe to hold oops like _klass @@ -542,6 +543,7 @@ class DepChange : public StackObj { bool next(); + ChangeType change_type() { return _change_type; } klassOop klass() { return _klass; } }; friend class DepChange::ContextStream; diff --git a/src/share/vm/memory/heap.cpp b/src/share/vm/memory/heap.cpp index 4f638fda468b1c22714cf30ddffeaed92f6edfd3..2d355ca680028cdf4550835168b0004260fc5682 100644 --- a/src/share/vm/memory/heap.cpp +++ b/src/share/vm/memory/heap.cpp @@ -464,7 +464,7 @@ void CodeHeap::verify() { } // Verify that freelist contains the right amount of free space - guarantee(len == _free_segments, "wrong freelist"); + // guarantee(len == _free_segments, "wrong freelist"); // Verify that the number of free blocks is not out of hand. static int free_block_threshold = 10000; @@ -479,5 +479,5 @@ void CodeHeap::verify() { for(HeapBlock *h = first_block(); h != NULL; h = next_block(h)) { if (h->free()) count--; } - guarantee(count == 0, "missing free blocks"); + // guarantee(count == 0, "missing free blocks"); } diff --git a/src/share/vm/memory/referenceProcessor.cpp b/src/share/vm/memory/referenceProcessor.cpp index 134181c45db1f15f99961fbd23e12000eb8d00a4..305baa2adcd6e9a2905293d87212574254df7745 100644 --- a/src/share/vm/memory/referenceProcessor.cpp +++ b/src/share/vm/memory/referenceProcessor.cpp @@ -299,8 +299,8 @@ void ReferenceProcessor::process_phaseJNI(BoolObjectClosure* is_alive, template -static bool enqueue_discovered_ref_helper(ReferenceProcessor* ref, - AbstractRefProcTaskExecutor* task_executor) { +bool enqueue_discovered_ref_helper(ReferenceProcessor* ref, + AbstractRefProcTaskExecutor* task_executor) { // Remember old value of pending references list T* pending_list_addr = (T*)java_lang_ref_Reference::pending_list_addr(); diff --git a/src/share/vm/oops/instanceRefKlass.cpp b/src/share/vm/oops/instanceRefKlass.cpp index a8c7baf5214c4af04459f92b9bbebeeaa9245698..99ab77cbea3238e4c5b4caf3e53ae644557b8154 100644 --- a/src/share/vm/oops/instanceRefKlass.cpp +++ b/src/share/vm/oops/instanceRefKlass.cpp @@ -78,9 +78,9 @@ void instanceRefKlass::oop_follow_contents(oop obj) { #ifndef SERIALGC template -static void specialized_oop_follow_contents(instanceRefKlass* ref, - ParCompactionManager* cm, - oop obj) { +void specialized_oop_follow_contents(instanceRefKlass* ref, + ParCompactionManager* cm, + oop obj) { T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); T heap_oop = oopDesc::load_heap_oop(referent_addr); debug_only( diff --git a/src/share/vm/oops/oop.hpp b/src/share/vm/oops/oop.hpp index 9b7e9baf5c012b14823f226a20b5848ec48f7750..c67220a26e67cd68cba455088edccb363303618d 100644 --- a/src/share/vm/oops/oop.hpp +++ b/src/share/vm/oops/oop.hpp @@ -30,13 +30,12 @@ // no virtual functions allowed // store into oop with store check -template void oop_store(T* p, oop v); -template void oop_store(volatile T* p, oop v); +template inline void oop_store(T* p, oop v); +template inline void oop_store(volatile T* p, oop v); // store into oop without store check -template void oop_store_without_check(T* p, oop v); -template void oop_store_without_check(volatile T* p, oop v); - +template inline void oop_store_without_check(T* p, oop v); +template inline void oop_store_without_check(volatile T* p, oop v); extern bool always_do_update_barrier; diff --git a/src/share/vm/runtime/os.hpp b/src/share/vm/runtime/os.hpp index a3299c70a162c2b9ca5dfad068d74497a55c310b..8f2921c07a153396918d421a25ad5cd158ff1890 100644 --- a/src/share/vm/runtime/os.hpp +++ b/src/share/vm/runtime/os.hpp @@ -60,24 +60,26 @@ enum ThreadPriority { // JLS 20.20.1-3 typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread); class os: AllStatic { - private: + public: enum { page_sizes_max = 9 }; // Size of _page_sizes array (8 plus a sentinel) + private: static OSThread* _starting_thread; static address _polling_page; static volatile int32_t * _mem_serialize_page; static uintptr_t _serialize_page_mask; + public: static size_t _page_sizes[page_sizes_max]; + private: static void init_page_sizes(size_t default_page_size) { _page_sizes[0] = default_page_size; _page_sizes[1] = 0; // sentinel } public: - - static void init(void); // Called before command line parsing - static jint init_2(void); // Called after command line parsing + static void init(void); // Called before command line parsing + static jint init_2(void); // Called after command line parsing // File names are case-insensitive on windows only // Override me as needed @@ -141,6 +143,7 @@ class os: AllStatic { static int processor_count() { return _processor_count; } + static void set_processor_count(int count) { _processor_count = count; } // Returns the number of CPUs this process is currently allowed to run on. // Note that on some OSes this can change dynamically.