This commit is contained in:
Jiangli Zhou 2014-10-14 13:43:47 -04:00
commit 5b06cbcdad
322 changed files with 15522 additions and 2912 deletions

View File

@ -275,3 +275,5 @@ c36c0092693707a8255561433647e8c3cd724ccd jdk9-b29
b2287cac7813c70ed7f679d9a46fe774bd4005f8 jdk9-b30
9d0e6639a4d71b63507dd94b1a028e963b27e798 jdk9-b31
1b1ec4291abc0ba6da7bf79b754f08dd759a4a0c jdk9-b32
f0c5e4b732da823bdaa4184133675f384e7cd68d jdk9-b33
9618201c5df28a460631577fad1f61e96f775c34 jdk9-b34

View File

@ -275,3 +275,5 @@ ea2f7981236f3812436958748ab3d26e80a35130 jdk9-b28
36e9bc875325813ac9c44ac0c617a463091fa9f5 jdk9-b30
69a84c16d9c28e0e3d504b9c8766c24bafcd58f6 jdk9-b31
7e3512dae8e020d44399c0f1c579ff1fe3090ed6 jdk9-b32
e4ba01b726e263953ae129be37c94de6ed145b1d jdk9-b33
087b23f35631e68e950496a36fce8ccca612966a jdk9-b34

View File

@ -48,6 +48,13 @@ BUILD_OUTPUT:=@BUILD_OUTPUT@/bootcycle-build
# Use a different Boot JDK
OLD_BOOT_JDK:=$(BOOT_JDK)
BOOT_JDK:=@BUILD_OUTPUT@/images/j2sdk-image
BOOT_RTJAR:=@BUILD_OUTPUT@/images/j2sdk-image/jre/lib/rt.jar
BOOT_RTJAR:=$(BOOT_JDK)/jre/lib/rt.jar
JAVA_CMD:=$(BOOT_JDK)/bin/java
JAVAC_CMD:=$(BOOT_JDK)/bin/javac
JAVAH_CMD:=$(BOOT_JDK)/bin/javah
JAR_CMD:=$(BOOT_JDK)/bin/jar
NATIVE2ASCII_CMD:=$(BOOT_JDK)/bin/native2ascii
JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner
SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD)
SJAVAC_SERVER_JAVA:=$(subst $(OLD_BOOT_JDK),$(BOOT_JDK),$(SJAVAC_SERVER_JAVA))

View File

@ -296,7 +296,7 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
AC_SUBST(SJAVAC_SERVER_JAVA)
if test "$MEMORY_SIZE" -gt "3000"; then
ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA_FLAGS,[$SJAVAC_SERVER_JAVA])
if test "$JVM_ARG_OK" = true; then
JVM_64BIT=true
JVM_ARG_OK=false
@ -320,7 +320,8 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
if test "$MX_VALUE" -lt "512"; then
MX_VALUE=512
fi
ADD_JVM_ARG_IF_OK([-Xms${MS_VALUE}M -Xmx${MX_VALUE}M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms${MS_VALUE}M -Xmx${MX_VALUE}M],SJAVAC_SERVER_JAVA_FLAGS,[$SJAVAC_SERVER_JAVA])
AC_SUBST(SJAVAC_SERVER_JAVA_FLAGS)
AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac],
[use sjavac to do fast incremental compiles @<:@disabled@:>@])],

View File

@ -633,6 +633,7 @@ CCACHE
USE_PRECOMPILED_HEADER
SJAVAC_SERVER_DIR
ENABLE_SJAVAC
SJAVAC_SERVER_JAVA_FLAGS
SJAVAC_SERVER_JAVA
JAVA_TOOL_FLAGS_SMALL
JAVA_FLAGS_SMALL
@ -4327,7 +4328,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1410791401
DATE_WHEN_GENERATED=1412599039
###############################################################################
#
@ -50472,7 +50473,7 @@ fi
FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn`
FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""`
if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -d64"
SJAVAC_SERVER_JAVA_FLAGS="$SJAVAC_SERVER_JAVA_FLAGS -d64"
JVM_ARG_OK=true
else
$ECHO "Arg failed:" >&5
@ -50510,7 +50511,7 @@ fi
FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn`
FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""`
if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms${MS_VALUE}M -Xmx${MX_VALUE}M"
SJAVAC_SERVER_JAVA_FLAGS="$SJAVAC_SERVER_JAVA_FLAGS -Xms${MS_VALUE}M -Xmx${MX_VALUE}M"
JVM_ARG_OK=true
else
$ECHO "Arg failed:" >&5
@ -50519,6 +50520,7 @@ fi
fi
# Check whether --enable-sjavac was given.
if test "${enable_sjavac+set}" = set; then :
enableval=$enable_sjavac; ENABLE_SJAVAC="${enableval}"

View File

@ -256,7 +256,8 @@ NASHORN_DIST=$(NASHORN_OUTPUTDIR)/dist
BUILD_HOTSPOT=@BUILD_HOTSPOT@
# The boot jdk to use
# The boot jdk to use. These are overridden in bootcycle-spec.gmk. Make sure to keep
# them in sync.
BOOT_JDK:=@BOOT_JDK@
BOOT_RTJAR:=@BOOT_RTJAR@
BOOT_TOOLSJAR=$(BOOT_JDK)/lib/tools.jar
@ -453,23 +454,35 @@ JAVA_FLAGS:=@JAVA_FLAGS@
JAVA_FLAGS_BIG:=@JAVA_FLAGS_BIG@
JAVA_FLAGS_SMALL:=@JAVA_FLAGS_SMALL@
JAVA_TOOL_FLAGS_SMALL:=@JAVA_TOOL_FLAGS_SMALL@
SJAVAC_SERVER_JAVA_FLAGS:=@SJAVAC_SERVER_JAVA_FLAGS@
JAVA=@FIXPATH@ @JAVA@ $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)
JAVA_SMALL=@FIXPATH@ @JAVA@ $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS)
# The *_CMD variables are defined separately to be easily overridden in bootcycle-spec.gmk
# for bootcycle-images build. Make sure to keep them in sync. Do not use the *_CMD
# versions of the variables directly.
JAVA_CMD:=@JAVA@
JAVAC_CMD:=@JAVAC@
JAVAH_CMD:=@JAVAH@
JAR_CMD:=@JAR@
NATIVE2ASCII_CMD:=@NATIVE2ASCII@
JARSIGNER_CMD:=@JARSIGNER@
SJAVAC_SERVER_JAVA_CMD:=@SJAVAC_SERVER_JAVA@
# These variables are meant to be used. They are defined with = instead of := to make
# it possible to override only the *_CMD variables.
JAVA=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)
JAVA_SMALL=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS)
JAVAC=@FIXPATH@ $(JAVAC_CMD)
JAVAH=@FIXPATH@ $(JAVAH_CMD)
JAR=@FIXPATH@ $(JAR_CMD)
NATIVE2ASCII=@FIXPATH@ $(NATIVE2ASCII_CMD) $(JAVA_TOOL_FLAGS_SMALL)
JARSIGNER=@FIXPATH@ $(JARSIGNER_CMD)
# A specific java binary with specific options can be used to run
# the long running background sjavac servers and other long running tasks.
SJAVAC_SERVER_JAVA=@FIXPATH@ $(SJAVAC_SERVER_JAVA_CMD) $(SJAVAC_SERVER_JAVA_FLAGS)
JAVAC:=@FIXPATH@ @JAVAC@
# Hotspot sets this variable before reading the SPEC when compiling sa-jdi.jar. Avoid
# overriding that value by using ?=.
JAVAC_FLAGS?=@JAVAC_FLAGS@
JAVAH:=@FIXPATH@ @JAVAH@
JAR:=@FIXPATH@ @JAR@
NATIVE2ASCII:=@FIXPATH@ @NATIVE2ASCII@ $(JAVA_TOOL_FLAGS_SMALL)
JARSIGNER:=@FIXPATH@ @JARSIGNER@
# You run the new javac using the boot jdk with $(BOOT_JDK)/bin/java $(NEW_JAVAC) ...
INTERIM_LANGTOOLS_JAR := $(LANGTOOLS_OUTPUTDIR)/dist/interim_langtools.jar
INTERIM_LANGTOOLS_ARGS := "-Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR)" -cp $(INTERIM_LANGTOOLS_JAR)
@ -486,10 +499,6 @@ ifndef RC_FLAGS
RC_FLAGS:=@RC_FLAGS@
endif
# A specific java binary with specific options can be used to run
# the long running background sjavac servers and other long running tasks.
SJAVAC_SERVER_JAVA:=@FIXPATH@ @SJAVAC_SERVER_JAVA@
# Tools adhering to a minimal and common standard of posix compliance.
AWK:=@AWK@
BASENAME:=@BASENAME@

View File

@ -275,3 +275,5 @@ a00b04ef067e39f50b9a0fea6f1904e35d632a73 jdk9-b28
98967ae6ae53ebf15615e07cd5a6b1ae04dfd84c jdk9-b30
c432b80aadd0cb2b2361b02add4d671957d4cec9 jdk9-b31
b5b139354630edb2d06190bf31653acbdcea63a8 jdk9-b32
cfdac5887952c2dd73c73a1d8d9aa880d0539bbf jdk9-b33
24a0bad5910f775bb4002d1dacf8b3af87c63cd8 jdk9-b34

View File

@ -51,13 +51,11 @@ $(eval $(call SetupJavaCompilation,BUILD_INTERIM_CORBA, \
JAR := $(INTERIM_CORBA_JAR)))
################################################################################
# Copy idl files straight to jdk/lib. Not sure if this is the right way to do
# it, but we are moving away from the one repo at a time build. Perhaps we should
# scrap the 'jdk' prefix to bin, lib etc?
$(JDK_OUTPUTDIR)/lib/%: $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/%
# Copy idl files straight to jdk/include.
$(JDK_OUTPUTDIR)/include/%: $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/%
$(install-file)
IDL_TARGET_FILES := $(JDK_OUTPUTDIR)/lib/orb.idl $(JDK_OUTPUTDIR)/lib/ir.idl
IDL_TARGET_FILES := $(JDK_OUTPUTDIR)/include/orb.idl $(JDK_OUTPUTDIR)/include/ir.idl
################################################################################

View File

@ -435,3 +435,5 @@ deb29e92f68ace2808a36ecfa18c7d61dcb645bb jdk9-b29
5c722dffbc0f34eb8d903dca7b261e52248fa17e jdk9-b30
9f7d155d28e519f3e4645dc21cf185c25f3176ed jdk9-b31
af46576a8d7cb4003028b8ee8bf408cfe227315b jdk9-b32
9b3f5e4f33725f7c1d9b8e523133fe8383a54d9f jdk9-b33
821164b0131a47ca065697c7d27d8f215e608c8d jdk9-b34

View File

@ -67,7 +67,6 @@ MAPFILE = $(GAMMADIR)/make/aix/makefiles/mapfile-vers-debug
# not justified.
LFLAGS_QIPA=
G_SUFFIX = _g
VERSION = optimized
SYSDEFS += -DASSERT -DFASTDEBUG
PICFLAGS = DEFAULT

View File

@ -268,8 +268,35 @@ class Assembler : public AbstractAssembler {
ISEL_OPCODE = (31u << OPCODE_SHIFT | 15u << 1),
MTLR_OPCODE = (31u << OPCODE_SHIFT | 467u << 1 | 8 << SPR_0_4_SHIFT),
MFLR_OPCODE = (31u << OPCODE_SHIFT | 339u << 1 | 8 << SPR_0_4_SHIFT),
// Special purpose registers
MTSPR_OPCODE = (31u << OPCODE_SHIFT | 467u << 1),
MFSPR_OPCODE = (31u << OPCODE_SHIFT | 339u << 1),
MTXER_OPCODE = (MTSPR_OPCODE | 1 << SPR_0_4_SHIFT),
MFXER_OPCODE = (MFSPR_OPCODE | 1 << SPR_0_4_SHIFT),
MTDSCR_OPCODE = (MTSPR_OPCODE | 3 << SPR_0_4_SHIFT),
MFDSCR_OPCODE = (MFSPR_OPCODE | 3 << SPR_0_4_SHIFT),
MTLR_OPCODE = (MTSPR_OPCODE | 8 << SPR_0_4_SHIFT),
MFLR_OPCODE = (MFSPR_OPCODE | 8 << SPR_0_4_SHIFT),
MTCTR_OPCODE = (MTSPR_OPCODE | 9 << SPR_0_4_SHIFT),
MFCTR_OPCODE = (MFSPR_OPCODE | 9 << SPR_0_4_SHIFT),
MTTFHAR_OPCODE = (MTSPR_OPCODE | 128 << SPR_0_4_SHIFT),
MFTFHAR_OPCODE = (MFSPR_OPCODE | 128 << SPR_0_4_SHIFT),
MTTFIAR_OPCODE = (MTSPR_OPCODE | 129 << SPR_0_4_SHIFT),
MFTFIAR_OPCODE = (MFSPR_OPCODE | 129 << SPR_0_4_SHIFT),
MTTEXASR_OPCODE = (MTSPR_OPCODE | 130 << SPR_0_4_SHIFT),
MFTEXASR_OPCODE = (MFSPR_OPCODE | 130 << SPR_0_4_SHIFT),
MTTEXASRU_OPCODE = (MTSPR_OPCODE | 131 << SPR_0_4_SHIFT),
MFTEXASRU_OPCODE = (MFSPR_OPCODE | 131 << SPR_0_4_SHIFT),
MTVRSAVE_OPCODE = (MTSPR_OPCODE | 256 << SPR_0_4_SHIFT),
MFVRSAVE_OPCODE = (MFSPR_OPCODE | 256 << SPR_0_4_SHIFT),
MFTB_OPCODE = (MFSPR_OPCODE | 268 << SPR_0_4_SHIFT),
MTCRF_OPCODE = (31u << OPCODE_SHIFT | 144u << 1),
MFCR_OPCODE = (31u << OPCODE_SHIFT | 19u << 1),
@ -291,9 +318,6 @@ class Assembler : public AbstractAssembler {
// CTR-related opcodes
BCCTR_OPCODE = (19u << OPCODE_SHIFT | 528u << 1),
MTCTR_OPCODE = (31u << OPCODE_SHIFT | 467u << 1 | 9 << SPR_0_4_SHIFT),
MFCTR_OPCODE = (31u << OPCODE_SHIFT | 339u << 1 | 9 << SPR_0_4_SHIFT),
LWZ_OPCODE = (32u << OPCODE_SHIFT),
LWZX_OPCODE = (31u << OPCODE_SHIFT | 23u << 1),
@ -585,6 +609,37 @@ class Assembler : public AbstractAssembler {
MTVSCR_OPCODE = (4u << OPCODE_SHIFT | 1604u ),
MFVSCR_OPCODE = (4u << OPCODE_SHIFT | 1540u ),
// AES (introduced with Power 8)
VCIPHER_OPCODE = (4u << OPCODE_SHIFT | 1288u),
VCIPHERLAST_OPCODE = (4u << OPCODE_SHIFT | 1289u),
VNCIPHER_OPCODE = (4u << OPCODE_SHIFT | 1352u),
VNCIPHERLAST_OPCODE = (4u << OPCODE_SHIFT | 1353u),
VSBOX_OPCODE = (4u << OPCODE_SHIFT | 1480u),
// SHA (introduced with Power 8)
VSHASIGMAD_OPCODE = (4u << OPCODE_SHIFT | 1730u),
VSHASIGMAW_OPCODE = (4u << OPCODE_SHIFT | 1666u),
// Vector Binary Polynomial Multiplication (introduced with Power 8)
VPMSUMB_OPCODE = (4u << OPCODE_SHIFT | 1032u),
VPMSUMD_OPCODE = (4u << OPCODE_SHIFT | 1224u),
VPMSUMH_OPCODE = (4u << OPCODE_SHIFT | 1096u),
VPMSUMW_OPCODE = (4u << OPCODE_SHIFT | 1160u),
// Vector Permute and Xor (introduced with Power 8)
VPERMXOR_OPCODE = (4u << OPCODE_SHIFT | 45u),
// Transactional Memory instructions (introduced with Power 8)
TBEGIN_OPCODE = (31u << OPCODE_SHIFT | 654u << 1),
TEND_OPCODE = (31u << OPCODE_SHIFT | 686u << 1),
TABORT_OPCODE = (31u << OPCODE_SHIFT | 910u << 1),
TABORTWC_OPCODE = (31u << OPCODE_SHIFT | 782u << 1),
TABORTWCI_OPCODE = (31u << OPCODE_SHIFT | 846u << 1),
TABORTDC_OPCODE = (31u << OPCODE_SHIFT | 814u << 1),
TABORTDCI_OPCODE = (31u << OPCODE_SHIFT | 878u << 1),
TSR_OPCODE = (31u << OPCODE_SHIFT | 750u << 1),
TCHECK_OPCODE = (31u << OPCODE_SHIFT | 718u << 1),
// Icache and dcache related instructions
DCBA_OPCODE = (31u << OPCODE_SHIFT | 758u << 1),
DCBZ_OPCODE = (31u << OPCODE_SHIFT | 1014u << 1),
@ -1420,6 +1475,25 @@ class Assembler : public AbstractAssembler {
inline void mcrf( ConditionRegister crd, ConditionRegister cra);
inline void mtcr( Register s);
// Special purpose registers
// Exception Register
inline void mtxer(Register s1);
inline void mfxer(Register d);
// Vector Register Save Register
inline void mtvrsave(Register s1);
inline void mfvrsave(Register d);
// Timebase
inline void mftb(Register d);
// Introduced with Power 8:
// Data Stream Control Register
inline void mtdscr(Register s1);
inline void mfdscr(Register d );
// Transactional Memory Registers
inline void mftfhar(Register d);
inline void mftfiar(Register d);
inline void mftexasr(Register d);
inline void mftexasru(Register d);
// PPC 1, section 2.4.1 Branch Instructions
inline void b( address a, relocInfo::relocType rt = relocInfo::none);
inline void b( Label& L);
@ -1860,6 +1934,39 @@ class Assembler : public AbstractAssembler {
inline void mtvscr( VectorRegister b);
inline void mfvscr( VectorRegister d);
// AES (introduced with Power 8)
inline void vcipher( VectorRegister d, VectorRegister a, VectorRegister b);
inline void vcipherlast( VectorRegister d, VectorRegister a, VectorRegister b);
inline void vncipher( VectorRegister d, VectorRegister a, VectorRegister b);
inline void vncipherlast(VectorRegister d, VectorRegister a, VectorRegister b);
inline void vsbox( VectorRegister d, VectorRegister a);
// SHA (introduced with Power 8)
// Not yet implemented.
// Vector Binary Polynomial Multiplication (introduced with Power 8)
inline void vpmsumb( VectorRegister d, VectorRegister a, VectorRegister b);
inline void vpmsumd( VectorRegister d, VectorRegister a, VectorRegister b);
inline void vpmsumh( VectorRegister d, VectorRegister a, VectorRegister b);
inline void vpmsumw( VectorRegister d, VectorRegister a, VectorRegister b);
// Vector Permute and Xor (introduced with Power 8)
inline void vpermxor( VectorRegister d, VectorRegister a, VectorRegister b, VectorRegister c);
// Transactional Memory instructions (introduced with Power 8)
inline void tbegin_(); // R=0
inline void tbeginrot_(); // R=1 Rollback-Only Transaction
inline void tend_(); // A=0
inline void tendall_(); // A=1
inline void tabort_(Register a);
inline void tabortwc_(int t, Register a, Register b);
inline void tabortwci_(int t, Register a, int si);
inline void tabortdc_(int t, Register a, Register b);
inline void tabortdci_(int t, Register a, int si);
inline void tsuspend_(); // tsr with L=0
inline void tresume_(); // tsr with L=1
inline void tcheck(int f);
// The following encoders use r0 as second operand. These instructions
// read r0 as '0'.
inline void lwzx( Register d, Register s2);

View File

@ -312,6 +312,25 @@ inline void Assembler::mcrf( ConditionRegister crd, ConditionRegister cra)
{ emit_int32(MCRF_OPCODE | bf(crd) | bfa(cra)); }
inline void Assembler::mtcr( Register s) { Assembler::mtcrf(0xff, s); }
// Special purpose registers
// Exception Register
inline void Assembler::mtxer(Register s1) { emit_int32(MTXER_OPCODE | rs(s1)); }
inline void Assembler::mfxer(Register d ) { emit_int32(MFXER_OPCODE | rt(d)); }
// Vector Register Save Register
inline void Assembler::mtvrsave(Register s1) { emit_int32(MTVRSAVE_OPCODE | rs(s1)); }
inline void Assembler::mfvrsave(Register d ) { emit_int32(MFVRSAVE_OPCODE | rt(d)); }
// Timebase
inline void Assembler::mftb(Register d ) { emit_int32(MFTB_OPCODE | rt(d)); }
// Introduced with Power 8:
// Data Stream Control Register
inline void Assembler::mtdscr(Register s1) { emit_int32(MTDSCR_OPCODE | rs(s1)); }
inline void Assembler::mfdscr(Register d ) { emit_int32(MFDSCR_OPCODE | rt(d)); }
// Transactional Memory Registers
inline void Assembler::mftfhar(Register d ) { emit_int32(MFTFHAR_OPCODE | rt(d)); }
inline void Assembler::mftfiar(Register d ) { emit_int32(MFTFIAR_OPCODE | rt(d)); }
inline void Assembler::mftexasr(Register d ) { emit_int32(MFTEXASR_OPCODE | rt(d)); }
inline void Assembler::mftexasru(Register d ) { emit_int32(MFTEXASRU_OPCODE | rt(d)); }
// SAP JVM 2006-02-13 PPC branch instruction.
// PPC 1, section 2.4.1 Branch Instructions
inline void Assembler::b( address a, relocInfo::relocType rt) { emit_data(BXX_OPCODE| li(disp( intptr_t(a), intptr_t(pc()))) |aa(0)|lk(0), rt); }
@ -735,6 +754,39 @@ inline void Assembler::vsrah( VectorRegister d, VectorRegister a, VectorRegist
inline void Assembler::mtvscr( VectorRegister b) { emit_int32( MTVSCR_OPCODE | vrb(b)); }
inline void Assembler::mfvscr( VectorRegister d) { emit_int32( MFVSCR_OPCODE | vrt(d)); }
// AES (introduced with Power 8)
inline void Assembler::vcipher( VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VCIPHER_OPCODE | vrt(d) | vra(a) | vrb(b)); }
inline void Assembler::vcipherlast( VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VCIPHERLAST_OPCODE | vrt(d) | vra(a) | vrb(b)); }
inline void Assembler::vncipher( VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VNCIPHER_OPCODE | vrt(d) | vra(a) | vrb(b)); }
inline void Assembler::vncipherlast(VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VNCIPHERLAST_OPCODE | vrt(d) | vra(a) | vrb(b)); }
inline void Assembler::vsbox( VectorRegister d, VectorRegister a) { emit_int32( VSBOX_OPCODE | vrt(d) | vra(a) ); }
// SHA (introduced with Power 8)
// Not yet implemented.
// Vector Binary Polynomial Multiplication (introduced with Power 8)
inline void Assembler::vpmsumb( VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VPMSUMB_OPCODE | vrt(d) | vra(a) | vrb(b)); }
inline void Assembler::vpmsumd( VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VPMSUMD_OPCODE | vrt(d) | vra(a) | vrb(b)); }
inline void Assembler::vpmsumh( VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VPMSUMH_OPCODE | vrt(d) | vra(a) | vrb(b)); }
inline void Assembler::vpmsumw( VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VPMSUMW_OPCODE | vrt(d) | vra(a) | vrb(b)); }
// Vector Permute and Xor (introduced with Power 8)
inline void Assembler::vpermxor( VectorRegister d, VectorRegister a, VectorRegister b, VectorRegister c) { emit_int32( VPMSUMW_OPCODE | vrt(d) | vra(a) | vrb(b) | vrc(c)); }
// Transactional Memory instructions (introduced with Power 8)
inline void Assembler::tbegin_() { emit_int32( TBEGIN_OPCODE | rc(1)); }
inline void Assembler::tbeginrot_() { emit_int32( TBEGIN_OPCODE | /*R=1*/ 1u << (31-10) | rc(1)); }
inline void Assembler::tend_() { emit_int32( TEND_OPCODE | rc(1)); }
inline void Assembler::tendall_() { emit_int32( TEND_OPCODE | /*A=1*/ 1u << (31-6) | rc(1)); }
inline void Assembler::tabort_(Register a) { emit_int32( TABORT_OPCODE | ra(a) | rc(1)); }
inline void Assembler::tabortwc_(int t, Register a, Register b) { emit_int32( TABORTWC_OPCODE | to(t) | ra(a) | rb(b) | rc(1)); }
inline void Assembler::tabortwci_(int t, Register a, int si) { emit_int32( TABORTWCI_OPCODE | to(t) | ra(a) | sh1620(si) | rc(1)); }
inline void Assembler::tabortdc_(int t, Register a, Register b) { emit_int32( TABORTDC_OPCODE | to(t) | ra(a) | rb(b) | rc(1)); }
inline void Assembler::tabortdci_(int t, Register a, int si) { emit_int32( TABORTDCI_OPCODE | to(t) | ra(a) | sh1620(si) | rc(1)); }
inline void Assembler::tsuspend_() { emit_int32( TSR_OPCODE | rc(1)); }
inline void Assembler::tresume_() { emit_int32( TSR_OPCODE | /*L=1*/ 1u << (31-10) | rc(1)); }
inline void Assembler::tcheck(int f) { emit_int32( TCHECK_OPCODE | bf(f)); }
// ra0 version
inline void Assembler::lwzx( Register d, Register s2) { emit_int32( LWZX_OPCODE | rt(d) | rb(s2));}
inline void Assembler::lwz( Register d, int si16 ) { emit_int32( LWZ_OPCODE | rt(d) | d1(si16));}

View File

@ -37,6 +37,8 @@ const int StackAlignmentInBytes = 16;
// signatures accordingly.
const bool CCallingConventionRequiresIntsAsLongs = true;
#define SUPPORTS_NATIVE_CX8
// The PPC CPUs are NOT multiple-copy-atomic.
#define CPU_NOT_MULTIPLE_COPY_ATOMIC

View File

@ -25,7 +25,6 @@
#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "interp_masm_ppc_64.hpp"
#include "interpreter/interpreterRuntime.hpp"

View File

@ -24,7 +24,6 @@
*/
#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "interpreter/bytecodeHistogram.hpp"
#include "interpreter/interpreter.hpp"

View File

@ -2366,7 +2366,7 @@ void MacroAssembler::g1_write_barrier_post(Register Rstore_addr, Register Rnew_v
#endif // INCLUDE_ALL_GCS
// Values for last_Java_pc, and last_Java_sp must comply to the rules
// in frame_ppc64.hpp.
// in frame_ppc.hpp.
void MacroAssembler::set_last_Java_frame(Register last_Java_sp, Register last_Java_pc) {
// Always set last_Java_pc and flags first because once last_Java_sp
// is visible has_last_Java_frame is true and users will look at the
@ -2493,6 +2493,7 @@ int MacroAssembler::instr_size_for_decode_klass_not_null() {
}
void MacroAssembler::decode_klass_not_null(Register dst, Register src) {
assert(dst != R0, "Dst reg may not be R0, as R0 is used here.");
if (src == noreg) src = dst;
Register shifted_src = src;
if (Universe::narrow_klass_shift() != 0 ||
@ -2527,14 +2528,11 @@ void MacroAssembler::load_klass_with_trap_null_check(Register dst, Register src)
void MacroAssembler::reinit_heapbase(Register d, Register tmp) {
if (Universe::heap() != NULL) {
if (Universe::narrow_oop_base() == NULL) {
Assembler::xorr(R30, R30, R30);
} else {
load_const(R30, Universe::narrow_ptrs_base(), tmp);
}
load_const_optimized(R30, Universe::narrow_ptrs_base(), tmp);
} else {
load_const(R30, Universe::narrow_ptrs_base_addr(), tmp);
ld(R30, 0, R30);
// Heap not yet allocated. Load indirectly.
int simm16_offset = load_const_optimized(R30, Universe::narrow_ptrs_base_addr(), tmp, true);
ld(R30, simm16_offset, R30);
}
}

View File

@ -1249,6 +1249,7 @@ EmitCallOffsets emit_call_with_trampoline_stub(MacroAssembler &_masm, address en
// Emit the trampoline stub which will be related to the branch-and-link below.
CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, offsets.insts_call_instruction_offset);
if (Compile::current()->env()->failing()) { return offsets; } // Code cache may be full.
__ relocate(rtype);
}
@ -1410,7 +1411,7 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
while (bang_offset <= bang_end) {
// Need at least one stack bang at end of shadow zone.
// Again I had to copy code, this time from assembler_ppc64.cpp,
// Again I had to copy code, this time from assembler_ppc.cpp,
// bang_stack_with_offset - see there for comments.
// Stack grows down, caller passes positive offset.
@ -2000,7 +2001,7 @@ void MachUEPNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
// Inline_cache contains a klass.
Register ic_klass = as_Register(Matcher::inline_cache_reg_encode());
Register receiver_klass = R0; // tmp
Register receiver_klass = R12_scratch2; // tmp
assert_different_registers(ic_klass, receiver_klass, R11_scratch1, R3_ARG1);
assert(R11_scratch1 == R11, "need prologue scratch register");
@ -3484,6 +3485,7 @@ encode %{
// Emit the trampoline stub which will be related to the branch-and-link below.
CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, start_offset);
if (Compile::current()->env()->failing()) { return; } // Code cache may be full.
__ relocate(_optimized_virtual ?
relocInfo::opt_virtual_call_type : relocInfo::static_call_type);
}
@ -3527,6 +3529,7 @@ encode %{
// Emit the trampoline stub which will be related to the branch-and-link below.
CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, start_offset);
if (ra_->C->env()->failing()) { return; } // Code cache may be full.
assert(_optimized_virtual, "methodHandle call should be a virtual call");
__ relocate(relocInfo::opt_virtual_call_type);
}
@ -3577,9 +3580,7 @@ encode %{
const address entry_point_const = __ address_constant(entry_point, RelocationHolder::none);
const int entry_point_const_toc_offset = __ offset_to_method_toc(entry_point_const);
CallStubImpl::emit_trampoline_stub(_masm, entry_point_const_toc_offset, __ offset());
if (ra_->C->env()->failing())
return;
if (ra_->C->env()->failing()) { return; } // Code cache may be full.
// Build relocation at call site with ic position as data.
assert((_load_ic_hi_node != NULL && _load_ic_node == NULL) ||
@ -5638,19 +5639,6 @@ instruct loadNKlass(iRegNdst dst, memory mem) %{
ins_pipe(pipe_class_memory);
%}
//// Load compressed klass and decode it if narrow_klass_shift == 0.
//// TODO: will narrow_klass_shift ever be 0?
//instruct decodeNKlass2Klass(iRegPdst dst, memory mem) %{
// match(Set dst (DecodeNKlass (LoadNKlass mem)));
// predicate(false /* TODO: PPC port Universe::narrow_klass_shift() == 0*);
// ins_cost(MEMORY_REF_COST);
//
// format %{ "LWZ $dst, $mem \t// DecodeNKlass (unscaled)" %}
// size(4);
// ins_encode( enc_lwz(dst, mem) );
// ins_pipe(pipe_class_memory);
//%}
// Load Klass Pointer
instruct loadKlass(iRegPdst dst, memoryAlg4 mem) %{
match(Set dst (LoadKlass mem));
@ -6070,11 +6058,15 @@ instruct loadConN_Ex(iRegNdst dst, immN src) %{
%}
%}
instruct loadConNKlass_hi(iRegNdst dst, immNKlass src) %{
// We have seen a safepoint between the hi and lo parts, and this node was handled
// as an oop. Therefore this needs a match rule so that build_oop_map knows this is
// not a narrow oop.
instruct loadConNKlass_hi(iRegNdst dst, immNKlass_NM src) %{
match(Set dst src);
effect(DEF dst, USE src);
ins_cost(DEFAULT_COST);
format %{ "LIS $dst, $src \t// narrow oop hi" %}
format %{ "LIS $dst, $src \t// narrow klass hi" %}
size(4);
ins_encode %{
// TODO: PPC port $archOpcode(ppc64Opcode_addis);
@ -6084,6 +6076,21 @@ instruct loadConNKlass_hi(iRegNdst dst, immNKlass src) %{
ins_pipe(pipe_class_default);
%}
// As loadConNKlass_hi this must be recognized as narrow klass, not oop!
instruct loadConNKlass_mask(iRegNdst dst, immNKlass_NM src1, iRegNsrc src2) %{
match(Set dst src1);
effect(TEMP src2);
ins_cost(DEFAULT_COST);
format %{ "MASK $dst, $src2, 0xFFFFFFFF" %} // mask
size(4);
ins_encode %{
// TODO: PPC port $archOpcode(ppc64Opcode_rldicl);
__ clrldi($dst$$Register, $src2$$Register, 0x20);
%}
ins_pipe(pipe_class_default);
%}
// This needs a match rule so that build_oop_map knows this is
// not a narrow oop.
instruct loadConNKlass_lo(iRegNdst dst, immNKlass_NM src1, iRegNsrc src2) %{
@ -6091,10 +6098,10 @@ instruct loadConNKlass_lo(iRegNdst dst, immNKlass_NM src1, iRegNsrc src2) %{
effect(TEMP src2);
ins_cost(DEFAULT_COST);
format %{ "ADDI $dst, $src1, $src2 \t// narrow oop lo" %}
format %{ "ORI $dst, $src1, $src2 \t// narrow klass lo" %}
size(4);
ins_encode %{
// TODO: PPC port $archOpcode(ppc64Opcode_addi);
// TODO: PPC port $archOpcode(ppc64Opcode_ori);
intptr_t Csrc = Klass::encode_klass((Klass *)$src1$$constant);
assert(__ oop_recorder() != NULL, "this assembler needs an OopRecorder");
int klass_index = __ oop_recorder()->find_index((Klass *)$src1$$constant);
@ -6125,10 +6132,11 @@ instruct loadConNKlass_Ex(iRegNdst dst, immNKlass src) %{
MachNode *m2 = m1;
if (!Assembler::is_uimm((jlong)Klass::encode_klass((Klass *)op_src->constant()), 31)) {
// Value might be 1-extended. Mask out these bits.
m2 = new clearMs32bNode();
m2 = new loadConNKlass_maskNode();
m2->add_req(NULL, m1);
m2->_opnds[0] = op_dst;
m2->_opnds[1] = op_dst;
m2->_opnds[1] = op_src;
m2->_opnds[2] = op_dst;
ra_->set_pair(m2->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
nodes->push(m2);
}
@ -6973,7 +6981,7 @@ instruct encodePKlass_32GAligned(iRegNdst dst, iRegPsrc src) %{
size(4);
ins_encode %{
// TODO: PPC port $archOpcode(ppc64Opcode_rldicl);
__ rldicl($dst$$Register, $src$$Register, 64-Universe::narrow_oop_shift(), 32);
__ rldicl($dst$$Register, $src$$Register, 64-Universe::narrow_klass_shift(), 32);
%}
ins_pipe(pipe_class_default);
%}

View File

@ -24,7 +24,6 @@
*/
#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "interpreter/interpreter.hpp"
#include "nativeInst_ppc.hpp"
@ -39,9 +38,6 @@
#include "runtime/stubCodeGenerator.hpp"
#include "runtime/stubRoutines.hpp"
#include "utilities/top.hpp"
#ifdef COMPILER2
#include "opto/runtime.hpp"
#endif
#include "runtime/thread.inline.hpp"
#define __ _masm->
@ -216,7 +212,7 @@ class StubGenerator: public StubCodeGenerator {
{
BLOCK_COMMENT("Call frame manager or native entry.");
// Call frame manager or native entry.
Register r_new_arg_entry = R14; // PPC_state;
Register r_new_arg_entry = R14;
assert_different_registers(r_new_arg_entry, r_top_of_arguments_addr,
r_arg_method, r_arg_thread);

View File

@ -353,7 +353,6 @@ void TemplateTable::ldc(bool wide) {
__ sldi(Rscratch1, Rscratch1, LogBytesPerWord);
__ cmpdi(CCR0, Rscratch2, JVM_CONSTANT_Integer);
__ bne(CCR0, notInt);
__ isync(); // Order load of constant wrt. tags.
__ lwax(R17_tos, Rcpool, Rscratch1);
__ push(itos);
__ b(exit);
@ -365,7 +364,6 @@ void TemplateTable::ldc(bool wide) {
__ cmpdi(CCR0, Rscratch2, JVM_CONSTANT_Float);
__ asm_assert_eq("unexpected type", 0x8765);
#endif
__ isync(); // Order load of constant wrt. tags.
__ lfsx(F15_ftos, Rcpool, Rscratch1);
__ push(ftos);
@ -424,13 +422,11 @@ void TemplateTable::ldc2_w() {
// Check out Conversions.java for an example.
// Also ConstantPool::header_size() is 20, which makes it very difficult
// to double-align double on the constant pool. SG, 11/7/97
__ isync(); // Order load of constant wrt. tags.
__ lfdx(F15_ftos, Rcpool, Rindex);
__ push(dtos);
__ b(Lexit);
__ bind(Llong);
__ isync(); // Order load of constant wrt. tags.
__ ldx(R17_tos, Rcpool, Rindex);
__ push(ltos);

View File

@ -347,10 +347,10 @@ static int read_volatiles(jvm_agent_t* J) {
&J->Number_of_heaps, sizeof(J->Number_of_heaps));
/* Allocate memory for heap configurations */
J->Heap_low = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_high = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_segmap_low = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_segmap_high = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_low = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_high = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_segmap_low = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_segmap_high = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
/* Read code heap configurations */
for (i = 0; i < J->Number_of_heaps; ++i) {

View File

@ -129,6 +129,7 @@ uintptr_t os::Linux::_initial_thread_stack_size = 0;
int (*os::Linux::_clock_gettime)(clockid_t, struct timespec *) = NULL;
int (*os::Linux::_pthread_getcpuclockid)(pthread_t, clockid_t *) = NULL;
int (*os::Linux::_pthread_setname_np)(pthread_t, const char*) = NULL;
Mutex* os::Linux::_createThread_lock = NULL;
pthread_t os::Linux::_main_thread;
int os::Linux::_page_size = -1;
@ -4695,6 +4696,11 @@ void os::init(void) {
StackRedPages = 1;
StackShadowPages = round_to((StackShadowPages*Linux::vm_default_page_size()), vm_page_size()) / vm_page_size();
}
// retrieve entry point for pthread_setname_np
Linux::_pthread_setname_np =
(int(*)(pthread_t, const char*))dlsym(RTLD_DEFAULT, "pthread_setname_np");
}
// To install functions for atexit system call
@ -4894,8 +4900,14 @@ int os::active_processor_count() {
}
void os::set_native_thread_name(const char *name) {
// Not yet implemented.
return;
if (Linux::_pthread_setname_np) {
char buf [16]; // according to glibc manpage, 16 chars incl. '/0'
snprintf(buf, sizeof(buf), "%s", name);
buf[sizeof(buf) - 1] = '\0';
const int rc = Linux::_pthread_setname_np(pthread_self(), buf);
// ERANGE should not happen; all other errors should just be ignored.
assert(rc != ERANGE, "pthread_setname_np failed");
}
}
bool os::distribute_processes(uint length, uint* distribution) {

View File

@ -55,6 +55,7 @@ class Linux {
static int (*_clock_gettime)(clockid_t, struct timespec *);
static int (*_pthread_getcpuclockid)(pthread_t, clockid_t *);
static int (*_pthread_setname_np)(pthread_t, const char*);
static address _initial_thread_stack_bottom;
static uintptr_t _initial_thread_stack_size;

View File

@ -347,10 +347,10 @@ static int read_volatiles(jvm_agent_t* J) {
&J->Number_of_heaps, sizeof(J->Number_of_heaps));
/* Allocate memory for heap configurations */
J->Heap_low = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_high = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_segmap_low = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_segmap_high = (jvm_agent_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_low = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_high = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_segmap_low = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
J->Heap_segmap_high = (uint64_t*)calloc(J->Number_of_heaps, sizeof(uint64_t));
/* Read code heap configurations */
for (i = 0; i < J->Number_of_heaps; ++i) {

View File

@ -745,8 +745,29 @@ int os::active_processor_count() {
}
void os::set_native_thread_name(const char *name) {
// Not yet implemented.
return;
// See: http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx
//
// Note that unfortunately this only works if the process
// is already attached to a debugger; debugger must observe
// the exception below to show the correct name.
const DWORD MS_VC_EXCEPTION = 0x406D1388;
struct {
DWORD dwType; // must be 0x1000
LPCSTR szName; // pointer to name (in user addr space)
DWORD dwThreadID; // thread ID (-1=caller thread)
DWORD dwFlags; // reserved for future use, must be zero
} info;
info.dwType = 0x1000;
info.szName = name;
info.dwThreadID = -1;
info.dwFlags = 0;
__try {
RaiseException (MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (const ULONG_PTR*)&info );
} __except(EXCEPTION_CONTINUE_EXECUTION) {}
}
bool os::distribute_processes(uint length, uint* distribution) {

View File

@ -47,4 +47,4 @@ inline void Prefetch::write(void *loc, intx interval) {
);
}
#endif // OS_CPU_LINUX_PPC_VM_PREFETCH_LINUX_OJDKPPC_HPP
#endif // OS_CPU_LINUX_PPC_VM_PREFETCH_LINUX_PPC_INLINE_HPP

View File

@ -2069,14 +2069,14 @@ void LIRGenerator::do_UnsafeGetRaw(UnsafeGetRaw* x) {
LIR_Opr base_op = base.result();
LIR_Opr index_op = idx.result();
#ifndef _LP64
if (x->base()->type()->tag() == longTag) {
if (base_op->type() == T_LONG) {
base_op = new_register(T_INT);
__ convert(Bytecodes::_l2i, base.result(), base_op);
}
if (x->has_index()) {
if (x->index()->type()->tag() == longTag) {
if (index_op->type() == T_LONG) {
LIR_Opr long_index_op = index_op;
if (x->index()->type()->is_constant()) {
if (index_op->is_constant()) {
long_index_op = new_register(T_LONG);
__ move(index_op, long_index_op);
}
@ -2091,14 +2091,14 @@ void LIRGenerator::do_UnsafeGetRaw(UnsafeGetRaw* x) {
assert(!x->has_index() || index_op->type() == T_INT, "index should be an int");
#else
if (x->has_index()) {
if (x->index()->type()->tag() == intTag) {
if (!x->index()->type()->is_constant()) {
if (index_op->type() == T_INT) {
if (!index_op->is_constant()) {
index_op = new_register(T_LONG);
__ convert(Bytecodes::_i2l, idx.result(), index_op);
}
} else {
assert(x->index()->type()->tag() == longTag, "must be");
if (x->index()->type()->is_constant()) {
assert(index_op->type() == T_LONG, "must be");
if (index_op->is_constant()) {
index_op = new_register(T_LONG);
__ move(idx.result(), index_op);
}
@ -2179,12 +2179,12 @@ void LIRGenerator::do_UnsafePutRaw(UnsafePutRaw* x) {
LIR_Opr index_op = idx.result();
#ifndef _LP64
if (x->base()->type()->tag() == longTag) {
if (base_op->type() == T_LONG) {
base_op = new_register(T_INT);
__ convert(Bytecodes::_l2i, base.result(), base_op);
}
if (x->has_index()) {
if (x->index()->type()->tag() == longTag) {
if (index_op->type() == T_LONG) {
index_op = new_register(T_INT);
__ convert(Bytecodes::_l2i, idx.result(), index_op);
}
@ -2194,7 +2194,7 @@ void LIRGenerator::do_UnsafePutRaw(UnsafePutRaw* x) {
assert(!x->has_index() || (index_op->type() == T_INT && !index_op->is_constant()), "index should be an non-constant int");
#else
if (x->has_index()) {
if (x->index()->type()->tag() == intTag) {
if (index_op->type() == T_INT) {
index_op = new_register(T_LONG);
__ convert(Bytecodes::_i2l, idx.result(), index_op);
}

View File

@ -98,6 +98,19 @@ bool Verifier::verify(instanceKlassHandle klass, Verifier::Mode mode, bool shoul
HandleMark hm;
ResourceMark rm(THREAD);
// Eagerly allocate the identity hash code for a klass. This is a fallout
// from 6320749 and 8059924: hash code generator is not supposed to be called
// during the safepoint, but it allows to sneak the hashcode in during
// verification. Without this eager hashcode generation, we may end up
// installing the hashcode during some other operation, which may be at
// safepoint -- blowing up the checks. It was previously done as the side
// effect (sic!) for external_name(), but instead of doing that, we opt to
// explicitly push the hashcode in here. This is signify the following block
// is IMPORTANT:
if (klass->java_mirror() != NULL) {
klass->java_mirror()->identity_hash();
}
if (!is_eligible_for_verification(klass, should_verify_class)) {
return true;
}

View File

@ -254,8 +254,7 @@ bool CodeCache::heap_available(int code_blob_type) {
if (!SegmentedCodeCache) {
// No segmentation: use a single code heap
return (code_blob_type == CodeBlobType::All);
} else if ((Arguments::mode() == Arguments::_int) ||
(TieredStopAtLevel == CompLevel_none)) {
} else if (Arguments::mode() == Arguments::_int) {
// Interpreter only: we don't need any method code heaps
return (code_blob_type == CodeBlobType::NonNMethod);
} else if (TieredCompilation && (TieredStopAtLevel > CompLevel_simple)) {

View File

@ -1683,6 +1683,8 @@ protected:
int _failures;
bool _verbose;
HeapRegionClaimer _hrclaimer;
public:
G1ParVerifyFinalCountTask(G1CollectedHeap* g1h,
BitMap* region_bm, BitMap* card_bm,
@ -1692,19 +1694,8 @@ public:
_actual_region_bm(region_bm), _actual_card_bm(card_bm),
_expected_region_bm(expected_region_bm), _expected_card_bm(expected_card_bm),
_failures(0), _verbose(false),
_n_workers(0) {
_n_workers(_g1h->workers()->active_workers()), _hrclaimer(_n_workers) {
assert(VerifyDuringGC, "don't call this otherwise");
// Use the value already set as the number of active threads
// in the call to run_task().
if (G1CollectedHeap::use_parallel_gc_threads()) {
assert( _g1h->workers()->active_workers() > 0,
"Should have been previously set");
_n_workers = _g1h->workers()->active_workers();
} else {
_n_workers = 1;
}
assert(_expected_card_bm->size() == _actual_card_bm->size(), "sanity");
assert(_expected_region_bm->size() == _actual_region_bm->size(), "sanity");
@ -1721,10 +1712,7 @@ public:
_verbose);
if (G1CollectedHeap::use_parallel_gc_threads()) {
_g1h->heap_region_par_iterate_chunked(&verify_cl,
worker_id,
_n_workers,
HeapRegion::VerifyCountClaimValue);
_g1h->heap_region_par_iterate(&verify_cl, worker_id, &_hrclaimer);
} else {
_g1h->heap_region_iterate(&verify_cl);
}
@ -1813,22 +1801,14 @@ protected:
BitMap* _actual_card_bm;
uint _n_workers;
HeapRegionClaimer _hrclaimer;
public:
G1ParFinalCountTask(G1CollectedHeap* g1h, BitMap* region_bm, BitMap* card_bm)
: AbstractGangTask("G1 final counting"),
_g1h(g1h), _cm(_g1h->concurrent_mark()),
_actual_region_bm(region_bm), _actual_card_bm(card_bm),
_n_workers(0) {
// Use the value already set as the number of active threads
// in the call to run_task().
if (G1CollectedHeap::use_parallel_gc_threads()) {
assert( _g1h->workers()->active_workers() > 0,
"Should have been previously set");
_n_workers = _g1h->workers()->active_workers();
} else {
_n_workers = 1;
}
_n_workers(_g1h->workers()->active_workers()), _hrclaimer(_n_workers) {
}
void work(uint worker_id) {
@ -1839,10 +1819,7 @@ public:
_actual_card_bm);
if (G1CollectedHeap::use_parallel_gc_threads()) {
_g1h->heap_region_par_iterate_chunked(&final_update_cl,
worker_id,
_n_workers,
HeapRegion::FinalCountClaimValue);
_g1h->heap_region_par_iterate(&final_update_cl, worker_id, &_hrclaimer);
} else {
_g1h->heap_region_iterate(&final_update_cl);
}
@ -1929,12 +1906,12 @@ protected:
size_t _max_live_bytes;
size_t _freed_bytes;
FreeRegionList* _cleanup_list;
HeapRegionClaimer _hrclaimer;
public:
G1ParNoteEndTask(G1CollectedHeap* g1h,
FreeRegionList* cleanup_list) :
AbstractGangTask("G1 note end"), _g1h(g1h),
_max_live_bytes(0), _freed_bytes(0), _cleanup_list(cleanup_list) { }
G1ParNoteEndTask(G1CollectedHeap* g1h, FreeRegionList* cleanup_list, uint n_workers) :
AbstractGangTask("G1 note end"), _g1h(g1h), _max_live_bytes(0), _freed_bytes(0), _cleanup_list(cleanup_list), _hrclaimer(n_workers) {
}
void work(uint worker_id) {
double start = os::elapsedTime();
@ -1943,9 +1920,7 @@ public:
G1NoteEndOfConcMarkClosure g1_note_end(_g1h, &local_cleanup_list,
&hrrs_cleanup_task);
if (G1CollectedHeap::use_parallel_gc_threads()) {
_g1h->heap_region_par_iterate_chunked(&g1_note_end, worker_id,
_g1h->workers()->active_workers(),
HeapRegion::NoteEndClaimValue);
_g1h->heap_region_par_iterate(&g1_note_end, worker_id, &_hrclaimer);
} else {
_g1h->heap_region_iterate(&g1_note_end);
}
@ -1991,16 +1966,16 @@ protected:
G1RemSet* _g1rs;
BitMap* _region_bm;
BitMap* _card_bm;
HeapRegionClaimer _hrclaimer;
public:
G1ParScrubRemSetTask(G1CollectedHeap* g1h,
BitMap* region_bm, BitMap* card_bm) :
AbstractGangTask("G1 ScrubRS"), _g1rs(g1h->g1_rem_set()),
_region_bm(region_bm), _card_bm(card_bm) { }
G1ParScrubRemSetTask(G1CollectedHeap* g1h, BitMap* region_bm, BitMap* card_bm, uint n_workers) :
AbstractGangTask("G1 ScrubRS"), _g1rs(g1h->g1_rem_set()), _region_bm(region_bm), _card_bm(card_bm), _hrclaimer(n_workers) {
}
void work(uint worker_id) {
if (G1CollectedHeap::use_parallel_gc_threads()) {
_g1rs->scrub_par(_region_bm, _card_bm, worker_id,
HeapRegion::ScrubRemSetClaimValue);
_g1rs->scrub_par(_region_bm, _card_bm, worker_id, &_hrclaimer);
} else {
_g1rs->scrub(_region_bm, _card_bm);
}
@ -2043,9 +2018,6 @@ void ConcurrentMark::cleanup() {
G1ParFinalCountTask g1_par_count_task(g1h, &_region_bm, &_card_bm);
if (G1CollectedHeap::use_parallel_gc_threads()) {
assert(g1h->check_heap_region_claim_values(HeapRegion::InitialClaimValue),
"sanity check");
g1h->set_par_threads();
n_workers = g1h->n_par_threads();
assert(g1h->n_par_threads() == n_workers,
@ -2053,9 +2025,6 @@ void ConcurrentMark::cleanup() {
g1h->workers()->run_task(&g1_par_count_task);
// Done with the parallel phase so reset to 0.
g1h->set_par_threads(0);
assert(g1h->check_heap_region_claim_values(HeapRegion::FinalCountClaimValue),
"sanity check");
} else {
n_workers = 1;
g1_par_count_task.work(0);
@ -2080,9 +2049,6 @@ void ConcurrentMark::cleanup() {
g1h->workers()->run_task(&g1_par_verify_task);
// Done with the parallel phase so reset to 0.
g1h->set_par_threads(0);
assert(g1h->check_heap_region_claim_values(HeapRegion::VerifyCountClaimValue),
"sanity check");
} else {
g1_par_verify_task.work(0);
}
@ -2108,14 +2074,11 @@ void ConcurrentMark::cleanup() {
g1h->reset_gc_time_stamp();
// Note end of marking in all heap regions.
G1ParNoteEndTask g1_par_note_end_task(g1h, &_cleanup_list);
G1ParNoteEndTask g1_par_note_end_task(g1h, &_cleanup_list, n_workers);
if (G1CollectedHeap::use_parallel_gc_threads()) {
g1h->set_par_threads((int)n_workers);
g1h->workers()->run_task(&g1_par_note_end_task);
g1h->set_par_threads(0);
assert(g1h->check_heap_region_claim_values(HeapRegion::NoteEndClaimValue),
"sanity check");
} else {
g1_par_note_end_task.work(0);
}
@ -2132,15 +2095,11 @@ void ConcurrentMark::cleanup() {
// regions.
if (G1ScrubRemSets) {
double rs_scrub_start = os::elapsedTime();
G1ParScrubRemSetTask g1_par_scrub_rs_task(g1h, &_region_bm, &_card_bm);
G1ParScrubRemSetTask g1_par_scrub_rs_task(g1h, &_region_bm, &_card_bm, n_workers);
if (G1CollectedHeap::use_parallel_gc_threads()) {
g1h->set_par_threads((int)n_workers);
g1h->workers()->run_task(&g1_par_scrub_rs_task);
g1h->set_par_threads(0);
assert(g1h->check_heap_region_claim_values(
HeapRegion::ScrubRemSetClaimValue),
"sanity check");
} else {
g1_par_scrub_rs_task.work(0);
}
@ -3288,6 +3247,7 @@ protected:
BitMap* _cm_card_bm;
uint _max_worker_id;
int _active_workers;
HeapRegionClaimer _hrclaimer;
public:
G1AggregateCountDataTask(G1CollectedHeap* g1h,
@ -3295,18 +3255,18 @@ public:
BitMap* cm_card_bm,
uint max_worker_id,
int n_workers) :
AbstractGangTask("Count Aggregation"),
_g1h(g1h), _cm(cm), _cm_card_bm(cm_card_bm),
_max_worker_id(max_worker_id),
_active_workers(n_workers) { }
AbstractGangTask("Count Aggregation"),
_g1h(g1h), _cm(cm), _cm_card_bm(cm_card_bm),
_max_worker_id(max_worker_id),
_active_workers(n_workers),
_hrclaimer(_active_workers) {
}
void work(uint worker_id) {
AggregateCountDataHRClosure cl(_g1h, _cm_card_bm, _max_worker_id);
if (G1CollectedHeap::use_parallel_gc_threads()) {
_g1h->heap_region_par_iterate_chunked(&cl, worker_id,
_active_workers,
HeapRegion::AggregateCountClaimValue);
_g1h->heap_region_par_iterate(&cl, worker_id, &_hrclaimer);
} else {
_g1h->heap_region_iterate(&cl);
}
@ -3323,15 +3283,9 @@ void ConcurrentMark::aggregate_count_data() {
_max_worker_id, n_workers);
if (G1CollectedHeap::use_parallel_gc_threads()) {
assert(_g1h->check_heap_region_claim_values(HeapRegion::InitialClaimValue),
"sanity check");
_g1h->set_par_threads(n_workers);
_g1h->workers()->run_task(&g1_par_agg_task);
_g1h->set_par_threads(0);
assert(_g1h->check_heap_region_claim_values(HeapRegion::AggregateCountClaimValue),
"sanity check");
_g1h->reset_heap_region_claim_values();
} else {
g1_par_agg_task.work(0);
}

View File

@ -90,8 +90,8 @@ size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0;
// Notes on implementation of parallelism in different tasks.
//
// G1ParVerifyTask uses heap_region_par_iterate_chunked() for parallelism.
// The number of GC workers is passed to heap_region_par_iterate_chunked().
// G1ParVerifyTask uses heap_region_par_iterate() for parallelism.
// The number of GC workers is passed to heap_region_par_iterate().
// It does use run_task() which sets _n_workers in the task.
// G1ParTask executes g1_process_roots() ->
// SharedHeap::process_roots() which calls eventually to
@ -1215,17 +1215,15 @@ public:
class ParRebuildRSTask: public AbstractGangTask {
G1CollectedHeap* _g1;
HeapRegionClaimer _hrclaimer;
public:
ParRebuildRSTask(G1CollectedHeap* g1)
: AbstractGangTask("ParRebuildRSTask"),
_g1(g1)
{ }
ParRebuildRSTask(G1CollectedHeap* g1) :
AbstractGangTask("ParRebuildRSTask"), _g1(g1), _hrclaimer(g1->workers()->active_workers()) {}
void work(uint worker_id) {
RebuildRSOutOfRegionClosure rebuild_rs(_g1, worker_id);
_g1->heap_region_par_iterate_chunked(&rebuild_rs, worker_id,
_g1->workers()->active_workers(),
HeapRegion::RebuildRSClaimValue);
_g1->heap_region_par_iterate(&rebuild_rs, worker_id, &_hrclaimer);
}
};
@ -1455,8 +1453,6 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
set_par_threads(n_workers);
ParRebuildRSTask rebuild_rs_task(this);
assert(check_heap_region_claim_values(
HeapRegion::InitialClaimValue), "sanity check");
assert(UseDynamicNumberOfGCThreads ||
workers()->active_workers() == workers()->total_workers(),
"Unless dynamic should use total workers");
@ -1466,9 +1462,6 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
set_par_threads(workers()->active_workers());
workers()->run_task(&rebuild_rs_task);
set_par_threads(0);
assert(check_heap_region_claim_values(
HeapRegion::RebuildRSClaimValue), "sanity check");
reset_heap_region_claim_values();
} else {
RebuildRSOutOfRegionClosure rebuild_rs(this);
heap_region_iterate(&rebuild_rs);
@ -2343,6 +2336,7 @@ bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) {
case GCCause::_gc_locker: return GCLockerInvokesConcurrent;
case GCCause::_java_lang_system_gc: return ExplicitGCInvokesConcurrent;
case GCCause::_g1_humongous_allocation: return true;
case GCCause::_update_allocation_context_stats_inc: return true;
default: return false;
}
}
@ -2633,111 +2627,12 @@ void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const {
}
void
G1CollectedHeap::heap_region_par_iterate_chunked(HeapRegionClosure* cl,
uint worker_id,
uint num_workers,
jint claim_value) const {
_hrm.par_iterate(cl, worker_id, num_workers, claim_value);
G1CollectedHeap::heap_region_par_iterate(HeapRegionClosure* cl,
uint worker_id,
HeapRegionClaimer *hrclaimer) const {
_hrm.par_iterate(cl, worker_id, hrclaimer);
}
class ResetClaimValuesClosure: public HeapRegionClosure {
public:
bool doHeapRegion(HeapRegion* r) {
r->set_claim_value(HeapRegion::InitialClaimValue);
return false;
}
};
void G1CollectedHeap::reset_heap_region_claim_values() {
ResetClaimValuesClosure blk;
heap_region_iterate(&blk);
}
void G1CollectedHeap::reset_cset_heap_region_claim_values() {
ResetClaimValuesClosure blk;
collection_set_iterate(&blk);
}
#ifdef ASSERT
// This checks whether all regions in the heap have the correct claim
// value. I also piggy-backed on this a check to ensure that the
// humongous_start_region() information on "continues humongous"
// regions is correct.
class CheckClaimValuesClosure : public HeapRegionClosure {
private:
jint _claim_value;
uint _failures;
HeapRegion* _sh_region;
public:
CheckClaimValuesClosure(jint claim_value) :
_claim_value(claim_value), _failures(0), _sh_region(NULL) { }
bool doHeapRegion(HeapRegion* r) {
if (r->claim_value() != _claim_value) {
gclog_or_tty->print_cr("Region " HR_FORMAT ", "
"claim value = %d, should be %d",
HR_FORMAT_PARAMS(r),
r->claim_value(), _claim_value);
++_failures;
}
if (!r->is_humongous()) {
_sh_region = NULL;
} else if (r->is_starts_humongous()) {
_sh_region = r;
} else if (r->is_continues_humongous()) {
if (r->humongous_start_region() != _sh_region) {
gclog_or_tty->print_cr("Region " HR_FORMAT ", "
"HS = "PTR_FORMAT", should be "PTR_FORMAT,
HR_FORMAT_PARAMS(r),
r->humongous_start_region(),
_sh_region);
++_failures;
}
}
return false;
}
uint failures() { return _failures; }
};
bool G1CollectedHeap::check_heap_region_claim_values(jint claim_value) {
CheckClaimValuesClosure cl(claim_value);
heap_region_iterate(&cl);
return cl.failures() == 0;
}
class CheckClaimValuesInCSetHRClosure: public HeapRegionClosure {
private:
jint _claim_value;
uint _failures;
public:
CheckClaimValuesInCSetHRClosure(jint claim_value) :
_claim_value(claim_value), _failures(0) { }
uint failures() { return _failures; }
bool doHeapRegion(HeapRegion* hr) {
assert(hr->in_collection_set(), "how?");
assert(!hr->is_humongous(), "H-region in CSet");
if (hr->claim_value() != _claim_value) {
gclog_or_tty->print_cr("CSet Region " HR_FORMAT ", "
"claim value = %d, should be %d",
HR_FORMAT_PARAMS(hr),
hr->claim_value(), _claim_value);
_failures += 1;
}
return false;
}
};
bool G1CollectedHeap::check_cset_heap_region_claim_values(jint claim_value) {
CheckClaimValuesInCSetHRClosure cl(claim_value);
collection_set_iterate(&cl);
return cl.failures() == 0;
}
#endif // ASSERT
// Clear the cached CSet starting regions and (more importantly)
// the time stamps. Called when we reset the GC time stamp.
void G1CollectedHeap::clear_cset_start_regions() {
@ -3251,19 +3146,21 @@ public:
class G1ParVerifyTask: public AbstractGangTask {
private:
G1CollectedHeap* _g1h;
VerifyOption _vo;
bool _failures;
G1CollectedHeap* _g1h;
VerifyOption _vo;
bool _failures;
HeapRegionClaimer _hrclaimer;
public:
// _vo == UsePrevMarking -> use "prev" marking information,
// _vo == UseNextMarking -> use "next" marking information,
// _vo == UseMarkWord -> use mark word from object header.
G1ParVerifyTask(G1CollectedHeap* g1h, VerifyOption vo) :
AbstractGangTask("Parallel verify task"),
_g1h(g1h),
_vo(vo),
_failures(false) { }
AbstractGangTask("Parallel verify task"),
_g1h(g1h),
_vo(vo),
_failures(false),
_hrclaimer(g1h->workers()->active_workers()) {}
bool failures() {
return _failures;
@ -3272,9 +3169,7 @@ public:
void work(uint worker_id) {
HandleMark hm;
VerifyRegionClosure blk(true, _vo);
_g1h->heap_region_par_iterate_chunked(&blk, worker_id,
_g1h->workers()->active_workers(),
HeapRegion::ParVerifyClaimValue);
_g1h->heap_region_par_iterate(&blk, worker_id, &_hrclaimer);
if (blk.failures()) {
_failures = true;
}
@ -3316,8 +3211,6 @@ void G1CollectedHeap::verify(bool silent, VerifyOption vo) {
if (!silent) { gclog_or_tty->print("HeapRegions "); }
if (GCParallelVerificationEnabled && ParallelGCThreads > 1) {
assert(check_heap_region_claim_values(HeapRegion::InitialClaimValue),
"sanity check");
G1ParVerifyTask task(this, vo);
assert(UseDynamicNumberOfGCThreads ||
@ -3331,15 +3224,6 @@ void G1CollectedHeap::verify(bool silent, VerifyOption vo) {
failures = true;
}
// Checks that the expected amount of parallel work was done.
// The implication is that n_workers is > 0.
assert(check_heap_region_claim_values(HeapRegion::ParVerifyClaimValue),
"sanity check");
reset_heap_region_claim_values();
assert(check_heap_region_claim_values(HeapRegion::InitialClaimValue),
"sanity check");
} else {
VerifyRegionClosure blk(false, vo);
heap_region_iterate(&blk);
@ -3926,8 +3810,6 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
}
assert(check_young_list_well_formed(), "young list should be well formed");
assert(check_heap_region_claim_values(HeapRegion::InitialClaimValue),
"sanity check");
// Don't dynamically change the number of GC threads this early. A value of
// 0 is used to indicate serial work. When parallel work is done,
@ -4288,26 +4170,12 @@ void G1CollectedHeap::finalize_for_evac_failure() {
}
void G1CollectedHeap::remove_self_forwarding_pointers() {
assert(check_cset_heap_region_claim_values(HeapRegion::InitialClaimValue), "sanity");
double remove_self_forwards_start = os::elapsedTime();
set_par_threads();
G1ParRemoveSelfForwardPtrsTask rsfp_task(this);
if (G1CollectedHeap::use_parallel_gc_threads()) {
set_par_threads();
workers()->run_task(&rsfp_task);
set_par_threads(0);
} else {
rsfp_task.work(0);
}
assert(check_cset_heap_region_claim_values(HeapRegion::ParEvacFailureClaimValue), "sanity");
// Reset the claim values in the regions in the collection set.
reset_cset_heap_region_claim_values();
assert(check_cset_heap_region_claim_values(HeapRegion::InitialClaimValue), "sanity");
workers()->run_task(&rsfp_task);
set_par_threads(0);
// Now restore saved marks, if any.
assert(_objs_with_preserved_marks.size() ==
@ -5948,11 +5816,6 @@ void G1CollectedHeap::evacuate_collection_set(EvacuationInfo& evacuation_info) {
purge_code_root_memory();
if (g1_policy()->during_initial_mark_pause()) {
// Reset the claim values set during marking the strong code roots
reset_heap_region_claim_values();
}
finalize_for_evac_failure();
if (evacuation_failed()) {

View File

@ -211,6 +211,7 @@ class G1CollectedHeap : public SharedHeap {
friend class G1FreeHumongousRegionClosure;
// Other related classes.
friend class G1MarkSweep;
friend class HeapRegionClaimer;
private:
// The one and only G1CollectedHeap, so static functions can find it.
@ -1377,38 +1378,15 @@ public:
inline HeapWord* bottom_addr_for_region(uint index) const;
// Divide the heap region sequence into "chunks" of some size (the number
// of regions divided by the number of parallel threads times some
// overpartition factor, currently 4). Assumes that this will be called
// in parallel by ParallelGCThreads worker threads with distinct worker
// ids in the range [0..max(ParallelGCThreads-1, 1)], that all parallel
// calls will use the same "claim_value", and that that claim value is
// different from the claim_value of any heap region before the start of
// the iteration. Applies "blk->doHeapRegion" to each of the regions, by
// attempting to claim the first region in each chunk, and, if
// successful, applying the closure to each region in the chunk (and
// setting the claim value of the second and subsequent regions of the
// chunk.) For now requires that "doHeapRegion" always returns "false",
// i.e., that a closure never attempt to abort a traversal.
void heap_region_par_iterate_chunked(HeapRegionClosure* cl,
uint worker_id,
uint num_workers,
jint claim_value) const;
// It resets all the region claim values to the default.
void reset_heap_region_claim_values();
// Resets the claim values of regions in the current
// collection set to the default.
void reset_cset_heap_region_claim_values();
#ifdef ASSERT
bool check_heap_region_claim_values(jint claim_value);
// Same as the routine above but only checks regions in the
// current collection set.
bool check_cset_heap_region_claim_values(jint claim_value);
#endif // ASSERT
// Iterate over the heap regions in parallel. Assumes that this will be called
// in parallel by ParallelGCThreads worker threads with distinct worker ids
// in the range [0..max(ParallelGCThreads-1, 1)]. Applies "blk->doHeapRegion"
// to each of the regions, by attempting to claim the region using the
// HeapRegionClaimer and, if successful, applying the closure to the claimed
// region.
void heap_region_par_iterate(HeapRegionClosure* cl,
uint worker_id,
HeapRegionClaimer* hrclaimer) const;
// Clear the cached cset start regions and (more importantly)
// the time stamps. Called when we reset the GC time stamp.

View File

@ -1598,19 +1598,17 @@ class ParKnownGarbageTask: public AbstractGangTask {
CollectionSetChooser* _hrSorted;
uint _chunk_size;
G1CollectedHeap* _g1;
HeapRegionClaimer _hrclaimer;
public:
ParKnownGarbageTask(CollectionSetChooser* hrSorted, uint chunk_size) :
AbstractGangTask("ParKnownGarbageTask"),
_hrSorted(hrSorted), _chunk_size(chunk_size),
_g1(G1CollectedHeap::heap()) { }
ParKnownGarbageTask(CollectionSetChooser* hrSorted, uint chunk_size, uint n_workers) :
AbstractGangTask("ParKnownGarbageTask"),
_hrSorted(hrSorted), _chunk_size(chunk_size),
_g1(G1CollectedHeap::heap()), _hrclaimer(n_workers) {}
void work(uint worker_id) {
ParKnownGarbageHRClosure parKnownGarbageCl(_hrSorted, _chunk_size);
// Back to zero for the claim value.
_g1->heap_region_par_iterate_chunked(&parKnownGarbageCl, worker_id,
_g1->workers()->active_workers(),
HeapRegion::InitialClaimValue);
_g1->heap_region_par_iterate(&parKnownGarbageCl, worker_id, &_hrclaimer);
}
};
@ -1641,12 +1639,8 @@ G1CollectorPolicy::record_concurrent_mark_cleanup_end(int no_of_gc_threads) {
}
_collectionSetChooser->prepare_for_par_region_addition(_g1->num_regions(),
WorkUnit);
ParKnownGarbageTask parKnownGarbageTask(_collectionSetChooser,
(int) WorkUnit);
ParKnownGarbageTask parKnownGarbageTask(_collectionSetChooser, WorkUnit, (uint) no_of_gc_threads);
_g1->workers()->run_task(&parKnownGarbageTask);
assert(_g1->check_heap_region_claim_values(HeapRegion::InitialClaimValue),
"sanity check");
} else {
KnownGarbageClosure knownGarbagecl(_collectionSetChooser);
_g1->heap_region_iterate(&knownGarbagecl);

View File

@ -177,16 +177,18 @@ class RemoveSelfForwardPtrHRClosure: public HeapRegionClosure {
G1CollectedHeap* _g1h;
ConcurrentMark* _cm;
uint _worker_id;
HeapRegionClaimer* _hrclaimer;
DirtyCardQueue _dcq;
UpdateRSetDeferred _update_rset_cl;
public:
RemoveSelfForwardPtrHRClosure(G1CollectedHeap* g1h,
uint worker_id) :
_g1h(g1h), _dcq(&g1h->dirty_card_queue_set()), _update_rset_cl(g1h, &_dcq),
_worker_id(worker_id), _cm(_g1h->concurrent_mark()) {
}
uint worker_id,
HeapRegionClaimer* hrclaimer) :
_g1h(g1h), _dcq(&g1h->dirty_card_queue_set()), _update_rset_cl(g1h, &_dcq),
_worker_id(worker_id), _cm(_g1h->concurrent_mark()), _hrclaimer(hrclaimer) {
}
bool doHeapRegion(HeapRegion *hr) {
bool during_initial_mark = _g1h->g1_policy()->during_initial_mark_pause();
@ -195,7 +197,7 @@ public:
assert(!hr->is_humongous(), "sanity");
assert(hr->in_collection_set(), "bad CS");
if (hr->claimHeapRegion(HeapRegion::ParEvacFailureClaimValue)) {
if (_hrclaimer->claim_region(hr->hrm_index())) {
if (hr->evacuation_failed()) {
RemoveSelfForwardPtrObjClosure rspc(_g1h, _cm, hr, &_update_rset_cl,
during_initial_mark,
@ -233,14 +235,15 @@ public:
class G1ParRemoveSelfForwardPtrsTask: public AbstractGangTask {
protected:
G1CollectedHeap* _g1h;
HeapRegionClaimer _hrclaimer;
public:
G1ParRemoveSelfForwardPtrsTask(G1CollectedHeap* g1h) :
AbstractGangTask("G1 Remove Self-forwarding Pointers"),
_g1h(g1h) { }
AbstractGangTask("G1 Remove Self-forwarding Pointers"), _g1h(g1h),
_hrclaimer(g1h->workers()->active_workers()) {}
void work(uint worker_id) {
RemoveSelfForwardPtrHRClosure rsfp_cl(_g1h, worker_id);
RemoveSelfForwardPtrHRClosure rsfp_cl(_g1h, worker_id, &_hrclaimer);
HeapRegion* hr = _g1h->start_cset_region_for_worker(worker_id);
_g1h->collection_set_iterate_from(hr, &rsfp_cl);

View File

@ -425,13 +425,9 @@ void G1RemSet::scrub(BitMap* region_bm, BitMap* card_bm) {
_g1->heap_region_iterate(&scrub_cl);
}
void G1RemSet::scrub_par(BitMap* region_bm, BitMap* card_bm,
uint worker_num, int claim_val) {
void G1RemSet::scrub_par(BitMap* region_bm, BitMap* card_bm, uint worker_num, HeapRegionClaimer *hrclaimer) {
ScrubRSClosure scrub_cl(region_bm, card_bm);
_g1->heap_region_par_iterate_chunked(&scrub_cl,
worker_num,
n_workers(),
claim_val);
_g1->heap_region_par_iterate(&scrub_cl, worker_num, hrclaimer);
}
G1TriggerClosure::G1TriggerClosure() :

View File

@ -128,10 +128,10 @@ public:
void scrub(BitMap* region_bm, BitMap* card_bm);
// Like the above, but assumes is called in parallel: "worker_num" is the
// parallel thread id of the current thread, and "claim_val" is the
// value that should be used to claim heap regions.
// parallel thread id of the current thread, and "hrclaimer" is the shared
// HeapRegionClaimer that should be used to claim heap regions.
void scrub_par(BitMap* region_bm, BitMap* card_bm,
uint worker_num, int claim_val);
uint worker_num, HeapRegionClaimer* hrclaimer);
// Refine the card corresponding to "card_ptr".
// If check_for_refs_into_cset is true, a true result is returned

View File

@ -217,7 +217,6 @@ void HeapRegion::hr_clear(bool par, bool clear_space, bool locked) {
} else {
hrrs->clear();
}
_claimed = InitialClaimValue;
}
zero_marked_bytes();
@ -294,17 +293,6 @@ void HeapRegion::clear_humongous() {
_humongous_start_region = NULL;
}
bool HeapRegion::claimHeapRegion(jint claimValue) {
jint current = _claimed;
if (current != claimValue) {
jint res = Atomic::cmpxchg(claimValue, &_claimed, current);
if (res == current) {
return true;
}
}
return false;
}
HeapRegion::HeapRegion(uint hrm_index,
G1BlockOffsetSharedArray* sharedOffsetArray,
MemRegion mr) :
@ -314,7 +302,7 @@ HeapRegion::HeapRegion(uint hrm_index,
_humongous_start_region(NULL),
_in_collection_set(false),
_next_in_special_set(NULL),
_claimed(InitialClaimValue), _evacuation_failed(false),
_evacuation_failed(false),
_prev_marked_bytes(0), _next_marked_bytes(0), _gc_efficiency(0.0),
_next_young_region(NULL),
_next_dirty_cards_region(NULL), _next(NULL), _prev(NULL),

View File

@ -254,9 +254,6 @@ class HeapRegion: public G1OffsetTableContigSpace {
HeapRegionSetBase* _containing_set;
#endif // ASSERT
// For parallel heapRegion traversal.
jint _claimed;
// We use concurrent marking to determine the amount of live data
// in each heap region.
size_t _prev_marked_bytes; // Bytes known to be live via last completed marking.
@ -336,19 +333,6 @@ class HeapRegion: public G1OffsetTableContigSpace {
// up once during initialization time.
static void setup_heap_region_size(size_t initial_heap_size, size_t max_heap_size);
enum ClaimValues {
InitialClaimValue = 0,
FinalCountClaimValue = 1,
NoteEndClaimValue = 2,
ScrubRemSetClaimValue = 3,
ParVerifyClaimValue = 4,
RebuildRSClaimValue = 5,
ParEvacFailureClaimValue = 6,
AggregateCountClaimValue = 7,
VerifyCountClaimValue = 8,
ParMarkRootClaimValue = 9
};
// All allocated blocks are occupied by objects in a HeapRegion
bool block_is_obj(const HeapWord* p) const;
@ -691,12 +675,6 @@ class HeapRegion: public G1OffsetTableContigSpace {
return (HeapWord *) obj >= next_top_at_mark_start();
}
// For parallel heapRegion traversal.
bool claimHeapRegion(int claimValue);
jint claim_value() { return _claimed; }
// Use this carefully: only when you're sure no one is claiming...
void set_claim_value(int claimValue) { _claimed = claimValue; }
// Returns the "evacuation_failed" property of the region.
bool evacuation_failed() { return _evacuation_failed; }

View File

@ -260,20 +260,17 @@ uint HeapRegionManager::find_unavailable_from_idx(uint start_idx, uint* res_idx)
return num_regions;
}
uint HeapRegionManager::start_region_for_worker(uint worker_i, uint num_workers, uint num_regions) const {
return num_regions * worker_i / num_workers;
}
void HeapRegionManager::par_iterate(HeapRegionClosure* blk, uint worker_id, uint num_workers, jint claim_value) const {
const uint start_index = start_region_for_worker(worker_id, num_workers, _allocated_heapregions_length);
void HeapRegionManager::par_iterate(HeapRegionClosure* blk, uint worker_id, HeapRegionClaimer* hrclaimer) const {
const uint start_index = hrclaimer->start_region_for_worker(worker_id);
// Every worker will actually look at all regions, skipping over regions that
// are currently not committed.
// This also (potentially) iterates over regions newly allocated during GC. This
// is no problem except for some extra work.
for (uint count = 0; count < _allocated_heapregions_length; count++) {
const uint index = (start_index + count) % _allocated_heapregions_length;
assert(0 <= index && index < _allocated_heapregions_length, "sanity");
const uint n_regions = hrclaimer->n_regions();
for (uint count = 0; count < n_regions; count++) {
const uint index = (start_index + count) % n_regions;
assert(0 <= index && index < n_regions, "sanity");
// Skip over unavailable regions
if (!is_available(index)) {
continue;
@ -282,11 +279,11 @@ void HeapRegionManager::par_iterate(HeapRegionClosure* blk, uint worker_id, uint
// We'll ignore "continues humongous" regions (we'll process them
// when we come across their corresponding "start humongous"
// region) and regions already claimed.
if (r->claim_value() == claim_value || r->is_continues_humongous()) {
if (hrclaimer->is_region_claimed(index) || r->is_continues_humongous()) {
continue;
}
// OK, try to claim it
if (!r->claimHeapRegion(claim_value)) {
if (!hrclaimer->claim_region(index)) {
continue;
}
// Success!
@ -306,13 +303,11 @@ void HeapRegionManager::par_iterate(HeapRegionClosure* blk, uint worker_id, uint
assert(chr->humongous_start_region() == r,
err_msg("Must work on humongous continuation of the original start region "
PTR_FORMAT ", but is " PTR_FORMAT, p2i(r), p2i(chr)));
assert(chr->claim_value() != claim_value,
assert(!hrclaimer->is_region_claimed(ch_index),
"Must not have been claimed yet because claiming of humongous continuation first claims the start region");
bool claim_result = chr->claimHeapRegion(claim_value);
// We should always be able to claim it; no one else should
// be trying to claim this region.
guarantee(claim_result, "We should always be able to claim the is_continues_humongous part of the humongous object");
// There's no need to actually claim the continues humongous region, but we can do it in an assert as an extra precaution.
assert(hrclaimer->claim_region(ch_index), "We should always be able to claim the continuesHumongous part of the humongous object");
bool res2 = blk->doHeapRegion(chr);
if (res2) {
@ -445,3 +440,31 @@ void HeapRegionManager::verify_optional() {
}
#endif // PRODUCT
HeapRegionClaimer::HeapRegionClaimer(uint n_workers) :
_n_workers(n_workers), _n_regions(G1CollectedHeap::heap()->_hrm._allocated_heapregions_length), _claims(NULL) {
assert(n_workers > 0, "Need at least one worker.");
_claims = NEW_C_HEAP_ARRAY(uint, _n_regions, mtGC);
memset(_claims, Unclaimed, sizeof(*_claims) * _n_regions);
}
HeapRegionClaimer::~HeapRegionClaimer() {
if (_claims != NULL) {
FREE_C_HEAP_ARRAY(uint, _claims, mtGC);
}
}
uint HeapRegionClaimer::start_region_for_worker(uint worker_id) const {
assert(worker_id < _n_workers, "Invalid worker_id.");
return _n_regions * worker_id / _n_workers;
}
bool HeapRegionClaimer::is_region_claimed(uint region_index) const {
assert(region_index < _n_regions, "Invalid index.");
return _claims[region_index] == Claimed;
}
bool HeapRegionClaimer::claim_region(uint region_index) {
assert(region_index < _n_regions, "Invalid index.");
uint old_val = Atomic::cmpxchg(Claimed, &_claims[region_index], Unclaimed);
return old_val == Unclaimed;
}

View File

@ -31,6 +31,7 @@
class HeapRegion;
class HeapRegionClosure;
class HeapRegionClaimer;
class FreeRegionList;
class G1HeapRegionTable : public G1BiasedMappedArray<HeapRegion*> {
@ -66,6 +67,7 @@ class G1HeapRegionTable : public G1BiasedMappedArray<HeapRegion*> {
class HeapRegionManager: public CHeapObj<mtGC> {
friend class VMStructs;
friend class HeapRegionClaimer;
G1HeapRegionTable _regions;
@ -99,9 +101,6 @@ class HeapRegionManager: public CHeapObj<mtGC> {
// Notify other data structures about change in the heap layout.
void update_committed_space(HeapWord* old_end, HeapWord* new_end);
// Calculate the starting region for each worker during parallel iteration so
// that they do not all start from the same region.
uint start_region_for_worker(uint worker_i, uint num_workers, uint num_regions) const;
// Find a contiguous set of empty or uncommitted regions of length num and return
// the index of the first region or G1_NO_HRM_INDEX if the search was unsuccessful.
@ -223,7 +222,7 @@ public:
// terminating the iteration early if doHeapRegion() returns true.
void iterate(HeapRegionClosure* blk) const;
void par_iterate(HeapRegionClosure* blk, uint worker_id, uint no_of_par_workers, jint claim_value) const;
void par_iterate(HeapRegionClosure* blk, uint worker_id, HeapRegionClaimer* hrclaimer) const;
// Uncommit up to num_regions_to_remove regions that are completely free.
// Return the actual number of uncommitted regions.
@ -235,5 +234,33 @@ public:
void verify_optional() PRODUCT_RETURN;
};
// The HeapRegionClaimer is used during parallel iteration over heap regions,
// allowing workers to claim heap regions, gaining exclusive rights to these regions.
class HeapRegionClaimer : public StackObj {
uint _n_workers;
uint _n_regions;
uint* _claims;
static const uint Unclaimed = 0;
static const uint Claimed = 1;
public:
HeapRegionClaimer(uint n_workers);
~HeapRegionClaimer();
inline uint n_regions() const {
return _n_regions;
}
// Calculate the starting region for given worker so
// that they do not all start from the same region.
uint start_region_for_worker(uint worker_id) const;
// Check if region has been claimed with this HRClaimer.
bool is_region_claimed(uint region_index) const;
// Claim the given region, returns true if successfully claimed.
bool claim_region(uint region_index);
};
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONMANAGER_HPP

View File

@ -95,8 +95,9 @@ void VM_G1IncCollectionPause::doit() {
assert(!_should_initiate_conc_mark ||
((_gc_cause == GCCause::_gc_locker && GCLockerInvokesConcurrent) ||
(_gc_cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent) ||
_gc_cause == GCCause::_g1_humongous_allocation),
"only a GC locker, a System.gc() or a hum allocation induced GC should start a cycle");
_gc_cause == GCCause::_g1_humongous_allocation ||
_gc_cause == GCCause::_update_allocation_context_stats_inc),
"only a GC locker, a System.gc(), stats update or a hum allocation induced GC should start a cycle");
if (_word_size > 0) {
// An allocation has been requested. So, try to do that first.

View File

@ -54,7 +54,8 @@ const char* GCCause::to_string(GCCause::Cause cause) {
case _wb_young_gc:
return "WhiteBox Initiated Young GC";
case _update_allocation_context_stats:
case _update_allocation_context_stats_inc:
case _update_allocation_context_stats_full:
return "Update Allocation Context Stats";
case _no_gc:

View File

@ -47,7 +47,8 @@ class GCCause : public AllStatic {
_heap_inspection,
_heap_dump,
_wb_young_gc,
_update_allocation_context_stats,
_update_allocation_context_stats_inc,
_update_allocation_context_stats_full,
/* implementation independent, but reserved for GC use */
_no_gc,

View File

@ -1153,12 +1153,18 @@ void Compile::init_start(StartNode* s) {
assert(s == start(), "");
}
/**
* Return the 'StartNode'. We must not have a pending failure, since the ideal graph
* can be in an inconsistent state, i.e., we can get segmentation faults when traversing
* the ideal graph.
*/
StartNode* Compile::start() const {
assert(!failing(), "");
assert (!failing(), err_msg_res("Must not have pending failure. Reason is: %s", failure_reason()));
for (DUIterator_Fast imax, i = root()->fast_outs(imax); i < imax; i++) {
Node* start = root()->fast_out(i);
if( start->is_Start() )
if (start->is_Start()) {
return start->as_Start();
}
}
fatal("Did not find Start node!");
return NULL;

View File

@ -707,12 +707,15 @@ class Compile : public Phase {
void sort_expensive_nodes();
// Compilation environment.
Arena* comp_arena() { return &_comp_arena; }
ciEnv* env() const { return _env; }
CompileLog* log() const { return _log; }
bool failing() const { return _env->failing() || _failure_reason != NULL; }
const char* failure_reason() { return _failure_reason; }
bool failure_reason_is(const char* r) { return (r==_failure_reason) || (r!=NULL && _failure_reason!=NULL && strcmp(r, _failure_reason)==0); }
Arena* comp_arena() { return &_comp_arena; }
ciEnv* env() const { return _env; }
CompileLog* log() const { return _log; }
bool failing() const { return _env->failing() || _failure_reason != NULL; }
const char* failure_reason() const { return (_env->failing()) ? _env->failure_reason() : _failure_reason; }
bool failure_reason_is(const char* r) const {
return (r == _failure_reason) || (r != NULL && _failure_reason != NULL && strcmp(r, _failure_reason) == 0);
}
void record_failure(const char* reason);
void record_method_not_compilable(const char* reason, bool all_tiers = false) {

View File

@ -802,10 +802,16 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) {
// each arm of the Phi. If I know something clever about the exceptions
// I'm loading the class from, I can replace the LoadKlass with the
// klass constant for the exception oop.
if( ex_node->is_Phi() ) {
ex_klass_node = new PhiNode( ex_node->in(0), TypeKlassPtr::OBJECT );
for( uint i = 1; i < ex_node->req(); i++ ) {
Node* p = basic_plus_adr( ex_node->in(i), ex_node->in(i), oopDesc::klass_offset_in_bytes() );
if (ex_node->is_Phi()) {
ex_klass_node = new PhiNode(ex_node->in(0), TypeKlassPtr::OBJECT);
for (uint i = 1; i < ex_node->req(); i++) {
Node* ex_in = ex_node->in(i);
if (ex_in == top() || ex_in == NULL) {
// This path was not taken.
ex_klass_node->init_req(i, top());
continue;
}
Node* p = basic_plus_adr(ex_in, ex_in, oopDesc::klass_offset_in_bytes());
Node* k = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeInstPtr::KLASS, TypeKlassPtr::OBJECT) );
ex_klass_node->init_req( i, k );
}

View File

@ -335,7 +335,36 @@ WB_ENTRY(void, WB_NMTOverflowHashBucket(JNIEnv* env, jobject o, jlong num))
}
WB_END
WB_ENTRY(jboolean, WB_NMTChangeTrackingLevel(JNIEnv* env))
// Test that we can downgrade NMT levels but not upgrade them.
if (MemTracker::tracking_level() == NMT_off) {
MemTracker::transition_to(NMT_off);
return MemTracker::tracking_level() == NMT_off;
} else {
assert(MemTracker::tracking_level() == NMT_detail, "Should start out as detail tracking");
MemTracker::transition_to(NMT_summary);
assert(MemTracker::tracking_level() == NMT_summary, "Should be summary now");
// Can't go to detail once NMT is set to summary.
MemTracker::transition_to(NMT_detail);
assert(MemTracker::tracking_level() == NMT_summary, "Should still be summary now");
// Shutdown sets tracking level to minimal.
MemTracker::shutdown();
assert(MemTracker::tracking_level() == NMT_minimal, "Should be minimal now");
// Once the tracking level is minimal, we cannot increase to summary.
// The code ignores this request instead of asserting because if the malloc site
// table overflows in another thread, it tries to change the code to summary.
MemTracker::transition_to(NMT_summary);
assert(MemTracker::tracking_level() == NMT_minimal, "Should still be minimal now");
// Really can never go up to detail, verify that the code would never do this.
MemTracker::transition_to(NMT_detail);
assert(MemTracker::tracking_level() == NMT_minimal, "Should still be minimal now");
return MemTracker::tracking_level() == NMT_minimal;
}
WB_END
#endif // INCLUDE_NMT
static jmethodID reflected_method_to_jmid(JavaThread* thread, JNIEnv* env, jobject method) {
@ -962,6 +991,7 @@ static JNINativeMethod methods[] = {
{CC"NMTReleaseMemory", CC"(JJ)V", (void*)&WB_NMTReleaseMemory },
{CC"NMTOverflowHashBucket", CC"(J)V", (void*)&WB_NMTOverflowHashBucket},
{CC"NMTIsDetailSupported",CC"()Z", (void*)&WB_NMTIsDetailSupported},
{CC"NMTChangeTrackingLevel", CC"()Z", (void*)&WB_NMTChangeTrackingLevel},
#endif // INCLUDE_NMT
{CC"deoptimizeAll", CC"()V", (void*)&WB_DeoptimizeAll },
{CC"deoptimizeMethod", CC"(Ljava/lang/reflect/Executable;Z)I",

View File

@ -540,17 +540,25 @@ int NMethodSweeper::process_nmethod(nmethod *nm) {
// If there are no current activations of this method on the
// stack we can safely convert it to a zombie method
if (nm->can_not_entrant_be_converted()) {
if (PrintMethodFlushing && Verbose) {
tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (not entrant) being made zombie", nm->compile_id(), nm);
}
// Clear ICStubs to prevent back patching stubs of zombie or unloaded
// nmethods during the next safepoint (see ICStub::finalize).
MutexLocker cl(CompiledIC_lock);
nm->clear_ic_stubs();
// Code cache state change is tracked in make_zombie()
nm->make_zombie();
_zombified_count++;
SWEEP(nm);
{
MutexLocker cl(CompiledIC_lock);
nm->clear_ic_stubs();
}
// Acquiring the CompiledIC_lock may block for a safepoint and set the
// nmethod to zombie (see 'CodeCache::make_marked_nmethods_zombies').
// Check if nmethod is still non-entrant at this point.
if (nm->is_not_entrant()) {
if (PrintMethodFlushing && Verbose) {
tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (not entrant) being made zombie", nm->compile_id(), nm);
}
// Code cache state change is tracked in make_zombie()
nm->make_zombie();
_zombified_count++;
SWEEP(nm);
}
assert(nm->is_zombie(), "nmethod must be zombie");
} else {
// Still alive, clean up its inline caches
MutexLocker cl(CompiledIC_lock);

View File

@ -1287,6 +1287,7 @@ void WatcherThread::run() {
this->record_stack_base_and_size();
this->initialize_thread_local_storage();
this->set_native_thread_name(this->name());
this->set_active_handles(JNIHandleBlock::allocate_block());
while (!_should_terminate) {
assert(watcher_thread() == Thread::current(), "thread consistency check");

View File

@ -241,6 +241,7 @@ void VMThread::run() {
assert(this == vm_thread(), "check");
this->initialize_thread_local_storage();
this->set_native_thread_name(this->name());
this->record_stack_base_and_size();
// Notify_lock wait checks on active_handles() to rewait in
// case of spurious wakeup, it should wait on the last

View File

@ -51,14 +51,6 @@ size_t MallocMemorySnapshot::total_arena() const {
return amount;
}
void MallocMemorySnapshot::reset() {
_tracking_header.reset();
for (int index = 0; index < mt_number_of_types; index ++) {
_malloc[index].reset();
}
}
// Make adjustment by subtracting chunks used by arenas
// from total chunks to get total free chunck size
void MallocMemorySnapshot::make_adjustment() {
@ -116,14 +108,9 @@ bool MallocTracker::initialize(NMT_TrackingLevel level) {
bool MallocTracker::transition(NMT_TrackingLevel from, NMT_TrackingLevel to) {
assert(from != NMT_off, "Can not transition from off state");
assert(to != NMT_off, "Can not transition to off state");
if (from == NMT_minimal) {
MallocMemorySummary::reset();
}
assert (from != NMT_minimal, "cannot transition from minimal state");
if (to == NMT_detail) {
assert(from == NMT_minimal || from == NMT_summary, "Just check");
return MallocSiteTable::initialize();
} else if (from == NMT_detail) {
if (from == NMT_detail) {
assert(to == NMT_minimal || to == NMT_summary, "Just check");
MallocSiteTable::shutdown();
}

View File

@ -51,14 +51,6 @@ class MemoryCounter VALUE_OBJ_CLASS_SPEC {
DEBUG_ONLY(_peak_size = 0;)
}
// Reset counters
void reset() {
_size = 0;
_count = 0;
DEBUG_ONLY(_peak_size = 0;)
DEBUG_ONLY(_peak_count = 0;)
}
inline void allocate(size_t sz) {
Atomic::add(1, (volatile MemoryCounterType*)&_count);
if (sz > 0) {
@ -124,11 +116,6 @@ class MallocMemory VALUE_OBJ_CLASS_SPEC {
_arena.resize(sz);
}
void reset() {
_malloc.reset();
_arena.reset();
}
inline size_t malloc_size() const { return _malloc.size(); }
inline size_t malloc_count() const { return _malloc.count();}
inline size_t arena_size() const { return _arena.size(); }
@ -176,8 +163,6 @@ class MallocMemorySnapshot : public ResourceObj {
return s->by_type(mtThreadStack)->malloc_count();
}
void reset();
void copy_to(MallocMemorySnapshot* s) {
s->_tracking_header = _tracking_header;
for (int index = 0; index < mt_number_of_types; index ++) {
@ -240,11 +225,6 @@ class MallocMemorySummary : AllStatic {
return as_snapshot()->malloc_overhead()->size();
}
// Reset all counters to zero
static void reset() {
as_snapshot()->reset();
}
static MallocMemorySnapshot* as_snapshot() {
return (MallocMemorySnapshot*)_snapshot;
}

View File

@ -90,10 +90,6 @@ class MemBaseline VALUE_OBJ_CLASS_SPEC {
_class_count(0) {
}
~MemBaseline() {
reset();
}
bool baseline(bool summaryOnly = true);
BaselineType baseline_type() const { return _baseline_type; }
@ -169,8 +165,7 @@ class MemBaseline VALUE_OBJ_CLASS_SPEC {
// reset the baseline for reuse
void reset() {
_baseline_type = Not_baselined;
_malloc_memory_snapshot.reset();
_virtual_memory_snapshot.reset();
// _malloc_memory_snapshot and _virtual_memory_snapshot are copied over.
_class_count = 0;
_malloc_sites.clear();

View File

@ -96,20 +96,6 @@ class MemSummaryReporter : public MemReporterBase {
size_t _class_count;
public:
// Report summary tracking data from global snapshots directly.
// This constructor is used for final reporting and hs_err reporting.
MemSummaryReporter(MallocMemorySnapshot* malloc_snapshot,
VirtualMemorySnapshot* vm_snapshot, outputStream* output,
size_t class_count = 0, size_t scale = K) :
MemReporterBase(output, scale),
_malloc_snapshot(malloc_snapshot),
_vm_snapshot(vm_snapshot) {
if (class_count == 0) {
_class_count = InstanceKlass::number_of_instance_classes();
} else {
_class_count = class_count;
}
}
// This constructor is for normal reporting from a recent baseline.
MemSummaryReporter(MemBaseline& baseline, outputStream* output,
size_t scale = K) : MemReporterBase(output, scale),

View File

@ -144,11 +144,9 @@ void Tracker::record(address addr, size_t size) {
}
// Shutdown can only be issued via JCmd, and NMT JCmd is serialized
// by lock
// Shutdown can only be issued via JCmd, and NMT JCmd is serialized by lock
void MemTracker::shutdown() {
// We can only shutdown NMT to minimal tracking level if it is
// ever on.
// We can only shutdown NMT to minimal tracking level if it is ever on.
if (tracking_level () > NMT_minimal) {
transition_to(NMT_minimal);
}
@ -157,45 +155,36 @@ void MemTracker::shutdown() {
bool MemTracker::transition_to(NMT_TrackingLevel level) {
NMT_TrackingLevel current_level = tracking_level();
assert(level != NMT_off || current_level == NMT_off, "Cannot transition NMT to off");
if (current_level == level) {
return true;
} else if (current_level > level) {
// Downgrade tracking level, we want to lower the tracking
// level first
// Downgrade tracking level, we want to lower the tracking level first
_tracking_level = level;
// Make _tracking_level visible immediately.
OrderAccess::fence();
VirtualMemoryTracker::transition(current_level, level);
MallocTracker::transition(current_level, level);
if (level == NMT_minimal) _baseline.reset();
} else {
VirtualMemoryTracker::transition(current_level, level);
MallocTracker::transition(current_level, level);
_tracking_level = level;
// Make _tracking_level visible immediately.
OrderAccess::fence();
// Upgrading tracking level is not supported and has never been supported.
// Allocating and deallocating malloc tracking structures is not thread safe and
// leads to inconsistencies unless a lot coarser locks are added.
}
return true;
}
void MemTracker::final_report(outputStream* output) {
assert(output != NULL, "No output stream");
if (tracking_level() >= NMT_summary) {
MallocMemorySnapshot* malloc_memory_snapshot =
MallocMemorySummary::as_snapshot();
malloc_memory_snapshot->make_adjustment();
VirtualMemorySnapshot* virtual_memory_snapshot =
VirtualMemorySummary::as_snapshot();
MemSummaryReporter rptr(malloc_memory_snapshot,
virtual_memory_snapshot, output);
rptr.report();
// shutdown NMT, the data no longer accurate
shutdown();
void MemTracker::report(bool summary_only, outputStream* output) {
assert(output != NULL, "No output stream");
MemBaseline baseline;
if (baseline.baseline(summary_only)) {
if (summary_only) {
MemSummaryReporter rpt(baseline, output);
rpt.report();
} else {
MemDetailReporter rpt(baseline, output);
rpt.report();
}
}
}

View File

@ -70,6 +70,7 @@ class MemTracker : AllStatic {
static inline void release_thread_stack(void* addr, size_t size) { }
static void final_report(outputStream*) { }
static void error_report(outputStream*) { }
};
#else
@ -270,13 +271,20 @@ class MemTracker : AllStatic {
// other tools.
static inline Mutex* query_lock() { return _query_lock; }
// Make a final report and shutdown.
// This function generates summary report without creating snapshots,
// to avoid additional memory allocation. It uses native memory summary
// counters, and makes adjustment to them, once the adjustment is made,
// the counters are no longer accurate. As the result, this function
// should only be used for final reporting before shutting down.
static void final_report(outputStream*);
// Make a final report or report for hs_err file.
static void error_report(outputStream* output) {
if (tracking_level() >= NMT_summary) {
report(true, output); // just print summary for error case.
}
}
static void final_report(outputStream* output) {
NMT_TrackingLevel level = tracking_level();
if (level >= NMT_summary) {
report(level == NMT_summary, output);
}
}
// Stored baseline
static inline MemBaseline& get_baseline() {
@ -291,6 +299,7 @@ class MemTracker : AllStatic {
private:
static NMT_TrackingLevel init_tracking_level();
static void report(bool summary_only, outputStream* output);
private:
// Tracking level

View File

@ -443,26 +443,28 @@ bool VirtualMemoryTracker::remove_released_region(address addr, size_t size) {
bool VirtualMemoryTracker::walk_virtual_memory(VirtualMemoryWalker* walker) {
assert(_reserved_regions != NULL, "Sanity check");
ThreadCritical tc;
LinkedListNode<ReservedMemoryRegion>* head = _reserved_regions->head();
while (head != NULL) {
const ReservedMemoryRegion* rgn = head->peek();
if (!walker->do_allocation_site(rgn)) {
return false;
// Check that the _reserved_regions haven't been deleted.
if (_reserved_regions != NULL) {
LinkedListNode<ReservedMemoryRegion>* head = _reserved_regions->head();
while (head != NULL) {
const ReservedMemoryRegion* rgn = head->peek();
if (!walker->do_allocation_site(rgn)) {
return false;
}
head = head->next();
}
head = head->next();
}
}
return true;
}
// Transition virtual memory tracking level.
bool VirtualMemoryTracker::transition(NMT_TrackingLevel from, NMT_TrackingLevel to) {
if (from == NMT_minimal) {
assert(to == NMT_summary || to == NMT_detail, "Just check");
VirtualMemorySummary::reset();
} else if (to == NMT_minimal) {
assert (from != NMT_minimal, "cannot convert from the lowest tracking level to anything");
if (to == NMT_minimal) {
assert(from == NMT_summary || from == NMT_detail, "Just check");
// Clean up virtual memory tracking data structures.
ThreadCritical tc;
// Check for potential race with other thread calling transition
if (_reserved_regions != NULL) {
delete _reserved_regions;
_reserved_regions = NULL;

View File

@ -62,11 +62,6 @@ class VirtualMemory VALUE_OBJ_CLASS_SPEC {
_committed -= sz;
}
void reset() {
_reserved = 0;
_committed = 0;
}
inline size_t reserved() const { return _reserved; }
inline size_t committed() const { return _committed; }
};
@ -123,12 +118,6 @@ class VirtualMemorySnapshot : public ResourceObj {
return amount;
}
inline void reset() {
for (int index = 0; index < mt_number_of_types; index ++) {
_virtual_memory[index].reset();
}
}
void copy_to(VirtualMemorySnapshot* s) {
for (int index = 0; index < mt_number_of_types; index ++) {
s->_virtual_memory[index] = _virtual_memory[index];
@ -174,10 +163,6 @@ class VirtualMemorySummary : AllStatic {
as_snapshot()->copy_to(s);
}
static inline void reset() {
as_snapshot()->reset();
}
static VirtualMemorySnapshot* as_snapshot() {
return (VirtualMemorySnapshot*)_snapshot;
}

View File

@ -740,7 +740,7 @@ void VMError::report(outputStream* st) {
STEP(228, "(Native Memory Tracking)" )
if (_verbose) {
MemTracker::final_report(st);
MemTracker::error_report(st);
}
STEP(230, "" )

View File

@ -447,7 +447,7 @@ hotspot_compiler_3 = \
compiler/codegen/ \
compiler/cpuflags/RestoreMXCSR.java \
compiler/EscapeAnalysis/ \
compiler/exceptions/TestRecursiveReplacedException.java \
compiler/exceptions/ \
compiler/floatingpoint/ModNaN.java \
compiler/gcbarriers/G1CrashTest.java \
compiler/inlining/ \

View File

@ -38,22 +38,26 @@ public class CheckSegmentedCodeCache {
private static void verifySegmentedCodeCache(ProcessBuilder pb, boolean enabled) throws Exception {
OutputAnalyzer out = new OutputAnalyzer(pb.start());
out.shouldHaveExitValue(0);
if (enabled) {
try {
// Non-nmethod code heap should be always available with the segmented code cache
out.shouldContain(NON_METHOD);
} catch (RuntimeException e) {
// TieredCompilation is disabled in a client VM
out.shouldContain("TieredCompilation is disabled in this release.");
// Check if TieredCompilation is disabled (in a client VM)
if(!out.getOutput().contains("TieredCompilation is disabled in this release.")) {
// Code cache is not segmented
throw new RuntimeException("No code cache segmentation.");
}
}
} else {
out.shouldNotContain(NON_METHOD);
}
out.shouldHaveExitValue(0);
}
private static void verifyCodeHeapNotExists(ProcessBuilder pb, String... heapNames) throws Exception {
OutputAnalyzer out = new OutputAnalyzer(pb.start());
out.shouldHaveExitValue(0);
for (String name : heapNames) {
out.shouldNotContain(name);
}
@ -86,6 +90,10 @@ public class CheckSegmentedCodeCache {
"-XX:ReservedCodeCacheSize=240m",
"-XX:+PrintCodeCache", "-version");
verifySegmentedCodeCache(pb, true);
pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation",
"-XX:ReservedCodeCacheSize=400m",
"-XX:+PrintCodeCache", "-version");
verifySegmentedCodeCache(pb, true);
// Always enabled if SegmentedCodeCache is set
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
@ -100,12 +108,13 @@ public class CheckSegmentedCodeCache {
"-Xint",
"-XX:+PrintCodeCache", "-version");
verifyCodeHeapNotExists(pb, PROFILED, NON_PROFILED);
// If we stop compilation at CompLevel_none or CompLevel_simple we
// don't need a profiled code heap.
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
"-XX:TieredStopAtLevel=0",
"-XX:+PrintCodeCache", "-version");
verifyCodeHeapNotExists(pb, PROFILED, NON_PROFILED);
// If we stop compilation at CompLevel_simple
verifyCodeHeapNotExists(pb, PROFILED);
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
"-XX:TieredStopAtLevel=1",
"-XX:+PrintCodeCache", "-version");

View File

@ -0,0 +1,81 @@
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 8059299
* @summary assert(adr_type != NULL) failed: expecting TypeKlassPtr
* @run main/othervm -Xbatch CatchInlineExceptions
*/
class Exception1 extends Exception {};
class Exception2 extends Exception {};
public class CatchInlineExceptions {
private static int counter0;
private static int counter1;
private static int counter2;
private static int counter;
static void foo(int i) throws Exception {
if ((i & 1023) == 2) {
counter0++;
throw new Exception2();
}
}
static void test(int i) throws Exception {
try {
foo(i);
}
catch (Exception e) {
if (e instanceof Exception1) {
counter1++;
} else if (e instanceof Exception2) {
counter2++;
}
counter++;
throw e;
}
}
public static void main(String[] args) throws Throwable {
for (int i = 0; i < 15000; i++) {
try {
test(i);
} catch (Exception e) {
// expected
}
}
if (counter1 != 0) {
throw new RuntimeException("Failed: counter1(" + counter1 + ") != 0");
}
if (counter2 != counter) {
throw new RuntimeException("Failed: counter2(" + counter2 + ") != counter0(" + counter0 + ")");
}
if (counter2 != counter) {
throw new RuntimeException("Failed: counter2(" + counter2 + ") != counter(" + counter + ")");
}
System.out.println("TEST PASSED");
}
}

View File

@ -0,0 +1,51 @@
/*
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8059100
* @summary Test that you can decrease NMT tracking level but not increase it.
* @key nmt
* @library /testlibrary /testlibrary/whitebox
* @build ChangeTrackingLevel
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ChangeTrackingLevel
*/
import com.oracle.java.testlibrary.*;
import sun.hotspot.WhiteBox;
public class ChangeTrackingLevel {
public static WhiteBox wb = WhiteBox.getWhiteBox();
public static void main(String args[]) throws Exception {
boolean testChangeLevel = wb.NMTChangeTrackingLevel();
if (testChangeLevel) {
System.out.println("NMT level change test passed.");
} else {
// it also fails if the VM asserts.
throw new RuntimeException("NMT level change test failed");
}
}
};

View File

@ -101,6 +101,7 @@ public class WhiteBox {
public native void NMTOverflowHashBucket(long num);
public native long NMTMallocWithPseudoStack(long size, int index);
public native boolean NMTIsDetailSupported();
public native boolean NMTChangeTrackingLevel();
// Compiler
public native void deoptimizeAll();

View File

@ -275,3 +275,5 @@ dc1e26434b3fd7e9b8eeab149103c1e30965f95c jdk9-b28
d181d4002214e4914d5525bd5ee13369311c765c jdk9-b30
292317ebc7dbaca6b3965f0bc7b38a2cee733b7a jdk9-b31
b940ca3d2c7e8a279ca850706b89c2ad3a841e82 jdk9-b32
46b360454dadbb329d42c59bb8192daeb9d59875 jdk9-b33
6b343b9b7a7008f5f699a2d99881163cab7a2986 jdk9-b34

View File

@ -278,3 +278,5 @@ dcaa586ab756420e9a62643793bacef2c84bf637 jdk9-b27
e58d3ea638c3824f01547596b2a98aa5f77c4a5c jdk9-b30
7af228ae847f3c02aaafb7b01cdbb3bdc2e89e77 jdk9-b31
838a2f693e51b869e7bc26a20afffdde1300394e jdk9-b32
77a45995dd3b6e57805475ae3111ac6f7db7749e jdk9-b33
28ea43d925f1e5250976097a2977dd3e66e11f0b jdk9-b34

View File

@ -275,3 +275,5 @@ f0870554049807d3392bd7976ab114f7f2b7bafa jdk9-b27
8d24fb4493f13d380a2adf62d444e1e5a4451f37 jdk9-b30
71e99dae28f9791287b88d46e16a266b564f22be jdk9-b31
8bdf7083b5bd02aa330ba622895e586dd3378d37 jdk9-b32
60fe681c30bc3821545a2506d4d3c2e04073f67c jdk9-b33
21568031434d7a9dbb0cc6516cc3183d349c2253 jdk9-b34

View File

@ -709,7 +709,18 @@ $(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar: $(HOTSPOT_DIST)/lib/sa-jdi.jar
#
$(eval $(call SetupZipArchive,BUILD_SEC_BIN_ZIP, \
SRC := $(JDK_OUTPUTDIR), \
INCLUDES := modules/java.base/javax/net \
INCLUDES := \
modules/java.base/javax/crypto \
modules/java.base/javax/crypto/spec \
modules/java.base/sun/security/internal/interfaces \
modules/java.base/sun/security/internal/spec \
modules/java.base/com/sun/crypto/provider \
modules/jdk.crypto.ec/sun/security/ec \
modules/jdk.crypto.mscapi/sun/security/mscapi \
modules/jdk.crypto.pkcs11/sun/security/pkcs11 \
modules/jdk.crypto.pkcs11/sun/security/pkcs11/wrapper \
modules/jdk.crypto.ucrypto/com/oracle/security/ucrypto \
modules/java.base/javax/net \
modules/java.base/javax/security/cert \
modules/java.base/com/sun/net/ssl \
modules/java.base/com/sun/security/cert \

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -41,52 +41,73 @@ ifneq ($(BUILD_CRYPTO), no)
US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED := \
$(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/US_export_policy.jar
ifndef OPENJDK
#
# In past releases, Oracle JDK has had a separately downloadable set of
# policy files which has been a nightmare for deployment.
#
# Now if we're closed and limited (default for Oracle JDK), create
# an "unlimited_policy" directory that contains the unlimited policy
# files. It will be up to the user/deployer to make an informed choice
# as to whether they are legally entitled to use the unlimited policy
# file in their environment. Users/deployers simply need to overwrite
# the files. Consult README.txt (below) for more info.
#
UNLIMITED_POLICY_DIR := $(JDK_OUTPUTDIR)/lib/security/unlimited_policy
endif
#
# TODO fix so that SetupArchive does not write files into SRCS
# then we don't need this extra copying
#
# NOTE: We currently do not place restrictions on our limited export
# policy. This was not a typo. This means we are shipping the same file
# for both limimted and unlimited US_export_policy.jar.
# for both limited and unlimited US_export_policy.jar. Only the local
# policy file currently has restrictions.
#
US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
US_EXPORT_POLICY_JAR_SRC_DIR := \
$(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
US_EXPORT_POLICY_JAR_TMP := \
$(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/US_export_policy_jar.tmp
$(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
$(install-file)
US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
US_EXPORT_POLICY_JAR_DEPS := \
$(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
$(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, $(US_EXPORT_POLICY_JAR_DEPS), \
$(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, \
$(US_EXPORT_POLICY_JAR_DEPS), \
SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
SUFFIXES := .policy, \
JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED), \
EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
SKIP_METAINF := true))
$(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED): $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
$(ECHO) $(LOG_INFO) Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(install-file)
$(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED): \
$(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
$(ECHO) $(LOG_INFO) \
Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(install-file)
TARGETS += $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED) \
$(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
endif
ifndef OPENJDK
ifeq ($(UNLIMITED_CRYPTO), true)
$(error No prebuilt unlimited crypto jars available)
endif
$(US_EXPORT_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
ifeq ($(UNLIMITED_CRYPTO), true)
$(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
$(install-file)
else
ifeq ($(UNLIMITED_CRYPTO), true)
$(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
$(install-file)
else
$(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED)
$(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED)
$(install-file)
endif
ifndef OPENJDK
ifneq ($(UNLIMITED_CRYPTO), true)
$(UNLIMITED_POLICY_DIR)/US_export_policy.jar: \
$(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
$(install-file)
TARGETS += $(UNLIMITED_POLICY_DIR)/US_export_policy.jar
endif
endif
@ -112,11 +133,13 @@ ifneq ($(BUILD_CRYPTO), no)
LOCAL_POLICY_JAR_UNLIMITED_TMP := \
$(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/local_policy_jar.tmp
$(LOCAL_POLICY_JAR_LIMITED_TMP)/%: $(JDK_TOPDIR)/make/data/cryptopolicy/limited/%
$(install-file)
$(LOCAL_POLICY_JAR_LIMITED_TMP)/%: \
$(JDK_TOPDIR)/make/data/cryptopolicy/limited/%
$(install-file)
$(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/%
$(install-file)
$(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: \
$(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/%
$(install-file)
$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \
$(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \
@ -135,28 +158,34 @@ ifneq ($(BUILD_CRYPTO), no)
EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
SKIP_METAINF := true))
TARGETS += $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED) $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
TARGETS += $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED) \
$(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
ifndef OPENJDK
$(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/README.txt: \
$(JDK_TOPDIR)/make/closed/javax/crypto/doc/README.txt
ifneq ($(UNLIMITED_CRYPTO), true)
$(UNLIMITED_POLICY_DIR)/README.txt: \
$(JDK_TOPDIR)/make/closed/data/cryptopolicy/README.txt
$(install-file)
TARGETS += $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/README.txt
TARGETS += $(UNLIMITED_POLICY_DIR)/README.txt
endif
endif
endif
ifeq ($(UNLIMITED_CRYPTO), true)
$(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
$(install-file)
else
$(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED)
$(install-file)
endif
ifndef OPENJDK
$(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(install-file)
else
ifeq ($(UNLIMITED_CRYPTO), true)
$(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
$(install-file)
else
$(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED)
$(install-file)
ifneq ($(UNLIMITED_CRYPTO), true)
$(UNLIMITED_POLICY_DIR)/local_policy.jar: \
$(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
$(install-file)
TARGETS += $(UNLIMITED_POLICY_DIR)/local_policy.jar
endif
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -29,16 +29,13 @@ include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
# The jars created in this file are required for the exploded jdk image to function and
# cannot wait to be built in the images target.
##########################################################################################
# Create manifest for security jars
#
# Include these extra attributes for now, should probably take out.
#
MAINMANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf
JCE_MANIFEST := $(JDK_OUTPUTDIR)/lib/_the.security.manifest.mf
JCE_MANIFEST := $(JDK_OUTPUTDIR)/jce/unsigned/_the.security.manifest.mf
$(JCE_MANIFEST): $(MAINMANIFEST)
$(MKDIR) -p $(@D)
@ -48,18 +45,15 @@ $(JCE_MANIFEST): $(MAINMANIFEST)
$(MAINMANIFEST) >> $@.tmp
$(ECHO) "Extension-Name: javax.crypto" >> $@.tmp
$(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp
$(ECHO) "Release-Version: $(RELEASE)" >> $@.tmp
$(MV) $@.tmp $@
##########################################################################################
# For security and crypto jars, always build the jar, but for closed, install the prebuilt
# signed version instead of the newly built jar. Unsigned jars are treated as intermediate
# targets and explicitly added to the TARGETS list. For open, signing is not needed. See
# SignJars.gmk for more information.
# For crypto jars, always build the jar.
#
# The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO
# variable is set to no if these jars can't be built to skip that step of the build.
# Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no
# other way to get the jars than to build them.
# The source for the crypto jars is not available for all licensees.
# The BUILD_CRYPTO variable is set to no if these jars can't be built
# to skip that step of the build.
SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
SUNPKCS11_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunpkcs11.jar
@ -74,15 +68,8 @@ $(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR, , \
$(SUNPKCS11_JAR_UNSIGNED): $(JCE_MANIFEST)
ifndef OPENJDK
SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
$(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_SRC)
@$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED)
$(install-file)
else
$(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED)
$(install-file)
endif
TARGETS += $(SUNPKCS11_JAR_UNSIGNED) $(SUNPKCS11_JAR_DST)
@ -101,22 +88,16 @@ $(eval $(call SetupArchive,BUILD_SUNEC_JAR, , \
$(SUNEC_JAR_UNSIGNED): $(JCE_MANIFEST)
ifndef OPENJDK
SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
$(SUNEC_JAR_DST): $(SUNEC_JAR_SRC)
@$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED)
$(install-file)
else
$(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED)
$(install-file)
endif
TARGETS += $(SUNEC_JAR_UNSIGNED) $(SUNEC_JAR_DST)
##########################################################################################
SUNJCE_PROVIDER_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunjce_provider.jar
SUNJCE_PROVIDER_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunjce_provider.jar
SUNJCE_PROVIDER_JAR_UNSIGNED := \
$(JDK_OUTPUTDIR)/jce/unsigned/sunjce_provider.jar
ifneq ($(BUILD_CRYPTO), no)
$(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR, , \
@ -132,15 +113,8 @@ ifneq ($(BUILD_CRYPTO), no)
TARGETS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
endif
ifndef OPENJDK
SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
$(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_SRC)
@$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED)
$(install-file)
else
$(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED)
$(install-file)
endif
TARGETS += $(SUNJCE_PROVIDER_JAR_DST)
@ -163,15 +137,8 @@ ifneq ($(BUILD_CRYPTO), no)
TARGETS += $(JCE_JAR_UNSIGNED)
endif
ifndef OPENJDK
JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
$(JCE_JAR_DST): $(JCE_JAR_SRC)
@$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(JCE_JAR_DST): $(JCE_JAR_UNSIGNED)
$(install-file)
else
$(JCE_JAR_DST): $(JCE_JAR_UNSIGNED)
$(install-file)
endif
TARGETS += $(JCE_JAR_DST)
@ -192,15 +159,8 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
$(SUNMSCAPI_JAR_UNSIGNED): $(JCE_MANIFEST)
ifndef OPENJDK
SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
$(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_SRC)
@$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED)
$(install-file)
else
$(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED)
$(install-file)
endif
TARGETS += $(SUNMSCAPI_JAR_UNSIGNED) $(SUNMSCAPI_JAR_DST)
@ -213,7 +173,6 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/ucrypto.jar
UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar
$(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \
SRCS := $(JDK_OUTPUTDIR)/modules/jdk.crypto.ucrypto, \
@ -225,8 +184,7 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
$(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
$(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_SRC)
@$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_UNSIGNED)
$(install-file)
TARGETS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)

View File

@ -203,8 +203,6 @@ ifeq ($(PROFILE), )
jconsole.jar \
sa-jdi.jar \
dt.jar \
orb.idl \
ir.idl \
ct.sym
ifeq ($(OPENJDK_TARGET_OS), windows)

View File

@ -1,126 +0,0 @@
#
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
# 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.
#
include $(SPEC)
include MakeBase.gmk
# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Oracle JDK
# builds respectively.)
#
# JCE builds are very different between OpenJDK and JDK. The OpenJDK JCE
# jar files do not require signing, but those for JDK do. If an unsigned
# jar file is installed into JDK, things will break when the crypto
# routines are called.
#
# All jars are created in CreateJars.gmk. This Makefile does the signing
# of the jars for JDK.
#
# For JDK, the binaries use pre-built/pre-signed binary files stored in
# the closed workspace that are not shipped in the OpenJDK workspaces.
# We still build the JDK files to verify the files compile, and in
# preparation for possible signing. Developers working on JCE in JDK
# must sign the JCE files before testing. The JCE signing key is kept
# separate from the JDK workspace to prevent its disclosure.
#
# SPECIAL NOTE TO JCE/JDK developers: The source files must eventually
# be built, signed, and then the resulting jar files MUST BE CHECKED
# INTO THE CLOSED PART OF THE WORKSPACE*. This separate step *MUST NOT
# BE FORGOTTEN*, otherwise a bug fixed in the source code will not be
# reflected in the shipped binaries.
#
# Please consult with Release Engineering, which is responsible for
# creating the final JCE builds suitable for checkin.
#
# Default target
all:
ifndef OPENJDK
README-MAKEFILE_WARNING := \
"\nPlease read jdk/make/SignJars.gmk for further build instructions.\n"
#
# Location for JCE codesigning key.
#
SIGNING_KEY_DIR := /security/ws/JCE-signing/src
SIGNING_KEYSTORE := $(SIGNING_KEY_DIR)/KeyStore.jks
SIGNING_PASSPHRASE := $(SIGNING_KEY_DIR)/passphrase.txt
SIGNING_ALIAS := oracle_jce_rsa
#
# Defines for signing the various jar files.
#
check-keystore:
@if [ ! -f $(SIGNING_KEYSTORE) -o ! -f $(SIGNING_PASSPHRASE) ]; then \
$(PRINTF) "\n$(SIGNING_KEYSTORE): Signing mechanism *NOT* available..."; \
$(PRINTF) $(README-MAKEFILE_WARNING); \
exit 2; \
fi
$(JDK_OUTPUTDIR)/jce/signed/%: $(JDK_OUTPUTDIR)/jce/unsigned/%
$(call install-file)
$(JARSIGNER) -keystore $(SIGNING_KEYSTORE) \
$@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE)
@$(PRINTF) "\nJar codesigning finished.\n"
JAR_LIST := \
jce.jar \
policy/limited/local_policy.jar \
policy/limited/US_export_policy.jar \
policy/unlimited/local_policy.jar \
policy/unlimited/US_export_policy.jar \
sunec.jar \
sunjce_provider.jar \
sunpkcs11.jar \
sunmscapi.jar \
ucrypto.jar \
#
UNSIGNED_JARS := $(wildcard $(addprefix $(JDK_OUTPUTDIR)/jce/unsigned/, $(JAR_LIST)))
ifeq ($(UNSIGNED_JARS), )
$(error No jars found in $(JDK_OUTPUTDIR)/jce/unsigned/)
endif
SIGNED_JARS := $(patsubst $(JDK_OUTPUTDIR)/jce/unsigned/%,$(JDK_OUTPUTDIR)/jce/signed/%, \
$(UNSIGNED_JARS))
$(SIGNED_JARS): check-keystore
$(JDK_OUTPUTDIR)/jce/signed/policy/unlimited/README.txt: \
$(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/README.txt
$(install-file)
all: $(SIGNED_JARS) $(JDK_OUTPUTDIR)/jce/signed/policy/unlimited/README.txt
@$(PRINTF) "\n*** The jar files built by the 'sign-jars' target are developer ***"
@$(PRINTF) "\n*** builds only and *MUST NOT* be checked into the closed workspace. ***"
@$(PRINTF) "\n*** ***"
@$(PRINTF) "\n*** Please consult with Release Engineering: they will generate ***"
@$(PRINTF) "\n*** the proper binaries for the closed workspace. ***"
@$(PRINTF) "\n"
@$(PRINTF) $(README-MAKEFILE_WARNING)
endif # !OPENJDK

View File

@ -25,9 +25,12 @@
include LibCommon.gmk
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, jdk, lib/Lib-java.management.gmk))
################################################################################
BUILD_LIBMANAGEMENT_SRC := $(JDK_TOPDIR)/src/java.management/share/native/libmanagement \
BUILD_LIBMANAGEMENT_SRC += $(JDK_TOPDIR)/src/java.management/share/native/libmanagement \
$(JDK_TOPDIR)/src/java.management/$(OPENJDK_TARGET_OS_API_DIR)/native/libmanagement
BUILD_LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/java.management/share/native/include \
$(addprefix -I,$(BUILD_LIBMANAGEMENT_SRC)) \
@ -56,6 +59,9 @@ ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
endif
endif
# Make it possible to override this variable
LIBMANAGEMENT_MAPFILE ?= $(JDK_TOPDIR)/make/mapfiles/libmanagement/mapfile-vers
$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \
LIBRARY := management, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
@ -64,7 +70,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \
LANG := C, \
OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) $(BUILD_LIBMANAGEMENT_CFLAGS), \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libmanagement/mapfile-vers, \
MAPFILE := $(LIBMANAGEMENT_MAPFILE), \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_solaris := -lkstat, \

View File

@ -79,6 +79,13 @@ PROFILE_1_JRE_LIB_FILES := \
security/trusted.libraries \
tzdb.dat
ifndef OPENJDK
PROFILE_1_JRE_LIB_FILES += \
security/unlimited_policy/README.txt \
security/unlimited_policy/US_export_policy.jar \
security/unlimited_policy/local_policy.jar
endif
PROFILE_1_JRE_OTHER_FILES := \
COPYRIGHT \
LICENSE \
@ -99,6 +106,11 @@ PROFILE_1_JRE_JAR_FILES := \
security/US_export_policy.jar \
security/local_policy.jar
ifndef OPENJDK
PROFILE_1_JRE_JAR_FILES += \
security/unlimited_policy/US_export_policy.jar \
security/unlimited_policy/local_policy.jar
endif
PROFILE_2_JRE_BIN_FILES := \
rmid$(EXE_SUFFIX) \

View File

@ -397,7 +397,7 @@ import java.lang.NullPointerException; // for javadoc
* in all cases,
* <pre>
* new URI(<i>u</i>.getScheme(),
* <i>u</i>.getUserInfo(), <i>u</i>.getAuthority(),
* <i>u</i>.getAuthority(),
* <i>u</i>.getPath(), <i>u</i>.getQuery(),
* <i>u</i>.getFragment())
* .equals(<i>u</i>)</pre>

View File

@ -384,7 +384,7 @@ public abstract class $Type$Buffer
* and vice versa. The new buffer's capacity and limit will be
* <tt>array.length</tt>, its position will be zero, and its mark will be
* undefined. Its {@link #array backing array} will be the
* given array, and its {@link #arrayOffset array offset>} will
* given array, and its {@link #arrayOffset array offset} will
* be zero. </p>
*
* @param array

View File

@ -208,7 +208,7 @@ public abstract class FileStore {
* @param attribute
* the attribute to read
* @return the attribute value; {@code null} may be a valid valid for some
* @return the attribute value; {@code null} may be a valid for some
* attributes
*
* @throws UnsupportedOperationException

View File

@ -1480,7 +1480,7 @@ public final class Files {
* <li>It is <i>transitive</i>: for three {@code Paths}
* {@code f}, {@code g}, and {@code h}, if {@code isSameFile(f,g)} returns
* {@code true} and {@code isSameFile(g,h)} returns {@code true}, then
* {@code isSameFile(f,h)} will return return {@code true}.
* {@code isSameFile(f,h)} will return {@code true}.
* </ul>
*
* @param path
@ -2818,7 +2818,7 @@ public final class Files {
/**
* Opens or creates a file for writing, returning a {@code BufferedWriter}
* that may be used to write text to the file in an efficient manner.
* The {@code options} parameter specifies how the the file is created or
* The {@code options} parameter specifies how the file is created or
* opened. If no options are present then this method works as if the {@link
* StandardOpenOption#CREATE CREATE}, {@link
* StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING}, and {@link
@ -3307,7 +3307,7 @@ public final class Files {
* line.separator}. Characters are encoded into bytes using the specified
* charset.
*
* <p> The {@code options} parameter specifies how the the file is created
* <p> The {@code options} parameter specifies how the file is created
* or opened. If no options are present then this method works as if the
* {@link StandardOpenOption#CREATE CREATE}, {@link
* StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING}, and {@link

View File

@ -115,7 +115,7 @@ public interface SecureDirectoryStream<T>
* channel.
*
* @param path
* the path of the file to open open or create
* the path of the file to open or create
* @param options
* options specifying how the file is opened
* @param attrs

View File

@ -74,7 +74,7 @@ class TempFileHelper {
}
/**
* Creates a file or directory in in the given given directory (or in the
* Creates a file or directory in the given directory (or in the
* temporary directory if dir is {@code null}).
*/
private static Path create(Path dir,
@ -149,7 +149,7 @@ class TempFileHelper {
}
/**
* Creates a temporary file in the given directory, or in in the
* Creates a temporary file in the given directory, or in the
* temporary directory if dir is {@code null}.
*/
static Path createTempFile(Path dir,
@ -162,7 +162,7 @@ class TempFileHelper {
}
/**
* Creates a temporary directory in the given directory, or in in the
* Creates a temporary directory in the given directory, or in the
* temporary directory if dir is {@code null}.
*/
static Path createTempDirectory(Path dir,

View File

@ -51,7 +51,7 @@
* <p> An attribute view provides a read-only or updatable view of the non-opaque
* values, or <em>metadata</em>, associated with objects in a file system.
* The {@link java.nio.file.attribute.FileAttributeView} interface is
* extended by several other interfaces that that views to specific sets of file
* extended by several other interfaces that views to specific sets of file
* attributes. {@code FileAttributeViews} are selected by invoking the {@link
* java.nio.file.Files#getFileAttributeView} method with a
* <em>type-token</em> to identify the required view. Views can also be identified

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -63,7 +63,7 @@ package java.security;
* </pre>
*
* For more information, see
* <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280:
* <a href="http://tools.ietf.org/html/rfc5280">RFC 5280:
* Internet X.509 Public Key Infrastructure Certificate and CRL Profile</a>.
*
* <LI>A Format

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,8 +27,8 @@ package java.security.cert;
/**
* The CRLReason enumeration specifies the reason that a certificate
* is revoked, as defined in <a href="http://www.ietf.org/rfc/rfc3280.txt">
* RFC 3280: Internet X.509 Public Key Infrastructure Certificate and CRL
* is revoked, as defined in <a href="http://tools.ietf.org/html/rfc5280">
* RFC 5280: Internet X.509 Public Key Infrastructure Certificate and CRL
* Profile</a>.
*
* @author Sean Mullan

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,7 @@ package java.security.cert;
/**
* The {@code PKIXReason} enumerates the potential PKIX-specific reasons
* that an X.509 certification path may be invalid according to the PKIX
* (RFC 3280) standard. These reasons are in addition to those of the
* (RFC 5280) standard. These reasons are in addition to those of the
* {@code CertPathValidatorException.BasicReason} enumeration.
*
* @since 1.7

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -78,7 +78,7 @@ public class TrustAnchor {
* The name constraints are specified as a byte array. This byte array
* should contain the DER encoded form of the name constraints, as they
* would appear in the NameConstraints structure defined in
* <a href="http://www.ietf.org/rfc/rfc3280">RFC 3280</a>
* <a href="http://tools.ietf.org/html/rfc5280">RFC 5280</a>
* and X.509. The ASN.1 definition of this structure appears below.
*
* <pre>{@code
@ -140,7 +140,7 @@ public class TrustAnchor {
* <p>
* The name constraints are specified as a byte array. This byte array
* contains the DER encoded form of the name constraints, as they
* would appear in the NameConstraints structure defined in RFC 3280
* would appear in the NameConstraints structure defined in RFC 5280
* and X.509. The ASN.1 notation for this structure is supplied in the
* documentation for
* {@link #TrustAnchor(X509Certificate, byte[])
@ -179,7 +179,7 @@ public class TrustAnchor {
* <p>
* The name constraints are specified as a byte array. This byte array
* contains the DER encoded form of the name constraints, as they
* would appear in the NameConstraints structure defined in RFC 3280
* would appear in the NameConstraints structure defined in RFC 5280
* and X.509. The ASN.1 notation for this structure is supplied in the
* documentation for
* {@link #TrustAnchor(X509Certificate, byte[])
@ -294,7 +294,7 @@ public class TrustAnchor {
* <p>
* The name constraints are returned as a byte array. This byte array
* contains the DER encoded form of the name constraints, as they
* would appear in the NameConstraints structure defined in RFC 3280
* would appear in the NameConstraints structure defined in RFC 5280
* and X.509. The ASN.1 notation for this structure is supplied in the
* documentation for
* {@link #TrustAnchor(X509Certificate, byte[])

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -69,7 +69,7 @@ import sun.security.x509.X509CRLImpl;
* </pre>
* <p>
* More information can be found in
* <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280: Internet X.509
* <a href="http://tools.ietf.org/html/rfc5280">RFC 5280: Internet X.509
* Public Key Infrastructure Certificate and CRL Profile</a>.
* <p>
* The ASN.1 definition of {@code tbsCertList} is:

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -52,7 +52,7 @@ import sun.security.x509.X500Name;
* {@link CertStore#getCRLs CertStore.getCRLs} or some similar
* method.
* <p>
* Please refer to <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280:
* Please refer to <a href="http://tools.ietf.org/html/rfc5280">RFC 5280:
* Internet X.509 Public Key Infrastructure Certificate and CRL Profile</a>
* for definitions of the X.509 CRL fields and extensions mentioned below.
* <p>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -65,7 +65,7 @@ import sun.security.x509.*;
* number. Other unique combinations include the issuer, subject,
* subjectKeyIdentifier and/or the subjectPublicKey criteria.
* <p>
* Please refer to <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280:
* Please refer to <a href="http://tools.ietf.org/html/rfc5280">RFC 5280:
* Internet X.509 Public Key Infrastructure Certificate and CRL Profile</a> for
* definitions of the X.509 certificate extensions mentioned below.
* <p>
@ -728,7 +728,7 @@ public class X509CertSelector implements CertSelector {
* The name is provided in string format.
* <a href="http://www.ietf.org/rfc/rfc822.txt">RFC 822</a>, DNS, and URI
* names use the well-established string formats for those types (subject to
* the restrictions included in RFC 3280). IPv4 address names are
* the restrictions included in RFC 5280). IPv4 address names are
* supplied using dotted quad notation. OID address names are represented
* as a series of nonnegative integers separated by periods. And
* directory names (distinguished names) are supplied in RFC 2253 format.
@ -746,7 +746,7 @@ public class X509CertSelector implements CertSelector {
* String form of some distinguished names.
*
* @param type the name type (0-8, as specified in
* RFC 3280, section 4.2.1.7)
* RFC 5280, section 4.2.1.6)
* @param name the name in string form (not {@code null})
* @throws IOException if a parsing error occurs
*/
@ -770,7 +770,7 @@ public class X509CertSelector implements CertSelector {
* <p>
* The name is provided as a byte array. This byte array should contain
* the DER encoded name, as it would appear in the GeneralName structure
* defined in RFC 3280 and X.509. The encoded byte array should only contain
* defined in RFC 5280 and X.509. The encoded byte array should only contain
* the encoded value of the name, and should not include the tag associated
* with the name in the GeneralName structure. The ASN.1 definition of this
* structure appears below.
@ -806,7 +806,7 @@ public class X509CertSelector implements CertSelector {
* must contain the specified subjectAlternativeName.
*
* @param type the name type (0-8, as specified in
* RFC 3280, section 4.2.1.7)
* RFC 5280, section 4.2.1.6)
* @param name the name in string or byte array form
* @throws IOException if a parsing error occurs
*/
@ -995,7 +995,7 @@ public class X509CertSelector implements CertSelector {
* <p>
* The name constraints are specified as a byte array. This byte array
* should contain the DER encoded form of the name constraints, as they
* would appear in the NameConstraints structure defined in RFC 3280
* would appear in the NameConstraints structure defined in RFC 5280
* and X.509. The ASN.1 definition of this structure appears below.
*
* <pre>{@code
@ -1197,7 +1197,7 @@ public class X509CertSelector implements CertSelector {
* <p>
* The name is provided in string format. RFC 822, DNS, and URI names
* use the well-established string formats for those types (subject to
* the restrictions included in RFC 3280). IPv4 address names are
* the restrictions included in RFC 5280). IPv4 address names are
* supplied using dotted quad notation. OID address names are represented
* as a series of nonnegative integers separated by periods. And
* directory names (distinguished names) are supplied in RFC 2253 format.
@ -1214,7 +1214,7 @@ public class X509CertSelector implements CertSelector {
* String form of some distinguished names.
*
* @param type the name type (0-8, as specified in
* RFC 3280, section 4.2.1.7)
* RFC 5280, section 4.2.1.6)
* @param name the name in string form
* @throws IOException if a parsing error occurs
*/
@ -1234,7 +1234,7 @@ public class X509CertSelector implements CertSelector {
* <p>
* The name is provided as a byte array. This byte array should contain
* the DER encoded name, as it would appear in the GeneralName structure
* defined in RFC 3280 and X.509. The ASN.1 definition of this structure
* defined in RFC 5280 and X.509. The ASN.1 definition of this structure
* appears in the documentation for
* {@link #addSubjectAlternativeName(int type, byte [] name)
* addSubjectAlternativeName(int type, byte [] name)}.
@ -1243,7 +1243,7 @@ public class X509CertSelector implements CertSelector {
* subsequent modifications.
*
* @param type the name type (0-8, as specified in
* RFC 3280, section 4.2.1.7)
* RFC 5280, section 4.2.1.6)
* @param name a byte array containing the name in ASN.1 DER encoded form
* @throws IOException if a parsing error occurs
*/
@ -1258,7 +1258,7 @@ public class X509CertSelector implements CertSelector {
* the specified pathToName.
*
* @param type the name type (0-8, as specified in
* RFC 3280, section 4.2.1.7)
* RFC 5280, section 4.2.1.6)
* @param name the name in string or byte array form
* @throws IOException if an encoding error occurs (incorrect form for DN)
*/
@ -1715,7 +1715,7 @@ public class X509CertSelector implements CertSelector {
* <p>
* The name constraints are returned as a byte array. This byte array
* contains the DER encoded form of the name constraints, as they
* would appear in the NameConstraints structure defined in RFC 3280
* would appear in the NameConstraints structure defined in RFC 5280
* and X.509. The ASN.1 notation for this structure is supplied in the
* documentation for
* {@link #setNameConstraints(byte [] bytes) setNameConstraints(byte [] bytes)}.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -63,7 +63,7 @@ import sun.security.x509.X509CertImpl;
* CA such as a "root" CA.
* <p>
* More information can be found in
* <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280: Internet X.509
* <a href="http://tools.ietf.org/html/rfc5280">RFC 5280: Internet X.509
* Public Key Infrastructure Certificate and CRL Profile</a>.
* <p>
* The ASN.1 definition of {@code tbsCertificate} is:
@ -408,7 +408,7 @@ implements X509Extension {
* Gets the {@code issuerUniqueID} value from the certificate.
* The issuer unique identifier is present in the certificate
* to handle the possibility of reuse of issuer names over time.
* RFC 3280 recommends that names not be reused and that
* RFC 5280 recommends that names not be reused and that
* conforming certificates not make use of unique identifiers.
* Applications conforming to that profile should be capable of
* parsing unique identifiers and making comparisons.
@ -459,7 +459,7 @@ implements X509Extension {
* encipherOnly (7),
* decipherOnly (8) }
* </pre>
* RFC 3280 recommends that when used, this be marked
* RFC 5280 recommends that when used, this be marked
* as a critical extension.
*
* @return the KeyUsage extension of this certificate, represented as
@ -572,7 +572,7 @@ implements X509Extension {
* <a href="http://www.ietf.org/rfc/rfc822.txt">RFC 822</a>, DNS, and URI
* names are returned as {@code String}s,
* using the well-established string formats for those types (subject to
* the restrictions included in RFC 3280). IPv4 address names are
* the restrictions included in RFC 5280). IPv4 address names are
* returned using dotted quad notation. IPv6 address names are returned
* in the form "a1:a2:...:a8", where a1-a8 are hexadecimal values
* representing the eight 16-bit pieces of the address. OID names are

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -93,8 +93,7 @@ import java.io.IOException;
* The deployment applications can use "Accept-Encoding=pack200-gzip". This
* indicates to the server that the client application desires a version of
* the file encoded with Pack200 and further compressed with gzip. Please
* refer to <a href="{@docRoot}/../technotes/guides/deployment/deployment-guide/pack200.html">Java Deployment Guide</a> for more details and
* techniques.
* refer to the Java Deployment Guide for techniques and details.
* <p>
* Unless otherwise noted, passing a <tt>null</tt> argument to a constructor or
* method in this class will cause a {@link NullPointerException} to be thrown.

View File

@ -263,9 +263,9 @@ public class Cipher {
Provider provider,
String transformation) {
// See bug 4341369 & 4334690 for more info.
// If the caller is trusted, then okey.
// If the caller is trusted, then okay.
// Otherwise throw a NullPointerException.
if (!JceSecurityManager.INSTANCE.isCallerTrusted()) {
if (!JceSecurityManager.INSTANCE.isCallerTrusted(provider)) {
throw new NullPointerException();
}
this.spi = cipherSpi;

View File

@ -76,12 +76,14 @@ final class JceSecurity {
static {
try {
AccessController.doPrivileged(
new PrivilegedExceptionAction<Object>() {
public Object run() throws Exception {
new PrivilegedExceptionAction<Void> () {
@Override
public Void run() throws Exception {
setupJurisdictionPolicies();
return null;
}
});
}
);
isRestricted = defaultPolicy.implies(
CryptoAllPermission.INSTANCE) ? false : true;
@ -143,9 +145,9 @@ final class JceSecurity {
* @throws Exception on error
*/
static CryptoPermissions verifyExemptJar(URL codeBase) throws Exception {
JarVerifier jv = new JarVerifier(codeBase, true);
jv.verify();
return jv.getPermissions();
ProviderVerifier pv = new ProviderVerifier(codeBase, true);
pv.verify();
return pv.getPermissions();
}
/**
@ -153,11 +155,11 @@ final class JceSecurity {
*
* @throws Exception on error
*/
static void verifyProviderJar(URL codeBase) throws Exception {
static void verifyProvider(URL codeBase, Provider p) throws Exception {
// Verify the provider JAR file and all
// supporting JAR files if there are any.
JarVerifier jv = new JarVerifier(codeBase, false);
jv.verify();
ProviderVerifier pv = new ProviderVerifier(codeBase, p, false);
pv.verify();
}
private final static Object PROVIDER_VERIFIED = Boolean.TRUE;
@ -183,7 +185,7 @@ final class JceSecurity {
try {
verifyingProviders.put(p, Boolean.FALSE);
URL providerURL = getCodeBase(p.getClass());
verifyProviderJar(providerURL);
verifyProvider(providerURL, p);
// Verified ok, cache result
verificationResults.put(p, PROVIDER_VERIFIED);
return null;
@ -222,18 +224,20 @@ final class JceSecurity {
synchronized (codeBaseCacheRef) {
URL url = codeBaseCacheRef.get(clazz);
if (url == null) {
url = AccessController.doPrivileged(new PrivilegedAction<URL>() {
public URL run() {
ProtectionDomain pd = clazz.getProtectionDomain();
if (pd != null) {
CodeSource cs = pd.getCodeSource();
if (cs != null) {
return cs.getLocation();
url = AccessController.doPrivileged(
new PrivilegedAction<URL>() {
@Override
public URL run() {
ProtectionDomain pd = clazz.getProtectionDomain();
if (pd != null) {
CodeSource cs = pd.getCodeSource();
if (cs != null) {
return cs.getLocation();
}
}
return NULL_URL;
}
return NULL_URL;
}
});
});
codeBaseCacheRef.put(clazz, url);
}
return (url == NULL_URL) ? null : url;
@ -315,7 +319,7 @@ final class JceSecurity {
// Enforce the signer restraint, i.e. signer of JCE framework
// jar should also be the signer of the two jurisdiction policy
// jar files.
JarVerifier.verifyPolicySigned(je.getCertificates());
ProviderVerifier.verifyPolicySigned(je.getCertificates());
}
// Close and nullify the JarFile reference to help GC.
jf.close();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -228,7 +228,7 @@ final class JceSecurityManager extends SecurityManager {
}
// See bug 4341369 & 4334690 for more info.
boolean isCallerTrusted() {
boolean isCallerTrusted(Provider provider) {
// Get the caller and its codebase.
Class<?>[] context = getClassContext();
URL callerCodeBase = null;
@ -249,7 +249,7 @@ final class JceSecurityManager extends SecurityManager {
}
// Check whether the caller is a trusted provider.
try {
JceSecurity.verifyProviderJar(callerCodeBase);
JceSecurity.verifyProvider(callerCodeBase, provider);
} catch (Exception e2) {
return false;
}

View File

@ -320,7 +320,7 @@ public class KeyGenerator {
/**
* Update the active spi of this class and return the next
* implementation for failover. If no more implemenations are
* implementation for failover. If no more implementations are
* available, this method returns null. However, the active spi of
* this class is never set to null.
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -31,7 +31,8 @@ import java.security.*;
import java.util.jar.*;
/**
* This class verifies JAR files (and any supporting JAR files), and
* This class verifies Provider/Policy resources found at a URL
* (currently only JAR files and any supporting JAR files), and
* determines whether they may be used in this implementation.
*
* The JCE in OpenJDK has an open cryptographic interface, meaning it
@ -42,22 +43,36 @@ import java.util.jar.*;
*
* @since 1.7
*/
final class JarVerifier {
final class ProviderVerifier {
// The URL for the JAR file we want to verify.
private URL jarURL;
private Provider provider;
private boolean savePerms;
private CryptoPermissions appPerms = null;
/**
* Creates a JarVerifier object to verify the given URL.
* Creates a ProviderVerifier object to verify the given URL.
*
* @param jarURL the JAR file to be verified.
* @param savePerms if true, save the permissions allowed by the
* exemption mechanism
*/
JarVerifier(URL jarURL, boolean savePerms) {
ProviderVerifier(URL jarURL, boolean savePerms) {
this(jarURL, null, savePerms);
}
/**
* Creates a ProviderVerifier object to verify the given URL.
*
* @param jarURL the JAR file to be verified
* @param provider the corresponding provider.
* @param savePerms if true, save the permissions allowed by the
* exemption mechanism
*/
ProviderVerifier(URL jarURL, Provider provider, boolean savePerms) {
this.jarURL = jarURL;
this.provider = provider;
this.savePerms = savePerms;
}
@ -68,7 +83,7 @@ final class JarVerifier {
* In OpenJDK, we just need to examine the "cryptoperms" file to see
* if any permissions were bundled together with this jar file.
*/
void verify() throws JarException, IOException {
void verify() throws IOException {
// Short-circuit. If we weren't asked to save any, we're done.
if (!savePerms) {
@ -98,7 +113,8 @@ final class JarVerifier {
}
});
} catch (java.security.PrivilegedActionException pae) {
throw new SecurityException("Cannot load " + url.toString(), pae);
throw new SecurityException("Cannot load " + url.toString(),
pae.getCause());
}
if (jf != null) {
@ -144,7 +160,7 @@ final class JarVerifier {
* Returns the permissions which are bundled with the JAR file,
* aka the "cryptoperms" file.
*
* NOTE: if this JarVerifier instance is constructed with "savePerms"
* NOTE: if this ProviderVerifier instance is constructed with "savePerms"
* equal to false, then this method would always return null.
*/
CryptoPermissions getPermissions() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -41,13 +41,13 @@ import sun.security.util.*;
* of the distinguished name, or by using the ASN.1 DER encoded byte
* representation of the distinguished name. The current specification
* for the string representation of a distinguished name is defined in
* <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253: Lightweight
* <a href="http://tools.ietf.org/html/rfc2253">RFC 2253: Lightweight
* Directory Access Protocol (v3): UTF-8 String Representation of
* Distinguished Names</a>. This class, however, accepts string formats from
* both RFC 2253 and <a href="http://www.ietf.org/rfc/rfc1779.txt">RFC 1779:
* both RFC 2253 and <a href="http://tools.ietf.org/html/rfc1779">RFC 1779:
* A String Representation of Distinguished Names</a>, and also recognizes
* attribute type keywords whose OIDs (Object Identifiers) are defined in
* <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280: Internet X.509
* <a href="http://tools.ietf.org/html/rfc5280">RFC 5280: Internet X.509
* Public Key Infrastructure Certificate and CRL Profile</a>.
*
* <p> The string representation for this {@code X500Principal}
@ -108,7 +108,7 @@ public final class X500Principal implements Principal, java.io.Serializable {
* (and listed in {@link #getName(String format) getName(String format)}),
* as well as the T, DNQ or DNQUALIFIER, SURNAME, GIVENNAME, INITIALS,
* GENERATION, EMAILADDRESS, and SERIALNUMBER keywords whose Object
* Identifiers (OIDs) are defined in RFC 3280 and its successor.
* Identifiers (OIDs) are defined in RFC 5280.
* Any other attribute type must be specified as an OID.
*
* <p>This implementation enforces a more restrictive OID syntax than
@ -456,7 +456,7 @@ public final class X500Principal implements Principal, java.io.Serializable {
* (obtained via the {@code getName(X500Principal.CANONICAL)} method)
* of this object and <i>o</i> are equal.
*
* <p> This implementation is compliant with the requirements of RFC 3280.
* <p> This implementation is compliant with the requirements of RFC 5280.
*
* @param o Object to be compared for equality with this
* {@code X500Principal}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -31,15 +31,15 @@
* <h2>Package Specification</h2>
*
* <ul>
* <li><a href="http://www.ietf.org/rfc/rfc1779.txt">
* <li><a href="http://tools.ietf.org/html/rfc1779">
* RFC 1779: A String Representation of Distinguished Names</a></li>
* <li><a href="http://www.ietf.org/rfc/rfc2253.txt">
* <li><a href="http://tools.ietf.org/html/rfc2253">
* RFC 2253: Lightweight Directory Access Protocol (v3):
* UTF-8 String Representation of Distinguished Names</a></li>
* <li><a href="http://www.ietf.org/rfc/rfc3280.txt">
* RFC 3280: Internet X.509 Public Key Infrastructure
* <li><a href="http://tools.ietf.org/html/rfc5280">
* RFC 5280: Internet X.509 Public Key Infrastructure
* Certificate and Certificate Revocation List (CRL) Profile</a></li>
* <li><a href="http://www.ietf.org/rfc/rfc4512.txt">
* <li><a href="http://tools.ietf.org/html/rfc4512">
* RFC 4512: Lightweight Directory Access Protocol (LDAP):
* Directory Information Models</a></li>
* </ul>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -64,7 +64,7 @@ import java.security.*;
* and CRLs. Aliases for X.509 are X509.
*
* - PKIX is the certification path validation algorithm described
* in RFC 3280. The ValidationAlgorithm attribute notes the
* in RFC 5280. The ValidationAlgorithm attribute notes the
* specification that this provider implements.
*
* - LDAP is the CertStore type for LDAP repositories. The
@ -250,7 +250,7 @@ final class SunEntries {
map.put("CertPathBuilder.PKIX",
"sun.security.provider.certpath.SunCertPathBuilder");
map.put("CertPathBuilder.PKIX ValidationAlgorithm",
"RFC3280");
"RFC5280");
/*
* CertPathValidator
@ -258,7 +258,7 @@ final class SunEntries {
map.put("CertPathValidator.PKIX",
"sun.security.provider.certpath.PKIXCertPathValidator");
map.put("CertPathValidator.PKIX ValidationAlgorithm",
"RFC3280");
"RFC5280");
/*
* CertStores

View File

@ -434,7 +434,7 @@ public class DistributionPointFetcher {
}
if (indirectCRL) {
if (pointCrlIssuers.size() != 1) {
// RFC 3280: there must be only 1 CRL issuer
// RFC 5280: there must be only 1 CRL issuer
// name when relativeName is present
if (debug != null) {
debug.println("must only be one CRL " +

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -578,7 +578,7 @@ class PolicyChecker extends PKIXCertPathChecker {
}
/**
* Rewrite leaf nodes at the end of validation as described in RFC 3280
* Rewrite leaf nodes at the end of validation as described in RFC 5280
* section 6.1.5: Step (g)(iii). Leaf nodes with anyPolicy are replaced
* by nodes explicitly representing initial policies not already
* represented by leaf nodes.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -56,7 +56,7 @@ final class PolicyNodeImpl implements PolicyNode {
private PolicyNodeImpl mParent;
private HashSet<PolicyNodeImpl> mChildren;
// the 4 fields specified by RFC 3280
// the 4 fields specified by RFC 5280
private String mValidPolicy;
private HashSet<PolicyQualifierInfo> mQualifierSet;
private boolean mCriticalityIndicator;

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