This commit is contained in:
Tom Rodriguez 2012-03-02 09:13:13 -08:00
commit dac856d4f2
498 changed files with 6664 additions and 26780 deletions

View File

@ -147,3 +147,5 @@ e8f03541af27e38aafb619b96863e17f65ffe53b jdk8-b22
498124337041ad53cbaa7eb110f3d7acd6d4eac4 jdk8-b23
7d3720d8c595d1519c31e9ff7366203fc2c61350 jdk8-b24
0071a6d64113a35ba345bb1580c256de5ce17d3e jdk8-b25
6c805d8ed4e5449ea5e4d158c7bdbd7b0b70efd1 jdk8-b26
c51754cddc037b9609e202b9ed38363d8683e7a8 jdk8-b27

View File

@ -147,3 +147,5 @@ cc771d92284f71765eca14d6d08703c4af254c04 jdk8-b21
60d6f64a86b1e511169d264727f6d51415978df0 jdk8-b23
1a5f1d6b98d6827cdb529a4abe6e52a886d944f4 jdk8-b24
221a378e06a326f45e5d89e2123cd6323e0181d1 jdk8-b25
2accafff224ae39caf5f532c305251ba624bf2c0 jdk8-b26
1533dfab9903e4edcfead3b0192643f38c418b9b jdk8-b27

View File

@ -147,3 +147,5 @@ a11d0062c445d5f36651c78650ab88aa594bcbff jdk8-b22
5218eb256658442b62b05295aafa5b5f35252972 jdk8-b23
b98f0e6dddf987df565029a1f58417fc1844c3f3 jdk8-b24
e45d6b406d5f91ff5256a5c82456ab1e7eb8becd jdk8-b25
79f709a099f40c08f76567fa6d813f9009a69826 jdk8-b26
4fffe75e4edd39a2517f10b743941bf94edb143d jdk8-b27

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -82,6 +82,6 @@ public class DynAnyFactoryImpl
private String[] __ids = { "IDL:omg.org/DynamicAny/DynAnyFactory:1.0" };
public String[] _ids() {
return __ids;
return (String[]) __ids.clone();
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -195,6 +195,6 @@ abstract class DynAnyImpl extends org.omg.CORBA.LocalObject implements DynAny
private String[] __ids = { "IDL:omg.org/DynamicAny/DynAny:1.0" };
public String[] _ids() {
return __ids;
return (String[]) __ids.clone();
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -138,7 +138,7 @@ public abstract class _CodeBaseImplBase extends org.omg.CORBA.portable.ObjectImp
public String[] _ids ()
{
return __ids;
return (String[]) __ids.clone();
}

View File

@ -222,3 +222,7 @@ b22de824749922986ce4d442bed029916b832807 hs23-b13
d71e662fe03741b6de498ca2077220148405a978 hs23-b15
fd3060701216a11c0df6dcd053c6fd7c2b17a42c jdk8-b26
f92a171cf0071ca6c3fa8231d7d570377f8b2f4d hs23-b16
f92a171cf0071ca6c3fa8231d7d570377f8b2f4d hs23-b16
931e5f39e365a0d550d79148ff87a7f9e864d2e1 hs23-b16
3b24e7e01d20ca590d0f86b1222bb7c3f1a2aa2d jdk8-b27
975c4105f1e2ef1190a75b77124033f1fd4290b5 hs24-b01

View File

@ -648,7 +648,12 @@ public class ConstantPool extends Oop implements ClassConstants {
}
public void printValueOn(PrintStream tty) {
tty.print("ConstantPool for " + getPoolHolder().getName().asString());
Oop holder = poolHolder.getValue(this);
if (holder instanceof Klass) {
tty.print("ConstantPool for " + ((Klass)holder).getName().asString());
} else {
tty.print("ConstantPool for partially loaded class");
}
}
public long getObjectSize() {

View File

@ -58,6 +58,7 @@
# needs to be set here since this Makefile doesn't include defs.make
OS_VENDOR:=$(shell uname -s)
-include $(SPEC)
include $(GAMMADIR)/make/scm.make
include $(GAMMADIR)/make/altsrc.make
@ -247,6 +248,8 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \
echo; \
[ -n "$(SPEC)" ] && \
echo "include $(SPEC)"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
) > $@

View File

@ -27,53 +27,57 @@ OS_VENDOR = $(shell uname -s)
#------------------------------------------------------------------------
# CC, CXX & AS
# When cross-compiling the ALT_COMPILER_PATH points
# to the cross-compilation toolset
ifdef CROSS_COMPILE_ARCH
CXX = $(ALT_COMPILER_PATH)/g++
CC = $(ALT_COMPILER_PATH)/gcc
HOSTCXX = g++
HOSTCC = gcc
else ifneq ($(OS_VENDOR), Darwin)
CXX = g++
CC = gcc
HOSTCXX = $(CXX)
HOSTCC = $(CC)
# If a SPEC is not set already, then use these defaults.
ifeq ($(SPEC),)
# When cross-compiling the ALT_COMPILER_PATH points
# to the cross-compilation toolset
ifdef CROSS_COMPILE_ARCH
CXX = $(ALT_COMPILER_PATH)/g++
CC = $(ALT_COMPILER_PATH)/gcc
HOSTCXX = g++
HOSTCC = gcc
else ifneq ($(OS_VENDOR), Darwin)
CXX = g++
CC = gcc
HOSTCXX = $(CXX)
HOSTCC = $(CC)
endif
# 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
ifeq ($(ARCH), i486)
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
AS = $(CC) -c -x assembler-with-cpp
endif
# 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
ifeq ($(ARCH), i486)
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
AS = $(CC) -c -x assembler-with-cpp
# -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")

View File

@ -25,12 +25,15 @@
#------------------------------------------------------------------------
# CC, CXX & AS
CXX = CC
CC = cc
AS = $(CC) -c
# If a SPEC is not set already, then use these defaults.
ifeq ($(SPEC),)
CXX = CC
CC = cc
AS = $(CC) -c
HOSTCXX = $(CXX)
HOSTCC = $(CC)
HOSTCXX = $(CXX)
HOSTCC = $(CC)
endif
ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
ARCHFLAG/i486 = -m32

View File

@ -24,6 +24,11 @@
# 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):
MAKE_VERBOSE=y

View File

@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2011
HS_MAJOR_VER=24
HS_MINOR_VER=0
HS_BUILD_NUMBER=01
HS_BUILD_NUMBER=02
JDK_MAJOR_VER=1
JDK_MINOR_VER=8

View File

@ -55,6 +55,7 @@
# The makefiles are split this way so that "make foo" will run faster by not
# having to read the dependency files for the vm.
-include $(SPEC)
include $(GAMMADIR)/make/scm.make
include $(GAMMADIR)/make/altsrc.make
@ -244,6 +245,8 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \
echo; \
[ -n "$(SPEC)" ] && \
echo "include $(SPEC)"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
) > $@

View File

@ -25,21 +25,26 @@
#------------------------------------------------------------------------
# CC, CXX & AS
# When cross-compiling the ALT_COMPILER_PATH points
# to the cross-compilation toolset
ifdef CROSS_COMPILE_ARCH
CXX = $(ALT_COMPILER_PATH)/g++
CC = $(ALT_COMPILER_PATH)/gcc
HOSTCXX = g++
HOSTCC = gcc
else
CXX = g++
CC = gcc
HOSTCXX = $(CXX)
HOSTCC = $(CC)
# If a SPEC is not set already, then use these defaults.
ifeq ($(SPEC),)
# When cross-compiling the ALT_COMPILER_PATH points
# to the cross-compilation toolset
ifdef CROSS_COMPILE_ARCH
CXX = $(ALT_COMPILER_PATH)/g++
CC = $(ALT_COMPILER_PATH)/gcc
HOSTCXX = g++
HOSTCC = gcc
STRIP = $(ALT_COMPILER_PATH)/strip
else
CXX = g++
CC = gcc
HOSTCXX = $(CXX)
HOSTCC = $(CC)
STRIP = strip
endif
AS = $(CC) -c
endif
AS = $(CC) -c
# -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")
@ -261,9 +266,3 @@ endif
ifdef MINIMIZE_RAM_USAGE
CFLAGS += -DMINIMIZE_RAM_USAGE
endif
ifdef CROSS_COMPILE_ARCH
STRIP = $(ALT_COMPILER_PATH)/strip
else
STRIP = strip
endif

View File

@ -28,3 +28,6 @@ OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
# Must also specify if CPU is big endian
CFLAGS += -DVM_BIG_ENDIAN
ifdef E500V2
ASFLAGS += -Wa,-mspe -Wa,--defsym -Wa,E500V2=1
endif

View File

@ -25,12 +25,15 @@
#------------------------------------------------------------------------
# CC, CXX & AS
CXX = CC
CC = cc
AS = $(CC) -c
# If a SPEC is not set already, then use these defaults.
ifeq ($(SPEC),)
CXX = CC
CC = cc
AS = $(CC) -c
HOSTCXX = $(CXX)
HOSTCC = $(CC)
HOSTCXX = $(CXX)
HOSTCC = $(CC)
endif
ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
ARCHFLAG/i486 = -m32

View File

@ -55,6 +55,7 @@
# The makefiles are split this way so that "make foo" will run faster by not
# having to read the dependency files for the vm.
-include $(SPEC)
include $(GAMMADIR)/make/scm.make
include $(GAMMADIR)/make/altsrc.make
@ -237,6 +238,8 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \
echo; \
[ -n "$(SPEC)" ] && \
echo "include $(SPEC)"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
) > $@

View File

@ -25,9 +25,13 @@
#------------------------------------------------------------------------
# CC, CXX & AS
CXX = g++
CC = gcc
AS = $(CC) -c
# If a SPEC is not set already, then use these defaults.
ifeq ($(SPEC),)
CXX = g++
CC = gcc
AS = $(CC) -c
MCS = /usr/ccs/bin/mcs
endif
Compiler = gcc
@ -193,5 +197,3 @@ DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
DEBUG_CFLAGS += -gstabs
endif
MCS = /usr/ccs/bin/mcs

View File

@ -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
CC = cc
CXX = CC
# Note that this 'as' is an older version of the Sun Studio 'fbe', and will
# use the older style options. The 'fbe' options will match 'cc' and 'CC'.
AS = /usr/ccs/bin/as
# Note that this 'as' is an older version of the Sun Studio 'fbe', and will
# use the older style options. The 'fbe' options will match 'cc' and 'CC'.
AS = /usr/ccs/bin/as
NM = /usr/ccs/bin/nm
NAWK = /bin/nawk
NM = /usr/ccs/bin/nm
NAWK = /bin/nawk
MCS = /usr/ccs/bin/mcs
STRIP = /usr/ccs/bin/strip
endif
REORDER_FLAG = -xF
@ -557,9 +561,6 @@ else
#LINK_INTO = LIBJVM
endif
MCS = /usr/ccs/bin/mcs
STRIP = /usr/ccs/bin/strip
# Solaris platforms collect lots of redundant file-ident lines,
# to the point of wasting a significant percentage of file space.
# (The text is stored in ELF .comment sections, contributed by

View File

@ -297,6 +297,10 @@ $(variantDir)\local.make: checks
@ echo BUILDARCH=$(BUILDARCH) >> $@
@ echo Platform_arch=$(Platform_arch) >> $@
@ 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 >> $@
checks: checkVariant checkWorkSpace checkSA

View File

@ -23,7 +23,9 @@
#
# Generic compiler settings
!if "x$(CXX)" == "x"
CXX=cl.exe
!endif
# CXX Flags: (these vary slightly from VC6->VS2003->VS2005 compilers)
# /nologo Supress copyright message at every cl.exe startup
@ -183,8 +185,10 @@ BUFFEROVERFLOWLIB = bufferoverflowU.lib
LD_FLAGS = /manifest $(LD_FLAGS) $(BUFFEROVERFLOWLIB)
# Manifest Tool - used in VS2005 and later to adjust manifests stored
# as resources inside build artifacts.
!if "x$(MT)" == "x"
MT=mt.exe
!endif
!endif
!if "$(COMPILER_NAME)" == "VS2008"
PRODUCT_OPT_OPTION = /O2 /Oy-
@ -194,8 +198,10 @@ GX_OPTION = /EHsc
LD_FLAGS = /manifest $(LD_FLAGS)
# Manifest Tool - used in VS2005 and later to adjust manifests stored
# as resources inside build artifacts.
!if "x$(MT)" == "x"
MT=mt.exe
!endif
!endif
!if "$(COMPILER_NAME)" == "VS2010"
PRODUCT_OPT_OPTION = /O2 /Oy-
@ -205,7 +211,9 @@ GX_OPTION = /EHsc
LD_FLAGS = /manifest $(LD_FLAGS)
# Manifest Tool - used in VS2005 and later to adjust manifests stored
# as resources inside build artifacts.
!if "x$(MT)" == "x"
MT=mt.exe
!endif
!if "$(BUILDARCH)" == "i486"
LD_FLAGS = /SAFESEH $(LD_FLAGS)
!endif
@ -225,7 +233,9 @@ FASTDEBUG_OPT_OPTION = $(DEBUG_OPT_OPTION)
!endif
# Generic linker settings
!if "x$(LD)" == "x"
LD=link.exe
!endif
LD_FLAGS= $(LD_FLAGS) kernel32.lib user32.lib gdi32.lib winspool.lib \
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
uuid.lib Wsock32.lib winmm.lib /nologo /machine:$(MACHINE) /opt:REF \
@ -237,7 +247,9 @@ LD_FLAGS= $(LD_FLAGS) psapi.lib
!endif
# Resource compiler settings
!if "x$(RC)" == "x"
RC=rc.exe
!endif
RC_FLAGS=/D "HS_VER=$(HS_VER)" \
/D "HS_DOTVER=$(HS_DOTVER)" \
/D "HS_BUILD_ID=$(HS_BUILD_ID)" \

View File

@ -202,3 +202,19 @@ ifeq ($(BUILD_WIN_SA), 1)
# Must pass this down to nmake.
MAKE_ARGS += BUILD_WIN_SA=1
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

View File

@ -3231,6 +3231,26 @@ void LIR_Assembler::membar_release() {
// no-op on TSO
}
void LIR_Assembler::membar_loadload() {
// no-op
//__ membar(Assembler::Membar_mask_bits(Assembler::loadload));
}
void LIR_Assembler::membar_storestore() {
// no-op
//__ membar(Assembler::Membar_mask_bits(Assembler::storestore));
}
void LIR_Assembler::membar_loadstore() {
// no-op
//__ membar(Assembler::Membar_mask_bits(Assembler::loadstore));
}
void LIR_Assembler::membar_storeload() {
__ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad));
}
// Pack two sequential registers containing 32 bit values
// into a single 64 bit register.
// src and src->successor() are packed into dst

View File

@ -3713,6 +3713,25 @@ void LIR_Assembler::membar_release() {
// __ store_fence();
}
void LIR_Assembler::membar_loadload() {
// no-op
//__ membar(Assembler::Membar_mask_bits(Assembler::loadload));
}
void LIR_Assembler::membar_storestore() {
// no-op
//__ membar(Assembler::Membar_mask_bits(Assembler::storestore));
}
void LIR_Assembler::membar_loadstore() {
// no-op
//__ membar(Assembler::Membar_mask_bits(Assembler::loadstore));
}
void LIR_Assembler::membar_storeload() {
__ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad));
}
void LIR_Assembler::get_thread(LIR_Opr result_reg) {
assert(result_reg->is_register(), "check");
#ifdef _LP64

View File

@ -1,5 +1,5 @@
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -65,8 +65,8 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
address generate_getPsrInfo() {
// Flags to test CPU type.
const uint32_t EFL_AC = 0x40000;
const uint32_t EFL_ID = 0x200000;
const uint32_t HS_EFL_AC = 0x40000;
const uint32_t HS_EFL_ID = 0x200000;
// Values for when we don't have a CPUID instruction.
const int CPU_FAMILY_SHIFT = 8;
const uint32_t CPU_FAMILY_386 = (3 << CPU_FAMILY_SHIFT);
@ -100,7 +100,7 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
//
// if we are unable to change the AC flag, we have a 386
//
__ xorl(rax, EFL_AC);
__ xorl(rax, HS_EFL_AC);
__ push(rax);
__ popf();
__ pushf();
@ -118,7 +118,7 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
//
__ bind(detect_486);
__ mov(rax, rcx);
__ xorl(rax, EFL_ID);
__ xorl(rax, HS_EFL_ID);
__ push(rax);
__ popf();
__ pushf();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -49,7 +49,11 @@
void OSThread::pd_initialize() {
assert(this != NULL, "check");
#ifdef __APPLE__
_thread_id = 0;
#else
_thread_id = NULL;
#endif
_pthread_id = NULL;
_siginfo = NULL;
_ucontext = NULL;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -40,10 +40,17 @@
private:
#ifdef _ALLBSD_SOURCE
// _thread_id and _pthread_id are the same on BSD
// keep both to minimize code divergence in os_bsd.cpp
#ifdef __APPLE__
thread_t _thread_id;
#else
pthread_t _thread_id;
#endif
// _pthread_id is the pthread id, which is used by library calls
// (e.g. pthread_kill).
pthread_t _pthread_id;
#else
// _thread_id is kernel thread id (similar to LWP id on Solaris). Each
// thread has a unique thread_id (BsdThreads or NPTL). It can be used
@ -64,9 +71,15 @@
void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; }
#ifdef _ALLBSD_SOURCE
#ifdef __APPLE__
thread_t thread_id() const {
return _thread_id;
}
#else
pthread_t thread_id() const {
return _thread_id;
}
#endif
#else
pid_t thread_id() const {
return _thread_id;
@ -84,9 +97,15 @@
}
#endif // ASSERT
#ifdef _ALLBSD_SOURCE
#ifdef __APPLE__
void set_thread_id(thread_t id) {
_thread_id = id;
}
#else
void set_thread_id(pthread_t id) {
_thread_id = id;
}
#endif
#else
void set_thread_id(pid_t id) {
_thread_id = id;

View File

@ -568,6 +568,25 @@ void os::init_system_properties_values() {
sprintf(ld_library_path, "%s:%s", v, t);
free(t);
}
#ifdef __APPLE__
// Apple's Java6 has "." at the beginning of java.library.path.
// OpenJDK on Windows has "." at the end of java.library.path.
// OpenJDK on Linux and Solaris don't have "." in java.library.path
// at all. To ease the transition from Apple's Java6 to OpenJDK7,
// "." is appended to the end of java.library.path. Yes, this
// could cause a change in behavior, but Apple's Java6 behavior
// can be achieved by putting "." at the beginning of the
// JAVA_LIBRARY_PATH environment variable.
{
char *t = ld_library_path;
// that's +3 for appending ":." and the trailing '\0'
ld_library_path = (char *) malloc(strlen(t) + 3);
sprintf(ld_library_path, "%s:%s", t, ".");
free(t);
}
#endif
Arguments::set_library_path(ld_library_path);
}
@ -979,8 +998,13 @@ static void *java_start(Thread *thread) {
}
#ifdef _ALLBSD_SOURCE
#ifdef __APPLE__
// thread_id is mach thread on macos
osthread->set_thread_id(::mach_thread_self());
#else
// thread_id is pthread_id on BSD
osthread->set_thread_id(::pthread_self());
#endif
#else
// thread_id is kernel thread id (similar to Solaris LWP id)
osthread->set_thread_id(os::Bsd::gettid());
@ -1171,7 +1195,11 @@ bool os::create_attached_thread(JavaThread* thread) {
// Store pthread info into the OSThread
#ifdef _ALLBSD_SOURCE
#ifdef __APPLE__
osthread->set_thread_id(::mach_thread_self());
#else
osthread->set_thread_id(::pthread_self());
#endif
#else
osthread->set_thread_id(os::Bsd::gettid());
#endif
@ -1788,7 +1816,13 @@ size_t os::lasterror(char *buf, size_t len) {
return n;
}
intx os::current_thread_id() { return (intx)pthread_self(); }
intx os::current_thread_id() {
#ifdef __APPLE__
return (intx)::mach_thread_self();
#else
return (intx)::pthread_self();
#endif
}
int os::current_process_id() {
// Under the old bsd thread library, bsd gives each thread
@ -5133,9 +5167,9 @@ jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
struct thread_basic_info tinfo;
mach_msg_type_number_t tcount = THREAD_INFO_MAX;
kern_return_t kr;
mach_port_t mach_thread;
thread_t mach_thread;
mach_thread = pthread_mach_thread_np(thread->osthread()->thread_id());
mach_thread = thread->osthread()->thread_id();
kr = thread_info(mach_thread, THREAD_BASIC_INFO, (thread_info_t)&tinfo, &tcount);
if (kr != KERN_SUCCESS)
return -1;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* 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,12 +29,18 @@
// constants required by the Serviceability Agent. This file is
// referenced by vmStructs.cpp.
#ifdef __APPLE__
#define OS_THREAD_ID_TYPE thread_t
#else
#define OS_THREAD_ID_TYPE pthread_t
#endif
#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
\
/******************************/ \
/* Threads (NOTE: incomplete) */ \
/******************************/ \
nonstatic_field(OSThread, _thread_id, pthread_t) \
nonstatic_field(OSThread, _thread_id, OS_THREAD_ID_TYPE) \
nonstatic_field(OSThread, _pthread_id, pthread_t) \
/* This must be the last entry, and must be present */ \
last_entry()
@ -46,7 +52,7 @@
/* Posix Thread IDs */ \
/**********************/ \
\
declare_integer_type(pid_t) \
declare_unsigned_integer_type(thread_t) \
declare_unsigned_integer_type(pthread_t) \
\
/* This must be the last entry, and must be present */ \

View File

@ -908,3 +908,4 @@ void Canonicalizer::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {}
void Canonicalizer::do_ProfileCall(ProfileCall* x) {}
void Canonicalizer::do_ProfileInvoke(ProfileInvoke* x) {}
void Canonicalizer::do_RuntimeCall(RuntimeCall* x) {}
void Canonicalizer::do_MemBar(MemBar* x) {}

View File

@ -104,6 +104,7 @@ class Canonicalizer: InstructionVisitor {
virtual void do_ProfileCall (ProfileCall* x);
virtual void do_ProfileInvoke (ProfileInvoke* x);
virtual void do_RuntimeCall (RuntimeCall* x);
virtual void do_MemBar (MemBar* x);
};
#endif // SHARE_VM_C1_C1_CANONICALIZER_HPP

View File

@ -1418,6 +1418,12 @@ void GraphBuilder::method_return(Value x) {
call_register_finalizer();
}
bool need_mem_bar = false;
if (method()->name() == ciSymbol::object_initializer_name() &&
scope()->wrote_final()) {
need_mem_bar = true;
}
// Check to see whether we are inlining. If so, Return
// instructions become Gotos to the continuation point.
if (continuation() != NULL) {
@ -1437,6 +1443,10 @@ void GraphBuilder::method_return(Value x) {
monitorexit(state()->lock_at(0), SynchronizationEntryBCI);
}
if (need_mem_bar) {
append(new MemBar(lir_membar_storestore));
}
// State at end of inlined method is the state of the caller
// without the method parameters on stack, including the
// return value, if any, of the inlined method on operand stack.
@ -1456,7 +1466,6 @@ void GraphBuilder::method_return(Value x) {
// the continuation point.
append_with_bci(goto_callee, scope_data()->continuation()->bci());
incr_num_returns();
return;
}
@ -1472,6 +1481,10 @@ void GraphBuilder::method_return(Value x) {
append_split(new MonitorExit(receiver, state()->unlock()));
}
if (need_mem_bar) {
append(new MemBar(lir_membar_storestore));
}
append(new Return(x));
}
@ -1504,6 +1517,9 @@ void GraphBuilder::access_field(Bytecodes::Code code) {
}
}
if (field->is_final() && (code == Bytecodes::_putfield)) {
scope()->set_wrote_final();
}
const int offset = !needs_patching ? field->offset() : -1;
switch (code) {

View File

@ -141,6 +141,7 @@ IRScope::IRScope(Compilation* compilation, IRScope* caller, int caller_bci, ciMe
_xhandlers = new XHandlers(method);
_number_of_locks = 0;
_monitor_pairing_ok = method->has_balanced_monitors();
_wrote_final = false;
_start = NULL;
if (osr_bci == -1) {

View File

@ -149,6 +149,7 @@ class IRScope: public CompilationResourceObj {
XHandlers* _xhandlers; // the exception handlers
int _number_of_locks; // the number of monitor lock slots needed
bool _monitor_pairing_ok; // the monitor pairing info
bool _wrote_final; // has written final field
BlockBegin* _start; // the start block, successsors are method entries
BitMap _requires_phi_function; // bit is set if phi functions at loop headers are necessary for a local variable
@ -181,6 +182,8 @@ class IRScope: public CompilationResourceObj {
void set_min_number_of_locks(int n) { if (n > _number_of_locks) _number_of_locks = n; }
bool monitor_pairing_ok() const { return _monitor_pairing_ok; }
BlockBegin* start() const { return _start; }
void set_wrote_final() { _wrote_final = true; }
bool wrote_final () const { return _wrote_final; }
};

View File

@ -107,6 +107,7 @@ class UnsafePrefetchWrite;
class ProfileCall;
class ProfileInvoke;
class RuntimeCall;
class MemBar;
// A Value is a reference to the instruction creating the value
typedef Instruction* Value;
@ -204,6 +205,7 @@ class InstructionVisitor: public StackObj {
virtual void do_ProfileCall (ProfileCall* x) = 0;
virtual void do_ProfileInvoke (ProfileInvoke* x) = 0;
virtual void do_RuntimeCall (RuntimeCall* x) = 0;
virtual void do_MemBar (MemBar* x) = 0;
};
@ -2351,6 +2353,23 @@ LEAF(ProfileInvoke, Instruction)
virtual void state_values_do(ValueVisitor*);
};
LEAF(MemBar, Instruction)
private:
LIR_Code _code;
public:
MemBar(LIR_Code code)
: Instruction(voidType)
, _code(code)
{
pin();
}
LIR_Code code() { return _code; }
virtual void input_values_do(ValueVisitor*) {}
};
class BlockPair: public CompilationResourceObj {
private:
BlockBegin* _from;

View File

@ -855,4 +855,20 @@ void InstructionPrinter::do_RuntimeCall(RuntimeCall* x) {
output()->put(')');
}
void InstructionPrinter::do_MemBar(MemBar* x) {
if (os::is_MP()) {
LIR_Code code = x->code();
switch (code) {
case lir_membar_acquire : output()->print("membar_acquire"); break;
case lir_membar_release : output()->print("membar_release"); break;
case lir_membar : output()->print("membar"); break;
case lir_membar_loadload : output()->print("membar_loadload"); break;
case lir_membar_storestore: output()->print("membar_storestore"); break;
case lir_membar_loadstore : output()->print("membar_loadstore"); break;
case lir_membar_storeload : output()->print("membar_storeload"); break;
default : ShouldNotReachHere(); break;
}
}
}
#endif // PRODUCT

View File

@ -132,6 +132,7 @@ class InstructionPrinter: public InstructionVisitor {
virtual void do_ProfileCall (ProfileCall* x);
virtual void do_ProfileInvoke (ProfileInvoke* x);
virtual void do_RuntimeCall (RuntimeCall* x);
virtual void do_MemBar (MemBar* x);
};
#endif // PRODUCT

View File

@ -464,6 +464,10 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
case lir_membar: // result and info always invalid
case lir_membar_acquire: // result and info always invalid
case lir_membar_release: // result and info always invalid
case lir_membar_loadload: // result and info always invalid
case lir_membar_storestore: // result and info always invalid
case lir_membar_loadstore: // result and info always invalid
case lir_membar_storeload: // result and info always invalid
{
assert(op->as_Op0() != NULL, "must be");
assert(op->_info == NULL, "info not used by this instruction");
@ -1607,6 +1611,10 @@ const char * LIR_Op::name() const {
case lir_membar: s = "membar"; break;
case lir_membar_acquire: s = "membar_acquire"; break;
case lir_membar_release: s = "membar_release"; break;
case lir_membar_loadload: s = "membar_loadload"; break;
case lir_membar_storestore: s = "membar_storestore"; break;
case lir_membar_loadstore: s = "membar_loadstore"; break;
case lir_membar_storeload: s = "membar_storeload"; break;
case lir_word_align: s = "word_align"; break;
case lir_label: s = "label"; break;
case lir_nop: s = "nop"; break;

View File

@ -866,6 +866,10 @@ enum LIR_Code {
, lir_membar
, lir_membar_acquire
, lir_membar_release
, lir_membar_loadload
, lir_membar_storestore
, lir_membar_loadstore
, lir_membar_storeload
, lir_get_thread
, end_op0
, begin_op1
@ -1918,6 +1922,10 @@ class LIR_List: public CompilationResourceObj {
void membar() { append(new LIR_Op0(lir_membar)); }
void membar_acquire() { append(new LIR_Op0(lir_membar_acquire)); }
void membar_release() { append(new LIR_Op0(lir_membar_release)); }
void membar_loadload() { append(new LIR_Op0(lir_membar_loadload)); }
void membar_storestore() { append(new LIR_Op0(lir_membar_storestore)); }
void membar_loadstore() { append(new LIR_Op0(lir_membar_loadstore)); }
void membar_storeload() { append(new LIR_Op0(lir_membar_storeload)); }
void nop() { append(new LIR_Op0(lir_nop)); }
void build_frame() { append(new LIR_Op0(lir_build_frame)); }

View File

@ -664,6 +664,22 @@ void LIR_Assembler::emit_op0(LIR_Op0* op) {
membar_release();
break;
case lir_membar_loadload:
membar_loadload();
break;
case lir_membar_storestore:
membar_storestore();
break;
case lir_membar_loadstore:
membar_loadstore();
break;
case lir_membar_storeload:
membar_storeload();
break;
case lir_get_thread:
get_thread(op->result_opr());
break;

View File

@ -241,6 +241,10 @@ class LIR_Assembler: public CompilationResourceObj {
void membar();
void membar_acquire();
void membar_release();
void membar_loadload();
void membar_storestore();
void membar_loadstore();
void membar_storeload();
void get_thread(LIR_Opr result);
void verify_oop_map(CodeEmitInfo* info);

View File

@ -3165,3 +3165,20 @@ LIR_Opr LIRGenerator::call_runtime(BasicTypeArray* signature, LIRItemList* args,
}
return result;
}
void LIRGenerator::do_MemBar(MemBar* x) {
if (os::is_MP()) {
LIR_Code code = x->code();
switch(code) {
case lir_membar_acquire : __ membar_acquire(); break;
case lir_membar_release : __ membar_release(); break;
case lir_membar : __ membar(); break;
case lir_membar_loadload : __ membar_loadload(); break;
case lir_membar_storestore: __ membar_storestore(); break;
case lir_membar_loadstore : __ membar_loadstore(); break;
case lir_membar_storeload : __ membar_storeload(); break;
default : ShouldNotReachHere(); break;
}
}
}

View File

@ -525,6 +525,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
virtual void do_ProfileCall (ProfileCall* x);
virtual void do_ProfileInvoke (ProfileInvoke* x);
virtual void do_RuntimeCall (RuntimeCall* x);
virtual void do_MemBar (MemBar* x);
};

View File

@ -509,6 +509,7 @@ public:
void do_ProfileCall (ProfileCall* x);
void do_ProfileInvoke (ProfileInvoke* x);
void do_RuntimeCall (RuntimeCall* x);
void do_MemBar (MemBar* x);
};
@ -678,6 +679,7 @@ void NullCheckVisitor::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {}
void NullCheckVisitor::do_ProfileCall (ProfileCall* x) { nce()->clear_last_explicit_null_check(); }
void NullCheckVisitor::do_ProfileInvoke (ProfileInvoke* x) {}
void NullCheckVisitor::do_RuntimeCall (RuntimeCall* x) {}
void NullCheckVisitor::do_MemBar (MemBar* x) {}
void NullCheckEliminator::visit(Value* p) {

View File

@ -200,6 +200,7 @@ class ValueNumberingVisitor: public InstructionVisitor {
void do_ProfileCall (ProfileCall* x) { /* nothing to do */ }
void do_ProfileInvoke (ProfileInvoke* x) { /* nothing to do */ };
void do_RuntimeCall (RuntimeCall* x) { /* nothing to do */ };
void do_MemBar (MemBar* x) { /* nothing to do */ };
};

View File

@ -1,5 +1,5 @@
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -509,6 +509,9 @@
template(clear_name, "clear") \
template(trigger_method_signature, "(ILjava/lang/management/MemoryUsage;)V") \
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_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") \

View File

@ -1,5 +1,5 @@
/*
* 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.
*
* 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) {
void ConstantPoolCacheEntry::print(outputStream* st, int index) const {
// print separator
if (index == 0) tty->print_cr(" -------------");
if (index == 0) st->print_cr(" -------------");
// print entry
tty->print("%3d ("PTR_FORMAT") ", index, (intptr_t)this);
st->print("%3d ("PTR_FORMAT") ", index, (intptr_t)this);
if (is_secondary_entry())
tty->print_cr("[%5d|secondary]", main_entry_index());
st->print_cr("[%5d|secondary]", main_entry_index());
else
tty->print_cr("[%02x|%02x|%5d]", bytecode_2(), bytecode_1(), constant_pool_index());
tty->print_cr(" [ "PTR_FORMAT"]", (intptr_t)(oop)_f1);
tty->print_cr(" [ "PTR_FORMAT"]", (intptr_t)_f2);
tty->print_cr(" [ "PTR_FORMAT"]", (intptr_t)_flags);
tty->print_cr(" -------------");
st->print_cr("[%02x|%02x|%5d]", bytecode_2(), bytecode_1(), constant_pool_index());
st->print_cr(" [ "PTR_FORMAT"]", (intptr_t)(oop)_f1);
st->print_cr(" [ "PTR_FORMAT"]", (intptr_t)_f2);
st->print_cr(" [ "PTR_FORMAT"]", (intptr_t)_flags);
st->print_cr(" -------------");
}
void ConstantPoolCacheEntry::verify(outputStream* st) const {

View File

@ -1,5 +1,5 @@
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -49,6 +49,11 @@ void DCmdRegistrant::register_dcmds(){
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(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
@ -344,3 +349,185 @@ int ThreadDumpDCmd::num_arguments() {
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);
}

View File

@ -1,5 +1,5 @@
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -214,4 +214,82 @@ public:
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

View File

@ -1,5 +1,5 @@
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -87,14 +87,7 @@
#endif
#ifdef __APPLE__
#include <AvailabilityMacros.h>
#if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4)
// Mac OS X 10.4 defines EFL_AC and EFL_ID,
// which conflict with hotspot variable names.
//
// This has been fixed in Mac OS X 10.5.
#undef EFL_AC
#undef EFL_ID
#endif
#include <mach/mach.h>
#endif
#include <sys/time.h>
#endif // LINUX || _ALLBSD_SOURCE

View File

@ -147,3 +147,5 @@ cf9d6ec44f891236ad18451021d6dcd57dc82f7b jdk8-b22
95102fd334183d15dc98a95dd0d749527b6c7300 jdk8-b23
7836655e2495646c462f13de73dcc3ada197b64f jdk8-b24
bb694c151fc7b5c8f9edc8af6a80738530feacaf jdk8-b25
dbb7283c197b27da1fc12ae8a83785c851b68c12 jdk8-b26
80c47eb83d24fdd64bbb48f288bd6d4f03e0ec88 jdk8-b27

View File

@ -147,3 +147,5 @@ c266cab0e3fff05f2048c23046c14d60f7102175 jdk8-b21
25ce7a0004874273f6aeda14e7c3538cba34bdf1 jdk8-b23
e0d90803439b174fe0b0033e09d50444ba12498f jdk8-b24
b376d901e006cd9e0c59733c84e190aace23eec6 jdk8-b25
3518639eab6ce5c7b482bdb0a60342c392ab97a8 jdk8-b26
38c037af4127289de12efc67f45d19bb67abff69 jdk8-b27

View File

@ -101,7 +101,7 @@
<copy todir="${build.classes.dir}/META-INF"
file="${secondary.src.dir}/META-INF/mimetypes.default"/>
<copy todir="${build.classes.dir}/META-INF/services"
file="${primary.src.dir}/com/sun/tools/etc/META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory"/>
file="${primary.src.dir}/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin"/>
<copy todir="${build.classes.dir}/META-INF/services"
file="${primary.src.dir}/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin"/>
<mkdir dir="${build.classes.dir}/com/sun/tools/internal/xjc/runtime"/>

View File

@ -25,8 +25,8 @@
drops.master.copy.base=${drops.dir}
jaxws_src.bundle.name=jdk8-jaxws2_2_4-b01-2011_07_22.zip
jaxws_src.bundle.md5.checksum=f64bedd3c512e6b1ca265fda2feb0905
jaxws_src.bundle.name=jdk8-jaxws-2_2-SNAPSHOT-2012_01_11-patched.zip
jaxws_src.bundle.md5.checksum=005b93d1a2d6e66438c3c84c49c10b13
jaxws_src.master.bundle.dir=${drops.master.copy.base}
jaxws_src.master.bundle.url.base=http://download.java.net/glassfish/components/jax-ws/openjdk/jdk8

View File

@ -147,3 +147,5 @@ dda27c73d8db4a9c7a23872b6f0c5106edcb2021 jdk8-b22
54202e0148ec7d4570cab5bc9b00d216a7677569 jdk8-b23
34029a0c69bba882264a29fc822f8283fd15f104 jdk8-b24
ec17fbe5b8fbc52da070eec43b4711d9354b2ab8 jdk8-b25
5aca406e87cb9144a9405be312dadd728a9c6fe2 jdk8-b26
c68342532e2e7deb3a25fc04ed3e4c142278f747 jdk8-b27

View File

@ -47,7 +47,6 @@ SUBDIRS_enterprise = crypto/provider jndi \
org rowset net/httpserver
SUBDIRS_misc = $(SCRIPT_SUBDIR) tracing servicetag nio demo
# Omit mirror since it's built with the apt tool.
SUBDIRS_tools = tools
include $(BUILDDIR)/common/Subdirs.gmk

View File

@ -29,11 +29,11 @@
ifneq ($(PLATFORM), windows)
FILES_export = \
sun/nio/ch/SctpAssocChange.java \
sun/nio/ch/SctpChannelImpl.java \
sun/nio/ch/SctpNet.java \
sun/nio/ch/SctpPeerAddrChange.java \
sun/nio/ch/SctpResultContainer.java \
sun/nio/ch/SctpServerChannelImpl.java \
sun/nio/ch/SctpStdSocketOption.java
sun/nio/ch/sctp/AssociationChange.java \
sun/nio/ch/sctp/SctpChannelImpl.java \
sun/nio/ch/sctp/SctpNet.java \
sun/nio/ch/sctp/PeerAddrChange.java \
sun/nio/ch/sctp/ResultContainer.java \
sun/nio/ch/sctp/SctpServerChannelImpl.java \
sun/nio/ch/sctp/SctpStdSocketOption.java
endif

View File

@ -42,25 +42,25 @@ FILES_java = \
com/sun/nio/sctp/SendFailedNotification.java \
com/sun/nio/sctp/ShutdownNotification.java \
\
sun/nio/ch/SctpMessageInfoImpl.java \
sun/nio/ch/SctpStdSocketOption.java
sun/nio/ch/sctp/MessageInfoImpl.java \
sun/nio/ch/sctp/SctpStdSocketOption.java
ifneq ($(PLATFORM), windows)
FILES_java += \
sun/nio/ch/SctpAssocChange.java \
sun/nio/ch/SctpAssociationImpl.java \
sun/nio/ch/SctpChannelImpl.java \
sun/nio/ch/SctpMultiChannelImpl.java \
sun/nio/ch/SctpNet.java \
sun/nio/ch/SctpNotification.java \
sun/nio/ch/SctpPeerAddrChange.java \
sun/nio/ch/SctpResultContainer.java \
sun/nio/ch/SctpSendFailed.java \
sun/nio/ch/SctpServerChannelImpl.java \
sun/nio/ch/SctpShutdown.java
sun/nio/ch/sctp/AssociationChange.java \
sun/nio/ch/sctp/AssociationImpl.java \
sun/nio/ch/sctp/PeerAddrChange.java \
sun/nio/ch/sctp/ResultContainer.java \
sun/nio/ch/sctp/SctpChannelImpl.java \
sun/nio/ch/sctp/SctpMultiChannelImpl.java \
sun/nio/ch/sctp/SctpNet.java \
sun/nio/ch/sctp/SctpNotification.java \
sun/nio/ch/sctp/SctpServerChannelImpl.java \
sun/nio/ch/sctp/SendFailed.java \
sun/nio/ch/sctp/Shutdown.java
else
FILES_java += \
sun/nio/ch/SctpChannelImpl.java \
sun/nio/ch/SctpMultiChannelImpl.java \
sun/nio/ch/SctpServerChannelImpl.java
sun/nio/ch/sctp/SctpChannelImpl.java \
sun/nio/ch/sctp/SctpMultiChannelImpl.java \
sun/nio/ch/sctp/SctpServerChannelImpl.java
endif

View File

@ -47,14 +47,16 @@ include $(BUILDDIR)/common/Library.gmk
#
# Find platform-specific C source files
#
vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch
vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch/sctp
#
# Include nio.h, net_util.h, sun_nio_ch_IOStatus.h, etc
#
OTHER_INCLUDES += \
-I$(SHARE_SRC)/native/sun/nio/ch \
-I$(SHARE_SRC)/native/sun/nio/ch/sctp \
-I$(SHARE_SRC)/native/java/net \
-I$(PLATFORM_SRC)/native/sun/nio/ch \
-I$(PLATFORM_SRC)/native/java/net \
-I$(CLASSHDRDIR)/../../../../java/java.nio/nio/CClassHeaders
@ -75,5 +77,5 @@ endif # ifneq windows
clean clobber::
$(RM) -r $(CLASSDESTDIR)/com/sun/nio/sctp
$(RM) -r $(CLASSDESTDIR)/sun/nio/ch
$(RM) -r $(CLASSDESTDIR)/sun/nio/ch/sctp

View File

@ -25,30 +25,30 @@
SUNWprivate_1.1 {
global:
Java_sun_nio_ch_SctpNet_init;
Java_sun_nio_ch_SctpNet_socket0;
Java_sun_nio_ch_SctpNet_bindx;
Java_sun_nio_ch_SctpNet_branch0;
Java_sun_nio_ch_SctpNet_listen0;
Java_sun_nio_ch_SctpNet_connect0;
Java_sun_nio_ch_SctpNet_close0;
Java_sun_nio_ch_SctpNet_preClose0;
Java_sun_nio_ch_SctpNet_getLocalAddresses0;
Java_sun_nio_ch_SctpNet_getRemoteAddresses0;
Java_sun_nio_ch_SctpNet_getPrimAddrOption0;
Java_sun_nio_ch_SctpNet_setPrimAddrOption0;
Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0;
Java_sun_nio_ch_SctpNet_getInitMsgOption0;
Java_sun_nio_ch_SctpNet_setInitMsgOption0;
Java_sun_nio_ch_SctpNet_getIntOption0;
Java_sun_nio_ch_SctpNet_setIntOption0;
Java_sun_nio_ch_SctpNet_shutdown0;
Java_sun_nio_ch_SctpChannelImpl_initIDs;
Java_sun_nio_ch_SctpChannelImpl_checkConnect;
Java_sun_nio_ch_SctpChannelImpl_receive0;
Java_sun_nio_ch_SctpChannelImpl_send0;
Java_sun_nio_ch_SctpServerChannelImpl_initIDs;
Java_sun_nio_ch_SctpServerChannelImpl_accept0;
Java_sun_nio_ch_sctp_SctpNet_init;
Java_sun_nio_ch_sctp_SctpNet_socket0;
Java_sun_nio_ch_sctp_SctpNet_bindx;
Java_sun_nio_ch_sctp_SctpNet_branch0;
Java_sun_nio_ch_sctp_SctpNet_listen0;
Java_sun_nio_ch_sctp_SctpNet_connect0;
Java_sun_nio_ch_sctp_SctpNet_close0;
Java_sun_nio_ch_sctp_SctpNet_preClose0;
Java_sun_nio_ch_sctp_SctpNet_getLocalAddresses0;
Java_sun_nio_ch_sctp_SctpNet_getRemoteAddresses0;
Java_sun_nio_ch_sctp_SctpNet_getPrimAddrOption0;
Java_sun_nio_ch_sctp_SctpNet_setPrimAddrOption0;
Java_sun_nio_ch_sctp_SctpNet_setPeerPrimAddrOption0;
Java_sun_nio_ch_sctp_SctpNet_getInitMsgOption0;
Java_sun_nio_ch_sctp_SctpNet_setInitMsgOption0;
Java_sun_nio_ch_sctp_SctpNet_getIntOption0;
Java_sun_nio_ch_sctp_SctpNet_setIntOption0;
Java_sun_nio_ch_sctp_SctpNet_shutdown0;
Java_sun_nio_ch_sctp_SctpChannelImpl_initIDs;
Java_sun_nio_ch_sctp_SctpChannelImpl_checkConnect;
Java_sun_nio_ch_sctp_SctpChannelImpl_receive0;
Java_sun_nio_ch_sctp_SctpChannelImpl_send0;
Java_sun_nio_ch_sctp_SctpServerChannelImpl_initIDs;
Java_sun_nio_ch_sctp_SctpServerChannelImpl_accept0;
JNI_OnLoad;
local:
*;

View File

@ -132,7 +132,6 @@ endif
JDK_MAN_PAGES = \
$(JRE_MAN_PAGES) \
appletviewer.1 \
apt.1 \
extcheck.1 \
idlj.1 \
jar.1 \
@ -264,7 +263,6 @@ SOURCES = \
com/sun/java/swing \
com/sun/javadoc \
com/sun/jmx \
com/sun/mirror \
com/sun/source \
com/sun/naming \
com/sun/security/auth \
@ -346,7 +344,6 @@ TOOLS = \
com/sun/javadoc \
com/sun/jdi \
com/sun/jarsigner \
com/sun/mirror \
com/sun/source \
com/sun/tools/classfile \
com/sun/tools/doclets \
@ -356,16 +353,16 @@ TOOLS = \
com/sun/tools/hat \
com/sun/tools/javac \
com/sun/tools/javadoc \
com/sun/tools/apt \
com/sun/tools/javah \
com/sun/tools/javap \
com/sun/tools/corba \
com/sun/tools/internal/xjc \
com/sun/tools/internal/ws \
META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory \
META-INF/services/com.sun.tools.xjc.Plugin \
META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
META-INF/services/com.sun.tools.internal.xjc.Plugin \
com/sun/istack/internal/tools \
com/sun/istack/internal/ws \
com/sun/tools/internal/jxc/ap \
com/sun/tools/internal/ws/wscompile/plugin/at_generated \
com/sun/codemodel \
com/sun/tools/internal/jxc \
com/sun/xml/internal/rngom \
@ -438,7 +435,6 @@ NOTJRETOOLS = \
java-rmi.cgi \
javac$(EXE_SUFFIX) \
javadoc$(EXE_SUFFIX) \
apt$(EXE_SUFFIX) \
javah$(EXE_SUFFIX) \
javap$(EXE_SUFFIX) \
jcmd$(EXE_SUFFIX) \
@ -525,13 +521,10 @@ $(NOT_RT_JAR_LIST): FRC
$(ECHO) "com/sun/javadoc/" >> $@
$(ECHO) "com/sun/jdi/" >> $@
$(ECHO) "com/sun/jarsigner/" >> $@
$(ECHO) "com/sun/mirror/" >> $@
$(ECHO) "com/sun/source/" >> $@
$(ECHO) "com/sun/istack/internal/tools/" >> $@
$(ECHO) "com/sun/istack/internal/ws/" >> $@
$(ECHO) "META-INF/services/com.sun.jdi.connect.Connector" >> $@
$(ECHO) "META-INF/services/com.sun.jdi.connect.spi.TransportService" >> $@
$(ECHO) "META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory" >> $@
$(ECHO) "META-INF/services/com.sun.tools.xjc.Plugin" >> $@
$(ECHO) "com/sun/tools/" >> $@
$(ECHO) "sun/jvmstat/" >> $@
@ -1000,7 +993,7 @@ initial-image-jdk:: initial-image-jdk-setup \
@#
@# files that might not exist need to be touched.
@#
$(TOUCH) $(CLASSBINDIR)/META-INF/services/com.sun.tools.xjc.Plugin
$(TOUCH) $(CLASSBINDIR)/META-INF/services/com.sun.tools.internal.xjc.Plugin
@#
@# lib/tools.jar
@#

View File

@ -34,7 +34,6 @@ IMPORT_RT_PACKAGES += \
javax/xml/ws \
javax/jws \
javax/annotation \
com/sun/istack/internal \
com/sun/xml/internal/bind \
com/sun/xml/internal/fastinfoset \
com/sun/xml/internal/messaging \
@ -42,13 +41,13 @@ IMPORT_RT_PACKAGES += \
com/sun/xml/internal/txw2 \
com/sun/xml/internal/ws \
com/sun/xml/internal/stream/buffer
NOT_USED_PACKAGES += \
com/sun/tools/internal/txw2
IMPORT_TOOLS_PACKAGES += \
com/sun/codemodel \
com/sun/istack/internal/tools \
com/sun/istack/internal/ws \
com/sun/xml/internal/rngom \
com/sun/xml/internal/xsom \
com/sun/xml/internal/dtdparser \
@ -56,6 +55,9 @@ IMPORT_TOOLS_PACKAGES += \
com/sun/tools/internal/ws \
com/sun/tools/internal/jxc \
org/relaxng \
META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory \
META-INF/services/com.sun.tools.internal.xjc.Plugin
META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
META-INF/services/com.sun.tools.internal.xjc.Plugin \
com/sun/tools/internal/jxc/ap \
com/sun/tools/internal/ws/wscompile/plugin/at_generated

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1997, 2008, 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.
#
# This code is free software; you can redistribute it and/or modify it
@ -32,9 +32,7 @@ IMPORT_RT_PACKAGES += \
IMPORT_TOOLS_PACKAGES += \
com/sun/javadoc \
com/sun/mirror \
com/sun/source \
com/sun/tools/apt \
com/sun/tools/classfile \
com/sun/tools/doclets \
com/sun/tools/javac \

View File

@ -1,4 +1,4 @@
# 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.
#
# This code is free software; you can redistribute it and/or modify it
@ -356,64 +356,6 @@ $(COREAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(CORE_P
$(prep-target)
$(call PackageFilter,$(CORE_PKGS))
#############################################################
#
# mirrordocs
#
# Part of langtools
ifdef LANGTOOLS_DIST
ALL_OTHER_TARGETS += mirrordocs
endif
MIRROR_DOCDIR := $(JDK_API_DOCSDIR)/apt/mirror
MIRROR2COREAPI := ../../$(JDKJRE2COREAPI)
MIRROR_DOCTITLE := Mirror API
MIRROR_WINDOWTITLE := Mirror API
MIRROR_HEADER := <strong>Mirror API</strong>
MIRROR_BOTTOM := $(call CommonBottom,$(MIRROR_FIRST_COPYRIGHT_YEAR))
MIRROR_GROUPNAME := Packages
MIRROR_OVERVIEW := $(IMPORTSRCDIR)/com/sun/mirror/overview.html
MIRROR_REGEXP := com.sun.mirror.*
# MIRROR_PKGS is located in NON_CORE_PKGS.gmk
# The index.html, options, and packages files
MIRROR_INDEX_FILE = $(MIRROR_DOCDIR)/index.html
MIRROR_OPTIONS_FILE = $(DOCSTMPDIR)/mirror.options
MIRROR_PACKAGES_FILE = $(DOCSTMPDIR)/mirror.packages
mirrordocs: $(MIRROR_INDEX_FILE)
# Set relative location to core api document root
$(MIRROR_INDEX_FILE): GET2DOCSDIR=$(MIRROR2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(MIRROR_INDEX_FILE): $(MIRROR_OPTIONS_FILE) $(MIRROR_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(MIRROR_OPTIONS_FILE),$(MIRROR_PACKAGES_FILE))
$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
@$(MIRROR_OPTIONS_FILE) @$(MIRROR_PACKAGES_FILE)
# Create file with javadoc options in it
$(MIRROR_OPTIONS_FILE): $(MIRROR_OVERVIEW)
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionPair,-overview,$(MIRROR_OVERVIEW)) ; \
$(call OptionPair,-doctitle,$(MIRROR_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(MIRROR_WINDOWTITLE) $(DRAFT_WINTITLE));\
$(call OptionPair,-header,$(MIRROR_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-bottom,$(MIRROR_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-group,$(MIRROR_GROUPNAME),$(MIRROR_REGEXP)); \
$(call OptionTrip,-linkoffline,$(MIRROR2COREAPI),$(COREAPI_DOCSDIR)); \
) >> $@
# Create a file with the package names in it
$(MIRROR_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(MIRROR_PKGS))
$(prep-target)
$(call PackageFilter,$(MIRROR_PKGS))
#############################################################
#
# docletapidocs

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -71,11 +71,6 @@ DOCLETAPI_PKGS = com.sun.javadoc
TAGLETAPI_FILE = com/sun/tools/doclets/Taglet.java
MIRROR_PKGS = com.sun.mirror.apt \
com.sun.mirror.declaration \
com.sun.mirror.type \
com.sun.mirror.util
ATTACH_PKGS = com.sun.tools.attach \
com.sun.tools.attach.spi

View File

@ -474,6 +474,7 @@ JAVA_JAVA_java = \
sun/misc/MessageUtils.java \
sun/misc/GC.java \
sun/misc/Service.java \
sun/misc/JavaAWTAccess.java \
sun/misc/JavaLangAccess.java \
sun/misc/JavaIOAccess.java \
sun/misc/JavaIOFileDescriptorAccess.java \

View File

@ -54,9 +54,6 @@ SUNWprivate_1.1 {
Java_sun_management_GcInfoBuilder_getLastGcInfo0;
Java_sun_management_GcInfoBuilder_getNumGcExtAttributes;
Java_sun_management_HotSpotDiagnostic_dumpHeap;
Java_sun_management_HotSpotDiagnostic_executeDiagnosticCommand0;
Java_sun_management_HotSpotDiagnostic_getDiagnosticCommandInfo0;
Java_sun_management_HotSpotDiagnostic_getDiagnosticCommands0;
Java_sun_management_HotspotThread_getInternalThreadCount;
Java_sun_management_HotspotThread_getInternalThreadTimes0;
Java_sun_management_MemoryImpl_getMemoryManagers0;

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -55,7 +55,6 @@ endif
define make-all-launchers
$(make-appletviewer)
$(call make-launcher, apt, com.sun.tools.apt.Main, , )
$(call make-launcher, extcheck, com.sun.tools.extcheck.Main, , )
$(call make-launcher, idlj, com.sun.tools.corba.se.idl.toJavaPortable.Compile, , )
$(call make-launcher, jar, sun.tools.jar.Main, , )

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -47,10 +47,6 @@ ifndef MAIN_CLASS
endif
# Some tools need the wildcard expansion option
ifeq ($(PROGRAM),apt)
WILDCARDS=true
NEVER_ACT_AS_SERVER_CLASS_MACHINE=true
endif
ifeq ($(PROGRAM),javac)
WILDCARDS=true
MAIN_JAVA_ARGS += -J-Xss4m -J-ea:com.sun.tools...

View File

@ -1,153 +0,0 @@
." Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
." 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.
."
.TH apt 1 "10 May 2011"
.LP
.SH "NAME"
.LP
.LP
\f2apt\fP \- annotation processing tool
.LP
.SH "SYNOPSIS"
.LP
.LP
\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files]
.LP
.SH "PARAMETERS"
.LP
.LP
Options may be in any order. For a discussion of parameters which apply to a specific option, see OPTIONS below.
.LP
.RS 3
.TP 3
sourcefiles
Zero or more source files to be processed.
.TP 3
@files
One or more files that list source files or other options
.RE
.LP
.SH "DESCRIPTION"
.LP
.LP
\f3Note\fP: The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations.
.LP
.LP
The tool \f2apt\fP, annotation processing tool, includes reflective APIs and supporting infrastructure to process program annotations. The \f2apt\fP reflective APIs provide a build\-time, source\-based, read\-only view of program structure. These reflective APIs are designed to cleanly model the Java(TM) programming language's type system after the addition of generics. First, \f2apt\fP runs annotation processors that can produce new source code and other files. Next, \f2apt\fP can cause compilation of both original and generated source files, easing development. The reflective APIs and other APIs used to interact with the tool are subpackages of \f2com.sun.mirror\fP.
.LP
.LP
A fuller discussion of how the tool operates as well as instructions for developing with \f2apt\fP are in
.na
\f4Getting Started with \fP\f4apt\fP. @
.fi
http://download.oracle.com/javase/7/docs/technotes/guides/apt/GettingStarted.html
.LP
.SH "OPTIONS"
.LP
.SS
apt specific options
.LP
.RS 3
.TP 3
\-s dir
Specify the directory root under which processor\-generated source files will be placed; files are placed in subdirectories based on package namespace.
.TP 3
\-nocompile
Do not compile source files to class files.
.TP 3
\-print
Print out textual representation of specified types; perform no annotation processing or compilation.
.TP 3
\-A[key[=val]]
Options to pass to annotation processors \-\- these are not interpreted by \f2apt\fP directly, but are made available for use by individual processors
.TP 3
\-factorypath path
Specify where to find annotation processor factories; if this option is used, the classpath is \f2not\fP searched for factories.
.TP 3
\-factory classname
Name of annotation processor factory to use; bypasses default discovery process
.TP 3
\-version
Print version information.
.TP 3
\-X
Display information about non\-standard options.
.RE
.LP
.SS
Options shared with javac
.LP
.RS 3
.TP 3
\-d dir
Specify where to place processor and javac generated class files
.TP 3
\-cp path or \-classpath path
Specify where to find user class files and annotation processor factories. If \f2\-factorypath\fP is given, the classpath is not searched for factories.
.RE
.LP
.LP
Consult the javac(1) man page for information on \f2javac\fP options.
.LP
.SS
Non\-Standard Options
.LP
.RS 3
.TP 3
\-XListAnnotationTypes
List found annotation types.
.TP 3
\-XListDeclarations
List specified and included declarations.
.TP 3
\-XPrintAptRounds
Print information about initial and recursive \f2apt\fP rounds.
.TP 3
\-XPrintFactoryInfo
Print information about which annotations a factory is asked to process.
.TP 3
\-XclassesAsDecls
Treat both class and source files as declarations to process.
.RE
.LP
.LP
\f3Note\fP: Because these options are non\-standard, they are subject to change without notice.
.LP
.SH "NOTES"
.LP
.LP
The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations.
.LP
.SH "SEE ALSO"
.LP
.RS 3
.TP 2
o
javac(1), java(1)
.RE
.LP

View File

@ -1,153 +0,0 @@
." Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
." 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.
."
.TH apt 1 "07 May 2011"
.LP
.SH "NAME"
.LP
.LP
\f2apt\fP \- 注釈処理ツール
.LP
.SH "形式"
.LP
.LP
\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files]
.LP
.SH "パラメータ"
.LP
.LP
オプションの指定順序に決まりはありません。特定のオプションに適用されるパラメータについては、下記の「オプション」を参照してください。
.LP
.RS 3
.TP 3
sourcefiles
ゼロ、1 つ、または複数の処理対象のソースファイル
.TP 3
@files
ソースファイルまたは他のオプションを一覧表示する 1 つまたは複数のファイル
.RE
.LP
.SH "説明"
.LP
.LP
\f3\fP: \f2apt\fP ツールと、パッケージ \f2com.sun.mirror\fP に含まれているそれに関連した API は、JDK 7 以降非推奨になっており、JDK の次のメジャーリリースで削除される予定です。\f2javac(1)\fP ツールで利用可能なオプションと、パッケージ \f2javax.annotation.processing\fP および \f2javax.lang.model\fP に含まれている API を使用して、注釈を処理してください。
.LP
.LP
注釈処理ツール \f2apt\fP は、リフレクト API とサポートインフラストラクチャーから構成され、プログラム注釈を処理します。\f2apt\fP リフレクト API は、 構築時のソースベースで、プログラム構造に関する読み取り専用ビューを提供します。これらのリフレクト API は、総称を追加した後に、Java(TM) プログラミング言語の型システムを正しくモデル化するように設計されています。最初に、\f2apt\fP は、新しいソースコードと他のファイルを作成する注釈プロセッサを実行します。次に、\f2apt\fP は、元のソースファイルと生成したソースファイルの両方をコンパイルするため、開発が楽になります。ツールとのインタフェースに使用されるリフレクト API などの API は、\f2com.sun.mirror\fP のサブパッケージです。
.LP
.LP
ツールの機能に関する詳細と、\f2apt\fP を使用した開発方法については、
.na
\f4「apt 入門」\fP @
.fi
http://java.sun.com/javase/6/docs/technotes/guides/apt/GettingStarted.htmlを参照してください。
.LP
.SH "オプション"
.LP
.SS
apt 固有のオプション
.LP
.RS 3
.TP 3
\-s dir
プロセッサの生成するソースファイルを置くディレクトリルートを指定します。 ファイルは、パッケージの名前空間に基づいてサブディレクトリに置かれます。
.TP 3
\-nocompile
ソースファイルをクラスファイルにコンパイルしません。
.TP 3
\-print
指定したタイプのテキスト表現を出力します。 注釈処理またはコンパイルは行いません。
.TP 3
\-A[key[=val]]
注釈プロセッサへ渡すオプションです。 このオプションは、\f2apt\fP が直接解釈するのではなく、それぞれのプロセッサによって使用できるように変えられます。
.TP 3
\-factorypath path
注釈プロセッサファクトリを検索する場所を指定します。 このオプションを使用する場合、クラスパスのファクトリは検索されません。
.TP 3
\-factory classname
使用する注釈プロセッサファクトリの名前です。 デフォルトの検出プロセスを省略します。
.TP 3
\-version
バージョン情報を出力します。
.TP 3
\-X
非標準オプションに関する情報を表示します。
.RE
.LP
.SS
javac と共用するオプション
.LP
.RS 3
.TP 3
\-d dir
プロセッサと javac 生成のクラスファイルを置く場所を指定します。
.TP 3
\-cp path または \-classpath path
ユーザークラスファイルと注釈プロセッサファクトリを検索する場所を指定します。\f2\-factorypath\fP が指定されている場合、クラスパスのファクトリは検索されません。
.RE
.LP
.LP
\f2javac\fP オプションの詳細については、javac(1) のマニュアルページを参照してください。
.LP
.SS
非標準オプション
.LP
.RS 3
.TP 3
\-XListAnnotationTypes
注釈の型に検出されるリスト.
.TP 3
\-XListDeclarations
指定および宣言がインクルードされるリスト.
.TP 3
\-XPrintAptRounds
初期および再帰的な \f2apt\fP ラウンドに関する情報を出力する.
.TP 3
\-XPrintFactoryInfo
処理を要求するファクトリの注釈に関する情報を出力する.
.TP 3
\-XclassesAsDecls
クラスファイルとソースファイルの両方を、処理対象の宣言として処理します。
.RE
.LP
.LP
\f3\fP: これらは非標準オプションなので、予告なく変更される可能性があります。
.LP
.SH "注"
.LP
.LP
\f2apt\fP ツールと、パッケージ \f2com.sun.mirror\fP に含まれているそれに関連した API は、JDK 7 以降非推奨になっており、JDK の次のメジャーリリースで削除される予定です。\f2javac(1)\fP ツールで利用可能なオプションと、パッケージ \f2javax.annotation.processing\fP および \f2javax.lang.model\fP に含まれている API を使用して、注釈を処理してください。
.LP
.SH "関連項目"
.LP
.RS 3
.TP 2
o
javac(1), java(1)
.RE
.LP

View File

@ -55,9 +55,12 @@ final class PBEKey implements SecretKey {
// Should allow an empty password.
passwd = new char[0];
}
for (int i=0; i<passwd.length; i++) {
if ((passwd[i] < '\u0020') || (passwd[i] > '\u007E')) {
throw new InvalidKeySpecException("Password is not ASCII");
// Accept "\0" to signify "zero-length password with no terminator".
if (!(passwd.length == 1 && passwd[0] == 0)) {
for (int i=0; i<passwd.length; i++) {
if ((passwd[i] < '\u0020') || (passwd[i] > '\u007E')) {
throw new InvalidKeySpecException("Password is not ASCII");
}
}
}
this.key = new byte[passwd.length];

View File

@ -60,11 +60,16 @@ final class PKCS12PBECipherCore {
static byte[] derive(char[] chars, byte[] salt,
int ic, int n, int type) {
// Add in trailing NULL terminator.
// Add in trailing NULL terminator. Special case:
// no terminator if password is "\0".
int length = chars.length*2;
if (length != 0) {
if (length == 2 && chars[0] == 0) {
chars = new char[0];
length = 0;
} else {
length += 2;
}
byte[] passwd = new byte[length];
for (int i = 0, j = 0; i < chars.length; i++, j+=2) {
passwd[j] = (byte) ((chars[i] >>> 8) & 0xFF);
@ -133,6 +138,9 @@ final class PKCS12PBECipherCore {
}
private static void concat(byte[] src, byte[] dst, int start, int len) {
if (src.length == 0) {
return;
}
int loop = len / src.length;
int off, i;
for (i = 0, off = 0; i < loop; i++, off += src.length)

View File

@ -137,6 +137,11 @@ public class WindowsProgressBarUI extends BasicProgressBarUI
g.setColor(progressBar.getForeground());
barRectHeight -= 2;
barRectWidth -= 2;
if (barRectWidth <= 0 || barRectHeight <= 0) {
return;
}
Graphics2D g2 = (Graphics2D)g;
g2.setStroke(new BasicStroke((float)(vertical ? barRectWidth : barRectHeight),
BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -622,11 +622,7 @@ public class DnsClient {
//-------------------------------------------------------------------------
private static boolean debug = false;
public static void setDebug(boolean flag) {
debug = flag;
}
private static final boolean debug = false;
private static void dprint(String mess) {
if (debug) {

View File

@ -1,151 +0,0 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
package com.sun.management;
import java.beans.ConstructorProperties;
/**
* Diagnostic Command Argument information. It contains the description
* of one parameter of the diagnostic command. A parameter can either be an
* option or an argument. Options are identified by the option name while
* arguments are identified by their position in the command line. The generic
* syntax of a diagnostic command is:
* <blockquote>
* &lt;command name&gt; [&lt;option&gt;=&lt;value&gt;] [&lt;argument_value&gt;]
* </blockquote>
* Example:
* <blockquote>
* command_name option1=value1 option2=value argumentA argumentB argumentC
* </blockquote>
* In this command line, the diagnostic command receives five parameters, two
* options named {@code option1} and {@code option2}, and three arguments.
* argumentA's position is 0, argumentB's position is 1 and argumentC's
* position is 2.
*
* @author Frederic Parain
* @since 7u4
*/
public class DiagnosticCommandArgumentInfo {
private final String name;
private final String description;
private final String type;
private final String defaultValue;
private final boolean mandatory;
private final boolean option;
private final int position;
/**
* Returns the argument name
*
* @return the argument name
*/
public String getName() {
return name;
}
/**
* Returns the argument description
*
* @return the argument description
*/
public String getDescription() {
return description;
}
/**
* Returns the argument type
*
* @return the argument type
*/
public String getType() {
return type;
}
/**
* Returns the default value as a String if a default value
* is defined, null otherwise.
*
* @return the default value as a String if a default value
* is defined, null otherwise.
*/
public String getDefault() {
return defaultValue;
}
/**
* Returns {@code true} if the argument is mandatory,
* {@code false} otherwise
*
* @return {@code true} if the argument is mandatory,
* {@code false} otherwise
*/
public boolean isMandatory() {
return mandatory;
}
/**
* Returns {@code true} if the argument is an option,
* {@code false} otherwise. Options have to be specified using the
* &lt;key&gt;=&lt;value&gt; syntax on the command line, while other
* arguments are specified with a single &lt;value&gt; field and are
* identified by their position on command line.
*
* @return {@code true} if the argument is an option,
* {@code false} otherwise
*/
public boolean isOption() {
return option;
}
/**
* Returns the expected position of this argument if it is not an option,
* -1 otherwise. Argument position if defined from left to right,
* starting at zero and ignoring the diagnostic command name and
* options.
*
* @return the expected position of this argument if it is not an option,
* -1 otherwise.
*/
public int getPosition() {
return position;
}
@ConstructorProperties({"name","description","type","default",
"mandatory","option","position"})
public DiagnosticCommandArgumentInfo(String name, String description,
String type, String defaultValue,
boolean mandatory, boolean option,
int position) {
this.name = name;
this.description = description;
this.type = type;
this.defaultValue = defaultValue;
this.mandatory = mandatory;
this.option = option;
this.position = position;
}
}

View File

@ -1,110 +0,0 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
package com.sun.management;
import java.beans.ConstructorProperties;
import java.util.List;
/**
* Diagnostic command information. It contains the description of a
* diagnostic command.
*
* @author Frederic Parain
* @since 7u4
*/
public class DiagnosticCommandInfo {
private final String name;
private final String description;
private final String impact;
private final boolean enabled;
private final List<DiagnosticCommandArgumentInfo> arguments;
/**
* Returns the diagnostic command name
*
* @return the diagnostic command name
*/
public String getName() {
return name;
}
/**
* Returns the diagnostic command description
*
* @return the diagnostic command description
*/
public String getDescription() {
return description;
}
/**
* Returns the potential impact of the diagnostic command execution
* on the Java virtual machine behavior
*
* @return the potential impact of the diagnostic command execution
* on the Java virtual machine behavior
*/
public String getImpact() {
return impact;
}
/**
* Returns {@code true} if the diagnostic command is enabled,
* {@code false} otherwise. The enabled/disabled
* status of a diagnostic command can evolve during
* the lifetime of the Java virtual machine.
*
* @return {@code true} if the diagnostic command is enabled,
* {@code false} otherwise
*/
public boolean isEnabled() {
return enabled;
}
/**
* Returns the list of the diagnostic command arguments description.
* If the diagnostic command has no arguments, it returns an empty list.
*
* @return a list of the diagnostic command arguments description
*/
public List<DiagnosticCommandArgumentInfo> getArgumentsInfo() {
return arguments;
}
@ConstructorProperties({"name", "description","impact","enabled",
"argumentsInfo"})
public DiagnosticCommandInfo(String name, String description,
String impact, boolean enabled,
List<DiagnosticCommandArgumentInfo> arguments)
{
this.name = name;
this.description = description;
this.impact = impact;
this.enabled = enabled;
this.arguments = arguments;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
* 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,11 +31,6 @@ import java.lang.management.PlatformManagedObject;
/**
* Diagnostic management interface for the HotSpot Virtual Machine.
*
* <p>{@linkplain #getDiagnosticCommands Diagnostic commands}
* are actions that can be invoked dynamically and
* executed in a target Java virtual machine, mainly for troubleshooting
* and diagnosis.
*
* <p>The diagnostic MBean is registered to the platform MBeanServer
* as are other platform MBeans.
*
@ -116,108 +111,4 @@ public interface HotSpotDiagnosticMXBean extends PlatformManagedObject {
* ManagementPermission("control").
*/
public void setVMOption(String name, String value);
/**
* Returns the {@linkplain DiagnosticCommandInfo#getName() names}
* of all diagnostic commands.
* A diagnostic command is an action that can be invoked dynamically
* mainly for troubleshooting and diagnosis. The list of diagnostic
* commands may change at runtime. A diagnostic command may be
* {@linkplain DiagnosticCommandInfo#isEnabled disabled} but will
* not be removed from a previously returned list.
*
* @return the names of all diagnostic commands.
*
* @since 7u4
*/
public List<String> getDiagnosticCommands();
/**
* Returns a {@code DiagnosticCommandInfo} object describing the
* diagnostic command of the specified name {@code command}
*
* @param command a diagnostic command name
* @return a {@code DiagnosticCommandInfo} object
* @throws java.lang.IllegalArgumentException if the {@code command}
* doesn't match any diagnostic command registered in the
* targeted Java virtual machine.
*
* @since 7u4
*/
public DiagnosticCommandInfo getDiagnosticCommandInfo(String command);
/**
* Returns a list of {@code DiagnosticCommandInfo} object describing
* all diagnostic commands available on the targeted Java virtual machine
*
* @return a list of {@code DiagnosticCommandInfo} objects
*
* @since 7u4
*/
public List<DiagnosticCommandInfo> getDiagnosticCommandInfo();
/**
* Returns a list of {@code DiagnosticCommandInfo} object describing
* all diagnostic commands specified in the {@code commands} list.
*
* @param commands {@code List} of {@code String} containing diagnostic
* command names
* @return a {@code List} of {@code DiagnosticCommandInfo} objects
*
* @throws java.lang.IllegalArgumentException if at least one
* command specified in the {@code commands } list
* doesn't match any diagnostic command registered in the
* targeted Java virtual machine.
*
* @since 7u4
*/
public List<DiagnosticCommandInfo> getDiagnosticCommandInfo(List<String> commands);
/**
* Executes the command line {@code commandLine}. The command line must
* start with a diagnostic command name, optionally followed by parameters.
* Each command has its own syntax but the generic syntax for a diagnostic
* command line is:
* <blockquote>
* &lt;command name&gt; [&lt;option&gt;=&lt;value&gt;] [&lt;argument_value&gt;]
* </blockquote>
*
* @param commandLine command line to execute
* @return a {@code String} object containing the diagnostic command
* output.
*
* @throws java.lang.IllegalArgumentException if the command line doesn't
* match any diagnostic command registered in the virtual machine
* of if the parameters don't match the diagnostic command syntax.
* @throws java.lang.SecurityException
* if a security manager exists and the caller does not have
* ManagementPermission("control").
*
* @since 7u4
*/
public String execute(String commandLine);
/**
* Invokes the diagnostic command named {@code cmd} with the parameters
* specified in {@code args}. Each command has its own syntax but
* the generic syntax for parameters is:
* <blockquote>
* [&lt;option&gt;=&lt;value&gt;] [&lt;argument_value&gt;]
* </blockquote>
*
* @param cmd a diagnostic command name
* @param args the command parameters
* @return a {@code String} object containing the diagnostic command
* output.
*
* @throws java.lang.IllegalArgumentException if the command line doesn't
* match any diagnostic command registered in the virtual machine
* of if the parameters don't match the diagnostic command syntax.
* @throws java.lang.SecurityException
* if a security manager exists and the caller does not have
* ManagementPermission("control").
*
* @since 7u4
*/
public String execute(String cmd, String... args);
}

View File

@ -736,7 +736,7 @@ class DirectAudioDevice extends AbstractMixer {
if (off < 0) {
throw new ArrayIndexOutOfBoundsException(off);
}
if (off + len > b.length) {
if ((long)off + (long)len > (long)b.length) {
throw new ArrayIndexOutOfBoundsException(b.length);
}
@ -964,7 +964,7 @@ class DirectAudioDevice extends AbstractMixer {
if (off < 0) {
throw new ArrayIndexOutOfBoundsException(off);
}
if (off + len > b.length) {
if ((long)off + (long)len > (long)b.length) {
throw new ArrayIndexOutOfBoundsException(b.length);
}
if (!isActive() && doIO) {

View File

@ -130,6 +130,12 @@ public class SoftMixingSourceDataLine extends SoftMixingDataLine implements
if (len % framesize != 0)
throw new IllegalArgumentException(
"Number of bytes does not represent an integral number of sample frames.");
if (off < 0) {
throw new ArrayIndexOutOfBoundsException(off);
}
if ((long)off + (long)len > (long)b.length) {
throw new ArrayIndexOutOfBoundsException(b.length);
}
byte[] buff = cycling_buffer;
int buff_len = cycling_buffer.length;

View File

@ -94,7 +94,7 @@ public abstract class MessageInfo {
if (streamNumber < 0 || streamNumber > 65536)
throw new IllegalArgumentException("Invalid stream number");
return new sun.nio.ch.SctpMessageInfoImpl(null, address, streamNumber);
return new sun.nio.ch.sctp.MessageInfoImpl(null, address, streamNumber);
}
/**
* Creates a {@code MessageInfo} instance suitable for use when
@ -133,8 +133,8 @@ public abstract class MessageInfo {
if (streamNumber < 0 || streamNumber > 65536)
throw new IllegalArgumentException("Invalid stream number");
return new sun.nio.ch.SctpMessageInfoImpl(association, address,
streamNumber);
return new sun.nio.ch.sctp.MessageInfoImpl(association,
address, streamNumber);
}
/**

View File

@ -162,7 +162,7 @@ public abstract class SctpChannel
*/
public static SctpChannel open() throws
IOException {
return new sun.nio.ch.SctpChannelImpl((SelectorProvider)null);
return new sun.nio.ch.sctp.SctpChannelImpl((SelectorProvider)null);
}
/**

View File

@ -162,7 +162,7 @@ public abstract class SctpMultiChannel
*/
public static SctpMultiChannel open() throws
IOException {
return new sun.nio.ch.SctpMultiChannelImpl((SelectorProvider)null);
return new sun.nio.ch.sctp.SctpMultiChannelImpl((SelectorProvider)null);
}
/**

View File

@ -98,7 +98,7 @@ public abstract class SctpServerChannel
*/
public static SctpServerChannel open() throws
IOException {
return new sun.nio.ch.SctpServerChannelImpl((SelectorProvider)null);
return new sun.nio.ch.sctp.SctpServerChannelImpl((SelectorProvider)null);
}
/**

View File

@ -25,7 +25,7 @@
package com.sun.nio.sctp;
import java.net.SocketAddress;
import sun.nio.ch.SctpStdSocketOption;
import sun.nio.ch.sctp.SctpStdSocketOption;
/**
* SCTP channels supports the socket options defined by this class
@ -50,7 +50,7 @@ public class SctpStandardSocketOptions {
*/
public static final SctpSocketOption<Boolean> SCTP_DISABLE_FRAGMENTS = new
SctpStdSocketOption<Boolean>("SCTP_DISABLE_FRAGMENTS", Boolean.class,
sun.nio.ch.SctpStdSocketOption.SCTP_DISABLE_FRAGMENTS);
sun.nio.ch.sctp.SctpStdSocketOption.SCTP_DISABLE_FRAGMENTS);
/**
* Enables or disables explicit message completion.
@ -69,7 +69,7 @@ public class SctpStandardSocketOptions {
*/
public static final SctpSocketOption<Boolean> SCTP_EXPLICIT_COMPLETE = new
SctpStdSocketOption<Boolean>("SCTP_EXPLICIT_COMPLETE", Boolean.class,
sun.nio.ch.SctpStdSocketOption.SCTP_EXPLICIT_COMPLETE);
sun.nio.ch.sctp.SctpStdSocketOption.SCTP_EXPLICIT_COMPLETE);
/**
* Fragmented interleave controls how the presentation of messages occur
@ -120,7 +120,7 @@ public class SctpStandardSocketOptions {
public static final SctpSocketOption<Integer> SCTP_FRAGMENT_INTERLEAVE =
new SctpStdSocketOption<Integer>("SCTP_FRAGMENT_INTERLEAVE",
Integer.class,
sun.nio.ch.SctpStdSocketOption.SCTP_FRAGMENT_INTERLEAVE);
sun.nio.ch.sctp.SctpStdSocketOption.SCTP_FRAGMENT_INTERLEAVE);
/**
* The maximum number of streams requested by the local endpoint during
@ -171,7 +171,7 @@ public class SctpStandardSocketOptions {
*/
public static final SctpSocketOption<Boolean> SCTP_NODELAY =
new SctpStdSocketOption<Boolean>("SCTP_NODELAY", Boolean.class,
sun.nio.ch.SctpStdSocketOption.SCTP_NODELAY);
sun.nio.ch.sctp.SctpStdSocketOption.SCTP_NODELAY);
/**
* Requests that the local SCTP stack use the given peer address as
@ -246,7 +246,7 @@ public class SctpStandardSocketOptions {
*/
public static final SctpSocketOption<Integer> SO_SNDBUF =
new SctpStdSocketOption<Integer>("SO_SNDBUF", Integer.class,
sun.nio.ch.SctpStdSocketOption.SO_SNDBUF);
sun.nio.ch.sctp.SctpStdSocketOption.SO_SNDBUF);
/**
* The size of the socket receive buffer.
@ -273,7 +273,7 @@ public class SctpStandardSocketOptions {
*/
public static final SctpSocketOption<Integer> SO_RCVBUF =
new SctpStdSocketOption<Integer>("SO_RCVBUF", Integer.class,
sun.nio.ch.SctpStdSocketOption.SO_RCVBUF);
sun.nio.ch.sctp.SctpStdSocketOption.SO_RCVBUF);
/**
* Linger on close if data is present.
@ -304,7 +304,7 @@ public class SctpStandardSocketOptions {
*/
public static final SctpSocketOption<Integer> SO_LINGER =
new SctpStdSocketOption<Integer>("SO_LINGER", Integer.class,
sun.nio.ch.SctpStdSocketOption.SO_LINGER);
sun.nio.ch.sctp.SctpStdSocketOption.SO_LINGER);
/**
* This class is used to set the maximum number of inbound/outbound streams

View File

@ -115,7 +115,7 @@ public class List extends Component implements ItemSelectable, Accessible {
* @see #addItem(String)
* @see #getItem(int)
*/
Vector items = new Vector();
Vector<String> items = new Vector<>();
/**
* This field will represent the number of visible rows in the
@ -306,7 +306,7 @@ public class List extends Component implements ItemSelectable, Accessible {
// to insure that it cannot be overridden by client subclasses.
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
final String getItemImpl(int index) {
return (String)items.elementAt(index);
return items.elementAt(index);
}
/**
@ -415,7 +415,7 @@ public class List extends Component implements ItemSelectable, Accessible {
if (peer != null) {
peer.removeAll();
}
items = new Vector();
items = new Vector<>();
selected = new int[0];
}
@ -490,9 +490,9 @@ public class List extends Component implements ItemSelectable, Accessible {
public synchronized int[] getSelectedIndexes() {
ListPeer peer = (ListPeer)this.peer;
if (peer != null) {
selected = ((ListPeer)peer).getSelectedIndexes();
selected = peer.getSelectedIndexes();
}
return (int[])selected.clone();
return selected.clone();
}
/**
@ -908,7 +908,7 @@ public class List extends Component implements ItemSelectable, Accessible {
* @since 1.4
*/
public synchronized ItemListener[] getItemListeners() {
return (ItemListener[])(getListeners(ItemListener.class));
return getListeners(ItemListener.class);
}
/**
@ -975,7 +975,7 @@ public class List extends Component implements ItemSelectable, Accessible {
* @since 1.4
*/
public synchronized ActionListener[] getActionListeners() {
return (ActionListener[])(getListeners(ActionListener.class));
return getListeners(ActionListener.class);
}
/**

View File

@ -398,10 +398,10 @@ public class Window extends Container implements Accessible {
initIDs();
}
String s = (String) java.security.AccessController.doPrivileged(
String s = java.security.AccessController.doPrivileged(
new GetPropertyAction("java.awt.syncLWRequests"));
systemSyncLWRequests = (s != null && s.equals("true"));
s = (String) java.security.AccessController.doPrivileged(
s = java.security.AccessController.doPrivileged(
new GetPropertyAction("java.awt.Window.locationByPlatform"));
locationByPlatformProp = (s != null && s.equals("true"));
}
@ -1378,7 +1378,7 @@ public class Window extends Container implements Accessible {
// make sure the privileged action is only
// for getting the property! We don't want the
// above checkTopLevelWindow call to always succeed!
warningString = (String) AccessController.doPrivileged(
warningString = AccessController.doPrivileged(
new GetPropertyAction("awt.appletWarning",
"Java Applet Window"));
}

View File

@ -921,9 +921,9 @@ public class ICC_Profile implements Serializable {
*/
private static ICC_Profile getStandardProfile(final String name) {
return (ICC_Profile) AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
return AccessController.doPrivileged(
new PrivilegedAction<ICC_Profile>() {
public ICC_Profile run() {
ICC_Profile p = null;
try {
p = getInstance (name);

View File

@ -321,14 +321,15 @@ public abstract class InputEvent extends ComponentEvent {
* @param when a long int that gives the time the event occurred.
* Passing negative or zero value
* is not recommended
* @param modifiers the modifier keys down during event (e.g. shift, ctrl,
* alt, meta)
* Passing negative parameter is not recommended.
* Zero value means no modifiers.
* Either extended _DOWN_MASK or old _MASK modifiers
* should be used, but both models should not be mixed
* in one event. Use of the extended modifiers is
* preferred
* @param modifiers a modifier mask describing the modifier keys and mouse
* buttons (for example, shift, ctrl, alt, and meta) that
* are down during the event.
* Only extended modifiers are allowed to be used as a
* value for this parameter (see the {@link InputEvent#getModifiersEx}
* class for the description of extended modifiers).
* Passing negative parameter
* is not recommended.
* Zero value means that no modifiers were passed
* @throws IllegalArgumentException if <code>source</code> is null
* @see #getSource()
* @see #getID()
@ -416,9 +417,13 @@ public abstract class InputEvent extends ComponentEvent {
/**
* Returns the extended modifier mask for this event.
* <P>
* Extended modifiers are the modifiers that ends with the _DOWN_MASK suffix,
* such as ALT_DOWN_MASK, BUTTON1_DOWN_MASK, and others.
* <P>
* Extended modifiers represent the state of all modal keys,
* such as ALT, CTRL, META, and the mouse buttons just after
* the event occurred
* the event occurred.
* <P>
* For example, if the user presses <b>button 1</b> followed by
* <b>button 2</b>, and then releases them in the same order,

View File

@ -488,14 +488,15 @@ public class MouseEvent extends InputEvent {
* @param when A long integer that gives the time the event occurred.
* Passing negative or zero value
* is not recommended
* @param modifiers The modifier keys down during event (e.g. shift, ctrl,
* alt, meta)
* @param modifiers a modifier mask describing the modifier keys and mouse
* buttons (for example, shift, ctrl, alt, and meta) that
* are down during the event.
* Only extended modifiers are allowed to be used as a
* value for this parameter (see the {@link InputEvent#getModifiersEx}
* class for the description of extended modifiers).
* Passing negative parameter
* is not recommended.
* Zero value means that no modifiers were passed.
* Use either an extended _DOWN_MASK or old _MASK modifiers,
* however do not mix models in the one event.
* The extended modifiers are preferred for using
* Zero value means that no modifiers were passed
* @param x The horizontal x coordinate for the mouse location.
* It is allowed to pass negative values
* @param y The vertical y coordinate for the mouse location.
@ -586,14 +587,15 @@ public class MouseEvent extends InputEvent {
* @param when A long integer that gives the time the event occurred.
* Passing negative or zero value
* is not recommended
* @param modifiers The modifier keys down during event (e.g. shift, ctrl,
* alt, meta)
* @param modifiers a modifier mask describing the modifier keys and mouse
* buttons (for example, shift, ctrl, alt, and meta) that
* are down during the event.
* Only extended modifiers are allowed to be used as a
* value for this parameter (see the {@link InputEvent#getModifiersEx}
* class for the description of extended modifiers).
* Passing negative parameter
* is not recommended.
* Zero value means that no modifiers were passed.
* Use either an extended _DOWN_MASK or old _MASK modifiers,
* however do not mix models in the one event.
* The extended modifiers are preferred for using
* Zero value means that no modifiers were passed
* @param x The horizontal x coordinate for the mouse location.
* It is allowed to pass negative values
* @param y The vertical y coordinate for the mouse location.
@ -657,14 +659,15 @@ public class MouseEvent extends InputEvent {
* @param when A long integer that gives the time the event occurred.
* Passing negative or zero value
* is not recommended
* @param modifiers The modifier keys down during event (e.g. shift, ctrl,
* alt, meta)
* @param modifiers a modifier mask describing the modifier keys and mouse
* buttons (for example, shift, ctrl, alt, and meta) that
* are down during the event.
* Only extended modifiers are allowed to be used as a
* value for this parameter (see the {@link InputEvent#getModifiersEx}
* class for the description of extended modifiers).
* Passing negative parameter
* is not recommended.
* Zero value means that no modifiers were passed.
* Use either an extended _DOWN_MASK or old _MASK modifiers,
* however do not mix models in the one event.
* The extended modifiers are preferred for using
* Zero value means that no modifiers were passed
* @param x The horizontal x coordinate for the mouse location.
* It is allowed to pass negative values
* @param y The vertical y coordinate for the mouse location.

View File

@ -153,7 +153,7 @@ public class File
/**
* The FileSystem object representing the platform's local file system.
*/
static private FileSystem fs = FileSystem.getFileSystem();
private static final FileSystem fs = FileSystem.getFileSystem();
/**
* This abstract pathname's normalized pathname string. A normalized
@ -162,13 +162,13 @@ public class File
*
* @serial
*/
private String path;
private final String path;
/**
* The length of this abstract pathname's prefix, or zero if it has no
* prefix.
*/
private transient int prefixLength;
private final transient int prefixLength;
/**
* Returns the length of this abstract pathname's prefix.
@ -2023,10 +2023,28 @@ public class File
char sep = s.readChar(); // read the previous separator char
if (sep != separatorChar)
pathField = pathField.replace(sep, separatorChar);
this.path = fs.normalize(pathField);
this.prefixLength = fs.prefixLength(this.path);
String path = fs.normalize(pathField);
UNSAFE.putObject(this, PATH_OFFSET, path);
UNSAFE.putIntVolatile(this, PREFIX_LENGTH_OFFSET, fs.prefixLength(path));
}
private static final long PATH_OFFSET;
private static final long PREFIX_LENGTH_OFFSET;
private static final sun.misc.Unsafe UNSAFE;
static {
try {
sun.misc.Unsafe unsafe = sun.misc.Unsafe.getUnsafe();
PATH_OFFSET = unsafe.objectFieldOffset(
File.class.getDeclaredField("path"));
PREFIX_LENGTH_OFFSET = unsafe.objectFieldOffset(
File.class.getDeclaredField("prefixLength"));
UNSAFE = unsafe;
} catch (ReflectiveOperationException e) {
throw new Error(e);
}
}
/** use serialVersionUID from JDK 1.0.2 for interoperability */
private static final long serialVersionUID = 301077366599181567L;

View File

@ -123,14 +123,39 @@ public class ObjectStreamClass implements Serializable {
*/
private boolean hasBlockExternalData = true;
/**
* Contains information about InvalidClassException instances to be thrown
* when attempting operations on an invalid class. Note that instances of
* this class are immutable and are potentially shared among
* ObjectStreamClass instances.
*/
private static class ExceptionInfo {
private final String className;
private final String message;
ExceptionInfo(String cn, String msg) {
className = cn;
message = msg;
}
/**
* Returns (does not throw) an InvalidClassException instance created
* from the information in this object, suitable for being thrown by
* the caller.
*/
InvalidClassException newInvalidClassException() {
return new InvalidClassException(className, message);
}
}
/** exception (if any) thrown while attempting to resolve class */
private ClassNotFoundException resolveEx;
/** exception (if any) to throw if non-enum deserialization attempted */
private InvalidClassException deserializeEx;
private ExceptionInfo deserializeEx;
/** exception (if any) to throw if non-enum serialization attempted */
private InvalidClassException serializeEx;
private ExceptionInfo serializeEx;
/** exception (if any) to throw if default serialization attempted */
private InvalidClassException defaultSerializeEx;
private ExceptionInfo defaultSerializeEx;
/** serializable fields */
private ObjectStreamField[] fields;
@ -444,7 +469,8 @@ public class ObjectStreamClass implements Serializable {
fields = getSerialFields(cl);
computeFieldOffsets();
} catch (InvalidClassException e) {
serializeEx = deserializeEx = e;
serializeEx = deserializeEx =
new ExceptionInfo(e.classname, e.getMessage());
fields = NO_FIELDS;
}
@ -483,15 +509,14 @@ public class ObjectStreamClass implements Serializable {
if (deserializeEx == null) {
if (isEnum) {
deserializeEx = new InvalidClassException(name, "enum type");
deserializeEx = new ExceptionInfo(name, "enum type");
} else if (cons == null) {
deserializeEx = new InvalidClassException(
name, "no valid constructor");
deserializeEx = new ExceptionInfo(name, "no valid constructor");
}
}
for (int i = 0; i < fields.length; i++) {
if (fields[i].getField() == null) {
defaultSerializeEx = new InvalidClassException(
defaultSerializeEx = new ExceptionInfo(
name, "unmatched serializable field(s) declared");
}
}
@ -601,8 +626,8 @@ public class ObjectStreamClass implements Serializable {
(externalizable != localDesc.externalizable) ||
!(serializable || externalizable))
{
deserializeEx = new InvalidClassException(localDesc.name,
"class invalid for deserialization");
deserializeEx = new ExceptionInfo(
localDesc.name, "class invalid for deserialization");
}
}
@ -727,11 +752,7 @@ public class ObjectStreamClass implements Serializable {
*/
void checkDeserialize() throws InvalidClassException {
if (deserializeEx != null) {
InvalidClassException ice =
new InvalidClassException(deserializeEx.classname,
deserializeEx.getMessage());
ice.initCause(deserializeEx);
throw ice;
throw deserializeEx.newInvalidClassException();
}
}
@ -742,11 +763,7 @@ public class ObjectStreamClass implements Serializable {
*/
void checkSerialize() throws InvalidClassException {
if (serializeEx != null) {
InvalidClassException ice =
new InvalidClassException(serializeEx.classname,
serializeEx.getMessage());
ice.initCause(serializeEx);
throw ice;
throw serializeEx.newInvalidClassException();
}
}
@ -759,11 +776,7 @@ public class ObjectStreamClass implements Serializable {
*/
void checkDefaultSerialize() throws InvalidClassException {
if (defaultSerializeEx != null) {
InvalidClassException ice =
new InvalidClassException(defaultSerializeEx.classname,
defaultSerializeEx.getMessage());
ice.initCause(defaultSerializeEx);
throw ice;
throw defaultSerializeEx.newInvalidClassException();
}
}

View File

@ -81,6 +81,22 @@ import sun.misc.DoubleConsts;
* floating-point approximation. Not all approximations that have 1
* ulp accuracy will automatically meet the monotonicity requirements.
*
* <p>
* The platform uses signed two's complement integer arithmetic with
* int and long primitive types. The developer should choose
* the primitive type to ensure that arithmetic operations consistently
* produce correct results, which in some cases means the operations
* will not overflow the range of values of the computation.
* The best practice is to choose the primitive type and algorithm to avoid
* overflow. In cases where the size is {@code int} or {@code long} and
* overflow errors need to be detected, the methods {@code addExact},
* {@code subtractExact}, {@code multiplyExact}, and {@code toIntExact}
* throw an {@code ArithmeticException} when the results overflow.
* For other arithmetic operations such as divide, absolute value,
* increment, decrement, and negation overflow occurs only with
* a specific minimum or maximum value and should be checked against
* the minimum or maximum as appropriate.
*
* @author unascribed
* @author Joseph D. Darcy
* @since JDK1.0
@ -718,6 +734,137 @@ public final class Math {
return rnd.nextDouble();
}
/**
* Returns the sum of its arguments,
* throwing an exception if the result overflows an {@code int}.
*
* @param x the first value
* @param y the second value
* @return the result
* @throws ArithmeticException if the result overflows an int
*/
public static int addExact(int x, int y) {
int r = x + y;
// HD 2-12 Overflow iff both arguments have the opposite sign of the result
if (((x ^ r) & (y ^ r)) < 0) {
throw new ArithmeticException("integer overflow");
}
return r;
}
/**
* Returns the sum of its arguments,
* throwing an exception if the result overflows a {@code long}.
*
* @param x the first value
* @param y the second value
* @return the result
* @throws ArithmeticException if the result overflows a long
*/
public static long addExact(long x, long y) {
long r = x + y;
// HD 2-12 Overflow iff both arguments have the opposite sign of the result
if (((x ^ r) & (y ^ r)) < 0) {
throw new ArithmeticException("long overflow");
}
return r;
}
/**
* Returns the difference of the arguments,
* throwing an exception if the result overflows an {@code int}.
*
* @param x the first value
* @param y the second value to subtract from the first
* @return the result
* @throws ArithmeticException if the result overflows an int
*/
public static int subtractExact(int x, int y) {
int r = x - y;
// HD 2-12 Overflow iff the arguments have different signs and
// the sign of the result is different than the sign of x
if (((x ^ y) & (x ^ r)) < 0) {
throw new ArithmeticException("integer overflow");
}
return r;
}
/**
* Returns the difference of the arguments,
* throwing an exception if the result overflows a {@code long}.
*
* @param x the first value
* @param y the second value to subtract from the first
* @return the result
* @throws ArithmeticException if the result overflows a long
*/
public static long subtractExact(long x, long y) {
long r = x - y;
// HD 2-12 Overflow iff the arguments have different signs and
// the sign of the result is different than the sign of x
if (((x ^ y) & (x ^ r)) < 0) {
throw new ArithmeticException("long overflow");
}
return r;
}
/**
* Returns the product of the arguments,
* throwing an exception if the result overflows an {@code int}.
*
* @param x the first value
* @param y the second value
* @return the result
* @throws ArithmeticException if the result overflows an int
*/
public static int multiplyExact(int x, int y) {
long r = (long)x * (long)y;
if ((int)r != r) {
throw new ArithmeticException("long overflow");
}
return (int)r;
}
/**
* Returns the product of the arguments,
* throwing an exception if the result overflows a {@code long}.
*
* @param x the first value
* @param y the second value
* @return the result
* @throws ArithmeticException if the result overflows a long
*/
public static long multiplyExact(long x, long y) {
long r = x * y;
long ax = Math.abs(x);
long ay = Math.abs(y);
if (((ax | ay) >>> 31 != 0)) {
// Some bits greater than 2^31 that might cause overflow
// Check the result using the divide operator
// and check for the special case of Long.MIN_VALUE * -1
if (((y != 0) && (r / y != x)) ||
(x == Long.MIN_VALUE && y == -1)) {
throw new ArithmeticException("long overflow");
}
}
return r;
}
/**
* Returns the value of the {@code long} argument;
* throwing an exception if the value overflows an {@code int}.
*
* @param value the long value
* @return the argument as an int
* @throws ArithmeticException if the {@code argument} overflows an int
*/
public static int toIntExact(long value) {
if ((int)value != value) {
throw new ArithmeticException("integer overflow");
}
return (int)value;
}
/**
* Returns the absolute value of an {@code int} value.
* If the argument is not negative, the argument is returned.
@ -1737,7 +1884,7 @@ public final class Math {
}
/**
* Return {@code d} &times;
* Returns {@code d} &times;
* 2<sup>{@code scaleFactor}</sup> rounded as if performed
* by a single correctly rounded floating-point multiply to a
* member of the double value set. See the Java
@ -1844,7 +1991,7 @@ public final class Math {
}
/**
* Return {@code f} &times;
* Returns {@code f} &times;
* 2<sup>{@code scaleFactor}</sup> rounded as if performed
* by a single correctly rounded floating-point multiply to a
* member of the float value set. See the Java

View File

@ -56,6 +56,22 @@ import sun.misc.DoubleConsts;
* {@code sinh}, {@code cosh}, {@code tanh},
* {@code hypot}, {@code expm1}, and {@code log1p}.
*
* <p>
* The platform uses signed two's complement integer arithmetic with
* int and long primitive types. The developer should choose
* the primitive type to ensure that arithmetic operations consistently
* produce correct results, which in some cases means the operations
* will not overflow the range of values of the computation.
* The best practice is to choose the primitive type and algorithm to avoid
* overflow. In cases where the size is {@code int} or {@code long} and
* overflow errors need to be detected, the methods {@code addExact},
* {@code subtractExact}, {@code multiplyExact}, and {@code toIntExact}
* throw an {@code ArithmeticException} when the results overflow.
* For other arithmetic operations such as divide, absolute value,
* increment, decrement, and negation overflow occurs only with
* a specific minimum or maximum value and should be checked against
* the minimum or maximum as appropriate.
*
* @author unascribed
* @author Joseph D. Darcy
* @since 1.3
@ -699,7 +715,111 @@ public final class StrictMath {
}
/**
* Returns the absolute value of an {@code int} value..
* Returns the sum of its arguments,
* throwing an exception if the result overflows an {@code int}.
*
* @param x the first value
* @param y the second value
* @return the result
* @throws ArithmeticException if the result overflows an int
* @see Math#addExact(int,int)
* @since 1.8
*/
public static int addExact(int x, int y) {
return Math.addExact(x, y);
}
/**
* Returns the sum of its arguments,
* throwing an exception if the result overflows a {@code long}.
*
* @param x the first value
* @param y the second value
* @return the result
* @throws ArithmeticException if the result overflows a long
* @see Math#addExact(long,long)
* @since 1.8
*/
public static long addExact(long x, long y) {
return Math.addExact(x, y);
}
/**
* Return the difference of the arguments,
* throwing an exception if the result overflows an {@code int}.
*
* @param x the first value
* @param y the second value to subtract from the first
* @return the result
* @throws ArithmeticException if the result overflows an int
* @see Math#subtractExact(int,int)
* @since 1.8
*/
public static int subtractExact(int x, int y) {
return Math.subtractExact(x, y);
}
/**
* Return the difference of the arguments,
* throwing an exception if the result overflows a {@code long}.
*
* @param x the first value
* @param y the second value to subtract from the first
* @return the result
* @throws ArithmeticException if the result overflows a long
* @see Math#subtractExact(long,long)
* @since 1.8
*/
public static long subtractExact(long x, long y) {
return Math.subtractExact(x, y);
}
/**
* Return the product of the arguments,
* throwing an exception if the result overflows an {@code int}.
*
* @param x the first value
* @param y the second value
* @return the result
* @throws ArithmeticException if the result overflows an int
* @see Math#multiplyExact(int,int)
* @since 1.8
*/
public static int multiplyExact(int x, int y) {
return Math.multiplyExact(x, y);
}
/**
* Return the product of the arguments,
* throwing an exception if the result overflows a {@code long}.
*
* @param x the first value
* @param y the second value
* @return the result
* @throws ArithmeticException if the result overflows a long
* @see Math#multiplyExact(long,long)
* @since 1.8
*/
public static long multiplyExact(long x, long y) {
return Math.multiplyExact(x, y);
}
/**
* Return the value of the {@code long} argument;
* throwing an exception if the value overflows an {@code int}.
*
* @param value the long value
* @return the argument as an int
* @throws ArithmeticException if the {@code argument} overflows an int
* @see Math#toIntExact(int)
* @since 1.8
*/
public static int toIntExact(long value) {
return Math.toIntExact(value);
}
/**
* Returns the absolute value of an {@code int} value.
* If the argument is not negative, the argument is returned.
* If the argument is negative, the negation of the argument is returned.
*

View File

@ -1099,6 +1099,19 @@ public final class System {
*/
public static native String mapLibraryName(String libname);
/**
* Create PrintStream for stdout/err based on encoding.
*/
private static PrintStream newPrintStream(FileOutputStream fos, String enc) {
if (enc != null) {
try {
return new PrintStream(new BufferedOutputStream(fos, 128), true, enc);
} catch (UnsupportedEncodingException uee) {}
}
return new PrintStream(new BufferedOutputStream(fos, 128), true);
}
/**
* Initialize the system class. Called after thread initialization.
*/
@ -1139,8 +1152,9 @@ public final class System {
FileOutputStream fdOut = new FileOutputStream(FileDescriptor.out);
FileOutputStream fdErr = new FileOutputStream(FileDescriptor.err);
setIn0(new BufferedInputStream(fdIn));
setOut0(new PrintStream(new BufferedOutputStream(fdOut, 128), true));
setErr0(new PrintStream(new BufferedOutputStream(fdErr, 128), true));
setOut0(newPrintStream(fdOut, props.getProperty("sun.stdout.encoding")));
setErr0(newPrintStream(fdErr, props.getProperty("sun.stderr.encoding")));
// Load the zip library now in order to keep java.util.zip.ZipFile
// from trying to use itself to load this library later.
loadLibrary("zip");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -46,12 +46,17 @@ at the permission allows, and associated risks">
* <tr>
* <td>control</td>
* <td>Ability to control the runtime characteristics of the Java virtual
* machine, for example, setting the -verbose:gc and -verbose:class flag,
* setting the threshold of a memory pool, and enabling and disabling
* the thread contention monitoring support.
* machine, for example, enabling and disabling the verbose output for
* the class loading or memory system, setting the threshold of a memory
* pool, and enabling and disabling the thread contention monitoring
* support. Some actions controlled by this permission can disclose
* information about the running application, like the -verbose:class
* flag.
* </td>
* <td>This allows an attacker to control the runtime characteristics
* of the Java virtual machine and cause the system to misbehave.
* of the Java virtual machine and cause the system to misbehave. An
* attacker can also access some information related to the running
* application.
* </td>
* </tr>
* <tr>

View File

@ -43,6 +43,8 @@ import java.lang.ref.SoftReference;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.concurrent.ConcurrentHashMap;
import sun.misc.SharedSecrets;
import sun.misc.JavaAWTAccess;
import sun.security.action.GetPropertyAction;
import sun.util.TimeZoneNameUtility;
import sun.util.calendar.ZoneInfo;
@ -615,7 +617,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* method doesn't create a clone.
*/
static TimeZone getDefaultRef() {
TimeZone defaultZone = defaultZoneTL.get();
TimeZone defaultZone = getDefaultInAppContext();
if (defaultZone == null) {
defaultZone = defaultTimeZone;
if (defaultZone == null) {
@ -706,10 +708,65 @@ abstract public class TimeZone implements Serializable, Cloneable {
if (hasPermission()) {
synchronized (TimeZone.class) {
defaultTimeZone = zone;
defaultZoneTL.set(null);
setDefaultInAppContext(null);
}
} else {
defaultZoneTL.set(zone);
setDefaultInAppContext(zone);
}
}
/**
* Returns the default TimeZone in an AppContext if any AppContext
* has ever used. null is returned if any AppContext hasn't been
* used or if the AppContext doesn't have the default TimeZone.
*/
private synchronized static TimeZone getDefaultInAppContext() {
// JavaAWTAccess provides access implementation-private methods without using reflection.
JavaAWTAccess javaAWTAccess = SharedSecrets.getJavaAWTAccess();
// Note that javaAWTAccess may be null if sun.awt.AppContext class hasn't
// been loaded. If so, it implies that AWTSecurityManager is not our
// SecurityManager and we can use a local static variable.
// This works around a build time issue.
if (javaAWTAccess == null) {
return mainAppContextDefault;
} else {
if (!javaAWTAccess.isDisposed()) {
TimeZone tz = (TimeZone)
javaAWTAccess.get(TimeZone.class);
if (tz == null && javaAWTAccess.isMainAppContext()) {
return mainAppContextDefault;
} else {
return tz;
}
}
}
return null;
}
/**
* Sets the default TimeZone in the AppContext to the given
* tz. null is handled special: do nothing if any AppContext
* hasn't been used, remove the default TimeZone in the
* AppContext otherwise.
*/
private synchronized static void setDefaultInAppContext(TimeZone tz) {
// JavaAWTAccess provides access implementation-private methods without using reflection.
JavaAWTAccess javaAWTAccess = SharedSecrets.getJavaAWTAccess();
// Note that javaAWTAccess may be null if sun.awt.AppContext class hasn't
// been loaded. If so, it implies that AWTSecurityManager is not our
// SecurityManager and we can use a local static variable.
// This works around a build time issue.
if (javaAWTAccess == null) {
mainAppContextDefault = tz;
} else {
if (!javaAWTAccess.isDisposed()) {
javaAWTAccess.put(TimeZone.class, tz);
if (javaAWTAccess.isMainAppContext()) {
mainAppContextDefault = null;
}
}
}
}
@ -760,12 +817,13 @@ abstract public class TimeZone implements Serializable, Cloneable {
*/
private String ID;
private static volatile TimeZone defaultTimeZone;
private static final InheritableThreadLocal<TimeZone> defaultZoneTL
= new InheritableThreadLocal<TimeZone>();
static final String GMT_ID = "GMT";
private static final int GMT_ID_LENGTH = 3;
// a static TimeZone we can reference if no AppContext is in place
private static TimeZone mainAppContextDefault;
/**
* Parses a custom time zone identifier and returns a corresponding zone.
* This method doesn't support the RFC 822 time zone format. (e.g., +hhmm)

View File

@ -34,8 +34,10 @@
*/
package java.util.concurrent.atomic;
import java.lang.reflect.Array;
import java.util.Arrays;
import sun.misc.Unsafe;
import java.util.*;
/**
* An array of object references in which elements may be updated
@ -49,13 +51,23 @@ import java.util.*;
public class AtomicReferenceArray<E> implements java.io.Serializable {
private static final long serialVersionUID = -6209656149925076980L;
private static final Unsafe unsafe = Unsafe.getUnsafe();
private static final int base = unsafe.arrayBaseOffset(Object[].class);
private static final Unsafe unsafe;
private static final int base;
private static final int shift;
private final Object[] array;
private static final long arrayFieldOffset;
private final Object[] array; // must have exact type Object[]
static {
int scale = unsafe.arrayIndexScale(Object[].class);
int scale;
try {
unsafe = Unsafe.getUnsafe();
arrayFieldOffset = unsafe.objectFieldOffset
(AtomicReferenceArray.class.getDeclaredField("array"));
base = unsafe.arrayBaseOffset(Object[].class);
scale = unsafe.arrayIndexScale(Object[].class);
} catch (Exception e) {
throw new Error(e);
}
if ((scale & (scale - 1)) != 0)
throw new Error("data type scale not a power of two");
shift = 31 - Integer.numberOfLeadingZeros(scale);
@ -91,7 +103,7 @@ public class AtomicReferenceArray<E> implements java.io.Serializable {
*/
public AtomicReferenceArray(E[] array) {
// Visibility guaranteed by final field guarantees
this.array = array.clone();
this.array = Arrays.copyOf(array, array.length, Object[].class);
}
/**
@ -197,7 +209,7 @@ public class AtomicReferenceArray<E> implements java.io.Serializable {
* @return the String representation of the current values of array
*/
public String toString() {
int iMax = array.length - 1;
int iMax = array.length - 1;
if (iMax == -1)
return "[]";
@ -211,4 +223,19 @@ public class AtomicReferenceArray<E> implements java.io.Serializable {
}
}
/**
* Reconstitutes the instance from a stream (that is, deserializes it).
* @param s the stream
*/
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
// Note: This must be changed if any additional fields are defined
Object a = s.readFields().get("array", null);
if (a == null || !a.getClass().isArray())
throw new java.io.InvalidObjectException("Not array type");
if (a.getClass() != Object[].class)
a = Arrays.copyOf((Object[])a, Array.getLength(a), Object[].class);
unsafe.putObjectVolatile(this, arrayFieldOffset, a);
}
}

View File

@ -71,7 +71,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
* @param size the initial number of attributes
*/
public Attributes(int size) {
map = new HashMap(size);
map = new HashMap<>(size);
}
/**
@ -81,7 +81,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
* @param attr the specified Attributes
*/
public Attributes(Attributes attr) {
map = new HashMap(attr);
map = new HashMap<>(attr);
}
@ -296,9 +296,9 @@ public class Attributes implements Map<Object,Object>, Cloneable {
* XXX Need to handle UTF8 values and break up lines longer than 72 bytes
*/
void write(DataOutputStream os) throws IOException {
Iterator it = entrySet().iterator();
Iterator<Map.Entry<Object, Object>> it = entrySet().iterator();
while (it.hasNext()) {
Map.Entry e = (Map.Entry)it.next();
Map.Entry<Object, Object> e = it.next();
StringBuffer buffer = new StringBuffer(
((Name)e.getKey()).toString());
buffer.append(": ");
@ -340,9 +340,9 @@ public class Attributes implements Map<Object,Object>, Cloneable {
// write out all attributes except for the version
// we wrote out earlier
Iterator it = entrySet().iterator();
Iterator<Map.Entry<Object, Object>> it = entrySet().iterator();
while (it.hasNext()) {
Map.Entry e = (Map.Entry)it.next();
Map.Entry<Object, Object> e = it.next();
String name = ((Name)e.getKey()).toString();
if ((version != null) && ! (name.equalsIgnoreCase(vername))) {
@ -499,7 +499,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
*/
public boolean equals(Object o) {
if (o instanceof Name) {
Comparator c = ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER;
Comparator<String> c = ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER;
return c.compare(name, ((Name)o).name) == 0;
} else {
return false;

Some files were not shown because too many files have changed in this diff Show More