Merge
This commit is contained in:
commit
05752298fa
@ -202,3 +202,4 @@ b43aa5bd8ca5c8121336495382d35ecfa7a71536 jdk8-b74
|
|||||||
fd1a5574cf68af24bfd52decc37ac6361afb278a jdk8-b78
|
fd1a5574cf68af24bfd52decc37ac6361afb278a jdk8-b78
|
||||||
91d35211e74464dca5edf9b66ab01d0d0d8cded7 jdk8-b79
|
91d35211e74464dca5edf9b66ab01d0d0d8cded7 jdk8-b79
|
||||||
907a926d3c96472f357617b48b6b968ea855c23c jdk8-b80
|
907a926d3c96472f357617b48b6b968ea855c23c jdk8-b80
|
||||||
|
145dbc56f931c134e837b675b9e6e7bf08902e93 jdk8-b81
|
||||||
|
7
Makefile
7
Makefile
@ -90,6 +90,7 @@ include ./make/corba-rules.gmk
|
|||||||
include ./make/jaxp-rules.gmk
|
include ./make/jaxp-rules.gmk
|
||||||
include ./make/jaxws-rules.gmk
|
include ./make/jaxws-rules.gmk
|
||||||
include ./make/jdk-rules.gmk
|
include ./make/jdk-rules.gmk
|
||||||
|
include ./make/nashorn-rules.gmk
|
||||||
include ./make/install-rules.gmk
|
include ./make/install-rules.gmk
|
||||||
include ./make/sponsors-rules.gmk
|
include ./make/sponsors-rules.gmk
|
||||||
include ./make/deploy-rules.gmk
|
include ./make/deploy-rules.gmk
|
||||||
@ -174,6 +175,11 @@ ifeq ($(BUILD_JDK), true)
|
|||||||
clobber:: jdk-clobber
|
clobber:: jdk-clobber
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BUILD_NASHORN), true)
|
||||||
|
generic_build_repo_series:: $(NASHORN)
|
||||||
|
clobber:: nashorn-clobber
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(BUILD_DEPLOY), true)
|
ifeq ($(BUILD_DEPLOY), true)
|
||||||
generic_build_repo_series:: $(DEPLOY)
|
generic_build_repo_series:: $(DEPLOY)
|
||||||
clobber:: deploy-clobber
|
clobber:: deploy-clobber
|
||||||
@ -336,6 +342,7 @@ deploy_fastdebug_only:
|
|||||||
BUILD_HOTSPOT=false \
|
BUILD_HOTSPOT=false \
|
||||||
BUILD_JDK=false \
|
BUILD_JDK=false \
|
||||||
BUILD_LANGTOOLS=false \
|
BUILD_LANGTOOLS=false \
|
||||||
|
BUILD_NASHORN=false \
|
||||||
BUILD_CORBA=false \
|
BUILD_CORBA=false \
|
||||||
BUILD_JAXP=false \
|
BUILD_JAXP=false \
|
||||||
BUILD_JAXWS=false \
|
BUILD_JAXWS=false \
|
||||||
|
@ -194,6 +194,7 @@ BASIC_COMPILE_FIXPATH
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
JDKOPT_SETUP_BUILD_TWEAKS
|
JDKOPT_SETUP_BUILD_TWEAKS
|
||||||
|
JDKOPT_DETECT_INTREE_EC
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
|
@ -612,6 +612,7 @@ SJAVAC_SERVER_JAVA
|
|||||||
JOBS
|
JOBS
|
||||||
MEMORY_SIZE
|
MEMORY_SIZE
|
||||||
NUM_CORES
|
NUM_CORES
|
||||||
|
ENABLE_INTREE_EC
|
||||||
SALIB_NAME
|
SALIB_NAME
|
||||||
HOTSPOT_MAKE_ARGS
|
HOTSPOT_MAKE_ARGS
|
||||||
FIXPATH
|
FIXPATH
|
||||||
@ -749,6 +750,7 @@ BUILD_OUTPUT
|
|||||||
OVERRIDE_SRC_ROOT
|
OVERRIDE_SRC_ROOT
|
||||||
ADD_SRC_ROOT
|
ADD_SRC_ROOT
|
||||||
JDK_TOPDIR
|
JDK_TOPDIR
|
||||||
|
NASHORN_TOPDIR
|
||||||
HOTSPOT_TOPDIR
|
HOTSPOT_TOPDIR
|
||||||
JAXWS_TOPDIR
|
JAXWS_TOPDIR
|
||||||
JAXP_TOPDIR
|
JAXP_TOPDIR
|
||||||
@ -3751,7 +3753,7 @@ fi
|
|||||||
#CUSTOM_AUTOCONF_INCLUDE
|
#CUSTOM_AUTOCONF_INCLUDE
|
||||||
|
|
||||||
# Do not change or remove the following line, it is needed for consistency checks:
|
# Do not change or remove the following line, it is needed for consistency checks:
|
||||||
DATE_WHEN_GENERATED=1363150186
|
DATE_WHEN_GENERATED=1363706268
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
@ -10783,6 +10785,12 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
#
|
||||||
|
# Enable or disable the elliptic curve crypto implementation
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Compress jars
|
# Compress jars
|
||||||
@ -15682,6 +15690,7 @@ CORBA_TOPDIR="$SRC_ROOT/corba"
|
|||||||
JAXP_TOPDIR="$SRC_ROOT/jaxp"
|
JAXP_TOPDIR="$SRC_ROOT/jaxp"
|
||||||
JAXWS_TOPDIR="$SRC_ROOT/jaxws"
|
JAXWS_TOPDIR="$SRC_ROOT/jaxws"
|
||||||
HOTSPOT_TOPDIR="$SRC_ROOT/hotspot"
|
HOTSPOT_TOPDIR="$SRC_ROOT/hotspot"
|
||||||
|
NASHORN_TOPDIR="$SRC_ROOT/nashorn"
|
||||||
JDK_TOPDIR="$SRC_ROOT/jdk"
|
JDK_TOPDIR="$SRC_ROOT/jdk"
|
||||||
|
|
||||||
|
|
||||||
@ -15692,6 +15701,7 @@ JDK_TOPDIR="$SRC_ROOT/jdk"
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Pickup additional source for a component from outside of the source root
|
# Pickup additional source for a component from outside of the source root
|
||||||
@ -15922,6 +15932,19 @@ $as_echo_n "checking if hotspot should be overridden... " >&6; }
|
|||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $HOTSPOT_TOPDIR" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $HOTSPOT_TOPDIR" >&5
|
||||||
$as_echo "yes with $HOTSPOT_TOPDIR" >&6; }
|
$as_echo "yes with $HOTSPOT_TOPDIR" >&6; }
|
||||||
fi
|
fi
|
||||||
|
if test "x$with_override_nashorn" != x; then
|
||||||
|
CURDIR="$PWD"
|
||||||
|
cd "$with_override_nashorn"
|
||||||
|
NASHORN_TOPDIR="`pwd`"
|
||||||
|
cd "$CURDIR"
|
||||||
|
if ! test -f $NASHORN_TOPDIR/makefiles/BuildNashorn.gmk; then
|
||||||
|
as_fn_error $? "You have to override nashorn with a full nashorn repo!" "$LINENO" 5
|
||||||
|
fi
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if nashorn should be overridden" >&5
|
||||||
|
$as_echo_n "checking if nashorn should be overridden... " >&6; }
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $NASHORN_TOPDIR" >&5
|
||||||
|
$as_echo "yes with $NASHORN_TOPDIR" >&6; }
|
||||||
|
fi
|
||||||
if test "x$with_override_jdk" != x; then
|
if test "x$with_override_jdk" != x; then
|
||||||
CURDIR="$PWD"
|
CURDIR="$PWD"
|
||||||
cd "$with_override_jdk"
|
cd "$with_override_jdk"
|
||||||
@ -18534,14 +18557,18 @@ fi
|
|||||||
|
|
||||||
### Locate C compiler (CC)
|
### Locate C compiler (CC)
|
||||||
|
|
||||||
# gcc is almost always present, but on Windows we
|
# On windows, only cl.exe is supported.
|
||||||
# prefer cl.exe and on Solaris we prefer CC.
|
# On Solaris, cc is preferred to gcc.
|
||||||
# Thus test for them in this order.
|
# Elsewhere, gcc is preferred to cc.
|
||||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
|
||||||
# Do not probe for cc on MacOSX.
|
if test "x$CC" != x; then
|
||||||
COMPILER_CHECK_LIST="cl gcc"
|
COMPILER_CHECK_LIST="$CC"
|
||||||
|
elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||||
|
COMPILER_CHECK_LIST="cl"
|
||||||
|
elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||||
|
COMPILER_CHECK_LIST="cc gcc"
|
||||||
else
|
else
|
||||||
COMPILER_CHECK_LIST="cl cc gcc"
|
COMPILER_CHECK_LIST="gcc cc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -19505,7 +19532,7 @@ $as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSIO
|
|||||||
$as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;}
|
$as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;}
|
||||||
|
|
||||||
|
|
||||||
# Now that we have resolved CC ourself, let autoconf have it's go at it
|
# Now that we have resolved CC ourself, let autoconf have its go at it
|
||||||
ac_ext=c
|
ac_ext=c
|
||||||
ac_cpp='$CPP $CPPFLAGS'
|
ac_cpp='$CPP $CPPFLAGS'
|
||||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||||
@ -20107,13 +20134,17 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
|||||||
|
|
||||||
### Locate C++ compiler (CXX)
|
### Locate C++ compiler (CXX)
|
||||||
|
|
||||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
if test "x$CXX" != x; then
|
||||||
# Do not probe for CC on MacOSX.
|
COMPILER_CHECK_LIST="$CXX"
|
||||||
COMPILER_CHECK_LIST="cl g++"
|
elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||||
|
COMPILER_CHECK_LIST="cl"
|
||||||
|
elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||||
|
COMPILER_CHECK_LIST="CC g++"
|
||||||
else
|
else
|
||||||
COMPILER_CHECK_LIST="cl CC g++"
|
COMPILER_CHECK_LIST="g++ CC"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
COMPILER_NAME=C++
|
COMPILER_NAME=C++
|
||||||
|
|
||||||
CXX=
|
CXX=
|
||||||
@ -21074,7 +21105,7 @@ $as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSIO
|
|||||||
$as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;}
|
$as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;}
|
||||||
|
|
||||||
|
|
||||||
# Now that we have resolved CXX ourself, let autoconf have it's go at it
|
# Now that we have resolved CXX ourself, let autoconf have its go at it
|
||||||
ac_ext=cpp
|
ac_ext=cpp
|
||||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||||
@ -29799,7 +29830,7 @@ if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
|
|||||||
_ACEOF
|
_ACEOF
|
||||||
X11_A_OK=yes
|
X11_A_OK=yes
|
||||||
else
|
else
|
||||||
X11_A_OK=no
|
X11_A_OK=no; break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
@ -31670,6 +31701,22 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if elliptic curve crypto implementation is present" >&5
|
||||||
|
$as_echo_n "checking if elliptic curve crypto implementation is present... " >&6; }
|
||||||
|
|
||||||
|
if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then
|
||||||
|
ENABLE_INTREE_EC=yes
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||||
|
$as_echo "yes" >&6; }
|
||||||
|
else
|
||||||
|
ENABLE_INTREE_EC=no
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||||
|
$as_echo "no" >&6; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Configure parts of the build that only affect the build performance,
|
# Configure parts of the build that only affect the build performance,
|
||||||
|
@ -364,6 +364,25 @@ else
|
|||||||
fi
|
fi
|
||||||
AC_SUBST(UNLIMITED_CRYPTO)
|
AC_SUBST(UNLIMITED_CRYPTO)
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
#
|
||||||
|
# Enable or disable the elliptic curve crypto implementation
|
||||||
|
#
|
||||||
|
AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
|
||||||
|
[
|
||||||
|
AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
|
||||||
|
|
||||||
|
if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then
|
||||||
|
ENABLE_INTREE_EC=yes
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
else
|
||||||
|
ENABLE_INTREE_EC=no
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(ENABLE_INTREE_EC)
|
||||||
|
])
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Compress jars
|
# Compress jars
|
||||||
|
@ -182,7 +182,7 @@ CFLAGS="$CFLAGS $X_CFLAGS"
|
|||||||
# Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
|
# Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
|
||||||
AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h],
|
AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h],
|
||||||
[X11_A_OK=yes],
|
[X11_A_OK=yes],
|
||||||
[X11_A_OK=no],
|
[X11_A_OK=no; break],
|
||||||
[ # include <X11/Xlib.h>
|
[ # include <X11/Xlib.h>
|
||||||
# include <X11/Xutil.h>
|
# include <X11/Xutil.h>
|
||||||
])
|
])
|
||||||
|
@ -33,12 +33,14 @@ CORBA_TOPDIR="$SRC_ROOT/corba"
|
|||||||
JAXP_TOPDIR="$SRC_ROOT/jaxp"
|
JAXP_TOPDIR="$SRC_ROOT/jaxp"
|
||||||
JAXWS_TOPDIR="$SRC_ROOT/jaxws"
|
JAXWS_TOPDIR="$SRC_ROOT/jaxws"
|
||||||
HOTSPOT_TOPDIR="$SRC_ROOT/hotspot"
|
HOTSPOT_TOPDIR="$SRC_ROOT/hotspot"
|
||||||
|
NASHORN_TOPDIR="$SRC_ROOT/nashorn"
|
||||||
JDK_TOPDIR="$SRC_ROOT/jdk"
|
JDK_TOPDIR="$SRC_ROOT/jdk"
|
||||||
AC_SUBST(LANGTOOLS_TOPDIR)
|
AC_SUBST(LANGTOOLS_TOPDIR)
|
||||||
AC_SUBST(CORBA_TOPDIR)
|
AC_SUBST(CORBA_TOPDIR)
|
||||||
AC_SUBST(JAXP_TOPDIR)
|
AC_SUBST(JAXP_TOPDIR)
|
||||||
AC_SUBST(JAXWS_TOPDIR)
|
AC_SUBST(JAXWS_TOPDIR)
|
||||||
AC_SUBST(HOTSPOT_TOPDIR)
|
AC_SUBST(HOTSPOT_TOPDIR)
|
||||||
|
AC_SUBST(NASHORN_TOPDIR)
|
||||||
AC_SUBST(JDK_TOPDIR)
|
AC_SUBST(JDK_TOPDIR)
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -234,6 +236,17 @@ if test "x$with_override_hotspot" != x; then
|
|||||||
AC_MSG_CHECKING([if hotspot should be overridden])
|
AC_MSG_CHECKING([if hotspot should be overridden])
|
||||||
AC_MSG_RESULT([yes with $HOTSPOT_TOPDIR])
|
AC_MSG_RESULT([yes with $HOTSPOT_TOPDIR])
|
||||||
fi
|
fi
|
||||||
|
if test "x$with_override_nashorn" != x; then
|
||||||
|
CURDIR="$PWD"
|
||||||
|
cd "$with_override_nashorn"
|
||||||
|
NASHORN_TOPDIR="`pwd`"
|
||||||
|
cd "$CURDIR"
|
||||||
|
if ! test -f $NASHORN_TOPDIR/makefiles/BuildNashorn.gmk; then
|
||||||
|
AC_MSG_ERROR([You have to override nashorn with a full nashorn repo!])
|
||||||
|
fi
|
||||||
|
AC_MSG_CHECKING([if nashorn should be overridden])
|
||||||
|
AC_MSG_RESULT([yes with $NASHORN_TOPDIR])
|
||||||
|
fi
|
||||||
if test "x$with_override_jdk" != x; then
|
if test "x$with_override_jdk" != x; then
|
||||||
CURDIR="$PWD"
|
CURDIR="$PWD"
|
||||||
cd "$with_override_jdk"
|
cd "$with_override_jdk"
|
||||||
|
@ -141,6 +141,7 @@ CORBA_TOPDIR:=@CORBA_TOPDIR@
|
|||||||
JAXP_TOPDIR:=@JAXP_TOPDIR@
|
JAXP_TOPDIR:=@JAXP_TOPDIR@
|
||||||
JAXWS_TOPDIR:=@JAXWS_TOPDIR@
|
JAXWS_TOPDIR:=@JAXWS_TOPDIR@
|
||||||
HOTSPOT_TOPDIR:=@HOTSPOT_TOPDIR@
|
HOTSPOT_TOPDIR:=@HOTSPOT_TOPDIR@
|
||||||
|
NASHORN_TOPDIR:=@NASHORN_TOPDIR@
|
||||||
COPYRIGHT_YEAR:=@COPYRIGHT_YEAR@
|
COPYRIGHT_YEAR:=@COPYRIGHT_YEAR@
|
||||||
|
|
||||||
# Location where build customization files may be found
|
# Location where build customization files may be found
|
||||||
@ -230,6 +231,7 @@ JAXP_OUTPUTDIR=$(BUILD_OUTPUT)/jaxp
|
|||||||
JAXWS_OUTPUTDIR=$(BUILD_OUTPUT)/jaxws
|
JAXWS_OUTPUTDIR=$(BUILD_OUTPUT)/jaxws
|
||||||
HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
|
HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
|
||||||
JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
|
JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
|
||||||
|
NASHORN_OUTPUTDIR=$(BUILD_OUTPUT)/nashorn
|
||||||
IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
|
IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
|
||||||
JCE_OUTPUTDIR=$(BUILD_OUTPUT)/jce-release
|
JCE_OUTPUTDIR=$(BUILD_OUTPUT)/jce-release
|
||||||
|
|
||||||
@ -238,6 +240,7 @@ CORBA_DIST=$(CORBA_OUTPUTDIR)/dist
|
|||||||
JAXP_DIST=$(JAXP_OUTPUTDIR)/dist
|
JAXP_DIST=$(JAXP_OUTPUTDIR)/dist
|
||||||
JAXWS_DIST=$(JAXWS_OUTPUTDIR)/dist
|
JAXWS_DIST=$(JAXWS_OUTPUTDIR)/dist
|
||||||
HOTSPOT_DIST=@HOTSPOT_DIST@
|
HOTSPOT_DIST=@HOTSPOT_DIST@
|
||||||
|
NASHORN_DIST=$(NASHORN_OUTPUTDIR)/dist
|
||||||
|
|
||||||
BUILD_HOTSPOT=@BUILD_HOTSPOT@
|
BUILD_HOTSPOT=@BUILD_HOTSPOT@
|
||||||
|
|
||||||
@ -536,6 +539,7 @@ endif
|
|||||||
|
|
||||||
# Build setup
|
# Build setup
|
||||||
ENABLE_JFR=@ENABLE_JFR@
|
ENABLE_JFR=@ENABLE_JFR@
|
||||||
|
ENABLE_INTREE_EC=@ENABLE_INTREE_EC@
|
||||||
USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
|
USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
|
||||||
USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@
|
USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@
|
||||||
USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
|
USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
|
||||||
|
@ -249,30 +249,38 @@ fi
|
|||||||
|
|
||||||
### Locate C compiler (CC)
|
### Locate C compiler (CC)
|
||||||
|
|
||||||
# gcc is almost always present, but on Windows we
|
# On windows, only cl.exe is supported.
|
||||||
# prefer cl.exe and on Solaris we prefer CC.
|
# On Solaris, cc is preferred to gcc.
|
||||||
# Thus test for them in this order.
|
# Elsewhere, gcc is preferred to cc.
|
||||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
|
||||||
# Do not probe for cc on MacOSX.
|
if test "x$CC" != x; then
|
||||||
COMPILER_CHECK_LIST="cl gcc"
|
COMPILER_CHECK_LIST="$CC"
|
||||||
|
elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||||
|
COMPILER_CHECK_LIST="cl"
|
||||||
|
elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||||
|
COMPILER_CHECK_LIST="cc gcc"
|
||||||
else
|
else
|
||||||
COMPILER_CHECK_LIST="cl cc gcc"
|
COMPILER_CHECK_LIST="gcc cc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST])
|
TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST])
|
||||||
# Now that we have resolved CC ourself, let autoconf have it's go at it
|
# Now that we have resolved CC ourself, let autoconf have its go at it
|
||||||
AC_PROG_CC([$CC])
|
AC_PROG_CC([$CC])
|
||||||
|
|
||||||
### Locate C++ compiler (CXX)
|
### Locate C++ compiler (CXX)
|
||||||
|
|
||||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
if test "x$CXX" != x; then
|
||||||
# Do not probe for CC on MacOSX.
|
COMPILER_CHECK_LIST="$CXX"
|
||||||
COMPILER_CHECK_LIST="cl g++"
|
elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||||
|
COMPILER_CHECK_LIST="cl"
|
||||||
|
elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||||
|
COMPILER_CHECK_LIST="CC g++"
|
||||||
else
|
else
|
||||||
COMPILER_CHECK_LIST="cl CC g++"
|
COMPILER_CHECK_LIST="g++ CC"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST])
|
TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST])
|
||||||
# Now that we have resolved CXX ourself, let autoconf have it's go at it
|
# Now that we have resolved CXX ourself, let autoconf have its go at it
|
||||||
AC_PROG_CXX([$CXX])
|
AC_PROG_CXX([$CXX])
|
||||||
|
|
||||||
### Locate other tools
|
### Locate other tools
|
||||||
|
@ -96,7 +96,7 @@ pull_default=""
|
|||||||
repos=""
|
repos=""
|
||||||
repos_extra=""
|
repos_extra=""
|
||||||
if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
|
if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
|
||||||
subrepos="corba jaxp jaxws langtools jdk hotspot"
|
subrepos="corba jaxp jaxws langtools jdk hotspot nashorn"
|
||||||
if [ -f .hg/hgrc ] ; then
|
if [ -f .hg/hgrc ] ; then
|
||||||
pull_default=`hg paths default`
|
pull_default=`hg paths default`
|
||||||
if [ "${pull_default}" = "" ] ; then
|
if [ "${pull_default}" = "" ] ; then
|
||||||
|
@ -120,6 +120,12 @@ jdk-only: start-make
|
|||||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk $(JDK_TARGET))
|
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk $(JDK_TARGET))
|
||||||
@$(call TargetExit)
|
@$(call TargetExit)
|
||||||
|
|
||||||
|
nashorn: jdk nashorn-only
|
||||||
|
nashorn-only: start-make
|
||||||
|
@$(call TargetEnter)
|
||||||
|
@($(CD) $(NASHORN_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk)
|
||||||
|
@$(call TargetExit)
|
||||||
|
|
||||||
demos: jdk demos-only
|
demos: jdk demos-only
|
||||||
demos-only: start-make
|
demos-only: start-make
|
||||||
@$(call TargetEnter)
|
@$(call TargetEnter)
|
||||||
@ -128,7 +134,7 @@ demos-only: start-make
|
|||||||
|
|
||||||
# Note: This double-colon rule is intentional, to support
|
# Note: This double-colon rule is intentional, to support
|
||||||
# custom make file integration.
|
# custom make file integration.
|
||||||
images:: source-tips demos images-only
|
images:: source-tips demos nashorn images-only
|
||||||
images-only: start-make
|
images-only: start-make
|
||||||
@$(call TargetEnter)
|
@$(call TargetEnter)
|
||||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk images)
|
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk images)
|
||||||
@ -175,9 +181,10 @@ bootcycle-images:
|
|||||||
@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
|
@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
|
||||||
@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images)
|
@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images)
|
||||||
|
|
||||||
test: start-make
|
test: images test-only
|
||||||
|
test-only: start-make
|
||||||
@$(call TargetEnter)
|
@$(call TargetEnter)
|
||||||
@($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k MAKEFLAGS= PRODUCT_HOME=$(OUTPUT_ROOT)/jdk JPRT_JAVA_HOME=$(OUTPUT_ROOT)/jdk ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true
|
@($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k MAKEFLAGS= PRODUCT_HOME=$(JDK_IMAGE_DIR) JPRT_JAVA_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true
|
||||||
@$(call TargetExit)
|
@$(call TargetExit)
|
||||||
|
|
||||||
# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
|
# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
|
||||||
@ -190,7 +197,7 @@ $(OUTPUT_ROOT)/source_tips: FRC
|
|||||||
|
|
||||||
|
|
||||||
# Remove everything, except the output from configure.
|
# Remove everything, except the output from configure.
|
||||||
clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images clean-overlay-images clean-bootcycle-build clean-docs
|
clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-overlay-images clean-bootcycle-build clean-docs
|
||||||
@($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*)
|
@($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*)
|
||||||
@$(ECHO) Cleaned all build artifacts.
|
@$(ECHO) Cleaned all build artifacts.
|
||||||
|
|
||||||
@ -220,6 +227,8 @@ clean-hotspot:
|
|||||||
$(call CleanComponent,hotspot)
|
$(call CleanComponent,hotspot)
|
||||||
clean-jdk:
|
clean-jdk:
|
||||||
$(call CleanComponent,jdk)
|
$(call CleanComponent,jdk)
|
||||||
|
clean-nashorn:
|
||||||
|
$(call CleanComponent,nashorn)
|
||||||
clean-images:
|
clean-images:
|
||||||
$(call CleanComponent,images)
|
$(call CleanComponent,images)
|
||||||
clean-overlay-images:
|
clean-overlay-images:
|
||||||
@ -230,10 +239,10 @@ clean-docs:
|
|||||||
$(call CleanComponent,docs)
|
$(call CleanComponent,docs)
|
||||||
$(call CleanComponent,docstemp)
|
$(call CleanComponent,docstemp)
|
||||||
|
|
||||||
.PHONY: langtools corba jaxp jaxws hotspot jdk images overlay-images install
|
.PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install
|
||||||
.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only overlay-images-only install-only
|
.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only
|
||||||
.PHONY: all test clean dist-clean bootcycle-images start-make
|
.PHONY: all test clean dist-clean bootcycle-images start-make
|
||||||
.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images clean-overlay-images clean-bootcycle-build
|
.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-overlay-images clean-bootcycle-build
|
||||||
.PHONY: profiles profiles-only profiles-oscheck
|
.PHONY: profiles profiles-only profiles-oscheck
|
||||||
|
|
||||||
FRC: # Force target
|
FRC: # Force target
|
||||||
|
@ -51,8 +51,9 @@ decompress_paths=$(SED) -f $(SRC_ROOT)/common/makefiles/support/ListPathsSafely-
|
|||||||
-e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \
|
-e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \
|
||||||
-e 's|X00|X|g' | tr '\n' '$2'
|
-e 's|X00|X|g' | tr '\n' '$2'
|
||||||
|
|
||||||
|
# Subst in an extra $ to prevent it from disappearing.
|
||||||
define ListPathsSafely_If
|
define ListPathsSafely_If
|
||||||
$(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(wordlist $3,$4,$($1)))))
|
$(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(subst $$,$$$$,$(wordlist $3,$4,$($1))))))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define ListPathsSafely_Printf
|
define ListPathsSafely_Printf
|
||||||
|
@ -80,7 +80,8 @@ JCONSOLE_PKGS = com.sun.tools.jconsole
|
|||||||
|
|
||||||
TREEAPI_PKGS = com.sun.source.doctree \
|
TREEAPI_PKGS = com.sun.source.doctree \
|
||||||
com.sun.source.tree \
|
com.sun.source.tree \
|
||||||
com.sun.source.util
|
com.sun.source.util \
|
||||||
|
jdk
|
||||||
|
|
||||||
SMARTCARDIO_PKGS = javax.smartcardio
|
SMARTCARDIO_PKGS = javax.smartcardio
|
||||||
|
|
||||||
@ -93,6 +94,8 @@ APPLE_EXT_PKGS = com.apple.concurrent \
|
|||||||
com.apple.eio
|
com.apple.eio
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
JDK_PKGS = jdk
|
||||||
|
|
||||||
# non-core packages in rt.jar
|
# non-core packages in rt.jar
|
||||||
NON_CORE_PKGS = $(DOMAPI_PKGS) \
|
NON_CORE_PKGS = $(DOMAPI_PKGS) \
|
||||||
$(MGMT_PKGS) \
|
$(MGMT_PKGS) \
|
||||||
@ -103,5 +106,5 @@ NON_CORE_PKGS = $(DOMAPI_PKGS) \
|
|||||||
$(HTTPSERVER_PKGS) \
|
$(HTTPSERVER_PKGS) \
|
||||||
$(SMARTCARDIO_PKGS) \
|
$(SMARTCARDIO_PKGS) \
|
||||||
$(SCTPAPI_PKGS) \
|
$(SCTPAPI_PKGS) \
|
||||||
$(APPLE_EXT_PKGS)
|
$(APPLE_EXT_PKGS) \
|
||||||
|
$(JDK_PKGS)
|
||||||
|
@ -202,3 +202,4 @@ d4e68ce17795601017ac2f952baad7272942c36e jdk8-b75
|
|||||||
27d6368ae8ba570c31c2f0e696d39c99fa2f4538 jdk8-b78
|
27d6368ae8ba570c31c2f0e696d39c99fa2f4538 jdk8-b78
|
||||||
e41fb1aa0329767b2737303c994e38bede1baa07 jdk8-b79
|
e41fb1aa0329767b2737303c994e38bede1baa07 jdk8-b79
|
||||||
5f3d4a6bdd027a1631d97e2dfff63fd5e46987a4 jdk8-b80
|
5f3d4a6bdd027a1631d97e2dfff63fd5e46987a4 jdk8-b80
|
||||||
|
2a00aeeb466b9dee22508f6261f63b70f9c696fe jdk8-b81
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
#
|
#
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
@ -29,10 +29,6 @@ com_sun_corba_se_impl_orbutil_java = \
|
|||||||
com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java \
|
com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java \
|
||||||
com/sun/corba/se/impl/orbutil/GetPropertyAction.java \
|
com/sun/corba/se/impl/orbutil/GetPropertyAction.java \
|
||||||
com/sun/corba/se/impl/orbutil/HexOutputStream.java \
|
com/sun/corba/se/impl/orbutil/HexOutputStream.java \
|
||||||
com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3.java \
|
|
||||||
com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3_1.java \
|
|
||||||
com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3.java \
|
|
||||||
com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3_1.java \
|
|
||||||
com/sun/corba/se/impl/orbutil/LegacyHookGetFields.java \
|
com/sun/corba/se/impl/orbutil/LegacyHookGetFields.java \
|
||||||
com/sun/corba/se/impl/orbutil/LegacyHookPutFields.java \
|
com/sun/corba/se/impl/orbutil/LegacyHookPutFields.java \
|
||||||
com/sun/corba/se/impl/orbutil/LogKeywords.java \
|
com/sun/corba/se/impl/orbutil/LogKeywords.java \
|
||||||
@ -45,19 +41,11 @@ com_sun_corba_se_impl_orbutil_java = \
|
|||||||
com/sun/corba/se/impl/orbutil/ORBUtility.java \
|
com/sun/corba/se/impl/orbutil/ORBUtility.java \
|
||||||
com/sun/corba/se/impl/orbutil/ORBClassLoader.java \
|
com/sun/corba/se/impl/orbutil/ORBClassLoader.java \
|
||||||
com/sun/corba/se/impl/orbutil/RepIdDelegator.java \
|
com/sun/corba/se/impl/orbutil/RepIdDelegator.java \
|
||||||
com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3.java \
|
|
||||||
com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3_1.java \
|
|
||||||
com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3.java \
|
|
||||||
com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java \
|
|
||||||
com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java \
|
com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java \
|
||||||
com/sun/corba/se/impl/orbutil/RepositoryIdStrings.java \
|
com/sun/corba/se/impl/orbutil/RepositoryIdStrings.java \
|
||||||
com/sun/corba/se/impl/orbutil/RepositoryIdUtility.java \
|
com/sun/corba/se/impl/orbutil/RepositoryIdUtility.java \
|
||||||
com/sun/corba/se/impl/orbutil/RepositoryIdInterface.java \
|
com/sun/corba/se/impl/orbutil/RepositoryIdInterface.java \
|
||||||
com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3_1.java \
|
|
||||||
com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java \
|
|
||||||
com/sun/corba/se/impl/orbutil/StackImpl.java \
|
com/sun/corba/se/impl/orbutil/StackImpl.java \
|
||||||
com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3_1.java \
|
|
||||||
com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3.java \
|
|
||||||
com/sun/corba/se/impl/orbutil/closure/Future.java \
|
com/sun/corba/se/impl/orbutil/closure/Future.java \
|
||||||
com/sun/corba/se/impl/orbutil/closure/Constant.java \
|
com/sun/corba/se/impl/orbutil/closure/Constant.java \
|
||||||
com/sun/corba/se/impl/orbutil/concurrent/Sync.java \
|
com/sun/corba/se/impl/orbutil/concurrent/Sync.java \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -322,9 +322,9 @@ class ServerCallback extends
|
|||||||
com.sun.corba.se.spi.activation._ServerImplBase
|
com.sun.corba.se.spi.activation._ServerImplBase
|
||||||
{
|
{
|
||||||
private ORB orb;
|
private ORB orb;
|
||||||
private Method installMethod ;
|
private transient Method installMethod ;
|
||||||
private Method uninstallMethod ;
|
private transient Method uninstallMethod ;
|
||||||
private Method shutdownMethod ;
|
private transient Method shutdownMethod ;
|
||||||
private Object methodArgs[] ;
|
private Object methodArgs[] ;
|
||||||
|
|
||||||
ServerCallback(ORB orb, Method installMethod, Method uninstallMethod,
|
ServerCallback(ORB orb, Method installMethod, Method uninstallMethod,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -1218,7 +1218,7 @@ public class AnyImpl extends Any
|
|||||||
// See bug 4391648 for more info about the tcORB in this
|
// See bug 4391648 for more info about the tcORB in this
|
||||||
// case.
|
// case.
|
||||||
RepositoryIdStrings repStrs
|
RepositoryIdStrings repStrs
|
||||||
= RepositoryIdFactory.getRepIdStringsFactory(tcORB);
|
= RepositoryIdFactory.getRepIdStringsFactory();
|
||||||
|
|
||||||
|
|
||||||
// Assertion: c instanceof Serializable?
|
// Assertion: c instanceof Serializable?
|
||||||
@ -1251,7 +1251,7 @@ public class AnyImpl extends Any
|
|||||||
// Anything else
|
// Anything else
|
||||||
// We know that this is a TypeCodeImpl since it is our ORB
|
// We know that this is a TypeCodeImpl since it is our ORB
|
||||||
classTC = (TypeCodeImpl)ValueUtility.createTypeCodeForClass(
|
classTC = (TypeCodeImpl)ValueUtility.createTypeCodeForClass(
|
||||||
tcORB, c, ORBUtility.createValueHandler(tcORB));
|
tcORB, c, ORBUtility.createValueHandler());
|
||||||
// Intruct classTC to store its buffer
|
// Intruct classTC to store its buffer
|
||||||
classTC.setCaching(true);
|
classTC.setCaching(true);
|
||||||
// Update the cache
|
// Update the cache
|
||||||
|
@ -2189,10 +2189,7 @@ public final class TypeCodeImpl extends TypeCode
|
|||||||
|
|
||||||
if (labelIndex == _unionLabels.length) {
|
if (labelIndex == _unionLabels.length) {
|
||||||
// check if label has not been found
|
// check if label has not been found
|
||||||
if (_defaultIndex == -1)
|
if (_defaultIndex != -1)
|
||||||
// throw exception if default was not expected
|
|
||||||
throw wrapper.unexpectedUnionDefault() ;
|
|
||||||
else
|
|
||||||
// must be of the default branch type
|
// must be of the default branch type
|
||||||
_memberTypes[_defaultIndex].copy(src, dst);
|
_memberTypes[_defaultIndex].copy(src, dst);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -269,8 +269,8 @@ public class CDRInputStream_1_0 extends CDRInputStreamBase
|
|||||||
|
|
||||||
private final void createRepositoryIdHandlers()
|
private final void createRepositoryIdHandlers()
|
||||||
{
|
{
|
||||||
repIdUtil = RepositoryIdFactory.getRepIdUtility(orb);
|
repIdUtil = RepositoryIdFactory.getRepIdUtility();
|
||||||
repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(orb);
|
repIdStrs = RepositoryIdFactory.getRepIdStringsFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
public GIOPVersion getGIOPVersion() {
|
public GIOPVersion getGIOPVersion() {
|
||||||
@ -564,10 +564,7 @@ public class CDRInputStream_1_0 extends CDRInputStreamBase
|
|||||||
|
|
||||||
checkForNegativeLength(len);
|
checkForNegativeLength(len);
|
||||||
|
|
||||||
if (orb != null && ORBUtility.isLegacyORB((ORB)orb))
|
return internalReadString(len);
|
||||||
return legacyReadString(len);
|
|
||||||
else
|
|
||||||
return internalReadString(len);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String internalReadString(int len) {
|
private final String internalReadString(int len) {
|
||||||
@ -588,54 +585,6 @@ public class CDRInputStream_1_0 extends CDRInputStreamBase
|
|||||||
return new String(result, 0, getCharConverter().getNumChars());
|
return new String(result, 0, getCharConverter().getNumChars());
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String legacyReadString(int len) {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Workaround for ORBs which send string lengths of
|
|
||||||
// zero to mean empty string.
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// IMPORTANT: Do not replace 'new String("")' with "", it may result
|
|
||||||
// in a Serialization bug (See serialization.zerolengthstring) and
|
|
||||||
// bug id: 4728756 for details
|
|
||||||
if (len == 0)
|
|
||||||
return new String("");
|
|
||||||
|
|
||||||
len--;
|
|
||||||
char[] c = new char[len];
|
|
||||||
|
|
||||||
int n = 0;
|
|
||||||
while (n < len) {
|
|
||||||
int avail;
|
|
||||||
int bytes;
|
|
||||||
int wanted;
|
|
||||||
|
|
||||||
avail = bbwi.buflen - bbwi.position();
|
|
||||||
if (avail <= 0) {
|
|
||||||
grow(1, 1);
|
|
||||||
avail = bbwi.buflen - bbwi.position();
|
|
||||||
}
|
|
||||||
wanted = len - n;
|
|
||||||
bytes = (wanted < avail) ? wanted : avail;
|
|
||||||
// Microbenchmarks are showing a loop of ByteBuffer.get(int) being
|
|
||||||
// faster than ByteBuffer.get(byte[], int, int).
|
|
||||||
for (int i=0; i<bytes; i++) {
|
|
||||||
c[n+i] = (char) (bbwi.byteBuffer.get(bbwi.position()+i) & 0xFF);
|
|
||||||
}
|
|
||||||
bbwi.position(bbwi.position() + bytes);
|
|
||||||
n += bytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Skip past terminating null byte
|
|
||||||
//
|
|
||||||
if (bbwi.position() + 1 > bbwi.buflen)
|
|
||||||
alignAndCheck(1, 1);
|
|
||||||
bbwi.position(bbwi.position() + 1);
|
|
||||||
|
|
||||||
return new String(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
public final String read_string() {
|
public final String read_string() {
|
||||||
return readStringOrIndirection(false);
|
return readStringOrIndirection(false);
|
||||||
}
|
}
|
||||||
@ -1045,7 +994,7 @@ public class CDRInputStream_1_0 extends CDRInputStreamBase
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (valueHandler == null)
|
if (valueHandler == null)
|
||||||
valueHandler = ORBUtility.createValueHandler(orb);
|
valueHandler = ORBUtility.createValueHandler();
|
||||||
|
|
||||||
value = valueHandler.readValue(parent,
|
value = valueHandler.readValue(parent,
|
||||||
indirection,
|
indirection,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -189,18 +189,8 @@ public class CDROutputStream_1_0 extends CDROutputStreamBase
|
|||||||
|
|
||||||
private final void createRepositoryIdHandlers()
|
private final void createRepositoryIdHandlers()
|
||||||
{
|
{
|
||||||
if (orb != null) {
|
repIdUtil = RepositoryIdFactory.getRepIdUtility();
|
||||||
// Get the appropriate versions based on the ORB version. The
|
repIdStrs = RepositoryIdFactory.getRepIdStringsFactory();
|
||||||
// ORB versioning info is only in the core ORB.
|
|
||||||
repIdUtil
|
|
||||||
= RepositoryIdFactory.getRepIdUtility(orb);
|
|
||||||
repIdStrs
|
|
||||||
= RepositoryIdFactory.getRepIdStringsFactory(orb);
|
|
||||||
} else {
|
|
||||||
// Get the latest versions
|
|
||||||
repIdUtil = RepositoryIdFactory.getRepIdUtility();
|
|
||||||
repIdStrs = RepositoryIdFactory.getRepIdStringsFactory();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BufferManagerWrite getBufferManager()
|
public BufferManagerWrite getBufferManager()
|
||||||
@ -705,7 +695,7 @@ public class CDROutputStream_1_0 extends CDROutputStreamBase
|
|||||||
private void writeArray(Serializable array, Class clazz) {
|
private void writeArray(Serializable array, Class clazz) {
|
||||||
|
|
||||||
if (valueHandler == null)
|
if (valueHandler == null)
|
||||||
valueHandler = ORBUtility.createValueHandler(orb); //d11638
|
valueHandler = ORBUtility.createValueHandler(); //d11638
|
||||||
|
|
||||||
// Write value_tag
|
// Write value_tag
|
||||||
int indirection = writeValueTag(mustChunk, true,
|
int indirection = writeValueTag(mustChunk, true,
|
||||||
@ -768,7 +758,7 @@ public class CDROutputStream_1_0 extends CDROutputStreamBase
|
|||||||
|
|
||||||
private void writeRMIIIOPValueType(Serializable object, Class clazz) {
|
private void writeRMIIIOPValueType(Serializable object, Class clazz) {
|
||||||
if (valueHandler == null)
|
if (valueHandler == null)
|
||||||
valueHandler = ORBUtility.createValueHandler(orb); //d11638
|
valueHandler = ORBUtility.createValueHandler(); //d11638
|
||||||
|
|
||||||
Serializable key = object;
|
Serializable key = object;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -86,7 +86,7 @@ public class FVDCodeBaseImpl extends _CodeBaseImplBase
|
|||||||
// default to using the current ORB version in case the
|
// default to using the current ORB version in case the
|
||||||
// vhandler is not set
|
// vhandler is not set
|
||||||
if (vhandler == null) {
|
if (vhandler == null) {
|
||||||
vhandler = new ValueHandlerImpl(false);
|
vhandler = ValueHandlerImpl.getInstance(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Util.getCodebase may return null which would
|
// Util.getCodebase may return null which would
|
||||||
@ -120,7 +120,7 @@ public class FVDCodeBaseImpl extends _CodeBaseImplBase
|
|||||||
// default to using the current ORB version in case the
|
// default to using the current ORB version in case the
|
||||||
// vhandler is not set
|
// vhandler is not set
|
||||||
if (vhandler == null) {
|
if (vhandler == null) {
|
||||||
vhandler = new ValueHandlerImpl(false);
|
vhandler = ValueHandlerImpl.getInstance(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try{
|
||||||
@ -161,7 +161,7 @@ public class FVDCodeBaseImpl extends _CodeBaseImplBase
|
|||||||
// default to using the current ORB version in case the
|
// default to using the current ORB version in case the
|
||||||
// vhandler is not set
|
// vhandler is not set
|
||||||
if (vhandler == null) {
|
if (vhandler == null) {
|
||||||
vhandler = new ValueHandlerImpl(false);
|
vhandler = ValueHandlerImpl.getInstance(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Stack repIds = new Stack();
|
Stack repIds = new Stack();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -25,7 +25,7 @@
|
|||||||
/*
|
/*
|
||||||
* Licensed Materials - Property of IBM
|
* Licensed Materials - Property of IBM
|
||||||
* RMI-IIOP v1.0
|
* RMI-IIOP v1.0
|
||||||
* Copyright IBM Corp. 1998 1999 All Rights Reserved
|
* Copyright IBM Corp. 1998 2012 All Rights Reserved
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -56,7 +56,6 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Hashtable;
|
|
||||||
|
|
||||||
import com.sun.corba.se.impl.util.RepositoryId;
|
import com.sun.corba.se.impl.util.RepositoryId;
|
||||||
|
|
||||||
@ -83,8 +82,6 @@ public class ObjectStreamClass implements java.io.Serializable {
|
|||||||
private static Object noArgsList[] = {};
|
private static Object noArgsList[] = {};
|
||||||
private static Class noTypesList[] = {};
|
private static Class noTypesList[] = {};
|
||||||
|
|
||||||
private static Hashtable translatedFields;
|
|
||||||
|
|
||||||
/** true if represents enum type */
|
/** true if represents enum type */
|
||||||
private boolean isEnum;
|
private boolean isEnum;
|
||||||
|
|
||||||
@ -384,6 +381,42 @@ public class ObjectStreamClass implements java.io.Serializable {
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final class PersistentFieldsValue
|
||||||
|
extends ClassValue<ObjectStreamField[]> {
|
||||||
|
PersistentFieldsValue() { }
|
||||||
|
|
||||||
|
protected ObjectStreamField[] computeValue(Class<?> type) {
|
||||||
|
try {
|
||||||
|
Field pf = type.getDeclaredField("serialPersistentFields");
|
||||||
|
int mods = pf.getModifiers();
|
||||||
|
if (Modifier.isPrivate(mods) && Modifier.isStatic(mods) &&
|
||||||
|
Modifier.isFinal(mods)) {
|
||||||
|
pf.setAccessible(true);
|
||||||
|
java.io.ObjectStreamField[] fields =
|
||||||
|
(java.io.ObjectStreamField[])pf.get(type);
|
||||||
|
return translateFields(fields);
|
||||||
|
}
|
||||||
|
} catch (NoSuchFieldException | IllegalAccessException |
|
||||||
|
IllegalArgumentException | ClassCastException e) {
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ObjectStreamField[] translateFields(
|
||||||
|
java.io.ObjectStreamField[] fields) {
|
||||||
|
ObjectStreamField[] translation =
|
||||||
|
new ObjectStreamField[fields.length];
|
||||||
|
for (int i = 0; i < fields.length; i++) {
|
||||||
|
translation[i] = new ObjectStreamField(fields[i].getName(),
|
||||||
|
fields[i].getType());
|
||||||
|
}
|
||||||
|
return translation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final PersistentFieldsValue persistentFieldsValue =
|
||||||
|
new PersistentFieldsValue();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize class descriptor. This method is only invoked on class
|
* Initialize class descriptor. This method is only invoked on class
|
||||||
* descriptors created via calls to lookupInternal(). This method is kept
|
* descriptors created via calls to lookupInternal(). This method is kept
|
||||||
@ -416,35 +449,7 @@ public class ObjectStreamClass implements java.io.Serializable {
|
|||||||
* If it is declared, use the declared serialPersistentFields.
|
* If it is declared, use the declared serialPersistentFields.
|
||||||
* Otherwise, extract the fields from the class itself.
|
* Otherwise, extract the fields from the class itself.
|
||||||
*/
|
*/
|
||||||
try {
|
fields = persistentFieldsValue.get(cl);
|
||||||
Field pf = cl.getDeclaredField("serialPersistentFields");
|
|
||||||
// serial bug 7; the serialPersistentFields were not
|
|
||||||
// being read and stored as Accessible bit was not set
|
|
||||||
pf.setAccessible(true);
|
|
||||||
// serial bug 7; need to find if the field is of type
|
|
||||||
// java.io.ObjectStreamField
|
|
||||||
java.io.ObjectStreamField[] f =
|
|
||||||
(java.io.ObjectStreamField[])pf.get(cl);
|
|
||||||
int mods = pf.getModifiers();
|
|
||||||
if ((Modifier.isPrivate(mods)) &&
|
|
||||||
(Modifier.isStatic(mods)) &&
|
|
||||||
(Modifier.isFinal(mods)))
|
|
||||||
{
|
|
||||||
fields = (ObjectStreamField[])translateFields((Object[])pf.get(cl));
|
|
||||||
}
|
|
||||||
} catch (NoSuchFieldException e) {
|
|
||||||
fields = null;
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
fields = null;
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
fields = null;
|
|
||||||
} catch (ClassCastException e) {
|
|
||||||
/* Thrown if a field serialPersistentField exists
|
|
||||||
* but it is not of type ObjectStreamField.
|
|
||||||
*/
|
|
||||||
fields = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (fields == null) {
|
if (fields == null) {
|
||||||
/* Get all of the declared fields for this
|
/* Get all of the declared fields for this
|
||||||
@ -641,43 +646,6 @@ public class ObjectStreamClass implements java.io.Serializable {
|
|||||||
superclass = null;
|
superclass = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Object[] translateFields(Object objs[])
|
|
||||||
throws NoSuchFieldException {
|
|
||||||
try{
|
|
||||||
java.io.ObjectStreamField fields[] = (java.io.ObjectStreamField[])objs;
|
|
||||||
Object translation[] = null;
|
|
||||||
|
|
||||||
if (translatedFields == null)
|
|
||||||
translatedFields = new Hashtable();
|
|
||||||
|
|
||||||
translation = (Object[])translatedFields.get(fields);
|
|
||||||
|
|
||||||
if (translation != null)
|
|
||||||
return translation;
|
|
||||||
else {
|
|
||||||
Class osfClass = Class.forName("com.sun.corba.se.impl.io.ObjectStreamField");
|
|
||||||
translation = (Object[])java.lang.reflect.Array.newInstance(osfClass, objs.length);
|
|
||||||
Object arg[] = new Object[2];
|
|
||||||
Class types[] = {String.class, Class.class};
|
|
||||||
Constructor constructor = osfClass.getDeclaredConstructor(types);
|
|
||||||
for (int i = fields.length -1; i >= 0; i--){
|
|
||||||
arg[0] = fields[i].getName();
|
|
||||||
arg[1] = fields[i].getType();
|
|
||||||
|
|
||||||
translation[i] = constructor.newInstance(arg);
|
|
||||||
}
|
|
||||||
translatedFields.put(fields, translation);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return (Object[])translation;
|
|
||||||
}
|
|
||||||
catch(Throwable t){
|
|
||||||
NoSuchFieldException nsfe = new NoSuchFieldException();
|
|
||||||
nsfe.initCause( t ) ;
|
|
||||||
throw nsfe ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the class this version descriptor matches.
|
* Set the class this version descriptor matches.
|
||||||
@ -1555,8 +1523,8 @@ public class ObjectStreamClass implements java.io.Serializable {
|
|||||||
private boolean hasExternalizableBlockData;
|
private boolean hasExternalizableBlockData;
|
||||||
Method writeObjectMethod;
|
Method writeObjectMethod;
|
||||||
Method readObjectMethod;
|
Method readObjectMethod;
|
||||||
private Method writeReplaceObjectMethod;
|
private transient Method writeReplaceObjectMethod;
|
||||||
private Method readResolveObjectMethod;
|
private transient Method readResolveObjectMethod;
|
||||||
private Constructor cons ;
|
private Constructor cons ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -53,7 +53,7 @@ import com.sun.corba.se.spi.logging.CORBALogDomains;
|
|||||||
import com.sun.corba.se.impl.logging.OMGSystemException;
|
import com.sun.corba.se.impl.logging.OMGSystemException;
|
||||||
import com.sun.corba.se.impl.logging.UtilSystemException;
|
import com.sun.corba.se.impl.logging.UtilSystemException;
|
||||||
|
|
||||||
public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat {
|
public final class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat {
|
||||||
|
|
||||||
// Property to override our maximum stream format version
|
// Property to override our maximum stream format version
|
||||||
public static final String FORMAT_VERSION_PROPERTY
|
public static final String FORMAT_VERSION_PROPERTY
|
||||||
@ -150,14 +150,22 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
|||||||
writeValueWithVersion(out, value, streamFormatVersion);
|
writeValueWithVersion(out, value, streamFormatVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ValueHandlerImpl(){}
|
private ValueHandlerImpl(){}
|
||||||
|
|
||||||
public ValueHandlerImpl(boolean isInputStream) {
|
private ValueHandlerImpl(boolean isInputStream) {
|
||||||
this();
|
this();
|
||||||
useHashtables = false;
|
useHashtables = false;
|
||||||
this.isInputStream = isInputStream;
|
this.isInputStream = isInputStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ValueHandlerImpl getInstance() {
|
||||||
|
return new ValueHandlerImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
static ValueHandlerImpl getInstance(boolean isInputStream) {
|
||||||
|
return new ValueHandlerImpl(isInputStream);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes the value to the stream using java semantics.
|
* Writes the value to the stream using java semantics.
|
||||||
* @param out The stream to write the value to
|
* @param out The stream to write the value to
|
||||||
@ -458,12 +466,7 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
|||||||
return ObjectStreamClass.lookup(value.getClass()).writeReplace(value);
|
return ObjectStreamClass.lookup(value.getClass()).writeReplace(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private void writeCharArray(org.omg.CORBA_2_3.portable.OutputStream out,
|
||||||
* Encapsulates writing of Java char arrays so that the 1.3 subclass
|
|
||||||
* can override it without exposing internals across packages. This
|
|
||||||
* is a fix for bug 4367783.
|
|
||||||
*/
|
|
||||||
protected void writeCharArray(org.omg.CORBA_2_3.portable.OutputStream out,
|
|
||||||
char[] array,
|
char[] array,
|
||||||
int offset,
|
int offset,
|
||||||
int length)
|
int length)
|
||||||
@ -576,12 +579,7 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private void readCharArray(org.omg.CORBA_2_3.portable.InputStream in,
|
||||||
* Encapsulates reading of Java char arrays so that the 1.3 subclass
|
|
||||||
* can override it without exposing internals across packages. This
|
|
||||||
* is a fix for bug 4367783.
|
|
||||||
*/
|
|
||||||
protected void readCharArray(org.omg.CORBA_2_3.portable.InputStream in,
|
|
||||||
char[] array,
|
char[] array,
|
||||||
int offset,
|
int offset,
|
||||||
int length)
|
int length)
|
||||||
@ -795,7 +793,7 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
|||||||
return RepositoryId.cache.getId(repId).isSequence();
|
return RepositoryId.cache.getId(repId).isSequence();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getOutputStreamClassName() {
|
private String getOutputStreamClassName() {
|
||||||
return "com.sun.corba.se.impl.io.IIOPOutputStream";
|
return "com.sun.corba.se.impl.io.IIOPOutputStream";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -843,29 +841,11 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
|||||||
private IIOPOutputStream createOutputStreamBuiltInNoPriv(
|
private IIOPOutputStream createOutputStreamBuiltInNoPriv(
|
||||||
final String name
|
final String name
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
return
|
return name.equals(IIOPOutputStream.class.getName()) ?
|
||||||
name.equals(
|
new IIOPOutputStream() : null;
|
||||||
IIOPOutputStream
|
|
||||||
.class.getName()
|
|
||||||
) ?
|
|
||||||
new IIOPOutputStream() :
|
|
||||||
|
|
||||||
name.equals(
|
|
||||||
com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3
|
|
||||||
.class.getName()
|
|
||||||
) ?
|
|
||||||
new com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3() :
|
|
||||||
|
|
||||||
name.equals(
|
|
||||||
com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3_1
|
|
||||||
.class.getName()
|
|
||||||
) ?
|
|
||||||
new com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3_1() :
|
|
||||||
|
|
||||||
null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getInputStreamClassName() {
|
private String getInputStreamClassName() {
|
||||||
return "com.sun.corba.se.impl.io.IIOPInputStream";
|
return "com.sun.corba.se.impl.io.IIOPInputStream";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -913,26 +893,8 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
|||||||
private IIOPInputStream createInputStreamBuiltInNoPriv(
|
private IIOPInputStream createInputStreamBuiltInNoPriv(
|
||||||
final String name
|
final String name
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
return
|
return name.equals(IIOPInputStream.class.getName()) ?
|
||||||
name.equals(
|
new IIOPInputStream() : null;
|
||||||
IIOPInputStream
|
|
||||||
.class.getName()
|
|
||||||
) ?
|
|
||||||
new IIOPInputStream() :
|
|
||||||
|
|
||||||
name.equals(
|
|
||||||
com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3
|
|
||||||
.class.getName()
|
|
||||||
) ?
|
|
||||||
new com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3() :
|
|
||||||
|
|
||||||
name.equals(
|
|
||||||
com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3_1
|
|
||||||
.class.getName()
|
|
||||||
) ?
|
|
||||||
new com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3_1() :
|
|
||||||
|
|
||||||
null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -958,12 +920,7 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
TCKind getJavaCharTCKind() {
|
||||||
* Our JDK 1.3 and JDK 1.3.1 behavior subclasses override this.
|
|
||||||
* The correct behavior is for a Java char to map to a CORBA wchar,
|
|
||||||
* but our older code mapped it to a CORBA char.
|
|
||||||
*/
|
|
||||||
protected TCKind getJavaCharTCKind() {
|
|
||||||
return TCKind.tk_wchar;
|
return TCKind.tk_wchar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -93,6 +93,14 @@ public class ValueUtility {
|
|||||||
null, // tk_abstract_interface 32
|
null, // tk_abstract_interface 32
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static {
|
||||||
|
sun.corba.SharedSecrets.setJavaCorbaAccess(new sun.corba.JavaCorbaAccess() {
|
||||||
|
public ValueHandlerImpl newValueHandlerImpl() {
|
||||||
|
return ValueHandlerImpl.getInstance();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public static String getSignature(ValueMember member)
|
public static String getSignature(ValueMember member)
|
||||||
throws ClassNotFoundException {
|
throws ClassNotFoundException {
|
||||||
|
|
||||||
|
@ -112,6 +112,9 @@ import com.sun.corba.se.impl.util.JDKBridge;
|
|||||||
import com.sun.corba.se.impl.orbutil.ORBClassLoader;
|
import com.sun.corba.se.impl.orbutil.ORBClassLoader;
|
||||||
import com.sun.corba.se.impl.logging.UtilSystemException;
|
import com.sun.corba.se.impl.logging.UtilSystemException;
|
||||||
import com.sun.corba.se.spi.logging.CORBALogDomains;
|
import com.sun.corba.se.spi.logging.CORBALogDomains;
|
||||||
|
import sun.corba.SharedSecrets;
|
||||||
|
import sun.corba.JavaCorbaAccess;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides utility methods that can be used by stubs and ties to
|
* Provides utility methods that can be used by stubs and ties to
|
||||||
@ -125,7 +128,8 @@ public class Util implements javax.rmi.CORBA.UtilDelegate
|
|||||||
// Maps targets to ties.
|
// Maps targets to ties.
|
||||||
private static IdentityHashtable exportedServants = new IdentityHashtable();
|
private static IdentityHashtable exportedServants = new IdentityHashtable();
|
||||||
|
|
||||||
private static ValueHandlerImpl valueHandlerSingleton = new ValueHandlerImpl();
|
private static final ValueHandlerImpl valueHandlerSingleton =
|
||||||
|
SharedSecrets.getJavaCorbaAccess().newValueHandlerImpl();
|
||||||
|
|
||||||
private UtilSystemException utilWrapper = UtilSystemException.get(
|
private UtilSystemException utilWrapper = UtilSystemException.get(
|
||||||
CORBALogDomains.RPC_ENCODING);
|
CORBALogDomains.RPC_ENCODING);
|
||||||
|
@ -840,7 +840,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
|||||||
// backward compatability 4365188
|
// backward compatability 4365188
|
||||||
CodeBase cb;
|
CodeBase cb;
|
||||||
|
|
||||||
ValueHandler vh = ORBUtility.createValueHandler(this);
|
ValueHandler vh = ORBUtility.createValueHandler();
|
||||||
|
|
||||||
cb = (CodeBase)vh.getRunTimeCodeBase();
|
cb = (CodeBase)vh.getRunTimeCodeBase();
|
||||||
return ORBUtility.connectAndGetIOR( this, cb ) ;
|
return ORBUtility.connectAndGetIOR( this, cb ) ;
|
||||||
|
@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation. Oracle designates this
|
|
||||||
* particular file as subject to the "Classpath" exception as provided
|
|
||||||
* by Oracle in the LICENSE file that accompanied this code.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
*/
|
|
||||||
package com.sun.corba.se.impl.orbutil;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.Hashtable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implements legacy behavior from Ladybird to maintain
|
|
||||||
* backwards compatibility.
|
|
||||||
*/
|
|
||||||
public class IIOPInputStream_1_3_1 extends com.sun.corba.se.impl.io.IIOPInputStream
|
|
||||||
{
|
|
||||||
public IIOPInputStream_1_3_1()
|
|
||||||
throws java.io.IOException {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Before JDK 1.3.1_01, the PutField/GetField implementation
|
|
||||||
* actually sent a Hashtable.
|
|
||||||
*/
|
|
||||||
public ObjectInputStream.GetField readFields()
|
|
||||||
throws IOException, ClassNotFoundException, NotActiveException {
|
|
||||||
|
|
||||||
Hashtable fields = (Hashtable)readObject();
|
|
||||||
return new LegacyHookGetFields(fields);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,68 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation. Oracle designates this
|
|
||||||
* particular file as subject to the "Classpath" exception as provided
|
|
||||||
* by Oracle in the LICENSE file that accompanied this code.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
package com.sun.corba.se.impl.orbutil;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implements legacy behavior from before Ladybird to maintain
|
|
||||||
* backwards compatibility.
|
|
||||||
*/
|
|
||||||
public class IIOPOutputStream_1_3 extends com.sun.corba.se.impl.io.IIOPOutputStream
|
|
||||||
{
|
|
||||||
// We can't assume that the superclass's putFields
|
|
||||||
// member will be non-private. We must allow
|
|
||||||
// the RI to run on JDK 1.3.1 FCS as well as
|
|
||||||
// the JDK 1.3.1_01 patch.
|
|
||||||
private ObjectOutputStream.PutField putFields_1_3;
|
|
||||||
|
|
||||||
// The newer version in the io package correctly writes a wstring instead.
|
|
||||||
// This concerns bug 4379597.
|
|
||||||
protected void internalWriteUTF(org.omg.CORBA.portable.OutputStream stream,
|
|
||||||
String data)
|
|
||||||
{
|
|
||||||
stream.write_string(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IIOPOutputStream_1_3()
|
|
||||||
throws java.io.IOException {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Before JDK 1.3.1_01, the PutField/GetField implementation
|
|
||||||
* actually sent a Hashtable.
|
|
||||||
*/
|
|
||||||
public ObjectOutputStream.PutField putFields()
|
|
||||||
throws IOException {
|
|
||||||
putFields_1_3 = new LegacyHookPutFields();
|
|
||||||
return putFields_1_3;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void writeFields()
|
|
||||||
throws IOException {
|
|
||||||
putFields_1_3.write(this);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,66 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation. Oracle designates this
|
|
||||||
* particular file as subject to the "Classpath" exception as provided
|
|
||||||
* by Oracle in the LICENSE file that accompanied this code.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
*/
|
|
||||||
package com.sun.corba.se.impl.orbutil;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.Hashtable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implements legacy behavior from Ladybird to maintain
|
|
||||||
* backwards compatibility.
|
|
||||||
*/
|
|
||||||
public class IIOPOutputStream_1_3_1 extends com.sun.corba.se.impl.io.IIOPOutputStream
|
|
||||||
{
|
|
||||||
// We can't assume that the superclass's putFields
|
|
||||||
// member will be non-private. We must allow
|
|
||||||
// the RI to run on JDK 1.3.1 FCS as well as
|
|
||||||
// the JDK 1.3.1_01 patch.
|
|
||||||
private ObjectOutputStream.PutField putFields_1_3_1;
|
|
||||||
|
|
||||||
public IIOPOutputStream_1_3_1()
|
|
||||||
throws java.io.IOException {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Before JDK 1.3.1_01, the PutField/GetField implementation
|
|
||||||
* actually sent a Hashtable.
|
|
||||||
*/
|
|
||||||
public ObjectOutputStream.PutField putFields()
|
|
||||||
throws IOException {
|
|
||||||
|
|
||||||
putFields_1_3_1 = new LegacyHookPutFields();
|
|
||||||
return putFields_1_3_1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void writeFields()
|
|
||||||
throws IOException {
|
|
||||||
|
|
||||||
putFields_1_3_1.write(this);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -160,44 +160,12 @@ public final class ORBUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the correct ValueHandler for the given ORB,
|
* Return default ValueHandler
|
||||||
* querying ORBVersion information. If the ORB or
|
|
||||||
* ORBVersion is null, gets the ValueHandler from
|
|
||||||
* Util.createValueHandler.
|
|
||||||
*/
|
*/
|
||||||
public static ValueHandler createValueHandler(ORB orb) {
|
public static ValueHandler createValueHandler() {
|
||||||
|
|
||||||
if (orb == null)
|
|
||||||
return Util.createValueHandler();
|
|
||||||
|
|
||||||
ORBVersion version = orb.getORBVersion();
|
|
||||||
|
|
||||||
if (version == null)
|
|
||||||
return Util.createValueHandler();
|
|
||||||
|
|
||||||
if (version.equals(ORBVersionFactory.getOLD()))
|
|
||||||
return new ValueHandlerImpl_1_3();
|
|
||||||
if (version.equals(ORBVersionFactory.getNEW()))
|
|
||||||
return new ValueHandlerImpl_1_3_1();
|
|
||||||
|
|
||||||
return Util.createValueHandler();
|
return Util.createValueHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the given ORB could accurately be determined to be a
|
|
||||||
* Kestrel or earlier ORB. Note: If passed the ORBSingleton, this will return
|
|
||||||
* false.
|
|
||||||
*/
|
|
||||||
public static boolean isLegacyORB(ORB orb)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
ORBVersion currentORB = orb.getORBVersion();
|
|
||||||
return currentORB.equals( ORBVersionFactory.getOLD() ) ;
|
|
||||||
} catch (SecurityException se) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if it was accurately determined that the remote ORB is
|
* Returns true if it was accurately determined that the remote ORB is
|
||||||
* a foreign (non-JavaSoft) ORB. Note: If passed the ORBSingleton, this
|
* a foreign (non-JavaSoft) ORB. Note: If passed the ORBSingleton, this
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -1119,8 +1119,8 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
|
|||||||
private boolean hasExternalizableBlockData;
|
private boolean hasExternalizableBlockData;
|
||||||
Method writeObjectMethod;
|
Method writeObjectMethod;
|
||||||
Method readObjectMethod;
|
Method readObjectMethod;
|
||||||
private Method writeReplaceObjectMethod;
|
private transient Method writeReplaceObjectMethod;
|
||||||
private Method readResolveObjectMethod;
|
private transient Method readResolveObjectMethod;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ObjectStreamClass_1_3_1 that this one was built from.
|
* ObjectStreamClass_1_3_1 that this one was built from.
|
||||||
|
@ -1,177 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation. Oracle designates this
|
|
||||||
* particular file as subject to the "Classpath" exception as provided
|
|
||||||
* by Oracle in the LICENSE file that accompanied this code.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sun.corba.se.impl.orbutil;
|
|
||||||
|
|
||||||
import org.omg.CORBA.ORB;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import com.sun.corba.se.impl.io.TypeMismatchException;
|
|
||||||
import com.sun.corba.se.impl.util.RepositoryId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delegates to the RepositoryId_1_3 implementation in
|
|
||||||
* com.sun.corba.se.impl.orbutil. This is necessary to
|
|
||||||
* overcome the fact that many of RepositoryId's methods
|
|
||||||
* are static.
|
|
||||||
*/
|
|
||||||
public final class RepIdDelegator_1_3
|
|
||||||
implements RepositoryIdStrings,
|
|
||||||
RepositoryIdUtility,
|
|
||||||
RepositoryIdInterface
|
|
||||||
{
|
|
||||||
// RepositoryIdFactory methods
|
|
||||||
|
|
||||||
public String createForAnyType(Class type) {
|
|
||||||
return RepositoryId_1_3.createForAnyType(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String createForJavaType(Serializable ser)
|
|
||||||
throws TypeMismatchException
|
|
||||||
{
|
|
||||||
return RepositoryId_1_3.createForJavaType(ser);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String createForJavaType(Class clz)
|
|
||||||
throws TypeMismatchException
|
|
||||||
{
|
|
||||||
return RepositoryId_1_3.createForJavaType(clz);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String createSequenceRepID(java.lang.Object ser) {
|
|
||||||
return RepositoryId_1_3.createSequenceRepID(ser);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String createSequenceRepID(Class clazz) {
|
|
||||||
return RepositoryId_1_3.createSequenceRepID(clazz);
|
|
||||||
}
|
|
||||||
|
|
||||||
public RepositoryIdInterface getFromString(String repIdString) {
|
|
||||||
return new RepIdDelegator_1_3(RepositoryId_1_3.cache.getId(repIdString));
|
|
||||||
}
|
|
||||||
|
|
||||||
// RepositoryIdUtility methods
|
|
||||||
|
|
||||||
public boolean isChunkedEncoding(int valueTag) {
|
|
||||||
return RepositoryId.isChunkedEncoding(valueTag);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isCodeBasePresent(int valueTag) {
|
|
||||||
return RepositoryId.isCodeBasePresent(valueTag);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClassDescValueRepId() {
|
|
||||||
return RepositoryId_1_3.kClassDescValueRepID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getWStringValueRepId() {
|
|
||||||
return RepositoryId_1_3.kWStringValueRepID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTypeInfo(int valueTag) {
|
|
||||||
return RepositoryId.getTypeInfo(valueTag);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStandardRMIChunkedNoRepStrId() {
|
|
||||||
return RepositoryId.kPreComputed_StandardRMIChunked_NoRep;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCodeBaseRMIChunkedNoRepStrId() {
|
|
||||||
return RepositoryId.kPreComputed_CodeBaseRMIChunked_NoRep;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStandardRMIChunkedId() {
|
|
||||||
return RepositoryId.kPreComputed_StandardRMIChunked;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCodeBaseRMIChunkedId() {
|
|
||||||
return RepositoryId.kPreComputed_CodeBaseRMIChunked;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStandardRMIUnchunkedId() {
|
|
||||||
return RepositoryId.kPreComputed_StandardRMIUnchunked;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCodeBaseRMIUnchunkedId() {
|
|
||||||
return RepositoryId.kPreComputed_CodeBaseRMIUnchunked;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStandardRMIUnchunkedNoRepStrId() {
|
|
||||||
return RepositoryId.kPreComputed_StandardRMIUnchunked_NoRep;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCodeBaseRMIUnchunkedNoRepStrId() {
|
|
||||||
return RepositoryId.kPreComputed_CodeBaseRMIUnchunked_NoRep;
|
|
||||||
}
|
|
||||||
|
|
||||||
// RepositoryIdInterface methods
|
|
||||||
|
|
||||||
public Class getClassFromType() throws ClassNotFoundException {
|
|
||||||
return delegate.getClassFromType();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Class getClassFromType(String codebaseURL)
|
|
||||||
throws ClassNotFoundException, MalformedURLException
|
|
||||||
{
|
|
||||||
return delegate.getClassFromType(codebaseURL);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Class getClassFromType(Class expectedType,
|
|
||||||
String codebaseURL)
|
|
||||||
throws ClassNotFoundException, MalformedURLException
|
|
||||||
{
|
|
||||||
return delegate.getClassFromType(expectedType, codebaseURL);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClassName() {
|
|
||||||
return delegate.getClassName();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Constructor used for factory/utility cases
|
|
||||||
public RepIdDelegator_1_3() {}
|
|
||||||
|
|
||||||
// Constructor used by getIdFromString. All non-static
|
|
||||||
// RepositoryId methods will use the provided delegate.
|
|
||||||
private RepIdDelegator_1_3(RepositoryId_1_3 _delegate) {
|
|
||||||
this.delegate = _delegate;
|
|
||||||
}
|
|
||||||
|
|
||||||
private RepositoryId_1_3 delegate = null;
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
if (delegate != null)
|
|
||||||
return delegate.toString();
|
|
||||||
else
|
|
||||||
return this.getClass().getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (delegate != null)
|
|
||||||
return delegate.equals(obj);
|
|
||||||
else
|
|
||||||
return super.equals(obj);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,177 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation. Oracle designates this
|
|
||||||
* particular file as subject to the "Classpath" exception as provided
|
|
||||||
* by Oracle in the LICENSE file that accompanied this code.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sun.corba.se.impl.orbutil;
|
|
||||||
|
|
||||||
import org.omg.CORBA.ORB;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import com.sun.corba.se.impl.io.TypeMismatchException;
|
|
||||||
import com.sun.corba.se.impl.util.RepositoryId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delegates to the RepositoryId_1_3_1 implementation in
|
|
||||||
* com.sun.corba.se.impl.orbutil. This is necessary to
|
|
||||||
* overcome the fact that many of RepositoryId's methods
|
|
||||||
* are static.
|
|
||||||
*/
|
|
||||||
public final class RepIdDelegator_1_3_1
|
|
||||||
implements RepositoryIdStrings,
|
|
||||||
RepositoryIdUtility,
|
|
||||||
RepositoryIdInterface
|
|
||||||
{
|
|
||||||
// RepositoryIdFactory methods
|
|
||||||
|
|
||||||
public String createForAnyType(Class type) {
|
|
||||||
return RepositoryId_1_3_1.createForAnyType(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String createForJavaType(Serializable ser)
|
|
||||||
throws TypeMismatchException
|
|
||||||
{
|
|
||||||
return RepositoryId_1_3_1.createForJavaType(ser);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String createForJavaType(Class clz)
|
|
||||||
throws TypeMismatchException
|
|
||||||
{
|
|
||||||
return RepositoryId_1_3_1.createForJavaType(clz);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String createSequenceRepID(java.lang.Object ser) {
|
|
||||||
return RepositoryId_1_3_1.createSequenceRepID(ser);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String createSequenceRepID(Class clazz) {
|
|
||||||
return RepositoryId_1_3_1.createSequenceRepID(clazz);
|
|
||||||
}
|
|
||||||
|
|
||||||
public RepositoryIdInterface getFromString(String repIdString) {
|
|
||||||
return new RepIdDelegator_1_3_1(RepositoryId_1_3_1.cache.getId(repIdString));
|
|
||||||
}
|
|
||||||
|
|
||||||
// RepositoryIdUtility methods
|
|
||||||
|
|
||||||
public boolean isChunkedEncoding(int valueTag) {
|
|
||||||
return RepositoryId.isChunkedEncoding(valueTag);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isCodeBasePresent(int valueTag) {
|
|
||||||
return RepositoryId.isCodeBasePresent(valueTag);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClassDescValueRepId() {
|
|
||||||
return RepositoryId_1_3_1.kClassDescValueRepID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getWStringValueRepId() {
|
|
||||||
return RepositoryId_1_3_1.kWStringValueRepID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTypeInfo(int valueTag) {
|
|
||||||
return RepositoryId.getTypeInfo(valueTag);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStandardRMIChunkedNoRepStrId() {
|
|
||||||
return RepositoryId.kPreComputed_StandardRMIChunked_NoRep;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCodeBaseRMIChunkedNoRepStrId() {
|
|
||||||
return RepositoryId.kPreComputed_CodeBaseRMIChunked_NoRep;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStandardRMIChunkedId() {
|
|
||||||
return RepositoryId.kPreComputed_StandardRMIChunked;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCodeBaseRMIChunkedId() {
|
|
||||||
return RepositoryId.kPreComputed_CodeBaseRMIChunked;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStandardRMIUnchunkedId() {
|
|
||||||
return RepositoryId.kPreComputed_StandardRMIUnchunked;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCodeBaseRMIUnchunkedId() {
|
|
||||||
return RepositoryId.kPreComputed_CodeBaseRMIUnchunked;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStandardRMIUnchunkedNoRepStrId() {
|
|
||||||
return RepositoryId.kPreComputed_StandardRMIUnchunked_NoRep;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCodeBaseRMIUnchunkedNoRepStrId() {
|
|
||||||
return RepositoryId.kPreComputed_CodeBaseRMIUnchunked_NoRep;
|
|
||||||
}
|
|
||||||
|
|
||||||
// RepositoryIdInterface methods
|
|
||||||
|
|
||||||
public Class getClassFromType() throws ClassNotFoundException {
|
|
||||||
return delegate.getClassFromType();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Class getClassFromType(String codebaseURL)
|
|
||||||
throws ClassNotFoundException, MalformedURLException
|
|
||||||
{
|
|
||||||
return delegate.getClassFromType(codebaseURL);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Class getClassFromType(Class expectedType,
|
|
||||||
String codebaseURL)
|
|
||||||
throws ClassNotFoundException, MalformedURLException
|
|
||||||
{
|
|
||||||
return delegate.getClassFromType(expectedType, codebaseURL);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClassName() {
|
|
||||||
return delegate.getClassName();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Constructor used for factory/utility cases
|
|
||||||
public RepIdDelegator_1_3_1() {}
|
|
||||||
|
|
||||||
// Constructor used by getIdFromString. All non-static
|
|
||||||
// RepositoryId methods will use the provided delegate.
|
|
||||||
private RepIdDelegator_1_3_1(RepositoryId_1_3_1 _delegate) {
|
|
||||||
this.delegate = _delegate;
|
|
||||||
}
|
|
||||||
|
|
||||||
private RepositoryId_1_3_1 delegate = null;
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
if (delegate != null)
|
|
||||||
return delegate.toString();
|
|
||||||
else
|
|
||||||
return this.getClass().getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (delegate != null)
|
|
||||||
return delegate.equals(obj);
|
|
||||||
else
|
|
||||||
return super.equals(obj);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,108 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2000, 2002, 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.
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* Licensed Materials - Property of IBM
|
|
||||||
* RMI-IIOP v1.0
|
|
||||||
* Copyright IBM Corp. 1998 1999 All Rights Reserved
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sun.corba.se.impl.orbutil;
|
|
||||||
|
|
||||||
import java.util.Stack;
|
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.util.EmptyStackException;
|
|
||||||
import java.util.Enumeration;
|
|
||||||
|
|
||||||
// Really limited pool - in this case just creating several at a time...
|
|
||||||
class RepositoryIdPool_1_3 extends Stack {
|
|
||||||
|
|
||||||
private static int MAX_CACHE_SIZE = 4;
|
|
||||||
private RepositoryIdCache_1_3 cache;
|
|
||||||
|
|
||||||
public final synchronized RepositoryId_1_3 popId() {
|
|
||||||
|
|
||||||
try {
|
|
||||||
return (RepositoryId_1_3)super.pop();
|
|
||||||
}
|
|
||||||
catch(EmptyStackException e) {
|
|
||||||
increasePool(5);
|
|
||||||
return (RepositoryId_1_3)super.pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pool management
|
|
||||||
final void increasePool(int size) {
|
|
||||||
//if (cache.size() <= MAX_CACHE_SIZE)
|
|
||||||
for (int i = size; i > 0; i--)
|
|
||||||
push(new RepositoryId_1_3());
|
|
||||||
/*
|
|
||||||
// _REVISIT_ This will not work w/out either thread tracing or weak references. I am
|
|
||||||
// betting that thread tracing almost completely negates benefit of reuse. Until either
|
|
||||||
// 1.2 only inclusion or proof to the contrary, I'll leave it this way...
|
|
||||||
else {
|
|
||||||
int numToReclaim = cache.size() / 2;
|
|
||||||
Enumeration keys = cache.keys();
|
|
||||||
Enumeration elements = cache.elements();
|
|
||||||
for (int i = numToReclaim; i > 0; i--) {
|
|
||||||
Object key = keys.nextElement();
|
|
||||||
Object element = elements.nextElement();
|
|
||||||
|
|
||||||
push(element);
|
|
||||||
cache.remove(key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
final void setCaches(RepositoryIdCache_1_3 cache) {
|
|
||||||
this.cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class RepositoryIdCache_1_3 extends Hashtable {
|
|
||||||
|
|
||||||
private RepositoryIdPool_1_3 pool = new RepositoryIdPool_1_3();
|
|
||||||
|
|
||||||
public RepositoryIdCache_1_3() {
|
|
||||||
pool.setCaches(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public final synchronized RepositoryId_1_3 getId(String key) {
|
|
||||||
RepositoryId_1_3 repId = (RepositoryId_1_3)super.get(key);
|
|
||||||
|
|
||||||
if (repId != null)
|
|
||||||
return repId;
|
|
||||||
else {
|
|
||||||
//repId = pool.popId().init(key);
|
|
||||||
repId = new RepositoryId_1_3(key);
|
|
||||||
put(key, repId);
|
|
||||||
return repId;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,102 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation. Oracle designates this
|
|
||||||
* particular file as subject to the "Classpath" exception as provided
|
|
||||||
* by Oracle in the LICENSE file that accompanied this code.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sun.corba.se.impl.orbutil;
|
|
||||||
|
|
||||||
import java.util.Stack;
|
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.util.EmptyStackException;
|
|
||||||
import java.util.Enumeration;
|
|
||||||
|
|
||||||
// Really limited pool - in this case just creating several at a time...
|
|
||||||
class RepositoryIdPool_1_3_1 extends Stack {
|
|
||||||
|
|
||||||
private static int MAX_CACHE_SIZE = 4;
|
|
||||||
private RepositoryIdCache_1_3_1 cache;
|
|
||||||
|
|
||||||
public final synchronized RepositoryId_1_3_1 popId() {
|
|
||||||
|
|
||||||
try {
|
|
||||||
return (RepositoryId_1_3_1)super.pop();
|
|
||||||
}
|
|
||||||
catch(EmptyStackException e) {
|
|
||||||
increasePool(5);
|
|
||||||
return (RepositoryId_1_3_1)super.pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pool management
|
|
||||||
final void increasePool(int size) {
|
|
||||||
//if (cache.size() <= MAX_CACHE_SIZE)
|
|
||||||
for (int i = size; i > 0; i--)
|
|
||||||
push(new RepositoryId_1_3_1());
|
|
||||||
/*
|
|
||||||
// _REVISIT_ This will not work w/out either thread tracing or weak references. I am
|
|
||||||
// betting that thread tracing almost completely negates benefit of reuse. Until either
|
|
||||||
// 1.2 only inclusion or proof to the contrary, I'll leave it this way...
|
|
||||||
else {
|
|
||||||
int numToReclaim = cache.size() / 2;
|
|
||||||
Enumeration keys = cache.keys();
|
|
||||||
Enumeration elements = cache.elements();
|
|
||||||
for (int i = numToReclaim; i > 0; i--) {
|
|
||||||
Object key = keys.nextElement();
|
|
||||||
Object element = elements.nextElement();
|
|
||||||
|
|
||||||
push(element);
|
|
||||||
cache.remove(key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
final void setCaches(RepositoryIdCache_1_3_1 cache) {
|
|
||||||
this.cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class RepositoryIdCache_1_3_1 extends Hashtable {
|
|
||||||
|
|
||||||
private RepositoryIdPool_1_3_1 pool = new RepositoryIdPool_1_3_1();
|
|
||||||
|
|
||||||
public RepositoryIdCache_1_3_1() {
|
|
||||||
pool.setCaches(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public final synchronized RepositoryId_1_3_1 getId(String key) {
|
|
||||||
RepositoryId_1_3_1 repId = (RepositoryId_1_3_1)super.get(key);
|
|
||||||
|
|
||||||
if (repId != null)
|
|
||||||
return repId;
|
|
||||||
else {
|
|
||||||
//repId = pool.popId().init(key);
|
|
||||||
repId = new RepositoryId_1_3_1(key);
|
|
||||||
put(key, repId);
|
|
||||||
return repId;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -30,12 +30,6 @@ import com.sun.corba.se.spi.orb.ORB;
|
|||||||
|
|
||||||
public abstract class RepositoryIdFactory
|
public abstract class RepositoryIdFactory
|
||||||
{
|
{
|
||||||
private static final RepIdDelegator_1_3 legacyDelegator
|
|
||||||
= new RepIdDelegator_1_3();
|
|
||||||
|
|
||||||
private static final RepIdDelegator_1_3_1 ladybirdDelegator
|
|
||||||
= new RepIdDelegator_1_3_1();
|
|
||||||
|
|
||||||
private static final RepIdDelegator currentDelegator
|
private static final RepIdDelegator currentDelegator
|
||||||
= new RepIdDelegator();
|
= new RepIdDelegator();
|
||||||
|
|
||||||
@ -47,29 +41,6 @@ public abstract class RepositoryIdFactory
|
|||||||
return currentDelegator;
|
return currentDelegator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks the version of the ORB and returns the appropriate
|
|
||||||
* RepositoryIdStrings instance.
|
|
||||||
*/
|
|
||||||
public static RepositoryIdStrings getRepIdStringsFactory(ORB orb)
|
|
||||||
{
|
|
||||||
if (orb != null) {
|
|
||||||
switch (orb.getORBVersion().getORBType()) {
|
|
||||||
case ORBVersion.NEWER:
|
|
||||||
case ORBVersion.FOREIGN:
|
|
||||||
case ORBVersion.JDK1_3_1_01:
|
|
||||||
return currentDelegator;
|
|
||||||
case ORBVersion.OLD:
|
|
||||||
return legacyDelegator;
|
|
||||||
case ORBVersion.NEW:
|
|
||||||
return ladybirdDelegator;
|
|
||||||
default:
|
|
||||||
return currentDelegator;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
return currentDelegator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the latest version RepositoryIdUtility instance
|
* Returns the latest version RepositoryIdUtility instance
|
||||||
*/
|
*/
|
||||||
@ -78,26 +49,4 @@ public abstract class RepositoryIdFactory
|
|||||||
return currentDelegator;
|
return currentDelegator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks the version of the ORB and returns the appropriate
|
|
||||||
* RepositoryIdUtility instance.
|
|
||||||
*/
|
|
||||||
public static RepositoryIdUtility getRepIdUtility(ORB orb)
|
|
||||||
{
|
|
||||||
if (orb != null) {
|
|
||||||
switch (orb.getORBVersion().getORBType()) {
|
|
||||||
case ORBVersion.NEWER:
|
|
||||||
case ORBVersion.FOREIGN:
|
|
||||||
case ORBVersion.JDK1_3_1_01:
|
|
||||||
return currentDelegator;
|
|
||||||
case ORBVersion.OLD:
|
|
||||||
return legacyDelegator;
|
|
||||||
case ORBVersion.NEW:
|
|
||||||
return ladybirdDelegator;
|
|
||||||
default:
|
|
||||||
return currentDelegator;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
return currentDelegator;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,990 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* Licensed Materials - Property of IBM
|
|
||||||
* RMI-IIOP v1.0
|
|
||||||
* Copyright IBM Corp. 1998 1999 All Rights Reserved
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sun.corba.se.impl.orbutil;
|
|
||||||
|
|
||||||
import java.util.StringTokenizer;
|
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
|
||||||
// Imports for using codebase URL to load class
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import org.omg.CORBA.portable.ValueBase;
|
|
||||||
import org.omg.CORBA.portable.IDLEntity;
|
|
||||||
|
|
||||||
import com.sun.corba.se.impl.util.JDKBridge;
|
|
||||||
import com.sun.corba.se.impl.util.Utility;
|
|
||||||
import com.sun.corba.se.impl.util.PackagePrefixChecker;
|
|
||||||
import com.sun.corba.se.impl.util.IdentityHashtable;
|
|
||||||
import com.sun.corba.se.impl.io.ObjectStreamClass;
|
|
||||||
|
|
||||||
import javax.rmi.CORBA.Util;
|
|
||||||
|
|
||||||
// keeping the original RepositoryId class that was shipped in
|
|
||||||
// JDK 1.3. It has interoperability bugs
|
|
||||||
|
|
||||||
public class RepositoryId_1_3 {
|
|
||||||
|
|
||||||
// Legal IDL Identifier characters (1 = legal). Note
|
|
||||||
// that '.' (2E) is marked as legal even though it is
|
|
||||||
// not legal in IDL. This allows us to treat a fully
|
|
||||||
// qualified Java name with '.' package separators
|
|
||||||
// uniformly, and is safe because that is the only
|
|
||||||
// legal use of '.' in a Java name.
|
|
||||||
|
|
||||||
public static final RepositoryIdCache_1_3 cache = new RepositoryIdCache_1_3();
|
|
||||||
private static final byte[] IDL_IDENTIFIER_CHARS = {
|
|
||||||
|
|
||||||
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
|
|
||||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 00-0f
|
|
||||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 10-1f
|
|
||||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,1,0, // 20-2f
|
|
||||||
1,1,1,1, 1,1,1,1, 1,1,0,0, 0,0,0,0, // 30-3f
|
|
||||||
0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // 40-4f
|
|
||||||
1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,1, // 50-5f
|
|
||||||
0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // 60-6f
|
|
||||||
1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,0, // 70-7f
|
|
||||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 80-8f
|
|
||||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 90-9f
|
|
||||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // a0-af
|
|
||||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // b0-bf
|
|
||||||
1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // c0-cf
|
|
||||||
0,1,1,1, 1,1,1,0, 1,1,1,1, 1,0,0,1, // d0-df
|
|
||||||
1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // e0-ef
|
|
||||||
0,1,1,1, 1,1,1,0, 1,1,1,1, 1,0,0,1, // f0-ff
|
|
||||||
};
|
|
||||||
|
|
||||||
private static String defaultServerURL = null;
|
|
||||||
private static boolean useCodebaseOnly = false;
|
|
||||||
|
|
||||||
static {
|
|
||||||
if (defaultServerURL == null)
|
|
||||||
defaultServerURL = (String)JDKBridge.getLocalCodebase();
|
|
||||||
useCodebaseOnly = JDKBridge.useCodebaseOnly();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private static IdentityHashtable classToRepStr = new IdentityHashtable();
|
|
||||||
private static IdentityHashtable classIDLToRepStr = new IdentityHashtable();
|
|
||||||
private static IdentityHashtable classSeqToRepStr = new IdentityHashtable();
|
|
||||||
|
|
||||||
private static IdentityHashtable repStrToByteArray = new IdentityHashtable();
|
|
||||||
private static Hashtable repStrToClass = new Hashtable();
|
|
||||||
|
|
||||||
private String repId = null;
|
|
||||||
private boolean isSupportedFormat = true;
|
|
||||||
private String typeString = null;
|
|
||||||
private String versionString = null;
|
|
||||||
private boolean isSequence = false;
|
|
||||||
private boolean isRMIValueType = false;
|
|
||||||
private boolean isIDLType = false;
|
|
||||||
private String completeClassName = null;
|
|
||||||
private String unqualifiedName = null;
|
|
||||||
private String definedInId = null;
|
|
||||||
private Class clazz = null;
|
|
||||||
private String suid = null, actualSuid = null;
|
|
||||||
private long suidLong = ObjectStreamClass.kDefaultUID, actualSuidLong = ObjectStreamClass.kDefaultUID;
|
|
||||||
|
|
||||||
// Repository ID fragments
|
|
||||||
private static final String kValuePrefix = "RMI:";
|
|
||||||
private static final String kIDLPrefix = "IDL:";
|
|
||||||
private static final String kIDLNamePrefix = "omg.org/";
|
|
||||||
private static final String kIDLClassnamePrefix = "org.omg.";
|
|
||||||
private static final String kSequencePrefix = "[";
|
|
||||||
private static final String kCORBAPrefix = "CORBA/";
|
|
||||||
private static final String kArrayPrefix = kValuePrefix + kSequencePrefix + kCORBAPrefix;
|
|
||||||
private static final int kValuePrefixLength = kValuePrefix.length();
|
|
||||||
private static final int kIDLPrefixLength = kIDLPrefix.length();
|
|
||||||
private static final int kSequencePrefixLength = kSequencePrefix.length();
|
|
||||||
private static final String kInterfaceHashCode = ":0000000000000000";
|
|
||||||
private static final String kInterfaceOnlyHashStr = "0000000000000000";
|
|
||||||
private static final String kExternalizableHashStr = "0000000000000001";
|
|
||||||
|
|
||||||
// Value tag utility methods and constants
|
|
||||||
public static final int kInitialValueTag= 0x7fffff00;
|
|
||||||
public static final int kNoTypeInfo = 0;
|
|
||||||
public static final int kSingleRepTypeInfo = 0x02;
|
|
||||||
public static final int kPartialListTypeInfo = 0x06;
|
|
||||||
public static final int kChunkedMask = 0x08;
|
|
||||||
|
|
||||||
// Public, well known repository IDs
|
|
||||||
|
|
||||||
// _REVISIT_ : A table structure with a good search routine for all of this
|
|
||||||
// would be more efficient and easier to maintain...
|
|
||||||
|
|
||||||
// String
|
|
||||||
public static final String kWStringValueVersion = "1.0";
|
|
||||||
public static final String kWStringValueHash = ":"+kWStringValueVersion;
|
|
||||||
public static final String kWStringStubValue = "WStringValue";
|
|
||||||
public static final String kWStringTypeStr = "omg.org/CORBA/"+kWStringStubValue;
|
|
||||||
public static final String kWStringValueRepID = kIDLPrefix + kWStringTypeStr + kWStringValueHash;
|
|
||||||
|
|
||||||
// Any
|
|
||||||
public static final String kAnyRepID = kIDLPrefix + "omg.org/CORBA/Any";
|
|
||||||
|
|
||||||
// Class
|
|
||||||
public static final String kClassDescValueHash = ":" + Long.toHexString(
|
|
||||||
ObjectStreamClass.getSerialVersionUID(javax.rmi.CORBA.ClassDesc.class));
|
|
||||||
public static final String kClassDescStubValue = "ClassDesc";
|
|
||||||
public static final String kClassDescTypeStr = "javax.rmi.CORBA."+kClassDescStubValue;
|
|
||||||
public static final String kClassDescValueRepID = kValuePrefix + kClassDescTypeStr + kClassDescValueHash;
|
|
||||||
|
|
||||||
// Object
|
|
||||||
public static final String kObjectValueHash = ":1.0";
|
|
||||||
public static final String kObjectStubValue = "Object";
|
|
||||||
|
|
||||||
// Sequence
|
|
||||||
public static final String kSequenceValueHash = ":1.0";
|
|
||||||
public static final String kPrimitiveSequenceValueHash = ":0000000000000000";
|
|
||||||
|
|
||||||
// Serializable
|
|
||||||
public static final String kSerializableValueHash = ":1.0";
|
|
||||||
public static final String kSerializableStubValue = "Serializable";
|
|
||||||
|
|
||||||
// Externalizable
|
|
||||||
public static final String kExternalizableValueHash = ":1.0";
|
|
||||||
public static final String kExternalizableStubValue = "Externalizable";
|
|
||||||
|
|
||||||
// Remote (The empty string is used for java.rmi.Remote)
|
|
||||||
public static final String kRemoteValueHash = "";
|
|
||||||
public static final String kRemoteStubValue = "";
|
|
||||||
public static final String kRemoteTypeStr = "";
|
|
||||||
public static final String kRemoteValueRepID = "";
|
|
||||||
|
|
||||||
private static final Hashtable kSpecialArrayTypeStrings = new Hashtable();
|
|
||||||
|
|
||||||
static {
|
|
||||||
kSpecialArrayTypeStrings.put("CORBA.WStringValue", new StringBuffer(java.lang.String.class.getName()));
|
|
||||||
kSpecialArrayTypeStrings.put("javax.rmi.CORBA.ClassDesc", new StringBuffer(java.lang.Class.class.getName()));
|
|
||||||
kSpecialArrayTypeStrings.put("CORBA.Object", new StringBuffer(java.rmi.Remote.class.getName()));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Hashtable kSpecialCasesRepIDs = new Hashtable();
|
|
||||||
|
|
||||||
static {
|
|
||||||
kSpecialCasesRepIDs.put(java.lang.String.class, kWStringValueRepID);
|
|
||||||
kSpecialCasesRepIDs.put(java.lang.Class.class, kClassDescValueRepID);
|
|
||||||
kSpecialCasesRepIDs.put(java.rmi.Remote.class, kRemoteValueRepID);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Hashtable kSpecialCasesStubValues = new Hashtable();
|
|
||||||
|
|
||||||
static {
|
|
||||||
kSpecialCasesStubValues.put(java.lang.String.class, kWStringStubValue);
|
|
||||||
kSpecialCasesStubValues.put(java.lang.Class.class, kClassDescStubValue);
|
|
||||||
kSpecialCasesStubValues.put(java.lang.Object.class, kObjectStubValue);
|
|
||||||
kSpecialCasesStubValues.put(java.io.Serializable.class, kSerializableStubValue);
|
|
||||||
kSpecialCasesStubValues.put(java.io.Externalizable.class, kExternalizableStubValue);
|
|
||||||
kSpecialCasesStubValues.put(java.rmi.Remote.class, kRemoteStubValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static final Hashtable kSpecialCasesVersions = new Hashtable();
|
|
||||||
|
|
||||||
static {
|
|
||||||
kSpecialCasesVersions.put(java.lang.String.class, kWStringValueHash);
|
|
||||||
kSpecialCasesVersions.put(java.lang.Class.class, kClassDescValueHash);
|
|
||||||
kSpecialCasesVersions.put(java.lang.Object.class, kObjectValueHash);
|
|
||||||
kSpecialCasesVersions.put(java.io.Serializable.class, kSerializableValueHash);
|
|
||||||
kSpecialCasesVersions.put(java.io.Externalizable.class, kExternalizableValueHash);
|
|
||||||
kSpecialCasesVersions.put(java.rmi.Remote.class, kRemoteValueHash);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Hashtable kSpecialCasesClasses = new Hashtable();
|
|
||||||
|
|
||||||
static {
|
|
||||||
kSpecialCasesClasses.put(kWStringTypeStr, java.lang.String.class);
|
|
||||||
kSpecialCasesClasses.put(kClassDescTypeStr, java.lang.Class.class);
|
|
||||||
kSpecialCasesClasses.put(kRemoteTypeStr, java.rmi.Remote.class);
|
|
||||||
|
|
||||||
kSpecialCasesClasses.put("org.omg.CORBA.WStringValue", java.lang.String.class);
|
|
||||||
kSpecialCasesClasses.put("javax.rmi.CORBA.ClassDesc", java.lang.Class.class);
|
|
||||||
//kSpecialCasesClasses.put(kRemoteTypeStr, java.rmi.Remote.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Hashtable kSpecialCasesArrayPrefix = new Hashtable();
|
|
||||||
|
|
||||||
static {
|
|
||||||
kSpecialCasesArrayPrefix.put(java.lang.String.class, kValuePrefix + kSequencePrefix + kCORBAPrefix);
|
|
||||||
kSpecialCasesArrayPrefix.put(java.lang.Class.class, kValuePrefix + kSequencePrefix + "javax/rmi/CORBA/");
|
|
||||||
kSpecialCasesArrayPrefix.put(java.lang.Object.class, kValuePrefix + kSequencePrefix + "java/lang/");
|
|
||||||
kSpecialCasesArrayPrefix.put(java.io.Serializable.class, kValuePrefix + kSequencePrefix + "java/io/");
|
|
||||||
kSpecialCasesArrayPrefix.put(java.io.Externalizable.class, kValuePrefix + kSequencePrefix + "java/io/");
|
|
||||||
kSpecialCasesArrayPrefix.put(java.rmi.Remote.class, kValuePrefix + kSequencePrefix + kCORBAPrefix);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Hashtable kSpecialPrimitives = new Hashtable();
|
|
||||||
|
|
||||||
static {
|
|
||||||
kSpecialPrimitives.put("int","long");
|
|
||||||
kSpecialPrimitives.put("long","longlong");
|
|
||||||
kSpecialPrimitives.put("byte","octet");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used to convert ascii to hex.
|
|
||||||
*/
|
|
||||||
private static final byte ASCII_HEX[] = {
|
|
||||||
(byte)'0',
|
|
||||||
(byte)'1',
|
|
||||||
(byte)'2',
|
|
||||||
(byte)'3',
|
|
||||||
(byte)'4',
|
|
||||||
(byte)'5',
|
|
||||||
(byte)'6',
|
|
||||||
(byte)'7',
|
|
||||||
(byte)'8',
|
|
||||||
(byte)'9',
|
|
||||||
(byte)'A',
|
|
||||||
(byte)'B',
|
|
||||||
(byte)'C',
|
|
||||||
(byte)'D',
|
|
||||||
(byte)'E',
|
|
||||||
(byte)'F',
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Interface Rep ID Strings
|
|
||||||
public static final String kjava_rmi_Remote = createForAnyType(java.rmi.Remote.class);
|
|
||||||
public static final String korg_omg_CORBA_Object = createForAnyType(org.omg.CORBA.Object.class);
|
|
||||||
|
|
||||||
// Dummy arguments for getIdFromHelper method
|
|
||||||
public static final Class kNoParamTypes[] ={};
|
|
||||||
public static final Object kNoArgs[] = {};
|
|
||||||
|
|
||||||
|
|
||||||
RepositoryId_1_3(){}
|
|
||||||
|
|
||||||
RepositoryId_1_3(String aRepId){
|
|
||||||
init(aRepId);
|
|
||||||
}
|
|
||||||
|
|
||||||
RepositoryId_1_3 init(String aRepId){
|
|
||||||
|
|
||||||
this.repId = aRepId;
|
|
||||||
|
|
||||||
// Special case for remote
|
|
||||||
if (aRepId.length() == 0) {
|
|
||||||
clazz = java.rmi.Remote.class;
|
|
||||||
typeString = "";
|
|
||||||
isRMIValueType = true;
|
|
||||||
suid = kInterfaceOnlyHashStr;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
else if (aRepId.equals(kWStringValueRepID)) {
|
|
||||||
clazz = java.lang.String.class;
|
|
||||||
typeString = kWStringTypeStr;
|
|
||||||
isIDLType = true;
|
|
||||||
versionString = kWStringValueVersion;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
String repId = convertFromISOLatin1(aRepId);
|
|
||||||
|
|
||||||
versionString = repId.substring(repId.indexOf(':', repId.indexOf(':')+1));
|
|
||||||
if (repId.startsWith(kIDLPrefix)) {
|
|
||||||
typeString =
|
|
||||||
repId.substring(kIDLPrefixLength, repId.indexOf(':', kIDLPrefixLength));
|
|
||||||
isIDLType = true;
|
|
||||||
if (typeString.startsWith(kIDLNamePrefix))
|
|
||||||
completeClassName = kIDLClassnamePrefix +
|
|
||||||
typeString.substring(kIDLNamePrefix.length()).replace('/','.');
|
|
||||||
else completeClassName = typeString.replace('/','.');
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (repId.startsWith(kValuePrefix)) {
|
|
||||||
typeString =
|
|
||||||
repId.substring(kValuePrefixLength, repId.indexOf(':', kValuePrefixLength));
|
|
||||||
isRMIValueType = true;
|
|
||||||
|
|
||||||
if (versionString.indexOf('.') == -1) {
|
|
||||||
actualSuid = versionString.substring(1);
|
|
||||||
suid = actualSuid; // default if not explicitly specified
|
|
||||||
|
|
||||||
if (actualSuid.indexOf(':') != -1){
|
|
||||||
// we have a declared hash also
|
|
||||||
int pos = actualSuid.indexOf(':')+1;
|
|
||||||
// actualSuid = suid.substring(pos);
|
|
||||||
// suid = suid.substring(0, pos-1);
|
|
||||||
suid = actualSuid.substring(pos);
|
|
||||||
actualSuid = actualSuid.substring(0, pos-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// _REVISIT_ : Special case version failure ?
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else isSupportedFormat = false;
|
|
||||||
|
|
||||||
if (typeString.startsWith(kSequencePrefix)) {
|
|
||||||
isSequence = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public final String getUnqualifiedName() {
|
|
||||||
if (unqualifiedName == null){
|
|
||||||
String className = getClassName();
|
|
||||||
int index = (className != null) ? className.lastIndexOf('.') : -1;
|
|
||||||
if (index == -1){
|
|
||||||
unqualifiedName = className;
|
|
||||||
definedInId = "IDL::1.0";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
unqualifiedName = className.substring(index);
|
|
||||||
definedInId = "IDL:" + className.substring(0, index).replace('.','/') + ":1.0";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return unqualifiedName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final String getDefinedInId() {
|
|
||||||
if (definedInId == null){
|
|
||||||
getUnqualifiedName();
|
|
||||||
}
|
|
||||||
|
|
||||||
return definedInId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final String getTypeString() {
|
|
||||||
return typeString;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final String getVersionString() {
|
|
||||||
return versionString;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final String getSerialVersionUID() {
|
|
||||||
return suid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final String getActualSerialVersionUID() {
|
|
||||||
return actualSuid;
|
|
||||||
}
|
|
||||||
public final long getSerialVersionUIDAsLong() {
|
|
||||||
return suidLong;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final long getActualSerialVersionUIDAsLong() {
|
|
||||||
return actualSuidLong;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isRMIValueType() {
|
|
||||||
return isRMIValueType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isIDLType() {
|
|
||||||
return isIDLType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final String getRepositoryId() {
|
|
||||||
return repId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static byte[] getByteArray(String repStr) {
|
|
||||||
synchronized (repStrToByteArray){
|
|
||||||
return (byte[]) repStrToByteArray.get(repStr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setByteArray(String repStr, byte[] repStrBytes) {
|
|
||||||
synchronized (repStrToByteArray){
|
|
||||||
repStrToByteArray.put(repStr, repStrBytes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isSequence() {
|
|
||||||
return isSequence;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isSupportedFormat() {
|
|
||||||
return isSupportedFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// This method will return the classname from the typestring OR if the classname turns out to be
|
|
||||||
// a special class "pseudo" name, then the matching real classname is returned.
|
|
||||||
public final String getClassName() {
|
|
||||||
|
|
||||||
if (isRMIValueType)
|
|
||||||
return typeString;
|
|
||||||
else if (isIDLType)
|
|
||||||
return completeClassName;
|
|
||||||
else return null;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// This method calls getClazzFromType() and falls back to the repStrToClass
|
|
||||||
// cache if no class was found. It's used where any class matching the
|
|
||||||
// given repid is an acceptable result.
|
|
||||||
public final Class getAnyClassFromType() throws ClassNotFoundException {
|
|
||||||
try {
|
|
||||||
return getClassFromType();
|
|
||||||
} catch (ClassNotFoundException cnfe) {
|
|
||||||
Class clz = (Class)repStrToClass.get(repId);
|
|
||||||
if (clz != null)
|
|
||||||
return clz;
|
|
||||||
else
|
|
||||||
throw cnfe;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public final Class getClassFromType()
|
|
||||||
throws ClassNotFoundException {
|
|
||||||
if (clazz != null)
|
|
||||||
return clazz;
|
|
||||||
|
|
||||||
Class specialCase = (Class)kSpecialCasesClasses.get(getClassName());
|
|
||||||
|
|
||||||
if (specialCase != null){
|
|
||||||
clazz = specialCase;
|
|
||||||
return specialCase;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
try{
|
|
||||||
return Util.loadClass(getClassName(), null, null);
|
|
||||||
}
|
|
||||||
catch(ClassNotFoundException cnfe){
|
|
||||||
if (defaultServerURL != null) {
|
|
||||||
try{
|
|
||||||
return getClassFromType(defaultServerURL);
|
|
||||||
}
|
|
||||||
catch(MalformedURLException mue){
|
|
||||||
throw cnfe;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else throw cnfe;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public final Class getClassFromType(Class expectedType, String codebase)
|
|
||||||
throws ClassNotFoundException {
|
|
||||||
if (clazz != null)
|
|
||||||
return clazz;
|
|
||||||
|
|
||||||
Class specialCase = (Class)kSpecialCasesClasses.get(getClassName());
|
|
||||||
|
|
||||||
if (specialCase != null){
|
|
||||||
clazz = specialCase;
|
|
||||||
return specialCase;
|
|
||||||
} else {
|
|
||||||
ClassLoader expectedTypeClassLoader = (expectedType == null ? null : expectedType.getClassLoader());
|
|
||||||
return loadClassOfType(getClassName(),
|
|
||||||
codebase,
|
|
||||||
expectedTypeClassLoader,
|
|
||||||
expectedType,
|
|
||||||
expectedTypeClassLoader);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public final Class getClassFromType(String url)
|
|
||||||
throws ClassNotFoundException, MalformedURLException {
|
|
||||||
return Util.loadClass(getClassName(), url, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public final String toString() {
|
|
||||||
return repId;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String createHashString(java.io.Serializable ser) {
|
|
||||||
|
|
||||||
return createHashString(ser.getClass());
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String createHashString(java.lang.Class clazz) {
|
|
||||||
|
|
||||||
if (clazz.isInterface() || !java.io.Serializable.class.isAssignableFrom(clazz))
|
|
||||||
return kInterfaceHashCode;
|
|
||||||
|
|
||||||
|
|
||||||
long actualLong = ObjectStreamClassUtil_1_3.computeStructuralUID(false, clazz);
|
|
||||||
String hash = null;
|
|
||||||
if (actualLong == 0)
|
|
||||||
hash = kInterfaceOnlyHashStr;
|
|
||||||
else if (actualLong == 1)
|
|
||||||
hash = kExternalizableHashStr;
|
|
||||||
else
|
|
||||||
hash = Long.toHexString(actualLong).toUpperCase();
|
|
||||||
while(hash.length() < 16){
|
|
||||||
hash = "0" + hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
long declaredLong = ObjectStreamClassUtil_1_3.computeSerialVersionUID(clazz);
|
|
||||||
String declared = null;
|
|
||||||
if (declaredLong == 0)
|
|
||||||
declared = kInterfaceOnlyHashStr;
|
|
||||||
else if (declaredLong == 1)
|
|
||||||
declared = kExternalizableHashStr;
|
|
||||||
else
|
|
||||||
declared = Long.toHexString(declaredLong).toUpperCase();
|
|
||||||
while (declared.length() < 16){
|
|
||||||
declared = "0" + declared;
|
|
||||||
}
|
|
||||||
hash = hash + ":" + declared;
|
|
||||||
|
|
||||||
return ":" + hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a repository ID for a sequence. This is for expert users only as
|
|
||||||
* this method assumes the object passed is an array. If passed an object
|
|
||||||
* that is not an array, it will produce a rep id for a sequence of zero
|
|
||||||
* length. This would be an error.
|
|
||||||
* @param ser The Java object to create a repository ID for
|
|
||||||
**/
|
|
||||||
public static String createSequenceRepID(java.lang.Object ser){
|
|
||||||
return createSequenceRepID(ser.getClass());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a repository ID for a sequence. This is for expert users only as
|
|
||||||
* this method assumes the object passed is an array. If passed an object
|
|
||||||
* that is not an array, it will produce a malformed rep id.
|
|
||||||
* @param clazz The Java class to create a repository ID for
|
|
||||||
**/
|
|
||||||
public static String createSequenceRepID(java.lang.Class clazz){
|
|
||||||
synchronized (classSeqToRepStr){
|
|
||||||
|
|
||||||
String repid = (String)classSeqToRepStr.get(clazz);
|
|
||||||
if (repid != null)
|
|
||||||
return repid;
|
|
||||||
|
|
||||||
Class originalClazz = clazz;
|
|
||||||
|
|
||||||
Class type = null;
|
|
||||||
int numOfDims = 0;
|
|
||||||
|
|
||||||
while ((type = clazz.getComponentType()) != null) {
|
|
||||||
numOfDims++;
|
|
||||||
clazz = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clazz.isPrimitive())
|
|
||||||
repid = kValuePrefix + originalClazz.getName() + kPrimitiveSequenceValueHash;
|
|
||||||
else {
|
|
||||||
StringBuffer buf = new StringBuffer();
|
|
||||||
buf.append(kValuePrefix);
|
|
||||||
while(numOfDims-- > 0) {
|
|
||||||
buf.append("[");
|
|
||||||
}
|
|
||||||
buf.append("L");
|
|
||||||
buf.append(convertToISOLatin1(clazz.getName()));
|
|
||||||
buf.append(";");
|
|
||||||
buf.append(createHashString(clazz));
|
|
||||||
repid = buf.toString();
|
|
||||||
}
|
|
||||||
classSeqToRepStr.put(originalClazz,repid);
|
|
||||||
return repid;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static String createForSpecialCase(java.lang.Class clazz){
|
|
||||||
if (clazz.isArray()){
|
|
||||||
return createSequenceRepID(clazz);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return (String)kSpecialCasesRepIDs.get(clazz);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String createForSpecialCase(java.io.Serializable ser){
|
|
||||||
Class clazz = ser.getClass();
|
|
||||||
if (clazz.isArray()){
|
|
||||||
return createSequenceRepID(ser);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return createForSpecialCase(clazz);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a repository ID for a normal Java Type.
|
|
||||||
* @param ser The Java object to create a repository ID for
|
|
||||||
* @exception com.sun.corba.se.impl.io.TypeMismatchException if ser implements the
|
|
||||||
* org.omg.CORBA.portable.IDLEntity interface which indicates it is an IDL Value type.
|
|
||||||
**/
|
|
||||||
public static String createForJavaType(java.io.Serializable ser)
|
|
||||||
throws com.sun.corba.se.impl.io.TypeMismatchException
|
|
||||||
{
|
|
||||||
synchronized (classToRepStr) {
|
|
||||||
String repid = createForSpecialCase(ser);
|
|
||||||
if (repid != null)
|
|
||||||
return repid;
|
|
||||||
Class clazz = ser.getClass();
|
|
||||||
repid = (String)classToRepStr.get(clazz);
|
|
||||||
|
|
||||||
if (repid != null)
|
|
||||||
return repid;
|
|
||||||
|
|
||||||
repid = kValuePrefix + convertToISOLatin1(clazz.getName()) +
|
|
||||||
createHashString(clazz);
|
|
||||||
|
|
||||||
classToRepStr.put(clazz, repid);
|
|
||||||
repStrToClass.put(repid, clazz);
|
|
||||||
return repid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a repository ID for a normal Java Type.
|
|
||||||
* @param clz The Java class to create a repository ID for
|
|
||||||
* @exception com.sun.corba.se.impl.io.TypeMismatchException if ser implements the
|
|
||||||
* org.omg.CORBA.portable.IDLEntity interface which indicates it is an IDL Value type.
|
|
||||||
**/
|
|
||||||
public static String createForJavaType(Class clz)
|
|
||||||
throws com.sun.corba.se.impl.io.TypeMismatchException
|
|
||||||
{
|
|
||||||
synchronized (classToRepStr){
|
|
||||||
String repid = createForSpecialCase(clz);
|
|
||||||
if (repid != null)
|
|
||||||
return repid;
|
|
||||||
|
|
||||||
repid = (String)classToRepStr.get(clz);
|
|
||||||
if (repid != null)
|
|
||||||
return repid;
|
|
||||||
|
|
||||||
repid = kValuePrefix + convertToISOLatin1(clz.getName()) +
|
|
||||||
createHashString(clz);
|
|
||||||
|
|
||||||
classToRepStr.put(clz, repid);
|
|
||||||
repStrToClass.put(repid, clz);
|
|
||||||
return repid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a repository ID for an IDL Java Type.
|
|
||||||
* @param ser The IDL Value object to create a repository ID for
|
|
||||||
* @param major The major version number
|
|
||||||
* @param minor The minor version number
|
|
||||||
* @exception com.sun.corba.se.impl.io.TypeMismatchException if ser does not implement the
|
|
||||||
* org.omg.CORBA.portable.IDLEntity interface which indicates it is an IDL Value type.
|
|
||||||
**/
|
|
||||||
public static String createForIDLType(Class ser, int major, int minor)
|
|
||||||
throws com.sun.corba.se.impl.io.TypeMismatchException
|
|
||||||
{
|
|
||||||
synchronized (classIDLToRepStr){
|
|
||||||
String repid = (String)classIDLToRepStr.get(ser);
|
|
||||||
if (repid != null)
|
|
||||||
return repid;
|
|
||||||
|
|
||||||
repid = kIDLPrefix + convertToISOLatin1(ser.getName()).replace('.','/') +
|
|
||||||
":" + major + "." + minor;
|
|
||||||
classIDLToRepStr.put(ser, repid);
|
|
||||||
return repid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String getIdFromHelper(Class clazz){
|
|
||||||
try {
|
|
||||||
Class helperClazz = Utility.loadClassForClass(clazz.getName()+"Helper", null,
|
|
||||||
clazz.getClassLoader(), clazz, clazz.getClassLoader());
|
|
||||||
Method idMethod = helperClazz.getDeclaredMethod("id", kNoParamTypes);
|
|
||||||
return (String)idMethod.invoke(null, kNoArgs);
|
|
||||||
}
|
|
||||||
catch(java.lang.ClassNotFoundException cnfe)
|
|
||||||
{
|
|
||||||
throw new org.omg.CORBA.MARSHAL(cnfe.toString());
|
|
||||||
}
|
|
||||||
catch(java.lang.NoSuchMethodException nsme)
|
|
||||||
{
|
|
||||||
throw new org.omg.CORBA.MARSHAL(nsme.toString());
|
|
||||||
}
|
|
||||||
catch(java.lang.reflect.InvocationTargetException ite)
|
|
||||||
{
|
|
||||||
throw new org.omg.CORBA.MARSHAL(ite.toString());
|
|
||||||
}
|
|
||||||
catch(java.lang.IllegalAccessException iae)
|
|
||||||
{
|
|
||||||
throw new org.omg.CORBA.MARSHAL(iae.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Createa a repository ID for the type if it is either a java type
|
|
||||||
* or an IDL type.
|
|
||||||
* @param type The type to create rep. id for
|
|
||||||
* @return The rep. id.
|
|
||||||
**/
|
|
||||||
public static String createForAnyType(Class type) {
|
|
||||||
try{
|
|
||||||
if (type.isArray())
|
|
||||||
return createSequenceRepID(type);
|
|
||||||
else if (IDLEntity.class.isAssignableFrom(type))
|
|
||||||
{
|
|
||||||
try{
|
|
||||||
return getIdFromHelper(type);
|
|
||||||
}
|
|
||||||
catch(Throwable t) {
|
|
||||||
return createForIDLType(type, 1, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else return createForJavaType(type);
|
|
||||||
}
|
|
||||||
catch(com.sun.corba.se.impl.io.TypeMismatchException e){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isAbstractBase(Class clazz) {
|
|
||||||
return (clazz.isInterface() &&
|
|
||||||
IDLEntity.class.isAssignableFrom(clazz) &&
|
|
||||||
(!ValueBase.class.isAssignableFrom(clazz)) &&
|
|
||||||
(!org.omg.CORBA.Object.class.isAssignableFrom(clazz)));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert strings with illegal IDL identifier characters.
|
|
||||||
* <p>
|
|
||||||
* Section 5.5.7 of OBV spec.
|
|
||||||
*/
|
|
||||||
private static String convertToISOLatin1 (String name) {
|
|
||||||
|
|
||||||
int length = name.length();
|
|
||||||
if (length == 0) {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
StringBuffer buffer = null;
|
|
||||||
|
|
||||||
for (int i = 0; i < length; i++) {
|
|
||||||
|
|
||||||
char c = name.charAt(i);
|
|
||||||
|
|
||||||
if (c > 255 || IDL_IDENTIFIER_CHARS[c] == 0) {
|
|
||||||
|
|
||||||
// We gotta convert. Have we already started?
|
|
||||||
|
|
||||||
if (buffer == null) {
|
|
||||||
|
|
||||||
// No, so get set up...
|
|
||||||
|
|
||||||
buffer = new StringBuffer(name.substring(0,i));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert the character into the IDL escape syntax...
|
|
||||||
buffer.append(
|
|
||||||
"\\U" +
|
|
||||||
(char)ASCII_HEX[(c & 0xF000) >>> 12] +
|
|
||||||
(char)ASCII_HEX[(c & 0x0F00) >>> 8] +
|
|
||||||
(char)ASCII_HEX[(c & 0x00F0) >>> 4] +
|
|
||||||
(char)ASCII_HEX[(c & 0x000F)]);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (buffer != null) {
|
|
||||||
buffer.append(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (buffer != null) {
|
|
||||||
name = buffer.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert strings with ISO Latin 1 escape sequences back to original strings.
|
|
||||||
* <p>
|
|
||||||
* Section 5.5.7 of OBV spec.
|
|
||||||
*/
|
|
||||||
private static String convertFromISOLatin1 (String name) {
|
|
||||||
|
|
||||||
int index = -1;
|
|
||||||
StringBuffer buf = new StringBuffer(name);
|
|
||||||
|
|
||||||
while ((index = buf.toString().indexOf("\\U")) != -1){
|
|
||||||
String str = "0000" + buf.toString().substring(index+2, index+6);
|
|
||||||
|
|
||||||
// Convert Hexadecimal
|
|
||||||
byte[] buffer = new byte[(str.length() - 4) / 2];
|
|
||||||
for (int i=4, j=0; i < str.length(); i +=2, j++) {
|
|
||||||
buffer[j] = (byte)((ORBUtility.hexOf(str.charAt(i)) << 4) & 0xF0);
|
|
||||||
buffer[j] |= (byte)((ORBUtility.hexOf(str.charAt(i+1)) << 0) & 0x0F);
|
|
||||||
}
|
|
||||||
buf = new StringBuffer(delete(buf.toString(), index, index+6));
|
|
||||||
buf.insert(index, (char)buffer[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return buf.toString();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String delete(String str, int from, int to)
|
|
||||||
{
|
|
||||||
return str.substring(0, from) + str.substring(to, str.length());
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String replace(String target, String arg, String source)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
i = target.indexOf(arg);
|
|
||||||
|
|
||||||
while(i != -1)
|
|
||||||
{
|
|
||||||
String left = target.substring(0, i);
|
|
||||||
String right = target.substring(i+arg.length());
|
|
||||||
target = new String(left+source+right);
|
|
||||||
i = target.indexOf(arg);
|
|
||||||
}
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Load a class and check that it is assignable to a given type.
|
|
||||||
* @param className the class name.
|
|
||||||
* @param remoteCodebase the codebase to use. May be null.
|
|
||||||
* @param loader the class loader of last resort. May be null.
|
|
||||||
* @param expectedType the expected type. May be null.
|
|
||||||
* @return the loaded class.
|
|
||||||
*/
|
|
||||||
private Class loadClassOfType (String className,
|
|
||||||
String remoteCodebase,
|
|
||||||
ClassLoader loader,
|
|
||||||
Class expectedType,
|
|
||||||
ClassLoader expectedTypeClassLoader)
|
|
||||||
throws ClassNotFoundException {
|
|
||||||
|
|
||||||
Class loadedClass = null;
|
|
||||||
|
|
||||||
try {
|
|
||||||
//Sequence finding of the stubs according to spec
|
|
||||||
try{
|
|
||||||
//If-else is put here for speed up of J2EE.
|
|
||||||
//According to the OMG spec, the if clause is not dead code.
|
|
||||||
//It can occur if some compiler has allowed generation
|
|
||||||
//into org.omg.stub hierarchy for non-offending
|
|
||||||
//classes. This will encourage people to
|
|
||||||
//produce non-offending class stubs in their own hierarchy.
|
|
||||||
if(!PackagePrefixChecker
|
|
||||||
.hasOffendingPrefix(PackagePrefixChecker
|
|
||||||
.withoutPackagePrefix(className))){
|
|
||||||
loadedClass = Util.loadClass
|
|
||||||
(PackagePrefixChecker.withoutPackagePrefix(className),
|
|
||||||
remoteCodebase,
|
|
||||||
loader);
|
|
||||||
} else {
|
|
||||||
loadedClass = Util.loadClass
|
|
||||||
(className,
|
|
||||||
remoteCodebase,
|
|
||||||
loader);
|
|
||||||
}
|
|
||||||
} catch (ClassNotFoundException cnfe) {
|
|
||||||
loadedClass = Util.loadClass
|
|
||||||
(className,
|
|
||||||
remoteCodebase,
|
|
||||||
loader);
|
|
||||||
}
|
|
||||||
if (expectedType == null)
|
|
||||||
return loadedClass;
|
|
||||||
} catch (ClassNotFoundException cnfe) {
|
|
||||||
if (expectedType == null)
|
|
||||||
throw cnfe;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If no class was not loaded, or if the loaded class is not of the
|
|
||||||
// correct type, make a further attempt to load the correct class
|
|
||||||
// using the classloader of the expected type.
|
|
||||||
// _REVISIT_ Is this step necessary, or should the Util,loadClass
|
|
||||||
// algorithm always produce a valid class if the setup is correct?
|
|
||||||
// Does the OMG standard algorithm need to be changed to include
|
|
||||||
// this step?
|
|
||||||
if (loadedClass == null || !expectedType.isAssignableFrom(loadedClass)) {
|
|
||||||
if (expectedType.getClassLoader() != expectedTypeClassLoader)
|
|
||||||
throw new IllegalArgumentException("expectedTypeClassLoader not class loader of expectedType.");
|
|
||||||
|
|
||||||
if (expectedTypeClassLoader != null)
|
|
||||||
loadedClass = expectedTypeClassLoader.loadClass(className);
|
|
||||||
else
|
|
||||||
loadedClass = ORBClassLoader.loadClass(className);
|
|
||||||
}
|
|
||||||
|
|
||||||
return loadedClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks to see if the FullValueDescription should be retrieved.
|
|
||||||
* @exception Throws IOException if suids do not match or if the repositoryID
|
|
||||||
* is not an RMIValueType
|
|
||||||
*/
|
|
||||||
public static boolean useFullValueDescription(Class clazz, String repositoryID)
|
|
||||||
throws IOException{
|
|
||||||
|
|
||||||
String clazzRepIDStr = createForAnyType(clazz);
|
|
||||||
|
|
||||||
if (clazzRepIDStr.equals(repositoryID))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
RepositoryId_1_3 targetRepid;
|
|
||||||
RepositoryId_1_3 clazzRepid;
|
|
||||||
|
|
||||||
synchronized(cache) {
|
|
||||||
// to avoid race condition where multiple threads could be
|
|
||||||
// accessing this method, and their access to the cache may
|
|
||||||
// be interleaved giving unexpected results
|
|
||||||
|
|
||||||
targetRepid = cache.getId(repositoryID);
|
|
||||||
clazzRepid = cache.getId(clazzRepIDStr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((targetRepid.isRMIValueType()) && (clazzRepid.isRMIValueType())){
|
|
||||||
if (!targetRepid.getSerialVersionUID().equals(clazzRepid.getSerialVersionUID())) {
|
|
||||||
|
|
||||||
String mssg = "Mismatched serialization UIDs : Source (Rep. ID" +
|
|
||||||
clazzRepid + ") = " +
|
|
||||||
clazzRepid.getSerialVersionUID() + " whereas Target (Rep. ID " + repositoryID +
|
|
||||||
") = " + targetRepid.getSerialVersionUID();
|
|
||||||
throw new IOException(mssg);
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
throw new IOException("The repository ID is not of an RMI value type (Expected ID = " + clazzRepIDStr + "; Received ID = " + repositoryID +")");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -1,251 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2000, 2003, 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.
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* Licensed Materials - Property of IBM
|
|
||||||
* RMI-IIOP v1.0
|
|
||||||
* Copyright IBM Corp. 1998 1999 All Rights Reserved
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sun.corba.se.impl.orbutil;
|
|
||||||
|
|
||||||
import javax.rmi.CORBA.Util;
|
|
||||||
import javax.rmi.PortableRemoteObject;
|
|
||||||
|
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.util.Stack;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.EmptyStackException;
|
|
||||||
|
|
||||||
import com.sun.corba.se.impl.util.Utility;
|
|
||||||
import com.sun.corba.se.impl.io.IIOPInputStream;
|
|
||||||
import com.sun.corba.se.impl.io.IIOPOutputStream;
|
|
||||||
import com.sun.corba.se.impl.util.RepositoryId;
|
|
||||||
import com.sun.corba.se.impl.util.Utility;
|
|
||||||
|
|
||||||
import org.omg.CORBA.TCKind;
|
|
||||||
import org.omg.CORBA.MARSHAL;
|
|
||||||
import org.omg.CORBA.CompletionStatus;
|
|
||||||
import org.omg.CORBA.portable.IndirectionException;
|
|
||||||
import com.sun.org.omg.SendingContext.CodeBase;
|
|
||||||
|
|
||||||
import java.security.AccessController;
|
|
||||||
import java.security.PrivilegedAction;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class overrides behavior of our current ValueHandlerImpl to
|
|
||||||
* provide backwards compatibility with JDK 1.3.0.
|
|
||||||
*/
|
|
||||||
public class ValueHandlerImpl_1_3 extends com.sun.corba.se.impl.io.ValueHandlerImpl {
|
|
||||||
|
|
||||||
public ValueHandlerImpl_1_3(){
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ValueHandlerImpl_1_3(boolean isInputStream) {
|
|
||||||
super(isInputStream);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes the value to the stream using java semantics.
|
|
||||||
* @param out The stream to write the value to
|
|
||||||
* @param value The value to be written to the stream
|
|
||||||
**/
|
|
||||||
public void writeValue(org.omg.CORBA.portable.OutputStream _out, java.io.Serializable value) {
|
|
||||||
super.writeValue(_out, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reads a value from the stream using java semantics.
|
|
||||||
* @param in The stream to read the value from
|
|
||||||
* @param clazz The type of the value to be read in
|
|
||||||
* @param sender The sending context runtime
|
|
||||||
**/
|
|
||||||
public java.io.Serializable readValue(org.omg.CORBA.portable.InputStream _in,
|
|
||||||
int offset,
|
|
||||||
java.lang.Class clazz,
|
|
||||||
String repositoryID,
|
|
||||||
org.omg.SendingContext.RunTime _sender)
|
|
||||||
{
|
|
||||||
return super.readValue(_in, offset, clazz, repositoryID, _sender);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the repository ID for the given RMI value Class.
|
|
||||||
* @param clz The class to return a repository ID for.
|
|
||||||
* @return the repository ID of the Class.
|
|
||||||
**/
|
|
||||||
public java.lang.String getRMIRepositoryID(java.lang.Class clz) {
|
|
||||||
return RepositoryId_1_3.createForJavaType(clz);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether the given Class performs custom or
|
|
||||||
* default marshaling.
|
|
||||||
* @param clz The class to test for custom marshaling.
|
|
||||||
* @return True if the class performs custom marshaling, false
|
|
||||||
* if it does not.
|
|
||||||
**/
|
|
||||||
public boolean isCustomMarshaled(java.lang.Class clz) {
|
|
||||||
return super.isCustomMarshaled(clz);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the CodeBase for this ValueHandler. This is used by
|
|
||||||
* the ORB runtime. The server sends the service context containing
|
|
||||||
* the IOR for this CodeBase on the first GIOP reply. The clients
|
|
||||||
* do the same on the first GIOP request.
|
|
||||||
* @return the SendingContext.CodeBase of this ValueHandler.
|
|
||||||
**/
|
|
||||||
public org.omg.SendingContext.RunTime getRunTimeCodeBase() {
|
|
||||||
return super.getRunTimeCodeBase();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If the value contains a writeReplace method then the result
|
|
||||||
* is returned. Otherwise, the value itself is returned.
|
|
||||||
* @return the true value to marshal on the wire.
|
|
||||||
**/
|
|
||||||
public java.io.Serializable writeReplace(java.io.Serializable value) {
|
|
||||||
return super.writeReplace(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods supported for backward compatability so that the appropriate
|
|
||||||
// Rep-id calculations take place based on the ORB version
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a boolean of whether or not RepositoryId indicates
|
|
||||||
* FullValueDescriptor.
|
|
||||||
* used for backward compatability
|
|
||||||
*/
|
|
||||||
|
|
||||||
public boolean useFullValueDescription(Class clazz, String repositoryID)
|
|
||||||
throws IOException
|
|
||||||
|
|
||||||
{
|
|
||||||
return RepositoryId_1_3.useFullValueDescription(clazz, repositoryID);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClassName(String id)
|
|
||||||
{
|
|
||||||
RepositoryId_1_3 repID = RepositoryId_1_3.cache.getId(id);
|
|
||||||
return repID.getClassName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Class getClassFromType(String id)
|
|
||||||
throws ClassNotFoundException
|
|
||||||
{
|
|
||||||
RepositoryId_1_3 repId = RepositoryId_1_3.cache.getId(id);
|
|
||||||
return repId.getClassFromType();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Class getAnyClassFromType(String id)
|
|
||||||
throws ClassNotFoundException
|
|
||||||
{
|
|
||||||
RepositoryId_1_3 repId = RepositoryId_1_3.cache.getId(id);
|
|
||||||
return repId.getAnyClassFromType();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String createForAnyType(Class cl)
|
|
||||||
{
|
|
||||||
return RepositoryId_1_3.createForAnyType(cl);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefinedInId(String id)
|
|
||||||
{
|
|
||||||
RepositoryId_1_3 repId = RepositoryId_1_3.cache.getId(id);
|
|
||||||
return repId.getDefinedInId();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUnqualifiedName(String id)
|
|
||||||
{
|
|
||||||
RepositoryId_1_3 repId = RepositoryId_1_3.cache.getId(id);
|
|
||||||
return repId.getUnqualifiedName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSerialVersionUID(String id)
|
|
||||||
{
|
|
||||||
RepositoryId_1_3 repId = RepositoryId_1_3.cache.getId(id);
|
|
||||||
return repId.getSerialVersionUID();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isAbstractBase(Class clazz)
|
|
||||||
{
|
|
||||||
return RepositoryId_1_3.isAbstractBase(clazz);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSequence(String id)
|
|
||||||
{
|
|
||||||
RepositoryId_1_3 repId = RepositoryId_1_3.cache.getId(id);
|
|
||||||
return repId.isSequence();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Preserves the incorrect 1.3 behavior which truncates Java chars in
|
|
||||||
* arrays to 8-bit CORBA chars. Bug 4367783. This enables us to
|
|
||||||
* continue interoperating with our legacy ORBs. If this goes into
|
|
||||||
* Ladybird, then Ladybird and Kestrel will interoperate as long as
|
|
||||||
* people don't use chars greater than 8-bits.
|
|
||||||
*/
|
|
||||||
protected void writeCharArray(org.omg.CORBA_2_3.portable.OutputStream out,
|
|
||||||
char[] array,
|
|
||||||
int offset,
|
|
||||||
int length)
|
|
||||||
{
|
|
||||||
out.write_char_array(array, offset, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Preserves the incorrect 1.3 behavior which truncates Java chars in
|
|
||||||
* arrays to 8-bit CORBA chars. Bug 4367783. This enables us to
|
|
||||||
* continue interoperating with our legacy ORBs. If this goes into
|
|
||||||
* Ladybird, then Ladybird and Kestrel will interoperate as long as
|
|
||||||
* people don't use chars greater than 8-bits.
|
|
||||||
*/
|
|
||||||
protected void readCharArray(org.omg.CORBA_2_3.portable.InputStream in,
|
|
||||||
char[] array,
|
|
||||||
int offset,
|
|
||||||
int length)
|
|
||||||
{
|
|
||||||
in.read_char_array(array, offset, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected final String getOutputStreamClassName() {
|
|
||||||
return "com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected final String getInputStreamClassName() {
|
|
||||||
return "com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Our JDK 1.3 and JDK 1.3.1 behavior subclasses override this.
|
|
||||||
* The correct behavior is for a Java char to map to a CORBA wchar,
|
|
||||||
* but our older code mapped it to a CORBA char.
|
|
||||||
*/
|
|
||||||
protected TCKind getJavaCharTCKind() {
|
|
||||||
return TCKind.tk_char;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,77 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation. Oracle designates this
|
|
||||||
* particular file as subject to the "Classpath" exception as provided
|
|
||||||
* by Oracle in the LICENSE file that accompanied this code.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
package com.sun.corba.se.impl.orbutil;
|
|
||||||
|
|
||||||
import org.omg.CORBA.TCKind;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class overrides behavior of our current ValueHandlerImpl to
|
|
||||||
* provide backwards compatibility with JDK 1.3.1.
|
|
||||||
*/
|
|
||||||
public class ValueHandlerImpl_1_3_1
|
|
||||||
extends com.sun.corba.se.impl.io.ValueHandlerImpl
|
|
||||||
{
|
|
||||||
public ValueHandlerImpl_1_3_1() {}
|
|
||||||
|
|
||||||
public ValueHandlerImpl_1_3_1(boolean isInputStream) {
|
|
||||||
super(isInputStream);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Our JDK 1.3 and JDK 1.3.1 behavior subclasses override this.
|
|
||||||
* The correct behavior is for a Java char to map to a CORBA wchar,
|
|
||||||
* but our older code mapped it to a CORBA char.
|
|
||||||
*/
|
|
||||||
protected TCKind getJavaCharTCKind() {
|
|
||||||
return TCKind.tk_char;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* RepositoryId_1_3_1 performs an incorrect repId calculation
|
|
||||||
* when using serialPersistentFields and one of the fields no longer
|
|
||||||
* exists on the class itself.
|
|
||||||
*/
|
|
||||||
public boolean useFullValueDescription(Class clazz, String repositoryID)
|
|
||||||
throws java.io.IOException
|
|
||||||
{
|
|
||||||
return RepositoryId_1_3_1.useFullValueDescription(clazz, repositoryID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Installs the legacy IIOPOutputStream_1_3_1 which does
|
|
||||||
* PutFields/GetFields incorrectly. Bug 4407244.
|
|
||||||
*/
|
|
||||||
protected final String getOutputStreamClassName() {
|
|
||||||
return "com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3_1";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Installs the legacy IIOPInputStream_1_3_1 which does
|
|
||||||
* PutFields/GetFields incorrectly. Bug 4407244.
|
|
||||||
*/
|
|
||||||
protected final String getInputStreamClassName() {
|
|
||||||
return "com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3_1";
|
|
||||||
}
|
|
||||||
}
|
|
@ -98,6 +98,7 @@ import com.sun.corba.se.impl.logging.OMGSystemException ;
|
|||||||
import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl ;
|
import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl ;
|
||||||
|
|
||||||
import com.sun.corba.se.impl.orbutil.ORBClassLoader ;
|
import com.sun.corba.se.impl.orbutil.ORBClassLoader ;
|
||||||
|
import sun.awt.AppContext;
|
||||||
|
|
||||||
public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
||||||
implements Broker, TypeCodeFactory
|
implements Broker, TypeCodeFactory
|
||||||
@ -173,14 +174,7 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
|||||||
|
|
||||||
protected MonitoringManager monitoringManager;
|
protected MonitoringManager monitoringManager;
|
||||||
|
|
||||||
// There is only one instance of the PresentationManager
|
private static PresentationManager setupPresentationManager() {
|
||||||
// that is shared between all ORBs. This is necessary
|
|
||||||
// because RMI-IIOP requires the PresentationManager in
|
|
||||||
// places where no ORB is available, so the PresentationManager
|
|
||||||
// must be global. It is initialized here as well.
|
|
||||||
protected static PresentationManager globalPM = null ;
|
|
||||||
|
|
||||||
static {
|
|
||||||
staticWrapper = ORBUtilSystemException.get(
|
staticWrapper = ORBUtilSystemException.get(
|
||||||
CORBALogDomains.RPC_PRESENTATION ) ;
|
CORBALogDomains.RPC_PRESENTATION ) ;
|
||||||
|
|
||||||
@ -220,10 +214,11 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
|||||||
}
|
}
|
||||||
) ;
|
) ;
|
||||||
|
|
||||||
globalPM = new PresentationManagerImpl( useDynamicStub ) ;
|
PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
|
||||||
globalPM.setStubFactoryFactory( false,
|
pm.setStubFactoryFactory( false,
|
||||||
PresentationDefaults.getStaticStubFactoryFactory() ) ;
|
PresentationDefaults.getStaticStubFactoryFactory() ) ;
|
||||||
globalPM.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
|
pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
|
||||||
|
return pm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
@ -234,11 +229,19 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
|||||||
byteBufferPool = null;
|
byteBufferPool = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get the single instance of the PresentationManager
|
/**
|
||||||
|
* Returns the Presentation Manager for the current thread group, using the ThreadGroup-specific
|
||||||
|
* AppContext to hold it. Creates and records one if needed.
|
||||||
*/
|
*/
|
||||||
public static PresentationManager getPresentationManager()
|
public static PresentationManager getPresentationManager()
|
||||||
{
|
{
|
||||||
return globalPM ;
|
AppContext ac = AppContext.getAppContext();
|
||||||
|
PresentationManager pm = (PresentationManager) ac.get(PresentationManager.class);
|
||||||
|
if (pm == null) {
|
||||||
|
pm = setupPresentationManager();
|
||||||
|
ac.put(PresentationManager.class, pm);
|
||||||
|
}
|
||||||
|
return pm;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get the appropriate StubFactoryFactory. This
|
/** Get the appropriate StubFactoryFactory. This
|
||||||
@ -248,8 +251,9 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
|||||||
public static PresentationManager.StubFactoryFactory
|
public static PresentationManager.StubFactoryFactory
|
||||||
getStubFactoryFactory()
|
getStubFactoryFactory()
|
||||||
{
|
{
|
||||||
boolean useDynamicStubs = globalPM.useDynamicStubs() ;
|
PresentationManager gPM = getPresentationManager();
|
||||||
return globalPM.getStubFactoryFactory( useDynamicStubs ) ;
|
boolean useDynamicStubs = gPM.useDynamicStubs() ;
|
||||||
|
return gPM.getStubFactoryFactory( useDynamicStubs ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ORB()
|
protected ORB()
|
||||||
|
32
corba/src/share/classes/sun/corba/JavaCorbaAccess.java
Normal file
32
corba/src/share/classes/sun/corba/JavaCorbaAccess.java
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package sun.corba;
|
||||||
|
|
||||||
|
import com.sun.corba.se.impl.io.ValueHandlerImpl;
|
||||||
|
|
||||||
|
public interface JavaCorbaAccess {
|
||||||
|
public ValueHandlerImpl newValueHandlerImpl();
|
||||||
|
}
|
60
corba/src/share/classes/sun/corba/SharedSecrets.java
Normal file
60
corba/src/share/classes/sun/corba/SharedSecrets.java
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package sun.corba;
|
||||||
|
|
||||||
|
import com.sun.corba.se.impl.io.ValueUtility;
|
||||||
|
import sun.misc.Unsafe;
|
||||||
|
|
||||||
|
import java.security.AccessController;
|
||||||
|
|
||||||
|
/** A repository of "shared secrets", which are a mechanism for
|
||||||
|
calling implementation-private methods in another package without
|
||||||
|
using reflection. A package-private class implements a public
|
||||||
|
interface and provides the ability to call package-private methods
|
||||||
|
within that package; the object implementing that interface is
|
||||||
|
provided through a third package to which access is restricted.
|
||||||
|
This framework avoids the primary disadvantage of using reflection
|
||||||
|
for this purpose, namely the loss of compile-time checking. */
|
||||||
|
|
||||||
|
// SharedSecrets cloned in corba repo to avoid build issues
|
||||||
|
public class SharedSecrets {
|
||||||
|
private static final Unsafe unsafe = Unsafe.getUnsafe();
|
||||||
|
private static JavaCorbaAccess javaCorbaAccess;
|
||||||
|
|
||||||
|
public static JavaCorbaAccess getJavaCorbaAccess() {
|
||||||
|
if (javaCorbaAccess == null) {
|
||||||
|
// Ensure ValueUtility is initialized; we know that that class
|
||||||
|
// provides the shared secret
|
||||||
|
unsafe.ensureClassInitialized(ValueUtility.class);
|
||||||
|
}
|
||||||
|
return javaCorbaAccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setJavaCorbaAccess(JavaCorbaAccess access) {
|
||||||
|
javaCorbaAccess = access;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -322,3 +322,5 @@ d5e12e7d2f719144d84903d9151455661c47b476 jdk8-b78
|
|||||||
df5396524152118535c36da5801d828b560d19a2 hs25-b21
|
df5396524152118535c36da5801d828b560d19a2 hs25-b21
|
||||||
4a198b201f3ce84433fa94a3ca65d061473e7c4c jdk8-b80
|
4a198b201f3ce84433fa94a3ca65d061473e7c4c jdk8-b80
|
||||||
dd6350b4abc4a6c19c89dd982cc0e4f3d119885c hs25-b22
|
dd6350b4abc4a6c19c89dd982cc0e4f3d119885c hs25-b22
|
||||||
|
65b797426a3bec6e91b64085a0cfb94adadb634a jdk8-b81
|
||||||
|
0631ebcc45f05c73b09a56c2586685af1f781c1d hs25-b23
|
||||||
|
@ -132,12 +132,12 @@ static map_info* add_map_info(struct ps_prochandle* ph, int fd, off_t offset,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Part of the class sharing workaround
|
// Part of the class sharing workaround
|
||||||
static map_info* add_class_share_map_info(struct ps_prochandle* ph, off_t offset,
|
static void add_class_share_map_info(struct ps_prochandle* ph, off_t offset,
|
||||||
uintptr_t vaddr, size_t memsz) {
|
uintptr_t vaddr, size_t memsz) {
|
||||||
map_info* map;
|
map_info* map;
|
||||||
if ((map = allocate_init_map(ph->core->classes_jsa_fd,
|
if ((map = allocate_init_map(ph->core->classes_jsa_fd,
|
||||||
offset, vaddr, memsz)) == NULL) {
|
offset, vaddr, memsz)) == NULL) {
|
||||||
return NULL;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
map->next = ph->core->class_share_maps;
|
map->next = ph->core->class_share_maps;
|
||||||
|
@ -168,12 +168,12 @@ endif
|
|||||||
# conversions which might affect the values. To avoid that, we need to turn
|
# conversions which might affect the values. To avoid that, we need to turn
|
||||||
# it off explicitly.
|
# it off explicitly.
|
||||||
ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
|
ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
|
||||||
ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare
|
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
|
||||||
else
|
else
|
||||||
ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
|
WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS)
|
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
|
||||||
# Special cases
|
# Special cases
|
||||||
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
|
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
|
||||||
# XXXDARWIN: for _dyld_bind_fully_image_containing_address
|
# XXXDARWIN: for _dyld_bind_fully_image_containing_address
|
||||||
|
@ -69,7 +69,7 @@ ifeq ($(INCLUDE_CDS), false)
|
|||||||
CXXFLAGS += -DINCLUDE_CDS=0
|
CXXFLAGS += -DINCLUDE_CDS=0
|
||||||
CFLAGS += -DINCLUDE_CDS=0
|
CFLAGS += -DINCLUDE_CDS=0
|
||||||
|
|
||||||
Src_Files_EXCLUDE += metaspaceShared.cpp
|
Src_Files_EXCLUDE += filemap.cpp metaspaceShared.cpp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(INCLUDE_ALL_GCS), false)
|
ifeq ($(INCLUDE_ALL_GCS), false)
|
||||||
|
@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013
|
|||||||
|
|
||||||
HS_MAJOR_VER=25
|
HS_MAJOR_VER=25
|
||||||
HS_MINOR_VER=0
|
HS_MINOR_VER=0
|
||||||
HS_BUILD_NUMBER=22
|
HS_BUILD_NUMBER=23
|
||||||
|
|
||||||
JDK_MAJOR_VER=1
|
JDK_MAJOR_VER=1
|
||||||
JDK_MINOR_VER=8
|
JDK_MINOR_VER=8
|
||||||
|
@ -131,12 +131,12 @@ WARNINGS_ARE_ERRORS = -Werror
|
|||||||
# conversions which might affect the values. To avoid that, we need to turn
|
# conversions which might affect the values. To avoid that, we need to turn
|
||||||
# it off explicitly.
|
# it off explicitly.
|
||||||
ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
|
ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
|
||||||
ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare
|
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
|
||||||
else
|
else
|
||||||
ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
|
WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS)
|
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
|
||||||
# Special cases
|
# Special cases
|
||||||
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
|
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
|
||||||
|
|
||||||
|
@ -118,8 +118,8 @@ endif
|
|||||||
# Compiler warnings are treated as errors
|
# Compiler warnings are treated as errors
|
||||||
WARNINGS_ARE_ERRORS = -Werror
|
WARNINGS_ARE_ERRORS = -Werror
|
||||||
# Enable these warnings. See 'info gcc' about details on these options
|
# Enable these warnings. See 'info gcc' about details on these options
|
||||||
ADDITIONAL_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
|
WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
|
||||||
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ADDITIONAL_WARNINGS)
|
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
|
||||||
# Special cases
|
# Special cases
|
||||||
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
|
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
|
||||||
|
|
||||||
|
@ -2194,7 +2194,8 @@ int AbstractInterpreter::layout_activation(Method* method,
|
|||||||
int callee_locals_size,
|
int callee_locals_size,
|
||||||
frame* caller,
|
frame* caller,
|
||||||
frame* interpreter_frame,
|
frame* interpreter_frame,
|
||||||
bool is_top_frame) {
|
bool is_top_frame,
|
||||||
|
bool is_bottom_frame) {
|
||||||
|
|
||||||
assert(popframe_extra_args == 0, "NEED TO FIX");
|
assert(popframe_extra_args == 0, "NEED TO FIX");
|
||||||
// NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state()
|
// NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state()
|
||||||
|
@ -1581,7 +1581,8 @@ int AbstractInterpreter::layout_activation(Method* method,
|
|||||||
int callee_local_count,
|
int callee_local_count,
|
||||||
frame* caller,
|
frame* caller,
|
||||||
frame* interpreter_frame,
|
frame* interpreter_frame,
|
||||||
bool is_top_frame) {
|
bool is_top_frame,
|
||||||
|
bool is_bottom_frame) {
|
||||||
// Note: This calculation must exactly parallel the frame setup
|
// Note: This calculation must exactly parallel the frame setup
|
||||||
// in InterpreterGenerator::generate_fixed_frame.
|
// in InterpreterGenerator::generate_fixed_frame.
|
||||||
// If f!=NULL, set up the following variables:
|
// If f!=NULL, set up the following variables:
|
||||||
@ -1664,6 +1665,15 @@ int AbstractInterpreter::layout_activation(Method* method,
|
|||||||
int delta = local_words - parm_words;
|
int delta = local_words - parm_words;
|
||||||
int computed_sp_adjustment = (delta > 0) ? round_to(delta, WordsPerLong) : 0;
|
int computed_sp_adjustment = (delta > 0) ? round_to(delta, WordsPerLong) : 0;
|
||||||
*interpreter_frame->register_addr(I5_savedSP) = (intptr_t) (fp + computed_sp_adjustment) - STACK_BIAS;
|
*interpreter_frame->register_addr(I5_savedSP) = (intptr_t) (fp + computed_sp_adjustment) - STACK_BIAS;
|
||||||
|
if (!is_bottom_frame) {
|
||||||
|
// Llast_SP is set below for the current frame to SP (with the
|
||||||
|
// extra space for the callee's locals). Here we adjust
|
||||||
|
// Llast_SP for the caller's frame, removing the extra space
|
||||||
|
// for the current method's locals.
|
||||||
|
*caller->register_addr(Llast_SP) = *interpreter_frame->register_addr(I5_savedSP);
|
||||||
|
} else {
|
||||||
|
assert(*caller->register_addr(Llast_SP) >= *interpreter_frame->register_addr(I5_savedSP), "strange Llast_SP");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
assert(caller->is_compiled_frame() || caller->is_entry_frame(), "only possible cases");
|
assert(caller->is_compiled_frame() || caller->is_entry_frame(), "only possible cases");
|
||||||
// Don't have Lesp available; lay out locals block in the caller
|
// Don't have Lesp available; lay out locals block in the caller
|
||||||
|
@ -2361,7 +2361,8 @@ int AbstractInterpreter::layout_activation(Method* method,
|
|||||||
int callee_locals,
|
int callee_locals,
|
||||||
frame* caller,
|
frame* caller,
|
||||||
frame* interpreter_frame,
|
frame* interpreter_frame,
|
||||||
bool is_top_frame) {
|
bool is_top_frame,
|
||||||
|
bool is_bottom_frame) {
|
||||||
|
|
||||||
assert(popframe_extra_args == 0, "FIX ME");
|
assert(popframe_extra_args == 0, "FIX ME");
|
||||||
// NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state()
|
// NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state()
|
||||||
|
@ -356,7 +356,7 @@ frame frame::sender_for_entry_frame(RegisterMap* map) const {
|
|||||||
// Verifies the calculated original PC of a deoptimization PC for the
|
// Verifies the calculated original PC of a deoptimization PC for the
|
||||||
// given unextended SP. The unextended SP might also be the saved SP
|
// given unextended SP. The unextended SP might also be the saved SP
|
||||||
// for MethodHandle call sites.
|
// for MethodHandle call sites.
|
||||||
#if ASSERT
|
#ifdef ASSERT
|
||||||
void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return) {
|
void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return) {
|
||||||
frame fr;
|
frame fr;
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@
|
|||||||
return (intptr_t*) addr_at(offset);
|
return (intptr_t*) addr_at(offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ASSERT
|
#ifdef ASSERT
|
||||||
// Used in frame::sender_for_{interpreter,compiled}_frame
|
// Used in frame::sender_for_{interpreter,compiled}_frame
|
||||||
static void verify_deopt_original_pc( nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return = false);
|
static void verify_deopt_original_pc( nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return = false);
|
||||||
static void verify_deopt_mh_original_pc(nmethod* nm, intptr_t* unextended_sp) {
|
static void verify_deopt_mh_original_pc(nmethod* nm, intptr_t* unextended_sp) {
|
||||||
|
@ -1585,7 +1585,8 @@ int AbstractInterpreter::layout_activation(Method* method,
|
|||||||
int callee_locals,
|
int callee_locals,
|
||||||
frame* caller,
|
frame* caller,
|
||||||
frame* interpreter_frame,
|
frame* interpreter_frame,
|
||||||
bool is_top_frame) {
|
bool is_top_frame,
|
||||||
|
bool is_bottom_frame) {
|
||||||
// Note: This calculation must exactly parallel the frame setup
|
// Note: This calculation must exactly parallel the frame setup
|
||||||
// in AbstractInterpreterGenerator::generate_method_entry.
|
// in AbstractInterpreterGenerator::generate_method_entry.
|
||||||
// If interpreter_frame!=NULL, set up the method, locals, and monitors.
|
// If interpreter_frame!=NULL, set up the method, locals, and monitors.
|
||||||
|
@ -1599,7 +1599,8 @@ int AbstractInterpreter::layout_activation(Method* method,
|
|||||||
int callee_locals,
|
int callee_locals,
|
||||||
frame* caller,
|
frame* caller,
|
||||||
frame* interpreter_frame,
|
frame* interpreter_frame,
|
||||||
bool is_top_frame) {
|
bool is_top_frame,
|
||||||
|
bool is_bottom_frame) {
|
||||||
// Note: This calculation must exactly parallel the frame setup
|
// Note: This calculation must exactly parallel the frame setup
|
||||||
// in AbstractInterpreterGenerator::generate_method_entry.
|
// in AbstractInterpreterGenerator::generate_method_entry.
|
||||||
// If interpreter_frame!=NULL, set up the method, locals, and monitors.
|
// If interpreter_frame!=NULL, set up the method, locals, and monitors.
|
||||||
|
@ -919,7 +919,8 @@ int AbstractInterpreter::layout_activation(Method* method,
|
|||||||
int callee_locals,
|
int callee_locals,
|
||||||
frame* caller,
|
frame* caller,
|
||||||
frame* interpreter_frame,
|
frame* interpreter_frame,
|
||||||
bool is_top_frame) {
|
bool is_top_frame,
|
||||||
|
bool is_bottom_frame) {
|
||||||
assert(popframe_extra_args == 0, "what to do?");
|
assert(popframe_extra_args == 0, "what to do?");
|
||||||
assert(!is_top_frame || (!callee_locals && !callee_param_count),
|
assert(!is_top_frame || (!callee_locals && !callee_param_count),
|
||||||
"top frame should have no caller");
|
"top frame should have no caller");
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
#include "runtime/threadCritical.hpp"
|
#include "runtime/threadCritical.hpp"
|
||||||
#include "runtime/timer.hpp"
|
#include "runtime/timer.hpp"
|
||||||
#include "services/attachListener.hpp"
|
#include "services/attachListener.hpp"
|
||||||
|
#include "services/memTracker.hpp"
|
||||||
#include "services/runtimeService.hpp"
|
#include "services/runtimeService.hpp"
|
||||||
#include "utilities/decoder.hpp"
|
#include "utilities/decoder.hpp"
|
||||||
#include "utilities/defaultStream.hpp"
|
#include "utilities/defaultStream.hpp"
|
||||||
@ -2275,13 +2276,25 @@ char* os::reserve_memory_special(size_t bytes, char* req_addr, bool exec) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The memory is committed
|
||||||
|
address pc = CALLER_PC;
|
||||||
|
MemTracker::record_virtual_memory_reserve((address)addr, bytes, pc);
|
||||||
|
MemTracker::record_virtual_memory_commit((address)addr, bytes, pc);
|
||||||
|
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::release_memory_special(char* base, size_t bytes) {
|
bool os::release_memory_special(char* base, size_t bytes) {
|
||||||
// detaching the SHM segment will also delete it, see reserve_memory_special()
|
// detaching the SHM segment will also delete it, see reserve_memory_special()
|
||||||
int rslt = shmdt(base);
|
int rslt = shmdt(base);
|
||||||
return rslt == 0;
|
if (rslt == 0) {
|
||||||
|
MemTracker::record_virtual_memory_uncommit((address)base, bytes);
|
||||||
|
MemTracker::record_virtual_memory_release((address)base, bytes);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t os::large_page_size() {
|
size_t os::large_page_size() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -40,6 +40,9 @@
|
|||||||
product(bool, UseHugeTLBFS, false, \
|
product(bool, UseHugeTLBFS, false, \
|
||||||
"Use MAP_HUGETLB for large pages") \
|
"Use MAP_HUGETLB for large pages") \
|
||||||
\
|
\
|
||||||
|
product(bool, LoadExecStackDllInVMThread, true, \
|
||||||
|
"Load DLLs with executable-stack attribute in the VM Thread") \
|
||||||
|
\
|
||||||
product(bool, UseSHM, false, \
|
product(bool, UseSHM, false, \
|
||||||
"Use SYSV shared memory for large pages")
|
"Use SYSV shared memory for large pages")
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include "runtime/extendedPC.hpp"
|
#include "runtime/extendedPC.hpp"
|
||||||
#include "runtime/globals.hpp"
|
#include "runtime/globals.hpp"
|
||||||
#include "runtime/interfaceSupport.hpp"
|
#include "runtime/interfaceSupport.hpp"
|
||||||
|
#include "runtime/init.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
#include "runtime/javaCalls.hpp"
|
#include "runtime/javaCalls.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
@ -57,10 +58,12 @@
|
|||||||
#include "runtime/threadCritical.hpp"
|
#include "runtime/threadCritical.hpp"
|
||||||
#include "runtime/timer.hpp"
|
#include "runtime/timer.hpp"
|
||||||
#include "services/attachListener.hpp"
|
#include "services/attachListener.hpp"
|
||||||
|
#include "services/memTracker.hpp"
|
||||||
#include "services/runtimeService.hpp"
|
#include "services/runtimeService.hpp"
|
||||||
#include "utilities/decoder.hpp"
|
#include "utilities/decoder.hpp"
|
||||||
#include "utilities/defaultStream.hpp"
|
#include "utilities/defaultStream.hpp"
|
||||||
#include "utilities/events.hpp"
|
#include "utilities/events.hpp"
|
||||||
|
#include "utilities/elfFile.hpp"
|
||||||
#include "utilities/growableArray.hpp"
|
#include "utilities/growableArray.hpp"
|
||||||
#include "utilities/vmError.hpp"
|
#include "utilities/vmError.hpp"
|
||||||
|
|
||||||
@ -1796,9 +1799,93 @@ bool os::dll_address_to_library_name(address addr, char* buf,
|
|||||||
// in case of error it checks if .dll/.so was built for the
|
// in case of error it checks if .dll/.so was built for the
|
||||||
// same architecture as Hotspot is running on
|
// same architecture as Hotspot is running on
|
||||||
|
|
||||||
|
|
||||||
|
// Remember the stack's state. The Linux dynamic linker will change
|
||||||
|
// the stack to 'executable' at most once, so we must safepoint only once.
|
||||||
|
bool os::Linux::_stack_is_executable = false;
|
||||||
|
|
||||||
|
// VM operation that loads a library. This is necessary if stack protection
|
||||||
|
// of the Java stacks can be lost during loading the library. If we
|
||||||
|
// do not stop the Java threads, they can stack overflow before the stacks
|
||||||
|
// are protected again.
|
||||||
|
class VM_LinuxDllLoad: public VM_Operation {
|
||||||
|
private:
|
||||||
|
const char *_filename;
|
||||||
|
void *_lib;
|
||||||
|
public:
|
||||||
|
VM_LinuxDllLoad(const char *fn) :
|
||||||
|
_filename(fn), _lib(NULL) {}
|
||||||
|
VMOp_Type type() const { return VMOp_LinuxDllLoad; }
|
||||||
|
void doit() {
|
||||||
|
_lib = os::Linux::dll_load_inner(_filename);
|
||||||
|
os::Linux::_stack_is_executable = true;
|
||||||
|
}
|
||||||
|
void* loaded_library() { return _lib; }
|
||||||
|
};
|
||||||
|
|
||||||
void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
|
void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
|
||||||
{
|
{
|
||||||
void * result= ::dlopen(filename, RTLD_LAZY);
|
void * result = NULL;
|
||||||
|
bool load_attempted = false;
|
||||||
|
|
||||||
|
// Check whether the library to load might change execution rights
|
||||||
|
// of the stack. If they are changed, the protection of the stack
|
||||||
|
// guard pages will be lost. We need a safepoint to fix this.
|
||||||
|
//
|
||||||
|
// See Linux man page execstack(8) for more info.
|
||||||
|
if (os::uses_stack_guard_pages() && !os::Linux::_stack_is_executable) {
|
||||||
|
ElfFile ef(filename);
|
||||||
|
if (!ef.specifies_noexecstack()) {
|
||||||
|
if (!is_init_completed()) {
|
||||||
|
os::Linux::_stack_is_executable = true;
|
||||||
|
// This is OK - No Java threads have been created yet, and hence no
|
||||||
|
// stack guard pages to fix.
|
||||||
|
//
|
||||||
|
// This should happen only when you are building JDK7 using a very
|
||||||
|
// old version of JDK6 (e.g., with JPRT) and running test_gamma.
|
||||||
|
//
|
||||||
|
// Dynamic loader will make all stacks executable after
|
||||||
|
// this function returns, and will not do that again.
|
||||||
|
assert(Threads::first() == NULL, "no Java threads should exist yet.");
|
||||||
|
} else {
|
||||||
|
warning("You have loaded library %s which might have disabled stack guard. "
|
||||||
|
"The VM will try to fix the stack guard now.\n"
|
||||||
|
"It's highly recommended that you fix the library with "
|
||||||
|
"'execstack -c <libfile>', or link it with '-z noexecstack'.",
|
||||||
|
filename);
|
||||||
|
|
||||||
|
assert(Thread::current()->is_Java_thread(), "must be Java thread");
|
||||||
|
JavaThread *jt = JavaThread::current();
|
||||||
|
if (jt->thread_state() != _thread_in_native) {
|
||||||
|
// This happens when a compiler thread tries to load a hsdis-<arch>.so file
|
||||||
|
// that requires ExecStack. Cannot enter safe point. Let's give up.
|
||||||
|
warning("Unable to fix stack guard. Giving up.");
|
||||||
|
} else {
|
||||||
|
if (!LoadExecStackDllInVMThread) {
|
||||||
|
// This is for the case where the DLL has an static
|
||||||
|
// constructor function that executes JNI code. We cannot
|
||||||
|
// load such DLLs in the VMThread.
|
||||||
|
result = ::dlopen(filename, RTLD_LAZY);
|
||||||
|
}
|
||||||
|
|
||||||
|
ThreadInVMfromNative tiv(jt);
|
||||||
|
debug_only(VMNativeEntryWrapper vew;)
|
||||||
|
|
||||||
|
VM_LinuxDllLoad op(filename);
|
||||||
|
VMThread::execute(&op);
|
||||||
|
if (LoadExecStackDllInVMThread) {
|
||||||
|
result = op.loaded_library();
|
||||||
|
}
|
||||||
|
load_attempted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!load_attempted) {
|
||||||
|
result = ::dlopen(filename, RTLD_LAZY);
|
||||||
|
}
|
||||||
|
|
||||||
if (result != NULL) {
|
if (result != NULL) {
|
||||||
// Successful loading
|
// Successful loading
|
||||||
return result;
|
return result;
|
||||||
@ -1952,6 +2039,38 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void * os::Linux::dll_load_inner(const char *filename) {
|
||||||
|
void * result = NULL;
|
||||||
|
if (LoadExecStackDllInVMThread) {
|
||||||
|
result = ::dlopen(filename, RTLD_LAZY);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Since 7019808, libjvm.so is linked with -noexecstack. If the VM loads a
|
||||||
|
// library that requires an executable stack, or which does not have this
|
||||||
|
// stack attribute set, dlopen changes the stack attribute to executable. The
|
||||||
|
// read protection of the guard pages gets lost.
|
||||||
|
//
|
||||||
|
// Need to check _stack_is_executable again as multiple VM_LinuxDllLoad
|
||||||
|
// may have been queued at the same time.
|
||||||
|
|
||||||
|
if (!_stack_is_executable) {
|
||||||
|
JavaThread *jt = Threads::first();
|
||||||
|
|
||||||
|
while (jt) {
|
||||||
|
if (!jt->stack_guard_zone_unused() && // Stack not yet fully initialized
|
||||||
|
jt->stack_yellow_zone_enabled()) { // No pending stack overflow exceptions
|
||||||
|
if (!os::guard_memory((char *) jt->stack_red_zone_base() - jt->stack_red_zone_size(),
|
||||||
|
jt->stack_yellow_zone_size() + jt->stack_red_zone_size())) {
|
||||||
|
warning("Attempt to reguard stack yellow zone failed.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jt = jt->next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* glibc-2.0 libdl is not MT safe. If you are building with any glibc,
|
* glibc-2.0 libdl is not MT safe. If you are building with any glibc,
|
||||||
* chances are you might want to run the generated bits against glibc-2.0
|
* chances are you might want to run the generated bits against glibc-2.0
|
||||||
@ -3094,13 +3213,24 @@ char* os::reserve_memory_special(size_t bytes, char* req_addr, bool exec) {
|
|||||||
numa_make_global(addr, bytes);
|
numa_make_global(addr, bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The memory is committed
|
||||||
|
address pc = CALLER_PC;
|
||||||
|
MemTracker::record_virtual_memory_reserve((address)addr, bytes, pc);
|
||||||
|
MemTracker::record_virtual_memory_commit((address)addr, bytes, pc);
|
||||||
|
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::release_memory_special(char* base, size_t bytes) {
|
bool os::release_memory_special(char* base, size_t bytes) {
|
||||||
// detaching the SHM segment will also delete it, see reserve_memory_special()
|
// detaching the SHM segment will also delete it, see reserve_memory_special()
|
||||||
int rslt = shmdt(base);
|
int rslt = shmdt(base);
|
||||||
return rslt == 0;
|
if (rslt == 0) {
|
||||||
|
MemTracker::record_virtual_memory_uncommit((address)base, bytes);
|
||||||
|
MemTracker::record_virtual_memory_release((address)base, bytes);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t os::large_page_size() {
|
size_t os::large_page_size() {
|
||||||
|
@ -94,6 +94,9 @@ class Linux {
|
|||||||
static void print_libversion_info(outputStream* st);
|
static void print_libversion_info(outputStream* st);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
static bool _stack_is_executable;
|
||||||
|
static void *dll_load_inner(const char *name);
|
||||||
|
|
||||||
static void init_thread_fpu_state();
|
static void init_thread_fpu_state();
|
||||||
static int get_fpu_control_word();
|
static int get_fpu_control_word();
|
||||||
static void set_fpu_control_word(int fpu_control);
|
static void set_fpu_control_word(int fpu_control);
|
||||||
|
@ -2945,7 +2945,7 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info
|
|||||||
while (p < (uint64_t)end) {
|
while (p < (uint64_t)end) {
|
||||||
addrs[0] = p;
|
addrs[0] = p;
|
||||||
size_t addrs_count = 1;
|
size_t addrs_count = 1;
|
||||||
while (addrs_count < MAX_MEMINFO_CNT && addrs[addrs_count - 1] < (uint64_t)end) {
|
while (addrs_count < MAX_MEMINFO_CNT && addrs[addrs_count - 1] + page_size < (uint64_t)end) {
|
||||||
addrs[addrs_count] = addrs[addrs_count - 1] + page_size;
|
addrs[addrs_count] = addrs[addrs_count - 1] + page_size;
|
||||||
addrs_count++;
|
addrs_count++;
|
||||||
}
|
}
|
||||||
@ -3420,13 +3420,25 @@ char* os::reserve_memory_special(size_t size, char* addr, bool exec) {
|
|||||||
if ((retAddr != NULL) && UseNUMAInterleaving) {
|
if ((retAddr != NULL) && UseNUMAInterleaving) {
|
||||||
numa_make_global(retAddr, size);
|
numa_make_global(retAddr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The memory is committed
|
||||||
|
address pc = CALLER_PC;
|
||||||
|
MemTracker::record_virtual_memory_reserve((address)retAddr, size, pc);
|
||||||
|
MemTracker::record_virtual_memory_commit((address)retAddr, size, pc);
|
||||||
|
|
||||||
return retAddr;
|
return retAddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::release_memory_special(char* base, size_t bytes) {
|
bool os::release_memory_special(char* base, size_t bytes) {
|
||||||
// detaching the SHM segment will also delete it, see reserve_memory_special()
|
// detaching the SHM segment will also delete it, see reserve_memory_special()
|
||||||
int rslt = shmdt(base);
|
int rslt = shmdt(base);
|
||||||
return rslt == 0;
|
if (rslt == 0) {
|
||||||
|
MemTracker::record_virtual_memory_uncommit((address)base, bytes);
|
||||||
|
MemTracker::record_virtual_memory_release((address)base, bytes);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t os::large_page_size() {
|
size_t os::large_page_size() {
|
||||||
|
@ -60,6 +60,7 @@
|
|||||||
#include "runtime/threadCritical.hpp"
|
#include "runtime/threadCritical.hpp"
|
||||||
#include "runtime/timer.hpp"
|
#include "runtime/timer.hpp"
|
||||||
#include "services/attachListener.hpp"
|
#include "services/attachListener.hpp"
|
||||||
|
#include "services/memTracker.hpp"
|
||||||
#include "services/runtimeService.hpp"
|
#include "services/runtimeService.hpp"
|
||||||
#include "utilities/decoder.hpp"
|
#include "utilities/decoder.hpp"
|
||||||
#include "utilities/defaultStream.hpp"
|
#include "utilities/defaultStream.hpp"
|
||||||
@ -2836,7 +2837,7 @@ static char* allocate_pages_individually(size_t bytes, char* addr, DWORD flags,
|
|||||||
PAGE_READWRITE);
|
PAGE_READWRITE);
|
||||||
// If reservation failed, return NULL
|
// If reservation failed, return NULL
|
||||||
if (p_buf == NULL) return NULL;
|
if (p_buf == NULL) return NULL;
|
||||||
|
MemTracker::record_virtual_memory_reserve((address)p_buf, size_of_reserve, CALLER_PC);
|
||||||
os::release_memory(p_buf, bytes + chunk_size);
|
os::release_memory(p_buf, bytes + chunk_size);
|
||||||
|
|
||||||
// we still need to round up to a page boundary (in case we are using large pages)
|
// we still need to round up to a page boundary (in case we are using large pages)
|
||||||
@ -2898,6 +2899,11 @@ static char* allocate_pages_individually(size_t bytes, char* addr, DWORD flags,
|
|||||||
if (next_alloc_addr > p_buf) {
|
if (next_alloc_addr > p_buf) {
|
||||||
// Some memory was committed so release it.
|
// Some memory was committed so release it.
|
||||||
size_t bytes_to_release = bytes - bytes_remaining;
|
size_t bytes_to_release = bytes - bytes_remaining;
|
||||||
|
// NMT has yet to record any individual blocks, so it
|
||||||
|
// need to create a dummy 'reserve' record to match
|
||||||
|
// the release.
|
||||||
|
MemTracker::record_virtual_memory_reserve((address)p_buf,
|
||||||
|
bytes_to_release, CALLER_PC);
|
||||||
os::release_memory(p_buf, bytes_to_release);
|
os::release_memory(p_buf, bytes_to_release);
|
||||||
}
|
}
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
@ -2909,10 +2915,19 @@ static char* allocate_pages_individually(size_t bytes, char* addr, DWORD flags,
|
|||||||
#endif
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bytes_remaining -= bytes_to_rq;
|
bytes_remaining -= bytes_to_rq;
|
||||||
next_alloc_addr += bytes_to_rq;
|
next_alloc_addr += bytes_to_rq;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
// Although the memory is allocated individually, it is returned as one.
|
||||||
|
// NMT records it as one block.
|
||||||
|
address pc = CALLER_PC;
|
||||||
|
MemTracker::record_virtual_memory_reserve((address)p_buf, bytes, pc);
|
||||||
|
if ((flags & MEM_COMMIT) != 0) {
|
||||||
|
MemTracker::record_virtual_memory_commit((address)p_buf, bytes, pc);
|
||||||
|
}
|
||||||
|
|
||||||
// made it this far, success
|
// made it this far, success
|
||||||
return p_buf;
|
return p_buf;
|
||||||
}
|
}
|
||||||
@ -3099,11 +3114,20 @@ char* os::reserve_memory_special(size_t bytes, char* addr, bool exec) {
|
|||||||
// normal policy just allocate it all at once
|
// normal policy just allocate it all at once
|
||||||
DWORD flag = MEM_RESERVE | MEM_COMMIT | MEM_LARGE_PAGES;
|
DWORD flag = MEM_RESERVE | MEM_COMMIT | MEM_LARGE_PAGES;
|
||||||
char * res = (char *)VirtualAlloc(NULL, bytes, flag, prot);
|
char * res = (char *)VirtualAlloc(NULL, bytes, flag, prot);
|
||||||
|
if (res != NULL) {
|
||||||
|
address pc = CALLER_PC;
|
||||||
|
MemTracker::record_virtual_memory_reserve((address)res, bytes, pc);
|
||||||
|
MemTracker::record_virtual_memory_commit((address)res, bytes, pc);
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::release_memory_special(char* base, size_t bytes) {
|
bool os::release_memory_special(char* base, size_t bytes) {
|
||||||
|
assert(base != NULL, "Sanity check");
|
||||||
|
// Memory allocated via reserve_memory_special() is committed
|
||||||
|
MemTracker::record_virtual_memory_uncommit((address)base, bytes);
|
||||||
return release_memory(base, bytes);
|
return release_memory(base, bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ JVM_handle_bsd_signal(int sig,
|
|||||||
// here if the underlying file has been truncated.
|
// here if the underlying file has been truncated.
|
||||||
// Do not crash the VM in such a case.
|
// Do not crash the VM in such a case.
|
||||||
CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
|
CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
|
||||||
nmethod* nm = cb->is_nmethod() ? (nmethod*)cb : NULL;
|
nmethod* nm = (cb != NULL && cb->is_nmethod()) ? (nmethod*)cb : NULL;
|
||||||
if (nm != NULL && nm->has_unsafe_access()) {
|
if (nm != NULL && nm->has_unsafe_access()) {
|
||||||
stub = StubRoutines::handler_for_unsafe_access();
|
stub = StubRoutines::handler_for_unsafe_access();
|
||||||
}
|
}
|
||||||
|
@ -410,6 +410,11 @@ inline static bool checkOverflow(sigcontext* uc,
|
|||||||
// to handle_unexpected_exception way down below.
|
// to handle_unexpected_exception way down below.
|
||||||
thread->disable_stack_red_zone();
|
thread->disable_stack_red_zone();
|
||||||
tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
|
tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
|
||||||
|
|
||||||
|
// This is a likely cause, but hard to verify. Let's just print
|
||||||
|
// it as a hint.
|
||||||
|
tty->print_raw_cr("Please check if any of your loaded .so files has "
|
||||||
|
"enabled executable stack (see man page execstack(8))");
|
||||||
} else {
|
} else {
|
||||||
// Accessing stack address below sp may cause SEGV if current
|
// Accessing stack address below sp may cause SEGV if current
|
||||||
// thread has MAP_GROWSDOWN stack. This should only happen when
|
// thread has MAP_GROWSDOWN stack. This should only happen when
|
||||||
|
@ -305,6 +305,11 @@ JVM_handle_linux_signal(int sig,
|
|||||||
// to handle_unexpected_exception way down below.
|
// to handle_unexpected_exception way down below.
|
||||||
thread->disable_stack_red_zone();
|
thread->disable_stack_red_zone();
|
||||||
tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
|
tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
|
||||||
|
|
||||||
|
// This is a likely cause, but hard to verify. Let's just print
|
||||||
|
// it as a hint.
|
||||||
|
tty->print_raw_cr("Please check if any of your loaded .so files has "
|
||||||
|
"enabled executable stack (see man page execstack(8))");
|
||||||
} else {
|
} else {
|
||||||
// Accessing stack address below sp may cause SEGV if current
|
// Accessing stack address below sp may cause SEGV if current
|
||||||
// thread has MAP_GROWSDOWN stack. This should only happen when
|
// thread has MAP_GROWSDOWN stack. This should only happen when
|
||||||
|
@ -2375,7 +2375,7 @@ class LIR_OpVisitState: public StackObj {
|
|||||||
// collects all register operands of the instruction
|
// collects all register operands of the instruction
|
||||||
void visit(LIR_Op* op);
|
void visit(LIR_Op* op);
|
||||||
|
|
||||||
#if ASSERT
|
#ifdef ASSERT
|
||||||
// check that an operation has no operands
|
// check that an operation has no operands
|
||||||
bool no_operands(LIR_Op* op);
|
bool no_operands(LIR_Op* op);
|
||||||
#endif
|
#endif
|
||||||
|
@ -2540,7 +2540,7 @@ void ciTypeFlow::build_loop_tree(Block* blk) {
|
|||||||
} else if (innermost->head() == blk) {
|
} else if (innermost->head() == blk) {
|
||||||
// If loop header, complete the tree pointers
|
// If loop header, complete the tree pointers
|
||||||
if (blk->loop() != innermost) {
|
if (blk->loop() != innermost) {
|
||||||
#if ASSERT
|
#ifdef ASSERT
|
||||||
assert(blk->loop()->head() == innermost->head(), "same head");
|
assert(blk->loop()->head() == innermost->head(), "same head");
|
||||||
Loop* dl;
|
Loop* dl;
|
||||||
for (dl = innermost; dl != NULL && dl != blk->loop(); dl = dl->parent());
|
for (dl = innermost; dl != NULL && dl != blk->loop(); dl = dl->parent());
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -34,6 +34,7 @@
|
|||||||
#include "classfile/symbolTable.hpp"
|
#include "classfile/symbolTable.hpp"
|
||||||
|
|
||||||
class FieldAllocationCount;
|
class FieldAllocationCount;
|
||||||
|
class FieldLayoutInfo;
|
||||||
|
|
||||||
|
|
||||||
// Parser for for .class files
|
// Parser for for .class files
|
||||||
@ -47,6 +48,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
|||||||
u2 _major_version;
|
u2 _major_version;
|
||||||
u2 _minor_version;
|
u2 _minor_version;
|
||||||
Symbol* _class_name;
|
Symbol* _class_name;
|
||||||
|
ClassLoaderData* _loader_data;
|
||||||
KlassHandle _host_klass;
|
KlassHandle _host_klass;
|
||||||
GrowableArray<Handle>* _cp_patches; // overrides for CP entries
|
GrowableArray<Handle>* _cp_patches; // overrides for CP entries
|
||||||
|
|
||||||
@ -58,33 +60,59 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
|||||||
|
|
||||||
// class attributes parsed before the instance klass is created:
|
// class attributes parsed before the instance klass is created:
|
||||||
bool _synthetic_flag;
|
bool _synthetic_flag;
|
||||||
|
int _sde_length;
|
||||||
|
char* _sde_buffer;
|
||||||
Symbol* _sourcefile;
|
Symbol* _sourcefile;
|
||||||
Symbol* _generic_signature;
|
Symbol* _generic_signature;
|
||||||
char* _sde_buffer;
|
|
||||||
int _sde_length;
|
// Metadata created before the instance klass is created. Must be deallocated
|
||||||
Array<u2>* _inner_classes;
|
// if not transferred to the InstanceKlass upon successful class loading
|
||||||
|
// in which case these pointers have been set to NULL.
|
||||||
|
instanceKlassHandle _super_klass;
|
||||||
|
ConstantPool* _cp;
|
||||||
|
Array<u2>* _fields;
|
||||||
|
Array<Method*>* _methods;
|
||||||
|
Array<u2>* _inner_classes;
|
||||||
|
Array<Klass*>* _local_interfaces;
|
||||||
|
Array<Klass*>* _transitive_interfaces;
|
||||||
AnnotationArray* _annotations;
|
AnnotationArray* _annotations;
|
||||||
AnnotationArray* _type_annotations;
|
AnnotationArray* _type_annotations;
|
||||||
|
Array<AnnotationArray*>* _fields_annotations;
|
||||||
|
Array<AnnotationArray*>* _fields_type_annotations;
|
||||||
|
InstanceKlass* _klass; // InstanceKlass once created.
|
||||||
|
|
||||||
void set_class_synthetic_flag(bool x) { _synthetic_flag = x; }
|
void set_class_synthetic_flag(bool x) { _synthetic_flag = x; }
|
||||||
void set_class_sourcefile(Symbol* x) { _sourcefile = x; }
|
void set_class_sourcefile(Symbol* x) { _sourcefile = x; }
|
||||||
void set_class_generic_signature(Symbol* x) { _generic_signature = x; }
|
void set_class_generic_signature(Symbol* x) { _generic_signature = x; }
|
||||||
void set_class_sde_buffer(char* x, int len) { _sde_buffer = x; _sde_length = len; }
|
void set_class_sde_buffer(char* x, int len) { _sde_buffer = x; _sde_length = len; }
|
||||||
void set_class_inner_classes(Array<u2>* x) { _inner_classes = x; }
|
|
||||||
void set_class_annotations(AnnotationArray* x) { _annotations = x; }
|
void init_parsed_class_attributes(ClassLoaderData* loader_data) {
|
||||||
void set_class_type_annotations(AnnotationArray* x) { _type_annotations = x; }
|
_loader_data = loader_data;
|
||||||
void init_parsed_class_attributes() {
|
|
||||||
_synthetic_flag = false;
|
_synthetic_flag = false;
|
||||||
_sourcefile = NULL;
|
_sourcefile = NULL;
|
||||||
_generic_signature = NULL;
|
_generic_signature = NULL;
|
||||||
_sde_buffer = NULL;
|
_sde_buffer = NULL;
|
||||||
_sde_length = 0;
|
_sde_length = 0;
|
||||||
_annotations = _type_annotations = NULL;
|
|
||||||
// initialize the other flags too:
|
// initialize the other flags too:
|
||||||
_has_finalizer = _has_empty_finalizer = _has_vanilla_constructor = false;
|
_has_finalizer = _has_empty_finalizer = _has_vanilla_constructor = false;
|
||||||
_max_bootstrap_specifier_index = -1;
|
_max_bootstrap_specifier_index = -1;
|
||||||
|
clear_class_metadata();
|
||||||
|
_klass = NULL;
|
||||||
}
|
}
|
||||||
void apply_parsed_class_attributes(instanceKlassHandle k); // update k
|
void apply_parsed_class_attributes(instanceKlassHandle k); // update k
|
||||||
|
void apply_parsed_class_metadata(instanceKlassHandle k, int fields_count, TRAPS);
|
||||||
|
void clear_class_metadata() {
|
||||||
|
// metadata created before the instance klass is created. Must be
|
||||||
|
// deallocated if classfile parsing returns an error.
|
||||||
|
_cp = NULL;
|
||||||
|
_fields = NULL;
|
||||||
|
_methods = NULL;
|
||||||
|
_inner_classes = NULL;
|
||||||
|
_local_interfaces = NULL;
|
||||||
|
_transitive_interfaces = NULL;
|
||||||
|
_annotations = _type_annotations = NULL;
|
||||||
|
_fields_annotations = _fields_type_annotations = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
class AnnotationCollector {
|
class AnnotationCollector {
|
||||||
public:
|
public:
|
||||||
@ -124,11 +152,27 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
|||||||
void set_contended(bool contended) { set_annotation(_sun_misc_Contended); }
|
void set_contended(bool contended) { set_annotation(_sun_misc_Contended); }
|
||||||
bool is_contended() { return has_annotation(_sun_misc_Contended); }
|
bool is_contended() { return has_annotation(_sun_misc_Contended); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// This class also doubles as a holder for metadata cleanup.
|
||||||
class FieldAnnotationCollector: public AnnotationCollector {
|
class FieldAnnotationCollector: public AnnotationCollector {
|
||||||
|
ClassLoaderData* _loader_data;
|
||||||
|
AnnotationArray* _field_annotations;
|
||||||
|
AnnotationArray* _field_type_annotations;
|
||||||
public:
|
public:
|
||||||
FieldAnnotationCollector() : AnnotationCollector(_in_field) { }
|
FieldAnnotationCollector(ClassLoaderData* loader_data) :
|
||||||
|
AnnotationCollector(_in_field),
|
||||||
|
_loader_data(loader_data),
|
||||||
|
_field_annotations(NULL),
|
||||||
|
_field_type_annotations(NULL) {}
|
||||||
void apply_to(FieldInfo* f);
|
void apply_to(FieldInfo* f);
|
||||||
|
~FieldAnnotationCollector();
|
||||||
|
AnnotationArray* field_annotations() { return _field_annotations; }
|
||||||
|
AnnotationArray* field_type_annotations() { return _field_type_annotations; }
|
||||||
|
|
||||||
|
void set_field_annotations(AnnotationArray* a) { _field_annotations = a; }
|
||||||
|
void set_field_type_annotations(AnnotationArray* a) { _field_type_annotations = a; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class MethodAnnotationCollector: public AnnotationCollector {
|
class MethodAnnotationCollector: public AnnotationCollector {
|
||||||
public:
|
public:
|
||||||
MethodAnnotationCollector() : AnnotationCollector(_in_method) { }
|
MethodAnnotationCollector() : AnnotationCollector(_in_method) { }
|
||||||
@ -152,38 +196,30 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
|||||||
void set_stream(ClassFileStream* st) { _stream = st; }
|
void set_stream(ClassFileStream* st) { _stream = st; }
|
||||||
|
|
||||||
// Constant pool parsing
|
// Constant pool parsing
|
||||||
void parse_constant_pool_entries(ClassLoaderData* loader_data,
|
void parse_constant_pool_entries(int length, TRAPS);
|
||||||
constantPoolHandle cp, int length, TRAPS);
|
|
||||||
|
|
||||||
constantPoolHandle parse_constant_pool(ClassLoaderData* loader_data, TRAPS);
|
constantPoolHandle parse_constant_pool(TRAPS);
|
||||||
|
|
||||||
// Interface parsing
|
// Interface parsing
|
||||||
Array<Klass*>* parse_interfaces(constantPoolHandle cp,
|
Array<Klass*>* parse_interfaces(int length,
|
||||||
int length,
|
|
||||||
ClassLoaderData* loader_data,
|
|
||||||
Handle protection_domain,
|
Handle protection_domain,
|
||||||
Symbol* class_name,
|
Symbol* class_name,
|
||||||
bool* has_default_methods,
|
bool* has_default_methods,
|
||||||
TRAPS);
|
TRAPS);
|
||||||
void record_defined_class_dependencies(instanceKlassHandle defined_klass, TRAPS);
|
void record_defined_class_dependencies(instanceKlassHandle defined_klass, TRAPS);
|
||||||
|
|
||||||
|
instanceKlassHandle parse_super_class(int super_class_index, TRAPS);
|
||||||
// Field parsing
|
// Field parsing
|
||||||
void parse_field_attributes(ClassLoaderData* loader_data,
|
void parse_field_attributes(u2 attributes_count,
|
||||||
constantPoolHandle cp, u2 attributes_count,
|
|
||||||
bool is_static, u2 signature_index,
|
bool is_static, u2 signature_index,
|
||||||
u2* constantvalue_index_addr,
|
u2* constantvalue_index_addr,
|
||||||
bool* is_synthetic_addr,
|
bool* is_synthetic_addr,
|
||||||
u2* generic_signature_index_addr,
|
u2* generic_signature_index_addr,
|
||||||
AnnotationArray** field_annotations,
|
|
||||||
AnnotationArray** field_type_annotations,
|
|
||||||
FieldAnnotationCollector* parsed_annotations,
|
FieldAnnotationCollector* parsed_annotations,
|
||||||
TRAPS);
|
TRAPS);
|
||||||
Array<u2>* parse_fields(ClassLoaderData* loader_data,
|
Array<u2>* parse_fields(Symbol* class_name,
|
||||||
Symbol* class_name,
|
bool is_interface,
|
||||||
constantPoolHandle cp, bool is_interface,
|
|
||||||
FieldAllocationCount *fac,
|
FieldAllocationCount *fac,
|
||||||
Array<AnnotationArray*>** fields_annotations,
|
|
||||||
Array<AnnotationArray*>** fields_type_annotations,
|
|
||||||
u2* java_fields_count_ptr, TRAPS);
|
u2* java_fields_count_ptr, TRAPS);
|
||||||
|
|
||||||
void print_field_layout(Symbol* name,
|
void print_field_layout(Symbol* name,
|
||||||
@ -195,65 +231,52 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
|||||||
int static_fields_end);
|
int static_fields_end);
|
||||||
|
|
||||||
// Method parsing
|
// Method parsing
|
||||||
methodHandle parse_method(ClassLoaderData* loader_data,
|
methodHandle parse_method(bool is_interface,
|
||||||
constantPoolHandle cp,
|
|
||||||
bool is_interface,
|
|
||||||
AccessFlags* promoted_flags,
|
AccessFlags* promoted_flags,
|
||||||
TRAPS);
|
TRAPS);
|
||||||
Array<Method*>* parse_methods(ClassLoaderData* loader_data,
|
Array<Method*>* parse_methods(bool is_interface,
|
||||||
constantPoolHandle cp,
|
|
||||||
bool is_interface,
|
|
||||||
AccessFlags* promoted_flags,
|
AccessFlags* promoted_flags,
|
||||||
bool* has_final_method,
|
bool* has_final_method,
|
||||||
bool* has_default_method,
|
bool* has_default_method,
|
||||||
TRAPS);
|
TRAPS);
|
||||||
Array<int>* sort_methods(ClassLoaderData* loader_data,
|
intArray* sort_methods(Array<Method*>* methods);
|
||||||
Array<Method*>* methods,
|
|
||||||
TRAPS);
|
u2* parse_exception_table(u4 code_length, u4 exception_table_length,
|
||||||
u2* parse_exception_table(ClassLoaderData* loader_data,
|
TRAPS);
|
||||||
u4 code_length, u4 exception_table_length,
|
|
||||||
constantPoolHandle cp, TRAPS);
|
|
||||||
void parse_linenumber_table(
|
void parse_linenumber_table(
|
||||||
u4 code_attribute_length, u4 code_length,
|
u4 code_attribute_length, u4 code_length,
|
||||||
CompressedLineNumberWriteStream** write_stream, TRAPS);
|
CompressedLineNumberWriteStream** write_stream, TRAPS);
|
||||||
u2* parse_localvariable_table(u4 code_length, u2 max_locals, u4 code_attribute_length,
|
u2* parse_localvariable_table(u4 code_length, u2 max_locals, u4 code_attribute_length,
|
||||||
constantPoolHandle cp, u2* localvariable_table_length,
|
u2* localvariable_table_length,
|
||||||
bool isLVTT, TRAPS);
|
bool isLVTT, TRAPS);
|
||||||
u2* parse_checked_exceptions(u2* checked_exceptions_length, u4 method_attribute_length,
|
u2* parse_checked_exceptions(u2* checked_exceptions_length, u4 method_attribute_length,
|
||||||
constantPoolHandle cp, TRAPS);
|
TRAPS);
|
||||||
void parse_type_array(u2 array_length, u4 code_length, u4* u1_index, u4* u2_index,
|
void parse_type_array(u2 array_length, u4 code_length, u4* u1_index, u4* u2_index,
|
||||||
u1* u1_array, u2* u2_array, constantPoolHandle cp, TRAPS);
|
u1* u1_array, u2* u2_array, TRAPS);
|
||||||
Array<u1>* parse_stackmap_table(ClassLoaderData* loader_data, u4 code_attribute_length, TRAPS);
|
u1* parse_stackmap_table(u4 code_attribute_length, TRAPS);
|
||||||
|
|
||||||
// Classfile attribute parsing
|
// Classfile attribute parsing
|
||||||
void parse_classfile_sourcefile_attribute(constantPoolHandle cp, TRAPS);
|
void parse_classfile_sourcefile_attribute(TRAPS);
|
||||||
void parse_classfile_source_debug_extension_attribute(constantPoolHandle cp,
|
void parse_classfile_source_debug_extension_attribute(int length, TRAPS);
|
||||||
int length, TRAPS);
|
u2 parse_classfile_inner_classes_attribute(u1* inner_classes_attribute_start,
|
||||||
u2 parse_classfile_inner_classes_attribute(ClassLoaderData* loader_data,
|
|
||||||
u1* inner_classes_attribute_start,
|
|
||||||
bool parsed_enclosingmethod_attribute,
|
bool parsed_enclosingmethod_attribute,
|
||||||
u2 enclosing_method_class_index,
|
u2 enclosing_method_class_index,
|
||||||
u2 enclosing_method_method_index,
|
u2 enclosing_method_method_index,
|
||||||
constantPoolHandle cp,
|
|
||||||
TRAPS);
|
TRAPS);
|
||||||
void parse_classfile_attributes(ClassLoaderData* loader_data,
|
void parse_classfile_attributes(ClassAnnotationCollector* parsed_annotations,
|
||||||
constantPoolHandle cp,
|
|
||||||
ClassAnnotationCollector* parsed_annotations,
|
|
||||||
TRAPS);
|
TRAPS);
|
||||||
void parse_classfile_synthetic_attribute(constantPoolHandle cp, TRAPS);
|
void parse_classfile_synthetic_attribute(TRAPS);
|
||||||
void parse_classfile_signature_attribute(constantPoolHandle cp, TRAPS);
|
void parse_classfile_signature_attribute(TRAPS);
|
||||||
void parse_classfile_bootstrap_methods_attribute(ClassLoaderData* loader_data, constantPoolHandle cp, u4 attribute_length, TRAPS);
|
void parse_classfile_bootstrap_methods_attribute(u4 attribute_length, TRAPS);
|
||||||
|
|
||||||
// Annotations handling
|
// Annotations handling
|
||||||
AnnotationArray* assemble_annotations(ClassLoaderData* loader_data,
|
AnnotationArray* assemble_annotations(u1* runtime_visible_annotations,
|
||||||
u1* runtime_visible_annotations,
|
|
||||||
int runtime_visible_annotations_length,
|
int runtime_visible_annotations_length,
|
||||||
u1* runtime_invisible_annotations,
|
u1* runtime_invisible_annotations,
|
||||||
int runtime_invisible_annotations_length, TRAPS);
|
int runtime_invisible_annotations_length, TRAPS);
|
||||||
int skip_annotation(u1* buffer, int limit, int index);
|
int skip_annotation(u1* buffer, int limit, int index);
|
||||||
int skip_annotation_value(u1* buffer, int limit, int index);
|
int skip_annotation_value(u1* buffer, int limit, int index);
|
||||||
void parse_annotations(ClassLoaderData* loader_data,
|
void parse_annotations(u1* buffer, int limit,
|
||||||
u1* buffer, int limit, constantPoolHandle cp,
|
|
||||||
/* Results (currently, only one result is supported): */
|
/* Results (currently, only one result is supported): */
|
||||||
AnnotationCollector* result,
|
AnnotationCollector* result,
|
||||||
TRAPS);
|
TRAPS);
|
||||||
@ -267,8 +290,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
|||||||
int* nonstatic_oop_offsets,
|
int* nonstatic_oop_offsets,
|
||||||
unsigned int* nonstatic_oop_counts);
|
unsigned int* nonstatic_oop_counts);
|
||||||
void set_precomputed_flags(instanceKlassHandle k);
|
void set_precomputed_flags(instanceKlassHandle k);
|
||||||
Array<Klass*>* compute_transitive_interfaces(ClassLoaderData* loader_data,
|
Array<Klass*>* compute_transitive_interfaces(instanceKlassHandle super,
|
||||||
instanceKlassHandle super,
|
|
||||||
Array<Klass*>* local_ifs, TRAPS);
|
Array<Klass*>* local_ifs, TRAPS);
|
||||||
|
|
||||||
// Format checker methods
|
// Format checker methods
|
||||||
@ -318,7 +340,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
|||||||
bool is_supported_version(u2 major, u2 minor);
|
bool is_supported_version(u2 major, u2 minor);
|
||||||
bool has_illegal_visibility(jint flags);
|
bool has_illegal_visibility(jint flags);
|
||||||
|
|
||||||
void verify_constantvalue(int constantvalue_index, int signature_index, constantPoolHandle cp, TRAPS);
|
void verify_constantvalue(int constantvalue_index, int signature_index, TRAPS);
|
||||||
void verify_legal_utf8(const unsigned char* buffer, int length, TRAPS);
|
void verify_legal_utf8(const unsigned char* buffer, int length, TRAPS);
|
||||||
void verify_legal_class_name(Symbol* name, TRAPS);
|
void verify_legal_class_name(Symbol* name, TRAPS);
|
||||||
void verify_legal_field_name(Symbol* name, TRAPS);
|
void verify_legal_field_name(Symbol* name, TRAPS);
|
||||||
@ -359,10 +381,17 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
|||||||
// In older versions of the VM, Klass*s cannot sneak into early phases of
|
// In older versions of the VM, Klass*s cannot sneak into early phases of
|
||||||
// constant pool construction, but in later versions they can.
|
// constant pool construction, but in later versions they can.
|
||||||
// %%% Let's phase out the old is_klass_reference.
|
// %%% Let's phase out the old is_klass_reference.
|
||||||
bool is_klass_reference(constantPoolHandle cp, int index) {
|
bool valid_klass_reference_at(int index) {
|
||||||
return (EnableInvokeDynamic
|
return _cp->is_within_bounds(index) &&
|
||||||
? cp->tag_at(index).is_klass_or_reference()
|
(EnableInvokeDynamic
|
||||||
: cp->tag_at(index).is_klass_reference());
|
? _cp->tag_at(index).is_klass_or_reference()
|
||||||
|
: _cp->tag_at(index).is_klass_reference());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Checks that the cpool index is in range and is a utf8
|
||||||
|
bool valid_symbol_at(int cpool_index) {
|
||||||
|
return (_cp->is_within_bounds(cpool_index) &&
|
||||||
|
_cp->tag_at(cpool_index).is_utf8());
|
||||||
}
|
}
|
||||||
|
|
||||||
void copy_localvariable_table(ConstMethod* cm, int lvt_cnt,
|
void copy_localvariable_table(ConstMethod* cm, int lvt_cnt,
|
||||||
@ -373,8 +402,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
|||||||
u2** localvariable_type_table_start,
|
u2** localvariable_type_table_start,
|
||||||
TRAPS);
|
TRAPS);
|
||||||
|
|
||||||
void copy_method_annotations(ClassLoaderData* loader_data,
|
void copy_method_annotations(ConstMethod* cm,
|
||||||
ConstMethod* cm,
|
|
||||||
u1* runtime_visible_annotations,
|
u1* runtime_visible_annotations,
|
||||||
int runtime_visible_annotations_length,
|
int runtime_visible_annotations_length,
|
||||||
u1* runtime_invisible_annotations,
|
u1* runtime_invisible_annotations,
|
||||||
@ -391,9 +419,15 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
|||||||
int annotation_default_length,
|
int annotation_default_length,
|
||||||
TRAPS);
|
TRAPS);
|
||||||
|
|
||||||
|
// lays out fields in class and returns the total oopmap count
|
||||||
|
void layout_fields(Handle class_loader, FieldAllocationCount* fac,
|
||||||
|
ClassAnnotationCollector* parsed_annotations,
|
||||||
|
FieldLayoutInfo* info, TRAPS);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
ClassFileParser(ClassFileStream* st) { set_stream(st); }
|
ClassFileParser(ClassFileStream* st) { set_stream(st); }
|
||||||
|
~ClassFileParser();
|
||||||
|
|
||||||
// Parse .class file and return new Klass*. The Klass* is not hooked up
|
// Parse .class file and return new Klass*. The Klass* is not hooked up
|
||||||
// to the system dictionary or any other structures, so a .class file can
|
// to the system dictionary or any other structures, so a .class file can
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -49,18 +49,17 @@ Symbol* SymbolTable::allocate_symbol(const u1* name, int len, bool c_heap, TRAPS
|
|||||||
|
|
||||||
Symbol* sym;
|
Symbol* sym;
|
||||||
|
|
||||||
if (c_heap) {
|
if (DumpSharedSpaces) {
|
||||||
|
// Allocate all symbols to CLD shared metaspace
|
||||||
|
sym = new (len, ClassLoaderData::the_null_class_loader_data(), THREAD) Symbol(name, len, -1);
|
||||||
|
} else if (c_heap) {
|
||||||
// refcount starts as 1
|
// refcount starts as 1
|
||||||
assert(!DumpSharedSpaces, "never allocate to C heap");
|
|
||||||
sym = new (len, THREAD) Symbol(name, len, 1);
|
sym = new (len, THREAD) Symbol(name, len, 1);
|
||||||
assert(sym != NULL, "new should call vm_exit_out_of_memory if C_HEAP is exhausted");
|
assert(sym != NULL, "new should call vm_exit_out_of_memory if C_HEAP is exhausted");
|
||||||
} else {
|
} else {
|
||||||
if (DumpSharedSpaces) {
|
// Allocate to global arena
|
||||||
sym = new (len, ClassLoaderData::the_null_class_loader_data(), THREAD) Symbol(name, len, -1);
|
|
||||||
} else {
|
|
||||||
sym = new (len, arena(), THREAD) Symbol(name, len, -1);
|
sym = new (len, arena(), THREAD) Symbol(name, len, -1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return sym;
|
return sym;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ void CompressedWriteStream::write_int_mb(jint value) {
|
|||||||
// for this block (a matching directive turns it back on later).
|
// for this block (a matching directive turns it back on later).
|
||||||
// These directives can be removed once the MS VS.NET 2005
|
// These directives can be removed once the MS VS.NET 2005
|
||||||
// compiler stack overflow is fixed.
|
// compiler stack overflow is fixed.
|
||||||
#if _MSC_VER >=1400 && !defined(_WIN64)
|
#if defined(_MSC_VER) && _MSC_VER >=1400 && !defined(_WIN64)
|
||||||
#pragma optimize("", off)
|
#pragma optimize("", off)
|
||||||
#pragma warning(disable: 4748)
|
#pragma warning(disable: 4748)
|
||||||
#endif
|
#endif
|
||||||
@ -276,7 +276,7 @@ void test_compressed_stream(int trace) {
|
|||||||
guarantee(fails == 0, "test failures");
|
guarantee(fails == 0, "test failures");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if _MSC_VER >=1400 && !defined(_WIN64)
|
#if defined(_MSC_VER) &&_MSC_VER >=1400 && !defined(_WIN64)
|
||||||
#pragma warning(default: 4748)
|
#pragma warning(default: 4748)
|
||||||
#pragma optimize("", on)
|
#pragma optimize("", on)
|
||||||
#endif
|
#endif
|
||||||
|
@ -505,7 +505,7 @@ void CompileTask::log_task(xmlStream* log) {
|
|||||||
ResourceMark rm(thread);
|
ResourceMark rm(thread);
|
||||||
|
|
||||||
// <task id='9' method='M' osr_bci='X' level='1' blocking='1' stamp='1.234'>
|
// <task id='9' method='M' osr_bci='X' level='1' blocking='1' stamp='1.234'>
|
||||||
if (_compile_id != 0) log->print(" compile_id='%d'", _compile_id);
|
log->print(" compile_id='%d'", _compile_id);
|
||||||
if (_osr_bci != CompileBroker::standard_entry_bci) {
|
if (_osr_bci != CompileBroker::standard_entry_bci) {
|
||||||
log->print(" compile_kind='osr'"); // same as nmethod::compile_kind
|
log->print(" compile_kind='osr'"); // same as nmethod::compile_kind
|
||||||
} // else compile_kind='c2c'
|
} // else compile_kind='c2c'
|
||||||
|
@ -2063,11 +2063,6 @@ void CMSCollector::do_mark_sweep_work(bool clear_all_soft_refs,
|
|||||||
// required.
|
// required.
|
||||||
_collectorState = FinalMarking;
|
_collectorState = FinalMarking;
|
||||||
}
|
}
|
||||||
if (PrintGCDetails &&
|
|
||||||
(_collectorState > Idling ||
|
|
||||||
!GCCause::is_user_requested_gc(GenCollectedHeap::heap()->gc_cause()))) {
|
|
||||||
gclog_or_tty->print(" (concurrent mode failure)");
|
|
||||||
}
|
|
||||||
collect_in_foreground(clear_all_soft_refs);
|
collect_in_foreground(clear_all_soft_refs);
|
||||||
|
|
||||||
// For a mark-sweep, compute_new_size() will be called
|
// For a mark-sweep, compute_new_size() will be called
|
||||||
@ -3400,10 +3395,10 @@ CMSPhaseAccounting::CMSPhaseAccounting(CMSCollector *collector,
|
|||||||
if (PrintCMSStatistics != 0) {
|
if (PrintCMSStatistics != 0) {
|
||||||
_collector->resetYields();
|
_collector->resetYields();
|
||||||
}
|
}
|
||||||
if (PrintGCDetails && PrintGCTimeStamps) {
|
if (PrintGCDetails) {
|
||||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
||||||
gclog_or_tty->stamp();
|
gclog_or_tty->stamp(PrintGCTimeStamps);
|
||||||
gclog_or_tty->print_cr(": [%s-concurrent-%s-start]",
|
gclog_or_tty->print_cr("[%s-concurrent-%s-start]",
|
||||||
_collector->cmsGen()->short_name(), _phase);
|
_collector->cmsGen()->short_name(), _phase);
|
||||||
}
|
}
|
||||||
_collector->resetTimer();
|
_collector->resetTimer();
|
||||||
|
@ -1310,11 +1310,6 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
|
|||||||
_markStack.expand();
|
_markStack.expand();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if VERIFY_OBJS_PROCESSED
|
|
||||||
_scan_obj_cl.objs_processed = 0;
|
|
||||||
ThreadLocalObjQueue::objs_enqueued = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Statistics
|
// Statistics
|
||||||
double now = os::elapsedTime();
|
double now = os::elapsedTime();
|
||||||
_remark_mark_times.add((mark_work_end - start) * 1000.0);
|
_remark_mark_times.add((mark_work_end - start) * 1000.0);
|
||||||
@ -2555,17 +2550,6 @@ void ConcurrentMark::checkpointRootsFinalWork() {
|
|||||||
guarantee(satb_mq_set.completed_buffers_num() == 0, "invariant");
|
guarantee(satb_mq_set.completed_buffers_num() == 0, "invariant");
|
||||||
|
|
||||||
print_stats();
|
print_stats();
|
||||||
|
|
||||||
#if VERIFY_OBJS_PROCESSED
|
|
||||||
if (_scan_obj_cl.objs_processed != ThreadLocalObjQueue::objs_enqueued) {
|
|
||||||
gclog_or_tty->print_cr("Processed = %d, enqueued = %d.",
|
|
||||||
_scan_obj_cl.objs_processed,
|
|
||||||
ThreadLocalObjQueue::objs_enqueued);
|
|
||||||
guarantee(_scan_obj_cl.objs_processed ==
|
|
||||||
ThreadLocalObjQueue::objs_enqueued,
|
|
||||||
"Different number of objs processed and enqueued.");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
@ -4111,7 +4095,7 @@ void CMTask::do_marking_step(double time_target_ms,
|
|||||||
// bitmap knows by how much we need to move it as it knows its
|
// bitmap knows by how much we need to move it as it knows its
|
||||||
// granularity).
|
// granularity).
|
||||||
assert(_finger < _region_limit, "invariant");
|
assert(_finger < _region_limit, "invariant");
|
||||||
HeapWord* new_finger = _nextMarkBitMap->nextWord(_finger);
|
HeapWord* new_finger = _nextMarkBitMap->nextObject(_finger);
|
||||||
// Check if bitmap iteration was aborted while scanning the last object
|
// Check if bitmap iteration was aborted while scanning the last object
|
||||||
if (new_finger >= _region_limit) {
|
if (new_finger >= _region_limit) {
|
||||||
giveup_current_region();
|
giveup_current_region();
|
||||||
|
@ -97,7 +97,6 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
|
|||||||
HeapWord* limit = NULL) const;
|
HeapWord* limit = NULL) const;
|
||||||
|
|
||||||
// conversion utilities
|
// conversion utilities
|
||||||
// XXX Fix these so that offsets are size_t's...
|
|
||||||
HeapWord* offsetToHeapWord(size_t offset) const {
|
HeapWord* offsetToHeapWord(size_t offset) const {
|
||||||
return _bmStartWord + (offset << _shifter);
|
return _bmStartWord + (offset << _shifter);
|
||||||
}
|
}
|
||||||
@ -105,8 +104,13 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
|
|||||||
return pointer_delta(addr, _bmStartWord) >> _shifter;
|
return pointer_delta(addr, _bmStartWord) >> _shifter;
|
||||||
}
|
}
|
||||||
int heapWordDiffToOffsetDiff(size_t diff) const;
|
int heapWordDiffToOffsetDiff(size_t diff) const;
|
||||||
HeapWord* nextWord(HeapWord* addr) {
|
|
||||||
return offsetToHeapWord(heapWordToOffset(addr) + 1);
|
// The argument addr should be the start address of a valid object
|
||||||
|
HeapWord* nextObject(HeapWord* addr) {
|
||||||
|
oop obj = (oop) addr;
|
||||||
|
HeapWord* res = addr + obj->size();
|
||||||
|
assert(offsetToHeapWord(heapWordToOffset(res)) == res, "sanity");
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
// debugging
|
// debugging
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -252,12 +252,10 @@ inline bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
|
|||||||
|
|
||||||
start_offset = _bm.get_next_one_offset(start_offset, end_offset);
|
start_offset = _bm.get_next_one_offset(start_offset, end_offset);
|
||||||
while (start_offset < end_offset) {
|
while (start_offset < end_offset) {
|
||||||
HeapWord* obj_addr = offsetToHeapWord(start_offset);
|
|
||||||
oop obj = (oop) obj_addr;
|
|
||||||
if (!cl->do_bit(start_offset)) {
|
if (!cl->do_bit(start_offset)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
HeapWord* next_addr = MIN2(obj_addr + obj->size(), end_addr);
|
HeapWord* next_addr = MIN2(nextObject(offsetToHeapWord(start_offset)), end_addr);
|
||||||
BitMap::idx_t next_offset = heapWordToOffset(next_addr);
|
BitMap::idx_t next_offset = heapWordToOffset(next_addr);
|
||||||
start_offset = _bm.get_next_one_offset(next_offset, end_offset);
|
start_offset = _bm.get_next_one_offset(next_offset, end_offset);
|
||||||
}
|
}
|
||||||
|
@ -409,7 +409,7 @@ HeapWord* ParallelScavengeHeap::mem_allocate(
|
|||||||
// heap remains parsable.
|
// heap remains parsable.
|
||||||
const bool limit_exceeded = size_policy()->gc_overhead_limit_exceeded();
|
const bool limit_exceeded = size_policy()->gc_overhead_limit_exceeded();
|
||||||
const bool softrefs_clear = collector_policy()->all_soft_refs_clear();
|
const bool softrefs_clear = collector_policy()->all_soft_refs_clear();
|
||||||
assert(!limit_exceeded || softrefs_clear, "Should have been cleared");
|
|
||||||
if (limit_exceeded && softrefs_clear) {
|
if (limit_exceeded && softrefs_clear) {
|
||||||
*gc_overhead_limit_was_exceeded = true;
|
*gc_overhead_limit_was_exceeded = true;
|
||||||
size_policy()->set_gc_overhead_limit_exceeded(false);
|
size_policy()->set_gc_overhead_limit_exceeded(false);
|
||||||
|
@ -948,6 +948,8 @@ void MutableNUMASpace::LGRPSpace::scan_pages(size_t page_size, size_t page_count
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (e != scan_end) {
|
if (e != scan_end) {
|
||||||
|
assert(e < scan_end, err_msg("e: " PTR_FORMAT " scan_end: " PTR_FORMAT, e, scan_end));
|
||||||
|
|
||||||
if ((page_expected.size != page_size || page_expected.lgrp_id != lgrp_id())
|
if ((page_expected.size != page_size || page_expected.lgrp_id != lgrp_id())
|
||||||
&& page_expected.size != 0) {
|
&& page_expected.size != 0) {
|
||||||
os::free_memory(s, pointer_delta(e, s, sizeof(char)), page_size);
|
os::free_memory(s, pointer_delta(e, s, sizeof(char)), page_size);
|
||||||
|
@ -186,7 +186,8 @@ class AbstractInterpreter: AllStatic {
|
|||||||
int caller_actual_parameters,
|
int caller_actual_parameters,
|
||||||
int callee_params,
|
int callee_params,
|
||||||
int callee_locals,
|
int callee_locals,
|
||||||
bool is_top_frame) {
|
bool is_top_frame,
|
||||||
|
bool is_bottom_frame) {
|
||||||
return layout_activation(method,
|
return layout_activation(method,
|
||||||
temps,
|
temps,
|
||||||
popframe_args,
|
popframe_args,
|
||||||
@ -196,7 +197,8 @@ class AbstractInterpreter: AllStatic {
|
|||||||
callee_locals,
|
callee_locals,
|
||||||
(frame*)NULL,
|
(frame*)NULL,
|
||||||
(frame*)NULL,
|
(frame*)NULL,
|
||||||
is_top_frame);
|
is_top_frame,
|
||||||
|
is_bottom_frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int layout_activation(Method* method,
|
static int layout_activation(Method* method,
|
||||||
@ -208,7 +210,8 @@ class AbstractInterpreter: AllStatic {
|
|||||||
int callee_locals,
|
int callee_locals,
|
||||||
frame* caller,
|
frame* caller,
|
||||||
frame* interpreter_frame,
|
frame* interpreter_frame,
|
||||||
bool is_top_frame);
|
bool is_top_frame,
|
||||||
|
bool is_bottom_frame);
|
||||||
|
|
||||||
// Runtime support
|
// Runtime support
|
||||||
static bool is_not_reached( methodHandle method, int bci);
|
static bool is_not_reached( methodHandle method, int bci);
|
||||||
|
@ -803,7 +803,7 @@ void LinkResolver::runtime_resolve_special_method(CallInfo& result, methodHandle
|
|||||||
if (!direct_calling_default_method &&
|
if (!direct_calling_default_method &&
|
||||||
check_access &&
|
check_access &&
|
||||||
// a) check if ACC_SUPER flag is set for the current class
|
// a) check if ACC_SUPER flag is set for the current class
|
||||||
current_klass->is_super() &&
|
(current_klass->is_super() || !AllowNonVirtualCalls) &&
|
||||||
// b) check if the method class is a superclass of the current class (superclass relation is not reflexive!)
|
// b) check if the method class is a superclass of the current class (superclass relation is not reflexive!)
|
||||||
current_klass->is_subtype_of(method_klass()) &&
|
current_klass->is_subtype_of(method_klass()) &&
|
||||||
current_klass() != method_klass() &&
|
current_klass() != method_klass() &&
|
||||||
|
@ -84,15 +84,13 @@ void Rewriter::make_constant_pool_cache(TRAPS) {
|
|||||||
const int length = _cp_cache_map.length();
|
const int length = _cp_cache_map.length();
|
||||||
ClassLoaderData* loader_data = _pool->pool_holder()->class_loader_data();
|
ClassLoaderData* loader_data = _pool->pool_holder()->class_loader_data();
|
||||||
ConstantPoolCache* cache =
|
ConstantPoolCache* cache =
|
||||||
ConstantPoolCache::allocate(loader_data, length, CHECK);
|
ConstantPoolCache::allocate(loader_data, length, _cp_cache_map,
|
||||||
|
_invokedynamic_references_map, CHECK);
|
||||||
|
|
||||||
// initialize object cache in constant pool
|
// initialize object cache in constant pool
|
||||||
_pool->initialize_resolved_references(loader_data, _resolved_references_map,
|
_pool->initialize_resolved_references(loader_data, _resolved_references_map,
|
||||||
_resolved_reference_limit,
|
_resolved_reference_limit,
|
||||||
CHECK);
|
CHECK);
|
||||||
|
|
||||||
No_Safepoint_Verifier nsv;
|
|
||||||
cache->initialize(_cp_cache_map, _invokedynamic_references_map);
|
|
||||||
_pool->set_cache(cache);
|
_pool->set_cache(cache);
|
||||||
cache->set_constant_pool(_pool());
|
cache->set_constant_pool(_pool());
|
||||||
}
|
}
|
||||||
|
@ -620,7 +620,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size,
|
|||||||
|
|
||||||
const bool limit_exceeded = size_policy()->gc_overhead_limit_exceeded();
|
const bool limit_exceeded = size_policy()->gc_overhead_limit_exceeded();
|
||||||
const bool softrefs_clear = all_soft_refs_clear();
|
const bool softrefs_clear = all_soft_refs_clear();
|
||||||
assert(!limit_exceeded || softrefs_clear, "Should have been cleared");
|
|
||||||
if (limit_exceeded && softrefs_clear) {
|
if (limit_exceeded && softrefs_clear) {
|
||||||
*gc_overhead_limit_was_exceeded = true;
|
*gc_overhead_limit_was_exceeded = true;
|
||||||
size_policy()->set_gc_overhead_limit_exceeded(false);
|
size_policy()->set_gc_overhead_limit_exceeded(false);
|
||||||
|
@ -112,12 +112,19 @@ public:
|
|||||||
char* region_base(int i) { return _header._space[i]._base; }
|
char* region_base(int i) { return _header._space[i]._base; }
|
||||||
struct FileMapHeader* header() { return &_header; }
|
struct FileMapHeader* header() { return &_header; }
|
||||||
|
|
||||||
static void set_current_info(FileMapInfo* info) { _current_info = info; }
|
static void set_current_info(FileMapInfo* info) {
|
||||||
static FileMapInfo* current_info() { return _current_info; }
|
CDS_ONLY(_current_info = info;)
|
||||||
|
}
|
||||||
|
|
||||||
|
static FileMapInfo* current_info() {
|
||||||
|
CDS_ONLY(return _current_info;)
|
||||||
|
NOT_CDS(return NULL;)
|
||||||
|
}
|
||||||
|
|
||||||
static void assert_mark(bool check);
|
static void assert_mark(bool check);
|
||||||
|
|
||||||
// File manipulation.
|
// File manipulation.
|
||||||
bool initialize();
|
bool initialize() NOT_CDS_RETURN_(false);
|
||||||
bool open_for_read();
|
bool open_for_read();
|
||||||
void open_for_write();
|
void open_for_write();
|
||||||
void write_header();
|
void write_header();
|
||||||
@ -141,7 +148,7 @@ public:
|
|||||||
void fail_continue(const char *msg, ...);
|
void fail_continue(const char *msg, ...);
|
||||||
|
|
||||||
// Return true if given address is in the mapped shared space.
|
// Return true if given address is in the mapped shared space.
|
||||||
bool is_in_shared_space(const void* p);
|
bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SHARE_VM_MEMORY_FILEMAP_HPP
|
#endif // SHARE_VM_MEMORY_FILEMAP_HPP
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -52,7 +52,6 @@ const bool metaspace_slow_verify = false;
|
|||||||
const uint metadata_deallocate_a_lot_block = 10;
|
const uint metadata_deallocate_a_lot_block = 10;
|
||||||
const uint metadata_deallocate_a_lock_chunk = 3;
|
const uint metadata_deallocate_a_lock_chunk = 3;
|
||||||
size_t const allocation_from_dictionary_limit = 64 * K;
|
size_t const allocation_from_dictionary_limit = 64 * K;
|
||||||
const size_t metadata_deallocate = 0xf5f5f5f5;
|
|
||||||
|
|
||||||
MetaWord* last_allocated = 0;
|
MetaWord* last_allocated = 0;
|
||||||
|
|
||||||
@ -2440,7 +2439,8 @@ void MetaspaceAux::print_on(outputStream* out, Metaspace::MetadataType mdtype) {
|
|||||||
free_chunks_capacity_bytes / K,
|
free_chunks_capacity_bytes / K,
|
||||||
used_and_free / K,
|
used_and_free / K,
|
||||||
capacity_bytes / K);
|
capacity_bytes / K);
|
||||||
assert(used_and_free == capacity_bytes, "Accounting is wrong");
|
// Accounting can only be correct if we got the values during a safepoint
|
||||||
|
assert(!SafepointSynchronize::is_at_safepoint() || used_and_free == capacity_bytes, "Accounting is wrong");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print total fragmentation for class and data metaspaces separately
|
// Print total fragmentation for class and data metaspaces separately
|
||||||
|
@ -885,6 +885,8 @@ ReservedSpace Universe::reserve_heap(size_t heap_size, size_t alignment) {
|
|||||||
// the actual alignment depends on its size.
|
// the actual alignment depends on its size.
|
||||||
Universe::set_class_metaspace_size(align_size_up(ClassMetaspaceSize, alignment));
|
Universe::set_class_metaspace_size(align_size_up(ClassMetaspaceSize, alignment));
|
||||||
size_t total_reserved = align_size_up(heap_size + Universe::class_metaspace_size(), alignment);
|
size_t total_reserved = align_size_up(heap_size + Universe::class_metaspace_size(), alignment);
|
||||||
|
assert(!UseCompressedOops || (total_reserved <= (OopEncodingHeapMax - os::vm_page_size())),
|
||||||
|
"heap size is too big for compressed oops");
|
||||||
char* addr = Universe::preferred_heap_base(total_reserved, Universe::UnscaledNarrowOop);
|
char* addr = Universe::preferred_heap_base(total_reserved, Universe::UnscaledNarrowOop);
|
||||||
|
|
||||||
ReservedHeapSpace total_rs(total_reserved, alignment, UseLargePages, addr);
|
ReservedHeapSpace total_rs(total_reserved, alignment, UseLargePages, addr);
|
||||||
|
@ -55,11 +55,24 @@ ConstMethod::ConstMethod(int byte_code_size,
|
|||||||
set_stackmap_data(NULL);
|
set_stackmap_data(NULL);
|
||||||
set_code_size(byte_code_size);
|
set_code_size(byte_code_size);
|
||||||
set_constMethod_size(size);
|
set_constMethod_size(size);
|
||||||
set_inlined_tables_length(sizes);
|
set_inlined_tables_length(sizes); // sets _flags
|
||||||
set_method_type(method_type);
|
set_method_type(method_type);
|
||||||
assert(this->size() == size, "wrong size for object");
|
assert(this->size() == size, "wrong size for object");
|
||||||
|
set_name_index(0);
|
||||||
|
set_signature_index(0);
|
||||||
|
set_constants(NULL);
|
||||||
|
set_max_stack(0);
|
||||||
|
set_max_locals(0);
|
||||||
|
set_method_idnum(0);
|
||||||
|
set_size_of_parameters(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Accessor that copies to metadata.
|
||||||
|
void ConstMethod::copy_stackmap_data(ClassLoaderData* loader_data,
|
||||||
|
u1* sd, int length, TRAPS) {
|
||||||
|
_stackmap_data = MetadataFactory::new_array<u1>(loader_data, length, CHECK);
|
||||||
|
memcpy((void*)_stackmap_data->adr_at(0), (void*)sd, length);
|
||||||
|
}
|
||||||
|
|
||||||
// Deallocate metadata fields associated with ConstMethod*
|
// Deallocate metadata fields associated with ConstMethod*
|
||||||
void ConstMethod::deallocate_contents(ClassLoaderData* loader_data) {
|
void ConstMethod::deallocate_contents(ClassLoaderData* loader_data) {
|
||||||
|
@ -280,6 +280,7 @@ public:
|
|||||||
// stackmap table data
|
// stackmap table data
|
||||||
Array<u1>* stackmap_data() const { return _stackmap_data; }
|
Array<u1>* stackmap_data() const { return _stackmap_data; }
|
||||||
void set_stackmap_data(Array<u1>* sd) { _stackmap_data = sd; }
|
void set_stackmap_data(Array<u1>* sd) { _stackmap_data = sd; }
|
||||||
|
void copy_stackmap_data(ClassLoaderData* loader_data, u1* sd, int length, TRAPS);
|
||||||
bool has_stackmap_table() const { return _stackmap_data != NULL; }
|
bool has_stackmap_table() const { return _stackmap_data != NULL; }
|
||||||
|
|
||||||
void init_fingerprint() {
|
void init_fingerprint() {
|
||||||
|
@ -44,6 +44,8 @@
|
|||||||
void ConstantPoolCacheEntry::initialize_entry(int index) {
|
void ConstantPoolCacheEntry::initialize_entry(int index) {
|
||||||
assert(0 < index && index < 0x10000, "sanity check");
|
assert(0 < index && index < 0x10000, "sanity check");
|
||||||
_indices = index;
|
_indices = index;
|
||||||
|
_f1 = NULL;
|
||||||
|
_f2 = _flags = 0;
|
||||||
assert(constant_pool_index() == index, "");
|
assert(constant_pool_index() == index, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,13 +535,17 @@ void ConstantPoolCacheEntry::verify(outputStream* st) const {
|
|||||||
|
|
||||||
// Implementation of ConstantPoolCache
|
// Implementation of ConstantPoolCache
|
||||||
|
|
||||||
ConstantPoolCache* ConstantPoolCache::allocate(ClassLoaderData* loader_data, int length, TRAPS) {
|
ConstantPoolCache* ConstantPoolCache::allocate(ClassLoaderData* loader_data,
|
||||||
|
int length,
|
||||||
|
const intStack& index_map,
|
||||||
|
const intStack& invokedynamic_map, TRAPS) {
|
||||||
int size = ConstantPoolCache::size(length);
|
int size = ConstantPoolCache::size(length);
|
||||||
|
|
||||||
return new (loader_data, size, false, THREAD) ConstantPoolCache(length);
|
return new (loader_data, size, false, THREAD) ConstantPoolCache(length, index_map, invokedynamic_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConstantPoolCache::initialize(intArray& inverse_index_map, intArray& invokedynamic_references_map) {
|
void ConstantPoolCache::initialize(const intArray& inverse_index_map,
|
||||||
|
const intArray& invokedynamic_references_map) {
|
||||||
assert(inverse_index_map.length() == length(), "inverse index map must have same length as cache");
|
assert(inverse_index_map.length() == length(), "inverse index map must have same length as cache");
|
||||||
for (int i = 0; i < length(); i++) {
|
for (int i = 0; i < length(); i++) {
|
||||||
ConstantPoolCacheEntry* e = entry_at(i);
|
ConstantPoolCacheEntry* e = entry_at(i);
|
||||||
|
@ -377,14 +377,21 @@ class ConstantPoolCache: public MetaspaceObj {
|
|||||||
debug_only(friend class ClassVerifier;)
|
debug_only(friend class ClassVerifier;)
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
ConstantPoolCache(int length) : _length(length), _constant_pool(NULL) {
|
ConstantPoolCache(int length, const intStack& inverse_index_map,
|
||||||
|
const intStack& invokedynamic_references_map) :
|
||||||
|
_length(length), _constant_pool(NULL) {
|
||||||
|
initialize(inverse_index_map, invokedynamic_references_map);
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
assert(entry_at(i)->is_f1_null(), "Failed to clear?");
|
assert(entry_at(i)->is_f1_null(), "Failed to clear?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialization
|
||||||
|
void initialize(const intArray& inverse_index_map, const intArray& invokedynamic_references_map);
|
||||||
public:
|
public:
|
||||||
static ConstantPoolCache* allocate(ClassLoaderData* loader_data, int length, TRAPS);
|
static ConstantPoolCache* allocate(ClassLoaderData* loader_data, int length,
|
||||||
|
const intStack& inverse_index_map,
|
||||||
|
const intStack& invokedynamic_references_map, TRAPS);
|
||||||
bool is_constantPoolCache() const { return true; }
|
bool is_constantPoolCache() const { return true; }
|
||||||
|
|
||||||
int length() const { return _length; }
|
int length() const { return _length; }
|
||||||
@ -405,9 +412,6 @@ class ConstantPoolCache: public MetaspaceObj {
|
|||||||
friend class ConstantPoolCacheEntry;
|
friend class ConstantPoolCacheEntry;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Initialization
|
|
||||||
void initialize(intArray& inverse_index_map, intArray& invokedynamic_references_map);
|
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
void set_constant_pool(ConstantPool* pool) { _constant_pool = pool; }
|
void set_constant_pool(ConstantPool* pool) { _constant_pool = pool; }
|
||||||
ConstantPool* constant_pool() const { return _constant_pool; }
|
ConstantPool* constant_pool() const { return _constant_pool; }
|
||||||
|
@ -165,7 +165,8 @@ HS_DTRACE_PROBE_DECL5(hotspot, class__initialization__end,
|
|||||||
|
|
||||||
volatile int InstanceKlass::_total_instanceKlass_count = 0;
|
volatile int InstanceKlass::_total_instanceKlass_count = 0;
|
||||||
|
|
||||||
Klass* InstanceKlass::allocate_instance_klass(ClassLoaderData* loader_data,
|
InstanceKlass* InstanceKlass::allocate_instance_klass(
|
||||||
|
ClassLoaderData* loader_data,
|
||||||
int vtable_len,
|
int vtable_len,
|
||||||
int itable_len,
|
int itable_len,
|
||||||
int static_field_size,
|
int static_field_size,
|
||||||
@ -207,10 +208,35 @@ Klass* InstanceKlass::allocate_instance_klass(ClassLoaderData* loader_data,
|
|||||||
access_flags, is_anonymous);
|
access_flags, is_anonymous);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for pending exception before adding to the loader data and incrementing
|
||||||
|
// class count. Can get OOM here.
|
||||||
|
if (HAS_PENDING_EXCEPTION) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add all classes to our internal class loader list here,
|
||||||
|
// including classes in the bootstrap (NULL) class loader.
|
||||||
|
loader_data->add_class(ik);
|
||||||
|
|
||||||
Atomic::inc(&_total_instanceKlass_count);
|
Atomic::inc(&_total_instanceKlass_count);
|
||||||
return ik;
|
return ik;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// copy method ordering from resource area to Metaspace
|
||||||
|
void InstanceKlass::copy_method_ordering(intArray* m, TRAPS) {
|
||||||
|
if (m != NULL) {
|
||||||
|
// allocate a new array and copy contents (memcpy?)
|
||||||
|
_method_ordering = MetadataFactory::new_array<int>(class_loader_data(), m->length(), CHECK);
|
||||||
|
for (int i = 0; i < m->length(); i++) {
|
||||||
|
_method_ordering->at_put(i, m->at(i));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_method_ordering = Universe::the_empty_int_array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
InstanceKlass::InstanceKlass(int vtable_len,
|
InstanceKlass::InstanceKlass(int vtable_len,
|
||||||
int itable_len,
|
int itable_len,
|
||||||
int static_field_size,
|
int static_field_size,
|
||||||
@ -220,72 +246,116 @@ InstanceKlass::InstanceKlass(int vtable_len,
|
|||||||
bool is_anonymous) {
|
bool is_anonymous) {
|
||||||
No_Safepoint_Verifier no_safepoint; // until k becomes parsable
|
No_Safepoint_Verifier no_safepoint; // until k becomes parsable
|
||||||
|
|
||||||
int size = InstanceKlass::size(vtable_len, itable_len, nonstatic_oop_map_size,
|
int iksize = InstanceKlass::size(vtable_len, itable_len, nonstatic_oop_map_size,
|
||||||
access_flags.is_interface(), is_anonymous);
|
access_flags.is_interface(), is_anonymous);
|
||||||
|
|
||||||
// The sizes of these these three variables are used for determining the
|
set_vtable_length(vtable_len);
|
||||||
// size of the instanceKlassOop. It is critical that these are set to the right
|
set_itable_length(itable_len);
|
||||||
// sizes before the first GC, i.e., when we allocate the mirror.
|
set_static_field_size(static_field_size);
|
||||||
this->set_vtable_length(vtable_len);
|
set_nonstatic_oop_map_size(nonstatic_oop_map_size);
|
||||||
this->set_itable_length(itable_len);
|
set_access_flags(access_flags);
|
||||||
this->set_static_field_size(static_field_size);
|
_misc_flags = 0; // initialize to zero
|
||||||
this->set_nonstatic_oop_map_size(nonstatic_oop_map_size);
|
set_is_anonymous(is_anonymous);
|
||||||
this->set_access_flags(access_flags);
|
assert(size() == iksize, "wrong size for object");
|
||||||
this->set_is_anonymous(is_anonymous);
|
|
||||||
assert(this->size() == size, "wrong size for object");
|
|
||||||
|
|
||||||
this->set_array_klasses(NULL);
|
set_array_klasses(NULL);
|
||||||
this->set_methods(NULL);
|
set_methods(NULL);
|
||||||
this->set_method_ordering(NULL);
|
set_method_ordering(NULL);
|
||||||
this->set_local_interfaces(NULL);
|
set_local_interfaces(NULL);
|
||||||
this->set_transitive_interfaces(NULL);
|
set_transitive_interfaces(NULL);
|
||||||
this->init_implementor();
|
init_implementor();
|
||||||
this->set_fields(NULL, 0);
|
set_fields(NULL, 0);
|
||||||
this->set_constants(NULL);
|
set_constants(NULL);
|
||||||
this->set_class_loader_data(NULL);
|
set_class_loader_data(NULL);
|
||||||
this->set_protection_domain(NULL);
|
set_protection_domain(NULL);
|
||||||
this->set_signers(NULL);
|
set_signers(NULL);
|
||||||
this->set_source_file_name(NULL);
|
set_source_file_name(NULL);
|
||||||
this->set_source_debug_extension(NULL, 0);
|
set_source_debug_extension(NULL, 0);
|
||||||
this->set_array_name(NULL);
|
set_array_name(NULL);
|
||||||
this->set_inner_classes(NULL);
|
set_inner_classes(NULL);
|
||||||
this->set_static_oop_field_count(0);
|
set_static_oop_field_count(0);
|
||||||
this->set_nonstatic_field_size(0);
|
set_nonstatic_field_size(0);
|
||||||
this->set_is_marked_dependent(false);
|
set_is_marked_dependent(false);
|
||||||
this->set_init_state(InstanceKlass::allocated);
|
set_init_state(InstanceKlass::allocated);
|
||||||
this->set_init_thread(NULL);
|
set_init_thread(NULL);
|
||||||
this->set_init_lock(NULL);
|
set_init_lock(NULL);
|
||||||
this->set_reference_type(rt);
|
set_reference_type(rt);
|
||||||
this->set_oop_map_cache(NULL);
|
set_oop_map_cache(NULL);
|
||||||
this->set_jni_ids(NULL);
|
set_jni_ids(NULL);
|
||||||
this->set_osr_nmethods_head(NULL);
|
set_osr_nmethods_head(NULL);
|
||||||
this->set_breakpoints(NULL);
|
set_breakpoints(NULL);
|
||||||
this->init_previous_versions();
|
init_previous_versions();
|
||||||
this->set_generic_signature(NULL);
|
set_generic_signature(NULL);
|
||||||
this->release_set_methods_jmethod_ids(NULL);
|
release_set_methods_jmethod_ids(NULL);
|
||||||
this->release_set_methods_cached_itable_indices(NULL);
|
release_set_methods_cached_itable_indices(NULL);
|
||||||
this->set_annotations(NULL);
|
set_annotations(NULL);
|
||||||
this->set_jvmti_cached_class_field_map(NULL);
|
set_jvmti_cached_class_field_map(NULL);
|
||||||
this->set_initial_method_idnum(0);
|
set_initial_method_idnum(0);
|
||||||
|
_dependencies = NULL;
|
||||||
|
set_jvmti_cached_class_field_map(NULL);
|
||||||
|
set_cached_class_file(NULL, 0);
|
||||||
|
set_initial_method_idnum(0);
|
||||||
|
set_minor_version(0);
|
||||||
|
set_major_version(0);
|
||||||
|
NOT_PRODUCT(_verify_count = 0;)
|
||||||
|
|
||||||
// initialize the non-header words to zero
|
// initialize the non-header words to zero
|
||||||
intptr_t* p = (intptr_t*)this;
|
intptr_t* p = (intptr_t*)this;
|
||||||
for (int index = InstanceKlass::header_size(); index < size; index++) {
|
for (int index = InstanceKlass::header_size(); index < iksize; index++) {
|
||||||
p[index] = NULL_WORD;
|
p[index] = NULL_WORD;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set temporary value until parseClassFile updates it with the real instance
|
// Set temporary value until parseClassFile updates it with the real instance
|
||||||
// size.
|
// size.
|
||||||
this->set_layout_helper(Klass::instance_layout_helper(0, true));
|
set_layout_helper(Klass::instance_layout_helper(0, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void InstanceKlass::deallocate_methods(ClassLoaderData* loader_data,
|
||||||
|
Array<Method*>* methods) {
|
||||||
|
if (methods != NULL && methods != Universe::the_empty_method_array()) {
|
||||||
|
for (int i = 0; i < methods->length(); i++) {
|
||||||
|
Method* method = methods->at(i);
|
||||||
|
if (method == NULL) continue; // maybe null if error processing
|
||||||
|
// Only want to delete methods that are not executing for RedefineClasses.
|
||||||
|
// The previous version will point to them so they're not totally dangling
|
||||||
|
assert (!method->on_stack(), "shouldn't be called with methods on stack");
|
||||||
|
MetadataFactory::free_metadata(loader_data, method);
|
||||||
|
}
|
||||||
|
MetadataFactory::free_array<Method*>(loader_data, methods);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void InstanceKlass::deallocate_interfaces(ClassLoaderData* loader_data,
|
||||||
|
Klass* super_klass,
|
||||||
|
Array<Klass*>* local_interfaces,
|
||||||
|
Array<Klass*>* transitive_interfaces) {
|
||||||
|
// Only deallocate transitive interfaces if not empty, same as super class
|
||||||
|
// or same as local interfaces. See code in parseClassFile.
|
||||||
|
Array<Klass*>* ti = transitive_interfaces;
|
||||||
|
if (ti != Universe::the_empty_klass_array() && ti != local_interfaces) {
|
||||||
|
// check that the interfaces don't come from super class
|
||||||
|
Array<Klass*>* sti = (super_klass == NULL) ? NULL :
|
||||||
|
InstanceKlass::cast(super_klass)->transitive_interfaces();
|
||||||
|
if (ti != sti) {
|
||||||
|
MetadataFactory::free_array<Klass*>(loader_data, ti);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// local interfaces can be empty
|
||||||
|
if (local_interfaces != Universe::the_empty_klass_array()) {
|
||||||
|
MetadataFactory::free_array<Klass*>(loader_data, local_interfaces);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This function deallocates the metadata and C heap pointers that the
|
// This function deallocates the metadata and C heap pointers that the
|
||||||
// InstanceKlass points to.
|
// InstanceKlass points to.
|
||||||
void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) {
|
void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) {
|
||||||
|
|
||||||
// Orphan the mirror first, CMS thinks it's still live.
|
// Orphan the mirror first, CMS thinks it's still live.
|
||||||
java_lang_Class::set_klass(java_mirror(), NULL);
|
if (java_mirror() != NULL) {
|
||||||
|
java_lang_Class::set_klass(java_mirror(), NULL);
|
||||||
|
}
|
||||||
|
|
||||||
// Need to take this class off the class loader data list.
|
// Need to take this class off the class loader data list.
|
||||||
loader_data->remove_class(this);
|
loader_data->remove_class(this);
|
||||||
@ -300,17 +370,7 @@ void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) {
|
|||||||
// reference counting symbol names.
|
// reference counting symbol names.
|
||||||
release_C_heap_structures();
|
release_C_heap_structures();
|
||||||
|
|
||||||
Array<Method*>* ms = methods();
|
deallocate_methods(loader_data, methods());
|
||||||
if (ms != Universe::the_empty_method_array()) {
|
|
||||||
for (int i = 0; i <= methods()->length() -1 ; i++) {
|
|
||||||
Method* method = methods()->at(i);
|
|
||||||
// Only want to delete methods that are not executing for RedefineClasses.
|
|
||||||
// The previous version will point to them so they're not totally dangling
|
|
||||||
assert (!method->on_stack(), "shouldn't be called with methods on stack");
|
|
||||||
MetadataFactory::free_metadata(loader_data, method);
|
|
||||||
}
|
|
||||||
MetadataFactory::free_array<Method*>(loader_data, methods());
|
|
||||||
}
|
|
||||||
set_methods(NULL);
|
set_methods(NULL);
|
||||||
|
|
||||||
if (method_ordering() != Universe::the_empty_int_array()) {
|
if (method_ordering() != Universe::the_empty_int_array()) {
|
||||||
@ -327,24 +387,8 @@ void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) {
|
|||||||
}
|
}
|
||||||
set_secondary_supers(NULL);
|
set_secondary_supers(NULL);
|
||||||
|
|
||||||
// Only deallocate transitive interfaces if not empty, same as super class
|
deallocate_interfaces(loader_data, super(), local_interfaces(), transitive_interfaces());
|
||||||
// or same as local interfaces. See code in parseClassFile.
|
|
||||||
Array<Klass*>* ti = transitive_interfaces();
|
|
||||||
if (ti != Universe::the_empty_klass_array() && ti != local_interfaces()) {
|
|
||||||
// check that the interfaces don't come from super class
|
|
||||||
Array<Klass*>* sti = (super() == NULL) ? NULL :
|
|
||||||
InstanceKlass::cast(super())->transitive_interfaces();
|
|
||||||
if (ti != sti) {
|
|
||||||
MetadataFactory::free_array<Klass*>(loader_data, ti);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set_transitive_interfaces(NULL);
|
set_transitive_interfaces(NULL);
|
||||||
|
|
||||||
// local interfaces can be empty
|
|
||||||
Array<Klass*>* li = local_interfaces();
|
|
||||||
if (li != Universe::the_empty_klass_array()) {
|
|
||||||
MetadataFactory::free_array<Klass*>(loader_data, li);
|
|
||||||
}
|
|
||||||
set_local_interfaces(NULL);
|
set_local_interfaces(NULL);
|
||||||
|
|
||||||
MetadataFactory::free_array<jushort>(loader_data, fields());
|
MetadataFactory::free_array<jushort>(loader_data, fields());
|
||||||
@ -352,9 +396,11 @@ void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) {
|
|||||||
|
|
||||||
// If a method from a redefined class is using this constant pool, don't
|
// If a method from a redefined class is using this constant pool, don't
|
||||||
// delete it, yet. The new class's previous version will point to this.
|
// delete it, yet. The new class's previous version will point to this.
|
||||||
assert (!constants()->on_stack(), "shouldn't be called if anything is onstack");
|
if (constants() != NULL) {
|
||||||
MetadataFactory::free_metadata(loader_data, constants());
|
assert (!constants()->on_stack(), "shouldn't be called if anything is onstack");
|
||||||
set_constants(NULL);
|
MetadataFactory::free_metadata(loader_data, constants());
|
||||||
|
set_constants(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (inner_classes() != Universe::the_empty_short_array()) {
|
if (inner_classes() != Universe::the_empty_short_array()) {
|
||||||
MetadataFactory::free_array<jushort>(loader_data, inner_classes());
|
MetadataFactory::free_array<jushort>(loader_data, inner_classes());
|
||||||
@ -2785,7 +2831,7 @@ void InstanceKlass::print_on(outputStream* st) const {
|
|||||||
st->print(BULLET"protection domain: "); ((InstanceKlass*)this)->protection_domain()->print_value_on(st); st->cr();
|
st->print(BULLET"protection domain: "); ((InstanceKlass*)this)->protection_domain()->print_value_on(st); st->cr();
|
||||||
st->print(BULLET"host class: "); host_klass()->print_value_on_maybe_null(st); st->cr();
|
st->print(BULLET"host class: "); host_klass()->print_value_on_maybe_null(st); st->cr();
|
||||||
st->print(BULLET"signers: "); signers()->print_value_on(st); st->cr();
|
st->print(BULLET"signers: "); signers()->print_value_on(st); st->cr();
|
||||||
st->print(BULLET"init_lock: "); ((oop)init_lock())->print_value_on(st); st->cr();
|
st->print(BULLET"init_lock: "); ((oop)_init_lock)->print_value_on(st); st->cr();
|
||||||
if (source_file_name() != NULL) {
|
if (source_file_name() != NULL) {
|
||||||
st->print(BULLET"source file: ");
|
st->print(BULLET"source file: ");
|
||||||
source_file_name()->print_value_on(st);
|
source_file_name()->print_value_on(st);
|
||||||
|
@ -147,7 +147,8 @@ class InstanceKlass: public Klass {
|
|||||||
AccessFlags access_flags,
|
AccessFlags access_flags,
|
||||||
bool is_anonymous);
|
bool is_anonymous);
|
||||||
public:
|
public:
|
||||||
static Klass* allocate_instance_klass(ClassLoaderData* loader_data,
|
static InstanceKlass* allocate_instance_klass(
|
||||||
|
ClassLoaderData* loader_data,
|
||||||
int vtable_len,
|
int vtable_len,
|
||||||
int itable_len,
|
int itable_len,
|
||||||
int static_field_size,
|
int static_field_size,
|
||||||
@ -266,9 +267,10 @@ class InstanceKlass: public Klass {
|
|||||||
u1 _init_state; // state of class
|
u1 _init_state; // state of class
|
||||||
u1 _reference_type; // reference type
|
u1 _reference_type; // reference type
|
||||||
|
|
||||||
|
|
||||||
JvmtiCachedClassFieldMap* _jvmti_cached_class_field_map; // JVMTI: used during heap iteration
|
JvmtiCachedClassFieldMap* _jvmti_cached_class_field_map; // JVMTI: used during heap iteration
|
||||||
|
|
||||||
|
NOT_PRODUCT(int _verify_count;) // to avoid redundant verifies
|
||||||
|
|
||||||
// Method array.
|
// Method array.
|
||||||
Array<Method*>* _methods;
|
Array<Method*>* _methods;
|
||||||
// Interface (Klass*s) this class declares locally to implement.
|
// Interface (Klass*s) this class declares locally to implement.
|
||||||
@ -356,16 +358,19 @@ class InstanceKlass: public Klass {
|
|||||||
// method ordering
|
// method ordering
|
||||||
Array<int>* method_ordering() const { return _method_ordering; }
|
Array<int>* method_ordering() const { return _method_ordering; }
|
||||||
void set_method_ordering(Array<int>* m) { _method_ordering = m; }
|
void set_method_ordering(Array<int>* m) { _method_ordering = m; }
|
||||||
|
void copy_method_ordering(intArray* m, TRAPS);
|
||||||
|
|
||||||
// interfaces
|
// interfaces
|
||||||
Array<Klass*>* local_interfaces() const { return _local_interfaces; }
|
Array<Klass*>* local_interfaces() const { return _local_interfaces; }
|
||||||
void set_local_interfaces(Array<Klass*>* a) {
|
void set_local_interfaces(Array<Klass*>* a) {
|
||||||
guarantee(_local_interfaces == NULL || a == NULL, "Just checking");
|
guarantee(_local_interfaces == NULL || a == NULL, "Just checking");
|
||||||
_local_interfaces = a; }
|
_local_interfaces = a; }
|
||||||
|
|
||||||
Array<Klass*>* transitive_interfaces() const { return _transitive_interfaces; }
|
Array<Klass*>* transitive_interfaces() const { return _transitive_interfaces; }
|
||||||
void set_transitive_interfaces(Array<Klass*>* a) {
|
void set_transitive_interfaces(Array<Klass*>* a) {
|
||||||
guarantee(_transitive_interfaces == NULL || a == NULL, "Just checking");
|
guarantee(_transitive_interfaces == NULL || a == NULL, "Just checking");
|
||||||
_transitive_interfaces = a; }
|
_transitive_interfaces = a;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class fieldDescriptor;
|
friend class fieldDescriptor;
|
||||||
@ -381,10 +386,9 @@ class InstanceKlass: public Klass {
|
|||||||
int java_fields_count() const { return (int)_java_fields_count; }
|
int java_fields_count() const { return (int)_java_fields_count; }
|
||||||
|
|
||||||
Array<u2>* fields() const { return _fields; }
|
Array<u2>* fields() const { return _fields; }
|
||||||
|
|
||||||
void set_fields(Array<u2>* f, u2 java_fields_count) {
|
void set_fields(Array<u2>* f, u2 java_fields_count) {
|
||||||
guarantee(_fields == NULL || f == NULL, "Just checking");
|
guarantee(_fields == NULL || f == NULL, "Just checking");
|
||||||
_fields = f;
|
_fields = f;
|
||||||
_java_fields_count = java_fields_count;
|
_java_fields_count = java_fields_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -588,7 +592,7 @@ class InstanceKlass: public Klass {
|
|||||||
|
|
||||||
// symbol unloading support (refcount already added)
|
// symbol unloading support (refcount already added)
|
||||||
Symbol* array_name() { return _array_name; }
|
Symbol* array_name() { return _array_name; }
|
||||||
void set_array_name(Symbol* name) { assert(_array_name == NULL, "name already created"); _array_name = name; }
|
void set_array_name(Symbol* name) { assert(_array_name == NULL || name == NULL, "name already created"); _array_name = name; }
|
||||||
|
|
||||||
// nonstatic oop-map blocks
|
// nonstatic oop-map blocks
|
||||||
static int nonstatic_oop_map_size(unsigned int oop_map_count) {
|
static int nonstatic_oop_map_size(unsigned int oop_map_count) {
|
||||||
@ -914,8 +918,15 @@ class InstanceKlass: public Klass {
|
|||||||
void clean_method_data(BoolObjectClosure* is_alive);
|
void clean_method_data(BoolObjectClosure* is_alive);
|
||||||
|
|
||||||
// Explicit metaspace deallocation of fields
|
// Explicit metaspace deallocation of fields
|
||||||
// For RedefineClasses, we need to deallocate instanceKlasses
|
// For RedefineClasses and class file parsing errors, we need to deallocate
|
||||||
|
// instanceKlasses and the metadata they point to.
|
||||||
void deallocate_contents(ClassLoaderData* loader_data);
|
void deallocate_contents(ClassLoaderData* loader_data);
|
||||||
|
static void deallocate_methods(ClassLoaderData* loader_data,
|
||||||
|
Array<Method*>* methods);
|
||||||
|
void static deallocate_interfaces(ClassLoaderData* loader_data,
|
||||||
|
Klass* super_klass,
|
||||||
|
Array<Klass*>* local_interfaces,
|
||||||
|
Array<Klass*>* transitive_interfaces);
|
||||||
|
|
||||||
// The constant pool is on stack if any of the methods are executing or
|
// The constant pool is on stack if any of the methods are executing or
|
||||||
// referenced by handles.
|
// referenced by handles.
|
||||||
|
@ -146,16 +146,16 @@ void* Klass::operator new(size_t size, ClassLoaderData* loader_data, size_t word
|
|||||||
Klass::Klass() {
|
Klass::Klass() {
|
||||||
Klass* k = this;
|
Klass* k = this;
|
||||||
|
|
||||||
{ // Preinitialize supertype information.
|
// Preinitialize supertype information.
|
||||||
// A later call to initialize_supers() may update these settings:
|
// A later call to initialize_supers() may update these settings:
|
||||||
set_super(NULL);
|
set_super(NULL);
|
||||||
for (juint i = 0; i < Klass::primary_super_limit(); i++) {
|
for (juint i = 0; i < Klass::primary_super_limit(); i++) {
|
||||||
_primary_supers[i] = NULL;
|
_primary_supers[i] = NULL;
|
||||||
}
|
|
||||||
set_secondary_supers(NULL);
|
|
||||||
_primary_supers[0] = k;
|
|
||||||
set_super_check_offset(in_bytes(primary_supers_offset()));
|
|
||||||
}
|
}
|
||||||
|
set_secondary_supers(NULL);
|
||||||
|
set_secondary_super_cache(NULL);
|
||||||
|
_primary_supers[0] = k;
|
||||||
|
set_super_check_offset(in_bytes(primary_supers_offset()));
|
||||||
|
|
||||||
set_java_mirror(NULL);
|
set_java_mirror(NULL);
|
||||||
set_modifier_flags(0);
|
set_modifier_flags(0);
|
||||||
|
@ -79,7 +79,6 @@
|
|||||||
// [last_biased_lock_bulk_revocation_time] (64 bits)
|
// [last_biased_lock_bulk_revocation_time] (64 bits)
|
||||||
// [prototype_header]
|
// [prototype_header]
|
||||||
// [biased_lock_revocation_count]
|
// [biased_lock_revocation_count]
|
||||||
// [verify_count ] - not in product
|
|
||||||
// [alloc_count ]
|
// [alloc_count ]
|
||||||
// [_modified_oops]
|
// [_modified_oops]
|
||||||
// [_accumulated_modified_oops]
|
// [_accumulated_modified_oops]
|
||||||
@ -172,10 +171,6 @@ class Klass : public Metadata {
|
|||||||
markOop _prototype_header; // Used when biased locking is both enabled and disabled for this type
|
markOop _prototype_header; // Used when biased locking is both enabled and disabled for this type
|
||||||
jint _biased_lock_revocation_count;
|
jint _biased_lock_revocation_count;
|
||||||
|
|
||||||
#ifndef PRODUCT
|
|
||||||
int _verify_count; // to avoid redundant verifies
|
|
||||||
#endif
|
|
||||||
|
|
||||||
juint _alloc_count; // allocation profiling support
|
juint _alloc_count; // allocation profiling support
|
||||||
|
|
||||||
TRACE_DEFINE_KLASS_TRACE_ID;
|
TRACE_DEFINE_KLASS_TRACE_ID;
|
||||||
|
@ -77,22 +77,19 @@ Method* Method::allocate(ClassLoaderData* loader_data,
|
|||||||
return new (loader_data, size, false, THREAD) Method(cm, access_flags, size);
|
return new (loader_data, size, false, THREAD) Method(cm, access_flags, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
Method::Method(ConstMethod* xconst,
|
Method::Method(ConstMethod* xconst, AccessFlags access_flags, int size) {
|
||||||
AccessFlags access_flags, int size) {
|
|
||||||
No_Safepoint_Verifier no_safepoint;
|
No_Safepoint_Verifier no_safepoint;
|
||||||
set_constMethod(xconst);
|
set_constMethod(xconst);
|
||||||
set_access_flags(access_flags);
|
set_access_flags(access_flags);
|
||||||
set_method_size(size);
|
set_method_size(size);
|
||||||
set_name_index(0);
|
|
||||||
set_signature_index(0);
|
|
||||||
#ifdef CC_INTERP
|
#ifdef CC_INTERP
|
||||||
set_result_index(T_VOID);
|
set_result_index(T_VOID);
|
||||||
#endif
|
#endif
|
||||||
set_constants(NULL);
|
|
||||||
set_max_stack(0);
|
|
||||||
set_max_locals(0);
|
|
||||||
set_intrinsic_id(vmIntrinsics::_none);
|
set_intrinsic_id(vmIntrinsics::_none);
|
||||||
set_jfr_towrite(false);
|
set_jfr_towrite(false);
|
||||||
|
set_force_inline(false);
|
||||||
|
set_hidden(false);
|
||||||
|
set_dont_inline(false);
|
||||||
set_method_data(NULL);
|
set_method_data(NULL);
|
||||||
set_interpreter_throwout_count(0);
|
set_interpreter_throwout_count(0);
|
||||||
set_vtable_index(Method::garbage_vtable_index);
|
set_vtable_index(Method::garbage_vtable_index);
|
||||||
|
@ -652,23 +652,25 @@ MethodData::MethodData(methodHandle method, int size, TRAPS) {
|
|||||||
// Set the method back-pointer.
|
// Set the method back-pointer.
|
||||||
_method = method();
|
_method = method();
|
||||||
|
|
||||||
if (TieredCompilation) {
|
_invocation_counter.init();
|
||||||
_invocation_counter.init();
|
_backedge_counter.init();
|
||||||
_backedge_counter.init();
|
_invocation_counter_start = 0;
|
||||||
_invocation_counter_start = 0;
|
_backedge_counter_start = 0;
|
||||||
_backedge_counter_start = 0;
|
_num_loops = 0;
|
||||||
_num_loops = 0;
|
_num_blocks = 0;
|
||||||
_num_blocks = 0;
|
_highest_comp_level = 0;
|
||||||
_highest_comp_level = 0;
|
_highest_osr_comp_level = 0;
|
||||||
_highest_osr_comp_level = 0;
|
_would_profile = true;
|
||||||
_would_profile = true;
|
|
||||||
}
|
|
||||||
set_creation_mileage(mileage_of(method()));
|
set_creation_mileage(mileage_of(method()));
|
||||||
|
|
||||||
// Initialize flags and trap history.
|
// Initialize flags and trap history.
|
||||||
_nof_decompiles = 0;
|
_nof_decompiles = 0;
|
||||||
_nof_overflow_recompiles = 0;
|
_nof_overflow_recompiles = 0;
|
||||||
_nof_overflow_traps = 0;
|
_nof_overflow_traps = 0;
|
||||||
|
_eflags = 0;
|
||||||
|
_arg_local = 0;
|
||||||
|
_arg_stack = 0;
|
||||||
|
_arg_returned = 0;
|
||||||
assert(sizeof(_trap_hist) % sizeof(HeapWord) == 0, "align");
|
assert(sizeof(_trap_hist) % sizeof(HeapWord) == 0, "align");
|
||||||
Copy::zero_to_words((HeapWord*) &_trap_hist,
|
Copy::zero_to_words((HeapWord*) &_trap_hist,
|
||||||
sizeof(_trap_hist) / sizeof(HeapWord));
|
sizeof(_trap_hist) / sizeof(HeapWord));
|
||||||
@ -677,6 +679,7 @@ MethodData::MethodData(methodHandle method, int size, TRAPS) {
|
|||||||
// corresponding data cells.
|
// corresponding data cells.
|
||||||
int data_size = 0;
|
int data_size = 0;
|
||||||
int empty_bc_count = 0; // number of bytecodes lacking data
|
int empty_bc_count = 0; // number of bytecodes lacking data
|
||||||
|
_data[0] = 0; // apparently not set below.
|
||||||
BytecodeStream stream(method);
|
BytecodeStream stream(method);
|
||||||
Bytecodes::Code c;
|
Bytecodes::Code c;
|
||||||
while ((c = stream.next()) >= 0) {
|
while ((c = stream.next()) >= 0) {
|
||||||
@ -710,6 +713,7 @@ MethodData::MethodData(methodHandle method, int size, TRAPS) {
|
|||||||
post_initialize(&stream);
|
post_initialize(&stream);
|
||||||
|
|
||||||
set_size(object_size);
|
set_size(object_size);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a measure of how much mileage the method has on it.
|
// Get a measure of how much mileage the method has on it.
|
||||||
|
@ -187,31 +187,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------LRG_List---------------------------------------
|
|
||||||
// Map Node indices to Live RanGe indices.
|
|
||||||
// Array lookup in the optimized case.
|
|
||||||
class LRG_List : public ResourceObj {
|
|
||||||
friend class VMStructs;
|
|
||||||
uint _cnt, _max;
|
|
||||||
uint* _lidxs;
|
|
||||||
ReallocMark _nesting; // assertion check for reallocations
|
|
||||||
public:
|
|
||||||
LRG_List( uint max );
|
|
||||||
|
|
||||||
uint lookup( uint nidx ) const {
|
|
||||||
return _lidxs[nidx];
|
|
||||||
}
|
|
||||||
uint operator[] (uint nidx) const { return lookup(nidx); }
|
|
||||||
|
|
||||||
void map( uint nidx, uint lidx ) {
|
|
||||||
assert( nidx < _cnt, "oob" );
|
|
||||||
_lidxs[nidx] = lidx;
|
|
||||||
}
|
|
||||||
void extend( uint nidx, uint lidx );
|
|
||||||
|
|
||||||
uint Size() const { return _cnt; }
|
|
||||||
};
|
|
||||||
|
|
||||||
//------------------------------IFG--------------------------------------------
|
//------------------------------IFG--------------------------------------------
|
||||||
// InterFerence Graph
|
// InterFerence Graph
|
||||||
// An undirected graph implementation. Created with a fixed number of
|
// An undirected graph implementation. Created with a fixed number of
|
||||||
|
@ -892,7 +892,7 @@ Compile::Compile( ciEnv* ci_env,
|
|||||||
: Phase(Compiler),
|
: Phase(Compiler),
|
||||||
_env(ci_env),
|
_env(ci_env),
|
||||||
_log(ci_env->log()),
|
_log(ci_env->log()),
|
||||||
_compile_id(-1),
|
_compile_id(0),
|
||||||
_save_argument_registers(save_arg_registers),
|
_save_argument_registers(save_arg_registers),
|
||||||
_method(NULL),
|
_method(NULL),
|
||||||
_stub_name(stub_name),
|
_stub_name(stub_name),
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user