提交 3f530dcc 编写于 作者: F fparain

Merge

...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
# needs to be set here since this Makefile doesn't include defs.make # needs to be set here since this Makefile doesn't include defs.make
OS_VENDOR:=$(shell uname -s) OS_VENDOR:=$(shell uname -s)
-include $(SPEC)
include $(GAMMADIR)/make/scm.make include $(GAMMADIR)/make/scm.make
include $(GAMMADIR)/make/altsrc.make include $(GAMMADIR)/make/altsrc.make
...@@ -247,6 +248,8 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst ...@@ -247,6 +248,8 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \ echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \ echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \
echo; \ echo; \
[ -n "$(SPEC)" ] && \
echo "include $(SPEC)"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
) > $@ ) > $@
......
...@@ -27,53 +27,57 @@ OS_VENDOR = $(shell uname -s) ...@@ -27,53 +27,57 @@ OS_VENDOR = $(shell uname -s)
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# CC, CXX & AS # CC, CXX & AS
# When cross-compiling the ALT_COMPILER_PATH points # If a SPEC is not set already, then use these defaults.
# to the cross-compilation toolset ifeq ($(SPEC),)
ifdef CROSS_COMPILE_ARCH # When cross-compiling the ALT_COMPILER_PATH points
CXX = $(ALT_COMPILER_PATH)/g++ # to the cross-compilation toolset
CC = $(ALT_COMPILER_PATH)/gcc ifdef CROSS_COMPILE_ARCH
HOSTCXX = g++ CXX = $(ALT_COMPILER_PATH)/g++
HOSTCC = gcc CC = $(ALT_COMPILER_PATH)/gcc
else ifneq ($(OS_VENDOR), Darwin) HOSTCXX = g++
CXX = g++ HOSTCC = gcc
CC = gcc else ifneq ($(OS_VENDOR), Darwin)
HOSTCXX = $(CXX) CXX = g++
HOSTCC = $(CC) CC = gcc
endif HOSTCXX = $(CXX)
HOSTCC = $(CC)
# i486 hotspot requires -mstackrealign on Darwin.
# llvm-gcc supports this in Xcode 3.2.6 and 4.0.
# gcc-4.0 supports this on earlier versions.
# Prefer llvm-gcc where available.
ifeq ($(OS_VENDOR), Darwin)
ifeq ($(origin CXX), default)
CXX = llvm-g++
endif
ifeq ($(origin CC), default)
CC = llvm-gcc
endif endif
ifeq ($(ARCH), i486) # i486 hotspot requires -mstackrealign on Darwin.
LLVM_SUPPORTS_STACKREALIGN := $(shell \ # llvm-gcc supports this in Xcode 3.2.6 and 4.0.
[ "0"`llvm-gcc -v 2>&1 | grep LLVM | sed -E "s/.*LLVM build ([0-9]+).*/\1/"` -gt "2333" ] \ # gcc-4.0 supports this on earlier versions.
&& echo true || echo false) # Prefer llvm-gcc where available.
ifeq ($(OS_VENDOR), Darwin)
ifeq ($(LLVM_SUPPORTS_STACKREALIGN), true) ifeq ($(origin CXX), default)
CXX32 ?= llvm-g++ CXX = llvm-g++
CC32 ?= llvm-gcc endif
else ifeq ($(origin CC), default)
CXX32 ?= g++-4.0 CC = llvm-gcc
CC32 ?= gcc-4.0 endif
endif
CXX = $(CXX32) ifeq ($(ARCH), i486)
CC = $(CC32) LLVM_SUPPORTS_STACKREALIGN := $(shell \
[ "0"`llvm-gcc -v 2>&1 | grep LLVM | sed -E "s/.*LLVM build ([0-9]+).*/\1/"` -gt "2333" ] \
&& echo true || echo false)
ifeq ($(LLVM_SUPPORTS_STACKREALIGN), true)
CXX32 ?= llvm-g++
CC32 ?= llvm-gcc
else
CXX32 ?= g++-4.0
CC32 ?= gcc-4.0
endif
CXX = $(CXX32)
CC = $(CC32)
endif
HOSTCXX = $(CXX)
HOSTCC = $(CC)
endif endif
HOSTCXX = $(CXX) AS = $(CC) -c -x assembler-with-cpp
HOSTCC = $(CC)
endif endif
AS = $(CC) -c -x assembler-with-cpp
# -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
# prints the numbers (e.g. "2.95", "3.2.1") # prints the numbers (e.g. "2.95", "3.2.1")
......
...@@ -25,12 +25,15 @@ ...@@ -25,12 +25,15 @@
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# CC, CXX & AS # CC, CXX & AS
CXX = CC # If a SPEC is not set already, then use these defaults.
CC = cc ifeq ($(SPEC),)
AS = $(CC) -c CXX = CC
CC = cc
HOSTCXX = $(CXX) AS = $(CC) -c
HOSTCC = $(CC)
HOSTCXX = $(CXX)
HOSTCC = $(CC)
endif
ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
ARCHFLAG/i486 = -m32 ARCHFLAG/i486 = -m32
......
...@@ -24,6 +24,11 @@ ...@@ -24,6 +24,11 @@
# The common definitions for hotspot builds. # The common definitions for hotspot builds.
# Optionally include SPEC file generated by configure.
ifneq ($(SPEC),)
include $(SPEC)
endif
# Default to verbose build logs (show all compile lines): # Default to verbose build logs (show all compile lines):
MAKE_VERBOSE=y MAKE_VERBOSE=y
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
# The makefiles are split this way so that "make foo" will run faster by not # The makefiles are split this way so that "make foo" will run faster by not
# having to read the dependency files for the vm. # having to read the dependency files for the vm.
-include $(SPEC)
include $(GAMMADIR)/make/scm.make include $(GAMMADIR)/make/scm.make
include $(GAMMADIR)/make/altsrc.make include $(GAMMADIR)/make/altsrc.make
...@@ -244,6 +245,8 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst ...@@ -244,6 +245,8 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \ echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \ echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \
echo; \ echo; \
[ -n "$(SPEC)" ] && \
echo "include $(SPEC)"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
) > $@ ) > $@
......
...@@ -25,21 +25,26 @@ ...@@ -25,21 +25,26 @@
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# CC, CXX & AS # CC, CXX & AS
# When cross-compiling the ALT_COMPILER_PATH points # If a SPEC is not set already, then use these defaults.
# to the cross-compilation toolset ifeq ($(SPEC),)
ifdef CROSS_COMPILE_ARCH # When cross-compiling the ALT_COMPILER_PATH points
CXX = $(ALT_COMPILER_PATH)/g++ # to the cross-compilation toolset
CC = $(ALT_COMPILER_PATH)/gcc ifdef CROSS_COMPILE_ARCH
HOSTCXX = g++ CXX = $(ALT_COMPILER_PATH)/g++
HOSTCC = gcc CC = $(ALT_COMPILER_PATH)/gcc
else HOSTCXX = g++
CXX = g++ HOSTCC = gcc
CC = gcc STRIP = $(ALT_COMPILER_PATH)/strip
HOSTCXX = $(CXX) else
HOSTCC = $(CC) CXX = g++
CC = gcc
HOSTCXX = $(CXX)
HOSTCC = $(CC)
STRIP = strip
endif
AS = $(CC) -c
endif endif
AS = $(CC) -c
# -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
# prints the numbers (e.g. "2.95", "3.2.1") # prints the numbers (e.g. "2.95", "3.2.1")
...@@ -261,9 +266,3 @@ endif ...@@ -261,9 +266,3 @@ endif
ifdef MINIMIZE_RAM_USAGE ifdef MINIMIZE_RAM_USAGE
CFLAGS += -DMINIMIZE_RAM_USAGE CFLAGS += -DMINIMIZE_RAM_USAGE
endif endif
ifdef CROSS_COMPILE_ARCH
STRIP = $(ALT_COMPILER_PATH)/strip
else
STRIP = strip
endif
...@@ -25,12 +25,15 @@ ...@@ -25,12 +25,15 @@
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# CC, CXX & AS # CC, CXX & AS
CXX = CC # If a SPEC is not set already, then use these defaults.
CC = cc ifeq ($(SPEC),)
AS = $(CC) -c CXX = CC
CC = cc
HOSTCXX = $(CXX) AS = $(CC) -c
HOSTCC = $(CC)
HOSTCXX = $(CXX)
HOSTCC = $(CC)
endif
ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
ARCHFLAG/i486 = -m32 ARCHFLAG/i486 = -m32
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
# The makefiles are split this way so that "make foo" will run faster by not # The makefiles are split this way so that "make foo" will run faster by not
# having to read the dependency files for the vm. # having to read the dependency files for the vm.
-include $(SPEC)
include $(GAMMADIR)/make/scm.make include $(GAMMADIR)/make/scm.make
include $(GAMMADIR)/make/altsrc.make include $(GAMMADIR)/make/altsrc.make
...@@ -237,6 +238,8 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst ...@@ -237,6 +238,8 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \ echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \ echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \
echo; \ echo; \
[ -n "$(SPEC)" ] && \
echo "include $(SPEC)"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
) > $@ ) > $@
......
...@@ -25,9 +25,13 @@ ...@@ -25,9 +25,13 @@
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# CC, CXX & AS # CC, CXX & AS
CXX = g++ # If a SPEC is not set already, then use these defaults.
CC = gcc ifeq ($(SPEC),)
AS = $(CC) -c CXX = g++
CC = gcc
AS = $(CC) -c
MCS = /usr/ccs/bin/mcs
endif
Compiler = gcc Compiler = gcc
...@@ -193,5 +197,3 @@ DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH)) ...@@ -193,5 +197,3 @@ DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),) ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
DEBUG_CFLAGS += -gstabs DEBUG_CFLAGS += -gstabs
endif endif
MCS = /usr/ccs/bin/mcs
...@@ -22,18 +22,22 @@ ...@@ -22,18 +22,22 @@
# #
# #
# Compiler-specific flags for sparcworks. # If a SPEC is not set already, then use these defaults.
ifeq ($(SPEC),)
# Compiler-specific flags for sparcworks.
CC = cc
CXX = CC
# tell make which C and C++ compilers to use # Note that this 'as' is an older version of the Sun Studio 'fbe', and will
CC = cc # use the older style options. The 'fbe' options will match 'cc' and 'CC'.
CXX = CC AS = /usr/ccs/bin/as
# Note that this 'as' is an older version of the Sun Studio 'fbe', and will NM = /usr/ccs/bin/nm
# use the older style options. The 'fbe' options will match 'cc' and 'CC'. NAWK = /bin/nawk
AS = /usr/ccs/bin/as
NM = /usr/ccs/bin/nm MCS = /usr/ccs/bin/mcs
NAWK = /bin/nawk STRIP = /usr/ccs/bin/strip
endif
REORDER_FLAG = -xF REORDER_FLAG = -xF
...@@ -557,9 +561,6 @@ else ...@@ -557,9 +561,6 @@ else
#LINK_INTO = LIBJVM #LINK_INTO = LIBJVM
endif endif
MCS = /usr/ccs/bin/mcs
STRIP = /usr/ccs/bin/strip
# Solaris platforms collect lots of redundant file-ident lines, # Solaris platforms collect lots of redundant file-ident lines,
# to the point of wasting a significant percentage of file space. # to the point of wasting a significant percentage of file space.
# (The text is stored in ELF .comment sections, contributed by # (The text is stored in ELF .comment sections, contributed by
......
...@@ -297,6 +297,10 @@ $(variantDir)\local.make: checks ...@@ -297,6 +297,10 @@ $(variantDir)\local.make: checks
@ echo BUILDARCH=$(BUILDARCH) >> $@ @ echo BUILDARCH=$(BUILDARCH) >> $@
@ echo Platform_arch=$(Platform_arch) >> $@ @ echo Platform_arch=$(Platform_arch) >> $@
@ echo Platform_arch_model=$(Platform_arch_model) >> $@ @ echo Platform_arch_model=$(Platform_arch_model) >> $@
@ echo CXX=$(CXX) >> $@
@ echo LD=$(LD) >> $@
@ echo MT=$(MT) >> $@
@ echo RC=$(RC) >> $@
@ sh $(WorkSpace)/make/windows/get_msc_ver.sh >> $@ @ sh $(WorkSpace)/make/windows/get_msc_ver.sh >> $@
checks: checkVariant checkWorkSpace checkSA checks: checkVariant checkWorkSpace checkSA
......
...@@ -23,7 +23,9 @@ ...@@ -23,7 +23,9 @@
# #
# Generic compiler settings # Generic compiler settings
!if "x$(CXX)" == "x"
CXX=cl.exe CXX=cl.exe
!endif
# CXX Flags: (these vary slightly from VC6->VS2003->VS2005 compilers) # CXX Flags: (these vary slightly from VC6->VS2003->VS2005 compilers)
# /nologo Supress copyright message at every cl.exe startup # /nologo Supress copyright message at every cl.exe startup
...@@ -183,8 +185,10 @@ BUFFEROVERFLOWLIB = bufferoverflowU.lib ...@@ -183,8 +185,10 @@ BUFFEROVERFLOWLIB = bufferoverflowU.lib
LD_FLAGS = /manifest $(LD_FLAGS) $(BUFFEROVERFLOWLIB) LD_FLAGS = /manifest $(LD_FLAGS) $(BUFFEROVERFLOWLIB)
# Manifest Tool - used in VS2005 and later to adjust manifests stored # Manifest Tool - used in VS2005 and later to adjust manifests stored
# as resources inside build artifacts. # as resources inside build artifacts.
!if "x$(MT)" == "x"
MT=mt.exe MT=mt.exe
!endif !endif
!endif
!if "$(COMPILER_NAME)" == "VS2008" !if "$(COMPILER_NAME)" == "VS2008"
PRODUCT_OPT_OPTION = /O2 /Oy- PRODUCT_OPT_OPTION = /O2 /Oy-
...@@ -194,8 +198,10 @@ GX_OPTION = /EHsc ...@@ -194,8 +198,10 @@ GX_OPTION = /EHsc
LD_FLAGS = /manifest $(LD_FLAGS) LD_FLAGS = /manifest $(LD_FLAGS)
# Manifest Tool - used in VS2005 and later to adjust manifests stored # Manifest Tool - used in VS2005 and later to adjust manifests stored
# as resources inside build artifacts. # as resources inside build artifacts.
!if "x$(MT)" == "x"
MT=mt.exe MT=mt.exe
!endif !endif
!endif
!if "$(COMPILER_NAME)" == "VS2010" !if "$(COMPILER_NAME)" == "VS2010"
PRODUCT_OPT_OPTION = /O2 /Oy- PRODUCT_OPT_OPTION = /O2 /Oy-
...@@ -205,7 +211,9 @@ GX_OPTION = /EHsc ...@@ -205,7 +211,9 @@ GX_OPTION = /EHsc
LD_FLAGS = /manifest $(LD_FLAGS) LD_FLAGS = /manifest $(LD_FLAGS)
# Manifest Tool - used in VS2005 and later to adjust manifests stored # Manifest Tool - used in VS2005 and later to adjust manifests stored
# as resources inside build artifacts. # as resources inside build artifacts.
!if "x$(MT)" == "x"
MT=mt.exe MT=mt.exe
!endif
!if "$(BUILDARCH)" == "i486" !if "$(BUILDARCH)" == "i486"
LD_FLAGS = /SAFESEH $(LD_FLAGS) LD_FLAGS = /SAFESEH $(LD_FLAGS)
!endif !endif
...@@ -225,7 +233,9 @@ FASTDEBUG_OPT_OPTION = $(DEBUG_OPT_OPTION) ...@@ -225,7 +233,9 @@ FASTDEBUG_OPT_OPTION = $(DEBUG_OPT_OPTION)
!endif !endif
# Generic linker settings # Generic linker settings
!if "x$(LD)" == "x"
LD=link.exe LD=link.exe
!endif
LD_FLAGS= $(LD_FLAGS) kernel32.lib user32.lib gdi32.lib winspool.lib \ LD_FLAGS= $(LD_FLAGS) kernel32.lib user32.lib gdi32.lib winspool.lib \
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \ comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
uuid.lib Wsock32.lib winmm.lib /nologo /machine:$(MACHINE) /opt:REF \ uuid.lib Wsock32.lib winmm.lib /nologo /machine:$(MACHINE) /opt:REF \
...@@ -237,7 +247,9 @@ LD_FLAGS= $(LD_FLAGS) psapi.lib ...@@ -237,7 +247,9 @@ LD_FLAGS= $(LD_FLAGS) psapi.lib
!endif !endif
# Resource compiler settings # Resource compiler settings
!if "x$(RC)" == "x"
RC=rc.exe RC=rc.exe
!endif
RC_FLAGS=/D "HS_VER=$(HS_VER)" \ RC_FLAGS=/D "HS_VER=$(HS_VER)" \
/D "HS_DOTVER=$(HS_DOTVER)" \ /D "HS_DOTVER=$(HS_DOTVER)" \
/D "HS_BUILD_ID=$(HS_BUILD_ID)" \ /D "HS_BUILD_ID=$(HS_BUILD_ID)" \
......
...@@ -202,3 +202,19 @@ ifeq ($(BUILD_WIN_SA), 1) ...@@ -202,3 +202,19 @@ ifeq ($(BUILD_WIN_SA), 1)
# Must pass this down to nmake. # Must pass this down to nmake.
MAKE_ARGS += BUILD_WIN_SA=1 MAKE_ARGS += BUILD_WIN_SA=1
endif endif
# Propagate compiler and tools paths from configure to nmake.
# Need to make sure they contain \\ and not /.
ifneq ($(SPEC),)
ifeq ($(USING_CYGWIN), true)
MAKE_ARGS += CXX="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(CXX)))"
MAKE_ARGS += LD="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(LD)))"
MAKE_ARGS += RC="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(RC)))"
MAKE_ARGS += MT="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(MT)))"
else
MAKE_ARGS += CXX="$(subst /,\\,$(CXX))"
MAKE_ARGS += LD="$(subst /,\\,$(LD))"
MAKE_ARGS += RC="$(subst /,\\,$(RC))"
MAKE_ARGS += MT="$(subst /,\\,$(MT))"
endif
endif
/* /*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -509,6 +509,9 @@ ...@@ -509,6 +509,9 @@
template(clear_name, "clear") \ template(clear_name, "clear") \
template(trigger_method_signature, "(ILjava/lang/management/MemoryUsage;)V") \ template(trigger_method_signature, "(ILjava/lang/management/MemoryUsage;)V") \
template(startAgent_name, "startAgent") \ template(startAgent_name, "startAgent") \
template(startRemoteAgent_name, "startRemoteManagementAgent") \
template(startLocalAgent_name, "startLocalManagementAgent") \
template(stopRemoteAgent_name, "stopRemoteManagementAgent") \
template(java_lang_management_ThreadInfo_constructor_signature, "(Ljava/lang/Thread;ILjava/lang/Object;Ljava/lang/Thread;JJJJ[Ljava/lang/StackTraceElement;)V") \ template(java_lang_management_ThreadInfo_constructor_signature, "(Ljava/lang/Thread;ILjava/lang/Object;Ljava/lang/Thread;JJJJ[Ljava/lang/StackTraceElement;)V") \
template(java_lang_management_ThreadInfo_with_locks_constructor_signature, "(Ljava/lang/Thread;ILjava/lang/Object;Ljava/lang/Thread;JJJJ[Ljava/lang/StackTraceElement;[Ljava/lang/Object;[I[Ljava/lang/Object;)V") \ template(java_lang_management_ThreadInfo_with_locks_constructor_signature, "(Ljava/lang/Thread;ILjava/lang/Object;Ljava/lang/Thread;JJJJ[Ljava/lang/StackTraceElement;[Ljava/lang/Object;[I[Ljava/lang/Object;)V") \
template(long_long_long_long_void_signature, "(JJJJ)V") \ template(long_long_long_long_void_signature, "(JJJJ)V") \
......
/* /*
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -504,17 +504,17 @@ bool ConstantPoolCacheEntry::is_interesting_method_entry(klassOop k) { ...@@ -504,17 +504,17 @@ bool ConstantPoolCacheEntry::is_interesting_method_entry(klassOop k) {
void ConstantPoolCacheEntry::print(outputStream* st, int index) const { void ConstantPoolCacheEntry::print(outputStream* st, int index) const {
// print separator // print separator
if (index == 0) tty->print_cr(" -------------"); if (index == 0) st->print_cr(" -------------");
// print entry // print entry
tty->print("%3d ("PTR_FORMAT") ", index, (intptr_t)this); st->print("%3d ("PTR_FORMAT") ", index, (intptr_t)this);
if (is_secondary_entry()) if (is_secondary_entry())
tty->print_cr("[%5d|secondary]", main_entry_index()); st->print_cr("[%5d|secondary]", main_entry_index());
else else
tty->print_cr("[%02x|%02x|%5d]", bytecode_2(), bytecode_1(), constant_pool_index()); st->print_cr("[%02x|%02x|%5d]", bytecode_2(), bytecode_1(), constant_pool_index());
tty->print_cr(" [ "PTR_FORMAT"]", (intptr_t)(oop)_f1); st->print_cr(" [ "PTR_FORMAT"]", (intptr_t)(oop)_f1);
tty->print_cr(" [ "PTR_FORMAT"]", (intptr_t)_f2); st->print_cr(" [ "PTR_FORMAT"]", (intptr_t)_f2);
tty->print_cr(" [ "PTR_FORMAT"]", (intptr_t)_flags); st->print_cr(" [ "PTR_FORMAT"]", (intptr_t)_flags);
tty->print_cr(" -------------"); st->print_cr(" -------------");
} }
void ConstantPoolCacheEntry::verify(outputStream* st) const { void ConstantPoolCacheEntry::verify(outputStream* st) const {
......
/* /*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -49,6 +49,11 @@ void DCmdRegistrant::register_dcmds(){ ...@@ -49,6 +49,11 @@ void DCmdRegistrant::register_dcmds(){
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(true, false));
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(true, false));
//Enhanced JMX Agent Support
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartRemoteDCmd>(true,false));
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartLocalDCmd>(true,false));
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStopRemoteDCmd>(true,false));
} }
#ifndef HAVE_EXTRA_DCMD #ifndef HAVE_EXTRA_DCMD
...@@ -344,3 +349,185 @@ int ThreadDumpDCmd::num_arguments() { ...@@ -344,3 +349,185 @@ int ThreadDumpDCmd::num_arguments() {
return 0; return 0;
} }
} }
// Enhanced JMX Agent support
JMXStartRemoteDCmd::JMXStartRemoteDCmd(outputStream *output, bool heap_allocated) :
DCmdWithParser(output, heap_allocated),
_config_file
("config.file",
"set com.sun.management.config.file", "STRING", false),
_jmxremote_port
("jmxremote.port",
"set com.sun.management.jmxremote.port", "STRING", false),
_jmxremote_rmi_port
("jmxremote.rmi.port",
"set com.sun.management.jmxremote.rmi.port", "STRING", false),
_jmxremote_ssl
("jmxremote.ssl",
"set com.sun.management.jmxremote.ssl", "STRING", false),
_jmxremote_registry_ssl
("jmxremote.registry.ssl",
"set com.sun.management.jmxremote.registry.ssl", "STRING", false),
_jmxremote_authenticate
("jmxremote.authenticate",
"set com.sun.management.jmxremote.authenticate", "STRING", false),
_jmxremote_password_file
("jmxremote.password.file",
"set com.sun.management.jmxremote.password.file", "STRING", false),
_jmxremote_access_file
("jmxremote.access.file",
"set com.sun.management.jmxremote.access.file", "STRING", false),
_jmxremote_login_config
("jmxremote.login.config",
"set com.sun.management.jmxremote.login.config", "STRING", false),
_jmxremote_ssl_enabled_cipher_suites
("jmxremote.ssl.enabled.cipher.suites",
"set com.sun.management.jmxremote.ssl.enabled.cipher.suite", "STRING", false),
_jmxremote_ssl_enabled_protocols
("jmxremote.ssl.enabled.protocols",
"set com.sun.management.jmxremote.ssl.enabled.protocols", "STRING", false),
_jmxremote_ssl_need_client_auth
("jmxremote.ssl.need.client.auth",
"set com.sun.management.jmxremote.need.client.auth", "STRING", false),
_jmxremote_ssl_config_file
("jmxremote.ssl.config.file",
"set com.sun.management.jmxremote.ssl_config_file", "STRING", false)
{
_dcmdparser.add_dcmd_option(&_config_file);
_dcmdparser.add_dcmd_option(&_jmxremote_port);
_dcmdparser.add_dcmd_option(&_jmxremote_rmi_port);
_dcmdparser.add_dcmd_option(&_jmxremote_ssl);
_dcmdparser.add_dcmd_option(&_jmxremote_registry_ssl);
_dcmdparser.add_dcmd_option(&_jmxremote_authenticate);
_dcmdparser.add_dcmd_option(&_jmxremote_password_file);
_dcmdparser.add_dcmd_option(&_jmxremote_access_file);
_dcmdparser.add_dcmd_option(&_jmxremote_login_config);
_dcmdparser.add_dcmd_option(&_jmxremote_ssl_enabled_cipher_suites);
_dcmdparser.add_dcmd_option(&_jmxremote_ssl_enabled_protocols);
_dcmdparser.add_dcmd_option(&_jmxremote_ssl_need_client_auth);
_dcmdparser.add_dcmd_option(&_jmxremote_ssl_config_file);
}
int JMXStartRemoteDCmd::num_arguments() {
ResourceMark rm;
JMXStartRemoteDCmd* dcmd = new JMXStartRemoteDCmd(NULL, false);
if (dcmd != NULL) {
DCmdMark mark(dcmd);
return dcmd->_dcmdparser.num_arguments();
} else {
return 0;
}
}
void JMXStartRemoteDCmd::execute(TRAPS) {
ResourceMark rm(THREAD);
HandleMark hm(THREAD);
// Load and initialize the sun.management.Agent class
// invoke startRemoteManagementAgent(string) method to start
// the remote management server.
// throw java.lang.NoSuchMethodError if the method doesn't exist
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK);
instanceKlassHandle ik (THREAD, k);
JavaValue result(T_VOID);
// Pass all command line arguments to java as key=value,...
// All checks are done on java side
int len = 0;
stringStream options;
char comma[2] = {0,0};
// Leave default values on Agent.class side and pass only
// agruments explicitly set by user. All arguments passed
// to jcmd override properties with the same name set by
// command line with -D or by managmenent.properties
// file.
#define PUT_OPTION(a) \
if ( (a).is_set() ){ \
options.print("%scom.sun.management.%s=%s", comma, (a).name(), (a).value()); \
comma[0] = ','; \
}
PUT_OPTION(_config_file);
PUT_OPTION(_jmxremote_port);
PUT_OPTION(_jmxremote_rmi_port);
PUT_OPTION(_jmxremote_ssl);
PUT_OPTION(_jmxremote_registry_ssl);
PUT_OPTION(_jmxremote_authenticate);
PUT_OPTION(_jmxremote_password_file);
PUT_OPTION(_jmxremote_access_file);
PUT_OPTION(_jmxremote_login_config);
PUT_OPTION(_jmxremote_ssl_enabled_cipher_suites);
PUT_OPTION(_jmxremote_ssl_enabled_protocols);
PUT_OPTION(_jmxremote_ssl_need_client_auth);
PUT_OPTION(_jmxremote_ssl_config_file);
#undef PUT_OPTION
Handle str = java_lang_String::create_from_str(options.as_string(), CHECK);
JavaCalls::call_static(&result, ik, vmSymbols::startRemoteAgent_name(), vmSymbols::string_void_signature(), str, CHECK);
}
JMXStartLocalDCmd::JMXStartLocalDCmd(outputStream *output, bool heap_allocated) :
DCmd(output, heap_allocated)
{
// do nothing
}
void JMXStartLocalDCmd::execute(TRAPS) {
ResourceMark rm(THREAD);
HandleMark hm(THREAD);
// Load and initialize the sun.management.Agent class
// invoke startLocalManagementAgent(void) method to start
// the local management server
// throw java.lang.NoSuchMethodError if method doesn't exist
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK);
instanceKlassHandle ik (THREAD, k);
JavaValue result(T_VOID);
JavaCalls::call_static(&result, ik, vmSymbols::startLocalAgent_name(), vmSymbols::void_method_signature(), CHECK);
}
void JMXStopRemoteDCmd::execute(TRAPS) {
ResourceMark rm(THREAD);
HandleMark hm(THREAD);
// Load and initialize the sun.management.Agent class
// invoke stopRemoteManagementAgent method to stop the
// management server
// throw java.lang.NoSuchMethodError if method doesn't exist
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK);
instanceKlassHandle ik (THREAD, k);
JavaValue result(T_VOID);
JavaCalls::call_static(&result, ik, vmSymbols::stopRemoteAgent_name(), vmSymbols::void_method_signature(), CHECK);
}
/* /*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -214,4 +214,82 @@ public: ...@@ -214,4 +214,82 @@ public:
virtual void execute(TRAPS); virtual void execute(TRAPS);
}; };
// Enhanced JMX Agent support
class JMXStartRemoteDCmd : public DCmdWithParser {
// Explicitly list all properties that could be
// passed to Agent.startRemoteManagementAgent()
// com.sun.management is omitted
DCmdArgument<char *> _config_file;
DCmdArgument<char *> _jmxremote_port;
DCmdArgument<char *> _jmxremote_rmi_port;
DCmdArgument<char *> _jmxremote_ssl;
DCmdArgument<char *> _jmxremote_registry_ssl;
DCmdArgument<char *> _jmxremote_authenticate;
DCmdArgument<char *> _jmxremote_password_file;
DCmdArgument<char *> _jmxremote_access_file;
DCmdArgument<char *> _jmxremote_login_config;
DCmdArgument<char *> _jmxremote_ssl_enabled_cipher_suites;
DCmdArgument<char *> _jmxremote_ssl_enabled_protocols;
DCmdArgument<char *> _jmxremote_ssl_need_client_auth;
DCmdArgument<char *> _jmxremote_ssl_config_file;
public:
JMXStartRemoteDCmd(outputStream *output, bool heap_allocated);
static const char *name() {
return "ManagementAgent.start";
}
static const char *description() {
return "Start remote management agent.";
}
static int num_arguments();
virtual void execute(TRAPS);
};
class JMXStartLocalDCmd : public DCmd {
// Explicitly request start of local agent,
// it will not be started by start dcmd
public:
JMXStartLocalDCmd(outputStream *output, bool heap_allocated);
static const char *name() {
return "ManagementAgent.start_local";
}
static const char *description() {
return "Start local management agent.";
}
virtual void execute(TRAPS);
};
class JMXStopRemoteDCmd : public DCmd {
public:
JMXStopRemoteDCmd(outputStream *output, bool heap_allocated) :
DCmd(output, heap_allocated) {
// Do Nothing
}
static const char *name() {
return "ManagementAgent.stop";
}
static const char *description() {
return "Stop remote management agent.";
}
virtual void execute(TRAPS);
};
#endif // SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP #endif // SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册